From f6b52d2ac4bfc2cf7d68aa3d75122dd31f2d7fe9 Mon Sep 17 00:00:00 2001 From: AI Redefined Inc Date: Mon, 4 Dec 2023 21:49:42 +0000 Subject: [PATCH] Deploy website - based on cc591154a56c4ef2f8565a537a9d1b526141bf23 --- 404.html | 16 +- api/.gitignore | 3 + assets/css/styles.32238c8f.css | 1 - assets/css/styles.fba6cdd5.css | 1 + assets/js/08714d8c.2b3a3d60.js | 1 + assets/js/08714d8c.8066bd98.js | 1 - assets/js/1426.0c0df919.js | 1 + assets/js/14f1d27f.df7b274f.js | 1 + assets/js/14f1d27f.e67f3f33.js | 1 - assets/js/1744.dbc8bcaa.js | 1 + assets/js/17896441.82a14470.js | 1 + assets/js/17896441.e1ad11d7.js | 1 - assets/js/180.266d3c72.js | 1819 +++++++++++++++++ assets/js/180.266d3c72.js.LICENSE.txt | 101 + assets/js/1a4e3797.2adc3808.js | 2 - assets/js/1a4e3797.2adc3808.js.LICENSE.txt | 1 - assets/js/1a4e3797.98c7b9ce.js | 2 + assets/js/1a4e3797.98c7b9ce.js.LICENSE.txt | 1 + assets/js/1ae06ce2.b025e158.js | 1 + assets/js/1b039142.34999ad0.js | 1 - assets/js/1b039142.844cbc15.js | 1 + assets/js/1be78505.88fe94d0.js | 1 + assets/js/1be78505.b5adb11b.js | 1 - assets/js/25848ff4.57f5c5cf.js | 1 - assets/js/25848ff4.82af9e63.js | 1 + assets/js/2d986b69.356337e0.js | 1 - assets/js/2d986b69.a602b553.js | 1 + assets/js/354f5e12.28413fb0.js | 1 - assets/js/354f5e12.51aa68f8.js | 1 + assets/js/3f8274eb.2403290b.js | 1 + assets/js/3f8274eb.7b2c5f8f.js | 1 - assets/js/4698.8c4037a9.js | 2 - assets/js/4698.8c4037a9.js.LICENSE.txt | 5 - assets/js/4f085710.4ae361d8.js | 1 + assets/js/4f085710.99943333.js | 1 - assets/js/50751b0a.5ac1ed00.js | 1 - assets/js/50751b0a.e8e54558.js | 1 + assets/js/61fcde8c.4dd88737.js | 1 - assets/js/61fcde8c.6d225a73.js | 1 + assets/js/6780.2e464230.js | 1 - assets/js/696a412b.30d5fb90.js | 1 - assets/js/696a412b.d894ab23.js | 1 + assets/js/6c6cf206.4874a857.js | 1 - assets/js/6c6cf206.5b4ed37f.js | 1 + assets/js/6f2832ad.a9a521bd.js | 1 + assets/js/6f2832ad.e5b5393c.js | 1 - assets/js/710eddd2.0d5614ca.js | 1 + assets/js/710eddd2.97c3fcd9.js | 1 - assets/js/76d0d1d8.322e3cf9.js | 1 + assets/js/76d0d1d8.fef871bb.js | 1 - assets/js/7a87d372.6b3c6bdb.js | 1 + assets/js/7a87d372.7e5409a8.js | 1 - assets/js/80b5be58.275e3f65.js | 1 + assets/js/80b5be58.7a80df6d.js | 1 - assets/js/85f318fb.18658faf.js | 1 - assets/js/85f318fb.fb5b0e0a.js | 1 + assets/js/8ba33b25.3073f947.js | 1 + assets/js/8ba33b25.993fc35e.js | 1 - assets/js/8f51b104.a7e302fa.js | 1 - assets/js/8f51b104.ad70d212.js | 1 + assets/js/8f68e2ce.68e819b0.js | 1 - assets/js/8f68e2ce.9a776507.js | 1 + assets/js/92a77eef.3834a1d4.js | 1 - assets/js/92a77eef.a4d602b3.js | 1 + assets/js/935f2afb.09e8e1d7.js | 1 + assets/js/935f2afb.eaa09a8c.js | 1 - assets/js/9b35c4f5.4724485f.js | 1 - assets/js/9b35c4f5.8ddc6530.js | 1 + assets/js/9b824c8f.1c11dbd9.js | 1 - assets/js/9b824c8f.ce8974a2.js | 1 + assets/js/a57d321a.60ac5400.js | 1 + assets/js/a57d321a.7b1da2dc.js | 1 - assets/js/ac5280f2.23c0bab4.js | 1 - assets/js/ac5280f2.4f4b5f86.js | 1 + assets/js/b2327a6c.23dd6cdd.js | 1 + assets/js/b2327a6c.2d13b65b.js | 1 - assets/js/c24ec994.1b981edd.js | 1 - assets/js/c24ec994.ca06e2db.js | 1 + assets/js/c377a04b.dee11c26.js | 1 - assets/js/c377a04b.f8bc1c7c.js | 1 + assets/js/c3c15305.0d717cd1.js | 1 - assets/js/c3c15305.d1d9e182.js | 1 + assets/js/c4f5d8e4.75997564.js | 1 - assets/js/c4f5d8e4.d96c9167.js | 1 + assets/js/d03751be.3d85882f.js | 1 - assets/js/d03751be.6bff62ea.js | 1 + assets/js/d04964af.19d5aef9.js | 1 + assets/js/d04964af.dad4b03c.js | 1 - assets/js/d9378b29.6db302b8.js | 1 - assets/js/d9378b29.fc93762c.js | 1 + assets/js/e848be99.7ec8f765.js | 1 + assets/js/e848be99.fe19ea8a.js | 1 - assets/js/f012f959.ad12eb4f.js | 1 - assets/js/f012f959.eebb0295.js | 1 + assets/js/fd5e6f38.00dde33b.js | 1 + assets/js/fd5e6f38.65b6ada4.js | 1 - assets/js/main.5e88352e.js | 2 + ...CENSE.txt => main.5e88352e.js.LICENSE.txt} | 0 assets/js/main.cd67fb39.js | 2 - assets/js/runtime~main.08a7e066.js | 1 - assets/js/runtime~main.6c3ff3f8.js | 1 + cogment_verse.html | 18 +- docs.html | 18 +- docs/community-channels.html | 18 +- docs/guide/core-concepts.html | 18 +- docs/guide/development-guide.html | 20 +- docs/guide/implementation-recipes.html | 16 +- .../configure-trial-from-controller.html | 16 +- .../v2-migration-guide.html | 16 +- docs/guide/tutorial.html | 16 +- docs/guide/tutorial/actors-in-cogment.html | 18 +- docs/guide/tutorial/advanced-tutorials.html | 16 +- .../advanced-tutorials/directory.html | 36 +- .../advanced-tutorials/human-player.html | 16 +- .../advanced-tutorials/web-client.html | 16 +- docs/guide/tutorial/decision-making.html | 16 +- .../tutorial/environment-in-cogment.html | 18 +- docs/guide/tutorial/setup.html | 16 +- docs/license.html | 18 +- docs/reference/cli.html | 18 +- .../cli/directory/directory-client.html | 20 +- .../cli/directory/directory-server.html | 20 +- docs/reference/cli/launch.html | 38 +- docs/reference/cli/model-registry.html | 18 +- docs/reference/cli/orchestrator.html | 18 +- docs/reference/cli/status.html | 18 +- .../trial-datastore-client.html | 16 +- .../trial-datastore-server.html | 18 +- docs/reference/cli/web-proxy.html | 18 +- docs/reference/cogment-v2-changes.html | 16 +- docs/reference/cogment-yaml.html | 16 +- docs/reference/grpc.html | 44 +- docs/reference/javascript.html | 20 +- docs/reference/parameters.html | 28 +- .../python-enterprise/installation.html | 16 +- docs/reference/python-enterprise/runner.html | 34 +- docs/reference/python.html | 22 +- docs/reference/web-proxy-api.html | 21 + index.html | 18 +- search.html | 16 +- sitemap.xml | 2 +- 141 files changed, 2382 insertions(+), 443 deletions(-) create mode 100644 api/.gitignore delete mode 100644 assets/css/styles.32238c8f.css create mode 100644 assets/css/styles.fba6cdd5.css create mode 100644 assets/js/08714d8c.2b3a3d60.js delete mode 100644 assets/js/08714d8c.8066bd98.js create mode 100644 assets/js/1426.0c0df919.js create mode 100644 assets/js/14f1d27f.df7b274f.js delete mode 100644 assets/js/14f1d27f.e67f3f33.js create mode 100644 assets/js/1744.dbc8bcaa.js create mode 100644 assets/js/17896441.82a14470.js delete mode 100644 assets/js/17896441.e1ad11d7.js create mode 100644 assets/js/180.266d3c72.js create mode 100644 assets/js/180.266d3c72.js.LICENSE.txt delete mode 100644 assets/js/1a4e3797.2adc3808.js delete mode 100644 assets/js/1a4e3797.2adc3808.js.LICENSE.txt create mode 100644 assets/js/1a4e3797.98c7b9ce.js create mode 100644 assets/js/1a4e3797.98c7b9ce.js.LICENSE.txt create mode 100644 assets/js/1ae06ce2.b025e158.js delete mode 100644 assets/js/1b039142.34999ad0.js create mode 100644 assets/js/1b039142.844cbc15.js create mode 100644 assets/js/1be78505.88fe94d0.js delete mode 100644 assets/js/1be78505.b5adb11b.js delete mode 100644 assets/js/25848ff4.57f5c5cf.js create mode 100644 assets/js/25848ff4.82af9e63.js delete mode 100644 assets/js/2d986b69.356337e0.js create mode 100644 assets/js/2d986b69.a602b553.js delete mode 100644 assets/js/354f5e12.28413fb0.js create mode 100644 assets/js/354f5e12.51aa68f8.js create mode 100644 assets/js/3f8274eb.2403290b.js delete mode 100644 assets/js/3f8274eb.7b2c5f8f.js delete mode 100644 assets/js/4698.8c4037a9.js delete mode 100644 assets/js/4698.8c4037a9.js.LICENSE.txt create mode 100644 assets/js/4f085710.4ae361d8.js delete mode 100644 assets/js/4f085710.99943333.js delete mode 100644 assets/js/50751b0a.5ac1ed00.js create mode 100644 assets/js/50751b0a.e8e54558.js delete mode 100644 assets/js/61fcde8c.4dd88737.js create mode 100644 assets/js/61fcde8c.6d225a73.js delete mode 100644 assets/js/6780.2e464230.js delete mode 100644 assets/js/696a412b.30d5fb90.js create mode 100644 assets/js/696a412b.d894ab23.js delete mode 100644 assets/js/6c6cf206.4874a857.js create mode 100644 assets/js/6c6cf206.5b4ed37f.js create mode 100644 assets/js/6f2832ad.a9a521bd.js delete mode 100644 assets/js/6f2832ad.e5b5393c.js create mode 100644 assets/js/710eddd2.0d5614ca.js delete mode 100644 assets/js/710eddd2.97c3fcd9.js create mode 100644 assets/js/76d0d1d8.322e3cf9.js delete mode 100644 assets/js/76d0d1d8.fef871bb.js create mode 100644 assets/js/7a87d372.6b3c6bdb.js delete mode 100644 assets/js/7a87d372.7e5409a8.js create mode 100644 assets/js/80b5be58.275e3f65.js delete mode 100644 assets/js/80b5be58.7a80df6d.js delete mode 100644 assets/js/85f318fb.18658faf.js create mode 100644 assets/js/85f318fb.fb5b0e0a.js create mode 100644 assets/js/8ba33b25.3073f947.js delete mode 100644 assets/js/8ba33b25.993fc35e.js delete mode 100644 assets/js/8f51b104.a7e302fa.js create mode 100644 assets/js/8f51b104.ad70d212.js delete mode 100644 assets/js/8f68e2ce.68e819b0.js create mode 100644 assets/js/8f68e2ce.9a776507.js delete mode 100644 assets/js/92a77eef.3834a1d4.js create mode 100644 assets/js/92a77eef.a4d602b3.js create mode 100644 assets/js/935f2afb.09e8e1d7.js delete mode 100644 assets/js/935f2afb.eaa09a8c.js delete mode 100644 assets/js/9b35c4f5.4724485f.js create mode 100644 assets/js/9b35c4f5.8ddc6530.js delete mode 100644 assets/js/9b824c8f.1c11dbd9.js create mode 100644 assets/js/9b824c8f.ce8974a2.js create mode 100644 assets/js/a57d321a.60ac5400.js delete mode 100644 assets/js/a57d321a.7b1da2dc.js delete mode 100644 assets/js/ac5280f2.23c0bab4.js create mode 100644 assets/js/ac5280f2.4f4b5f86.js create mode 100644 assets/js/b2327a6c.23dd6cdd.js delete mode 100644 assets/js/b2327a6c.2d13b65b.js delete mode 100644 assets/js/c24ec994.1b981edd.js create mode 100644 assets/js/c24ec994.ca06e2db.js delete mode 100644 assets/js/c377a04b.dee11c26.js create mode 100644 assets/js/c377a04b.f8bc1c7c.js delete mode 100644 assets/js/c3c15305.0d717cd1.js create mode 100644 assets/js/c3c15305.d1d9e182.js delete mode 100644 assets/js/c4f5d8e4.75997564.js create mode 100644 assets/js/c4f5d8e4.d96c9167.js delete mode 100644 assets/js/d03751be.3d85882f.js create mode 100644 assets/js/d03751be.6bff62ea.js create mode 100644 assets/js/d04964af.19d5aef9.js delete mode 100644 assets/js/d04964af.dad4b03c.js delete mode 100644 assets/js/d9378b29.6db302b8.js create mode 100644 assets/js/d9378b29.fc93762c.js create mode 100644 assets/js/e848be99.7ec8f765.js delete mode 100644 assets/js/e848be99.fe19ea8a.js delete mode 100644 assets/js/f012f959.ad12eb4f.js create mode 100644 assets/js/f012f959.eebb0295.js create mode 100644 assets/js/fd5e6f38.00dde33b.js delete mode 100644 assets/js/fd5e6f38.65b6ada4.js create mode 100644 assets/js/main.5e88352e.js rename assets/js/{main.cd67fb39.js.LICENSE.txt => main.5e88352e.js.LICENSE.txt} (100%) delete mode 100644 assets/js/main.cd67fb39.js delete mode 100644 assets/js/runtime~main.08a7e066.js create mode 100644 assets/js/runtime~main.6c3ff3f8.js create mode 100644 docs/reference/web-proxy-api.html diff --git a/404.html b/404.html index 466a3c2..8ce1f96 100644 --- a/404.html +++ b/404.html @@ -1,21 +1,21 @@ - + - + Page Not Found | Cogment - - - + + +
-
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- - +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

+ + \ No newline at end of file diff --git a/api/.gitignore b/api/.gitignore new file mode 100644 index 0000000..e802b47 --- /dev/null +++ b/api/.gitignore @@ -0,0 +1,3 @@ +# This directory is used as an output for temporary file, ignore everything +* +!.gitignore diff --git a/assets/css/styles.32238c8f.css b/assets/css/styles.32238c8f.css deleted file mode 100644 index f76915b..0000000 --- a/assets/css/styles.32238c8f.css +++ /dev/null @@ -1 +0,0 @@ -.col,.container{padding:0 var(--ifm-spacing-horizontal);width:100%}.markdown>h2,.markdown>h3,.markdown>h4,.markdown>h5,.markdown>h6{margin-bottom:calc(var(--ifm-heading-vertical-rhythm-bottom)*var(--ifm-leading))}.markdown li,body{word-wrap:break-word}body,ol ol,ol ul,ul ol,ul ul{margin:0}pre,table{overflow:auto}blockquote,pre{margin:0 0 var(--ifm-spacing-vertical)}.breadcrumbs__link,.button{transition-timing-function:var(--ifm-transition-timing-default)}.button,.hash-link{-webkit-user-select:none}.button,code{vertical-align:middle}.button--outline.button--active,.button--outline:active,.button--outline:hover,:root{--ifm-button-color:var(--ifm-font-color-base-inverse)}.menu__link:hover,a{transition:color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.navbar--dark,:root{--ifm-navbar-link-hover-color:var(--ifm-color-primary)}.menu,.navbar-sidebar{overflow-x:hidden}:root,html[data-theme=dark]{--ifm-color-emphasis-500:var(--ifm-color-gray-500)}.fa-beat,.fa-beat-fade,.fa-fade,.fa-flip{animation-direction:var(--fa-animation-direction,normal);animation-duration:var(--fa-animation-duration,1s);animation-delay:var(--fa-animation-delay,0)}.fa-beat,.fa-beat-fade,.fa-fade,.fa-flip,.fa-spin{animation-delay:var(--fa-animation-delay,0)}.toggleButton_gllP,html{-webkit-tap-highlight-color:transparent}*,.DocSearch-Container,.DocSearch-Container *,.fa-layers-counter{box-sizing:border-box}:root{--ifm-color-scheme:light;--ifm-dark-value:10%;--ifm-darker-value:15%;--ifm-darkest-value:30%;--ifm-light-value:15%;--ifm-lighter-value:30%;--ifm-lightest-value:50%;--ifm-contrast-background-value:90%;--ifm-contrast-foreground-value:70%;--ifm-contrast-background-dark-value:70%;--ifm-contrast-foreground-dark-value:90%;--ifm-color-primary:#3578e5;--ifm-color-secondary:#ebedf0;--ifm-color-success:#00a400;--ifm-color-info:#54c7ec;--ifm-color-warning:#ffba00;--ifm-color-danger:#fa383e;--ifm-color-primary-dark:#306cce;--ifm-color-primary-darker:#2d66c3;--ifm-color-primary-darkest:#2554a0;--ifm-color-primary-light:#538ce9;--ifm-color-primary-lighter:#72a1ed;--ifm-color-primary-lightest:#9abcf2;--ifm-color-primary-contrast-background:#ebf2fc;--ifm-color-primary-contrast-foreground:#102445;--ifm-color-secondary-dark:#d4d5d8;--ifm-color-secondary-darker:#c8c9cc;--ifm-color-secondary-darkest:#a4a6a8;--ifm-color-secondary-light:#eef0f2;--ifm-color-secondary-lighter:#f1f2f5;--ifm-color-secondary-lightest:#f5f6f8;--ifm-color-secondary-contrast-background:#fdfdfe;--ifm-color-secondary-contrast-foreground:#474748;--ifm-color-success-dark:#009400;--ifm-color-success-darker:#008b00;--ifm-color-success-darkest:#007300;--ifm-color-success-light:#26b226;--ifm-color-success-lighter:#4dbf4d;--ifm-color-success-lightest:#80d280;--ifm-color-success-contrast-background:#e6f6e6;--ifm-color-success-contrast-foreground:#003100;--ifm-color-info-dark:#4cb3d4;--ifm-color-info-darker:#47a9c9;--ifm-color-info-darkest:#3b8ba5;--ifm-color-info-light:#6ecfef;--ifm-color-info-lighter:#87d8f2;--ifm-color-info-lightest:#aae3f6;--ifm-color-info-contrast-background:#eef9fd;--ifm-color-info-contrast-foreground:#193c47;--ifm-color-warning-dark:#e6a700;--ifm-color-warning-darker:#d99e00;--ifm-color-warning-darkest:#b38200;--ifm-color-warning-light:#ffc426;--ifm-color-warning-lighter:#ffcf4d;--ifm-color-warning-lightest:#ffdd80;--ifm-color-warning-contrast-background:#fff8e6;--ifm-color-warning-contrast-foreground:#4d3800;--ifm-color-danger-dark:#e13238;--ifm-color-danger-darker:#d53035;--ifm-color-danger-darkest:#af272b;--ifm-color-danger-light:#fb565b;--ifm-color-danger-lighter:#fb7478;--ifm-color-danger-lightest:#fd9c9f;--ifm-color-danger-contrast-background:#ffebec;--ifm-color-danger-contrast-foreground:#4b1113;--ifm-color-white:#fff;--ifm-color-black:#000;--ifm-color-gray-0:var(--ifm-color-white);--ifm-color-gray-100:#f5f6f7;--ifm-color-gray-200:#ebedf0;--ifm-color-gray-300:#dadde1;--ifm-color-gray-400:#ccd0d5;--ifm-color-gray-500:#bec3c9;--ifm-color-gray-600:#8d949e;--ifm-color-gray-700:#606770;--ifm-color-gray-800:#444950;--ifm-color-gray-900:#1c1e21;--ifm-color-gray-1000:var(--ifm-color-black);--ifm-color-emphasis-0:var(--ifm-color-gray-0);--ifm-color-emphasis-100:var(--ifm-color-gray-100);--ifm-color-emphasis-200:var(--ifm-color-gray-200);--ifm-color-emphasis-300:var(--ifm-color-gray-300);--ifm-color-emphasis-400:var(--ifm-color-gray-400);--ifm-color-emphasis-600:var(--ifm-color-gray-600);--ifm-color-emphasis-700:var(--ifm-color-gray-700);--ifm-color-emphasis-800:var(--ifm-color-gray-800);--ifm-color-emphasis-900:var(--ifm-color-gray-900);--ifm-color-emphasis-1000:var(--ifm-color-gray-1000);--ifm-color-content:var(--ifm-color-emphasis-900);--ifm-color-content-inverse:var(--ifm-color-emphasis-0);--ifm-color-content-secondary:#525860;--ifm-background-color:#0000;--ifm-background-surface-color:var(--ifm-color-content-inverse);--ifm-global-border-width:1px;--ifm-global-radius:0.4rem;--ifm-hover-overlay:#0000000d;--ifm-font-color-base:var(--ifm-color-content);--ifm-font-color-base-inverse:var(--ifm-color-content-inverse);--ifm-font-color-secondary:var(--ifm-color-content-secondary);--ifm-font-family-base:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ifm-font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--ifm-font-size-base:100%;--ifm-font-weight-light:300;--ifm-font-weight-normal:400;--ifm-font-weight-semibold:500;--ifm-font-weight-bold:700;--ifm-font-weight-base:var(--ifm-font-weight-normal);--ifm-line-height-base:1.65;--ifm-global-spacing:1rem;--ifm-spacing-vertical:var(--ifm-global-spacing);--ifm-spacing-horizontal:var(--ifm-global-spacing);--ifm-transition-fast:200ms;--ifm-transition-slow:400ms;--ifm-transition-timing-default:cubic-bezier(0.08,0.52,0.52,1);--ifm-global-shadow-lw:0 1px 2px 0 #0000001a;--ifm-global-shadow-md:0 5px 40px #0003;--ifm-global-shadow-tl:0 12px 28px 0 #0003,0 2px 4px 0 #0000001a;--ifm-z-index-dropdown:100;--ifm-z-index-fixed:200;--ifm-z-index-overlay:400;--ifm-container-width:1140px;--ifm-container-width-xl:1320px;--ifm-code-background:#f6f7f8;--ifm-code-border-radius:var(--ifm-global-radius);--ifm-code-font-size:90%;--ifm-code-padding-horizontal:0.1rem;--ifm-code-padding-vertical:0.1rem;--ifm-pre-background:var(--ifm-code-background);--ifm-pre-border-radius:var(--ifm-code-border-radius);--ifm-pre-color:inherit;--ifm-pre-line-height:1.45;--ifm-pre-padding:1rem;--ifm-heading-color:inherit;--ifm-heading-margin-top:0;--ifm-heading-margin-bottom:var(--ifm-spacing-vertical);--ifm-heading-font-family:var(--ifm-font-family-base);--ifm-heading-font-weight:var(--ifm-font-weight-bold);--ifm-heading-line-height:1.25;--ifm-h1-font-size:2rem;--ifm-h2-font-size:1.5rem;--ifm-h3-font-size:1.25rem;--ifm-h4-font-size:1rem;--ifm-h5-font-size:0.875rem;--ifm-h6-font-size:0.85rem;--ifm-image-alignment-padding:1.25rem;--ifm-leading-desktop:1.25;--ifm-leading:calc(var(--ifm-leading-desktop)*1rem);--ifm-list-left-padding:2rem;--ifm-list-margin:1rem;--ifm-list-item-margin:0.25rem;--ifm-list-paragraph-margin:1rem;--ifm-table-cell-padding:0.75rem;--ifm-table-background:#0000;--ifm-table-stripe-background:#00000008;--ifm-table-border-width:1px;--ifm-table-border-color:var(--ifm-color-emphasis-300);--ifm-table-head-background:inherit;--ifm-table-head-color:inherit;--ifm-table-head-font-weight:var(--ifm-font-weight-bold);--ifm-table-cell-color:inherit;--ifm-link-color:var(--ifm-color-primary);--ifm-link-decoration:none;--ifm-link-hover-color:var(--ifm-link-color);--ifm-link-hover-decoration:underline;--ifm-paragraph-margin-bottom:var(--ifm-leading);--ifm-blockquote-font-size:var(--ifm-font-size-base);--ifm-blockquote-border-left-width:2px;--ifm-blockquote-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-blockquote-padding-vertical:0;--ifm-blockquote-shadow:none;--ifm-blockquote-color:var(--ifm-color-emphasis-800);--ifm-blockquote-border-color:var(--ifm-color-emphasis-300);--ifm-hr-background-color:var(--ifm-color-emphasis-500);--ifm-hr-height:1px;--ifm-hr-margin-vertical:1.5rem;--ifm-scrollbar-size:7px;--ifm-scrollbar-track-background-color:#f1f1f1;--ifm-scrollbar-thumb-background-color:silver;--ifm-scrollbar-thumb-hover-background-color:#a7a7a7;--ifm-alert-background-color:inherit;--ifm-alert-border-color:inherit;--ifm-alert-border-radius:var(--ifm-global-radius);--ifm-alert-border-width:0px;--ifm-alert-border-left-width:5px;--ifm-alert-color:var(--ifm-font-color-base);--ifm-alert-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-alert-padding-vertical:var(--ifm-spacing-vertical);--ifm-alert-shadow:var(--ifm-global-shadow-lw);--ifm-avatar-intro-margin:1rem;--ifm-avatar-intro-alignment:inherit;--ifm-avatar-photo-size:3rem;--ifm-badge-background-color:inherit;--ifm-badge-border-color:inherit;--ifm-badge-border-radius:var(--ifm-global-radius);--ifm-badge-border-width:var(--ifm-global-border-width);--ifm-badge-color:var(--ifm-color-white);--ifm-badge-padding-horizontal:calc(var(--ifm-spacing-horizontal)*0.5);--ifm-badge-padding-vertical:calc(var(--ifm-spacing-vertical)*0.25);--ifm-breadcrumb-border-radius:1.5rem;--ifm-breadcrumb-spacing:0.5rem;--ifm-breadcrumb-color-active:var(--ifm-color-primary);--ifm-breadcrumb-item-background-active:var(--ifm-hover-overlay);--ifm-breadcrumb-padding-horizontal:0.8rem;--ifm-breadcrumb-padding-vertical:0.4rem;--ifm-breadcrumb-size-multiplier:1;--ifm-breadcrumb-separator:url('data:image/svg+xml;utf8,');--ifm-breadcrumb-separator-filter:none;--ifm-breadcrumb-separator-size:0.5rem;--ifm-breadcrumb-separator-size-multiplier:1.25;--ifm-button-background-color:inherit;--ifm-button-border-color:var(--ifm-button-background-color);--ifm-button-border-width:var(--ifm-global-border-width);--ifm-button-font-weight:var(--ifm-font-weight-bold);--ifm-button-padding-horizontal:1.5rem;--ifm-button-padding-vertical:0.375rem;--ifm-button-size-multiplier:1;--ifm-button-transition-duration:var(--ifm-transition-fast);--ifm-button-border-radius:calc(var(--ifm-global-radius)*var(--ifm-button-size-multiplier));--ifm-button-group-spacing:2px;--ifm-card-background-color:var(--ifm-background-surface-color);--ifm-card-border-radius:calc(var(--ifm-global-radius)*2);--ifm-card-horizontal-spacing:var(--ifm-global-spacing);--ifm-card-vertical-spacing:var(--ifm-global-spacing);--ifm-toc-border-color:var(--ifm-color-emphasis-300);--ifm-toc-link-color:var(--ifm-color-content-secondary);--ifm-toc-padding-vertical:0.5rem;--ifm-toc-padding-horizontal:0.5rem;--ifm-dropdown-background-color:var(--ifm-background-surface-color);--ifm-dropdown-font-weight:var(--ifm-font-weight-semibold);--ifm-dropdown-link-color:var(--ifm-font-color-base);--ifm-dropdown-hover-background-color:var(--ifm-hover-overlay);--ifm-footer-background-color:var(--ifm-color-emphasis-100);--ifm-footer-color:inherit;--ifm-footer-link-color:var(--ifm-color-emphasis-700);--ifm-footer-link-hover-color:var(--ifm-color-primary);--ifm-footer-link-horizontal-spacing:0.5rem;--ifm-footer-padding-horizontal:calc(var(--ifm-spacing-horizontal)*2);--ifm-footer-padding-vertical:calc(var(--ifm-spacing-vertical)*2);--ifm-footer-title-color:inherit;--ifm-footer-logo-max-width:min(30rem,90vw);--ifm-hero-background-color:var(--ifm-background-surface-color);--ifm-hero-text-color:var(--ifm-color-emphasis-800);--ifm-menu-color:var(--ifm-color-emphasis-700);--ifm-menu-color-active:var(--ifm-color-primary);--ifm-menu-color-background-active:var(--ifm-hover-overlay);--ifm-menu-color-background-hover:var(--ifm-hover-overlay);--ifm-menu-link-padding-horizontal:0.75rem;--ifm-menu-link-padding-vertical:0.375rem;--ifm-menu-link-sublist-icon:url('data:image/svg+xml;utf8,');--ifm-menu-link-sublist-icon-filter:none;--ifm-navbar-background-color:var(--ifm-background-surface-color);--ifm-navbar-height:3.75rem;--ifm-navbar-item-padding-horizontal:0.75rem;--ifm-navbar-item-padding-vertical:0.25rem;--ifm-navbar-link-color:var(--ifm-font-color-base);--ifm-navbar-link-active-color:var(--ifm-link-color);--ifm-navbar-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-navbar-padding-vertical:calc(var(--ifm-spacing-vertical)*0.5);--ifm-navbar-shadow:var(--ifm-global-shadow-lw);--ifm-navbar-search-input-background-color:var(--ifm-color-emphasis-200);--ifm-navbar-search-input-color:var(--ifm-color-emphasis-800);--ifm-navbar-search-input-placeholder-color:var(--ifm-color-emphasis-500);--ifm-navbar-search-input-icon:url('data:image/svg+xml;utf8,');--ifm-navbar-sidebar-width:83vw;--ifm-pagination-border-radius:var(--ifm-global-radius);--ifm-pagination-color-active:var(--ifm-color-primary);--ifm-pagination-font-size:1rem;--ifm-pagination-item-active-background:var(--ifm-hover-overlay);--ifm-pagination-page-spacing:0.2em;--ifm-pagination-padding-horizontal:calc(var(--ifm-spacing-horizontal)*1);--ifm-pagination-padding-vertical:calc(var(--ifm-spacing-vertical)*0.25);--ifm-pagination-nav-border-radius:var(--ifm-global-radius);--ifm-pagination-nav-color-hover:var(--ifm-color-primary);--ifm-pills-color-active:var(--ifm-color-primary);--ifm-pills-color-background-active:var(--ifm-hover-overlay);--ifm-pills-spacing:0.125rem;--ifm-tabs-color:var(--ifm-font-color-secondary);--ifm-tabs-color-active:var(--ifm-color-primary);--ifm-tabs-color-active-border:var(--ifm-tabs-color-active);--ifm-tabs-padding-horizontal:1rem;--ifm-tabs-padding-vertical:1rem}.badge--danger,.badge--info,.badge--primary,.badge--secondary,.badge--success,.badge--warning{--ifm-badge-border-color:var(--ifm-badge-background-color)}.button--link,.button--outline{--ifm-button-background-color:#0000}html{-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;text-size-adjust:100%;background-color:var(--ifm-background-color);color:var(--ifm-font-color-base);color-scheme:var(--ifm-color-scheme);font:var(--ifm-font-size-base)/var(--ifm-line-height-base) var(--ifm-font-family-base);text-rendering:optimizelegibility}iframe{border:0;color-scheme:auto}.container{margin:0 auto;max-width:var(--ifm-container-width)}.container--fluid{max-width:inherit}.row{display:flex;flex-wrap:wrap;margin:0 calc(var(--ifm-spacing-horizontal)*-1)}.margin-bottom--none,.margin-vert--none,.markdown>:last-child{margin-bottom:0!important}.margin-top--none,.margin-vert--none,.tabItem_LNqP{margin-top:0!important}.row--no-gutters{margin-left:0;margin-right:0}.margin-horiz--none,.margin-right--none{margin-right:0!important}.row--no-gutters>.col{padding-left:0;padding-right:0}.row--align-top{align-items:flex-start}.row--align-bottom{align-items:flex-end}.menuExternalLink_NmtK,.row--align-center{align-items:center}.row--align-stretch{align-items:stretch}.row--align-baseline{align-items:baseline}.col{--ifm-col-width:100%;flex:1 0;margin-left:0;max-width:var(--ifm-col-width)}.padding-bottom--none,.padding-vert--none{padding-bottom:0!important}.padding-top--none,.padding-vert--none{padding-top:0!important}.padding-horiz--none,.padding-left--none{padding-left:0!important}.padding-horiz--none,.padding-right--none{padding-right:0!important}.col[class*=col--]{flex:0 0 var(--ifm-col-width)}.col--1{--ifm-col-width:8.33333%}.col--offset-1{margin-left:8.33333%}.col--2{--ifm-col-width:16.66667%}.col--offset-2{margin-left:16.66667%}.col--3{--ifm-col-width:25%}.col--offset-3{margin-left:25%}.col--4{--ifm-col-width:33.33333%}.col--offset-4{margin-left:33.33333%}.col--5{--ifm-col-width:41.66667%}.col--offset-5{margin-left:41.66667%}.col--6{--ifm-col-width:50%}.col--offset-6{margin-left:50%}.col--7{--ifm-col-width:58.33333%}.col--offset-7{margin-left:58.33333%}.col--8{--ifm-col-width:66.66667%}.col--offset-8{margin-left:66.66667%}.col--9{--ifm-col-width:75%}.col--offset-9{margin-left:75%}.col--10{--ifm-col-width:83.33333%}.col--offset-10{margin-left:83.33333%}.col--11{--ifm-col-width:91.66667%}.col--offset-11{margin-left:91.66667%}.col--12{--ifm-col-width:100%}.col--offset-12{margin-left:100%}.margin-horiz--none,.margin-left--none{margin-left:0!important}.margin--none{margin:0!important}.margin-bottom--xs,.margin-vert--xs{margin-bottom:.25rem!important}.margin-top--xs,.margin-vert--xs{margin-top:.25rem!important}.margin-horiz--xs,.margin-left--xs{margin-left:.25rem!important}.margin-horiz--xs,.margin-right--xs{margin-right:.25rem!important}.margin--xs{margin:.25rem!important}.margin-bottom--sm,.margin-vert--sm{margin-bottom:.5rem!important}.margin-top--sm,.margin-vert--sm{margin-top:.5rem!important}.margin-horiz--sm,.margin-left--sm{margin-left:.5rem!important}.margin-horiz--sm,.margin-right--sm{margin-right:.5rem!important}.margin--sm{margin:.5rem!important}.margin-bottom--md,.margin-vert--md{margin-bottom:1rem!important}.margin-top--md,.margin-vert--md{margin-top:1rem!important}.margin-horiz--md,.margin-left--md{margin-left:1rem!important}.margin-horiz--md,.margin-right--md{margin-right:1rem!important}.margin--md{margin:1rem!important}.margin-bottom--lg,.margin-vert--lg{margin-bottom:2rem!important}.margin-top--lg,.margin-vert--lg{margin-top:2rem!important}.margin-horiz--lg,.margin-left--lg{margin-left:2rem!important}.margin-horiz--lg,.margin-right--lg{margin-right:2rem!important}.margin--lg{margin:2rem!important}.margin-bottom--xl,.margin-vert--xl{margin-bottom:5rem!important}.margin-top--xl,.margin-vert--xl{margin-top:5rem!important}.margin-horiz--xl,.margin-left--xl{margin-left:5rem!important}.margin-horiz--xl,.margin-right--xl{margin-right:5rem!important}.margin--xl{margin:5rem!important}.padding--none{padding:0!important}.padding-bottom--xs,.padding-vert--xs{padding-bottom:.25rem!important}.padding-top--xs,.padding-vert--xs{padding-top:.25rem!important}.padding-horiz--xs,.padding-left--xs{padding-left:.25rem!important}.padding-horiz--xs,.padding-right--xs{padding-right:.25rem!important}.padding--xs{padding:.25rem!important}.padding-bottom--sm,.padding-vert--sm{padding-bottom:.5rem!important}.padding-top--sm,.padding-vert--sm{padding-top:.5rem!important}.padding-horiz--sm,.padding-left--sm{padding-left:.5rem!important}.padding-horiz--sm,.padding-right--sm{padding-right:.5rem!important}.padding--sm{padding:.5rem!important}.padding-bottom--md,.padding-vert--md{padding-bottom:1rem!important}.padding-top--md,.padding-vert--md{padding-top:1rem!important}.padding-horiz--md,.padding-left--md{padding-left:1rem!important}.padding-horiz--md,.padding-right--md{padding-right:1rem!important}.padding--md{padding:1rem!important}.padding-bottom--lg,.padding-vert--lg{padding-bottom:2rem!important}.padding-top--lg,.padding-vert--lg{padding-top:2rem!important}.padding-horiz--lg,.padding-left--lg{padding-left:2rem!important}.padding-horiz--lg,.padding-right--lg{padding-right:2rem!important}.padding--lg{padding:2rem!important}.padding-bottom--xl,.padding-vert--xl{padding-bottom:5rem!important}.padding-top--xl,.padding-vert--xl{padding-top:5rem!important}.padding-horiz--xl,.padding-left--xl{padding-left:5rem!important}.padding-horiz--xl,.padding-right--xl{padding-right:5rem!important}.padding--xl{padding:5rem!important}code{background-color:var(--ifm-code-background);border:.1rem solid #0000001a;border-radius:var(--ifm-code-border-radius);font-family:var(--ifm-font-family-monospace);font-size:var(--ifm-code-font-size);padding:var(--ifm-code-padding-vertical) var(--ifm-code-padding-horizontal)}a code{color:inherit}pre{background-color:var(--ifm-pre-background);border-radius:var(--ifm-pre-border-radius);color:var(--ifm-pre-color);font:var(--ifm-code-font-size)/var(--ifm-pre-line-height) var(--ifm-font-family-monospace);padding:var(--ifm-pre-padding)}pre code{background-color:initial;border:none;font-size:100%;line-height:inherit;padding:0}kbd{background-color:var(--ifm-color-emphasis-0);border:1px solid var(--ifm-color-emphasis-400);border-radius:.2rem;box-shadow:inset 0 -1px 0 var(--ifm-color-emphasis-400);color:var(--ifm-color-emphasis-800);font:80% var(--ifm-font-family-monospace);padding:.15rem .3rem}h1,h2,h3,h4,h5,h6{color:var(--ifm-heading-color);font-family:var(--ifm-heading-font-family);font-weight:var(--ifm-heading-font-weight);line-height:var(--ifm-heading-line-height);margin:var(--ifm-heading-margin-top) 0 var(--ifm-heading-margin-bottom) 0}h1{font-size:var(--ifm-h1-font-size)}h2{font-size:var(--ifm-h2-font-size)}h3{font-size:var(--ifm-h3-font-size)}h4{font-size:var(--ifm-h4-font-size)}h5{font-size:var(--ifm-h5-font-size)}h6{font-size:var(--ifm-h6-font-size)}img{max-width:100%}img[align=right]{padding-left:var(--image-alignment-padding)}img[align=left]{padding-right:var(--image-alignment-padding)}.markdown{--ifm-h1-vertical-rhythm-top:3;--ifm-h2-vertical-rhythm-top:2;--ifm-h3-vertical-rhythm-top:1.5;--ifm-heading-vertical-rhythm-top:1.25;--ifm-h1-vertical-rhythm-bottom:1.25;--ifm-heading-vertical-rhythm-bottom:1}.markdown:after,.markdown:before{content:"";display:table}.markdown:after{clear:both}.markdown h1:first-child{--ifm-h1-font-size:3rem;margin-bottom:calc(var(--ifm-h1-vertical-rhythm-bottom)*var(--ifm-leading))}.markdown>h2{--ifm-h2-font-size:2rem;margin-top:calc(var(--ifm-h2-vertical-rhythm-top)*var(--ifm-leading))}.markdown>h3{--ifm-h3-font-size:1.5rem;margin-top:calc(var(--ifm-h3-vertical-rhythm-top)*var(--ifm-leading))}.markdown>h4,.markdown>h5,.markdown>h6{margin-top:calc(var(--ifm-heading-vertical-rhythm-top)*var(--ifm-leading))}.markdown>p,.markdown>pre,.markdown>ul,.tabList__CuJ{margin-bottom:var(--ifm-leading)}.markdown li>p{margin-top:var(--ifm-list-paragraph-margin)}.markdown li+li{margin-top:var(--ifm-list-item-margin)}ol,ul{margin:0 0 var(--ifm-list-margin);padding-left:var(--ifm-list-left-padding)}ol ol,ul ol{list-style-type:lower-roman}ol ol ol,ol ul ol,ul ol ol,ul ul ol{list-style-type:lower-alpha}table{border-collapse:collapse;display:block;margin-bottom:var(--ifm-spacing-vertical)}table thead tr{border-bottom:2px solid var(--ifm-table-border-color)}table thead,table tr:nth-child(2n){background-color:var(--ifm-table-stripe-background)}table tr{background-color:var(--ifm-table-background);border-top:var(--ifm-table-border-width) solid var(--ifm-table-border-color)}table td,table th{border:var(--ifm-table-border-width) solid var(--ifm-table-border-color);padding:var(--ifm-table-cell-padding)}table th{background-color:var(--ifm-table-head-background);color:var(--ifm-table-head-color);font-weight:var(--ifm-table-head-font-weight)}table td{color:var(--ifm-table-cell-color)}strong{font-weight:var(--ifm-font-weight-bold)}a{color:var(--ifm-link-color);text-decoration:var(--ifm-link-decoration)}a:hover{color:var(--ifm-link-hover-color);text-decoration:var(--ifm-link-hover-decoration)}.button:hover,.text--no-decoration,.text--no-decoration:hover,a:not([href]){text-decoration:none}p{margin:0 0 var(--ifm-paragraph-margin-bottom)}blockquote{border-left:var(--ifm-blockquote-border-left-width) solid var(--ifm-blockquote-border-color);box-shadow:var(--ifm-blockquote-shadow);color:var(--ifm-blockquote-color);font-size:var(--ifm-blockquote-font-size);padding:var(--ifm-blockquote-padding-vertical) var(--ifm-blockquote-padding-horizontal)}blockquote>:first-child{margin-top:0}blockquote>:last-child{margin-bottom:0}hr{background-color:var(--ifm-hr-background-color);border:0;height:var(--ifm-hr-height);margin:var(--ifm-hr-margin-vertical) 0}.shadow--lw{box-shadow:var(--ifm-global-shadow-lw)!important}.shadow--md{box-shadow:var(--ifm-global-shadow-md)!important}.shadow--tl{box-shadow:var(--ifm-global-shadow-tl)!important}.text--primary,.wordWrapButtonEnabled_EoeP .wordWrapButtonIcon_Bwma{color:var(--ifm-color-primary)}.text--secondary{color:var(--ifm-color-secondary)}.text--success{color:var(--ifm-color-success)}.text--info{color:var(--ifm-color-info)}.text--warning{color:var(--ifm-color-warning)}.text--danger{color:var(--ifm-color-danger)}.text--center{text-align:center}.text--left{text-align:left}.text--justify{text-align:justify}.text--right{text-align:right}.text--capitalize{text-transform:capitalize}.text--lowercase{text-transform:lowercase}.admonitionHeading_tbUL,.alert__heading,.navbar,.text--uppercase{text-transform:uppercase}.text--light{font-weight:var(--ifm-font-weight-light)}.text--normal{font-weight:var(--ifm-font-weight-normal)}.text--semibold{font-weight:var(--ifm-font-weight-semibold)}.text--bold{font-weight:var(--ifm-font-weight-bold)}.text--italic{font-style:italic}.text--truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text--break{word-wrap:break-word!important;word-break:break-word!important}.clean-btn{background:none;border:none;color:inherit;cursor:pointer;font-family:inherit;padding:0}.alert,.alert .close{color:var(--ifm-alert-foreground-color)}.clean-list{list-style:none;padding-left:0}.alert--primary{--ifm-alert-background-color:var(--ifm-color-primary-contrast-background);--ifm-alert-background-color-highlight:#3578e526;--ifm-alert-foreground-color:var(--ifm-color-primary-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-primary-dark)}.alert--secondary{--ifm-alert-background-color:var(--ifm-color-secondary-contrast-background);--ifm-alert-background-color-highlight:#ebedf026;--ifm-alert-foreground-color:var(--ifm-color-secondary-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-secondary-dark)}.alert--success{--ifm-alert-background-color:var(--ifm-color-success-contrast-background);--ifm-alert-background-color-highlight:#00a40026;--ifm-alert-foreground-color:var(--ifm-color-success-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-success-dark)}.alert--info{--ifm-alert-background-color:var(--ifm-color-info-contrast-background);--ifm-alert-background-color-highlight:#54c7ec26;--ifm-alert-foreground-color:var(--ifm-color-info-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-info-dark)}.alert--warning{--ifm-alert-background-color:var(--ifm-color-warning-contrast-background);--ifm-alert-background-color-highlight:#ffba0026;--ifm-alert-foreground-color:var(--ifm-color-warning-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-warning-dark)}.alert--danger{--ifm-alert-background-color:var(--ifm-color-danger-contrast-background);--ifm-alert-background-color-highlight:#fa383e26;--ifm-alert-foreground-color:var(--ifm-color-danger-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-danger-dark)}.alert{--ifm-code-background:var(--ifm-alert-background-color-highlight);--ifm-link-color:var(--ifm-alert-foreground-color);--ifm-link-hover-color:var(--ifm-alert-foreground-color);--ifm-link-decoration:underline;--ifm-tabs-color:var(--ifm-alert-foreground-color);--ifm-tabs-color-active:var(--ifm-alert-foreground-color);--ifm-tabs-color-active-border:var(--ifm-alert-border-color);background-color:var(--ifm-alert-background-color);border:var(--ifm-alert-border-width) solid var(--ifm-alert-border-color);border-left-width:var(--ifm-alert-border-left-width);border-radius:var(--ifm-alert-border-radius);box-shadow:var(--ifm-alert-shadow);padding:var(--ifm-alert-padding-vertical) var(--ifm-alert-padding-horizontal)}.alert__heading{align-items:center;display:flex;font:700 var(--ifm-h5-font-size)/var(--ifm-heading-line-height) var(--ifm-heading-font-family);margin-bottom:.5rem}.alert__icon{display:inline-flex;margin-right:.4em}.alert__icon svg{fill:var(--ifm-alert-foreground-color);stroke:var(--ifm-alert-foreground-color);stroke-width:0}.alert .close{margin:calc(var(--ifm-alert-padding-vertical)*-1) calc(var(--ifm-alert-padding-horizontal)*-1) 0 0;opacity:.75}.alert .close:focus,.alert .close:hover{opacity:1}.alert a{text-decoration-color:var(--ifm-alert-border-color)}.alert a:hover{text-decoration-thickness:2px}.avatar{column-gap:var(--ifm-avatar-intro-margin);display:flex}.avatar__photo{border-radius:50%;display:block;height:var(--ifm-avatar-photo-size);overflow:hidden;width:var(--ifm-avatar-photo-size)}.card--full-height,.navbar__logo img,body,html{height:100%}.avatar__photo--sm{--ifm-avatar-photo-size:2rem}.avatar__photo--lg{--ifm-avatar-photo-size:4rem}.avatar__photo--xl{--ifm-avatar-photo-size:6rem}.avatar__intro{display:flex;flex:1 1;flex-direction:column;justify-content:center;text-align:var(--ifm-avatar-intro-alignment)}.badge,.breadcrumbs__item,.breadcrumbs__link,.button,.dropdown>.navbar__link:after{display:inline-block}.avatar__name{font:700 var(--ifm-h4-font-size)/var(--ifm-heading-line-height) var(--ifm-font-family-base)}.avatar__subtitle{margin-top:.25rem}.avatar--vertical{--ifm-avatar-intro-alignment:center;--ifm-avatar-intro-margin:0.5rem;align-items:center;flex-direction:column}.badge{background-color:var(--ifm-badge-background-color);border:var(--ifm-badge-border-width) solid var(--ifm-badge-border-color);border-radius:var(--ifm-badge-border-radius);color:var(--ifm-badge-color);font-size:75%;font-weight:var(--ifm-font-weight-bold);line-height:1;padding:var(--ifm-badge-padding-vertical) var(--ifm-badge-padding-horizontal)}.badge--primary{--ifm-badge-background-color:var(--ifm-color-primary)}.badge--secondary{--ifm-badge-background-color:var(--ifm-color-secondary);color:var(--ifm-color-black)}.breadcrumbs__link,.button.button--secondary.button--outline:not(.button--active):not(:hover){color:var(--ifm-font-color-base)}.badge--success{--ifm-badge-background-color:var(--ifm-color-success)}.badge--info{--ifm-badge-background-color:var(--ifm-color-info)}.badge--warning{--ifm-badge-background-color:var(--ifm-color-warning)}.badge--danger{--ifm-badge-background-color:var(--ifm-color-danger)}.breadcrumbs{margin-bottom:0;padding-left:0}.breadcrumbs__item:not(:last-child):after{background:var(--ifm-breadcrumb-separator) center;content:" ";display:inline-block;filter:var(--ifm-breadcrumb-separator-filter);height:calc(var(--ifm-breadcrumb-separator-size)*var(--ifm-breadcrumb-size-multiplier)*var(--ifm-breadcrumb-separator-size-multiplier));margin:0 var(--ifm-breadcrumb-spacing);opacity:.5;width:calc(var(--ifm-breadcrumb-separator-size)*var(--ifm-breadcrumb-size-multiplier)*var(--ifm-breadcrumb-separator-size-multiplier))}.breadcrumbs__item--active .breadcrumbs__link{background:var(--ifm-breadcrumb-item-background-active);color:var(--ifm-breadcrumb-color-active)}.breadcrumbs__link{border-radius:var(--ifm-breadcrumb-border-radius);font-size:calc(1rem*var(--ifm-breadcrumb-size-multiplier));padding:calc(var(--ifm-breadcrumb-padding-vertical)*var(--ifm-breadcrumb-size-multiplier)) calc(var(--ifm-breadcrumb-padding-horizontal)*var(--ifm-breadcrumb-size-multiplier));transition-duration:var(--ifm-transition-fast);transition-property:background,color}.breadcrumbs__link:any-link:hover,.breadcrumbs__link:link:hover,.breadcrumbs__link:visited:hover,area[href].breadcrumbs__link:hover{background:var(--ifm-breadcrumb-item-background-active);text-decoration:none}.breadcrumbs--sm{--ifm-breadcrumb-size-multiplier:0.8}.breadcrumbs--lg{--ifm-breadcrumb-size-multiplier:1.2}.button{background-color:var(--ifm-button-background-color);border:var(--ifm-button-border-width) solid var(--ifm-button-border-color);border-radius:var(--ifm-button-border-radius);cursor:pointer;font-size:calc(.875rem*var(--ifm-button-size-multiplier));font-weight:var(--ifm-button-font-weight);line-height:1.5;padding:calc(var(--ifm-button-padding-vertical)*var(--ifm-button-size-multiplier)) calc(var(--ifm-button-padding-horizontal)*var(--ifm-button-size-multiplier));text-align:center;transition-duration:var(--ifm-button-transition-duration);transition-property:color,background,border-color;user-select:none;white-space:nowrap}.button,.button:hover{color:var(--ifm-button-color)}.button--outline{--ifm-button-color:var(--ifm-button-border-color)}.button--outline:hover{--ifm-button-background-color:var(--ifm-button-border-color)}.button--link{--ifm-button-border-color:#0000;color:var(--ifm-link-color);text-decoration:var(--ifm-link-decoration)}.button--link.button--active,.button--link:active,.button--link:hover{color:var(--ifm-link-hover-color);text-decoration:var(--ifm-link-hover-decoration)}.button.disabled,.button:disabled,.button[disabled]{opacity:.65;pointer-events:none}.button--sm{--ifm-button-size-multiplier:0.8}.button--lg{--ifm-button-size-multiplier:1.35}.button--block{display:block;width:100%}.button.button--secondary{color:var(--ifm-color-gray-900)}:where(.button--primary){--ifm-button-background-color:var(--ifm-color-primary);--ifm-button-border-color:var(--ifm-color-primary)}:where(.button--primary):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-primary-dark);--ifm-button-border-color:var(--ifm-color-primary-dark)}.button--primary.button--active,.button--primary:active{--ifm-button-background-color:var(--ifm-color-primary-darker);--ifm-button-border-color:var(--ifm-color-primary-darker)}:where(.button--secondary){--ifm-button-background-color:var(--ifm-color-secondary);--ifm-button-border-color:var(--ifm-color-secondary)}:where(.button--secondary):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-secondary-dark);--ifm-button-border-color:var(--ifm-color-secondary-dark)}.button--secondary.button--active,.button--secondary:active{--ifm-button-background-color:var(--ifm-color-secondary-darker);--ifm-button-border-color:var(--ifm-color-secondary-darker)}:where(.button--success){--ifm-button-background-color:var(--ifm-color-success);--ifm-button-border-color:var(--ifm-color-success)}:where(.button--success):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-success-dark);--ifm-button-border-color:var(--ifm-color-success-dark)}.button--success.button--active,.button--success:active{--ifm-button-background-color:var(--ifm-color-success-darker);--ifm-button-border-color:var(--ifm-color-success-darker)}:where(.button--info){--ifm-button-background-color:var(--ifm-color-info);--ifm-button-border-color:var(--ifm-color-info)}:where(.button--info):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-info-dark);--ifm-button-border-color:var(--ifm-color-info-dark)}.button--info.button--active,.button--info:active{--ifm-button-background-color:var(--ifm-color-info-darker);--ifm-button-border-color:var(--ifm-color-info-darker)}:where(.button--warning){--ifm-button-background-color:var(--ifm-color-warning);--ifm-button-border-color:var(--ifm-color-warning)}:where(.button--warning):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-warning-dark);--ifm-button-border-color:var(--ifm-color-warning-dark)}.button--warning.button--active,.button--warning:active{--ifm-button-background-color:var(--ifm-color-warning-darker);--ifm-button-border-color:var(--ifm-color-warning-darker)}:where(.button--danger){--ifm-button-background-color:var(--ifm-color-danger);--ifm-button-border-color:var(--ifm-color-danger)}:where(.button--danger):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-danger-dark);--ifm-button-border-color:var(--ifm-color-danger-dark)}.button--danger.button--active,.button--danger:active{--ifm-button-background-color:var(--ifm-color-danger-darker);--ifm-button-border-color:var(--ifm-color-danger-darker)}.button-group{display:inline-flex;gap:var(--ifm-button-group-spacing)}.button-group>.button:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.button-group>.button:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.button-group--block{display:flex;justify-content:stretch}.button-group--block>.button{flex-grow:1}.card{background-color:var(--ifm-card-background-color);border-radius:var(--ifm-card-border-radius);box-shadow:var(--ifm-global-shadow-lw);display:flex;flex-direction:column;overflow:hidden}.card__image{padding-top:var(--ifm-card-vertical-spacing)}.card__image:first-child{padding-top:0}.card__body,.card__footer,.card__header{padding:var(--ifm-card-vertical-spacing) var(--ifm-card-horizontal-spacing)}.card__body:not(:last-child),.card__footer:not(:last-child),.card__header:not(:last-child){padding-bottom:0}.card__body>:last-child,.card__footer>:last-child,.card__header>:last-child{margin-bottom:0}.card__footer{margin-top:auto}.table-of-contents{font-size:.8rem;margin-bottom:0;padding:var(--ifm-toc-padding-vertical) 0}.table-of-contents,.table-of-contents ul{list-style:none;padding-left:var(--ifm-toc-padding-horizontal)}.table-of-contents li{margin:var(--ifm-toc-padding-vertical) var(--ifm-toc-padding-horizontal)}.table-of-contents__left-border{border-left:1px solid var(--ifm-toc-border-color)}.table-of-contents__link{color:var(--ifm-toc-link-color);display:block}.table-of-contents__link--active,.table-of-contents__link--active code,.table-of-contents__link:hover,.table-of-contents__link:hover code{color:var(--ifm-color-primary);text-decoration:none}.close{color:var(--ifm-color-black);float:right;font-size:1.5rem;font-weight:var(--ifm-font-weight-bold);line-height:1;opacity:.5;padding:1rem;transition:opacity var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.close:hover{opacity:.7}.close:focus,.theme-code-block-highlighted-line .codeLineNumber_Tfdd:before{opacity:.8}.dropdown{display:inline-flex;font-weight:var(--ifm-dropdown-font-weight);position:relative;vertical-align:top}.fa-layers,.svg-inline--fa{vertical-align:-.125em;height:1em}.dropdown--hoverable:hover .dropdown__menu,.dropdown--show .dropdown__menu{opacity:1;pointer-events:all;transform:translateY(-1px);visibility:visible}#nprogress,.dropdown__menu,.navbar__item.dropdown .navbar__link:not([href]){pointer-events:none}.dropdown--right .dropdown__menu{left:inherit;right:0}.dropdown--nocaret .navbar__link:after{content:none!important}.dropdown__menu{background-color:var(--ifm-dropdown-background-color);border-radius:var(--ifm-global-radius);box-shadow:var(--ifm-global-shadow-md);left:0;list-style:none;max-height:80vh;min-width:10rem;opacity:0;overflow-y:auto;padding:.5rem;position:absolute;top:calc(100% - var(--ifm-navbar-item-padding-vertical) + .3rem);transform:translateY(-.625rem);transition-duration:var(--ifm-transition-fast);transition-property:opacity,transform,visibility;transition-timing-function:var(--ifm-transition-timing-default);visibility:hidden;z-index:var(--ifm-z-index-dropdown)}.menu__caret,.menu__link,.menu__list-item-collapsible{border-radius:.25rem;transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.dropdown__link{border-radius:.25rem;color:var(--ifm-dropdown-link-color);display:block;font-size:.875rem;margin-top:.2rem;padding:.25rem .5rem;white-space:nowrap}.dropdown__link--active,.dropdown__link:hover{background-color:var(--ifm-dropdown-hover-background-color);color:var(--ifm-dropdown-link-color);text-decoration:none}.dropdown__link--active,.dropdown__link--active:hover{--ifm-dropdown-link-color:var(--ifm-link-color)}.dropdown>.navbar__link:after{border-color:currentcolor #0000;border-style:solid;border-width:.4em .4em 0;content:"";margin-left:.3em;position:relative;top:2px;transform:translateY(-50%)}.footer{background-color:var(--ifm-footer-background-color);color:var(--ifm-footer-color);padding:var(--ifm-footer-padding-vertical) var(--ifm-footer-padding-horizontal)}.footer--dark{--ifm-footer-background-color:#303846;--ifm-footer-color:var(--ifm-footer-link-color);--ifm-footer-link-color:var(--ifm-color-secondary);--ifm-footer-title-color:var(--ifm-color-white)}.footer__links{margin-bottom:1rem}.footer__link-item{color:var(--ifm-footer-link-color);line-height:2}.footer__link-item:hover{color:var(--ifm-footer-link-hover-color)}.footer__link-separator{margin:0 var(--ifm-footer-link-horizontal-spacing)}.footer__logo{margin-top:1rem;max-width:var(--ifm-footer-logo-max-width)}.footer__title{color:var(--ifm-footer-title-color);font:700 var(--ifm-h4-font-size)/var(--ifm-heading-line-height) var(--ifm-font-family-base);margin-bottom:var(--ifm-heading-margin-bottom)}.menu,.navbar__link{font-weight:var(--ifm-font-weight-semibold)}.docItemContainer_Djhp article>:first-child,.docItemContainer_Djhp header+*,.footer__item{margin-top:0}.admonitionContent_S0QG>:last-child,.collapsibleContent_i85q>:last-child,.footer__items,.tabItem_Ymn6>:last-child{margin-bottom:0}.codeBlockStandalone_MEMb,[type=checkbox]{padding:0}.hero{align-items:center;background-color:var(--ifm-hero-background-color);color:var(--ifm-hero-text-color);display:flex;padding:4rem 2rem}.hero--primary{--ifm-hero-background-color:var(--ifm-color-primary);--ifm-hero-text-color:var(--ifm-font-color-base-inverse)}.hero--dark{--ifm-hero-background-color:#303846;--ifm-hero-text-color:var(--ifm-color-white)}.hero__title{font-size:3rem}.hero__subtitle{font-size:1.5rem}.menu__list{list-style:none;margin:0;padding-left:0}.menu__caret,.menu__link{padding:var(--ifm-menu-link-padding-vertical) var(--ifm-menu-link-padding-horizontal)}.menu__list .menu__list{flex:0 0 100%;margin-top:.25rem;padding-left:var(--ifm-menu-link-padding-horizontal)}.menu__list-item:not(:first-child){margin-top:.25rem}.menu__list-item--collapsed .menu__list{height:0;overflow:hidden}.details_lb9f[data-collapsed=false].isBrowser_bmU9>summary:before,.details_lb9f[open]:not(.isBrowser_bmU9)>summary:before,.fa-rotate-90,.menu__list-item--collapsed .menu__caret:before,.menu__list-item--collapsed .menu__link--sublist:after{transform:rotate(90deg)}.menu__list-item-collapsible{display:flex;flex-wrap:wrap;position:relative}.menu__caret:hover,.menu__link:hover,.menu__list-item-collapsible--active,.menu__list-item-collapsible:hover{background:var(--ifm-menu-color-background-hover)}.menu__list-item-collapsible .menu__link--active,.menu__list-item-collapsible .menu__link:hover{background:none!important}.menu__caret,.menu__link{align-items:center;display:flex}.navbar-sidebar,.navbar-sidebar__backdrop{opacity:0;transition-duration:var(--ifm-transition-fast);transition-timing-function:ease-in-out;bottom:0;left:0;top:0;visibility:hidden}.menu__link{color:var(--ifm-menu-color);flex:1;line-height:1.25}.menu__link:hover{color:var(--ifm-menu-color);text-decoration:none}.menu__caret:before,.menu__link--sublist-caret:after{height:1.25rem;transform:rotate(180deg);transition:transform var(--ifm-transition-fast) linear;width:1.25rem;filter:var(--ifm-menu-link-sublist-icon-filter);content:""}.menu__link--sublist-caret:after{background:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem;margin-left:auto;min-width:1.25rem}.menu__link--active,.menu__link--active:hover{color:var(--ifm-menu-color-active)}.navbar__brand,.navbar__link{color:var(--ifm-navbar-link-color)}.menu__link--active:not(.menu__link--sublist){background-color:var(--ifm-menu-color-background-active)}.menu__caret:before{background:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem}.navbar--dark,html[data-theme=dark]{--ifm-menu-link-sublist-icon-filter:invert(100%) sepia(94%) saturate(17%) hue-rotate(223deg) brightness(104%) contrast(98%)}.navbar{background-color:var(--ifm-navbar-background-color);box-shadow:var(--ifm-navbar-shadow);height:var(--ifm-navbar-height);padding:var(--ifm-navbar-padding-vertical) var(--ifm-navbar-padding-horizontal)}.navbar,.navbar>.container,.navbar>.container-fluid{display:flex}.navbar--fixed-top{position:sticky;top:0;z-index:var(--ifm-z-index-fixed)}.navbar__inner{display:flex;flex-wrap:wrap;justify-content:space-between;width:100%}.navbar__brand{align-items:center;display:flex;margin-right:1rem;min-width:0}.navbar__brand:hover{color:var(--ifm-navbar-link-hover-color);text-decoration:none}.announcementBarContent_xLdY,.navbar__title{flex:1 1 auto}.navbar__toggle{display:none;margin-right:.5rem}.navbar__logo{flex:0 0 auto;height:2rem;margin-right:.5rem}.navbar__items{align-items:center;display:flex;flex:1;min-width:0}.navbar__items--center{flex:0 0 auto}.navbar__items--center .navbar__brand{margin:0}.navbar__items--center+.navbar__items--right{flex:1}.navbar__items--right{flex:0 0 auto;justify-content:flex-end}.navbar__items--right>:last-child{padding-right:0}.navbar__item{display:inline-block;padding:var(--ifm-navbar-item-padding-vertical) var(--ifm-navbar-item-padding-horizontal)}.navbar__link--active,.navbar__link:hover{color:var(--ifm-navbar-link-hover-color);text-decoration:none}.navbar--dark,.navbar--primary{--ifm-menu-color:var(--ifm-color-gray-300);--ifm-navbar-link-color:var(--ifm-color-gray-100);--ifm-navbar-search-input-background-color:#ffffff1a;--ifm-navbar-search-input-placeholder-color:#ffffff80;color:var(--ifm-color-white)}.navbar--dark{--ifm-navbar-background-color:#242526;--ifm-menu-color-background-active:#ffffff0d;--ifm-navbar-search-input-color:var(--ifm-color-white)}.navbar--primary{--ifm-navbar-background-color:var(--ifm-color-primary);--ifm-navbar-link-hover-color:var(--ifm-color-white);--ifm-menu-color-active:var(--ifm-color-white);--ifm-navbar-search-input-color:var(--ifm-color-emphasis-500)}.navbar__search-input{-webkit-appearance:none;appearance:none;background:var(--ifm-navbar-search-input-background-color) var(--ifm-navbar-search-input-icon) no-repeat .75rem center/1rem 1rem;border:none;border-radius:2rem;color:var(--ifm-navbar-search-input-color);cursor:text;display:inline-block;font-size:.9rem;height:2rem;padding:0 .5rem 0 2.25rem;width:12.5rem}.navbar__search-input::placeholder{color:var(--ifm-navbar-search-input-placeholder-color)}.navbar-sidebar{background-color:var(--ifm-navbar-background-color);box-shadow:var(--ifm-global-shadow-md);position:fixed;transform:translate3d(-100%,0,0);transition-property:opacity,visibility,transform;width:var(--ifm-navbar-sidebar-width)}.navbar-sidebar--show .navbar-sidebar,.navbar-sidebar__items{transform:translateZ(0)}.navbar-sidebar--show .navbar-sidebar,.navbar-sidebar--show .navbar-sidebar__backdrop{opacity:1;visibility:visible}.navbar-sidebar__backdrop{background-color:#0009;position:fixed;right:0;transition-property:opacity,visibility}.navbar-sidebar__brand{align-items:center;box-shadow:var(--ifm-navbar-shadow);display:flex;flex:1;height:var(--ifm-navbar-height);padding:var(--ifm-navbar-padding-vertical) var(--ifm-navbar-padding-horizontal)}.navbar-sidebar__items{display:flex;height:calc(100% - var(--ifm-navbar-height));transition:transform var(--ifm-transition-fast) ease-in-out}.navbar-sidebar__items--show-secondary{transform:translate3d(calc((var(--ifm-navbar-sidebar-width))*-1),0,0)}.navbar-sidebar__item{flex-shrink:0;padding:.5rem;width:calc(var(--ifm-navbar-sidebar-width))}.navbar-sidebar__back{background:var(--ifm-menu-color-background-active);font-size:15px;font-weight:var(--ifm-button-font-weight);margin:0 0 .2rem -.5rem;padding:.6rem 1.5rem;position:relative;text-align:left;top:-.5rem;width:calc(100% + 1rem)}.navbar-sidebar__close{display:flex;margin-left:auto}.pagination{column-gap:var(--ifm-pagination-page-spacing);display:flex;font-size:var(--ifm-pagination-font-size);padding-left:0}.pagination--sm{--ifm-pagination-font-size:0.8rem;--ifm-pagination-padding-horizontal:0.8rem;--ifm-pagination-padding-vertical:0.2rem}.pagination--lg{--ifm-pagination-font-size:1.2rem;--ifm-pagination-padding-horizontal:1.2rem;--ifm-pagination-padding-vertical:0.3rem}.pagination__item{display:inline-flex}.pagination__item>span{padding:var(--ifm-pagination-padding-vertical)}.pagination__item--active .pagination__link{color:var(--ifm-pagination-color-active)}.pagination__item--active .pagination__link,.pagination__item:not(.pagination__item--active):hover .pagination__link{background:var(--ifm-pagination-item-active-background)}.pagination__item--disabled,.pagination__item[disabled]{opacity:.25;pointer-events:none}.pagination__link{border-radius:var(--ifm-pagination-border-radius);color:var(--ifm-font-color-base);display:inline-block;padding:var(--ifm-pagination-padding-vertical) var(--ifm-pagination-padding-horizontal);transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.pagination__link:hover{text-decoration:none}.pagination-nav{grid-gap:var(--ifm-spacing-horizontal);display:grid;gap:var(--ifm-spacing-horizontal);grid-template-columns:repeat(2,1fr)}.pagination-nav__link{border:1px solid var(--ifm-color-emphasis-300);border-radius:var(--ifm-pagination-nav-border-radius);display:block;height:100%;line-height:var(--ifm-heading-line-height);padding:var(--ifm-global-spacing);transition:border-color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.pagination-nav__link:hover{border-color:var(--ifm-pagination-nav-color-hover);text-decoration:none}.pagination-nav__link--next{grid-column:2/3;text-align:right}.content_knG7,.fa-fw,.fa-layers,.fa-li,.pills--block .pills__item{text-align:center}.pagination-nav__label{font-size:var(--ifm-h4-font-size);font-weight:var(--ifm-heading-font-weight);word-break:break-word}.pagination-nav__link--prev .pagination-nav__label:before{content:"« "}.pagination-nav__link--next .pagination-nav__label:after{content:" »"}.pagination-nav__sublabel{color:var(--ifm-color-content-secondary);font-size:var(--ifm-h5-font-size);font-weight:var(--ifm-font-weight-semibold);margin-bottom:.25rem}.pills__item,.tabs{font-weight:var(--ifm-font-weight-bold)}.pills{display:flex;gap:var(--ifm-pills-spacing);padding-left:0}.pills__item{border-radius:.5rem;cursor:pointer;display:inline-block;padding:.25rem 1rem;transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.pills__item--active{color:var(--ifm-pills-color-active)}.pills__item--active,.pills__item:not(.pills__item--active):hover{background:var(--ifm-pills-color-background-active)}.pills--block{justify-content:stretch}.pills--block .pills__item{flex-grow:1}.tabs{color:var(--ifm-tabs-color);display:flex;margin-bottom:0;overflow-x:auto;padding-left:0}.tabs__item{border-bottom:3px solid #0000;border-radius:var(--ifm-global-radius);cursor:pointer;display:inline-flex;padding:var(--ifm-tabs-padding-vertical) var(--ifm-tabs-padding-horizontal);transition:background-color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.tabs__item--active{border-bottom-color:var(--ifm-tabs-color-active-border);border-bottom-left-radius:0;border-bottom-right-radius:0;color:var(--ifm-tabs-color-active)}.fa-duotone.fa-inverse,.fa-inverse,.fa-layers-counter,.fad.fa-inverse{color:var(--fa-inverse,#fff)}.tabs__item:hover{background-color:var(--ifm-hover-overlay)}.tabs--block{justify-content:stretch}.tabs--block .tabs__item{flex-grow:1;justify-content:center}html[data-theme=dark]{--ifm-color-scheme:dark;--ifm-color-emphasis-0:var(--ifm-color-gray-1000);--ifm-color-emphasis-100:var(--ifm-color-gray-900);--ifm-color-emphasis-200:var(--ifm-color-gray-800);--ifm-color-emphasis-300:var(--ifm-color-gray-700);--ifm-color-emphasis-400:var(--ifm-color-gray-600);--ifm-color-emphasis-600:var(--ifm-color-gray-400);--ifm-color-emphasis-700:var(--ifm-color-gray-300);--ifm-color-emphasis-800:var(--ifm-color-gray-200);--ifm-color-emphasis-900:var(--ifm-color-gray-100);--ifm-color-emphasis-1000:var(--ifm-color-gray-0);--ifm-background-color:#1b1b1d;--ifm-background-surface-color:#242526;--ifm-hover-overlay:#ffffff0d;--ifm-color-content:#e3e3e3;--ifm-color-content-secondary:#fff;--ifm-breadcrumb-separator-filter:invert(64%) sepia(11%) saturate(0%) hue-rotate(149deg) brightness(99%) contrast(95%);--ifm-code-background:#ffffff1a;--ifm-scrollbar-track-background-color:#444;--ifm-scrollbar-thumb-background-color:#686868;--ifm-scrollbar-thumb-hover-background-color:#7a7a7a;--ifm-table-stripe-background:#ffffff12;--ifm-toc-border-color:var(--ifm-color-emphasis-200);--ifm-color-primary-contrast-background:#102445;--ifm-color-primary-contrast-foreground:#ebf2fc;--ifm-color-secondary-contrast-background:#474748;--ifm-color-secondary-contrast-foreground:#fdfdfe;--ifm-color-success-contrast-background:#003100;--ifm-color-success-contrast-foreground:#e6f6e6;--ifm-color-info-contrast-background:#193c47;--ifm-color-info-contrast-foreground:#eef9fd;--ifm-color-warning-contrast-background:#4d3800;--ifm-color-warning-contrast-foreground:#fff8e6;--ifm-color-danger-contrast-background:#4b1113;--ifm-color-danger-contrast-foreground:#ffebec;--docsearch-text-color:#f5f6f7;--docsearch-container-background:#090a11cc;--docsearch-modal-background:#15172a;--docsearch-modal-shadow:inset 1px 1px 0 0 #2c2e40,0 3px 8px 0 #000309;--docsearch-searchbox-background:#090a11;--docsearch-searchbox-focus-background:#000;--docsearch-hit-color:#bec3c9;--docsearch-hit-shadow:none;--docsearch-hit-background:#090a11;--docsearch-key-gradient:linear-gradient(-26.5deg,#565872,#31355b);--docsearch-key-shadow:inset 0 -2px 0 0 #282d55,inset 0 0 1px 1px #51577d,0 2px 2px 0 #0304094d;--docsearch-footer-background:#1e2136;--docsearch-footer-shadow:inset 0 1px 0 0 #494c6a80,0 -4px 8px 0 #0003;--docsearch-logo-color:#fff;--docsearch-muted-color:#7f8497}:root{--docusaurus-progress-bar-color:var(--ifm-color-primary);--ifm-font-family-base:"Object Sans Regular";--ifm-color-primary:#5217b8;--ifm-color-primary-dark:#46149c;--ifm-color-primary-darker:#391081;--ifm-color-primary-darkest:#290b5c;--ifm-color-primary-light:#621cdd;--ifm-color-primary-lighter:#6e29e4;--ifm-color-primary-lightest:#874ee9;--ifm-color-secondary:#ffb300;--ifm-color-secondary-dark:#e6a100;--ifm-color-secondary-darker:#d99800;--ifm-color-secondary-darkest:#b37d00;--ifm-color-secondary-light:#ffbb1a;--ifm-color-secondary-lighter:#ffbe26;--ifm-color-secondary-lightest:#ffca4d;--ifm-navbar-background-color:#5217b8;--ifm-hero-background-color-bottom:#290c5c;--ifm-navbar-link-color:var(--ifm-font-color-base-inverse);--ifm-navbar-link-hover-color:var(--ifm-color-secondary);--ifm-navbar-link-active-color:var(--ifm-color-gray-400);--docusaurus-announcement-bar-height:auto;--docusaurus-tag-list-border:var(--ifm-color-emphasis-300);--docusaurus-collapse-button-bg:#0000;--docusaurus-collapse-button-bg-hover:#0000001a;--doc-sidebar-width:300px;--doc-sidebar-hidden-width:30px;--docsearch-primary-color:#5468ff;--docsearch-text-color:#1c1e21;--docsearch-spacing:12px;--docsearch-icon-stroke-width:1.4;--docsearch-highlight-color:var(--docsearch-primary-color);--docsearch-muted-color:#969faf;--docsearch-container-background:#656c85cc;--docsearch-logo-color:#5468ff;--docsearch-modal-width:560px;--docsearch-modal-height:600px;--docsearch-modal-background:#f5f6f7;--docsearch-modal-shadow:inset 1px 1px 0 0 #ffffff80,0 3px 8px 0 #555a64;--docsearch-searchbox-height:56px;--docsearch-searchbox-background:#ebedf0;--docsearch-searchbox-focus-background:#fff;--docsearch-searchbox-shadow:inset 0 0 0 2px var(--docsearch-primary-color);--docsearch-hit-height:56px;--docsearch-hit-color:#444950;--docsearch-hit-active-color:#fff;--docsearch-hit-background:#fff;--docsearch-hit-shadow:0 1px 3px 0 #d4d9e1;--docsearch-key-gradient:linear-gradient(-225deg,#d5dbe4,#f8f8f8);--docsearch-key-shadow:inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 2px 1px #1e235a66;--docsearch-footer-height:44px;--docsearch-footer-background:#fff;--docsearch-footer-shadow:0 -1px 0 0 #e0e3e8,0 -3px 6px 0 #45629b1f;--docsearch-primary-color:var(--ifm-color-primary);--docsearch-text-color:var(--ifm-font-color-base)}#nprogress .bar{background:var(--docusaurus-progress-bar-color);height:2px;left:0;position:fixed;top:0;width:100%;z-index:1031}#nprogress .peg{box-shadow:0 0 10px var(--docusaurus-progress-bar-color),0 0 5px var(--docusaurus-progress-bar-color);height:100%;opacity:1;position:absolute;right:0;transform:rotate(3deg) translateY(-4px);width:100px}:host,:root{--fa-font-solid:normal 900 1em/1 "Font Awesome 6 Solid";--fa-font-regular:normal 400 1em/1 "Font Awesome 6 Regular";--fa-font-light:normal 300 1em/1 "Font Awesome 6 Light";--fa-font-thin:normal 100 1em/1 "Font Awesome 6 Thin";--fa-font-duotone:normal 900 1em/1 "Font Awesome 6 Duotone";--fa-font-brands:normal 400 1em/1 "Font Awesome 6 Brands"}svg:not(:host).svg-inline--fa,svg:not(:root).svg-inline--fa{box-sizing:initial;overflow:visible}.svg-inline--fa{display:var(--fa-display,inline-block);overflow:visible}.fa-layers,.fa-stack{display:inline-block}.svg-inline--fa.fa-2xs{vertical-align:.1em}.svg-inline--fa.fa-xs{vertical-align:0}.svg-inline--fa.fa-sm{vertical-align:-.07143em}.svg-inline--fa.fa-lg{vertical-align:-.2em}.svg-inline--fa.fa-xl{vertical-align:-.25em}.svg-inline--fa.fa-2xl{vertical-align:-.3125em}.svg-inline--fa.fa-pull-left{margin-right:var(--fa-pull-margin,.3em);width:auto}.svg-inline--fa.fa-pull-right{margin-left:var(--fa-pull-margin,.3em);width:auto}.svg-inline--fa.fa-li{top:.25em;width:var(--fa-li-width,2em)}.svg-inline--fa.fa-fw{width:var(--fa-fw-width,1.25em)}.fa-layers svg.svg-inline--fa{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;transform-origin:center center}.fa-layers-counter,.fa-layers-text{display:inline-block;position:absolute;text-align:center}.fa-layers,.fa-ul>li{position:relative}.fa-layers{width:1em}.fa-layers-text{left:50%;top:50%;transform:translate(-50%,-50%);transform-origin:center center}.fa-layers-counter{background-color:var(--fa-counter-background-color,#ff253a);border-radius:var(--fa-counter-border-radius,1em);line-height:var(--fa-counter-line-height,1);max-width:var(--fa-counter-max-width,5em);min-width:var(--fa-counter-min-width,1.5em);overflow:hidden;padding:var(--fa-counter-padding,.25em .5em);right:var(--fa-right,0);text-overflow:ellipsis;top:var(--fa-top,0);transform:scale(var(--fa-counter-scale,.25));transform-origin:top right}.fa-ul,:not(.containsTaskList_mC6p>li)>.containsTaskList_mC6p{padding-left:0}.fa-layers-bottom-right{bottom:var(--fa-bottom,0);right:var(--fa-right,0);top:auto;transform:scale(var(--fa-layers-scale,.25));transform-origin:bottom right}.fa-layers-bottom-left,.fa-layers-top-right{transform:scale(var(--fa-layers-scale,.25))}.fa-layers-bottom-left{bottom:var(--fa-bottom,0);left:var(--fa-left,0);right:auto;top:auto;transform-origin:bottom left}.fa-layers-top-right{right:var(--fa-right,0);top:var(--fa-top,0);transform-origin:top right}.fa-layers-top-left{left:var(--fa-left,0);right:auto;top:var(--fa-top,0);transform:scale(var(--fa-layers-scale,.25));transform-origin:top left}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-2xs{font-size:.625em;line-height:.1em;vertical-align:.225em}.fa-xs{font-size:.75em;line-height:.08333em;vertical-align:.125em}.fa-sm{font-size:.875em;line-height:.07143em;vertical-align:.05357em}.fa-lg{font-size:1.25em;line-height:.05em;vertical-align:-.075em}.fa-xl{font-size:1.5em;line-height:.04167em;vertical-align:-.125em}.fa-2xl{font-size:2em;line-height:.03125em;vertical-align:-.1875em}.fa-fw{width:1.25em}.fa-ul{list-style-type:none;margin-left:var(--fa-li-margin,2.5em)}.fa-li{left:calc(var(--fa-li-width,2em)*-1);line-height:inherit;position:absolute;width:var(--fa-li-width,2em)}.fa-border{border-color:var(--fa-border-color,#eee);border-radius:var(--fa-border-radius,.1em);border-style:var(--fa-border-style,solid);border-width:var(--fa-border-width,.08em);padding:var(--fa-border-padding,.2em .25em .15em)}.fa-pull-left{float:left;margin-right:var(--fa-pull-margin,.3em)}.fa-pull-right{float:right;margin-left:var(--fa-pull-margin,.3em)}.fa-beat{animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-name:a;animation-timing-function:var(--fa-animation-timing,ease-in-out)}.fa-beat-fade,.fa-fade{animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1));animation-iteration-count:var(--fa-animation-iteration-count,infinite)}.fa-fade{animation-name:b}.fa-beat-fade{animation-name:c}.fa-flip{animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-name:d;animation-timing-function:var(--fa-animation-timing,ease-in-out)}.fa-pulse,.fa-spin,.fa-spin-pulse{animation-direction:var(--fa-animation-direction,normal);animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-name:e}.fa-spin{animation-duration:var(--fa-animation-duration,2s);animation-timing-function:var(--fa-animation-timing,linear)}.fa-spin-reverse{--fa-animation-direction:reverse}.fa-pulse,.fa-spin-pulse{animation-duration:var(--fa-animation-duration,1s);animation-timing-function:var(--fa-animation-timing,steps(8))}@keyframes a{0%,90%{transform:scale(1)}45%{transform:scale(var(--fa-beat-scale,1.25))}}@keyframes b{50%{opacity:var(--fa-fade-opacity,.4)}}@keyframes c{0%,to{opacity:var(--fa-beat-fade-opacity,.4);transform:scale(1)}50%{opacity:1;transform:scale(var(--fa-beat-fade-scale,1.125))}}@keyframes d{50%{transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg))}}@keyframes e{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.fa-rotate-180{transform:rotate(180deg)}.fa-rotate-270{transform:rotate(270deg)}.fa-flip-horizontal{transform:scaleX(-1)}.fa-flip-vertical{transform:scaleY(-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{transform:scale(-1)}.fa-rotate-by{transform:rotate(var(--fa-rotate-angle,none))}.fa-stack{height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;z-index:var(--fa-stack-z-index,auto)}.svg-inline--fa.fa-stack-1x{height:1em;width:1.25em}.svg-inline--fa.fa-stack-2x{height:2em;width:2.5em}.fa-sr-only,.fa-sr-only-focusable:not(:focus),.sr-only,.sr-only-focusable:not(:focus){clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.svg-inline--fa .fa-primary{fill:var(--fa-primary-color,currentColor);opacity:var(--fa-primary-opacity,1)}.svg-inline--fa .fa-secondary{fill:var(--fa-secondary-color,currentColor)}.svg-inline--fa .fa-secondary,.svg-inline--fa.fa-swap-opacity .fa-primary{opacity:var(--fa-secondary-opacity,.4)}.svg-inline--fa.fa-swap-opacity .fa-secondary{opacity:var(--fa-primary-opacity,1)}.svg-inline--fa mask .fa-primary,.svg-inline--fa mask .fa-secondary{fill:#000}@font-face{font-family:Object Sans Regular;src:url(/assets/fonts/ObjectSans-Regular-2a8a3a5edf33ee77e5931269d27c4e6f.woff2) format("woff2"),url(/assets/fonts/ObjectSans-Regular-4ab681413dd329607b462c101a5f16a8.woff) format("woff")}.button--primary:not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-primary-darkest);--ifm-button-border-color:var(--ifm-color-primary-darkest)}.navbar__link--active{color:var(--ifm-navbar-link-active-color)}.hero_uw3b a:not(.button),.navbar__toggle{color:var(--ifm-font-color-base-inverse)}.docusaurus-highlight-code-line{background-color:#0000001a;display:block;margin:0 calc(var(--ifm-pre-padding)*-1);padding:0 var(--ifm-pre-padding)}html[data-theme=dark] .docusaurus-highlight-code-line{background-color:#0000004d}details summary{font-size:20px}body:not(.navigation-with-keyboard) :not(input):focus{outline:0}#docusaurus-base-url-issue-banner-container,.themedImage_ToTc,[data-theme=dark] .lightToggleIcon_pyhR,[data-theme=light] .darkToggleIcon_wfgR,html[data-announcement-bar-initially-dismissed=true] .announcementBar_mb4j{display:none}.skipToContent_fXgn{background-color:var(--ifm-background-surface-color);color:var(--ifm-color-emphasis-900);left:100%;padding:calc(var(--ifm-global-spacing)/2) var(--ifm-global-spacing);position:fixed;top:1rem;z-index:calc(var(--ifm-z-index-fixed) + 1)}.skipToContent_fXgn:focus{box-shadow:var(--ifm-global-shadow-md);left:1rem}.closeButton_CVFx{line-height:0;padding:0}.content_knG7{font-size:85%;padding:5px 0}.content_knG7 a{color:inherit;text-decoration:underline}.DocSearch-Container a,.tag_zVej:hover{text-decoration:none}.announcementBar_mb4j{align-items:center;background-color:var(--ifm-color-white);border-bottom:1px solid var(--ifm-color-emphasis-100);color:var(--ifm-color-black);display:flex;height:var(--docusaurus-announcement-bar-height)}.announcementBarPlaceholder_vyr4{flex:0 0 10px}.announcementBarClose_gvF7{align-self:stretch;flex:0 0 30px}.toggle_vylO{height:2rem;width:2rem}.toggleButton_gllP{align-items:center;border-radius:50%;display:flex;height:100%;justify-content:center;transition:background var(--ifm-transition-fast);width:100%}.toggleButton_gllP:hover{background:var(--ifm-color-emphasis-200)}.toggleButtonDisabled_aARS{cursor:not-allowed}.darkNavbarColorModeToggle_X3D1:hover{background:var(--ifm-color-gray-800)}[data-theme=dark] .themedImage--dark_i4oU,[data-theme=light] .themedImage--light_HNdA{display:initial}.iconExternalLink_nPIU{margin-left:.3rem}.iconLanguage_nlXk{margin-right:5px;vertical-align:text-bottom}.navbarHideable_m1mJ{transition:transform var(--ifm-transition-fast) ease}.navbarHidden_jGov{transform:translate3d(0,calc(-100% - 2px),0)}.errorBoundaryError_a6uf{color:red;white-space:pre-wrap}.footerLogoLink_BH7S{opacity:.5;transition:opacity var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.footerLogoLink_BH7S:hover,.hash-link:focus,:hover>.hash-link{opacity:1}.mainWrapper_z2l0{display:flex;flex:1 0 auto;flex-direction:column}.docusaurus-mt-lg{margin-top:3rem}#__docusaurus{display:flex;flex-direction:column;min-height:100%}.iconEdit_Z9Sw{margin-right:.3em;vertical-align:sub}.tag_zVej{border:1px solid var(--docusaurus-tag-list-border);transition:border var(--ifm-transition-fast)}.tag_zVej:hover{--docusaurus-tag-list-border:var(--ifm-link-color)}.tagRegular_sFm0{border-radius:var(--ifm-global-radius);font-size:90%;padding:.2rem .5rem .3rem}.tagWithCount_h2kH{align-items:center;border-left:0;display:flex;padding:0 .5rem 0 1rem;position:relative}.tagWithCount_h2kH:after,.tagWithCount_h2kH:before{border:1px solid var(--docusaurus-tag-list-border);content:"";position:absolute;top:50%;transition:inherit}.tagWithCount_h2kH:before{border-bottom:0;border-right:0;height:1.18rem;right:100%;transform:translate(50%,-50%) rotate(-45deg);width:1.18rem}.tagWithCount_h2kH:after{border-radius:50%;height:.5rem;left:0;transform:translateY(-50%);width:.5rem}.tagWithCount_h2kH span{background:var(--ifm-color-secondary);border-radius:var(--ifm-global-radius);color:var(--ifm-color-black);font-size:.7rem;line-height:1.2;margin-left:.3rem;padding:.1rem .4rem}.tags_jXut{display:inline}.tag_QGVx{display:inline-block;margin:0 .4rem .5rem 0}.lastUpdated_vwxv{font-size:smaller;font-style:italic;margin-top:.2rem}.tocCollapsibleButton_TO0P{align-items:center;display:flex;font-size:inherit;justify-content:space-between;padding:.4rem .8rem;width:100%}.tocCollapsibleButton_TO0P:after{background:var(--ifm-menu-link-sublist-icon) 50% 50%/2rem 2rem no-repeat;content:"";filter:var(--ifm-menu-link-sublist-icon-filter);height:1.25rem;transform:rotate(180deg);transition:transform var(--ifm-transition-fast);width:1.25rem}.tocCollapsibleButtonExpanded_MG3E:after,.tocCollapsibleExpanded_sAul{transform:none}.tocCollapsible_ETCw{background-color:var(--ifm-menu-color-background-active);border-radius:var(--ifm-global-radius);margin:1rem 0}.buttonGroup__atx button,.codeBlockContainer_Ckt0{background:var(--prism-background-color);color:var(--prism-color)}.tocCollapsibleContent_vkbj>ul{border-left:none;border-top:1px solid var(--ifm-color-emphasis-300);font-size:15px;padding:.2rem 0}.tocCollapsibleContent_vkbj ul li{margin:.4rem .8rem}.tocCollapsibleContent_vkbj a{display:block}.tableOfContents_bqdL{max-height:calc(100vh - var(--ifm-navbar-height) - 2rem);overflow-y:auto;position:sticky;top:calc(var(--ifm-navbar-height) + 1rem)}.anchorWithStickyNavbar_LWe7{scroll-margin-top:calc(var(--ifm-navbar-height) + .5rem)}.anchorWithHideOnScrollNavbar_WYt5{scroll-margin-top:.5rem}.hash-link{opacity:0;padding-left:.5rem;transition:opacity var(--ifm-transition-fast);user-select:none}.hash-link:before{content:"#"}.codeBlockContainer_Ckt0{border-radius:var(--ifm-code-border-radius);box-shadow:var(--ifm-global-shadow-lw);margin-bottom:var(--ifm-leading)}.codeBlockContent_biex{border-radius:inherit;direction:ltr;position:relative}.codeBlockTitle_Ktv7{border-bottom:1px solid var(--ifm-color-emphasis-300);border-top-left-radius:inherit;border-top-right-radius:inherit;font-size:var(--ifm-code-font-size);font-weight:500;padding:.75rem var(--ifm-pre-padding)}.codeBlock_bY9V{--ifm-pre-background:var(--prism-background-color);margin:0;padding:0}.codeBlockTitle_Ktv7+.codeBlockContent_biex .codeBlock_bY9V{border-top-left-radius:0;border-top-right-radius:0}.codeBlockLines_e6Vv{float:left;font:inherit;min-width:100%;padding:var(--ifm-pre-padding)}.codeBlockLinesWithNumbering_o6Pm{display:table;padding:var(--ifm-pre-padding) 0}.buttonGroup__atx{column-gap:.2rem;display:flex;position:absolute;right:calc(var(--ifm-pre-padding)/2);top:calc(var(--ifm-pre-padding)/2)}.buttonGroup__atx button{align-items:center;border:1px solid var(--ifm-color-emphasis-300);border-radius:var(--ifm-global-radius);display:flex;line-height:0;opacity:0;padding:.4rem;transition:opacity var(--ifm-transition-fast) ease-in-out}.buttonGroup__atx button:focus-visible,.buttonGroup__atx button:hover{opacity:1!important}.theme-code-block:hover .buttonGroup__atx button{opacity:.4}:where(:root){--docusaurus-highlighted-code-line-bg:#484d5b}:where([data-theme=dark]){--docusaurus-highlighted-code-line-bg:#646464}.theme-code-block-highlighted-line{background-color:var(--docusaurus-highlighted-code-line-bg);display:block;margin:0 calc(var(--ifm-pre-padding)*-1);padding:0 var(--ifm-pre-padding)}.codeLine_lJS_{counter-increment:a;display:table-row}.codeLineNumber_Tfdd{background:var(--ifm-pre-background);display:table-cell;left:0;overflow-wrap:normal;padding:0 var(--ifm-pre-padding);position:sticky;text-align:right;width:1%}.codeLineNumber_Tfdd:before{content:counter(a);opacity:.4}.codeLineContent_feaV{padding-right:var(--ifm-pre-padding)}.theme-code-block:hover .copyButtonCopied_obH4{opacity:1!important}.copyButtonIcons_eSgA{height:1.125rem;position:relative;width:1.125rem}.copyButtonIcon_y97N,.copyButtonSuccessIcon_LjdS{fill:currentColor;height:inherit;left:0;opacity:inherit;position:absolute;top:0;transition:all var(--ifm-transition-fast) ease;width:inherit}.copyButtonSuccessIcon_LjdS{color:#00d600;left:50%;opacity:0;top:50%;transform:translate(-50%,-50%) scale(.33)}.copyButtonCopied_obH4 .copyButtonIcon_y97N{opacity:0;transform:scale(.33)}.copyButtonCopied_obH4 .copyButtonSuccessIcon_LjdS{opacity:1;transform:translate(-50%,-50%) scale(1);transition-delay:75ms}.wordWrapButtonIcon_Bwma{height:1.2rem;width:1.2rem}.details_lb9f{--docusaurus-details-summary-arrow-size:0.38rem;--docusaurus-details-transition:transform 200ms ease;--docusaurus-details-decoration-color:grey}.details_lb9f>summary{cursor:pointer;list-style:none;padding-left:1rem;position:relative}.details_lb9f>summary::-webkit-details-marker{display:none}.details_lb9f>summary:before{border-color:#0000 #0000 #0000 var(--docusaurus-details-decoration-color);border-style:solid;border-width:var(--docusaurus-details-summary-arrow-size);content:"";left:0;position:absolute;top:.45rem;transform:rotate(0);transform-origin:calc(var(--docusaurus-details-summary-arrow-size)/2) 50%;transition:var(--docusaurus-details-transition)}.collapsibleContent_i85q{border-top:1px solid var(--docusaurus-details-decoration-color);margin-top:1rem;padding-top:1rem}.details_b_Ee{--docusaurus-details-decoration-color:var(--ifm-alert-border-color);--docusaurus-details-transition:transform var(--ifm-transition-fast) ease;border:1px solid var(--ifm-alert-border-color);margin:0 0 var(--ifm-spacing-vertical)}.containsTaskList_mC6p{list-style:none}.img_ev3q{height:auto}.admonition_LlT9{margin-bottom:1em}.admonitionHeading_tbUL{font:var(--ifm-heading-font-weight) var(--ifm-h5-font-size)/var(--ifm-heading-line-height) var(--ifm-heading-font-family);margin-bottom:.3rem}.admonitionHeading_tbUL code{text-transform:none}.admonitionIcon_kALy{display:inline-block;margin-right:.4em;vertical-align:middle}.admonitionIcon_kALy svg{fill:var(--ifm-alert-foreground-color);display:inline-block;height:1.6em;width:1.6em}.breadcrumbHomeIcon_YNFT{height:1.1rem;position:relative;top:1px;vertical-align:top;width:1.1rem}.breadcrumbsContainer_Z_bl{--ifm-breadcrumb-size-multiplier:0.8;margin-bottom:.8rem}.searchQueryInput_u2C7,.searchVersionInput_m0Ui{background:var(--docsearch-searchbox-focus-background);border:2px solid var(--ifm-toc-border-color);border-radius:var(--ifm-global-radius);color:var(--docsearch-text-color);font:var(--ifm-font-size-base) var(--ifm-font-family-base);margin-bottom:.5rem;padding:.8rem;transition:border var(--ifm-transition-fast) ease;width:100%}.searchQueryInput_u2C7:focus,.searchVersionInput_m0Ui:focus{border-color:var(--docsearch-primary-color);outline:0}.searchQueryInput_u2C7::placeholder{color:var(--docsearch-muted-color)}.searchResultsColumn_JPFH{font-size:.9rem;font-weight:700}.algoliaLogo_rT1R{max-width:150px}.algoliaLogoPathFill_WdUC{fill:var(--ifm-font-color-base)}.searchResultItem_Tv2o{border-bottom:1px solid var(--ifm-toc-border-color);padding:1rem 0}.searchResultItemHeading_KbCB{font-weight:400;margin-bottom:0}.searchResultItemPath_lhe1{--ifm-breadcrumb-separator-size-multiplier:1;color:var(--ifm-color-content-secondary);font-size:.8rem}.searchResultItemSummary_AEaO{font-style:italic;margin:.5rem 0 0}.loadingSpinner_XVxU{animation:1s linear infinite f;border:.4em solid #eee;border-radius:50%;border-top:.4em solid var(--ifm-color-primary);height:3rem;margin:0 auto;width:3rem}@keyframes f{to{transform:rotate(1turn)}}.loader_vvXV{margin-top:2rem}.search-result-match{background:#ffd78e40;color:var(--docsearch-hit-color);padding:.09em 0}.backToTopButton_sjWU{background-color:var(--ifm-color-emphasis-200);border-radius:50%;bottom:1.3rem;box-shadow:var(--ifm-global-shadow-lw);height:3rem;opacity:0;position:fixed;right:1.3rem;transform:scale(0);transition:all var(--ifm-transition-fast) var(--ifm-transition-timing-default);visibility:hidden;width:3rem;z-index:calc(var(--ifm-z-index-fixed) - 1)}.backToTopButton_sjWU:after{background-color:var(--ifm-color-emphasis-1000);content:" ";display:inline-block;height:100%;-webkit-mask:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem no-repeat;mask:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem no-repeat;width:100%}.backToTopButtonShow_xfvO{opacity:1;transform:scale(1);visibility:visible}[data-theme=dark]:root{--docusaurus-collapse-button-bg:#ffffff0d;--docusaurus-collapse-button-bg-hover:#ffffff1a}.collapseSidebarButton_PEFL{display:none;margin:0}.docSidebarContainer_b6E3,.sidebarLogo_isFc{display:none}.docMainContainer_gTbr,.docPage__5DB{display:flex;width:100%}.docPage__5DB{flex:1 0}.docsWrapper_BCFX{display:flex;flex:1 0 auto}.verticallyJustifiedCol__fFm{display:flex;flex-direction:column;justify-content:center}.videoContainer_Inu3{height:0;padding-bottom:56.25%;position:relative;width:100%}.videoContainer_Inu3>iframe{height:100%;left:0;position:absolute;top:0;width:100%}.cogment_verse_logo_FnS0 .main{fill:var(--ifm-font-color-base-inverse)}.cogment_verse_logo_FnS0 .subscript{fill:var(--ifm-color-gray-500)}.logos_W70m{align-items:center;display:flex;flex-wrap:wrap;gap:1rem;justify-content:space-evenly;padding:1rem}.logos_W70m .logo_kX79{flex:0 0 150px}.benefit_pXnC{align-items:center;display:flex;flex-direction:column}.benefit_pXnC h4{display:block;font-size:var(--ifm-h3-font-size);height:3rem;text-align:center}.benefit_pXnC ul{-webkit-padding-start:0;display:block;max-width:25rem;padding-inline-start:0;padding:0 2rem;width:100%}.benefit_pXnC img{height:auto;max-width:200px}.screenshots_x3pV{display:flex;flex-direction:row;gap:2rem;justify-content:space-evenly;padding:2rem}.screenshots_x3pV>img{flex:0 0 auto;height:128px}.cta_i4Jo{display:flex;flex-direction:row;gap:1rem;justify-content:center}.DocSearch-Button,.DocSearch-Button-Container{align-items:center;display:flex}.hero_uw3b{background-color:var(--ifm-navbar-background-color);background-image:linear-gradient(var(--ifm-navbar-background-color),var(--ifm-hero-background-color-bottom));color:var(--ifm-font-color-base-inverse)}.hero_uw3b strong{font-weight:bolder}.hero_uw3b .button--primary{--ifm-button-background-color:var(--ifm-color-content-inverse);--ifm-button-border-color:var(--ifm-color-content-inverse);--ifm-button-color:var(--ifm-font-color-base)}.hero_uw3b .button--primary:hover{--ifm-button-background-color:var(--ifm-color-gray-300);--ifm-button-border-color:var(--ifm-color-gray-300)}.section_ccoD h3{color:var(--ifm-color-primary);text-align:center;text-transform:uppercase}.DocSearch-Button{background:var(--docsearch-searchbox-background);border:0;border-radius:40px;color:var(--docsearch-muted-color);cursor:pointer;font-weight:500;height:36px;justify-content:space-between;padding:0 8px;-webkit-user-select:none;user-select:none}.DocSearch-Button:active,.DocSearch-Button:focus,.DocSearch-Button:hover{background:var(--docsearch-searchbox-focus-background);box-shadow:var(--docsearch-searchbox-shadow);color:var(--docsearch-text-color);outline:0}.DocSearch-Search-Icon{stroke-width:1.6}.DocSearch-Hit-Tree,.DocSearch-Hit-action,.DocSearch-Hit-icon,.DocSearch-Reset{stroke-width:var(--docsearch-icon-stroke-width)}.DocSearch-Button .DocSearch-Search-Icon{color:var(--docsearch-text-color)}.DocSearch-Button-Placeholder{font-size:1rem;padding:0 12px 0 6px}.DocSearch-Input,.DocSearch-Link{-webkit-appearance:none;font:inherit}.DocSearch-Button-Keys{display:flex;min-width:calc(40px + .8em)}.DocSearch-Button-Key{align-items:center;background:var(--docsearch-key-gradient);border:0;border-radius:3px;box-shadow:var(--docsearch-key-shadow);color:var(--docsearch-muted-color);display:flex;height:18px;justify-content:center;margin-right:.4em;padding:0 0 2px;position:relative;top:-1px;width:20px}.DocSearch--active{overflow:hidden!important}.DocSearch-Container{background-color:var(--docsearch-container-background);height:100vh;left:0;position:fixed;top:0;width:100vw;z-index:200}.DocSearch-Link{appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;margin:0;padding:0}.DocSearch-Modal{background:var(--docsearch-modal-background);border-radius:6px;box-shadow:var(--docsearch-modal-shadow);flex-direction:column;margin:60px auto auto;max-width:var(--docsearch-modal-width);position:relative}.DocSearch-SearchBar{display:flex;padding:var(--docsearch-spacing) var(--docsearch-spacing) 0}.DocSearch-Form{align-items:center;background:var(--docsearch-searchbox-focus-background);border-radius:4px;box-shadow:var(--docsearch-searchbox-shadow);display:flex;height:var(--docsearch-searchbox-height);margin:0;padding:0 var(--docsearch-spacing);position:relative;width:100%}.DocSearch-Input{appearance:none;background:#0000;border:0;color:var(--docsearch-text-color);flex:1;font-size:1.2em;height:100%;outline:0;padding:0 0 0 8px;width:80%}.DocSearch-Hit-action-button,.DocSearch-Reset{-webkit-appearance:none;border:0;cursor:pointer}.DocSearch-Input::placeholder{color:var(--docsearch-muted-color);opacity:1}.DocSearch-Input::-webkit-search-cancel-button,.DocSearch-Input::-webkit-search-decoration,.DocSearch-Input::-webkit-search-results-button,.DocSearch-Input::-webkit-search-results-decoration{display:none}.DocSearch-LoadingIndicator,.DocSearch-MagnifierLabel,.DocSearch-Reset{margin:0;padding:0}.DocSearch-Container--Stalled .DocSearch-LoadingIndicator,.DocSearch-MagnifierLabel,.DocSearch-Reset{align-items:center;color:var(--docsearch-highlight-color);display:flex;justify-content:center}.DocSearch-Cancel,.DocSearch-Container--Stalled .DocSearch-MagnifierLabel,.DocSearch-LoadingIndicator,.DocSearch-Reset[hidden]{display:none}.DocSearch-Reset{animation:.1s ease-in forwards g;appearance:none;background:none;border-radius:50%;color:var(--docsearch-icon-color);padding:2px;right:0}.DocSearch-Help,.DocSearch-HitsFooter,.DocSearch-Label{color:var(--docsearch-muted-color)}.DocSearch-Reset:hover{color:var(--docsearch-highlight-color)}.DocSearch-LoadingIndicator svg,.DocSearch-MagnifierLabel svg{height:24px;width:24px}.DocSearch-Dropdown{max-height:calc(var(--docsearch-modal-height) - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height));min-height:var(--docsearch-spacing);overflow-y:auto;overflow-y:overlay;padding:0 var(--docsearch-spacing);scrollbar-color:var(--docsearch-muted-color) var(--docsearch-modal-background);scrollbar-width:thin}.DocSearch-Dropdown::-webkit-scrollbar{width:12px}.DocSearch-Dropdown::-webkit-scrollbar-track{background:#0000}.DocSearch-Dropdown::-webkit-scrollbar-thumb{background-color:var(--docsearch-muted-color);border:3px solid var(--docsearch-modal-background);border-radius:20px}.DocSearch-Dropdown ul{list-style:none;margin:0;padding:0}.DocSearch-Label{font-size:.75em;line-height:1.6em}.DocSearch-Help{font-size:.9em;margin:0;-webkit-user-select:none;user-select:none}.DocSearch-Title{font-size:1.2em}.DocSearch-Logo a{display:flex}.DocSearch-Logo svg{color:var(--docsearch-logo-color);margin-left:8px}.DocSearch-Hits:last-of-type{margin-bottom:24px}.DocSearch-Hits mark{background:none;color:var(--docsearch-highlight-color)}.DocSearch-HitsFooter{display:flex;font-size:.85em;justify-content:center;margin-bottom:var(--docsearch-spacing);padding:var(--docsearch-spacing)}.DocSearch-HitsFooter a{border-bottom:1px solid;color:inherit}.DocSearch-Hit{border-radius:4px;display:flex;padding-bottom:4px;position:relative}.DocSearch-Hit--deleting{opacity:0;transition:.25s linear}.DocSearch-Hit--favoriting{transform:scale(0);transform-origin:top center;transition:.25s linear .25s}.DocSearch-Hit a{background:var(--docsearch-hit-background);border-radius:4px;box-shadow:var(--docsearch-hit-shadow);display:block;padding-left:var(--docsearch-spacing);width:100%}.DocSearch-Hit-source{background:var(--docsearch-modal-background);color:var(--docsearch-highlight-color);font-size:.85em;font-weight:600;line-height:32px;margin:0 -4px;padding:8px 4px 0;position:sticky;top:0;z-index:10}.DocSearch-Hit-Tree{color:var(--docsearch-muted-color);height:var(--docsearch-hit-height);opacity:.5;width:24px}.DocSearch-Hit[aria-selected=true] a{background-color:var(--docsearch-highlight-color)}.DocSearch-Hit[aria-selected=true] mark{text-decoration:underline}.DocSearch-Hit-Container{align-items:center;color:var(--docsearch-hit-color);display:flex;flex-direction:row;height:var(--docsearch-hit-height);padding:0 var(--docsearch-spacing) 0 0}.DocSearch-Hit-icon{height:20px;width:20px}.DocSearch-Hit-action,.DocSearch-Hit-icon{color:var(--docsearch-muted-color)}.DocSearch-Hit-action{align-items:center;display:flex;height:22px;width:22px}.DocSearch-Hit-action svg{display:block;height:18px;width:18px}.DocSearch-Hit-action+.DocSearch-Hit-action{margin-left:6px}.DocSearch-Hit-action-button{appearance:none;background:none;border-radius:50%;color:inherit;padding:2px}svg.DocSearch-Hit-Select-Icon{display:none}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Select-Icon{display:block}.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:#0003;transition:background-color .1s ease-in}.DocSearch-Hit-action-button:focus path,.DocSearch-Hit-action-button:hover path{fill:#fff}.DocSearch-Hit-content-wrapper{display:flex;flex:1 1 auto;flex-direction:column;font-weight:500;justify-content:center;line-height:1.2em;margin:0 8px;overflow-x:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap;width:80%}.DocSearch-Hit-title{font-size:.9em}.DocSearch-Hit-path{color:var(--docsearch-muted-color);font-size:.75em}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Tree,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-action,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-icon,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-path,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-text,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-title,.DocSearch-Hit[aria-selected=true] mark{color:var(--docsearch-hit-active-color)!important}.DocSearch-ErrorScreen,.DocSearch-NoResults,.DocSearch-StartScreen{font-size:.9em;margin:0 auto;padding:36px 0;text-align:center;width:80%}.DocSearch-Screen-Icon{color:var(--docsearch-muted-color);padding-bottom:12px}.DocSearch-NoResults-Prefill-List{display:inline-block;padding-bottom:24px;text-align:left}.DocSearch-NoResults-Prefill-List ul{display:inline-block;padding:8px 0 0}.DocSearch-NoResults-Prefill-List li{list-style-position:inside;list-style-type:"» "}.DocSearch-Prefill{-webkit-appearance:none;appearance:none;background:none;border:0;border-radius:1em;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;font-size:1em;font-weight:700;padding:0}.DocSearch-Prefill:focus,.DocSearch-Prefill:hover{outline:0;text-decoration:underline}.DocSearch-Footer{align-items:center;background:var(--docsearch-footer-background);border-radius:0 0 8px 8px;box-shadow:var(--docsearch-footer-shadow);display:flex;flex-direction:row-reverse;flex-shrink:0;height:var(--docsearch-footer-height);justify-content:space-between;padding:0 var(--docsearch-spacing);position:relative;-webkit-user-select:none;user-select:none;width:100%;z-index:300}.DocSearch-Commands{color:var(--docsearch-muted-color);display:flex;list-style:none;margin:0;padding:0}.DocSearch-Commands li{align-items:center;display:flex}.DocSearch-Commands li:not(:last-of-type){margin-right:.8em}.DocSearch-Commands-Key{align-items:center;background:var(--docsearch-key-gradient);border:0;border-radius:2px;box-shadow:var(--docsearch-key-shadow);color:var(--docsearch-muted-color);display:flex;height:18px;justify-content:center;margin-right:.4em;padding:0 0 1px;width:20px}@keyframes g{0%{opacity:0}to{opacity:1}}.DocSearch-Button{margin:0;transition:all var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.DocSearch-Container{z-index:calc(var(--ifm-z-index-fixed) + 1)}@media (min-width:997px){.collapseSidebarButton_PEFL,.expandButton_m80_{background-color:var(--docusaurus-collapse-button-bg)}:root{--docusaurus-announcement-bar-height:30px}.announcementBarClose_gvF7,.announcementBarPlaceholder_vyr4{flex-basis:50px}.searchBox_ZlJk{padding:var(--ifm-navbar-item-padding-vertical) var(--ifm-navbar-item-padding-horizontal)}.lastUpdated_vwxv{text-align:right}.tocMobile_ITEo{display:none}.docItemCol_VOVn{max-width:75%!important}.collapseSidebarButton_PEFL{border:1px solid var(--ifm-toc-border-color);border-radius:0;bottom:0;display:block!important;height:40px;position:sticky}.collapseSidebarButtonIcon_kv0_{margin-top:4px;transform:rotate(180deg)}.expandButtonIcon_BlDH,[dir=rtl] .collapseSidebarButtonIcon_kv0_{transform:rotate(0)}.collapseSidebarButton_PEFL:focus,.collapseSidebarButton_PEFL:hover,.expandButton_m80_:focus,.expandButton_m80_:hover{background-color:var(--docusaurus-collapse-button-bg-hover)}.menuHtmlItem_M9Kj{padding:var(--ifm-menu-link-padding-vertical) var(--ifm-menu-link-padding-horizontal)}.menu_SIkG{flex-grow:1;padding:.5rem}@supports (scrollbar-gutter:stable){.menu_SIkG{padding:.5rem 0 .5rem .5rem;scrollbar-gutter:stable}}.menuWithAnnouncementBar_GW3s{margin-bottom:var(--docusaurus-announcement-bar-height)}.sidebar_njMd{display:flex;flex-direction:column;height:100%;padding-top:var(--ifm-navbar-height);width:var(--doc-sidebar-width)}.sidebarWithHideableNavbar_wUlq{padding-top:0}.sidebarHidden_VK0M{opacity:0;visibility:hidden}.sidebarLogo_isFc{align-items:center;color:inherit!important;display:flex!important;margin:0 var(--ifm-navbar-padding-horizontal);max-height:var(--ifm-navbar-height);min-height:var(--ifm-navbar-height);text-decoration:none!important}.sidebarLogo_isFc img{height:2rem;margin-right:.5rem}.expandButton_m80_{align-items:center;display:flex;height:100%;justify-content:center;position:absolute;right:0;top:0;transition:background-color var(--ifm-transition-fast) ease;width:100%}[dir=rtl] .expandButtonIcon_BlDH{transform:rotate(180deg)}.docSidebarContainer_b6E3{border-right:1px solid var(--ifm-toc-border-color);-webkit-clip-path:inset(0);clip-path:inset(0);display:block;margin-top:calc(var(--ifm-navbar-height)*-1);transition:width var(--ifm-transition-fast) ease;width:var(--doc-sidebar-width);will-change:width}.docSidebarContainerHidden_b3ry{cursor:pointer;width:var(--doc-sidebar-hidden-width)}.sidebarViewport_Xe31{height:100%;max-height:100vh;position:sticky;top:0}.docMainContainer_gTbr{flex-grow:1;max-width:calc(100% - var(--doc-sidebar-width))}.docMainContainerEnhanced_Uz_u{max-width:calc(100% - var(--doc-sidebar-hidden-width))}.docItemWrapperEnhanced_czyv{max-width:calc(var(--ifm-container-width) + var(--doc-sidebar-width))!important}}@media (min-width:1440px){.container{max-width:var(--ifm-container-width-xl)}}@media (max-width:996px){.col{--ifm-col-width:100%;flex-basis:var(--ifm-col-width);margin-left:0}.footer{--ifm-footer-padding-horizontal:0}.colorModeToggle_DEke,.footer__link-separator,.navbar__item,.tableOfContents_bqdL{display:none}.footer__col{margin-bottom:calc(var(--ifm-spacing-vertical)*3)}.footer__link-item{display:block}.hero{padding-left:0;padding-right:0}.navbar>.container,.navbar>.container-fluid{padding:0}.navbar__toggle{display:inherit}.navbar__search-input{width:9rem}.pills--block,.tabs--block{flex-direction:column}.searchBox_ZlJk{position:absolute;right:var(--ifm-navbar-padding-horizontal)}.docItemContainer_F8PC{padding:0 .3rem}}@media only screen and (max-width:996px){.searchQueryColumn_RTkw,.searchResultsColumn_JPFH{max-width:60%!important}.searchLogoColumn_rJIA,.searchVersionColumn_ypXd{max-width:40%!important}.searchLogoColumn_rJIA{padding-left:0!important}}@media (max-width:768px){.DocSearch-Button-Keys,.DocSearch-Button-Placeholder,.DocSearch-Commands,.DocSearch-Hit-Tree{display:none}:root{--docsearch-spacing:10px;--docsearch-footer-height:40px}.DocSearch-Dropdown{height:100%;max-height:calc(var(--docsearch-vh,1vh)*100 - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height))}.DocSearch-Container{height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh,1vh)*100);position:absolute}.DocSearch-Footer{border-radius:0;bottom:0;position:absolute}.DocSearch-Hit-content-wrapper{display:flex;position:relative;width:80%}.DocSearch-Modal{border-radius:0;box-shadow:none;height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh,1vh)*100);margin:0;max-width:100%;width:100%}.DocSearch-Cancel{-webkit-appearance:none;appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;flex:none;font:inherit;font-size:1em;font-weight:500;margin-left:var(--docsearch-spacing);outline:0;overflow:hidden;padding:0;-webkit-user-select:none;user-select:none;white-space:nowrap}}@media (max-width:576px){.markdown h1:first-child{--ifm-h1-font-size:2rem}.markdown>h2{--ifm-h2-font-size:1.5rem}.markdown>h3{--ifm-h3-font-size:1.25rem}}@media screen and (max-width:576px){.searchQueryColumn_RTkw{max-width:100%!important}.searchVersionColumn_ypXd{max-width:100%!important;padding-left:var(--ifm-spacing-horizontal)!important}}@media (hover:hover){.backToTopButton_sjWU:hover{background-color:var(--ifm-color-emphasis-300)}}@media (pointer:fine){.thin-scrollbar{scrollbar-width:thin}.thin-scrollbar::-webkit-scrollbar{height:var(--ifm-scrollbar-size);width:var(--ifm-scrollbar-size)}.thin-scrollbar::-webkit-scrollbar-track{background:var(--ifm-scrollbar-track-background-color);border-radius:10px}.thin-scrollbar::-webkit-scrollbar-thumb{background:var(--ifm-scrollbar-thumb-background-color);border-radius:10px}.thin-scrollbar::-webkit-scrollbar-thumb:hover{background:var(--ifm-scrollbar-thumb-hover-background-color)}}@media (prefers-reduced-motion:reduce){:root{--ifm-transition-fast:0ms;--ifm-transition-slow:0ms}.fa-beat,.fa-beat-fade,.fa-fade,.fa-flip,.fa-pulse,.fa-spin,.fa-spin-pulse{animation-delay:-1ms;animation-duration:1ms;animation-iteration-count:1;transition-delay:0s;transition-duration:0s}}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Reset{stroke-width:var(--docsearch-icon-stroke-width);animation:none;-webkit-appearance:none;appearance:none;background:none;border:0;border-radius:50%;color:var(--docsearch-icon-color);cursor:pointer;right:0}.DocSearch-Hit--deleting,.DocSearch-Hit--favoriting{transition:none}.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:#0003;transition:none}}@media print{.announcementBar_mb4j,.footer,.menu,.navbar,.pagination-nav,.table-of-contents,.tocMobile_ITEo{display:none}.tabs{page-break-inside:avoid}.codeBlockLines_e6Vv{white-space:pre-wrap}} \ No newline at end of file diff --git a/assets/css/styles.fba6cdd5.css b/assets/css/styles.fba6cdd5.css new file mode 100644 index 0000000..ac8d8e9 --- /dev/null +++ b/assets/css/styles.fba6cdd5.css @@ -0,0 +1 @@ +.col,.container{padding:0 var(--ifm-spacing-horizontal);width:100%}.markdown>h2,.markdown>h3,.markdown>h4,.markdown>h5,.markdown>h6{margin-bottom:calc(var(--ifm-heading-vertical-rhythm-bottom)*var(--ifm-leading))}.markdown li,body{word-wrap:break-word}body,ol ol,ol ul,ul ol,ul ul{margin:0}pre,table{overflow:auto}blockquote,pre{margin:0 0 var(--ifm-spacing-vertical)}.breadcrumbs__link,.button{transition-timing-function:var(--ifm-transition-timing-default)}.button,.hash-link{-webkit-user-select:none}.button,code{vertical-align:middle}.button--outline.button--active,.button--outline:active,.button--outline:hover,:root{--ifm-button-color:var(--ifm-font-color-base-inverse)}.menu__link:hover,a{transition:color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.navbar--dark,:root{--ifm-navbar-link-hover-color:var(--ifm-color-primary)}.menu,.navbar-sidebar{overflow-x:hidden}:root,html[data-theme=dark]{--ifm-color-emphasis-500:var(--ifm-color-gray-500)}.fa-beat,.fa-bounce{animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-duration:var(--fa-animation-duration,1s)}.fa-beat,.fa-beat-fade,.fa-bounce,.fa-fade,.fa-flip,.fa-shake{animation-duration:var(--fa-animation-duration,1s)}.fa-beat,.fa-beat-fade,.fa-bounce,.fa-fade,.fa-flip,.fa-shake,.fa-spin{animation-delay:var(--fa-animation-delay,0s);animation-direction:var(--fa-animation-direction,normal)}.fa-beat,.fa-beat-fade,.fa-bounce,.fa-fade,.fa-flip,.fa-pulse,.fa-shake,.fa-spin,.fa-spin-pulse{animation-direction:var(--fa-animation-direction,normal)}.toggleButton_gllP,html{-webkit-tap-highlight-color:transparent}*,.DocSearch-Container,.DocSearch-Container *,.fa-layers-counter{box-sizing:border-box}:root{--ifm-color-scheme:light;--ifm-dark-value:10%;--ifm-darker-value:15%;--ifm-darkest-value:30%;--ifm-light-value:15%;--ifm-lighter-value:30%;--ifm-lightest-value:50%;--ifm-contrast-background-value:90%;--ifm-contrast-foreground-value:70%;--ifm-contrast-background-dark-value:70%;--ifm-contrast-foreground-dark-value:90%;--ifm-color-primary:#3578e5;--ifm-color-secondary:#ebedf0;--ifm-color-success:#00a400;--ifm-color-info:#54c7ec;--ifm-color-warning:#ffba00;--ifm-color-danger:#fa383e;--ifm-color-primary-dark:#306cce;--ifm-color-primary-darker:#2d66c3;--ifm-color-primary-darkest:#2554a0;--ifm-color-primary-light:#538ce9;--ifm-color-primary-lighter:#72a1ed;--ifm-color-primary-lightest:#9abcf2;--ifm-color-primary-contrast-background:#ebf2fc;--ifm-color-primary-contrast-foreground:#102445;--ifm-color-secondary-dark:#d4d5d8;--ifm-color-secondary-darker:#c8c9cc;--ifm-color-secondary-darkest:#a4a6a8;--ifm-color-secondary-light:#eef0f2;--ifm-color-secondary-lighter:#f1f2f5;--ifm-color-secondary-lightest:#f5f6f8;--ifm-color-secondary-contrast-background:#fdfdfe;--ifm-color-secondary-contrast-foreground:#474748;--ifm-color-success-dark:#009400;--ifm-color-success-darker:#008b00;--ifm-color-success-darkest:#007300;--ifm-color-success-light:#26b226;--ifm-color-success-lighter:#4dbf4d;--ifm-color-success-lightest:#80d280;--ifm-color-success-contrast-background:#e6f6e6;--ifm-color-success-contrast-foreground:#003100;--ifm-color-info-dark:#4cb3d4;--ifm-color-info-darker:#47a9c9;--ifm-color-info-darkest:#3b8ba5;--ifm-color-info-light:#6ecfef;--ifm-color-info-lighter:#87d8f2;--ifm-color-info-lightest:#aae3f6;--ifm-color-info-contrast-background:#eef9fd;--ifm-color-info-contrast-foreground:#193c47;--ifm-color-warning-dark:#e6a700;--ifm-color-warning-darker:#d99e00;--ifm-color-warning-darkest:#b38200;--ifm-color-warning-light:#ffc426;--ifm-color-warning-lighter:#ffcf4d;--ifm-color-warning-lightest:#ffdd80;--ifm-color-warning-contrast-background:#fff8e6;--ifm-color-warning-contrast-foreground:#4d3800;--ifm-color-danger-dark:#e13238;--ifm-color-danger-darker:#d53035;--ifm-color-danger-darkest:#af272b;--ifm-color-danger-light:#fb565b;--ifm-color-danger-lighter:#fb7478;--ifm-color-danger-lightest:#fd9c9f;--ifm-color-danger-contrast-background:#ffebec;--ifm-color-danger-contrast-foreground:#4b1113;--ifm-color-white:#fff;--ifm-color-black:#000;--ifm-color-gray-0:var(--ifm-color-white);--ifm-color-gray-100:#f5f6f7;--ifm-color-gray-200:#ebedf0;--ifm-color-gray-300:#dadde1;--ifm-color-gray-400:#ccd0d5;--ifm-color-gray-500:#bec3c9;--ifm-color-gray-600:#8d949e;--ifm-color-gray-700:#606770;--ifm-color-gray-800:#444950;--ifm-color-gray-900:#1c1e21;--ifm-color-gray-1000:var(--ifm-color-black);--ifm-color-emphasis-0:var(--ifm-color-gray-0);--ifm-color-emphasis-100:var(--ifm-color-gray-100);--ifm-color-emphasis-200:var(--ifm-color-gray-200);--ifm-color-emphasis-300:var(--ifm-color-gray-300);--ifm-color-emphasis-400:var(--ifm-color-gray-400);--ifm-color-emphasis-600:var(--ifm-color-gray-600);--ifm-color-emphasis-700:var(--ifm-color-gray-700);--ifm-color-emphasis-800:var(--ifm-color-gray-800);--ifm-color-emphasis-900:var(--ifm-color-gray-900);--ifm-color-emphasis-1000:var(--ifm-color-gray-1000);--ifm-color-content:var(--ifm-color-emphasis-900);--ifm-color-content-inverse:var(--ifm-color-emphasis-0);--ifm-color-content-secondary:#525860;--ifm-background-color:#0000;--ifm-background-surface-color:var(--ifm-color-content-inverse);--ifm-global-border-width:1px;--ifm-global-radius:0.4rem;--ifm-hover-overlay:#0000000d;--ifm-font-color-base:var(--ifm-color-content);--ifm-font-color-base-inverse:var(--ifm-color-content-inverse);--ifm-font-color-secondary:var(--ifm-color-content-secondary);--ifm-font-family-base:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ifm-font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--ifm-font-size-base:100%;--ifm-font-weight-light:300;--ifm-font-weight-normal:400;--ifm-font-weight-semibold:500;--ifm-font-weight-bold:700;--ifm-font-weight-base:var(--ifm-font-weight-normal);--ifm-line-height-base:1.65;--ifm-global-spacing:1rem;--ifm-spacing-vertical:var(--ifm-global-spacing);--ifm-spacing-horizontal:var(--ifm-global-spacing);--ifm-transition-fast:200ms;--ifm-transition-slow:400ms;--ifm-transition-timing-default:cubic-bezier(0.08,0.52,0.52,1);--ifm-global-shadow-lw:0 1px 2px 0 #0000001a;--ifm-global-shadow-md:0 5px 40px #0003;--ifm-global-shadow-tl:0 12px 28px 0 #0003,0 2px 4px 0 #0000001a;--ifm-z-index-dropdown:100;--ifm-z-index-fixed:200;--ifm-z-index-overlay:400;--ifm-container-width:1140px;--ifm-container-width-xl:1320px;--ifm-code-background:#f6f7f8;--ifm-code-border-radius:var(--ifm-global-radius);--ifm-code-font-size:90%;--ifm-code-padding-horizontal:0.1rem;--ifm-code-padding-vertical:0.1rem;--ifm-pre-background:var(--ifm-code-background);--ifm-pre-border-radius:var(--ifm-code-border-radius);--ifm-pre-color:inherit;--ifm-pre-line-height:1.45;--ifm-pre-padding:1rem;--ifm-heading-color:inherit;--ifm-heading-margin-top:0;--ifm-heading-margin-bottom:var(--ifm-spacing-vertical);--ifm-heading-font-family:var(--ifm-font-family-base);--ifm-heading-font-weight:var(--ifm-font-weight-bold);--ifm-heading-line-height:1.25;--ifm-h1-font-size:2rem;--ifm-h2-font-size:1.5rem;--ifm-h3-font-size:1.25rem;--ifm-h4-font-size:1rem;--ifm-h5-font-size:0.875rem;--ifm-h6-font-size:0.85rem;--ifm-image-alignment-padding:1.25rem;--ifm-leading-desktop:1.25;--ifm-leading:calc(var(--ifm-leading-desktop)*1rem);--ifm-list-left-padding:2rem;--ifm-list-margin:1rem;--ifm-list-item-margin:0.25rem;--ifm-list-paragraph-margin:1rem;--ifm-table-cell-padding:0.75rem;--ifm-table-background:#0000;--ifm-table-stripe-background:#00000008;--ifm-table-border-width:1px;--ifm-table-border-color:var(--ifm-color-emphasis-300);--ifm-table-head-background:inherit;--ifm-table-head-color:inherit;--ifm-table-head-font-weight:var(--ifm-font-weight-bold);--ifm-table-cell-color:inherit;--ifm-link-color:var(--ifm-color-primary);--ifm-link-decoration:none;--ifm-link-hover-color:var(--ifm-link-color);--ifm-link-hover-decoration:underline;--ifm-paragraph-margin-bottom:var(--ifm-leading);--ifm-blockquote-font-size:var(--ifm-font-size-base);--ifm-blockquote-border-left-width:2px;--ifm-blockquote-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-blockquote-padding-vertical:0;--ifm-blockquote-shadow:none;--ifm-blockquote-color:var(--ifm-color-emphasis-800);--ifm-blockquote-border-color:var(--ifm-color-emphasis-300);--ifm-hr-background-color:var(--ifm-color-emphasis-500);--ifm-hr-height:1px;--ifm-hr-margin-vertical:1.5rem;--ifm-scrollbar-size:7px;--ifm-scrollbar-track-background-color:#f1f1f1;--ifm-scrollbar-thumb-background-color:silver;--ifm-scrollbar-thumb-hover-background-color:#a7a7a7;--ifm-alert-background-color:inherit;--ifm-alert-border-color:inherit;--ifm-alert-border-radius:var(--ifm-global-radius);--ifm-alert-border-width:0px;--ifm-alert-border-left-width:5px;--ifm-alert-color:var(--ifm-font-color-base);--ifm-alert-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-alert-padding-vertical:var(--ifm-spacing-vertical);--ifm-alert-shadow:var(--ifm-global-shadow-lw);--ifm-avatar-intro-margin:1rem;--ifm-avatar-intro-alignment:inherit;--ifm-avatar-photo-size:3rem;--ifm-badge-background-color:inherit;--ifm-badge-border-color:inherit;--ifm-badge-border-radius:var(--ifm-global-radius);--ifm-badge-border-width:var(--ifm-global-border-width);--ifm-badge-color:var(--ifm-color-white);--ifm-badge-padding-horizontal:calc(var(--ifm-spacing-horizontal)*0.5);--ifm-badge-padding-vertical:calc(var(--ifm-spacing-vertical)*0.25);--ifm-breadcrumb-border-radius:1.5rem;--ifm-breadcrumb-spacing:0.5rem;--ifm-breadcrumb-color-active:var(--ifm-color-primary);--ifm-breadcrumb-item-background-active:var(--ifm-hover-overlay);--ifm-breadcrumb-padding-horizontal:0.8rem;--ifm-breadcrumb-padding-vertical:0.4rem;--ifm-breadcrumb-size-multiplier:1;--ifm-breadcrumb-separator:url('data:image/svg+xml;utf8,');--ifm-breadcrumb-separator-filter:none;--ifm-breadcrumb-separator-size:0.5rem;--ifm-breadcrumb-separator-size-multiplier:1.25;--ifm-button-background-color:inherit;--ifm-button-border-color:var(--ifm-button-background-color);--ifm-button-border-width:var(--ifm-global-border-width);--ifm-button-font-weight:var(--ifm-font-weight-bold);--ifm-button-padding-horizontal:1.5rem;--ifm-button-padding-vertical:0.375rem;--ifm-button-size-multiplier:1;--ifm-button-transition-duration:var(--ifm-transition-fast);--ifm-button-border-radius:calc(var(--ifm-global-radius)*var(--ifm-button-size-multiplier));--ifm-button-group-spacing:2px;--ifm-card-background-color:var(--ifm-background-surface-color);--ifm-card-border-radius:calc(var(--ifm-global-radius)*2);--ifm-card-horizontal-spacing:var(--ifm-global-spacing);--ifm-card-vertical-spacing:var(--ifm-global-spacing);--ifm-toc-border-color:var(--ifm-color-emphasis-300);--ifm-toc-link-color:var(--ifm-color-content-secondary);--ifm-toc-padding-vertical:0.5rem;--ifm-toc-padding-horizontal:0.5rem;--ifm-dropdown-background-color:var(--ifm-background-surface-color);--ifm-dropdown-font-weight:var(--ifm-font-weight-semibold);--ifm-dropdown-link-color:var(--ifm-font-color-base);--ifm-dropdown-hover-background-color:var(--ifm-hover-overlay);--ifm-footer-background-color:var(--ifm-color-emphasis-100);--ifm-footer-color:inherit;--ifm-footer-link-color:var(--ifm-color-emphasis-700);--ifm-footer-link-hover-color:var(--ifm-color-primary);--ifm-footer-link-horizontal-spacing:0.5rem;--ifm-footer-padding-horizontal:calc(var(--ifm-spacing-horizontal)*2);--ifm-footer-padding-vertical:calc(var(--ifm-spacing-vertical)*2);--ifm-footer-title-color:inherit;--ifm-footer-logo-max-width:min(30rem,90vw);--ifm-hero-background-color:var(--ifm-background-surface-color);--ifm-hero-text-color:var(--ifm-color-emphasis-800);--ifm-menu-color:var(--ifm-color-emphasis-700);--ifm-menu-color-active:var(--ifm-color-primary);--ifm-menu-color-background-active:var(--ifm-hover-overlay);--ifm-menu-color-background-hover:var(--ifm-hover-overlay);--ifm-menu-link-padding-horizontal:0.75rem;--ifm-menu-link-padding-vertical:0.375rem;--ifm-menu-link-sublist-icon:url('data:image/svg+xml;utf8,');--ifm-menu-link-sublist-icon-filter:none;--ifm-navbar-background-color:var(--ifm-background-surface-color);--ifm-navbar-height:3.75rem;--ifm-navbar-item-padding-horizontal:0.75rem;--ifm-navbar-item-padding-vertical:0.25rem;--ifm-navbar-link-color:var(--ifm-font-color-base);--ifm-navbar-link-active-color:var(--ifm-link-color);--ifm-navbar-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-navbar-padding-vertical:calc(var(--ifm-spacing-vertical)*0.5);--ifm-navbar-shadow:var(--ifm-global-shadow-lw);--ifm-navbar-search-input-background-color:var(--ifm-color-emphasis-200);--ifm-navbar-search-input-color:var(--ifm-color-emphasis-800);--ifm-navbar-search-input-placeholder-color:var(--ifm-color-emphasis-500);--ifm-navbar-search-input-icon:url('data:image/svg+xml;utf8,');--ifm-navbar-sidebar-width:83vw;--ifm-pagination-border-radius:var(--ifm-global-radius);--ifm-pagination-color-active:var(--ifm-color-primary);--ifm-pagination-font-size:1rem;--ifm-pagination-item-active-background:var(--ifm-hover-overlay);--ifm-pagination-page-spacing:0.2em;--ifm-pagination-padding-horizontal:calc(var(--ifm-spacing-horizontal)*1);--ifm-pagination-padding-vertical:calc(var(--ifm-spacing-vertical)*0.25);--ifm-pagination-nav-border-radius:var(--ifm-global-radius);--ifm-pagination-nav-color-hover:var(--ifm-color-primary);--ifm-pills-color-active:var(--ifm-color-primary);--ifm-pills-color-background-active:var(--ifm-hover-overlay);--ifm-pills-spacing:0.125rem;--ifm-tabs-color:var(--ifm-font-color-secondary);--ifm-tabs-color-active:var(--ifm-color-primary);--ifm-tabs-color-active-border:var(--ifm-tabs-color-active);--ifm-tabs-padding-horizontal:1rem;--ifm-tabs-padding-vertical:1rem}.badge--danger,.badge--info,.badge--primary,.badge--secondary,.badge--success,.badge--warning{--ifm-badge-border-color:var(--ifm-badge-background-color)}.button--link,.button--outline{--ifm-button-background-color:#0000}html{-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;text-size-adjust:100%;background-color:var(--ifm-background-color);color:var(--ifm-font-color-base);color-scheme:var(--ifm-color-scheme);font:var(--ifm-font-size-base)/var(--ifm-line-height-base) var(--ifm-font-family-base);text-rendering:optimizelegibility}iframe{border:0;color-scheme:auto}.container{margin:0 auto;max-width:var(--ifm-container-width)}.container--fluid{max-width:inherit}.row{display:flex;flex-wrap:wrap;margin:0 calc(var(--ifm-spacing-horizontal)*-1)}.margin-bottom--none,.margin-vert--none,.markdown>:last-child{margin-bottom:0!important}.margin-top--none,.margin-vert--none,.tabItem_LNqP{margin-top:0!important}.row--no-gutters{margin-left:0;margin-right:0}.margin-horiz--none,.margin-right--none{margin-right:0!important}.row--no-gutters>.col{padding-left:0;padding-right:0}.row--align-top{align-items:flex-start}.row--align-bottom{align-items:flex-end}.menuExternalLink_NmtK,.row--align-center{align-items:center}.row--align-stretch{align-items:stretch}.row--align-baseline{align-items:baseline}.col{--ifm-col-width:100%;flex:1 0;margin-left:0;max-width:var(--ifm-col-width)}.padding-bottom--none,.padding-vert--none{padding-bottom:0!important}.padding-top--none,.padding-vert--none{padding-top:0!important}.padding-horiz--none,.padding-left--none{padding-left:0!important}.padding-horiz--none,.padding-right--none{padding-right:0!important}.col[class*=col--]{flex:0 0 var(--ifm-col-width)}.col--1{--ifm-col-width:8.33333%}.col--offset-1{margin-left:8.33333%}.col--2{--ifm-col-width:16.66667%}.col--offset-2{margin-left:16.66667%}.col--3{--ifm-col-width:25%}.col--offset-3{margin-left:25%}.col--4{--ifm-col-width:33.33333%}.col--offset-4{margin-left:33.33333%}.col--5{--ifm-col-width:41.66667%}.col--offset-5{margin-left:41.66667%}.col--6{--ifm-col-width:50%}.col--offset-6{margin-left:50%}.col--7{--ifm-col-width:58.33333%}.col--offset-7{margin-left:58.33333%}.col--8{--ifm-col-width:66.66667%}.col--offset-8{margin-left:66.66667%}.col--9{--ifm-col-width:75%}.col--offset-9{margin-left:75%}.col--10{--ifm-col-width:83.33333%}.col--offset-10{margin-left:83.33333%}.col--11{--ifm-col-width:91.66667%}.col--offset-11{margin-left:91.66667%}.col--12{--ifm-col-width:100%}.col--offset-12{margin-left:100%}.margin-horiz--none,.margin-left--none{margin-left:0!important}.margin--none{margin:0!important}.margin-bottom--xs,.margin-vert--xs{margin-bottom:.25rem!important}.margin-top--xs,.margin-vert--xs{margin-top:.25rem!important}.margin-horiz--xs,.margin-left--xs{margin-left:.25rem!important}.margin-horiz--xs,.margin-right--xs{margin-right:.25rem!important}.margin--xs{margin:.25rem!important}.margin-bottom--sm,.margin-vert--sm{margin-bottom:.5rem!important}.margin-top--sm,.margin-vert--sm{margin-top:.5rem!important}.margin-horiz--sm,.margin-left--sm{margin-left:.5rem!important}.margin-horiz--sm,.margin-right--sm{margin-right:.5rem!important}.margin--sm{margin:.5rem!important}.margin-bottom--md,.margin-vert--md{margin-bottom:1rem!important}.margin-top--md,.margin-vert--md{margin-top:1rem!important}.margin-horiz--md,.margin-left--md{margin-left:1rem!important}.margin-horiz--md,.margin-right--md{margin-right:1rem!important}.margin--md{margin:1rem!important}.margin-bottom--lg,.margin-vert--lg{margin-bottom:2rem!important}.margin-top--lg,.margin-vert--lg{margin-top:2rem!important}.margin-horiz--lg,.margin-left--lg{margin-left:2rem!important}.margin-horiz--lg,.margin-right--lg{margin-right:2rem!important}.margin--lg{margin:2rem!important}.margin-bottom--xl,.margin-vert--xl{margin-bottom:5rem!important}.margin-top--xl,.margin-vert--xl{margin-top:5rem!important}.margin-horiz--xl,.margin-left--xl{margin-left:5rem!important}.margin-horiz--xl,.margin-right--xl{margin-right:5rem!important}.margin--xl{margin:5rem!important}.padding--none{padding:0!important}.padding-bottom--xs,.padding-vert--xs{padding-bottom:.25rem!important}.padding-top--xs,.padding-vert--xs{padding-top:.25rem!important}.padding-horiz--xs,.padding-left--xs{padding-left:.25rem!important}.padding-horiz--xs,.padding-right--xs{padding-right:.25rem!important}.padding--xs{padding:.25rem!important}.padding-bottom--sm,.padding-vert--sm{padding-bottom:.5rem!important}.padding-top--sm,.padding-vert--sm{padding-top:.5rem!important}.padding-horiz--sm,.padding-left--sm{padding-left:.5rem!important}.padding-horiz--sm,.padding-right--sm{padding-right:.5rem!important}.padding--sm{padding:.5rem!important}.padding-bottom--md,.padding-vert--md{padding-bottom:1rem!important}.padding-top--md,.padding-vert--md{padding-top:1rem!important}.padding-horiz--md,.padding-left--md{padding-left:1rem!important}.padding-horiz--md,.padding-right--md{padding-right:1rem!important}.padding--md{padding:1rem!important}.padding-bottom--lg,.padding-vert--lg{padding-bottom:2rem!important}.padding-top--lg,.padding-vert--lg{padding-top:2rem!important}.padding-horiz--lg,.padding-left--lg{padding-left:2rem!important}.padding-horiz--lg,.padding-right--lg{padding-right:2rem!important}.padding--lg{padding:2rem!important}.padding-bottom--xl,.padding-vert--xl{padding-bottom:5rem!important}.padding-top--xl,.padding-vert--xl{padding-top:5rem!important}.padding-horiz--xl,.padding-left--xl{padding-left:5rem!important}.padding-horiz--xl,.padding-right--xl{padding-right:5rem!important}.padding--xl{padding:5rem!important}code{background-color:var(--ifm-code-background);border:.1rem solid #0000001a;border-radius:var(--ifm-code-border-radius);font-family:var(--ifm-font-family-monospace);font-size:var(--ifm-code-font-size);padding:var(--ifm-code-padding-vertical) var(--ifm-code-padding-horizontal)}a code{color:inherit}pre{background-color:var(--ifm-pre-background);border-radius:var(--ifm-pre-border-radius);color:var(--ifm-pre-color);font:var(--ifm-code-font-size)/var(--ifm-pre-line-height) var(--ifm-font-family-monospace);padding:var(--ifm-pre-padding)}pre code{background-color:initial;border:none;font-size:100%;line-height:inherit;padding:0}kbd{background-color:var(--ifm-color-emphasis-0);border:1px solid var(--ifm-color-emphasis-400);border-radius:.2rem;box-shadow:inset 0 -1px 0 var(--ifm-color-emphasis-400);color:var(--ifm-color-emphasis-800);font:80% var(--ifm-font-family-monospace);padding:.15rem .3rem}h1,h2,h3,h4,h5,h6{color:var(--ifm-heading-color);font-family:var(--ifm-heading-font-family);font-weight:var(--ifm-heading-font-weight);line-height:var(--ifm-heading-line-height);margin:var(--ifm-heading-margin-top) 0 var(--ifm-heading-margin-bottom) 0}h1{font-size:var(--ifm-h1-font-size)}h2{font-size:var(--ifm-h2-font-size)}h3{font-size:var(--ifm-h3-font-size)}h4{font-size:var(--ifm-h4-font-size)}h5{font-size:var(--ifm-h5-font-size)}h6{font-size:var(--ifm-h6-font-size)}img{max-width:100%}img[align=right]{padding-left:var(--image-alignment-padding)}img[align=left]{padding-right:var(--image-alignment-padding)}.markdown{--ifm-h1-vertical-rhythm-top:3;--ifm-h2-vertical-rhythm-top:2;--ifm-h3-vertical-rhythm-top:1.5;--ifm-heading-vertical-rhythm-top:1.25;--ifm-h1-vertical-rhythm-bottom:1.25;--ifm-heading-vertical-rhythm-bottom:1}.markdown:after,.markdown:before{content:"";display:table}.markdown:after{clear:both}.markdown h1:first-child{--ifm-h1-font-size:3rem;margin-bottom:calc(var(--ifm-h1-vertical-rhythm-bottom)*var(--ifm-leading))}.markdown>h2{--ifm-h2-font-size:2rem;margin-top:calc(var(--ifm-h2-vertical-rhythm-top)*var(--ifm-leading))}.markdown>h3{--ifm-h3-font-size:1.5rem;margin-top:calc(var(--ifm-h3-vertical-rhythm-top)*var(--ifm-leading))}.markdown>h4,.markdown>h5,.markdown>h6{margin-top:calc(var(--ifm-heading-vertical-rhythm-top)*var(--ifm-leading))}.markdown>p,.markdown>pre,.markdown>ul,.tabList__CuJ{margin-bottom:var(--ifm-leading)}.markdown li>p{margin-top:var(--ifm-list-paragraph-margin)}.markdown li+li{margin-top:var(--ifm-list-item-margin)}ol,ul{margin:0 0 var(--ifm-list-margin);padding-left:var(--ifm-list-left-padding)}ol ol,ul ol{list-style-type:lower-roman}ol ol ol,ol ul ol,ul ol ol,ul ul ol{list-style-type:lower-alpha}table{border-collapse:collapse;display:block;margin-bottom:var(--ifm-spacing-vertical)}table thead tr{border-bottom:2px solid var(--ifm-table-border-color)}table thead,table tr:nth-child(2n){background-color:var(--ifm-table-stripe-background)}table tr{background-color:var(--ifm-table-background);border-top:var(--ifm-table-border-width) solid var(--ifm-table-border-color)}table td,table th{border:var(--ifm-table-border-width) solid var(--ifm-table-border-color);padding:var(--ifm-table-cell-padding)}table th{background-color:var(--ifm-table-head-background);color:var(--ifm-table-head-color);font-weight:var(--ifm-table-head-font-weight)}table td{color:var(--ifm-table-cell-color)}strong{font-weight:var(--ifm-font-weight-bold)}a{color:var(--ifm-link-color);text-decoration:var(--ifm-link-decoration)}a:hover{color:var(--ifm-link-hover-color);text-decoration:var(--ifm-link-hover-decoration)}.button:hover,.text--no-decoration,.text--no-decoration:hover,a:not([href]){text-decoration:none}p{margin:0 0 var(--ifm-paragraph-margin-bottom)}blockquote{border-left:var(--ifm-blockquote-border-left-width) solid var(--ifm-blockquote-border-color);box-shadow:var(--ifm-blockquote-shadow);color:var(--ifm-blockquote-color);font-size:var(--ifm-blockquote-font-size);padding:var(--ifm-blockquote-padding-vertical) var(--ifm-blockquote-padding-horizontal)}blockquote>:first-child{margin-top:0}blockquote>:last-child{margin-bottom:0}hr{background-color:var(--ifm-hr-background-color);border:0;height:var(--ifm-hr-height);margin:var(--ifm-hr-margin-vertical) 0}.shadow--lw{box-shadow:var(--ifm-global-shadow-lw)!important}.shadow--md{box-shadow:var(--ifm-global-shadow-md)!important}.shadow--tl{box-shadow:var(--ifm-global-shadow-tl)!important}.text--primary,.wordWrapButtonEnabled_EoeP .wordWrapButtonIcon_Bwma{color:var(--ifm-color-primary)}.text--secondary{color:var(--ifm-color-secondary)}.text--success{color:var(--ifm-color-success)}.text--info{color:var(--ifm-color-info)}.text--warning{color:var(--ifm-color-warning)}.text--danger{color:var(--ifm-color-danger)}.text--center{text-align:center}.text--left{text-align:left}.text--justify{text-align:justify}.text--right{text-align:right}.text--capitalize{text-transform:capitalize}.text--lowercase{text-transform:lowercase}.admonitionHeading_tbUL,.alert__heading,.navbar,.text--uppercase{text-transform:uppercase}.text--light{font-weight:var(--ifm-font-weight-light)}.text--normal{font-weight:var(--ifm-font-weight-normal)}.text--semibold{font-weight:var(--ifm-font-weight-semibold)}.text--bold{font-weight:var(--ifm-font-weight-bold)}.text--italic{font-style:italic}.text--truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text--break{word-wrap:break-word!important;word-break:break-word!important}.clean-btn{background:none;border:none;color:inherit;cursor:pointer;font-family:inherit;padding:0}.alert,.alert .close{color:var(--ifm-alert-foreground-color)}.clean-list{list-style:none;padding-left:0}.alert--primary{--ifm-alert-background-color:var(--ifm-color-primary-contrast-background);--ifm-alert-background-color-highlight:#3578e526;--ifm-alert-foreground-color:var(--ifm-color-primary-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-primary-dark)}.alert--secondary{--ifm-alert-background-color:var(--ifm-color-secondary-contrast-background);--ifm-alert-background-color-highlight:#ebedf026;--ifm-alert-foreground-color:var(--ifm-color-secondary-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-secondary-dark)}.alert--success{--ifm-alert-background-color:var(--ifm-color-success-contrast-background);--ifm-alert-background-color-highlight:#00a40026;--ifm-alert-foreground-color:var(--ifm-color-success-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-success-dark)}.alert--info{--ifm-alert-background-color:var(--ifm-color-info-contrast-background);--ifm-alert-background-color-highlight:#54c7ec26;--ifm-alert-foreground-color:var(--ifm-color-info-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-info-dark)}.alert--warning{--ifm-alert-background-color:var(--ifm-color-warning-contrast-background);--ifm-alert-background-color-highlight:#ffba0026;--ifm-alert-foreground-color:var(--ifm-color-warning-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-warning-dark)}.alert--danger{--ifm-alert-background-color:var(--ifm-color-danger-contrast-background);--ifm-alert-background-color-highlight:#fa383e26;--ifm-alert-foreground-color:var(--ifm-color-danger-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-danger-dark)}.alert{--ifm-code-background:var(--ifm-alert-background-color-highlight);--ifm-link-color:var(--ifm-alert-foreground-color);--ifm-link-hover-color:var(--ifm-alert-foreground-color);--ifm-link-decoration:underline;--ifm-tabs-color:var(--ifm-alert-foreground-color);--ifm-tabs-color-active:var(--ifm-alert-foreground-color);--ifm-tabs-color-active-border:var(--ifm-alert-border-color);background-color:var(--ifm-alert-background-color);border:var(--ifm-alert-border-width) solid var(--ifm-alert-border-color);border-left-width:var(--ifm-alert-border-left-width);border-radius:var(--ifm-alert-border-radius);box-shadow:var(--ifm-alert-shadow);padding:var(--ifm-alert-padding-vertical) var(--ifm-alert-padding-horizontal)}.alert__heading{align-items:center;display:flex;font:700 var(--ifm-h5-font-size)/var(--ifm-heading-line-height) var(--ifm-heading-font-family);margin-bottom:.5rem}.alert__icon{display:inline-flex;margin-right:.4em}.alert__icon svg{fill:var(--ifm-alert-foreground-color);stroke:var(--ifm-alert-foreground-color);stroke-width:0}.alert .close{margin:calc(var(--ifm-alert-padding-vertical)*-1) calc(var(--ifm-alert-padding-horizontal)*-1) 0 0;opacity:.75}.alert .close:focus,.alert .close:hover{opacity:1}.alert a{text-decoration-color:var(--ifm-alert-border-color)}.alert a:hover{text-decoration-thickness:2px}.avatar{column-gap:var(--ifm-avatar-intro-margin);display:flex}.avatar__photo{border-radius:50%;display:block;height:var(--ifm-avatar-photo-size);overflow:hidden;width:var(--ifm-avatar-photo-size)}.card--full-height,.navbar__logo img,body,html{height:100%}.avatar__photo--sm{--ifm-avatar-photo-size:2rem}.avatar__photo--lg{--ifm-avatar-photo-size:4rem}.avatar__photo--xl{--ifm-avatar-photo-size:6rem}.avatar__intro{display:flex;flex:1 1;flex-direction:column;justify-content:center;text-align:var(--ifm-avatar-intro-alignment)}.badge,.breadcrumbs__item,.breadcrumbs__link,.button,.dropdown>.navbar__link:after{display:inline-block}.avatar__name{font:700 var(--ifm-h4-font-size)/var(--ifm-heading-line-height) var(--ifm-font-family-base)}.avatar__subtitle{margin-top:.25rem}.avatar--vertical{--ifm-avatar-intro-alignment:center;--ifm-avatar-intro-margin:0.5rem;align-items:center;flex-direction:column}.badge{background-color:var(--ifm-badge-background-color);border:var(--ifm-badge-border-width) solid var(--ifm-badge-border-color);border-radius:var(--ifm-badge-border-radius);color:var(--ifm-badge-color);font-size:75%;font-weight:var(--ifm-font-weight-bold);line-height:1;padding:var(--ifm-badge-padding-vertical) var(--ifm-badge-padding-horizontal)}.badge--primary{--ifm-badge-background-color:var(--ifm-color-primary)}.badge--secondary{--ifm-badge-background-color:var(--ifm-color-secondary);color:var(--ifm-color-black)}.breadcrumbs__link,.button.button--secondary.button--outline:not(.button--active):not(:hover),.openapidoc_oorz table>tbody>tr{color:var(--ifm-font-color-base)}.badge--success{--ifm-badge-background-color:var(--ifm-color-success)}.badge--info{--ifm-badge-background-color:var(--ifm-color-info)}.badge--warning{--ifm-badge-background-color:var(--ifm-color-warning)}.badge--danger{--ifm-badge-background-color:var(--ifm-color-danger)}.breadcrumbs{margin-bottom:0;padding-left:0}.breadcrumbs__item:not(:last-child):after{background:var(--ifm-breadcrumb-separator) center;content:" ";display:inline-block;filter:var(--ifm-breadcrumb-separator-filter);height:calc(var(--ifm-breadcrumb-separator-size)*var(--ifm-breadcrumb-size-multiplier)*var(--ifm-breadcrumb-separator-size-multiplier));margin:0 var(--ifm-breadcrumb-spacing);opacity:.5;width:calc(var(--ifm-breadcrumb-separator-size)*var(--ifm-breadcrumb-size-multiplier)*var(--ifm-breadcrumb-separator-size-multiplier))}.breadcrumbs__item--active .breadcrumbs__link{background:var(--ifm-breadcrumb-item-background-active);color:var(--ifm-breadcrumb-color-active)}.breadcrumbs__link{border-radius:var(--ifm-breadcrumb-border-radius);font-size:calc(1rem*var(--ifm-breadcrumb-size-multiplier));padding:calc(var(--ifm-breadcrumb-padding-vertical)*var(--ifm-breadcrumb-size-multiplier)) calc(var(--ifm-breadcrumb-padding-horizontal)*var(--ifm-breadcrumb-size-multiplier));transition-duration:var(--ifm-transition-fast);transition-property:background,color}.breadcrumbs__link:any-link:hover,.breadcrumbs__link:link:hover,.breadcrumbs__link:visited:hover,area[href].breadcrumbs__link:hover{background:var(--ifm-breadcrumb-item-background-active);text-decoration:none}.breadcrumbs--sm{--ifm-breadcrumb-size-multiplier:0.8}.breadcrumbs--lg{--ifm-breadcrumb-size-multiplier:1.2}.button{background-color:var(--ifm-button-background-color);border:var(--ifm-button-border-width) solid var(--ifm-button-border-color);border-radius:var(--ifm-button-border-radius);cursor:pointer;font-size:calc(.875rem*var(--ifm-button-size-multiplier));font-weight:var(--ifm-button-font-weight);line-height:1.5;padding:calc(var(--ifm-button-padding-vertical)*var(--ifm-button-size-multiplier)) calc(var(--ifm-button-padding-horizontal)*var(--ifm-button-size-multiplier));text-align:center;transition-duration:var(--ifm-button-transition-duration);transition-property:color,background,border-color;user-select:none;white-space:nowrap}.button,.button:hover{color:var(--ifm-button-color)}.button--outline{--ifm-button-color:var(--ifm-button-border-color)}.button--outline:hover{--ifm-button-background-color:var(--ifm-button-border-color)}.button--link{--ifm-button-border-color:#0000;color:var(--ifm-link-color);text-decoration:var(--ifm-link-decoration)}.button--link.button--active,.button--link:active,.button--link:hover{color:var(--ifm-link-hover-color);text-decoration:var(--ifm-link-hover-decoration)}.button.disabled,.button:disabled,.button[disabled]{opacity:.65;pointer-events:none}.button--sm{--ifm-button-size-multiplier:0.8}.button--lg{--ifm-button-size-multiplier:1.35}.button--block{display:block;width:100%}.button.button--secondary{color:var(--ifm-color-gray-900)}:where(.button--primary){--ifm-button-background-color:var(--ifm-color-primary);--ifm-button-border-color:var(--ifm-color-primary)}:where(.button--primary):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-primary-dark);--ifm-button-border-color:var(--ifm-color-primary-dark)}.button--primary.button--active,.button--primary:active{--ifm-button-background-color:var(--ifm-color-primary-darker);--ifm-button-border-color:var(--ifm-color-primary-darker)}:where(.button--secondary){--ifm-button-background-color:var(--ifm-color-secondary);--ifm-button-border-color:var(--ifm-color-secondary)}:where(.button--secondary):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-secondary-dark);--ifm-button-border-color:var(--ifm-color-secondary-dark)}.button--secondary.button--active,.button--secondary:active{--ifm-button-background-color:var(--ifm-color-secondary-darker);--ifm-button-border-color:var(--ifm-color-secondary-darker)}:where(.button--success){--ifm-button-background-color:var(--ifm-color-success);--ifm-button-border-color:var(--ifm-color-success)}:where(.button--success):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-success-dark);--ifm-button-border-color:var(--ifm-color-success-dark)}.button--success.button--active,.button--success:active{--ifm-button-background-color:var(--ifm-color-success-darker);--ifm-button-border-color:var(--ifm-color-success-darker)}:where(.button--info){--ifm-button-background-color:var(--ifm-color-info);--ifm-button-border-color:var(--ifm-color-info)}:where(.button--info):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-info-dark);--ifm-button-border-color:var(--ifm-color-info-dark)}.button--info.button--active,.button--info:active{--ifm-button-background-color:var(--ifm-color-info-darker);--ifm-button-border-color:var(--ifm-color-info-darker)}:where(.button--warning){--ifm-button-background-color:var(--ifm-color-warning);--ifm-button-border-color:var(--ifm-color-warning)}:where(.button--warning):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-warning-dark);--ifm-button-border-color:var(--ifm-color-warning-dark)}.button--warning.button--active,.button--warning:active{--ifm-button-background-color:var(--ifm-color-warning-darker);--ifm-button-border-color:var(--ifm-color-warning-darker)}:where(.button--danger){--ifm-button-background-color:var(--ifm-color-danger);--ifm-button-border-color:var(--ifm-color-danger)}:where(.button--danger):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-danger-dark);--ifm-button-border-color:var(--ifm-color-danger-dark)}.button--danger.button--active,.button--danger:active{--ifm-button-background-color:var(--ifm-color-danger-darker);--ifm-button-border-color:var(--ifm-color-danger-darker)}.button-group{display:inline-flex;gap:var(--ifm-button-group-spacing)}.button-group>.button:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.button-group>.button:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.button-group--block{display:flex;justify-content:stretch}.button-group--block>.button{flex-grow:1}.card{background-color:var(--ifm-card-background-color);border-radius:var(--ifm-card-border-radius);box-shadow:var(--ifm-global-shadow-lw);display:flex;flex-direction:column;overflow:hidden}.card__image{padding-top:var(--ifm-card-vertical-spacing)}.card__image:first-child{padding-top:0}.card__body,.card__footer,.card__header{padding:var(--ifm-card-vertical-spacing) var(--ifm-card-horizontal-spacing)}.card__body:not(:last-child),.card__footer:not(:last-child),.card__header:not(:last-child){padding-bottom:0}.card__body>:last-child,.card__footer>:last-child,.card__header>:last-child{margin-bottom:0}.card__footer{margin-top:auto}.table-of-contents{font-size:.8rem;margin-bottom:0;padding:var(--ifm-toc-padding-vertical) 0}.table-of-contents,.table-of-contents ul{list-style:none;padding-left:var(--ifm-toc-padding-horizontal)}.table-of-contents li{margin:var(--ifm-toc-padding-vertical) var(--ifm-toc-padding-horizontal)}.table-of-contents__left-border{border-left:1px solid var(--ifm-toc-border-color)}.table-of-contents__link{color:var(--ifm-toc-link-color);display:block}.table-of-contents__link--active,.table-of-contents__link--active code,.table-of-contents__link:hover,.table-of-contents__link:hover code{color:var(--ifm-color-primary);text-decoration:none}.close{color:var(--ifm-color-black);float:right;font-size:1.5rem;font-weight:var(--ifm-font-weight-bold);line-height:1;opacity:.5;padding:1rem;transition:opacity var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.close:hover{opacity:.7}.close:focus,.theme-code-block-highlighted-line .codeLineNumber_Tfdd:before{opacity:.8}.dropdown{display:inline-flex;font-weight:var(--ifm-dropdown-font-weight);position:relative;vertical-align:top}.fa-layers,.svg-inline--fa{vertical-align:-.125em;height:1em}.dropdown--hoverable:hover .dropdown__menu,.dropdown--show .dropdown__menu{opacity:1;pointer-events:all;transform:translateY(-1px);visibility:visible}#nprogress,.dropdown__menu,.navbar__item.dropdown .navbar__link:not([href]){pointer-events:none}.dropdown--right .dropdown__menu{left:inherit;right:0}.dropdown--nocaret .navbar__link:after{content:none!important}.dropdown__menu{background-color:var(--ifm-dropdown-background-color);border-radius:var(--ifm-global-radius);box-shadow:var(--ifm-global-shadow-md);left:0;list-style:none;max-height:80vh;min-width:10rem;opacity:0;overflow-y:auto;padding:.5rem;position:absolute;top:calc(100% - var(--ifm-navbar-item-padding-vertical) + .3rem);transform:translateY(-.625rem);transition-duration:var(--ifm-transition-fast);transition-property:opacity,transform,visibility;transition-timing-function:var(--ifm-transition-timing-default);visibility:hidden;z-index:var(--ifm-z-index-dropdown)}.menu__caret,.menu__link,.menu__list-item-collapsible{border-radius:.25rem;transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.dropdown__link{border-radius:.25rem;color:var(--ifm-dropdown-link-color);display:block;font-size:.875rem;margin-top:.2rem;padding:.25rem .5rem;white-space:nowrap}.dropdown__link--active,.dropdown__link:hover{background-color:var(--ifm-dropdown-hover-background-color);color:var(--ifm-dropdown-link-color);text-decoration:none}.dropdown__link--active,.dropdown__link--active:hover{--ifm-dropdown-link-color:var(--ifm-link-color)}.dropdown>.navbar__link:after{border-color:currentcolor #0000;border-style:solid;border-width:.4em .4em 0;content:"";margin-left:.3em;position:relative;top:2px;transform:translateY(-50%)}.footer{background-color:var(--ifm-footer-background-color);color:var(--ifm-footer-color);padding:var(--ifm-footer-padding-vertical) var(--ifm-footer-padding-horizontal)}.footer--dark{--ifm-footer-background-color:#303846;--ifm-footer-color:var(--ifm-footer-link-color);--ifm-footer-link-color:var(--ifm-color-secondary);--ifm-footer-title-color:var(--ifm-color-white)}.footer__links{margin-bottom:1rem}.footer__link-item{color:var(--ifm-footer-link-color);line-height:2}.footer__link-item:hover{color:var(--ifm-footer-link-hover-color)}.footer__link-separator{margin:0 var(--ifm-footer-link-horizontal-spacing)}.footer__logo{margin-top:1rem;max-width:var(--ifm-footer-logo-max-width)}.footer__title{color:var(--ifm-footer-title-color);font:700 var(--ifm-h4-font-size)/var(--ifm-heading-line-height) var(--ifm-font-family-base);margin-bottom:var(--ifm-heading-margin-bottom)}.menu,.navbar__link{font-weight:var(--ifm-font-weight-semibold)}.docItemContainer_Djhp article>:first-child,.docItemContainer_Djhp header+*,.footer__item{margin-top:0}.admonitionContent_S0QG>:last-child,.collapsibleContent_i85q>:last-child,.footer__items,.tabItem_Ymn6>:last-child{margin-bottom:0}.codeBlockStandalone_MEMb,[type=checkbox]{padding:0}.hero{align-items:center;background-color:var(--ifm-hero-background-color);color:var(--ifm-hero-text-color);display:flex;padding:4rem 2rem}.hero--primary{--ifm-hero-background-color:var(--ifm-color-primary);--ifm-hero-text-color:var(--ifm-font-color-base-inverse)}.hero--dark{--ifm-hero-background-color:#303846;--ifm-hero-text-color:var(--ifm-color-white)}.hero__title{font-size:3rem}.hero__subtitle{font-size:1.5rem}.menu__list{list-style:none;margin:0;padding-left:0}.menu__caret,.menu__link{padding:var(--ifm-menu-link-padding-vertical) var(--ifm-menu-link-padding-horizontal)}.menu__list .menu__list{flex:0 0 100%;margin-top:.25rem;padding-left:var(--ifm-menu-link-padding-horizontal)}.menu__list-item:not(:first-child){margin-top:.25rem}.menu__list-item--collapsed .menu__list{height:0;overflow:hidden}.details_lb9f[data-collapsed=false].isBrowser_bmU9>summary:before,.details_lb9f[open]:not(.isBrowser_bmU9)>summary:before,.fa-rotate-90,.menu__list-item--collapsed .menu__caret:before,.menu__list-item--collapsed .menu__link--sublist:after{transform:rotate(90deg)}.menu__list-item-collapsible{display:flex;flex-wrap:wrap;position:relative}.menu__caret:hover,.menu__link:hover,.menu__list-item-collapsible--active,.menu__list-item-collapsible:hover{background:var(--ifm-menu-color-background-hover)}.menu__list-item-collapsible .menu__link--active,.menu__list-item-collapsible .menu__link:hover{background:none!important}.menu__caret,.menu__link{align-items:center;display:flex}.navbar-sidebar,.navbar-sidebar__backdrop{opacity:0;transition-duration:var(--ifm-transition-fast);transition-timing-function:ease-in-out;bottom:0;left:0;top:0;visibility:hidden}.menu__link{color:var(--ifm-menu-color);flex:1;line-height:1.25}.menu__link:hover{color:var(--ifm-menu-color);text-decoration:none}.menu__caret:before,.menu__link--sublist-caret:after{height:1.25rem;transform:rotate(180deg);transition:transform var(--ifm-transition-fast) linear;width:1.25rem;filter:var(--ifm-menu-link-sublist-icon-filter);content:""}.menu__link--sublist-caret:after{background:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem;margin-left:auto;min-width:1.25rem}.menu__link--active,.menu__link--active:hover{color:var(--ifm-menu-color-active)}.navbar__brand,.navbar__link{color:var(--ifm-navbar-link-color)}.menu__link--active:not(.menu__link--sublist){background-color:var(--ifm-menu-color-background-active)}.menu__caret:before{background:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem}.navbar--dark,html[data-theme=dark]{--ifm-menu-link-sublist-icon-filter:invert(100%) sepia(94%) saturate(17%) hue-rotate(223deg) brightness(104%) contrast(98%)}.navbar{background-color:var(--ifm-navbar-background-color);box-shadow:var(--ifm-navbar-shadow);height:var(--ifm-navbar-height);padding:var(--ifm-navbar-padding-vertical) var(--ifm-navbar-padding-horizontal)}.navbar,.navbar>.container,.navbar>.container-fluid{display:flex}.navbar--fixed-top{position:sticky;top:0;z-index:var(--ifm-z-index-fixed)}.navbar__inner{display:flex;flex-wrap:wrap;justify-content:space-between;width:100%}.navbar__brand{align-items:center;display:flex;margin-right:1rem;min-width:0}.navbar__brand:hover{color:var(--ifm-navbar-link-hover-color);text-decoration:none}.announcementBarContent_xLdY,.navbar__title{flex:1 1 auto}.navbar__toggle{display:none;margin-right:.5rem}.navbar__logo{flex:0 0 auto;height:2rem;margin-right:.5rem}.navbar__items{align-items:center;display:flex;flex:1;min-width:0}.navbar__items--center{flex:0 0 auto}.navbar__items--center .navbar__brand{margin:0}.navbar__items--center+.navbar__items--right{flex:1}.navbar__items--right{flex:0 0 auto;justify-content:flex-end}.navbar__items--right>:last-child{padding-right:0}.navbar__item{display:inline-block;padding:var(--ifm-navbar-item-padding-vertical) var(--ifm-navbar-item-padding-horizontal)}.navbar__link--active,.navbar__link:hover{color:var(--ifm-navbar-link-hover-color);text-decoration:none}.navbar--dark,.navbar--primary{--ifm-menu-color:var(--ifm-color-gray-300);--ifm-navbar-link-color:var(--ifm-color-gray-100);--ifm-navbar-search-input-background-color:#ffffff1a;--ifm-navbar-search-input-placeholder-color:#ffffff80;color:var(--ifm-color-white)}.navbar--dark{--ifm-navbar-background-color:#242526;--ifm-menu-color-background-active:#ffffff0d;--ifm-navbar-search-input-color:var(--ifm-color-white)}.navbar--primary{--ifm-navbar-background-color:var(--ifm-color-primary);--ifm-navbar-link-hover-color:var(--ifm-color-white);--ifm-menu-color-active:var(--ifm-color-white);--ifm-navbar-search-input-color:var(--ifm-color-emphasis-500)}.navbar__search-input{-webkit-appearance:none;appearance:none;background:var(--ifm-navbar-search-input-background-color) var(--ifm-navbar-search-input-icon) no-repeat .75rem center/1rem 1rem;border:none;border-radius:2rem;color:var(--ifm-navbar-search-input-color);cursor:text;display:inline-block;font-size:.9rem;height:2rem;padding:0 .5rem 0 2.25rem;width:12.5rem}.navbar__search-input::placeholder{color:var(--ifm-navbar-search-input-placeholder-color)}.navbar-sidebar{background-color:var(--ifm-navbar-background-color);box-shadow:var(--ifm-global-shadow-md);position:fixed;transform:translate3d(-100%,0,0);transition-property:opacity,visibility,transform;width:var(--ifm-navbar-sidebar-width)}.navbar-sidebar--show .navbar-sidebar,.navbar-sidebar__items{transform:translateZ(0)}.navbar-sidebar--show .navbar-sidebar,.navbar-sidebar--show .navbar-sidebar__backdrop{opacity:1;visibility:visible}.navbar-sidebar__backdrop{background-color:#0009;position:fixed;right:0;transition-property:opacity,visibility}.navbar-sidebar__brand{align-items:center;box-shadow:var(--ifm-navbar-shadow);display:flex;flex:1;height:var(--ifm-navbar-height);padding:var(--ifm-navbar-padding-vertical) var(--ifm-navbar-padding-horizontal)}.navbar-sidebar__items{display:flex;height:calc(100% - var(--ifm-navbar-height));transition:transform var(--ifm-transition-fast) ease-in-out}.navbar-sidebar__items--show-secondary{transform:translate3d(calc((var(--ifm-navbar-sidebar-width))*-1),0,0)}.navbar-sidebar__item{flex-shrink:0;padding:.5rem;width:calc(var(--ifm-navbar-sidebar-width))}.navbar-sidebar__back{background:var(--ifm-menu-color-background-active);font-size:15px;font-weight:var(--ifm-button-font-weight);margin:0 0 .2rem -.5rem;padding:.6rem 1.5rem;position:relative;text-align:left;top:-.5rem;width:calc(100% + 1rem)}.navbar-sidebar__close{display:flex;margin-left:auto}.pagination{column-gap:var(--ifm-pagination-page-spacing);display:flex;font-size:var(--ifm-pagination-font-size);padding-left:0}.pagination--sm{--ifm-pagination-font-size:0.8rem;--ifm-pagination-padding-horizontal:0.8rem;--ifm-pagination-padding-vertical:0.2rem}.pagination--lg{--ifm-pagination-font-size:1.2rem;--ifm-pagination-padding-horizontal:1.2rem;--ifm-pagination-padding-vertical:0.3rem}.pagination__item{display:inline-flex}.pagination__item>span{padding:var(--ifm-pagination-padding-vertical)}.pagination__item--active .pagination__link{color:var(--ifm-pagination-color-active)}.pagination__item--active .pagination__link,.pagination__item:not(.pagination__item--active):hover .pagination__link{background:var(--ifm-pagination-item-active-background)}.pagination__item--disabled,.pagination__item[disabled]{opacity:.25;pointer-events:none}.pagination__link{border-radius:var(--ifm-pagination-border-radius);color:var(--ifm-font-color-base);display:inline-block;padding:var(--ifm-pagination-padding-vertical) var(--ifm-pagination-padding-horizontal);transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.pagination__link:hover{text-decoration:none}.pagination-nav{grid-gap:var(--ifm-spacing-horizontal);display:grid;gap:var(--ifm-spacing-horizontal);grid-template-columns:repeat(2,1fr)}.pagination-nav__link{border:1px solid var(--ifm-color-emphasis-300);border-radius:var(--ifm-pagination-nav-border-radius);display:block;height:100%;line-height:var(--ifm-heading-line-height);padding:var(--ifm-global-spacing);transition:border-color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.pagination-nav__link:hover{border-color:var(--ifm-pagination-nav-color-hover);text-decoration:none}.pagination-nav__link--next{grid-column:2/3;text-align:right}.content_knG7,.fa-fw,.fa-layers,.fa-li,.pills--block .pills__item{text-align:center}.pagination-nav__label{font-size:var(--ifm-h4-font-size);font-weight:var(--ifm-heading-font-weight);word-break:break-word}.pagination-nav__link--prev .pagination-nav__label:before{content:"« "}.pagination-nav__link--next .pagination-nav__label:after{content:" »"}.pagination-nav__sublabel{color:var(--ifm-color-content-secondary);font-size:var(--ifm-h5-font-size);font-weight:var(--ifm-font-weight-semibold);margin-bottom:.25rem}.pills__item,.tabs{font-weight:var(--ifm-font-weight-bold)}.pills{display:flex;gap:var(--ifm-pills-spacing);padding-left:0}.pills__item{border-radius:.5rem;cursor:pointer;display:inline-block;padding:.25rem 1rem;transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.pills__item--active{color:var(--ifm-pills-color-active)}.pills__item--active,.pills__item:not(.pills__item--active):hover{background:var(--ifm-pills-color-background-active)}.pills--block{justify-content:stretch}.pills--block .pills__item{flex-grow:1}.tabs{color:var(--ifm-tabs-color);display:flex;margin-bottom:0;overflow-x:auto;padding-left:0}.tabs__item{border-bottom:3px solid #0000;border-radius:var(--ifm-global-radius);cursor:pointer;display:inline-flex;padding:var(--ifm-tabs-padding-vertical) var(--ifm-tabs-padding-horizontal);transition:background-color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.tabs__item--active{border-bottom-color:var(--ifm-tabs-color-active-border);border-bottom-left-radius:0;border-bottom-right-radius:0;color:var(--ifm-tabs-color-active)}.fa-duotone.fa-inverse,.fa-inverse,.fa-layers-counter,.fad.fa-inverse{color:var(--fa-inverse,#fff)}.tabs__item:hover{background-color:var(--ifm-hover-overlay)}.tabs--block{justify-content:stretch}.tabs--block .tabs__item{flex-grow:1;justify-content:center}html[data-theme=dark]{--ifm-color-scheme:dark;--ifm-color-emphasis-0:var(--ifm-color-gray-1000);--ifm-color-emphasis-100:var(--ifm-color-gray-900);--ifm-color-emphasis-200:var(--ifm-color-gray-800);--ifm-color-emphasis-300:var(--ifm-color-gray-700);--ifm-color-emphasis-400:var(--ifm-color-gray-600);--ifm-color-emphasis-600:var(--ifm-color-gray-400);--ifm-color-emphasis-700:var(--ifm-color-gray-300);--ifm-color-emphasis-800:var(--ifm-color-gray-200);--ifm-color-emphasis-900:var(--ifm-color-gray-100);--ifm-color-emphasis-1000:var(--ifm-color-gray-0);--ifm-background-color:#1b1b1d;--ifm-background-surface-color:#242526;--ifm-hover-overlay:#ffffff0d;--ifm-color-content:#e3e3e3;--ifm-color-content-secondary:#fff;--ifm-breadcrumb-separator-filter:invert(64%) sepia(11%) saturate(0%) hue-rotate(149deg) brightness(99%) contrast(95%);--ifm-code-background:#ffffff1a;--ifm-scrollbar-track-background-color:#444;--ifm-scrollbar-thumb-background-color:#686868;--ifm-scrollbar-thumb-hover-background-color:#7a7a7a;--ifm-table-stripe-background:#ffffff12;--ifm-toc-border-color:var(--ifm-color-emphasis-200);--ifm-color-primary-contrast-background:#102445;--ifm-color-primary-contrast-foreground:#ebf2fc;--ifm-color-secondary-contrast-background:#474748;--ifm-color-secondary-contrast-foreground:#fdfdfe;--ifm-color-success-contrast-background:#003100;--ifm-color-success-contrast-foreground:#e6f6e6;--ifm-color-info-contrast-background:#193c47;--ifm-color-info-contrast-foreground:#eef9fd;--ifm-color-warning-contrast-background:#4d3800;--ifm-color-warning-contrast-foreground:#fff8e6;--ifm-color-danger-contrast-background:#4b1113;--ifm-color-danger-contrast-foreground:#ffebec;--docsearch-text-color:#f5f6f7;--docsearch-container-background:#090a11cc;--docsearch-modal-background:#15172a;--docsearch-modal-shadow:inset 1px 1px 0 0 #2c2e40,0 3px 8px 0 #000309;--docsearch-searchbox-background:#090a11;--docsearch-searchbox-focus-background:#000;--docsearch-hit-color:#bec3c9;--docsearch-hit-shadow:none;--docsearch-hit-background:#090a11;--docsearch-key-gradient:linear-gradient(-26.5deg,#565872,#31355b);--docsearch-key-shadow:inset 0 -2px 0 0 #282d55,inset 0 0 1px 1px #51577d,0 2px 2px 0 #0304094d;--docsearch-footer-background:#1e2136;--docsearch-footer-shadow:inset 0 1px 0 0 #494c6a80,0 -4px 8px 0 #0003;--docsearch-logo-color:#fff;--docsearch-muted-color:#7f8497}:root{--docusaurus-progress-bar-color:var(--ifm-color-primary);--ifm-font-family-base:"Object Sans Regular";--ifm-color-primary:#5217b8;--ifm-color-primary-dark:#46149c;--ifm-color-primary-darker:#391081;--ifm-color-primary-darkest:#290b5c;--ifm-color-primary-light:#621cdd;--ifm-color-primary-lighter:#6e29e4;--ifm-color-primary-lightest:#874ee9;--ifm-color-secondary:#ffb300;--ifm-color-secondary-dark:#e6a100;--ifm-color-secondary-darker:#d99800;--ifm-color-secondary-darkest:#b37d00;--ifm-color-secondary-light:#ffbb1a;--ifm-color-secondary-lighter:#ffbe26;--ifm-color-secondary-lightest:#ffca4d;--ifm-navbar-background-color:#5217b8;--ifm-hero-background-color-bottom:#290c5c;--ifm-navbar-link-color:var(--ifm-font-color-base-inverse);--ifm-navbar-link-hover-color:var(--ifm-color-secondary);--ifm-navbar-link-active-color:var(--ifm-color-gray-400);--docusaurus-announcement-bar-height:auto;--docusaurus-tag-list-border:var(--ifm-color-emphasis-300);--docusaurus-collapse-button-bg:#0000;--docusaurus-collapse-button-bg-hover:#0000001a;--doc-sidebar-width:300px;--doc-sidebar-hidden-width:30px;--docsearch-primary-color:#5468ff;--docsearch-text-color:#1c1e21;--docsearch-spacing:12px;--docsearch-icon-stroke-width:1.4;--docsearch-highlight-color:var(--docsearch-primary-color);--docsearch-muted-color:#969faf;--docsearch-container-background:#656c85cc;--docsearch-logo-color:#5468ff;--docsearch-modal-width:560px;--docsearch-modal-height:600px;--docsearch-modal-background:#f5f6f7;--docsearch-modal-shadow:inset 1px 1px 0 0 #ffffff80,0 3px 8px 0 #555a64;--docsearch-searchbox-height:56px;--docsearch-searchbox-background:#ebedf0;--docsearch-searchbox-focus-background:#fff;--docsearch-searchbox-shadow:inset 0 0 0 2px var(--docsearch-primary-color);--docsearch-hit-height:56px;--docsearch-hit-color:#444950;--docsearch-hit-active-color:#fff;--docsearch-hit-background:#fff;--docsearch-hit-shadow:0 1px 3px 0 #d4d9e1;--docsearch-key-gradient:linear-gradient(-225deg,#d5dbe4,#f8f8f8);--docsearch-key-shadow:inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 2px 1px #1e235a66;--docsearch-footer-height:44px;--docsearch-footer-background:#fff;--docsearch-footer-shadow:0 -1px 0 0 #e0e3e8,0 -3px 6px 0 #45629b1f;--docsearch-primary-color:var(--ifm-color-primary);--docsearch-text-color:var(--ifm-font-color-base)}#nprogress .bar{background:var(--docusaurus-progress-bar-color);height:2px;left:0;position:fixed;top:0;width:100%;z-index:1031}#nprogress .peg{box-shadow:0 0 10px var(--docusaurus-progress-bar-color),0 0 5px var(--docusaurus-progress-bar-color);height:100%;opacity:1;position:absolute;right:0;transform:rotate(3deg) translateY(-4px);width:100px}:host,:root{--fa-font-solid:normal 900 1em/1 "Font Awesome 6 Solid";--fa-font-regular:normal 400 1em/1 "Font Awesome 6 Regular";--fa-font-light:normal 300 1em/1 "Font Awesome 6 Light";--fa-font-thin:normal 100 1em/1 "Font Awesome 6 Thin";--fa-font-duotone:normal 900 1em/1 "Font Awesome 6 Duotone";--fa-font-sharp-solid:normal 900 1em/1 "Font Awesome 6 Sharp";--fa-font-sharp-regular:normal 400 1em/1 "Font Awesome 6 Sharp";--fa-font-sharp-light:normal 300 1em/1 "Font Awesome 6 Sharp";--fa-font-brands:normal 400 1em/1 "Font Awesome 6 Brands"}svg:not(:host).svg-inline--fa,svg:not(:root).svg-inline--fa{box-sizing:initial;overflow:visible}.svg-inline--fa{display:var(--fa-display,inline-block);overflow:visible}.fa-layers,.fa-stack{display:inline-block}.svg-inline--fa.fa-2xs{vertical-align:.1em}.svg-inline--fa.fa-xs{vertical-align:0}.svg-inline--fa.fa-sm{vertical-align:-.07143em}.svg-inline--fa.fa-lg{vertical-align:-.2em}.svg-inline--fa.fa-xl{vertical-align:-.25em}.svg-inline--fa.fa-2xl{vertical-align:-.3125em}.svg-inline--fa.fa-pull-left{margin-right:var(--fa-pull-margin,.3em);width:auto}.svg-inline--fa.fa-pull-right{margin-left:var(--fa-pull-margin,.3em);width:auto}.svg-inline--fa.fa-li{top:.25em;width:var(--fa-li-width,2em)}.svg-inline--fa.fa-fw{width:var(--fa-fw-width,1.25em)}.fa-layers svg.svg-inline--fa{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;transform-origin:center center}.fa-layers-counter,.fa-layers-text{display:inline-block;position:absolute;text-align:center}.fa-layers,.fa-ul>li{position:relative}.fa-layers{width:1em}.fa-layers-text{left:50%;top:50%;transform:translate(-50%,-50%);transform-origin:center center}.fa-layers-counter{background-color:var(--fa-counter-background-color,#ff253a);border-radius:var(--fa-counter-border-radius,1em);line-height:var(--fa-counter-line-height,1);max-width:var(--fa-counter-max-width,5em);min-width:var(--fa-counter-min-width,1.5em);overflow:hidden;padding:var(--fa-counter-padding,.25em .5em);right:var(--fa-right,0);text-overflow:ellipsis;top:var(--fa-top,0);transform:scale(var(--fa-counter-scale,.25));transform-origin:top right}.fa-ul,:not(.containsTaskList_mC6p>li)>.containsTaskList_mC6p{padding-left:0}.fa-layers-bottom-right{bottom:var(--fa-bottom,0);right:var(--fa-right,0);top:auto;transform:scale(var(--fa-layers-scale,.25));transform-origin:bottom right}.fa-layers-bottom-left,.fa-layers-top-right{transform:scale(var(--fa-layers-scale,.25))}.fa-layers-bottom-left{bottom:var(--fa-bottom,0);left:var(--fa-left,0);right:auto;top:auto;transform-origin:bottom left}.fa-layers-top-right{right:var(--fa-right,0);top:var(--fa-top,0);transform-origin:top right}.fa-layers-top-left{left:var(--fa-left,0);right:auto;top:var(--fa-top,0);transform:scale(var(--fa-layers-scale,.25));transform-origin:top left}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-2xs{font-size:.625em;line-height:.1em;vertical-align:.225em}.fa-xs{font-size:.75em;line-height:.08333em;vertical-align:.125em}.fa-sm{font-size:.875em;line-height:.07143em;vertical-align:.05357em}.fa-lg{font-size:1.25em;line-height:.05em;vertical-align:-.075em}.fa-xl{font-size:1.5em;line-height:.04167em;vertical-align:-.125em}.fa-2xl{font-size:2em;line-height:.03125em;vertical-align:-.1875em}.fa-fw{width:1.25em}.fa-ul{list-style-type:none;margin-left:var(--fa-li-margin,2.5em)}.fa-li{left:calc(var(--fa-li-width,2em)*-1);line-height:inherit;position:absolute;width:var(--fa-li-width,2em)}.fa-border{border-color:var(--fa-border-color,#eee);border-radius:var(--fa-border-radius,.1em);border-style:var(--fa-border-style,solid);border-width:var(--fa-border-width,.08em);padding:var(--fa-border-padding,.2em .25em .15em)}.fa-pull-left{float:left;margin-right:var(--fa-pull-margin,.3em)}.fa-pull-right{float:right;margin-left:var(--fa-pull-margin,.3em)}.fa-beat{animation-name:a;animation-timing-function:var(--fa-animation-timing,ease-in-out)}.fa-bounce{animation-name:b;animation-timing-function:var(--fa-animation-timing,cubic-bezier(.28,.84,.42,1))}.fa-beat-fade,.fa-fade{animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1));animation-iteration-count:var(--fa-animation-iteration-count,infinite)}.fa-fade{animation-name:c}.fa-beat-fade{animation-name:d}.fa-flip{animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-name:e;animation-timing-function:var(--fa-animation-timing,ease-in-out)}.fa-shake,.fa-spin{animation-timing-function:var(--fa-animation-timing,linear)}.fa-shake{animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-name:f}.fa-pulse,.fa-spin,.fa-spin-pulse{animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-name:g}.fa-spin{animation-duration:var(--fa-animation-duration,2s)}.fa-spin-reverse{--fa-animation-direction:reverse}.fa-pulse,.fa-spin-pulse{animation-duration:var(--fa-animation-duration,1s);animation-timing-function:var(--fa-animation-timing,steps(8))}@keyframes a{0%,90%{transform:scale(1)}45%{transform:scale(var(--fa-beat-scale,1.25))}}@keyframes b{0%,64%,to{transform:scale(1) translateY(0)}10%{transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0)}30%{transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em))}50%{transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0)}57%{transform:scale(1) translateY(var(--fa-bounce-rebound,-.125em))}}@keyframes c{50%{opacity:var(--fa-fade-opacity,.4)}}@keyframes d{0%,to{opacity:var(--fa-beat-fade-opacity,.4);transform:scale(1)}50%{opacity:1;transform:scale(var(--fa-beat-fade-scale,1.125))}}@keyframes e{50%{transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg))}}@keyframes f{0%{transform:rotate(-15deg)}4%{transform:rotate(15deg)}24%,8%{transform:rotate(-18deg)}12%,28%{transform:rotate(18deg)}16%{transform:rotate(-22deg)}20%{transform:rotate(22deg)}32%{transform:rotate(-12deg)}36%{transform:rotate(12deg)}40%,to{transform:rotate(0)}}@keyframes g{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.fa-rotate-180{transform:rotate(180deg)}.fa-rotate-270{transform:rotate(270deg)}.fa-flip-horizontal{transform:scaleX(-1)}.fa-flip-vertical{transform:scaleY(-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{transform:scale(-1)}.fa-rotate-by{transform:rotate(var(--fa-rotate-angle,none))}.fa-stack{height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;z-index:var(--fa-stack-z-index,auto)}.svg-inline--fa.fa-stack-1x{height:1em;width:1.25em}.svg-inline--fa.fa-stack-2x{height:2em;width:2.5em}.fa-sr-only,.fa-sr-only-focusable:not(:focus),.sr-only,.sr-only-focusable:not(:focus){clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.svg-inline--fa .fa-primary{fill:var(--fa-primary-color,currentColor);opacity:var(--fa-primary-opacity,1)}.svg-inline--fa .fa-secondary{fill:var(--fa-secondary-color,currentColor)}.svg-inline--fa .fa-secondary,.svg-inline--fa.fa-swap-opacity .fa-primary{opacity:var(--fa-secondary-opacity,.4)}.svg-inline--fa.fa-swap-opacity .fa-secondary{opacity:var(--fa-primary-opacity,1)}.svg-inline--fa mask .fa-primary,.svg-inline--fa mask .fa-secondary{fill:#000}@font-face{font-family:Object Sans Regular;src:url(/assets/fonts/ObjectSans-Regular-2a8a3a5edf33ee77e5931269d27c4e6f.woff2) format("woff2"),url(/assets/fonts/ObjectSans-Regular-4ab681413dd329607b462c101a5f16a8.woff) format("woff")}.button--primary:not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-primary-darkest);--ifm-button-border-color:var(--ifm-color-primary-darkest)}.navbar__link--active{color:var(--ifm-navbar-link-active-color)}.hero_uw3b a:not(.button),.navbar__toggle{color:var(--ifm-font-color-base-inverse)}.docusaurus-highlight-code-line{background-color:#0000001a;display:block;margin:0 calc(var(--ifm-pre-padding)*-1);padding:0 var(--ifm-pre-padding)}.openapidoc_oorz table tbody tr table,.openapidoc_oorz table tbody tr table tbody tr,.openapidoc_oorz table.security-details tr:nth-child(odd),.skipToContent_fXgn{background-color:var(--ifm-background-surface-color)}html[data-theme=dark] .docusaurus-highlight-code-line{background-color:#0000004d}details summary{font-size:20px}body:not(.navigation-with-keyboard) :not(input):focus{outline:0}#__docusaurus-base-url-issue-banner-container,.themedImage_ToTc,[data-theme=dark] .lightToggleIcon_pyhR,[data-theme=light] .darkToggleIcon_wfgR,html[data-announcement-bar-initially-dismissed=true] .announcementBar_mb4j{display:none}.skipToContent_fXgn{color:var(--ifm-color-emphasis-900);left:100%;padding:calc(var(--ifm-global-spacing)/2) var(--ifm-global-spacing);position:fixed;top:1rem;z-index:calc(var(--ifm-z-index-fixed) + 1)}.skipToContent_fXgn:focus{box-shadow:var(--ifm-global-shadow-md);left:1rem}.closeButton_CVFx{line-height:0;padding:0}.content_knG7{font-size:85%;padding:5px 0}.content_knG7 a{color:inherit;text-decoration:underline}.DocSearch-Container a,.tag_zVej:hover{text-decoration:none}.announcementBar_mb4j{align-items:center;background-color:var(--ifm-color-white);border-bottom:1px solid var(--ifm-color-emphasis-100);color:var(--ifm-color-black);display:flex;height:var(--docusaurus-announcement-bar-height)}.announcementBarPlaceholder_vyr4{flex:0 0 10px}.announcementBarClose_gvF7{align-self:stretch;flex:0 0 30px}.toggle_vylO{height:2rem;width:2rem}.toggleButton_gllP{align-items:center;border-radius:50%;display:flex;height:100%;justify-content:center;transition:background var(--ifm-transition-fast);width:100%}.toggleButton_gllP:hover{background:var(--ifm-color-emphasis-200)}.toggleButtonDisabled_aARS{cursor:not-allowed}.darkNavbarColorModeToggle_X3D1:hover{background:var(--ifm-color-gray-800)}[data-theme=dark] .themedImage--dark_i4oU,[data-theme=light] .themedImage--light_HNdA,html:not([data-theme]) .themedComponent--light_NU7w{display:initial}.iconExternalLink_nPIU{margin-left:.3rem}.iconLanguage_nlXk{margin-right:5px;vertical-align:text-bottom}.navbarHideable_m1mJ{transition:transform var(--ifm-transition-fast) ease}.navbarHidden_jGov{transform:translate3d(0,calc(-100% - 2px),0)}.errorBoundaryError_a6uf{color:red;white-space:pre-wrap}.footerLogoLink_BH7S{opacity:.5;transition:opacity var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.footerLogoLink_BH7S:hover,.hash-link:focus,:hover>.hash-link{opacity:1}.mainWrapper_z2l0{display:flex;flex:1 0 auto;flex-direction:column}.docusaurus-mt-lg{margin-top:3rem}#__docusaurus{display:flex;flex-direction:column;min-height:100%}.iconEdit_Z9Sw{margin-right:.3em;vertical-align:sub}.tag_zVej{border:1px solid var(--docusaurus-tag-list-border);transition:border var(--ifm-transition-fast)}.tag_zVej:hover{--docusaurus-tag-list-border:var(--ifm-link-color)}.tagRegular_sFm0{border-radius:var(--ifm-global-radius);font-size:90%;padding:.2rem .5rem .3rem}.tagWithCount_h2kH{align-items:center;border-left:0;display:flex;padding:0 .5rem 0 1rem;position:relative}.tagWithCount_h2kH:after,.tagWithCount_h2kH:before{border:1px solid var(--docusaurus-tag-list-border);content:"";position:absolute;top:50%;transition:inherit}.tagWithCount_h2kH:before{border-bottom:0;border-right:0;height:1.18rem;right:100%;transform:translate(50%,-50%) rotate(-45deg);width:1.18rem}.tagWithCount_h2kH:after{border-radius:50%;height:.5rem;left:0;transform:translateY(-50%);width:.5rem}.tagWithCount_h2kH span{background:var(--ifm-color-secondary);border-radius:var(--ifm-global-radius);color:var(--ifm-color-black);font-size:.7rem;line-height:1.2;margin-left:.3rem;padding:.1rem .4rem}.tags_jXut{display:inline}.tag_QGVx{display:inline-block;margin:0 .4rem .5rem 0}.lastUpdated_vwxv{font-size:smaller;font-style:italic;margin-top:.2rem}.tocCollapsibleButton_TO0P{align-items:center;display:flex;font-size:inherit;justify-content:space-between;padding:.4rem .8rem;width:100%}.tocCollapsibleButton_TO0P:after{background:var(--ifm-menu-link-sublist-icon) 50% 50%/2rem 2rem no-repeat;content:"";filter:var(--ifm-menu-link-sublist-icon-filter);height:1.25rem;transform:rotate(180deg);transition:transform var(--ifm-transition-fast);width:1.25rem}.tocCollapsibleButtonExpanded_MG3E:after,.tocCollapsibleExpanded_sAul{transform:none}.tocCollapsible_ETCw{background-color:var(--ifm-menu-color-background-active);border-radius:var(--ifm-global-radius);margin:1rem 0}.buttonGroup__atx button,.codeBlockContainer_Ckt0{background:var(--prism-background-color);color:var(--prism-color)}.tocCollapsibleContent_vkbj>ul{border-left:none;border-top:1px solid var(--ifm-color-emphasis-300);font-size:15px;padding:.2rem 0}.tocCollapsibleContent_vkbj ul li{margin:.4rem .8rem}.tocCollapsibleContent_vkbj a{display:block}.tableOfContents_bqdL{max-height:calc(100vh - var(--ifm-navbar-height) - 2rem);overflow-y:auto;position:sticky;top:calc(var(--ifm-navbar-height) + 1rem)}.anchorWithStickyNavbar_LWe7{scroll-margin-top:calc(var(--ifm-navbar-height) + .5rem)}.anchorWithHideOnScrollNavbar_WYt5{scroll-margin-top:.5rem}.hash-link{opacity:0;padding-left:.5rem;transition:opacity var(--ifm-transition-fast);user-select:none}.hash-link:before{content:"#"}.codeBlockContainer_Ckt0{border-radius:var(--ifm-code-border-radius);box-shadow:var(--ifm-global-shadow-lw);margin-bottom:var(--ifm-leading)}.codeBlockContent_biex{border-radius:inherit;direction:ltr;position:relative}.codeBlockTitle_Ktv7{border-bottom:1px solid var(--ifm-color-emphasis-300);border-top-left-radius:inherit;border-top-right-radius:inherit;font-size:var(--ifm-code-font-size);font-weight:500;padding:.75rem var(--ifm-pre-padding)}.codeBlock_bY9V{--ifm-pre-background:var(--prism-background-color);margin:0;padding:0}.codeBlockTitle_Ktv7+.codeBlockContent_biex .codeBlock_bY9V{border-top-left-radius:0;border-top-right-radius:0}.codeBlockLines_e6Vv{float:left;font:inherit;min-width:100%;padding:var(--ifm-pre-padding)}.codeBlockLinesWithNumbering_o6Pm{display:table;padding:var(--ifm-pre-padding) 0}.buttonGroup__atx{column-gap:.2rem;display:flex;position:absolute;right:calc(var(--ifm-pre-padding)/2);top:calc(var(--ifm-pre-padding)/2)}.buttonGroup__atx button{align-items:center;border:1px solid var(--ifm-color-emphasis-300);border-radius:var(--ifm-global-radius);display:flex;line-height:0;opacity:0;padding:.4rem;transition:opacity var(--ifm-transition-fast) ease-in-out}.buttonGroup__atx button:focus-visible,.buttonGroup__atx button:hover{opacity:1!important}.theme-code-block:hover .buttonGroup__atx button{opacity:.4}:where(:root){--docusaurus-highlighted-code-line-bg:#484d5b}:where([data-theme=dark]){--docusaurus-highlighted-code-line-bg:#646464}.theme-code-block-highlighted-line{background-color:var(--docusaurus-highlighted-code-line-bg);display:block;margin:0 calc(var(--ifm-pre-padding)*-1);padding:0 var(--ifm-pre-padding)}.codeLine_lJS_{counter-increment:a;display:table-row}.codeLineNumber_Tfdd{background:var(--ifm-pre-background);display:table-cell;left:0;overflow-wrap:normal;padding:0 var(--ifm-pre-padding);position:sticky;text-align:right;width:1%}.codeLineNumber_Tfdd:before{content:counter(a);opacity:.4}.codeLineContent_feaV{padding-right:var(--ifm-pre-padding)}.theme-code-block:hover .copyButtonCopied_obH4{opacity:1!important}.copyButtonIcons_eSgA{height:1.125rem;position:relative;width:1.125rem}.copyButtonIcon_y97N,.copyButtonSuccessIcon_LjdS{fill:currentColor;height:inherit;left:0;opacity:inherit;position:absolute;top:0;transition:all var(--ifm-transition-fast) ease;width:inherit}.copyButtonSuccessIcon_LjdS{color:#00d600;left:50%;opacity:0;top:50%;transform:translate(-50%,-50%) scale(.33)}.copyButtonCopied_obH4 .copyButtonIcon_y97N{opacity:0;transform:scale(.33)}.copyButtonCopied_obH4 .copyButtonSuccessIcon_LjdS{opacity:1;transform:translate(-50%,-50%) scale(1);transition-delay:75ms}.wordWrapButtonIcon_Bwma{height:1.2rem;width:1.2rem}.details_lb9f{--docusaurus-details-summary-arrow-size:0.38rem;--docusaurus-details-transition:transform 200ms ease;--docusaurus-details-decoration-color:grey}.details_lb9f>summary{cursor:pointer;list-style:none;padding-left:1rem;position:relative}.details_lb9f>summary::-webkit-details-marker{display:none}.details_lb9f>summary:before{border-color:#0000 #0000 #0000 var(--docusaurus-details-decoration-color);border-style:solid;border-width:var(--docusaurus-details-summary-arrow-size);content:"";left:0;position:absolute;top:.45rem;transform:rotate(0);transform-origin:calc(var(--docusaurus-details-summary-arrow-size)/2) 50%;transition:var(--docusaurus-details-transition)}.collapsibleContent_i85q{border-top:1px solid var(--docusaurus-details-decoration-color);margin-top:1rem;padding-top:1rem}.details_b_Ee{--docusaurus-details-decoration-color:var(--ifm-alert-border-color);--docusaurus-details-transition:transform var(--ifm-transition-fast) ease;border:1px solid var(--ifm-alert-border-color);margin:0 0 var(--ifm-spacing-vertical)}.containsTaskList_mC6p{list-style:none}.img_ev3q{height:auto}.admonition_LlT9{margin-bottom:1em}.admonitionHeading_tbUL{font:var(--ifm-heading-font-weight) var(--ifm-h5-font-size)/var(--ifm-heading-line-height) var(--ifm-heading-font-family);margin-bottom:.3rem}.admonitionHeading_tbUL code{text-transform:none}.admonitionIcon_kALy{display:inline-block;margin-right:.4em;vertical-align:middle}.admonitionIcon_kALy svg{fill:var(--ifm-alert-foreground-color);display:inline-block;height:1.6em;width:1.6em}.breadcrumbHomeIcon_YNFT{height:1.1rem;position:relative;top:1px;vertical-align:top;width:1.1rem}.breadcrumbsContainer_Z_bl{--ifm-breadcrumb-size-multiplier:0.8;margin-bottom:.8rem}.searchQueryInput_u2C7,.searchVersionInput_m0Ui{background:var(--docsearch-searchbox-focus-background);border:2px solid var(--ifm-toc-border-color);border-radius:var(--ifm-global-radius);color:var(--docsearch-text-color);font:var(--ifm-font-size-base) var(--ifm-font-family-base);margin-bottom:.5rem;padding:.8rem;transition:border var(--ifm-transition-fast) ease;width:100%}.searchQueryInput_u2C7:focus,.searchVersionInput_m0Ui:focus{border-color:var(--docsearch-primary-color);outline:0}.searchQueryInput_u2C7::placeholder{color:var(--docsearch-muted-color)}.searchResultsColumn_JPFH{font-size:.9rem;font-weight:700}.algoliaLogo_rT1R{max-width:150px}.algoliaLogoPathFill_WdUC{fill:var(--ifm-font-color-base)}.searchResultItem_Tv2o{border-bottom:1px solid var(--ifm-toc-border-color);padding:1rem 0}.searchResultItemHeading_KbCB{font-weight:400;margin-bottom:0}.searchResultItemPath_lhe1{--ifm-breadcrumb-separator-size-multiplier:1;color:var(--ifm-color-content-secondary);font-size:.8rem}.searchResultItemSummary_AEaO{font-style:italic;margin:.5rem 0 0}.loadingSpinner_XVxU{animation:1s linear infinite h;border:.4em solid #eee;border-radius:50%;border-top:.4em solid var(--ifm-color-primary);height:3rem;margin:0 auto;width:3rem}@keyframes h{to{transform:rotate(1turn)}}.loader_vvXV{margin-top:2rem}.search-result-match{background:#ffd78e40;color:var(--docsearch-hit-color);padding:.09em 0}.docSidebarContainer_b6E3,.openapidoc_oorz .menu-content,.sidebarLogo_isFc{display:none}.openapidoc_oorz code{background-color:initial;padding:0}.openapidoc_oorz table th{border:none}.openapidoc_oorz table td{border-right:none;border-top:none}.openapidoc_oorz table td:first-child{border-bottom:none}.openapidoc_oorz table td:nth-child(2){border-left:none}.openapidoc_oorz table tr{background-color:var(--ifm-background-color)}.openapidoc_oorz tr.last+tr>td>div{background-color:var(--ifm-background-color)!important}.openapidoc_oorz span.dropdown-selector-value{color:var(--ifm-font-color-secondary)}.backToTopButton_sjWU{background-color:var(--ifm-color-emphasis-200);border-radius:50%;bottom:1.3rem;box-shadow:var(--ifm-global-shadow-lw);height:3rem;opacity:0;position:fixed;right:1.3rem;transform:scale(0);transition:all var(--ifm-transition-fast) var(--ifm-transition-timing-default);visibility:hidden;width:3rem;z-index:calc(var(--ifm-z-index-fixed) - 1)}.backToTopButton_sjWU:after{background-color:var(--ifm-color-emphasis-1000);content:" ";display:inline-block;height:100%;-webkit-mask:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem no-repeat;mask:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem no-repeat;width:100%}.backToTopButtonShow_xfvO{opacity:1;transform:scale(1);visibility:visible}[data-theme=dark]:root{--docusaurus-collapse-button-bg:#ffffff0d;--docusaurus-collapse-button-bg-hover:#ffffff1a}.collapseSidebarButton_PEFL{display:none;margin:0}.docMainContainer_gTbr,.docPage__5DB{display:flex;width:100%}.docPage__5DB{flex:1 0}.docsWrapper_BCFX{display:flex;flex:1 0 auto}.verticallyJustifiedCol__fFm{display:flex;flex-direction:column;justify-content:center}.videoContainer_Inu3{height:0;padding-bottom:56.25%;position:relative;width:100%}.videoContainer_Inu3>iframe{height:100%;left:0;position:absolute;top:0;width:100%}.cogment_verse_logo_FnS0 .main{fill:var(--ifm-font-color-base-inverse)}.cogment_verse_logo_FnS0 .subscript{fill:var(--ifm-color-gray-500)}.logos_W70m{align-items:center;display:flex;flex-wrap:wrap;gap:1rem;justify-content:space-evenly;padding:1rem}.logos_W70m .logo_kX79{flex:0 0 150px}.benefit_pXnC{align-items:center;display:flex;flex-direction:column}.benefit_pXnC h4{display:block;font-size:var(--ifm-h3-font-size);height:3rem;text-align:center}.benefit_pXnC ul{display:block;max-width:25rem;padding-inline-start:0;padding:0 2rem;width:100%}.benefit_pXnC img{height:auto;max-width:200px}.screenshots_x3pV{display:flex;flex-direction:row;gap:2rem;justify-content:space-evenly;padding:2rem}.screenshots_x3pV>img{flex:0 0 auto;height:128px}.cta_i4Jo{display:flex;flex-direction:row;gap:1rem;justify-content:center}.DocSearch-Button,.DocSearch-Button-Container{align-items:center;display:flex}.hero_uw3b{background-color:var(--ifm-navbar-background-color);background-image:linear-gradient(var(--ifm-navbar-background-color),var(--ifm-hero-background-color-bottom));color:var(--ifm-font-color-base-inverse)}.hero_uw3b strong{font-weight:bolder}.hero_uw3b .button--primary{--ifm-button-background-color:var(--ifm-color-content-inverse);--ifm-button-border-color:var(--ifm-color-content-inverse);--ifm-button-color:var(--ifm-font-color-base)}.hero_uw3b .button--primary:hover{--ifm-button-background-color:var(--ifm-color-gray-300);--ifm-button-border-color:var(--ifm-color-gray-300)}.section_ccoD h3{color:var(--ifm-color-primary);text-align:center;text-transform:uppercase}.DocSearch-Button{background:var(--docsearch-searchbox-background);border:0;border-radius:40px;color:var(--docsearch-muted-color);cursor:pointer;font-weight:500;height:36px;justify-content:space-between;padding:0 8px;-webkit-user-select:none;user-select:none}.DocSearch-Button:active,.DocSearch-Button:focus,.DocSearch-Button:hover{background:var(--docsearch-searchbox-focus-background);box-shadow:var(--docsearch-searchbox-shadow);color:var(--docsearch-text-color);outline:0}.DocSearch-Search-Icon{stroke-width:1.6}.DocSearch-Hit-Tree,.DocSearch-Hit-action,.DocSearch-Hit-icon,.DocSearch-Reset{stroke-width:var(--docsearch-icon-stroke-width)}.DocSearch-Button .DocSearch-Search-Icon{color:var(--docsearch-text-color)}.DocSearch-Button-Placeholder{font-size:1rem;padding:0 12px 0 6px}.DocSearch-Input,.DocSearch-Link{-webkit-appearance:none;font:inherit}.DocSearch-Button-Keys{display:flex;min-width:calc(40px + .8em)}.DocSearch-Button-Key{align-items:center;background:var(--docsearch-key-gradient);border:0;border-radius:3px;box-shadow:var(--docsearch-key-shadow);color:var(--docsearch-muted-color);display:flex;height:18px;justify-content:center;margin-right:.4em;padding:0 0 2px;position:relative;top:-1px;width:20px}.DocSearch--active{overflow:hidden!important}.DocSearch-Container{background-color:var(--docsearch-container-background);height:100vh;left:0;position:fixed;top:0;width:100vw;z-index:200}.DocSearch-Link{appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;margin:0;padding:0}.DocSearch-Modal{background:var(--docsearch-modal-background);border-radius:6px;box-shadow:var(--docsearch-modal-shadow);flex-direction:column;margin:60px auto auto;max-width:var(--docsearch-modal-width);position:relative}.DocSearch-SearchBar{display:flex;padding:var(--docsearch-spacing) var(--docsearch-spacing) 0}.DocSearch-Form{align-items:center;background:var(--docsearch-searchbox-focus-background);border-radius:4px;box-shadow:var(--docsearch-searchbox-shadow);display:flex;height:var(--docsearch-searchbox-height);margin:0;padding:0 var(--docsearch-spacing);position:relative;width:100%}.DocSearch-Input{appearance:none;background:#0000;border:0;color:var(--docsearch-text-color);flex:1;font-size:1.2em;height:100%;outline:0;padding:0 0 0 8px;width:80%}.DocSearch-Hit-action-button,.DocSearch-Reset{-webkit-appearance:none;border:0;cursor:pointer}.DocSearch-Input::placeholder{color:var(--docsearch-muted-color);opacity:1}.DocSearch-Input::-webkit-search-cancel-button,.DocSearch-Input::-webkit-search-decoration,.DocSearch-Input::-webkit-search-results-button,.DocSearch-Input::-webkit-search-results-decoration{display:none}.DocSearch-LoadingIndicator,.DocSearch-MagnifierLabel,.DocSearch-Reset{margin:0;padding:0}.DocSearch-Container--Stalled .DocSearch-LoadingIndicator,.DocSearch-MagnifierLabel,.DocSearch-Reset{align-items:center;color:var(--docsearch-highlight-color);display:flex;justify-content:center}.DocSearch-Cancel,.DocSearch-Container--Stalled .DocSearch-MagnifierLabel,.DocSearch-LoadingIndicator,.DocSearch-Reset[hidden]{display:none}.DocSearch-Reset{animation:.1s ease-in forwards i;appearance:none;background:none;border-radius:50%;color:var(--docsearch-icon-color);padding:2px;right:0}.DocSearch-Help,.DocSearch-HitsFooter,.DocSearch-Label{color:var(--docsearch-muted-color)}.DocSearch-Reset:hover{color:var(--docsearch-highlight-color)}.DocSearch-LoadingIndicator svg,.DocSearch-MagnifierLabel svg{height:24px;width:24px}.DocSearch-Dropdown{max-height:calc(var(--docsearch-modal-height) - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height));min-height:var(--docsearch-spacing);overflow-y:auto;overflow-y:overlay;padding:0 var(--docsearch-spacing);scrollbar-color:var(--docsearch-muted-color) var(--docsearch-modal-background);scrollbar-width:thin}.DocSearch-Dropdown::-webkit-scrollbar{width:12px}.DocSearch-Dropdown::-webkit-scrollbar-track{background:#0000}.DocSearch-Dropdown::-webkit-scrollbar-thumb{background-color:var(--docsearch-muted-color);border:3px solid var(--docsearch-modal-background);border-radius:20px}.DocSearch-Dropdown ul{list-style:none;margin:0;padding:0}.DocSearch-Label{font-size:.75em;line-height:1.6em}.DocSearch-Help{font-size:.9em;margin:0;-webkit-user-select:none;user-select:none}.DocSearch-Title{font-size:1.2em}.DocSearch-Logo a{display:flex}.DocSearch-Logo svg{color:var(--docsearch-logo-color);margin-left:8px}.DocSearch-Hits:last-of-type{margin-bottom:24px}.DocSearch-Hits mark{background:none;color:var(--docsearch-highlight-color)}.DocSearch-HitsFooter{display:flex;font-size:.85em;justify-content:center;margin-bottom:var(--docsearch-spacing);padding:var(--docsearch-spacing)}.DocSearch-HitsFooter a{border-bottom:1px solid;color:inherit}.DocSearch-Hit{border-radius:4px;display:flex;padding-bottom:4px;position:relative}.DocSearch-Hit--deleting{opacity:0;transition:.25s linear}.DocSearch-Hit--favoriting{transform:scale(0);transform-origin:top center;transition:.25s linear .25s}.DocSearch-Hit a{background:var(--docsearch-hit-background);border-radius:4px;box-shadow:var(--docsearch-hit-shadow);display:block;padding-left:var(--docsearch-spacing);width:100%}.DocSearch-Hit-source{background:var(--docsearch-modal-background);color:var(--docsearch-highlight-color);font-size:.85em;font-weight:600;line-height:32px;margin:0 -4px;padding:8px 4px 0;position:sticky;top:0;z-index:10}.DocSearch-Hit-Tree{color:var(--docsearch-muted-color);height:var(--docsearch-hit-height);opacity:.5;width:24px}.DocSearch-Hit[aria-selected=true] a{background-color:var(--docsearch-highlight-color)}.DocSearch-Hit[aria-selected=true] mark{text-decoration:underline}.DocSearch-Hit-Container{align-items:center;color:var(--docsearch-hit-color);display:flex;flex-direction:row;height:var(--docsearch-hit-height);padding:0 var(--docsearch-spacing) 0 0}.DocSearch-Hit-icon{height:20px;width:20px}.DocSearch-Hit-action,.DocSearch-Hit-icon{color:var(--docsearch-muted-color)}.DocSearch-Hit-action{align-items:center;display:flex;height:22px;width:22px}.DocSearch-Hit-action svg{display:block;height:18px;width:18px}.DocSearch-Hit-action+.DocSearch-Hit-action{margin-left:6px}.DocSearch-Hit-action-button{appearance:none;background:none;border-radius:50%;color:inherit;padding:2px}svg.DocSearch-Hit-Select-Icon{display:none}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Select-Icon{display:block}.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:#0003;transition:background-color .1s ease-in}.DocSearch-Hit-action-button:focus path,.DocSearch-Hit-action-button:hover path{fill:#fff}.DocSearch-Hit-content-wrapper{display:flex;flex:1 1 auto;flex-direction:column;font-weight:500;justify-content:center;line-height:1.2em;margin:0 8px;overflow-x:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap;width:80%}.DocSearch-Hit-title{font-size:.9em}.DocSearch-Hit-path{color:var(--docsearch-muted-color);font-size:.75em}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Tree,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-action,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-icon,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-path,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-text,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-title,.DocSearch-Hit[aria-selected=true] mark{color:var(--docsearch-hit-active-color)!important}.DocSearch-ErrorScreen,.DocSearch-NoResults,.DocSearch-StartScreen{font-size:.9em;margin:0 auto;padding:36px 0;text-align:center;width:80%}.DocSearch-Screen-Icon{color:var(--docsearch-muted-color);padding-bottom:12px}.DocSearch-NoResults-Prefill-List{display:inline-block;padding-bottom:24px;text-align:left}.DocSearch-NoResults-Prefill-List ul{display:inline-block;padding:8px 0 0}.DocSearch-NoResults-Prefill-List li{list-style-position:inside;list-style-type:"» "}.DocSearch-Prefill{-webkit-appearance:none;appearance:none;background:none;border:0;border-radius:1em;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;font-size:1em;font-weight:700;padding:0}.DocSearch-Prefill:focus,.DocSearch-Prefill:hover{outline:0;text-decoration:underline}.DocSearch-Footer{align-items:center;background:var(--docsearch-footer-background);border-radius:0 0 8px 8px;box-shadow:var(--docsearch-footer-shadow);display:flex;flex-direction:row-reverse;flex-shrink:0;height:var(--docsearch-footer-height);justify-content:space-between;padding:0 var(--docsearch-spacing);position:relative;-webkit-user-select:none;user-select:none;width:100%;z-index:300}.DocSearch-Commands{color:var(--docsearch-muted-color);display:flex;list-style:none;margin:0;padding:0}.DocSearch-Commands li{align-items:center;display:flex}.DocSearch-Commands li:not(:last-of-type){margin-right:.8em}.DocSearch-Commands-Key{align-items:center;background:var(--docsearch-key-gradient);border:0;border-radius:2px;box-shadow:var(--docsearch-key-shadow);color:var(--docsearch-muted-color);display:flex;height:18px;justify-content:center;margin-right:.4em;padding:0 0 1px;width:20px}@keyframes i{0%{opacity:0}to{opacity:1}}.DocSearch-Button{margin:0;transition:all var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.DocSearch-Container{z-index:calc(var(--ifm-z-index-fixed) + 1)}@media (min-width:997px){.collapseSidebarButton_PEFL,.expandButton_m80_{background-color:var(--docusaurus-collapse-button-bg)}:root{--docusaurus-announcement-bar-height:30px}.announcementBarClose_gvF7,.announcementBarPlaceholder_vyr4{flex-basis:50px}.searchBox_ZlJk{padding:var(--ifm-navbar-item-padding-vertical) var(--ifm-navbar-item-padding-horizontal)}.lastUpdated_vwxv{text-align:right}.tocMobile_ITEo{display:none}.docItemCol_VOVn{max-width:75%!important}.collapseSidebarButton_PEFL{border:1px solid var(--ifm-toc-border-color);border-radius:0;bottom:0;display:block!important;height:40px;position:sticky}.collapseSidebarButtonIcon_kv0_{margin-top:4px;transform:rotate(180deg)}.expandButtonIcon_BlDH,[dir=rtl] .collapseSidebarButtonIcon_kv0_{transform:rotate(0)}.collapseSidebarButton_PEFL:focus,.collapseSidebarButton_PEFL:hover,.expandButton_m80_:focus,.expandButton_m80_:hover{background-color:var(--docusaurus-collapse-button-bg-hover)}.menuHtmlItem_M9Kj{padding:var(--ifm-menu-link-padding-vertical) var(--ifm-menu-link-padding-horizontal)}.menu_SIkG{flex-grow:1;padding:.5rem}@supports (scrollbar-gutter:stable){.menu_SIkG{padding:.5rem 0 .5rem .5rem;scrollbar-gutter:stable}}.menuWithAnnouncementBar_GW3s{margin-bottom:var(--docusaurus-announcement-bar-height)}.sidebar_njMd{display:flex;flex-direction:column;height:100%;padding-top:var(--ifm-navbar-height);width:var(--doc-sidebar-width)}.sidebarWithHideableNavbar_wUlq{padding-top:0}.sidebarHidden_VK0M{opacity:0;visibility:hidden}.sidebarLogo_isFc{align-items:center;color:inherit!important;display:flex!important;margin:0 var(--ifm-navbar-padding-horizontal);max-height:var(--ifm-navbar-height);min-height:var(--ifm-navbar-height);text-decoration:none!important}.sidebarLogo_isFc img{height:2rem;margin-right:.5rem}.expandButton_m80_{align-items:center;display:flex;height:100%;justify-content:center;position:absolute;right:0;top:0;transition:background-color var(--ifm-transition-fast) ease;width:100%}[dir=rtl] .expandButtonIcon_BlDH{transform:rotate(180deg)}.docSidebarContainer_b6E3{border-right:1px solid var(--ifm-toc-border-color);-webkit-clip-path:inset(0);clip-path:inset(0);display:block;margin-top:calc(var(--ifm-navbar-height)*-1);transition:width var(--ifm-transition-fast) ease;width:var(--doc-sidebar-width);will-change:width}.docSidebarContainerHidden_b3ry{cursor:pointer;width:var(--doc-sidebar-hidden-width)}.sidebarViewport_Xe31{height:100%;max-height:100vh;position:sticky;top:0}.docMainContainer_gTbr{flex-grow:1;max-width:calc(100% - var(--doc-sidebar-width))}.docMainContainerEnhanced_Uz_u{max-width:calc(100% - var(--doc-sidebar-hidden-width))}.docItemWrapperEnhanced_czyv{max-width:calc(var(--ifm-container-width) + var(--doc-sidebar-width))!important}}@media (min-width:1440px){.container{max-width:var(--ifm-container-width-xl)}}@media (max-width:996px){.col{--ifm-col-width:100%;flex-basis:var(--ifm-col-width);margin-left:0}.footer{--ifm-footer-padding-horizontal:0}.colorModeToggle_DEke,.footer__link-separator,.navbar__item,.tableOfContents_bqdL{display:none}.footer__col{margin-bottom:calc(var(--ifm-spacing-vertical)*3)}.footer__link-item{display:block}.hero{padding-left:0;padding-right:0}.navbar>.container,.navbar>.container-fluid{padding:0}.navbar__toggle{display:inherit}.navbar__search-input{width:9rem}.pills--block,.tabs--block{flex-direction:column}.searchBox_ZlJk{position:absolute;right:var(--ifm-navbar-padding-horizontal)}.docItemContainer_F8PC{padding:0 .3rem}}@media only screen and (max-width:996px){.searchQueryColumn_RTkw,.searchResultsColumn_JPFH{max-width:60%!important}.searchLogoColumn_rJIA,.searchVersionColumn_ypXd{max-width:40%!important}.searchLogoColumn_rJIA{padding-left:0!important}}@media (max-width:768px){.DocSearch-Button-Keys,.DocSearch-Button-Placeholder,.DocSearch-Commands,.DocSearch-Hit-Tree{display:none}:root{--docsearch-spacing:10px;--docsearch-footer-height:40px}.DocSearch-Dropdown{height:100%;max-height:calc(var(--docsearch-vh,1vh)*100 - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height))}.DocSearch-Container{height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh,1vh)*100);position:absolute}.DocSearch-Footer{border-radius:0;bottom:0;position:absolute}.DocSearch-Hit-content-wrapper{display:flex;position:relative;width:80%}.DocSearch-Modal{border-radius:0;box-shadow:none;height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh,1vh)*100);margin:0;max-width:100%;width:100%}.DocSearch-Cancel{-webkit-appearance:none;appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;flex:none;font:inherit;font-size:1em;font-weight:500;margin-left:var(--docsearch-spacing);outline:0;overflow:hidden;padding:0;-webkit-user-select:none;user-select:none;white-space:nowrap}}@media (max-width:576px){.markdown h1:first-child{--ifm-h1-font-size:2rem}.markdown>h2{--ifm-h2-font-size:1.5rem}.markdown>h3{--ifm-h3-font-size:1.25rem}}@media screen and (max-width:576px){.searchQueryColumn_RTkw{max-width:100%!important}.searchVersionColumn_ypXd{max-width:100%!important;padding-left:var(--ifm-spacing-horizontal)!important}}@media (hover:hover){.backToTopButton_sjWU:hover{background-color:var(--ifm-color-emphasis-300)}}@media (pointer:fine){.thin-scrollbar{scrollbar-width:thin}.thin-scrollbar::-webkit-scrollbar{height:var(--ifm-scrollbar-size);width:var(--ifm-scrollbar-size)}.thin-scrollbar::-webkit-scrollbar-track{background:var(--ifm-scrollbar-track-background-color);border-radius:10px}.thin-scrollbar::-webkit-scrollbar-thumb{background:var(--ifm-scrollbar-thumb-background-color);border-radius:10px}.thin-scrollbar::-webkit-scrollbar-thumb:hover{background:var(--ifm-scrollbar-thumb-hover-background-color)}}@media (prefers-reduced-motion:reduce){:root{--ifm-transition-fast:0ms;--ifm-transition-slow:0ms}.fa-beat,.fa-beat-fade,.fa-bounce,.fa-fade,.fa-flip,.fa-pulse,.fa-shake,.fa-spin,.fa-spin-pulse{animation-delay:-1ms;animation-duration:1ms;animation-iteration-count:1;transition-delay:0s;transition-duration:0s}}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Reset{stroke-width:var(--docsearch-icon-stroke-width);animation:none;-webkit-appearance:none;appearance:none;background:none;border:0;border-radius:50%;color:var(--docsearch-icon-color);cursor:pointer;right:0}.DocSearch-Hit--deleting,.DocSearch-Hit--favoriting{transition:none}.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:#0003;transition:none}}@media print{.announcementBar_mb4j,.footer,.menu,.navbar,.pagination-nav,.table-of-contents,.tocMobile_ITEo{display:none}.tabs{page-break-inside:avoid}.codeBlockLines_e6Vv{white-space:pre-wrap}} \ No newline at end of file diff --git a/assets/js/08714d8c.2b3a3d60.js b/assets/js/08714d8c.2b3a3d60.js new file mode 100644 index 0000000..bcd5a5b --- /dev/null +++ b/assets/js/08714d8c.2b3a3d60.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[3922],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>u});var i=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=i.createContext({}),p=function(e){var t=i.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=p(e.components);return i.createElement(s.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return i.createElement(i.Fragment,{},t)}},h=i.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,s=e.parentName,d=l(e,["components","mdxType","originalType","parentName"]),c=p(n),h=a,u=c["".concat(s,".").concat(h)]||c[h]||m[h]||r;return n?i.createElement(u,o(o({ref:t},d),{},{components:n})):i.createElement(u,o({ref:t},d))}));function u(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,o=new Array(r);o[0]=h;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[c]="string"==typeof e?e:a,o[1]=l;for(var p=2;p{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>m,frontMatter:()=>r,metadata:()=>l,toc:()=>p});var i=n(7462),a=(n(7294),n(3905));const r={sidebar_position:2},o="Trial Parameters",l={unversionedId:"reference/parameters",id:"reference/parameters",title:"Trial Parameters",description:"The trial parameters are a set of parameters that define the details of a trial.",source:"@site/docs/reference/parameters.md",sourceDirName:"reference",slug:"/reference/parameters",permalink:"/docs/reference/parameters",draft:!1,tags:[],version:"current",lastUpdatedAt:1697135297,formattedLastUpdatedAt:"Oct 12, 2023",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"docSidebar",previous:{title:"Specifications File",permalink:"/docs/reference/cogment-yaml"},next:{title:"CLI",permalink:"/docs/reference/cli/"}},s={},p=[{value:"Parameters reference",id:"parameters-reference",level:2},{value:"Parameter file",id:"parameter-file",level:2},{value:"Parameters and pre-trial hooks",id:"parameters-and-pre-trial-hooks",level:2},{value:"Cogment endpoints",id:"cogment-endpoints",level:2},{value:"grpc scheme",id:"grpc-scheme",level:3},{value:"cogment scheme",id:"cogment-scheme",level:3},{value:"client host",id:"client-host",level:4},{value:"discover host",id:"discover-host",level:4},{value:"Discovery path",id:"discovery-path",level:5},{value:"Discovery query",id:"discovery-query",level:5},{value:"Reserved query properties",id:"reserved-query-properties",level:5}],d={toc:p},c="wrapper";function m(e){let{components:t,...n}=e;return(0,a.kt)(c,(0,i.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"trial-parameters"},"Trial Parameters"),(0,a.kt)("p",null,"The trial parameters are a set of parameters that define the details of a trial.\nThey may be generated from the default parameters provided to the Orchestrator (see ",(0,a.kt)("a",{parentName:"p",href:"#parameter-file"},"Parameter File"),"), and updated by the pre-trial hooks (see ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/python#class-cogmenttrialparameters"},"TrialParameters")," and ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/python#registerpretrialhookself-impl"},"register_pre_trial_hook"),").\nOr they can be provided whole to the trial start call (see ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/python#async-starttrialself-trialconfignone-trialidrequestednone-trialparamsnone"},"start_trial"),")."),(0,a.kt)("p",null,"In the parameters, are optional config messages for the trial, environment and actors.\nThe trial config is only used by the pre-trial hooks, whereas the other configs are sent to their respective destination at the start of the trial.\nThe config protobuf messages are defined in the spec file."),(0,a.kt)("p",null,"The pre-trial hooks exist to allow dynamic parameter setting at the start of a trial, with the use of the trial config.\nAnother way to set the parameters dynamically is by providing them to the start trial call.\nThe parameters of the trial start call take priority over all others, and thus when provided, the default parameters will be ignored and the pre-trial hooks will not be called."),(0,a.kt)("h2",{id:"parameters-reference"},"Parameters reference"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"config"),": User defined configuration sent to the first trial pre-hook before the start of the trial. The type is defined in the spec file under section ",(0,a.kt)("inlineCode",{parentName:"li"},"trial:config_type"),". DEFAULT: not set."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"properties"),": User defined key/value properties (in a map/dictionary style) that are associated with the trial. Key names starting with a double underscore (","_","_",") are reserved for Cogment internal use. DEFAULT: empty."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"max_steps"),": The maximum number of time steps (ticks) that the trial will run before requesting a ",(0,a.kt)("a",{parentName:"li",href:"/docs/guide/development-guide#soft-termination"},(0,a.kt)("em",{parentName:"a"},"soft")," termination")," at the next step. DEFAULT: 0 (infinite nb steps)."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"max_inactivity"),": The number of seconds of inactivity after which a trial will be ",(0,a.kt)("a",{parentName:"li",href:"/docs/guide/development-guide#hard-termination"},(0,a.kt)("em",{parentName:"a"},"hard")," terminated"),'. "Activity" is defined as a message received by the Orchestrator from a user component. If 0, the trial will not be terminated because of inactivity. DEFAULT: 30 seconds.'),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"nb_buffered_ticks"),": The number of ticks (steps) to buffer in the Orchestrator before sending the data to the datalog. This is in effect the delay between the currently running trial and the datalog data. It is also the time window for past data (e.g. rewards) to still make it in the correct normal sample of the datalog. If data is too far in the past (the tick ID is more in the past than ",(0,a.kt)("inlineCode",{parentName:"li"},"nb_buffered_ticks"),") then a special ",(0,a.kt)("inlineCode",{parentName:"li"},"out-of-sync")," ",(0,a.kt)("a",{parentName:"li",href:"/docs/reference/python#class-cogmentlogsample"},"sample")," will be sent to the datalog. This value must be larger than 1. DEFAULT: 2."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"datalog_endpoint"),": Endpoint of the datalog service. DEFAULT: not set (data logging is disabled)."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"datalog_exclude_fields"),": List of fields to exclude from the data samples sent to the datalog service."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"environment_config"),": User defined configuration sent to the environment at the start of the trial. The type is defined in spec file under section ",(0,a.kt)("inlineCode",{parentName:"li"},"environment:config_type"),". DEFAULT: not set."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"environment_name"),': The name of the environment. DEFAULT: "env".'),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"environment_endpoint"),": Endpoint of the environment service. DEFAULT: context discovery endpoint (the Directory will be inquired)."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"environment_implementation"),": The name of the implementation to run the environment. This must match an implementation that is defined at the endpoint. DEFAULT: not set (an arbitrary implementation will be chosen at runtime)."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"actors"),": List of actor parameter sets.",(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"config"),": User defined configuration sent to the actor at the start of the trial. The type is defined in the spec file under section ",(0,a.kt)("inlineCode",{parentName:"li"},"actor_classes:config_type")," for the appropriate actor class. DEFAULT: not set."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"name"),": The name of the actor (must be unique in the trial). DEFAULT: none (required parameter)."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"actor_class"),": The name of the actor class. This must match a value in the spec file under section ",(0,a.kt)("inlineCode",{parentName:"li"},"actor_classes:name"),". DEFAULT: none (required parameter)."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"endpoint"),': Endpoint of the actor. This can be "cogment://client", which indicates a client actor. DEFAULT: context discovery endpoint (the Directory will be inquired).'),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"implementation"),": The name of the implementation to run this actor. This must match an implementation that is defined at the endpoint. DEFAULT: not set (an arbitrary implementation will be chosen at runtime)."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"initial_connection_timeout"),": Maximum amount of time (in seconds) to wait for an actor to connect to a new trial, after which it is considered unavailable for the trial duration. If the wait is too long (see ",(0,a.kt)("inlineCode",{parentName:"li"},"max_inactivity"),"), the trial may be terminated. The trial may wait longer than the requested timeout. DEFAULT: 0.0 (no timeout; indefinite wait)."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"response_timeout"),": Maximum amount of time (in seconds) to wait for an actor to respond with an action after an observation is sent, after which it is considered unavailable. If the wait is too long, the trial may be terminated (see ",(0,a.kt)("inlineCode",{parentName:"li"},"max_inactivity"),"). The trial may wait longer than the requested timeout. DEFAULT: 0.0 (no timeout; indefinite wait)."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"optional"),": If set (true), the actor is optional. An optional actor is not necessary for a trial to continue. If an actor is required (i.e not optional), the trial will be terminated if the actor is not available. DEFAULT: false."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"default_action"),": This is only relevant for optional actors (see ",(0,a.kt)("inlineCode",{parentName:"li"},"optional"),"). If set, and the actor is not available, the environment will receive this action (the environment will not be informed that the actor is unavailable). If not set, the environment will be informed that the actor is unavailable (the environment will not receive an action). The type is defined in the spec file under section ",(0,a.kt)("inlineCode",{parentName:"li"},"actor_classes:action:space")," for the appropriate actor class. DEFAULT: not set.")))),(0,a.kt)("h2",{id:"parameter-file"},"Parameter file"),(0,a.kt)("p",null,"The parameter file serves to initialize the Orchestrator default parameters.\nIt is able to set all parameters except for the configs and actor default actions."),(0,a.kt)("p",null,"The file uses the YAML configuration language. It consists of one top level YAML section called ",(0,a.kt)("inlineCode",{parentName:"p"},"trial_params"),".\nAny other top level section will be ignored."),(0,a.kt)("p",null,"The layout is hierarchical, so the name of the parameters may be different than the parameter description above:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"properties"),": Dictionary of user defined key/value pairs."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"max_steps")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"max_inactivity")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"nb_buffered_ticks")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"datalog"),": List of parameters related to the data logger. If this section is not present, data logging is disabled.",(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"endpoint")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"exclude_fields")))),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"environment"),": List of parameters for the environment",(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"name")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"endpoint")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"implementation")))),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"actors"),": List of actor parameter sets. Note that as defaults, the number of actors may not be suited for all trials.",(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"name")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"actor_class")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"endpoint")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"implementation")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"initial_connection_timeout")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"response_timeout")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"optional"))))),(0,a.kt)("p",null,"E.g.:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-yaml"},'trial_params:\n properties:\n days_to_retain: 10\n training: no\n with_humans: yes\n params_source: default\n processor: "Alpha-67+"\n\n max_steps: 1000\n max_inactivity: 30\n nb_buffered_ticks: 5\n\n datalog:\n endpoint: grpc://logserver:9000\n exclude_fields: [messages, actions]\n\n environment:\n name: Arena\n endpoint: grpc://env:9000\n implementation: simple\n\n actors:\n - name: Alice\n actor_class: BigPlayer\n endpoint: cogment://discover\n implementation:\n - name: Bob\n actor_class: BigPlayer\n endpoint: grpc://bp2:9000\n implementation: Test\n initial_connection_timeout: 10.0\n - name: Carol\n actor_class: SmallPlayer\n endpoint: grpc://sp:9000\n implementation: DQN_Hotel3\n initial_connection_timeout: 5.0\n optional: True\n - name: Dave\n actor_class: SmallPlayer\n endpoint: cogment://discover/service?id=8390256\n implementation: DNN_Karma3.1.17\n initial_connection_timeout: 3.0\n optional: True\n - name: Olivia\n actor_class: Referee\n endpoint: cogment://client\n implementation: Standard\n response_timeout: 20.0\n')),(0,a.kt)("h2",{id:"parameters-and-pre-trial-hooks"},"Parameters and pre-trial hooks"),(0,a.kt)("p",null,"If no parameters were given to the trial start call, the default parameters and pre-trial hooks are used.\nAnd if no pre-trial hooks are defined, the default parameters will be used directly to start the trial."),(0,a.kt)("p",null,"Pre-trial hooks are gRPC services that may be called to set up the parameters for a new trial. Multiple hooks can be defined and they will all be called in order, in a pipeline fashion (i.e. the output of one becomes the input of the next). The first hook service to be called will receive the default parameters (augmented by the trial config that may be given to the trial start call). The output of the last hook is used as final parameters to start the new trial. The response of the last hook will be waited on before the trial starts."),(0,a.kt)("p",null,"The hooks will be called to update or generate all the parameter data (presented here) in addition to the configurations for the environment and the actors (if needed)."),(0,a.kt)("p",null,"Pre-trial hooks are defined on the command line (or an environment variable) when starting the Orchestrator."),(0,a.kt)("h2",{id:"cogment-endpoints"},"Cogment endpoints"),(0,a.kt)("p",null,"Cogment endpoints are basic URLs (",(0,a.kt)("inlineCode",{parentName:"p"},"scheme://host/path?query"),") that can have one of two schemes: ",(0,a.kt)("inlineCode",{parentName:"p"},"grpc")," or ",(0,a.kt)("inlineCode",{parentName:"p"},"cogment"),".\nThe path and query are optional, but a valid endpoint must have a scheme and a host."),(0,a.kt)("p",null,"The context is used to determine what API service will be used to connect to the endpoint; e.g. if this is the endpoint for an environment, then the ",(0,a.kt)("inlineCode",{parentName:"p"},"EnvironmentSP")," gRPC API will be used."),(0,a.kt)("h3",{id:"grpc-scheme"},(0,a.kt)("inlineCode",{parentName:"h3"},"grpc")," scheme"),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"grpc")," scheme is used to access a network resource using one of the Cogment gRPC API directly, without the need of a Directory.\nAn endpoint with this scheme is also called a ",(0,a.kt)("strong",{parentName:"p"},"grpc endpoint"),".\nThe rest of the URL is a standard HTTP address (with port) and points to the gRPC server waiting for connection. E.g.:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"grpc://10.0.123.5:9000\ngrpc://SomeServer:9011\ngrpc://second.actors.base.com:9050\n")),(0,a.kt)("h3",{id:"cogment-scheme"},(0,a.kt)("inlineCode",{parentName:"h3"},"cogment")," scheme"),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"cogment")," scheme is specific to Cogment and has two possible hosts: ",(0,a.kt)("inlineCode",{parentName:"p"},"client")," or ",(0,a.kt)("inlineCode",{parentName:"p"},"discover"),"."),(0,a.kt)("h4",{id:"client-host"},(0,a.kt)("inlineCode",{parentName:"h4"},"client")," host"),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"client")," host is used in the very specific case of an ",(0,a.kt)("em",{parentName:"p"},"actor"),' being a "client actor".\nThis endpoint (i.e. exactly "cogment://client") is a ',(0,a.kt)("strong",{parentName:"p"},"special endpoint"),".\nOnly actors can use this endpoint.\nIn this case, the actor with such an endpoint will connect as a client, the Orchestrator being the server.\nThe client will connect to the actor port of the ","[Orchestrator][../reference/cli/orchestrator.md]","."),(0,a.kt)("h4",{id:"discover-host"},(0,a.kt)("inlineCode",{parentName:"h4"},"discover")," host"),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"discover")," host is to indicate that a ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/cli/directory/directory-server"},"Directory"),' needs to be inquired.\nAn endpoint with this host (i.e. starting with "cogment://discover") is also called a ',(0,a.kt)("strong",{parentName:"p"},"discovery endpoint"),"."),(0,a.kt)("p",null,"The directory returns an actual endpoint where to reach the service; either a grpc endpoint (e.g. ",(0,a.kt)("inlineCode",{parentName:"p"},"grpc://10.5.134.2:9000"),"), or for an actor, it can also be a special endpoint (e.g. ",(0,a.kt)("inlineCode",{parentName:"p"},"cogment://client"),").\nThe result should not be another discovery endpoint."),(0,a.kt)("p",null,"The endpoint for the directory must be a grpc endpoint and is provided beforehand (e.g. for the ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/cli/orchestrator"},"Orchestrator"),", it is an option on start)."),(0,a.kt)("p",null,"With a ",(0,a.kt)("strong",{parentName:"p"},"context discovery endpoint")," there is no path in the URL, and some of the details of the service will be obtained from the context of the endpoint (i.e. where the endpoint was provided and for what).\nThis type of endpoint is the simple form of discovery endpoints."),(0,a.kt)("p",null,"When there is no query, it is in its simplest form and referred as a ",(0,a.kt)("strong",{parentName:"p"},"pure context discovery endpoint"),': "cogment://discover".\nIt is the default in Cogment when no endpoint is provided by the user (where discovery endpoints are valid).'),(0,a.kt)("p",null,"Example of context discovery endpoints:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"cogment://discover\ncogment://discover?tag=blue\ncogment://discover?tag=red&zone=1\n")),(0,a.kt)("p",null,"If these endpoints were provided for actors, they would be equivalent to these ",(0,a.kt)("strong",{parentName:"p"},"explicit discovery endpoints"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"cogment://discover/actor?__actor_class=xxx&__implementation=yyy\ncogment://discover/actor?__actor_class=xxx&__implementation=yyy&tag=blue\ncogment://discover/actor?__actor_class=xxx&__implementation=yyy&tag=red&zone=1\n")),(0,a.kt)("p",null,'Where "xxx" and "yyy" are values taken from the context (typically the trial start parameters). For each type of endpoint, the context provides the path as described ',(0,a.kt)("a",{parentName:"p",href:"#discovery-path"},"below"),", and these properties (if available):"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"For actor contexts: properties are ",(0,a.kt)("inlineCode",{parentName:"li"},"__actor_class")," and ",(0,a.kt)("inlineCode",{parentName:"li"},"__implementation")),(0,a.kt)("li",{parentName:"ul"},"For environment contexts: property is ",(0,a.kt)("inlineCode",{parentName:"li"},"__implementation")),(0,a.kt)("li",{parentName:"ul"},"For all other contexts, no properties are provided by the context")),(0,a.kt)("p",null,"These properties are implicitly registered in the directory when starting an actor or environment service from a SDK.\nBut if explicitly registering the services to the directory, these properties must be provided if a context discovery endpoint is used (otherwise the service will not be found)."),(0,a.kt)("p",null,"An ",(0,a.kt)("strong",{parentName:"p"},"explicit discovery endpoint"),", as opposed to a context discovery endpoint, is a URL with a path, and needs to explicitly provide all the necessary information in the URL (the context of the endpoint will be ignored).\nIn other words, no context property will be implicitly added to the URL query sent to the directory, the user is fully responsible to match the URL to the need (and match the properties)."),(0,a.kt)("h5",{id:"discovery-path"},"Discovery path"),(0,a.kt)("p",null,"There are two categories of path for discovery endpoints, one for generic service types and the other for specific service types."),(0,a.kt)("p",null,"The generic path ",(0,a.kt)("inlineCode",{parentName:"p"},"service")," is used to find services of any type.\nIn this case, the query must be ",(0,a.kt)("inlineCode",{parentName:"p"},"__id=XXX")," where XXX is a 64 bit unsigned integer representing the ID of a service registered in the directory, e.g.:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"cogment://discover/service?__id=67834892\ncogment://discover/service?__id=42\n")),(0,a.kt)("p",null,"The specific paths are used to find a specific type of service:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"actor"),": To find an actor service"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"environment"),": To find an environment service"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"datalog"),": To find a data logger service"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"prehook"),": To find a pre-trial hook service"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"lifecycle"),": To find a service offering trial life cycle management"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"actservice"),": To find a service offering client actor connection"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"datastore"),": To find a data store service"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"modelregistry"),": To find a model registry service"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"directory"),": To find a directory service")),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"actor"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"environment")," and ",(0,a.kt)("inlineCode",{parentName:"p"},"datalog")," paths will normally be used in the trial parameters to start a new trial.\nThey will be interpreted and managed by the Orchestrator, which will inquire the Directory."),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"prehook")," path is for use on the command line of the Orchestrator."),(0,a.kt)("p",null,"The others are for use by services themselves, e.g. to find an Orchestrator to connect to."),(0,a.kt)("h5",{id:"discovery-query"},"Discovery query"),(0,a.kt)("p",null,"Following the path in the discovery endpoint, is the optional query; properties to find a suitable service.\nAll the properties provided in the query must match properties registered in the directory (with some exceptions, see ",(0,a.kt)("a",{parentName:"p",href:"#reserved-query-properties"},"below"),").\nWhich properties are acceptable depends on the directory (and how the services are registered in the directory)."),(0,a.kt)("p",null,"The query in the discovery endpoint must follow these guidelines:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Entries are separated by the ampersand (&)"),(0,a.kt)("li",{parentName:"ul"},"Property name and associated value are separated by an equal sign (=)"),(0,a.kt)("li",{parentName:"ul"},"Property names and values must be composed of only these characters: A-Z, a-z, 0-9, underscore (","_","), dash (-), dot (.)"),(0,a.kt)("li",{parentName:"ul"},"Property values are optional"),(0,a.kt)("li",{parentName:"ul"},"Property names starting with a double underscore (","_","_",") are reserved. E.g ",(0,a.kt)("inlineCode",{parentName:"li"},"__authentication-token"))),(0,a.kt)("p",null,"E.g.:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"cogment://discover/actor?__implementation=d3qn\ncogment://discover/environment?__implementation=fqdn3&type=fast-2x&ping=low\ncogment://discover/datalog?name=high&open&color=green_blue\n")),(0,a.kt)("h5",{id:"reserved-query-properties"},"Reserved query properties"),(0,a.kt)("p",null,"Some endpoint query properties are reserved for Cogment use. They may be interpreted by other services than the directory, and thus may not correspond to directory properties that participate in service discovery.\nSome of these names may not be used as properties to inquire from (or register in) the directory.\nThey may be used for special purposes that differ for each name."),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"__actor_class"),": This is a property name implicitly used by Cogment. It is registered in the Directory for services that were implicitly registered by Cogment or a Cogment SDK. It is also used by Cogment to inquire for context discovery endpoints."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"__authentication-token"),": This query property is ",(0,a.kt)("em",{parentName:"li"},"not")," a directory property. It is used to provide authentication to the directory. The value (and need) depends on the directory implementation and/or how the registration of the service is made in the directory. This is not registered as a property in the Directory."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"__id"),": This query property is not a directory property. It is used to provide a service ID for inquiry to the directory for a specific service. This is not registered as a property in the Directory."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"__implementation"),": This is a property name implicitly used by Cogment. It is registered in the Directory for services that were implicitly registered by Cogment or a Cogment SDK. It is also used by Cogment to inquire for context discovery endpoints.")))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/08714d8c.8066bd98.js b/assets/js/08714d8c.8066bd98.js deleted file mode 100644 index 7a4deda..0000000 --- a/assets/js/08714d8c.8066bd98.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[3922],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>h});var i=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=i.createContext({}),p=function(e){var t=i.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=p(e.components);return i.createElement(s.Provider,{value:t},e.children)},c={inlineCode:"code",wrapper:function(e){var t=e.children;return i.createElement(i.Fragment,{},t)}},m=i.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,s=e.parentName,d=l(e,["components","mdxType","originalType","parentName"]),m=p(n),h=a,u=m["".concat(s,".").concat(h)]||m[h]||c[h]||r;return n?i.createElement(u,o(o({ref:t},d),{},{components:n})):i.createElement(u,o({ref:t},d))}));function h(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,o=new Array(r);o[0]=m;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l.mdxType="string"==typeof e?e:a,o[1]=l;for(var p=2;p{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>c,frontMatter:()=>r,metadata:()=>l,toc:()=>p});var i=n(7462),a=(n(7294),n(3905));const r={sidebar_position:2},o="Trial Parameters",l={unversionedId:"reference/parameters",id:"reference/parameters",title:"Trial Parameters",description:"The trial parameters are a set of parameters that define the details of a trial.",source:"@site/docs/reference/parameters.md",sourceDirName:"reference",slug:"/reference/parameters",permalink:"/docs/reference/parameters",draft:!1,tags:[],version:"current",lastUpdatedAt:1697135297,formattedLastUpdatedAt:"Oct 12, 2023",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"docSidebar",previous:{title:"Specifications File",permalink:"/docs/reference/cogment-yaml"},next:{title:"CLI",permalink:"/docs/reference/cli/"}},s={},p=[{value:"Parameters reference",id:"parameters-reference",level:2},{value:"Parameter file",id:"parameter-file",level:2},{value:"Parameters and pre-trial hooks",id:"parameters-and-pre-trial-hooks",level:2},{value:"Cogment endpoints",id:"cogment-endpoints",level:2},{value:"grpc scheme",id:"grpc-scheme",level:3},{value:"cogment scheme",id:"cogment-scheme",level:3},{value:"client host",id:"client-host",level:4},{value:"discover host",id:"discover-host",level:4},{value:"Discovery path",id:"discovery-path",level:5},{value:"Discovery query",id:"discovery-query",level:5},{value:"Reserved query properties",id:"reserved-query-properties",level:5}],d={toc:p};function c(e){let{components:t,...n}=e;return(0,a.kt)("wrapper",(0,i.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"trial-parameters"},"Trial Parameters"),(0,a.kt)("p",null,"The trial parameters are a set of parameters that define the details of a trial.\nThey may be generated from the default parameters provided to the Orchestrator (see ",(0,a.kt)("a",{parentName:"p",href:"#parameter-file"},"Parameter File"),"), and updated by the pre-trial hooks (see ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/python#class-cogmenttrialparameters"},"TrialParameters")," and ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/python#registerpretrialhookself-impl"},"register_pre_trial_hook"),").\nOr they can be provided whole to the trial start call (see ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/python#async-starttrialself-trialconfignone-trialidrequestednone-trialparamsnone"},"start_trial"),")."),(0,a.kt)("p",null,"In the parameters, are optional config messages for the trial, environment and actors.\nThe trial config is only used by the pre-trial hooks, whereas the other configs are sent to their respective destination at the start of the trial.\nThe config protobuf messages are defined in the spec file."),(0,a.kt)("p",null,"The pre-trial hooks exist to allow dynamic parameter setting at the start of a trial, with the use of the trial config.\nAnother way to set the parameters dynamically is by providing them to the start trial call.\nThe parameters of the trial start call take priority over all others, and thus when provided, the default parameters will be ignored and the pre-trial hooks will not be called."),(0,a.kt)("h2",{id:"parameters-reference"},"Parameters reference"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"config"),": User defined configuration sent to the first trial pre-hook before the start of the trial. The type is defined in the spec file under section ",(0,a.kt)("inlineCode",{parentName:"li"},"trial:config_type"),". DEFAULT: not set."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"properties"),": User defined key/value properties (in a map/dictionary style) that are associated with the trial. Key names starting with a double underscore (","_","_",") are reserved for Cogment internal use. DEFAULT: empty."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"max_steps"),": The maximum number of time steps (ticks) that the trial will run before requesting a ",(0,a.kt)("a",{parentName:"li",href:"/docs/guide/development-guide#soft-termination"},(0,a.kt)("em",{parentName:"a"},"soft")," termination")," at the next step. DEFAULT: 0 (infinite nb steps)."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"max_inactivity"),": The number of seconds of inactivity after which a trial will be ",(0,a.kt)("a",{parentName:"li",href:"/docs/guide/development-guide#hard-termination"},(0,a.kt)("em",{parentName:"a"},"hard")," terminated"),'. "Activity" is defined as a message received by the Orchestrator from a user component. If 0, the trial will not be terminated because of inactivity. DEFAULT: 30 seconds.'),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"nb_buffered_ticks"),": The number of ticks (steps) to buffer in the Orchestrator before sending the data to the datalog. This is in effect the delay between the currently running trial and the datalog data. It is also the time window for past data (e.g. rewards) to still make it in the correct normal sample of the datalog. If data is too far in the past (the tick ID is more in the past than ",(0,a.kt)("inlineCode",{parentName:"li"},"nb_buffered_ticks"),") then a special ",(0,a.kt)("inlineCode",{parentName:"li"},"out-of-sync")," ",(0,a.kt)("a",{parentName:"li",href:"/docs/reference/python#class-cogmentlogsample"},"sample")," will be sent to the datalog. This value must be larger than 1. DEFAULT: 2."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"datalog_endpoint"),": Endpoint of the datalog service. DEFAULT: not set (data logging is disabled)."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"datalog_exclude_fields"),": List of fields to exclude from the data samples sent to the datalog service."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"environment_config"),": User defined configuration sent to the environment at the start of the trial. The type is defined in spec file under section ",(0,a.kt)("inlineCode",{parentName:"li"},"environment:config_type"),". DEFAULT: not set."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"environment_name"),': The name of the environment. DEFAULT: "env".'),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"environment_endpoint"),": Endpoint of the environment service. DEFAULT: context discovery endpoint (the Directory will be inquired)."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"environment_implementation"),": The name of the implementation to run the environment. This must match an implementation that is defined at the endpoint. DEFAULT: not set (an arbitrary implementation will be chosen at runtime)."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"actors"),": List of actor parameter sets.",(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"config"),": User defined configuration sent to the actor at the start of the trial. The type is defined in the spec file under section ",(0,a.kt)("inlineCode",{parentName:"li"},"actor_classes:config_type")," for the appropriate actor class. DEFAULT: not set."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"name"),": The name of the actor (must be unique in the trial). DEFAULT: none (required parameter)."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"actor_class"),": The name of the actor class. This must match a value in the spec file under section ",(0,a.kt)("inlineCode",{parentName:"li"},"actor_classes:name"),". DEFAULT: none (required parameter)."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"endpoint"),': Endpoint of the actor. This can be "cogment://client", which indicates a client actor. DEFAULT: context discovery endpoint (the Directory will be inquired).'),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"implementation"),": The name of the implementation to run this actor. This must match an implementation that is defined at the endpoint. DEFAULT: not set (an arbitrary implementation will be chosen at runtime)."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"initial_connection_timeout"),": Maximum amount of time (in seconds) to wait for an actor to connect to a new trial, after which it is considered unavailable for the trial duration. If the wait is too long (see ",(0,a.kt)("inlineCode",{parentName:"li"},"max_inactivity"),"), the trial may be terminated. The trial may wait longer than the requested timeout. DEFAULT: 0.0 (no timeout; indefinite wait)."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"response_timeout"),": Maximum amount of time (in seconds) to wait for an actor to respond with an action after an observation is sent, after which it is considered unavailable. If the wait is too long, the trial may be terminated (see ",(0,a.kt)("inlineCode",{parentName:"li"},"max_inactivity"),"). The trial may wait longer than the requested timeout. DEFAULT: 0.0 (no timeout; indefinite wait)."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"optional"),": If set (true), the actor is optional. An optional actor is not necessary for a trial to continue. If an actor is required (i.e not optional), the trial will be terminated if the actor is not available. DEFAULT: false."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"default_action"),": This is only relevant for optional actors (see ",(0,a.kt)("inlineCode",{parentName:"li"},"optional"),"). If set, and the actor is not available, the environment will receive this action (the environment will not be informed that the actor is unavailable). If not set, the environment will be informed that the actor is unavailable (the environment will not receive an action). The type is defined in the spec file under section ",(0,a.kt)("inlineCode",{parentName:"li"},"actor_classes:action:space")," for the appropriate actor class. DEFAULT: not set.")))),(0,a.kt)("h2",{id:"parameter-file"},"Parameter file"),(0,a.kt)("p",null,"The parameter file serves to initialize the Orchestrator default parameters.\nIt is able to set all parameters except for the configs and actor default actions."),(0,a.kt)("p",null,"The file uses the YAML configuration language. It consists of one top level YAML section called ",(0,a.kt)("inlineCode",{parentName:"p"},"trial_params"),".\nAny other top level section will be ignored."),(0,a.kt)("p",null,"The layout is hierarchical, so the name of the parameters may be different than the parameter description above:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"properties"),": Dictionary of user defined key/value pairs."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"max_steps")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"max_inactivity")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"nb_buffered_ticks")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"datalog"),": List of parameters related to the data logger. If this section is not present, data logging is disabled.",(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"endpoint")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"exclude_fields")))),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"environment"),": List of parameters for the environment",(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"name")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"endpoint")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"implementation")))),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"actors"),": List of actor parameter sets. Note that as defaults, the number of actors may not be suited for all trials.",(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"name")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"actor_class")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"endpoint")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"implementation")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"initial_connection_timeout")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"response_timeout")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"optional"))))),(0,a.kt)("p",null,"E.g.:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-yaml"},'trial_params:\n properties:\n days_to_retain: 10\n training: no\n with_humans: yes\n params_source: default\n processor: "Alpha-67+"\n\n max_steps: 1000\n max_inactivity: 30\n nb_buffered_ticks: 5\n\n datalog:\n endpoint: grpc://logserver:9000\n exclude_fields: [messages, actions]\n\n environment:\n name: Arena\n endpoint: grpc://env:9000\n implementation: simple\n\n actors:\n - name: Alice\n actor_class: BigPlayer\n endpoint: cogment://discover\n implementation:\n - name: Bob\n actor_class: BigPlayer\n endpoint: grpc://bp2:9000\n implementation: Test\n initial_connection_timeout: 10.0\n - name: Carol\n actor_class: SmallPlayer\n endpoint: grpc://sp:9000\n implementation: DQN_Hotel3\n initial_connection_timeout: 5.0\n optional: True\n - name: Dave\n actor_class: SmallPlayer\n endpoint: cogment://discover/service?id=8390256\n implementation: DNN_Karma3.1.17\n initial_connection_timeout: 3.0\n optional: True\n - name: Olivia\n actor_class: Referee\n endpoint: cogment://client\n implementation: Standard\n response_timeout: 20.0\n')),(0,a.kt)("h2",{id:"parameters-and-pre-trial-hooks"},"Parameters and pre-trial hooks"),(0,a.kt)("p",null,"If no parameters were given to the trial start call, the default parameters and pre-trial hooks are used.\nAnd if no pre-trial hooks are defined, the default parameters will be used directly to start the trial."),(0,a.kt)("p",null,"Pre-trial hooks are gRPC services that may be called to set up the parameters for a new trial. Multiple hooks can be defined and they will all be called in order, in a pipeline fashion (i.e. the output of one becomes the input of the next). The first hook service to be called will receive the default parameters (augmented by the trial config that may be given to the trial start call). The output of the last hook is used as final parameters to start the new trial. The response of the last hook will be waited on before the trial starts."),(0,a.kt)("p",null,"The hooks will be called to update or generate all the parameter data (presented here) in addition to the configurations for the environment and the actors (if needed)."),(0,a.kt)("p",null,"Pre-trial hooks are defined on the command line (or an environment variable) when starting the Orchestrator."),(0,a.kt)("h2",{id:"cogment-endpoints"},"Cogment endpoints"),(0,a.kt)("p",null,"Cogment endpoints are basic URLs (",(0,a.kt)("inlineCode",{parentName:"p"},"scheme://host/path?query"),") that can have one of two schemes: ",(0,a.kt)("inlineCode",{parentName:"p"},"grpc")," or ",(0,a.kt)("inlineCode",{parentName:"p"},"cogment"),".\nThe path and query are optional, but a valid endpoint must have a scheme and a host."),(0,a.kt)("p",null,"The context is used to determine what API service will be used to connect to the endpoint; e.g. if this is the endpoint for an environment, then the ",(0,a.kt)("inlineCode",{parentName:"p"},"EnvironmentSP")," gRPC API will be used."),(0,a.kt)("h3",{id:"grpc-scheme"},(0,a.kt)("inlineCode",{parentName:"h3"},"grpc")," scheme"),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"grpc")," scheme is used to access a network resource using one of the Cogment gRPC API directly, without the need of a Directory.\nAn endpoint with this scheme is also called a ",(0,a.kt)("strong",{parentName:"p"},"grpc endpoint"),".\nThe rest of the URL is a standard HTTP address (with port) and points to the gRPC server waiting for connection. E.g.:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"grpc://10.0.123.5:9000\ngrpc://SomeServer:9011\ngrpc://second.actors.base.com:9050\n")),(0,a.kt)("h3",{id:"cogment-scheme"},(0,a.kt)("inlineCode",{parentName:"h3"},"cogment")," scheme"),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"cogment")," scheme is specific to Cogment and has two possible hosts: ",(0,a.kt)("inlineCode",{parentName:"p"},"client")," or ",(0,a.kt)("inlineCode",{parentName:"p"},"discover"),"."),(0,a.kt)("h4",{id:"client-host"},(0,a.kt)("inlineCode",{parentName:"h4"},"client")," host"),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"client")," host is used in the very specific case of an ",(0,a.kt)("em",{parentName:"p"},"actor"),' being a "client actor".\nThis endpoint (i.e. exactly "cogment://client") is a ',(0,a.kt)("strong",{parentName:"p"},"special endpoint"),".\nOnly actors can use this endpoint.\nIn this case, the actor with such an endpoint will connect as a client, the Orchestrator being the server.\nThe client will connect to the actor port of the ","[Orchestrator][../reference/cli/orchestrator.md]","."),(0,a.kt)("h4",{id:"discover-host"},(0,a.kt)("inlineCode",{parentName:"h4"},"discover")," host"),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"discover")," host is to indicate that a ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/cli/directory/directory-server"},"Directory"),' needs to be inquired.\nAn endpoint with this host (i.e. starting with "cogment://discover") is also called a ',(0,a.kt)("strong",{parentName:"p"},"discovery endpoint"),"."),(0,a.kt)("p",null,"The directory returns an actual endpoint where to reach the service; either a grpc endpoint (e.g. ",(0,a.kt)("inlineCode",{parentName:"p"},"grpc://10.5.134.2:9000"),"), or for an actor, it can also be a special endpoint (e.g. ",(0,a.kt)("inlineCode",{parentName:"p"},"cogment://client"),").\nThe result should not be another discovery endpoint."),(0,a.kt)("p",null,"The endpoint for the directory must be a grpc endpoint and is provided beforehand (e.g. for the ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/cli/orchestrator"},"Orchestrator"),", it is an option on start)."),(0,a.kt)("p",null,"With a ",(0,a.kt)("strong",{parentName:"p"},"context discovery endpoint")," there is no path in the URL, and some of the details of the service will be obtained from the context of the endpoint (i.e. where the endpoint was provided and for what).\nThis type of endpoint is the simple form of discovery endpoints."),(0,a.kt)("p",null,"When there is no query, it is in its simplest form and referred as a ",(0,a.kt)("strong",{parentName:"p"},"pure context discovery endpoint"),': "cogment://discover".\nIt is the default in Cogment when no endpoint is provided by the user (where discovery endpoints are valid).'),(0,a.kt)("p",null,"Example of context discovery endpoints:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"cogment://discover\ncogment://discover?tag=blue\ncogment://discover?tag=red&zone=1\n")),(0,a.kt)("p",null,"If these endpoints were provided for actors, they would be equivalent to these ",(0,a.kt)("strong",{parentName:"p"},"explicit discovery endpoints"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"cogment://discover/actor?__actor_class=xxx&__implementation=yyy\ncogment://discover/actor?__actor_class=xxx&__implementation=yyy&tag=blue\ncogment://discover/actor?__actor_class=xxx&__implementation=yyy&tag=red&zone=1\n")),(0,a.kt)("p",null,'Where "xxx" and "yyy" are values taken from the context (typically the trial start parameters). For each type of endpoint, the context provides the path as described ',(0,a.kt)("a",{parentName:"p",href:"#discovery-path"},"below"),", and these properties (if available):"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"For actor contexts: properties are ",(0,a.kt)("inlineCode",{parentName:"li"},"__actor_class")," and ",(0,a.kt)("inlineCode",{parentName:"li"},"__implementation")),(0,a.kt)("li",{parentName:"ul"},"For environment contexts: property is ",(0,a.kt)("inlineCode",{parentName:"li"},"__implementation")),(0,a.kt)("li",{parentName:"ul"},"For all other contexts, no properties are provided by the context")),(0,a.kt)("p",null,"These properties are implicitly registered in the directory when starting an actor or environment service from a SDK.\nBut if explicitly registering the services to the directory, these properties must be provided if a context discovery endpoint is used (otherwise the service will not be found)."),(0,a.kt)("p",null,"An ",(0,a.kt)("strong",{parentName:"p"},"explicit discovery endpoint"),", as opposed to a context discovery endpoint, is a URL with a path, and needs to explicitly provide all the necessary information in the URL (the context of the endpoint will be ignored).\nIn other words, no context property will be implicitly added to the URL query sent to the directory, the user is fully responsible to match the URL to the need (and match the properties)."),(0,a.kt)("h5",{id:"discovery-path"},"Discovery path"),(0,a.kt)("p",null,"There are two categories of path for discovery endpoints, one for generic service types and the other for specific service types."),(0,a.kt)("p",null,"The generic path ",(0,a.kt)("inlineCode",{parentName:"p"},"service")," is used to find services of any type.\nIn this case, the query must be ",(0,a.kt)("inlineCode",{parentName:"p"},"__id=XXX")," where XXX is a 64 bit unsigned integer representing the ID of a service registered in the directory, e.g.:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"cogment://discover/service?__id=67834892\ncogment://discover/service?__id=42\n")),(0,a.kt)("p",null,"The specific paths are used to find a specific type of service:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"actor"),": To find an actor service"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"environment"),": To find an environment service"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"datalog"),": To find a data logger service"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"prehook"),": To find a pre-trial hook service"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"lifecycle"),": To find a service offering trial life cycle management"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"actservice"),": To find a service offering client actor connection"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"datastore"),": To find a data store service"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"modelregistry"),": To find a model registry service"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"directory"),": To find a directory service")),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"actor"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"environment")," and ",(0,a.kt)("inlineCode",{parentName:"p"},"datalog")," paths will normally be used in the trial parameters to start a new trial.\nThey will be interpreted and managed by the Orchestrator, which will inquire the Directory."),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"prehook")," path is for use on the command line of the Orchestrator."),(0,a.kt)("p",null,"The others are for use by services themselves, e.g. to find an Orchestrator to connect to."),(0,a.kt)("h5",{id:"discovery-query"},"Discovery query"),(0,a.kt)("p",null,"Following the path in the discovery endpoint, is the optional query; properties to find a suitable service.\nAll the properties provided in the query must match properties registered in the directory (with some exceptions, see ",(0,a.kt)("a",{parentName:"p",href:"#reserved-query-properties"},"below"),").\nWhich properties are acceptable depends on the directory (and how the services are registered in the directory)."),(0,a.kt)("p",null,"The query in the discovery endpoint must follow these guidelines:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Entries are separated by the ampersand (&)"),(0,a.kt)("li",{parentName:"ul"},"Property name and associated value are separated by an equal sign (=)"),(0,a.kt)("li",{parentName:"ul"},"Property names and values must be composed of only these characters: A-Z, a-z, 0-9, underscore (","_","), dash (-), dot (.)"),(0,a.kt)("li",{parentName:"ul"},"Property values are optional"),(0,a.kt)("li",{parentName:"ul"},"Property names starting with a double underscore (","_","_",") are reserved. E.g ",(0,a.kt)("inlineCode",{parentName:"li"},"__authentication-token"))),(0,a.kt)("p",null,"E.g.:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"cogment://discover/actor?__implementation=d3qn\ncogment://discover/environment?__implementation=fqdn3&type=fast-2x&ping=low\ncogment://discover/datalog?name=high&open&color=green_blue\n")),(0,a.kt)("h5",{id:"reserved-query-properties"},"Reserved query properties"),(0,a.kt)("p",null,"Some endpoint query properties are reserved for Cogment use. They may be interpreted by other services than the directory, and thus may not correspond to directory properties that participate in service discovery.\nSome of these names may not be used as properties to inquire from (or register in) the directory.\nThey may be used for special purposes that differ for each name."),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"__actor_class"),": This is a property name implicitly used by Cogment. It is registered in the Directory for services that were implicitly registered by Cogment or a Cogment SDK. It is also used by Cogment to inquire for context discovery endpoints."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"__authentication-token"),": This query property is ",(0,a.kt)("em",{parentName:"li"},"not")," a directory property. It is used to provide authentication to the directory. The value (and need) depends on the directory implementation and/or how the registration of the service is made in the directory. This is not registered as a property in the Directory."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"__id"),": This query property is not a directory property. It is used to provide a service ID for inquiry to the directory for a specific service. This is not registered as a property in the Directory."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"__implementation"),": This is a property name implicitly used by Cogment. It is registered in the Directory for services that were implicitly registered by Cogment or a Cogment SDK. It is also used by Cogment to inquire for context discovery endpoints.")))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/1426.0c0df919.js b/assets/js/1426.0c0df919.js new file mode 100644 index 0000000..b67adeb --- /dev/null +++ b/assets/js/1426.0c0df919.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[1426],{6672:(e,t,r)=>{function n(e,t){var r=void 0;return function(){for(var n=arguments.length,o=new Array(n),i=0;ipn});var a=function(){};function c(e){var t=e.item,r=e.items;return{index:t.__autocomplete_indexName,items:[t],positions:[1+r.findIndex((function(e){return e.objectID===t.objectID}))],queryID:t.__autocomplete_queryID,algoliaSource:["autocomplete"]}}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,c=[],l=!0,u=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(s){u=!0,o=s}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return u(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t=3||2===r&&n>=4||1===r&&n>=10);function i(t,r,n){if(o&&void 0!==n){var i=n[0].__autocomplete_algoliaCredentials,a={"X-Algolia-Application-Id":i.appId,"X-Algolia-API-Key":i.apiKey};e.apply(void 0,[t].concat(p(r),[{headers:a}]))}else e.apply(void 0,[t].concat(p(r)))}return{init:function(t,r){e("init",{appId:t,apiKey:r})},setUserToken:function(t){e("setUserToken",t)},clickedObjectIDsAfterSearch:function(){for(var e=arguments.length,t=new Array(e),r=0;r0&&i("clickedObjectIDsAfterSearch",g(t),t[0].items)},clickedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),r=0;r0&&i("clickedObjectIDs",g(t),t[0].items)},clickedFilters:function(){for(var t=arguments.length,r=new Array(t),n=0;n0&&e.apply(void 0,["clickedFilters"].concat(r))},convertedObjectIDsAfterSearch:function(){for(var e=arguments.length,t=new Array(e),r=0;r0&&i("convertedObjectIDsAfterSearch",g(t),t[0].items)},convertedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),r=0;r0&&i("convertedObjectIDs",g(t),t[0].items)},convertedFilters:function(){for(var t=arguments.length,r=new Array(t),n=0;n0&&e.apply(void 0,["convertedFilters"].concat(r))},viewedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),r=0;r0&&t.reduce((function(e,t){var r=t.items,n=d(t,f);return[].concat(p(e),p(function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,r=[],n=0;n0&&e.apply(void 0,["viewedFilters"].concat(r))}}}function S(e){var t=e.items.reduce((function(e,t){var r;return e[t.__autocomplete_indexName]=(null!==(r=e[t.__autocomplete_indexName])&&void 0!==r?r:[]).concat(t),e}),{});return Object.keys(t).map((function(e){return{index:e,items:t[e],algoliaSource:["autocomplete"]}}))}function j(e){return e.objectID&&e.__autocomplete_indexName&&e.__autocomplete_queryID}function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}function E(e){return function(e){if(Array.isArray(e))return P(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return P(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return P(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&C({onItemsChange:o,items:r,insights:f,state:t}))}}),0);return{name:"aa.algoliaInsightsPlugin",subscribe:function(e){var t=e.setContext,r=e.onSelect,n=e.onActive;s("addAlgoliaAgent","insights-plugin"),t({algoliaInsightsPlugin:{__algoliaSearchParameters:{clickAnalytics:!0},insights:f}}),r((function(e){var t=e.item,r=e.state,n=e.event;j(t)&&l({state:r,event:n,insights:f,item:t,insightsEvents:[D({eventName:"Item Selected"},c({item:t,items:m.current}))]})})),n((function(e){var t=e.item,r=e.state,n=e.event;j(t)&&u({state:r,event:n,insights:f,item:t,insightsEvents:[D({eventName:"Item Active"},c({item:t,items:m.current}))]})}))},onStateChange:function(e){var t=e.state;p({state:t})},__autocomplete_pluginOptions:e}}function N(e){return N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},N(e)}function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function q(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==N(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==N(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===N(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function R(e,t,r){var n,o=t.initialState;return{getState:function(){return o},dispatch:function(n,i){var a=function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0},reshape:function(e){return e.sources}},e),{},{id:null!==(r=e.id)&&void 0!==r?r:"autocomplete-".concat(V++),plugins:o,initialState:X({activeItemId:null,query:"",completion:null,collections:[],isOpen:!1,status:"idle",context:{}},e.initialState),onStateChange:function(t){var r;null===(r=e.onStateChange)||void 0===r||r.call(e,t),o.forEach((function(e){var r;return null===(r=e.onStateChange)||void 0===r?void 0:r.call(e,t)}))},onSubmit:function(t){var r;null===(r=e.onSubmit)||void 0===r||r.call(e,t),o.forEach((function(e){var r;return null===(r=e.onSubmit)||void 0===r?void 0:r.call(e,t)}))},onReset:function(t){var r;null===(r=e.onReset)||void 0===r||r.call(e,t),o.forEach((function(e){var r;return null===(r=e.onReset)||void 0===r?void 0:r.call(e,t)}))},getSources:function(r){return Promise.all([].concat(Q(o.map((function(e){return e.getSources}))),[e.getSources]).filter(Boolean).map((function(e){return function(e,t){var r=[];return Promise.resolve(e(t)).then((function(e){return Array.isArray(e),Promise.all(e.filter((function(e){return Boolean(e)})).map((function(e){if(e.sourceId,r.includes(e.sourceId))throw new Error("[Autocomplete] The `sourceId` ".concat(JSON.stringify(e.sourceId)," is not unique."));r.push(e.sourceId);var t={getItemInputValue:function(e){return e.state.query},getItemUrl:function(){},onSelect:function(e){(0,e.setIsOpen)(!1)},onActive:a,onResolve:a};Object.keys(t).forEach((function(e){t[e].__default=!0}));var n=$($({},t),e);return Promise.resolve(n)})))}))}(e,r)}))).then((function(e){return L(e)})).then((function(e){return e.map((function(e){return X(X({},e),{},{onSelect:function(r){e.onSelect(r),t.forEach((function(e){var t;return null===(t=e.onSelect)||void 0===t?void 0:t.call(e,r)}))},onActive:function(r){e.onActive(r),t.forEach((function(e){var t;return null===(t=e.onActive)||void 0===t?void 0:t.call(e,r)}))},onResolve:function(r){e.onResolve(r),t.forEach((function(e){var t;return null===(t=e.onResolve)||void 0===t?void 0:t.call(e,r)}))}})}))}))},navigator:X({navigate:function(e){var t=e.itemUrl;n.location.assign(t)},navigateNewTab:function(e){var t=e.itemUrl,r=n.open(t,"_blank","noopener");null==r||r.focus()},navigateNewWindow:function(e){var t=e.itemUrl;n.open(t,"_blank","noopener")}},e.navigator)})}function te(e){return te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},te(e)}function re(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ne(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var Ie,De,Ae,ke=null,xe=(Ie=-1,De=-1,Ae=void 0,function(e){var t=++Ie;return Promise.resolve(e).then((function(e){return Ae&&t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var Me=/((gt|sm)-|galaxy nexus)|samsung[- ]|samsungbrowser/i;function He(e){return He="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},He(e)}var Fe=["props","refresh","store"],Ue=["inputElement","formElement","panelElement"],Be=["inputElement"],Ve=["inputElement","maxLength"],Ke=["sourceIndex"],$e=["sourceIndex"],Je=["item","source","sourceIndex"];function ze(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function We(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Ge(e){var t=e.props,r=e.refresh,n=e.store,o=Ze(e,Fe),i=function(e,t){return void 0!==t?"".concat(e,"-").concat(t):e};return{getEnvironmentProps:function(e){var r=e.inputElement,o=e.formElement,i=e.panelElement;function a(e){!n.getState().isOpen&&n.pendingRequests.isEmpty()||e.target===r||!1===[o,i].some((function(t){return r=t,n=e.target,r===n||r.contains(n);var r,n}))&&(n.dispatch("blur",null),t.debug||n.pendingRequests.cancelAll())}return We({onTouchStart:a,onMouseDown:a,onTouchMove:function(e){!1!==n.getState().isOpen&&r===t.environment.document.activeElement&&e.target!==r&&r.blur()}},Ze(e,Ue))},getRootProps:function(e){return We({role:"combobox","aria-expanded":n.getState().isOpen,"aria-haspopup":"listbox","aria-owns":n.getState().isOpen?"".concat(t.id,"-list"):void 0,"aria-labelledby":"".concat(t.id,"-label")},e)},getFormProps:function(e){e.inputElement;return We({action:"",noValidate:!0,role:"search",onSubmit:function(i){var a;i.preventDefault(),t.onSubmit(We({event:i,refresh:r,state:n.getState()},o)),n.dispatch("submit",null),null===(a=e.inputElement)||void 0===a||a.blur()},onReset:function(i){var a;i.preventDefault(),t.onReset(We({event:i,refresh:r,state:n.getState()},o)),n.dispatch("reset",null),null===(a=e.inputElement)||void 0===a||a.focus()}},Ze(e,Be))},getLabelProps:function(e){var r=e||{},n=r.sourceIndex,o=Ze(r,Ke);return We({htmlFor:"".concat(i(t.id,n),"-input"),id:"".concat(i(t.id,n),"-label")},o)},getInputProps:function(e){var i;function c(e){(t.openOnFocus||Boolean(n.getState().query))&&Ce(We({event:e,props:t,query:n.getState().completion||n.getState().query,refresh:r,store:n},o)),n.dispatch("focus",null)}var l=e||{},u=(l.inputElement,l.maxLength),s=void 0===u?512:u,f=Ze(l,Ve),m=ge(n.getState()),p=function(e){return Boolean(e&&e.match(Me))}((null===(i=t.environment.navigator)||void 0===i?void 0:i.userAgent)||""),v=null!=m&&m.itemUrl&&!p?"go":"search";return We({"aria-autocomplete":"both","aria-activedescendant":n.getState().isOpen&&null!==n.getState().activeItemId?"".concat(t.id,"-item-").concat(n.getState().activeItemId):void 0,"aria-controls":n.getState().isOpen?"".concat(t.id,"-list"):void 0,"aria-labelledby":"".concat(t.id,"-label"),value:n.getState().completion||n.getState().query,id:"".concat(t.id,"-input"),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",enterKeyHint:v,spellCheck:"false",autoFocus:t.autoFocus,placeholder:t.placeholder,maxLength:s,type:"search",onChange:function(e){Ce(We({event:e,props:t,query:e.currentTarget.value.slice(0,s),refresh:r,store:n},o))},onKeyDown:function(e){!function(e){var t=e.event,r=e.props,n=e.refresh,o=e.store,i=Le(e,Ne);if("ArrowUp"===t.key||"ArrowDown"===t.key){var a=function(){var e=r.environment.document.getElementById("".concat(r.id,"-item-").concat(o.getState().activeItemId));e&&(e.scrollIntoViewIfNeeded?e.scrollIntoViewIfNeeded(!1):e.scrollIntoView(!1))},c=function(){var e=ge(o.getState());if(null!==o.getState().activeItemId&&e){var r=e.item,a=e.itemInputValue,c=e.itemUrl,l=e.source;l.onActive(qe({event:t,item:r,itemInputValue:a,itemUrl:c,refresh:n,source:l,state:o.getState()},i))}};t.preventDefault(),!1===o.getState().isOpen&&(r.openOnFocus||Boolean(o.getState().query))?Ce(qe({event:t,props:r,query:o.getState().query,refresh:n,store:o},i)).then((function(){o.dispatch(t.key,{nextActiveItemId:r.defaultActiveItemId}),c(),setTimeout(a,0)})):(o.dispatch(t.key,{}),c(),a())}else if("Escape"===t.key)t.preventDefault(),o.dispatch(t.key,null),o.pendingRequests.cancelAll();else if("Tab"===t.key)o.dispatch("blur",null),o.pendingRequests.cancelAll();else if("Enter"===t.key){if(null===o.getState().activeItemId||o.getState().collections.every((function(e){return 0===e.items.length})))return void(r.debug||o.pendingRequests.cancelAll());t.preventDefault();var l=ge(o.getState()),u=l.item,s=l.itemInputValue,f=l.itemUrl,m=l.source;if(t.metaKey||t.ctrlKey)void 0!==f&&(m.onSelect(qe({event:t,item:u,itemInputValue:s,itemUrl:f,refresh:n,source:m,state:o.getState()},i)),r.navigator.navigateNewTab({itemUrl:f,item:u,state:o.getState()}));else if(t.shiftKey)void 0!==f&&(m.onSelect(qe({event:t,item:u,itemInputValue:s,itemUrl:f,refresh:n,source:m,state:o.getState()},i)),r.navigator.navigateNewWindow({itemUrl:f,item:u,state:o.getState()}));else if(t.altKey);else{if(void 0!==f)return m.onSelect(qe({event:t,item:u,itemInputValue:s,itemUrl:f,refresh:n,source:m,state:o.getState()},i)),void r.navigator.navigate({itemUrl:f,item:u,state:o.getState()});Ce(qe({event:t,nextState:{isOpen:!1},props:r,query:s,refresh:n,store:o},i)).then((function(){m.onSelect(qe({event:t,item:u,itemInputValue:s,itemUrl:f,refresh:n,source:m,state:o.getState()},i))}))}}}(We({event:e,props:t,refresh:r,store:n},o))},onFocus:c,onBlur:a,onClick:function(r){e.inputElement!==t.environment.document.activeElement||n.getState().isOpen||c(r)}},f)},getPanelProps:function(e){return We({onMouseDown:function(e){e.preventDefault()},onMouseLeave:function(){n.dispatch("mouseleave",null)}},e)},getListProps:function(e){var r=e||{},n=r.sourceIndex,o=Ze(r,$e);return We({role:"listbox","aria-labelledby":"".concat(i(t.id,n),"-label"),id:"".concat(i(t.id,n),"-list")},o)},getItemProps:function(e){var a=e.item,c=e.source,l=e.sourceIndex,u=Ze(e,Je);return We({id:"".concat(i(t.id,l),"-item-").concat(a.__autocomplete_id),role:"option","aria-selected":n.getState().activeItemId===a.__autocomplete_id,onMouseMove:function(e){if(a.__autocomplete_id!==n.getState().activeItemId){n.dispatch("mousemove",a.__autocomplete_id);var t=ge(n.getState());if(null!==n.getState().activeItemId&&t){var i=t.item,c=t.itemInputValue,l=t.itemUrl,u=t.source;u.onActive(We({event:e,item:i,itemInputValue:c,itemUrl:l,refresh:r,source:u,state:n.getState()},o))}}},onMouseDown:function(e){e.preventDefault()},onClick:function(e){var i=c.getItemInputValue({item:a,state:n.getState()}),l=c.getItemUrl({item:a,state:n.getState()});(l?Promise.resolve():Ce(We({event:e,nextState:{isOpen:!1},props:t,query:i,refresh:r,store:n},o))).then((function(){c.onSelect(We({event:e,item:a,itemInputValue:i,itemUrl:l,refresh:r,source:c,state:n.getState()},o))}))}},u)}}}var Xe=[{segment:"autocomplete-core",version:"1.9.3"}];function Ye(e){return Ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ye(e)}function et(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tt(e){for(var t=1;t=r?null===n?null:0:o}function at(e){return at="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},at(e)}function ct(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function lt(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function kt(e){var t=e.translations,r=void 0===t?{}:t,n=At(e,Pt),o=r.noResultsText,i=void 0===o?"No results for":o,a=r.suggestedQueryText,c=void 0===a?"Try searching for":a,l=r.reportMissingResultsText,u=void 0===l?"Believe this query should return results?":l,s=r.reportMissingResultsLinkText,f=void 0===s?"Let us know.":s,m=n.state.context.searchSuggestions;return yt.createElement("div",{className:"DocSearch-NoResults"},yt.createElement("div",{className:"DocSearch-Screen-Icon"},yt.createElement(Et,null)),yt.createElement("p",{className:"DocSearch-Title"},i,' "',yt.createElement("strong",null,n.state.query),'"'),m&&m.length>0&&yt.createElement("div",{className:"DocSearch-NoResults-Prefill-List"},yt.createElement("p",{className:"DocSearch-Help"},c,":"),yt.createElement("ul",null,m.slice(0,3).reduce((function(e,t){return[].concat(It(e),[yt.createElement("li",{key:t},yt.createElement("button",{className:"DocSearch-Prefill",key:t,type:"button",onClick:function(){n.setQuery(t.toLowerCase()+" "),n.refresh(),n.inputRef.current.focus()}},t))])}),[]))),n.getMissingResultsUrl&&yt.createElement("p",{className:"DocSearch-Help"},"".concat(u," "),yt.createElement("a",{href:n.getMissingResultsUrl({query:n.state.query}),target:"_blank",rel:"noopener noreferrer"},f)))}var xt=function(){return yt.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},yt.createElement("path",{d:"M17 6v12c0 .52-.2 1-1 1H4c-.7 0-1-.33-1-1V2c0-.55.42-1 1-1h8l5 5zM14 8h-3.13c-.51 0-.87-.34-.87-.87V4",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))};function Ct(e){switch(e.type){case"lvl1":return yt.createElement(xt,null);case"content":return yt.createElement(Nt,null);default:return yt.createElement(_t,null)}}function _t(){return yt.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},yt.createElement("path",{d:"M13 13h4-4V8H7v5h6v4-4H7V8H3h4V3v5h6V3v5h4-4v5zm-6 0v4-4H3h4z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}function Nt(){return yt.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},yt.createElement("path",{d:"M17 5H3h14zm0 5H3h14zm0 5H3h14z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function Tt(){return yt.createElement("svg",{className:"DocSearch-Hit-Select-Icon",width:"20",height:"20",viewBox:"0 0 20 20"},yt.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},yt.createElement("path",{d:"M18 3v4c0 2-2 4-4 4H2"}),yt.createElement("path",{d:"M8 17l-6-6 6-6"})))}var qt=["hit","attribute","tagName"];function Rt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Lt(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Ft(e,t){return t.split(".").reduce((function(e,t){return null!=e&&e[t]?e[t]:null}),e)}function Ut(e){var t=e.hit,r=e.attribute,n=e.tagName,o=void 0===n?"span":n,i=Ht(e,qt);return(0,yt.createElement)(o,Lt(Lt({},i),{},{dangerouslySetInnerHTML:{__html:Ft(t,"_snippetResult.".concat(r,".value"))||Ft(t,r)}}))}function Bt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,c=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(l){c=!0,o=l}finally{try{a||null==r.return||r.return()}finally{if(c)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Vt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r|<\/mark>)/g,Wt=RegExp(zt.source);function Qt(e){var t,r,n=e;if(!n.__docsearch_parent&&!e._highlightResult)return e.hierarchy.lvl0;var o=((n.__docsearch_parent?null===(t=n.__docsearch_parent)||void 0===t||null===(t=t._highlightResult)||void 0===t||null===(t=t.hierarchy)||void 0===t?void 0:t.lvl0:null===(r=e._highlightResult)||void 0===r||null===(r=r.hierarchy)||void 0===r?void 0:r.lvl0)||{}).value;return o&&Wt.test(o)?o.replace(zt,""):o}function Zt(){return Zt=Object.assign||function(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function or(e){var t=e.translations,r=void 0===t?{}:t,n=nr(e,tr),o=r.recentSearchesTitle,i=void 0===o?"Recent":o,a=r.noRecentSearchesText,c=void 0===a?"No recent searches":a,l=r.saveRecentSearchButtonTitle,u=void 0===l?"Save this search":l,s=r.removeRecentSearchButtonTitle,f=void 0===s?"Remove this search from history":s,m=r.favoriteSearchesTitle,p=void 0===m?"Favorite":m,v=r.removeFavoriteSearchButtonTitle,d=void 0===v?"Remove this search from favorites":v;return"idle"===n.state.status&&!1===n.hasCollections?n.disableUserPersonalization?null:yt.createElement("div",{className:"DocSearch-StartScreen"},yt.createElement("p",{className:"DocSearch-Help"},c)):!1===n.hasCollections?null:yt.createElement("div",{className:"DocSearch-Dropdown-Container"},yt.createElement($t,rr({},n,{title:i,collection:n.state.collections[0],renderIcon:function(){return yt.createElement("div",{className:"DocSearch-Hit-icon"},yt.createElement(Xt,null))},renderAction:function(e){var t=e.item,r=e.runFavoriteTransition,o=e.runDeleteTransition;return yt.createElement(yt.Fragment,null,yt.createElement("div",{className:"DocSearch-Hit-action"},yt.createElement("button",{className:"DocSearch-Hit-action-button",title:u,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),r((function(){n.favoriteSearches.add(t),n.recentSearches.remove(t),n.refresh()}))}},yt.createElement(Yt,null))),yt.createElement("div",{className:"DocSearch-Hit-action"},yt.createElement("button",{className:"DocSearch-Hit-action-button",title:f,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),o((function(){n.recentSearches.remove(t),n.refresh()}))}},yt.createElement(er,null))))}})),yt.createElement($t,rr({},n,{title:p,collection:n.state.collections[1],renderIcon:function(){return yt.createElement("div",{className:"DocSearch-Hit-icon"},yt.createElement(Yt,null))},renderAction:function(e){var t=e.item,r=e.runDeleteTransition;return yt.createElement("div",{className:"DocSearch-Hit-action"},yt.createElement("button",{className:"DocSearch-Hit-action-button",title:d,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),r((function(){n.favoriteSearches.remove(t),n.refresh()}))}},yt.createElement(er,null)))}})))}var ir=["translations"];function ar(){return ar=Object.assign||function(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var lr=yt.memo((function(e){var t=e.translations,r=void 0===t?{}:t,n=cr(e,ir);if("error"===n.state.status)return yt.createElement(wt,{translations:null==r?void 0:r.errorScreen});var o=n.state.collections.some((function(e){return e.items.length>0}));return n.state.query?!1===o?yt.createElement(kt,ar({},n,{translations:null==r?void 0:r.noResultsScreen})):yt.createElement(Gt,n):yt.createElement(or,ar({},n,{hasCollections:o,translations:null==r?void 0:r.startScreen}))}),(function(e,t){return"loading"===t.state.status||"stalled"===t.state.status}));function ur(){return yt.createElement("svg",{viewBox:"0 0 38 38",stroke:"currentColor",strokeOpacity:".5"},yt.createElement("g",{fill:"none",fillRule:"evenodd"},yt.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},yt.createElement("circle",{strokeOpacity:".3",cx:"18",cy:"18",r:"18"}),yt.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18"},yt.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})))))}var sr=r(830),fr=["translations"];function mr(){return mr=Object.assign||function(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function vr(e){var t=e.translations,r=void 0===t?{}:t,n=pr(e,fr),o=r.resetButtonTitle,i=void 0===o?"Clear the query":o,a=r.resetButtonAriaLabel,c=void 0===a?"Clear the query":a,l=r.cancelButtonText,u=void 0===l?"Cancel":l,s=r.cancelButtonAriaLabel,f=void 0===s?"Cancel":s,m=n.getFormProps({inputElement:n.inputRef.current}).onReset;return yt.useEffect((function(){n.autoFocus&&n.inputRef.current&&n.inputRef.current.focus()}),[n.autoFocus,n.inputRef]),yt.useEffect((function(){n.isFromSelection&&n.inputRef.current&&n.inputRef.current.select()}),[n.isFromSelection,n.inputRef]),yt.createElement(yt.Fragment,null,yt.createElement("form",{className:"DocSearch-Form",onSubmit:function(e){e.preventDefault()},onReset:m},yt.createElement("label",mr({className:"DocSearch-MagnifierLabel"},n.getLabelProps()),yt.createElement(sr.W,null)),yt.createElement("div",{className:"DocSearch-LoadingIndicator"},yt.createElement(ur,null)),yt.createElement("input",mr({className:"DocSearch-Input",ref:n.inputRef},n.getInputProps({inputElement:n.inputRef.current,autoFocus:n.autoFocus,maxLength:ht}))),yt.createElement("button",{type:"reset",title:i,className:"DocSearch-Reset","aria-label":c,hidden:!n.state.query},yt.createElement(er,null))),yt.createElement("button",{className:"DocSearch-Cancel",type:"reset","aria-label":f,onClick:n.onClose},u))}var dr=["_highlightResult","_snippetResult"];function yr(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function hr(e){return!1===function(){var e="__TEST_KEY__";try{return localStorage.setItem(e,""),localStorage.removeItem(e),!0}catch(t){return!1}}()?{setItem:function(){},getItem:function(){return[]}}:{setItem:function(t){return window.localStorage.setItem(e,JSON.stringify(t))},getItem:function(){var t=window.localStorage.getItem(e);return t?JSON.parse(t):[]}}}function br(e){var t=e.key,r=e.limit,n=void 0===r?5:r,o=hr(t),i=o.getItem().slice(0,n);return{add:function(e){var t=e,r=(t._highlightResult,t._snippetResult,yr(t,dr)),a=i.findIndex((function(e){return e.objectID===r.objectID}));a>-1&&i.splice(a,1),i.unshift(r),i=i.slice(0,n),o.setItem(i)},remove:function(e){i=i.filter((function(t){return t.objectID!==e.objectID})),o.setItem(i)},getAll:function(){return i}}}function gr(e){const t=`algoliasearch-client-js-${e.key}`;let r;const n=()=>(void 0===r&&(r=e.localStorage||window.localStorage),r),o=()=>JSON.parse(n().getItem(t)||"{}"),i=e=>{n().setItem(t,JSON.stringify(e))};return{get:(t,r,n={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{(()=>{const t=e.timeToLive?1e3*e.timeToLive:null,r=o(),n=Object.fromEntries(Object.entries(r).filter((([,e])=>void 0!==e.timestamp)));if(i(n),!t)return;const a=Object.fromEntries(Object.entries(n).filter((([,e])=>{const r=(new Date).getTime();return!(e.timestamp+tPromise.all([e?e.value:r(),void 0!==e]))).then((([e,t])=>Promise.all([e,t||n.miss(e)]))).then((([e])=>e)),set:(e,r)=>Promise.resolve().then((()=>{const i=o();return i[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:r},n().setItem(t,JSON.stringify(i)),r})),delete:e=>Promise.resolve().then((()=>{const r=o();delete r[JSON.stringify(e)],n().setItem(t,JSON.stringify(r))})),clear:()=>Promise.resolve().then((()=>{n().removeItem(t)}))}}function Or(e){const t=[...e.caches],r=t.shift();return void 0===r?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,n,o={miss:()=>Promise.resolve()})=>r.get(e,n,o).catch((()=>Or({caches:t}).get(e,n,o))),set:(e,n)=>r.set(e,n).catch((()=>Or({caches:t}).set(e,n))),delete:e=>r.delete(e).catch((()=>Or({caches:t}).delete(e))),clear:()=>r.clear().catch((()=>Or({caches:t}).clear()))}}function Sr(e={serializable:!0}){let t={};return{get(r,n,o={miss:()=>Promise.resolve()}){const i=JSON.stringify(r);if(i in t)return Promise.resolve(e.serializable?JSON.parse(t[i]):t[i]);const a=n(),c=o&&o.miss||(()=>Promise.resolve());return a.then((e=>c(e))).then((()=>a))},set:(r,n)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}function jr(e){let t=e.length-1;for(;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function wr(e,t){return t?(Object.keys(t).forEach((r=>{e[r]=t[r](e)})),e):e}function Er(e,...t){let r=0;return e.replace(/%s/g,(()=>encodeURIComponent(t[r++])))}const Pr="4.20.0",Ir={WithinQueryParameters:0,WithinHeaders:1};function Dr(e,t){const r=e||{},n=r.data||{};return Object.keys(r).forEach((e=>{-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(n[e]=r[e])})),{data:Object.entries(n).length>0?n:void 0,timeout:r.timeout||t,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}const Ar={Read:1,Write:2,Any:3},kr={Up:1,Down:2,Timeouted:3},xr=12e4;function Cr(e,t=kr.Up){return{...e,status:t,lastUpdate:Date.now()}}function _r(e){return"string"==typeof e?{protocol:"https",url:e,accept:Ar.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||Ar.Any}}const Nr={Delete:"DELETE",Get:"GET",Post:"POST",Put:"PUT"};function Tr(e,t){return Promise.all(t.map((t=>e.get(t,(()=>Promise.resolve(Cr(t))))))).then((e=>{const r=e.filter((e=>function(e){return e.status===kr.Up||Date.now()-e.lastUpdate>xr}(e))),n=e.filter((e=>function(e){return e.status===kr.Timeouted&&Date.now()-e.lastUpdate<=xr}(e))),o=[...r,...n];return{getTimeout:(e,t)=>(0===n.length&&0===e?1:n.length+3+e)*t,statelessHosts:o.length>0?o.map((e=>_r(e))):t}}))}const qr=(e,t)=>(e=>{const t=e.status;return e.isTimedOut||(({isTimedOut:e,status:t})=>!e&&0==~~t)(e)||2!=~~(t/100)&&4!=~~(t/100)})(e)?t.onRetry(e):(({status:e})=>2==~~(e/100))(e)?t.onSuccess(e):t.onFail(e);function Rr(e,t,r,n){const o=[],i=function(e,t){if(e.method===Nr.Get||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(r,n),a=function(e,t){const r={...e.headers,...t.headers},n={};return Object.keys(r).forEach((e=>{const t=r[e];n[e.toLowerCase()]=t})),n}(e,n),c=r.method,l=r.method!==Nr.Get?{}:{...r.data,...n.data},u={"x-algolia-agent":e.userAgent.value,...e.queryParameters,...l,...n.queryParameters};let s=0;const f=(t,l)=>{const m=t.pop();if(void 0===m)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:Fr(o)};const p={data:i,headers:a,method:c,url:Mr(m,r.path,u),connectTimeout:l(s,e.timeouts.connect),responseTimeout:l(s,n.timeout)},v=e=>{const r={request:p,response:e,host:m,triesLeft:t.length};return o.push(r),r},d={onSuccess:e=>function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e),onRetry(r){const n=v(r);return r.isTimedOut&&s++,Promise.all([e.logger.info("Retryable failure",Ur(n)),e.hostsCache.set(m,Cr(m,r.isTimedOut?kr.Timeouted:kr.Down))]).then((()=>f(t,l)))},onFail(e){throw v(e),function({content:e,status:t},r){let n=e;try{n=JSON.parse(e).message}catch(o){}return function(e,t,r){return{name:"ApiError",message:e,status:t,transporterStackTrace:r}}(n,t,r)}(e,Fr(o))}};return e.requester.send(p).then((e=>qr(e,d)))};return Tr(e.hostsCache,t).then((e=>f([...e.statelessHosts].reverse(),e.getTimeout)))}function Lr(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}function Mr(e,t,r){const n=Hr(r);let o=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return n.length&&(o+=`?${n}`),o}function Hr(e){return Object.keys(e).map((t=>{return Er("%s=%s",t,(r=e[t],"[object Object]"===Object.prototype.toString.call(r)||"[object Array]"===Object.prototype.toString.call(r)?JSON.stringify(e[t]):e[t]));var r})).join("&")}function Fr(e){return e.map((e=>Ur(e)))}function Ur(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}const Br=e=>{const t=e.appId,r=function(e,t,r){const n={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers:()=>e===Ir.WithinHeaders?n:{},queryParameters:()=>e===Ir.WithinQueryParameters?n:{}}}(void 0!==e.authMode?e.authMode:Ir.WithinHeaders,t,e.apiKey),n=function(e){const{hostsCache:t,logger:r,requester:n,requestsCache:o,responsesCache:i,timeouts:a,userAgent:c,hosts:l,queryParameters:u,headers:s}=e,f={hostsCache:t,logger:r,requester:n,requestsCache:o,responsesCache:i,timeouts:a,userAgent:c,headers:s,queryParameters:u,hosts:l.map((e=>_r(e))),read(e,t){const r=Dr(t,f.timeouts.read),n=()=>Rr(f,f.hosts.filter((e=>0!=(e.accept&Ar.Read))),e,r);if(!0!==(void 0!==r.cacheable?r.cacheable:e.cacheable))return n();const o={request:e,mappedRequestOptions:r,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(o,(()=>f.requestsCache.get(o,(()=>f.requestsCache.set(o,n()).then((e=>Promise.all([f.requestsCache.delete(o),e])),(e=>Promise.all([f.requestsCache.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>f.responsesCache.set(o,e)})},write:(e,t)=>Rr(f,f.hosts.filter((e=>0!=(e.accept&Ar.Write))),e,Dr(t,f.timeouts.write))};return f}({hosts:[{url:`${t}-dsn.algolia.net`,accept:Ar.Read},{url:`${t}.algolia.net`,accept:Ar.Write}].concat(jr([{url:`${t}-1.algolianet.com`},{url:`${t}-2.algolianet.com`},{url:`${t}-3.algolianet.com`}])),...e,headers:{...r.headers(),"content-type":"application/x-www-form-urlencoded",...e.headers},queryParameters:{...r.queryParameters(),...e.queryParameters}}),o={transporter:n,appId:t,addAlgoliaAgent(e,t){n.userAgent.add({segment:e,version:t})},clearCache:()=>Promise.all([n.requestsCache.clear(),n.responsesCache.clear()]).then((()=>{}))};return wr(o,e.methods)},Vr=e=>(t,r)=>t.method===Nr.Get?e.transporter.read(t,r):e.transporter.write(t,r),Kr=e=>(t,r={})=>wr({transporter:e.transporter,appId:e.appId,indexName:t},r.methods),$r=e=>(t,r)=>{const n=t.map((e=>({...e,params:Hr(e.params||{})})));return e.transporter.read({method:Nr.Post,path:"1/indexes/*/queries",data:{requests:n},cacheable:!0},r)},Jr=e=>(t,r)=>Promise.all(t.map((t=>{const{facetName:n,facetQuery:o,...i}=t.params;return Kr(e)(t.indexName,{methods:{searchForFacetValues:Qr}}).searchForFacetValues(n,o,{...r,...i})}))),zr=e=>(t,r,n)=>e.transporter.read({method:Nr.Post,path:Er("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:r},cacheable:!0},n),Wr=e=>(t,r)=>e.transporter.read({method:Nr.Post,path:Er("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},r),Qr=e=>(t,r,n)=>e.transporter.read({method:Nr.Post,path:Er("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:r},cacheable:!0},n),Zr={Debug:1,Info:2,Error:3};function Gr(e,t,r){const n={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:e=>new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const n=(e,n)=>setTimeout((()=>{r.abort(),t({status:0,content:n,isTimedOut:!0})}),1e3*e),o=n(e.connectTimeout,"Connection timeout");let i;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===i&&(clearTimeout(o),i=n(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(o),clearTimeout(i),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(o),clearTimeout(i),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))},logger:(o=Zr.Error,{debug:(e,t)=>(Zr.Debug>=o&&console.debug(e,t),Promise.resolve()),info:(e,t)=>(Zr.Info>=o&&console.info(e,t),Promise.resolve()),error:(e,t)=>(console.error(e,t),Promise.resolve())}),responsesCache:Sr(),requestsCache:Sr({serializable:!1}),hostsCache:Or({caches:[gr({key:`${Pr}-${e}`}),Sr()]}),userAgent:Lr(Pr).add({segment:"Browser",version:"lite"}),authMode:Ir.WithinQueryParameters};var o;return Br({...n,...r,methods:{search:$r,searchForFacetValues:Jr,multipleQueries:$r,multipleSearchForFacetValues:Jr,customRequest:Vr,initIndex:e=>t=>Kr(e)(t,{methods:{search:Wr,searchForFacetValues:Qr,findAnswers:zr}})}})}Gr.version=Pr;const Xr=Gr;var Yr="3.5.2";function en(){}function tn(e){return e}function rn(e){return 1===e.button||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}function nn(e,t,r){return e.reduce((function(e,n){var o=t(n);return e.hasOwnProperty(o)||(e[o]=[]),e[o].length<(r||5)&&e[o].push(n),e}),{})}var on=["footer","searchBox"];function an(){return an=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function pn(e){var t=e.appId,r=e.apiKey,n=e.indexName,o=e.placeholder,i=void 0===o?"Search docs":o,a=e.searchParameters,c=e.maxResultsPerGroup,l=e.onClose,u=void 0===l?en:l,s=e.transformItems,f=void 0===s?tn:s,m=e.hitComponent,p=void 0===m?St:m,v=e.resultsFooterComponent,d=void 0===v?function(){return null}:v,y=e.navigator,h=e.initialScrollY,b=void 0===h?0:h,g=e.transformSearchClient,O=void 0===g?tn:g,S=e.disableUserPersonalization,j=void 0!==S&&S,w=e.initialQuery,E=void 0===w?"":w,P=e.translations,I=void 0===P?{}:P,D=e.getMissingResultsUrl,A=e.insights,k=void 0!==A&&A,x=I.footer,C=I.searchBox,_=mn(I,on),N=sn(yt.useState({query:"",collections:[],completion:null,context:{},isOpen:!1,activeItemId:null,status:"idle"}),2),T=N[0],q=N[1],R=yt.useRef(null),L=yt.useRef(null),M=yt.useRef(null),H=yt.useRef(null),F=yt.useRef(null),U=yt.useRef(10),B=yt.useRef("undefined"!=typeof window?window.getSelection().toString().slice(0,ht):"").current,V=yt.useRef(E||B).current,K=function(e,t,r){return yt.useMemo((function(){var n=Xr(e,t);return n.addAlgoliaAgent("docsearch",Yr),!1===/docsearch.js \(.*\)/.test(n.transporter.userAgent.value)&&n.addAlgoliaAgent("docsearch-react",Yr),r(n)}),[e,t,r])}(t,r,O),$=yt.useRef(br({key:"__DOCSEARCH_FAVORITE_SEARCHES__".concat(n),limit:10})).current,J=yt.useRef(br({key:"__DOCSEARCH_RECENT_SEARCHES__".concat(n),limit:0===$.getAll().length?7:4})).current,z=yt.useCallback((function(e){if(!j){var t="content"===e.type?e.__docsearch_parent:e;t&&-1===$.getAll().findIndex((function(e){return e.objectID===t.objectID}))&&J.add(t)}}),[$,J,j]),W=yt.useCallback((function(e){if(T.context.algoliaInsightsPlugin&&e.__autocomplete_id){var t=e,r={eventName:"Item Selected",index:t.__autocomplete_indexName,items:[t],positions:[e.__autocomplete_id],queryID:t.__autocomplete_queryID};T.context.algoliaInsightsPlugin.insights.clickedObjectIDsAfterSearch(r)}}),[T.context.algoliaInsightsPlugin]),Q=yt.useMemo((function(){return dt({id:"docsearch",defaultActiveItemId:0,placeholder:i,openOnFocus:!0,initialState:{query:V,context:{searchSuggestions:[]}},insights:k,navigator:y,onStateChange:function(e){q(e.state)},getSources:function(e){var o=e.query,i=e.state,l=e.setContext,s=e.setStatus;if(!o)return j?[]:[{sourceId:"recentSearches",onSelect:function(e){var t=e.item,r=e.event;z(t),rn(r)||u()},getItemUrl:function(e){return e.item.url},getItems:function(){return J.getAll()}},{sourceId:"favoriteSearches",onSelect:function(e){var t=e.item,r=e.event;z(t),rn(r)||u()},getItemUrl:function(e){return e.item.url},getItems:function(){return $.getAll()}}];var m=Boolean(k);return K.search([{query:o,indexName:n,params:ln({attributesToRetrieve:["hierarchy.lvl0","hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content","type","url"],attributesToSnippet:["hierarchy.lvl1:".concat(U.current),"hierarchy.lvl2:".concat(U.current),"hierarchy.lvl3:".concat(U.current),"hierarchy.lvl4:".concat(U.current),"hierarchy.lvl5:".concat(U.current),"hierarchy.lvl6:".concat(U.current),"content:".concat(U.current)],snippetEllipsisText:"\u2026",highlightPreTag:"",highlightPostTag:"",hitsPerPage:20,clickAnalytics:m},a)}]).catch((function(e){throw"RetryError"===e.name&&s("error"),e})).then((function(e){var o=e.results[0],a=o.hits,s=o.nbHits,p=nn(a,(function(e){return Qt(e)}),c);i.context.searchSuggestions.length0&&(X(),F.current&&F.current.focus())}),[V,X]),yt.useEffect((function(){function e(){if(L.current){var e=.01*window.innerHeight;L.current.style.setProperty("--docsearch-vh","".concat(e,"px"))}}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]),yt.createElement("div",an({ref:R},G({"aria-expanded":!0}),{className:["DocSearch","DocSearch-Container","stalled"===T.status&&"DocSearch-Container--Stalled","error"===T.status&&"DocSearch-Container--Errored"].filter(Boolean).join(" "),role:"button",tabIndex:0,onMouseDown:function(e){e.target===e.currentTarget&&u()}}),yt.createElement("div",{className:"DocSearch-Modal",ref:L},yt.createElement("header",{className:"DocSearch-SearchBar",ref:M},yt.createElement(vr,an({},Q,{state:T,autoFocus:0===V.length,inputRef:F,isFromSelection:Boolean(V)&&V===B,translations:C,onClose:u}))),yt.createElement("div",{className:"DocSearch-Dropdown",ref:H},yt.createElement(lr,an({},Q,{indexName:n,state:T,hitComponent:p,resultsFooterComponent:d,disableUserPersonalization:j,recentSearches:J,favoriteSearches:$,inputRef:F,translations:_,getMissingResultsUrl:D,onItemClick:function(e,t){W(e),z(e),rn(t)||u()}}))),yt.createElement("footer",{className:"DocSearch-Footer"},yt.createElement(Ot,{translations:x}))))}}}]); \ No newline at end of file diff --git a/assets/js/14f1d27f.df7b274f.js b/assets/js/14f1d27f.df7b274f.js new file mode 100644 index 0000000..80823be --- /dev/null +++ b/assets/js/14f1d27f.df7b274f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[931],{3905:(e,t,r)=>{r.d(t,{Zo:()=>c,kt:()=>h});var a=r(7294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function o(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var s=a.createContext({}),p=function(e){var t=a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},c=function(e){var t=p(e.components);return a.createElement(s.Provider,{value:t},e.children)},d="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},u=a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,i=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),d=p(r),u=n,h=d["".concat(s,".").concat(u)]||d[u]||m[u]||i;return r?a.createElement(h,o(o({ref:t},c),{},{components:r})):a.createElement(h,o({ref:t},c))}));function h(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var i=r.length,o=new Array(i);o[0]=u;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[d]="string"==typeof e?e:n,o[1]=l;for(var p=2;p{r.r(t),r.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>m,frontMatter:()=>i,metadata:()=>l,toc:()=>p});var a=r(7462),n=(r(7294),r(3905));const i={title:"Orchestrator",sidebar_position:1},o="Orchestrator",l={unversionedId:"reference/cli/orchestrator",id:"reference/cli/orchestrator",title:"Orchestrator",description:"The Orchestrator is the heart of Cogment. It ties all services together to execute trials.",source:"@site/docs/reference/cli/orchestrator.md",sourceDirName:"reference/cli",slug:"/reference/cli/orchestrator",permalink:"/docs/reference/cli/orchestrator",draft:!1,tags:[],version:"current",lastUpdatedAt:1691703005,formattedLastUpdatedAt:"Aug 10, 2023",sidebarPosition:1,frontMatter:{title:"Orchestrator",sidebar_position:1},sidebar:"docSidebar",previous:{title:"CLI",permalink:"/docs/reference/cli/"},next:{title:"Server",permalink:"/docs/reference/cli/directory/directory-server"}},s={},p=[{value:"Command line",id:"command-line",level:2},{value:"Configuration",id:"configuration",level:2},{value:"lifecycle_port",id:"lifecycle_port",level:3},{value:"actor_port",id:"actor_port",level:3},{value:"actor_web_port",id:"actor_web_port",level:3},{value:"params",id:"params",level:3},{value:"directory_endpoint",id:"directory_endpoint",level:3},{value:"directory_authentication_token",id:"directory_authentication_token",level:3},{value:"directory_auto_register",id:"directory_auto_register",level:3},{value:"directory_registration_host",id:"directory_registration_host",level:3},{value:"directory_registration_properties",id:"directory_registration_properties",level:3},{value:"pre_trial_hooks",id:"pre_trial_hooks",level:3},{value:"prometheus_port",id:"prometheus_port",level:3},{value:"status_file",id:"status_file",level:3},{value:"private_key",id:"private_key",level:3},{value:"root_cert",id:"root_cert",level:3},{value:"trust_chain",id:"trust_chain",level:3},{value:"gc_frequency",id:"gc_frequency",level:3},{value:"log_level",id:"log_level",level:3},{value:"log_file",id:"log_file",level:3}],c={toc:p},d="wrapper";function m(e){let{components:t,...r}=e;return(0,n.kt)(d,(0,a.Z)({},c,r,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("h1",{id:"orchestrator"},"Orchestrator"),(0,n.kt)("p",null,"The Orchestrator is the heart of Cogment. It ties all services together to execute trials."),(0,n.kt)("h2",{id:"command-line"},"Command line"),(0,n.kt)("p",null,"The Orchestrator is simply called this way"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"$ cogment services orchestrator --lifecycle_port=9001 --actor_port=9001 --pre_trial_hooks=grpc://config:9001\n")),(0,n.kt)("h2",{id:"configuration"},"Configuration"),(0,n.kt)("p",null,"The orchestrator configuration can be specified either through the command line or environment variables."),(0,n.kt)("h3",{id:"lifecycle_port"},(0,n.kt)("inlineCode",{parentName:"h3"},"lifecycle_port")),(0,n.kt)("p",null,"The TCP port where to serve the ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/grpc#service-triallifecyclesp"},"trial lifecycle gRPC service"),".\nThis is where the ",(0,n.kt)("a",{parentName:"p",href:"/docs/guide/development-guide#controller"},"Controller")," connects to.\nIt can be the same as the ",(0,n.kt)("inlineCode",{parentName:"p"},"actor_port"),"."),(0,n.kt)("p",null,"If set to 0, then the system will automatically choose a free port.\nThis is normally used in combination with a ",(0,n.kt)("a",{parentName:"p",href:"#directory_endpoint"},"Directory"),"."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--lifecycle_port=12000"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_LIFECYCLE_PORT=12000"),","),(0,n.kt)("li",{parentName:"ul"},"its default value is 9000.")),(0,n.kt)("h3",{id:"actor_port"},(0,n.kt)("inlineCode",{parentName:"h3"},"actor_port")),(0,n.kt)("p",null,"The TCP port where to serve the ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/grpc#service-clientactorsp"},"client actor gRPC service"),".\nThis is where ",(0,n.kt)("a",{parentName:"p",href:"/docs/guide/development-guide#service-actor-client-actor"},"Client Actors")," (as opposed to service actors) connect to.\nIt can be the same as the ",(0,n.kt)("inlineCode",{parentName:"p"},"lifecycle_port"),"."),(0,n.kt)("p",null,"If set to 0, then the system will automatically choose a free port.\nThis is normally used in combination with a ",(0,n.kt)("a",{parentName:"p",href:"#directory_endpoint"},"Directory"),"."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--actor_port=12000"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_ACTOR_PORT=12000"),","),(0,n.kt)("li",{parentName:"ul"},"its default value is 9000.")),(0,n.kt)("h3",{id:"actor_web_port"},(0,n.kt)("inlineCode",{parentName:"h3"},"actor_web_port")),(0,n.kt)("p",null,"The TCP port used to serve the ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/grpc#service-clientactorsp"},"client actor gRPC service")," for consumption over websocket. This is required for ",(0,n.kt)("a",{parentName:"p",href:"/docs/guide/development-guide#service-actor-client-actor"},"Client Actors")," running in a web browser."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--actor_web_port=8080"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_WEB_PROXY_PORT=12000"),","),(0,n.kt)("li",{parentName:"ul"},"its default value is 0, which means the http port is disabled.")),(0,n.kt)("h3",{id:"params"},(0,n.kt)("inlineCode",{parentName:"h3"},"params")),(0,n.kt)("p",null,"The name of the YAML file containing the ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/parameters"},"default parameters")," for new trials. Some of the parameters must match their corresponding values in the spec file (typically ",(0,n.kt)("inlineCode",{parentName:"p"},"cogment.yaml"),") and may therefore lock an Orchestrator instance to specific types of trials. If pre-trial hooks are defined, these parameters are sent to the first hook before a trial starts. These parameters are ignored if the parameters are provided on trial start (see ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/grpc#trialstartrequest"},"TrialStartRequest"),")."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--params=./path/to/params.yaml"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_DEFAULT_PARAMS_FILE=./path/to/params.yaml"),","),(0,n.kt)("li",{parentName:"ul"},"it has no default value.")),(0,n.kt)("h3",{id:"directory_endpoint"},(0,n.kt)("inlineCode",{parentName:"h3"},"directory_endpoint")),(0,n.kt)("p",null,"Cogment endpoint of the directory service. It must be a ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/parameters#grpc-scheme"},"gRPC endpoint"),". The directory will be used to register the orchestrator services, and to discover services for new trials."),(0,n.kt)("p",null,"If not provided, the endpoints provided to the Orchestrator or in the parameters must ",(0,n.kt)("em",{parentName:"p"},"not")," be discovery endpoints (i.e. must not require a directory). And the Orchestrator will not auto register its services, in which case manual registration to the directory must be done, or an explicit address must be provided to access the Orchestrator."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--directory_endpoint=grpc://foo:9005"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005"),","),(0,n.kt)("li",{parentName:"ul"},"it has no default value.")),(0,n.kt)("h3",{id:"directory_authentication_token"},(0,n.kt)("inlineCode",{parentName:"h3"},"directory_authentication_token")),(0,n.kt)("p",null,"Authentication token for services registered in the Directory. It is recorded in the Directory when registering a service. And a matching token must be provided to inquire for the service. An empty token is the same as no token."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--directory_authentication_token=GH670ploT"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT"),","),(0,n.kt)("li",{parentName:"ul"},"it has no default value.")),(0,n.kt)("h3",{id:"directory_auto_register"},(0,n.kt)("inlineCode",{parentName:"h3"},"directory_auto_register")),(0,n.kt)("p",null,"If 0, then the Orchestrator will not register its services to the Directory; The services must be externally registered, or ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/parameters#grpc-scheme"},"gRPC endpoints")," used to reach the services. If 1, then the Orchestrator will register its services to the ",(0,n.kt)("a",{parentName:"p",href:"#directoryservices"},"directory service")," if possible. Other values are reserved."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--directory_auto_register=0"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_ORCHESTRATOR_DIRECTORY_AUTO_REGISTER=0"),","),(0,n.kt)("li",{parentName:"ul"},"its default value is 1.")),(0,n.kt)("h3",{id:"directory_registration_host"},(0,n.kt)("inlineCode",{parentName:"h3"},"directory_registration_host")),(0,n.kt)("p",null,"This is the host that will be registered to the Directory for the Orchestrator services. If not provided, the Orchestrator will determine its own IP address and use that as the registration host."),(0,n.kt)("p",null,"In some circumstances, the IP address determined by Cogment may be wrong (e.g. multiple interfaces, load balancing, firewall), thus a host (hostname or IP address) must be explicitly provided."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--directory_registration_host=foo.bar"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_ORCHESTRATOR_DIRECTORY_REGISTRATION_HOST=foo.bar"),","),(0,n.kt)("li",{parentName:"ul"},"it has no default value (i.e. self determined IP address is used).")),(0,n.kt)("h3",{id:"directory_registration_properties"},(0,n.kt)("inlineCode",{parentName:"h3"},"directory_registration_properties")),(0,n.kt)("p",null,'These are the properties that will be registered to the Directory for the Orchestrator services. When inquiring the Directory, the properties inquired must match the properties registered. This is a string representing multiple properties in the form "name=value,name=value,name=value" where the values are optional.'),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},'--directory_registration_properties="Sim=20,hpp,mem=HIGH"'),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},'COGMENT_ORCHESTRATOR_DIRECTORY_REGISTRATION_PROPERTIES="Sim=20,hpp,mem=HIGH"'),","),(0,n.kt)("li",{parentName:"ul"},"it has no default value.")),(0,n.kt)("h3",{id:"pre_trial_hooks"},(0,n.kt)("inlineCode",{parentName:"h3"},"pre_trial_hooks")),(0,n.kt)("p",null,(0,n.kt)("a",{parentName:"p",href:"/docs/reference/parameters#cogment-endpoints"},"Cogment endpoint")," definitions for ",(0,n.kt)("a",{parentName:"p",href:"/docs/guide/development-guide#pre-trial-hook"},"pre-trial hooks"),". Hooks may be called before a new trial starts; They are then called in order, in a pipeline fashion, to set the parameters for a new trial. The first hook will receive the default parameters, and the result of the last hook will be used as the parameters for the new trial."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option with different endpoints separated by commas, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--pre_trial_hooks=grpc://foo:9000,grpc://bar:9000"),", and/or with the option passed multiple times, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--pre_trial_hooks=grpc://foo:9000 --pre_trial_hooks=grpc://bar:9000"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable with different endpoints separated by spaces, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},'COGMENT_PRE_TRIAL_HOOKS="grpc://foo:9000 grpc://bar:9000"'),","),(0,n.kt)("li",{parentName:"ul"},"it has no default value.")),(0,n.kt)("h3",{id:"prometheus_port"},(0,n.kt)("inlineCode",{parentName:"h3"},"prometheus_port")),(0,n.kt)("p",null,"The TCP port where to serve Prometheus metrics. Must be different than ",(0,n.kt)("inlineCode",{parentName:"p"},"lifecycle_port")," and ",(0,n.kt)("inlineCode",{parentName:"p"},"actor_port"),". If not specified, the Prometheus server is disabled."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--prometheus_port=8000"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_ORCHESTRATOR_PROMETHEUS_PORT=8000"),","),(0,n.kt)("li",{parentName:"ul"},"its default value is 0, which means the prometheus server is disabled.")),(0,n.kt)("h3",{id:"status_file"},(0,n.kt)("inlineCode",{parentName:"h3"},"status_file")),(0,n.kt)("p",null,'File containing simple status for the Orchestrator. This is useful when running the Orchestrator inside containers or synchronizing with external components. The file is open and stays open while the Orchestrator runs. The file will contain one to three letters: I, R, T. "I" indicates that the Orchestrator is initializing. When the Orchestrator starts, the file only contains this letter. "R" indicates that the Orchestrator is ready. This letter is added to the file (thus the file will normally contain "IR" at this point). "T" indicates that the Orchestrator has terminated (crashes will not set this file to "T"). Thus after a normal end, the file will contain "IRT".'),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--status_file=./path/to/status"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_STATUS_FILE=./path/to/status"),","),(0,n.kt)("li",{parentName:"ul"},"it has no default value.")),(0,n.kt)("h3",{id:"private_key"},(0,n.kt)("inlineCode",{parentName:"h3"},"private_key")),(0,n.kt)("p",null,"File name containg a PEM encoded private key for encrypted communication."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--private_key=./path/to/key.pem"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_PRIVATE_KEY_FILE=./path/to/key.pem"),","),(0,n.kt)("li",{parentName:"ul"},"it has no default value.")),(0,n.kt)("h3",{id:"root_cert"},(0,n.kt)("inlineCode",{parentName:"h3"},"root_cert")),(0,n.kt)("p",null,"File name containing a PEM encoded trusted root certificate."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--root_cert=./path/to/cert.pem"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_ROOT_CERT_FILE=./path/to/cert.pem"),","),(0,n.kt)("li",{parentName:"ul"},"it has no default value.")),(0,n.kt)("h3",{id:"trust_chain"},(0,n.kt)("inlineCode",{parentName:"h3"},"trust_chain")),(0,n.kt)("p",null,"File name containing a PEM encoded trust chain."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--trust_chain=./path/to/chain.pem"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_TRUST_CHAIN_FILE=./path/to/chain.pem"),","),(0,n.kt)("li",{parentName:"ul"},"it has no default value.")),(0,n.kt)("h3",{id:"gc_frequency"},(0,n.kt)("inlineCode",{parentName:"h3"},"gc_frequency")),(0,n.kt)("p",null,"Number of (started) trials between trial garbage collection. The Orchestrator periodically deletes ended and stale trials; this parameter controls how often this cleanup happens. The garbage collection may happen on the start of any trial."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--gc_frequency=5"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_GC_FREQUENCY=5"),","),(0,n.kt)("li",{parentName:"ul"},"default value is 10.")),(0,n.kt)("h3",{id:"log_level"},(0,n.kt)("inlineCode",{parentName:"h3"},"log_level")),(0,n.kt)("p",null,"Set to define the minimum level for logging. Possible values are: ",(0,n.kt)("inlineCode",{parentName:"p"},"off"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"error"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"warning"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"info"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"debug"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"trace"),". Note however that all trace and most debug level logs will only output if running the debug compiled version of the Orchestrator."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--log_level=debug"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_LOG_LEVEL=debug"),","),(0,n.kt)("li",{parentName:"ul"},"default value is info.")),(0,n.kt)("h3",{id:"log_file"},(0,n.kt)("inlineCode",{parentName:"h3"},"log_file")),(0,n.kt)("p",null,"Base file name for daily log output. The name will be suffixed with the date and a new file will be made every day. If not provided the logs go to stdout."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--log_file=./path/to/cogment.log"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_LOG_FILE=./path/to/cogment.log"),","),(0,n.kt)("li",{parentName:"ul"},"default value is info.")))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/14f1d27f.e67f3f33.js b/assets/js/14f1d27f.e67f3f33.js deleted file mode 100644 index 63972ab..0000000 --- a/assets/js/14f1d27f.e67f3f33.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[931],{3905:(e,t,r)=>{r.d(t,{Zo:()=>c,kt:()=>u});var a=r(7294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function o(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var s=a.createContext({}),p=function(e){var t=a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},c=function(e){var t=p(e.components);return a.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,i=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),m=p(r),u=n,h=m["".concat(s,".").concat(u)]||m[u]||d[u]||i;return r?a.createElement(h,o(o({ref:t},c),{},{components:r})):a.createElement(h,o({ref:t},c))}));function u(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var i=r.length,o=new Array(i);o[0]=m;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l.mdxType="string"==typeof e?e:n,o[1]=l;for(var p=2;p{r.r(t),r.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>d,frontMatter:()=>i,metadata:()=>l,toc:()=>p});var a=r(7462),n=(r(7294),r(3905));const i={title:"Orchestrator",sidebar_position:1},o="Orchestrator",l={unversionedId:"reference/cli/orchestrator",id:"reference/cli/orchestrator",title:"Orchestrator",description:"The Orchestrator is the heart of Cogment. It ties all services together to execute trials.",source:"@site/docs/reference/cli/orchestrator.md",sourceDirName:"reference/cli",slug:"/reference/cli/orchestrator",permalink:"/docs/reference/cli/orchestrator",draft:!1,tags:[],version:"current",lastUpdatedAt:1691703005,formattedLastUpdatedAt:"Aug 10, 2023",sidebarPosition:1,frontMatter:{title:"Orchestrator",sidebar_position:1},sidebar:"docSidebar",previous:{title:"CLI",permalink:"/docs/reference/cli/"},next:{title:"Server",permalink:"/docs/reference/cli/directory/directory-server"}},s={},p=[{value:"Command line",id:"command-line",level:2},{value:"Configuration",id:"configuration",level:2},{value:"lifecycle_port",id:"lifecycle_port",level:3},{value:"actor_port",id:"actor_port",level:3},{value:"actor_web_port",id:"actor_web_port",level:3},{value:"params",id:"params",level:3},{value:"directory_endpoint",id:"directory_endpoint",level:3},{value:"directory_authentication_token",id:"directory_authentication_token",level:3},{value:"directory_auto_register",id:"directory_auto_register",level:3},{value:"directory_registration_host",id:"directory_registration_host",level:3},{value:"directory_registration_properties",id:"directory_registration_properties",level:3},{value:"pre_trial_hooks",id:"pre_trial_hooks",level:3},{value:"prometheus_port",id:"prometheus_port",level:3},{value:"status_file",id:"status_file",level:3},{value:"private_key",id:"private_key",level:3},{value:"root_cert",id:"root_cert",level:3},{value:"trust_chain",id:"trust_chain",level:3},{value:"gc_frequency",id:"gc_frequency",level:3},{value:"log_level",id:"log_level",level:3},{value:"log_file",id:"log_file",level:3}],c={toc:p};function d(e){let{components:t,...r}=e;return(0,n.kt)("wrapper",(0,a.Z)({},c,r,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("h1",{id:"orchestrator"},"Orchestrator"),(0,n.kt)("p",null,"The Orchestrator is the heart of Cogment. It ties all services together to execute trials."),(0,n.kt)("h2",{id:"command-line"},"Command line"),(0,n.kt)("p",null,"The Orchestrator is simply called this way"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"$ cogment services orchestrator --lifecycle_port=9001 --actor_port=9001 --pre_trial_hooks=grpc://config:9001\n")),(0,n.kt)("h2",{id:"configuration"},"Configuration"),(0,n.kt)("p",null,"The orchestrator configuration can be specified either through the command line or environment variables."),(0,n.kt)("h3",{id:"lifecycle_port"},(0,n.kt)("inlineCode",{parentName:"h3"},"lifecycle_port")),(0,n.kt)("p",null,"The TCP port where to serve the ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/grpc#service-triallifecyclesp"},"trial lifecycle gRPC service"),".\nThis is where the ",(0,n.kt)("a",{parentName:"p",href:"/docs/guide/development-guide#controller"},"Controller")," connects to.\nIt can be the same as the ",(0,n.kt)("inlineCode",{parentName:"p"},"actor_port"),"."),(0,n.kt)("p",null,"If set to 0, then the system will automatically choose a free port.\nThis is normally used in combination with a ",(0,n.kt)("a",{parentName:"p",href:"#directory_endpoint"},"Directory"),"."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--lifecycle_port=12000"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_LIFECYCLE_PORT=12000"),","),(0,n.kt)("li",{parentName:"ul"},"its default value is 9000.")),(0,n.kt)("h3",{id:"actor_port"},(0,n.kt)("inlineCode",{parentName:"h3"},"actor_port")),(0,n.kt)("p",null,"The TCP port where to serve the ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/grpc#service-clientactorsp"},"client actor gRPC service"),".\nThis is where ",(0,n.kt)("a",{parentName:"p",href:"/docs/guide/development-guide#service-actor-client-actor"},"Client Actors")," (as opposed to service actors) connect to.\nIt can be the same as the ",(0,n.kt)("inlineCode",{parentName:"p"},"lifecycle_port"),"."),(0,n.kt)("p",null,"If set to 0, then the system will automatically choose a free port.\nThis is normally used in combination with a ",(0,n.kt)("a",{parentName:"p",href:"#directory_endpoint"},"Directory"),"."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--actor_port=12000"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_ACTOR_PORT=12000"),","),(0,n.kt)("li",{parentName:"ul"},"its default value is 9000.")),(0,n.kt)("h3",{id:"actor_web_port"},(0,n.kt)("inlineCode",{parentName:"h3"},"actor_web_port")),(0,n.kt)("p",null,"The TCP port used to serve the ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/grpc#service-clientactorsp"},"client actor gRPC service")," for consumption over websocket. This is required for ",(0,n.kt)("a",{parentName:"p",href:"/docs/guide/development-guide#service-actor-client-actor"},"Client Actors")," running in a web browser."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--actor_web_port=8080"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_WEB_PROXY_PORT=12000"),","),(0,n.kt)("li",{parentName:"ul"},"its default value is 0, which means the http port is disabled.")),(0,n.kt)("h3",{id:"params"},(0,n.kt)("inlineCode",{parentName:"h3"},"params")),(0,n.kt)("p",null,"The name of the YAML file containing the ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/parameters"},"default parameters")," for new trials. Some of the parameters must match their corresponding values in the spec file (typically ",(0,n.kt)("inlineCode",{parentName:"p"},"cogment.yaml"),") and may therefore lock an Orchestrator instance to specific types of trials. If pre-trial hooks are defined, these parameters are sent to the first hook before a trial starts. These parameters are ignored if the parameters are provided on trial start (see ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/grpc#trialstartrequest"},"TrialStartRequest"),")."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--params=./path/to/params.yaml"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_DEFAULT_PARAMS_FILE=./path/to/params.yaml"),","),(0,n.kt)("li",{parentName:"ul"},"it has no default value.")),(0,n.kt)("h3",{id:"directory_endpoint"},(0,n.kt)("inlineCode",{parentName:"h3"},"directory_endpoint")),(0,n.kt)("p",null,"Cogment endpoint of the directory service. It must be a ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/parameters#grpc-scheme"},"gRPC endpoint"),". The directory will be used to register the orchestrator services, and to discover services for new trials."),(0,n.kt)("p",null,"If not provided, the endpoints provided to the Orchestrator or in the parameters must ",(0,n.kt)("em",{parentName:"p"},"not")," be discovery endpoints (i.e. must not require a directory). And the Orchestrator will not auto register its services, in which case manual registration to the directory must be done, or an explicit address must be provided to access the Orchestrator."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--directory_endpoint=grpc://foo:9005"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005"),","),(0,n.kt)("li",{parentName:"ul"},"it has no default value.")),(0,n.kt)("h3",{id:"directory_authentication_token"},(0,n.kt)("inlineCode",{parentName:"h3"},"directory_authentication_token")),(0,n.kt)("p",null,"Authentication token for services registered in the Directory. It is recorded in the Directory when registering a service. And a matching token must be provided to inquire for the service. An empty token is the same as no token."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--directory_authentication_token=GH670ploT"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT"),","),(0,n.kt)("li",{parentName:"ul"},"it has no default value.")),(0,n.kt)("h3",{id:"directory_auto_register"},(0,n.kt)("inlineCode",{parentName:"h3"},"directory_auto_register")),(0,n.kt)("p",null,"If 0, then the Orchestrator will not register its services to the Directory; The services must be externally registered, or ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/parameters#grpc-scheme"},"gRPC endpoints")," used to reach the services. If 1, then the Orchestrator will register its services to the ",(0,n.kt)("a",{parentName:"p",href:"#directoryservices"},"directory service")," if possible. Other values are reserved."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--directory_auto_register=0"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_ORCHESTRATOR_DIRECTORY_AUTO_REGISTER=0"),","),(0,n.kt)("li",{parentName:"ul"},"its default value is 1.")),(0,n.kt)("h3",{id:"directory_registration_host"},(0,n.kt)("inlineCode",{parentName:"h3"},"directory_registration_host")),(0,n.kt)("p",null,"This is the host that will be registered to the Directory for the Orchestrator services. If not provided, the Orchestrator will determine its own IP address and use that as the registration host."),(0,n.kt)("p",null,"In some circumstances, the IP address determined by Cogment may be wrong (e.g. multiple interfaces, load balancing, firewall), thus a host (hostname or IP address) must be explicitly provided."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--directory_registration_host=foo.bar"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_ORCHESTRATOR_DIRECTORY_REGISTRATION_HOST=foo.bar"),","),(0,n.kt)("li",{parentName:"ul"},"it has no default value (i.e. self determined IP address is used).")),(0,n.kt)("h3",{id:"directory_registration_properties"},(0,n.kt)("inlineCode",{parentName:"h3"},"directory_registration_properties")),(0,n.kt)("p",null,'These are the properties that will be registered to the Directory for the Orchestrator services. When inquiring the Directory, the properties inquired must match the properties registered. This is a string representing multiple properties in the form "name=value,name=value,name=value" where the values are optional.'),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},'--directory_registration_properties="Sim=20,hpp,mem=HIGH"'),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},'COGMENT_ORCHESTRATOR_DIRECTORY_REGISTRATION_PROPERTIES="Sim=20,hpp,mem=HIGH"'),","),(0,n.kt)("li",{parentName:"ul"},"it has no default value.")),(0,n.kt)("h3",{id:"pre_trial_hooks"},(0,n.kt)("inlineCode",{parentName:"h3"},"pre_trial_hooks")),(0,n.kt)("p",null,(0,n.kt)("a",{parentName:"p",href:"/docs/reference/parameters#cogment-endpoints"},"Cogment endpoint")," definitions for ",(0,n.kt)("a",{parentName:"p",href:"/docs/guide/development-guide#pre-trial-hook"},"pre-trial hooks"),". Hooks may be called before a new trial starts; They are then called in order, in a pipeline fashion, to set the parameters for a new trial. The first hook will receive the default parameters, and the result of the last hook will be used as the parameters for the new trial."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option with different endpoints separated by commas, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--pre_trial_hooks=grpc://foo:9000,grpc://bar:9000"),", and/or with the option passed multiple times, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--pre_trial_hooks=grpc://foo:9000 --pre_trial_hooks=grpc://bar:9000"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable with different endpoints separated by spaces, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},'COGMENT_PRE_TRIAL_HOOKS="grpc://foo:9000 grpc://bar:9000"'),","),(0,n.kt)("li",{parentName:"ul"},"it has no default value.")),(0,n.kt)("h3",{id:"prometheus_port"},(0,n.kt)("inlineCode",{parentName:"h3"},"prometheus_port")),(0,n.kt)("p",null,"The TCP port where to serve Prometheus metrics. Must be different than ",(0,n.kt)("inlineCode",{parentName:"p"},"lifecycle_port")," and ",(0,n.kt)("inlineCode",{parentName:"p"},"actor_port"),". If not specified, the Prometheus server is disabled."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--prometheus_port=8000"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_ORCHESTRATOR_PROMETHEUS_PORT=8000"),","),(0,n.kt)("li",{parentName:"ul"},"its default value is 0, which means the prometheus server is disabled.")),(0,n.kt)("h3",{id:"status_file"},(0,n.kt)("inlineCode",{parentName:"h3"},"status_file")),(0,n.kt)("p",null,'File containing simple status for the Orchestrator. This is useful when running the Orchestrator inside containers or synchronizing with external components. The file is open and stays open while the Orchestrator runs. The file will contain one to three letters: I, R, T. "I" indicates that the Orchestrator is initializing. When the Orchestrator starts, the file only contains this letter. "R" indicates that the Orchestrator is ready. This letter is added to the file (thus the file will normally contain "IR" at this point). "T" indicates that the Orchestrator has terminated (crashes will not set this file to "T"). Thus after a normal end, the file will contain "IRT".'),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--status_file=./path/to/status"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_STATUS_FILE=./path/to/status"),","),(0,n.kt)("li",{parentName:"ul"},"it has no default value.")),(0,n.kt)("h3",{id:"private_key"},(0,n.kt)("inlineCode",{parentName:"h3"},"private_key")),(0,n.kt)("p",null,"File name containg a PEM encoded private key for encrypted communication."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--private_key=./path/to/key.pem"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_PRIVATE_KEY_FILE=./path/to/key.pem"),","),(0,n.kt)("li",{parentName:"ul"},"it has no default value.")),(0,n.kt)("h3",{id:"root_cert"},(0,n.kt)("inlineCode",{parentName:"h3"},"root_cert")),(0,n.kt)("p",null,"File name containing a PEM encoded trusted root certificate."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--root_cert=./path/to/cert.pem"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_ROOT_CERT_FILE=./path/to/cert.pem"),","),(0,n.kt)("li",{parentName:"ul"},"it has no default value.")),(0,n.kt)("h3",{id:"trust_chain"},(0,n.kt)("inlineCode",{parentName:"h3"},"trust_chain")),(0,n.kt)("p",null,"File name containing a PEM encoded trust chain."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--trust_chain=./path/to/chain.pem"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_TRUST_CHAIN_FILE=./path/to/chain.pem"),","),(0,n.kt)("li",{parentName:"ul"},"it has no default value.")),(0,n.kt)("h3",{id:"gc_frequency"},(0,n.kt)("inlineCode",{parentName:"h3"},"gc_frequency")),(0,n.kt)("p",null,"Number of (started) trials between trial garbage collection. The Orchestrator periodically deletes ended and stale trials; this parameter controls how often this cleanup happens. The garbage collection may happen on the start of any trial."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--gc_frequency=5"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_GC_FREQUENCY=5"),","),(0,n.kt)("li",{parentName:"ul"},"default value is 10.")),(0,n.kt)("h3",{id:"log_level"},(0,n.kt)("inlineCode",{parentName:"h3"},"log_level")),(0,n.kt)("p",null,"Set to define the minimum level for logging. Possible values are: ",(0,n.kt)("inlineCode",{parentName:"p"},"off"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"error"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"warning"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"info"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"debug"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"trace"),". Note however that all trace and most debug level logs will only output if running the debug compiled version of the Orchestrator."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--log_level=debug"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_LOG_LEVEL=debug"),","),(0,n.kt)("li",{parentName:"ul"},"default value is info.")),(0,n.kt)("h3",{id:"log_file"},(0,n.kt)("inlineCode",{parentName:"h3"},"log_file")),(0,n.kt)("p",null,"Base file name for daily log output. The name will be suffixed with the date and a new file will be made every day. If not provided the logs go to stdout."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--log_file=./path/to/cogment.log"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_LOG_FILE=./path/to/cogment.log"),","),(0,n.kt)("li",{parentName:"ul"},"default value is info.")))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/1744.dbc8bcaa.js b/assets/js/1744.dbc8bcaa.js new file mode 100644 index 0000000..73094c3 --- /dev/null +++ b/assets/js/1744.dbc8bcaa.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[1744],{7814:(n,t,e)=>{e.d(t,{G:()=>h});var a=e(3636),r=e(5697),i=e.n(r),o=e(7294);function s(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),e.push.apply(e,a)}return e}function c(n){for(var t=1;t=0||(r[e]=n[e]);return r}(n,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(n,e)&&(r[e]=n[e])}return r}function m(n){return function(n){if(Array.isArray(n))return d(n)}(n)||function(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||function(n,t){if(!n)return;if("string"==typeof n)return d(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);"Object"===e&&n.constructor&&(e=n.constructor.name);if("Map"===e||"Set"===e)return Array.from(n);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return d(n,t)}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(n,t){(null==t||t>n.length)&&(t=n.length);for(var e=0,a=new Array(t);e0||!Array.isArray(t)&&t?l({},n,t):{}}var h=o.forwardRef((function(n,t){var e=n.icon,r=n.mask,i=n.symbol,o=n.className,s=n.title,f=n.titleId,u=n.maskId,d=g(e),p=y("classes",[].concat(m(function(n){var t,e=n.beat,a=n.fade,r=n.beatFade,i=n.bounce,o=n.shake,s=n.flash,c=n.spin,f=n.spinPulse,u=n.spinReverse,m=n.pulse,d=n.fixedWidth,p=n.inverse,b=n.border,v=n.listItem,g=n.flip,y=n.size,h=n.rotation,w=n.pull,k=(l(t={"fa-beat":e,"fa-fade":a,"fa-beat-fade":r,"fa-bounce":i,"fa-shake":o,"fa-flash":s,"fa-spin":c,"fa-spin-reverse":u,"fa-spin-pulse":f,"fa-pulse":m,"fa-fw":d,"fa-inverse":p,"fa-border":b,"fa-li":v,"fa-flip":!0===g,"fa-flip-horizontal":"horizontal"===g||"both"===g,"fa-flip-vertical":"vertical"===g||"both"===g},"fa-".concat(y),null!=y),l(t,"fa-rotate-".concat(h),null!=h&&0!==h),l(t,"fa-pull-".concat(w),null!=w),l(t,"fa-swap-opacity",n.swapOpacity),t);return Object.keys(k).map((function(n){return k[n]?n:null})).filter((function(n){return n}))}(n)),m(o.split(" ")))),b=y("transform","string"==typeof n.transform?a.Qc.transform(n.transform):n.transform),k=y("mask",g(r)),x=(0,a.qv)(d,c(c(c(c({},p),b),k),{},{symbol:i,title:s,titleId:f,maskId:u}));if(!x)return function(){var n;!v&&console&&"function"==typeof console.error&&(n=console).error.apply(n,arguments)}("Could not find icon",d),null;var O=x.abstract,A={ref:t};return Object.keys(n).forEach((function(t){h.defaultProps.hasOwnProperty(t)||(A[t]=n[t])})),w(O[0],A)}));h.displayName="FontAwesomeIcon",h.propTypes={beat:i().bool,border:i().bool,beatFade:i().bool,bounce:i().bool,className:i().string,fade:i().bool,flash:i().bool,mask:i().oneOfType([i().object,i().array,i().string]),maskId:i().string,fixedWidth:i().bool,inverse:i().bool,flip:i().oneOf([!0,!1,"horizontal","vertical","both"]),icon:i().oneOfType([i().object,i().array,i().string]),listItem:i().bool,pull:i().oneOf(["right","left"]),pulse:i().bool,rotation:i().oneOf([0,90,180,270]),shake:i().bool,size:i().oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:i().bool,spinPulse:i().bool,spinReverse:i().bool,symbol:i().oneOfType([i().bool,i().string]),title:i().string,titleId:i().string,transform:i().oneOfType([i().string,i().object]),swapOpacity:i().bool},h.defaultProps={border:!1,className:"",mask:null,maskId:null,fixedWidth:!1,inverse:!1,flip:!1,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:"",titleId:null,transform:null,swapOpacity:!1};var w=function n(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof e)return e;var r=(e.children||[]).map((function(e){return n(t,e)})),i=Object.keys(e.attributes||{}).reduce((function(n,t){var a=e.attributes[t];switch(t){case"class":n.attrs.className=a,delete e.attributes.class;break;case"style":n.attrs.style=a.split(";").map((function(n){return n.trim()})).filter((function(n){return n})).reduce((function(n,t){var e,a=t.indexOf(":"),r=p(t.slice(0,a)),i=t.slice(a+1).trim();return r.startsWith("webkit")?n[(e=r,e.charAt(0).toUpperCase()+e.slice(1))]=i:n[r]=i,n}),{});break;default:0===t.indexOf("aria-")||0===t.indexOf("data-")?n.attrs[t.toLowerCase()]=a:n.attrs[p(t)]=a}return n}),{attrs:{}}),o=a.style,s=void 0===o?{}:o,f=u(a,b);return i.attrs.style=c(c({},i.attrs.style),s),t.apply(void 0,[e.tag,c(c({},i.attrs),f)].concat(m(r)))}.bind(null,o.createElement)},3905:(n,t,e)=>{e.d(t,{Zo:()=>l,kt:()=>p});var a=e(7294);function r(n,t,e){return t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function i(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),e.push.apply(e,a)}return e}function o(n){for(var t=1;t=0||(r[e]=n[e]);return r}(n,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(n,e)&&(r[e]=n[e])}return r}var c=a.createContext({}),f=function(n){var t=a.useContext(c),e=t;return n&&(e="function"==typeof n?n(t):o(o({},t),n)),e},l=function(n){var t=f(n.components);return a.createElement(c.Provider,{value:t},n.children)},u="mdxType",m={inlineCode:"code",wrapper:function(n){var t=n.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(n,t){var e=n.components,r=n.mdxType,i=n.originalType,c=n.parentName,l=s(n,["components","mdxType","originalType","parentName"]),u=f(e),d=r,p=u["".concat(c,".").concat(d)]||u[d]||m[d]||i;return e?a.createElement(p,o(o({ref:t},l),{},{components:e})):a.createElement(p,o({ref:t},l))}));function p(n,t){var e=arguments,r=t&&t.mdxType;if("string"==typeof n||r){var i=e.length,o=new Array(i);o[0]=d;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=n,s[u]="string"==typeof n?n:r,o[1]=s;for(var f=2;f{function a(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),e.push.apply(e,a)}return e}function r(n){for(var t=1;tn.length)&&(t=n.length);for(var e=0,a=new Array(t);ege,qv:()=>ye,vc:()=>ve});var m=function(){},d={},p={},b=null,v={mark:m,measure:m};try{"undefined"!=typeof window&&(d=window),"undefined"!=typeof document&&(p=document),"undefined"!=typeof MutationObserver&&(b=MutationObserver),"undefined"!=typeof performance&&(v=performance)}catch(he){}var g,y,h,w,k,x=(d.navigator||{}).userAgent,O=void 0===x?"":x,A=d,P=p,j=b,N=v,S=(A.document,!!P.documentElement&&!!P.head&&"function"==typeof P.addEventListener&&"function"==typeof P.createElement),C=~O.indexOf("MSIE")||~O.indexOf("Trident/"),E="___FONT_AWESOME___",z=16,M="fa",I="svg-inline--fa",T="data-fa-i2svg",R="data-fa-pseudo-element",L="data-fa-pseudo-element-pending",Y="data-prefix",D="data-icon",F="fontawesome-i2svg",W="async",_=["HTML","HEAD","STYLE","SCRIPT"],H=function(){try{return!0}catch(he){return!1}}(),U="classic",X="sharp",q=[U,X];function B(n){return new Proxy(n,{get:function(n,t){return t in n?n[t]:n[U]}})}var V=B((s(g={},U,{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands",fak:"kit","fa-kit":"kit"}),s(g,X,{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light"}),g)),G=B((s(y={},U,{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab",kit:"fak"}),s(y,X,{solid:"fass",regular:"fasr",light:"fasl"}),y)),Q=B((s(h={},U,{fab:"fa-brands",fad:"fa-duotone",fak:"fa-kit",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"}),s(h,X,{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light"}),h)),Z=B((s(w={},U,{"fa-brands":"fab","fa-duotone":"fad","fa-kit":"fak","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"}),s(w,X,{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl"}),w)),K=/fa(s|r|l|t|d|b|k|ss|sr|sl)?[\-\ ]/,$="fa-layers-text",J=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp|Kit)?.*/i,nn=B((s(k={},U,{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"}),s(k,X,{900:"fass",400:"fasr",300:"fasl"}),k)),tn=[1,2,3,4,5,6,7,8,9,10],en=tn.concat([11,12,13,14,15,16,17,18,19,20]),an=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],rn={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},on=new Set;Object.keys(G[U]).map(on.add.bind(on)),Object.keys(G[X]).map(on.add.bind(on));var sn=[].concat(q,f(on),["2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",rn.GROUP,rn.SWAP_OPACITY,rn.PRIMARY,rn.SECONDARY]).concat(tn.map((function(n){return"".concat(n,"x")}))).concat(en.map((function(n){return"w-".concat(n)}))),cn=A.FontAwesomeConfig||{};if(P&&"function"==typeof P.querySelector){[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach((function(n){var t=c(n,2),e=t[0],a=t[1],r=function(n){return""===n||"false"!==n&&("true"===n||n)}(function(n){var t=P.querySelector("script["+n+"]");if(t)return t.getAttribute(n)}(e));null!=r&&(cn[a]=r)}))}var fn={styleDefault:"solid",familyDefault:"classic",cssPrefix:M,replacementClass:I,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};cn.familyPrefix&&(cn.cssPrefix=cn.familyPrefix);var ln=r(r({},fn),cn);ln.autoReplaceSvg||(ln.observeMutations=!1);var un={};Object.keys(fn).forEach((function(n){Object.defineProperty(un,n,{enumerable:!0,set:function(t){ln[n]=t,mn.forEach((function(n){return n(un)}))},get:function(){return ln[n]}})})),Object.defineProperty(un,"familyPrefix",{enumerable:!0,set:function(n){ln.cssPrefix=n,mn.forEach((function(n){return n(un)}))},get:function(){return ln.cssPrefix}}),A.FontAwesomeConfig=un;var mn=[];var dn=z,pn={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};var bn="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function vn(){for(var n=12,t="";n-- >0;)t+=bn[62*Math.random()|0];return t}function gn(n){for(var t=[],e=(n||[]).length>>>0;e--;)t[e]=n[e];return t}function yn(n){return n.classList?gn(n.classList):(n.getAttribute("class")||"").split(" ").filter((function(n){return n}))}function hn(n){return"".concat(n).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function wn(n){return Object.keys(n||{}).reduce((function(t,e){return t+"".concat(e,": ").concat(n[e].trim(),";")}),"")}function kn(n){return n.size!==pn.size||n.x!==pn.x||n.y!==pn.y||n.rotate!==pn.rotate||n.flipX||n.flipY}var xn=':root, :host {\n --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Solid";\n --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Regular";\n --fa-font-light: normal 300 1em/1 "Font Awesome 6 Light";\n --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Thin";\n --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone";\n --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp";\n --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands";\n}\n\nsvg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {\n overflow: visible;\n box-sizing: content-box;\n}\n\n.svg-inline--fa {\n display: var(--fa-display, inline-block);\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-2xs {\n vertical-align: 0.1em;\n}\n.svg-inline--fa.fa-xs {\n vertical-align: 0em;\n}\n.svg-inline--fa.fa-sm {\n vertical-align: -0.0714285705em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.2em;\n}\n.svg-inline--fa.fa-xl {\n vertical-align: -0.25em;\n}\n.svg-inline--fa.fa-2xl {\n vertical-align: -0.3125em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-li {\n width: var(--fa-li-width, 2em);\n top: 0.25em;\n}\n.svg-inline--fa.fa-fw {\n width: var(--fa-fw-width, 1.25em);\n}\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter {\n background-color: var(--fa-counter-background-color, #ff253a);\n border-radius: var(--fa-counter-border-radius, 1em);\n box-sizing: border-box;\n color: var(--fa-inverse, #fff);\n line-height: var(--fa-counter-line-height, 1);\n max-width: var(--fa-counter-max-width, 5em);\n min-width: var(--fa-counter-min-width, 1.5em);\n overflow: hidden;\n padding: var(--fa-counter-padding, 0.25em 0.5em);\n right: var(--fa-right, 0);\n text-overflow: ellipsis;\n top: var(--fa-top, 0);\n -webkit-transform: scale(var(--fa-counter-scale, 0.25));\n transform: scale(var(--fa-counter-scale, 0.25));\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n bottom: var(--fa-bottom, 0);\n right: var(--fa-right, 0);\n top: auto;\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: bottom right;\n transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n bottom: var(--fa-bottom, 0);\n left: var(--fa-left, 0);\n right: auto;\n top: auto;\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: bottom left;\n transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n top: var(--fa-top, 0);\n right: var(--fa-right, 0);\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-top-left {\n left: var(--fa-left, 0);\n right: auto;\n top: var(--fa-top, 0);\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: top left;\n transform-origin: top left;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-2xs {\n font-size: 0.625em;\n line-height: 0.1em;\n vertical-align: 0.225em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n line-height: 0.0833333337em;\n vertical-align: 0.125em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n line-height: 0.0714285718em;\n vertical-align: 0.0535714295em;\n}\n\n.fa-lg {\n font-size: 1.25em;\n line-height: 0.05em;\n vertical-align: -0.075em;\n}\n\n.fa-xl {\n font-size: 1.5em;\n line-height: 0.0416666682em;\n vertical-align: -0.125em;\n}\n\n.fa-2xl {\n font-size: 2em;\n line-height: 0.03125em;\n vertical-align: -0.1875em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: var(--fa-li-margin, 2.5em);\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: calc(var(--fa-li-width, 2em) * -1);\n position: absolute;\n text-align: center;\n width: var(--fa-li-width, 2em);\n line-height: inherit;\n}\n\n.fa-border {\n border-color: var(--fa-border-color, #eee);\n border-radius: var(--fa-border-radius, 0.1em);\n border-style: var(--fa-border-style, solid);\n border-width: var(--fa-border-width, 0.08em);\n padding: var(--fa-border-padding, 0.2em 0.25em 0.15em);\n}\n\n.fa-pull-left {\n float: left;\n margin-right: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-pull-right {\n float: right;\n margin-left: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-beat {\n -webkit-animation-name: fa-beat;\n animation-name: fa-beat;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-bounce {\n -webkit-animation-name: fa-bounce;\n animation-name: fa-bounce;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\n}\n\n.fa-fade {\n -webkit-animation-name: fa-fade;\n animation-name: fa-fade;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-beat-fade {\n -webkit-animation-name: fa-beat-fade;\n animation-name: fa-beat-fade;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-flip {\n -webkit-animation-name: fa-flip;\n animation-name: fa-flip;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-shake {\n -webkit-animation-name: fa-shake;\n animation-name: fa-shake;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, linear);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin {\n -webkit-animation-name: fa-spin;\n animation-name: fa-spin;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 2s);\n animation-duration: var(--fa-animation-duration, 2s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, linear);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin-reverse {\n --fa-animation-direction: reverse;\n}\n\n.fa-pulse,\n.fa-spin-pulse {\n -webkit-animation-name: fa-spin;\n animation-name: fa-spin;\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, steps(8));\n animation-timing-function: var(--fa-animation-timing, steps(8));\n}\n\n@media (prefers-reduced-motion: reduce) {\n .fa-beat,\n.fa-bounce,\n.fa-fade,\n.fa-beat-fade,\n.fa-flip,\n.fa-pulse,\n.fa-shake,\n.fa-spin,\n.fa-spin-pulse {\n -webkit-animation-delay: -1ms;\n animation-delay: -1ms;\n -webkit-animation-duration: 1ms;\n animation-duration: 1ms;\n -webkit-animation-iteration-count: 1;\n animation-iteration-count: 1;\n -webkit-transition-delay: 0s;\n transition-delay: 0s;\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n }\n}\n@-webkit-keyframes fa-beat {\n 0%, 90% {\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 45% {\n -webkit-transform: scale(var(--fa-beat-scale, 1.25));\n transform: scale(var(--fa-beat-scale, 1.25));\n }\n}\n@keyframes fa-beat {\n 0%, 90% {\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 45% {\n -webkit-transform: scale(var(--fa-beat-scale, 1.25));\n transform: scale(var(--fa-beat-scale, 1.25));\n }\n}\n@-webkit-keyframes fa-bounce {\n 0% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 10% {\n -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n }\n 30% {\n -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n }\n 50% {\n -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n }\n 57% {\n -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n }\n 64% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 100% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n}\n@keyframes fa-bounce {\n 0% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 10% {\n -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n }\n 30% {\n -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n }\n 50% {\n -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n }\n 57% {\n -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n }\n 64% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 100% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n}\n@-webkit-keyframes fa-fade {\n 50% {\n opacity: var(--fa-fade-opacity, 0.4);\n }\n}\n@keyframes fa-fade {\n 50% {\n opacity: var(--fa-fade-opacity, 0.4);\n }\n}\n@-webkit-keyframes fa-beat-fade {\n 0%, 100% {\n opacity: var(--fa-beat-fade-opacity, 0.4);\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 50% {\n opacity: 1;\n -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125));\n transform: scale(var(--fa-beat-fade-scale, 1.125));\n }\n}\n@keyframes fa-beat-fade {\n 0%, 100% {\n opacity: var(--fa-beat-fade-opacity, 0.4);\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 50% {\n opacity: 1;\n -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125));\n transform: scale(var(--fa-beat-fade-scale, 1.125));\n }\n}\n@-webkit-keyframes fa-flip {\n 50% {\n -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n }\n}\n@keyframes fa-flip {\n 50% {\n -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n }\n}\n@-webkit-keyframes fa-shake {\n 0% {\n -webkit-transform: rotate(-15deg);\n transform: rotate(-15deg);\n }\n 4% {\n -webkit-transform: rotate(15deg);\n transform: rotate(15deg);\n }\n 8%, 24% {\n -webkit-transform: rotate(-18deg);\n transform: rotate(-18deg);\n }\n 12%, 28% {\n -webkit-transform: rotate(18deg);\n transform: rotate(18deg);\n }\n 16% {\n -webkit-transform: rotate(-22deg);\n transform: rotate(-22deg);\n }\n 20% {\n -webkit-transform: rotate(22deg);\n transform: rotate(22deg);\n }\n 32% {\n -webkit-transform: rotate(-12deg);\n transform: rotate(-12deg);\n }\n 36% {\n -webkit-transform: rotate(12deg);\n transform: rotate(12deg);\n }\n 40%, 100% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n}\n@keyframes fa-shake {\n 0% {\n -webkit-transform: rotate(-15deg);\n transform: rotate(-15deg);\n }\n 4% {\n -webkit-transform: rotate(15deg);\n transform: rotate(15deg);\n }\n 8%, 24% {\n -webkit-transform: rotate(-18deg);\n transform: rotate(-18deg);\n }\n 12%, 28% {\n -webkit-transform: rotate(18deg);\n transform: rotate(18deg);\n }\n 16% {\n -webkit-transform: rotate(-22deg);\n transform: rotate(-22deg);\n }\n 20% {\n -webkit-transform: rotate(22deg);\n transform: rotate(22deg);\n }\n 32% {\n -webkit-transform: rotate(-12deg);\n transform: rotate(-12deg);\n }\n 36% {\n -webkit-transform: rotate(12deg);\n transform: rotate(12deg);\n }\n 40%, 100% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n}\n@-webkit-keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n@keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n -webkit-transform: scale(1, -1);\n transform: scale(1, -1);\n}\n\n.fa-flip-both,\n.fa-flip-horizontal.fa-flip-vertical {\n -webkit-transform: scale(-1, -1);\n transform: scale(-1, -1);\n}\n\n.fa-rotate-by {\n -webkit-transform: rotate(var(--fa-rotate-angle, none));\n transform: rotate(var(--fa-rotate-angle, none));\n}\n\n.fa-stack {\n display: inline-block;\n vertical-align: middle;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: var(--fa-stack-z-index, auto);\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: var(--fa-inverse, #fff);\n}\n\n.sr-only,\n.fa-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.sr-only-focusable:not(:focus),\n.fa-sr-only-focusable:not(:focus) {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.svg-inline--fa .fa-primary {\n fill: var(--fa-primary-color, currentColor);\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n fill: var(--fa-secondary-color, currentColor);\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n fill: black;\n}\n\n.fad.fa-inverse,\n.fa-duotone.fa-inverse {\n color: var(--fa-inverse, #fff);\n}';function On(){var n=M,t=I,e=un.cssPrefix,a=un.replacementClass,r=xn;if(e!==n||a!==t){var i=new RegExp("\\.".concat(n,"\\-"),"g"),o=new RegExp("\\--".concat(n,"\\-"),"g"),s=new RegExp("\\.".concat(t),"g");r=r.replace(i,".".concat(e,"-")).replace(o,"--".concat(e,"-")).replace(s,".".concat(a))}return r}var An=!1;function Pn(){un.autoAddCss&&!An&&(!function(n){if(n&&S){var t=P.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=n;for(var e=P.head.childNodes,a=null,r=e.length-1;r>-1;r--){var i=e[r],o=(i.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(o)>-1&&(a=i)}P.head.insertBefore(t,a)}}(On()),An=!0)}var jn={mixout:function(){return{dom:{css:On,insertCss:Pn}}},hooks:function(){return{beforeDOMElementCreation:function(){Pn()},beforeI2svg:function(){Pn()}}}},Nn=A||{};Nn[E]||(Nn[E]={}),Nn[E].styles||(Nn[E].styles={}),Nn[E].hooks||(Nn[E].hooks={}),Nn[E].shims||(Nn[E].shims=[]);var Sn=Nn[E],Cn=[],En=!1;function zn(n){var t=n.tag,e=n.attributes,a=void 0===e?{}:e,r=n.children,i=void 0===r?[]:r;return"string"==typeof n?hn(n):"<".concat(t," ").concat(function(n){return Object.keys(n||{}).reduce((function(t,e){return t+"".concat(e,'="').concat(hn(n[e]),'" ')}),"").trim()}(a),">").concat(i.map(zn).join(""),"")}function Mn(n,t,e){if(n&&n[t]&&n[t][e])return{prefix:t,iconName:e,icon:n[t][e]}}S&&((En=(P.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(P.readyState))||P.addEventListener("DOMContentLoaded",(function n(){P.removeEventListener("DOMContentLoaded",n),En=1,Cn.map((function(n){return n()}))})));var In=function(n,t,e,a){var r,i,o,s=Object.keys(n),c=s.length,f=void 0!==a?function(n,t){return function(e,a,r,i){return n.call(t,e,a,r,i)}}(t,a):t;for(void 0===e?(r=1,o=n[s[0]]):(r=0,o=e);r=55296&&r<=56319&&e2&&void 0!==arguments[2]?arguments[2]:{}).skipHooks,a=void 0!==e&&e,i=Rn(t);"function"!=typeof Sn.hooks.addPack||a?Sn.styles[n]=r(r({},Sn.styles[n]||{}),i):Sn.hooks.addPack(n,Rn(t)),"fas"===n&&Ln("fa",t)}var Yn,Dn,Fn,Wn=Sn.styles,_n=Sn.shims,Hn=(s(Yn={},U,Object.values(Q[U])),s(Yn,X,Object.values(Q[X])),Yn),Un=null,Xn={},qn={},Bn={},Vn={},Gn={},Qn=(s(Dn={},U,Object.keys(V[U])),s(Dn,X,Object.keys(V[X])),Dn);function Zn(n,t){var e,a=t.split("-"),r=a[0],i=a.slice(1).join("-");return r!==n||""===i||(e=i,~sn.indexOf(e))?null:i}var Kn,$n=function(){var n=function(n){return In(Wn,(function(t,e,a){return t[a]=In(e,n,{}),t}),{})};Xn=n((function(n,t,e){(t[3]&&(n[t[3]]=e),t[2])&&t[2].filter((function(n){return"number"==typeof n})).forEach((function(t){n[t.toString(16)]=e}));return n})),qn=n((function(n,t,e){(n[e]=e,t[2])&&t[2].filter((function(n){return"string"==typeof n})).forEach((function(t){n[t]=e}));return n})),Gn=n((function(n,t,e){var a=t[2];return n[e]=e,a.forEach((function(t){n[t]=e})),n}));var t="far"in Wn||un.autoFetchSvg,e=In(_n,(function(n,e){var a=e[0],r=e[1],i=e[2];return"far"!==r||t||(r="fas"),"string"==typeof a&&(n.names[a]={prefix:r,iconName:i}),"number"==typeof a&&(n.unicodes[a.toString(16)]={prefix:r,iconName:i}),n}),{names:{},unicodes:{}});Bn=e.names,Vn=e.unicodes,Un=rt(un.styleDefault,{family:un.familyDefault})};function Jn(n,t){return(Xn[n]||{})[t]}function nt(n,t){return(Gn[n]||{})[t]}function tt(n){return Bn[n]||{prefix:null,iconName:null}}function et(){return Un}Kn=function(n){Un=rt(n.styleDefault,{family:un.familyDefault})},mn.push(Kn),$n();var at=function(){return{prefix:null,iconName:null,rest:[]}};function rt(n){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).family,e=void 0===t?U:t,a=V[e][n],r=G[e][n]||G[e][a],i=n in Sn.styles?n:null;return r||i||null}var it=(s(Fn={},U,Object.keys(Q[U])),s(Fn,X,Object.keys(Q[X])),Fn);function ot(n){var t,e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).skipLookups,a=void 0!==e&&e,r=(s(t={},U,"".concat(un.cssPrefix,"-").concat(U)),s(t,X,"".concat(un.cssPrefix,"-").concat(X)),t),i=null,o=U;(n.includes(r[U])||n.some((function(n){return it[U].includes(n)})))&&(o=U),(n.includes(r[X])||n.some((function(n){return it[X].includes(n)})))&&(o=X);var c=n.reduce((function(n,t){var e=Zn(un.cssPrefix,t);if(Wn[t]?(t=Hn[o].includes(t)?Z[o][t]:t,i=t,n.prefix=t):Qn[o].indexOf(t)>-1?(i=t,n.prefix=rt(t,{family:o})):e?n.iconName=e:t!==un.replacementClass&&t!==r[U]&&t!==r[X]&&n.rest.push(t),!a&&n.prefix&&n.iconName){var s="fa"===i?tt(n.iconName):{},c=nt(n.prefix,n.iconName);s.prefix&&(i=null),n.iconName=s.iconName||c||n.iconName,n.prefix=s.prefix||n.prefix,"far"!==n.prefix||Wn.far||!Wn.fas||un.autoFetchSvg||(n.prefix="fas")}return n}),at());return(n.includes("fa-brands")||n.includes("fab"))&&(c.prefix="fab"),(n.includes("fa-duotone")||n.includes("fad"))&&(c.prefix="fad"),c.prefix||o!==X||!Wn.fass&&!un.autoFetchSvg||(c.prefix="fass",c.iconName=nt(c.prefix,c.iconName)||c.iconName),"fa"!==c.prefix&&"fa"!==i||(c.prefix=et()||"fas"),c}var st=function(){function n(){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),this.definitions={}}var t,e,a;return t=n,e=[{key:"add",value:function(){for(var n=this,t=arguments.length,e=new Array(t),a=0;a0&&s.forEach((function(t){"string"==typeof t&&(n[r][t]=o)})),n[r][i]=o})),n}}],e&&o(t.prototype,e),a&&o(t,a),Object.defineProperty(t,"prototype",{writable:!1}),n}(),ct=[],ft={},lt={},ut=Object.keys(lt);function mt(n,t){for(var e=arguments.length,a=new Array(e>2?e-2:0),r=2;r1?t-1:0),a=1;a0&&void 0!==arguments[0]?arguments[0]:{};return S?(dt("beforeI2svg",n),pt("pseudoElements2svg",n),pt("i2svg",n)):Promise.reject("Operation requires a DOM of some kind.")},watch:function(){var n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.autoReplaceSvgRoot;!1===un.autoReplaceSvg&&(un.autoReplaceSvg=!0),un.observeMutations=!0,n=function(){ht({autoReplaceSvgRoot:e}),dt("watch",t)},S&&(En?setTimeout(n,0):Cn.push(n))}},yt={noAuto:function(){un.autoReplaceSvg=!1,un.observeMutations=!1,dt("noAuto")},config:un,dom:gt,parse:{icon:function(n){if(null===n)return null;if("object"===i(n)&&n.prefix&&n.iconName)return{prefix:n.prefix,iconName:nt(n.prefix,n.iconName)||n.iconName};if(Array.isArray(n)&&2===n.length){var t=0===n[1].indexOf("fa-")?n[1].slice(3):n[1],e=rt(n[0]);return{prefix:e,iconName:nt(e,t)||t}}if("string"==typeof n&&(n.indexOf("".concat(un.cssPrefix,"-"))>-1||n.match(K))){var a=ot(n.split(" "),{skipLookups:!0});return{prefix:a.prefix||et(),iconName:nt(a.prefix,a.iconName)||a.iconName}}if("string"==typeof n){var r=et();return{prefix:r,iconName:nt(r,n)||n}}}},library:vt,findIconDefinition:bt,toHtml:zn},ht=function(){var n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).autoReplaceSvgRoot,t=void 0===n?P:n;(Object.keys(Sn.styles).length>0||un.autoFetchSvg)&&S&&un.autoReplaceSvg&&yt.dom.i2svg({node:t})};function wt(n,t){return Object.defineProperty(n,"abstract",{get:t}),Object.defineProperty(n,"html",{get:function(){return n.abstract.map((function(n){return zn(n)}))}}),Object.defineProperty(n,"node",{get:function(){if(S){var t=P.createElement("div");return t.innerHTML=n.html,t.children}}}),n}function kt(n){var t=n.icons,e=t.main,a=t.mask,i=n.prefix,o=n.iconName,s=n.transform,c=n.symbol,f=n.title,l=n.maskId,u=n.titleId,m=n.extra,d=n.watchable,p=void 0!==d&&d,b=a.found?a:e,v=b.width,g=b.height,y="fak"===i,h=[un.replacementClass,o?"".concat(un.cssPrefix,"-").concat(o):""].filter((function(n){return-1===m.classes.indexOf(n)})).filter((function(n){return""!==n||!!n})).concat(m.classes).join(" "),w={children:[],attributes:r(r({},m.attributes),{},{"data-prefix":i,"data-icon":o,class:h,role:m.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(v," ").concat(g)})},k=y&&!~m.classes.indexOf("fa-fw")?{width:"".concat(v/g*16*.0625,"em")}:{};p&&(w.attributes[T]=""),f&&(w.children.push({tag:"title",attributes:{id:w.attributes["aria-labelledby"]||"title-".concat(u||vn())},children:[f]}),delete w.attributes.title);var x=r(r({},w),{},{prefix:i,iconName:o,main:e,mask:a,maskId:l,transform:s,symbol:c,styles:r(r({},k),m.styles)}),O=a.found&&e.found?pt("generateAbstractMask",x)||{children:[],attributes:{}}:pt("generateAbstractIcon",x)||{children:[],attributes:{}},A=O.children,P=O.attributes;return x.children=A,x.attributes=P,c?function(n){var t=n.prefix,e=n.iconName,a=n.children,i=n.attributes,o=n.symbol,s=!0===o?"".concat(t,"-").concat(un.cssPrefix,"-").concat(e):o;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:r(r({},i),{},{id:s}),children:a}]}]}(x):function(n){var t=n.children,e=n.main,a=n.mask,i=n.attributes,o=n.styles,s=n.transform;if(kn(s)&&e.found&&!a.found){var c={x:e.width/e.height/2,y:.5};i.style=wn(r(r({},o),{},{"transform-origin":"".concat(c.x+s.x/16,"em ").concat(c.y+s.y/16,"em")}))}return[{tag:"svg",attributes:i,children:t}]}(x)}function xt(n){var t=n.content,e=n.width,a=n.height,i=n.transform,o=n.title,s=n.extra,c=n.watchable,f=void 0!==c&&c,l=r(r(r({},s.attributes),o?{title:o}:{}),{},{class:s.classes.join(" ")});f&&(l[T]="");var u=r({},s.styles);kn(i)&&(u.transform=function(n){var t=n.transform,e=n.width,a=void 0===e?z:e,r=n.height,i=void 0===r?z:r,o=n.startCentered,s=void 0!==o&&o,c="";return c+=s&&C?"translate(".concat(t.x/dn-a/2,"em, ").concat(t.y/dn-i/2,"em) "):s?"translate(calc(-50% + ".concat(t.x/dn,"em), calc(-50% + ").concat(t.y/dn,"em)) "):"translate(".concat(t.x/dn,"em, ").concat(t.y/dn,"em) "),c+="scale(".concat(t.size/dn*(t.flipX?-1:1),", ").concat(t.size/dn*(t.flipY?-1:1),") "),c+"rotate(".concat(t.rotate,"deg) ")}({transform:i,startCentered:!0,width:e,height:a}),u["-webkit-transform"]=u.transform);var m=wn(u);m.length>0&&(l.style=m);var d=[];return d.push({tag:"span",attributes:l,children:[t]}),o&&d.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),d}var Ot=Sn.styles;function At(n){var t=n[0],e=n[1],a=c(n.slice(4),1)[0];return{found:!0,width:t,height:e,icon:Array.isArray(a)?{tag:"g",attributes:{class:"".concat(un.cssPrefix,"-").concat(rn.GROUP)},children:[{tag:"path",attributes:{class:"".concat(un.cssPrefix,"-").concat(rn.SECONDARY),fill:"currentColor",d:a[0]}},{tag:"path",attributes:{class:"".concat(un.cssPrefix,"-").concat(rn.PRIMARY),fill:"currentColor",d:a[1]}}]}:{tag:"path",attributes:{fill:"currentColor",d:a}}}}var Pt={found:!1,width:512,height:512};function jt(n,t){var e=t;return"fa"===t&&null!==un.styleDefault&&(t=et()),new Promise((function(a,i){pt("missingIconAbstract");if("fa"===e){var o=tt(n)||{};n=o.iconName||n,t=o.prefix||t}if(n&&t&&Ot[t]&&Ot[t][n])return a(At(Ot[t][n]));!function(n,t){H||un.showMissingIcons||!n||console.error('Icon with name "'.concat(n,'" and prefix "').concat(t,'" is missing.'))}(n,t),a(r(r({},Pt),{},{icon:un.showMissingIcons&&n&&pt("missingIconAbstract")||{}}))}))}var Nt=function(){},St=un.measurePerformance&&N&&N.mark&&N.measure?N:{mark:Nt,measure:Nt},Ct='FA "6.4.2"',Et=function(n){St.mark("".concat(Ct," ").concat(n," ends")),St.measure("".concat(Ct," ").concat(n),"".concat(Ct," ").concat(n," begins"),"".concat(Ct," ").concat(n," ends"))},zt={begin:function(n){return St.mark("".concat(Ct," ").concat(n," begins")),function(){return Et(n)}},end:Et},Mt=function(){};function It(n){return"string"==typeof(n.getAttribute?n.getAttribute(T):null)}function Tt(n){return P.createElementNS("http://www.w3.org/2000/svg",n)}function Rt(n){return P.createElement(n)}function Lt(n){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).ceFn,e=void 0===t?"svg"===n.tag?Tt:Rt:t;if("string"==typeof n)return P.createTextNode(n);var a=e(n.tag);return Object.keys(n.attributes||[]).forEach((function(t){a.setAttribute(t,n.attributes[t])})),(n.children||[]).forEach((function(n){a.appendChild(Lt(n,{ceFn:e}))})),a}var Yt={replace:function(n){var t=n[0];if(t.parentNode)if(n[1].forEach((function(n){t.parentNode.insertBefore(Lt(n),t)})),null===t.getAttribute(T)&&un.keepOriginalSource){var e=P.createComment(function(n){var t=" ".concat(n.outerHTML," ");return"".concat(t,"Font Awesome fontawesome.com ")}(t));t.parentNode.replaceChild(e,t)}else t.remove()},nest:function(n){var t=n[0],e=n[1];if(~yn(t).indexOf(un.replacementClass))return Yt.replace(n);var a=new RegExp("".concat(un.cssPrefix,"-.*"));if(delete e[0].attributes.id,e[0].attributes.class){var r=e[0].attributes.class.split(" ").reduce((function(n,t){return t===un.replacementClass||t.match(a)?n.toSvg.push(t):n.toNode.push(t),n}),{toNode:[],toSvg:[]});e[0].attributes.class=r.toSvg.join(" "),0===r.toNode.length?t.removeAttribute("class"):t.setAttribute("class",r.toNode.join(" "))}var i=e.map((function(n){return zn(n)})).join("\n");t.setAttribute(T,""),t.innerHTML=i}};function Dt(n){n()}function Ft(n,t){var e="function"==typeof t?t:Mt;if(0===n.length)e();else{var a=Dt;un.mutateApproach===W&&(a=A.requestAnimationFrame||Dt),a((function(){var t=!0===un.autoReplaceSvg?Yt.replace:Yt[un.autoReplaceSvg]||Yt.replace,a=zt.begin("mutate");n.map(t),a(),e()}))}}var Wt=!1;function _t(){Wt=!0}function Ht(){Wt=!1}var Ut=null;function Xt(n){if(j&&un.observeMutations){var t=n.treeCallback,e=void 0===t?Mt:t,a=n.nodeCallback,r=void 0===a?Mt:a,i=n.pseudoElementsCallback,o=void 0===i?Mt:i,s=n.observeMutationsRoot,c=void 0===s?P:s;Ut=new j((function(n){if(!Wt){var t=et();gn(n).forEach((function(n){if("childList"===n.type&&n.addedNodes.length>0&&!It(n.addedNodes[0])&&(un.searchPseudoElements&&o(n.target),e(n.target)),"attributes"===n.type&&n.target.parentNode&&un.searchPseudoElements&&o(n.target.parentNode),"attributes"===n.type&&It(n.target)&&~an.indexOf(n.attributeName))if("class"===n.attributeName&&function(n){var t=n.getAttribute?n.getAttribute(Y):null,e=n.getAttribute?n.getAttribute(D):null;return t&&e}(n.target)){var a=ot(yn(n.target)),i=a.prefix,s=a.iconName;n.target.setAttribute(Y,i||t),s&&n.target.setAttribute(D,s)}else(c=n.target)&&c.classList&&c.classList.contains&&c.classList.contains(un.replacementClass)&&r(n.target);var c}))}})),S&&Ut.observe(c,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function qt(n){var t,e,a=n.getAttribute("data-prefix"),r=n.getAttribute("data-icon"),i=void 0!==n.innerText?n.innerText.trim():"",o=ot(yn(n));return o.prefix||(o.prefix=et()),a&&r&&(o.prefix=a,o.iconName=r),o.iconName&&o.prefix||(o.prefix&&i.length>0&&(o.iconName=(t=o.prefix,e=n.innerText,(qn[t]||{})[e]||Jn(o.prefix,Tn(n.innerText)))),!o.iconName&&un.autoFetchSvg&&n.firstChild&&n.firstChild.nodeType===Node.TEXT_NODE&&(o.iconName=n.firstChild.data)),o}function Bt(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{styleParser:!0},e=qt(n),a=e.iconName,i=e.prefix,o=e.rest,s=function(n){var t=gn(n.attributes).reduce((function(n,t){return"class"!==n.name&&"style"!==n.name&&(n[t.name]=t.value),n}),{}),e=n.getAttribute("title"),a=n.getAttribute("data-fa-title-id");return un.autoA11y&&(e?t["aria-labelledby"]="".concat(un.replacementClass,"-title-").concat(a||vn()):(t["aria-hidden"]="true",t.focusable="false")),t}(n),c=mt("parseNodeAttributes",{},n),f=t.styleParser?function(n){var t=n.getAttribute("style"),e=[];return t&&(e=t.split(";").reduce((function(n,t){var e=t.split(":"),a=e[0],r=e.slice(1);return a&&r.length>0&&(n[a]=r.join(":").trim()),n}),{})),e}(n):[];return r({iconName:a,title:n.getAttribute("title"),titleId:n.getAttribute("data-fa-title-id"),prefix:i,transform:pn,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:o,styles:f,attributes:s}},c)}var Vt=Sn.styles;function Gt(n){var t="nest"===un.autoReplaceSvg?Bt(n,{styleParser:!1}):Bt(n);return~t.extra.classes.indexOf($)?pt("generateLayersText",n,t):pt("generateSvgReplacementMutation",n,t)}var Qt=new Set;function Zt(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!S)return Promise.resolve();var e=P.documentElement.classList,a=function(n){return e.add("".concat(F,"-").concat(n))},r=function(n){return e.remove("".concat(F,"-").concat(n))},i=un.autoFetchSvg?Qt:q.map((function(n){return"fa-".concat(n)})).concat(Object.keys(Vt));i.includes("fa")||i.push("fa");var o=[".".concat($,":not([").concat(T,"])")].concat(i.map((function(n){return".".concat(n,":not([").concat(T,"])")}))).join(", ");if(0===o.length)return Promise.resolve();var s=[];try{s=gn(n.querySelectorAll(o))}catch(he){}if(!(s.length>0))return Promise.resolve();a("pending"),r("complete");var c=zt.begin("onTree"),f=s.reduce((function(n,t){try{var e=Gt(t);e&&n.push(e)}catch(he){H||"MissingIcon"===he.name&&console.error(he)}return n}),[]);return new Promise((function(n,e){Promise.all(f).then((function(e){Ft(e,(function(){a("active"),a("complete"),r("pending"),"function"==typeof t&&t(),c(),n()}))})).catch((function(n){c(),e(n)}))}))}function Kt(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;Gt(n).then((function(n){n&&Ft([n],t)}))}q.map((function(n){Qt.add("fa-".concat(n))})),Object.keys(V[U]).map(Qt.add.bind(Qt)),Object.keys(V[X]).map(Qt.add.bind(Qt)),Qt=f(Qt);var $t=function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=t.transform,a=void 0===e?pn:e,i=t.symbol,o=void 0!==i&&i,s=t.mask,c=void 0===s?null:s,f=t.maskId,l=void 0===f?null:f,u=t.title,m=void 0===u?null:u,d=t.titleId,p=void 0===d?null:d,b=t.classes,v=void 0===b?[]:b,g=t.attributes,y=void 0===g?{}:g,h=t.styles,w=void 0===h?{}:h;if(n){var k=n.prefix,x=n.iconName,O=n.icon;return wt(r({type:"icon"},n),(function(){return dt("beforeDOMElementCreation",{iconDefinition:n,params:t}),un.autoA11y&&(m?y["aria-labelledby"]="".concat(un.replacementClass,"-title-").concat(p||vn()):(y["aria-hidden"]="true",y.focusable="false")),kt({icons:{main:At(O),mask:c?At(c.icon):{found:!1,width:null,height:null,icon:{}}},prefix:k,iconName:x,transform:r(r({},pn),a),symbol:o,title:m,maskId:l,titleId:p,extra:{attributes:y,styles:w,classes:v}})}))}},Jt={mixout:function(){return{icon:(n=$t,function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=(t||{}).icon?t:bt(t||{}),i=e.mask;return i&&(i=(i||{}).icon?i:bt(i||{})),n(a,r(r({},e),{},{mask:i}))})};var n},hooks:function(){return{mutationObserverCallbacks:function(n){return n.treeCallback=Zt,n.nodeCallback=Kt,n}}},provides:function(n){n.i2svg=function(n){var t=n.node,e=void 0===t?P:t,a=n.callback;return Zt(e,void 0===a?function(){}:a)},n.generateSvgReplacementMutation=function(n,t){var e=t.iconName,a=t.title,r=t.titleId,i=t.prefix,o=t.transform,s=t.symbol,f=t.mask,l=t.maskId,u=t.extra;return new Promise((function(t,m){Promise.all([jt(e,i),f.iconName?jt(f.iconName,f.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then((function(f){var m=c(f,2),d=m[0],p=m[1];t([n,kt({icons:{main:d,mask:p},prefix:i,iconName:e,transform:o,symbol:s,maskId:l,title:a,titleId:r,extra:u,watchable:!0})])})).catch(m)}))},n.generateAbstractIcon=function(n){var t,e=n.children,a=n.attributes,r=n.main,i=n.transform,o=wn(n.styles);return o.length>0&&(a.style=o),kn(i)&&(t=pt("generateAbstractTransformGrouping",{main:r,transform:i,containerWidth:r.width,iconWidth:r.width})),e.push(t||r.icon),{children:e,attributes:a}}}},ne={mixout:function(){return{layer:function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=t.classes,a=void 0===e?[]:e;return wt({type:"layer"},(function(){dt("beforeDOMElementCreation",{assembler:n,params:t});var e=[];return n((function(n){Array.isArray(n)?n.map((function(n){e=e.concat(n.abstract)})):e=e.concat(n.abstract)})),[{tag:"span",attributes:{class:["".concat(un.cssPrefix,"-layers")].concat(f(a)).join(" ")},children:e}]}))}}}},te={mixout:function(){return{counter:function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=t.title,a=void 0===e?null:e,i=t.classes,o=void 0===i?[]:i,s=t.attributes,c=void 0===s?{}:s,l=t.styles,u=void 0===l?{}:l;return wt({type:"counter",content:n},(function(){return dt("beforeDOMElementCreation",{content:n,params:t}),function(n){var t=n.content,e=n.title,a=n.extra,i=r(r(r({},a.attributes),e?{title:e}:{}),{},{class:a.classes.join(" ")}),o=wn(a.styles);o.length>0&&(i.style=o);var s=[];return s.push({tag:"span",attributes:i,children:[t]}),e&&s.push({tag:"span",attributes:{class:"sr-only"},children:[e]}),s}({content:n.toString(),title:a,extra:{attributes:c,styles:u,classes:["".concat(un.cssPrefix,"-layers-counter")].concat(f(o))}})}))}}}},ee={mixout:function(){return{text:function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=t.transform,a=void 0===e?pn:e,i=t.title,o=void 0===i?null:i,s=t.classes,c=void 0===s?[]:s,l=t.attributes,u=void 0===l?{}:l,m=t.styles,d=void 0===m?{}:m;return wt({type:"text",content:n},(function(){return dt("beforeDOMElementCreation",{content:n,params:t}),xt({content:n,transform:r(r({},pn),a),title:o,extra:{attributes:u,styles:d,classes:["".concat(un.cssPrefix,"-layers-text")].concat(f(c))}})}))}}},provides:function(n){n.generateLayersText=function(n,t){var e=t.title,a=t.transform,r=t.extra,i=null,o=null;if(C){var s=parseInt(getComputedStyle(n).fontSize,10),c=n.getBoundingClientRect();i=c.width/s,o=c.height/s}return un.autoA11y&&!e&&(r.attributes["aria-hidden"]="true"),Promise.resolve([n,xt({content:n.innerHTML,width:i,height:o,transform:a,title:e,extra:r,watchable:!0})])}}},ae=new RegExp('"',"ug"),re=[1105920,1112319];function ie(n,t){var e="".concat(L).concat(t.replace(":","-"));return new Promise((function(a,i){if(null!==n.getAttribute(e))return a();var o,s,c,f=gn(n.children).filter((function(n){return n.getAttribute(R)===t}))[0],l=A.getComputedStyle(n,t),u=l.getPropertyValue("font-family").match(J),m=l.getPropertyValue("font-weight"),d=l.getPropertyValue("content");if(f&&!u)return n.removeChild(f),a();if(u&&"none"!==d&&""!==d){var p=l.getPropertyValue("content"),b=~["Sharp"].indexOf(u[2])?X:U,v=~["Solid","Regular","Light","Thin","Duotone","Brands","Kit"].indexOf(u[2])?G[b][u[2].toLowerCase()]:nn[b][m],g=function(n){var t,e,a,r,i,o=n.replace(ae,""),s=(e=0,r=(t=o).length,(i=t.charCodeAt(e))>=55296&&i<=56319&&r>e+1&&(a=t.charCodeAt(e+1))>=56320&&a<=57343?1024*(i-55296)+a-56320+65536:i),c=s>=re[0]&&s<=re[1],f=2===o.length&&o[0]===o[1];return{value:Tn(f?o[0]:o),isSecondary:c||f}}(p),y=g.value,h=g.isSecondary,w=u[0].startsWith("FontAwesome"),k=Jn(v,y),x=k;if(w){var O=(s=Vn[o=y],c=Jn("fas",o),s||(c?{prefix:"fas",iconName:c}:null)||{prefix:null,iconName:null});O.iconName&&O.prefix&&(k=O.iconName,v=O.prefix)}if(!k||h||f&&f.getAttribute(Y)===v&&f.getAttribute(D)===x)a();else{n.setAttribute(e,x),f&&n.removeChild(f);var j={iconName:null,title:null,titleId:null,prefix:null,transform:pn,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}},N=j.extra;N.attributes[R]=t,jt(k,v).then((function(i){var o=kt(r(r({},j),{},{icons:{main:i,mask:at()},prefix:v,iconName:x,extra:N,watchable:!0})),s=P.createElementNS("http://www.w3.org/2000/svg","svg");"::before"===t?n.insertBefore(s,n.firstChild):n.appendChild(s),s.outerHTML=o.map((function(n){return zn(n)})).join("\n"),n.removeAttribute(e),a()})).catch(i)}}else a()}))}function oe(n){return Promise.all([ie(n,"::before"),ie(n,"::after")])}function se(n){return!(n.parentNode===document.head||~_.indexOf(n.tagName.toUpperCase())||n.getAttribute(R)||n.parentNode&&"svg"===n.parentNode.tagName)}function ce(n){if(S)return new Promise((function(t,e){var a=gn(n.querySelectorAll("*")).filter(se).map(oe),r=zt.begin("searchPseudoElements");_t(),Promise.all(a).then((function(){r(),Ht(),t()})).catch((function(){r(),Ht(),e()}))}))}var fe=!1,le=function(n){return n.toLowerCase().split(" ").reduce((function(n,t){var e=t.toLowerCase().split("-"),a=e[0],r=e.slice(1).join("-");if(a&&"h"===r)return n.flipX=!0,n;if(a&&"v"===r)return n.flipY=!0,n;if(r=parseFloat(r),isNaN(r))return n;switch(a){case"grow":n.size=n.size+r;break;case"shrink":n.size=n.size-r;break;case"left":n.x=n.x-r;break;case"right":n.x=n.x+r;break;case"up":n.y=n.y-r;break;case"down":n.y=n.y+r;break;case"rotate":n.rotate=n.rotate+r}return n}),{size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0})},ue={mixout:function(){return{parse:{transform:function(n){return le(n)}}}},hooks:function(){return{parseNodeAttributes:function(n,t){var e=t.getAttribute("data-fa-transform");return e&&(n.transform=le(e)),n}}},provides:function(n){n.generateAbstractTransformGrouping=function(n){var t=n.main,e=n.transform,a=n.containerWidth,i=n.iconWidth,o={transform:"translate(".concat(a/2," 256)")},s="translate(".concat(32*e.x,", ").concat(32*e.y,") "),c="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),f="rotate(".concat(e.rotate," 0 0)"),l={outer:o,inner:{transform:"".concat(s," ").concat(c," ").concat(f)},path:{transform:"translate(".concat(i/2*-1," -256)")}};return{tag:"g",attributes:r({},l.outer),children:[{tag:"g",attributes:r({},l.inner),children:[{tag:t.icon.tag,children:t.icon.children,attributes:r(r({},t.icon.attributes),l.path)}]}]}}}},me={x:0,y:0,width:"100%",height:"100%"};function de(n){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n.attributes&&(n.attributes.fill||t)&&(n.attributes.fill="black"),n}var pe={hooks:function(){return{parseNodeAttributes:function(n,t){var e=t.getAttribute("data-fa-mask"),a=e?ot(e.split(" ").map((function(n){return n.trim()}))):at();return a.prefix||(a.prefix=et()),n.mask=a,n.maskId=t.getAttribute("data-fa-mask-id"),n}}},provides:function(n){n.generateAbstractMask=function(n){var t,e=n.children,a=n.attributes,i=n.main,o=n.mask,s=n.maskId,c=n.transform,f=i.width,l=i.icon,u=o.width,m=o.icon,d=function(n){var t=n.transform,e=n.containerWidth,a=n.iconWidth,r={transform:"translate(".concat(e/2," 256)")},i="translate(".concat(32*t.x,", ").concat(32*t.y,") "),o="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),s="rotate(".concat(t.rotate," 0 0)");return{outer:r,inner:{transform:"".concat(i," ").concat(o," ").concat(s)},path:{transform:"translate(".concat(a/2*-1," -256)")}}}({transform:c,containerWidth:u,iconWidth:f}),p={tag:"rect",attributes:r(r({},me),{},{fill:"white"})},b=l.children?{children:l.children.map(de)}:{},v={tag:"g",attributes:r({},d.inner),children:[de(r({tag:l.tag,attributes:r(r({},l.attributes),d.path)},b))]},g={tag:"g",attributes:r({},d.outer),children:[v]},y="mask-".concat(s||vn()),h="clip-".concat(s||vn()),w={tag:"mask",attributes:r(r({},me),{},{id:y,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[p,g]},k={tag:"defs",children:[{tag:"clipPath",attributes:{id:h},children:(t=m,"g"===t.tag?t.children:[t])},w]};return e.push(k,{tag:"rect",attributes:r({fill:"currentColor","clip-path":"url(#".concat(h,")"),mask:"url(#".concat(y,")")},me)}),{children:e,attributes:a}}}},be={provides:function(n){var t=!1;A.matchMedia&&(t=A.matchMedia("(prefers-reduced-motion: reduce)").matches),n.missingIconAbstract=function(){var n=[],e={fill:"currentColor"},a={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};n.push({tag:"path",attributes:r(r({},e),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});var i=r(r({},a),{},{attributeName:"opacity"}),o={tag:"circle",attributes:r(r({},e),{},{cx:"256",cy:"364",r:"28"}),children:[]};return t||o.children.push({tag:"animate",attributes:r(r({},a),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:r(r({},i),{},{values:"1;0;1;1;0;1;"})}),n.push(o),n.push({tag:"path",attributes:r(r({},e),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:t?[]:[{tag:"animate",attributes:r(r({},i),{},{values:"1;0;0;0;0;1;"})}]}),t||n.push({tag:"path",attributes:r(r({},e),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:r(r({},i),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:n}}}};!function(n,t){var e=t.mixoutsTo;ct=n,ft={},Object.keys(lt).forEach((function(n){-1===ut.indexOf(n)&&delete lt[n]})),ct.forEach((function(n){var t=n.mixout?n.mixout():{};if(Object.keys(t).forEach((function(n){"function"==typeof t[n]&&(e[n]=t[n]),"object"===i(t[n])&&Object.keys(t[n]).forEach((function(a){e[n]||(e[n]={}),e[n][a]=t[n][a]}))})),n.hooks){var a=n.hooks();Object.keys(a).forEach((function(n){ft[n]||(ft[n]=[]),ft[n].push(a[n])}))}n.provides&&n.provides(lt)}))}([jn,Jt,ne,te,ee,{hooks:function(){return{mutationObserverCallbacks:function(n){return n.pseudoElementsCallback=ce,n}}},provides:function(n){n.pseudoElements2svg=function(n){var t=n.node,e=void 0===t?P:t;un.searchPseudoElements&&ce(e)}}},{mixout:function(){return{dom:{unwatch:function(){_t(),fe=!0}}}},hooks:function(){return{bootstrap:function(){Xt(mt("mutationObserverCallbacks",{}))},noAuto:function(){Ut&&Ut.disconnect()},watch:function(n){var t=n.observeMutationsRoot;fe?Ht():Xt(mt("mutationObserverCallbacks",{observeMutationsRoot:t}))}}}},ue,pe,be,{hooks:function(){return{parseNodeAttributes:function(n,t){var e=t.getAttribute("data-fa-symbol"),a=null!==e&&(""===e||e);return n.symbol=a,n}}}}],{mixoutsTo:yt});var ve=yt.config,ge=yt.parse,ye=yt.icon},3024:(n,t,e)=>{e.d(t,{omb:()=>a,zhw:()=>r});var a={prefix:"fab",iconName:"discord",icon:[640,512,[],"f392","M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"]},r={prefix:"fab",iconName:"github",icon:[496,512,[],"f09b","M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"]}}}]); \ No newline at end of file diff --git a/assets/js/17896441.82a14470.js b/assets/js/17896441.82a14470.js new file mode 100644 index 0000000..db6282a --- /dev/null +++ b/assets/js/17896441.82a14470.js @@ -0,0 +1 @@ +(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[7918],{3905:(e,t,n)=>{"use strict";n.d(t,{Zo:()=>d,kt:()=>f});var a=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=a.createContext({}),i=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},d=function(e){var t=i(e.components);return a.createElement(s.Provider,{value:t},e.children)},m="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},p=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,r=e.originalType,s=e.parentName,d=c(e,["components","mdxType","originalType","parentName"]),m=i(n),p=o,f=m["".concat(s,".").concat(p)]||m[p]||u[p]||r;return n?a.createElement(f,l(l({ref:t},d),{},{components:n})):a.createElement(f,l({ref:t},d))}));function f(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=n.length,l=new Array(r);l[0]=p;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c[m]="string"==typeof e?e:o,l[1]=c;for(var i=2;i{"use strict";n.r(t),n.d(t,{default:()=>Ot});var a=n(7294),o=n(833),r=n(902);const l=a.createContext(null);function c(e){let{children:t,content:n}=e;const o=function(e){return(0,a.useMemo)((()=>({metadata:e.metadata,frontMatter:e.frontMatter,assets:e.assets,contentTitle:e.contentTitle,toc:e.toc})),[e])}(n);return a.createElement(l.Provider,{value:o},t)}function s(){const e=(0,a.useContext)(l);if(null===e)throw new r.i6("DocProvider");return e}function i(){const{metadata:e,frontMatter:t,assets:n}=s();return a.createElement(o.d,{title:e.title,description:e.description,keywords:t.keywords,image:n.image??t.image})}var d=n(6010),m=n(7524),u=n(7462),p=n(5999),f=n(9960);function h(e){const{permalink:t,title:n,subLabel:o,isNext:r}=e;return a.createElement(f.Z,{className:(0,d.Z)("pagination-nav__link",r?"pagination-nav__link--next":"pagination-nav__link--prev"),to:t},o&&a.createElement("div",{className:"pagination-nav__sublabel"},o),a.createElement("div",{className:"pagination-nav__label"},n))}function g(e){const{previous:t,next:n}=e;return a.createElement("nav",{className:"pagination-nav docusaurus-mt-lg","aria-label":(0,p.I)({id:"theme.docs.paginator.navAriaLabel",message:"Docs pages",description:"The ARIA label for the docs pagination"})},t&&a.createElement(h,(0,u.Z)({},t,{subLabel:a.createElement(p.Z,{id:"theme.docs.paginator.previous",description:"The label used to navigate to the previous doc"},"Previous")})),n&&a.createElement(h,(0,u.Z)({},n,{subLabel:a.createElement(p.Z,{id:"theme.docs.paginator.next",description:"The label used to navigate to the next doc"},"Next"),isNext:!0})))}function b(){const{metadata:e}=s();return a.createElement(g,{previous:e.previous,next:e.next})}var v=n(2263),E=n(143),y=n(5281),k=n(373),N=n(4477);const C={unreleased:function(e){let{siteTitle:t,versionMetadata:n}=e;return a.createElement(p.Z,{id:"theme.docs.versions.unreleasedVersionLabel",description:"The label used to tell the user that he's browsing an unreleased doc version",values:{siteTitle:t,versionLabel:a.createElement("b",null,n.label)}},"This is unreleased documentation for {siteTitle} {versionLabel} version.")},unmaintained:function(e){let{siteTitle:t,versionMetadata:n}=e;return a.createElement(p.Z,{id:"theme.docs.versions.unmaintainedVersionLabel",description:"The label used to tell the user that he's browsing an unmaintained doc version",values:{siteTitle:t,versionLabel:a.createElement("b",null,n.label)}},"This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained.")}};function L(e){const t=C[e.versionMetadata.banner];return a.createElement(t,e)}function T(e){let{versionLabel:t,to:n,onClick:o}=e;return a.createElement(p.Z,{id:"theme.docs.versions.latestVersionSuggestionLabel",description:"The label used to tell the user to check the latest version",values:{versionLabel:t,latestVersionLink:a.createElement("b",null,a.createElement(f.Z,{to:n,onClick:o},a.createElement(p.Z,{id:"theme.docs.versions.latestVersionLinkLabel",description:"The label used for the latest version suggestion link label"},"latest version")))}},"For up-to-date documentation, see the {latestVersionLink} ({versionLabel}).")}function _(e){let{className:t,versionMetadata:n}=e;const{siteConfig:{title:o}}=(0,v.Z)(),{pluginId:r}=(0,E.gA)({failfast:!0}),{savePreferredVersionName:l}=(0,k.J)(r),{latestDocSuggestion:c,latestVersionSuggestion:s}=(0,E.Jo)(r),i=c??(m=s).docs.find((e=>e.id===m.mainDocId));var m;return a.createElement("div",{className:(0,d.Z)(t,y.k.docs.docVersionBanner,"alert alert--warning margin-bottom--md"),role:"alert"},a.createElement("div",null,a.createElement(L,{siteTitle:o,versionMetadata:n})),a.createElement("div",{className:"margin-top--md"},a.createElement(T,{versionLabel:s.label,to:i.path,onClick:()=>l(s.name)})))}function w(e){let{className:t}=e;const n=(0,N.E)();return n.banner?a.createElement(_,{className:t,versionMetadata:n}):null}function Z(e){let{className:t}=e;const n=(0,N.E)();return n.badge?a.createElement("span",{className:(0,d.Z)(t,y.k.docs.docVersionBadge,"badge badge--secondary")},a.createElement(p.Z,{id:"theme.docs.versionBadge.label",values:{versionLabel:n.label}},"Version: {versionLabel}")):null}function x(e){let{lastUpdatedAt:t,formattedLastUpdatedAt:n}=e;return a.createElement(p.Z,{id:"theme.lastUpdated.atDate",description:"The words used to describe on which date a page has been last updated",values:{date:a.createElement("b",null,a.createElement("time",{dateTime:new Date(1e3*t).toISOString()},n))}}," on {date}")}function B(e){let{lastUpdatedBy:t}=e;return a.createElement(p.Z,{id:"theme.lastUpdated.byUser",description:"The words used to describe by who the page has been last updated",values:{user:a.createElement("b",null,t)}}," by {user}")}function O(e){let{lastUpdatedAt:t,formattedLastUpdatedAt:n,lastUpdatedBy:o}=e;return a.createElement("span",{className:y.k.common.lastUpdated},a.createElement(p.Z,{id:"theme.lastUpdated.lastUpdatedAtBy",description:"The sentence used to display when a page has been last updated, and by who",values:{atDate:t&&n?a.createElement(x,{lastUpdatedAt:t,formattedLastUpdatedAt:n}):"",byUser:o?a.createElement(B,{lastUpdatedBy:o}):""}},"Last updated{atDate}{byUser}"),!1)}const H={iconEdit:"iconEdit_Z9Sw"};function A(e){let{className:t,...n}=e;return a.createElement("svg",(0,u.Z)({fill:"currentColor",height:"20",width:"20",viewBox:"0 0 40 40",className:(0,d.Z)(H.iconEdit,t),"aria-hidden":"true"},n),a.createElement("g",null,a.createElement("path",{d:"m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"})))}function j(e){let{editUrl:t}=e;return a.createElement("a",{href:t,target:"_blank",rel:"noreferrer noopener",className:y.k.common.editThisPage},a.createElement(A,null),a.createElement(p.Z,{id:"theme.common.editThisPage",description:"The link label to edit the current page"},"Edit this page"))}const S={tag:"tag_zVej",tagRegular:"tagRegular_sFm0",tagWithCount:"tagWithCount_h2kH"};function I(e){let{permalink:t,label:n,count:o}=e;return a.createElement(f.Z,{href:t,className:(0,d.Z)(S.tag,o?S.tagWithCount:S.tagRegular)},n,o&&a.createElement("span",null,o))}const M={tags:"tags_jXut",tag:"tag_QGVx"};function P(e){let{tags:t}=e;return a.createElement(a.Fragment,null,a.createElement("b",null,a.createElement(p.Z,{id:"theme.tags.tagsListLabel",description:"The label alongside a tag list"},"Tags:")),a.createElement("ul",{className:(0,d.Z)(M.tags,"padding--none","margin-left--sm")},t.map((e=>{let{label:t,permalink:n}=e;return a.createElement("li",{key:n,className:M.tag},a.createElement(I,{label:t,permalink:n}))}))))}const U={lastUpdated:"lastUpdated_vwxv"};function z(e){return a.createElement("div",{className:(0,d.Z)(y.k.docs.docFooterTagsRow,"row margin-bottom--sm")},a.createElement("div",{className:"col"},a.createElement(P,e)))}function V(e){let{editUrl:t,lastUpdatedAt:n,lastUpdatedBy:o,formattedLastUpdatedAt:r}=e;return a.createElement("div",{className:(0,d.Z)(y.k.docs.docFooterEditMetaRow,"row")},a.createElement("div",{className:"col"},t&&a.createElement(j,{editUrl:t})),a.createElement("div",{className:(0,d.Z)("col",U.lastUpdated)},(n||o)&&a.createElement(O,{lastUpdatedAt:n,formattedLastUpdatedAt:r,lastUpdatedBy:o})))}function D(){const{metadata:e}=s(),{editUrl:t,lastUpdatedAt:n,formattedLastUpdatedAt:o,lastUpdatedBy:r,tags:l}=e,c=l.length>0,i=!!(t||n||r);return c||i?a.createElement("footer",{className:(0,d.Z)(y.k.docs.docFooter,"docusaurus-mt-lg")},c&&a.createElement(z,{tags:l}),i&&a.createElement(V,{editUrl:t,lastUpdatedAt:n,lastUpdatedBy:r,formattedLastUpdatedAt:o})):null}var R=n(6043),W=n(6668);function $(e){const t=e.map((e=>({...e,parentIndex:-1,children:[]}))),n=Array(7).fill(-1);t.forEach(((e,t)=>{const a=n.slice(2,e.level);e.parentIndex=Math.max(...a),n[e.level]=t}));const a=[];return t.forEach((e=>{const{parentIndex:n,...o}=e;n>=0?t[n].children.push(o):a.push(o)})),a}function F(e){let{toc:t,minHeadingLevel:n,maxHeadingLevel:a}=e;return t.flatMap((e=>{const t=F({toc:e.children,minHeadingLevel:n,maxHeadingLevel:a});return function(e){return e.level>=n&&e.level<=a}(e)?[{...e,children:t}]:t}))}function q(e){const t=e.getBoundingClientRect();return t.top===t.bottom?q(e.parentNode):t}function G(e,t){let{anchorTopOffset:n}=t;const a=e.find((e=>q(e).top>=n));if(a){return function(e){return e.top>0&&e.bottom{e.current=t?0:document.querySelector(".navbar").clientHeight}),[t]),e}function J(e){const t=(0,a.useRef)(void 0),n=Y();(0,a.useEffect)((()=>{if(!e)return()=>{};const{linkClassName:a,linkActiveClassName:o,minHeadingLevel:r,maxHeadingLevel:l}=e;function c(){const e=function(e){return Array.from(document.getElementsByClassName(e))}(a),c=function(e){let{minHeadingLevel:t,maxHeadingLevel:n}=e;const a=[];for(let o=t;o<=n;o+=1)a.push(`h${o}.anchor`);return Array.from(document.querySelectorAll(a.join()))}({minHeadingLevel:r,maxHeadingLevel:l}),s=G(c,{anchorTopOffset:n.current}),i=e.find((e=>s&&s.id===function(e){return decodeURIComponent(e.href.substring(e.href.indexOf("#")+1))}(e)));e.forEach((e=>{!function(e,n){n?(t.current&&t.current!==e&&t.current.classList.remove(o),e.classList.add(o),t.current=e):e.classList.remove(o)}(e,e===i)}))}return document.addEventListener("scroll",c),document.addEventListener("resize",c),c(),()=>{document.removeEventListener("scroll",c),document.removeEventListener("resize",c)}}),[e,n])}function Q(e){let{toc:t,className:n,linkClassName:o,isChild:r}=e;return t.length?a.createElement("ul",{className:r?void 0:n},t.map((e=>a.createElement("li",{key:e.id},a.createElement("a",{href:`#${e.id}`,className:o??void 0,dangerouslySetInnerHTML:{__html:e.value}}),a.createElement(Q,{isChild:!0,toc:e.children,className:n,linkClassName:o}))))):null}const X=a.memo(Q);function K(e){let{toc:t,className:n="table-of-contents table-of-contents__left-border",linkClassName:o="table-of-contents__link",linkActiveClassName:r,minHeadingLevel:l,maxHeadingLevel:c,...s}=e;const i=(0,W.L)(),d=l??i.tableOfContents.minHeadingLevel,m=c??i.tableOfContents.maxHeadingLevel,p=function(e){let{toc:t,minHeadingLevel:n,maxHeadingLevel:o}=e;return(0,a.useMemo)((()=>F({toc:$(t),minHeadingLevel:n,maxHeadingLevel:o})),[t,n,o])}({toc:t,minHeadingLevel:d,maxHeadingLevel:m});return J((0,a.useMemo)((()=>{if(o&&r)return{linkClassName:o,linkActiveClassName:r,minHeadingLevel:d,maxHeadingLevel:m}}),[o,r,d,m])),a.createElement(X,(0,u.Z)({toc:p,className:n,linkClassName:o},s))}const ee={tocCollapsibleButton:"tocCollapsibleButton_TO0P",tocCollapsibleButtonExpanded:"tocCollapsibleButtonExpanded_MG3E"};function te(e){let{collapsed:t,...n}=e;return a.createElement("button",(0,u.Z)({type:"button"},n,{className:(0,d.Z)("clean-btn",ee.tocCollapsibleButton,!t&&ee.tocCollapsibleButtonExpanded,n.className)}),a.createElement(p.Z,{id:"theme.TOCCollapsible.toggleButtonLabel",description:"The label used by the button on the collapsible TOC component"},"On this page"))}const ne={tocCollapsible:"tocCollapsible_ETCw",tocCollapsibleContent:"tocCollapsibleContent_vkbj",tocCollapsibleExpanded:"tocCollapsibleExpanded_sAul"};function ae(e){let{toc:t,className:n,minHeadingLevel:o,maxHeadingLevel:r}=e;const{collapsed:l,toggleCollapsed:c}=(0,R.u)({initialState:!0});return a.createElement("div",{className:(0,d.Z)(ne.tocCollapsible,!l&&ne.tocCollapsibleExpanded,n)},a.createElement(te,{collapsed:l,onClick:c}),a.createElement(R.z,{lazy:!0,className:ne.tocCollapsibleContent,collapsed:l},a.createElement(K,{toc:t,minHeadingLevel:o,maxHeadingLevel:r})))}const oe={tocMobile:"tocMobile_ITEo"};function re(){const{toc:e,frontMatter:t}=s();return a.createElement(ae,{toc:e,minHeadingLevel:t.toc_min_heading_level,maxHeadingLevel:t.toc_max_heading_level,className:(0,d.Z)(y.k.docs.docTocMobile,oe.tocMobile)})}const le={tableOfContents:"tableOfContents_bqdL",docItemContainer:"docItemContainer_F8PC"},ce="table-of-contents__link toc-highlight",se="table-of-contents__link--active";function ie(e){let{className:t,...n}=e;return a.createElement("div",{className:(0,d.Z)(le.tableOfContents,"thin-scrollbar",t)},a.createElement(K,(0,u.Z)({},n,{linkClassName:ce,linkActiveClassName:se})))}function de(){const{toc:e,frontMatter:t}=s();return a.createElement(ie,{toc:e,minHeadingLevel:t.toc_min_heading_level,maxHeadingLevel:t.toc_max_heading_level,className:y.k.docs.docTocDesktop})}const me={anchorWithStickyNavbar:"anchorWithStickyNavbar_LWe7",anchorWithHideOnScrollNavbar:"anchorWithHideOnScrollNavbar_WYt5"};function ue(e){let{as:t,id:n,...o}=e;const{navbar:{hideOnScroll:r}}=(0,W.L)();if("h1"===t||!n)return a.createElement(t,(0,u.Z)({},o,{id:void 0}));const l=(0,p.I)({id:"theme.common.headingLinkTitle",message:"Direct link to {heading}",description:"Title for link to heading"},{heading:"string"==typeof o.children?o.children:n});return a.createElement(t,(0,u.Z)({},o,{className:(0,d.Z)("anchor",r?me.anchorWithHideOnScrollNavbar:me.anchorWithStickyNavbar,o.className),id:n}),o.children,a.createElement(f.Z,{className:"hash-link",to:`#${n}`,"aria-label":l,title:l},"\u200b"))}var pe=n(3905),fe=n(5742);var he=n(2389),ge=n(2949);function be(){const{prism:e}=(0,W.L)(),{colorMode:t}=(0,ge.I)(),n=e.theme,a=e.darkTheme||n;return"dark"===t?a:n}var ve=n(7594),Ee=n.n(ve);const ye=/title=(?["'])(?.*?)\1/,ke=/\{(?<range>[\d,-]+)\}/,Ne={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}};function Ce(e,t){const n=e.map((e=>{const{start:n,end:a}=Ne[e];return`(?:${n}\\s*(${t.flatMap((e=>[e.line,e.block?.start,e.block?.end].filter(Boolean))).join("|")})\\s*${a})`})).join("|");return new RegExp(`^\\s*(?:${n})\\s*$`)}function Le(e,t){let n=e.replace(/\n$/,"");const{language:a,magicComments:o,metastring:r}=t;if(r&&ke.test(r)){const e=r.match(ke).groups.range;if(0===o.length)throw new Error(`A highlight range has been given in code block's metastring (\`\`\` ${r}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);const t=o[0].className,a=Ee()(e).filter((e=>e>0)).map((e=>[e-1,[t]]));return{lineClassNames:Object.fromEntries(a),code:n}}if(void 0===a)return{lineClassNames:{},code:n};const l=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return Ce(["js","jsBlock"],t);case"jsx":case"tsx":return Ce(["js","jsBlock","jsx"],t);case"html":return Ce(["js","jsBlock","html"],t);case"python":case"py":case"bash":return Ce(["bash"],t);case"markdown":case"md":return Ce(["html","jsx","bash"],t);default:return Ce(Object.keys(Ne),t)}}(a,o),c=n.split("\n"),s=Object.fromEntries(o.map((e=>[e.className,{start:0,range:""}]))),i=Object.fromEntries(o.filter((e=>e.line)).map((e=>{let{className:t,line:n}=e;return[n,t]}))),d=Object.fromEntries(o.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.start,t]}))),m=Object.fromEntries(o.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.end,t]})));for(let p=0;p<c.length;){const e=c[p].match(l);if(!e){p+=1;continue}const t=e.slice(1).find((e=>void 0!==e));i[t]?s[i[t]].range+=`${p},`:d[t]?s[d[t]].start=p:m[t]&&(s[m[t]].range+=`${s[m[t]].start}-${p-1},`),c.splice(p,1)}n=c.join("\n");const u={};return Object.entries(s).forEach((e=>{let[t,{range:n}]=e;Ee()(n).forEach((e=>{u[e]??=[],u[e].push(t)}))})),{lineClassNames:u,code:n}}const Te={codeBlockContainer:"codeBlockContainer_Ckt0"};function _e(e){let{as:t,...n}=e;const o=function(e){const t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={};return Object.entries(e.plain).forEach((e=>{let[a,o]=e;const r=t[a];r&&"string"==typeof o&&(n[r]=o)})),n}(be());return a.createElement(t,(0,u.Z)({},n,{style:o,className:(0,d.Z)(n.className,Te.codeBlockContainer,y.k.common.codeBlock)}))}const we={codeBlockContent:"codeBlockContent_biex",codeBlockTitle:"codeBlockTitle_Ktv7",codeBlock:"codeBlock_bY9V",codeBlockStandalone:"codeBlockStandalone_MEMb",codeBlockLines:"codeBlockLines_e6Vv",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_o6Pm",buttonGroup:"buttonGroup__atx"};function Ze(e){let{children:t,className:n}=e;return a.createElement(_e,{as:"pre",tabIndex:0,className:(0,d.Z)(we.codeBlockStandalone,"thin-scrollbar",n)},a.createElement("code",{className:we.codeBlockLines},t))}const xe={attributes:!0,characterData:!0,childList:!0,subtree:!0};function Be(e,t){const[n,o]=(0,a.useState)(),l=(0,a.useCallback)((()=>{o(e.current?.closest("[role=tabpanel][hidden]"))}),[e,o]);(0,a.useEffect)((()=>{l()}),[l]),function(e,t,n){void 0===n&&(n=xe);const o=(0,r.zX)(t),l=(0,r.Ql)(n);(0,a.useEffect)((()=>{const t=new MutationObserver(o);return e&&t.observe(e,l),()=>t.disconnect()}),[e,o,l])}(n,(e=>{e.forEach((e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(t(),l())}))}),{attributes:!0,characterData:!1,childList:!1,subtree:!1})}const Oe={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]};var He={Prism:n(1205).Z,theme:Oe};function Ae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function je(){return je=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},je.apply(this,arguments)}var Se=/\r\n|\r|\n/,Ie=function(e){0===e.length?e.push({types:["plain"],content:"\n",empty:!0}):1===e.length&&""===e[0].content&&(e[0].content="\n",e[0].empty=!0)},Me=function(e,t){var n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)};function Pe(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&-1===t.indexOf(a)&&(n[a]=e[a]);return n}var Ue=function(e){function t(){for(var t=this,n=[],a=arguments.length;a--;)n[a]=arguments[a];e.apply(this,n),Ae(this,"getThemeDict",(function(e){if(void 0!==t.themeDict&&e.theme===t.prevTheme&&e.language===t.prevLanguage)return t.themeDict;t.prevTheme=e.theme,t.prevLanguage=e.language;var n=e.theme?function(e,t){var n=e.plain,a=Object.create(null),o=e.styles.reduce((function(e,n){var a=n.languages,o=n.style;return a&&!a.includes(t)||n.types.forEach((function(t){var n=je({},e[t],o);e[t]=n})),e}),a);return o.root=n,o.plain=je({},n,{backgroundColor:null}),o}(e.theme,e.language):void 0;return t.themeDict=n})),Ae(this,"getLineProps",(function(e){var n=e.key,a=e.className,o=e.style,r=je({},Pe(e,["key","className","style","line"]),{className:"token-line",style:void 0,key:void 0}),l=t.getThemeDict(t.props);return void 0!==l&&(r.style=l.plain),void 0!==o&&(r.style=void 0!==r.style?je({},r.style,o):o),void 0!==n&&(r.key=n),a&&(r.className+=" "+a),r})),Ae(this,"getStyleForToken",(function(e){var n=e.types,a=e.empty,o=n.length,r=t.getThemeDict(t.props);if(void 0!==r){if(1===o&&"plain"===n[0])return a?{display:"inline-block"}:void 0;if(1===o&&!a)return r[n[0]];var l=a?{display:"inline-block"}:{},c=n.map((function(e){return r[e]}));return Object.assign.apply(Object,[l].concat(c))}})),Ae(this,"getTokenProps",(function(e){var n=e.key,a=e.className,o=e.style,r=e.token,l=je({},Pe(e,["key","className","style","token"]),{className:"token "+r.types.join(" "),children:r.content,style:t.getStyleForToken(r),key:void 0});return void 0!==o&&(l.style=void 0!==l.style?je({},l.style,o):o),void 0!==n&&(l.key=n),a&&(l.className+=" "+a),l})),Ae(this,"tokenize",(function(e,t,n,a){var o={code:t,grammar:n,language:a,tokens:[]};e.hooks.run("before-tokenize",o);var r=o.tokens=e.tokenize(o.code,o.grammar,o.language);return e.hooks.run("after-tokenize",o),r}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.render=function(){var e=this.props,t=e.Prism,n=e.language,a=e.code,o=e.children,r=this.getThemeDict(this.props),l=t.languages[n];return o({tokens:function(e){for(var t=[[]],n=[e],a=[0],o=[e.length],r=0,l=0,c=[],s=[c];l>-1;){for(;(r=a[l]++)<o[l];){var i=void 0,d=t[l],m=n[l][r];if("string"==typeof m?(d=l>0?d:["plain"],i=m):(d=Me(d,m.type),m.alias&&(d=Me(d,m.alias)),i=m.content),"string"==typeof i){var u=i.split(Se),p=u.length;c.push({types:d,content:u[0]});for(var f=1;f<p;f++)Ie(c),s.push(c=[]),c.push({types:d,content:u[f]})}else l++,t.push(d),n.push(i),a.push(0),o.push(i.length)}l--,t.pop(),n.pop(),a.pop(),o.pop()}return Ie(c),s}(void 0!==l?this.tokenize(t,a,l,n):[a]),className:"prism-code language-"+n,style:void 0!==r?r.root:{},getLineProps:this.getLineProps,getTokenProps:this.getTokenProps})},t}(a.Component);const ze=Ue,Ve={codeLine:"codeLine_lJS_",codeLineNumber:"codeLineNumber_Tfdd",codeLineContent:"codeLineContent_feaV"};function De(e){let{line:t,classNames:n,showLineNumbers:o,getLineProps:r,getTokenProps:l}=e;1===t.length&&"\n"===t[0].content&&(t[0].content="");const c=r({line:t,className:(0,d.Z)(n,o&&Ve.codeLine)}),s=t.map(((e,t)=>a.createElement("span",(0,u.Z)({key:t},l({token:e,key:t})))));return a.createElement("span",c,o?a.createElement(a.Fragment,null,a.createElement("span",{className:Ve.codeLineNumber}),a.createElement("span",{className:Ve.codeLineContent},s)):s,a.createElement("br",null))}function Re(e){return a.createElement("svg",(0,u.Z)({viewBox:"0 0 24 24"},e),a.createElement("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"}))}function We(e){return a.createElement("svg",(0,u.Z)({viewBox:"0 0 24 24"},e),a.createElement("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))}const $e={copyButtonCopied:"copyButtonCopied_obH4",copyButtonIcons:"copyButtonIcons_eSgA",copyButtonIcon:"copyButtonIcon_y97N",copyButtonSuccessIcon:"copyButtonSuccessIcon_LjdS"};function Fe(e){let{code:t,className:n}=e;const[o,r]=(0,a.useState)(!1),l=(0,a.useRef)(void 0),c=(0,a.useCallback)((()=>{!function(e,t){let{target:n=document.body}=void 0===t?{}:t;if("string"!=typeof e)throw new TypeError(`Expected parameter \`text\` to be a \`string\`, got \`${typeof e}\`.`);const a=document.createElement("textarea"),o=document.activeElement;a.value=e,a.setAttribute("readonly",""),a.style.contain="strict",a.style.position="absolute",a.style.left="-9999px",a.style.fontSize="12pt";const r=document.getSelection(),l=r.rangeCount>0&&r.getRangeAt(0);n.append(a),a.select(),a.selectionStart=0,a.selectionEnd=e.length;let c=!1;try{c=document.execCommand("copy")}catch{}a.remove(),l&&(r.removeAllRanges(),r.addRange(l)),o&&o.focus()}(t),r(!0),l.current=window.setTimeout((()=>{r(!1)}),1e3)}),[t]);return(0,a.useEffect)((()=>()=>window.clearTimeout(l.current)),[]),a.createElement("button",{type:"button","aria-label":o?(0,p.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,p.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,p.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,d.Z)("clean-btn",n,$e.copyButton,o&&$e.copyButtonCopied),onClick:c},a.createElement("span",{className:$e.copyButtonIcons,"aria-hidden":"true"},a.createElement(Re,{className:$e.copyButtonIcon}),a.createElement(We,{className:$e.copyButtonSuccessIcon})))}function qe(e){return a.createElement("svg",(0,u.Z)({viewBox:"0 0 24 24"},e),a.createElement("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"}))}const Ge={wordWrapButtonIcon:"wordWrapButtonIcon_Bwma",wordWrapButtonEnabled:"wordWrapButtonEnabled_EoeP"};function Ye(e){let{className:t,onClick:n,isEnabled:o}=e;const r=(0,p.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return a.createElement("button",{type:"button",onClick:n,className:(0,d.Z)("clean-btn",t,o&&Ge.wordWrapButtonEnabled),"aria-label":r,title:r},a.createElement(qe,{className:Ge.wordWrapButtonIcon,"aria-hidden":"true"}))}function Je(e){let{children:t,className:n="",metastring:o,title:r,showLineNumbers:l,language:c}=e;const{prism:{defaultLanguage:s,magicComments:i}}=(0,W.L)(),m=c??function(e){const t=e.split(" ").find((e=>e.startsWith("language-")));return t?.replace(/language-/,"")}(n)??s,p=be(),f=function(){const[e,t]=(0,a.useState)(!1),[n,o]=(0,a.useState)(!1),r=(0,a.useRef)(null),l=(0,a.useCallback)((()=>{const n=r.current.querySelector("code");e?n.removeAttribute("style"):(n.style.whiteSpace="pre-wrap",n.style.overflowWrap="anywhere"),t((e=>!e))}),[r,e]),c=(0,a.useCallback)((()=>{const{scrollWidth:e,clientWidth:t}=r.current,n=e>t||r.current.querySelector("code").hasAttribute("style");o(n)}),[r]);return Be(r,c),(0,a.useEffect)((()=>{c()}),[e,c]),(0,a.useEffect)((()=>(window.addEventListener("resize",c,{passive:!0}),()=>{window.removeEventListener("resize",c)})),[c]),{codeBlockRef:r,isEnabled:e,isCodeScrollable:n,toggle:l}}(),h=function(e){return e?.match(ye)?.groups.title??""}(o)||r,{lineClassNames:g,code:b}=Le(t,{metastring:o,language:m,magicComments:i}),v=l??function(e){return Boolean(e?.includes("showLineNumbers"))}(o);return a.createElement(_e,{as:"div",className:(0,d.Z)(n,m&&!n.includes(`language-${m}`)&&`language-${m}`)},h&&a.createElement("div",{className:we.codeBlockTitle},h),a.createElement("div",{className:we.codeBlockContent},a.createElement(ze,(0,u.Z)({},He,{theme:p,code:b,language:m??"text"}),(e=>{let{className:t,tokens:n,getLineProps:o,getTokenProps:r}=e;return a.createElement("pre",{tabIndex:0,ref:f.codeBlockRef,className:(0,d.Z)(t,we.codeBlock,"thin-scrollbar")},a.createElement("code",{className:(0,d.Z)(we.codeBlockLines,v&&we.codeBlockLinesWithNumbering)},n.map(((e,t)=>a.createElement(De,{key:t,line:e,getLineProps:o,getTokenProps:r,classNames:g[t],showLineNumbers:v})))))})),a.createElement("div",{className:we.buttonGroup},(f.isEnabled||f.isCodeScrollable)&&a.createElement(Ye,{className:we.codeButton,onClick:()=>f.toggle(),isEnabled:f.isEnabled}),a.createElement(Fe,{className:we.codeButton,code:b}))))}function Qe(e){let{children:t,...n}=e;const o=(0,he.Z)(),r=function(e){return a.Children.toArray(e).some((e=>(0,a.isValidElement)(e)))?e:Array.isArray(e)?e.join(""):e}(t),l="string"==typeof r?Je:Ze;return a.createElement(l,(0,u.Z)({key:String(o)},n),r)}const Xe={details:"details_lb9f",isBrowser:"isBrowser_bmU9",collapsibleContent:"collapsibleContent_i85q"};function Ke(e){return!!e&&("SUMMARY"===e.tagName||Ke(e.parentElement))}function et(e,t){return!!e&&(e===t||et(e.parentElement,t))}function tt(e){let{summary:t,children:n,...o}=e;const r=(0,he.Z)(),l=(0,a.useRef)(null),{collapsed:c,setCollapsed:s}=(0,R.u)({initialState:!o.open}),[i,m]=(0,a.useState)(o.open),p=a.isValidElement(t)?t:a.createElement("summary",null,t??"Details");return a.createElement("details",(0,u.Z)({},o,{ref:l,open:i,"data-collapsed":c,className:(0,d.Z)(Xe.details,r&&Xe.isBrowser,o.className),onMouseDown:e=>{Ke(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();const t=e.target;Ke(t)&&et(t,l.current)&&(e.preventDefault(),c?(s(!1),m(!0)):s(!0))}}),p,a.createElement(R.z,{lazy:!1,collapsed:c,disableSSRStyle:!0,onCollapseTransitionEnd:e=>{s(e),m(!e)}},a.createElement("div",{className:Xe.collapsibleContent},n)))}const nt={details:"details_b_Ee"},at="alert alert--info";function ot(e){let{...t}=e;return a.createElement(tt,(0,u.Z)({},t,{className:(0,d.Z)(at,nt.details,t.className)}))}function rt(e){return a.createElement(ue,e)}const lt={containsTaskList:"containsTaskList_mC6p"};function ct(e){if(void 0!==e)return(0,d.Z)(e,e?.includes("contains-task-list")&<.containsTaskList)}const st={img:"img_ev3q"};const it="admonition_LlT9",dt="admonitionHeading_tbUL",mt="admonitionIcon_kALy",ut="admonitionContent_S0QG";const pt={note:{infimaClassName:"secondary",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 14 16"},a.createElement("path",{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"}))},label:a.createElement(p.Z,{id:"theme.admonition.note",description:"The default label used for the Note admonition (:::note)"},"note")},tip:{infimaClassName:"success",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 12 16"},a.createElement("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"}))},label:a.createElement(p.Z,{id:"theme.admonition.tip",description:"The default label used for the Tip admonition (:::tip)"},"tip")},danger:{infimaClassName:"danger",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 12 16"},a.createElement("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"}))},label:a.createElement(p.Z,{id:"theme.admonition.danger",description:"The default label used for the Danger admonition (:::danger)"},"danger")},info:{infimaClassName:"info",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 14 16"},a.createElement("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"}))},label:a.createElement(p.Z,{id:"theme.admonition.info",description:"The default label used for the Info admonition (:::info)"},"info")},caution:{infimaClassName:"warning",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 16 16"},a.createElement("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"}))},label:a.createElement(p.Z,{id:"theme.admonition.caution",description:"The default label used for the Caution admonition (:::caution)"},"caution")}},ft={secondary:"note",important:"info",success:"tip",warning:"danger"};function ht(e){const{mdxAdmonitionTitle:t,rest:n}=function(e){const t=a.Children.toArray(e),n=t.find((e=>a.isValidElement(e)&&"mdxAdmonitionTitle"===e.props?.mdxType)),o=a.createElement(a.Fragment,null,t.filter((e=>e!==n)));return{mdxAdmonitionTitle:n,rest:o}}(e.children);return{...e,title:e.title??t,children:n}}const gt={head:function(e){const t=a.Children.map(e.children,(e=>a.isValidElement(e)?function(e){if(e.props?.mdxType&&e.props.originalType){const{mdxType:t,originalType:n,...o}=e.props;return a.createElement(e.props.originalType,o)}return e}(e):e));return a.createElement(fe.Z,e,t)},code:function(e){const t=["a","abbr","b","br","button","cite","code","del","dfn","em","i","img","input","ins","kbd","label","object","output","q","ruby","s","small","span","strong","sub","sup","time","u","var","wbr"];return a.Children.toArray(e.children).every((e=>"string"==typeof e&&!e.includes("\n")||(0,a.isValidElement)(e)&&t.includes(e.props?.mdxType)))?a.createElement("code",e):a.createElement(Qe,e)},a:function(e){return a.createElement(f.Z,e)},pre:function(e){return a.createElement(Qe,(0,a.isValidElement)(e.children)&&"code"===e.children.props?.originalType?e.children.props:{...e})},details:function(e){const t=a.Children.toArray(e.children),n=t.find((e=>a.isValidElement(e)&&"summary"===e.props?.mdxType)),o=a.createElement(a.Fragment,null,t.filter((e=>e!==n)));return a.createElement(ot,(0,u.Z)({},e,{summary:n}),o)},ul:function(e){return a.createElement("ul",(0,u.Z)({},e,{className:ct(e.className)}))},img:function(e){return a.createElement("img",(0,u.Z)({loading:"lazy"},e,{className:(t=e.className,(0,d.Z)(t,st.img))}));var t},h1:e=>a.createElement(rt,(0,u.Z)({as:"h1"},e)),h2:e=>a.createElement(rt,(0,u.Z)({as:"h2"},e)),h3:e=>a.createElement(rt,(0,u.Z)({as:"h3"},e)),h4:e=>a.createElement(rt,(0,u.Z)({as:"h4"},e)),h5:e=>a.createElement(rt,(0,u.Z)({as:"h5"},e)),h6:e=>a.createElement(rt,(0,u.Z)({as:"h6"},e)),admonition:function(e){const{children:t,type:n,title:o,icon:r}=ht(e),l=function(e){const t=ft[e]??e,n=pt[t];return n||(console.warn(`No admonition config found for admonition type "${t}". Using Info as fallback.`),pt.info)}(n),c=o??l.label,{iconComponent:s}=l,i=r??a.createElement(s,null);return a.createElement("div",{className:(0,d.Z)(y.k.common.admonition,y.k.common.admonitionType(e.type),"alert",`alert--${l.infimaClassName}`,it)},a.createElement("div",{className:dt},a.createElement("span",{className:mt},i),c),a.createElement("div",{className:ut},t))},mermaid:()=>null};function bt(e){let{children:t}=e;return a.createElement(pe.Zo,{components:gt},t)}function vt(e){let{children:t}=e;const n=function(){const{metadata:e,frontMatter:t,contentTitle:n}=s();return t.hide_title||void 0!==n?null:e.title}();return a.createElement("div",{className:(0,d.Z)(y.k.docs.docMarkdown,"markdown")},n&&a.createElement("header",null,a.createElement(ue,{as:"h1"},n)),a.createElement(bt,null,t))}var Et=n(3438),yt=n(8596),kt=n(4996);function Nt(e){return a.createElement("svg",(0,u.Z)({viewBox:"0 0 24 24"},e),a.createElement("path",{d:"M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z",fill:"currentColor"}))}const Ct={breadcrumbHomeIcon:"breadcrumbHomeIcon_YNFT"};function Lt(){const e=(0,kt.Z)("/");return a.createElement("li",{className:"breadcrumbs__item"},a.createElement(f.Z,{"aria-label":(0,p.I)({id:"theme.docs.breadcrumbs.home",message:"Home page",description:"The ARIA label for the home page in the breadcrumbs"}),className:"breadcrumbs__link",href:e},a.createElement(Nt,{className:Ct.breadcrumbHomeIcon})))}const Tt={breadcrumbsContainer:"breadcrumbsContainer_Z_bl"};function _t(e){let{children:t,href:n,isLast:o}=e;const r="breadcrumbs__link";return o?a.createElement("span",{className:r,itemProp:"name"},t):n?a.createElement(f.Z,{className:r,href:n,itemProp:"item"},a.createElement("span",{itemProp:"name"},t)):a.createElement("span",{className:r},t)}function wt(e){let{children:t,active:n,index:o,addMicrodata:r}=e;return a.createElement("li",(0,u.Z)({},r&&{itemScope:!0,itemProp:"itemListElement",itemType:"https://schema.org/ListItem"},{className:(0,d.Z)("breadcrumbs__item",{"breadcrumbs__item--active":n})}),t,a.createElement("meta",{itemProp:"position",content:String(o+1)}))}function Zt(){const e=(0,Et.s1)(),t=(0,yt.Ns)();return e?a.createElement("nav",{className:(0,d.Z)(y.k.docs.docBreadcrumbs,Tt.breadcrumbsContainer),"aria-label":(0,p.I)({id:"theme.docs.breadcrumbs.navAriaLabel",message:"Breadcrumbs",description:"The ARIA label for the breadcrumbs"})},a.createElement("ul",{className:"breadcrumbs",itemScope:!0,itemType:"https://schema.org/BreadcrumbList"},t&&a.createElement(Lt,null),e.map(((t,n)=>{const o=n===e.length-1;return a.createElement(wt,{key:n,active:o,index:n,addMicrodata:!!t.href},a.createElement(_t,{href:t.href,isLast:o},t.label))})))):null}const xt={docItemContainer:"docItemContainer_Djhp",docItemCol:"docItemCol_VOVn"};function Bt(e){let{children:t}=e;const n=function(){const{frontMatter:e,toc:t}=s(),n=(0,m.i)(),o=e.hide_table_of_contents,r=!o&&t.length>0;return{hidden:o,mobile:r?a.createElement(re,null):void 0,desktop:!r||"desktop"!==n&&"ssr"!==n?void 0:a.createElement(de,null)}}();return a.createElement("div",{className:"row"},a.createElement("div",{className:(0,d.Z)("col",!n.hidden&&xt.docItemCol)},a.createElement(w,null),a.createElement("div",{className:xt.docItemContainer},a.createElement("article",null,a.createElement(Zt,null),a.createElement(Z,null),n.mobile,a.createElement(vt,null,t),a.createElement(D,null)),a.createElement(b,null))),n.desktop&&a.createElement("div",{className:"col col--3"},n.desktop))}function Ot(e){const t=`docs-doc-id-${e.content.metadata.unversionedId}`,n=e.content;return a.createElement(c,{content:e.content},a.createElement(o.FG,{className:t},a.createElement(i,null),a.createElement(Bt,null,a.createElement(n,null))))}},4477:(e,t,n)=>{"use strict";n.d(t,{E:()=>c,q:()=>l});var a=n(7294),o=n(902);const r=a.createContext(null);function l(e){let{children:t,version:n}=e;return a.createElement(r.Provider,{value:n},t)}function c(){const e=(0,a.useContext)(r);if(null===e)throw new o.i6("DocsVersionProvider");return e}},7594:(e,t)=>{function n(e){let t,n=[];for(let a of e.split(",").map((e=>e.trim())))if(/^-?\d+$/.test(a))n.push(parseInt(a,10));else if(t=a.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){let[e,a,o,r]=t;if(a&&r){a=parseInt(a),r=parseInt(r);const e=a<r?1:-1;"-"!==o&&".."!==o&&"\u2025"!==o||(r+=e);for(let t=a;t!==r;t+=e)n.push(t)}}return n}t.default=n,e.exports=n}}]); \ No newline at end of file diff --git a/assets/js/17896441.e1ad11d7.js b/assets/js/17896441.e1ad11d7.js deleted file mode 100644 index e560cda..0000000 --- a/assets/js/17896441.e1ad11d7.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[7918],{3905:(e,t,n)=>{"use strict";n.d(t,{Zo:()=>d,kt:()=>p});var a=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},r=Object.keys(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=a.createContext({}),i=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},d=function(e){var t=i(e.components);return a.createElement(s.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},u=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,r=e.originalType,s=e.parentName,d=c(e,["components","mdxType","originalType","parentName"]),u=i(n),p=o,f=u["".concat(s,".").concat(p)]||u[p]||m[p]||r;return n?a.createElement(f,l(l({ref:t},d),{},{components:n})):a.createElement(f,l({ref:t},d))}));function p(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=n.length,l=new Array(r);l[0]=u;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c.mdxType="string"==typeof e?e:o,l[1]=c;for(var i=2;i<r;i++)l[i]=n[i];return a.createElement.apply(null,l)}return a.createElement.apply(null,n)}u.displayName="MDXCreateElement"},8246:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>Pt});var a=n(7294),o=n(833),r=n(902);const l=a.createContext(null);function c(e){let{children:t,content:n}=e;const o=function(e){return(0,a.useMemo)((()=>({metadata:e.metadata,frontMatter:e.frontMatter,assets:e.assets,contentTitle:e.contentTitle,toc:e.toc})),[e])}(n);return a.createElement(l.Provider,{value:o},t)}function s(){const e=(0,a.useContext)(l);if(null===e)throw new r.i6("DocProvider");return e}function i(){const{metadata:e,frontMatter:t,assets:n}=s();return a.createElement(o.d,{title:e.title,description:e.description,keywords:t.keywords,image:n.image??t.image})}var d=n(6010),m=n(7524),u=n(7462),p=n(5999),f=n(9960);function h(e){const{permalink:t,title:n,subLabel:o,isNext:r}=e;return a.createElement(f.Z,{className:(0,d.Z)("pagination-nav__link",r?"pagination-nav__link--next":"pagination-nav__link--prev"),to:t},o&&a.createElement("div",{className:"pagination-nav__sublabel"},o),a.createElement("div",{className:"pagination-nav__label"},n))}function g(e){const{previous:t,next:n}=e;return a.createElement("nav",{className:"pagination-nav docusaurus-mt-lg","aria-label":(0,p.I)({id:"theme.docs.paginator.navAriaLabel",message:"Docs pages navigation",description:"The ARIA label for the docs pagination"})},t&&a.createElement(h,(0,u.Z)({},t,{subLabel:a.createElement(p.Z,{id:"theme.docs.paginator.previous",description:"The label used to navigate to the previous doc"},"Previous")})),n&&a.createElement(h,(0,u.Z)({},n,{subLabel:a.createElement(p.Z,{id:"theme.docs.paginator.next",description:"The label used to navigate to the next doc"},"Next"),isNext:!0})))}function v(){const{metadata:e}=s();return a.createElement(g,{previous:e.previous,next:e.next})}var b=n(2263),E=n(143),y=n(5281),k=n(373),N=n(4477);const L={unreleased:function(e){let{siteTitle:t,versionMetadata:n}=e;return a.createElement(p.Z,{id:"theme.docs.versions.unreleasedVersionLabel",description:"The label used to tell the user that he's browsing an unreleased doc version",values:{siteTitle:t,versionLabel:a.createElement("b",null,n.label)}},"This is unreleased documentation for {siteTitle} {versionLabel} version.")},unmaintained:function(e){let{siteTitle:t,versionMetadata:n}=e;return a.createElement(p.Z,{id:"theme.docs.versions.unmaintainedVersionLabel",description:"The label used to tell the user that he's browsing an unmaintained doc version",values:{siteTitle:t,versionLabel:a.createElement("b",null,n.label)}},"This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained.")}};function C(e){const t=L[e.versionMetadata.banner];return a.createElement(t,e)}function T(e){let{versionLabel:t,to:n,onClick:o}=e;return a.createElement(p.Z,{id:"theme.docs.versions.latestVersionSuggestionLabel",description:"The label used to tell the user to check the latest version",values:{versionLabel:t,latestVersionLink:a.createElement("b",null,a.createElement(f.Z,{to:n,onClick:o},a.createElement(p.Z,{id:"theme.docs.versions.latestVersionLinkLabel",description:"The label used for the latest version suggestion link label"},"latest version")))}},"For up-to-date documentation, see the {latestVersionLink} ({versionLabel}).")}function _(e){let{className:t,versionMetadata:n}=e;const{siteConfig:{title:o}}=(0,b.Z)(),{pluginId:r}=(0,E.gA)({failfast:!0}),{savePreferredVersionName:l}=(0,k.J)(r),{latestDocSuggestion:c,latestVersionSuggestion:s}=(0,E.Jo)(r),i=c??(m=s).docs.find((e=>e.id===m.mainDocId));var m;return a.createElement("div",{className:(0,d.Z)(t,y.k.docs.docVersionBanner,"alert alert--warning margin-bottom--md"),role:"alert"},a.createElement("div",null,a.createElement(C,{siteTitle:o,versionMetadata:n})),a.createElement("div",{className:"margin-top--md"},a.createElement(T,{versionLabel:s.label,to:i.path,onClick:()=>l(s.name)})))}function w(e){let{className:t}=e;const n=(0,N.E)();return n.banner?a.createElement(_,{className:t,versionMetadata:n}):null}function Z(e){let{className:t}=e;const n=(0,N.E)();return n.badge?a.createElement("span",{className:(0,d.Z)(t,y.k.docs.docVersionBadge,"badge badge--secondary")},a.createElement(p.Z,{id:"theme.docs.versionBadge.label",values:{versionLabel:n.label}},"Version: {versionLabel}")):null}function x(e){let{lastUpdatedAt:t,formattedLastUpdatedAt:n}=e;return a.createElement(p.Z,{id:"theme.lastUpdated.atDate",description:"The words used to describe on which date a page has been last updated",values:{date:a.createElement("b",null,a.createElement("time",{dateTime:new Date(1e3*t).toISOString()},n))}}," on {date}")}function B(e){let{lastUpdatedBy:t}=e;return a.createElement(p.Z,{id:"theme.lastUpdated.byUser",description:"The words used to describe by who the page has been last updated",values:{user:a.createElement("b",null,t)}}," by {user}")}function O(e){let{lastUpdatedAt:t,formattedLastUpdatedAt:n,lastUpdatedBy:o}=e;return a.createElement("span",{className:y.k.common.lastUpdated},a.createElement(p.Z,{id:"theme.lastUpdated.lastUpdatedAtBy",description:"The sentence used to display when a page has been last updated, and by who",values:{atDate:t&&n?a.createElement(x,{lastUpdatedAt:t,formattedLastUpdatedAt:n}):"",byUser:o?a.createElement(B,{lastUpdatedBy:o}):""}},"Last updated{atDate}{byUser}"),!1)}const A="iconEdit_Z9Sw";function j(e){let{className:t,...n}=e;return a.createElement("svg",(0,u.Z)({fill:"currentColor",height:"20",width:"20",viewBox:"0 0 40 40",className:(0,d.Z)(A,t),"aria-hidden":"true"},n),a.createElement("g",null,a.createElement("path",{d:"m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"})))}function H(e){let{editUrl:t}=e;return a.createElement("a",{href:t,target:"_blank",rel:"noreferrer noopener",className:y.k.common.editThisPage},a.createElement(j,null),a.createElement(p.Z,{id:"theme.common.editThisPage",description:"The link label to edit the current page"},"Edit this page"))}const S="tag_zVej",M="tagRegular_sFm0",P="tagWithCount_h2kH";function I(e){let{permalink:t,label:n,count:o}=e;return a.createElement(f.Z,{href:t,className:(0,d.Z)(S,o?P:M)},n,o&&a.createElement("span",null,o))}const U="tags_jXut",z="tag_QGVx";function V(e){let{tags:t}=e;return a.createElement(a.Fragment,null,a.createElement("b",null,a.createElement(p.Z,{id:"theme.tags.tagsListLabel",description:"The label alongside a tag list"},"Tags:")),a.createElement("ul",{className:(0,d.Z)(U,"padding--none","margin-left--sm")},t.map((e=>{let{label:t,permalink:n}=e;return a.createElement("li",{key:n,className:z},a.createElement(I,{label:t,permalink:n}))}))))}const D="lastUpdated_vwxv";function R(e){return a.createElement("div",{className:(0,d.Z)(y.k.docs.docFooterTagsRow,"row margin-bottom--sm")},a.createElement("div",{className:"col"},a.createElement(V,e)))}function $(e){let{editUrl:t,lastUpdatedAt:n,lastUpdatedBy:o,formattedLastUpdatedAt:r}=e;return a.createElement("div",{className:(0,d.Z)(y.k.docs.docFooterEditMetaRow,"row")},a.createElement("div",{className:"col"},t&&a.createElement(H,{editUrl:t})),a.createElement("div",{className:(0,d.Z)("col",D)},(n||o)&&a.createElement(O,{lastUpdatedAt:n,formattedLastUpdatedAt:r,lastUpdatedBy:o})))}function W(){const{metadata:e}=s(),{editUrl:t,lastUpdatedAt:n,formattedLastUpdatedAt:o,lastUpdatedBy:r,tags:l}=e,c=l.length>0,i=!!(t||n||r);return c||i?a.createElement("footer",{className:(0,d.Z)(y.k.docs.docFooter,"docusaurus-mt-lg")},c&&a.createElement(R,{tags:l}),i&&a.createElement($,{editUrl:t,lastUpdatedAt:n,lastUpdatedBy:r,formattedLastUpdatedAt:o})):null}var F=n(6043),q=n(6668);function G(e){const t=e.map((e=>({...e,parentIndex:-1,children:[]}))),n=Array(7).fill(-1);t.forEach(((e,t)=>{const a=n.slice(2,e.level);e.parentIndex=Math.max(...a),n[e.level]=t}));const a=[];return t.forEach((e=>{const{parentIndex:n,...o}=e;n>=0?t[n].children.push(o):a.push(o)})),a}function Y(e){let{toc:t,minHeadingLevel:n,maxHeadingLevel:a}=e;return t.flatMap((e=>{const t=Y({toc:e.children,minHeadingLevel:n,maxHeadingLevel:a});return function(e){return e.level>=n&&e.level<=a}(e)?[{...e,children:t}]:t}))}function J(e){const t=e.getBoundingClientRect();return t.top===t.bottom?J(e.parentNode):t}function Q(e,t){let{anchorTopOffset:n}=t;const a=e.find((e=>J(e).top>=n));if(a){return function(e){return e.top>0&&e.bottom<window.innerHeight/2}(J(a))?a:e[e.indexOf(a)-1]??null}return e[e.length-1]??null}function X(){const e=(0,a.useRef)(0),{navbar:{hideOnScroll:t}}=(0,q.L)();return(0,a.useEffect)((()=>{e.current=t?0:document.querySelector(".navbar").clientHeight}),[t]),e}function K(e){const t=(0,a.useRef)(void 0),n=X();(0,a.useEffect)((()=>{if(!e)return()=>{};const{linkClassName:a,linkActiveClassName:o,minHeadingLevel:r,maxHeadingLevel:l}=e;function c(){const e=function(e){return Array.from(document.getElementsByClassName(e))}(a),c=function(e){let{minHeadingLevel:t,maxHeadingLevel:n}=e;const a=[];for(let o=t;o<=n;o+=1)a.push(`h${o}.anchor`);return Array.from(document.querySelectorAll(a.join()))}({minHeadingLevel:r,maxHeadingLevel:l}),s=Q(c,{anchorTopOffset:n.current}),i=e.find((e=>s&&s.id===function(e){return decodeURIComponent(e.href.substring(e.href.indexOf("#")+1))}(e)));e.forEach((e=>{!function(e,n){n?(t.current&&t.current!==e&&t.current.classList.remove(o),e.classList.add(o),t.current=e):e.classList.remove(o)}(e,e===i)}))}return document.addEventListener("scroll",c),document.addEventListener("resize",c),c(),()=>{document.removeEventListener("scroll",c),document.removeEventListener("resize",c)}}),[e,n])}function ee(e){let{toc:t,className:n,linkClassName:o,isChild:r}=e;return t.length?a.createElement("ul",{className:r?void 0:n},t.map((e=>a.createElement("li",{key:e.id},a.createElement("a",{href:`#${e.id}`,className:o??void 0,dangerouslySetInnerHTML:{__html:e.value}}),a.createElement(ee,{isChild:!0,toc:e.children,className:n,linkClassName:o}))))):null}const te=a.memo(ee);function ne(e){let{toc:t,className:n="table-of-contents table-of-contents__left-border",linkClassName:o="table-of-contents__link",linkActiveClassName:r,minHeadingLevel:l,maxHeadingLevel:c,...s}=e;const i=(0,q.L)(),d=l??i.tableOfContents.minHeadingLevel,m=c??i.tableOfContents.maxHeadingLevel,p=function(e){let{toc:t,minHeadingLevel:n,maxHeadingLevel:o}=e;return(0,a.useMemo)((()=>Y({toc:G(t),minHeadingLevel:n,maxHeadingLevel:o})),[t,n,o])}({toc:t,minHeadingLevel:d,maxHeadingLevel:m});return K((0,a.useMemo)((()=>{if(o&&r)return{linkClassName:o,linkActiveClassName:r,minHeadingLevel:d,maxHeadingLevel:m}}),[o,r,d,m])),a.createElement(te,(0,u.Z)({toc:p,className:n,linkClassName:o},s))}const ae="tocCollapsibleButton_TO0P",oe="tocCollapsibleButtonExpanded_MG3E";function re(e){let{collapsed:t,...n}=e;return a.createElement("button",(0,u.Z)({type:"button"},n,{className:(0,d.Z)("clean-btn",ae,!t&&oe,n.className)}),a.createElement(p.Z,{id:"theme.TOCCollapsible.toggleButtonLabel",description:"The label used by the button on the collapsible TOC component"},"On this page"))}const le="tocCollapsible_ETCw",ce="tocCollapsibleContent_vkbj",se="tocCollapsibleExpanded_sAul";function ie(e){let{toc:t,className:n,minHeadingLevel:o,maxHeadingLevel:r}=e;const{collapsed:l,toggleCollapsed:c}=(0,F.u)({initialState:!0});return a.createElement("div",{className:(0,d.Z)(le,!l&&se,n)},a.createElement(re,{collapsed:l,onClick:c}),a.createElement(F.z,{lazy:!0,className:ce,collapsed:l},a.createElement(ne,{toc:t,minHeadingLevel:o,maxHeadingLevel:r})))}const de="tocMobile_ITEo";function me(){const{toc:e,frontMatter:t}=s();return a.createElement(ie,{toc:e,minHeadingLevel:t.toc_min_heading_level,maxHeadingLevel:t.toc_max_heading_level,className:(0,d.Z)(y.k.docs.docTocMobile,de)})}const ue="tableOfContents_bqdL";function pe(e){let{className:t,...n}=e;return a.createElement("div",{className:(0,d.Z)(ue,"thin-scrollbar",t)},a.createElement(ne,(0,u.Z)({},n,{linkClassName:"table-of-contents__link toc-highlight",linkActiveClassName:"table-of-contents__link--active"})))}function fe(){const{toc:e,frontMatter:t}=s();return a.createElement(pe,{toc:e,minHeadingLevel:t.toc_min_heading_level,maxHeadingLevel:t.toc_max_heading_level,className:y.k.docs.docTocDesktop})}const he="anchorWithStickyNavbar_LWe7",ge="anchorWithHideOnScrollNavbar_WYt5";function ve(e){let{as:t,id:n,...o}=e;const{navbar:{hideOnScroll:r}}=(0,q.L)();if("h1"===t||!n)return a.createElement(t,(0,u.Z)({},o,{id:void 0}));const l=(0,p.I)({id:"theme.common.headingLinkTitle",message:"Direct link to {heading}",description:"Title for link to heading"},{heading:"string"==typeof o.children?o.children:n});return a.createElement(t,(0,u.Z)({},o,{className:(0,d.Z)("anchor",r?ge:he,o.className),id:n}),o.children,a.createElement(f.Z,{className:"hash-link",to:`#${n}`,"aria-label":l,title:l},"\u200b"))}var be=n(3905),Ee=n(5742);var ye=n(2389),ke=n(2949);function Ne(){const{prism:e}=(0,q.L)(),{colorMode:t}=(0,ke.I)(),n=e.theme,a=e.darkTheme||n;return"dark"===t?a:n}var Le=n(7594),Ce=n.n(Le);const Te=/title=(?<quote>["'])(?<title>.*?)\1/,_e=/\{(?<range>[\d,-]+)\}/,we={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}};function Ze(e,t){const n=e.map((e=>{const{start:n,end:a}=we[e];return`(?:${n}\\s*(${t.flatMap((e=>{var t,n;return[e.line,null==(t=e.block)?void 0:t.start,null==(n=e.block)?void 0:n.end].filter(Boolean)})).join("|")})\\s*${a})`})).join("|");return new RegExp(`^\\s*(?:${n})\\s*$`)}function xe(e,t){let n=e.replace(/\n$/,"");const{language:a,magicComments:o,metastring:r}=t;if(r&&_e.test(r)){const e=r.match(_e).groups.range;if(0===o.length)throw new Error(`A highlight range has been given in code block's metastring (\`\`\` ${r}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);const t=o[0].className,a=Ce()(e).filter((e=>e>0)).map((e=>[e-1,[t]]));return{lineClassNames:Object.fromEntries(a),code:n}}if(void 0===a)return{lineClassNames:{},code:n};const l=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return Ze(["js","jsBlock"],t);case"jsx":case"tsx":return Ze(["js","jsBlock","jsx"],t);case"html":return Ze(["js","jsBlock","html"],t);case"python":case"py":case"bash":return Ze(["bash"],t);case"markdown":case"md":return Ze(["html","jsx","bash"],t);default:return Ze(Object.keys(we),t)}}(a,o),c=n.split("\n"),s=Object.fromEntries(o.map((e=>[e.className,{start:0,range:""}]))),i=Object.fromEntries(o.filter((e=>e.line)).map((e=>{let{className:t,line:n}=e;return[n,t]}))),d=Object.fromEntries(o.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.start,t]}))),m=Object.fromEntries(o.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.end,t]})));for(let p=0;p<c.length;){const e=c[p].match(l);if(!e){p+=1;continue}const t=e.slice(1).find((e=>void 0!==e));i[t]?s[i[t]].range+=`${p},`:d[t]?s[d[t]].start=p:m[t]&&(s[m[t]].range+=`${s[m[t]].start}-${p-1},`),c.splice(p,1)}n=c.join("\n");const u={};return Object.entries(s).forEach((e=>{let[t,{range:n}]=e;Ce()(n).forEach((e=>{u[e]??=[],u[e].push(t)}))})),{lineClassNames:u,code:n}}const Be="codeBlockContainer_Ckt0";function Oe(e){let{as:t,...n}=e;const o=function(e){const t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={};return Object.entries(e.plain).forEach((e=>{let[a,o]=e;const r=t[a];r&&"string"==typeof o&&(n[r]=o)})),n}(Ne());return a.createElement(t,(0,u.Z)({},n,{style:o,className:(0,d.Z)(n.className,Be,y.k.common.codeBlock)}))}const Ae={codeBlockContent:"codeBlockContent_biex",codeBlockTitle:"codeBlockTitle_Ktv7",codeBlock:"codeBlock_bY9V",codeBlockStandalone:"codeBlockStandalone_MEMb",codeBlockLines:"codeBlockLines_e6Vv",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_o6Pm",buttonGroup:"buttonGroup__atx"};function je(e){let{children:t,className:n}=e;return a.createElement(Oe,{as:"pre",tabIndex:0,className:(0,d.Z)(Ae.codeBlockStandalone,"thin-scrollbar",n)},a.createElement("code",{className:Ae.codeBlockLines},t))}const He={attributes:!0,characterData:!0,childList:!0,subtree:!0};function Se(e,t){const[n,o]=(0,a.useState)(),l=(0,a.useCallback)((()=>{var t;o(null==(t=e.current)?void 0:t.closest("[role=tabpanel][hidden]"))}),[e,o]);(0,a.useEffect)((()=>{l()}),[l]),function(e,t,n){void 0===n&&(n=He);const o=(0,r.zX)(t),l=(0,r.Ql)(n);(0,a.useEffect)((()=>{const t=new MutationObserver(o);return e&&t.observe(e,l),()=>t.disconnect()}),[e,o,l])}(n,(e=>{e.forEach((e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(t(),l())}))}),{attributes:!0,characterData:!1,childList:!1,subtree:!1})}const Me={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]};var Pe={Prism:n(7410).Z,theme:Me};function Ie(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ue(){return Ue=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},Ue.apply(this,arguments)}var ze=/\r\n|\r|\n/,Ve=function(e){0===e.length?e.push({types:["plain"],content:"\n",empty:!0}):1===e.length&&""===e[0].content&&(e[0].content="\n",e[0].empty=!0)},De=function(e,t){var n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},Re=function(e,t){var n=e.plain,a=Object.create(null),o=e.styles.reduce((function(e,n){var a=n.languages,o=n.style;return a&&!a.includes(t)||n.types.forEach((function(t){var n=Ue({},e[t],o);e[t]=n})),e}),a);return o.root=n,o.plain=Ue({},n,{backgroundColor:null}),o};function $e(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&-1===t.indexOf(a)&&(n[a]=e[a]);return n}const We=function(e){function t(){for(var t=this,n=[],a=arguments.length;a--;)n[a]=arguments[a];e.apply(this,n),Ie(this,"getThemeDict",(function(e){if(void 0!==t.themeDict&&e.theme===t.prevTheme&&e.language===t.prevLanguage)return t.themeDict;t.prevTheme=e.theme,t.prevLanguage=e.language;var n=e.theme?Re(e.theme,e.language):void 0;return t.themeDict=n})),Ie(this,"getLineProps",(function(e){var n=e.key,a=e.className,o=e.style,r=Ue({},$e(e,["key","className","style","line"]),{className:"token-line",style:void 0,key:void 0}),l=t.getThemeDict(t.props);return void 0!==l&&(r.style=l.plain),void 0!==o&&(r.style=void 0!==r.style?Ue({},r.style,o):o),void 0!==n&&(r.key=n),a&&(r.className+=" "+a),r})),Ie(this,"getStyleForToken",(function(e){var n=e.types,a=e.empty,o=n.length,r=t.getThemeDict(t.props);if(void 0!==r){if(1===o&&"plain"===n[0])return a?{display:"inline-block"}:void 0;if(1===o&&!a)return r[n[0]];var l=a?{display:"inline-block"}:{},c=n.map((function(e){return r[e]}));return Object.assign.apply(Object,[l].concat(c))}})),Ie(this,"getTokenProps",(function(e){var n=e.key,a=e.className,o=e.style,r=e.token,l=Ue({},$e(e,["key","className","style","token"]),{className:"token "+r.types.join(" "),children:r.content,style:t.getStyleForToken(r),key:void 0});return void 0!==o&&(l.style=void 0!==l.style?Ue({},l.style,o):o),void 0!==n&&(l.key=n),a&&(l.className+=" "+a),l})),Ie(this,"tokenize",(function(e,t,n,a){var o={code:t,grammar:n,language:a,tokens:[]};e.hooks.run("before-tokenize",o);var r=o.tokens=e.tokenize(o.code,o.grammar,o.language);return e.hooks.run("after-tokenize",o),r}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.render=function(){var e=this.props,t=e.Prism,n=e.language,a=e.code,o=e.children,r=this.getThemeDict(this.props),l=t.languages[n];return o({tokens:function(e){for(var t=[[]],n=[e],a=[0],o=[e.length],r=0,l=0,c=[],s=[c];l>-1;){for(;(r=a[l]++)<o[l];){var i=void 0,d=t[l],m=n[l][r];if("string"==typeof m?(d=l>0?d:["plain"],i=m):(d=De(d,m.type),m.alias&&(d=De(d,m.alias)),i=m.content),"string"==typeof i){var u=i.split(ze),p=u.length;c.push({types:d,content:u[0]});for(var f=1;f<p;f++)Ve(c),s.push(c=[]),c.push({types:d,content:u[f]})}else l++,t.push(d),n.push(i),a.push(0),o.push(i.length)}l--,t.pop(),n.pop(),a.pop(),o.pop()}return Ve(c),s}(void 0!==l?this.tokenize(t,a,l,n):[a]),className:"prism-code language-"+n,style:void 0!==r?r.root:{},getLineProps:this.getLineProps,getTokenProps:this.getTokenProps})},t}(a.Component),Fe="codeLine_lJS_",qe="codeLineNumber_Tfdd",Ge="codeLineContent_feaV";function Ye(e){let{line:t,classNames:n,showLineNumbers:o,getLineProps:r,getTokenProps:l}=e;1===t.length&&"\n"===t[0].content&&(t[0].content="");const c=r({line:t,className:(0,d.Z)(n,o&&Fe)}),s=t.map(((e,t)=>a.createElement("span",(0,u.Z)({key:t},l({token:e,key:t})))));return a.createElement("span",c,o?a.createElement(a.Fragment,null,a.createElement("span",{className:qe}),a.createElement("span",{className:Ge},s)):s,a.createElement("br",null))}const Je={copyButtonCopied:"copyButtonCopied_obH4",copyButtonIcons:"copyButtonIcons_eSgA",copyButtonIcon:"copyButtonIcon_y97N",copyButtonSuccessIcon:"copyButtonSuccessIcon_LjdS"};function Qe(e){let{code:t,className:n}=e;const[o,r]=(0,a.useState)(!1),l=(0,a.useRef)(void 0),c=(0,a.useCallback)((()=>{!function(e,t){let{target:n=document.body}=void 0===t?{}:t;if("string"!=typeof e)throw new TypeError(`Expected parameter \`text\` to be a \`string\`, got \`${typeof e}\`.`);const a=document.createElement("textarea"),o=document.activeElement;a.value=e,a.setAttribute("readonly",""),a.style.contain="strict",a.style.position="absolute",a.style.left="-9999px",a.style.fontSize="12pt";const r=document.getSelection(),l=r.rangeCount>0&&r.getRangeAt(0);n.append(a),a.select(),a.selectionStart=0,a.selectionEnd=e.length;let c=!1;try{c=document.execCommand("copy")}catch{}a.remove(),l&&(r.removeAllRanges(),r.addRange(l)),o&&o.focus()}(t),r(!0),l.current=window.setTimeout((()=>{r(!1)}),1e3)}),[t]);return(0,a.useEffect)((()=>()=>window.clearTimeout(l.current)),[]),a.createElement("button",{type:"button","aria-label":o?(0,p.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,p.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,p.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,d.Z)("clean-btn",n,Je.copyButton,o&&Je.copyButtonCopied),onClick:c},a.createElement("span",{className:Je.copyButtonIcons,"aria-hidden":"true"},a.createElement("svg",{className:Je.copyButtonIcon,viewBox:"0 0 24 24"},a.createElement("path",{d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})),a.createElement("svg",{className:Je.copyButtonSuccessIcon,viewBox:"0 0 24 24"},a.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))))}const Xe="wordWrapButtonIcon_Bwma",Ke="wordWrapButtonEnabled_EoeP";function et(e){let{className:t,onClick:n,isEnabled:o}=e;const r=(0,p.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return a.createElement("button",{type:"button",onClick:n,className:(0,d.Z)("clean-btn",t,o&&Ke),"aria-label":r,title:r},a.createElement("svg",{className:Xe,viewBox:"0 0 24 24","aria-hidden":"true"},a.createElement("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})))}function tt(e){let{children:t,className:n="",metastring:o,title:r,showLineNumbers:l,language:c}=e;const{prism:{defaultLanguage:s,magicComments:i}}=(0,q.L)(),m=c??function(e){const t=e.split(" ").find((e=>e.startsWith("language-")));return null==t?void 0:t.replace(/language-/,"")}(n)??s,p=Ne(),f=function(){const[e,t]=(0,a.useState)(!1),[n,o]=(0,a.useState)(!1),r=(0,a.useRef)(null),l=(0,a.useCallback)((()=>{const n=r.current.querySelector("code");e?n.removeAttribute("style"):(n.style.whiteSpace="pre-wrap",n.style.overflowWrap="anywhere"),t((e=>!e))}),[r,e]),c=(0,a.useCallback)((()=>{const{scrollWidth:e,clientWidth:t}=r.current,n=e>t||r.current.querySelector("code").hasAttribute("style");o(n)}),[r]);return Se(r,c),(0,a.useEffect)((()=>{c()}),[e,c]),(0,a.useEffect)((()=>(window.addEventListener("resize",c,{passive:!0}),()=>{window.removeEventListener("resize",c)})),[c]),{codeBlockRef:r,isEnabled:e,isCodeScrollable:n,toggle:l}}(),h=function(e){var t;return(null==e||null==(t=e.match(Te))?void 0:t.groups.title)??""}(o)||r,{lineClassNames:g,code:v}=xe(t,{metastring:o,language:m,magicComments:i}),b=l??function(e){return Boolean(null==e?void 0:e.includes("showLineNumbers"))}(o);return a.createElement(Oe,{as:"div",className:(0,d.Z)(n,m&&!n.includes(`language-${m}`)&&`language-${m}`)},h&&a.createElement("div",{className:Ae.codeBlockTitle},h),a.createElement("div",{className:Ae.codeBlockContent},a.createElement(We,(0,u.Z)({},Pe,{theme:p,code:v,language:m??"text"}),(e=>{let{className:t,tokens:n,getLineProps:o,getTokenProps:r}=e;return a.createElement("pre",{tabIndex:0,ref:f.codeBlockRef,className:(0,d.Z)(t,Ae.codeBlock,"thin-scrollbar")},a.createElement("code",{className:(0,d.Z)(Ae.codeBlockLines,b&&Ae.codeBlockLinesWithNumbering)},n.map(((e,t)=>a.createElement(Ye,{key:t,line:e,getLineProps:o,getTokenProps:r,classNames:g[t],showLineNumbers:b})))))})),a.createElement("div",{className:Ae.buttonGroup},(f.isEnabled||f.isCodeScrollable)&&a.createElement(et,{className:Ae.codeButton,onClick:()=>f.toggle(),isEnabled:f.isEnabled}),a.createElement(Qe,{className:Ae.codeButton,code:v}))))}function nt(e){let{children:t,...n}=e;const o=(0,ye.Z)(),r=function(e){return a.Children.toArray(e).some((e=>(0,a.isValidElement)(e)))?e:Array.isArray(e)?e.join(""):e}(t),l="string"==typeof r?tt:je;return a.createElement(l,(0,u.Z)({key:String(o)},n),r)}const at="details_lb9f",ot="isBrowser_bmU9",rt="collapsibleContent_i85q";function lt(e){return!!e&&("SUMMARY"===e.tagName||lt(e.parentElement))}function ct(e,t){return!!e&&(e===t||ct(e.parentElement,t))}function st(e){let{summary:t,children:n,...o}=e;const r=(0,ye.Z)(),l=(0,a.useRef)(null),{collapsed:c,setCollapsed:s}=(0,F.u)({initialState:!o.open}),[i,m]=(0,a.useState)(o.open),p=a.isValidElement(t)?t:a.createElement("summary",null,t??"Details");return a.createElement("details",(0,u.Z)({},o,{ref:l,open:i,"data-collapsed":c,className:(0,d.Z)(at,r&&ot,o.className),onMouseDown:e=>{lt(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();const t=e.target;lt(t)&&ct(t,l.current)&&(e.preventDefault(),c?(s(!1),m(!0)):s(!0))}}),p,a.createElement(F.z,{lazy:!1,collapsed:c,disableSSRStyle:!0,onCollapseTransitionEnd:e=>{s(e),m(!e)}},a.createElement("div",{className:rt},n)))}const it="details_b_Ee";function dt(e){let{...t}=e;return a.createElement(st,(0,u.Z)({},t,{className:(0,d.Z)("alert alert--info",it,t.className)}))}function mt(e){return a.createElement(ve,e)}const ut="containsTaskList_mC6p";const pt="img_ev3q";const ft="admonition_LlT9",ht="admonitionHeading_tbUL",gt="admonitionIcon_kALy",vt="admonitionContent_S0QG";const bt={note:{infimaClassName:"secondary",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 14 16"},a.createElement("path",{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"}))},label:a.createElement(p.Z,{id:"theme.admonition.note",description:"The default label used for the Note admonition (:::note)"},"note")},tip:{infimaClassName:"success",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 12 16"},a.createElement("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"}))},label:a.createElement(p.Z,{id:"theme.admonition.tip",description:"The default label used for the Tip admonition (:::tip)"},"tip")},danger:{infimaClassName:"danger",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 12 16"},a.createElement("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"}))},label:a.createElement(p.Z,{id:"theme.admonition.danger",description:"The default label used for the Danger admonition (:::danger)"},"danger")},info:{infimaClassName:"info",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 14 16"},a.createElement("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"}))},label:a.createElement(p.Z,{id:"theme.admonition.info",description:"The default label used for the Info admonition (:::info)"},"info")},caution:{infimaClassName:"warning",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 16 16"},a.createElement("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"}))},label:a.createElement(p.Z,{id:"theme.admonition.caution",description:"The default label used for the Caution admonition (:::caution)"},"caution")}},Et={secondary:"note",important:"info",success:"tip",warning:"danger"};function yt(e){const{mdxAdmonitionTitle:t,rest:n}=function(e){const t=a.Children.toArray(e),n=t.find((e=>{var t;return a.isValidElement(e)&&"mdxAdmonitionTitle"===(null==(t=e.props)?void 0:t.mdxType)})),o=a.createElement(a.Fragment,null,t.filter((e=>e!==n)));return{mdxAdmonitionTitle:n,rest:o}}(e.children);return{...e,title:e.title??t,children:n}}const kt={head:function(e){const t=a.Children.map(e.children,(e=>a.isValidElement(e)?function(e){var t;if(null!=(t=e.props)&&t.mdxType&&e.props.originalType){const{mdxType:t,originalType:n,...o}=e.props;return a.createElement(e.props.originalType,o)}return e}(e):e));return a.createElement(Ee.Z,e,t)},code:function(e){const t=["a","abbr","b","br","button","cite","code","del","dfn","em","i","img","input","ins","kbd","label","object","output","q","ruby","s","small","span","strong","sub","sup","time","u","var","wbr"];return a.Children.toArray(e.children).every((e=>{var n;return"string"==typeof e&&!e.includes("\n")||(0,a.isValidElement)(e)&&t.includes(null==(n=e.props)?void 0:n.mdxType)}))?a.createElement("code",e):a.createElement(nt,e)},a:function(e){return a.createElement(f.Z,e)},pre:function(e){var t;return a.createElement(nt,(0,a.isValidElement)(e.children)&&"code"===(null==(t=e.children.props)?void 0:t.originalType)?e.children.props:{...e})},details:function(e){const t=a.Children.toArray(e.children),n=t.find((e=>{var t;return a.isValidElement(e)&&"summary"===(null==(t=e.props)?void 0:t.mdxType)})),o=a.createElement(a.Fragment,null,t.filter((e=>e!==n)));return a.createElement(dt,(0,u.Z)({},e,{summary:n}),o)},ul:function(e){return a.createElement("ul",(0,u.Z)({},e,{className:(t=e.className,(0,d.Z)(t,(null==t?void 0:t.includes("contains-task-list"))&&ut))}));var t},img:function(e){return a.createElement("img",(0,u.Z)({loading:"lazy"},e,{className:(t=e.className,(0,d.Z)(t,pt))}));var t},h1:e=>a.createElement(mt,(0,u.Z)({as:"h1"},e)),h2:e=>a.createElement(mt,(0,u.Z)({as:"h2"},e)),h3:e=>a.createElement(mt,(0,u.Z)({as:"h3"},e)),h4:e=>a.createElement(mt,(0,u.Z)({as:"h4"},e)),h5:e=>a.createElement(mt,(0,u.Z)({as:"h5"},e)),h6:e=>a.createElement(mt,(0,u.Z)({as:"h6"},e)),admonition:function(e){const{children:t,type:n,title:o,icon:r}=yt(e),l=function(e){const t=Et[e]??e;return bt[t]||(console.warn(`No admonition config found for admonition type "${t}". Using Info as fallback.`),bt.info)}(n),c=o??l.label,{iconComponent:s}=l,i=r??a.createElement(s,null);return a.createElement("div",{className:(0,d.Z)(y.k.common.admonition,y.k.common.admonitionType(e.type),"alert",`alert--${l.infimaClassName}`,ft)},a.createElement("div",{className:ht},a.createElement("span",{className:gt},i),c),a.createElement("div",{className:vt},t))},mermaid:()=>null};function Nt(e){let{children:t}=e;return a.createElement(be.Zo,{components:kt},t)}function Lt(e){let{children:t}=e;const n=function(){const{metadata:e,frontMatter:t,contentTitle:n}=s();return t.hide_title||void 0!==n?null:e.title}();return a.createElement("div",{className:(0,d.Z)(y.k.docs.docMarkdown,"markdown")},n&&a.createElement("header",null,a.createElement(ve,{as:"h1"},n)),a.createElement(Nt,null,t))}var Ct=n(3438),Tt=n(8596),_t=n(4996);function wt(e){return a.createElement("svg",(0,u.Z)({viewBox:"0 0 24 24"},e),a.createElement("path",{d:"M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z",fill:"currentColor"}))}const Zt="breadcrumbHomeIcon_YNFT";function xt(){const e=(0,_t.Z)("/");return a.createElement("li",{className:"breadcrumbs__item"},a.createElement(f.Z,{"aria-label":(0,p.I)({id:"theme.docs.breadcrumbs.home",message:"Home page",description:"The ARIA label for the home page in the breadcrumbs"}),className:"breadcrumbs__link",href:e},a.createElement(wt,{className:Zt})))}const Bt="breadcrumbsContainer_Z_bl";function Ot(e){let{children:t,href:n,isLast:o}=e;const r="breadcrumbs__link";return o?a.createElement("span",{className:r,itemProp:"name"},t):n?a.createElement(f.Z,{className:r,href:n,itemProp:"item"},a.createElement("span",{itemProp:"name"},t)):a.createElement("span",{className:r},t)}function At(e){let{children:t,active:n,index:o,addMicrodata:r}=e;return a.createElement("li",(0,u.Z)({},r&&{itemScope:!0,itemProp:"itemListElement",itemType:"https://schema.org/ListItem"},{className:(0,d.Z)("breadcrumbs__item",{"breadcrumbs__item--active":n})}),t,a.createElement("meta",{itemProp:"position",content:String(o+1)}))}function jt(){const e=(0,Ct.s1)(),t=(0,Tt.Ns)();return e?a.createElement("nav",{className:(0,d.Z)(y.k.docs.docBreadcrumbs,Bt),"aria-label":(0,p.I)({id:"theme.docs.breadcrumbs.navAriaLabel",message:"Breadcrumbs",description:"The ARIA label for the breadcrumbs"})},a.createElement("ul",{className:"breadcrumbs",itemScope:!0,itemType:"https://schema.org/BreadcrumbList"},t&&a.createElement(xt,null),e.map(((t,n)=>{const o=n===e.length-1;return a.createElement(At,{key:n,active:o,index:n,addMicrodata:!!t.href},a.createElement(Ot,{href:t.href,isLast:o},t.label))})))):null}const Ht="docItemContainer_Djhp",St="docItemCol_VOVn";function Mt(e){let{children:t}=e;const n=function(){const{frontMatter:e,toc:t}=s(),n=(0,m.i)(),o=e.hide_table_of_contents,r=!o&&t.length>0;return{hidden:o,mobile:r?a.createElement(me,null):void 0,desktop:!r||"desktop"!==n&&"ssr"!==n?void 0:a.createElement(fe,null)}}();return a.createElement("div",{className:"row"},a.createElement("div",{className:(0,d.Z)("col",!n.hidden&&St)},a.createElement(w,null),a.createElement("div",{className:Ht},a.createElement("article",null,a.createElement(jt,null),a.createElement(Z,null),n.mobile,a.createElement(Lt,null,t),a.createElement(W,null)),a.createElement(v,null))),n.desktop&&a.createElement("div",{className:"col col--3"},n.desktop))}function Pt(e){const t=`docs-doc-id-${e.content.metadata.unversionedId}`,n=e.content;return a.createElement(c,{content:e.content},a.createElement(o.FG,{className:t},a.createElement(i,null),a.createElement(Mt,null,a.createElement(n,null))))}},4477:(e,t,n)=>{"use strict";n.d(t,{E:()=>c,q:()=>l});var a=n(7294),o=n(902);const r=a.createContext(null);function l(e){let{children:t,version:n}=e;return a.createElement(r.Provider,{value:n},t)}function c(){const e=(0,a.useContext)(r);if(null===e)throw new o.i6("DocsVersionProvider");return e}},7594:(e,t)=>{function n(e){let t,n=[];for(let a of e.split(",").map((e=>e.trim())))if(/^-?\d+$/.test(a))n.push(parseInt(a,10));else if(t=a.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){let[e,a,o,r]=t;if(a&&r){a=parseInt(a),r=parseInt(r);const e=a<r?1:-1;"-"!==o&&".."!==o&&"\u2025"!==o||(r+=e);for(let t=a;t!==r;t+=e)n.push(t)}}return n}t.default=n,e.exports=n}}]); \ No newline at end of file diff --git a/assets/js/180.266d3c72.js b/assets/js/180.266d3c72.js new file mode 100644 index 0000000..c74d01c --- /dev/null +++ b/assets/js/180.266d3c72.js @@ -0,0 +1,1819 @@ +/*! For license information please see 180.266d3c72.js.LICENSE.txt */ +(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[180],{3905:(e,t,n)=>{"use strict";n.d(t,{Zo:()=>u,kt:()=>h});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var l=r.createContext({}),c=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):s(s({},t),e)),n},u=function(e){var t=c(e.components);return r.createElement(l.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,o=e.originalType,l=e.parentName,u=a(e,["components","mdxType","originalType","parentName"]),p=c(n),f=i,h=p["".concat(l,".").concat(f)]||p[f]||d[f]||o;return n?r.createElement(h,s(s({ref:t},u),{},{components:n})):r.createElement(h,s({ref:t},u))}));function h(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var o=n.length,s=new Array(o);s[0]=f;var a={};for(var l in t)hasOwnProperty.call(t,l)&&(a[l]=t[l]);a.originalType=e,a[p]="string"==typeof e?e:i,s[1]=a;for(var c=2;c<o;c++)s[c]=n[c];return r.createElement.apply(null,s)}return r.createElement.apply(null,n)}f.displayName="MDXCreateElement"},3675:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(t){o(t)}}function a(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.mapTypeToComponent=t.bundleDocument=t.bundleFromString=t.bundle=t.OasVersion=void 0;const i=n(2307),o=n(4182),s=n(8065),a=n(5220),l=n(9443),c=n(1510),u=n(7468),p=n(5030),d=n(348),f=n(771),h=n(1094),m=n(5351),g=n(4185);var y;function v(e){return r(this,void 0,void 0,(function*(){const{document:t,config:n,customTypes:r,externalRefResolver:i,dereference:u=!1,skipRedoclyRegistryRefs:d=!1,removeUnusedComponents:f=!1,keepUrlRefs:h=!1}=e,y=(0,c.detectSpec)(t.parsed),v=(0,c.getMajorSpecVersion)(y),b=n.getRulesForOasVersion(v),w=(0,a.normalizeTypes)(n.extendTypes(null!=r?r:(0,c.getTypes)(y),y),n),k=(0,p.initRules)(b,n,"preprocessors",y),O=(0,p.initRules)(b,n,"decorators",y),S={problems:[],oasVersion:y,refTypes:new Map,visitorsData:{}};f&&O.push({severity:"error",ruleId:"remove-unused-components",visitor:v===c.SpecMajorVersion.OAS2?(0,m.RemoveUnusedComponents)({}):(0,g.RemoveUnusedComponents)({})});let E=yield(0,o.resolveDocument)({rootDocument:t,rootType:w.Root,externalRefResolver:i});k.length>0&&((0,l.walkDocument)({document:t,rootType:w.Root,normalizedVisitors:(0,s.normalizeVisitors)(k,w),resolvedRefMap:E,ctx:S}),E=yield(0,o.resolveDocument)({rootDocument:t,rootType:w.Root,externalRefResolver:i}));const _=(0,s.normalizeVisitors)([{severity:"error",ruleId:"bundler",visitor:x(v,u,d,t,E,h)},...O],w);return(0,l.walkDocument)({document:t,rootType:w.Root,normalizedVisitors:_,resolvedRefMap:E,ctx:S}),{bundle:t,problems:S.problems.map((e=>n.addProblemToIgnore(e))),fileDependencies:i.getFiles(),rootType:w.Root,refTypes:S.refTypes,visitorsData:S.visitorsData}}))}function b(e,t){switch(t){case c.SpecMajorVersion.OAS3:switch(e){case"Schema":return"schemas";case"Parameter":return"parameters";case"Response":return"responses";case"Example":return"examples";case"RequestBody":return"requestBodies";case"Header":return"headers";case"SecuritySchema":return"securitySchemes";case"Link":return"links";case"Callback":return"callbacks";default:return null}case c.SpecMajorVersion.OAS2:switch(e){case"Schema":return"definitions";case"Parameter":return"parameters";case"Response":return"responses";default:return null}case c.SpecMajorVersion.Async2:switch(e){case"Schema":return"schemas";case"Parameter":return"parameters";default:return null}}}function x(e,t,n,r,s,a){let l,p;const m={ref:{leave(i,l,c){if(!c.location||void 0===c.node)return void(0,d.reportUnresolvedRef)(c,l.report,l.location);if(c.location.source===r.source&&c.location.source===l.location.source&&"scalar"!==l.type.name&&!t)return;if(n&&(0,h.isRedoclyRegistryURL)(i.$ref))return;if(a&&(0,u.isAbsoluteUrl)(i.$ref))return;const p=b(l.type.name,e);p?t?(y(p,c,l),g(i,c,l)):(i.$ref=y(p,c,l),function(e,t,n){const i=(0,o.makeRefId)(n.location.source.absoluteRef,e.$ref);s.set(i,{document:r,isRemote:!1,node:t.node,nodePointer:e.$ref,resolved:!0})}(i,c,l)):g(i,c,l)}},Root:{enter(t,n){p=n.location,e===c.SpecMajorVersion.OAS3?l=t.components=t.components||{}:e===c.SpecMajorVersion.OAS2&&(l=t)}}};function g(e,t,n){if((0,f.isPlainObject)(t.node)){delete e.$ref;const n=Object.assign({},t.node,e);Object.assign(e,n)}else n.parent[n.key]=t.node}function y(t,n,r){l[t]=l[t]||{};const i=function(e,t,n){const[r,i]=[e.location.source.absoluteRef,e.location.pointer],o=l[t];let s="";const a=i.slice(2).split("/").filter(f.isTruthy);for(;a.length>0;)if(s=a.pop()+(s?`-${s}`:""),!o||!o[s]||v(o[s],e,n))return s;if(s=(0,u.refBaseName)(r)+(s?`_${s}`:""),!o[s]||v(o[s],e,n))return s;const c=s;let p=2;for(;o[s]&&!v(o[s],e,n);)s=`${c}-${p}`,p++;o[s]||n.report({message:`Two schemas are referenced with the same name but different content. Renamed ${c} to ${s}.`,location:n.location,forceSeverity:"warn"});return s}(n,t,r);return l[t][i]=n.node,e===c.SpecMajorVersion.OAS3?`#/components/${t}/${i}`:`#/${t}/${i}`}function v(e,t,n){var r;return!(!(0,u.isRef)(e)||(null===(r=n.resolve(e,p.absolutePointer).location)||void 0===r?void 0:r.absolutePointer)!==t.location.absolutePointer)||i(e,t.node)}return e===c.SpecMajorVersion.OAS3&&(m.DiscriminatorMapping={leave(n,r){for(const i of Object.keys(n)){const o=n[i],s=r.resolve({$ref:o});if(!s.location||void 0===s.node)return void(0,d.reportUnresolvedRef)(s,r.report,r.location.child(i));const a=b("Schema",e);t?y(a,s,r):n[i]=y(a,s,r)}}}),m}!function(e){e.Version2="oas2",e.Version3_0="oas3_0",e.Version3_1="oas3_1"}(y||(t.OasVersion=y={})),t.bundle=function(e){return r(this,void 0,void 0,(function*(){const{ref:t,doc:n,externalRefResolver:r=new o.BaseResolver(e.config.resolve),base:i=null}=e;if(!t&&!n)throw new Error("Document or reference is required.\n");const s=void 0===n?yield r.resolveDocument(i,t,!0):n;if(s instanceof Error)throw s;return v(Object.assign(Object.assign({document:s},e),{config:e.config.styleguide,externalRefResolver:r}))}))},t.bundleFromString=function(e){return r(this,void 0,void 0,(function*(){const{source:t,absoluteRef:n,externalRefResolver:r=new o.BaseResolver(e.config.resolve)}=e,i=(0,o.makeDocumentFromString)(t,n||"/");return v(Object.assign(Object.assign({document:i},e),{externalRefResolver:r,config:e.config.styleguide}))}))},t.bundleDocument=v,t.mapTypeToComponent=b},3777:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Config=t.StyleguideConfig=t.AVAILABLE_REGIONS=t.DOMAINS=t.DEFAULT_REGION=t.IGNORE_FILE=void 0;const r=n(5101),i=n(6470),o=n(5273),s=n(771),a=n(1510),l=n(8005),c=n(2565),u=n(7468);t.IGNORE_FILE=".redocly.lint-ignore.yaml";t.DEFAULT_REGION="us",t.DOMAINS=function(){const e={us:"redocly.com",eu:"eu.redocly.com"},t=l.env.REDOCLY_DOMAIN;return(null==t?void 0:t.endsWith(".redocly.host"))&&(e[t.split(".")[0]]=t),"redoc.online"===t&&(e[t]=t),e}(),t.AVAILABLE_REGIONS=Object.keys(t.DOMAINS);class p{constructor(e,n){this.rawConfig=e,this.configFile=n,this.ignore={},this._usedRules=new Set,this._usedVersions=new Set,this.plugins=e.plugins||[],this.doNotResolveExamples=!!e.doNotResolveExamples,this.recommendedFallback=e.recommendedFallback||!1,this.rules={[a.SpecVersion.OAS2]:Object.assign(Object.assign({},e.rules),e.oas2Rules),[a.SpecVersion.OAS3_0]:Object.assign(Object.assign({},e.rules),e.oas3_0Rules),[a.SpecVersion.OAS3_1]:Object.assign(Object.assign({},e.rules),e.oas3_1Rules),[a.SpecVersion.Async2]:Object.assign(Object.assign({},e.rules),e.async2Rules)},this.preprocessors={[a.SpecVersion.OAS2]:Object.assign(Object.assign({},e.preprocessors),e.oas2Preprocessors),[a.SpecVersion.OAS3_0]:Object.assign(Object.assign({},e.preprocessors),e.oas3_0Preprocessors),[a.SpecVersion.OAS3_1]:Object.assign(Object.assign({},e.preprocessors),e.oas3_1Preprocessors),[a.SpecVersion.Async2]:Object.assign(Object.assign({},e.preprocessors),e.async2Preprocessors)},this.decorators={[a.SpecVersion.OAS2]:Object.assign(Object.assign({},e.decorators),e.oas2Decorators),[a.SpecVersion.OAS3_0]:Object.assign(Object.assign({},e.decorators),e.oas3_0Decorators),[a.SpecVersion.OAS3_1]:Object.assign(Object.assign({},e.decorators),e.oas3_1Decorators),[a.SpecVersion.Async2]:Object.assign(Object.assign({},e.decorators),e.async2Decorators)},this.extendPaths=e.extendPaths||[],this.pluginPaths=e.pluginPaths||[],this.resolveIgnore(function(e){return e?(0,s.doesYamlFileExist)(e)?i.join(i.dirname(e),t.IGNORE_FILE):i.join(e,t.IGNORE_FILE):l.isBrowser?void 0:i.join(process.cwd(),t.IGNORE_FILE)}(n))}resolveIgnore(e){if(e&&(0,s.doesYamlFileExist)(e)){this.ignore=(0,o.parseYaml)(r.readFileSync(e,"utf-8"))||{};for(const t of Object.keys(this.ignore)){this.ignore[(0,u.isAbsoluteUrl)(t)?t:i.resolve(i.dirname(e),t)]=this.ignore[t];for(const e of Object.keys(this.ignore[t]))this.ignore[t][e]=new Set(this.ignore[t][e]);(0,u.isAbsoluteUrl)(t)||delete this.ignore[t]}}}saveIgnore(){const e=this.configFile?i.dirname(this.configFile):process.cwd(),n=i.join(e,t.IGNORE_FILE),a={};for(const t of Object.keys(this.ignore)){const n=a[(0,u.isAbsoluteUrl)(t)?t:(0,s.slash)(i.relative(e,t))]=this.ignore[t];for(const e of Object.keys(n))n[e]=Array.from(n[e])}r.writeFileSync(n,"# This file instructs Redocly's linter to ignore the rules contained for specific parts of your API.\n# See https://redoc.ly/docs/cli/ for more information.\n"+(0,o.stringifyYaml)(a))}addIgnore(e){const t=this.ignore,n=e.location[0];if(void 0===n.pointer)return;const r=t[n.source.absoluteRef]=t[n.source.absoluteRef]||{};(r[e.ruleId]=r[e.ruleId]||new Set).add(n.pointer)}addProblemToIgnore(e){const t=e.location[0];if(void 0===t.pointer)return e;const n=(this.ignore[t.source.absoluteRef]||{})[e.ruleId],r=n&&n.has(t.pointer);return r?Object.assign(Object.assign({},e),{ignored:r}):e}extendTypes(e,t){let n=e;for(const r of this.plugins)if(void 0!==r.typeExtension)switch(t){case a.SpecVersion.OAS3_0:case a.SpecVersion.OAS3_1:if(!r.typeExtension.oas3)continue;n=r.typeExtension.oas3(n,t);break;case a.SpecVersion.OAS2:if(!r.typeExtension.oas2)continue;n=r.typeExtension.oas2(n,t);break;case a.SpecVersion.Async2:if(!r.typeExtension.async2)continue;n=r.typeExtension.async2(n,t);break;default:throw new Error("Not implemented")}return n}getRuleSettings(e,t){this._usedRules.add(e),this._usedVersions.add(t);const n=this.rules[t][e]||"off";return"string"==typeof n?{severity:n}:Object.assign({severity:"error"},n)}getPreprocessorSettings(e,t){this._usedRules.add(e),this._usedVersions.add(t);const n=this.preprocessors[t][e]||"off";return"string"==typeof n?{severity:"on"===n?"error":n}:Object.assign({severity:"error"},n)}getDecoratorSettings(e,t){this._usedRules.add(e),this._usedVersions.add(t);const n=this.decorators[t][e]||"off";return"string"==typeof n?{severity:"on"===n?"error":n}:Object.assign({severity:"error"},n)}getUnusedRules(){const e=[],t=[],n=[];for(const r of Array.from(this._usedVersions))e.push(...Object.keys(this.rules[r]).filter((e=>!this._usedRules.has(e)))),t.push(...Object.keys(this.decorators[r]).filter((e=>!this._usedRules.has(e)))),n.push(...Object.keys(this.preprocessors[r]).filter((e=>!this._usedRules.has(e))));return{rules:e,preprocessors:n,decorators:t}}getRulesForOasVersion(e){switch(e){case a.SpecMajorVersion.OAS3:const e=[];return this.plugins.forEach((t=>{var n;return(null===(n=t.preprocessors)||void 0===n?void 0:n.oas3)&&e.push(t.preprocessors.oas3)})),this.plugins.forEach((t=>{var n;return(null===(n=t.rules)||void 0===n?void 0:n.oas3)&&e.push(t.rules.oas3)})),this.plugins.forEach((t=>{var n;return(null===(n=t.decorators)||void 0===n?void 0:n.oas3)&&e.push(t.decorators.oas3)})),e;case a.SpecMajorVersion.OAS2:const t=[];return this.plugins.forEach((e=>{var n;return(null===(n=e.preprocessors)||void 0===n?void 0:n.oas2)&&t.push(e.preprocessors.oas2)})),this.plugins.forEach((e=>{var n;return(null===(n=e.rules)||void 0===n?void 0:n.oas2)&&t.push(e.rules.oas2)})),this.plugins.forEach((e=>{var n;return(null===(n=e.decorators)||void 0===n?void 0:n.oas2)&&t.push(e.decorators.oas2)})),t;case a.SpecMajorVersion.Async2:const n=[];return this.plugins.forEach((e=>{var t;return(null===(t=e.preprocessors)||void 0===t?void 0:t.async2)&&n.push(e.preprocessors.async2)})),this.plugins.forEach((e=>{var t;return(null===(t=e.rules)||void 0===t?void 0:t.async2)&&n.push(e.rules.async2)})),this.plugins.forEach((e=>{var t;return(null===(t=e.decorators)||void 0===t?void 0:t.async2)&&n.push(e.decorators.async2)})),n}}skipRules(e){for(const t of e||[])for(const e of Object.values(a.SpecVersion))this.rules[e][t]&&(this.rules[e][t]="off")}skipPreprocessors(e){for(const t of e||[])for(const e of Object.values(a.SpecVersion))this.preprocessors[e][t]&&(this.preprocessors[e][t]="off")}skipDecorators(e){for(const t of e||[])for(const e of Object.values(a.SpecVersion))this.decorators[e][t]&&(this.decorators[e][t]="off")}}t.StyleguideConfig=p;t.Config=class{constructor(e,t){this.rawConfig=e,this.configFile=t,this.apis=e.apis||{},this.styleguide=new p(e.styleguide||{},t),this.theme=e.theme||{},this.resolve=(0,c.getResolveConfig)(null==e?void 0:e.resolve),this.region=e.region,this.organization=e.organization,this.files=e.files||[],this.telemetry=e.telemetry}}},5030:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initRules=void 0;const r=n(771);t.initRules=function(e,t,n,i){return e.flatMap((e=>Object.keys(e).map((r=>{const o=e[r],s="rules"===n?t.getRuleSettings(r,i):"preprocessors"===n?t.getPreprocessorSettings(r,i):t.getDecoratorSettings(r,i);if("off"===s.severity)return;const a=s.severity,l=o(s);return Array.isArray(l)?l.map((e=>({severity:a,ruleId:r,visitor:e}))):{severity:a,ruleId:r,visitor:l}})))).flatMap((e=>e)).filter(r.isDefined)}},2565:function(e,t,n){"use strict";var r=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigValidationError=t.getUniquePlugins=t.getResolveConfig=t.transformConfig=t.checkForDeprecatedFields=t.getMergedConfig=t.mergeExtends=t.prefixRules=t.transformApiDefinitionsToApis=t.parsePresetName=void 0;const i=n(771),o=n(3777),s=n(3065);function a(e){if(!e)return;const t={};for(const[n,r]of Object.entries(e))t[n]={root:r};return t}function l(e){var t,{plugins:n,extends:o,rules:s,oas2Rules:a,oas3_0Rules:l,oas3_1Rules:c,async2Rules:u,preprocessors:p,oas2Preprocessors:d,oas3_0Preprocessors:f,oas3_1Preprocessors:h,async2Preprocessors:m,decorators:g,oas2Decorators:y,oas3_0Decorators:v,oas3_1Decorators:b,async2Decorators:x}=e,w=r(e,["plugins","extends","rules","oas2Rules","oas3_0Rules","oas3_1Rules","async2Rules","preprocessors","oas2Preprocessors","oas3_0Preprocessors","oas3_1Preprocessors","async2Preprocessors","decorators","oas2Decorators","oas3_0Decorators","oas3_1Decorators","async2Decorators"]);const k={plugins:n,extends:o,rules:s,oas2Rules:a,oas3_0Rules:l,oas3_1Rules:c,async2Rules:u,preprocessors:p,oas2Preprocessors:d,oas3_0Preprocessors:f,oas3_1Preprocessors:h,async2Preprocessors:m,decorators:g,oas2Decorators:y,oas3_0Decorators:v,oas3_1Decorators:b,async2Decorators:x,doNotResolveExamples:null===(t=w.resolve)||void 0===t?void 0:t.doNotResolveExamples};if(w.lint&&w.styleguide||Object.values(k).some(i.isDefined)&&(w.lint||w.styleguide))throw new Error("Do not use 'lint', 'styleguide' and flat syntax together. \nSee more about the configuration in the docs: https://redocly.com/docs/cli/configuration/ \n");return{styleguideConfig:Object.values(k).some(i.isDefined)?k:void 0,rawConfigRest:w}}function c(e){if(!e)return;const t={};for(let n of Object.entries(e)){const[e,i]=n,{lint:o}=i,s=r(i,["lint"]),{styleguideConfig:a,rawConfigRest:c}=l(s);t[e]=Object.assign({styleguide:a||o},c)}return t}function u(e,t,n,r){const o=n.apis&&Object.values(n.apis).some((t=>t[e]));n[e]&&null===t&&(0,i.showWarningForDeprecatedField)(e),n[e]&&t&&n[t]&&(0,i.showErrorForDeprecatedField)(e,t),n[e]&&r&&n[r]&&(0,i.showErrorForDeprecatedField)(e,t,r),(n[e]||o)&&(0,i.showWarningForDeprecatedField)(e,t,r)}t.parsePresetName=function(e){if(e.indexOf("/")>-1){const[t,n]=e.split("/");return{pluginId:t,configName:n}}return{pluginId:"",configName:e}},t.transformApiDefinitionsToApis=a,t.prefixRules=function(e,t){if(!t)return e;const n={};for(const r of Object.keys(e))n[`${t}/${r}`]=e[r];return n},t.mergeExtends=function(e){const t={rules:{},oas2Rules:{},oas3_0Rules:{},oas3_1Rules:{},async2Rules:{},preprocessors:{},oas2Preprocessors:{},oas3_0Preprocessors:{},oas3_1Preprocessors:{},async2Preprocessors:{},decorators:{},oas2Decorators:{},oas3_0Decorators:{},oas3_1Decorators:{},async2Decorators:{},plugins:[],pluginPaths:[],extendPaths:[]};for(const n of e){if(n.extends)throw new Error(`'extends' is not supported in shared configs yet: ${JSON.stringify(n,null,2)}.`);Object.assign(t.rules,n.rules),Object.assign(t.oas2Rules,n.oas2Rules),(0,i.assignExisting)(t.oas2Rules,n.rules||{}),Object.assign(t.oas3_0Rules,n.oas3_0Rules),(0,i.assignExisting)(t.oas3_0Rules,n.rules||{}),Object.assign(t.oas3_1Rules,n.oas3_1Rules),(0,i.assignExisting)(t.oas3_1Rules,n.rules||{}),Object.assign(t.async2Rules,n.async2Rules),(0,i.assignExisting)(t.async2Rules,n.rules||{}),Object.assign(t.preprocessors,n.preprocessors),Object.assign(t.oas2Preprocessors,n.oas2Preprocessors),(0,i.assignExisting)(t.oas2Preprocessors,n.preprocessors||{}),Object.assign(t.oas3_0Preprocessors,n.oas3_0Preprocessors),(0,i.assignExisting)(t.oas3_0Preprocessors,n.preprocessors||{}),Object.assign(t.oas3_1Preprocessors,n.oas3_1Preprocessors),(0,i.assignExisting)(t.oas3_1Preprocessors,n.preprocessors||{}),Object.assign(t.async2Preprocessors,n.async2Preprocessors),(0,i.assignExisting)(t.async2Preprocessors,n.preprocessors||{}),Object.assign(t.decorators,n.decorators),Object.assign(t.oas2Decorators,n.oas2Decorators),(0,i.assignExisting)(t.oas2Decorators,n.decorators||{}),Object.assign(t.oas3_0Decorators,n.oas3_0Decorators),(0,i.assignExisting)(t.oas3_0Decorators,n.decorators||{}),Object.assign(t.oas3_1Decorators,n.oas3_1Decorators),(0,i.assignExisting)(t.oas3_1Decorators,n.decorators||{}),Object.assign(t.async2Decorators,n.async2Decorators),(0,i.assignExisting)(t.async2Decorators,n.decorators||{}),t.plugins.push(...n.plugins||[]),t.pluginPaths.push(...n.pluginPaths||[]),t.extendPaths.push(...new Set(n.extendPaths))}return t},t.getMergedConfig=function(e,t){var n,r,s,a,l,c,u,p;const d=[...Object.values(e.apis).map((e=>{var t;return null===(t=null==e?void 0:e.styleguide)||void 0===t?void 0:t.extendPaths})),null===(r=null===(n=e.rawConfig)||void 0===n?void 0:n.styleguide)||void 0===r?void 0:r.extendPaths].flat().filter(i.isTruthy),f=[...Object.values(e.apis).map((e=>{var t;return null===(t=null==e?void 0:e.styleguide)||void 0===t?void 0:t.pluginPaths})),null===(a=null===(s=e.rawConfig)||void 0===s?void 0:s.styleguide)||void 0===a?void 0:a.pluginPaths].flat().filter(i.isTruthy);return t?new o.Config(Object.assign(Object.assign({},e.rawConfig),{styleguide:Object.assign(Object.assign({},e.apis[t]?e.apis[t].styleguide:e.rawConfig.styleguide),{extendPaths:d,pluginPaths:f}),theme:Object.assign(Object.assign({},e.rawConfig.theme),null===(l=e.apis[t])||void 0===l?void 0:l.theme),files:[...e.files,...null!==(p=null===(u=null===(c=e.apis)||void 0===c?void 0:c[t])||void 0===u?void 0:u.files)&&void 0!==p?p:[]]}),e.configFile):e},t.checkForDeprecatedFields=u,t.transformConfig=function(e){var t,n;const i=[["apiDefinitions","apis",void 0],["referenceDocs","openapi","theme"],["lint",void 0,void 0],["styleguide",void 0,void 0],["features.openapi","openapi","theme"]];for(const[r,s,a]of i)u(r,s,e,a);const{apis:o,apiDefinitions:p,referenceDocs:d,lint:f}=e,h=r(e,["apis","apiDefinitions","referenceDocs","lint"]),{styleguideConfig:m,rawConfigRest:g}=l(h),y=Object.assign({theme:{openapi:Object.assign(Object.assign(Object.assign({},d),e["features.openapi"]),null===(t=e.theme)||void 0===t?void 0:t.openapi),mockServer:Object.assign(Object.assign({},e["features.mockServer"]),null===(n=e.theme)||void 0===n?void 0:n.mockServer)},apis:c(o)||a(p),styleguide:m||f},g);return function(e){var t,n;let r=Object.assign({},null===(t=e.styleguide)||void 0===t?void 0:t.rules);for(const i of Object.values(e.apis||{}))r=Object.assign(Object.assign({},r),null===(n=null==i?void 0:i.styleguide)||void 0===n?void 0:n.rules);for(const i of Object.keys(r))i.startsWith("assert/")&&s.logger.warn(`\nThe 'assert/' syntax in ${i} is deprecated. Update your configuration to use 'rule/' instead. Examples and more information: https://redocly.com/docs/cli/rules/configurable-rules/\n`)}(y),y},t.getResolveConfig=function(e){var t,n;return{http:{headers:null!==(n=null===(t=null==e?void 0:e.http)||void 0===t?void 0:t.headers)&&void 0!==n?n:[],customFetch:void 0}}},t.getUniquePlugins=function(e){const t=new Set,n=[];for(const r of e)t.has(r.id)?r.id&&s.logger.warn(`Duplicate plugin id "${s.colorize.red(r.id)}".\n`):(n.push(r),t.add(r.id));return n};class p extends Error{}t.ConfigValidationError=p},5351:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RemoveUnusedComponents=void 0;const r=n(771);t.RemoveUnusedComponents=()=>{const e=new Map;function t(t,n,r){var i;e.set(t.absolutePointer,{used:(null===(i=e.get(t.absolutePointer))||void 0===i?void 0:i.used)||!1,componentType:n,name:r})}return{ref:{leave(t,{type:n,resolve:r,key:i}){if(["Schema","Parameter","Response","SecurityScheme"].includes(n.name)){const n=r(t);if(!n.location)return;const[o,s]=n.location.absolutePointer.split("#",2),a=`${o}#${s.split("/").slice(0,3).join("/")}`;e.set(a,{used:!0,name:i.toString()})}}},Root:{leave(t,n){const i=n.getVisitorData();i.removedCount=0;const o=new Set;e.forEach((e=>{const{used:n,name:r,componentType:s}=e;!n&&s&&(o.add(s),delete t[s][r],i.removedCount++)}));for(const e of o)(0,r.isEmptyObject)(t[e])&&delete t[e]}},NamedSchemas:{Schema(e,{location:n,key:r}){e.allOf||t(n,"definitions",r.toString())}},NamedParameters:{Parameter(e,{location:n,key:r}){t(n,"parameters",r.toString())}},NamedResponses:{Response(e,{location:n,key:r}){t(n,"responses",r.toString())}},NamedSecuritySchemes:{SecurityScheme(e,{location:n,key:r}){t(n,"securityDefinitions",r.toString())}}}}},4185:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RemoveUnusedComponents=void 0;const r=n(771);t.RemoveUnusedComponents=()=>{const e=new Map;function t(t,n,r){var i;e.set(t.absolutePointer,{used:(null===(i=e.get(t.absolutePointer))||void 0===i?void 0:i.used)||!1,componentType:n,name:r})}return{ref:{leave(t,{type:n,resolve:r,key:i}){if(["Schema","Header","Parameter","Response","Example","RequestBody"].includes(n.name)){const n=r(t);if(!n.location)return;const[o,s]=n.location.absolutePointer.split("#",2),a=`${o}#${s.split("/").slice(0,4).join("/")}`;e.set(a,{used:!0,name:i.toString()})}}},Root:{leave(t,n){const i=n.getVisitorData();i.removedCount=0,e.forEach((e=>{const{used:n,componentType:o,name:s}=e;if(!n&&o&&t.components){const e=t.components[o];delete e[s],i.removedCount++,(0,r.isEmptyObject)(e)&&delete t.components[o]}})),(0,r.isEmptyObject)(t.components)&&delete t.components}},NamedSchemas:{Schema(e,{location:n,key:r}){e.allOf||t(n,"schemas",r.toString())}},NamedParameters:{Parameter(e,{location:n,key:r}){t(n,"parameters",r.toString())}},NamedResponses:{Response(e,{location:n,key:r}){t(n,"responses",r.toString())}},NamedExamples:{Example(e,{location:n,key:r}){t(n,"examples",r.toString())}},NamedRequestBodies:{RequestBody(e,{location:n,key:r}){t(n,"requestBodies",r.toString())}},NamedHeaders:{Header(e,{location:n,key:r}){t(n,"headers",r.toString())}}}}},8005:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.env=t.isBrowser=void 0,t.isBrowser="undefined"!=typeof window||"undefined"==typeof process,t.env=t.isBrowser?{}:process.env||{}},5273:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringifyYaml=t.parseYaml=void 0;const r=n(9183),i=r.JSON_SCHEMA.extend({implicit:[r.types.merge],explicit:[r.types.binary,r.types.omap,r.types.pairs,r.types.set]});t.parseYaml=(e,t)=>(0,r.load)(e,Object.assign({schema:i},t));t.stringifyYaml=(e,t)=>(0,r.dump)(e,t)},3065:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.colorize=t.colorOptions=void 0;const r=n(4819);var i=n(4819);Object.defineProperty(t,"colorOptions",{enumerable:!0,get:function(){return i.options}});const o=n(8005),s=n(771);t.colorize=new Proxy(r,{get:(e,t)=>o.isBrowser?s.identity:e[t]});t.logger=new class{stderr(e){return process.stderr.write(e)}info(e){return o.isBrowser?console.log(e):this.stderr(e)}warn(e){return o.isBrowser?console.warn(e):this.stderr(t.colorize.yellow(e))}error(e){return o.isBrowser?console.error(e):this.stderr(t.colorize.red(e))}}},1510:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTypes=t.getMajorSpecVersion=t.detectSpec=t.SpecMajorVersion=t.SpecVersion=void 0;const r=n(388),i=n(5241),o=n(2608),s=n(1576);var a,l;!function(e){e.OAS2="oas2",e.OAS3_0="oas3_0",e.OAS3_1="oas3_1",e.Async2="async2"}(a||(t.SpecVersion=a={})),function(e){e.OAS2="oas2",e.OAS3="oas3",e.Async2="async2"}(l||(t.SpecMajorVersion=l={}));const c={[a.OAS2]:r.Oas2Types,[a.OAS3_0]:i.Oas3Types,[a.OAS3_1]:o.Oas3_1Types,[a.Async2]:s.AsyncApi2Types};t.detectSpec=function(e){if("object"!=typeof e)throw new Error("Document must be JSON object, got "+typeof e);if(e.openapi&&"string"!=typeof e.openapi)throw new Error(`Invalid OpenAPI version: should be a string but got "${typeof e.openapi}"`);if(e.openapi&&e.openapi.startsWith("3.0"))return a.OAS3_0;if(e.openapi&&e.openapi.startsWith("3.1"))return a.OAS3_1;if(e.swagger&&"2.0"===e.swagger)return a.OAS2;if(e.openapi||e.swagger)throw new Error(`Unsupported OpenAPI version: ${e.openapi||e.swagger}`);if(e.asyncapi&&e.asyncapi.startsWith("2."))return a.Async2;if(e.asyncapi)throw new Error(`Unsupported AsyncAPI version: ${e.asyncapi}`);throw new Error("Unsupported specification")},t.getMajorSpecVersion=function(e){return e===a.OAS2?l.OAS2:e===a.Async2?l.Async2:l.OAS3},t.getTypes=function(e){return c[e]}},1094:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(t){o(t)}}function a(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.isRedoclyRegistryURL=t.RedoclyClient=void 0;const i=n(2116),o=n(6470),s=n(6918),a=n(1390),l=n(3777),c=n(8005),u=n(771),p=n(3065),d=".redocly-config.json";t.RedoclyClient=class{constructor(e){this.accessTokens={},this.region=this.loadRegion(e),this.loadTokens(),this.domain=e?l.DOMAINS[e]:c.env.REDOCLY_DOMAIN||l.DOMAINS[l.DEFAULT_REGION],c.env.REDOCLY_DOMAIN=this.domain,this.registryApi=new a.RegistryApi(this.accessTokens,this.region)}loadRegion(e){if(e&&!l.DOMAINS[e])throw new Error(`Invalid argument: region in config file.\nGiven: ${p.colorize.green(e)}, choices: "us", "eu".`);return c.env.REDOCLY_DOMAIN?l.AVAILABLE_REGIONS.find((e=>l.DOMAINS[e]===c.env.REDOCLY_DOMAIN))||l.DEFAULT_REGION:e||l.DEFAULT_REGION}getRegion(){return this.region}hasTokens(){return(0,u.isNotEmptyObject)(this.accessTokens)}hasToken(){return!!this.accessTokens[this.region]}getAuthorizationHeader(){return r(this,void 0,void 0,(function*(){return this.accessTokens[this.region]}))}setAccessTokens(e){this.accessTokens=e}loadTokens(){const e=(0,o.resolve)((0,s.homedir)(),d),t=this.readCredentialsFile(e);(0,u.isNotEmptyObject)(t)&&this.setAccessTokens(Object.assign(Object.assign({},t),t.token&&!t[this.region]&&{[this.region]:t.token})),c.env.REDOCLY_AUTHORIZATION&&this.setAccessTokens(Object.assign(Object.assign({},this.accessTokens),{[this.region]:c.env.REDOCLY_AUTHORIZATION}))}getAllTokens(){return Object.entries(this.accessTokens).filter((([e])=>l.AVAILABLE_REGIONS.includes(e))).map((([e,t])=>({region:e,token:t})))}getValidTokens(){return r(this,void 0,void 0,(function*(){const e=this.getAllTokens(),t=yield Promise.allSettled(e.map((({token:e,region:t})=>this.verifyToken(e,t))));return e.filter(((e,n)=>"fulfilled"===t[n].status)).map((({token:e,region:t})=>({token:e,region:t,valid:!0})))}))}getTokens(){return r(this,void 0,void 0,(function*(){return this.hasTokens()?yield this.getValidTokens():[]}))}isAuthorizedWithRedoclyByRegion(){return r(this,void 0,void 0,(function*(){if(!this.hasTokens())return!1;const e=this.accessTokens[this.region];if(!e)return!1;try{return yield this.verifyToken(e,this.region),!0}catch(t){return!1}}))}isAuthorizedWithRedocly(){return r(this,void 0,void 0,(function*(){return this.hasTokens()&&(0,u.isNotEmptyObject)(yield this.getValidTokens())}))}readCredentialsFile(e){return(0,i.existsSync)(e)?JSON.parse((0,i.readFileSync)(e,"utf-8")):{}}verifyToken(e,t,n=!1){return r(this,void 0,void 0,(function*(){return this.registryApi.authStatus(e,t,n)}))}login(e,t=!1){return r(this,void 0,void 0,(function*(){const n=(0,o.resolve)((0,s.homedir)(),d);try{yield this.verifyToken(e,this.region,t)}catch(a){throw new Error("Authorization failed. Please check if you entered a valid API key.")}const r=Object.assign(Object.assign({},this.readCredentialsFile(n)),{[this.region]:e,token:e});this.accessTokens=r,this.registryApi.setAccessTokens(r),(0,i.writeFileSync)(n,JSON.stringify(r,null,2))}))}logout(){const e=(0,o.resolve)((0,s.homedir)(),d);(0,i.existsSync)(e)&&(0,i.unlinkSync)(e)}},t.isRedoclyRegistryURL=function(e){const t=c.env.REDOCLY_DOMAIN||l.DOMAINS[l.DEFAULT_REGION],n="redocly.com"===t?"redoc.ly":t;return!(!e.startsWith(`https://api.${t}/registry/`)&&!e.startsWith(`https://api.${n}/registry/`))}},1390:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(t){o(t)}}function a(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RegistryApi=void 0;const i=n(4904),o=n(3777),s=n(771),a=n(3244).i8;t.RegistryApi=class{constructor(e,t){this.accessTokens=e,this.region=t}get accessToken(){return(0,s.isNotEmptyObject)(this.accessTokens)&&this.accessTokens[this.region]}getBaseUrl(e=o.DEFAULT_REGION){return`https://api.${o.DOMAINS[e]}/registry`}setAccessTokens(e){return this.accessTokens=e,this}request(e="",t={},n){var o,s;return r(this,void 0,void 0,(function*(){const r="undefined"!=typeof process&&(null===(o=process.env)||void 0===o?void 0:o.REDOCLY_CLI_COMMAND)||"",l="undefined"!=typeof process&&(null===(s=process.env)||void 0===s?void 0:s.REDOCLY_ENVIRONMENT)||"",c=Object.assign({},t.headers||{},{"x-redocly-cli-version":a,"user-agent":`redocly-cli / ${a} ${r} ${l}`});if(!c.hasOwnProperty("authorization"))throw new Error("Unauthorized");const u=yield(0,i.default)(`${this.getBaseUrl(n)}${e}`,Object.assign({},t,{headers:c}));if(401===u.status)throw new Error("Unauthorized");if(404===u.status){const e=yield u.json();throw new Error(e.code)}return u}))}authStatus(e,t,n=!1){return r(this,void 0,void 0,(function*(){try{const n=yield this.request("",{headers:{authorization:e}},t);return yield n.json()}catch(r){throw n&&console.log(r),r}}))}prepareFileUpload({organizationId:e,name:t,version:n,filesHash:i,filename:o,isUpsert:s}){return r(this,void 0,void 0,(function*(){const r=yield this.request(`/${e}/${t}/${n}/prepare-file-upload`,{method:"POST",headers:{"content-type":"application/json",authorization:this.accessToken},body:JSON.stringify({filesHash:i,filename:o,isUpsert:s})},this.region);if(r.ok)return r.json();throw new Error("Could not prepare file upload")}))}pushApi({organizationId:e,name:t,version:n,rootFilePath:i,filePaths:o,branch:s,isUpsert:a,isPublic:l,batchId:c,batchSize:u}){return r(this,void 0,void 0,(function*(){if(!(yield this.request(`/${e}/${t}/${n}`,{method:"PUT",headers:{"content-type":"application/json",authorization:this.accessToken},body:JSON.stringify({rootFilePath:i,filePaths:o,branch:s,isUpsert:a,isPublic:l,batchId:c,batchSize:u})},this.region)).ok)throw new Error("Could not push api")}))}}},7468:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAnchor=t.isMappingRef=t.isAbsoluteUrl=t.refBaseName=t.pointerBaseName=t.parsePointer=t.parseRef=t.escapePointer=t.unescapePointer=t.Location=t.isRef=t.joinPointer=void 0;const r=n(771);function i(e,t){return""===e&&(e="#/"),"/"===e[e.length-1]?e+t:e+"/"+t}t.joinPointer=i,t.isRef=function(e){return e&&"string"==typeof e.$ref};class o{constructor(e,t){this.source=e,this.pointer=t}child(e){return new o(this.source,i(this.pointer,(Array.isArray(e)?e:[e]).map(a).join("/")))}key(){return Object.assign(Object.assign({},this),{reportOnKey:!0})}get absolutePointer(){return this.source.absoluteRef+("#/"===this.pointer?"":this.pointer)}}function s(e){return decodeURIComponent(e.replace(/~1/g,"/").replace(/~0/g,"~"))}function a(e){return"number"==typeof e?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}t.Location=o,t.unescapePointer=s,t.escapePointer=a,t.parseRef=function(e){const[t,n]=e.split("#/");return{uri:t||null,pointer:n?n.split("/").map(s).filter(r.isTruthy):[]}},t.parsePointer=function(e){return e.substr(2).split("/").map(s)},t.pointerBaseName=function(e){const t=e.split("/");return t[t.length-1]},t.refBaseName=function(e){const t=e.split(/[\/\\]/);return t[t.length-1].replace(/\.[^.]+$/,"")},t.isAbsoluteUrl=function(e){return e.startsWith("http://")||e.startsWith("https://")},t.isMappingRef=function(e){return e.startsWith("#")||e.startsWith("https://")||e.startsWith("http://")||e.startsWith("./")||e.startsWith("../")||e.indexOf("/")>-1},t.isAnchor=function(e){return/^#[A-Za-z][A-Za-z0-9\-_:.]*$/.test(e)}},4182:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(t){o(t)}}function a(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.resolveDocument=t.BaseResolver=t.makeDocumentFromString=t.makeRefId=t.YamlParseError=t.ResolveError=t.Source=void 0;const i=n(3197),o=n(6470),s=n(7468),a=n(5220),l=n(771);class c{constructor(e,t,n){this.absoluteRef=e,this.body=t,this.mimeType=n}getAst(e){var t;return void 0===this._ast&&(this._ast=null!==(t=e(this.body,{filename:this.absoluteRef}))&&void 0!==t?t:void 0,this._ast&&0===this._ast.kind&&""===this._ast.value&&1!==this._ast.startPosition&&(this._ast.startPosition=1,this._ast.endPosition=1)),this._ast}getLines(){return void 0===this._lines&&(this._lines=this.body.split(/\r\n|[\n\r]/g)),this._lines}}t.Source=c;class u extends Error{constructor(e){super(e.message),this.originalError=e,Object.setPrototypeOf(this,u.prototype)}}t.ResolveError=u;const p=/\((\d+):(\d+)\)$/;class d extends Error{constructor(e,t){super(e.message.split("\n")[0]),this.originalError=e,this.source=t,Object.setPrototypeOf(this,d.prototype);const[,n,r]=this.message.match(p)||[];this.line=parseInt(n,10),this.col=parseInt(r,10)}}function f(e,t){return e+"::"+t}t.YamlParseError=d,t.makeRefId=f,t.makeDocumentFromString=function(e,t){const n=new c(t,e);try{return{source:n,parsed:(0,l.parseYaml)(e,{filename:t})}}catch(r){throw new d(r,n)}};function h(e,t){return{prev:e,node:t}}t.BaseResolver=class{constructor(e={http:{headers:[]}}){this.config=e,this.cache=new Map}getFiles(){return new Set(Array.from(this.cache.keys()))}resolveExternalRef(e,t){return(0,s.isAbsoluteUrl)(t)?t:e&&(0,s.isAbsoluteUrl)(e)?new URL(t,e).href:o.resolve(e?o.dirname(e):process.cwd(),t)}loadExternalRef(e){return r(this,void 0,void 0,(function*(){try{if((0,s.isAbsoluteUrl)(e)){const{body:t,mimeType:n}=yield(0,l.readFileFromUrl)(e,this.config.http);return new c(e,t,n)}{if(i.lstatSync(e).isDirectory())throw new Error(`Expected a file but received a folder at ${e}`);const t=yield i.promises.readFile(e,"utf-8");return new c(e,t.replace(/\r\n/g,"\n"))}}catch(t){throw t.message=t.message.replace(", lstat",""),new u(t)}}))}parseDocument(e,t=!1){var n;const r=e.absoluteRef.substr(e.absoluteRef.lastIndexOf("."));if(![".json",".json",".yml",".yaml"].includes(r)&&!(null===(n=e.mimeType)||void 0===n?void 0:n.match(/(json|yaml|openapi)/))&&!t)return{source:e,parsed:e.body};try{return{source:e,parsed:(0,l.parseYaml)(e.body,{filename:e.absoluteRef})}}catch(i){throw new d(i,e)}}resolveDocument(e,t,n=!1){return r(this,void 0,void 0,(function*(){const r=this.resolveExternalRef(e,t),i=this.cache.get(r);if(i)return i;const o=this.loadExternalRef(r).then((e=>this.parseDocument(e,n)));return this.cache.set(r,o),o}))}};const m={name:"unknown",properties:{}},g={name:"scalar",properties:{}};t.resolveDocument=function(e){return r(this,void 0,void 0,(function*(){const{rootDocument:t,externalRefResolver:n,rootType:i}=e,o=new Map,c=new Set,u=[];let p;!function e(t,i,p,d){const y=i.source.absoluteRef,v=new Map;function b(t,n,r){if("object"!=typeof t||null===t)return;const o=`${n.name}::${r}`;if(c.has(o))return;c.add(o);const[l,p]=Object.entries(t).find((([e])=>"$anchor"===e))||[];if(p&&v.set(`#${p}`,t),Array.isArray(t)){const e=n.items;if(void 0===e&&n!==m&&n!==a.SpecExtension)return;for(let n=0;n<t.length;n++)b(t[n],e||m,(0,s.joinPointer)(r,n))}else{for(const e of Object.keys(t)){let i=t[e],o=n.properties[e];void 0===o&&(o=n.additionalProperties),"function"==typeof o&&(o=o(i,e)),void 0===o&&(o=m),n.extensionsPrefix&&e.startsWith(n.extensionsPrefix)&&o===m&&(o=a.SpecExtension),!(0,a.isNamedType)(o)&&(null==o?void 0:o.directResolveAs)&&(o=o.directResolveAs,i={$ref:i}),o&&void 0===o.name&&!1!==o.resolvable&&(o=g),(0,a.isNamedType)(o)&&"object"==typeof i&&b(i,o,(0,s.joinPointer)(r,(0,s.escapePointer)(e)))}if((0,s.isRef)(t)){const r=x(i,t,{prev:null,node:t}).then((t=>{t.resolved&&e(t.node,t.document,t.nodePointer,n)}));u.push(r)}}}function x(e,t,i){return r(this,void 0,void 0,(function*(){if(function(e,t){for(;e;){if(e.node===t)return!0;e=e.prev}return!1}(i.prev,t))throw new Error("Self-referencing circular pointer");if((0,s.isAnchor)(t.$ref)){yield(0,l.nextTick)();const n={resolved:!0,isRemote:!1,node:v.get(t.$ref),document:e,nodePointer:t.$ref},r=f(e.source.absoluteRef,t.$ref);return o.set(r,n),n}const{uri:r,pointer:a}=(0,s.parseRef)(t.$ref),c=null!==r;let u;try{u=c?yield n.resolveDocument(e.source.absoluteRef,r):e}catch(y){const n={resolved:!1,isRemote:c,document:void 0,error:y},r=f(e.source.absoluteRef,t.$ref);return o.set(r,n),n}let p={resolved:!0,document:u,isRemote:c,node:e.parsed,nodePointer:"#/"},d=u.parsed;const m=a;for(const e of m){if("object"!=typeof d){d=void 0;break}if(void 0!==d[e])d=d[e],p.nodePointer=(0,s.joinPointer)(p.nodePointer,(0,s.escapePointer)(e));else{if(!(0,s.isRef)(d)){d=void 0;break}if(p=yield x(u,d,h(i,d)),u=p.document||u,"object"!=typeof p.node){d=void 0;break}d=p.node[e],p.nodePointer=(0,s.joinPointer)(p.nodePointer,(0,s.escapePointer)(e))}}p.node=d,p.document=u;const g=f(e.source.absoluteRef,t.$ref);return p.document&&(0,s.isRef)(d)&&(p=yield x(p.document,d,h(i,d))),o.set(g,p),Object.assign({},p)}))}b(t,d,y+p)}(t.parsed,t,"#/",i);do{p=yield Promise.all(u)}while(u.length!==p.length);return o}))}},348:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportUnresolvedRef=t.NoUnresolvedRefs=void 0;const r=n(4182);function i(e,t,n){var i;const o=e.error;o instanceof r.YamlParseError&&t({message:"Failed to parse: "+o.message,location:{source:o.source,pointer:void 0,start:{col:o.col,line:o.line}}});const s=null===(i=e.error)||void 0===i?void 0:i.message;t({location:n,message:"Can't resolve $ref"+(s?": "+s:"")})}t.NoUnresolvedRefs=()=>({ref:{leave(e,{report:t,location:n},r){void 0===r.node&&i(r,t,n)}},DiscriminatorMapping(e,{report:t,resolve:n,location:r}){for(const o of Object.keys(e)){const s=n({$ref:e[o]});if(void 0!==s.node)return;i(s,t,r.child(o))}}}),t.reportUnresolvedRef=i},1576:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncApi2Types=void 0;const r=n(5220),i=n(7468),o={properties:{},allowed:()=>["http","ws","kafka","anypointmq","amqp","amqp1","mqtt","mqtt5","nats","jms","sns","solace","sqs","stomp","redis","mercure","ibmmq","googlepubsub","pulsar"],additionalProperties:{type:"object"}},s={properties:{},allowed:()=>["http","ws","kafka","anypointmq","amqp","amqp1","mqtt","mqtt5","nats","jms","sns","solace","sqs","stomp","redis","mercure","ibmmq","googlepubsub","pulsar"],additionalProperties:{type:"object"}},a={properties:{},additionalProperties:(e,t)=>t.match(/^[A-Za-z0-9_\-]+$/)?"Server":void 0},l={properties:{},allowed:()=>["http","ws","kafka","anypointmq","amqp","amqp1","mqtt","mqtt5","nats","jms","sns","solace","sqs","stomp","redis","mercure","ibmmq","googlepubsub","pulsar"],additionalProperties:{type:"object"}},c={properties:{},allowed:()=>["http","ws","kafka","anypointmq","amqp","amqp1","mqtt","mqtt5","nats","jms","sns","solace","sqs","stomp","redis","mercure","ibmmq","googlepubsub","pulsar"],additionalProperties:{type:"object"}},u={properties:{$id:{type:"string"},id:{type:"string"},$schema:{type:"string"},definitions:"NamedSchemas",$defs:"NamedSchemas",$vocabulary:{type:"string"},externalDocs:"ExternalDocs",discriminator:"Discriminator",myArbitraryKeyword:{type:"boolean"},title:{type:"string"},multipleOf:{type:"number",minimum:0},maximum:{type:"number"},minimum:{type:"number"},exclusiveMaximum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0},pattern:{type:"string"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0},uniqueItems:{type:"boolean"},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0},required:{type:"array",items:{type:"string"}},enum:{type:"array"},type:e=>Array.isArray(e)?{type:"array",items:{enum:["object","array","string","number","integer","boolean","null"]}}:{enum:["object","array","string","number","integer","boolean","null"]},allOf:(0,r.listOf)("Schema"),anyOf:(0,r.listOf)("Schema"),oneOf:(0,r.listOf)("Schema"),not:"Schema",if:"Schema",then:"Schema",else:"Schema",dependentSchemas:(0,r.listOf)("Schema"),prefixItems:(0,r.listOf)("Schema"),contains:"Schema",minContains:{type:"integer",minimum:0},maxContains:{type:"integer",minimum:0},patternProperties:{type:"object"},propertyNames:"Schema",unevaluatedItems:e=>"boolean"==typeof e?{type:"boolean"}:"Schema",unevaluatedProperties:e=>"boolean"==typeof e?{type:"boolean"}:"Schema",summary:{type:"string"},properties:"SchemaProperties",items:e=>"boolean"==typeof e?{type:"boolean"}:"Schema",additionalProperties:e=>"boolean"==typeof e?{type:"boolean"}:"Schema",description:{type:"string"},format:{type:"string"},contentEncoding:{type:"string"},contentMediaType:{type:"string"},default:null,readOnly:{type:"boolean"},writeOnly:{type:"boolean"},examples:{type:"array"},example:{isExample:!0},deprecated:{type:"boolean"},const:null,$comment:{type:"string"},dependencies:{type:"object"}}},p={properties:{},additionalProperties:e=>(0,i.isMappingRef)(e)?{type:"string",directResolveAs:"Schema"}:{type:"string"}},d={properties:{type:{enum:["userPassword","apiKey","X509","symmetricEncryption","asymmetricEncryption","httpApiKey","http","oauth2","openIdConnect","plain","scramSha256","scramSha512","gssapi"]},description:{type:"string"},name:{type:"string"},in:{type:"string",enum:["query","header","cookie","user","password"]},scheme:{type:"string"},bearerFormat:{type:"string"},flows:"SecuritySchemeFlows",openIdConnectUrl:{type:"string"}},required(e){switch(null==e?void 0:e.type){case"apiKey":return["type","in"];case"httpApiKey":return["type","name","in"];case"http":return["type","scheme"];case"oauth2":return["type","flows"];case"openIdConnect":return["type","openIdConnectUrl"];default:return["type"]}},allowed(e){switch(null==e?void 0:e.type){case"apiKey":return["type","in","description"];case"httpApiKey":return["type","name","in","description"];case"http":return["type","scheme","bearerFormat","description"];case"oauth2":return["type","flows","description"];case"openIdConnect":return["type","openIdConnectUrl","description"];default:return["type","description"]}},extensionsPrefix:"x-"},f={properties:{}};o.properties.http=f;const h={properties:{}};s.properties.http=h;const m={properties:{headers:"Schema",bindingVersion:{type:"string"}}};l.properties.http=m;const g={properties:{type:{type:"string"},method:{type:"string",enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","CONNECT","TRACE"]},headers:"Schema",bindingVersion:{type:"string"}}};c.properties.http=g;const y={properties:{method:{type:"string"},query:"Schema",headers:"Schema",bindingVersion:{type:"string"}}};o.properties.ws=y;const v={properties:{}};s.properties.ws=v;const b={properties:{}};l.properties.ws=b;const x={properties:{}};c.properties.ws=x;const w={properties:{topic:{type:"string"},partitions:{type:"integer"},replicas:{type:"integer"},topicConfiguration:"KafkaTopicConfiguration",bindingVersion:{type:"string"}}};o.properties.kafka=w;const k={properties:{}};s.properties.kafka=k;const O={properties:{key:"Schema",schemaIdLocation:{type:"string"},schemaIdPayloadEncoding:{type:"string"},schemaLookupStrategy:{type:"string"},bindingVersion:{type:"string"}}};l.properties.kafka=O;const S={properties:{groupId:"Schema",clientId:"Schema",bindingVersion:{type:"string"}}};c.properties.kafka=S;const E={properties:{destination:{type:"string"},destinationType:{type:"string"},bindingVersion:{type:"string"}}};o.properties.anypointmq=E;const _={properties:{}};s.properties.anypointmq=_;const A={properties:{headers:"Schema",bindingVersion:{type:"string"}}};l.properties.anypointmq=A;const j={properties:{}};c.properties.anypointmq=j;const T={properties:{}};o.properties.amqp=T;const P={properties:{}};s.properties.amqp=P;const I={properties:{contentEncoding:{type:"string"},messageType:{type:"string"},bindingVersion:{type:"string"}}};l.properties.amqp=I;const C={properties:{expiration:{type:"integer"},userId:{type:"string"},cc:{type:"array",items:{type:"string"}},priority:{type:"integer"},deliveryMode:{type:"integer"},mandatory:{type:"boolean"},bcc:{type:"array",items:{type:"string"}},replyTo:{type:"string"},timestamp:{type:"boolean"},ack:{type:"boolean"},bindingVersion:{type:"string"}}};c.properties.amqp=C;const R={properties:{}};o.properties.amqp1=R;const N={properties:{}};s.properties.amqp1=N;const L={properties:{}};l.properties.amqp1=L;const $={properties:{}};c.properties.amqp1=$;const M={properties:{qos:{type:"integer"},retain:{type:"boolean"},bindingVersion:{type:"string"}}};o.properties.mqtt=M;const D={properties:{clientId:{type:"string"},cleanSession:{type:"boolean"},lastWill:"MqttServerBindingLastWill",keepAlive:{type:"integer"},bindingVersion:{type:"string"}}};s.properties.mqtt=D;const F={properties:{bindingVersion:{type:"string"}}};l.properties.mqtt=F;const B={properties:{qos:{type:"integer"},retain:{type:"boolean"},bindingVersion:{type:"string"}}};c.properties.mqtt=B;const z={properties:{}};o.properties.mqtt5=z;const U={properties:{}};s.properties.mqtt5=U;const q={properties:{}};l.properties.mqtt5=q;const W={properties:{}};c.properties.mqtt5=W;const V={properties:{}};o.properties.nats=V;const Q={properties:{}};s.properties.nats=Q;const H={properties:{}};l.properties.nats=H;const Y={properties:{queue:{type:"string"},bindingVersion:{type:"string"}}};c.properties.nats=Y;const G={properties:{destination:{type:"string"},destinationType:{type:"string"},bindingVersion:{type:"string"}}};o.properties.jms=G;const X={properties:{}};s.properties.jms=X;const K={properties:{headers:"Schema",bindingVersion:{type:"string"}}};l.properties.jms=K;const J={properties:{headers:"Schema",bindingVersion:{type:"string"}}};c.properties.jms=J;const Z={properties:{}};o.properties.solace=Z;const ee={properties:{bindingVersion:{type:"string"},msgVpn:{type:"string"}}};s.properties.solace=ee;const te={properties:{}};l.properties.solace=te;const ne={properties:{bindingVersion:{type:"string"},destinations:(0,r.listOf)("SolaceDestination")}};c.properties.solace=ne;const re={properties:{}};o.properties.stomp=re;const ie={properties:{}};s.properties.stomp=ie;const oe={properties:{}};l.properties.stomp=oe;const se={properties:{}};c.properties.stomp=se;const ae={properties:{}};o.properties.redis=ae;const le={properties:{}};s.properties.redis=le;const ce={properties:{}};l.properties.redis=ce;const ue={properties:{}};c.properties.redis=ue;const pe={properties:{}};o.properties.mercure=pe;const de={properties:{}};s.properties.mercure=de;const fe={properties:{}};l.properties.mercure=fe;const he={properties:{}};c.properties.mercure=he,t.AsyncApi2Types={Root:{properties:{asyncapi:null,info:"Info",id:{type:"string"},servers:"ServerMap",channels:"ChannelMap",components:"Components",tags:"TagList",externalDocs:"ExternalDocs",defaultContentType:{type:"string"}},required:["asyncapi","channels","info"]},Tag:{properties:{name:{type:"string"},description:{type:"string"},externalDocs:"ExternalDocs"},required:["name"]},TagList:(0,r.listOf)("Tag"),ServerMap:a,ExternalDocs:{properties:{description:{type:"string"},url:{type:"string"}},required:["url"]},Server:{properties:{url:{type:"string"},protocol:{type:"string"},protocolVersion:{type:"string"},description:{type:"string"},variables:"ServerVariablesMap",security:"SecurityRequirementList",bindings:"ServerBindings",tags:"TagList"},required:["url","protocol"]},ServerVariable:{properties:{enum:{type:"array",items:{type:"string"}},default:{type:"string"},description:{type:"string"},examples:{type:"array",items:{type:"string"}}},required:[]},ServerVariablesMap:(0,r.mapOf)("ServerVariable"),SecurityRequirement:{properties:{},additionalProperties:{type:"array",items:{type:"string"}}},SecurityRequirementList:(0,r.listOf)("SecurityRequirement"),Info:{properties:{title:{type:"string"},version:{type:"string"},description:{type:"string"},termsOfService:{type:"string"},contact:"Contact",license:"License"},required:["title","version"]},Contact:{properties:{name:{type:"string"},url:{type:"string"},email:{type:"string"}}},License:{properties:{name:{type:"string"},url:{type:"string"}},required:["name"]},HttpServerBinding:h,HttpChannelBinding:f,HttpMessageBinding:m,HttpOperationBinding:g,WsServerBinding:v,WsChannelBinding:y,WsMessageBinding:b,WsOperationBinding:x,KafkaServerBinding:k,KafkaTopicConfiguration:{properties:{"cleanup.policy":{type:"array",items:{enum:["delete","compact"]}},"retention.ms":{type:"integer"},"retention.bytes":{type:"integer"},"delete.retention.ms":{type:"integer"},"max.message.bytes":{type:"integer"}}},KafkaChannelBinding:w,KafkaMessageBinding:O,KafkaOperationBinding:S,AnypointmqServerBinding:_,AnypointmqChannelBinding:E,AnypointmqMessageBinding:A,AnypointmqOperationBinding:j,AmqpServerBinding:P,AmqpChannelBinding:T,AmqpMessageBinding:I,AmqpOperationBinding:C,Amqp1ServerBinding:N,Amqp1ChannelBinding:R,Amqp1MessageBinding:L,Amqp1OperationBinding:$,MqttServerBindingLastWill:{properties:{topic:{type:"string"},qos:{type:"integer"},message:{type:"string"},retain:{type:"boolean"}}},MqttServerBinding:D,MqttChannelBinding:M,MqttMessageBinding:F,MqttOperationBinding:B,Mqtt5ServerBinding:U,Mqtt5ChannelBinding:z,Mqtt5MessageBinding:q,Mqtt5OperationBinding:W,NatsServerBinding:Q,NatsChannelBinding:V,NatsMessageBinding:H,NatsOperationBinding:Y,JmsServerBinding:X,JmsChannelBinding:G,JmsMessageBinding:K,JmsOperationBinding:J,SolaceServerBinding:ee,SolaceChannelBinding:Z,SolaceMessageBinding:te,SolaceDestination:{properties:{destinationType:{type:"string",enum:["queue","topic"]},deliveryMode:{type:"string",enum:["direct","persistent"]},"queue.name":{type:"string"},"queue.topicSubscriptions":{type:"array",items:{type:"string"}},"queue.accessType":{type:"string",enum:["exclusive","nonexclusive"]},"queue.maxMsgSpoolSize":{type:"string"},"queue.maxTtl":{type:"string"},"topic.topicSubscriptions":{type:"array",items:{type:"string"}}}},SolaceOperationBinding:ne,StompServerBinding:ie,StompChannelBinding:re,StompMessageBinding:oe,StompOperationBinding:se,RedisServerBinding:le,RedisChannelBinding:ae,RedisMessageBinding:ce,RedisOperationBinding:ue,MercureServerBinding:de,MercureChannelBinding:pe,MercureMessageBinding:fe,MercureOperationBinding:he,ServerBindings:s,ChannelBindings:o,ChannelMap:{properties:{},additionalProperties:"Channel"},Channel:{properties:{description:{type:"string"},subscribe:"Operation",publish:"Operation",parameters:"ParametersMap",bindings:"ChannelBindings",servers:{type:"array",items:{type:"string"}}}},Parameter:{properties:{description:{type:"string"},schema:"Schema",location:{type:"string"}}},ParametersMap:(0,r.mapOf)("Parameter"),Operation:{properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:"ExternalDocs",operationId:{type:"string"},security:"SecurityRequirementList",bindings:"OperationBindings",traits:"OperationTraitList",message:"Message"},required:[]},Schema:u,MessageExample:{properties:{payload:{isExample:!0},summary:{type:"string"},name:{type:"string"},headers:{type:"object"}}},SchemaProperties:{properties:{},additionalProperties:e=>"boolean"==typeof e?{type:"boolean"}:"Schema"},DiscriminatorMapping:p,Discriminator:{properties:{propertyName:{type:"string"},mapping:"DiscriminatorMapping"},required:["propertyName"]},Components:{properties:{messages:"NamedMessages",parameters:"NamedParameters",schemas:"NamedSchemas",correlationIds:"NamedCorrelationIds",messageTraits:"NamedMessageTraits",operationTraits:"NamedOperationTraits",streamHeaders:"NamedStreamHeaders",securitySchemes:"NamedSecuritySchemes",servers:"ServerMap",serverVariables:"ServerVariablesMap",channels:"ChannelMap",serverBindings:"ServerBindings",channelBindings:"ChannelBindings",operationBindings:"OperationBindings",messageBindings:"MessageBindings"}},NamedSchemas:(0,r.mapOf)("Schema"),NamedMessages:(0,r.mapOf)("Message"),NamedMessageTraits:(0,r.mapOf)("MessageTrait"),NamedOperationTraits:(0,r.mapOf)("OperationTrait"),NamedParameters:(0,r.mapOf)("Parameter"),NamedSecuritySchemes:(0,r.mapOf)("SecurityScheme"),NamedCorrelationIds:(0,r.mapOf)("CorrelationId"),NamedStreamHeaders:(0,r.mapOf)("StreamHeader"),ImplicitFlow:{properties:{refreshUrl:{type:"string"},scopes:{type:"object",additionalProperties:{type:"string"}},authorizationUrl:{type:"string"}},required:["authorizationUrl","scopes"]},PasswordFlow:{properties:{refreshUrl:{type:"string"},scopes:{type:"object",additionalProperties:{type:"string"}},tokenUrl:{type:"string"}},required:["tokenUrl","scopes"]},ClientCredentials:{properties:{refreshUrl:{type:"string"},scopes:{type:"object",additionalProperties:{type:"string"}},tokenUrl:{type:"string"}},required:["tokenUrl","scopes"]},AuthorizationCode:{properties:{refreshUrl:{type:"string"},authorizationUrl:{type:"string"},scopes:{type:"object",additionalProperties:{type:"string"}},tokenUrl:{type:"string"}},required:["authorizationUrl","tokenUrl","scopes"]},SecuritySchemeFlows:{properties:{implicit:"ImplicitFlow",password:"PasswordFlow",clientCredentials:"ClientCredentials",authorizationCode:"AuthorizationCode"}},SecurityScheme:d,Message:{properties:{messageId:{type:"string"},headers:"Schema",payload:"Schema",correlationId:"CorrelationId",schemaFormat:{type:"string"},contentType:{type:"string"},name:{type:"string"},title:{type:"string"},summary:{type:"string"},description:{type:"string"},tags:"TagList",externalDocs:"ExternalDocs",bindings:"MessageBindings",traits:"MessageTraitList"},additionalProperties:{}},MessageBindings:l,OperationBindings:c,OperationTrait:{properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:"ExternalDocs",operationId:{type:"string"},security:"SecurityRequirementList",bindings:"OperationBindings"},required:[]},OperationTraitList:(0,r.listOf)("OperationTrait"),MessageTrait:{properties:{messageId:{type:"string"},headers:"Schema",correlationId:"CorrelationId",schemaFormat:{type:"string"},contentType:{type:"string"},name:{type:"string"},title:{type:"string"},summary:{type:"string"},description:{type:"string"},tags:"TagList",externalDocs:"ExternalDocs",bindings:"MessageBindings"},additionalProperties:{}},MessageTraitList:(0,r.listOf)("MessageTrait"),CorrelationId:{properties:{description:{type:"string"},location:{type:"string"}},required:["location"]}}},5220:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNamedType=t.normalizeTypes=t.SpecExtension=t.mapOf=t.listOf=void 0,t.listOf=function(e){return{name:`${e}List`,properties:{},items:e}},t.mapOf=function(e){return{name:`${e}Map`,properties:{},additionalProperties:()=>e}},t.SpecExtension={name:"SpecExtension",properties:{},additionalProperties:{resolvable:!0}},t.normalizeTypes=function(e,n={}){const r={};for(const t of Object.keys(e))r[t]=Object.assign(Object.assign({},e[t]),{name:t});for(const t of Object.values(r))i(t);return r.SpecExtension=t.SpecExtension,r;function i(e){if(e.additionalProperties&&(e.additionalProperties=o(e.additionalProperties)),e.items&&(e.items=o(e.items)),e.properties){const t={};for(const[r,i]of Object.entries(e.properties))t[r]=o(i),n.doNotResolveExamples&&i&&i.isExample&&(t[r]=Object.assign(Object.assign({},i),{resolvable:!1}));e.properties=t}}function o(e){if("string"==typeof e){if(!r[e])throw new Error(`Unknown type name found: ${e}`);return r[e]}return"function"==typeof e?(t,n)=>o(e(t,n)):e&&e.name?(i(e=Object.assign({},e)),e):e&&e.directResolveAs?Object.assign(Object.assign({},e),{directResolveAs:o(e.directResolveAs)}):e}},t.isNamedType=function(e){return"string"==typeof(null==e?void 0:e.name)}},388:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Oas2Types=void 0;const r=n(5220),i=/^[0-9][0-9Xx]{2}$/,o={properties:{},additionalProperties:(e,t)=>t.startsWith("/")?"PathItem":void 0},s={properties:{name:{type:"string"},in:{type:"string",enum:["query","header","path","formData","body"]},description:{type:"string"},required:{type:"boolean"},schema:"Schema",type:{type:"string",enum:["string","number","integer","boolean","array","file"]},format:{type:"string"},allowEmptyValue:{type:"boolean"},items:"ParameterItems",collectionFormat:{type:"string",enum:["csv","ssv","tsv","pipes","multi"]},default:null,maximum:{type:"integer"},exclusiveMaximum:{type:"boolean"},minimum:{type:"integer"},exclusiveMinimum:{type:"boolean"},maxLength:{type:"integer"},minLength:{type:"integer"},pattern:{type:"string"},maxItems:{type:"integer"},minItems:{type:"integer"},uniqueItems:{type:"boolean"},enum:{type:"array"},multipleOf:{type:"number"},"x-example":"Example","x-examples":"ExamplesMap"},required:e=>e&&e.in?"body"===e.in?["name","in","schema"]:"array"===e.type?["name","in","type","items"]:["name","in","type"]:["name","in"],extensionsPrefix:"x-"},a={properties:{type:{type:"string",enum:["string","number","integer","boolean","array"]},format:{type:"string"},items:"ParameterItems",collectionFormat:{type:"string",enum:["csv","ssv","tsv","pipes","multi"]},default:null,maximum:{type:"integer"},exclusiveMaximum:{type:"boolean"},minimum:{type:"integer"},exclusiveMinimum:{type:"boolean"},maxLength:{type:"integer"},minLength:{type:"integer"},pattern:{type:"string"},maxItems:{type:"integer"},minItems:{type:"integer"},uniqueItems:{type:"boolean"},enum:{type:"array"},multipleOf:{type:"number"}},required:e=>e&&"array"===e.type?["type","items"]:["type"],extensionsPrefix:"x-"},l={properties:{default:"Response"},additionalProperties:(e,t)=>i.test(t)?"Response":void 0},c={properties:{description:{type:"string"},schema:"Schema",headers:(0,r.mapOf)("Header"),examples:"Examples","x-summary":{type:"string"}},required:["description"],extensionsPrefix:"x-"},u={properties:{description:{type:"string"},type:{type:"string",enum:["string","number","integer","boolean","array"]},format:{type:"string"},items:"ParameterItems",collectionFormat:{type:"string",enum:["csv","ssv","tsv","pipes","multi"]},default:null,maximum:{type:"integer"},exclusiveMaximum:{type:"boolean"},minimum:{type:"integer"},exclusiveMinimum:{type:"boolean"},maxLength:{type:"integer"},minLength:{type:"integer"},pattern:{type:"string"},maxItems:{type:"integer"},minItems:{type:"integer"},uniqueItems:{type:"boolean"},enum:{type:"array"},multipleOf:{type:"number"}},required:e=>e&&"array"===e.type?["type","items"]:["type"],extensionsPrefix:"x-"},p={properties:{format:{type:"string"},title:{type:"string"},description:{type:"string"},default:null,multipleOf:{type:"number"},maximum:{type:"number"},minimum:{type:"number"},exclusiveMaximum:{type:"boolean"},exclusiveMinimum:{type:"boolean"},maxLength:{type:"number"},minLength:{type:"number"},pattern:{type:"string"},maxItems:{type:"number"},minItems:{type:"number"},uniqueItems:{type:"boolean"},maxProperties:{type:"number"},minProperties:{type:"number"},required:{type:"array",items:{type:"string"}},enum:{type:"array"},type:{type:"string",enum:["object","array","string","number","integer","boolean","null"]},items:e=>Array.isArray(e)?(0,r.listOf)("Schema"):"Schema",allOf:(0,r.listOf)("Schema"),properties:"SchemaProperties",additionalProperties:e=>"boolean"==typeof e?{type:"boolean"}:"Schema",discriminator:{type:"string"},readOnly:{type:"boolean"},xml:"Xml",externalDocs:"ExternalDocs",example:{isExample:!0},"x-tags":{type:"array",items:{type:"string"}},"x-nullable":{type:"boolean"},"x-extendedDiscriminator":{type:"string"},"x-additionalPropertiesName":{type:"string"},"x-explicitMappingOnly":{type:"boolean"},"x-enumDescriptions":"EnumDescriptions"},extensionsPrefix:"x-"},d={properties:{type:{enum:["basic","apiKey","oauth2"]},description:{type:"string"},name:{type:"string"},in:{type:"string",enum:["query","header"]},flow:{enum:["implicit","password","application","accessCode"]},authorizationUrl:{type:"string"},tokenUrl:{type:"string"},scopes:{type:"object",additionalProperties:{type:"string"}},"x-defaultClientId":{type:"string"}},required(e){switch(null==e?void 0:e.type){case"apiKey":return["type","name","in"];case"oauth2":switch(null==e?void 0:e.flow){case"implicit":return["type","flow","authorizationUrl","scopes"];case"accessCode":return["type","flow","authorizationUrl","tokenUrl","scopes"];case"application":case"password":return["type","flow","tokenUrl","scopes"];default:return["type","flow","scopes"]}default:return["type"]}},allowed(e){switch(null==e?void 0:e.type){case"basic":return["type","description"];case"apiKey":return["type","name","in","description"];case"oauth2":switch(null==e?void 0:e.flow){case"implicit":return["type","flow","authorizationUrl","description","scopes"];case"accessCode":return["type","flow","authorizationUrl","tokenUrl","description","scopes"];case"application":case"password":return["type","flow","tokenUrl","description","scopes"];default:return["type","flow","tokenUrl","authorizationUrl","description","scopes"]}default:return["type","description"]}},extensionsPrefix:"x-"};t.Oas2Types={Root:{properties:{swagger:{type:"string"},info:"Info",host:{type:"string"},basePath:{type:"string"},schemes:{type:"array",items:{type:"string"}},consumes:{type:"array",items:{type:"string"}},produces:{type:"array",items:{type:"string"}},paths:"Paths",definitions:"NamedSchemas",parameters:"NamedParameters",responses:"NamedResponses",securityDefinitions:"NamedSecuritySchemes",security:"SecurityRequirementList",tags:"TagList",externalDocs:"ExternalDocs","x-servers":"XServerList","x-tagGroups":"TagGroups","x-ignoredHeaderParameters":{type:"array",items:{type:"string"}}},required:["swagger","paths","info"],extensionsPrefix:"x-"},Tag:{properties:{name:{type:"string"},description:{type:"string"},externalDocs:"ExternalDocs","x-traitTag":{type:"boolean"},"x-displayName":{type:"string"}},required:["name"],extensionsPrefix:"x-"},TagList:(0,r.listOf)("Tag"),TagGroups:(0,r.listOf)("TagGroup"),TagGroup:{properties:{name:{type:"string"},tags:{type:"array",items:{type:"string"}}}},ExternalDocs:{properties:{description:{type:"string"},url:{type:"string"}},required:["url"],extensionsPrefix:"x-"},Example:{properties:{value:{isExample:!0},summary:{type:"string"},description:{type:"string"},externalValue:{type:"string"}},extensionsPrefix:"x-"},ExamplesMap:(0,r.mapOf)("Example"),EnumDescriptions:{properties:{},additionalProperties:{type:"string"}},SecurityRequirement:{properties:{},additionalProperties:{type:"array",items:{type:"string"}}},SecurityRequirementList:(0,r.listOf)("SecurityRequirement"),Info:{properties:{title:{type:"string"},description:{type:"string"},termsOfService:{type:"string"},contact:"Contact",license:"License",version:{type:"string"},"x-logo":"Logo"},required:["title","version"],extensionsPrefix:"x-"},Contact:{properties:{name:{type:"string"},url:{type:"string"},email:{type:"string"}},extensionsPrefix:"x-"},License:{properties:{name:{type:"string"},url:{type:"string"}},required:["name"],extensionsPrefix:"x-"},Logo:{properties:{url:{type:"string"},altText:{type:"string"},backgroundColor:{type:"string"},href:{type:"string"}},extensionsPrefix:"x-"},Paths:o,PathItem:{properties:{$ref:{type:"string"},parameters:"ParameterList",get:"Operation",put:"Operation",post:"Operation",delete:"Operation",options:"Operation",head:"Operation",patch:"Operation"},extensionsPrefix:"x-"},Parameter:s,ParameterItems:a,ParameterList:(0,r.listOf)("Parameter"),Operation:{properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:"ExternalDocs",operationId:{type:"string"},consumes:{type:"array",items:{type:"string"}},produces:{type:"array",items:{type:"string"}},parameters:"ParameterList",responses:"Responses",schemes:{type:"array",items:{type:"string"}},deprecated:{type:"boolean"},security:"SecurityRequirementList","x-codeSamples":"XCodeSampleList","x-code-samples":"XCodeSampleList","x-hideTryItPanel":{type:"boolean"}},required:["responses"],extensionsPrefix:"x-"},Examples:{properties:{},additionalProperties:{isExample:!0}},Header:u,Responses:l,Response:c,Schema:p,Xml:{properties:{name:{type:"string"},namespace:{type:"string"},prefix:{type:"string"},attribute:{type:"boolean"},wrapped:{type:"boolean"}},extensionsPrefix:"x-"},SchemaProperties:{properties:{},additionalProperties:"Schema"},NamedSchemas:(0,r.mapOf)("Schema"),NamedResponses:(0,r.mapOf)("Response"),NamedParameters:(0,r.mapOf)("Parameter"),NamedSecuritySchemes:(0,r.mapOf)("SecurityScheme"),SecurityScheme:d,XCodeSample:{properties:{lang:{type:"string"},label:{type:"string"},source:{type:"string"}}},XCodeSampleList:(0,r.listOf)("XCodeSample"),XServerList:(0,r.listOf)("XServer"),XServer:{properties:{url:{type:"string"},description:{type:"string"}},required:["url"]}}},5241:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Oas3Types=void 0;const r=n(5220),i=n(7468),o=/^[0-9][0-9Xx]{2}$/,s={properties:{},additionalProperties:(e,t)=>t.startsWith("/")?"PathItem":void 0},a={properties:{default:"Response"},additionalProperties:(e,t)=>o.test(t)?"Response":void 0},l={properties:{externalDocs:"ExternalDocs",discriminator:"Discriminator",title:{type:"string"},multipleOf:{type:"number",minimum:0},maximum:{type:"number"},minimum:{type:"number"},exclusiveMaximum:{type:"boolean"},exclusiveMinimum:{type:"boolean"},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0},pattern:{type:"string"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0},uniqueItems:{type:"boolean"},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0},required:{type:"array",items:{type:"string"}},enum:{type:"array"},type:{enum:["object","array","string","number","integer","boolean","null"]},allOf:(0,r.listOf)("Schema"),anyOf:(0,r.listOf)("Schema"),oneOf:(0,r.listOf)("Schema"),not:"Schema",properties:"SchemaProperties",items:e=>Array.isArray(e)?(0,r.listOf)("Schema"):"Schema",additionalItems:e=>"boolean"==typeof e?{type:"boolean"}:"Schema",additionalProperties:e=>"boolean"==typeof e?{type:"boolean"}:"Schema",description:{type:"string"},format:{type:"string"},default:null,nullable:{type:"boolean"},readOnly:{type:"boolean"},writeOnly:{type:"boolean"},xml:"Xml",example:{isExample:!0},deprecated:{type:"boolean"},"x-tags":{type:"array",items:{type:"string"}},"x-additionalPropertiesName":{type:"string"},"x-explicitMappingOnly":{type:"boolean"}},extensionsPrefix:"x-"},c={properties:{},additionalProperties:e=>(0,i.isMappingRef)(e)?{type:"string",directResolveAs:"Schema"}:{type:"string"}},u={properties:{type:{enum:["apiKey","http","oauth2","openIdConnect"]},description:{type:"string"},name:{type:"string"},in:{type:"string",enum:["query","header","cookie"]},scheme:{type:"string"},bearerFormat:{type:"string"},flows:"OAuth2Flows",openIdConnectUrl:{type:"string"},"x-defaultClientId":{type:"string"}},required(e){switch(null==e?void 0:e.type){case"apiKey":return["type","name","in"];case"http":return["type","scheme"];case"oauth2":return["type","flows"];case"openIdConnect":return["type","openIdConnectUrl"];default:return["type"]}},allowed(e){switch(null==e?void 0:e.type){case"apiKey":return["type","name","in","description"];case"http":return["type","scheme","bearerFormat","description"];case"oauth2":return["type","flows","description"];case"openIdConnect":return["type","openIdConnectUrl","description"];default:return["type","description"]}},extensionsPrefix:"x-"};t.Oas3Types={Root:{properties:{openapi:null,info:"Info",servers:"ServerList",security:"SecurityRequirementList",tags:"TagList",externalDocs:"ExternalDocs",paths:"Paths",components:"Components","x-webhooks":"WebhooksMap","x-tagGroups":"TagGroups","x-ignoredHeaderParameters":{type:"array",items:{type:"string"}}},required:["openapi","paths","info"],extensionsPrefix:"x-"},Tag:{properties:{name:{type:"string"},description:{type:"string"},externalDocs:"ExternalDocs","x-traitTag":{type:"boolean"},"x-displayName":{type:"string"}},required:["name"],extensionsPrefix:"x-"},TagList:(0,r.listOf)("Tag"),TagGroups:(0,r.listOf)("TagGroup"),TagGroup:{properties:{name:{type:"string"},tags:{type:"array",items:{type:"string"}}},extensionsPrefix:"x-"},ExternalDocs:{properties:{description:{type:"string"},url:{type:"string"}},required:["url"],extensionsPrefix:"x-"},Server:{properties:{url:{type:"string"},description:{type:"string"},variables:"ServerVariablesMap"},required:["url"],extensionsPrefix:"x-"},ServerList:(0,r.listOf)("Server"),ServerVariable:{properties:{enum:{type:"array",items:{type:"string"}},default:{type:"string"},description:{type:"string"}},required:["default"],extensionsPrefix:"x-"},ServerVariablesMap:(0,r.mapOf)("ServerVariable"),SecurityRequirement:{properties:{},additionalProperties:{type:"array",items:{type:"string"}}},SecurityRequirementList:(0,r.listOf)("SecurityRequirement"),Info:{properties:{title:{type:"string"},version:{type:"string"},description:{type:"string"},termsOfService:{type:"string"},contact:"Contact",license:"License","x-logo":"Logo"},required:["title","version"],extensionsPrefix:"x-"},Contact:{properties:{name:{type:"string"},url:{type:"string"},email:{type:"string"}},extensionsPrefix:"x-"},License:{properties:{name:{type:"string"},url:{type:"string"}},required:["name"],extensionsPrefix:"x-"},Paths:s,PathItem:{properties:{$ref:{type:"string"},servers:"ServerList",parameters:"ParameterList",summary:{type:"string"},description:{type:"string"},get:"Operation",put:"Operation",post:"Operation",delete:"Operation",options:"Operation",head:"Operation",patch:"Operation",trace:"Operation"},extensionsPrefix:"x-"},Parameter:{properties:{name:{type:"string"},in:{enum:["query","header","path","cookie"]},description:{type:"string"},required:{type:"boolean"},deprecated:{type:"boolean"},allowEmptyValue:{type:"boolean"},style:{enum:["form","simple","label","matrix","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{type:"boolean"},schema:"Schema",example:{isExample:!0},examples:"ExamplesMap",content:"MediaTypesMap"},required:["name","in"],requiredOneOf:["schema","content"],extensionsPrefix:"x-"},ParameterList:(0,r.listOf)("Parameter"),Operation:{properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:"ExternalDocs",operationId:{type:"string"},parameters:"ParameterList",security:"SecurityRequirementList",servers:"ServerList",requestBody:"RequestBody",responses:"Responses",deprecated:{type:"boolean"},callbacks:"CallbacksMap","x-codeSamples":"XCodeSampleList","x-code-samples":"XCodeSampleList","x-hideTryItPanel":{type:"boolean"}},required:["responses"],extensionsPrefix:"x-"},Callback:(0,r.mapOf)("PathItem"),CallbacksMap:(0,r.mapOf)("Callback"),RequestBody:{properties:{description:{type:"string"},required:{type:"boolean"},content:"MediaTypesMap"},required:["content"],extensionsPrefix:"x-"},MediaTypesMap:{properties:{},additionalProperties:"MediaType"},MediaType:{properties:{schema:"Schema",example:{isExample:!0},examples:"ExamplesMap",encoding:"EncodingMap"},extensionsPrefix:"x-"},Example:{properties:{value:{isExample:!0},summary:{type:"string"},description:{type:"string"},externalValue:{type:"string"}},extensionsPrefix:"x-"},ExamplesMap:(0,r.mapOf)("Example"),Encoding:{properties:{contentType:{type:"string"},headers:"HeadersMap",style:{enum:["form","simple","label","matrix","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{type:"boolean"}},extensionsPrefix:"x-"},EncodingMap:(0,r.mapOf)("Encoding"),EnumDescriptions:{properties:{},additionalProperties:{type:"string"}},Header:{properties:{description:{type:"string"},required:{type:"boolean"},deprecated:{type:"boolean"},allowEmptyValue:{type:"boolean"},style:{enum:["form","simple","label","matrix","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{type:"boolean"},schema:"Schema",example:{isExample:!0},examples:"ExamplesMap",content:"MediaTypesMap"},requiredOneOf:["schema","content"],extensionsPrefix:"x-"},HeadersMap:(0,r.mapOf)("Header"),Responses:a,Response:{properties:{description:{type:"string"},headers:"HeadersMap",content:"MediaTypesMap",links:"LinksMap","x-summary":{type:"string"}},required:["description"],extensionsPrefix:"x-"},Link:{properties:{operationRef:{type:"string"},operationId:{type:"string"},parameters:null,requestBody:null,description:{type:"string"},server:"Server"},extensionsPrefix:"x-"},Logo:{properties:{url:{type:"string"},altText:{type:"string"},backgroundColor:{type:"string"},href:{type:"string"}}},Schema:l,Xml:{properties:{name:{type:"string"},namespace:{type:"string"},prefix:{type:"string"},attribute:{type:"boolean"},wrapped:{type:"boolean"}},extensionsPrefix:"x-"},SchemaProperties:{properties:{},additionalProperties:"Schema"},DiscriminatorMapping:c,Discriminator:{properties:{propertyName:{type:"string"},mapping:"DiscriminatorMapping"},required:["propertyName"],extensionsPrefix:"x-"},Components:{properties:{parameters:"NamedParameters",schemas:"NamedSchemas",responses:"NamedResponses",examples:"NamedExamples",requestBodies:"NamedRequestBodies",headers:"NamedHeaders",securitySchemes:"NamedSecuritySchemes",links:"NamedLinks",callbacks:"NamedCallbacks"},extensionsPrefix:"x-"},LinksMap:(0,r.mapOf)("Link"),NamedSchemas:(0,r.mapOf)("Schema"),NamedResponses:(0,r.mapOf)("Response"),NamedParameters:(0,r.mapOf)("Parameter"),NamedExamples:(0,r.mapOf)("Example"),NamedRequestBodies:(0,r.mapOf)("RequestBody"),NamedHeaders:(0,r.mapOf)("Header"),NamedSecuritySchemes:(0,r.mapOf)("SecurityScheme"),NamedLinks:(0,r.mapOf)("Link"),NamedCallbacks:(0,r.mapOf)("Callback"),ImplicitFlow:{properties:{refreshUrl:{type:"string"},scopes:{type:"object",additionalProperties:{type:"string"}},authorizationUrl:{type:"string"}},required:["authorizationUrl","scopes"],extensionsPrefix:"x-"},PasswordFlow:{properties:{refreshUrl:{type:"string"},scopes:{type:"object",additionalProperties:{type:"string"}},tokenUrl:{type:"string"}},required:["tokenUrl","scopes"],extensionsPrefix:"x-"},ClientCredentials:{properties:{refreshUrl:{type:"string"},scopes:{type:"object",additionalProperties:{type:"string"}},tokenUrl:{type:"string"}},required:["tokenUrl","scopes"],extensionsPrefix:"x-"},AuthorizationCode:{properties:{refreshUrl:{type:"string"},authorizationUrl:{type:"string"},scopes:{type:"object",additionalProperties:{type:"string"}},tokenUrl:{type:"string"},"x-usePkce":e=>"boolean"==typeof e?{type:"boolean"}:"XUsePkce"},required:["authorizationUrl","tokenUrl","scopes"],extensionsPrefix:"x-"},OAuth2Flows:{properties:{implicit:"ImplicitFlow",password:"PasswordFlow",clientCredentials:"ClientCredentials",authorizationCode:"AuthorizationCode"},extensionsPrefix:"x-"},SecurityScheme:u,XCodeSample:{properties:{lang:{type:"string"},label:{type:"string"},source:{type:"string"}}},XCodeSampleList:(0,r.listOf)("XCodeSample"),XUsePkce:{properties:{disableManualConfiguration:{type:"boolean"},hideClientSecretInput:{type:"boolean"}}},WebhooksMap:{properties:{},additionalProperties:()=>"PathItem"}}},2608:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Oas3_1Types=void 0;const r=n(5220),i=n(5241),o={properties:{$id:{type:"string"},$anchor:{type:"string"},id:{type:"string"},$schema:{type:"string"},definitions:"NamedSchemas",$defs:"NamedSchemas",$vocabulary:{type:"string"},externalDocs:"ExternalDocs",discriminator:"Discriminator",title:{type:"string"},multipleOf:{type:"number",minimum:0},maximum:{type:"number"},minimum:{type:"number"},exclusiveMaximum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0},pattern:{type:"string"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0},uniqueItems:{type:"boolean"},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0},required:{type:"array",items:{type:"string"}},enum:{type:"array"},type:e=>Array.isArray(e)?{type:"array",items:{enum:["object","array","string","number","integer","boolean","null"]}}:{enum:["object","array","string","number","integer","boolean","null"]},allOf:(0,r.listOf)("Schema"),anyOf:(0,r.listOf)("Schema"),oneOf:(0,r.listOf)("Schema"),not:"Schema",if:"Schema",then:"Schema",else:"Schema",dependentSchemas:(0,r.listOf)("Schema"),prefixItems:(0,r.listOf)("Schema"),contains:"Schema",minContains:{type:"integer",minimum:0},maxContains:{type:"integer",minimum:0},patternProperties:{type:"object"},propertyNames:"Schema",unevaluatedItems:e=>"boolean"==typeof e?{type:"boolean"}:"Schema",unevaluatedProperties:e=>"boolean"==typeof e?{type:"boolean"}:"Schema",summary:{type:"string"},properties:"SchemaProperties",items:e=>"boolean"==typeof e?{type:"boolean"}:"Schema",additionalProperties:e=>"boolean"==typeof e?{type:"boolean"}:"Schema",description:{type:"string"},format:{type:"string"},contentEncoding:{type:"string"},contentMediaType:{type:"string"},default:null,readOnly:{type:"boolean"},writeOnly:{type:"boolean"},xml:"Xml",examples:{type:"array"},example:{isExample:!0},deprecated:{type:"boolean"},const:null,$comment:{type:"string"},"x-tags":{type:"array",items:{type:"string"}}},extensionsPrefix:"x-"},s={properties:{type:{enum:["apiKey","http","oauth2","openIdConnect","mutualTLS"]},description:{type:"string"},name:{type:"string"},in:{type:"string",enum:["query","header","cookie"]},scheme:{type:"string"},bearerFormat:{type:"string"},flows:"OAuth2Flows",openIdConnectUrl:{type:"string"}},required(e){switch(null==e?void 0:e.type){case"apiKey":return["type","name","in"];case"http":return["type","scheme"];case"oauth2":return["type","flows"];case"openIdConnect":return["type","openIdConnectUrl"];default:return["type"]}},allowed(e){switch(null==e?void 0:e.type){case"apiKey":return["type","name","in","description"];case"http":return["type","scheme","bearerFormat","description"];case"oauth2":switch(null==e?void 0:e.flows){case"implicit":return["type","flows","authorizationUrl","refreshUrl","description","scopes"];case"password":case"clientCredentials":return["type","flows","tokenUrl","refreshUrl","description","scopes"];default:return["type","flows","authorizationUrl","refreshUrl","tokenUrl","description","scopes"]}case"openIdConnect":return["type","openIdConnectUrl","description"];default:return["type","description"]}},extensionsPrefix:"x-"};t.Oas3_1Types=Object.assign(Object.assign({},i.Oas3Types),{Info:{properties:{title:{type:"string"},version:{type:"string"},description:{type:"string"},termsOfService:{type:"string"},summary:{type:"string"},contact:"Contact",license:"License","x-logo":"Logo"},required:["title","version"],extensionsPrefix:"x-"},Root:{properties:{openapi:null,info:"Info",servers:"ServerList",security:"SecurityRequirementList",tags:"TagList",externalDocs:"ExternalDocs",paths:"Paths",webhooks:"WebhooksMap",components:"Components",jsonSchemaDialect:{type:"string"}},required:["openapi","info"],requiredOneOf:["paths","components","webhooks"],extensionsPrefix:"x-"},Schema:o,SchemaProperties:{properties:{},additionalProperties:e=>"boolean"==typeof e?{type:"boolean"}:"Schema"},License:{properties:{name:{type:"string"},url:{type:"string"},identifier:{type:"string"}},required:["name"],extensionsPrefix:"x-"},Components:{properties:{parameters:"NamedParameters",schemas:"NamedSchemas",responses:"NamedResponses",examples:"NamedExamples",requestBodies:"NamedRequestBodies",headers:"NamedHeaders",securitySchemes:"NamedSecuritySchemes",links:"NamedLinks",callbacks:"NamedCallbacks",pathItems:"NamedPathItems"},extensionsPrefix:"x-"},NamedPathItems:(0,r.mapOf)("PathItem"),SecurityScheme:s,Operation:{properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:"ExternalDocs",operationId:{type:"string"},parameters:"ParameterList",security:"SecurityRequirementList",servers:"ServerList",requestBody:"RequestBody",responses:"Responses",deprecated:{type:"boolean"},callbacks:"CallbacksMap","x-codeSamples":"XCodeSampleList","x-code-samples":"XCodeSampleList","x-hideTryItPanel":{type:"boolean"}},extensionsPrefix:"x-"}})},771:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(t){o(t)}}function a(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.nextTick=t.pickDefined=t.keysOf=t.identity=t.isTruthy=t.showErrorForDeprecatedField=t.showWarningForDeprecatedField=t.doesYamlFileExist=t.isCustomRuleId=t.getMatchingStatusCodeRange=t.assignExisting=t.isNotString=t.isString=t.isNotEmptyObject=t.slash=t.isPathParameter=t.yamlAndJsonSyncReader=t.readFileAsStringSync=t.isSingular=t.validateMimeTypeOAS3=t.validateMimeType=t.splitCamelCaseIntoWords=t.omitObjectProps=t.pickObjectProps=t.readFileFromUrl=t.isEmptyArray=t.isEmptyObject=t.isPlainObject=t.isDefined=t.loadYaml=t.popStack=t.pushStack=t.stringifyYaml=t.parseYaml=void 0;const i=n(3197),o=n(6470),s=n(4099),a=n(996),l=n(3450),c=n(5273),u=n(8005),p=n(3065);var d=n(5273);function f(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function h(e,t){return t.match(/^https?:\/\//)||(e=e.replace(/^https?:\/\//,"")),s(e,t)}function m(e){return"string"==typeof e}function g(e){return!!e}function y(e,t){return`${void 0!==t?`${t}.`:""}${e}`}Object.defineProperty(t,"parseYaml",{enumerable:!0,get:function(){return d.parseYaml}}),Object.defineProperty(t,"stringifyYaml",{enumerable:!0,get:function(){return d.stringifyYaml}}),t.pushStack=function(e,t){return{prev:e,value:t}},t.popStack=function(e){var t;return null!==(t=null==e?void 0:e.prev)&&void 0!==t?t:null},t.loadYaml=function(e){return r(this,void 0,void 0,(function*(){const t=yield i.promises.readFile(e,"utf-8");return(0,c.parseYaml)(t)}))},t.isDefined=function(e){return void 0!==e},t.isPlainObject=f,t.isEmptyObject=function(e){return f(e)&&0===Object.keys(e).length},t.isEmptyArray=function(e){return Array.isArray(e)&&0===e.length},t.readFileFromUrl=function(e,t){return r(this,void 0,void 0,(function*(){const n={};for(const i of t.headers)h(e,i.matches)&&(n[i.name]=void 0!==i.envVariable?u.env[i.envVariable]||"":i.value);const r=yield(t.customFetch||a.default)(e,{headers:n});if(!r.ok)throw new Error(`Failed to load ${e}: ${r.status} ${r.statusText}`);return{body:yield r.text(),mimeType:r.headers.get("content-type")}}))},t.pickObjectProps=function(e,t){return Object.fromEntries(t.filter((t=>t in e)).map((t=>[t,e[t]])))},t.omitObjectProps=function(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.includes(e))))},t.splitCamelCaseIntoWords=function(e){const t=e.split(/(?:[-._])|([A-Z][a-z]+)/).filter(g).map((e=>e.toLocaleLowerCase())),n=e.split(/([A-Z]{2,})/).filter((e=>e&&e===e.toUpperCase())).map((e=>e.toLocaleLowerCase()));return new Set([...t,...n])},t.validateMimeType=function({type:e,value:t},{report:n,location:r},i){if(!i)throw new Error(`Parameter "allowedValues" is not provided for "${"consumes"===e?"request":"response"}-mime-type" rule`);if(t[e])for(const o of t[e])i.includes(o)||n({message:`Mime type "${o}" is not allowed`,location:r.child(t[e].indexOf(o)).key()})},t.validateMimeTypeOAS3=function({type:e,value:t},{report:n,location:r},i){if(!i)throw new Error(`Parameter "allowedValues" is not provided for "${"consumes"===e?"request":"response"}-mime-type" rule`);if(t.content)for(const o of Object.keys(t.content))i.includes(o)||n({message:`Mime type "${o}" is not allowed`,location:r.child("content").child(o).key()})},t.isSingular=function(e){return l.isSingular(e)},t.readFileAsStringSync=function(e){return i.readFileSync(e,"utf-8")},t.yamlAndJsonSyncReader=function(e){const t=i.readFileSync(e,"utf-8");return(0,c.parseYaml)(t)},t.isPathParameter=function(e){return e.startsWith("{")&&e.endsWith("}")},t.slash=function(e){return/^\\\\\?\\/.test(e)?e:e.replace(/\\/g,"/")},t.isNotEmptyObject=function(e){return!!e&&Object.keys(e).length>0},t.isString=m,t.isNotString=function(e){return!m(e)},t.assignExisting=function(e,t){for(const n of Object.keys(t))e.hasOwnProperty(n)&&(e[n]=t[n])},t.getMatchingStatusCodeRange=function(e){return`${e}`.replace(/^(\d)\d\d$/,((e,t)=>`${t}XX`))},t.isCustomRuleId=function(e){return e.includes("/")},t.doesYamlFileExist=function(e){return(".yaml"===(0,o.extname)(e)||".yml"===(0,o.extname)(e))&&i.hasOwnProperty("existsSync")&&i.existsSync(e)},t.showWarningForDeprecatedField=function(e,t,n){p.logger.warn(`The '${p.colorize.red(e)}' field is deprecated. ${t?`Use ${p.colorize.green(y(t,n))} instead. `:""}Read more about this change: https://redocly.com/docs/api-registry/guides/migration-guide-config-file/#changed-properties\n`)},t.showErrorForDeprecatedField=function(e,t,n){throw new Error(`Do not use '${e}' field. ${t?`Use '${y(t,n)}' instead. `:""}\n`)},t.isTruthy=g,t.identity=function(e){return e},t.keysOf=function(e){return e?Object.keys(e):[]},t.pickDefined=function(e){if(!e)return;const t={};for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t},t.nextTick=function(){new Promise((e=>{setTimeout(e)}))}},8065:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeVisitors=void 0;const r=n(5220),i={Root:"DefinitionRoot",ServerVariablesMap:"ServerVariableMap",Paths:["PathMap","PathsMap"],CallbacksMap:"CallbackMap",MediaTypesMap:"MediaTypeMap",ExamplesMap:"ExampleMap",EncodingMap:"EncodingsMap",HeadersMap:"HeaderMap",LinksMap:"LinkMap",OAuth2Flows:"SecuritySchemeFlows",Responses:"ResponsesMap"};t.normalizeVisitors=function(e,t){const n={any:{enter:[],leave:[]}};for(const r of Object.keys(t))n[r]={enter:[],leave:[]};n.ref={enter:[],leave:[]};for(const{ruleId:r,severity:i,visitor:l}of e)a({ruleId:r,severity:i},l,null);for(const r of Object.keys(n))n[r].enter.sort(((e,t)=>t.depth-e.depth)),n[r].leave.sort(((e,t)=>e.depth-t.depth));return n;function o(e,t,i,s,a=[]){if(a.includes(t))return;a=[...a,t];const l=new Set;for(const n of Object.values(t.properties))n!==i?"object"==typeof n&&null!==n&&n.name&&l.add(n):c(e,a);t.additionalProperties&&"function"!=typeof t.additionalProperties&&(t.additionalProperties===i?c(e,a):void 0!==t.additionalProperties.name&&l.add(t.additionalProperties)),t.items&&(t.items===i?c(e,a):void 0!==t.items.name&&l.add(t.items)),t.extensionsPrefix&&l.add(r.SpecExtension);for(const n of Array.from(l.values()))o(e,n,i,s,a);function c(e,t){for(const r of t.slice(1))n[r.name]=n[r.name]||{enter:[],leave:[]},n[r.name].enter.push(Object.assign(Object.assign({},e),{visit:()=>{},depth:0,context:{isSkippedLevel:!0,seen:new Set,parent:s}}))}}function s(e,t){if(Array.isArray(t)){const n=t.find((t=>e[t]))||void 0;return n&&e[n]}return e[t]}function a(e,r,l,c=0){const u=Object.keys(t);if(0===c)u.push("any"),u.push("ref");else{if(r.any)throw new Error("any() is allowed only on top level");if(r.ref)throw new Error("ref() is allowed only on top level")}for(const p of u){const u=r[p]||s(r,i[p]),d=n[p];if(!u)continue;let f,h,m;const g="object"==typeof u;if("ref"===p&&g&&u.skip)throw new Error("ref() visitor does not support skip");"function"==typeof u?f=u:g&&(f=u.enter,h=u.leave,m=u.skip);const y={activatedOn:null,type:t[p],parent:l,isSkippedLevel:!1};if("object"==typeof u&&a(e,u,y,c+1),l&&o(e,l.type,t[p],l),f||g){if(f&&"function"!=typeof f)throw new Error("DEV: should be function");d.enter.push(Object.assign(Object.assign({},e),{visit:f||(()=>{}),skip:m,depth:c,context:y}))}if(h){if("function"!=typeof h)throw new Error("DEV: should be function");d.leave.push(Object.assign(Object.assign({},e),{visit:h,depth:c,context:y}))}}}}},9443:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.walkDocument=void 0;const r=n(7468),i=n(771),o=n(4182),s=n(5220);function a(e){var t,n;const r={};for(;e.parent;)(null===(t=e.parent.activatedOn)||void 0===t?void 0:t.value.location)&&(r[e.parent.type.name]=null===(n=e.parent.activatedOn)||void 0===n?void 0:n.value.location),e=e.parent;return r}t.walkDocument=function(e){const{document:t,rootType:n,normalizedVisitors:l,resolvedRefMap:c,ctx:u}=e,p={},d=new Set;!function e(t,n,f,h,m){var g,y,v,b,x,w,k,O,S,E,_;const A=(e,t=T.source.absoluteRef)=>{if(!(0,r.isRef)(e))return{location:f,node:e};const n=(0,o.makeRefId)(t,e.$ref),i=c.get(n);if(!i)return{location:void 0,node:void 0};const{resolved:s,node:a,document:l,nodePointer:u,error:p}=i;return{location:s?new r.Location(l.source,u):p instanceof o.YamlParseError?new r.Location(p.source,""):void 0,node:a,error:p}},j=f;let T=f;const{node:P,location:I,error:C}=A(t),R=new Set;if((0,r.isRef)(t)){const e=l.ref.enter;for(const{visit:r,ruleId:i,severity:o,context:s}of e){R.add(s);r(t,{report:L.bind(void 0,i,o),resolve:A,rawNode:t,rawLocation:j,location:f,type:n,parent:h,key:m,parentLocations:{},oasVersion:u.oasVersion,getVisitorData:$.bind(void 0,i)},{node:P,location:I,error:C}),(null==I?void 0:I.source.absoluteRef)&&u.refTypes&&u.refTypes.set(null==I?void 0:I.source.absoluteRef,n)}}if(void 0!==P&&I&&"scalar"!==n.name){T=I;const o=null===(y=null===(g=p[n.name])||void 0===g?void 0:g.has)||void 0===y?void 0:y.call(g,P);let a=!1;const c=l.any.enter.concat((null===(v=l[n.name])||void 0===v?void 0:v.enter)||[]),u=[];for(const{context:e,visit:r,skip:s,ruleId:l,severity:p}of c){if(d.has(T.pointer))break;if(e.isSkippedLevel)!e.parent.activatedOn||e.parent.activatedOn.value.nextLevelTypeActivated||e.seen.has(t)||(e.seen.add(t),a=!0,u.push(e));else if(e.parent&&e.parent.activatedOn&&(null===(b=e.activatedOn)||void 0===b?void 0:b.value.withParentNode)!==e.parent.activatedOn.value.node&&(null===(x=e.parent.activatedOn.value.nextLevelTypeActivated)||void 0===x?void 0:x.value)!==n||!e.parent&&!o){u.push(e);const o={node:P,location:I,nextLevelTypeActivated:null,withParentNode:null===(k=null===(w=e.parent)||void 0===w?void 0:w.activatedOn)||void 0===k?void 0:k.value.node,skipped:null!==(E=(null===(S=null===(O=e.parent)||void 0===O?void 0:O.activatedOn)||void 0===S?void 0:S.value.skipped)||(null==s?void 0:s(P,m,{location:f,rawLocation:j,resolve:A,rawNode:t})))&&void 0!==E&&E};e.activatedOn=(0,i.pushStack)(e.activatedOn,o);let c=e.parent;for(;c;)c.activatedOn.value.nextLevelTypeActivated=(0,i.pushStack)(c.activatedOn.value.nextLevelTypeActivated,n),c=c.parent;o.skipped||(a=!0,R.add(e),N(r,P,t,e,l,p))}}if(a||!o)if(p[n.name]=p[n.name]||new Set,p[n.name].add(P),Array.isArray(P)){const t=n.items;if(void 0!==t)for(let n=0;n<P.length;n++)e(P[n],t,I.child([n]),P,n)}else if("object"==typeof P&&null!==P){const i=Object.keys(n.properties);n.additionalProperties?i.push(...Object.keys(P).filter((e=>!i.includes(e)))):n.extensionsPrefix&&i.push(...Object.keys(P).filter((e=>e.startsWith(n.extensionsPrefix)))),(0,r.isRef)(t)&&i.push(...Object.keys(t).filter((e=>"$ref"!==e&&!i.includes(e))));for(const o of i){let i=P[o],a=I;void 0===i&&(i=t[o],a=f);let l=n.properties[o];void 0===l&&(l=n.additionalProperties),"function"==typeof l&&(l=l(i,o)),void 0===l&&n.extensionsPrefix&&o.startsWith(n.extensionsPrefix)&&(l=s.SpecExtension),!(0,s.isNamedType)(l)&&(null==l?void 0:l.directResolveAs)&&(l=l.directResolveAs,i={$ref:i}),l&&void 0===l.name&&!1!==l.resolvable&&(l={name:"scalar",properties:{}}),(0,s.isNamedType)(l)&&("scalar"!==l.name||(0,r.isRef)(i))&&e(i,l,a.child([o]),P,o)}}const h=l.any.leave,C=((null===(_=l[n.name])||void 0===_?void 0:_.leave)||[]).concat(h);for(const e of u.reverse())if(e.isSkippedLevel)e.seen.delete(P);else if(e.activatedOn=(0,i.popStack)(e.activatedOn),e.parent){let t=e.parent;for(;t;)t.activatedOn.value.nextLevelTypeActivated=(0,i.popStack)(t.activatedOn.value.nextLevelTypeActivated),t=t.parent}for(const{context:e,visit:n,ruleId:r,severity:i}of C)!e.isSkippedLevel&&R.has(e)&&N(n,P,t,e,r,i)}if(T=f,(0,r.isRef)(t)){const e=l.ref.leave;for(const{visit:r,ruleId:i,severity:o,context:s}of e)if(R.has(s)){r(t,{report:L.bind(void 0,i,o),resolve:A,rawNode:t,rawLocation:j,location:f,type:n,parent:h,key:m,parentLocations:{},oasVersion:u.oasVersion,getVisitorData:$.bind(void 0,i)},{node:P,location:I,error:C})}}function N(e,t,r,i,o,s){e(t,{report:L.bind(void 0,o,s),resolve:A,rawNode:r,location:T,rawLocation:j,type:n,parent:h,key:m,parentLocations:a(i),oasVersion:u.oasVersion,ignoreNextVisitorsOnNode:()=>{d.add(T.pointer)},getVisitorData:$.bind(void 0,o)},function(e){var t;const n={};for(;e.parent;)n[e.parent.type.name]=null===(t=e.parent.activatedOn)||void 0===t?void 0:t.value.node,e=e.parent;return n}(i),i)}function L(e,t,n){const r=(n.location?Array.isArray(n.location)?n.location:[n.location]:[Object.assign(Object.assign({},T),{reportOnKey:!1})]).map((e=>Object.assign(Object.assign(Object.assign({},T),{reportOnKey:!1}),e))),i=n.forceSeverity||t;"off"!==i&&u.problems.push(Object.assign(Object.assign({ruleId:n.ruleId||e,severity:i},n),{suggest:n.suggest||[],location:r}))}function $(e){return u.visitorsData[e]=u.visitorsData[e]||{},u.visitorsData[e]}}(t.parsed,n,new r.Location(t.source,"#/"),void 0,"")}},5019:(e,t,n)=>{var r=n(5623);e.exports=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return g(function(e){return e.split("\\\\").join(i).split("\\{").join(o).split("\\}").join(s).split("\\,").join(a).split("\\.").join(l)}(e),!0).map(u)};var i="\0SLASH"+Math.random()+"\0",o="\0OPEN"+Math.random()+"\0",s="\0CLOSE"+Math.random()+"\0",a="\0COMMA"+Math.random()+"\0",l="\0PERIOD"+Math.random()+"\0";function c(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function u(e){return e.split(i).join("\\").split(o).join("{").split(s).join("}").split(a).join(",").split(l).join(".")}function p(e){if(!e)return[""];var t=[],n=r("{","}",e);if(!n)return e.split(",");var i=n.pre,o=n.body,s=n.post,a=i.split(",");a[a.length-1]+="{"+o+"}";var l=p(s);return s.length&&(a[a.length-1]+=l.shift(),a.push.apply(a,l)),t.push.apply(t,a),t}function d(e){return"{"+e+"}"}function f(e){return/^-?0\d/.test(e)}function h(e,t){return e<=t}function m(e,t){return e>=t}function g(e,t){var n=[],i=r("{","}",e);if(!i)return[e];var o=i.pre,a=i.post.length?g(i.post,!1):[""];if(/\$$/.test(i.pre))for(var l=0;l<a.length;l++){var u=o+"{"+i.body+"}"+a[l];n.push(u)}else{var y,v,b=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),x=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),w=b||x,k=i.body.indexOf(",")>=0;if(!w&&!k)return i.post.match(/,.*\}/)?g(e=i.pre+"{"+i.body+s+i.post):[e];if(w)y=i.body.split(/\.\./);else if(1===(y=p(i.body)).length&&1===(y=g(y[0],!1).map(d)).length)return a.map((function(e){return i.pre+y[0]+e}));if(w){var O=c(y[0]),S=c(y[1]),E=Math.max(y[0].length,y[1].length),_=3==y.length?Math.abs(c(y[2])):1,A=h;S<O&&(_*=-1,A=m);var j=y.some(f);v=[];for(var T=O;A(T,S);T+=_){var P;if(x)"\\"===(P=String.fromCharCode(T))&&(P="");else if(P=String(T),j){var I=E-P.length;if(I>0){var C=new Array(I+1).join("0");P=T<0?"-"+C+P.slice(1):C+P}}v.push(P)}}else{v=[];for(var R=0;R<y.length;R++)v.push.apply(v,g(y[R],!1))}for(R=0;R<v.length;R++)for(l=0;l<a.length;l++){u=o+v[R]+a[l];(!t||w||u)&&n.push(u)}}return n}},5751:e=>{const t="object"==typeof process&&process&&"win32"===process.platform;e.exports=t?{sep:"\\"}:{sep:"/"}},4099:(e,t,n)=>{const r=e.exports=(e,t,n={})=>(g(t),!(!n.nocomment&&"#"===t.charAt(0))&&new b(t,n).match(e));e.exports=r;const i=n(5751);r.sep=i.sep;const o=Symbol("globstar **");r.GLOBSTAR=o;const s=n(5019),a={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},l="[^/]",c=l+"*?",u=e=>e.split("").reduce(((e,t)=>(e[t]=!0,e)),{}),p=u("().*{}+?[]^$\\!"),d=u("[.("),f=/\/+/;r.filter=(e,t={})=>(n,i,o)=>r(n,e,t);const h=(e,t={})=>{const n={};return Object.keys(e).forEach((t=>n[t]=e[t])),Object.keys(t).forEach((e=>n[e]=t[e])),n};r.defaults=e=>{if(!e||"object"!=typeof e||!Object.keys(e).length)return r;const t=r,n=(n,r,i)=>t(n,r,h(e,i));return(n.Minimatch=class extends t.Minimatch{constructor(t,n){super(t,h(e,n))}}).defaults=n=>t.defaults(h(e,n)).Minimatch,n.filter=(n,r)=>t.filter(n,h(e,r)),n.defaults=n=>t.defaults(h(e,n)),n.makeRe=(n,r)=>t.makeRe(n,h(e,r)),n.braceExpand=(n,r)=>t.braceExpand(n,h(e,r)),n.match=(n,r,i)=>t.match(n,r,h(e,i)),n},r.braceExpand=(e,t)=>m(e,t);const m=(e,t={})=>(g(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:s(e)),g=e=>{if("string"!=typeof e)throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},y=Symbol("subparse");r.makeRe=(e,t)=>new b(e,t||{}).makeRe(),r.match=(e,t,n={})=>{const r=new b(t,n);return e=e.filter((e=>r.match(e))),r.options.nonull&&!e.length&&e.push(t),e};const v=e=>e.replace(/[[\]\\]/g,"\\$&");class b{constructor(e,t){g(e),t||(t={}),this.options=t,this.set=[],this.pattern=e,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||!1===t.allowWindowsEscape,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.make()}debug(){}make(){const e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();let n=this.globSet=this.braceExpand();t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,n),n=this.globParts=n.map((e=>e.split(f))),this.debug(this.pattern,n),n=n.map(((e,t,n)=>e.map(this.parse,this))),this.debug(this.pattern,n),n=n.filter((e=>-1===e.indexOf(!1))),this.debug(this.pattern,n),this.set=n}parseNegate(){if(this.options.nonegate)return;const e=this.pattern;let t=!1,n=0;for(let r=0;r<e.length&&"!"===e.charAt(r);r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n){var r=this.options;this.debug("matchOne",{this:this,file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var i=0,s=0,a=e.length,l=t.length;i<a&&s<l;i++,s++){this.debug("matchOne loop");var c,u=t[s],p=e[i];if(this.debug(t,u,p),!1===u)return!1;if(u===o){this.debug("GLOBSTAR",[t,u,p]);var d=i,f=s+1;if(f===l){for(this.debug("** at the end");i<a;i++)if("."===e[i]||".."===e[i]||!r.dot&&"."===e[i].charAt(0))return!1;return!0}for(;d<a;){var h=e[d];if(this.debug("\nglobstar while",e,d,t,f,h),this.matchOne(e.slice(d),t.slice(f),n))return this.debug("globstar found match!",d,a,h),!0;if("."===h||".."===h||!r.dot&&"."===h.charAt(0)){this.debug("dot detected!",e,d,t,f);break}this.debug("globstar swallow a segment, and continue"),d++}return!(!n||(this.debug("\n>>> no match, partial?",e,d,t,f),d!==a))}if("string"==typeof u?(c=p===u,this.debug("string match",u,p,c)):(c=p.match(u),this.debug("pattern match",u,p,c)),!c)return!1}if(i===a&&s===l)return!0;if(i===a)return n;if(s===l)return i===a-1&&""===e[i];throw new Error("wtf?")}braceExpand(){return m(this.pattern,this.options)}parse(e,t){g(e);const n=this.options;if("**"===e){if(!n.noglobstar)return o;e="*"}if(""===e)return"";let r="",i=!1,s=!1;const u=[],f=[];let h,m,b,x,w=!1,k=-1,O=-1,S="."===e.charAt(0),E=n.dot||S;const _=e=>"."===e.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",A=()=>{if(h){switch(h){case"*":r+=c,i=!0;break;case"?":r+=l,i=!0;break;default:r+="\\"+h}this.debug("clearStateChar %j %j",h,r),h=!1}};for(let o,l=0;l<e.length&&(o=e.charAt(l));l++)if(this.debug("%s\t%s %s %j",e,l,r,o),s){if("/"===o)return!1;p[o]&&(r+="\\"),r+=o,s=!1}else switch(o){case"/":return!1;case"\\":if(w&&"-"===e.charAt(l+1)){r+=o;continue}A(),s=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",e,l,r,o),w){this.debug(" in class"),"!"===o&&l===O+1&&(o="^"),r+=o;continue}this.debug("call clearStateChar %j",h),A(),h=o,n.noext&&A();continue;case"(":{if(w){r+="(";continue}if(!h){r+="\\(";continue}const t={type:h,start:l-1,reStart:r.length,open:a[h].open,close:a[h].close};this.debug(this.pattern,"\t",t),u.push(t),r+=t.open,0===t.start&&"!"!==t.type&&(S=!0,r+=_(e.slice(l+1))),this.debug("plType %j %j",h,r),h=!1;continue}case")":{const e=u[u.length-1];if(w||!e){r+="\\)";continue}u.pop(),A(),i=!0,b=e,r+=b.close,"!"===b.type&&f.push(Object.assign(b,{reEnd:r.length}));continue}case"|":{const t=u[u.length-1];if(w||!t){r+="\\|";continue}A(),r+="|",0===t.start&&"!"!==t.type&&(S=!0,r+=_(e.slice(l+1)));continue}case"[":if(A(),w){r+="\\"+o;continue}w=!0,O=l,k=r.length,r+=o;continue;case"]":if(l===O+1||!w){r+="\\"+o;continue}m=e.substring(O+1,l);try{RegExp("["+v(m.replace(/\\([^-\]])/g,"$1"))+"]"),r+=o}catch(P){r=r.substring(0,k)+"(?:$.)"}i=!0,w=!1;continue;default:A(),!p[o]||"^"===o&&w||(r+="\\"),r+=o}for(w&&(m=e.slice(O+1),x=this.parse(m,y),r=r.substring(0,k)+"\\["+x[0],i=i||x[1]),b=u.pop();b;b=u.pop()){let e;e=r.slice(b.reStart+b.open.length),this.debug("setting tail",r,b),e=e.replace(/((?:\\{2}){0,64})(\\?)\|/g,((e,t,n)=>(n||(n="\\"),t+t+n+"|"))),this.debug("tail=%j\n %s",e,e,b,r);const t="*"===b.type?c:"?"===b.type?l:"\\"+b.type;i=!0,r=r.slice(0,b.reStart)+t+"\\("+e}A(),s&&(r+="\\\\");const j=d[r.charAt(0)];for(let o=f.length-1;o>-1;o--){const e=f[o],n=r.slice(0,e.reStart),i=r.slice(e.reStart,e.reEnd-8);let s=r.slice(e.reEnd);const a=r.slice(e.reEnd-8,e.reEnd)+s,l=n.split(")").length,c=n.split("(").length-l;let u=s;for(let t=0;t<c;t++)u=u.replace(/\)[+*?]?/,"");s=u;r=n+i+s+(""===s&&t!==y?"(?:$|\\/)":"")+a}if(""!==r&&i&&(r="(?=.)"+r),j&&(r=(S?"":E?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)")+r),t===y)return[r,i];if(n.nocase&&!i&&(i=e.toUpperCase()!==e.toLowerCase()),!i)return(e=>e.replace(/\\(.)/g,"$1"))(e);const T=n.nocase?"i":"";try{return Object.assign(new RegExp("^"+r+"$",T),{_glob:e,_src:r})}catch(P){return new RegExp("$.")}}makeRe(){if(this.regexp||!1===this.regexp)return this.regexp;const e=this.set;if(!e.length)return this.regexp=!1,this.regexp;const t=this.options,n=t.noglobstar?c:t.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",r=t.nocase?"i":"";let i=e.map((e=>(e=e.map((e=>"string"==typeof e?e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):e===o?o:e._src)).reduce(((e,t)=>(e[e.length-1]===o&&t===o||e.push(t),e)),[]),e.forEach(((t,r)=>{t===o&&e[r-1]!==o&&(0===r?e.length>1?e[r+1]="(?:\\/|"+n+"\\/)?"+e[r+1]:e[r]=n:r===e.length-1?e[r-1]+="(?:\\/|"+n+")?":(e[r-1]+="(?:\\/|\\/"+n+"\\/)"+e[r+1],e[r+1]=o))})),e.filter((e=>e!==o)).join("/")))).join("|");i="^(?:"+i+")$",this.negate&&(i="^(?!"+i+").*$");try{this.regexp=new RegExp(i,r)}catch(s){this.regexp=!1}return this.regexp}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return""===e;if("/"===e&&t)return!0;const n=this.options;"/"!==i.sep&&(e=e.split(i.sep).join("/")),e=e.split(f),this.debug(this.pattern,"split",e);const r=this.set;let o;this.debug(this.pattern,"set",r);for(let i=e.length-1;i>=0&&(o=e[i],!o);i--);for(let i=0;i<r.length;i++){const s=r[i];let a=e;n.matchBase&&1===s.length&&(a=[o]);if(this.matchOne(a,s,t))return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate}static defaults(e){return r.defaults(e).Minimatch}}r.Minimatch=b},5623:e=>{"use strict";function t(e,t,i){e instanceof RegExp&&(e=n(e,i)),t instanceof RegExp&&(t=n(t,i));var o=r(e,t,i);return o&&{start:o[0],end:o[1],pre:i.slice(0,o[0]),body:i.slice(o[0]+e.length,o[1]),post:i.slice(o[1]+t.length)}}function n(e,t){var n=t.match(e);return n?n[0]:null}function r(e,t,n){var r,i,o,s,a,l=n.indexOf(e),c=n.indexOf(t,l+1),u=l;if(l>=0&&c>0){if(e===t)return[l,c];for(r=[],o=n.length;u>=0&&!a;)u==l?(r.push(u),l=n.indexOf(e,u+1)):1==r.length?a=[r.pop(),c]:((i=r.pop())<o&&(o=i,s=c),c=n.indexOf(t,u+1)),u=l<c&&l>=0?l:c;r.length&&(a=[o,s])}return a}e.exports=t,t.range=r},472:(e,t,n)=>{"use strict";var r=n(4663);e.exports=function(e,t){return e?void t.then((function(t){r((function(){e(null,t)}))}),(function(t){r((function(){e(t)}))})):t}},4663:e=>{"use strict";e.exports="object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:"function"==typeof setImmediate?setImmediate:function(e){setTimeout(e,0)}},4184:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var o=typeof n;if("string"===o||"number"===o)e.push(n);else if(Array.isArray(n)){if(n.length){var s=i.apply(null,n);s&&e.push(s)}}else if("object"===o){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var a in n)r.call(n,a)&&n[a]&&e.push(a)}}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(n=function(){return i}.apply(t,[]))||(e.exports=n)}()},1851:function(e,t){var n,r,i;r=[t],n=function(e){"use strict";e.__esModule=!0;var t={},n=Object.prototype.hasOwnProperty,r={memoize:function(e){var r=arguments.length<=1||void 0===arguments[1]?t:arguments[1],i=r.cache||{};return function(){for(var t=arguments.length,o=Array(t),s=0;s<t;s++)o[s]=arguments[s];var a=String(o[0]);return!1===r.caseSensitive&&(a=a.toLowerCase()),n.call(i,a)?i[a]:i[a]=e.apply(this,o)}},debounce:function(e,t){if("function"==typeof t){var n=e;e=t,t=n}var r=t&&t.delay||t||0,i=void 0,o=void 0,s=void 0;return function(){for(var t=arguments.length,n=Array(t),a=0;a<t;a++)n[a]=arguments[a];i=n,o=this,s||(s=setTimeout((function(){e.apply(o,i),i=o=s=null}),r))}},bind:function(e,t,n){var r=n.value;return{configurable:!0,get:function(){var e=r.bind(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e}}}},i=a(r.memoize),o=a(r.debounce),s=a((function(e,t){return e.bind(t)}),(function(){return r.bind}));function a(e,t){var n=(t=t||e.decorate||l(e))();return function(){for(var r=arguments.length,i=Array(r),o=0;o<r;o++)i[o]=arguments[o];var s=i.length;return(s<2?t:s>2?n:e).apply(void 0,i)}}function l(e){return function(t){return"function"==typeof t?e(t):function(n,r,i){i.value=e(i.value,t,n,r,i)}}}e.memoize=i,e.debounce=o,e.bind=s,e.default={memoize:i,debounce:o,bind:s}},void 0===(i="function"==typeof n?n.apply(t,r):n)||(e.exports=i)},7856:function(e){e.exports=function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function r(e,i,o){return r=n()?Reflect.construct:function(e,n,r){var i=[null];i.push.apply(i,n);var o=new(Function.bind.apply(e,i));return r&&t(o,r.prototype),o},r.apply(null,arguments)}function i(e){return o(e)||s(e)||a(e)||c()}function o(e){if(Array.isArray(e))return l(e)}function s(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function a(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u=Object.hasOwnProperty,p=Object.setPrototypeOf,d=Object.isFrozen,f=Object.getPrototypeOf,h=Object.getOwnPropertyDescriptor,m=Object.freeze,g=Object.seal,y=Object.create,v="undefined"!=typeof Reflect&&Reflect,b=v.apply,x=v.construct;b||(b=function(e,t,n){return e.apply(t,n)}),m||(m=function(e){return e}),g||(g=function(e){return e}),x||(x=function(e,t){return r(e,i(t))});var w=C(Array.prototype.forEach),k=C(Array.prototype.pop),O=C(Array.prototype.push),S=C(String.prototype.toLowerCase),E=C(String.prototype.toString),_=C(String.prototype.match),A=C(String.prototype.replace),j=C(String.prototype.indexOf),T=C(String.prototype.trim),P=C(RegExp.prototype.test),I=R(TypeError);function C(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return b(e,t,r)}}function R(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return x(e,n)}}function N(e,t,n){var r;n=null!==(r=n)&&void 0!==r?r:S,p&&p(e,null);for(var i=t.length;i--;){var o=t[i];if("string"==typeof o){var s=n(o);s!==o&&(d(t)||(t[i]=s),o=s)}e[o]=!0}return e}function L(e){var t,n=y(null);for(t in e)!0===b(u,e,[t])&&(n[t]=e[t]);return n}function $(e,t){for(;null!==e;){var n=h(e,t);if(n){if(n.get)return C(n.get);if("function"==typeof n.value)return C(n.value)}e=f(e)}function r(e){return console.warn("fallback value for",e),null}return r}var M=m(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),D=m(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),F=m(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),B=m(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),z=m(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),U=m(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),q=m(["#text"]),W=m(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),V=m(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Q=m(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),H=m(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Y=g(/\{\{[\w\W]*|[\w\W]*\}\}/gm),G=g(/<%[\w\W]*|[\w\W]*%>/gm),X=g(/\${[\w\W]*}/gm),K=g(/^data-[\-\w.\u00B7-\uFFFF]/),J=g(/^aria-[\-\w]+$/),Z=g(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ee=g(/^(?:\w+script|data):/i),te=g(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ne=g(/^html$/i),re=function(){return"undefined"==typeof window?null:window},ie=function(t,n){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var r=null,i="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(i)&&(r=n.currentScript.getAttribute(i));var o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(s){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function oe(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:re(),n=function(e){return oe(e)};if(n.version="2.4.7",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,o=t.document,s=t.DocumentFragment,a=t.HTMLTemplateElement,l=t.Node,c=t.Element,u=t.NodeFilter,p=t.NamedNodeMap,d=void 0===p?t.NamedNodeMap||t.MozNamedAttrMap:p,f=t.HTMLFormElement,h=t.DOMParser,g=t.trustedTypes,y=c.prototype,v=$(y,"cloneNode"),b=$(y,"nextSibling"),x=$(y,"childNodes"),C=$(y,"parentNode");if("function"==typeof a){var R=o.createElement("template");R.content&&R.content.ownerDocument&&(o=R.content.ownerDocument)}var se=ie(g,r),ae=se?se.createHTML(""):"",le=o,ce=le.implementation,ue=le.createNodeIterator,pe=le.createDocumentFragment,de=le.getElementsByTagName,fe=r.importNode,he={};try{he=L(o).documentMode?o.documentMode:{}}catch(Rt){}var me={};n.isSupported="function"==typeof C&&ce&&void 0!==ce.createHTMLDocument&&9!==he;var ge,ye,ve=Y,be=G,xe=X,we=K,ke=J,Oe=ee,Se=te,Ee=Z,_e=null,Ae=N({},[].concat(i(M),i(D),i(F),i(z),i(q))),je=null,Te=N({},[].concat(i(W),i(V),i(Q),i(H))),Pe=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ie=null,Ce=null,Re=!0,Ne=!0,Le=!1,$e=!0,Me=!1,De=!1,Fe=!1,Be=!1,ze=!1,Ue=!1,qe=!1,We=!0,Ve=!1,Qe="user-content-",He=!0,Ye=!1,Ge={},Xe=null,Ke=N({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Je=null,Ze=N({},["audio","video","img","source","image","track"]),et=null,tt=N({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nt="http://www.w3.org/1998/Math/MathML",rt="http://www.w3.org/2000/svg",it="http://www.w3.org/1999/xhtml",ot=it,st=!1,at=null,lt=N({},[nt,rt,it],E),ct=["application/xhtml+xml","text/html"],ut="text/html",pt=null,dt=o.createElement("form"),ft=function(e){return e instanceof RegExp||e instanceof Function},ht=function(t){pt&&pt===t||(t&&"object"===e(t)||(t={}),t=L(t),ge=ge=-1===ct.indexOf(t.PARSER_MEDIA_TYPE)?ut:t.PARSER_MEDIA_TYPE,ye="application/xhtml+xml"===ge?E:S,_e="ALLOWED_TAGS"in t?N({},t.ALLOWED_TAGS,ye):Ae,je="ALLOWED_ATTR"in t?N({},t.ALLOWED_ATTR,ye):Te,at="ALLOWED_NAMESPACES"in t?N({},t.ALLOWED_NAMESPACES,E):lt,et="ADD_URI_SAFE_ATTR"in t?N(L(tt),t.ADD_URI_SAFE_ATTR,ye):tt,Je="ADD_DATA_URI_TAGS"in t?N(L(Ze),t.ADD_DATA_URI_TAGS,ye):Ze,Xe="FORBID_CONTENTS"in t?N({},t.FORBID_CONTENTS,ye):Ke,Ie="FORBID_TAGS"in t?N({},t.FORBID_TAGS,ye):{},Ce="FORBID_ATTR"in t?N({},t.FORBID_ATTR,ye):{},Ge="USE_PROFILES"in t&&t.USE_PROFILES,Re=!1!==t.ALLOW_ARIA_ATTR,Ne=!1!==t.ALLOW_DATA_ATTR,Le=t.ALLOW_UNKNOWN_PROTOCOLS||!1,$e=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,Me=t.SAFE_FOR_TEMPLATES||!1,De=t.WHOLE_DOCUMENT||!1,ze=t.RETURN_DOM||!1,Ue=t.RETURN_DOM_FRAGMENT||!1,qe=t.RETURN_TRUSTED_TYPE||!1,Be=t.FORCE_BODY||!1,We=!1!==t.SANITIZE_DOM,Ve=t.SANITIZE_NAMED_PROPS||!1,He=!1!==t.KEEP_CONTENT,Ye=t.IN_PLACE||!1,Ee=t.ALLOWED_URI_REGEXP||Ee,ot=t.NAMESPACE||it,Pe=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&ft(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Pe.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&ft(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Pe.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Pe.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Me&&(Ne=!1),Ue&&(ze=!0),Ge&&(_e=N({},i(q)),je=[],!0===Ge.html&&(N(_e,M),N(je,W)),!0===Ge.svg&&(N(_e,D),N(je,V),N(je,H)),!0===Ge.svgFilters&&(N(_e,F),N(je,V),N(je,H)),!0===Ge.mathMl&&(N(_e,z),N(je,Q),N(je,H))),t.ADD_TAGS&&(_e===Ae&&(_e=L(_e)),N(_e,t.ADD_TAGS,ye)),t.ADD_ATTR&&(je===Te&&(je=L(je)),N(je,t.ADD_ATTR,ye)),t.ADD_URI_SAFE_ATTR&&N(et,t.ADD_URI_SAFE_ATTR,ye),t.FORBID_CONTENTS&&(Xe===Ke&&(Xe=L(Xe)),N(Xe,t.FORBID_CONTENTS,ye)),He&&(_e["#text"]=!0),De&&N(_e,["html","head","body"]),_e.table&&(N(_e,["tbody"]),delete Ie.tbody),m&&m(t),pt=t)},mt=N({},["mi","mo","mn","ms","mtext"]),gt=N({},["foreignobject","desc","title","annotation-xml"]),yt=N({},["title","style","font","a","script"]),vt=N({},D);N(vt,F),N(vt,B);var bt=N({},z);N(bt,U);var xt=function(e){var t=C(e);t&&t.tagName||(t={namespaceURI:ot,tagName:"template"});var n=S(e.tagName),r=S(t.tagName);return!!at[e.namespaceURI]&&(e.namespaceURI===rt?t.namespaceURI===it?"svg"===n:t.namespaceURI===nt?"svg"===n&&("annotation-xml"===r||mt[r]):Boolean(vt[n]):e.namespaceURI===nt?t.namespaceURI===it?"math"===n:t.namespaceURI===rt?"math"===n&>[r]:Boolean(bt[n]):e.namespaceURI===it?!(t.namespaceURI===rt&&!gt[r])&&!(t.namespaceURI===nt&&!mt[r])&&!bt[n]&&(yt[n]||!vt[n]):!("application/xhtml+xml"!==ge||!at[e.namespaceURI]))},wt=function(e){O(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(Rt){try{e.outerHTML=ae}catch(Rt){e.remove()}}},kt=function(e,t){try{O(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(Rt){O(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!je[e])if(ze||Ue)try{wt(t)}catch(Rt){}else try{t.setAttribute(e,"")}catch(Rt){}},Ot=function(e){var t,n;if(Be)e="<remove></remove>"+e;else{var r=_(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===ge&&ot===it&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=se?se.createHTML(e):e;if(ot===it)try{t=(new h).parseFromString(i,ge)}catch(Rt){}if(!t||!t.documentElement){t=ce.createDocument(ot,"template",null);try{t.documentElement.innerHTML=st?ae:i}catch(Rt){}}var s=t.body||t.documentElement;return e&&n&&s.insertBefore(o.createTextNode(n),s.childNodes[0]||null),ot===it?de.call(t,De?"html":"body")[0]:De?t.documentElement:s},St=function(e){return ue.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},Et=function(e){return e instanceof f&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},_t=function(t){return"object"===e(l)?t instanceof l:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},At=function(e,t,r){me[e]&&w(me[e],(function(e){e.call(n,t,r,pt)}))},jt=function(e){var t;if(At("beforeSanitizeElements",e,null),Et(e))return wt(e),!0;if(P(/[\u0080-\uFFFF]/,e.nodeName))return wt(e),!0;var r=ye(e.nodeName);if(At("uponSanitizeElement",e,{tagName:r,allowedTags:_e}),e.hasChildNodes()&&!_t(e.firstElementChild)&&(!_t(e.content)||!_t(e.content.firstElementChild))&&P(/<[/\w]/g,e.innerHTML)&&P(/<[/\w]/g,e.textContent))return wt(e),!0;if("select"===r&&P(/<template/i,e.innerHTML))return wt(e),!0;if(!_e[r]||Ie[r]){if(!Ie[r]&&Pt(r)){if(Pe.tagNameCheck instanceof RegExp&&P(Pe.tagNameCheck,r))return!1;if(Pe.tagNameCheck instanceof Function&&Pe.tagNameCheck(r))return!1}if(He&&!Xe[r]){var i=C(e)||e.parentNode,o=x(e)||e.childNodes;if(o&&i)for(var s=o.length-1;s>=0;--s)i.insertBefore(v(o[s],!0),b(e))}return wt(e),!0}return e instanceof c&&!xt(e)?(wt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!P(/<\/no(script|embed|frames)/i,e.innerHTML)?(Me&&3===e.nodeType&&(t=e.textContent,t=A(t,ve," "),t=A(t,be," "),t=A(t,xe," "),e.textContent!==t&&(O(n.removed,{element:e.cloneNode()}),e.textContent=t)),At("afterSanitizeElements",e,null),!1):(wt(e),!0)},Tt=function(e,t,n){if(We&&("id"===t||"name"===t)&&(n in o||n in dt))return!1;if(Ne&&!Ce[t]&&P(we,t));else if(Re&&P(ke,t));else if(!je[t]||Ce[t]){if(!(Pt(e)&&(Pe.tagNameCheck instanceof RegExp&&P(Pe.tagNameCheck,e)||Pe.tagNameCheck instanceof Function&&Pe.tagNameCheck(e))&&(Pe.attributeNameCheck instanceof RegExp&&P(Pe.attributeNameCheck,t)||Pe.attributeNameCheck instanceof Function&&Pe.attributeNameCheck(t))||"is"===t&&Pe.allowCustomizedBuiltInElements&&(Pe.tagNameCheck instanceof RegExp&&P(Pe.tagNameCheck,n)||Pe.tagNameCheck instanceof Function&&Pe.tagNameCheck(n))))return!1}else if(et[t]);else if(P(Ee,A(n,Se,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==j(n,"data:")||!Je[e])if(Le&&!P(Oe,A(n,Se,"")));else if(n)return!1;return!0},Pt=function(e){return e.indexOf("-")>0},It=function(t){var r,i,o,s;At("beforeSanitizeAttributes",t,null);var a=t.attributes;if(a){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:je};for(s=a.length;s--;){var c=r=a[s],u=c.name,p=c.namespaceURI;if(i="value"===u?r.value:T(r.value),o=ye(u),l.attrName=o,l.attrValue=i,l.keepAttr=!0,l.forceKeepAttr=void 0,At("uponSanitizeAttribute",t,l),i=l.attrValue,!l.forceKeepAttr&&(kt(u,t),l.keepAttr))if($e||!P(/\/>/i,i)){Me&&(i=A(i,ve," "),i=A(i,be," "),i=A(i,xe," "));var d=ye(t.nodeName);if(Tt(d,o,i)){if(!Ve||"id"!==o&&"name"!==o||(kt(u,t),i=Qe+i),se&&"object"===e(g)&&"function"==typeof g.getAttributeType)if(p);else switch(g.getAttributeType(d,o)){case"TrustedHTML":i=se.createHTML(i);break;case"TrustedScriptURL":i=se.createScriptURL(i)}try{p?t.setAttributeNS(p,u,i):t.setAttribute(u,i),k(n.removed)}catch(Rt){}}}else kt(u,t)}At("afterSanitizeAttributes",t,null)}},Ct=function e(t){var n,r=St(t);for(At("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)At("uponSanitizeShadowNode",n,null),jt(n)||(n.content instanceof s&&e(n.content),It(n));At("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(i){var o,a,c,u,p,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((st=!i)&&(i="\x3c!--\x3e"),"string"!=typeof i&&!_t(i)){if("function"!=typeof i.toString)throw I("toString is not a function");if("string"!=typeof(i=i.toString()))throw I("dirty is not a string, aborting")}if(!n.isSupported){if("object"===e(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof i)return t.toStaticHTML(i);if(_t(i))return t.toStaticHTML(i.outerHTML)}return i}if(Fe||ht(d),n.removed=[],"string"==typeof i&&(Ye=!1),Ye){if(i.nodeName){var f=ye(i.nodeName);if(!_e[f]||Ie[f])throw I("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof l)1===(a=(o=Ot("\x3c!----\x3e")).ownerDocument.importNode(i,!0)).nodeType&&"BODY"===a.nodeName||"HTML"===a.nodeName?o=a:o.appendChild(a);else{if(!ze&&!Me&&!De&&-1===i.indexOf("<"))return se&&qe?se.createHTML(i):i;if(!(o=Ot(i)))return ze?null:qe?ae:""}o&&Be&&wt(o.firstChild);for(var h=St(Ye?i:o);c=h.nextNode();)3===c.nodeType&&c===u||jt(c)||(c.content instanceof s&&Ct(c.content),It(c),u=c);if(u=null,Ye)return i;if(ze){if(Ue)for(p=pe.call(o.ownerDocument);o.firstChild;)p.appendChild(o.firstChild);else p=o;return(je.shadowroot||je.shadowrootmod)&&(p=fe.call(r,p,!0)),p}var m=De?o.outerHTML:o.innerHTML;return De&&_e["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&P(ne,o.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+m),Me&&(m=A(m,ve," "),m=A(m,be," "),m=A(m,xe," ")),se&&qe?se.createHTML(m):m},n.setConfig=function(e){ht(e),Fe=!0},n.clearConfig=function(){pt=null,Fe=!1},n.isValidAttribute=function(e,t,n){pt||ht({});var r=ye(e),i=ye(t);return Tt(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&(me[e]=me[e]||[],O(me[e],t))},n.removeHook=function(e){if(me[e])return k(me[e])},n.removeHooks=function(e){me[e]&&(me[e]=[])},n.removeAllHooks=function(){me={}},n}return oe()}()},6729:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new i(r,o||e,s),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],a]:e._events[l].push(a):(e._events[l]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,s=new Array(o);i<o;i++)s[i]=r[i].fn;return s},a.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},a.prototype.emit=function(e,t,r,i,o,s){var a=n?n+e:e;if(!this._events[a])return!1;var l,c,u=this._events[a],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,i),!0;case 5:return u.fn.call(u.context,t,r,i,o),!0;case 6:return u.fn.call(u.context,t,r,i,o,s),!0}for(c=1,l=new Array(p-1);c<p;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var d,f=u.length;for(c=0;c<f;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),p){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,r);break;case 4:u[c].fn.call(u[c].context,t,r,i);break;default:if(!l)for(d=1,l=new Array(p-1);d<p;d++)l[d-1]=arguments[d];u[c].fn.apply(u[c].context,l)}}return!0},a.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},a.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},a.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==t||i&&!a.once||r&&a.context!==r||s(this,o);else{for(var l=0,c=[],u=a.length;l<u;l++)(a[l].fn!==t||i&&!a[l].once||r&&a[l].context!==r)&&c.push(a[l]);c.length?this._events[o]=1===c.length?c[0]:c:s(this,o)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&s(this,t)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a},4445:e=>{e.exports=s,s.default=s,s.stable=u,s.stableStringify=u;var t="[...]",n="[Circular]",r=[],i=[];function o(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function s(e,t,n,s){var a;void 0===s&&(s=o()),l(e,"",0,[],void 0,0,s);try{a=0===i.length?JSON.stringify(e,t,n):JSON.stringify(e,d(t),n)}catch(u){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var c=r.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return a}function a(e,t,n,o){var s=Object.getOwnPropertyDescriptor(o,n);void 0!==s.get?s.configurable?(Object.defineProperty(o,n,{value:e}),r.push([o,n,t,s])):i.push([t,n,e]):(o[n]=e,r.push([o,n,t]))}function l(e,r,i,o,s,c,u){var p;if(c+=1,"object"==typeof e&&null!==e){for(p=0;p<o.length;p++)if(o[p]===e)return void a(n,e,r,s);if(void 0!==u.depthLimit&&c>u.depthLimit)return void a(t,e,r,s);if(void 0!==u.edgesLimit&&i+1>u.edgesLimit)return void a(t,e,r,s);if(o.push(e),Array.isArray(e))for(p=0;p<e.length;p++)l(e[p],p,p,o,e,c,u);else{var d=Object.keys(e);for(p=0;p<d.length;p++){var f=d[p];l(e[f],f,p,o,e,c,u)}}o.pop()}}function c(e,t){return e<t?-1:e>t?1:0}function u(e,t,n,s){void 0===s&&(s=o());var a,l=p(e,"",0,[],void 0,0,s)||e;try{a=0===i.length?JSON.stringify(l,t,n):JSON.stringify(l,d(t),n)}catch(u){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var c=r.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return a}function p(e,i,o,s,l,u,d){var f;if(u+=1,"object"==typeof e&&null!==e){for(f=0;f<s.length;f++)if(s[f]===e)return void a(n,e,i,l);try{if("function"==typeof e.toJSON)return}catch(y){return}if(void 0!==d.depthLimit&&u>d.depthLimit)return void a(t,e,i,l);if(void 0!==d.edgesLimit&&o+1>d.edgesLimit)return void a(t,e,i,l);if(s.push(e),Array.isArray(e))for(f=0;f<e.length;f++)p(e[f],f,f,s,e,u,d);else{var h={},m=Object.keys(e).sort(c);for(f=0;f<m.length;f++){var g=m[f];p(e[g],g,f,s,e,u,d),h[g]=e[g]}if(void 0===l)return h;r.push([l,i,e]),l[i]=h}s.pop()}}function d(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(i.length>0)for(var r=0;r<i.length;r++){var o=i[r];if(o[1]===t&&o[0]===n){n=o[2],i.splice(r,1);break}}return e.call(this,t,n)}}},9804:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString;e.exports=function(e,r,i){if("[object Function]"!==n.call(r))throw new TypeError("iterator must be a function");var o=e.length;if(o===+o)for(var s=0;s<o;s++)r.call(i,e[s],s,e);else for(var a in e)t.call(e,a)&&r.call(i,e[a],a,e)}},9183:(e,t,n)=>{"use strict";var r=n(7990),i=n(3150);function o(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}e.exports.Type=n(1364),e.exports.Schema=n(7657),e.exports.FAILSAFE_SCHEMA=n(4795),e.exports.JSON_SCHEMA=n(5966),e.exports.CORE_SCHEMA=n(6318),e.exports.DEFAULT_SCHEMA=n(6601),e.exports.load=r.load,e.exports.loadAll=r.loadAll,e.exports.dump=i.dump,e.exports.YAMLException=n(8425),e.exports.types={binary:n(3531),float:n(5215),map:n(945),null:n(151),pairs:n(6879),set:n(4982),timestamp:n(2156),bool:n(8771),int:n(1518),merge:n(2913),omap:n(1605),seq:n(6451),str:n(48)},e.exports.safeLoad=o("safeLoad","load"),e.exports.safeLoadAll=o("safeLoadAll","loadAll"),e.exports.safeDump=o("safeDump","dump")},8347:e=>{"use strict";function t(e){return null==e}e.exports.isNothing=t,e.exports.isObject=function(e){return"object"==typeof e&&null!==e},e.exports.toArray=function(e){return Array.isArray(e)?e:t(e)?[]:[e]},e.exports.repeat=function(e,t){var n,r="";for(n=0;n<t;n+=1)r+=e;return r},e.exports.isNegativeZero=function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},e.exports.extend=function(e,t){var n,r,i,o;if(t)for(n=0,r=(o=Object.keys(t)).length;n<r;n+=1)e[i=o[n]]=t[i];return e}},3150:(e,t,n)=>{"use strict";var r=n(8347),i=n(8425),o=n(6601),s=Object.prototype.toString,a=Object.prototype.hasOwnProperty,l=65279,c=9,u=10,p=13,d=32,f=33,h=34,m=35,g=37,y=38,v=39,b=42,x=44,w=45,k=58,O=61,S=62,E=63,_=64,A=91,j=93,T=96,P=123,I=124,C=125,R={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},N=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],L=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function $(e){var t,n,o;if(t=e.toString(16).toUpperCase(),e<=255)n="x",o=2;else if(e<=65535)n="u",o=4;else{if(!(e<=4294967295))throw new i("code point within a string may not be greater than 0xFFFFFFFF");n="U",o=8}return"\\"+n+r.repeat("0",o-t.length)+t}var M=1,D=2;function F(e){this.schema=e.schema||o,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=r.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var n,r,i,o,s,l,c;if(null===t)return{};for(n={},i=0,o=(r=Object.keys(t)).length;i<o;i+=1)s=r[i],l=String(t[s]),"!!"===s.slice(0,2)&&(s="tag:yaml.org,2002:"+s.slice(2)),(c=e.compiledTypeMap.fallback[s])&&a.call(c.styleAliases,l)&&(l=c.styleAliases[l]),n[s]=l;return n}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType='"'===e.quotingType?D:M,this.forceQuotes=e.forceQuotes||!1,this.replacer="function"==typeof e.replacer?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function B(e,t){for(var n,i=r.repeat(" ",t),o=0,s=-1,a="",l=e.length;o<l;)-1===(s=e.indexOf("\n",o))?(n=e.slice(o),o=l):(n=e.slice(o,s+1),o=s+1),n.length&&"\n"!==n&&(a+=i),a+=n;return a}function z(e,t){return"\n"+r.repeat(" ",e.indent*t)}function U(e){return e===d||e===c}function q(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&e!==l||65536<=e&&e<=1114111}function W(e){return q(e)&&e!==l&&e!==p&&e!==u}function V(e,t,n){var r=W(e),i=r&&!U(e);return(n?r:r&&e!==x&&e!==A&&e!==j&&e!==P&&e!==C)&&e!==m&&!(t===k&&!i)||W(t)&&!U(t)&&e===m||t===k&&i}function Q(e,t){var n,r=e.charCodeAt(t);return r>=55296&&r<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1))>=56320&&n<=57343?1024*(r-55296)+n-56320+65536:r}function H(e){return/^\n* /.test(e)}var Y=1,G=2,X=3,K=4,J=5;function Z(e,t,n,r,i,o,s,a){var c,p,d=0,R=null,N=!1,L=!1,$=-1!==r,M=-1,F=q(p=Q(e,0))&&p!==l&&!U(p)&&p!==w&&p!==E&&p!==k&&p!==x&&p!==A&&p!==j&&p!==P&&p!==C&&p!==m&&p!==y&&p!==b&&p!==f&&p!==I&&p!==O&&p!==S&&p!==v&&p!==h&&p!==g&&p!==_&&p!==T&&function(e){return!U(e)&&e!==k}(Q(e,e.length-1));if(t||s)for(c=0;c<e.length;d>=65536?c+=2:c++){if(!q(d=Q(e,c)))return J;F=F&&V(d,R,a),R=d}else{for(c=0;c<e.length;d>=65536?c+=2:c++){if((d=Q(e,c))===u)N=!0,$&&(L=L||c-M-1>r&&" "!==e[M+1],M=c);else if(!q(d))return J;F=F&&V(d,R,a),R=d}L=L||$&&c-M-1>r&&" "!==e[M+1]}return N||L?n>9&&H(e)?J:s?o===D?J:G:L?K:X:!F||s||i(e)?o===D?J:G:Y}function ee(e,t,n,r,o){e.dump=function(){if(0===t.length)return e.quotingType===D?'""':"''";if(!e.noCompatMode&&(-1!==N.indexOf(t)||L.test(t)))return e.quotingType===D?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,n),a=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),l=r||e.flowLevel>-1&&n>=e.flowLevel;switch(Z(t,l,e.indent,a,(function(t){return function(e,t){var n,r;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}(e,t)}),e.quotingType,e.forceQuotes&&!r,o)){case Y:return t;case G:return"'"+t.replace(/'/g,"''")+"'";case X:return"|"+te(t,e.indent)+ne(B(t,s));case K:return">"+te(t,e.indent)+ne(B(function(e,t){var n,r,i=/(\n+)([^\n]*)/g,o=(a=e.indexOf("\n"),a=-1!==a?a:e.length,i.lastIndex=a,re(e.slice(0,a),t)),s="\n"===e[0]||" "===e[0];var a;for(;r=i.exec(e);){var l=r[1],c=r[2];n=" "===c[0],o+=l+(s||n||""===c?"":"\n")+re(c,t),s=n}return o}(t,a),s));case J:return'"'+function(e){for(var t,n="",r=0,i=0;i<e.length;r>=65536?i+=2:i++)r=Q(e,i),!(t=R[r])&&q(r)?(n+=e[i],r>=65536&&(n+=e[i+1])):n+=t||$(r);return n}(t)+'"';default:throw new i("impossible error: invalid scalar style")}}()}function te(e,t){var n=H(e)?String(t):"",r="\n"===e[e.length-1];return n+(r&&("\n"===e[e.length-2]||"\n"===e)?"+":r?"":"-")+"\n"}function ne(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function re(e,t){if(""===e||" "===e[0])return e;for(var n,r,i=/ [^ ]/g,o=0,s=0,a=0,l="";n=i.exec(e);)(a=n.index)-o>t&&(r=s>o?s:a,l+="\n"+e.slice(o,r),o=r+1),s=a;return l+="\n",e.length-o>t&&s>o?l+=e.slice(o,s)+"\n"+e.slice(s+1):l+=e.slice(o),l.slice(1)}function ie(e,t,n,r){var i,o,s,a="",l=e.tag;for(i=0,o=n.length;i<o;i+=1)s=n[i],e.replacer&&(s=e.replacer.call(n,String(i),s)),(se(e,t+1,s,!0,!0,!1,!0)||void 0===s&&se(e,t+1,null,!0,!0,!1,!0))&&(r&&""===a||(a+=z(e,t)),e.dump&&u===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=l,e.dump=a||"[]"}function oe(e,t,n){var r,o,l,c,u,p;for(l=0,c=(o=n?e.explicitTypes:e.implicitTypes).length;l<c;l+=1)if(((u=o[l]).instanceOf||u.predicate)&&(!u.instanceOf||"object"==typeof t&&t instanceof u.instanceOf)&&(!u.predicate||u.predicate(t))){if(n?u.multi&&u.representName?e.tag=u.representName(t):e.tag=u.tag:e.tag="?",u.represent){if(p=e.styleMap[u.tag]||u.defaultStyle,"[object Function]"===s.call(u.represent))r=u.represent(t,p);else{if(!a.call(u.represent,p))throw new i("!<"+u.tag+'> tag resolver accepts not "'+p+'" style');r=u.represent[p](t,p)}e.dump=r}return!0}return!1}function se(e,t,n,r,o,a,l){e.tag=null,e.dump=n,oe(e,n,!1)||oe(e,n,!0);var c,p=s.call(e.dump),d=r;r&&(r=e.flowLevel<0||e.flowLevel>t);var f,h,m="[object Object]"===p||"[object Array]"===p;if(m&&(h=-1!==(f=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||h||2!==e.indent&&t>0)&&(o=!1),h&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(m&&h&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),"[object Object]"===p)r&&0!==Object.keys(e.dump).length?(!function(e,t,n,r){var o,s,a,l,c,p,d="",f=e.tag,h=Object.keys(n);if(!0===e.sortKeys)h.sort();else if("function"==typeof e.sortKeys)h.sort(e.sortKeys);else if(e.sortKeys)throw new i("sortKeys must be a boolean or a function");for(o=0,s=h.length;o<s;o+=1)p="",r&&""===d||(p+=z(e,t)),l=n[a=h[o]],e.replacer&&(l=e.replacer.call(n,a,l)),se(e,t+1,a,!0,!0,!0)&&((c=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&u===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,c&&(p+=z(e,t)),se(e,t+1,l,!0,c)&&(e.dump&&u===e.dump.charCodeAt(0)?p+=":":p+=": ",d+=p+=e.dump));e.tag=f,e.dump=d||"{}"}(e,t,e.dump,o),h&&(e.dump="&ref_"+f+e.dump)):(!function(e,t,n){var r,i,o,s,a,l="",c=e.tag,u=Object.keys(n);for(r=0,i=u.length;r<i;r+=1)a="",""!==l&&(a+=", "),e.condenseFlow&&(a+='"'),s=n[o=u[r]],e.replacer&&(s=e.replacer.call(n,o,s)),se(e,t,o,!1,!1)&&(e.dump.length>1024&&(a+="? "),a+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),se(e,t,s,!1,!1)&&(l+=a+=e.dump));e.tag=c,e.dump="{"+l+"}"}(e,t,e.dump),h&&(e.dump="&ref_"+f+" "+e.dump));else if("[object Array]"===p)r&&0!==e.dump.length?(e.noArrayIndent&&!l&&t>0?ie(e,t-1,e.dump,o):ie(e,t,e.dump,o),h&&(e.dump="&ref_"+f+e.dump)):(!function(e,t,n){var r,i,o,s="",a=e.tag;for(r=0,i=n.length;r<i;r+=1)o=n[r],e.replacer&&(o=e.replacer.call(n,String(r),o)),(se(e,t,o,!1,!1)||void 0===o&&se(e,t,null,!1,!1))&&(""!==s&&(s+=","+(e.condenseFlow?"":" ")),s+=e.dump);e.tag=a,e.dump="["+s+"]"}(e,t,e.dump),h&&(e.dump="&ref_"+f+" "+e.dump));else{if("[object String]"!==p){if("[object Undefined]"===p)return!1;if(e.skipInvalid)return!1;throw new i("unacceptable kind of an object to dump "+p)}"?"!==e.tag&&ee(e,e.dump,t,a,d)}null!==e.tag&&"?"!==e.tag&&(c=encodeURI("!"===e.tag[0]?e.tag.slice(1):e.tag).replace(/!/g,"%21"),c="!"===e.tag[0]?"!"+c:"tag:yaml.org,2002:"===c.slice(0,18)?"!!"+c.slice(18):"!<"+c+">",e.dump=c+" "+e.dump)}return!0}function ae(e,t){var n,r,i=[],o=[];for(le(e,i,o),n=0,r=o.length;n<r;n+=1)t.duplicates.push(i[o[n]]);t.usedDuplicates=new Array(r)}function le(e,t,n){var r,i,o;if(null!==e&&"object"==typeof e)if(-1!==(i=t.indexOf(e)))-1===n.indexOf(i)&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,o=e.length;i<o;i+=1)le(e[i],t,n);else for(i=0,o=(r=Object.keys(e)).length;i<o;i+=1)le(e[r[i]],t,n)}e.exports.dump=function(e,t){var n=new F(t=t||{});n.noRefs||ae(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),se(n,0,r,!0,!0)?n.dump+"\n":""}},8425:e=>{"use strict";function t(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+="\n\n"+e.mark.snippet),r+" "+n):r}function n(e,n){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=n,this.message=t(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n.prototype.toString=function(e){return this.name+": "+t(this,e)},e.exports=n},7990:(e,t,n)=>{"use strict";var r=n(8347),i=n(8425),o=n(192),s=n(6601),a=Object.prototype.hasOwnProperty,l=1,c=2,u=3,p=4,d=1,f=2,h=3,m=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,g=/[\x85\u2028\u2029]/,y=/[,\[\]\{\}]/,v=/^(?:!|!!|![a-z\-]+!)$/i,b=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function x(e){return Object.prototype.toString.call(e)}function w(e){return 10===e||13===e}function k(e){return 9===e||32===e}function O(e){return 9===e||32===e||10===e||13===e}function S(e){return 44===e||91===e||93===e||123===e||125===e}function E(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function _(e){return 48===e?"\0":97===e?"\x07":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"\x1b":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"\x85":95===e?"\xa0":76===e?"\u2028":80===e?"\u2029":""}function A(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var j=new Array(256),T=new Array(256),P=0;P<256;P++)j[P]=_(P)?1:0,T[P]=_(P);function I(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||s,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function C(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=o(n),new i(t,n)}function R(e,t){throw C(e,t)}function N(e,t){e.onWarning&&e.onWarning.call(null,C(e,t))}var L={YAML:function(e,t,n){var r,i,o;null!==e.version&&R(e,"duplication of %YAML directive"),1!==n.length&&R(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&R(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),o=parseInt(r[2],10),1!==i&&R(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,1!==o&&2!==o&&N(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,i;2!==n.length&&R(e,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],v.test(r)||R(e,"ill-formed tag handle (first argument) of the TAG directive"),a.call(e.tagMap,r)&&R(e,'there is a previously declared suffix for "'+r+'" tag handle'),b.test(i)||R(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(o){R(e,"tag prefix is malformed: "+i)}e.tagMap[r]=i}};function $(e,t,n,r){var i,o,s,a;if(t<n){if(a=e.input.slice(t,n),r)for(i=0,o=a.length;i<o;i+=1)9===(s=a.charCodeAt(i))||32<=s&&s<=1114111||R(e,"expected valid JSON character");else m.test(a)&&R(e,"the stream contains non-printable characters");e.result+=a}}function M(e,t,n,i){var o,s,l,c;for(r.isObject(n)||R(e,"cannot merge mappings; the provided source object is unacceptable"),l=0,c=(o=Object.keys(n)).length;l<c;l+=1)s=o[l],a.call(t,s)||(t[s]=n[s],i[s]=!0)}function D(e,t,n,r,i,o,s,l,c){var u,p;if(Array.isArray(i))for(u=0,p=(i=Array.prototype.slice.call(i)).length;u<p;u+=1)Array.isArray(i[u])&&R(e,"nested arrays are not supported inside keys"),"object"==typeof i&&"[object Object]"===x(i[u])&&(i[u]="[object Object]");if("object"==typeof i&&"[object Object]"===x(i)&&(i="[object Object]"),i=String(i),null===t&&(t={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(o))for(u=0,p=o.length;u<p;u+=1)M(e,t,o[u],n);else M(e,t,o,n);else e.json||a.call(n,i)||!a.call(t,i)||(e.line=s||e.line,e.lineStart=l||e.lineStart,e.position=c||e.position,R(e,"duplicated mapping key")),"__proto__"===i?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,writable:!0,value:o}):t[i]=o,delete n[i];return t}function F(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):R(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function B(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);0!==i;){for(;k(i);)9===i&&-1===e.firstTabInLine&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&35===i)do{i=e.input.charCodeAt(++e.position)}while(10!==i&&13!==i&&0!==i);if(!w(i))break;for(F(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;32===i;)e.lineIndent++,i=e.input.charCodeAt(++e.position)}return-1!==n&&0!==r&&e.lineIndent<n&&N(e,"deficient indentation"),r}function z(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!O(t)))}function U(e,t){1===t?e.result+=" ":t>1&&(e.result+=r.repeat("\n",t-1))}function q(e,t){var n,r,i=e.tag,o=e.anchor,s=[],a=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=s),r=e.input.charCodeAt(e.position);0!==r&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,R(e,"tab characters must not be used in indentation")),45===r)&&O(e.input.charCodeAt(e.position+1));)if(a=!0,e.position++,B(e,!0,-1)&&e.lineIndent<=t)s.push(null),r=e.input.charCodeAt(e.position);else if(n=e.line,Q(e,t,u,!1,!0),s.push(e.result),B(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)R(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!a&&(e.tag=i,e.anchor=o,e.kind="sequence",e.result=s,!0)}function W(e){var t,n,r,i,o=!1,s=!1;if(33!==(i=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&R(e,"duplication of a tag property"),60===(i=e.input.charCodeAt(++e.position))?(o=!0,i=e.input.charCodeAt(++e.position)):33===i?(s=!0,n="!!",i=e.input.charCodeAt(++e.position)):n="!",t=e.position,o){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&62!==i);e.position<e.length?(r=e.input.slice(t,e.position),i=e.input.charCodeAt(++e.position)):R(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!O(i);)33===i&&(s?R(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),v.test(n)||R(e,"named tag handle cannot contain such characters"),s=!0,t=e.position+1)),i=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),y.test(r)&&R(e,"tag suffix cannot contain flow indicator characters")}r&&!b.test(r)&&R(e,"tag name cannot contain such characters: "+r);try{r=decodeURIComponent(r)}catch(l){R(e,"tag name is malformed: "+r)}return o?e.tag=r:a.call(e.tagMap,n)?e.tag=e.tagMap[n]+r:"!"===n?e.tag="!"+r:"!!"===n?e.tag="tag:yaml.org,2002:"+r:R(e,'undeclared tag handle "'+n+'"'),!0}function V(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&R(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!O(n)&&!S(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&R(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Q(e,t,n,i,o){var s,m,g,y,v,b,x,_,P,I=1,C=!1,N=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=m=g=p===n||u===n,i&&B(e,!0,-1)&&(C=!0,e.lineIndent>t?I=1:e.lineIndent===t?I=0:e.lineIndent<t&&(I=-1)),1===I)for(;W(e)||V(e);)B(e,!0,-1)?(C=!0,g=s,e.lineIndent>t?I=1:e.lineIndent===t?I=0:e.lineIndent<t&&(I=-1)):g=!1;if(g&&(g=C||o),1!==I&&p!==n||(_=l===n||c===n?t:t+1,P=e.position-e.lineStart,1===I?g&&(q(e,P)||function(e,t,n){var r,i,o,s,a,l,u,d=e.tag,f=e.anchor,h={},m=Object.create(null),g=null,y=null,v=null,b=!1,x=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=h),u=e.input.charCodeAt(e.position);0!==u;){if(b||-1===e.firstTabInLine||(e.position=e.firstTabInLine,R(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),o=e.line,63!==u&&58!==u||!O(r)){if(s=e.line,a=e.lineStart,l=e.position,!Q(e,n,c,!1,!0))break;if(e.line===o){for(u=e.input.charCodeAt(e.position);k(u);)u=e.input.charCodeAt(++e.position);if(58===u)O(u=e.input.charCodeAt(++e.position))||R(e,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(D(e,h,m,g,y,null,s,a,l),g=y=v=null),x=!0,b=!1,i=!1,g=e.tag,y=e.result;else{if(!x)return e.tag=d,e.anchor=f,!0;R(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!x)return e.tag=d,e.anchor=f,!0;R(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===u?(b&&(D(e,h,m,g,y,null,s,a,l),g=y=v=null),x=!0,b=!0,i=!0):b?(b=!1,i=!0):R(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,u=r;if((e.line===o||e.lineIndent>t)&&(b&&(s=e.line,a=e.lineStart,l=e.position),Q(e,t,p,!0,i)&&(b?y=e.result:v=e.result),b||(D(e,h,m,g,y,v,s,a,l),g=y=v=null),B(e,!0,-1),u=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&0!==u)R(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return b&&D(e,h,m,g,y,null,s,a,l),x&&(e.tag=d,e.anchor=f,e.kind="mapping",e.result=h),x}(e,P,_))||function(e,t){var n,r,i,o,s,a,c,u,p,d,f,h,m=!0,g=e.tag,y=e.anchor,v=Object.create(null);if(91===(h=e.input.charCodeAt(e.position)))s=93,u=!1,o=[];else{if(123!==h)return!1;s=125,u=!0,o={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),h=e.input.charCodeAt(++e.position);0!==h;){if(B(e,!0,t),(h=e.input.charCodeAt(e.position))===s)return e.position++,e.tag=g,e.anchor=y,e.kind=u?"mapping":"sequence",e.result=o,!0;m?44===h&&R(e,"expected the node content, but found ','"):R(e,"missed comma between flow collection entries"),f=null,a=c=!1,63===h&&O(e.input.charCodeAt(e.position+1))&&(a=c=!0,e.position++,B(e,!0,t)),n=e.line,r=e.lineStart,i=e.position,Q(e,t,l,!1,!0),d=e.tag,p=e.result,B(e,!0,t),h=e.input.charCodeAt(e.position),!c&&e.line!==n||58!==h||(a=!0,h=e.input.charCodeAt(++e.position),B(e,!0,t),Q(e,t,l,!1,!0),f=e.result),u?D(e,o,v,d,p,f,n,r,i):a?o.push(D(e,null,v,d,p,f,n,r,i)):o.push(p),B(e,!0,t),44===(h=e.input.charCodeAt(e.position))?(m=!0,h=e.input.charCodeAt(++e.position)):m=!1}R(e,"unexpected end of the stream within a flow collection")}(e,_)?N=!0:(m&&function(e,t){var n,i,o,s,a,l=d,c=!1,u=!1,p=t,m=0,g=!1;if(124===(s=e.input.charCodeAt(e.position)))i=!1;else{if(62!==s)return!1;i=!0}for(e.kind="scalar",e.result="";0!==s;)if(43===(s=e.input.charCodeAt(++e.position))||45===s)d===l?l=43===s?h:f:R(e,"repeat of a chomping mode identifier");else{if(!((o=48<=(a=s)&&a<=57?a-48:-1)>=0))break;0===o?R(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?R(e,"repeat of an indentation width identifier"):(p=t+o-1,u=!0)}if(k(s)){do{s=e.input.charCodeAt(++e.position)}while(k(s));if(35===s)do{s=e.input.charCodeAt(++e.position)}while(!w(s)&&0!==s)}for(;0!==s;){for(F(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!u||e.lineIndent<p)&&32===s;)e.lineIndent++,s=e.input.charCodeAt(++e.position);if(!u&&e.lineIndent>p&&(p=e.lineIndent),w(s))m++;else{if(e.lineIndent<p){l===h?e.result+=r.repeat("\n",c?1+m:m):l===d&&c&&(e.result+="\n");break}for(i?k(s)?(g=!0,e.result+=r.repeat("\n",c?1+m:m)):g?(g=!1,e.result+=r.repeat("\n",m+1)):0===m?c&&(e.result+=" "):e.result+=r.repeat("\n",m):e.result+=r.repeat("\n",c?1+m:m),c=!0,u=!0,m=0,n=e.position;!w(s)&&0!==s;)s=e.input.charCodeAt(++e.position);$(e,n,e.position,!1)}}return!0}(e,_)||function(e,t){var n,r,i;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if($(e,r,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;r=e.position,e.position++,i=e.position}else w(n)?($(e,r,i,!0),U(e,B(e,!1,t)),r=i=e.position):e.position===e.lineStart&&z(e)?R(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);R(e,"unexpected end of the stream within a single quoted scalar")}(e,_)||function(e,t){var n,r,i,o,s,a,l;if(34!==(a=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(a=e.input.charCodeAt(e.position));){if(34===a)return $(e,n,e.position,!0),e.position++,!0;if(92===a){if($(e,n,e.position,!0),w(a=e.input.charCodeAt(++e.position)))B(e,!1,t);else if(a<256&&j[a])e.result+=T[a],e.position++;else if((s=120===(l=a)?2:117===l?4:85===l?8:0)>0){for(i=s,o=0;i>0;i--)(s=E(a=e.input.charCodeAt(++e.position)))>=0?o=(o<<4)+s:R(e,"expected hexadecimal character");e.result+=A(o),e.position++}else R(e,"unknown escape sequence");n=r=e.position}else w(a)?($(e,n,r,!0),U(e,B(e,!1,t)),n=r=e.position):e.position===e.lineStart&&z(e)?R(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}R(e,"unexpected end of the stream within a double quoted scalar")}(e,_)?N=!0:!function(e){var t,n,r;if(42!==(r=e.input.charCodeAt(e.position)))return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!O(r)&&!S(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&R(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),a.call(e.anchorMap,n)||R(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],B(e,!0,-1),!0}(e)?function(e,t,n){var r,i,o,s,a,l,c,u,p=e.kind,d=e.result;if(O(u=e.input.charCodeAt(e.position))||S(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(O(r=e.input.charCodeAt(e.position+1))||n&&S(r)))return!1;for(e.kind="scalar",e.result="",i=o=e.position,s=!1;0!==u;){if(58===u){if(O(r=e.input.charCodeAt(e.position+1))||n&&S(r))break}else if(35===u){if(O(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&z(e)||n&&S(u))break;if(w(u)){if(a=e.line,l=e.lineStart,c=e.lineIndent,B(e,!1,-1),e.lineIndent>=t){s=!0,u=e.input.charCodeAt(e.position);continue}e.position=o,e.line=a,e.lineStart=l,e.lineIndent=c;break}}s&&($(e,i,o,!1),U(e,e.line-a),i=o=e.position,s=!1),k(u)||(o=e.position+1),u=e.input.charCodeAt(++e.position)}return $(e,i,o,!1),!!e.result||(e.kind=p,e.result=d,!1)}(e,_,l===n)&&(N=!0,null===e.tag&&(e.tag="?")):(N=!0,null===e.tag&&null===e.anchor||R(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===I&&(N=g&&q(e,P))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&R(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),y=0,v=e.implicitTypes.length;y<v;y+=1)if((x=e.implicitTypes[y]).resolve(e.result)){e.result=x.construct(e.result),e.tag=x.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else if("!"!==e.tag){if(a.call(e.typeMap[e.kind||"fallback"],e.tag))x=e.typeMap[e.kind||"fallback"][e.tag];else for(x=null,y=0,v=(b=e.typeMap.multi[e.kind||"fallback"]).length;y<v;y+=1)if(e.tag.slice(0,b[y].tag.length)===b[y].tag){x=b[y];break}x||R(e,"unknown tag !<"+e.tag+">"),null!==e.result&&x.kind!==e.kind&&R(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+x.kind+'", not "'+e.kind+'"'),x.resolve(e.result,e.tag)?(e.result=x.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):R(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||N}function H(e){var t,n,r,i,o=e.position,s=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(i=e.input.charCodeAt(e.position))&&(B(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==i));){for(s=!0,i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!O(i);)i=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&R(e,"directive name must not be less than one character in length");0!==i;){for(;k(i);)i=e.input.charCodeAt(++e.position);if(35===i){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&!w(i));break}if(w(i))break;for(t=e.position;0!==i&&!O(i);)i=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position))}0!==i&&F(e),a.call(L,n)?L[n](e,n,r):N(e,'unknown document directive "'+n+'"')}B(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,B(e,!0,-1)):s&&R(e,"directives end mark is expected"),Q(e,e.lineIndent-1,p,!1,!0),B(e,!0,-1),e.checkLineBreaks&&g.test(e.input.slice(o,e.position))&&N(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&z(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,B(e,!0,-1)):e.position<e.length-1&&R(e,"end of the stream or a document separator is expected")}function Y(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new I(e,t),r=e.indexOf("\0");for(-1!==r&&(n.position=r,R(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)H(n);return n.documents}e.exports.loadAll=function(e,t,n){null!==t&&"object"==typeof t&&void 0===n&&(n=t,t=null);var r=Y(e,n);if("function"!=typeof t)return r;for(var i=0,o=r.length;i<o;i+=1)t(r[i])},e.exports.load=function(e,t){var n=Y(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new i("expected a single document in the stream, but found more")}}},7657:(e,t,n)=>{"use strict";var r=n(8425),i=n(1364);function o(e,t){var n=[];return e[t].forEach((function(e){var t=n.length;n.forEach((function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)})),n[t]=e})),n}function s(e){return this.extend(e)}s.prototype.extend=function(e){var t=[],n=[];if(e instanceof i)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new r("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof i))throw new r("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new r("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new r("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(e){if(!(e instanceof i))throw new r("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var a=Object.create(s.prototype);return a.implicit=(this.implicit||[]).concat(t),a.explicit=(this.explicit||[]).concat(n),a.compiledImplicit=o(a,"implicit"),a.compiledExplicit=o(a,"explicit"),a.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function r(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(r);return n}(a.compiledImplicit,a.compiledExplicit),a},e.exports=s},6318:(e,t,n)=>{"use strict";e.exports=n(5966)},6601:(e,t,n)=>{"use strict";e.exports=n(6318).extend({implicit:[n(2156),n(2913)],explicit:[n(3531),n(1605),n(6879),n(4982)]})},4795:(e,t,n)=>{"use strict";var r=n(7657);e.exports=new r({explicit:[n(48),n(6451),n(945)]})},5966:(e,t,n)=>{"use strict";e.exports=n(4795).extend({implicit:[n(151),n(8771),n(1518),n(5215)]})},192:(e,t,n)=>{"use strict";var r=n(8347);function i(e,t,n,r,i){var o="",s="",a=Math.floor(i/2)-1;return r-t>a&&(t=r-a+(o=" ... ").length),n-r>a&&(n=r+a-(s=" ...").length),{str:o+e.slice(t,n).replace(/\t/g,"\u2192")+s,pos:r-t+o.length}}function o(e,t){return r.repeat(" ",t-e.length)+e}e.exports=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,s=/\r?\n|\r|\0/g,a=[0],l=[],c=-1;n=s.exec(e.buffer);)l.push(n.index),a.push(n.index+n[0].length),e.position<=n.index&&c<0&&(c=a.length-2);c<0&&(c=a.length-1);var u,p,d="",f=Math.min(e.line+t.linesAfter,l.length).toString().length,h=t.maxLength-(t.indent+f+3);for(u=1;u<=t.linesBefore&&!(c-u<0);u++)p=i(e.buffer,a[c-u],l[c-u],e.position-(a[c]-a[c-u]),h),d=r.repeat(" ",t.indent)+o((e.line-u+1).toString(),f)+" | "+p.str+"\n"+d;for(p=i(e.buffer,a[c],l[c],e.position,h),d+=r.repeat(" ",t.indent)+o((e.line+1).toString(),f)+" | "+p.str+"\n",d+=r.repeat("-",t.indent+f+3+p.pos)+"^\n",u=1;u<=t.linesAfter&&!(c+u>=l.length);u++)p=i(e.buffer,a[c+u],l[c+u],e.position-(a[c]-a[c+u]),h),d+=r.repeat(" ",t.indent)+o((e.line+u+1).toString(),f)+" | "+p.str+"\n";return d.replace(/\n$/,"")}},1364:(e,t,n)=>{"use strict";var r=n(8425),i=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],o=["scalar","sequence","mapping"];e.exports=function(e,t){var n,s;if(t=t||{},Object.keys(t).forEach((function(t){if(-1===i.indexOf(t))throw new r('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=(n=t.styleAliases||null,s={},null!==n&&Object.keys(n).forEach((function(e){n[e].forEach((function(t){s[String(t)]=e}))})),s),-1===o.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}},3531:(e,t,n)=>{"use strict";var r=n(1364),i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";e.exports=new r("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=0,o=e.length,s=i;for(n=0;n<o;n++)if(!((t=s.indexOf(e.charAt(n)))>64)){if(t<0)return!1;r+=6}return r%8==0},construct:function(e){var t,n,r=e.replace(/[\r\n=]/g,""),o=r.length,s=i,a=0,l=[];for(t=0;t<o;t++)t%4==0&&t&&(l.push(a>>16&255),l.push(a>>8&255),l.push(255&a)),a=a<<6|s.indexOf(r.charAt(t));return 0===(n=o%4*6)?(l.push(a>>16&255),l.push(a>>8&255),l.push(255&a)):18===n?(l.push(a>>10&255),l.push(a>>2&255)):12===n&&l.push(a>>4&255),new Uint8Array(l)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,r="",o=0,s=e.length,a=i;for(t=0;t<s;t++)t%3==0&&t&&(r+=a[o>>18&63],r+=a[o>>12&63],r+=a[o>>6&63],r+=a[63&o]),o=(o<<8)+e[t];return 0===(n=s%3)?(r+=a[o>>18&63],r+=a[o>>12&63],r+=a[o>>6&63],r+=a[63&o]):2===n?(r+=a[o>>10&63],r+=a[o>>4&63],r+=a[o<<2&63],r+=a[64]):1===n&&(r+=a[o>>2&63],r+=a[o<<4&63],r+=a[64],r+=a[64]),r}})},8771:(e,t,n)=>{"use strict";var r=n(1364);e.exports=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},5215:(e,t,n)=>{"use strict";var r=n(8347),i=n(1364),o=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var s=/^[-+]?[0-9]+e/;e.exports=new i("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!o.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||r.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(e))return"-0.0";return n=e.toString(10),s.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},1518:(e,t,n)=>{"use strict";var r=n(8347),i=n(1364);function o(e){return 48<=e&&e<=55}function s(e){return 48<=e&&e<=57}e.exports=new i("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=e.length,i=0,a=!1;if(!r)return!1;if("-"!==(t=e[i])&&"+"!==t||(t=e[++i]),"0"===t){if(i+1===r)return!0;if("b"===(t=e[++i])){for(i++;i<r;i++)if("_"!==(t=e[i])){if("0"!==t&&"1"!==t)return!1;a=!0}return a&&"_"!==t}if("x"===t){for(i++;i<r;i++)if("_"!==(t=e[i])){if(!(48<=(n=e.charCodeAt(i))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return!1;a=!0}return a&&"_"!==t}if("o"===t){for(i++;i<r;i++)if("_"!==(t=e[i])){if(!o(e.charCodeAt(i)))return!1;a=!0}return a&&"_"!==t}}if("_"===t)return!1;for(;i<r;i++)if("_"!==(t=e[i])){if(!s(e.charCodeAt(i)))return!1;a=!0}return!(!a||"_"===t)},construct:function(e){var t,n=e,r=1;if(-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),"-"!==(t=n[0])&&"+"!==t||("-"===t&&(r=-1),t=(n=n.slice(1))[0]),"0"===n)return 0;if("0"===t){if("b"===n[1])return r*parseInt(n.slice(2),2);if("x"===n[1])return r*parseInt(n.slice(2),16);if("o"===n[1])return r*parseInt(n.slice(2),8)}return r*parseInt(n,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!r.isNegativeZero(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},945:(e,t,n)=>{"use strict";var r=n(1364);e.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},2913:(e,t,n)=>{"use strict";var r=n(1364);e.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}})},151:(e,t,n)=>{"use strict";var r=n(1364);e.exports=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})},1605:(e,t,n)=>{"use strict";var r=n(1364),i=Object.prototype.hasOwnProperty,o=Object.prototype.toString;e.exports=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,s,a,l=[],c=e;for(t=0,n=c.length;t<n;t+=1){if(r=c[t],a=!1,"[object Object]"!==o.call(r))return!1;for(s in r)if(i.call(r,s)){if(a)return!1;a=!0}if(!a)return!1;if(-1!==l.indexOf(s))return!1;l.push(s)}return!0},construct:function(e){return null!==e?e:[]}})},6879:(e,t,n)=>{"use strict";var r=n(1364),i=Object.prototype.toString;e.exports=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,o,s,a=e;for(s=new Array(a.length),t=0,n=a.length;t<n;t+=1){if(r=a[t],"[object Object]"!==i.call(r))return!1;if(1!==(o=Object.keys(r)).length)return!1;s[t]=[o[0],r[o[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,r,i,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1)r=s[t],i=Object.keys(r),o[t]=[i[0],r[i[0]]];return o}})},6451:(e,t,n)=>{"use strict";var r=n(1364);e.exports=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},4982:(e,t,n)=>{"use strict";var r=n(1364),i=Object.prototype.hasOwnProperty;e.exports=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(i.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}})},48:(e,t,n)=>{"use strict";var r=n(1364);e.exports=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},2156:(e,t,n)=>{"use strict";var r=n(1364),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),o=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");e.exports=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==i.exec(e)||null!==o.exec(e))},construct:function(e){var t,n,r,s,a,l,c,u,p=0,d=null;if(null===(t=i.exec(e))&&(t=o.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,s=+t[3],!t[4])return new Date(Date.UTC(n,r,s));if(a=+t[4],l=+t[5],c=+t[6],t[7]){for(p=t[7].slice(0,3);p.length<3;)p+="0";p=+p}return t[9]&&(d=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(d=-d)),u=new Date(Date.UTC(n,r,s,a,l,c,p)),d&&u.setTime(u.getTime()-d),u},instanceOf:Date,represent:function(e){return e.toISOString()}})},3573:(e,t,n)=>{"use strict";var r=n(9804);function i(e,t,n){if(3===arguments.length)return i.set(e,t,n);if(2===arguments.length)return i.get(e,t);var r=i.bind(i,e);for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o].bind(r,e));return r}e.exports=i,i.get=function(e,t){for(var n=Array.isArray(t)?t:i.parse(t),r=0;r<n.length;++r){var o=n[r];if("object"!=typeof e||!(o in e))throw new Error("Invalid reference token: "+o);e=e[o]}return e},i.set=function(e,t,n){var r=Array.isArray(t)?t:i.parse(t),o=r[0];if(0===r.length)throw Error("Can not set the root object");for(var s=0;s<r.length-1;++s){var a=r[s];"string"!=typeof a&&"number"!=typeof a&&(a=String(a)),"__proto__"!==a&&"constructor"!==a&&"prototype"!==a&&("-"===a&&Array.isArray(e)&&(a=e.length),o=r[s+1],a in e||(o.match(/^(\d+|-)$/)?e[a]=[]:e[a]={}),e=e[a])}return"-"===o&&Array.isArray(e)&&(o=e.length),e[o]=n,this},i.remove=function(e,t){var n=Array.isArray(t)?t:i.parse(t),r=n[n.length-1];if(void 0===r)throw new Error('Invalid JSON pointer for remove: "'+t+'"');var o=i.get(e,n.slice(0,-1));if(Array.isArray(o)){var s=+r;if(""===r&&isNaN(s))throw new Error('Invalid array index: "'+r+'"');Array.prototype.splice.call(o,s,1)}else delete o[r]},i.dict=function(e,t){var n={};return i.walk(e,(function(e,t){n[t]=e}),t),n},i.walk=function(e,t,n){var o=[];n=n||function(e){var t=Object.prototype.toString.call(e);return"[object Object]"===t||"[object Array]"===t},function e(s){r(s,(function(r,s){o.push(String(s)),n(r)?e(r):t(r,i.compile(o)),o.pop()}))}(e)},i.has=function(e,t){try{i.get(e,t)}catch(n){return!1}return!0},i.escape=function(e){return e.toString().replace(/~/g,"~0").replace(/\//g,"~1")},i.unescape=function(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")},i.parse=function(e){if(""===e)return[];if("/"!==e.charAt(0))throw new Error("Invalid JSON pointer: "+e);return e.substring(1).split(/\//).map(i.unescape)},i.compile=function(e){return 0===e.length?"":"/"+e.map(i.escape).join("/")}},2307:(e,t,n)=>{e=n.nmd(e);var r="__lodash_hash_undefined__",i=1,o=2,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",p="[object Date]",d="[object Error]",f="[object Function]",h="[object GeneratorFunction]",m="[object Map]",g="[object Number]",y="[object Null]",v="[object Object]",b="[object Promise]",x="[object Proxy]",w="[object RegExp]",k="[object Set]",O="[object String]",S="[object Symbol]",E="[object Undefined]",_="[object WeakMap]",A="[object ArrayBuffer]",j="[object DataView]",T=/^\[object .+?Constructor\]$/,P=/^(?:0|[1-9]\d*)$/,I={};I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I[a]=I[l]=I[A]=I[u]=I[j]=I[p]=I[d]=I[f]=I[m]=I[g]=I[v]=I[w]=I[k]=I[O]=I[_]=!1;var C="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,R="object"==typeof self&&self&&self.Object===Object&&self,N=C||R||Function("return this")(),L=t&&!t.nodeType&&t,$=L&&e&&!e.nodeType&&e,M=$&&$.exports===L,D=M&&C.process,F=function(){try{return D&&D.binding&&D.binding("util")}catch(e){}}(),B=F&&F.isTypedArray;function z(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function U(e,t){return e.has(t)}function q(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function W(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var V,Q,H,Y=Array.prototype,G=Function.prototype,X=Object.prototype,K=N["__core-js_shared__"],J=G.toString,Z=X.hasOwnProperty,ee=(V=/[^.]+$/.exec(K&&K.keys&&K.keys.IE_PROTO||""))?"Symbol(src)_1."+V:"",te=X.toString,ne=RegExp("^"+J.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=M?N.Buffer:void 0,ie=N.Symbol,oe=N.Uint8Array,se=X.propertyIsEnumerable,ae=Y.splice,le=ie?ie.toStringTag:void 0,ce=Object.getOwnPropertySymbols,ue=re?re.isBuffer:void 0,pe=(Q=Object.keys,H=Object,function(e){return Q(H(e))}),de=Be(N,"DataView"),fe=Be(N,"Map"),he=Be(N,"Promise"),me=Be(N,"Set"),ge=Be(N,"WeakMap"),ye=Be(Object,"create"),ve=We(de),be=We(fe),xe=We(he),we=We(me),ke=We(ge),Oe=ie?ie.prototype:void 0,Se=Oe?Oe.valueOf:void 0;function Ee(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function _e(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ae(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function je(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Ae;++t<n;)this.add(e[t])}function Te(e){var t=this.__data__=new _e(e);this.size=t.size}function Pe(e,t){var n=He(e),r=!n&&Qe(e),i=!n&&!r&&Ye(e),o=!n&&!r&&!i&&Ze(e),s=n||r||i||o,a=s?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=a.length;for(var c in e)!t&&!Z.call(e,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||qe(c,l))||a.push(c);return a}function Ie(e,t){for(var n=e.length;n--;)if(Ve(e[n][0],t))return n;return-1}function Ce(e){return null==e?void 0===e?E:y:le&&le in Object(e)?function(e){var t=Z.call(e,le),n=e[le];try{e[le]=void 0;var r=!0}catch(o){}var i=te.call(e);r&&(t?e[le]=n:delete e[le]);return i}(e):function(e){return te.call(e)}(e)}function Re(e){return Je(e)&&Ce(e)==a}function Ne(e,t,n,r,s){return e===t||(null==e||null==t||!Je(e)&&!Je(t)?e!=e&&t!=t:function(e,t,n,r,s,c){var f=He(e),h=He(t),y=f?l:Ue(e),b=h?l:Ue(t),x=(y=y==a?v:y)==v,E=(b=b==a?v:b)==v,_=y==b;if(_&&Ye(e)){if(!Ye(t))return!1;f=!0,x=!1}if(_&&!x)return c||(c=new Te),f||Ze(e)?Me(e,t,n,r,s,c):function(e,t,n,r,s,a,l){switch(n){case j:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case A:return!(e.byteLength!=t.byteLength||!a(new oe(e),new oe(t)));case u:case p:case g:return Ve(+e,+t);case d:return e.name==t.name&&e.message==t.message;case w:case O:return e==t+"";case m:var c=q;case k:var f=r&i;if(c||(c=W),e.size!=t.size&&!f)return!1;var h=l.get(e);if(h)return h==t;r|=o,l.set(e,t);var y=Me(c(e),c(t),r,s,a,l);return l.delete(e),y;case S:if(Se)return Se.call(e)==Se.call(t)}return!1}(e,t,y,n,r,s,c);if(!(n&i)){var T=x&&Z.call(e,"__wrapped__"),P=E&&Z.call(t,"__wrapped__");if(T||P){var I=T?e.value():e,C=P?t.value():t;return c||(c=new Te),s(I,C,n,r,c)}}if(!_)return!1;return c||(c=new Te),function(e,t,n,r,o,s){var a=n&i,l=De(e),c=l.length,u=De(t),p=u.length;if(c!=p&&!a)return!1;var d=c;for(;d--;){var f=l[d];if(!(a?f in t:Z.call(t,f)))return!1}var h=s.get(e);if(h&&s.get(t))return h==t;var m=!0;s.set(e,t),s.set(t,e);var g=a;for(;++d<c;){var y=e[f=l[d]],v=t[f];if(r)var b=a?r(v,y,f,t,e,s):r(y,v,f,e,t,s);if(!(void 0===b?y===v||o(y,v,n,r,s):b)){m=!1;break}g||(g="constructor"==f)}if(m&&!g){var x=e.constructor,w=t.constructor;x==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w||(m=!1)}return s.delete(e),s.delete(t),m}(e,t,n,r,s,c)}(e,t,n,r,Ne,s))}function Le(e){return!(!Ke(e)||function(e){return!!ee&&ee in e}(e))&&(Ge(e)?ne:T).test(We(e))}function $e(e){if(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||X,t!==r)return pe(e);var t,n,r,i=[];for(var o in Object(e))Z.call(e,o)&&"constructor"!=o&&i.push(o);return i}function Me(e,t,n,r,s,a){var l=n&i,c=e.length,u=t.length;if(c!=u&&!(l&&u>c))return!1;var p=a.get(e);if(p&&a.get(t))return p==t;var d=-1,f=!0,h=n&o?new je:void 0;for(a.set(e,t),a.set(t,e);++d<c;){var m=e[d],g=t[d];if(r)var y=l?r(g,m,d,t,e,a):r(m,g,d,e,t,a);if(void 0!==y){if(y)continue;f=!1;break}if(h){if(!z(t,(function(e,t){if(!U(h,t)&&(m===e||s(m,e,n,r,a)))return h.push(t)}))){f=!1;break}}else if(m!==g&&!s(m,g,n,r,a)){f=!1;break}}return a.delete(e),a.delete(t),f}function De(e){return function(e,t,n){var r=t(e);return He(e)?r:function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}(r,n(e))}(e,et,ze)}function Fe(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function Be(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Le(n)?n:void 0}Ee.prototype.clear=function(){this.__data__=ye?ye(null):{},this.size=0},Ee.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ee.prototype.get=function(e){var t=this.__data__;if(ye){var n=t[e];return n===r?void 0:n}return Z.call(t,e)?t[e]:void 0},Ee.prototype.has=function(e){var t=this.__data__;return ye?void 0!==t[e]:Z.call(t,e)},Ee.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ye&&void 0===t?r:t,this},_e.prototype.clear=function(){this.__data__=[],this.size=0},_e.prototype.delete=function(e){var t=this.__data__,n=Ie(t,e);return!(n<0)&&(n==t.length-1?t.pop():ae.call(t,n,1),--this.size,!0)},_e.prototype.get=function(e){var t=this.__data__,n=Ie(t,e);return n<0?void 0:t[n][1]},_e.prototype.has=function(e){return Ie(this.__data__,e)>-1},_e.prototype.set=function(e,t){var n=this.__data__,r=Ie(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Ae.prototype.clear=function(){this.size=0,this.__data__={hash:new Ee,map:new(fe||_e),string:new Ee}},Ae.prototype.delete=function(e){var t=Fe(this,e).delete(e);return this.size-=t?1:0,t},Ae.prototype.get=function(e){return Fe(this,e).get(e)},Ae.prototype.has=function(e){return Fe(this,e).has(e)},Ae.prototype.set=function(e,t){var n=Fe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},je.prototype.add=je.prototype.push=function(e){return this.__data__.set(e,r),this},je.prototype.has=function(e){return this.__data__.has(e)},Te.prototype.clear=function(){this.__data__=new _e,this.size=0},Te.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Te.prototype.get=function(e){return this.__data__.get(e)},Te.prototype.has=function(e){return this.__data__.has(e)},Te.prototype.set=function(e,t){var n=this.__data__;if(n instanceof _e){var r=n.__data__;if(!fe||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ae(r)}return n.set(e,t),this.size=n.size,this};var ze=ce?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}(ce(e),(function(t){return se.call(e,t)})))}:function(){return[]},Ue=Ce;function qe(e,t){return!!(t=null==t?s:t)&&("number"==typeof e||P.test(e))&&e>-1&&e%1==0&&e<t}function We(e){if(null!=e){try{return J.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Ve(e,t){return e===t||e!=e&&t!=t}(de&&Ue(new de(new ArrayBuffer(1)))!=j||fe&&Ue(new fe)!=m||he&&Ue(he.resolve())!=b||me&&Ue(new me)!=k||ge&&Ue(new ge)!=_)&&(Ue=function(e){var t=Ce(e),n=t==v?e.constructor:void 0,r=n?We(n):"";if(r)switch(r){case ve:return j;case be:return m;case xe:return b;case we:return k;case ke:return _}return t});var Qe=Re(function(){return arguments}())?Re:function(e){return Je(e)&&Z.call(e,"callee")&&!se.call(e,"callee")},He=Array.isArray;var Ye=ue||function(){return!1};function Ge(e){if(!Ke(e))return!1;var t=Ce(e);return t==f||t==h||t==c||t==x}function Xe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}function Ke(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Je(e){return null!=e&&"object"==typeof e}var Ze=B?function(e){return function(t){return e(t)}}(B):function(e){return Je(e)&&Xe(e.length)&&!!I[Ce(e)]};function et(e){return null!=(t=e)&&Xe(t.length)&&!Ge(t)?Pe(e):$e(e);var t}e.exports=function(e,t){return Ne(e,t)}},1336:(e,t,n)=>{var r,i;!function(){var o,s,a,l,c,u,p,d,f,h,m,g,y,v,b,x,w,k,O,S,E,_,A,j,T,P,I,C,R,N,L=function(e){var t=new L.Builder;return t.pipeline.add(L.trimmer,L.stopWordFilter,L.stemmer),t.searchPipeline.add(L.stemmer),e.call(t,t),t.build()};L.version="2.3.9",L.utils={},L.utils.warn=(o=this,function(e){o.console&&console.warn&&console.warn(e)}),L.utils.asString=function(e){return null==e?"":e.toString()},L.utils.clone=function(e){if(null==e)return e;for(var t=Object.create(null),n=Object.keys(e),r=0;r<n.length;r++){var i=n[r],o=e[i];if(Array.isArray(o))t[i]=o.slice();else{if("string"!=typeof o&&"number"!=typeof o&&"boolean"!=typeof o)throw new TypeError("clone is not deep and does not support nested objects");t[i]=o}}return t},L.FieldRef=function(e,t,n){this.docRef=e,this.fieldName=t,this._stringValue=n},L.FieldRef.joiner="/",L.FieldRef.fromString=function(e){var t=e.indexOf(L.FieldRef.joiner);if(-1===t)throw"malformed field ref string";var n=e.slice(0,t),r=e.slice(t+1);return new L.FieldRef(r,n,e)},L.FieldRef.prototype.toString=function(){return null==this._stringValue&&(this._stringValue=this.fieldName+L.FieldRef.joiner+this.docRef),this._stringValue},L.Set=function(e){if(this.elements=Object.create(null),e){this.length=e.length;for(var t=0;t<this.length;t++)this.elements[e[t]]=!0}else this.length=0},L.Set.complete={intersect:function(e){return e},union:function(){return this},contains:function(){return!0}},L.Set.empty={intersect:function(){return this},union:function(e){return e},contains:function(){return!1}},L.Set.prototype.contains=function(e){return!!this.elements[e]},L.Set.prototype.intersect=function(e){var t,n,r,i=[];if(e===L.Set.complete)return this;if(e===L.Set.empty)return e;this.length<e.length?(t=this,n=e):(t=e,n=this),r=Object.keys(t.elements);for(var o=0;o<r.length;o++){var s=r[o];s in n.elements&&i.push(s)}return new L.Set(i)},L.Set.prototype.union=function(e){return e===L.Set.complete?L.Set.complete:e===L.Set.empty?this:new L.Set(Object.keys(this.elements).concat(Object.keys(e.elements)))},L.idf=function(e,t){var n=0;for(var r in e)"_index"!=r&&(n+=Object.keys(e[r]).length);var i=(t-n+.5)/(n+.5);return Math.log(1+Math.abs(i))},L.Token=function(e,t){this.str=e||"",this.metadata=t||{}},L.Token.prototype.toString=function(){return this.str},L.Token.prototype.update=function(e){return this.str=e(this.str,this.metadata),this},L.Token.prototype.clone=function(e){return e=e||function(e){return e},new L.Token(e(this.str,this.metadata),this.metadata)},L.tokenizer=function(e,t){if(null==e||null==e)return[];if(Array.isArray(e))return e.map((function(e){return new L.Token(L.utils.asString(e).toLowerCase(),L.utils.clone(t))}));for(var n=e.toString().toLowerCase(),r=n.length,i=[],o=0,s=0;o<=r;o++){var a=o-s;if(n.charAt(o).match(L.tokenizer.separator)||o==r){if(a>0){var l=L.utils.clone(t)||{};l.position=[s,a],l.index=i.length,i.push(new L.Token(n.slice(s,o),l))}s=o+1}}return i},L.tokenizer.separator=/[\s\-]+/,L.Pipeline=function(){this._stack=[]},L.Pipeline.registeredFunctions=Object.create(null),L.Pipeline.registerFunction=function(e,t){t in this.registeredFunctions&&L.utils.warn("Overwriting existing registered function: "+t),e.label=t,L.Pipeline.registeredFunctions[e.label]=e},L.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||L.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},L.Pipeline.load=function(e){var t=new L.Pipeline;return e.forEach((function(e){var n=L.Pipeline.registeredFunctions[e];if(!n)throw new Error("Cannot load unregistered function: "+e);t.add(n)})),t},L.Pipeline.prototype.add=function(){Array.prototype.slice.call(arguments).forEach((function(e){L.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)}),this)},L.Pipeline.prototype.after=function(e,t){L.Pipeline.warnIfFunctionNotRegistered(t);var n=this._stack.indexOf(e);if(-1==n)throw new Error("Cannot find existingFn");n+=1,this._stack.splice(n,0,t)},L.Pipeline.prototype.before=function(e,t){L.Pipeline.warnIfFunctionNotRegistered(t);var n=this._stack.indexOf(e);if(-1==n)throw new Error("Cannot find existingFn");this._stack.splice(n,0,t)},L.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);-1!=t&&this._stack.splice(t,1)},L.Pipeline.prototype.run=function(e){for(var t=this._stack.length,n=0;n<t;n++){for(var r=this._stack[n],i=[],o=0;o<e.length;o++){var s=r(e[o],o,e);if(null!=s&&""!==s)if(Array.isArray(s))for(var a=0;a<s.length;a++)i.push(s[a]);else i.push(s)}e=i}return e},L.Pipeline.prototype.runString=function(e,t){var n=new L.Token(e,t);return this.run([n]).map((function(e){return e.toString()}))},L.Pipeline.prototype.reset=function(){this._stack=[]},L.Pipeline.prototype.toJSON=function(){return this._stack.map((function(e){return L.Pipeline.warnIfFunctionNotRegistered(e),e.label}))},L.Vector=function(e){this._magnitude=0,this.elements=e||[]},L.Vector.prototype.positionForIndex=function(e){if(0==this.elements.length)return 0;for(var t=0,n=this.elements.length/2,r=n-t,i=Math.floor(r/2),o=this.elements[2*i];r>1&&(o<e&&(t=i),o>e&&(n=i),o!=e);)r=n-t,i=t+Math.floor(r/2),o=this.elements[2*i];return o==e||o>e?2*i:o<e?2*(i+1):void 0},L.Vector.prototype.insert=function(e,t){this.upsert(e,t,(function(){throw"duplicate index"}))},L.Vector.prototype.upsert=function(e,t,n){this._magnitude=0;var r=this.positionForIndex(e);this.elements[r]==e?this.elements[r+1]=n(this.elements[r+1],t):this.elements.splice(r,0,e,t)},L.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var e=0,t=this.elements.length,n=1;n<t;n+=2){var r=this.elements[n];e+=r*r}return this._magnitude=Math.sqrt(e)},L.Vector.prototype.dot=function(e){for(var t=0,n=this.elements,r=e.elements,i=n.length,o=r.length,s=0,a=0,l=0,c=0;l<i&&c<o;)(s=n[l])<(a=r[c])?l+=2:s>a?c+=2:s==a&&(t+=n[l+1]*r[c+1],l+=2,c+=2);return t},L.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},L.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,n=0;t<this.elements.length;t+=2,n++)e[n]=this.elements[t];return e},L.Vector.prototype.toJSON=function(){return this.elements},L.stemmer=(s={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},a={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},p="^("+(c="[^aeiou][^aeiouy]*")+")?"+(u=(l="[aeiouy]")+"[aeiou]*")+c+"("+u+")?$",d="^("+c+")?"+u+c+u+c,f="^("+c+")?"+l,h=new RegExp("^("+c+")?"+u+c),m=new RegExp(d),g=new RegExp(p),y=new RegExp(f),v=/^(.+?)(ss|i)es$/,b=/^(.+?)([^s])s$/,x=/^(.+?)eed$/,w=/^(.+?)(ed|ing)$/,k=/.$/,O=/(at|bl|iz)$/,S=new RegExp("([^aeiouylsz])\\1$"),E=new RegExp("^"+c+l+"[^aeiouwxy]$"),_=/^(.+?[^aeiou])y$/,A=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,j=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,T=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,P=/^(.+?)(s|t)(ion)$/,I=/^(.+?)e$/,C=/ll$/,R=new RegExp("^"+c+l+"[^aeiouwxy]$"),N=function(e){var t,n,r,i,o,l,c;if(e.length<3)return e;if("y"==(r=e.substr(0,1))&&(e=r.toUpperCase()+e.substr(1)),o=b,(i=v).test(e)?e=e.replace(i,"$1$2"):o.test(e)&&(e=e.replace(o,"$1$2")),o=w,(i=x).test(e)){var u=i.exec(e);(i=h).test(u[1])&&(i=k,e=e.replace(i,""))}else o.test(e)&&(t=(u=o.exec(e))[1],(o=y).test(t)&&(l=S,c=E,(o=O).test(e=t)?e+="e":l.test(e)?(i=k,e=e.replace(i,"")):c.test(e)&&(e+="e")));return(i=_).test(e)&&(e=(t=(u=i.exec(e))[1])+"i"),(i=A).test(e)&&(t=(u=i.exec(e))[1],n=u[2],(i=h).test(t)&&(e=t+s[n])),(i=j).test(e)&&(t=(u=i.exec(e))[1],n=u[2],(i=h).test(t)&&(e=t+a[n])),o=P,(i=T).test(e)?(t=(u=i.exec(e))[1],(i=m).test(t)&&(e=t)):o.test(e)&&(t=(u=o.exec(e))[1]+u[2],(o=m).test(t)&&(e=t)),(i=I).test(e)&&(t=(u=i.exec(e))[1],o=g,l=R,((i=m).test(t)||o.test(t)&&!l.test(t))&&(e=t)),o=m,(i=C).test(e)&&o.test(e)&&(i=k,e=e.replace(i,"")),"y"==r&&(e=r.toLowerCase()+e.substr(1)),e},function(e){return e.update(N)}),L.Pipeline.registerFunction(L.stemmer,"stemmer"),L.generateStopWordFilter=function(e){var t=e.reduce((function(e,t){return e[t]=t,e}),{});return function(e){if(e&&t[e.toString()]!==e.toString())return e}},L.stopWordFilter=L.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),L.Pipeline.registerFunction(L.stopWordFilter,"stopWordFilter"),L.trimmer=function(e){return e.update((function(e){return e.replace(/^\W+/,"").replace(/\W+$/,"")}))},L.Pipeline.registerFunction(L.trimmer,"trimmer"),L.TokenSet=function(){this.final=!1,this.edges={},this.id=L.TokenSet._nextId,L.TokenSet._nextId+=1},L.TokenSet._nextId=1,L.TokenSet.fromArray=function(e){for(var t=new L.TokenSet.Builder,n=0,r=e.length;n<r;n++)t.insert(e[n]);return t.finish(),t.root},L.TokenSet.fromClause=function(e){return"editDistance"in e?L.TokenSet.fromFuzzyString(e.term,e.editDistance):L.TokenSet.fromString(e.term)},L.TokenSet.fromFuzzyString=function(e,t){for(var n=new L.TokenSet,r=[{node:n,editsRemaining:t,str:e}];r.length;){var i=r.pop();if(i.str.length>0){var o,s=i.str.charAt(0);s in i.node.edges?o=i.node.edges[s]:(o=new L.TokenSet,i.node.edges[s]=o),1==i.str.length&&(o.final=!0),r.push({node:o,editsRemaining:i.editsRemaining,str:i.str.slice(1)})}if(0!=i.editsRemaining){if("*"in i.node.edges)var a=i.node.edges["*"];else{a=new L.TokenSet;i.node.edges["*"]=a}if(0==i.str.length&&(a.final=!0),r.push({node:a,editsRemaining:i.editsRemaining-1,str:i.str}),i.str.length>1&&r.push({node:i.node,editsRemaining:i.editsRemaining-1,str:i.str.slice(1)}),1==i.str.length&&(i.node.final=!0),i.str.length>=1){if("*"in i.node.edges)var l=i.node.edges["*"];else{l=new L.TokenSet;i.node.edges["*"]=l}1==i.str.length&&(l.final=!0),r.push({node:l,editsRemaining:i.editsRemaining-1,str:i.str.slice(1)})}if(i.str.length>1){var c,u=i.str.charAt(0),p=i.str.charAt(1);p in i.node.edges?c=i.node.edges[p]:(c=new L.TokenSet,i.node.edges[p]=c),1==i.str.length&&(c.final=!0),r.push({node:c,editsRemaining:i.editsRemaining-1,str:u+i.str.slice(2)})}}}return n},L.TokenSet.fromString=function(e){for(var t=new L.TokenSet,n=t,r=0,i=e.length;r<i;r++){var o=e[r],s=r==i-1;if("*"==o)t.edges[o]=t,t.final=s;else{var a=new L.TokenSet;a.final=s,t.edges[o]=a,t=a}}return n},L.TokenSet.prototype.toArray=function(){for(var e=[],t=[{prefix:"",node:this}];t.length;){var n=t.pop(),r=Object.keys(n.node.edges),i=r.length;n.node.final&&(n.prefix.charAt(0),e.push(n.prefix));for(var o=0;o<i;o++){var s=r[o];t.push({prefix:n.prefix.concat(s),node:n.node.edges[s]})}}return e},L.TokenSet.prototype.toString=function(){if(this._str)return this._str;for(var e=this.final?"1":"0",t=Object.keys(this.edges).sort(),n=t.length,r=0;r<n;r++){var i=t[r];e=e+i+this.edges[i].id}return e},L.TokenSet.prototype.intersect=function(e){for(var t=new L.TokenSet,n=void 0,r=[{qNode:e,output:t,node:this}];r.length;){n=r.pop();for(var i=Object.keys(n.qNode.edges),o=i.length,s=Object.keys(n.node.edges),a=s.length,l=0;l<o;l++)for(var c=i[l],u=0;u<a;u++){var p=s[u];if(p==c||"*"==c){var d=n.node.edges[p],f=n.qNode.edges[c],h=d.final&&f.final,m=void 0;p in n.output.edges?(m=n.output.edges[p]).final=m.final||h:((m=new L.TokenSet).final=h,n.output.edges[p]=m),r.push({qNode:f,output:m,node:d})}}}return t},L.TokenSet.Builder=function(){this.previousWord="",this.root=new L.TokenSet,this.uncheckedNodes=[],this.minimizedNodes={}},L.TokenSet.Builder.prototype.insert=function(e){var t,n=0;if(e<this.previousWord)throw new Error("Out of order word insertion");for(var r=0;r<e.length&&r<this.previousWord.length&&e[r]==this.previousWord[r];r++)n++;this.minimize(n),t=0==this.uncheckedNodes.length?this.root:this.uncheckedNodes[this.uncheckedNodes.length-1].child;for(r=n;r<e.length;r++){var i=new L.TokenSet,o=e[r];t.edges[o]=i,this.uncheckedNodes.push({parent:t,char:o,child:i}),t=i}t.final=!0,this.previousWord=e},L.TokenSet.Builder.prototype.finish=function(){this.minimize(0)},L.TokenSet.Builder.prototype.minimize=function(e){for(var t=this.uncheckedNodes.length-1;t>=e;t--){var n=this.uncheckedNodes[t],r=n.child.toString();r in this.minimizedNodes?n.parent.edges[n.char]=this.minimizedNodes[r]:(n.child._str=r,this.minimizedNodes[r]=n.child),this.uncheckedNodes.pop()}},L.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},L.Index.prototype.search=function(e){return this.query((function(t){new L.QueryParser(e,t).parse()}))},L.Index.prototype.query=function(e){for(var t=new L.Query(this.fields),n=Object.create(null),r=Object.create(null),i=Object.create(null),o=Object.create(null),s=Object.create(null),a=0;a<this.fields.length;a++)r[this.fields[a]]=new L.Vector;e.call(t,t);for(a=0;a<t.clauses.length;a++){var l=t.clauses[a],c=null,u=L.Set.empty;c=l.usePipeline?this.pipeline.runString(l.term,{fields:l.fields}):[l.term];for(var p=0;p<c.length;p++){var d=c[p];l.term=d;var f=L.TokenSet.fromClause(l),h=this.tokenSet.intersect(f).toArray();if(0===h.length&&l.presence===L.Query.presence.REQUIRED){for(var m=0;m<l.fields.length;m++){o[I=l.fields[m]]=L.Set.empty}break}for(var g=0;g<h.length;g++){var y=h[g],v=this.invertedIndex[y],b=v._index;for(m=0;m<l.fields.length;m++){var x=v[I=l.fields[m]],w=Object.keys(x),k=y+"/"+I,O=new L.Set(w);if(l.presence==L.Query.presence.REQUIRED&&(u=u.union(O),void 0===o[I]&&(o[I]=L.Set.complete)),l.presence!=L.Query.presence.PROHIBITED){if(r[I].upsert(b,l.boost,(function(e,t){return e+t})),!i[k]){for(var S=0;S<w.length;S++){var E,_=w[S],A=new L.FieldRef(_,I),j=x[_];void 0===(E=n[A])?n[A]=new L.MatchData(y,I,j):E.add(y,I,j)}i[k]=!0}}else void 0===s[I]&&(s[I]=L.Set.empty),s[I]=s[I].union(O)}}}if(l.presence===L.Query.presence.REQUIRED)for(m=0;m<l.fields.length;m++){o[I=l.fields[m]]=o[I].intersect(u)}}var T=L.Set.complete,P=L.Set.empty;for(a=0;a<this.fields.length;a++){var I;o[I=this.fields[a]]&&(T=T.intersect(o[I])),s[I]&&(P=P.union(s[I]))}var C=Object.keys(n),R=[],N=Object.create(null);if(t.isNegated()){C=Object.keys(this.fieldVectors);for(a=0;a<C.length;a++){A=C[a];var $=L.FieldRef.fromString(A);n[A]=new L.MatchData}}for(a=0;a<C.length;a++){var M=($=L.FieldRef.fromString(C[a])).docRef;if(T.contains(M)&&!P.contains(M)){var D,F=this.fieldVectors[$],B=r[$.fieldName].similarity(F);if(void 0!==(D=N[M]))D.score+=B,D.matchData.combine(n[$]);else{var z={ref:M,score:B,matchData:n[$]};N[M]=z,R.push(z)}}}return R.sort((function(e,t){return t.score-e.score}))},L.Index.prototype.toJSON=function(){var e=Object.keys(this.invertedIndex).sort().map((function(e){return[e,this.invertedIndex[e]]}),this),t=Object.keys(this.fieldVectors).map((function(e){return[e,this.fieldVectors[e].toJSON()]}),this);return{version:L.version,fields:this.fields,fieldVectors:t,invertedIndex:e,pipeline:this.pipeline.toJSON()}},L.Index.load=function(e){var t={},n={},r=e.fieldVectors,i=Object.create(null),o=e.invertedIndex,s=new L.TokenSet.Builder,a=L.Pipeline.load(e.pipeline);e.version!=L.version&&L.utils.warn("Version mismatch when loading serialised index. Current version of lunr '"+L.version+"' does not match serialized index '"+e.version+"'");for(var l=0;l<r.length;l++){var c=(p=r[l])[0],u=p[1];n[c]=new L.Vector(u)}for(l=0;l<o.length;l++){var p,d=(p=o[l])[0],f=p[1];s.insert(d),i[d]=f}return s.finish(),t.fields=e.fields,t.fieldVectors=n,t.invertedIndex=i,t.tokenSet=s.root,t.pipeline=a,new L.Index(t)},L.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=L.tokenizer,this.pipeline=new L.Pipeline,this.searchPipeline=new L.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},L.Builder.prototype.ref=function(e){this._ref=e},L.Builder.prototype.field=function(e,t){if(/\//.test(e))throw new RangeError("Field '"+e+"' contains illegal character '/'");this._fields[e]=t||{}},L.Builder.prototype.b=function(e){this._b=e<0?0:e>1?1:e},L.Builder.prototype.k1=function(e){this._k1=e},L.Builder.prototype.add=function(e,t){var n=e[this._ref],r=Object.keys(this._fields);this._documents[n]=t||{},this.documentCount+=1;for(var i=0;i<r.length;i++){var o=r[i],s=this._fields[o].extractor,a=s?s(e):e[o],l=this.tokenizer(a,{fields:[o]}),c=this.pipeline.run(l),u=new L.FieldRef(n,o),p=Object.create(null);this.fieldTermFrequencies[u]=p,this.fieldLengths[u]=0,this.fieldLengths[u]+=c.length;for(var d=0;d<c.length;d++){var f=c[d];if(null==p[f]&&(p[f]=0),p[f]+=1,null==this.invertedIndex[f]){var h=Object.create(null);h._index=this.termIndex,this.termIndex+=1;for(var m=0;m<r.length;m++)h[r[m]]=Object.create(null);this.invertedIndex[f]=h}null==this.invertedIndex[f][o][n]&&(this.invertedIndex[f][o][n]=Object.create(null));for(var g=0;g<this.metadataWhitelist.length;g++){var y=this.metadataWhitelist[g],v=f.metadata[y];null==this.invertedIndex[f][o][n][y]&&(this.invertedIndex[f][o][n][y]=[]),this.invertedIndex[f][o][n][y].push(v)}}}},L.Builder.prototype.calculateAverageFieldLengths=function(){for(var e=Object.keys(this.fieldLengths),t=e.length,n={},r={},i=0;i<t;i++){var o=L.FieldRef.fromString(e[i]),s=o.fieldName;r[s]||(r[s]=0),r[s]+=1,n[s]||(n[s]=0),n[s]+=this.fieldLengths[o]}var a=Object.keys(this._fields);for(i=0;i<a.length;i++){var l=a[i];n[l]=n[l]/r[l]}this.averageFieldLength=n},L.Builder.prototype.createFieldVectors=function(){for(var e={},t=Object.keys(this.fieldTermFrequencies),n=t.length,r=Object.create(null),i=0;i<n;i++){for(var o=L.FieldRef.fromString(t[i]),s=o.fieldName,a=this.fieldLengths[o],l=new L.Vector,c=this.fieldTermFrequencies[o],u=Object.keys(c),p=u.length,d=this._fields[s].boost||1,f=this._documents[o.docRef].boost||1,h=0;h<p;h++){var m,g,y,v=u[h],b=c[v],x=this.invertedIndex[v]._index;void 0===r[v]?(m=L.idf(this.invertedIndex[v],this.documentCount),r[v]=m):m=r[v],g=m*((this._k1+1)*b)/(this._k1*(1-this._b+this._b*(a/this.averageFieldLength[s]))+b),g*=d,g*=f,y=Math.round(1e3*g)/1e3,l.insert(x,y)}e[o]=l}this.fieldVectors=e},L.Builder.prototype.createTokenSet=function(){this.tokenSet=L.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},L.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new L.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},L.Builder.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},L.MatchData=function(e,t,n){for(var r=Object.create(null),i=Object.keys(n||{}),o=0;o<i.length;o++){var s=i[o];r[s]=n[s].slice()}this.metadata=Object.create(null),void 0!==e&&(this.metadata[e]=Object.create(null),this.metadata[e][t]=r)},L.MatchData.prototype.combine=function(e){for(var t=Object.keys(e.metadata),n=0;n<t.length;n++){var r=t[n],i=Object.keys(e.metadata[r]);null==this.metadata[r]&&(this.metadata[r]=Object.create(null));for(var o=0;o<i.length;o++){var s=i[o],a=Object.keys(e.metadata[r][s]);null==this.metadata[r][s]&&(this.metadata[r][s]=Object.create(null));for(var l=0;l<a.length;l++){var c=a[l];null==this.metadata[r][s][c]?this.metadata[r][s][c]=e.metadata[r][s][c]:this.metadata[r][s][c]=this.metadata[r][s][c].concat(e.metadata[r][s][c])}}}},L.MatchData.prototype.add=function(e,t,n){if(!(e in this.metadata))return this.metadata[e]=Object.create(null),void(this.metadata[e][t]=n);if(t in this.metadata[e])for(var r=Object.keys(n),i=0;i<r.length;i++){var o=r[i];o in this.metadata[e][t]?this.metadata[e][t][o]=this.metadata[e][t][o].concat(n[o]):this.metadata[e][t][o]=n[o]}else this.metadata[e][t]=n},L.Query=function(e){this.clauses=[],this.allFields=e},L.Query.wildcard=new String("*"),L.Query.wildcard.NONE=0,L.Query.wildcard.LEADING=1,L.Query.wildcard.TRAILING=2,L.Query.presence={OPTIONAL:1,REQUIRED:2,PROHIBITED:3},L.Query.prototype.clause=function(e){return"fields"in e||(e.fields=this.allFields),"boost"in e||(e.boost=1),"usePipeline"in e||(e.usePipeline=!0),"wildcard"in e||(e.wildcard=L.Query.wildcard.NONE),e.wildcard&L.Query.wildcard.LEADING&&e.term.charAt(0)!=L.Query.wildcard&&(e.term="*"+e.term),e.wildcard&L.Query.wildcard.TRAILING&&e.term.slice(-1)!=L.Query.wildcard&&(e.term=e.term+"*"),"presence"in e||(e.presence=L.Query.presence.OPTIONAL),this.clauses.push(e),this},L.Query.prototype.isNegated=function(){for(var e=0;e<this.clauses.length;e++)if(this.clauses[e].presence!=L.Query.presence.PROHIBITED)return!1;return!0},L.Query.prototype.term=function(e,t){if(Array.isArray(e))return e.forEach((function(e){this.term(e,L.utils.clone(t))}),this),this;var n=t||{};return n.term=e.toString(),this.clause(n),this},L.QueryParseError=function(e,t,n){this.name="QueryParseError",this.message=e,this.start=t,this.end=n},L.QueryParseError.prototype=new Error,L.QueryLexer=function(e){this.lexemes=[],this.str=e,this.length=e.length,this.pos=0,this.start=0,this.escapeCharPositions=[]},L.QueryLexer.prototype.run=function(){for(var e=L.QueryLexer.lexText;e;)e=e(this)},L.QueryLexer.prototype.sliceString=function(){for(var e=[],t=this.start,n=this.pos,r=0;r<this.escapeCharPositions.length;r++)n=this.escapeCharPositions[r],e.push(this.str.slice(t,n)),t=n+1;return e.push(this.str.slice(t,this.pos)),this.escapeCharPositions.length=0,e.join("")},L.QueryLexer.prototype.emit=function(e){this.lexemes.push({type:e,str:this.sliceString(),start:this.start,end:this.pos}),this.start=this.pos},L.QueryLexer.prototype.escapeCharacter=function(){this.escapeCharPositions.push(this.pos-1),this.pos+=1},L.QueryLexer.prototype.next=function(){if(this.pos>=this.length)return L.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},L.QueryLexer.prototype.width=function(){return this.pos-this.start},L.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},L.QueryLexer.prototype.backup=function(){this.pos-=1},L.QueryLexer.prototype.acceptDigitRun=function(){var e,t;do{t=(e=this.next()).charCodeAt(0)}while(t>47&&t<58);e!=L.QueryLexer.EOS&&this.backup()},L.QueryLexer.prototype.more=function(){return this.pos<this.length},L.QueryLexer.EOS="EOS",L.QueryLexer.FIELD="FIELD",L.QueryLexer.TERM="TERM",L.QueryLexer.EDIT_DISTANCE="EDIT_DISTANCE",L.QueryLexer.BOOST="BOOST",L.QueryLexer.PRESENCE="PRESENCE",L.QueryLexer.lexField=function(e){return e.backup(),e.emit(L.QueryLexer.FIELD),e.ignore(),L.QueryLexer.lexText},L.QueryLexer.lexTerm=function(e){if(e.width()>1&&(e.backup(),e.emit(L.QueryLexer.TERM)),e.ignore(),e.more())return L.QueryLexer.lexText},L.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(L.QueryLexer.EDIT_DISTANCE),L.QueryLexer.lexText},L.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(L.QueryLexer.BOOST),L.QueryLexer.lexText},L.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(L.QueryLexer.TERM)},L.QueryLexer.termSeparator=L.tokenizer.separator,L.QueryLexer.lexText=function(e){for(;;){var t=e.next();if(t==L.QueryLexer.EOS)return L.QueryLexer.lexEOS;if(92!=t.charCodeAt(0)){if(":"==t)return L.QueryLexer.lexField;if("~"==t)return e.backup(),e.width()>0&&e.emit(L.QueryLexer.TERM),L.QueryLexer.lexEditDistance;if("^"==t)return e.backup(),e.width()>0&&e.emit(L.QueryLexer.TERM),L.QueryLexer.lexBoost;if("+"==t&&1===e.width())return e.emit(L.QueryLexer.PRESENCE),L.QueryLexer.lexText;if("-"==t&&1===e.width())return e.emit(L.QueryLexer.PRESENCE),L.QueryLexer.lexText;if(t.match(L.QueryLexer.termSeparator))return L.QueryLexer.lexTerm}else e.escapeCharacter()}},L.QueryParser=function(e,t){this.lexer=new L.QueryLexer(e),this.query=t,this.currentClause={},this.lexemeIdx=0},L.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=L.QueryParser.parseClause;e;)e=e(this);return this.query},L.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},L.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},L.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},L.QueryParser.parseClause=function(e){var t=e.peekLexeme();if(null!=t)switch(t.type){case L.QueryLexer.PRESENCE:return L.QueryParser.parsePresence;case L.QueryLexer.FIELD:return L.QueryParser.parseField;case L.QueryLexer.TERM:return L.QueryParser.parseTerm;default:var n="expected either a field or a term, found "+t.type;throw t.str.length>=1&&(n+=" with value '"+t.str+"'"),new L.QueryParseError(n,t.start,t.end)}},L.QueryParser.parsePresence=function(e){var t=e.consumeLexeme();if(null!=t){switch(t.str){case"-":e.currentClause.presence=L.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=L.Query.presence.REQUIRED;break;default:var n="unrecognised presence operator'"+t.str+"'";throw new L.QueryParseError(n,t.start,t.end)}var r=e.peekLexeme();if(null==r){n="expecting term or field, found nothing";throw new L.QueryParseError(n,t.start,t.end)}switch(r.type){case L.QueryLexer.FIELD:return L.QueryParser.parseField;case L.QueryLexer.TERM:return L.QueryParser.parseTerm;default:n="expecting term or field, found '"+r.type+"'";throw new L.QueryParseError(n,r.start,r.end)}}},L.QueryParser.parseField=function(e){var t=e.consumeLexeme();if(null!=t){if(-1==e.query.allFields.indexOf(t.str)){var n=e.query.allFields.map((function(e){return"'"+e+"'"})).join(", "),r="unrecognised field '"+t.str+"', possible fields: "+n;throw new L.QueryParseError(r,t.start,t.end)}e.currentClause.fields=[t.str];var i=e.peekLexeme();if(null==i){r="expecting term, found nothing";throw new L.QueryParseError(r,t.start,t.end)}if(i.type===L.QueryLexer.TERM)return L.QueryParser.parseTerm;r="expecting term, found '"+i.type+"'";throw new L.QueryParseError(r,i.start,i.end)}},L.QueryParser.parseTerm=function(e){var t=e.consumeLexeme();if(null!=t){e.currentClause.term=t.str.toLowerCase(),-1!=t.str.indexOf("*")&&(e.currentClause.usePipeline=!1);var n=e.peekLexeme();if(null!=n)switch(n.type){case L.QueryLexer.TERM:return e.nextClause(),L.QueryParser.parseTerm;case L.QueryLexer.FIELD:return e.nextClause(),L.QueryParser.parseField;case L.QueryLexer.EDIT_DISTANCE:return L.QueryParser.parseEditDistance;case L.QueryLexer.BOOST:return L.QueryParser.parseBoost;case L.QueryLexer.PRESENCE:return e.nextClause(),L.QueryParser.parsePresence;default:var r="Unexpected lexeme type '"+n.type+"'";throw new L.QueryParseError(r,n.start,n.end)}else e.nextClause()}},L.QueryParser.parseEditDistance=function(e){var t=e.consumeLexeme();if(null!=t){var n=parseInt(t.str,10);if(isNaN(n)){var r="edit distance must be numeric";throw new L.QueryParseError(r,t.start,t.end)}e.currentClause.editDistance=n;var i=e.peekLexeme();if(null!=i)switch(i.type){case L.QueryLexer.TERM:return e.nextClause(),L.QueryParser.parseTerm;case L.QueryLexer.FIELD:return e.nextClause(),L.QueryParser.parseField;case L.QueryLexer.EDIT_DISTANCE:return L.QueryParser.parseEditDistance;case L.QueryLexer.BOOST:return L.QueryParser.parseBoost;case L.QueryLexer.PRESENCE:return e.nextClause(),L.QueryParser.parsePresence;default:r="Unexpected lexeme type '"+i.type+"'";throw new L.QueryParseError(r,i.start,i.end)}else e.nextClause()}},L.QueryParser.parseBoost=function(e){var t=e.consumeLexeme();if(null!=t){var n=parseInt(t.str,10);if(isNaN(n)){var r="boost must be numeric";throw new L.QueryParseError(r,t.start,t.end)}e.currentClause.boost=n;var i=e.peekLexeme();if(null!=i)switch(i.type){case L.QueryLexer.TERM:return e.nextClause(),L.QueryParser.parseTerm;case L.QueryLexer.FIELD:return e.nextClause(),L.QueryParser.parseField;case L.QueryLexer.EDIT_DISTANCE:return L.QueryParser.parseEditDistance;case L.QueryLexer.BOOST:return L.QueryParser.parseBoost;case L.QueryLexer.PRESENCE:return e.nextClause(),L.QueryParser.parsePresence;default:r="Unexpected lexeme type '"+i.type+"'";throw new L.QueryParseError(r,i.start,i.end)}else e.nextClause()}},void 0===(i="function"==typeof(r=function(){return L})?r.call(t,n,t,e):r)||(e.exports=i)}()},813:function(e){e.exports=function(){"use strict";var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},n=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(n){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5e3;t(this,e),this.ctx=n,this.iframes=r,this.exclude=i,this.iframesTimeout=o}return n(e,[{key:"getContexts",value:function(){var e=[];return(void 0!==this.ctx&&this.ctx?NodeList.prototype.isPrototypeOf(this.ctx)?Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?this.ctx:"string"==typeof this.ctx?Array.prototype.slice.call(document.querySelectorAll(this.ctx)):[this.ctx]:[]).forEach((function(t){var n=e.filter((function(e){return e.contains(t)})).length>0;-1!==e.indexOf(t)||n||e.push(t)})),e}},{key:"getIframeContents",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=void 0;try{var i=e.contentWindow;if(r=i.document,!i||!r)throw new Error("iframe inaccessible")}catch(o){n()}r&&t(r)}},{key:"isIframeBlank",value:function(e){var t="about:blank",n=e.getAttribute("src").trim();return e.contentWindow.location.href===t&&n!==t&&n}},{key:"observeIframeLoad",value:function(e,t,n){var r=this,i=!1,o=null,s=function s(){if(!i){i=!0,clearTimeout(o);try{r.isIframeBlank(e)||(e.removeEventListener("load",s),r.getIframeContents(e,t,n))}catch(a){n()}}};e.addEventListener("load",s),o=setTimeout(s,this.iframesTimeout)}},{key:"onIframeReady",value:function(e,t,n){try{"complete"===e.contentWindow.document.readyState?this.isIframeBlank(e)?this.observeIframeLoad(e,t,n):this.getIframeContents(e,t,n):this.observeIframeLoad(e,t,n)}catch(r){n()}}},{key:"waitForIframes",value:function(e,t){var n=this,r=0;this.forEachIframe(e,(function(){return!0}),(function(e){r++,n.waitForIframes(e.querySelector("html"),(function(){--r||t()}))}),(function(e){e||t()}))}},{key:"forEachIframe",value:function(t,n,r){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},s=t.querySelectorAll("iframe"),a=s.length,l=0;s=Array.prototype.slice.call(s);var c=function(){--a<=0&&o(l)};a||c(),s.forEach((function(t){e.matches(t,i.exclude)?c():i.onIframeReady(t,(function(e){n(t)&&(l++,r(e)),c()}),c)}))}},{key:"createIterator",value:function(e,t,n){return document.createNodeIterator(e,t,n,!1)}},{key:"createInstanceOnIframe",value:function(t){return new e(t.querySelector("html"),this.iframes)}},{key:"compareNodeIframe",value:function(e,t,n){if(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING){if(null===t)return!0;if(t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)return!0}return!1}},{key:"getIteratorNode",value:function(e){var t=e.previousNode();return{prevNode:t,node:(null===t||e.nextNode())&&e.nextNode()}}},{key:"checkIframeFilter",value:function(e,t,n,r){var i=!1,o=!1;return r.forEach((function(e,t){e.val===n&&(i=t,o=e.handled)})),this.compareNodeIframe(e,t,n)?(!1!==i||o?!1===i||o||(r[i].handled=!0):r.push({val:n,handled:!0}),!0):(!1===i&&r.push({val:n,handled:!1}),!1)}},{key:"handleOpenIframes",value:function(e,t,n,r){var i=this;e.forEach((function(e){e.handled||i.getIframeContents(e.val,(function(e){i.createInstanceOnIframe(e).forEachNode(t,n,r)}))}))}},{key:"iterateThroughNodes",value:function(e,t,n,r,i){for(var o=this,s=this.createIterator(t,e,r),a=[],l=[],c=void 0,u=void 0,p=function(){var e=o.getIteratorNode(s);return u=e.prevNode,c=e.node};p();)this.iframes&&this.forEachIframe(t,(function(e){return o.checkIframeFilter(c,u,e,a)}),(function(t){o.createInstanceOnIframe(t).forEachNode(e,(function(e){return l.push(e)}),r)})),l.push(c);l.forEach((function(e){n(e)})),this.iframes&&this.handleOpenIframes(a,e,n,r),i()}},{key:"forEachNode",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},o=this.getContexts(),s=o.length;s||i(),o.forEach((function(o){var a=function(){r.iterateThroughNodes(e,o,t,n,(function(){--s<=0&&i()}))};r.iframes?r.waitForIframes(o,a):a()}))}}],[{key:"matches",value:function(e,t){var n="string"==typeof t?[t]:t,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;if(r){var i=!1;return n.every((function(t){return!r.call(e,t)||(i=!0,!1)})),i}return!1}}]),e}(),o=function(){function o(e){t(this,o),this.ctx=e,this.ie=!1;var n=window.navigator.userAgent;(n.indexOf("MSIE")>-1||n.indexOf("Trident")>-1)&&(this.ie=!0)}return n(o,[{key:"log",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"debug",r=this.opt.log;this.opt.debug&&"object"===(void 0===r?"undefined":e(r))&&"function"==typeof r[n]&&r[n]("mark.js: "+t)}},{key:"escapeStr",value:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}},{key:"createRegExp",value:function(e){return"disabled"!==this.opt.wildcards&&(e=this.setupWildcardsRegExp(e)),e=this.escapeStr(e),Object.keys(this.opt.synonyms).length&&(e=this.createSynonymsRegExp(e)),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),this.opt.diacritics&&(e=this.createDiacriticsRegExp(e)),e=this.createMergedBlanksRegExp(e),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.createJoinersRegExp(e)),"disabled"!==this.opt.wildcards&&(e=this.createWildcardsRegExp(e)),e=this.createAccuracyRegExp(e)}},{key:"createSynonymsRegExp",value:function(e){var t=this.opt.synonyms,n=this.opt.caseSensitive?"":"i",r=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(var i in t)if(t.hasOwnProperty(i)){var o=t[i],s="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(i):this.escapeStr(i),a="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(o):this.escapeStr(o);""!==s&&""!==a&&(e=e.replace(new RegExp("("+this.escapeStr(s)+"|"+this.escapeStr(a)+")","gm"+n),r+"("+this.processSynomyms(s)+"|"+this.processSynomyms(a)+")"+r))}return e}},{key:"processSynomyms",value:function(e){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),e}},{key:"setupWildcardsRegExp",value:function(e){return(e=e.replace(/(?:\\)*\?/g,(function(e){return"\\"===e.charAt(0)?"?":"\x01"}))).replace(/(?:\\)*\*/g,(function(e){return"\\"===e.charAt(0)?"*":"\x02"}))}},{key:"createWildcardsRegExp",value:function(e){var t="withSpaces"===this.opt.wildcards;return e.replace(/\u0001/g,t?"[\\S\\s]?":"\\S?").replace(/\u0002/g,t?"[\\S\\s]*?":"\\S*")}},{key:"setupIgnoreJoinersRegExp",value:function(e){return e.replace(/[^(|)\\]/g,(function(e,t,n){var r=n.charAt(t+1);return/[(|)\\]/.test(r)||""===r?e:e+"\0"}))}},{key:"createJoinersRegExp",value:function(e){var t=[],n=this.opt.ignorePunctuation;return Array.isArray(n)&&n.length&&t.push(this.escapeStr(n.join(""))),this.opt.ignoreJoiners&&t.push("\\u00ad\\u200b\\u200c\\u200d"),t.length?e.split(/\u0000+/).join("["+t.join("")+"]*"):e}},{key:"createDiacriticsRegExp",value:function(e){var t=this.opt.caseSensitive?"":"i",n=this.opt.caseSensitive?["a\xe0\xe1\u1ea3\xe3\u1ea1\u0103\u1eb1\u1eaf\u1eb3\u1eb5\u1eb7\xe2\u1ea7\u1ea5\u1ea9\u1eab\u1ead\xe4\xe5\u0101\u0105","A\xc0\xc1\u1ea2\xc3\u1ea0\u0102\u1eb0\u1eae\u1eb2\u1eb4\u1eb6\xc2\u1ea6\u1ea4\u1ea8\u1eaa\u1eac\xc4\xc5\u0100\u0104","c\xe7\u0107\u010d","C\xc7\u0106\u010c","d\u0111\u010f","D\u0110\u010e","e\xe8\xe9\u1ebb\u1ebd\u1eb9\xea\u1ec1\u1ebf\u1ec3\u1ec5\u1ec7\xeb\u011b\u0113\u0119","E\xc8\xc9\u1eba\u1ebc\u1eb8\xca\u1ec0\u1ebe\u1ec2\u1ec4\u1ec6\xcb\u011a\u0112\u0118","i\xec\xed\u1ec9\u0129\u1ecb\xee\xef\u012b","I\xcc\xcd\u1ec8\u0128\u1eca\xce\xcf\u012a","l\u0142","L\u0141","n\xf1\u0148\u0144","N\xd1\u0147\u0143","o\xf2\xf3\u1ecf\xf5\u1ecd\xf4\u1ed3\u1ed1\u1ed5\u1ed7\u1ed9\u01a1\u1edf\u1ee1\u1edb\u1edd\u1ee3\xf6\xf8\u014d","O\xd2\xd3\u1ece\xd5\u1ecc\xd4\u1ed2\u1ed0\u1ed4\u1ed6\u1ed8\u01a0\u1ede\u1ee0\u1eda\u1edc\u1ee2\xd6\xd8\u014c","r\u0159","R\u0158","s\u0161\u015b\u0219\u015f","S\u0160\u015a\u0218\u015e","t\u0165\u021b\u0163","T\u0164\u021a\u0162","u\xf9\xfa\u1ee7\u0169\u1ee5\u01b0\u1eeb\u1ee9\u1eed\u1eef\u1ef1\xfb\xfc\u016f\u016b","U\xd9\xda\u1ee6\u0168\u1ee4\u01af\u1eea\u1ee8\u1eec\u1eee\u1ef0\xdb\xdc\u016e\u016a","y\xfd\u1ef3\u1ef7\u1ef9\u1ef5\xff","Y\xdd\u1ef2\u1ef6\u1ef8\u1ef4\u0178","z\u017e\u017c\u017a","Z\u017d\u017b\u0179"]:["a\xe0\xe1\u1ea3\xe3\u1ea1\u0103\u1eb1\u1eaf\u1eb3\u1eb5\u1eb7\xe2\u1ea7\u1ea5\u1ea9\u1eab\u1ead\xe4\xe5\u0101\u0105A\xc0\xc1\u1ea2\xc3\u1ea0\u0102\u1eb0\u1eae\u1eb2\u1eb4\u1eb6\xc2\u1ea6\u1ea4\u1ea8\u1eaa\u1eac\xc4\xc5\u0100\u0104","c\xe7\u0107\u010dC\xc7\u0106\u010c","d\u0111\u010fD\u0110\u010e","e\xe8\xe9\u1ebb\u1ebd\u1eb9\xea\u1ec1\u1ebf\u1ec3\u1ec5\u1ec7\xeb\u011b\u0113\u0119E\xc8\xc9\u1eba\u1ebc\u1eb8\xca\u1ec0\u1ebe\u1ec2\u1ec4\u1ec6\xcb\u011a\u0112\u0118","i\xec\xed\u1ec9\u0129\u1ecb\xee\xef\u012bI\xcc\xcd\u1ec8\u0128\u1eca\xce\xcf\u012a","l\u0142L\u0141","n\xf1\u0148\u0144N\xd1\u0147\u0143","o\xf2\xf3\u1ecf\xf5\u1ecd\xf4\u1ed3\u1ed1\u1ed5\u1ed7\u1ed9\u01a1\u1edf\u1ee1\u1edb\u1edd\u1ee3\xf6\xf8\u014dO\xd2\xd3\u1ece\xd5\u1ecc\xd4\u1ed2\u1ed0\u1ed4\u1ed6\u1ed8\u01a0\u1ede\u1ee0\u1eda\u1edc\u1ee2\xd6\xd8\u014c","r\u0159R\u0158","s\u0161\u015b\u0219\u015fS\u0160\u015a\u0218\u015e","t\u0165\u021b\u0163T\u0164\u021a\u0162","u\xf9\xfa\u1ee7\u0169\u1ee5\u01b0\u1eeb\u1ee9\u1eed\u1eef\u1ef1\xfb\xfc\u016f\u016bU\xd9\xda\u1ee6\u0168\u1ee4\u01af\u1eea\u1ee8\u1eec\u1eee\u1ef0\xdb\xdc\u016e\u016a","y\xfd\u1ef3\u1ef7\u1ef9\u1ef5\xffY\xdd\u1ef2\u1ef6\u1ef8\u1ef4\u0178","z\u017e\u017c\u017aZ\u017d\u017b\u0179"],r=[];return e.split("").forEach((function(i){n.every((function(n){if(-1!==n.indexOf(i)){if(r.indexOf(n)>-1)return!1;e=e.replace(new RegExp("["+n+"]","gm"+t),"["+n+"]"),r.push(n)}return!0}))})),e}},{key:"createMergedBlanksRegExp",value:function(e){return e.replace(/[\s]+/gim,"[\\s]+")}},{key:"createAccuracyRegExp",value:function(e){var t=this,n="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\xa1\xbf",r=this.opt.accuracy,i="string"==typeof r?r:r.value,o="string"==typeof r?[]:r.limiters,s="";switch(o.forEach((function(e){s+="|"+t.escapeStr(e)})),i){case"partially":default:return"()("+e+")";case"complementary":return"()([^"+(s="\\s"+(s||this.escapeStr(n)))+"]*"+e+"[^"+s+"]*)";case"exactly":return"(^|\\s"+s+")("+e+")(?=$|\\s"+s+")"}}},{key:"getSeparatedKeywords",value:function(e){var t=this,n=[];return e.forEach((function(e){t.opt.separateWordSearch?e.split(" ").forEach((function(e){e.trim()&&-1===n.indexOf(e)&&n.push(e)})):e.trim()&&-1===n.indexOf(e)&&n.push(e)})),{keywords:n.sort((function(e,t){return t.length-e.length})),length:n.length}}},{key:"isNumeric",value:function(e){return Number(parseFloat(e))==e}},{key:"checkRanges",value:function(e){var t=this;if(!Array.isArray(e)||"[object Object]"!==Object.prototype.toString.call(e[0]))return this.log("markRanges() will only accept an array of objects"),this.opt.noMatch(e),[];var n=[],r=0;return e.sort((function(e,t){return e.start-t.start})).forEach((function(e){var i=t.callNoMatchOnInvalidRanges(e,r),o=i.start,s=i.end;i.valid&&(e.start=o,e.length=s-o,n.push(e),r=s)})),n}},{key:"callNoMatchOnInvalidRanges",value:function(e,t){var n=void 0,r=void 0,i=!1;return e&&void 0!==e.start?(r=(n=parseInt(e.start,10))+parseInt(e.length,10),this.isNumeric(e.start)&&this.isNumeric(e.length)&&r-t>0&&r-n>0?i=!0:(this.log("Ignoring invalid or overlapping range: "+JSON.stringify(e)),this.opt.noMatch(e))):(this.log("Ignoring invalid range: "+JSON.stringify(e)),this.opt.noMatch(e)),{start:n,end:r,valid:i}}},{key:"checkWhitespaceRanges",value:function(e,t,n){var r=void 0,i=!0,o=n.length,s=t-o,a=parseInt(e.start,10)-s;return(r=(a=a>o?o:a)+parseInt(e.length,10))>o&&(r=o,this.log("End range automatically set to the max value of "+o)),a<0||r-a<0||a>o||r>o?(i=!1,this.log("Invalid range: "+JSON.stringify(e)),this.opt.noMatch(e)):""===n.substring(a,r).replace(/\s+/g,"")&&(i=!1,this.log("Skipping whitespace only range: "+JSON.stringify(e)),this.opt.noMatch(e)),{start:a,end:r,valid:i}}},{key:"getTextNodes",value:function(e){var t=this,n="",r=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,(function(e){r.push({start:n.length,end:(n+=e.textContent).length,node:e})}),(function(e){return t.matchesExclude(e.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}),(function(){e({value:n,nodes:r})}))}},{key:"matchesExclude",value:function(e){return i.matches(e,this.opt.exclude.concat(["script","style","title","head","html"]))}},{key:"wrapRangeInTextNode",value:function(e,t,n){var r=this.opt.element?this.opt.element:"mark",i=e.splitText(t),o=i.splitText(n-t),s=document.createElement(r);return s.setAttribute("data-markjs","true"),this.opt.className&&s.setAttribute("class",this.opt.className),s.textContent=i.textContent,i.parentNode.replaceChild(s,i),o}},{key:"wrapRangeInMappedTextNode",value:function(e,t,n,r,i){var o=this;e.nodes.every((function(s,a){var l=e.nodes[a+1];if(void 0===l||l.start>t){if(!r(s.node))return!1;var c=t-s.start,u=(n>s.end?s.end:n)-s.start,p=e.value.substr(0,s.start),d=e.value.substr(u+s.start);if(s.node=o.wrapRangeInTextNode(s.node,c,u),e.value=p+d,e.nodes.forEach((function(t,n){n>=a&&(e.nodes[n].start>0&&n!==a&&(e.nodes[n].start-=u),e.nodes[n].end-=u)})),n-=u,i(s.node.previousSibling,s.start),!(n>s.end))return!1;t=s.end}return!0}))}},{key:"wrapMatches",value:function(e,t,n,r,i){var o=this,s=0===t?0:t+1;this.getTextNodes((function(t){t.nodes.forEach((function(t){t=t.node;for(var i=void 0;null!==(i=e.exec(t.textContent))&&""!==i[s];)if(n(i[s],t)){var a=i.index;if(0!==s)for(var l=1;l<s;l++)a+=i[l].length;t=o.wrapRangeInTextNode(t,a,a+i[s].length),r(t.previousSibling),e.lastIndex=0}})),i()}))}},{key:"wrapMatchesAcrossElements",value:function(e,t,n,r,i){var o=this,s=0===t?0:t+1;this.getTextNodes((function(t){for(var a=void 0;null!==(a=e.exec(t.value))&&""!==a[s];){var l=a.index;if(0!==s)for(var c=1;c<s;c++)l+=a[c].length;var u=l+a[s].length;o.wrapRangeInMappedTextNode(t,l,u,(function(e){return n(a[s],e)}),(function(t,n){e.lastIndex=n,r(t)}))}i()}))}},{key:"wrapRangeFromIndex",value:function(e,t,n,r){var i=this;this.getTextNodes((function(o){var s=o.value.length;e.forEach((function(e,r){var a=i.checkWhitespaceRanges(e,s,o.value),l=a.start,c=a.end;a.valid&&i.wrapRangeInMappedTextNode(o,l,c,(function(n){return t(n,e,o.value.substring(l,c),r)}),(function(t){n(t,e)}))})),r()}))}},{key:"unwrapMatches",value:function(e){for(var t=e.parentNode,n=document.createDocumentFragment();e.firstChild;)n.appendChild(e.removeChild(e.firstChild));t.replaceChild(n,e),this.ie?this.normalizeTextNode(t):t.normalize()}},{key:"normalizeTextNode",value:function(e){if(e){if(3===e.nodeType)for(;e.nextSibling&&3===e.nextSibling.nodeType;)e.nodeValue+=e.nextSibling.nodeValue,e.parentNode.removeChild(e.nextSibling);else this.normalizeTextNode(e.firstChild);this.normalizeTextNode(e.nextSibling)}}},{key:"markRegExp",value:function(e,t){var n=this;this.opt=t,this.log('Searching with expression "'+e+'"');var r=0,i="wrapMatches",o=function(e){r++,n.opt.each(e)};this.opt.acrossElements&&(i="wrapMatchesAcrossElements"),this[i](e,this.opt.ignoreGroups,(function(e,t){return n.opt.filter(t,e,r)}),o,(function(){0===r&&n.opt.noMatch(e),n.opt.done(r)}))}},{key:"mark",value:function(e,t){var n=this;this.opt=t;var r=0,i="wrapMatches",o=this.getSeparatedKeywords("string"==typeof e?[e]:e),s=o.keywords,a=o.length,l=this.opt.caseSensitive?"":"i",c=function e(t){var o=new RegExp(n.createRegExp(t),"gm"+l),c=0;n.log('Searching with expression "'+o+'"'),n[i](o,1,(function(e,i){return n.opt.filter(i,t,r,c)}),(function(e){c++,r++,n.opt.each(e)}),(function(){0===c&&n.opt.noMatch(t),s[a-1]===t?n.opt.done(r):e(s[s.indexOf(t)+1])}))};this.opt.acrossElements&&(i="wrapMatchesAcrossElements"),0===a?this.opt.done(r):c(s[0])}},{key:"markRanges",value:function(e,t){var n=this;this.opt=t;var r=0,i=this.checkRanges(e);i&&i.length?(this.log("Starting to mark with the following ranges: "+JSON.stringify(i)),this.wrapRangeFromIndex(i,(function(e,t,r,i){return n.opt.filter(e,t,r,i)}),(function(e,t){r++,n.opt.each(e,t)}),(function(){n.opt.done(r)}))):this.opt.done(r)}},{key:"unmark",value:function(e){var t=this;this.opt=e;var n=this.opt.element?this.opt.element:"*";n+="[data-markjs]",this.opt.className&&(n+="."+this.opt.className),this.log('Removal selector "'+n+'"'),this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT,(function(e){t.unwrapMatches(e)}),(function(e){var r=i.matches(e,n),o=t.matchesExclude(e);return!r||o?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}),this.opt.done)}},{key:"opt",set:function(e){this._opt=r({},{element:"",className:"",exclude:[],iframes:!1,iframesTimeout:5e3,separateWordSearch:!0,diacritics:!0,synonyms:{},accuracy:"partially",acrossElements:!1,caseSensitive:!1,ignoreJoiners:!1,ignoreGroups:0,ignorePunctuation:[],wildcards:"disabled",each:function(){},noMatch:function(){},filter:function(){return!0},done:function(){},debug:!1,log:window.console},e)},get:function(){return this._opt}},{key:"iterator",get:function(){return new i(this.ctx,this.opt.iframes,this.opt.exclude,this.opt.iframesTimeout)}}]),o}();function s(e){var t=this,n=new o(e);return this.mark=function(e,r){return n.mark(e,r),t},this.markRegExp=function(e,r){return n.markRegExp(e,r),t},this.markRanges=function(e,r){return n.markRanges(e,r),t},this.unmark=function(e){return n.unmark(e),t},this}return s}()},4851:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MobXProviderContext:()=>ie,Observer:()=>S,PropTypes:()=>ge,Provider:()=>oe,disposeOnUnmount:()=>pe,enableStaticRendering:()=>d,inject:()=>ae,isUsingStaticRendering:()=>f,observer:()=>te,observerBatching:()=>a,useAsObservableSource:()=>j,useLocalObservable:()=>E,useLocalStore:()=>T,useObserver:()=>P,useStaticRendering:()=>I});var r=n(8949),i=n(7294);if(!i.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!r.makeObservable)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var o=n(3935);function s(e){e()}function a(e){e||(e=s),(0,r.configure)({reactionScheduler:e})}function l(e){return(0,r.getDependencyTree)(e)}var c=function(){function e(e){var t=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(e){void 0===e&&(e=1e4),clearTimeout(t.sweepTimeout),t.sweepTimeout=void 0;var n=Date.now();t.registrations.forEach((function(r,i){n-r.registeredAt>=e&&(t.finalize(r.value),t.registrations.delete(i))})),t.registrations.size>0&&t.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this.registrations.set(n,{value:t,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.registrations.delete(e)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){void 0===this.sweepTimeout&&(this.sweepTimeout=setTimeout(this.sweep,1e4))}}),e}(),u=new("undefined"!=typeof FinalizationRegistry?FinalizationRegistry:c)((function(e){var t;null===(t=e.reaction)||void 0===t||t.dispose(),e.reaction=null})),p=!1;function d(e){p=e}function f(){return p}var h=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s};function m(e){return"observer".concat(e)}var g=function(){};function y(){return new g}function v(e,t){if(void 0===t&&(t="observed"),f())return e();var n=h(i.useState(y),1)[0],o=h(i.useState(),2)[1],s=function(){return o([])},a=i.useRef(null);a.current||(a.current={reaction:null,mounted:!1,changedBeforeMount:!1});var c,p,d=a.current;if(d.reaction||(d.reaction=new r.Reaction(m(t),(function(){d.mounted?s():d.changedBeforeMount=!0})),u.register(n,d,d)),i.useDebugValue(d.reaction,l),i.useEffect((function(){return u.unregister(d),d.mounted=!0,d.reaction?d.changedBeforeMount&&(d.changedBeforeMount=!1,s()):(d.reaction=new r.Reaction(m(t),(function(){s()})),s()),function(){d.reaction.dispose(),d.reaction=null,d.mounted=!1,d.changedBeforeMount=!1}}),[]),d.reaction.track((function(){try{c=e()}catch(t){p=t}})),p)throw p;return c}var b="function"==typeof Symbol&&Symbol.for,x=b?Symbol.for("react.forward_ref"):"function"==typeof i.forwardRef&&(0,i.forwardRef)((function(e){return null})).$$typeof,w=b?Symbol.for("react.memo"):"function"==typeof i.memo&&(0,i.memo)((function(e){return null})).$$typeof;function k(e,t){var n;if(w&&e.$$typeof===w)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");if(f())return e;var r=null!==(n=null==t?void 0:t.forwardRef)&&void 0!==n&&n,o=e,s=e.displayName||e.name;if(x&&e.$$typeof===x&&(r=!0,"function"!=typeof(o=e.render)))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var a,l,c=function(e,t){return v((function(){return o(e,t)}),s)};return""!==s&&(c.displayName=s),e.contextTypes&&(c.contextTypes=e.contextTypes),r&&(c=(0,i.forwardRef)(c)),c=(0,i.memo)(c),a=e,l=c,Object.keys(a).forEach((function(e){O[e]||Object.defineProperty(l,e,Object.getOwnPropertyDescriptor(a,e))})),c}var O={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function S(e){var t=e.children,n=e.render,r=t||n;return"function"!=typeof r?null:v(r)}function E(e,t){return(0,i.useState)((function(){return(0,r.observable)(e(),t,{autoBind:!0})}))[0]}S.displayName="Observer";var _,A=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s};function j(e){var t=A((0,i.useState)((function(){return(0,r.observable)(e,{},{deep:!1})})),1)[0];return(0,r.runInAction)((function(){Object.assign(t,e)})),t}function T(e,t){var n=t&&j(t);return(0,i.useState)((function(){return(0,r.observable)(e(n),void 0,{autoBind:!0})}))[0]}a(o.unstable_batchedUpdates);_=u.finalizeAllImmediately;function P(e,t){return void 0===t&&(t="observed"),v(e,t)}function I(e){d(e)}var C=0;var R={};function N(e){return R[e]||(R[e]=function(e){if("function"==typeof Symbol)return Symbol(e);var t="__$mobx-react "+e+" ("+C+")";return C++,t}(e)),R[e]}function L(e,t){if($(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=0;i<n.length;i++)if(!Object.hasOwnProperty.call(t,n[i])||!$(e[n[i]],t[n[i]]))return!1;return!0}function $(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}var M={$$typeof:1,render:1,compare:1,type:1,childContextTypes:1,contextType:1,contextTypes:1,defaultProps:1,getDefaultProps:1,getDerivedStateFromError:1,getDerivedStateFromProps:1,mixins:1,displayName:1,propTypes:1};function D(e,t,n){Object.hasOwnProperty.call(e,t)?e[t]=n:Object.defineProperty(e,t,{enumerable:!1,configurable:!0,writable:!0,value:n})}var F=N("patchMixins"),B=N("patchedDefinition");function z(e,t){for(var n=this,r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];t.locks++;try{var s;return null!=e&&(s=e.apply(this,i)),s}finally{t.locks--,0===t.locks&&t.methods.forEach((function(e){e.apply(n,i)}))}}function U(e,t){return function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];z.call.apply(z,[this,e,t].concat(r))}}function q(e,t,n){var r=function(e,t){var n=e[F]=e[F]||{},r=n[t]=n[t]||{};return r.locks=r.locks||0,r.methods=r.methods||[],r}(e,t);r.methods.indexOf(n)<0&&r.methods.push(n);var i=Object.getOwnPropertyDescriptor(e,t);if(!i||!i[B]){var o=e[t],s=W(e,t,i?i.enumerable:void 0,r,o);Object.defineProperty(e,t,s)}}function W(e,t,n,r,i){var o,s=U(i,r);return(o={})[B]=!0,o.get=function(){return s},o.set=function(i){if(this===e)s=U(i,r);else{var o=W(this,t,n,r,i);Object.defineProperty(this,t,o)}},o.configurable=!0,o.enumerable=n,o}var V=r.$mobx||"$mobx",Q=N("isMobXReactObserver"),H=N("isUnmounted"),Y=N("skipRender"),G=N("isForcingUpdate");function X(e){var t=e.prototype;if(e[Q]){var n=K(t);console.warn("The provided component class ("+n+")\n has already been declared as an observer component.")}else e[Q]=!0;if(t.componentWillReact)throw new Error("The componentWillReact life-cycle event is no longer supported");if(e.__proto__!==i.PureComponent)if(t.shouldComponentUpdate){if(t.shouldComponentUpdate!==Z)throw new Error("It is not allowed to use shouldComponentUpdate in observer based components.")}else t.shouldComponentUpdate=Z;ee(t,"props"),ee(t,"state"),e.contextType&&ee(t,"context");var r=t.render;if("function"!=typeof r){var o=K(t);throw new Error("[mobx-react] class component ("+o+") is missing `render` method.\n`observer` requires `render` being a function defined on prototype.\n`render = () => {}` or `render = function() {}` is not supported.")}return t.render=function(){return this.render=f()?r:J.call(this,r),this.render()},q(t,"componentDidMount",(function(){this[H]=!1,this.render[V]||i.Component.prototype.forceUpdate.call(this)})),q(t,"componentWillUnmount",(function(){if(!f()){var e=this.render[V];if(e)e.dispose(),this.render[V]=null;else{var t=K(this);console.warn("The reactive render of an observer class component ("+t+")\n was overridden after MobX attached. This may result in a memory leak if the\n overridden reactive render was not properly disposed.")}this[H]=!0}})),e}function K(e){return e.displayName||e.name||e.constructor&&(e.constructor.displayName||e.constructor.name)||"<component>"}function J(e){var t=this;D(this,Y,!1),D(this,G,!1);var n=K(this),o=e.bind(this),s=!1;return function e(){var a;s=!1;var l=null!=(a=e[V])?a:e[V]=function(){var e=new r.Reaction(n+".render()",(function(){if(!s&&(s=!0,!0!==t[H])){var n=!0;try{D(t,G,!0),t[Y]||i.Component.prototype.forceUpdate.call(t),n=!1}finally{D(t,G,!1),n&&(e.dispose(),t.render[V]=null)}}}));return e.reactComponent=t,e}(),c=void 0,u=void 0;if(l.track((function(){try{u=(0,r._allowStateChanges)(!1,o)}catch(e){c=e}})),c)throw c;return u}}function Z(e,t){return f()&&console.warn("[mobx-react] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side."),this.state!==t||!L(this.props,e)}function ee(e,t){var n=N("reactProp_"+t+"_valueHolder"),i=N("reactProp_"+t+"_atomHolder");function o(){return this[i]||D(this,i,(0,r.createAtom)("reactive "+t)),this[i]}Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){var e=!1;return r._allowStateReadsStart&&r._allowStateReadsEnd&&(e=(0,r._allowStateReadsStart)(!0)),o.call(this).reportObserved(),r._allowStateReadsStart&&r._allowStateReadsEnd&&(0,r._allowStateReadsEnd)(e),this[n]},set:function(e){this[G]||L(this[n],e)?D(this,n,e):(D(this,n,e),D(this,Y,!0),o.call(this).reportChanged(),D(this,Y,!1))}})}function te(e){return!0===e.isMobxInjector&&console.warn("Mobx observer: You are trying to use `observer` on a component that already has `inject`. Please apply `observer` before applying `inject`"),Object.prototype.isPrototypeOf.call(i.Component,e)||Object.prototype.isPrototypeOf.call(i.PureComponent,e)?X(e):k(e)}function ne(){return ne=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ne.apply(this,arguments)}var re=["children"],ie=i.createContext({});function oe(e){var t=e.children,n=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,re),r=i.useContext(ie),o=i.useRef(ne({},r,n)).current;return i.createElement(ie.Provider,{value:o},t)}function se(e,t,n,r){var o,s,a,l=i.forwardRef((function(n,r){var o=ne({},n),s=i.useContext(ie);return Object.assign(o,e(s||{},o)||{}),r&&(o.ref=r),i.createElement(t,o)}));return r&&(l=te(l)),l.isMobxInjector=!0,o=t,s=l,a=Object.getOwnPropertyNames(Object.getPrototypeOf(o)),Object.getOwnPropertyNames(o).forEach((function(e){M[e]||-1!==a.indexOf(e)||Object.defineProperty(s,e,Object.getOwnPropertyDescriptor(o,e))})),l.wrappedComponent=t,l.displayName=function(e,t){var n,r=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";n=t?"inject-with-"+t+"("+r+")":"inject("+r+")";return n}(t,n),l}function ae(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if("function"==typeof arguments[0]){var r=arguments[0];return function(e){return se(r,e,r.name,!0)}}return function(e){return se(function(e){return function(t,n){return e.forEach((function(e){if(!(e in n)){if(!(e in t))throw new Error("MobX injector: Store '"+e+"' is not available! Make sure it is provided by some Provider");n[e]=t[e]}})),n}}(t),e,t.join("-"),!1)}}oe.displayName="MobXProvider";var le=N("disposeOnUnmountProto"),ce=N("disposeOnUnmountInst");function ue(){var e=this;[].concat(this[le]||[],this[ce]||[]).forEach((function(t){var n="string"==typeof t?e[t]:t;null!=n&&(Array.isArray(n)?n.map((function(e){return e()})):n())}))}function pe(e,t){if(Array.isArray(t))return t.map((function(t){return pe(e,t)}));var n=Object.getPrototypeOf(e).constructor,r=Object.getPrototypeOf(e.constructor),o=Object.getPrototypeOf(Object.getPrototypeOf(e));if(n!==i.Component&&n!==i.PureComponent&&r!==i.Component&&r!==i.PureComponent&&o!==i.Component&&o!==i.PureComponent)throw new Error("[mobx-react] disposeOnUnmount only supports direct subclasses of React.Component or React.PureComponent.");if("string"!=typeof t&&"function"!=typeof t&&!Array.isArray(t))throw new Error("[mobx-react] disposeOnUnmount only works if the parameter is either a property key or a function.");var s="string"==typeof t,a=!!e[le]||!!e[ce];return(s?e[le]||(e[le]=[]):e[ce]||(e[ce]=[])).push(t),a||q(e,"componentWillUnmount",ue),"string"!=typeof t?t:void 0}function de(e){function t(t,n,i,o,s,a){for(var l=arguments.length,c=new Array(l>6?l-6:0),u=6;u<l;u++)c[u-6]=arguments[u];return(0,r.untracked)((function(){if(o=o||"<<anonymous>>",a=a||i,null==n[i]){if(t){var r=null===n[i]?"null":"undefined";return new Error("The "+s+" `"+a+"` is marked as required in `"+o+"`, but its value is `"+r+"`.")}return null}return e.apply(void 0,[n,i,o,s,a].concat(c))}))}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function fe(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||"Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol}(t,e)?"symbol":t}function he(e,t){return de((function(n,i,o,s,a){return(0,r.untracked)((function(){if(e&&fe(n[i])===t.toLowerCase())return null;var s;switch(t){case"Array":s=r.isObservableArray;break;case"Object":s=r.isObservableObject;break;case"Map":s=r.isObservableMap;break;default:throw new Error("Unexpected mobxType: "+t)}var l=n[i];if(!s(l)){var c=function(e){var t=fe(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}(l),u=e?" or javascript `"+t.toLowerCase()+"`":"";return new Error("Invalid prop `"+a+"` of type `"+c+"` supplied to `"+o+"`, expected `mobx.Observable"+t+"`"+u+".")}return null}))}))}function me(e,t){return de((function(n,i,o,s,a){for(var l=arguments.length,c=new Array(l>5?l-5:0),u=5;u<l;u++)c[u-5]=arguments[u];return(0,r.untracked)((function(){if("function"!=typeof t)return new Error("Property `"+a+"` of component `"+o+"` has invalid PropType notation.");var r=he(e,"Array")(n,i,o,s,a);if(r instanceof Error)return r;for(var l=n[i],u=0;u<l.length;u++)if((r=t.apply(void 0,[l,u,o,s,a+"["+u+"]"].concat(c)))instanceof Error)return r;return null}))}))}var ge={observableArray:he(!1,"Array"),observableArrayOf:me.bind(null,!1),observableMap:he(!1,"Map"),observableObject:he(!1,"Object"),arrayOrObservableArray:he(!0,"Array"),arrayOrObservableArrayOf:me.bind(null,!0),objectOrObservableObject:he(!0,"Object")};if(!i.Component)throw new Error("mobx-react requires React to be available");if(!r.observable)throw new Error("mobx-react requires mobx to be available")},8949:(e,t,n)=>{"use strict";n.r(t),n.d(t,{$mobx:()=>V,FlowCancellationError:()=>vn,ObservableMap:()=>Ar,ObservableSet:()=>Pr,Reaction:()=>Ct,_allowStateChanges:()=>Ge,_allowStateChangesInsideComputed:()=>Xt,_allowStateReadsEnd:()=>gt,_allowStateReadsStart:()=>mt,_autoAction:()=>Gt,_endAction:()=>Ye,_getAdministration:()=>Zr,_getGlobalState:()=>Ot,_interceptReads:()=>_n,_isComputingDerivation:()=>lt,_resetGlobalState:()=>St,_startAction:()=>He,action:()=>Yt,autorun:()=>Jt,comparer:()=>G,computed:()=>Fe,configure:()=>pn,createAtom:()=>Y,defineProperty:()=>zn,entries:()=>$n,extendObservable:()=>dn,flow:()=>kn,flowResult:()=>Sn,get:()=>Bn,getAtom:()=>Jr,getDebugName:()=>ei,getDependencyTree:()=>fn,getObserverTree:()=>mn,has:()=>Fn,intercept:()=>An,isAction:()=>Kt,isBoxedObservable:()=>et,isComputed:()=>Tn,isComputedProp:()=>Pn,isFlow:()=>En,isFlowCancellationError:()=>bn,isObservable:()=>Cn,isObservableArray:()=>wr,isObservableMap:()=>jr,isObservableObject:()=>Dr,isObservableProp:()=>Rn,isObservableSet:()=>Ir,keys:()=>Nn,makeAutoObservable:()=>ar,makeObservable:()=>or,observable:()=>Le,observe:()=>qn,onBecomeObserved:()=>on,onBecomeUnobserved:()=>sn,onReactionError:()=>Rt,override:()=>Z,ownKeys:()=>Un,reaction:()=>tn,remove:()=>Dn,runInAction:()=>Xt,set:()=>Mn,spy:()=>Ft,toJS:()=>Qn,trace:()=>Hn,transaction:()=>Yn,untracked:()=>dt,values:()=>Ln,when:()=>Gn});function r(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw new Error("number"==typeof e?"[MobX] minified error nr: "+e+(n.length?" "+n.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var i={};function o(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:i}var s=Object.assign,a=Object.getOwnPropertyDescriptor,l=Object.defineProperty,c=Object.prototype,u=[];Object.freeze(u);var p={};Object.freeze(p);var d="undefined"!=typeof Proxy,f=Object.toString();function h(){d||r("Proxy not available")}function m(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var g=function(){};function y(e){return"function"==typeof e}function v(e){switch(typeof e){case"string":case"symbol":case"number":return!0}return!1}function b(e){return null!==e&&"object"==typeof e}function x(e){if(!b(e))return!1;var t=Object.getPrototypeOf(e);if(null==t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n.toString()===f}function w(e){var t=null==e?void 0:e.constructor;return!!t&&("GeneratorFunction"===t.name||"GeneratorFunction"===t.displayName)}function k(e,t,n){l(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function O(e,t,n){l(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function S(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(e){return b(e)&&!0===e[n]}}function E(e){return e instanceof Map}function _(e){return e instanceof Set}var A=void 0!==Object.getOwnPropertySymbols;var j="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:A?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function T(e){return null===e?null:"object"==typeof e?""+e:e}function P(e,t){return c.hasOwnProperty.call(e,t)}var I=Object.getOwnPropertyDescriptors||function(e){var t={};return j(e).forEach((function(n){t[n]=a(e,n)})),t};function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,B(r.key),r)}}function R(e,t,n){return t&&C(e.prototype,t),n&&C(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function N(){return N=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},N.apply(this,arguments)}function L(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,$(e,t)}function $(e,t){return $=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$(e,t)}function M(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function F(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function B(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var z=Symbol("mobx-stored-annotations");function U(e){return Object.assign((function(t,n){if(W(n))return e.decorate_20223_(t,n);q(t,n,e)}),e)}function q(e,t,n){P(e,z)||k(e,z,N({},e[z])),function(e){return e.annotationType_===J}(n)||(e[z][t]=n)}function W(e){return"object"==typeof e&&"string"==typeof e.kind}var V=Symbol("mobx administration"),Q=function(){function e(e){void 0===e&&(e="Atom"),this.name_=void 0,this.isPendingUnobservation_=!1,this.isBeingObserved_=!1,this.observers_=new Set,this.batchId_=void 0,this.diffValue_=0,this.lastAccessedBy_=0,this.lowestObserverState_=tt.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=e,this.batchId_=kt.inBatch?kt.batchId:NaN}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach((function(e){return e()}))},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach((function(e){return e()}))},t.reportObserved=function(){return Pt(this)},t.reportChanged=function(){kt.inBatch&&this.batchId_===kt.batchId||(kt.stateVersion=kt.stateVersion<Number.MAX_SAFE_INTEGER?kt.stateVersion+1:Number.MIN_SAFE_INTEGER,this.batchId_=NaN),jt(),It(this),Tt()},t.toString=function(){return this.name_},e}(),H=S("Atom",Q);function Y(e,t,n){void 0===t&&(t=g),void 0===n&&(n=g);var r=new Q(e);return t!==g&&on(r,t),n!==g&&sn(r,n),r}var G={identity:function(e,t){return e===t},structural:function(e,t){return ri(e,t)},default:function(e,t){return Object.is?Object.is(e,t):e===t?0!==e||1/e==1/t:e!=e&&t!=t},shallow:function(e,t){return ri(e,t,1)}};function X(e,t,n){return Cn(e)?e:Array.isArray(e)?Le.array(e,{name:n}):x(e)?Le.object(e,void 0,{name:n}):E(e)?Le.map(e,{name:n}):_(e)?Le.set(e,{name:n}):"function"!=typeof e||Kt(e)||En(e)?e:w(e)?kn(e):Gt(n,e)}function K(e){return e}var J="override",Z=U({annotationType_:J,make_:function(e,t){0;0;return 0},extend_:function(e,t,n,i){r("'"+this.annotationType_+"' can only be used with 'makeObservable'")},decorate_20223_:function(e,t){console.warn("'"+this.annotationType_+"' cannot be used with decorators - this is a no-op")}});function ee(e,t){return{annotationType_:e,options_:t,make_:te,extend_:ne,decorate_20223_:re}}function te(e,t,n,r){var i;if(null!=(i=this.options_)&&i.bound)return null===this.extend_(e,t,n,!1)?0:1;if(r===e.target_)return null===this.extend_(e,t,n,!1)?0:2;if(Kt(n.value))return 1;var o=ie(e,this,t,n,!1);return l(r,t,o),2}function ne(e,t,n,r){var i=ie(e,this,t,n);return e.defineProperty_(t,i,r)}function re(e,t){var n=t.kind,i=t.name,o=t.addInitializer,s=this;if("field"!=n){var a,l,c,u,p,d;if("method"==n)return Kt(e)||(l=e,e=Ve(null!=(c=null==(u=s.options_)?void 0:u.name)?c:i.toString(),l,null!=(p=null==(d=s.options_)?void 0:d.autoAction)&&p)),null!=(a=this.options_)&&a.bound&&o((function(){var e=this,t=e[i].bind(e);t.isMobxAction=!0,e[i]=t})),e;r("Cannot apply '"+s.annotationType_+"' to '"+String(i)+"' (kind: "+n+"):\n'"+s.annotationType_+"' can only be used on properties with a function value.")}else o((function(){q(this,i,s)}))}function ie(e,t,n,r,i){var o,s,a,l,c,u,p,d;void 0===i&&(i=kt.safeDescriptors),d=r,t.annotationType_,d.value;var f,h=r.value;null!=(o=t.options_)&&o.bound&&(h=h.bind(null!=(f=e.proxy_)?f:e.target_));return{value:Ve(null!=(s=null==(a=t.options_)?void 0:a.name)?s:n.toString(),h,null!=(l=null==(c=t.options_)?void 0:c.autoAction)&&l,null!=(u=t.options_)&&u.bound?null!=(p=e.proxy_)?p:e.target_:void 0),configurable:!i||e.isPlainObject_,enumerable:!1,writable:!i}}function oe(e,t){return{annotationType_:e,options_:t,make_:se,extend_:ae,decorate_20223_:le}}function se(e,t,n,r){var i;if(r===e.target_)return null===this.extend_(e,t,n,!1)?0:2;if(null!=(i=this.options_)&&i.bound&&(!P(e.target_,t)||!En(e.target_[t]))&&null===this.extend_(e,t,n,!1))return 0;if(En(n.value))return 1;var o=ce(e,this,t,n,!1,!1);return l(r,t,o),2}function ae(e,t,n,r){var i,o=ce(e,this,t,n,null==(i=this.options_)?void 0:i.bound);return e.defineProperty_(t,o,r)}function le(e,t){var n;var r=t.name,i=t.addInitializer;return En(e)||(e=kn(e)),null!=(n=this.options_)&&n.bound&&i((function(){var e=this,t=e[r].bind(e);t.isMobXFlow=!0,e[r]=t})),e}function ce(e,t,n,r,i,o){var s;void 0===o&&(o=kt.safeDescriptors),s=r,t.annotationType_,s.value;var a,l=r.value;(En(l)||(l=kn(l)),i)&&((l=l.bind(null!=(a=e.proxy_)?a:e.target_)).isMobXFlow=!0);return{value:l,configurable:!o||e.isPlainObject_,enumerable:!1,writable:!o}}function ue(e,t){return{annotationType_:e,options_:t,make_:pe,extend_:de,decorate_20223_:fe}}function pe(e,t,n){return null===this.extend_(e,t,n,!1)?0:1}function de(e,t,n,r){return function(e,t,n,r){t.annotationType_,r.get;0}(0,this,0,n),e.defineComputedProperty_(t,N({},this.options_,{get:n.get,set:n.set}),r)}function fe(e,t){var n=this,r=t.name;return(0,t.addInitializer)((function(){var t=Lr(this)[V],i=N({},n.options_,{get:e,context:this});i.name||(i.name="ObservableObject."+r.toString()),t.values_.set(r,new rt(i))})),function(){return this[V].getObservablePropValue_(r)}}function he(e,t){return{annotationType_:e,options_:t,make_:me,extend_:ge,decorate_20223_:ye}}function me(e,t,n){return null===this.extend_(e,t,n,!1)?0:1}function ge(e,t,n,r){var i,o;return function(e,t,n,r){t.annotationType_;0}(0,this),e.defineObservableProperty_(t,n.value,null!=(i=null==(o=this.options_)?void 0:o.enhancer)?i:X,r)}function ye(e,t){var n=this,r=t.kind,i=t.name,o=new WeakSet;function s(e,t){var r,s,a=Lr(e)[V],l=new Ze(t,null!=(r=null==(s=n.options_)?void 0:s.enhancer)?r:X,"ObservableObject."+i.toString(),!1);a.values_.set(i,l),o.add(e)}if("accessor"==r)return{get:function(){return o.has(this)||s(this,e.get.call(this)),this[V].getObservablePropValue_(i)},set:function(e){return o.has(this)||s(this,e),this[V].setObservablePropValue_(i,e)},init:function(e){return o.has(this)||s(this,e),e}}}var ve="true",be=xe();function xe(e){return{annotationType_:ve,options_:e,make_:we,extend_:ke,decorate_20223_:Oe}}function we(e,t,n,r){var i,o,s,a;if(n.get)return Fe.make_(e,t,n,r);if(n.set){var c=Ve(t.toString(),n.set);return r===e.target_?null===e.defineProperty_(t,{configurable:!kt.safeDescriptors||e.isPlainObject_,set:c})?0:2:(l(r,t,{configurable:!0,set:c}),2)}if(r!==e.target_&&"function"==typeof n.value)return w(n.value)?(null!=(a=this.options_)&&a.autoBind?kn.bound:kn).make_(e,t,n,r):(null!=(s=this.options_)&&s.autoBind?Gt.bound:Gt).make_(e,t,n,r);var u,p=!1===(null==(i=this.options_)?void 0:i.deep)?Le.ref:Le;"function"==typeof n.value&&null!=(o=this.options_)&&o.autoBind&&(n.value=n.value.bind(null!=(u=e.proxy_)?u:e.target_));return p.make_(e,t,n,r)}function ke(e,t,n,r){var i,o,s;if(n.get)return Fe.extend_(e,t,n,r);if(n.set)return e.defineProperty_(t,{configurable:!kt.safeDescriptors||e.isPlainObject_,set:Ve(t.toString(),n.set)},r);"function"==typeof n.value&&null!=(i=this.options_)&&i.autoBind&&(n.value=n.value.bind(null!=(s=e.proxy_)?s:e.target_));return(!1===(null==(o=this.options_)?void 0:o.deep)?Le.ref:Le).extend_(e,t,n,r)}function Oe(e,t){r("'"+this.annotationType_+"' cannot be used as a decorator")}var Se={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function Ee(e){return e||Se}Object.freeze(Se);var _e=he("observable"),Ae=he("observable.ref",{enhancer:K}),je=he("observable.shallow",{enhancer:function(e,t,n){return null==e||Dr(e)||wr(e)||jr(e)||Ir(e)?e:Array.isArray(e)?Le.array(e,{name:n,deep:!1}):x(e)?Le.object(e,void 0,{name:n,deep:!1}):E(e)?Le.map(e,{name:n,deep:!1}):_(e)?Le.set(e,{name:n,deep:!1}):void 0}}),Te=he("observable.struct",{enhancer:function(e,t){return ri(e,t)?t:e}}),Pe=U(_e);function Ie(e){return!0===e.deep?X:!1===e.deep?K:(t=e.defaultDecorator)&&null!=(n=null==(r=t.options_)?void 0:r.enhancer)?n:X;var t,n,r}function Ce(e,t,n){return W(t)?_e.decorate_20223_(e,t):v(t)?void q(e,t,_e):Cn(e)?e:x(e)?Le.object(e,t,n):Array.isArray(e)?Le.array(e,t):E(e)?Le.map(e,t):_(e)?Le.set(e,t):"object"==typeof e&&null!==e?e:Le.box(e,t)}s(Ce,Pe);var Re,Ne,Le=s(Ce,{box:function(e,t){var n=Ee(t);return new Ze(e,Ie(n),n.name,!0,n.equals)},array:function(e,t){var n=Ee(t);return(!1===kt.useProxies||!1===n.proxy?Kr:dr)(e,Ie(n),n.name)},map:function(e,t){var n=Ee(t);return new Ar(e,Ie(n),n.name)},set:function(e,t){var n=Ee(t);return new Pr(e,Ie(n),n.name)},object:function(e,t,n){return ti((function(){return dn(!1===kt.useProxies||!1===(null==n?void 0:n.proxy)?Lr({},n):function(e,t){var n,r;return h(),e=Lr(e,t),null!=(r=(n=e[V]).proxy_)?r:n.proxy_=new Proxy(e,Jn)}({},n),e,t)}))},ref:U(Ae),shallow:U(je),deep:Pe,struct:U(Te)}),$e="computed",Me=ue($e),De=ue("computed.struct",{equals:G.structural}),Fe=function(e,t){if(W(t))return Me.decorate_20223_(e,t);if(v(t))return q(e,t,Me);if(x(e))return U(ue($e,e));var n=x(t)?t:{};return n.get=e,n.name||(n.name=e.name||""),new rt(n)};Object.assign(Fe,Me),Fe.struct=U(De);var Be,ze=0,Ue=1,qe=null!=(Re=null==(Ne=a((function(){}),"name"))?void 0:Ne.configurable)&&Re,We={value:"action",configurable:!0,writable:!1,enumerable:!1};function Ve(e,t,n,r){function i(){return Qe(e,n,t,r||this,arguments)}return void 0===n&&(n=!1),i.isMobxAction=!0,qe&&(We.value=e,l(i,"name",We)),i}function Qe(e,t,n,r,i){var o=He(e,t,r,i);try{return n.apply(r,i)}catch(s){throw o.error_=s,s}finally{Ye(o)}}function He(e,t,n,r){var i=kt.trackingDerivation,o=!t||!i;jt();var s=kt.allowStateChanges;o&&(ft(),s=Xe(!0));var a={runAsAction_:o,prevDerivation_:i,prevAllowStateChanges_:s,prevAllowStateReads_:mt(!0),notifySpy_:!1,startTime_:0,actionId_:Ue++,parentActionId_:ze};return ze=a.actionId_,a}function Ye(e){ze!==e.actionId_&&r(30),ze=e.parentActionId_,void 0!==e.error_&&(kt.suppressReactionErrors=!0),Ke(e.prevAllowStateChanges_),gt(e.prevAllowStateReads_),Tt(),e.runAsAction_&&ht(e.prevDerivation_),kt.suppressReactionErrors=!1}function Ge(e,t){var n=Xe(e);try{return t()}finally{Ke(n)}}function Xe(e){var t=kt.allowStateChanges;return kt.allowStateChanges=e,t}function Ke(e){kt.allowStateChanges=e}Be=Symbol.toPrimitive;var Je,Ze=function(e){function t(t,n,r,i,o){var s;return void 0===r&&(r="ObservableValue"),void 0===i&&(i=!0),void 0===o&&(o=G.default),(s=e.call(this,r)||this).enhancer=void 0,s.name_=void 0,s.equals=void 0,s.hasUnreportedChange_=!1,s.interceptors_=void 0,s.changeListeners_=void 0,s.value_=void 0,s.dehancer=void 0,s.enhancer=n,s.name_=r,s.equals=o,s.value_=n(t,void 0,r),s}L(t,e);var n=t.prototype;return n.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},n.set=function(e){this.value_;if((e=this.prepareNewValue_(e))!==kt.UNCHANGED){0,this.setNewValue_(e)}},n.prepareNewValue_=function(e){if(ct(this),Zn(this)){var t=tr(this,{object:this,type:cr,newValue:e});if(!t)return kt.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value_,this.name_),this.equals(this.value_,e)?kt.UNCHANGED:e},n.setNewValue_=function(e){var t=this.value_;this.value_=e,this.reportChanged(),nr(this)&&ir(this,{type:cr,object:this,newValue:e,oldValue:t})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(e){return er(this,e)},n.observe_=function(e,t){return t&&e({observableKind:"value",debugObjectName:this.name_,object:this,type:cr,newValue:this.value_,oldValue:void 0}),rr(this,e)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return T(this.get())},n[Be]=function(){return this.valueOf()},t}(Q),et=S("ObservableValue",Ze);Je=Symbol.toPrimitive;var tt,nt,rt=function(){function e(e){this.dependenciesState_=tt.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.isBeingObserved_=!1,this.isPendingUnobservation_=!1,this.observers_=new Set,this.diffValue_=0,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=tt.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new ot(null),this.name_=void 0,this.triggeredBy_=void 0,this.isComputing_=!1,this.isRunningSetter_=!1,this.derivation=void 0,this.setter_=void 0,this.isTracing_=nt.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,e.get||r(31),this.derivation=e.get,this.name_=e.name||"ComputedValue",e.set&&(this.setter_=Ve("ComputedValue-setter",e.set)),this.equals_=e.equals||(e.compareStructural||e.struct?G.structural:G.default),this.scope_=e.context,this.requiresReaction_=e.requiresReaction,this.keepAlive_=!!e.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){!function(e){if(e.lowestObserverState_!==tt.UP_TO_DATE_)return;e.lowestObserverState_=tt.POSSIBLY_STALE_,e.observers_.forEach((function(e){e.dependenciesState_===tt.UP_TO_DATE_&&(e.dependenciesState_=tt.POSSIBLY_STALE_,e.onBecomeStale_())}))}(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach((function(e){return e()}))},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach((function(e){return e()}))},t.get=function(){if(this.isComputing_&&r(32,this.name_,this.derivation),0!==kt.inBatch||0!==this.observers_.size||this.keepAlive_){if(Pt(this),at(this)){var e=kt.trackingContext;this.keepAlive_&&!e&&(kt.trackingContext=this),this.trackAndCompute()&&function(e){if(e.lowestObserverState_===tt.STALE_)return;e.lowestObserverState_=tt.STALE_,e.observers_.forEach((function(t){t.dependenciesState_===tt.POSSIBLY_STALE_?t.dependenciesState_=tt.STALE_:t.dependenciesState_===tt.UP_TO_DATE_&&(e.lowestObserverState_=tt.UP_TO_DATE_)}))}(this),kt.trackingContext=e}}else at(this)&&(this.warnAboutUntrackedRead_(),jt(),this.value_=this.computeValue_(!1),Tt());var t=this.value_;if(st(t))throw t.cause;return t},t.set=function(e){if(this.setter_){this.isRunningSetter_&&r(33,this.name_),this.isRunningSetter_=!0;try{this.setter_.call(this.scope_,e)}finally{this.isRunningSetter_=!1}}else r(34,this.name_)},t.trackAndCompute=function(){var e=this.value_,t=this.dependenciesState_===tt.NOT_TRACKING_,n=this.computeValue_(!0),r=t||st(e)||st(n)||!this.equals_(e,n);return r&&(this.value_=n),r},t.computeValue_=function(e){this.isComputing_=!0;var t,n=Xe(!1);if(e)t=ut(this,this.derivation,this.scope_);else if(!0===kt.disableErrorBoundaries)t=this.derivation.call(this.scope_);else try{t=this.derivation.call(this.scope_)}catch(r){t=new ot(r)}return Ke(n),this.isComputing_=!1,t},t.suspend_=function(){this.keepAlive_||(pt(this),this.value_=void 0)},t.observe_=function(e,t){var n=this,r=!0,i=void 0;return Jt((function(){var o=n.get();if(!r||t){var s=ft();e({observableKind:"computed",debugObjectName:n.name_,type:cr,object:n,newValue:o,oldValue:i}),ht(s)}r=!1,i=o}))},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return T(this.get())},t[Je]=function(){return this.valueOf()},e}(),it=S("ComputedValue",rt);!function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"}(tt||(tt={})),function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(nt||(nt={}));var ot=function(e){this.cause=void 0,this.cause=e};function st(e){return e instanceof ot}function at(e){switch(e.dependenciesState_){case tt.UP_TO_DATE_:return!1;case tt.NOT_TRACKING_:case tt.STALE_:return!0;case tt.POSSIBLY_STALE_:for(var t=mt(!0),n=ft(),r=e.observing_,i=r.length,o=0;o<i;o++){var s=r[o];if(it(s)){if(kt.disableErrorBoundaries)s.get();else try{s.get()}catch(a){return ht(n),gt(t),!0}if(e.dependenciesState_===tt.STALE_)return ht(n),gt(t),!0}}return yt(e),ht(n),gt(t),!1}}function lt(){return null!==kt.trackingDerivation}function ct(e){}function ut(e,t,n){var r=mt(!0);yt(e),e.newObserving_=new Array(e.observing_.length+100),e.unboundDepsCount_=0,e.runId_=++kt.runId;var i,o=kt.trackingDerivation;if(kt.trackingDerivation=e,kt.inBatch++,!0===kt.disableErrorBoundaries)i=t.call(n);else try{i=t.call(n)}catch(s){i=new ot(s)}return kt.inBatch--,kt.trackingDerivation=o,function(e){for(var t=e.observing_,n=e.observing_=e.newObserving_,r=tt.UP_TO_DATE_,i=0,o=e.unboundDepsCount_,s=0;s<o;s++){var a=n[s];0===a.diffValue_&&(a.diffValue_=1,i!==s&&(n[i]=a),i++),a.dependenciesState_>r&&(r=a.dependenciesState_)}n.length=i,e.newObserving_=null,o=t.length;for(;o--;){var l=t[o];0===l.diffValue_&&_t(l,e),l.diffValue_=0}for(;i--;){var c=n[i];1===c.diffValue_&&(c.diffValue_=0,Et(c,e))}r!==tt.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}(e),gt(r),i}function pt(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)_t(t[n],e);e.dependenciesState_=tt.NOT_TRACKING_}function dt(e){var t=ft();try{return e()}finally{ht(t)}}function ft(){var e=kt.trackingDerivation;return kt.trackingDerivation=null,e}function ht(e){kt.trackingDerivation=e}function mt(e){var t=kt.allowStateReads;return kt.allowStateReads=e,t}function gt(e){kt.allowStateReads=e}function yt(e){if(e.dependenciesState_!==tt.UP_TO_DATE_){e.dependenciesState_=tt.UP_TO_DATE_;for(var t=e.observing_,n=t.length;n--;)t[n].lowestObserverState_=tt.UP_TO_DATE_}}var vt=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED","useProxies"],bt=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.batchId=Number.MIN_SAFE_INTEGER,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0,this.stateVersion=Number.MIN_SAFE_INTEGER},xt=!0,wt=!1,kt=function(){var e=o();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(xt=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new bt).version&&(xt=!1),xt?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new bt):(setTimeout((function(){wt||r(35)}),1),new bt)}();function Ot(){return kt}function St(){var e=new bt;for(var t in e)-1===vt.indexOf(t)&&(kt[t]=e[t]);kt.allowStateChanges=!kt.enforceActions}function Et(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function _t(e,t){e.observers_.delete(t),0===e.observers_.size&&At(e)}function At(e){!1===e.isPendingUnobservation_&&(e.isPendingUnobservation_=!0,kt.pendingUnobservations.push(e))}function jt(){0===kt.inBatch&&(kt.batchId=kt.batchId<Number.MAX_SAFE_INTEGER?kt.batchId+1:Number.MIN_SAFE_INTEGER),kt.inBatch++}function Tt(){if(0==--kt.inBatch){$t();for(var e=kt.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation_=!1,0===n.observers_.size&&(n.isBeingObserved_&&(n.isBeingObserved_=!1,n.onBUO()),n instanceof rt&&n.suspend_())}kt.pendingUnobservations=[]}}function Pt(e){var t=kt.trackingDerivation;return null!==t?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved_&&kt.trackingContext&&(e.isBeingObserved_=!0,e.onBO())),e.isBeingObserved_):(0===e.observers_.size&&kt.inBatch>0&&At(e),!1)}function It(e){e.lowestObserverState_!==tt.STALE_&&(e.lowestObserverState_=tt.STALE_,e.observers_.forEach((function(e){e.dependenciesState_===tt.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=tt.STALE_})))}var Ct=function(){function e(e,t,n,r){void 0===e&&(e="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=tt.NOT_TRACKING_,this.diffValue_=0,this.runId_=0,this.unboundDepsCount_=0,this.isDisposed_=!1,this.isScheduled_=!1,this.isTrackPending_=!1,this.isRunning_=!1,this.isTracing_=nt.NONE,this.name_=e,this.onInvalidate_=t,this.errorHandler_=n,this.requiresObservable_=r}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled_||(this.isScheduled_=!0,kt.pendingReactions.push(this),$t())},t.isScheduled=function(){return this.isScheduled_},t.runReaction_=function(){if(!this.isDisposed_){jt(),this.isScheduled_=!1;var e=kt.trackingContext;if(kt.trackingContext=this,at(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(t){this.reportExceptionInDerivation_(t)}}kt.trackingContext=e,Tt()}},t.track=function(e){if(!this.isDisposed_){jt();0,this.isRunning_=!0;var t=kt.trackingContext;kt.trackingContext=this;var n=ut(this,e,void 0);kt.trackingContext=t,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&pt(this),st(n)&&this.reportExceptionInDerivation_(n.cause),Tt()}},t.reportExceptionInDerivation_=function(e){var t=this;if(this.errorHandler_)this.errorHandler_(e,this);else{if(kt.disableErrorBoundaries)throw e;var n="[mobx] uncaught error in '"+this+"'";kt.suppressReactionErrors||console.error(n,e),kt.globalReactionErrorHandlers.forEach((function(n){return n(e,t)}))}},t.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(jt(),pt(this),Tt()))},t.getDisposer_=function(e){var t=this,n=function n(){t.dispose(),null==e||null==e.removeEventListener||e.removeEventListener("abort",n)};return null==e||null==e.addEventListener||e.addEventListener("abort",n),n[V]=this,n},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(e){void 0===e&&(e=!1),Hn(this,e)},e}();function Rt(e){return kt.globalReactionErrorHandlers.push(e),function(){var t=kt.globalReactionErrorHandlers.indexOf(e);t>=0&&kt.globalReactionErrorHandlers.splice(t,1)}}var Nt=100,Lt=function(e){return e()};function $t(){kt.inBatch>0||kt.isRunningReactions||Lt(Mt)}function Mt(){kt.isRunningReactions=!0;for(var e=kt.pendingReactions,t=0;e.length>0;){++t===Nt&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction_()}kt.isRunningReactions=!1}var Dt=S("Reaction",Ct);function Ft(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var Bt="action",zt="autoAction",Ut="<unnamed action>",qt=ee(Bt),Wt=ee("action.bound",{bound:!0}),Vt=ee(zt,{autoAction:!0}),Qt=ee("autoAction.bound",{autoAction:!0,bound:!0});function Ht(e){return function(t,n){return y(t)?Ve(t.name||Ut,t,e):y(n)?Ve(t,n,e):W(n)?(e?Vt:qt).decorate_20223_(t,n):v(n)?q(t,n,e?Vt:qt):v(t)?U(ee(e?zt:Bt,{name:t,autoAction:e})):void 0}}var Yt=Ht(!1);Object.assign(Yt,qt);var Gt=Ht(!0);function Xt(e){return Qe(e.name||Ut,!1,e,this,void 0)}function Kt(e){return y(e)&&!0===e.isMobxAction}function Jt(e,t){var n,r,i,o,s;void 0===t&&(t=p);var a,l=null!=(n=null==(r=t)?void 0:r.name)?n:"Autorun";if(!t.scheduler&&!t.delay)a=new Ct(l,(function(){this.track(d)}),t.onError,t.requiresObservable);else{var c=en(t),u=!1;a=new Ct(l,(function(){u||(u=!0,c((function(){u=!1,a.isDisposed_||a.track(d)})))}),t.onError,t.requiresObservable)}function d(){e(a)}return null!=(i=t)&&null!=(o=i.signal)&&o.aborted||a.schedule_(),a.getDisposer_(null==(s=t)?void 0:s.signal)}Object.assign(Gt,Vt),Yt.bound=U(Wt),Gt.bound=U(Qt);var Zt=function(e){return e()};function en(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Zt}function tn(e,t,n){var r,i,o,s;void 0===n&&(n=p);var a,l,c,u,d=null!=(r=n.name)?r:"Reaction",f=Yt(d,n.onError?(a=n.onError,l=t,function(){try{return l.apply(this,arguments)}catch(e){a.call(this,e)}}):t),h=!n.scheduler&&!n.delay,m=en(n),g=!0,y=!1,v=n.compareStructural?G.structural:n.equals||G.default,b=new Ct(d,(function(){g||h?x():y||(y=!0,m(x))}),n.onError,n.requiresObservable);function x(){if(y=!1,!b.isDisposed_){var t=!1;b.track((function(){var n=Ge(!1,(function(){return e(b)}));t=g||!v(c,n),u=c,c=n})),(g&&n.fireImmediately||!g&&t)&&f(c,u,b),g=!1}}return null!=(i=n)&&null!=(o=i.signal)&&o.aborted||b.schedule_(),b.getDisposer_(null==(s=n)?void 0:s.signal)}var nn="onBO",rn="onBUO";function on(e,t,n){return an(nn,e,t,n)}function sn(e,t,n){return an(rn,e,t,n)}function an(e,t,n,r){var i="function"==typeof r?Jr(t,n):Jr(t),o=y(r)?r:n,s=e+"L";return i[s]?i[s].add(o):i[s]=new Set([o]),function(){var e=i[s];e&&(e.delete(o),0===e.size&&delete i[s])}}var ln="never",cn="always",un="observed";function pn(e){!0===e.isolateGlobalState&&function(){if((kt.pendingReactions.length||kt.inBatch||kt.isRunningReactions)&&r(36),wt=!0,xt){var e=o();0==--e.__mobxInstanceCount&&(e.__mobxGlobals=void 0),kt=new bt}}();var t,n,i=e.useProxies,s=e.enforceActions;if(void 0!==i&&(kt.useProxies=i===cn||i!==ln&&"undefined"!=typeof Proxy),"ifavailable"===i&&(kt.verifyProxies=!0),void 0!==s){var a=s===cn?cn:s===un;kt.enforceActions=a,kt.allowStateChanges=!0!==a&&a!==cn}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach((function(t){t in e&&(kt[t]=!!e[t])})),kt.allowStateReads=!kt.observableRequiresReaction,e.reactionScheduler&&(t=e.reactionScheduler,n=Lt,Lt=function(e){return t((function(){return n(e)}))})}function dn(e,t,n,r){var i=I(t);return ti((function(){var t=Lr(e,r)[V];j(i).forEach((function(e){t.extend_(e,i[e],!n||(!(e in n)||n[e]))}))})),e}function fn(e,t){return hn(Jr(e,t))}function hn(e){var t,n={name:e.name_};return e.observing_&&e.observing_.length>0&&(n.dependencies=(t=e.observing_,Array.from(new Set(t))).map(hn)),n}function mn(e,t){return gn(Jr(e,t))}function gn(e){var t={name:e.name_};return function(e){return e.observers_&&e.observers_.size>0}(e)&&(t.observers=Array.from(function(e){return e.observers_}(e)).map(gn)),t}var yn=0;function vn(){this.message="FLOW_CANCELLED"}function bn(e){return e instanceof vn}vn.prototype=Object.create(Error.prototype);var xn=oe("flow"),wn=oe("flow.bound",{bound:!0}),kn=Object.assign((function(e,t){if(W(t))return xn.decorate_20223_(e,t);if(v(t))return q(e,t,xn);var n=e,r=n.name||"<unnamed flow>",i=function(){var e,t=arguments,i=++yn,o=Yt(r+" - runid: "+i+" - init",n).apply(this,t),s=void 0,a=new Promise((function(t,n){var a=0;function l(e){var t;s=void 0;try{t=Yt(r+" - runid: "+i+" - yield "+a++,o.next).call(o,e)}catch(l){return n(l)}u(t)}function c(e){var t;s=void 0;try{t=Yt(r+" - runid: "+i+" - yield "+a++,o.throw).call(o,e)}catch(l){return n(l)}u(t)}function u(e){if(!y(null==e?void 0:e.then))return e.done?t(e.value):(s=Promise.resolve(e.value)).then(l,c);e.then(u,n)}e=n,l(void 0)}));return a.cancel=Yt(r+" - runid: "+i+" - cancel",(function(){try{s&&On(s);var t=o.return(void 0),n=Promise.resolve(t.value);n.then(g,g),On(n),e(new vn)}catch(r){e(r)}})),a};return i.isMobXFlow=!0,i}),xn);function On(e){y(e.cancel)&&e.cancel()}function Sn(e){return e}function En(e){return!0===(null==e?void 0:e.isMobXFlow)}function _n(e,t,n){var r;return jr(e)||wr(e)||et(e)?r=Zr(e):Dr(e)&&(r=Zr(e,t)),r.dehancer="function"==typeof t?t:n,function(){r.dehancer=void 0}}function An(e,t,n){return y(n)?function(e,t,n){return Zr(e,t).intercept_(n)}(e,t,n):function(e,t){return Zr(e).intercept_(t)}(e,t)}function jn(e,t){if(void 0===t)return it(e);if(!1===Dr(e))return!1;if(!e[V].values_.has(t))return!1;var n=Jr(e,t);return it(n)}function Tn(e){return jn(e)}function Pn(e,t){return jn(e,t)}function In(e,t){return!!e&&(void 0!==t?!!Dr(e)&&e[V].values_.has(t):Dr(e)||!!e[V]||H(e)||Dt(e)||it(e))}function Cn(e){return In(e)}function Rn(e,t){return In(e,t)}function Nn(e){return Dr(e)?e[V].keys_():jr(e)||Ir(e)?Array.from(e.keys()):wr(e)?e.map((function(e,t){return t})):void r(5)}function Ln(e){return Dr(e)?Nn(e).map((function(t){return e[t]})):jr(e)?Nn(e).map((function(t){return e.get(t)})):Ir(e)?Array.from(e.values()):wr(e)?e.slice():void r(6)}function $n(e){return Dr(e)?Nn(e).map((function(t){return[t,e[t]]})):jr(e)?Nn(e).map((function(t){return[t,e.get(t)]})):Ir(e)?Array.from(e.entries()):wr(e)?e.map((function(e,t){return[t,e]})):void r(7)}function Mn(e,t,n){if(2!==arguments.length||Ir(e))Dr(e)?e[V].set_(t,n):jr(e)?e.set(t,n):Ir(e)?e.add(t):wr(e)?("number"!=typeof t&&(t=parseInt(t,10)),t<0&&r("Invalid index: '"+t+"'"),jt(),t>=e.length&&(e.length=t+1),e[t]=n,Tt()):r(8);else{jt();var i=t;try{for(var o in i)Mn(e,o,i[o])}finally{Tt()}}}function Dn(e,t){Dr(e)?e[V].delete_(t):jr(e)||Ir(e)?e.delete(t):wr(e)?("number"!=typeof t&&(t=parseInt(t,10)),e.splice(t,1)):r(9)}function Fn(e,t){return Dr(e)?e[V].has_(t):jr(e)||Ir(e)?e.has(t):wr(e)?t>=0&&t<e.length:void r(10)}function Bn(e,t){if(Fn(e,t))return Dr(e)?e[V].get_(t):jr(e)?e.get(t):wr(e)?e[t]:void r(11)}function zn(e,t,n){if(Dr(e))return e[V].defineProperty_(t,n);r(39)}function Un(e){if(Dr(e))return e[V].ownKeys_();r(38)}function qn(e,t,n,r){return y(n)?function(e,t,n,r){return Zr(e,t).observe_(n,r)}(e,t,n,r):function(e,t,n){return Zr(e).observe_(t,n)}(e,t,n)}function Wn(e,t,n){return e.set(t,n),n}function Vn(e,t){if(null==e||"object"!=typeof e||e instanceof Date||!Cn(e))return e;if(et(e)||it(e))return Vn(e.get(),t);if(t.has(e))return t.get(e);if(wr(e)){var n=Wn(t,e,new Array(e.length));return e.forEach((function(e,r){n[r]=Vn(e,t)})),n}if(Ir(e)){var r=Wn(t,e,new Set);return e.forEach((function(e){r.add(Vn(e,t))})),r}if(jr(e)){var i=Wn(t,e,new Map);return e.forEach((function(e,n){i.set(n,Vn(e,t))})),i}var o=Wn(t,e,{});return Un(e).forEach((function(n){c.propertyIsEnumerable.call(e,n)&&(o[n]=Vn(e[n],t))})),o}function Qn(e,t){return Vn(e,new Map)}function Hn(){}function Yn(e,t){void 0===t&&(t=void 0),jt();try{return e.apply(t)}finally{Tt()}}function Gn(e,t,n){return 1===arguments.length||t&&"object"==typeof t?function(e,t){var n,r,i;0;if(null!=t&&null!=(n=t.signal)&&n.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var o=new Promise((function(n,o){var s,a=Xn(e,n,N({},t,{onError:o}));r=function(){a(),o(new Error("WHEN_CANCELLED"))},i=function(){a(),o(new Error("WHEN_ABORTED"))},null==t||null==(s=t.signal)||null==s.addEventListener||s.addEventListener("abort",i)})).finally((function(){var e;return null==t||null==(e=t.signal)||null==e.removeEventListener?void 0:e.removeEventListener("abort",i)}));return o.cancel=r,o}(e,t):Xn(e,t,n||{})}function Xn(e,t,n){var r;if("number"==typeof n.timeout){var i=new Error("WHEN_TIMEOUT");r=setTimeout((function(){if(!s[V].isDisposed_){if(s(),!n.onError)throw i;n.onError(i)}}),n.timeout)}n.name="When";var o=Ve("When-effect",t),s=Jt((function(t){Ge(!1,e)&&(t.dispose(),r&&clearTimeout(r),o())}),n);return s}function Kn(e){return e[V]}kn.bound=U(wn);var Jn={has:function(e,t){return Kn(e).has_(t)},get:function(e,t){return Kn(e).get_(t)},set:function(e,t,n){var r;return!!v(t)&&(null==(r=Kn(e).set_(t,n,!0))||r)},deleteProperty:function(e,t){var n;return!!v(t)&&(null==(n=Kn(e).delete_(t,!0))||n)},defineProperty:function(e,t,n){var r;return null==(r=Kn(e).defineProperty_(t,n))||r},ownKeys:function(e){return Kn(e).ownKeys_()},preventExtensions:function(e){r(13)}};function Zn(e){return void 0!==e.interceptors_&&e.interceptors_.length>0}function er(e,t){var n=e.interceptors_||(e.interceptors_=[]);return n.push(t),m((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function tr(e,t){var n=ft();try{for(var i=[].concat(e.interceptors_||[]),o=0,s=i.length;o<s&&((t=i[o](t))&&!t.type&&r(14),t);o++);return t}finally{ht(n)}}function nr(e){return void 0!==e.changeListeners_&&e.changeListeners_.length>0}function rr(e,t){var n=e.changeListeners_||(e.changeListeners_=[]);return n.push(t),m((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function ir(e,t){var n=ft(),r=e.changeListeners_;if(r){for(var i=0,o=(r=r.slice()).length;i<o;i++)r[i](t);ht(n)}}function or(e,t,n){return ti((function(){var r=Lr(e,n)[V];null!=t||(t=function(e){return P(e,z)||k(e,z,N({},e[z])),e[z]}(e)),j(t).forEach((function(e){return r.make_(e,t[e])}))})),e}var sr=Symbol("mobx-keys");function ar(e,t,n){return x(e)?dn(e,e,t,n):(ti((function(){var r=Lr(e,n)[V];if(!e[sr]){var i=Object.getPrototypeOf(e),o=new Set([].concat(j(e),j(i)));o.delete("constructor"),o.delete(V),k(i,sr,o)}e[sr].forEach((function(e){return r.make_(e,!t||(!(e in t)||t[e]))}))})),e)}var lr="splice",cr="update",ur={get:function(e,t){var n=e[V];return t===V?n:"length"===t?n.getArrayLength_():"string"!=typeof t||isNaN(t)?P(fr,t)?fr[t]:e[t]:n.get_(parseInt(t))},set:function(e,t,n){var r=e[V];return"length"===t&&r.setArrayLength_(n),"symbol"==typeof t||isNaN(t)?e[t]=n:r.set_(parseInt(t),n),!0},preventExtensions:function(){r(15)}},pr=function(){function e(e,t,n,r){void 0===e&&(e="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=n,this.legacyMode_=r,this.atom_=new Q(e),this.enhancer_=function(e,n){return t(e,n,"ObservableArray[..]")}}var t=e.prototype;return t.dehanceValue_=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.dehanceValues_=function(e){return void 0!==this.dehancer&&e.length>0?e.map(this.dehancer):e},t.intercept_=function(e){return er(this,e)},t.observe_=function(e,t){return void 0===t&&(t=!1),t&&e({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),rr(this,e)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(e){("number"!=typeof e||isNaN(e)||e<0)&&r("Out of range: "+e);var t=this.values_.length;if(e!==t)if(e>t){for(var n=new Array(e-t),i=0;i<e-t;i++)n[i]=void 0;this.spliceWithArray_(t,0,n)}else this.spliceWithArray_(e,t-e)},t.updateArrayLength_=function(e,t){e!==this.lastKnownLength_&&r(16),this.lastKnownLength_+=t,this.legacyMode_&&t>0&&Xr(e+t+1)},t.spliceWithArray_=function(e,t,n){var r=this;this.atom_;var i=this.values_.length;if(void 0===e?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),t=1===arguments.length?i-e:null==t?0:Math.max(0,Math.min(t,i-e)),void 0===n&&(n=u),Zn(this)){var o=tr(this,{object:this.proxy_,type:lr,index:e,removedCount:t,added:n});if(!o)return u;t=o.removedCount,n=o.added}if(n=0===n.length?n:n.map((function(e){return r.enhancer_(e,void 0)})),this.legacyMode_){var s=n.length-t;this.updateArrayLength_(i,s)}var a=this.spliceItemsIntoValues_(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice_(e,n,a),this.dehanceValues_(a)},t.spliceItemsIntoValues_=function(e,t,n){var r;if(n.length<1e4)return(r=this.values_).splice.apply(r,[e,t].concat(n));var i=this.values_.slice(e,e+t),o=this.values_.slice(e+t);this.values_.length+=n.length-t;for(var s=0;s<n.length;s++)this.values_[e+s]=n[s];for(var a=0;a<o.length;a++)this.values_[e+n.length+a]=o[a];return i},t.notifyArrayChildUpdate_=function(e,t,n){var r=!this.owned_&&!1,i=nr(this),o=i||r?{observableKind:"array",object:this.proxy_,type:cr,debugObjectName:this.atom_.name_,index:e,newValue:t,oldValue:n}:null;this.atom_.reportChanged(),i&&ir(this,o)},t.notifyArraySplice_=function(e,t,n){var r=!this.owned_&&!1,i=nr(this),o=i||r?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:lr,index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;this.atom_.reportChanged(),i&&ir(this,o)},t.get_=function(e){if(!(this.legacyMode_&&e>=this.values_.length))return this.atom_.reportObserved(),this.dehanceValue_(this.values_[e]);console.warn("[mobx] Out of bounds read: "+e)},t.set_=function(e,t){var n=this.values_;if(this.legacyMode_&&e>n.length&&r(17,e,n.length),e<n.length){this.atom_;var i=n[e];if(Zn(this)){var o=tr(this,{type:cr,object:this.proxy_,index:e,newValue:t});if(!o)return;t=o.newValue}(t=this.enhancer_(t,i))!==i&&(n[e]=t,this.notifyArrayChildUpdate_(e,t,i))}else{for(var s=new Array(e+1-n.length),a=0;a<s.length-1;a++)s[a]=void 0;s[s.length-1]=t,this.spliceWithArray_(n.length,0,s)}},e}();function dr(e,t,n,r){return void 0===n&&(n="ObservableArray"),void 0===r&&(r=!1),h(),ti((function(){var i=new pr(n,t,r,!1);O(i.values_,V,i);var o=new Proxy(i.values_,ur);return i.proxy_=o,e&&e.length&&i.spliceWithArray_(0,0,e),o}))}var fr={clear:function(){return this.splice(0)},replace:function(e){var t=this[V];return t.spliceWithArray_(0,t.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var o=this[V];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(e);case 2:return o.spliceWithArray_(e,t)}return o.spliceWithArray_(e,t,r)},spliceWithArray:function(e,t,n){return this[V].spliceWithArray_(e,t,n)},push:function(){for(var e=this[V],t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.spliceWithArray_(e.values_.length,0,n),e.values_.length},pop:function(){return this.splice(Math.max(this[V].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var e=this[V],t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.spliceWithArray_(0,0,n),e.values_.length},reverse:function(){return kt.trackingDerivation&&r(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){kt.trackingDerivation&&r(37,"sort");var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var t=this[V],n=t.dehanceValues_(t.values_).indexOf(e);return n>-1&&(this.splice(n,1),!0)}};function hr(e,t){"function"==typeof Array.prototype[e]&&(fr[e]=t(e))}function mr(e){return function(){var t=this[V];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_);return n[e].apply(n,arguments)}}function gr(e){return function(t,n){var r=this,i=this[V];return i.atom_.reportObserved(),i.dehanceValues_(i.values_)[e]((function(e,i){return t.call(n,e,i,r)}))}}function yr(e){return function(){var t=this,n=this[V];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(e,n,r){return i(e,n,r,t)},r[e].apply(r,arguments)}}hr("concat",mr),hr("flat",mr),hr("includes",mr),hr("indexOf",mr),hr("join",mr),hr("lastIndexOf",mr),hr("slice",mr),hr("toString",mr),hr("toLocaleString",mr),hr("every",gr),hr("filter",gr),hr("find",gr),hr("findIndex",gr),hr("flatMap",gr),hr("forEach",gr),hr("map",gr),hr("some",gr),hr("reduce",yr),hr("reduceRight",yr);var vr,br,xr=S("ObservableArrayAdministration",pr);function wr(e){return b(e)&&xr(e[V])}var kr={},Or="add",Sr="delete";vr=Symbol.iterator,br=Symbol.toStringTag;var Er,_r,Ar=function(){function e(e,t,n){var i=this;void 0===t&&(t=X),void 0===n&&(n="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[V]=kr,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=t,this.name_=n,y(Map)||r(18),ti((function(){i.keysAtom_=Y("ObservableMap.keys()"),i.data_=new Map,i.hasMap_=new Map,e&&i.merge(e)}))}var t=e.prototype;return t.has_=function(e){return this.data_.has(e)},t.has=function(e){var t=this;if(!kt.trackingDerivation)return this.has_(e);var n=this.hasMap_.get(e);if(!n){var r=n=new Ze(this.has_(e),K,"ObservableMap.key?",!1);this.hasMap_.set(e,r),sn(r,(function(){return t.hasMap_.delete(e)}))}return n.get()},t.set=function(e,t){var n=this.has_(e);if(Zn(this)){var r=tr(this,{type:n?cr:Or,object:this,newValue:t,name:e});if(!r)return this;t=r.newValue}return n?this.updateValue_(e,t):this.addValue_(e,t),this},t.delete=function(e){var t=this;if((this.keysAtom_,Zn(this))&&!tr(this,{type:Sr,object:this,name:e}))return!1;if(this.has_(e)){var n=nr(this),r=n?{observableKind:"map",debugObjectName:this.name_,type:Sr,object:this,oldValue:this.data_.get(e).value_,name:e}:null;return Yn((function(){var n;t.keysAtom_.reportChanged(),null==(n=t.hasMap_.get(e))||n.setNewValue_(!1),t.data_.get(e).setNewValue_(void 0),t.data_.delete(e)})),n&&ir(this,r),!0}return!1},t.updateValue_=function(e,t){var n=this.data_.get(e);if((t=n.prepareNewValue_(t))!==kt.UNCHANGED){var r=nr(this),i=r?{observableKind:"map",debugObjectName:this.name_,type:cr,object:this,oldValue:n.value_,name:e,newValue:t}:null;0,n.setNewValue_(t),r&&ir(this,i)}},t.addValue_=function(e,t){var n=this;this.keysAtom_,Yn((function(){var r,i=new Ze(t,n.enhancer_,"ObservableMap.key",!1);n.data_.set(e,i),t=i.value_,null==(r=n.hasMap_.get(e))||r.setNewValue_(!0),n.keysAtom_.reportChanged()}));var r=nr(this),i=r?{observableKind:"map",debugObjectName:this.name_,type:Or,object:this,name:e,newValue:t}:null;r&&ir(this,i)},t.get=function(e){return this.has(e)?this.dehanceValue_(this.data_.get(e).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var e=this,t=this.keys();return si({next:function(){var n=t.next(),r=n.done,i=n.value;return{done:r,value:r?void 0:e.get(i)}}})},t.entries=function(){var e=this,t=this.keys();return si({next:function(){var n=t.next(),r=n.done,i=n.value;return{done:r,value:r?void 0:[i,e.get(i)]}}})},t[vr]=function(){return this.entries()},t.forEach=function(e,t){for(var n,r=F(this);!(n=r()).done;){var i=n.value,o=i[0],s=i[1];e.call(t,s,o,this)}},t.merge=function(e){var t=this;return jr(e)&&(e=new Map(e)),Yn((function(){x(e)?function(e){var t=Object.keys(e);if(!A)return t;var n=Object.getOwnPropertySymbols(e);return n.length?[].concat(t,n.filter((function(t){return c.propertyIsEnumerable.call(e,t)}))):t}(e).forEach((function(n){return t.set(n,e[n])})):Array.isArray(e)?e.forEach((function(e){var n=e[0],r=e[1];return t.set(n,r)})):E(e)?(e.constructor!==Map&&r(19,e),e.forEach((function(e,n){return t.set(n,e)}))):null!=e&&r(20,e)})),this},t.clear=function(){var e=this;Yn((function(){dt((function(){for(var t,n=F(e.keys());!(t=n()).done;){var r=t.value;e.delete(r)}}))}))},t.replace=function(e){var t=this;return Yn((function(){for(var n,i=function(e){if(E(e)||jr(e))return e;if(Array.isArray(e))return new Map(e);if(x(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}return r(21,e)}(e),o=new Map,s=!1,a=F(t.data_.keys());!(n=a()).done;){var l=n.value;if(!i.has(l))if(t.delete(l))s=!0;else{var c=t.data_.get(l);o.set(l,c)}}for(var u,p=F(i.entries());!(u=p()).done;){var d=u.value,f=d[0],h=d[1],m=t.data_.has(f);if(t.set(f,h),t.data_.has(f)){var g=t.data_.get(f);o.set(f,g),m||(s=!0)}}if(!s)if(t.data_.size!==o.size)t.keysAtom_.reportChanged();else for(var y=t.data_.keys(),v=o.keys(),b=y.next(),w=v.next();!b.done;){if(b.value!==w.value){t.keysAtom_.reportChanged();break}b=y.next(),w=v.next()}t.data_=o})),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(e,t){return rr(this,e)},t.intercept_=function(e){return er(this,e)},R(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:br,get:function(){return"Map"}}]),e}(),jr=S("ObservableMap",Ar);var Tr={};Er=Symbol.iterator,_r=Symbol.toStringTag;var Pr=function(){function e(e,t,n){var i=this;void 0===t&&(t=X),void 0===n&&(n="ObservableSet"),this.name_=void 0,this[V]=Tr,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=n,y(Set)||r(22),this.enhancer_=function(e,r){return t(e,r,n)},ti((function(){i.atom_=Y(i.name_),e&&i.replace(e)}))}var t=e.prototype;return t.dehanceValue_=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.clear=function(){var e=this;Yn((function(){dt((function(){for(var t,n=F(e.data_.values());!(t=n()).done;){var r=t.value;e.delete(r)}}))}))},t.forEach=function(e,t){for(var n,r=F(this);!(n=r()).done;){var i=n.value;e.call(t,i,i,this)}},t.add=function(e){var t=this;if((this.atom_,Zn(this))&&!tr(this,{type:Or,object:this,newValue:e}))return this;if(!this.has(e)){Yn((function(){t.data_.add(t.enhancer_(e,void 0)),t.atom_.reportChanged()}));var n=!1,r=nr(this),i=r?{observableKind:"set",debugObjectName:this.name_,type:Or,object:this,newValue:e}:null;n,r&&ir(this,i)}return this},t.delete=function(e){var t=this;if(Zn(this)&&!tr(this,{type:Sr,object:this,oldValue:e}))return!1;if(this.has(e)){var n=nr(this),r=n?{observableKind:"set",debugObjectName:this.name_,type:Sr,object:this,oldValue:e}:null;return Yn((function(){t.atom_.reportChanged(),t.data_.delete(e)})),n&&ir(this,r),!0}return!1},t.has=function(e){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(e))},t.entries=function(){var e=0,t=Array.from(this.keys()),n=Array.from(this.values());return si({next:function(){var r=e;return e+=1,r<n.length?{value:[t[r],n[r]],done:!1}:{done:!0}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var e=this,t=0,n=Array.from(this.data_.values());return si({next:function(){return t<n.length?{value:e.dehanceValue_(n[t++]),done:!1}:{done:!0}}})},t.replace=function(e){var t=this;return Ir(e)&&(e=new Set(e)),Yn((function(){Array.isArray(e)||_(e)?(t.clear(),e.forEach((function(e){return t.add(e)}))):null!=e&&r("Cannot initialize set from "+e)})),this},t.observe_=function(e,t){return rr(this,e)},t.intercept_=function(e){return er(this,e)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Er]=function(){return this.values()},R(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:_r,get:function(){return"Set"}}]),e}(),Ir=S("ObservableSet",Pr),Cr=Object.create(null),Rr="remove",Nr=function(){function e(e,t,n,r){void 0===t&&(t=new Map),void 0===r&&(r=be),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=e,this.values_=t,this.name_=n,this.defaultAnnotation_=r,this.keysAtom_=new Q("ObservableObject.keys"),this.isPlainObject_=x(this.target_)}var t=e.prototype;return t.getObservablePropValue_=function(e){return this.values_.get(e).get()},t.setObservablePropValue_=function(e,t){var n=this.values_.get(e);if(n instanceof rt)return n.set(t),!0;if(Zn(this)){var r=tr(this,{type:cr,object:this.proxy_||this.target_,name:e,newValue:t});if(!r)return null;t=r.newValue}if((t=n.prepareNewValue_(t))!==kt.UNCHANGED){var i=nr(this),o=i?{type:cr,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:n.value_,name:e,newValue:t}:null;0,n.setNewValue_(t),i&&ir(this,o)}return!0},t.get_=function(e){return kt.trackingDerivation&&!P(this.target_,e)&&this.has_(e),this.target_[e]},t.set_=function(e,t,n){return void 0===n&&(n=!1),P(this.target_,e)?this.values_.has(e)?this.setObservablePropValue_(e,t):n?Reflect.set(this.target_,e,t):(this.target_[e]=t,!0):this.extend_(e,{value:t,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,n)},t.has_=function(e){if(!kt.trackingDerivation)return e in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var t=this.pendingKeys_.get(e);return t||(t=new Ze(e in this.target_,K,"ObservableObject.key?",!1),this.pendingKeys_.set(e,t)),t.get()},t.make_=function(e,t){if(!0===t&&(t=this.defaultAnnotation_),!1!==t){if(Br(this,t,e),!(e in this.target_)){var n;if(null!=(n=this.target_[z])&&n[e])return;r(1,t.annotationType_,this.name_+"."+e.toString())}for(var i=this.target_;i&&i!==c;){var o=a(i,e);if(o){var s=t.make_(this,e,o,i);if(0===s)return;if(1===s)break}i=Object.getPrototypeOf(i)}Fr(this,t,e)}},t.extend_=function(e,t,n,r){if(void 0===r&&(r=!1),!0===n&&(n=this.defaultAnnotation_),!1===n)return this.defineProperty_(e,t,r);Br(this,n,e);var i=n.extend_(this,e,t,r);return i&&Fr(this,n,e),i},t.defineProperty_=function(e,t,n){void 0===n&&(n=!1),this.keysAtom_;try{jt();var r=this.delete_(e);if(!r)return r;if(Zn(this)){var i=tr(this,{object:this.proxy_||this.target_,name:e,type:Or,newValue:t.value});if(!i)return null;var o=i.newValue;t.value!==o&&(t=N({},t,{value:o}))}if(n){if(!Reflect.defineProperty(this.target_,e,t))return!1}else l(this.target_,e,t);this.notifyPropertyAddition_(e,t.value)}finally{Tt()}return!0},t.defineObservableProperty_=function(e,t,n,r){void 0===r&&(r=!1),this.keysAtom_;try{jt();var i=this.delete_(e);if(!i)return i;if(Zn(this)){var o=tr(this,{object:this.proxy_||this.target_,name:e,type:Or,newValue:t});if(!o)return null;t=o.newValue}var s=Mr(e),a={configurable:!kt.safeDescriptors||this.isPlainObject_,enumerable:!0,get:s.get,set:s.set};if(r){if(!Reflect.defineProperty(this.target_,e,a))return!1}else l(this.target_,e,a);var c=new Ze(t,n,"ObservableObject.key",!1);this.values_.set(e,c),this.notifyPropertyAddition_(e,c.value_)}finally{Tt()}return!0},t.defineComputedProperty_=function(e,t,n){void 0===n&&(n=!1),this.keysAtom_;try{jt();var r=this.delete_(e);if(!r)return r;if(Zn(this))if(!tr(this,{object:this.proxy_||this.target_,name:e,type:Or,newValue:void 0}))return null;t.name||(t.name="ObservableObject.key"),t.context=this.proxy_||this.target_;var i=Mr(e),o={configurable:!kt.safeDescriptors||this.isPlainObject_,enumerable:!1,get:i.get,set:i.set};if(n){if(!Reflect.defineProperty(this.target_,e,o))return!1}else l(this.target_,e,o);this.values_.set(e,new rt(t)),this.notifyPropertyAddition_(e,void 0)}finally{Tt()}return!0},t.delete_=function(e,t){if(void 0===t&&(t=!1),this.keysAtom_,!P(this.target_,e))return!0;if(Zn(this)&&!tr(this,{object:this.proxy_||this.target_,name:e,type:Rr}))return null;try{var n,r;jt();var i,o=nr(this),s=this.values_.get(e),l=void 0;if(!s&&o)l=null==(i=a(this.target_,e))?void 0:i.value;if(t){if(!Reflect.deleteProperty(this.target_,e))return!1}else delete this.target_[e];if(s&&(this.values_.delete(e),s instanceof Ze&&(l=s.value_),It(s)),this.keysAtom_.reportChanged(),null==(n=this.pendingKeys_)||null==(r=n.get(e))||r.set(e in this.target_),o){var c={type:Rr,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:l,name:e};0,o&&ir(this,c)}}finally{Tt()}return!0},t.observe_=function(e,t){return rr(this,e)},t.intercept_=function(e){return er(this,e)},t.notifyPropertyAddition_=function(e,t){var n,r,i=nr(this);if(i){var o=i?{type:Or,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:e,newValue:t}:null;0,i&&ir(this,o)}null==(n=this.pendingKeys_)||null==(r=n.get(e))||r.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),j(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Lr(e,t){var n;if(P(e,V))return e;var r=null!=(n=null==t?void 0:t.name)?n:"ObservableObject",i=new Nr(e,new Map,String(r),function(e){var t;return e?null!=(t=e.defaultDecorator)?t:xe(e):void 0}(t));return k(e,V,i),e}var $r=S("ObservableObjectAdministration",Nr);function Mr(e){return Cr[e]||(Cr[e]={get:function(){return this[V].getObservablePropValue_(e)},set:function(t){return this[V].setObservablePropValue_(e,t)}})}function Dr(e){return!!b(e)&&$r(e[V])}function Fr(e,t,n){var r;null==(r=e.target_[z])||delete r[n]}function Br(e,t,n){}var zr,Ur,qr=Yr(0),Wr=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,!1===e}(),Vr=0,Qr=function(){};zr=Qr,Ur=Array.prototype,Object.setPrototypeOf?Object.setPrototypeOf(zr.prototype,Ur):void 0!==zr.prototype.__proto__?zr.prototype.__proto__=Ur:zr.prototype=Ur;var Hr=function(e,t,n){function r(t,n,r,i){var o;return void 0===r&&(r="ObservableArray"),void 0===i&&(i=!1),o=e.call(this)||this,ti((function(){var e=new pr(r,n,i,!0);e.proxy_=M(o),O(M(o),V,e),t&&t.length&&o.spliceWithArray(0,0,t),Wr&&Object.defineProperty(M(o),"0",qr)})),o}L(r,e);var i=r.prototype;return i.concat=function(){this[V].atom_.reportObserved();for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Array.prototype.concat.apply(this.slice(),t.map((function(e){return wr(e)?e.slice():e})))},i[n]=function(){var e=this,t=0;return si({next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0,value:void 0}}})},R(r,[{key:"length",get:function(){return this[V].getArrayLength_()},set:function(e){this[V].setArrayLength_(e)}},{key:t,get:function(){return"Array"}}]),r}(Qr,Symbol.toStringTag,Symbol.iterator);function Yr(e){return{enumerable:!1,configurable:!0,get:function(){return this[V].get_(e)},set:function(t){this[V].set_(e,t)}}}function Gr(e){l(Hr.prototype,""+e,Yr(e))}function Xr(e){if(e>Vr){for(var t=Vr;t<e+100;t++)Gr(t);Vr=e}}function Kr(e,t,n){return new Hr(e,t,n)}function Jr(e,t){if("object"==typeof e&&null!==e){if(wr(e))return void 0!==t&&r(23),e[V].atom_;if(Ir(e))return e.atom_;if(jr(e)){if(void 0===t)return e.keysAtom_;var n=e.data_.get(t)||e.hasMap_.get(t);return n||r(25,t,ei(e)),n}if(Dr(e)){if(!t)return r(26);var i=e[V].values_.get(t);return i||r(27,t,ei(e)),i}if(H(e)||it(e)||Dt(e))return e}else if(y(e)&&Dt(e[V]))return e[V];r(28)}function Zr(e,t){return e||r(29),void 0!==t?Zr(Jr(e,t)):H(e)||it(e)||Dt(e)||jr(e)||Ir(e)?e:e[V]?e[V]:void r(24,e)}function ei(e,t){var n;if(void 0!==t)n=Jr(e,t);else{if(Kt(e))return e.name;n=Dr(e)||jr(e)||Ir(e)?Zr(e):Jr(e)}return n.name_}function ti(e){var t=ft(),n=Xe(!0);jt();try{return e()}finally{Tt(),Ke(n),ht(t)}}Object.entries(fr).forEach((function(e){var t=e[0],n=e[1];"concat"!==t&&k(Hr.prototype,t,n)})),Xr(1e3);var ni=c.toString;function ri(e,t,n){return void 0===n&&(n=-1),ii(e,t,n)}function ii(e,t,n,r,i){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var o=typeof e;if("function"!==o&&"object"!==o&&"object"!=typeof t)return!1;var s=ni.call(e);if(s!==ni.call(t))return!1;switch(s){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":n>=0&&n++}e=oi(e),t=oi(t);var a="[object Array]"===s;if(!a){if("object"!=typeof e||"object"!=typeof t)return!1;var l=e.constructor,c=t.constructor;if(l!==c&&!(y(l)&&l instanceof l&&y(c)&&c instanceof c)&&"constructor"in e&&"constructor"in t)return!1}if(0===n)return!1;n<0&&(n=-1),i=i||[];for(var u=(r=r||[]).length;u--;)if(r[u]===e)return i[u]===t;if(r.push(e),i.push(t),a){if((u=e.length)!==t.length)return!1;for(;u--;)if(!ii(e[u],t[u],n-1,r,i))return!1}else{var p,d=Object.keys(e);if(u=d.length,Object.keys(t).length!==u)return!1;for(;u--;)if(!P(t,p=d[u])||!ii(e[p],t[p],n-1,r,i))return!1}return r.pop(),i.pop(),!0}function oi(e){return wr(e)?e.slice():E(e)||jr(e)||_(e)||Ir(e)?Array.from(e.entries()):e}function si(e){return e[Symbol.iterator]=ai,e}function ai(){return this}["Symbol","Map","Set"].forEach((function(e){void 0===o()[e]&&r("MobX requires global '"+e+"' to be available or polyfilled")})),"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Ft,extras:{getDebugName:ei},$mobx:V})},5900:(e,t,n)=>{"use strict";function r(e){return e<10?"0"+e:e}function i(e,t){return t>e.length?e.repeat(Math.trunc(t/e.length)+1).substring(0,t):e}function o(...e){const t=e=>e&&"object"==typeof e;return e.reduce(((e,n)=>(Object.keys(n||{}).forEach((r=>{const i=e[r],s=n[r];t(i)&&t(s)?e[r]=o(i,s):e[r]=s})),e)),Array.isArray(e[e.length-1])?[]:{})}function s(e){return{value:"object"===e?{}:"array"===e?[]:void 0}}function a(e,t){t&&e.pop()}n.r(t),n.d(t,{_registerSampler:()=>S,_samplers:()=>w,inferType:()=>c,sample:()=>O});const l={multipleOf:"number",maximum:"number",exclusiveMaximum:"number",minimum:"number",exclusiveMinimum:"number",maxLength:"string",minLength:"string",pattern:"string",items:"array",maxItems:"array",minItems:"array",uniqueItems:"array",additionalItems:"array",maxProperties:"object",minProperties:"object",required:"object",additionalProperties:"object",properties:"object",patternProperties:"object",dependencies:"object"};function c(e){if(void 0!==e.type)return Array.isArray(e.type)?0===e.type.length?null:e.type[0]:e.type;const t=Object.keys(l);for(var n=0;n<t.length;n++){let r=t[n],i=l[r];if(void 0!==e[r])return i}return null}var u=n(3573),p=n.n(u);let d={},f=[];function h(e){let t;return void 0!==e.const?t=e.const:void 0!==e.examples&&e.examples.length?t=e.examples[0]:void 0!==e.enum&&e.enum.length?t=e.enum[0]:void 0!==e.default&&(t=e.default),t}function m(e){const t=h(e);if(void 0!==t)return{value:t,readOnly:e.readOnly,writeOnly:e.writeOnly,type:null}}function g(e,t,n,r){if(r){if(f.includes(e))return s(c(e));f.push(e)}if(r&&r.depth>t.maxSampleDepth)return a(f,r),s(c(e));if(e.$ref){if(!n)throw new Error("Your schema contains $ref. You must provide full specification in the third parameter.");let i=decodeURIComponent(e.$ref);i.startsWith("#")&&(i=i.substring(1));const o=p().get(n,i);let l;if(!0!==d[i])d[i]=!0,l=g(o,t,n,r),d[i]=!1;else{l=s(c(o))}return a(f,r),l}if(void 0!==e.example)return a(f,r),{value:e.example,readOnly:e.readOnly,writeOnly:e.writeOnly,type:e.type};if(void 0!==e.allOf)return a(f,r),m(e)||function(e,t,n,r,i){let s=g(e,n,r);const a=[];for(let o of t){const{type:e,readOnly:t,writeOnly:l,value:c}=g({type:s.type,...o},n,r,i);s.type&&e&&e!==s.type&&(console.warn("allOf: schemas with different types can't be merged"),s.type=e),s.type=s.type||e,s.readOnly=s.readOnly||t,s.writeOnly=s.writeOnly||l,null!=c&&a.push(c)}if("object"===s.type)return s.value=o(s.value||{},...a.filter((e=>"object"==typeof e))),s;{"array"===s.type&&(n.quiet||console.warn('OpenAPI Sampler: found allOf with "array" type. Result may be incorrect'));const e=a[a.length-1];return s.value=null!=e?e:s.value,s}}({...e,allOf:void 0},e.allOf,t,n,r);if(e.oneOf&&e.oneOf.length){e.anyOf&&(t.quiet||console.warn("oneOf and anyOf are not supported on the same level. Skipping anyOf")),a(f,r);return u(e,Object.assign({readOnly:e.readOnly,writeOnly:e.writeOnly},e.oneOf[0]))}if(e.anyOf&&e.anyOf.length){a(f,r);return u(e,Object.assign({readOnly:e.readOnly,writeOnly:e.writeOnly},e.anyOf[0]))}if(e.if&&e.then){a(f,r);const{if:i,then:s,...l}=e;return g(o(l,i,s),t,n,r)}let i=h(e),l=null;if(void 0===i){i=null,l=e.type,Array.isArray(l)&&e.type.length>0&&(l=e.type[0]),l||(l=c(e));let o=w[l];o&&(i=o(e,t,n,r))}return a(f,r),{value:i,readOnly:e.readOnly,writeOnly:e.writeOnly,type:l};function u(e,i){const s=m(e);if(void 0!==s)return s;const a=g({...e,oneOf:void 0,anyOf:void 0},t,n,r),l=g(i,t,n,r);if("object"==typeof a.value&&"object"==typeof l.value){const e=o(a.value,l.value);return{...l,value:e}}return l}}function y(e){let t=0;if("boolean"==typeof e.exclusiveMinimum||"boolean"==typeof e.exclusiveMaximum){if(e.maximum&&e.minimum)return t=e.exclusiveMinimum?Math.floor(e.minimum)+1:e.minimum,(e.exclusiveMaximum&&t>=e.maximum||!e.exclusiveMaximum&&t>e.maximum)&&(t=(e.maximum+e.minimum)/2),t;if(e.minimum)return e.exclusiveMinimum?Math.floor(e.minimum)+1:e.minimum;if(e.maximum)return e.exclusiveMaximum?e.maximum>0?0:Math.floor(e.maximum)-1:e.maximum>0?0:e.maximum}else{if(e.minimum)return e.minimum;e.exclusiveMinimum?(t=Math.floor(e.exclusiveMinimum)+1,t===e.exclusiveMaximum&&(t=(t+Math.floor(e.exclusiveMaximum)-1)/2)):e.exclusiveMaximum?t=Math.floor(e.exclusiveMaximum)-1:e.maximum&&(t=e.maximum)}return t}function v({min:e,max:t,omitTime:n,omitDate:i}){let o=function(e,t,n,i){var o=n?"":e.getUTCFullYear()+"-"+r(e.getUTCMonth()+1)+"-"+r(e.getUTCDate());return t||(o+="T"+r(e.getUTCHours())+":"+r(e.getUTCMinutes())+":"+r(e.getUTCSeconds())+(i?"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5):"")+"Z"),o}(new Date("2019-08-24T14:15:22.123Z"),n,i,!1);return o.length<e&&console.warn(`Using minLength = ${e} is incorrect with format "date-time"`),t&&o.length>t&&console.warn(`Using maxLength = ${t} is incorrect with format "date-time"`),o}function b(e,t){let n=i("string",e);return t&&n.length>t&&(n=n.substring(0,t)),n}const x={email:function(){return"user@example.com"},"idn-email":function(){return"\u043f\u043e\u0448\u0442\u0430@\u0443\u043a\u0440.\u043d\u0435\u0442"},password:function(e,t){let n="pa$$word";return e>n.length&&(n+="_",n+=i("qwerty!@#$%^123456",e-n.length).substring(0,e-n.length)),n},"date-time":function(e,t){return v({min:e,max:t,omitTime:!1,omitDate:!1})},date:function(e,t){return v({min:e,max:t,omitTime:!0,omitDate:!1})},time:function(e,t){return v({min:e,max:t,omitTime:!1,omitDate:!0}).slice(1)},ipv4:function(){return"192.168.0.1"},ipv6:function(){return"2001:0db8:85a3:0000:0000:8a2e:0370:7334"},hostname:function(){return"example.com"},"idn-hostname":function(){return"\u043f\u0440\u0438\u043a\u043b\u0430\u0434.\u0443\u043a\u0440"},iri:function(){return"http://example.com/entity/1"},"iri-reference":function(){return"/entity/1"},uri:function(){return"http://example.com"},"uri-reference":function(){return"../dictionary"},"uri-template":function(){return"http://example.com/{endpoint}"},uuid:function(e,t,n){return function(e){var t,n,r,i,o=function(e){var t=0;if(0==e.length)return t;for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return t}(e),s=(t=o,n=o,r=o,i=o,function(){var e=(t|=0)-((n|=0)<<27|n>>>5)|0;return t=n^((r|=0)<<17|r>>>15),n=r+(i|=0)|0,r=i+e|0,((i=t+e|0)>>>0)/4294967296}),a="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{var t=16*s()%16|0;return("x"==e?t:3&t|8).toString(16)}));return a}(n||"id")},default:b,"json-pointer":function(){return"/json/pointer"},"relative-json-pointer":function(){return"1/relative/json/pointer"},regex:function(){return"/regex/"}};var w={};const k={skipReadOnly:!1,maxSampleDepth:15};function O(e,t,n){let r=Object.assign({},k,t);return d={},f=[],g(e,r,n).value}function S(e,t){w[e]=t}S("array",(function(e,t={},n,r){const i=r&&r.depth||1;let o=Math.min(null!=e.maxItems?e.maxItems:1/0,e.minItems||1);const s=e.prefixItems||e.items||e.contains;Array.isArray(s)&&(o=Math.max(o,s.length));let a=[];if(!s)return a;for(let c=0;c<o;c++){let e=(l=c,Array.isArray(s)?s[l]||{}:s||{}),{value:r}=g(e,t,n,{depth:i+1});a.push(r)}var l;return a})),S("boolean",(function(e){return!0})),S("integer",y),S("number",y),S("object",(function(e,t={},n,r){let i={};const o=r&&r.depth||1;if(e&&"object"==typeof e.properties){let r=(Array.isArray(e.required)?e.required:[]).reduce(((e,t)=>(e[t]=!0,e)),{});Object.keys(e.properties).forEach((s=>{if(t.skipNonRequired&&!r.hasOwnProperty(s))return;const a=g(e.properties[s],t,n,{propertyName:s,depth:o+1});t.skipReadOnly&&a.readOnly||t.skipWriteOnly&&a.writeOnly||(i[s]=a.value)}))}if(e&&"object"==typeof e.additionalProperties){const r=e.additionalProperties["x-additionalPropertiesName"]||"property";i[`${String(r)}1`]=g(e.additionalProperties,t,n,{depth:o+1}).value,i[`${String(r)}2`]=g(e.additionalProperties,t,n,{depth:o+1}).value}return i})),S("string",(function(e,t,n,r){let i=e.format||"default",o=x[i]||b,s=r&&r.propertyName;return o(0|e.minLength,e.maxLength,s)}))},6470:e=>{"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",i=0,o=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)n=e.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(o===a-1||1===s);else if(o!==a-1&&2===s){if(r.length<2||2!==i||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){var l=r.lastIndexOf("/");if(l!==r.length-1){-1===l?(r="",i=0):i=(r=r.slice(0,l)).length-1-r.lastIndexOf("/"),o=a,s=0;continue}}else if(2===r.length||1===r.length){r="",i=0,o=a,s=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(o+1,a):r=e.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===n&&-1!==s?++s:s=-1}return r}var r={resolve:function(){for(var e,r="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var s;o>=0?s=arguments[o]:(void 0===e&&(e=process.cwd()),s=e),t(s),0!==s.length&&(r=s+"/"+r,i=47===s.charCodeAt(0))}return r=n(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n<arguments.length;++n){var i=arguments[n];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var o=e.length,s=o-i,a=1;a<n.length&&47===n.charCodeAt(a);++a);for(var l=n.length-a,c=s<l?s:l,u=-1,p=0;p<=c;++p){if(p===c){if(l>c){if(47===n.charCodeAt(a+p))return n.slice(a+p+1);if(0===p)return n.slice(a+p)}else s>c&&(47===e.charCodeAt(i+p)?u=p:0===p&&(u=0));break}var d=e.charCodeAt(i+p);if(d!==n.charCodeAt(a+p))break;47===d&&(u=p)}var f="";for(p=i+u+1;p<=o;++p)p!==o&&47!==e.charCodeAt(p)||(0===f.length?f+="..":f+="/..");return f.length>0?f+n.slice(a+u):(a+=u,47===n.charCodeAt(a)&&++a,n.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,i=-1,o=!0,s=e.length-1;s>=1;--s)if(47===(n=e.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return-1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,i=0,o=-1,s=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var a=n.length-1,l=-1;for(r=e.length-1;r>=0;--r){var c=e.charCodeAt(r);if(47===c){if(!s){i=r+1;break}}else-1===l&&(s=!1,l=r+1),a>=0&&(c===n.charCodeAt(a)?-1==--a&&(o=r):(a=-1,o=l))}return i===o?o=l:-1===o&&(o=e.length),e.slice(i,o)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!s){i=r+1;break}}else-1===o&&(s=!1,o=r+1);return-1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,o=!0,s=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47!==l)-1===i&&(o=!1,i=a+1),46===l?-1===n?n=a:1!==s&&(s=1):-1!==n&&(s=-1);else if(!o){r=a+1;break}}return-1===n||-1===i||0===s||1===s&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+e+r:r}("/",e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,i=e.charCodeAt(0),o=47===i;o?(n.root="/",r=1):r=0;for(var s=-1,a=0,l=-1,c=!0,u=e.length-1,p=0;u>=r;--u)if(47!==(i=e.charCodeAt(u)))-1===l&&(c=!1,l=u+1),46===i?-1===s?s=u:1!==p&&(p=1):-1!==s&&(p=-1);else if(!c){a=u+1;break}return-1===s||-1===l||0===p||1===p&&s===l-1&&s===a+1?-1!==l&&(n.base=n.name=0===a&&o?e.slice(1,l):e.slice(a,l)):(0===a&&o?(n.name=e.slice(1,s),n.base=e.slice(1,l)):(n.name=e.slice(a,s),n.base=e.slice(a,l)),n.ext=e.slice(s,l)),a>0?n.dir=e.slice(0,a-1):o&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r},4772:(e,t,n)=>{"use strict";function r(e){return getComputedStyle(e)}function i(e,t){for(var n in t){var r=t[n];"number"==typeof r&&(r+="px"),e.style[n]=r}return e}function o(e){var t=document.createElement("div");return t.className=e,t}n.r(t),n.d(t,{default:()=>_});var s="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function a(e,t){if(!s)throw new Error("No element matching method supported");return s.call(e,t)}function l(e){e.remove?e.remove():e.parentNode&&e.parentNode.removeChild(e)}function c(e,t){return Array.prototype.filter.call(e.children,(function(e){return a(e,t)}))}var u={main:"ps",rtl:"ps__rtl",element:{thumb:function(e){return"ps__thumb-"+e},rail:function(e){return"ps__rail-"+e},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(e){return"ps--active-"+e},scrolling:function(e){return"ps--scrolling-"+e}}},p={x:null,y:null};function d(e,t){var n=e.element.classList,r=u.state.scrolling(t);n.contains(r)?clearTimeout(p[t]):n.add(r)}function f(e,t){p[t]=setTimeout((function(){return e.isAlive&&e.element.classList.remove(u.state.scrolling(t))}),e.settings.scrollingThreshold)}var h=function(e){this.element=e,this.handlers={}},m={isEmpty:{configurable:!0}};h.prototype.bind=function(e,t){void 0===this.handlers[e]&&(this.handlers[e]=[]),this.handlers[e].push(t),this.element.addEventListener(e,t,!1)},h.prototype.unbind=function(e,t){var n=this;this.handlers[e]=this.handlers[e].filter((function(r){return!(!t||r===t)||(n.element.removeEventListener(e,r,!1),!1)}))},h.prototype.unbindAll=function(){for(var e in this.handlers)this.unbind(e)},m.isEmpty.get=function(){var e=this;return Object.keys(this.handlers).every((function(t){return 0===e.handlers[t].length}))},Object.defineProperties(h.prototype,m);var g=function(){this.eventElements=[]};function y(e){if("function"==typeof window.CustomEvent)return new CustomEvent(e);var t=document.createEvent("CustomEvent");return t.initCustomEvent(e,!1,!1,void 0),t}function v(e,t,n,r,i){var o;if(void 0===r&&(r=!0),void 0===i&&(i=!1),"top"===t)o=["contentHeight","containerHeight","scrollTop","y","up","down"];else{if("left"!==t)throw new Error("A proper axis should be provided");o=["contentWidth","containerWidth","scrollLeft","x","left","right"]}!function(e,t,n,r,i){var o=n[0],s=n[1],a=n[2],l=n[3],c=n[4],u=n[5];void 0===r&&(r=!0);void 0===i&&(i=!1);var p=e.element;e.reach[l]=null,p[a]<1&&(e.reach[l]="start");p[a]>e[o]-e[s]-1&&(e.reach[l]="end");t&&(p.dispatchEvent(y("ps-scroll-"+l)),t<0?p.dispatchEvent(y("ps-scroll-"+c)):t>0&&p.dispatchEvent(y("ps-scroll-"+u)),r&&function(e,t){d(e,t),f(e,t)}(e,l));e.reach[l]&&(t||i)&&p.dispatchEvent(y("ps-"+l+"-reach-"+e.reach[l]))}(e,n,o,r,i)}function b(e){return parseInt(e,10)||0}g.prototype.eventElement=function(e){var t=this.eventElements.filter((function(t){return t.element===e}))[0];return t||(t=new h(e),this.eventElements.push(t)),t},g.prototype.bind=function(e,t,n){this.eventElement(e).bind(t,n)},g.prototype.unbind=function(e,t,n){var r=this.eventElement(e);r.unbind(t,n),r.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(r),1)},g.prototype.unbindAll=function(){this.eventElements.forEach((function(e){return e.unbindAll()})),this.eventElements=[]},g.prototype.once=function(e,t,n){var r=this.eventElement(e),i=function(e){r.unbind(t,i),n(e)};r.bind(t,i)};var x={isWebKit:"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style,supportsTouch:"undefined"!=typeof window&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:"undefined"!=typeof navigator&&navigator.msMaxTouchPoints,isChrome:"undefined"!=typeof navigator&&/Chrome/i.test(navigator&&navigator.userAgent)};function w(e){var t=e.element,n=Math.floor(t.scrollTop),r=t.getBoundingClientRect();e.containerWidth=Math.round(r.width),e.containerHeight=Math.round(r.height),e.contentWidth=t.scrollWidth,e.contentHeight=t.scrollHeight,t.contains(e.scrollbarXRail)||(c(t,u.element.rail("x")).forEach((function(e){return l(e)})),t.appendChild(e.scrollbarXRail)),t.contains(e.scrollbarYRail)||(c(t,u.element.rail("y")).forEach((function(e){return l(e)})),t.appendChild(e.scrollbarYRail)),!e.settings.suppressScrollX&&e.containerWidth+e.settings.scrollXMarginOffset<e.contentWidth?(e.scrollbarXActive=!0,e.railXWidth=e.containerWidth-e.railXMarginWidth,e.railXRatio=e.containerWidth/e.railXWidth,e.scrollbarXWidth=k(e,b(e.railXWidth*e.containerWidth/e.contentWidth)),e.scrollbarXLeft=b((e.negativeScrollAdjustment+t.scrollLeft)*(e.railXWidth-e.scrollbarXWidth)/(e.contentWidth-e.containerWidth))):e.scrollbarXActive=!1,!e.settings.suppressScrollY&&e.containerHeight+e.settings.scrollYMarginOffset<e.contentHeight?(e.scrollbarYActive=!0,e.railYHeight=e.containerHeight-e.railYMarginHeight,e.railYRatio=e.containerHeight/e.railYHeight,e.scrollbarYHeight=k(e,b(e.railYHeight*e.containerHeight/e.contentHeight)),e.scrollbarYTop=b(n*(e.railYHeight-e.scrollbarYHeight)/(e.contentHeight-e.containerHeight))):e.scrollbarYActive=!1,e.scrollbarXLeft>=e.railXWidth-e.scrollbarXWidth&&(e.scrollbarXLeft=e.railXWidth-e.scrollbarXWidth),e.scrollbarYTop>=e.railYHeight-e.scrollbarYHeight&&(e.scrollbarYTop=e.railYHeight-e.scrollbarYHeight),function(e,t){var n={width:t.railXWidth},r=Math.floor(e.scrollTop);t.isRtl?n.left=t.negativeScrollAdjustment+e.scrollLeft+t.containerWidth-t.contentWidth:n.left=e.scrollLeft;t.isScrollbarXUsingBottom?n.bottom=t.scrollbarXBottom-r:n.top=t.scrollbarXTop+r;i(t.scrollbarXRail,n);var o={top:r,height:t.railYHeight};t.isScrollbarYUsingRight?t.isRtl?o.right=t.contentWidth-(t.negativeScrollAdjustment+e.scrollLeft)-t.scrollbarYRight-t.scrollbarYOuterWidth-9:o.right=t.scrollbarYRight-e.scrollLeft:t.isRtl?o.left=t.negativeScrollAdjustment+e.scrollLeft+2*t.containerWidth-t.contentWidth-t.scrollbarYLeft-t.scrollbarYOuterWidth:o.left=t.scrollbarYLeft+e.scrollLeft;i(t.scrollbarYRail,o),i(t.scrollbarX,{left:t.scrollbarXLeft,width:t.scrollbarXWidth-t.railBorderXWidth}),i(t.scrollbarY,{top:t.scrollbarYTop,height:t.scrollbarYHeight-t.railBorderYWidth})}(t,e),e.scrollbarXActive?t.classList.add(u.state.active("x")):(t.classList.remove(u.state.active("x")),e.scrollbarXWidth=0,e.scrollbarXLeft=0,t.scrollLeft=!0===e.isRtl?e.contentWidth:0),e.scrollbarYActive?t.classList.add(u.state.active("y")):(t.classList.remove(u.state.active("y")),e.scrollbarYHeight=0,e.scrollbarYTop=0,t.scrollTop=0)}function k(e,t){return e.settings.minScrollbarLength&&(t=Math.max(t,e.settings.minScrollbarLength)),e.settings.maxScrollbarLength&&(t=Math.min(t,e.settings.maxScrollbarLength)),t}function O(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],p=t[8],h=e.element,m=null,g=null,y=null;function v(t){t.touches&&t.touches[0]&&(t[i]=t.touches[0].pageY),h[l]=m+y*(t[i]-g),d(e,c),w(e),t.stopPropagation(),t.type.startsWith("touch")&&t.changedTouches.length>1&&t.preventDefault()}function b(){f(e,c),e[p].classList.remove(u.state.clicking),e.event.unbind(e.ownerDocument,"mousemove",v)}function x(t,s){m=h[l],s&&t.touches&&(t[i]=t.touches[0].pageY),g=t[i],y=(e[r]-e[n])/(e[o]-e[a]),s?e.event.bind(e.ownerDocument,"touchmove",v):(e.event.bind(e.ownerDocument,"mousemove",v),e.event.once(e.ownerDocument,"mouseup",b),t.preventDefault()),e[p].classList.add(u.state.clicking),t.stopPropagation()}e.event.bind(e[s],"mousedown",(function(e){x(e)})),e.event.bind(e[s],"touchstart",(function(e){x(e,!0)}))}var S={"click-rail":function(e){e.element,e.event.bind(e.scrollbarY,"mousedown",(function(e){return e.stopPropagation()})),e.event.bind(e.scrollbarYRail,"mousedown",(function(t){var n=t.pageY-window.pageYOffset-e.scrollbarYRail.getBoundingClientRect().top>e.scrollbarYTop?1:-1;e.element.scrollTop+=n*e.containerHeight,w(e),t.stopPropagation()})),e.event.bind(e.scrollbarX,"mousedown",(function(e){return e.stopPropagation()})),e.event.bind(e.scrollbarXRail,"mousedown",(function(t){var n=t.pageX-window.pageXOffset-e.scrollbarXRail.getBoundingClientRect().left>e.scrollbarXLeft?1:-1;e.element.scrollLeft+=n*e.containerWidth,w(e),t.stopPropagation()}))},"drag-thumb":function(e){O(e,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),O(e,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])},keyboard:function(e){var t=e.element;e.event.bind(e.ownerDocument,"keydown",(function(n){if(!(n.isDefaultPrevented&&n.isDefaultPrevented()||n.defaultPrevented)&&(a(t,":hover")||a(e.scrollbarX,":focus")||a(e.scrollbarY,":focus"))){var r,i=document.activeElement?document.activeElement:e.ownerDocument.activeElement;if(i){if("IFRAME"===i.tagName)i=i.contentDocument.activeElement;else for(;i.shadowRoot;)i=i.shadowRoot.activeElement;if(a(r=i,"input,[contenteditable]")||a(r,"select,[contenteditable]")||a(r,"textarea,[contenteditable]")||a(r,"button,[contenteditable]"))return}var o=0,s=0;switch(n.which){case 37:o=n.metaKey?-e.contentWidth:n.altKey?-e.containerWidth:-30;break;case 38:s=n.metaKey?e.contentHeight:n.altKey?e.containerHeight:30;break;case 39:o=n.metaKey?e.contentWidth:n.altKey?e.containerWidth:30;break;case 40:s=n.metaKey?-e.contentHeight:n.altKey?-e.containerHeight:-30;break;case 32:s=n.shiftKey?e.containerHeight:-e.containerHeight;break;case 33:s=e.containerHeight;break;case 34:s=-e.containerHeight;break;case 36:s=e.contentHeight;break;case 35:s=-e.contentHeight;break;default:return}e.settings.suppressScrollX&&0!==o||e.settings.suppressScrollY&&0!==s||(t.scrollTop-=s,t.scrollLeft+=o,w(e),function(n,r){var i=Math.floor(t.scrollTop);if(0===n){if(!e.scrollbarYActive)return!1;if(0===i&&r>0||i>=e.contentHeight-e.containerHeight&&r<0)return!e.settings.wheelPropagation}var o=t.scrollLeft;if(0===r){if(!e.scrollbarXActive)return!1;if(0===o&&n<0||o>=e.contentWidth-e.containerWidth&&n>0)return!e.settings.wheelPropagation}return!0}(o,s)&&n.preventDefault())}}))},wheel:function(e){var t=e.element;function n(n){var i=function(e){var t=e.deltaX,n=-1*e.deltaY;return void 0!==t&&void 0!==n||(t=-1*e.wheelDeltaX/6,n=e.wheelDeltaY/6),e.deltaMode&&1===e.deltaMode&&(t*=10,n*=10),t!=t&&n!=n&&(t=0,n=e.wheelDelta),e.shiftKey?[-n,-t]:[t,n]}(n),o=i[0],s=i[1];if(!function(e,n,i){if(!x.isWebKit&&t.querySelector("select:focus"))return!0;if(!t.contains(e))return!1;for(var o=e;o&&o!==t;){if(o.classList.contains(u.element.consuming))return!0;var s=r(o);if(i&&s.overflowY.match(/(scroll|auto)/)){var a=o.scrollHeight-o.clientHeight;if(a>0&&(o.scrollTop>0&&i<0||o.scrollTop<a&&i>0))return!0}if(n&&s.overflowX.match(/(scroll|auto)/)){var l=o.scrollWidth-o.clientWidth;if(l>0&&(o.scrollLeft>0&&n<0||o.scrollLeft<l&&n>0))return!0}o=o.parentNode}return!1}(n.target,o,s)){var a=!1;e.settings.useBothWheelAxes?e.scrollbarYActive&&!e.scrollbarXActive?(s?t.scrollTop-=s*e.settings.wheelSpeed:t.scrollTop+=o*e.settings.wheelSpeed,a=!0):e.scrollbarXActive&&!e.scrollbarYActive&&(o?t.scrollLeft+=o*e.settings.wheelSpeed:t.scrollLeft-=s*e.settings.wheelSpeed,a=!0):(t.scrollTop-=s*e.settings.wheelSpeed,t.scrollLeft+=o*e.settings.wheelSpeed),w(e),a=a||function(n,r){var i=Math.floor(t.scrollTop),o=0===t.scrollTop,s=i+t.offsetHeight===t.scrollHeight,a=0===t.scrollLeft,l=t.scrollLeft+t.offsetWidth===t.scrollWidth;return!(Math.abs(r)>Math.abs(n)?o||s:a||l)||!e.settings.wheelPropagation}(o,s),a&&!n.ctrlKey&&(n.stopPropagation(),n.preventDefault())}}void 0!==window.onwheel?e.event.bind(t,"wheel",n):void 0!==window.onmousewheel&&e.event.bind(t,"mousewheel",n)},touch:function(e){if(x.supportsTouch||x.supportsIePointer){var t=e.element,n={},i=0,o={},s=null;x.supportsTouch?(e.event.bind(t,"touchstart",p),e.event.bind(t,"touchmove",d),e.event.bind(t,"touchend",f)):x.supportsIePointer&&(window.PointerEvent?(e.event.bind(t,"pointerdown",p),e.event.bind(t,"pointermove",d),e.event.bind(t,"pointerup",f)):window.MSPointerEvent&&(e.event.bind(t,"MSPointerDown",p),e.event.bind(t,"MSPointerMove",d),e.event.bind(t,"MSPointerUp",f)))}function a(n,r){t.scrollTop-=r,t.scrollLeft-=n,w(e)}function l(e){return e.targetTouches?e.targetTouches[0]:e}function c(e){return(!e.pointerType||"pen"!==e.pointerType||0!==e.buttons)&&(!(!e.targetTouches||1!==e.targetTouches.length)||!(!e.pointerType||"mouse"===e.pointerType||e.pointerType===e.MSPOINTER_TYPE_MOUSE))}function p(e){if(c(e)){var t=l(e);n.pageX=t.pageX,n.pageY=t.pageY,i=(new Date).getTime(),null!==s&&clearInterval(s)}}function d(s){if(c(s)){var p=l(s),d={pageX:p.pageX,pageY:p.pageY},f=d.pageX-n.pageX,h=d.pageY-n.pageY;if(function(e,n,i){if(!t.contains(e))return!1;for(var o=e;o&&o!==t;){if(o.classList.contains(u.element.consuming))return!0;var s=r(o);if(i&&s.overflowY.match(/(scroll|auto)/)){var a=o.scrollHeight-o.clientHeight;if(a>0&&(o.scrollTop>0&&i<0||o.scrollTop<a&&i>0))return!0}if(n&&s.overflowX.match(/(scroll|auto)/)){var l=o.scrollWidth-o.clientWidth;if(l>0&&(o.scrollLeft>0&&n<0||o.scrollLeft<l&&n>0))return!0}o=o.parentNode}return!1}(s.target,f,h))return;a(f,h),n=d;var m=(new Date).getTime(),g=m-i;g>0&&(o.x=f/g,o.y=h/g,i=m),function(n,r){var i=Math.floor(t.scrollTop),o=t.scrollLeft,s=Math.abs(n),a=Math.abs(r);if(a>s){if(r<0&&i===e.contentHeight-e.containerHeight||r>0&&0===i)return 0===window.scrollY&&r>0&&x.isChrome}else if(s>a&&(n<0&&o===e.contentWidth-e.containerWidth||n>0&&0===o))return!0;return!0}(f,h)&&s.preventDefault()}}function f(){e.settings.swipeEasing&&(clearInterval(s),s=setInterval((function(){e.isInitialized?clearInterval(s):o.x||o.y?Math.abs(o.x)<.01&&Math.abs(o.y)<.01?clearInterval(s):e.element?(a(30*o.x,30*o.y),o.x*=.8,o.y*=.8):clearInterval(s):clearInterval(s)}),10))}}},E=function(e,t){var n=this;if(void 0===t&&(t={}),"string"==typeof e&&(e=document.querySelector(e)),!e||!e.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");for(var s in this.element=e,e.classList.add(u.main),this.settings={handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1},t)this.settings[s]=t[s];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var a,l,c=function(){return e.classList.add(u.state.focus)},p=function(){return e.classList.remove(u.state.focus)};this.isRtl="rtl"===r(e).direction,!0===this.isRtl&&e.classList.add(u.rtl),this.isNegativeScroll=(l=e.scrollLeft,e.scrollLeft=-1,a=e.scrollLeft<0,e.scrollLeft=l,a),this.negativeScrollAdjustment=this.isNegativeScroll?e.scrollWidth-e.clientWidth:0,this.event=new g,this.ownerDocument=e.ownerDocument||document,this.scrollbarXRail=o(u.element.rail("x")),e.appendChild(this.scrollbarXRail),this.scrollbarX=o(u.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",c),this.event.bind(this.scrollbarX,"blur",p),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var d=r(this.scrollbarXRail);this.scrollbarXBottom=parseInt(d.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=b(d.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=b(d.borderLeftWidth)+b(d.borderRightWidth),i(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=b(d.marginLeft)+b(d.marginRight),i(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=o(u.element.rail("y")),e.appendChild(this.scrollbarYRail),this.scrollbarY=o(u.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",c),this.event.bind(this.scrollbarY,"blur",p),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var f=r(this.scrollbarYRail);this.scrollbarYRight=parseInt(f.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=b(f.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?function(e){var t=r(e);return b(t.width)+b(t.paddingLeft)+b(t.paddingRight)+b(t.borderLeftWidth)+b(t.borderRightWidth)}(this.scrollbarY):null,this.railBorderYWidth=b(f.borderTopWidth)+b(f.borderBottomWidth),i(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=b(f.marginTop)+b(f.marginBottom),i(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:e.scrollLeft<=0?"start":e.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:e.scrollTop<=0?"start":e.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach((function(e){return S[e](n)})),this.lastScrollTop=Math.floor(e.scrollTop),this.lastScrollLeft=e.scrollLeft,this.event.bind(this.element,"scroll",(function(e){return n.onScroll(e)})),w(this)};E.prototype.update=function(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,i(this.scrollbarXRail,{display:"block"}),i(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=b(r(this.scrollbarXRail).marginLeft)+b(r(this.scrollbarXRail).marginRight),this.railYMarginHeight=b(r(this.scrollbarYRail).marginTop)+b(r(this.scrollbarYRail).marginBottom),i(this.scrollbarXRail,{display:"none"}),i(this.scrollbarYRail,{display:"none"}),w(this),v(this,"top",0,!1,!0),v(this,"left",0,!1,!0),i(this.scrollbarXRail,{display:""}),i(this.scrollbarYRail,{display:""}))},E.prototype.onScroll=function(e){this.isAlive&&(w(this),v(this,"top",this.element.scrollTop-this.lastScrollTop),v(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)},E.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),l(this.scrollbarX),l(this.scrollbarY),l(this.scrollbarXRail),l(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)},E.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter((function(e){return!e.match(/^ps([-_].+|)$/)})).join(" ")};const _=E},3450:function(e){e.exports=function(){var e=[],t=[],n={},r={},i={};function o(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function s(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function a(e,t){return e.replace(/\$(\d{1,2})/g,(function(e,n){return t[n]||""}))}function l(e,t){return e.replace(t[0],(function(n,r){var i=a(t[1],arguments);return s(""===n?e[r-1]:n,i)}))}function c(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var i=r.length;i--;){var o=r[i];if(o[0].test(t))return l(t,o)}return t}function u(e,t,n){return function(r){var i=r.toLowerCase();return t.hasOwnProperty(i)?s(r,i):e.hasOwnProperty(i)?s(r,e[i]):c(i,r,n)}}function p(e,t,n,r){return function(r){var i=r.toLowerCase();return!!t.hasOwnProperty(i)||!e.hasOwnProperty(i)&&c(i,i,n)===i}}function d(e,t,n){return(n?t+" ":"")+(1===t?d.singular(e):d.plural(e))}return d.plural=u(i,r,e),d.isPlural=p(i,r,e),d.singular=u(r,i,t),d.isSingular=p(r,i,t),d.addPluralRule=function(t,n){e.push([o(t),n])},d.addSingularRule=function(e,n){t.push([o(e),n])},d.addUncountableRule=function(e){"string"!=typeof e?(d.addPluralRule(e,"$0"),d.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},d.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),i[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return d.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return d.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return d.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[e\xe9]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(d.addUncountableRule),d}()},1303:(e,t,n)=>{"use strict";n.r(t),n.d(t,{adjustHue:()=>Xe,animation:()=>Rt,backgroundImages:()=>Nt,backgrounds:()=>Lt,between:()=>W,border:()=>Mt,borderColor:()=>Dt,borderRadius:()=>Ft,borderStyle:()=>Bt,borderWidth:()=>zt,buttons:()=>Qt,clearFix:()=>V,complement:()=>Ke,cover:()=>Q,cssVar:()=>b,darken:()=>et,desaturate:()=>nt,directionalProperty:()=>O,easeIn:()=>F,easeInOut:()=>z,easeOut:()=>q,ellipsis:()=>H,em:()=>j,fluidRange:()=>X,fontFace:()=>ie,getContrast:()=>it,getLuminance:()=>rt,getValueAndUnit:()=>P,grayscale:()=>ot,hiDPI:()=>ae,hideText:()=>oe,hideVisually:()=>se,hsl:()=>De,hslToColorString:()=>st,hsla:()=>Fe,important:()=>I,invert:()=>at,lighten:()=>ct,linearGradient:()=>ce,margin:()=>Ht,math:()=>y,meetsContrastGuidelines:()=>ut,mix:()=>dt,modularScale:()=>R,normalize:()=>ue,opacify:()=>ht,padding:()=>Yt,parseToHsl:()=>Ce,parseToRgb:()=>Ie,position:()=>Xt,radialGradient:()=>pe,readableColor:()=>yt,rem:()=>N,remToPx:()=>M,retinaImage:()=>de,rgb:()=>Be,rgbToColorString:()=>vt,rgba:()=>ze,saturate:()=>xt,setHue:()=>kt,setLightness:()=>St,setSaturation:()=>_t,shade:()=>jt,size:()=>Kt,stripUnit:()=>_,textInputs:()=>en,timingFunctions:()=>he,tint:()=>Pt,toColorString:()=>Qe,transitions:()=>tn,transparentize:()=>Ct,triangle:()=>ye,wordWrap:()=>ve});var r=n(7462);var i=n(4578);function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}var s=n(9611);function a(e,t,n){return a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&(0,s.Z)(i,n.prototype),i},a.apply(null,arguments)}function l(e){var t="function"==typeof Map?new Map:void 0;return l=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return a(e,arguments,o(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),(0,s.Z)(n,e)},l(e)}function c(e,t){return t||(t=e.slice(0)),e.raw=t,e}function u(){var e;return(e=arguments.length-1)<0||arguments.length<=e?void 0:arguments[e]}var p={symbols:{"*":{infix:{symbol:"*",f:function(e,t){return e*t},notation:"infix",precedence:4,rightToLeft:0,argCount:2},symbol:"*",regSymbol:"\\*"},"/":{infix:{symbol:"/",f:function(e,t){return e/t},notation:"infix",precedence:4,rightToLeft:0,argCount:2},symbol:"/",regSymbol:"/"},"+":{infix:{symbol:"+",f:function(e,t){return e+t},notation:"infix",precedence:2,rightToLeft:0,argCount:2},prefix:{symbol:"+",f:u,notation:"prefix",precedence:3,rightToLeft:0,argCount:1},symbol:"+",regSymbol:"\\+"},"-":{infix:{symbol:"-",f:function(e,t){return e-t},notation:"infix",precedence:2,rightToLeft:0,argCount:2},prefix:{symbol:"-",f:function(e){return-e},notation:"prefix",precedence:3,rightToLeft:0,argCount:1},symbol:"-",regSymbol:"-"},",":{infix:{symbol:",",f:function(){return Array.of.apply(Array,arguments)},notation:"infix",precedence:1,rightToLeft:0,argCount:2},symbol:",",regSymbol:","},"(":{prefix:{symbol:"(",f:u,notation:"prefix",precedence:0,rightToLeft:0,argCount:1},symbol:"(",regSymbol:"\\("},")":{postfix:{symbol:")",f:void 0,notation:"postfix",precedence:0,rightToLeft:0,argCount:1},symbol:")",regSymbol:"\\)"},min:{func:{symbol:"min",f:function(){return Math.min.apply(Math,arguments)},notation:"func",precedence:0,rightToLeft:0,argCount:1},symbol:"min",regSymbol:"min\\b"},max:{func:{symbol:"max",f:function(){return Math.max.apply(Math,arguments)},notation:"func",precedence:0,rightToLeft:0,argCount:1},symbol:"max",regSymbol:"max\\b"}}};var d=function(e){function t(t){return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+t+" for more information.")||this)}return(0,i.Z)(t,e),t}(l(Error)),f=/((?!\w)a|na|hc|mc|dg|me[r]?|xe|ni(?![a-zA-Z])|mm|cp|tp|xp|q(?!s)|hv|xamv|nimv|wv|sm|s(?!\D|$)|ged|darg?|nrut)/g;function h(e,t){var n,r=e.pop();return t.push(r.f.apply(r,(n=[]).concat.apply(n,t.splice(-r.argCount)))),r.precedence}function m(e,t){var n,i=function(e){var t={};return t.symbols=e?(0,r.Z)({},p.symbols,e.symbols):(0,r.Z)({},p.symbols),t}(t),o=[i.symbols["("].prefix],s=[],a=new RegExp("\\d+(?:\\.\\d+)?|"+Object.keys(i.symbols).map((function(e){return i.symbols[e]})).sort((function(e,t){return t.symbol.length-e.symbol.length})).map((function(e){return e.regSymbol})).join("|")+"|(\\S)","g");a.lastIndex=0;var l=!1;do{var c=(n=a.exec(e))||[")",void 0],u=c[0],f=c[1],m=i.symbols[u],g=m&&!m.prefix&&!m.func,y=!m||!m.postfix&&!m.infix;if(f||(l?y:g))throw new d(37,n?n.index:e.length,e);if(l){var v=m.postfix||m.infix;do{var b=o[o.length-1];if((v.precedence-b.precedence||b.rightToLeft)>0)break}while(h(o,s));l="postfix"===v.notation,")"!==v.symbol&&(o.push(v),l&&h(o,s))}else if(m){if(o.push(m.prefix||m.func),m.func&&(!(n=a.exec(e))||"("!==n[0]))throw new d(38,n?n.index:e.length,e)}else s.push(+u),l=!0}while(n&&o.length);if(o.length)throw new d(39,n?n.index:e.length,e);if(n)throw new d(40,n?n.index:e.length,e);return s.pop()}function g(e){return e.split("").reverse().join("")}function y(e,t){var n=g(e),r=n.match(f);if(r&&!r.every((function(e){return e===r[0]})))throw new d(41);return""+m(g(n.replace(f,"")),t)+(r?g(r[0]):"")}var v=/--[\S]*/g;function b(e,t){if(!e||!e.match(v))throw new d(73);var n;if("undefined"!=typeof document&&null!==document.documentElement&&(n=getComputedStyle(document.documentElement).getPropertyValue(e)),n)return n.trim();if(t)return t;throw new d(74)}function x(e){return e.charAt(0).toUpperCase()+e.slice(1)}var w=["Top","Right","Bottom","Left"];function k(e,t){if(!e)return t.toLowerCase();var n=e.split("-");if(n.length>1)return n.splice(1,0,t),n.reduce((function(e,t){return""+e+x(t)}));var r=e.replace(/([a-z])([A-Z])/g,"$1"+t+"$2");return e===r?""+e+t:r}function O(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=n[0],o=n[1],s=void 0===o?i:o,a=n[2],l=void 0===a?i:a,c=n[3];return function(e,t){for(var n={},r=0;r<t.length;r+=1)(t[r]||0===t[r])&&(n[k(e,w[r])]=t[r]);return n}(e,[i,s,l,void 0===c?s:c])}function S(e,t){return e.substr(-t.length)===t}var E=/^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/;function _(e){return"string"!=typeof e?e:e.match(E)?parseFloat(e):e}var A=function(e){return function(t,n){void 0===n&&(n="16px");var r=t,i=n;if("string"==typeof t){if(!S(t,"px"))throw new d(69,e,t);r=_(t)}if("string"==typeof n){if(!S(n,"px"))throw new d(70,e,n);i=_(n)}if("string"==typeof r)throw new d(71,t,e);if("string"==typeof i)throw new d(72,n,e);return""+r/i+e}},j=A("em"),T=/^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/;function P(e){if("string"!=typeof e)return[e,""];var t=e.match(T);return t?[parseFloat(e),t[2]]:[e,void 0]}function I(e,t){if("object"!=typeof e||null===e)throw new d(75,typeof e);var n={};return Object.keys(e).forEach((function(r){"object"==typeof e[r]&&null!==e[r]?n[r]=I(e[r],t):!t||t&&(t===r||t.indexOf(r)>=0)?n[r]=e[r]+" !important":n[r]=e[r]})),n}var C={minorSecond:1.067,majorSecond:1.125,minorThird:1.2,majorThird:1.25,perfectFourth:1.333,augFourth:1.414,perfectFifth:1.5,minorSixth:1.6,goldenSection:1.618,majorSixth:1.667,minorSeventh:1.778,majorSeventh:1.875,octave:2,majorTenth:2.5,majorEleventh:2.667,majorTwelfth:3,doubleOctave:4};function R(e,t,n){if(void 0===t&&(t="1em"),void 0===n&&(n=1.333),"number"!=typeof e)throw new d(42);if("string"==typeof n&&!C[n])throw new d(43);var r="string"==typeof t?P(t):[t,""],i=r[0],o=r[1],s="string"==typeof n?C[n]:n;if("string"==typeof i)throw new d(44,t);return""+i*Math.pow(s,e)+(o||"")}var N=A("rem"),L=16;function $(e){var t=P(e);if("px"===t[1])return parseFloat(e);if("%"===t[1])return parseFloat(e)/100*L;throw new d(78,t[1])}function M(e,t){var n=P(e);if("rem"!==n[1]&&""!==n[1])throw new d(77,n[1]);var r=t?$(t):function(){if("undefined"!=typeof document&&null!==document.documentElement){var e=getComputedStyle(document.documentElement).fontSize;return e?$(e):L}return L}();return n[0]*r+"px"}var D={back:"cubic-bezier(0.600, -0.280, 0.735, 0.045)",circ:"cubic-bezier(0.600, 0.040, 0.980, 0.335)",cubic:"cubic-bezier(0.550, 0.055, 0.675, 0.190)",expo:"cubic-bezier(0.950, 0.050, 0.795, 0.035)",quad:"cubic-bezier(0.550, 0.085, 0.680, 0.530)",quart:"cubic-bezier(0.895, 0.030, 0.685, 0.220)",quint:"cubic-bezier(0.755, 0.050, 0.855, 0.060)",sine:"cubic-bezier(0.470, 0.000, 0.745, 0.715)"};function F(e){return D[e.toLowerCase().trim()]}var B={back:"cubic-bezier(0.680, -0.550, 0.265, 1.550)",circ:"cubic-bezier(0.785, 0.135, 0.150, 0.860)",cubic:"cubic-bezier(0.645, 0.045, 0.355, 1.000)",expo:"cubic-bezier(1.000, 0.000, 0.000, 1.000)",quad:"cubic-bezier(0.455, 0.030, 0.515, 0.955)",quart:"cubic-bezier(0.770, 0.000, 0.175, 1.000)",quint:"cubic-bezier(0.860, 0.000, 0.070, 1.000)",sine:"cubic-bezier(0.445, 0.050, 0.550, 0.950)"};function z(e){return B[e.toLowerCase().trim()]}var U={back:"cubic-bezier(0.175, 0.885, 0.320, 1.275)",cubic:"cubic-bezier(0.215, 0.610, 0.355, 1.000)",circ:"cubic-bezier(0.075, 0.820, 0.165, 1.000)",expo:"cubic-bezier(0.190, 1.000, 0.220, 1.000)",quad:"cubic-bezier(0.250, 0.460, 0.450, 0.940)",quart:"cubic-bezier(0.165, 0.840, 0.440, 1.000)",quint:"cubic-bezier(0.230, 1.000, 0.320, 1.000)",sine:"cubic-bezier(0.390, 0.575, 0.565, 1.000)"};function q(e){return U[e.toLowerCase().trim()]}function W(e,t,n,r){void 0===n&&(n="320px"),void 0===r&&(r="1200px");var i=P(e),o=i[0],s=i[1],a=P(t),l=a[0],c=a[1],u=P(n),p=u[0],f=u[1],h=P(r),m=h[0],g=h[1];if("number"!=typeof p||"number"!=typeof m||!f||!g||f!==g)throw new d(47);if("number"!=typeof o||"number"!=typeof l||s!==c)throw new d(48);if(s!==f||c!==g)throw new d(76);var y=(o-l)/(p-m);return"calc("+(l-y*m).toFixed(2)+(s||"")+" + "+(100*y).toFixed(2)+"vw)"}function V(e){var t;return void 0===e&&(e="&"),(t={})[e+"::after"]={clear:"both",content:'""',display:"table"},t}function Q(e){return void 0===e&&(e=0),{position:"absolute",top:e,right:e,bottom:e,left:e}}function H(e,t){void 0===t&&(t=1);var n={display:"inline-block",maxWidth:e||"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",wordWrap:"normal"};return t>1?(0,r.Z)({},n,{WebkitBoxOrient:"vertical",WebkitLineClamp:t,display:"-webkit-box",whiteSpace:"normal"}):n}function Y(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return G(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return G(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function G(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function X(e,t,n){if(void 0===t&&(t="320px"),void 0===n&&(n="1200px"),!Array.isArray(e)&&"object"!=typeof e||null===e)throw new d(49);if(Array.isArray(e)){for(var i,o={},s={},a=Y(e);!(i=a()).done;){var l,c,u=i.value;if(!u.prop||!u.fromSize||!u.toSize)throw new d(50);s[u.prop]=u.fromSize,o["@media (min-width: "+t+")"]=(0,r.Z)({},o["@media (min-width: "+t+")"],((l={})[u.prop]=W(u.fromSize,u.toSize,t,n),l)),o["@media (min-width: "+n+")"]=(0,r.Z)({},o["@media (min-width: "+n+")"],((c={})[u.prop]=u.toSize,c))}return(0,r.Z)({},s,o)}var p,f,h;if(!e.prop||!e.fromSize||!e.toSize)throw new d(51);return(h={})[e.prop]=e.fromSize,h["@media (min-width: "+t+")"]=((p={})[e.prop]=W(e.fromSize,e.toSize,t,n),p),h["@media (min-width: "+n+")"]=((f={})[e.prop]=e.toSize,f),h}var K,J,Z=/^\s*data:([a-z]+\/[a-z-]+(;[a-z-]+=[a-z-]+)?)?(;charset=[a-z0-9-]+)?(;base64)?,[a-z0-9!$&',()*+,;=\-._~:@/?%\s]*\s*$/i,ee={woff:"woff",woff2:"woff2",ttf:"truetype",otf:"opentype",eot:"embedded-opentype",svg:"svg",svgz:"svg"};function te(e,t){return t?' format("'+ee[e]+'")':""}function ne(e,t,n){if(function(e){return!!e.replace(/\s+/g," ").match(Z)}(e))return'url("'+e+'")'+te(t[0],n);var r=t.map((function(t){return'url("'+e+"."+t+'")'+te(t,n)}));return r.join(", ")}function re(e,t,n,r){var i=[];return t&&i.push(function(e){return e.map((function(e){return'local("'+e+'")'})).join(", ")}(t)),e&&i.push(ne(e,n,r)),i.join(", ")}function ie(e){var t=e.fontFamily,n=e.fontFilePath,r=e.fontStretch,i=e.fontStyle,o=e.fontVariant,s=e.fontWeight,a=e.fileFormats,l=void 0===a?["eot","woff2","woff","ttf","svg"]:a,c=e.formatHint,u=void 0!==c&&c,p=e.localFonts,f=void 0===p?[t]:p,h=e.unicodeRange,m=e.fontDisplay,g=e.fontVariationSettings,y=e.fontFeatureSettings;if(!t)throw new d(55);if(!n&&!f)throw new d(52);if(f&&!Array.isArray(f))throw new d(53);if(!Array.isArray(l))throw new d(54);var v={"@font-face":{fontFamily:t,src:re(n,f,l,u),unicodeRange:h,fontStretch:r,fontStyle:i,fontVariant:o,fontWeight:s,fontDisplay:m,fontVariationSettings:g,fontFeatureSettings:y}};return JSON.parse(JSON.stringify(v))}function oe(){return{textIndent:"101%",overflow:"hidden",whiteSpace:"nowrap"}}function se(){return{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",whiteSpace:"nowrap",width:"1px"}}function ae(e){return void 0===e&&(e=1.3),"\n @media only screen and (-webkit-min-device-pixel-ratio: "+e+"),\n only screen and (min--moz-device-pixel-ratio: "+e+"),\n only screen and (-o-min-device-pixel-ratio: "+e+"/1),\n only screen and (min-resolution: "+Math.round(96*e)+"dpi),\n only screen and (min-resolution: "+e+"dppx)\n "}function le(e){for(var t="",n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];for(var o=0;o<e.length;o+=1)if(t+=e[o],o===r.length-1&&r[o]){var s=r.filter((function(e){return!!e}));s.length>1?(t=t.slice(0,-1),t+=", "+r[o]):1===s.length&&(t+=""+r[o])}else r[o]&&(t+=r[o]+" ");return t.trim()}function ce(e){var t=e.colorStops,n=e.fallback,r=e.toDirection,i=void 0===r?"":r;if(!t||t.length<2)throw new d(56);return{backgroundColor:n||t[0].replace(/,\s+/g,",").split(" ")[0].replace(/,(?=\S)/g,", "),backgroundImage:le(K||(K=c(["linear-gradient(","",")"])),i,t.join(", ").replace(/,(?=\S)/g,", "))}}function ue(){var e;return[(e={html:{lineHeight:"1.15",textSizeAdjust:"100%"},body:{margin:"0"},main:{display:"block"},h1:{fontSize:"2em",margin:"0.67em 0"},hr:{boxSizing:"content-box",height:"0",overflow:"visible"},pre:{fontFamily:"monospace, monospace",fontSize:"1em"},a:{backgroundColor:"transparent"},"abbr[title]":{borderBottom:"none",textDecoration:"underline"}},e["b,\n strong"]={fontWeight:"bolder"},e["code,\n kbd,\n samp"]={fontFamily:"monospace, monospace",fontSize:"1em"},e.small={fontSize:"80%"},e["sub,\n sup"]={fontSize:"75%",lineHeight:"0",position:"relative",verticalAlign:"baseline"},e.sub={bottom:"-0.25em"},e.sup={top:"-0.5em"},e.img={borderStyle:"none"},e["button,\n input,\n optgroup,\n select,\n textarea"]={fontFamily:"inherit",fontSize:"100%",lineHeight:"1.15",margin:"0"},e["button,\n input"]={overflow:"visible"},e["button,\n select"]={textTransform:"none"},e['button,\n html [type="button"],\n [type="reset"],\n [type="submit"]']={WebkitAppearance:"button"},e['button::-moz-focus-inner,\n [type="button"]::-moz-focus-inner,\n [type="reset"]::-moz-focus-inner,\n [type="submit"]::-moz-focus-inner']={borderStyle:"none",padding:"0"},e['button:-moz-focusring,\n [type="button"]:-moz-focusring,\n [type="reset"]:-moz-focusring,\n [type="submit"]:-moz-focusring']={outline:"1px dotted ButtonText"},e.fieldset={padding:"0.35em 0.625em 0.75em"},e.legend={boxSizing:"border-box",color:"inherit",display:"table",maxWidth:"100%",padding:"0",whiteSpace:"normal"},e.progress={verticalAlign:"baseline"},e.textarea={overflow:"auto"},e['[type="checkbox"],\n [type="radio"]']={boxSizing:"border-box",padding:"0"},e['[type="number"]::-webkit-inner-spin-button,\n [type="number"]::-webkit-outer-spin-button']={height:"auto"},e['[type="search"]']={WebkitAppearance:"textfield",outlineOffset:"-2px"},e['[type="search"]::-webkit-search-decoration']={WebkitAppearance:"none"},e["::-webkit-file-upload-button"]={WebkitAppearance:"button",font:"inherit"},e.details={display:"block"},e.summary={display:"list-item"},e.template={display:"none"},e["[hidden]"]={display:"none"},e),{"abbr[title]":{textDecoration:"underline dotted"}}]}function pe(e){var t=e.colorStops,n=e.extent,r=void 0===n?"":n,i=e.fallback,o=e.position,s=void 0===o?"":o,a=e.shape,l=void 0===a?"":a;if(!t||t.length<2)throw new d(57);return{backgroundColor:i||t[0].split(" ")[0],backgroundImage:le(J||(J=c(["radial-gradient(","","","",")"])),s,l,r,t.join(", "))}}function de(e,t,n,i,o){var s;if(void 0===n&&(n="png"),void 0===o&&(o="_2x"),!e)throw new d(58);var a=n.replace(/^\./,""),l=i?i+"."+a:""+e+o+"."+a;return(s={backgroundImage:"url("+e+"."+a+")"})[ae()]=(0,r.Z)({backgroundImage:"url("+l+")"},t?{backgroundSize:t}:{}),s}var fe={easeInBack:"cubic-bezier(0.600, -0.280, 0.735, 0.045)",easeInCirc:"cubic-bezier(0.600, 0.040, 0.980, 0.335)",easeInCubic:"cubic-bezier(0.550, 0.055, 0.675, 0.190)",easeInExpo:"cubic-bezier(0.950, 0.050, 0.795, 0.035)",easeInQuad:"cubic-bezier(0.550, 0.085, 0.680, 0.530)",easeInQuart:"cubic-bezier(0.895, 0.030, 0.685, 0.220)",easeInQuint:"cubic-bezier(0.755, 0.050, 0.855, 0.060)",easeInSine:"cubic-bezier(0.470, 0.000, 0.745, 0.715)",easeOutBack:"cubic-bezier(0.175, 0.885, 0.320, 1.275)",easeOutCubic:"cubic-bezier(0.215, 0.610, 0.355, 1.000)",easeOutCirc:"cubic-bezier(0.075, 0.820, 0.165, 1.000)",easeOutExpo:"cubic-bezier(0.190, 1.000, 0.220, 1.000)",easeOutQuad:"cubic-bezier(0.250, 0.460, 0.450, 0.940)",easeOutQuart:"cubic-bezier(0.165, 0.840, 0.440, 1.000)",easeOutQuint:"cubic-bezier(0.230, 1.000, 0.320, 1.000)",easeOutSine:"cubic-bezier(0.390, 0.575, 0.565, 1.000)",easeInOutBack:"cubic-bezier(0.680, -0.550, 0.265, 1.550)",easeInOutCirc:"cubic-bezier(0.785, 0.135, 0.150, 0.860)",easeInOutCubic:"cubic-bezier(0.645, 0.045, 0.355, 1.000)",easeInOutExpo:"cubic-bezier(1.000, 0.000, 0.000, 1.000)",easeInOutQuad:"cubic-bezier(0.455, 0.030, 0.515, 0.955)",easeInOutQuart:"cubic-bezier(0.770, 0.000, 0.175, 1.000)",easeInOutQuint:"cubic-bezier(0.860, 0.000, 0.070, 1.000)",easeInOutSine:"cubic-bezier(0.445, 0.050, 0.550, 0.950)"};function he(e){return fe[e]}var me=function(e,t,n){var r=""+n[0]+(n[1]||""),i=""+n[0]/2+(n[1]||""),o=""+t[0]+(t[1]||""),s=""+t[0]/2+(t[1]||"");switch(e){case"top":return"0 "+i+" "+o+" "+i;case"topLeft":return r+" "+o+" 0 0";case"left":return s+" "+r+" "+s+" 0";case"bottomLeft":return r+" 0 0 "+o;case"bottom":return o+" "+i+" 0 "+i;case"bottomRight":return"0 0 "+r+" "+o;case"right":return s+" 0 "+s+" "+r;default:return"0 "+r+" "+o+" 0"}},ge=function(e,t){switch(e){case"top":case"bottomRight":return{borderBottomColor:t};case"right":case"bottomLeft":return{borderLeftColor:t};case"bottom":case"topLeft":return{borderTopColor:t};case"left":case"topRight":return{borderRightColor:t};default:throw new d(59)}};function ye(e){var t=e.pointingDirection,n=e.height,i=e.width,o=e.foregroundColor,s=e.backgroundColor,a=void 0===s?"transparent":s,l=P(i),c=P(n);if(isNaN(c[0])||isNaN(l[0]))throw new d(60);return(0,r.Z)({width:"0",height:"0",borderColor:a},ge(t,o),{borderStyle:"solid",borderWidth:me(t,c,l)})}function ve(e){return void 0===e&&(e="break-word"),{overflowWrap:e,wordWrap:e,wordBreak:"break-word"===e?"break-all":e}}function be(e){return Math.round(255*e)}function xe(e,t,n){return be(e)+","+be(t)+","+be(n)}function we(e,t,n,r){if(void 0===r&&(r=xe),0===t)return r(n,n,n);var i=(e%360+360)%360/60,o=(1-Math.abs(2*n-1))*t,s=o*(1-Math.abs(i%2-1)),a=0,l=0,c=0;i>=0&&i<1?(a=o,l=s):i>=1&&i<2?(a=s,l=o):i>=2&&i<3?(l=o,c=s):i>=3&&i<4?(l=s,c=o):i>=4&&i<5?(a=s,c=o):i>=5&&i<6&&(a=o,c=s);var u=n-o/2;return r(a+u,l+u,c+u)}var ke={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var Oe=/^#[a-fA-F0-9]{6}$/,Se=/^#[a-fA-F0-9]{8}$/,Ee=/^#[a-fA-F0-9]{3}$/,_e=/^#[a-fA-F0-9]{4}$/,Ae=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,je=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,Te=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,Pe=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function Ie(e){if("string"!=typeof e)throw new d(3);var t=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return ke[t]?"#"+ke[t]:e}(e);if(t.match(Oe))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(Se)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:n}}if(t.match(Ee))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(_e)){var r=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:r}}var i=Ae.exec(t);if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10)};var o=je.exec(t.substring(0,50));if(o)return{red:parseInt(""+o[1],10),green:parseInt(""+o[2],10),blue:parseInt(""+o[3],10),alpha:parseFloat(""+o[4])>1?parseFloat(""+o[4])/100:parseFloat(""+o[4])};var s=Te.exec(t);if(s){var a="rgb("+we(parseInt(""+s[1],10),parseInt(""+s[2],10)/100,parseInt(""+s[3],10)/100)+")",l=Ae.exec(a);if(!l)throw new d(4,t,a);return{red:parseInt(""+l[1],10),green:parseInt(""+l[2],10),blue:parseInt(""+l[3],10)}}var c=Pe.exec(t.substring(0,50));if(c){var u="rgb("+we(parseInt(""+c[1],10),parseInt(""+c[2],10)/100,parseInt(""+c[3],10)/100)+")",p=Ae.exec(u);if(!p)throw new d(4,t,u);return{red:parseInt(""+p[1],10),green:parseInt(""+p[2],10),blue:parseInt(""+p[3],10),alpha:parseFloat(""+c[4])>1?parseFloat(""+c[4])/100:parseFloat(""+c[4])}}throw new d(5)}function Ce(e){return function(e){var t,n=e.red/255,r=e.green/255,i=e.blue/255,o=Math.max(n,r,i),s=Math.min(n,r,i),a=(o+s)/2;if(o===s)return void 0!==e.alpha?{hue:0,saturation:0,lightness:a,alpha:e.alpha}:{hue:0,saturation:0,lightness:a};var l=o-s,c=a>.5?l/(2-o-s):l/(o+s);switch(o){case n:t=(r-i)/l+(r<i?6:0);break;case r:t=(i-n)/l+2;break;default:t=(n-r)/l+4}return t*=60,void 0!==e.alpha?{hue:t,saturation:c,lightness:a,alpha:e.alpha}:{hue:t,saturation:c,lightness:a}}(Ie(e))}var Re=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function Ne(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function Le(e){return Ne(Math.round(255*e))}function $e(e,t,n){return Re("#"+Le(e)+Le(t)+Le(n))}function Me(e,t,n){return we(e,t,n,$e)}function De(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return Me(e,t,n);if("object"==typeof e&&void 0===t&&void 0===n)return Me(e.hue,e.saturation,e.lightness);throw new d(1)}function Fe(e,t,n,r){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof r)return r>=1?Me(e,t,n):"rgba("+we(e,t,n)+","+r+")";if("object"==typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?Me(e.hue,e.saturation,e.lightness):"rgba("+we(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new d(2)}function Be(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return Re("#"+Ne(e)+Ne(t)+Ne(n));if("object"==typeof e&&void 0===t&&void 0===n)return Re("#"+Ne(e.red)+Ne(e.green)+Ne(e.blue));throw new d(6)}function ze(e,t,n,r){if("string"==typeof e&&"number"==typeof t){var i=Ie(e);return"rgba("+i.red+","+i.green+","+i.blue+","+t+")"}if("number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof r)return r>=1?Be(e,t,n):"rgba("+e+","+t+","+n+","+r+")";if("object"==typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?Be(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new d(7)}var Ue=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)},qe=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha},We=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)},Ve=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha};function Qe(e){if("object"!=typeof e)throw new d(8);if(qe(e))return ze(e);if(Ue(e))return Be(e);if(Ve(e))return Fe(e);if(We(e))return De(e);throw new d(8)}function He(e,t,n){return function(){var r=n.concat(Array.prototype.slice.call(arguments));return r.length>=t?e.apply(this,r):He(e,t,r)}}function Ye(e){return He(e,e.length,[])}function Ge(e,t){if("transparent"===t)return t;var n=Ce(t);return Qe((0,r.Z)({},n,{hue:n.hue+parseFloat(e)}))}var Xe=Ye(Ge);function Ke(e){if("transparent"===e)return e;var t=Ce(e);return Qe((0,r.Z)({},t,{hue:(t.hue+180)%360}))}function Je(e,t,n){return Math.max(e,Math.min(t,n))}function Ze(e,t){if("transparent"===t)return t;var n=Ce(t);return Qe((0,r.Z)({},n,{lightness:Je(0,1,n.lightness-parseFloat(e))}))}var et=Ye(Ze);function tt(e,t){if("transparent"===t)return t;var n=Ce(t);return Qe((0,r.Z)({},n,{saturation:Je(0,1,n.saturation-parseFloat(e))}))}var nt=Ye(tt);function rt(e){if("transparent"===e)return 0;var t=Ie(e),n=Object.keys(t).map((function(e){var n=t[e]/255;return n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)})),r=n[0],i=n[1],o=n[2];return parseFloat((.2126*r+.7152*i+.0722*o).toFixed(3))}function it(e,t){var n=rt(e),r=rt(t);return parseFloat((n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)).toFixed(2))}function ot(e){return"transparent"===e?e:Qe((0,r.Z)({},Ce(e),{saturation:0}))}function st(e){if("object"==typeof e&&"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness)return e.alpha&&"number"==typeof e.alpha?Fe({hue:e.hue,saturation:e.saturation,lightness:e.lightness,alpha:e.alpha}):De({hue:e.hue,saturation:e.saturation,lightness:e.lightness});throw new d(45)}function at(e){if("transparent"===e)return e;var t=Ie(e);return Qe((0,r.Z)({},t,{red:255-t.red,green:255-t.green,blue:255-t.blue}))}function lt(e,t){if("transparent"===t)return t;var n=Ce(t);return Qe((0,r.Z)({},n,{lightness:Je(0,1,n.lightness+parseFloat(e))}))}var ct=Ye(lt);function ut(e,t){var n=it(e,t);return{AA:n>=4.5,AALarge:n>=3,AAA:n>=7,AAALarge:n>=4.5}}function pt(e,t,n){if("transparent"===t)return n;if("transparent"===n)return t;if(0===e)return n;var i=Ie(t),o=(0,r.Z)({},i,{alpha:"number"==typeof i.alpha?i.alpha:1}),s=Ie(n),a=(0,r.Z)({},s,{alpha:"number"==typeof s.alpha?s.alpha:1}),l=o.alpha-a.alpha,c=2*parseFloat(e)-1,u=((c*l==-1?c:c+l)/(1+c*l)+1)/2,p=1-u;return ze({red:Math.floor(o.red*u+a.red*p),green:Math.floor(o.green*u+a.green*p),blue:Math.floor(o.blue*u+a.blue*p),alpha:o.alpha*parseFloat(e)+a.alpha*(1-parseFloat(e))})}var dt=Ye(pt);function ft(e,t){if("transparent"===t)return t;var n=Ie(t),i="number"==typeof n.alpha?n.alpha:1;return ze((0,r.Z)({},n,{alpha:Je(0,1,(100*i+100*parseFloat(e))/100)}))}var ht=Ye(ft),mt="#000",gt="#fff";function yt(e,t,n,r){void 0===t&&(t=mt),void 0===n&&(n=gt),void 0===r&&(r=!0);var i=rt(e)>.179,o=i?t:n;return!r||it(e,o)>=4.5?o:i?mt:gt}function vt(e){if("object"==typeof e&&"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue)return"number"==typeof e.alpha?ze({red:e.red,green:e.green,blue:e.blue,alpha:e.alpha}):Be({red:e.red,green:e.green,blue:e.blue});throw new d(46)}function bt(e,t){if("transparent"===t)return t;var n=Ce(t);return Qe((0,r.Z)({},n,{saturation:Je(0,1,n.saturation+parseFloat(e))}))}var xt=Ye(bt);function wt(e,t){return"transparent"===t?t:Qe((0,r.Z)({},Ce(t),{hue:parseFloat(e)}))}var kt=Ye(wt);function Ot(e,t){return"transparent"===t?t:Qe((0,r.Z)({},Ce(t),{lightness:parseFloat(e)}))}var St=Ye(Ot);function Et(e,t){return"transparent"===t?t:Qe((0,r.Z)({},Ce(t),{saturation:parseFloat(e)}))}var _t=Ye(Et);function At(e,t){return"transparent"===t?t:dt(parseFloat(e),"rgb(0, 0, 0)",t)}var jt=Ye(At);function Tt(e,t){return"transparent"===t?t:dt(parseFloat(e),"rgb(255, 255, 255)",t)}var Pt=Ye(Tt);function It(e,t){if("transparent"===t)return t;var n=Ie(t),i="number"==typeof n.alpha?n.alpha:1;return ze((0,r.Z)({},n,{alpha:Je(0,1,+(100*i-100*parseFloat(e)).toFixed(2)/100)}))}var Ct=Ye(It);function Rt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Array.isArray(t[0]);if(!r&&t.length>8)throw new d(64);return{animation:t.map((function(e){if(r&&!Array.isArray(e)||!r&&Array.isArray(e))throw new d(65);if(Array.isArray(e)&&e.length>8)throw new d(66);return Array.isArray(e)?e.join(" "):e})).join(", ")}}function Nt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return{backgroundImage:t.join(", ")}}function Lt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return{background:t.join(", ")}}var $t=["top","right","bottom","left"];function Mt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i;return"string"==typeof e&&$t.indexOf(e)>=0?((i={})["border"+x(e)+"Width"]=n[0],i["border"+x(e)+"Style"]=n[1],i["border"+x(e)+"Color"]=n[2],i):(n.unshift(e),{borderWidth:n[0],borderStyle:n[1],borderColor:n[2]})}function Dt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return O.apply(void 0,["borderColor"].concat(t))}function Ft(e,t){var n,r,i=x(e);if(!t&&0!==t)throw new d(62);if("Top"===i||"Bottom"===i)return(n={})["border"+i+"RightRadius"]=t,n["border"+i+"LeftRadius"]=t,n;if("Left"===i||"Right"===i)return(r={})["borderTop"+i+"Radius"]=t,r["borderBottom"+i+"Radius"]=t,r;throw new d(63)}function Bt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return O.apply(void 0,["borderStyle"].concat(t))}function zt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return O.apply(void 0,["borderWidth"].concat(t))}function Ut(e,t){return e(t?":"+t:"")}function qt(e,t,n){if(!t)throw new d(67);if(0===e.length)return Ut(t,null);for(var r=[],i=0;i<e.length;i+=1){if(n&&n.indexOf(e[i])<0)throw new d(68);r.push(Ut(t,e[i]))}return r=r.join(",")}var Wt=[void 0,null,"active","focus","hover"];function Vt(e){return"button"+e+',\n input[type="button"]'+e+',\n input[type="reset"]'+e+',\n input[type="submit"]'+e}function Qt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return qt(t,Vt,Wt)}function Ht(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return O.apply(void 0,["margin"].concat(t))}function Yt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return O.apply(void 0,["padding"].concat(t))}var Gt=["absolute","fixed","relative","static","sticky"];function Xt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return Gt.indexOf(e)>=0&&e?(0,r.Z)({},O.apply(void 0,[""].concat(n)),{position:e}):O.apply(void 0,["",e].concat(n))}function Kt(e,t){return void 0===t&&(t=e),{height:e,width:t}}var Jt=[void 0,null,"active","focus","hover"];function Zt(e){return'input[type="color"]'+e+',\n input[type="date"]'+e+',\n input[type="datetime"]'+e+',\n input[type="datetime-local"]'+e+',\n input[type="email"]'+e+',\n input[type="month"]'+e+',\n input[type="number"]'+e+',\n input[type="password"]'+e+',\n input[type="search"]'+e+',\n input[type="tel"]'+e+',\n input[type="text"]'+e+',\n input[type="time"]'+e+',\n input[type="url"]'+e+',\n input[type="week"]'+e+",\n input:not([type])"+e+",\n textarea"+e}function en(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return qt(t,Zt,Jt)}function tn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Array.isArray(t[0])&&2===t.length){var r=t[1];if("string"!=typeof r)throw new d(61);return{transition:t[0].map((function(e){return e+" "+r})).join(", ")}}return{transition:t.join(", ")}}},7874:()=>{!function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=r.variable[1].inside,s=0;s<i.length;s++)o[i[s]]=e.languages.bash[i[s]];e.languages.sh=e.languages.bash,e.languages.shell=e.languages.bash}(Prism)},4279:()=>{Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean},5433:()=>{Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}},6213:()=>{!function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(Prism)},2731:()=>{!function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism)},9016:()=>{!function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,(function(e,n){return"(?:"+t[+n]+")"}))}function n(e,n,r){return RegExp(t(e,n),r||"")}function r(e,t){for(var n=0;n<t;n++)e=e.replace(/<<self>>/g,(function(){return"(?:"+e+")"}));return e.replace(/<<self>>/g,"[^\\s\\S]")}var i="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",o="class enum interface record struct",s="add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",a="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function l(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var c=l(o),u=RegExp(l(i+" "+o+" "+s+" "+a)),p=l(o+" "+s+" "+a),d=l(i+" "+o+" "+a),f=r(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),h=r(/\((?:[^()]|<<self>>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,g=t(/<<0>>(?:\s*<<1>>)?/.source,[m,f]),y=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[p,g]),v=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[y,v]),x=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[f,h,v]),w=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[x]),k=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[w,y,v]),O={keyword:u,punctuation:/[<>()?,.:[\]]/},S=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,E=/"(?:\\.|[^\\"\r\n])*"/.source,_=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;e.languages.csharp=e.languages.extend("clike",{string:[{pattern:n(/(^|[^$\\])<<0>>/.source,[_]),lookbehind:!0,greedy:!0},{pattern:n(/(^|[^@$\\])<<0>>/.source,[E]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:n(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[y]),lookbehind:!0,inside:O},{pattern:n(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[m,k]),lookbehind:!0,inside:O},{pattern:n(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:n(/(\b<<0>>\s+)<<1>>/.source,[c,g]),lookbehind:!0,inside:O},{pattern:n(/(\bcatch\s*\(\s*)<<0>>/.source,[y]),lookbehind:!0,inside:O},{pattern:n(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:n(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[b]),lookbehind:!0,inside:O},{pattern:n(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[k,d,m]),inside:O}],keyword:u,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),e.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:n(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),e.languages.insertBefore("csharp","class-name",{namespace:{pattern:n(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:n(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[h]),lookbehind:!0,alias:"class-name",inside:O},"return-type":{pattern:n(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[k,y]),inside:O,alias:"class-name"},"constructor-invocation":{pattern:n(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[k]),lookbehind:!0,inside:O,alias:"class-name"},"generic-method":{pattern:n(/<<0>>\s*<<1>>(?=\s*\()/.source,[m,f]),inside:{function:n(/^<<0>>/.source,[m]),generic:{pattern:RegExp(f),alias:"class-name",inside:O}}},"type-list":{pattern:n(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[c,g,m,k,u.source,h,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:n(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[g,h]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:u,"class-name":{pattern:RegExp(k),greedy:!0,inside:O},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var A=E+"|"+S,j=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[A]),T=r(t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[j]),2),P=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,I=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[y,T]);e.languages.insertBefore("csharp","class-name",{attribute:{pattern:n(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[P,I]),lookbehind:!0,greedy:!0,inside:{target:{pattern:n(/^<<0>>(?=\s*:)/.source,[P]),alias:"keyword"},"attribute-arguments":{pattern:n(/\(<<0>>*\)/.source,[T]),inside:e.languages.csharp},"class-name":{pattern:RegExp(y),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var C=/:[^}\r\n]+/.source,R=r(t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[j]),2),N=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[R,C]),L=r(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[A]),2),$=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[L,C]);function M(t,r){return{interpolation:{pattern:n(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[t]),lookbehind:!0,inside:{"format-string":{pattern:n(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[r,C]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:n(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[N]),lookbehind:!0,greedy:!0,inside:M(N,R)},{pattern:n(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[$]),lookbehind:!0,greedy:!0,inside:M($,L)}],char:{pattern:RegExp(S),greedy:!0}}),e.languages.dotnet=e.languages.cs=e.languages.csharp}(Prism)},7899:()=>{Prism.languages.csv={value:/[^\r\n,"]+|"(?:[^"]|"")*"(?!")/,punctuation:/,/}},7046:()=>{Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Prism.languages.go["class-name"]},57:()=>{!function(e){function t(e){return RegExp("(^(?:"+e+"):[ \t]*(?![ \t]))[^]+","i")}e.languages.http={"request-line":{pattern:/^(?:CONNECT|DELETE|GET|HEAD|OPTIONS|PATCH|POST|PRI|PUT|SEARCH|TRACE)\s(?:https?:\/\/|\/)\S*\sHTTP\/[\d.]+/m,inside:{method:{pattern:/^[A-Z]+\b/,alias:"property"},"request-target":{pattern:/^(\s)(?:https?:\/\/|\/)\S*(?=\s)/,lookbehind:!0,alias:"url",inside:e.languages.uri},"http-version":{pattern:/^(\s)HTTP\/[\d.]+/,lookbehind:!0,alias:"property"}}},"response-status":{pattern:/^HTTP\/[\d.]+ \d+ .+/m,inside:{"http-version":{pattern:/^HTTP\/[\d.]+/,alias:"property"},"status-code":{pattern:/^(\s)\d+(?=\s)/,lookbehind:!0,alias:"number"},"reason-phrase":{pattern:/^(\s).+/,lookbehind:!0,alias:"string"}}},header:{pattern:/^[\w-]+:.+(?:(?:\r\n?|\n)[ \t].+)*/m,inside:{"header-value":[{pattern:t(/Content-Security-Policy/.source),lookbehind:!0,alias:["csp","languages-csp"],inside:e.languages.csp},{pattern:t(/Public-Key-Pins(?:-Report-Only)?/.source),lookbehind:!0,alias:["hpkp","languages-hpkp"],inside:e.languages.hpkp},{pattern:t(/Strict-Transport-Security/.source),lookbehind:!0,alias:["hsts","languages-hsts"],inside:e.languages.hsts},{pattern:t(/[^:]+/.source),lookbehind:!0}],"header-name":{pattern:/^[^:]+/,alias:"keyword"},punctuation:/^:/}}};var n,r=e.languages,i={"application/javascript":r.javascript,"application/json":r.json||r.javascript,"application/xml":r.xml,"text/xml":r.xml,"text/html":r.html,"text/css":r.css,"text/plain":r.plain},o={"application/json":!0,"application/xml":!0};function s(e){var t=e.replace(/^[a-z]+\//,"");return"(?:"+e+"|"+("\\w+/(?:[\\w.-]+\\+)+"+t+"(?![+\\w.-])")+")"}for(var a in i)if(i[a]){n=n||{};var l=o[a]?s(a):a;n[a.replace(/\//g,"-")]={pattern:RegExp("("+/content-type:\s*/.source+l+/(?:(?:\r\n?|\n)[\w-].*)*(?:\r(?:\n|(?!\n))|\n)/.source+")"+/[^ \t\w-][\s\S]*/.source,"i"),lookbehind:!0,inside:i[a]}}n&&e.languages.insertBefore("http","header",n)}(Prism)},2503:()=>{!function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism)},6841:()=>{Prism.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}},6854:()=>{!function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,i,o){if(n.language===r){var s=n.tokenStack=[];n.code=n.code.replace(i,(function(e){if("function"==typeof o&&!o(e))return e;for(var i,a=s.length;-1!==n.code.indexOf(i=t(r,a));)++a;return s[a]=e,i})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var i=0,o=Object.keys(n.tokenStack);!function s(a){for(var l=0;l<a.length&&!(i>=o.length);l++){var c=a[l];if("string"==typeof c||c.content&&"string"==typeof c.content){var u=o[i],p=n.tokenStack[u],d="string"==typeof c?c:c.content,f=t(r,u),h=d.indexOf(f);if(h>-1){++i;var m=d.substring(0,h),g=new e.Token(r,e.tokenize(p,n.grammar),"language-"+r,p),y=d.substring(h+f.length),v=[];m&&v.push.apply(v,s([m])),v.push(g),y&&v.push.apply(v,s([y])),"string"==typeof c?a.splice.apply(a,[l,1].concat(v)):c.content=v}}else c.content&&s(c.content)}return a}(n.tokens)}}}})}(Prism)},4335:()=>{Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml},1426:()=>{Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec},288:()=>{!function(e){var t=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;e.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,t+/\s*/.source+t].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}}(Prism)},9945:()=>{!function(e){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,n=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],r=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,i=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,o=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:r,operator:i,punctuation:o};var s={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},a=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:s}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:s}}];e.languages.insertBefore("php","variable",{string:a,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:a,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,number:r,operator:i,punctuation:o}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),e.hooks.add("before-tokenize",(function(t){if(/<\?/.test(t.code)){e.languages["markup-templating"].buildPlaceholders(t,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g)}})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"php")}))}(Prism)},366:()=>{Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python},2939:()=>{Prism.languages.q={string:/"(?:\\.|[^"\\\r\n])*"/,comment:[{pattern:/([\t )\]}])\/.*/,lookbehind:!0,greedy:!0},{pattern:/(^|\r?\n|\r)\/[\t ]*(?:(?:\r?\n|\r)(?:.*(?:\r?\n|\r(?!\n)))*?(?:\\(?=[\t ]*(?:\r?\n|\r))|$)|\S.*)/,lookbehind:!0,greedy:!0},{pattern:/^\\[\t ]*(?:\r?\n|\r)[\s\S]+/m,greedy:!0},{pattern:/^#!.+/m,greedy:!0}],symbol:/`(?::\S+|[\w.]*)/,datetime:{pattern:/0N[mdzuvt]|0W[dtz]|\d{4}\.\d\d(?:m|\.\d\d(?:T(?:\d\d(?::\d\d(?::\d\d(?:[.:]\d\d\d)?)?)?)?)?[dz]?)|\d\d:\d\d(?::\d\d(?:[.:]\d\d\d)?)?[uvt]?/,alias:"number"},number:/\b(?![01]:)(?:0N[hje]?|0W[hj]?|0[wn]|0x[\da-fA-F]+|\d+(?:\.\d*)?(?:e[+-]?\d+)?[hjfeb]?)/,keyword:/\\\w+\b|\b(?:abs|acos|aj0?|all|and|any|asc|asin|asof|atan|attr|avgs?|binr?|by|ceiling|cols|cor|cos|count|cov|cross|csv|cut|delete|deltas|desc|dev|differ|distinct|div|do|dsave|ej|enlist|eval|except|exec|exit|exp|fby|fills|first|fkeys|flip|floor|from|get|getenv|group|gtime|hclose|hcount|hdel|hopen|hsym|iasc|identity|idesc|if|ij|in|insert|inter|inv|keys?|last|like|list|ljf?|load|log|lower|lsq|ltime|ltrim|mavg|maxs?|mcount|md5|mdev|med|meta|mins?|mmax|mmin|mmu|mod|msum|neg|next|not|null|or|over|parse|peach|pj|plist|prds?|prev|prior|rand|rank|ratios|raze|read0|read1|reciprocal|reval|reverse|rload|rotate|rsave|rtrim|save|scan|scov|sdev|select|set|setenv|show|signum|sin|sqrt|ssr?|string|sublist|sums?|sv|svar|system|tables|tan|til|trim|txf|type|uj|ungroup|union|update|upper|upsert|value|var|views?|vs|wavg|where|while|within|wj1?|wsum|ww|xasc|xbar|xcols?|xdesc|xexp|xgroup|xkey|xlog|xprev|xrank)\b/,adverb:{pattern:/['\/\\]:?|\beach\b/,alias:"function"},verb:{pattern:/(?:\B\.\B|\b[01]:|<[=>]?|>=?|[:+\-*%,!?~=|$&#@^]):?|\b_\b:?/,alias:"operator"},punctuation:/[(){}\[\];.]/}},9385:()=>{!function(e){e.languages.ruby=e.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),e.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete e.languages.ruby.function;var n="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",r=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;e.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+n+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+r),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+r+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),e.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+n),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+n),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete e.languages.ruby.string,e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),e.languages.rb=e.languages.ruby}(Prism)},2886:()=>{Prism.languages.scala=Prism.languages.extend("java",{"triple-quoted-string":{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string"},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:/<-|=>|\b(?:abstract|case|catch|class|def|derives|do|else|enum|extends|extension|final|finally|for|forSome|given|if|implicit|import|infix|inline|lazy|match|new|null|object|opaque|open|override|package|private|protected|return|sealed|self|super|this|throw|trait|transparent|try|type|using|val|var|while|with|yield)\b/,number:/\b0x(?:[\da-f]*\.)?[\da-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e\d+)?[dfl]?/i,builtin:/\b(?:Any|AnyRef|AnyVal|Boolean|Byte|Char|Double|Float|Int|Long|Nothing|Short|String|Unit)\b/,symbol:/'[^\d\s\\]\w*/}),Prism.languages.insertBefore("scala","triple-quoted-string",{"string-interpolation":{pattern:/\b[a-z]\w*(?:"""(?:[^$]|\$(?:[^{]|\{(?:[^{}]|\{[^{}]*\})*\}))*?"""|"(?:[^$"\r\n]|\$(?:[^{]|\{(?:[^{}]|\{[^{}]*\})*\}))*")/i,greedy:!0,inside:{id:{pattern:/^\w+/,greedy:!0,alias:"function"},escape:{pattern:/\\\$"|\$[$"]/,greedy:!0,alias:"symbol"},interpolation:{pattern:/\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,greedy:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:Prism.languages.scala}}},string:/[\s\S]+/}}}),delete Prism.languages.scala["class-name"],delete Prism.languages.scala.function,delete Prism.languages.scala.constant},5266:()=>{Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}},874:()=>{Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach((function(e){e.inside.interpolation.inside=Prism.languages.swift}))},3358:()=>{!function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+n.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,(function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source})),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function s(e,t){t=(t||"").replace(/m/g,"")+"m";var n=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,(function(){return r})).replace(/<<value>>/g,(function(){return e}));return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,(function(){return r}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,(function(){return r})).replace(/<<key>>/g,(function(){return"(?:"+i+"|"+o+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:s(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:s(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:s(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:s(o),lookbehind:!0,greedy:!0},number:{pattern:s(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(Prism)},5660:(e,t,n)=>{var r=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof o?new o(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){var r,o;switch(n=n||{},i.util.type(t)){case"Object":if(o=i.util.objId(t),n[o])return n[o];for(var s in r={},n[o]=r,t)t.hasOwnProperty(s)&&(r[s]=e(t[s],n));return r;case"Array":return o=i.util.objId(t),n[o]?n[o]:(r=[],n[o]=r,t.forEach((function(t,i){r[i]=e(t,n)})),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,"gi"),""),e.classList.add("language-"+n)},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName("script");for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r="no-"+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=i.util.clone(i.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var o=(r=r||i.languages)[e],s={};for(var a in o)if(o.hasOwnProperty(a)){if(a==t)for(var l in n)n.hasOwnProperty(l)&&(s[l]=n[l]);n.hasOwnProperty(a)||(s[a]=o[a])}var c=r[e];return r[e]=s,i.languages.DFS(i.languages,(function(t,n){n===c&&t!=e&&(this[t]=s)})),s},DFS:function e(t,n,r,o){o=o||{};var s=i.util.objId;for(var a in t)if(t.hasOwnProperty(a)){n.call(t,a,t[a],r||a);var l=t[a],c=i.util.type(l);"Object"!==c||o[s(l)]?"Array"!==c||o[s(l)]||(o[s(l)]=!0,e(l,n,a,o)):(o[s(l)]=!0,e(l,n,null,o))}}},plugins:{},highlightAll:function(e,t){i.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};i.hooks.run("before-highlightall",r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),i.hooks.run("before-all-elements-highlight",r);for(var o,s=0;o=r.elements[s++];)i.highlightElement(o,!0===t,r.callback)},highlightElement:function(t,n,r){var o=i.util.getLanguage(t),s=i.languages[o];i.util.setLanguage(t,o);var a=t.parentElement;a&&"pre"===a.nodeName.toLowerCase()&&i.util.setLanguage(a,o);var l={element:t,language:o,grammar:s,code:t.textContent};function c(e){l.highlightedCode=e,i.hooks.run("before-insert",l),l.element.innerHTML=l.highlightedCode,i.hooks.run("after-highlight",l),i.hooks.run("complete",l),r&&r.call(l.element)}if(i.hooks.run("before-sanity-check",l),(a=l.element.parentElement)&&"pre"===a.nodeName.toLowerCase()&&!a.hasAttribute("tabindex")&&a.setAttribute("tabindex","0"),!l.code)return i.hooks.run("complete",l),void(r&&r.call(l.element));if(i.hooks.run("before-highlight",l),l.grammar)if(n&&e.Worker){var u=new Worker(i.filename);u.onmessage=function(e){c(e.data)},u.postMessage(JSON.stringify({language:l.language,code:l.code,immediateClose:!0}))}else c(i.highlight(l.code,l.grammar,l.language));else c(i.util.encode(l.code))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(i.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=i.tokenize(r.code,r.grammar),i.hooks.run("after-tokenize",r),o.stringify(i.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new l;return c(i,i.head,e),a(e,i,t,i.head,0),function(e){var t=[],n=e.head.next;for(;n!==e.tail;)t.push(n.value),n=n.next;return t}(i)},hooks:{all:{},add:function(e,t){var n=i.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=i.hooks.all[e];if(n&&n.length)for(var r,o=0;r=n[o++];)r(t)}},Token:o};function o(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function s(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var o=i[1].length;i.index+=o,i[0]=i[0].slice(o)}return i}function a(e,t,n,r,l,p){for(var d in n)if(n.hasOwnProperty(d)&&n[d]){var f=n[d];f=Array.isArray(f)?f:[f];for(var h=0;h<f.length;++h){if(p&&p.cause==d+","+h)return;var m=f[h],g=m.inside,y=!!m.lookbehind,v=!!m.greedy,b=m.alias;if(v&&!m.pattern.global){var x=m.pattern.toString().match(/[imsuy]*$/)[0];m.pattern=RegExp(m.pattern.source,x+"g")}for(var w=m.pattern||m,k=r.next,O=l;k!==t.tail&&!(p&&O>=p.reach);O+=k.value.length,k=k.next){var S=k.value;if(t.length>e.length)return;if(!(S instanceof o)){var E,_=1;if(v){if(!(E=s(w,O,e,y))||E.index>=e.length)break;var A=E.index,j=E.index+E[0].length,T=O;for(T+=k.value.length;A>=T;)T+=(k=k.next).value.length;if(O=T-=k.value.length,k.value instanceof o)continue;for(var P=k;P!==t.tail&&(T<j||"string"==typeof P.value);P=P.next)_++,T+=P.value.length;_--,S=e.slice(O,T),E.index-=O}else if(!(E=s(w,0,S,y)))continue;A=E.index;var I=E[0],C=S.slice(0,A),R=S.slice(A+I.length),N=O+S.length;p&&N>p.reach&&(p.reach=N);var L=k.prev;if(C&&(L=c(t,L,C),O+=C.length),u(t,L,_),k=c(t,L,new o(d,g?i.tokenize(I,g):I,b,I)),R&&c(t,k,R),_>1){var $={cause:d+","+h,reach:N};a(e,t,n,k.prev,O,$),p&&$.reach>p.reach&&(p.reach=$.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function u(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}if(e.Prism=i,o.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var r="";return t.forEach((function(t){r+=e(t,n)})),r}var o={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},s=t.alias;s&&(Array.isArray(s)?Array.prototype.push.apply(o.classes,s):o.classes.push(s)),i.hooks.run("wrap",o);var a="";for(var l in o.attributes)a+=" "+l+'="'+(o.attributes[l]||"").replace(/"/g,""")+'"';return"<"+o.tag+' class="'+o.classes.join(" ")+'"'+a+">"+o.content+"</"+o.tag+">"},!e.document)return e.addEventListener?(i.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,o=n.code,s=n.immediateClose;e.postMessage(i.highlight(o,i.languages[r],r)),s&&e.close()}),!1),i):i;var p=i.util.currentScript();function d(){i.manual||i.highlightAll()}if(p&&(i.filename=p.src,p.hasAttribute("data-manual")&&(i.manual=!0)),!i.manual){var f=document.readyState;"loading"===f||"interactive"===f&&p&&p.defer?document.addEventListener("DOMContentLoaded",d):window.requestAnimationFrame?window.requestAnimationFrame(d):window.setTimeout(d,16)}return i}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=r),void 0!==n.g&&(n.g.Prism=r),r.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},r.languages.markup.tag.inside["attr-value"].inside.entity=r.languages.markup.entity,r.languages.markup.doctype.inside["internal-subset"].inside=r.languages.markup,r.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(r.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:r.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};i["language-"+t]={pattern:/[\s\S]+/,inside:r.languages[t]};var o={};o[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:i},r.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(r.languages.markup.tag,"addAttribute",{value:function(e,t){r.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:r.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),r.languages.html=r.languages.markup,r.languages.mathml=r.languages.markup,r.languages.svg=r.languages.markup,r.languages.xml=r.languages.extend("markup",{}),r.languages.ssml=r.languages.xml,r.languages.atom=r.languages.xml,r.languages.rss=r.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(r),r.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},r.languages.javascript=r.languages.extend("clike",{"class-name":[r.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),r.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,r.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:r.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:r.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:r.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:r.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:r.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),r.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:r.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),r.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),r.languages.markup&&(r.languages.markup.tag.addInlined("script","javascript"),r.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),r.languages.js=r.languages.javascript,function(){if(void 0!==r&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},t="data-src-status",n="loading",i="loaded",o="pre[data-src]:not(["+t+'="'+i+'"]):not(['+t+'="'+n+'"])';r.hooks.add("before-highlightall",(function(e){e.selector+=", "+o})),r.hooks.add("before-sanity-check",(function(s){var a=s.element;if(a.matches(o)){s.code="",a.setAttribute(t,n);var l=a.appendChild(document.createElement("CODE"));l.textContent="Loading\u2026";var c=a.getAttribute("data-src"),u=s.language;if("none"===u){var p=(/\.(\w+)$/.exec(c)||[,"none"])[1];u=e[p]||p}r.util.setLanguage(l,u),r.util.setLanguage(a,u);var d=r.plugins.autoloader;d&&d.loadLanguages(u),function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.onreadystatechange=function(){4==r.readyState&&(r.status<400&&r.responseText?t(r.responseText):r.status>=400?n("\u2716 Error "+r.status+" while fetching file: "+r.statusText):n("\u2716 Error: File does not exist or is empty"))},r.send(null)}(c,(function(e){a.setAttribute(t,i);var n=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var n=Number(t[1]),r=t[2],i=t[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}(a.getAttribute("data-range"));if(n){var o=e.split(/\r\n?|\n/g),s=n[0],c=null==n[1]?o.length:n[1];s<0&&(s+=o.length),s=Math.max(0,Math.min(s-1,o.length)),c<0&&(c+=o.length),c=Math.max(0,Math.min(c,o.length)),e=o.slice(s,c).join("\n"),a.hasAttribute("data-start")||a.setAttribute("data-start",String(s+1))}l.textContent=e,r.highlightElement(l)}),(function(e){a.setAttribute(t,"failed"),l.textContent=e}))}})),r.plugins.fileHighlight={highlight:function(e){for(var t,n=(e||document).querySelectorAll(o),i=0;t=n[i++];)r.highlightElement(t)}};var s=!1;r.fileHighlight=function(){s||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),s=!0),r.plugins.fileHighlight.highlight.apply(this,arguments)}}}()},8369:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Tab:()=>$,TabList:()=>P,TabPanel:()=>U,Tabs:()=>_,resetIdCounter:()=>h});var r=n(7294);function i(e){return function(t){return!!t.type&&t.type.tabsRole===e}}var o=i("Tab"),s=i("TabList"),a=i("TabPanel");function l(){return l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(this,arguments)}function c(e,t){return r.Children.map(e,(function(e){return null===e?null:function(e){return o(e)||s(e)||a(e)}(e)?t(e):e.props&&e.props.children&&"object"==typeof e.props.children?(0,r.cloneElement)(e,l({},e.props,{children:c(e.props.children,t)})):e}))}function u(e,t){return r.Children.forEach(e,(function(e){null!==e&&(o(e)||a(e)?t(e):e.props&&e.props.children&&"object"==typeof e.props.children&&(s(e)&&t(e),u(e.props.children,t)))}))}var p=n(6010),d=0;function f(){return"react-tabs-"+d++}function h(){d=0}function m(e){var t=0;return u(e,(function(e){o(e)&&t++})),t}var g,y=["children","className","disabledTabClassName","domRef","focus","forceRenderTabPanel","onSelect","selectedIndex","selectedTabClassName","selectedTabPanelClassName","environment","disableUpDownKeys"];function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v.apply(this,arguments)}function b(e){return e&&"getAttribute"in e}function x(e){return b(e)&&e.getAttribute("data-rttab")}function w(e){return b(e)&&"true"===e.getAttribute("aria-disabled")}var k=function(e){var t=(0,r.useRef)([]),n=(0,r.useRef)([]),i=(0,r.useRef)([]),l=(0,r.useRef)();function u(t,n){t<0||t>=b()||(0,e.onSelect)(t,e.selectedIndex,n)}function d(e){for(var t=b(),n=e+1;n<t;n++)if(!w(k(n)))return n;for(var r=0;r<e;r++)if(!w(k(r)))return r;return e}function h(e){for(var t=e;t--;)if(!w(k(t)))return t;for(t=b();t-- >e;)if(!w(k(t)))return t;return e}function b(){return m(e.children)}function k(e){return t.current["tabs-"+e]}function O(e){var t=e.target;do{if(S(t)){if(w(t))return;return void u([].slice.call(t.parentNode.children).filter(x).indexOf(t),e)}}while(null!=(t=t.parentNode))}function S(e){if(!x(e))return!1;var t=e.parentElement;do{if(t===l.current)return!0;if(t.getAttribute("data-rttabs"))break;t=t.parentElement}while(t);return!1}e.children;var E=e.className,_=(e.disabledTabClassName,e.domRef),A=(e.focus,e.forceRenderTabPanel,e.onSelect,e.selectedIndex,e.selectedTabClassName,e.selectedTabPanelClassName,e.environment,e.disableUpDownKeys,function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,y));return r.createElement("div",v({},A,{className:(0,p.Z)(E),onClick:O,onKeyDown:function(t){var n=e.direction,r=e.disableUpDownKeys;if(S(t.target)){var i=e.selectedIndex,o=!1,s=!1;"Space"!==t.code&&32!==t.keyCode&&"Enter"!==t.code&&13!==t.keyCode||(o=!0,s=!1,O(t)),"ArrowLeft"!==t.code&&37!==t.keyCode&&(r||38!==t.keyCode&&"ArrowUp"!==t.code)?"ArrowRight"!==t.code&&39!==t.keyCode&&(r||40!==t.keyCode&&"ArrowDown"!==t.code)?35===t.keyCode||"End"===t.code?(i=function(){for(var e=b();e--;)if(!w(k(e)))return e;return null}(),o=!0,s=!0):36!==t.keyCode&&"Home"!==t.code||(i=function(){for(var e=b(),t=0;t<e;t++)if(!w(k(t)))return t;return null}(),o=!0,s=!0):(i="rtl"===n?h(i):d(i),o=!0,s=!0):(i="rtl"===n?d(i):h(i),o=!0,s=!0),o&&t.preventDefault(),s&&u(i,t)}},ref:function(e){l.current=e,_&&_(e)},"data-rttabs":!0}),function(){var l=0,u=e.children,p=e.disabledTabClassName,d=e.focus,h=e.forceRenderTabPanel,m=e.selectedIndex,y=e.selectedTabClassName,v=e.selectedTabPanelClassName,x=e.environment;n.current=n.current||[],i.current=i.current||[];for(var w=n.current.length-b();w++<0;)n.current.push(f()),i.current.push(f());return c(u,(function(e){var u=e;if(s(e)){var f=0,b=!1;null==g&&function(e){var t=e||("undefined"!=typeof window?window:void 0);try{g=!(void 0===t||!t.document||!t.document.activeElement)}catch(n){g=!1}}(x);var w=x||("undefined"!=typeof window?window:void 0);g&&w&&(b=r.Children.toArray(e.props.children).filter(o).some((function(e,t){return w.document.activeElement===k(t)}))),u=(0,r.cloneElement)(e,{children:c(e.props.children,(function(e){var o="tabs-"+f,s=m===f,a={tabRef:function(e){t.current[o]=e},id:n.current[f],panelId:i.current[f],selected:s,focus:s&&(d||b)};return y&&(a.selectedClassName=y),p&&(a.disabledClassName=p),f++,(0,r.cloneElement)(e,a)}))})}else if(a(e)){var O={id:i.current[l],tabId:n.current[l],selected:m===l};h&&(O.forceRender=h),v&&(O.selectedClassName=v),l++,u=(0,r.cloneElement)(e,O)}return u}))}())};k.defaultProps={className:"react-tabs",focus:!1},k.propTypes={};const O=k;function S(){return S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S.apply(this,arguments)}var E=function(e){var t=e.children,n=e.defaultFocus,i=e.defaultIndex,o=e.focusTabOnClick,s=e.onSelect,a=(0,r.useState)(n),l=a[0],c=a[1],u=(0,r.useState)(function(e){return null===e.selectedIndex?1:0}(e)),p=u[0],d=(0,r.useState)(1===p?i||0:null),f=d[0],h=d[1];if((0,r.useEffect)((function(){c(!1)}),[]),1===p){var g=m(t);(0,r.useEffect)((function(){if(null!=f){var e=Math.max(0,g-1);h(Math.min(f,e))}}),[g])}var y=S({},e);return y.focus=l,y.onSelect=function(e,t,n){"function"==typeof s&&!1===s(e,t,n)||(o&&c(!0),1===p&&h(e))},null!=f&&(y.selectedIndex=f),delete y.defaultFocus,delete y.defaultIndex,delete y.focusTabOnClick,r.createElement(O,y,t)};E.propTypes={},E.defaultProps={defaultFocus:!1,focusTabOnClick:!0,forceRenderTabPanel:!1,selectedIndex:null,defaultIndex:null,environment:null,disableUpDownKeys:!1},E.tabsRole="Tabs";const _=E;var A=["children","className"];function j(){return j=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},j.apply(this,arguments)}var T=function(e){var t=e.children,n=e.className,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,A);return r.createElement("ul",j({},i,{className:(0,p.Z)(n),role:"tablist"}),t)};T.tabsRole="TabList",T.propTypes={},T.defaultProps={className:"react-tabs__tab-list"};const P=T;var I=["children","className","disabled","disabledClassName","focus","id","panelId","selected","selectedClassName","tabIndex","tabRef"];function C(){return C=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},C.apply(this,arguments)}var R="react-tabs__tab",N={className:R,disabledClassName:R+"--disabled",focus:!1,id:null,panelId:null,selected:!1,selectedClassName:R+"--selected"},L=function(e){var t,n=(0,r.useRef)(),i=e.children,o=e.className,s=e.disabled,a=e.disabledClassName,l=e.focus,c=e.id,u=e.panelId,d=e.selected,f=e.selectedClassName,h=e.tabIndex,m=e.tabRef,g=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,I);return(0,r.useEffect)((function(){d&&l&&n.current.focus()}),[d,l]),r.createElement("li",C({},g,{className:(0,p.Z)(o,(t={},t[f]=d,t[a]=s,t)),ref:function(e){n.current=e,m&&m(e)},role:"tab",id:c,"aria-selected":d?"true":"false","aria-disabled":s?"true":"false","aria-controls":u,tabIndex:h||(d?"0":null),"data-rttab":!0}),i)};L.propTypes={},L.tabsRole="Tab",L.defaultProps=N;const $=L;var M=["children","className","forceRender","id","selected","selectedClassName","tabId"];function D(){return D=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},D.apply(this,arguments)}var F="react-tabs__tab-panel",B={className:F,forceRender:!1,selectedClassName:F+"--selected"},z=function(e){var t,n=e.children,i=e.className,o=e.forceRender,s=e.id,a=e.selected,l=e.selectedClassName,c=e.tabId,u=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,M);return r.createElement("div",D({},u,{className:(0,p.Z)(i,(t={},t[l]=a,t)),role:"tabpanel",id:s,"aria-labelledby":c}),o||a?n:null)};z.tabsRole="TabPanel",z.propTypes={},z.defaultProps=B;const U=z},2933:function(e,t,n){e.exports=function(){var e={260:function(e,t,n){"use strict";var r=n(15),i=n.n(r),o=n(645),s=n.n(o)()(i());s.push([e.id,".ps{overflow:hidden!important;overflow-anchor:none;-ms-overflow-style:none;touch-action:auto;-ms-touch-action:auto}.ps__rail-x{display:none;opacity:0;transition:background-color .2s linear,opacity .2s linear;-webkit-transition:background-color .2s linear,opacity .2s linear;height:15px;bottom:0;position:absolute}.ps__rail-y{display:none;opacity:0;transition:background-color .2s linear,opacity .2s linear;-webkit-transition:background-color .2s linear,opacity .2s linear;width:15px;right:0;position:absolute}.ps--active-x>.ps__rail-x,.ps--active-y>.ps__rail-y{display:block;background-color:transparent}.ps:hover>.ps__rail-x,.ps:hover>.ps__rail-y,.ps--focus>.ps__rail-x,.ps--focus>.ps__rail-y,.ps--scrolling-x>.ps__rail-x,.ps--scrolling-y>.ps__rail-y{opacity:.6}.ps .ps__rail-x:hover,.ps .ps__rail-y:hover,.ps .ps__rail-x:focus,.ps .ps__rail-y:focus,.ps .ps__rail-x.ps--clicking,.ps .ps__rail-y.ps--clicking{background-color:#eee;opacity:.9}.ps__thumb-x{background-color:#aaa;border-radius:6px;transition:background-color .2s linear,height .2s ease-in-out;-webkit-transition:background-color .2s linear,height .2s ease-in-out;height:6px;bottom:2px;position:absolute}.ps__thumb-y{background-color:#aaa;border-radius:6px;transition:background-color .2s linear,width .2s ease-in-out;-webkit-transition:background-color .2s linear,width .2s ease-in-out;width:6px;right:2px;position:absolute}.ps__rail-x:hover>.ps__thumb-x,.ps__rail-x:focus>.ps__thumb-x,.ps__rail-x.ps--clicking .ps__thumb-x{background-color:#999;height:11px}.ps__rail-y:hover>.ps__thumb-y,.ps__rail-y:focus>.ps__thumb-y,.ps__rail-y.ps--clicking .ps__thumb-y{background-color:#999;width:11px}@supports (-ms-overflow-style: none){.ps{overflow:auto!important}}@media screen and (-ms-high-contrast: active),(-ms-high-contrast: none){.ps{overflow:auto!important}}\n","",{version:3,sources:["webpack://./node_modules/perfect-scrollbar/css/perfect-scrollbar.css"],names:[],mappings:"AAGA,IACE,yBAAA,CACA,oBAAA,CACA,uBAAA,CACA,iBAAA,CACA,qBAAA,CAMF,YACE,YAAA,CACA,SAAA,CACA,yDAAA,CACA,iEAAA,CACA,WAAA,CAEA,QAAA,CAEA,iBAAA,CAGF,YACE,YAAA,CACA,SAAA,CACA,yDAAA,CACA,iEAAA,CACA,UAAA,CAEA,OAAA,CAEA,iBAAA,CAGF,oDAEE,aAAA,CACA,4BAAA,CAGF,oJAME,UAAA,CAGF,kJAME,qBAAA,CACA,UAAA,CAMF,aACE,qBAAA,CAnEF,iBAAA,CAqEE,6DAAA,CACA,qEAAA,CACA,UAAA,CAEA,UAAA,CAEA,iBAAA,CAGF,aACE,qBAAA,CA/EF,iBAAA,CAiFE,4DAAA,CACA,oEAAA,CACA,SAAA,CAEA,SAAA,CAEA,iBAAA,CAGF,oGAGE,qBAAA,CACA,WAAA,CAGF,oGAGE,qBAAA,CACA,UAAA,CAIF,qCACE,IACE,uBAAA,CAAA,CAIJ,wEACE,IACE,uBAAA,CAAA",sourcesContent:["/*\n * Container style\n */\n.ps {\n overflow: hidden !important;\n overflow-anchor: none;\n -ms-overflow-style: none;\n touch-action: auto;\n -ms-touch-action: auto;\n}\n\n/*\n * Scrollbar rail styles\n */\n.ps__rail-x {\n display: none;\n opacity: 0;\n transition: background-color .2s linear, opacity .2s linear;\n -webkit-transition: background-color .2s linear, opacity .2s linear;\n height: 15px;\n /* there must be 'bottom' or 'top' for ps__rail-x */\n bottom: 0px;\n /* please don't change 'position' */\n position: absolute;\n}\n\n.ps__rail-y {\n display: none;\n opacity: 0;\n transition: background-color .2s linear, opacity .2s linear;\n -webkit-transition: background-color .2s linear, opacity .2s linear;\n width: 15px;\n /* there must be 'right' or 'left' for ps__rail-y */\n right: 0;\n /* please don't change 'position' */\n position: absolute;\n}\n\n.ps--active-x > .ps__rail-x,\n.ps--active-y > .ps__rail-y {\n display: block;\n background-color: transparent;\n}\n\n.ps:hover > .ps__rail-x,\n.ps:hover > .ps__rail-y,\n.ps--focus > .ps__rail-x,\n.ps--focus > .ps__rail-y,\n.ps--scrolling-x > .ps__rail-x,\n.ps--scrolling-y > .ps__rail-y {\n opacity: 0.6;\n}\n\n.ps .ps__rail-x:hover,\n.ps .ps__rail-y:hover,\n.ps .ps__rail-x:focus,\n.ps .ps__rail-y:focus,\n.ps .ps__rail-x.ps--clicking,\n.ps .ps__rail-y.ps--clicking {\n background-color: #eee;\n opacity: 0.9;\n}\n\n/*\n * Scrollbar thumb styles\n */\n.ps__thumb-x {\n background-color: #aaa;\n border-radius: 6px;\n transition: background-color .2s linear, height .2s ease-in-out;\n -webkit-transition: background-color .2s linear, height .2s ease-in-out;\n height: 6px;\n /* there must be 'bottom' for ps__thumb-x */\n bottom: 2px;\n /* please don't change 'position' */\n position: absolute;\n}\n\n.ps__thumb-y {\n background-color: #aaa;\n border-radius: 6px;\n transition: background-color .2s linear, width .2s ease-in-out;\n -webkit-transition: background-color .2s linear, width .2s ease-in-out;\n width: 6px;\n /* there must be 'right' for ps__thumb-y */\n right: 2px;\n /* please don't change 'position' */\n position: absolute;\n}\n\n.ps__rail-x:hover > .ps__thumb-x,\n.ps__rail-x:focus > .ps__thumb-x,\n.ps__rail-x.ps--clicking .ps__thumb-x {\n background-color: #999;\n height: 11px;\n}\n\n.ps__rail-y:hover > .ps__thumb-y,\n.ps__rail-y:focus > .ps__thumb-y,\n.ps__rail-y.ps--clicking .ps__thumb-y {\n background-color: #999;\n width: 11px;\n}\n\n/* MS supports */\n@supports (-ms-overflow-style: none) {\n .ps {\n overflow: auto !important;\n }\n}\n\n@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n .ps {\n overflow: auto !important;\n }\n}\n"],sourceRoot:""}]),t.Z=s},645:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(r)for(var o=0;o<this.length;o++){var s=this[o][0];null!=s&&(i[s]=!0)}for(var a=0;a<e.length;a++){var l=[].concat(e[a]);r&&i[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),t.push(l))}},t}},15:function(e){"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}e.exports=function(e){var n,r,i=(r=4,function(e){if(Array.isArray(e))return e}(n=e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(e){a=!0,i=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}}(n,r)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=i[1],s=i[3];if("function"==typeof btoa){var a=btoa(unescape(encodeURIComponent(JSON.stringify(s)))),l="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(a),c="/*# ".concat(l," */"),u=s.sources.map((function(e){return"/*# sourceURL=".concat(s.sourceRoot||"").concat(e," */")}));return[o].concat(u).concat([c]).join("\n")}return[o].join("\n")}},825:function(e){e.exports={}},388:function(e,t,r){"use strict";r.d(t,{ZP:function(){return s}});var i=n(1336),o=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}));class s{constructor(){this.add=f,this.done=h,this.search=b,this.toJS=m,this.load=y,this.dispose=v,this.fromExternalJS=g}}let a,l,c,u=[];function p(){a=new i.Builder,a.field("title"),a.field("description"),a.ref("ref"),a.pipeline.add(i.trimmer,i.stopWordFilter,i.stemmer),c=new Promise((e=>{l=e}))}i.tokenizer.separator=/\s+/,p();const d=e=>{const t=i.trimmer(new i.Token(e,{}));return"*"+i.stemmer(t)+"*"};function f(e,t,n){const r=u.push(n)-1,i={title:e.toLowerCase(),description:t.toLowerCase(),ref:r};a.add(i)}function h(){return o(this,null,(function*(){l(a.build())}))}function m(){return o(this,null,(function*(){return{store:u,index:(yield c).toJSON()}}))}function g(e,t){return o(this,null,(function*(){try{if(importScripts(e),!self[t])throw new Error("Broken index file format");y(self[t])}catch(e){console.error("Failed to load search index: "+e.message)}}))}function y(e){return o(this,null,(function*(){u=e.store,l(i.Index.load(e.index))}))}function v(){return o(this,null,(function*(){u=[],p()}))}function b(e,t=0){return o(this,null,(function*(){if(0===e.trim().length)return[];let n=(yield c).query((t=>{e.trim().toLowerCase().split(/\s+/).forEach((e=>{if(1===e.length)return;const n=d(e);t.term(n,{})}))}));return t>0&&(n=n.slice(0,t)),n.map((e=>({meta:u[e.ref],score:e.score})))}))}},342:function(e,t,n){"use strict";const r=n(376),i={}.NODE_DISABLE_COLORS?{red:"",yellow:"",green:"",normal:""}:{red:"\x1b[31m",yellow:"\x1b[33;1m",green:"\x1b[32m",normal:"\x1b[0m"};function o(e,t){function n(e,t){return r.stringify(e)===r.stringify(Object.assign({},e,t))}return n(e,t)&&n(t,e)}function s(e){let t=(e=e.replace("[]","Array")).split("/");return t[0]=t[0].replace(/[^A-Za-z0-9_\-\.]+|\s+/gm,"_"),t.join("/")}String.prototype.toCamelCase=function(){return this.toLowerCase().replace(/[-_ \/\.](.)/g,(function(e,t){return t.toUpperCase()}))},e.exports={colour:i,uniqueOnly:function(e,t,n){return n.indexOf(e)===t},hasDuplicates:function(e){return new Set(e).size!==e.length},allSame:function(e){return new Set(e).size<=1},distinctArray:function(e){return e.length===function(e){let t=[];for(let n of e)t.find((function(e,t,r){return o(e,n)}))||t.push(n);return t}(e).length},firstDupe:function(e){return e.find((function(t,n,r){return e.indexOf(t)<n}))},hash:function(e){let t,n=0;if(0===e.length)return n;for(let r=0;r<e.length;r++)t=e.charCodeAt(r),n=(n<<5)-n+t,n|=0;return n},parameterTypeProperties:["format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","minLength","maxLength","multipleOf","minItems","maxItems","uniqueItems","minProperties","maxProperties","additionalProperties","pattern","enum","default"],arrayProperties:["items","minItems","maxItems","uniqueItems"],httpMethods:["get","post","put","delete","patch","head","options","trace"],sanitise:s,sanitiseAll:function(e){return s(e.split("/").join("_"))}}},856:function(e,t,n){"use strict";const r=n(825),i=n(470),o=n(416),s=n(416),a=n(66),l=n(53).jptr,c=n(401).recurse,u=n(683).clone,p=n(593).dereference,d=n(592).isRef,f=n(342);function h(e,t,n,r,i,s){let a=s.externalRefs[n+r].paths[0],p=o.parse(i),h={},m=1;for(;m;)m=0,c(e,{identityDetection:!0},(function(e,n,r){if(d(e,n))if(e[n].startsWith("#"))if(h[e[n]]||e.$fixed){if(!e.$fixed){let t=(a+"/"+h[e[n]]).split("/#/").join("/");r.parent[r.pkey]={$ref:t,"x-miro":e[n],$fixed:!0},s.verbose>1&&console.warn("Replacing with",t),m++}}else{let i=u(l(t,e[n]));if(s.verbose>1&&console.warn((!1===i?f.colour.red:f.colour.green)+"Fragment resolution",e[n],f.colour.normal),!1===i){if(r.parent[r.pkey]={},s.fatal){let t=new Error("Fragment $ref resolution failed "+e[n]);if(!s.promise)throw t;s.promise.reject(t)}}else m++,r.parent[r.pkey]=i,h[e[n]]=r.path.replace("/%24ref","")}else if(p.protocol){let t=o.resolve(i,e[n]).toString();s.verbose>1&&console.warn(f.colour.yellow+"Rewriting external url ref",e[n],"as",t,f.colour.normal),e["x-miro"]=e[n],s.externalRefs[e[n]]&&(s.externalRefs[t]||(s.externalRefs[t]=s.externalRefs[e[n]]),s.externalRefs[t].failed=s.externalRefs[e[n]].failed),e[n]=t}else if(!e["x-miro"]){let t=o.resolve(i,e[n]).toString(),r=!1;s.externalRefs[e[n]]&&(r=s.externalRefs[e[n]].failed),r||(s.verbose>1&&console.warn(f.colour.yellow+"Rewriting external ref",e[n],"as",t,f.colour.normal),e["x-miro"]=e[n],e[n]=t)}}));return c(e,{},(function(e,t,n){d(e,t)&&void 0!==e.$fixed&&delete e.$fixed})),s.verbose>1&&console.warn("Finished fragment resolution"),e}function m(e,t){if(!t.filters||!t.filters.length)return e;for(let n of t.filters)e=n(e,t);return e}function g(e,t,n,s){var c=o.parse(n.source),p=n.source.split("\\").join("/").split("/");p.pop()||p.pop();let d="",f=t.split("#");f.length>1&&(d="#"+f[1],t=f[0]),p=p.join("/");let g=(y=o.parse(t).protocol,v=c.protocol,y&&y.length>2?y:v&&v.length>2?v:"file:");var y,v;let b;if(b="file:"===g?i.resolve(p?p+"/":"",t):o.resolve(p?p+"/":"",t),n.cache[b]){n.verbose&&console.warn("CACHED",b,d);let e=u(n.cache[b]),r=n.externalRef=e;if(d&&(r=l(r,d),!1===r&&(r={},n.fatal))){let e=new Error("Cached $ref resolution failed "+b+d);if(!n.promise)throw e;n.promise.reject(e)}return r=h(r,e,t,d,b,n),r=m(r,n),s(u(r),b,n),Promise.resolve(r)}if(n.verbose&&console.warn("GET",b,d),n.handlers&&n.handlers[g])return n.handlers[g](p,t,d,n).then((function(e){return n.externalRef=e,e=m(e,n),n.cache[b]=e,s(e,b,n),e})).catch((function(e){throw n.verbose&&console.warn(e),e}));if(g&&g.startsWith("http")){const e=Object.assign({},n.fetchOptions,{agent:n.agent});return n.fetch(b,e).then((function(e){if(200!==e.status){if(n.ignoreIOErrors)return n.verbose&&console.warn("FAILED",t),n.externalRefs[t].failed=!0,'{"$ref":"'+t+'"}';throw new Error(`Received status code ${e.status}: ${b}`)}return e.text()})).then((function(e){try{let r=a.parse(e,{schema:"core",prettyErrors:!0});if(e=n.externalRef=r,n.cache[b]=u(e),d&&!1===(e=l(e,d))&&(e={},n.fatal)){let e=new Error("Remote $ref resolution failed "+b+d);if(!n.promise)throw e;n.promise.reject(e)}e=m(e=h(e,r,t,d,b,n),n)}catch(e){if(n.verbose&&console.warn(e),!n.promise||!n.fatal)throw e;n.promise.reject(e)}return s(e,b,n),e})).catch((function(e){if(n.verbose&&console.warn(e),n.cache[b]={},!n.promise||!n.fatal)throw e;n.promise.reject(e)}))}{const e='{"$ref":"'+t+'"}';return function(e,t,n,i,o){return new Promise((function(s,a){r.readFile(e,t,(function(e,t){e?n.ignoreIOErrors&&o?(n.verbose&&console.warn("FAILED",i),n.externalRefs[i].failed=!0,s(o)):a(e):s(t)}))}))}(b,n.encoding||"utf8",n,t,e).then((function(e){try{let r=a.parse(e,{schema:"core",prettyErrors:!0});if(e=n.externalRef=r,n.cache[b]=u(e),d&&!1===(e=l(e,d))&&(e={},n.fatal)){let e=new Error("File $ref resolution failed "+b+d);if(!n.promise)throw e;n.promise.reject(e)}e=m(e=h(e,r,t,d,b,n),n)}catch(e){if(n.verbose&&console.warn(e),!n.promise||!n.fatal)throw e;n.promise.reject(e)}return s(e,b,n),e})).catch((function(e){if(n.verbose&&console.warn(e),!n.promise||!n.fatal)throw e;n.promise.reject(e)}))}}function y(e){return new Promise((function(t,n){(function(e){return new Promise((function(t,n){function r(t,n,r){if(t[n]&&d(t[n],"$ref")){let o=t[n].$ref;if(!o.startsWith("#")){let s="";if(!i[o]){let t=Object.keys(i).find((function(e,t,n){return o.startsWith(e+"/")}));t&&(e.verbose&&console.warn("Found potential subschema at",t),s="/"+(o.split("#")[1]||"").replace(t.split("#")[1]||""),s=s.split("/undefined").join(""),o=t)}if(i[o]||(i[o]={resolved:!1,paths:[],extras:{},description:t[n].description}),i[o].resolved)if(i[o].failed);else if(e.rewriteRefs){let r=i[o].resolvedAt;e.verbose>1&&console.warn("Rewriting ref",o,r),t[n]["x-miro"]=o,t[n].$ref=r+s}else t[n]=u(i[o].data);else i[o].paths.push(r.path),i[o].extras[r.path]=s}}}let i=e.externalRefs;if(e.resolver.depth>0&&e.source===e.resolver.base)return t(i);c(e.openapi.definitions,{identityDetection:!0,path:"#/definitions"},r),c(e.openapi.components,{identityDetection:!0,path:"#/components"},r),c(e.openapi,{identityDetection:!0},r),t(i)}))})(e).then((function(t){for(let n in t)if(!t[n].resolved){let r=e.resolver.depth;r>0&&r++,e.resolver.actions[r].push((function(){return g(e.openapi,n,e,(function(e,r,i){if(!t[n].resolved){let o={};o.context=t[n],o.$ref=n,o.original=u(e),o.updated=e,o.source=r,i.externals.push(o),t[n].resolved=!0}let o=Object.assign({},i,{source:"",resolver:{actions:i.resolver.actions,depth:i.resolver.actions.length-1,base:i.resolver.base}});i.patch&&t[n].description&&!e.description&&"object"==typeof e&&(e.description=t[n].description),t[n].data=e;let s=(a=t[n].paths,[...new Set(a)]);var a;s=s.sort((function(e,t){const n=e.startsWith("#/components/")||e.startsWith("#/definitions/"),r=t.startsWith("#/components/")||t.startsWith("#/definitions/");return n&&!r?-1:r&&!n?1:0}));for(let c of s)if(t[n].resolvedAt&&c!==t[n].resolvedAt&&c.indexOf("x-ms-examples/")<0)i.verbose>1&&console.warn("Creating pointer to data at",c),l(i.openapi,c,{$ref:t[n].resolvedAt+t[n].extras[c],"x-miro":n+t[n].extras[c]});else{t[n].resolvedAt?i.verbose>1&&console.warn("Avoiding circular reference"):(t[n].resolvedAt=c,i.verbose>1&&console.warn("Creating initial clone of data at",c));let r=u(e);l(i.openapi,c,r)}0===i.resolver.actions[o.resolver.depth].length&&i.resolver.actions[o.resolver.depth].push((function(){return y(o)}))}))}))}})).catch((function(t){e.verbose&&console.warn(t),n(t)}));let r={options:e};r.actions=e.resolver.actions[e.resolver.depth],t(r)}))}function v(e,t,n){e.resolver.actions.push([]),y(e).then((function(r){var i;(i=r.actions,i.reduce(((e,t)=>e.then((e=>t().then(Array.prototype.concat.bind(e))))),Promise.resolve([]))).then((function(){if(e.resolver.depth>=e.resolver.actions.length)return console.warn("Ran off the end of resolver actions"),t(!0);e.resolver.depth++,e.resolver.actions[e.resolver.depth].length?setTimeout((function(){v(r.options,t,n)}),0):(e.verbose>1&&console.warn(f.colour.yellow+"Finished external resolution!",f.colour.normal),e.resolveInternal&&(e.verbose>1&&console.warn(f.colour.yellow+"Starting internal resolution!",f.colour.normal),e.openapi=p(e.openapi,e.original,{verbose:e.verbose-1}),e.verbose>1&&console.warn(f.colour.yellow+"Finished internal resolution!",f.colour.normal)),c(e.openapi,{},(function(t,n,r){d(t,n)&&(e.preserveMiro||delete t["x-miro"])})),t(e))})).catch((function(t){e.verbose&&console.warn(t),n(t)}))})).catch((function(t){e.verbose&&console.warn(t),n(t)}))}function b(e){if(e.cache||(e.cache={}),e.fetch||(e.fetch=s),e.source){let t=o.parse(e.source);(!t.protocol||t.protocol.length<=2)&&(e.source=i.resolve(e.source))}e.externals=[],e.externalRefs={},e.rewriteRefs=!0,e.resolver={},e.resolver.depth=0,e.resolver.base=e.source,e.resolver.actions=[[]]}e.exports={optionalResolve:function(e){return b(e),new Promise((function(t,n){e.resolve?v(e,t,n):t(e)}))},resolve:function(e,t,n){return n||(n={}),n.openapi=e,n.source=t,n.resolve=!0,b(n),new Promise((function(e,t){v(n,e,t)}))}}},804:function(e){"use strict";function t(){return{depth:0,seen:new WeakMap,top:!0,combine:!1,allowRefSiblings:!1}}e.exports={getDefaultState:t,walkSchema:function e(n,r,i,o){if(void 0===i.depth&&(i=t()),null==n)return n;if(void 0!==n.$ref){let e={$ref:n.$ref};return i.allowRefSiblings&&n.description&&(e.description=n.description),o(e,r,i),e}if(i.combine&&(n.allOf&&Array.isArray(n.allOf)&&1===n.allOf.length&&delete(n=Object.assign({},n.allOf[0],n)).allOf,n.anyOf&&Array.isArray(n.anyOf)&&1===n.anyOf.length&&delete(n=Object.assign({},n.anyOf[0],n)).anyOf,n.oneOf&&Array.isArray(n.oneOf)&&1===n.oneOf.length&&delete(n=Object.assign({},n.oneOf[0],n)).oneOf),o(n,r,i),i.seen.has(n))return n;if("object"==typeof n&&null!==n&&i.seen.set(n,!0),i.top=!1,i.depth++,void 0!==n.items&&(i.property="items",e(n.items,n,i,o)),n.additionalItems&&"object"==typeof n.additionalItems&&(i.property="additionalItems",e(n.additionalItems,n,i,o)),n.additionalProperties&&"object"==typeof n.additionalProperties&&(i.property="additionalProperties",e(n.additionalProperties,n,i,o)),n.properties)for(let t in n.properties){let r=n.properties[t];i.property="properties/"+t,e(r,n,i,o)}if(n.patternProperties)for(let t in n.patternProperties){let r=n.patternProperties[t];i.property="patternProperties/"+t,e(r,n,i,o)}if(n.allOf)for(let t in n.allOf){let r=n.allOf[t];i.property="allOf/"+t,e(r,n,i,o)}if(n.anyOf)for(let t in n.anyOf){let r=n.anyOf[t];i.property="anyOf/"+t,e(r,n,i,o)}if(n.oneOf)for(let t in n.oneOf){let r=n.oneOf[t];i.property="oneOf/"+t,e(r,n,i,o)}return n.not&&(i.property="not",e(n.not,n,i,o)),i.depth--,n}}},470:function(e){"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",i=0,o=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)n=e.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(o===a-1||1===s);else if(o!==a-1&&2===s){if(r.length<2||2!==i||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){var l=r.lastIndexOf("/");if(l!==r.length-1){-1===l?(r="",i=0):i=(r=r.slice(0,l)).length-1-r.lastIndexOf("/"),o=a,s=0;continue}}else if(2===r.length||1===r.length){r="",i=0,o=a,s=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(o+1,a):r=e.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===n&&-1!==s?++s:s=-1}return r}var r={resolve:function(){for(var e,r="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var s;o>=0?s=arguments[o]:(void 0===e&&(e=process.cwd()),s=e),t(s),0!==s.length&&(r=s+"/"+r,i=47===s.charCodeAt(0))}return r=n(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n<arguments.length;++n){var i=arguments[n];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var o=e.length,s=o-i,a=1;a<n.length&&47===n.charCodeAt(a);++a);for(var l=n.length-a,c=s<l?s:l,u=-1,p=0;p<=c;++p){if(p===c){if(l>c){if(47===n.charCodeAt(a+p))return n.slice(a+p+1);if(0===p)return n.slice(a+p)}else s>c&&(47===e.charCodeAt(i+p)?u=p:0===p&&(u=0));break}var d=e.charCodeAt(i+p);if(d!==n.charCodeAt(a+p))break;47===d&&(u=p)}var f="";for(p=i+u+1;p<=o;++p)p!==o&&47!==e.charCodeAt(p)||(0===f.length?f+="..":f+="/..");return f.length>0?f+n.slice(a+u):(a+=u,47===n.charCodeAt(a)&&++a,n.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,i=-1,o=!0,s=e.length-1;s>=1;--s)if(47===(n=e.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return-1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,i=0,o=-1,s=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var a=n.length-1,l=-1;for(r=e.length-1;r>=0;--r){var c=e.charCodeAt(r);if(47===c){if(!s){i=r+1;break}}else-1===l&&(s=!1,l=r+1),a>=0&&(c===n.charCodeAt(a)?-1==--a&&(o=r):(a=-1,o=l))}return i===o?o=l:-1===o&&(o=e.length),e.slice(i,o)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!s){i=r+1;break}}else-1===o&&(s=!1,o=r+1);return-1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,o=!0,s=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47!==l)-1===i&&(o=!1,i=a+1),46===l?-1===n?n=a:1!==s&&(s=1):-1!==n&&(s=-1);else if(!o){r=a+1;break}}return-1===n||-1===i||0===s||1===s&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,i=e.charCodeAt(0),o=47===i;o?(n.root="/",r=1):r=0;for(var s=-1,a=0,l=-1,c=!0,u=e.length-1,p=0;u>=r;--u)if(47!==(i=e.charCodeAt(u)))-1===l&&(c=!1,l=u+1),46===i?-1===s?s=u:1!==p&&(p=1):-1!==s&&(p=-1);else if(!c){a=u+1;break}return-1===s||-1===l||0===p||1===p&&s===l-1&&s===a+1?-1!==l&&(n.base=n.name=0===a&&o?e.slice(1,l):e.slice(a,l)):(0===a&&o?(n.name=e.slice(1,s),n.base=e.slice(1,l)):(n.name=e.slice(a,s),n.base=e.slice(a,l)),n.ext=e.slice(s,l)),a>0?n.dir=e.slice(0,a-1):o&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r},683:function(e){"use strict";e.exports={nop:function(e){return e},clone:function(e){return JSON.parse(JSON.stringify(e))},shallowClone:function(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},deepClone:function e(t){let n=Array.isArray(t)?[]:{};for(let r in t)(t.hasOwnProperty(r)||Array.isArray(t))&&(n[r]="object"==typeof t[r]?e(t[r]):t[r]);return n},fastClone:function(e){return Object.assign({},e)},circularClone:function e(t,n){if(n||(n=new WeakMap),Object(t)!==t||t instanceof Function)return t;if(n.has(t))return n.get(t);try{var r=new t.constructor}catch(e){r=Object.create(Object.getPrototypeOf(t))}return n.set(t,r),Object.assign(r,...Object.keys(t).map((r=>({[r]:e(t[r],n)}))))}}},593:function(e,t,n){"use strict";const r=n(401).recurse,i=n(683).shallowClone,o=n(53).jptr,s=n(592).isRef;e.exports={dereference:function e(t,n,a){a||(a={}),a.cache||(a.cache={}),a.state||(a.state={}),a.state.identityDetection=!0,a.depth=a.depth?a.depth+1:1;let l=a.depth>1?t:i(t),c={data:l},u=a.depth>1?n:i(n);a.master||(a.master=l);let p=function(e){return e&&e.verbose?{warn:function(){var e=Array.prototype.slice.call(arguments);console.warn.apply(console,e)}}:{warn:function(){}}}(a),d=1;for(;d>0;)d=0,r(c,a.state,(function(t,n,r){if(s(t,n)){let i=t[n];if(d++,a.cache[i]){let e=a.cache[i];if(e.resolved)p.warn("Patching %s for %s",i,e.path),r.parent[r.pkey]=e.data,a.$ref&&"object"==typeof r.parent[r.pkey]&&(r.parent[r.pkey][a.$ref]=i);else{if(i===e.path)throw new Error(`Tight circle at ${e.path}`);p.warn("Unresolved ref"),r.parent[r.pkey]=o(e.source,e.path),!1===r.parent[r.pkey]&&(r.parent[r.pkey]=o(e.source,e.key)),a.$ref&&"object"==typeof r.parent[r.pkey]&&(r.parent[a.$ref]=i)}}else{let t={};t.path=r.path.split("/$ref")[0],t.key=i,p.warn("Dereffing %s at %s",i,t.path),t.source=u,t.data=o(t.source,t.key),!1===t.data&&(t.data=o(a.master,t.key),t.source=a.master),!1===t.data&&p.warn("Missing $ref target",t.key),a.cache[i]=t,t.data=r.parent[r.pkey]=e(o(t.source,t.key),t.source,a),a.$ref&&"object"==typeof r.parent[r.pkey]&&(r.parent[r.pkey][a.$ref]=i),t.resolved=!0}}}));return c.data}}},592:function(e){"use strict";e.exports={isRef:function(e,t){return"$ref"===t&&!!e&&"string"==typeof e[t]}}},53:function(e){"use strict";function t(e){return e.replace(/\~1/g,"/").replace(/~0/g,"~")}e.exports={jptr:function(e,n,r){if(void 0===e)return!1;if(!n||"string"!=typeof n||"#"===n)return void 0!==r?r:e;if(n.indexOf("#")>=0){let e=n.split("#");if(e[0])return!1;n=e[1],n=decodeURIComponent(n.slice(1).split("+").join(" "))}n.startsWith("/")&&(n=n.slice(1));let i=n.split("/");for(let o=0;o<i.length;o++){i[o]=t(i[o]);let n=void 0!==r&&o==i.length-1,s=parseInt(i[o],10);if(!Array.isArray(e)||isNaN(s)||s.toString()!==i[o]?s=Array.isArray(e)&&"-"===i[o]?-2:-1:i[o]=o>0?i[o-1]:"",-1!=s||e&&e.hasOwnProperty(i[o]))if(s>=0)n&&(e[s]=r),e=e[s];else{if(-2===s)return n?(Array.isArray(e)&&e.push(r),r):void 0;n&&(e[i[o]]=r),e=e[i[o]]}else{if(void 0===r||"object"!=typeof e||Array.isArray(e))return!1;e[i[o]]=n?r:"0"===i[o+1]||"-"===i[o+1]?[]:{},e=e[i[o]]}}return e},jpescape:function(e){return e.replace(/\~/g,"~0").replace(/\//g,"~1")},jpunescape:t}},401:function(e,t,n){"use strict";const r=n(53).jpescape;e.exports={recurse:function e(t,n,i){if(n||(n={depth:0}),n.depth||(n=Object.assign({},{path:"#",depth:0,pkey:"",parent:{},payload:{},seen:new WeakMap,identity:!1,identityDetection:!1},n)),"object"!=typeof t)return;let o=n.path;for(let s in t){if(n.key=s,n.path=n.path+"/"+encodeURIComponent(r(s)),n.identityPath=n.seen.get(t[s]),n.identity=void 0!==n.identityPath,t.hasOwnProperty(s)&&i(t,s,n),"object"==typeof t[s]&&!n.identity){n.identityDetection&&!Array.isArray(t[s])&&null!==t[s]&&n.seen.set(t[s],n.path);let r={};r.parent=t,r.path=n.path,r.depth=n.depth?n.depth+1:1,r.pkey=s,r.payload=n.payload,r.seen=n.seen,r.identity=!1,r.identityDetection=n.identityDetection,e(t[s],r,i)}n.path=o}}}},232:function(e,t,n){"use strict";n.r(t);var r=n(379),i=n.n(r),o=n(795),s=n.n(o),a=n(569),l=n.n(a),c=n(565),u=n.n(c),p=n(216),d=n.n(p),f=n(589),h=n.n(f),m=n(260),g={};g.styleTagTransform=h(),g.setAttributes=u(),g.insert=l().bind(null,"head"),g.domAPI=s(),g.insertStyleElement=d(),i()(m.Z,g),t.default=m.Z&&m.Z.locals?m.Z.locals:void 0},379:function(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var o={},s=[],a=0;a<e.length;a++){var l=e[a],c=r.base?l[0]+r.base:l[0],u=o[c]||0,p="".concat(c," ").concat(u);o[c]=u+1;var d=n(p),f={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==d)t[d].references++,t[d].updater(f);else{var h=i(f,r);r.byIndex=a,t.splice(a,0,{identifier:p,updater:h,references:1})}s.push(p)}return s}function i(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var o=r(e=e||[],i=i||{});return function(e){e=e||[];for(var s=0;s<o.length;s++){var a=n(o[s]);t[a].references--}for(var l=r(e,i),c=0;c<o.length;c++){var u=n(o[c]);0===t[u].references&&(t[u].updater(),t.splice(u,1))}o=l}}},569:function(e){"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},216:function(e){"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},565:function(e,t,n){"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},795:function(e){"use strict";e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},589:function(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},925:function(e,t,n){"use strict";const r=n(825),i=n(416),o=(n(470),n(766)),s=n(416),a=n(66),l=n(53),c=l.jptr,u=n(592).isRef,p=n(683).clone,d=n(683).circularClone,f=n(401).recurse,h=n(856),m=n(804),g=n(342),y=n(711).statusCodes,v=n(109).i8,b="3.0.0";let x;class w extends Error{constructor(e){super(e),this.name="S2OError"}}function k(e,t){let n=new w(e);if(n.options=t,!t.promise)throw n;t.promise.reject(n)}function O(e,t,n){n.warnOnly?t[n.warnProperty||"x-s2o-warning"]=e:k(e,n)}function S(e,t){m.walkSchema(e,{},{},(function(e,n,r){!function(e,t){if(e["x-required"]&&Array.isArray(e["x-required"])&&(e.required||(e.required=[]),e.required=e.required.concat(e["x-required"]),delete e["x-required"]),e["x-anyOf"]&&(e.anyOf=e["x-anyOf"],delete e["x-anyOf"]),e["x-oneOf"]&&(e.oneOf=e["x-oneOf"],delete e["x-oneOf"]),e["x-not"]&&(e.not=e["x-not"],delete e["x-not"]),"boolean"==typeof e["x-nullable"]&&(e.nullable=e["x-nullable"],delete e["x-nullable"]),"object"==typeof e["x-discriminator"]&&"string"==typeof e["x-discriminator"].propertyName){e.discriminator=e["x-discriminator"],delete e["x-discriminator"];for(let t in e.discriminator.mapping){let n=e.discriminator.mapping[t];n.startsWith("#/definitions/")&&(e.discriminator.mapping[t]=n.replace("#/definitions/","#/components/schemas/"))}}}(e),function(e,t,n){if(e.nullable&&n.patches++,e.discriminator&&"string"==typeof e.discriminator&&(e.discriminator={propertyName:e.discriminator}),e.items&&Array.isArray(e.items)&&(0===e.items.length?e.items={}:1===e.items.length?e.items=e.items[0]:e.items={anyOf:e.items}),e.type&&Array.isArray(e.type))if(n.patch){if(n.patches++,0===e.type.length)delete e.type;else{e.oneOf||(e.oneOf=[]);for(let t of e.type){let n={};if("null"===t)e.nullable=!0;else{n.type=t;for(let t of g.arrayProperties)void 0!==e.prop&&(n[t]=e[t],delete e[t])}n.type&&e.oneOf.push(n)}delete e.type,0===e.oneOf.length?delete e.oneOf:e.oneOf.length<2&&(e.type=e.oneOf[0].type,Object.keys(e.oneOf[0]).length>1&&O("Lost properties from oneOf",e,n),delete e.oneOf)}e.type&&Array.isArray(e.type)&&1===e.type.length&&(e.type=e.type[0])}else k("(Patchable) schema type must not be an array",n);e.type&&"null"===e.type&&(delete e.type,e.nullable=!0),"array"!==e.type||e.items||(e.items={}),"file"===e.type&&(e.type="string",e.format="binary"),"boolean"==typeof e.required&&(e.required&&e.name&&(void 0===t.required&&(t.required=[]),Array.isArray(t.required)&&t.required.push(e.name)),delete e.required),e.xml&&"string"==typeof e.xml.namespace&&(e.xml.namespace||delete e.xml.namespace),void 0!==e.allowEmptyValue&&(n.patches++,delete e.allowEmptyValue)}(e,n,t)}))}function E(e,t,n){let r=n.payload.options;if(u(e,t)){if(e[t].startsWith("#/components/"));else if("#/consumes"===e[t])delete e[t],n.parent[n.pkey]=p(r.openapi.consumes);else if("#/produces"===e[t])delete e[t],n.parent[n.pkey]=p(r.openapi.produces);else if(e[t].startsWith("#/definitions/")){let n=e[t].replace("#/definitions/","").split("/");const i=l.jpunescape(n[0]);let o=x.schemas[decodeURIComponent(i)];o?n[0]=o:O("Could not resolve reference "+e[t],e,r),e[t]="#/components/schemas/"+n.join("/")}else if(e[t].startsWith("#/parameters/"))e[t]="#/components/parameters/"+g.sanitise(e[t].replace("#/parameters/",""));else if(e[t].startsWith("#/responses/"))e[t]="#/components/responses/"+g.sanitise(e[t].replace("#/responses/",""));else if(e[t].startsWith("#")){let n=p(l.jptr(r.openapi,e[t]));if(!1===n)O("direct $ref not found "+e[t],e,r);else if(r.refmap[e[t]])e[t]=r.refmap[e[t]];else{let o=e[t];o=o.replace("/properties/headers/",""),o=o.replace("/properties/responses/",""),o=o.replace("/properties/parameters/",""),o=o.replace("/properties/schemas/","");let s="schemas",a=o.lastIndexOf("/schema");if(s=o.indexOf("/headers/")>a?"headers":o.indexOf("/responses/")>a?"responses":o.indexOf("/example")>a?"examples":o.indexOf("/x-")>a?"extensions":o.indexOf("/parameters/")>a?"parameters":"schemas","schemas"===s&&S(n,r),"responses"!==s&&"extensions"!==s){let o=s.substr(0,s.length-1);"parameter"===o&&n.name&&n.name===g.sanitise(n.name)&&(o=encodeURIComponent(n.name));let a=1;for(e["x-miro"]&&(i=(i=e["x-miro"]).indexOf("#")>=0?i.split("#")[1].split("/").pop():i.split("/").pop().split(".")[0],o=encodeURIComponent(g.sanitise(i)),a="");l.jptr(r.openapi,"#/components/"+s+"/"+o+a);)a=""===a?2:++a;let c="#/components/"+s+"/"+o+a,u="";"examples"===s&&(n={value:n},u="/value"),l.jptr(r.openapi,c,n),r.refmap[e[t]]=c+u,e[t]=c+u}}}if(delete e["x-miro"],Object.keys(e).length>1){const i=e[t],o=n.path.indexOf("/schema")>=0;"preserve"===r.refSiblings||(o&&"allOf"===r.refSiblings?(delete e.$ref,n.parent[n.pkey]={allOf:[{$ref:i},e]}):n.parent[n.pkey]={$ref:i})}}var i;if("x-ms-odata"===t&&"string"==typeof e[t]&&e[t].startsWith("#/")){let n=e[t].replace("#/definitions/","").replace("#/components/schemas/","").split("/"),i=x.schemas[decodeURIComponent(n[0])];i?n[0]=i:O("Could not resolve reference "+e[t],e,r),e[t]="#/components/schemas/"+n.join("/")}}function _(e){for(let t in e)for(let n in e[t]){let r=g.sanitise(n);n!==r&&(e[t][r]=e[t][n],delete e[t][n])}}function A(e,t){if("basic"===e.type&&(e.type="http",e.scheme="basic"),"oauth2"===e.type){let n={},r=e.flow;"application"===e.flow&&(r="clientCredentials"),"accessCode"===e.flow&&(r="authorizationCode"),void 0!==e.authorizationUrl&&(n.authorizationUrl=e.authorizationUrl.split("?")[0].trim()||"/"),"string"==typeof e.tokenUrl&&(n.tokenUrl=e.tokenUrl.split("?")[0].trim()||"/"),n.scopes=e.scopes||{},e.flows={},e.flows[r]=n,delete e.flow,delete e.authorizationUrl,delete e.tokenUrl,delete e.scopes,void 0!==e.name&&(t.patch?(t.patches++,delete e.name):k("(Patchable) oauth2 securitySchemes should not have name property",t))}}function j(e){return e&&!e["x-s2o-delete"]}function T(e,t){if(e.$ref)e.$ref=e.$ref.replace("#/responses/","#/components/responses/");else{e.type&&!e.schema&&(e.schema={}),e.type&&(e.schema.type=e.type),e.items&&"array"!==e.items.type&&(e.items.collectionFormat!==e.collectionFormat&&O("Nested collectionFormats are not supported",e,t),delete e.items.collectionFormat),"array"===e.type?("ssv"===e.collectionFormat?O("collectionFormat:ssv is no longer supported for headers",e,t):"pipes"===e.collectionFormat?O("collectionFormat:pipes is no longer supported for headers",e,t):"multi"===e.collectionFormat?e.explode=!0:"tsv"===e.collectionFormat?(O("collectionFormat:tsv is no longer supported",e,t),e["x-collectionFormat"]="tsv"):e.style="simple",delete e.collectionFormat):e.collectionFormat&&(t.patch?(t.patches++,delete e.collectionFormat):k("(Patchable) collectionFormat is only applicable to header.type array",t)),delete e.type;for(let t of g.parameterTypeProperties)void 0!==e[t]&&(e.schema[t]=e[t],delete e[t]);for(let t of g.arrayProperties)void 0!==e[t]&&(e.schema[t]=e[t],delete e[t])}}function P(e,t){if(e.$ref.indexOf("#/parameters/")>=0){let t=e.$ref.split("#/parameters/");e.$ref=t[0]+"#/components/parameters/"+g.sanitise(t[1])}e.$ref.indexOf("#/definitions/")>=0&&O("Definition used as parameter",e,t)}function I(e,t,n,r,i,o,s){let a,l={},u=!0;if(t&&t.consumes&&"string"==typeof t.consumes){if(!s.patch)return k("(Patchable) operation.consumes must be an array",s);s.patches++,t.consumes=[t.consumes]}Array.isArray(o.consumes)||delete o.consumes;let d=((t?t.consumes:null)||o.consumes||[]).filter(g.uniqueOnly);if(e&&e.$ref&&"string"==typeof e.$ref){P(e,s);let t=decodeURIComponent(e.$ref.replace("#/components/parameters/","")),n=!1,r=o.components.parameters[t];if(r&&!r["x-s2o-delete"]||!e.$ref.startsWith("#/")||(e["x-s2o-delete"]=!0,n=!0),n){let t=e.$ref,n=c(o,e.$ref);!n&&t.startsWith("#/")?O("Could not resolve reference "+t,e,s):n&&(e=n)}}if(e&&(e.name||e.in)){"boolean"==typeof e["x-deprecated"]&&(e.deprecated=e["x-deprecated"],delete e["x-deprecated"]),void 0!==e["x-example"]&&(e.example=e["x-example"],delete e["x-example"]),"body"===e.in||e.type||(s.patch?(s.patches++,e.type="string"):k("(Patchable) parameter.type is mandatory for non-body parameters",s)),e.type&&"object"==typeof e.type&&e.type.$ref&&(e.type=c(o,e.type.$ref)),"file"===e.type&&(e["x-s2o-originalType"]=e.type,a=e.type),e.description&&"object"==typeof e.description&&e.description.$ref&&(e.description=c(o,e.description.$ref)),null===e.description&&delete e.description;let t=e.collectionFormat;if("array"!==e.type||t||(t="csv"),t&&("array"!==e.type&&(s.patch?(s.patches++,delete e.collectionFormat):k("(Patchable) collectionFormat is only applicable to param.type array",s)),"csv"!==t||"query"!==e.in&&"cookie"!==e.in||(e.style="form",e.explode=!1),"csv"!==t||"path"!==e.in&&"header"!==e.in||(e.style="simple"),"ssv"===t&&("query"===e.in?e.style="spaceDelimited":O("collectionFormat:ssv is no longer supported except for in:query parameters",e,s)),"pipes"===t&&("query"===e.in?e.style="pipeDelimited":O("collectionFormat:pipes is no longer supported except for in:query parameters",e,s)),"multi"===t&&(e.explode=!0),"tsv"===t&&(O("collectionFormat:tsv is no longer supported",e,s),e["x-collectionFormat"]="tsv"),delete e.collectionFormat),e.type&&"body"!==e.type&&"formData"!==e.in)if(e.items&&e.schema)O("parameter has array,items and schema",e,s);else{e.schema&&s.patches++,e.schema&&"object"==typeof e.schema||(e.schema={}),e.schema.type=e.type,e.items&&(e.schema.items=e.items,delete e.items,f(e.schema.items,null,(function(n,r,i){"collectionFormat"===r&&"string"==typeof n[r]&&(t&&n[r]!==t&&O("Nested collectionFormats are not supported",e,s),delete n[r])})));for(let t of g.parameterTypeProperties)void 0!==e[t]&&(e.schema[t]=e[t]),delete e[t]}e.schema&&S(e.schema,s),e["x-ms-skip-url-encoding"]&&"query"===e.in&&(e.allowReserved=!0,delete e["x-ms-skip-url-encoding"])}if(e&&"formData"===e.in){u=!1,l.content={};let t="application/x-www-form-urlencoded";if(d.length&&d.indexOf("multipart/form-data")>=0&&(t="multipart/form-data"),l.content[t]={},e.schema)l.content[t].schema=e.schema,e.schema.$ref&&(l["x-s2o-name"]=decodeURIComponent(e.schema.$ref.replace("#/components/schemas/","")));else{l.content[t].schema={},l.content[t].schema.type="object",l.content[t].schema.properties={},l.content[t].schema.properties[e.name]={};let n=l.content[t].schema,r=l.content[t].schema.properties[e.name];e.description&&(r.description=e.description),e.example&&(r.example=e.example),e.type&&(r.type=e.type);for(let t of g.parameterTypeProperties)void 0!==e[t]&&(r[t]=e[t]);!0===e.required&&(n.required||(n.required=[]),n.required.push(e.name),l.required=!0),void 0!==e.default&&(r.default=e.default),r.properties&&(r.properties=e.properties),e.allOf&&(r.allOf=e.allOf),"array"===e.type&&e.items&&(r.items=e.items,r.items.collectionFormat&&delete r.items.collectionFormat),"file"!==a&&"file"!==e["x-s2o-originalType"]||(r.type="string",r.format="binary"),C(e,r)}}else e&&"file"===e.type&&(e.required&&(l.required=e.required),l.content={},l.content["application/octet-stream"]={},l.content["application/octet-stream"].schema={},l.content["application/octet-stream"].schema.type="string",l.content["application/octet-stream"].schema.format="binary",C(e,l));if(e&&"body"===e.in){l.content={},e.name&&(l["x-s2o-name"]=(t&&t.operationId?g.sanitiseAll(t.operationId):"")+("_"+e.name).toCamelCase()),e.description&&(l.description=e.description),e.required&&(l.required=e.required),t&&s.rbname&&e.name&&(t[s.rbname]=e.name),e.schema&&e.schema.$ref?l["x-s2o-name"]=decodeURIComponent(e.schema.$ref.replace("#/components/schemas/","")):e.schema&&"array"===e.schema.type&&e.schema.items&&e.schema.items.$ref&&(l["x-s2o-name"]=decodeURIComponent(e.schema.items.$ref.replace("#/components/schemas/",""))+"Array"),d.length||d.push("application/json");for(let t of d)l.content[t]={},l.content[t].schema=p(e.schema||{}),S(l.content[t].schema,s);C(e,l)}if(Object.keys(l).length>0&&(e["x-s2o-delete"]=!0,t)&&(t.requestBody&&u?(t.requestBody["x-s2o-overloaded"]=!0,O("Operation "+(t.operationId||i)+" has multiple requestBodies",t,s)):(t.requestBody||(t=n[r]=function(e,t){let n={};for(let r of Object.keys(e))n[r]=e[r],"parameters"===r&&(n.requestBody={},t.rbname&&(n[t.rbname]=""));return n.requestBody={},n}(t,s)),t.requestBody.content&&t.requestBody.content["multipart/form-data"]&&t.requestBody.content["multipart/form-data"].schema&&t.requestBody.content["multipart/form-data"].schema.properties&&l.content["multipart/form-data"]&&l.content["multipart/form-data"].schema&&l.content["multipart/form-data"].schema.properties?(t.requestBody.content["multipart/form-data"].schema.properties=Object.assign(t.requestBody.content["multipart/form-data"].schema.properties,l.content["multipart/form-data"].schema.properties),t.requestBody.content["multipart/form-data"].schema.required=(t.requestBody.content["multipart/form-data"].schema.required||[]).concat(l.content["multipart/form-data"].schema.required||[]),t.requestBody.content["multipart/form-data"].schema.required.length||delete t.requestBody.content["multipart/form-data"].schema.required):t.requestBody.content&&t.requestBody.content["application/x-www-form-urlencoded"]&&t.requestBody.content["application/x-www-form-urlencoded"].schema&&t.requestBody.content["application/x-www-form-urlencoded"].schema.properties&&l.content["application/x-www-form-urlencoded"]&&l.content["application/x-www-form-urlencoded"].schema&&l.content["application/x-www-form-urlencoded"].schema.properties?(t.requestBody.content["application/x-www-form-urlencoded"].schema.properties=Object.assign(t.requestBody.content["application/x-www-form-urlencoded"].schema.properties,l.content["application/x-www-form-urlencoded"].schema.properties),t.requestBody.content["application/x-www-form-urlencoded"].schema.required=(t.requestBody.content["application/x-www-form-urlencoded"].schema.required||[]).concat(l.content["application/x-www-form-urlencoded"].schema.required||[]),t.requestBody.content["application/x-www-form-urlencoded"].schema.required.length||delete t.requestBody.content["application/x-www-form-urlencoded"].schema.required):(t.requestBody=Object.assign(t.requestBody,l),t.requestBody["x-s2o-name"]||(t.requestBody.schema&&t.requestBody.schema.$ref?t.requestBody["x-s2o-name"]=decodeURIComponent(t.requestBody.schema.$ref.replace("#/components/schemas/","")).split("/").join(""):t.operationId&&(t.requestBody["x-s2o-name"]=g.sanitiseAll(t.operationId)))))),e&&!e["x-s2o-delete"]){delete e.type;for(let t of g.parameterTypeProperties)delete e[t];"path"!==e.in||void 0!==e.required&&!0===e.required||(s.patch?(s.patches++,e.required=!0):k("(Patchable) path parameters must be required:true ["+e.name+" in "+i+"]",s))}return t}function C(e,t){for(let n in e)n.startsWith("x-")&&!n.startsWith("x-s2o")&&(t[n]=e[n])}function R(e,t,n,r,i){if(!e)return!1;if(e.$ref&&"string"==typeof e.$ref)e.$ref.indexOf("#/definitions/")>=0?O("definition used as response: "+e.$ref,e,i):e.$ref.startsWith("#/responses/")&&(e.$ref="#/components/responses/"+g.sanitise(decodeURIComponent(e.$ref.replace("#/responses/",""))));else{if((void 0===e.description||null===e.description||""===e.description&&i.patch)&&(i.patch?"object"!=typeof e||Array.isArray(e)||(i.patches++,e.description=y[e]||""):k("(Patchable) response.description is mandatory",i)),void 0!==e.schema){if(S(e.schema,i),e.schema.$ref&&"string"==typeof e.schema.$ref&&e.schema.$ref.startsWith("#/responses/")&&(e.schema.$ref="#/components/responses/"+g.sanitise(decodeURIComponent(e.schema.$ref.replace("#/responses/","")))),n&&n.produces&&"string"==typeof n.produces){if(!i.patch)return k("(Patchable) operation.produces must be an array",i);i.patches++,n.produces=[n.produces]}r.produces&&!Array.isArray(r.produces)&&delete r.produces;let t=((n?n.produces:null)||r.produces||[]).filter(g.uniqueOnly);t.length||t.push("*/*"),e.content={};for(let n of t){if(e.content[n]={},e.content[n].schema=p(e.schema),e.examples&&e.examples[n]){let t={};t.value=e.examples[n],e.content[n].examples={},e.content[n].examples.response=t,delete e.examples[n]}"file"===e.content[n].schema.type&&(e.content[n].schema={type:"string",format:"binary"})}delete e.schema}for(let t in e.examples)e.content||(e.content={}),e.content[t]||(e.content[t]={}),e.content[t].examples={},e.content[t].examples.response={},e.content[t].examples.response.value=e.examples[t];if(delete e.examples,e.headers)for(let t in e.headers)"status code"===t.toLowerCase()?i.patch?(i.patches++,delete e.headers[t]):k('(Patchable) "Status Code" is not a valid header',i):T(e.headers[t],i)}}function N(e,t,n,r,o){for(let s in e){let a=e[s];a&&a["x-trace"]&&"object"==typeof a["x-trace"]&&(a.trace=a["x-trace"],delete a["x-trace"]),a&&a["x-summary"]&&"string"==typeof a["x-summary"]&&(a.summary=a["x-summary"],delete a["x-summary"]),a&&a["x-description"]&&"string"==typeof a["x-description"]&&(a.description=a["x-description"],delete a["x-description"]),a&&a["x-servers"]&&Array.isArray(a["x-servers"])&&(a.servers=a["x-servers"],delete a["x-servers"]);for(let e in a)if(g.httpMethods.indexOf(e)>=0||"x-amazon-apigateway-any-method"===e){let u=a[e];if(u&&u.parameters&&Array.isArray(u.parameters)){if(a.parameters)for(let t of a.parameters)"string"==typeof t.$ref&&(P(t,n),t=c(o,t.$ref)),u.parameters.find((function(e,n,r){return e.name===t.name&&e.in===t.in}))||"formData"!==t.in&&"body"!==t.in&&"file"!==t.type||(u=I(t,u,a,e,s,o,n),n.rbname&&""===u[n.rbname]&&delete u[n.rbname]);for(let t of u.parameters)u=I(t,u,a,e,e+":"+s,o,n);n.rbname&&""===u[n.rbname]&&delete u[n.rbname],n.debug||u.parameters&&(u.parameters=u.parameters.filter(j))}if(u&&u.security&&_(u.security),"object"==typeof u){if(!u.responses){let e={description:"Default response"};u.responses={default:e}}for(let e in u.responses)R(u.responses[e],0,u,o,n)}if(u&&u["x-servers"]&&Array.isArray(u["x-servers"]))u.servers=u["x-servers"],delete u["x-servers"];else if(u&&u.schemes&&u.schemes.length)for(let e of u.schemes)if((!o.schemes||o.schemes.indexOf(e)<0)&&(u.servers||(u.servers=[]),Array.isArray(o.servers)))for(let t of o.servers){let n=p(t),r=i.parse(n.url);r.protocol=e,n.url=r.format(),u.servers.push(n)}if(n.debug&&(u["x-s2o-consumes"]=u.consumes||[],u["x-s2o-produces"]=u.produces||[]),u){if(delete u.consumes,delete u.produces,delete u.schemes,u["x-ms-examples"]){for(let e in u["x-ms-examples"]){let t=u["x-ms-examples"][e],n=g.sanitiseAll(e);if(t.parameters)for(let r in t.parameters){let n=t.parameters[r];for(let t of(u.parameters||[]).concat(a.parameters||[]))t.$ref&&(t=l.jptr(o,t.$ref)),t.name!==r||t.example||(t.examples||(t.examples={}),t.examples[e]={value:n})}if(t.responses)for(let r in t.responses){if(t.responses[r].headers)for(let e in t.responses[r].headers){let n=t.responses[r].headers[e];for(let t in u.responses[r].headers)t===e&&(u.responses[r].headers[t].example=n)}if(t.responses[r].body&&(o.components.examples[n]={value:p(t.responses[r].body)},u.responses[r]&&u.responses[r].content))for(let t in u.responses[r].content){let i=u.responses[r].content[t];i.examples||(i.examples={}),i.examples[e]={$ref:"#/components/examples/"+n}}}}delete u["x-ms-examples"]}if(u.parameters&&0===u.parameters.length&&delete u.parameters,u.requestBody){let n=u.operationId?g.sanitiseAll(u.operationId):g.sanitiseAll(e+s).toCamelCase(),i=g.sanitise(u.requestBody["x-s2o-name"]||n||"");delete u.requestBody["x-s2o-name"];let o=JSON.stringify(u.requestBody),a=g.hash(o);if(!r[a]){let e={};e.name=i,e.body=u.requestBody,e.refs=[],r[a]=e}let c="#/"+t+"/"+encodeURIComponent(l.jpescape(s))+"/"+e+"/requestBody";r[a].refs.push(c)}}}if(a&&a.parameters){for(let e in a.parameters)I(a.parameters[e],null,a,null,s,o,n);!n.debug&&Array.isArray(a.parameters)&&(a.parameters=a.parameters.filter(j))}}}function L(e){return e&&e.url&&"string"==typeof e.url?(e.url=e.url.split("{{").join("{"),e.url=e.url.split("}}").join("}"),e.url.replace(/\{(.+?)\}/g,(function(t,n){e.variables||(e.variables={}),e.variables[n]={default:"unknown"}})),e):e}function $(e,t,n){if(void 0===e.info||null===e.info){if(!t.patch)return n(new w("(Patchable) info object is mandatory"));t.patches++,e.info={version:"",title:""}}if("object"!=typeof e.info||Array.isArray(e.info))return n(new w("info must be an object"));if(void 0===e.info.title||null===e.info.title){if(!t.patch)return n(new w("(Patchable) info.title cannot be null"));t.patches++,e.info.title=""}if(void 0===e.info.version||null===e.info.version){if(!t.patch)return n(new w("(Patchable) info.version cannot be null"));t.patches++,e.info.version=""}if("string"!=typeof e.info.version){if(!t.patch)return n(new w("(Patchable) info.version must be a string"));t.patches++,e.info.version=e.info.version.toString()}if(void 0!==e.info.logo){if(!t.patch)return n(new w("(Patchable) info should not have logo property"));t.patches++,e.info["x-logo"]=e.info.logo,delete e.info.logo}if(void 0!==e.info.termsOfService){if(null===e.info.termsOfService){if(!t.patch)return n(new w("(Patchable) info.termsOfService cannot be null"));t.patches++,e.info.termsOfService=""}try{new URL(e.info.termsOfService)}catch(r){if(!t.patch)return n(new w("(Patchable) info.termsOfService must be a URL"));t.patches++,delete e.info.termsOfService}}}function M(e,t,n){if(void 0===e.paths){if(!t.patch)return n(new w("(Patchable) paths object is mandatory"));t.patches++,e.paths={}}}function D(e,t,n){return o(n,new Promise((function(n,r){if(e||(e={}),t.original=e,t.text||(t.text=a.stringify(e)),t.externals=[],t.externalRefs={},t.rewriteRefs=!0,t.preserveMiro=!0,t.promise={},t.promise.resolve=n,t.promise.reject=r,t.patches=0,t.cache||(t.cache={}),t.source&&(t.cache[t.source]=t.original),function(e,t){const n=new WeakSet;f(e,{identityDetection:!0},(function(e,r,i){"object"==typeof e[r]&&null!==e[r]&&(n.has(e[r])?t.anchors?e[r]=p(e[r]):k("YAML anchor or merge key at "+i.path,t):n.add(e[r]))}))}(e,t),e.openapi&&"string"==typeof e.openapi&&e.openapi.startsWith("3."))return t.openapi=d(e),$(t.openapi,t,r),M(t.openapi,t,r),void h.optionalResolve(t).then((function(){return t.direct?n(t.openapi):n(t)})).catch((function(e){console.warn(e),r(e)}));if(!e.swagger||"2.0"!=e.swagger)return r(new w("Unsupported swagger/OpenAPI version: "+(e.openapi?e.openapi:e.swagger)));let i=t.openapi={};if(i.openapi="string"==typeof t.targetVersion&&t.targetVersion.startsWith("3.")?t.targetVersion:b,t.origin){i["x-origin"]||(i["x-origin"]=[]);let n={};n.url=t.source||t.origin,n.format="swagger",n.version=e.swagger,n.converter={},n.converter.url="https://github.com/mermade/oas-kit",n.converter.version=v,i["x-origin"].push(n)}if(i=Object.assign(i,d(e)),delete i.swagger,f(i,{},(function(e,t,n){null===e[t]&&!t.startsWith("x-")&&"default"!==t&&n.path.indexOf("/example")<0&&delete e[t]})),e.host)for(let t of Array.isArray(e.schemes)?e.schemes:[""]){let n={},r=(e.basePath||"").replace(/\/$/,"");n.url=(t?t+":":"")+"//"+e.host+r,L(n),i.servers||(i.servers=[]),i.servers.push(n)}else if(e.basePath){let t={};t.url=e.basePath,L(t),i.servers||(i.servers=[]),i.servers.push(t)}if(delete i.host,delete i.basePath,i["x-servers"]&&Array.isArray(i["x-servers"])&&(i.servers=i["x-servers"],delete i["x-servers"]),e["x-ms-parameterized-host"]){let t=e["x-ms-parameterized-host"],n={};n.url=t.hostTemplate+(e.basePath?e.basePath:""),n.variables={};const r=n.url.match(/\{\w+\}/g);for(let e in t.parameters){let o=t.parameters[e];o.$ref&&(o=p(c(i,o.$ref))),e.startsWith("x-")||(delete o.required,delete o.type,delete o.in,void 0===o.default&&(o.enum?o.default=o.enum[0]:o.default="none"),o.name||(o.name=r[e].replace("{","").replace("}","")),n.variables[o.name]=o,delete o.name)}i.servers||(i.servers=[]),!1===t.useSchemePrefix?i.servers.push(n):e.schemes.forEach((e=>{i.servers.push(Object.assign({},n,{url:e+"://"+n.url}))})),delete i["x-ms-parameterized-host"]}$(i,t,r),M(i,t,r),"string"==typeof i.consumes&&(i.consumes=[i.consumes]),"string"==typeof i.produces&&(i.produces=[i.produces]),i.components={},i["x-callbacks"]&&(i.components.callbacks=i["x-callbacks"],delete i["x-callbacks"]),i.components.examples={},i.components.headers={},i["x-links"]&&(i.components.links=i["x-links"],delete i["x-links"]),i.components.parameters=i.parameters||{},i.components.responses=i.responses||{},i.components.requestBodies={},i.components.securitySchemes=i.securityDefinitions||{},i.components.schemas=i.definitions||{},delete i.definitions,delete i.responses,delete i.parameters,delete i.securityDefinitions,h.optionalResolve(t).then((function(){(function(e,t){let n={};x={schemas:{}},e.security&&_(e.security);for(let i in e.components.securitySchemes){let n=g.sanitise(i);i!==n&&(e.components.securitySchemes[n]&&k("Duplicate sanitised securityScheme name "+n,t),e.components.securitySchemes[n]=e.components.securitySchemes[i],delete e.components.securitySchemes[i]),A(e.components.securitySchemes[n],t)}for(let i in e.components.schemas){let n=g.sanitiseAll(i),r="";if(i!==n){for(;e.components.schemas[n+r];)r=r?++r:2;e.components.schemas[n+r]=e.components.schemas[i],delete e.components.schemas[i]}x.schemas[i]=n+r,S(e.components.schemas[n+r],t)}t.refmap={},f(e,{payload:{options:t}},E),function(e,t){for(let n in t.refmap)l.jptr(e,n,{$ref:t.refmap[n]})}(e,t);for(let i in e.components.parameters){let n=g.sanitise(i);i!==n&&(e.components.parameters[n]&&k("Duplicate sanitised parameter name "+n,t),e.components.parameters[n]=e.components.parameters[i],delete e.components.parameters[i]),I(e.components.parameters[n],null,null,null,n,e,t)}for(let i in e.components.responses){let n=g.sanitise(i);i!==n&&(e.components.responses[n]&&k("Duplicate sanitised response name "+n,t),e.components.responses[n]=e.components.responses[i],delete e.components.responses[i]);let r=e.components.responses[n];if(R(r,0,null,e,t),r.headers)for(let e in r.headers)"status code"===e.toLowerCase()?t.patch?(t.patches++,delete r.headers[e]):k('(Patchable) "Status Code" is not a valid header',t):T(r.headers[e],t)}for(let i in e.components.requestBodies){let t=e.components.requestBodies[i],r=JSON.stringify(t),o=g.hash(r),s={};s.name=i,s.body=t,s.refs=[],n[o]=s}if(N(e.paths,"paths",t,n,e),e["x-ms-paths"]&&N(e["x-ms-paths"],"x-ms-paths",t,n,e),!t.debug)for(let i in e.components.parameters)e.components.parameters[i]["x-s2o-delete"]&&delete e.components.parameters[i];t.debug&&(e["x-s2o-consumes"]=e.consumes||[],e["x-s2o-produces"]=e.produces||[]),delete e.consumes,delete e.produces,delete e.schemes;let r=[];if(e.components.requestBodies={},!t.resolveInternal){let t=1;for(let i in n){let o=n[i];if(o.refs.length>1){let n="";for(o.name||(o.name="requestBody",n=t++);r.indexOf(o.name+n)>=0;)n=n?++n:2;o.name=o.name+n,r.push(o.name),e.components.requestBodies[o.name]=p(o.body);for(let t in o.refs){let n={};n.$ref="#/components/requestBodies/"+o.name,l.jptr(e,o.refs[t],n)}}}}e.components.responses&&0===Object.keys(e.components.responses).length&&delete e.components.responses,e.components.parameters&&0===Object.keys(e.components.parameters).length&&delete e.components.parameters,e.components.examples&&0===Object.keys(e.components.examples).length&&delete e.components.examples,e.components.requestBodies&&0===Object.keys(e.components.requestBodies).length&&delete e.components.requestBodies,e.components.securitySchemes&&0===Object.keys(e.components.securitySchemes).length&&delete e.components.securitySchemes,e.components.headers&&0===Object.keys(e.components.headers).length&&delete e.components.headers,e.components.schemas&&0===Object.keys(e.components.schemas).length&&delete e.components.schemas,e.components&&0===Object.keys(e.components).length&&delete e.components})(t.openapi,t),t.direct?n(t.openapi):n(t)})).catch((function(e){console.warn(e),r(e)}))})))}function F(e,t,n){return o(n,new Promise((function(n,r){let i=null,o=null;try{i=JSON.parse(e),t.text=JSON.stringify(i,null,2)}catch(n){o=n;try{i=a.parse(e,{schema:"core",prettyErrors:!0}),t.sourceYaml=!0,t.text=e}catch(e){o=e}}i?D(i,t).then((e=>n(e))).catch((e=>r(e))):r(new w(o?o.message:"Could not parse string"))})))}e.exports={S2OError:w,targetVersion:b,convert:D,convertObj:D,convertUrl:function(e,t,n){return o(n,new Promise((function(n,r){t.origin=!0,t.source||(t.source=e),t.verbose&&console.warn("GET "+e),t.fetch||(t.fetch=s);const i=Object.assign({},t.fetchOptions,{agent:t.agent});t.fetch(e,i).then((function(t){if(200!==t.status)throw new w(`Received status code ${t.status}: ${e}`);return t.text()})).then((function(e){F(e,t).then((e=>n(e))).catch((e=>r(e)))})).catch((function(e){r(e)}))})))},convertStr:F,convertFile:function(e,t,n){return o(n,new Promise((function(n,i){r.readFile(e,t.encoding||"utf8",(function(r,o){r?i(r):(t.sourceFile=e,F(o,t).then((e=>n(e))).catch((e=>i(e))))}))})))},convertStream:function(e,t,n){return o(n,new Promise((function(n,r){let i="";e.on("data",(function(e){i+=e})).on("end",(function(){F(i,t).then((e=>n(e))).catch((e=>r(e)))}))})))}}},711:function(e,t,n){"use strict";const r=n(177);e.exports={statusCodes:Object.assign({},{default:"Default response","1XX":"Informational",103:"Early hints","2XX":"Successful","3XX":"Redirection","4XX":"Client Error","5XX":"Server Error","7XX":"Developer Error"},r.STATUS_CODES)}},595:function(e,t,n){var r=n(314),i=["add","done","toJS","fromExternalJS","load","dispose","search","Worker"];e.exports=function(){var e=new Worker(URL.createObjectURL(new Blob(['/*! For license information please see 756674defce81e90acea.worker.js.LICENSE.txt */\n!function(){var e={336:function(e,t,r){var n,i;!function(){var s,o,a,u,l,c,h,d,f,p,y,m,g,x,v,w,Q,k,S,E,L,P,b,T,O,I,R,F,C,N,j=function(e){var t=new j.Builder;return t.pipeline.add(j.trimmer,j.stopWordFilter,j.stemmer),t.searchPipeline.add(j.stemmer),e.call(t,t),t.build()};j.version="2.3.9",j.utils={},j.utils.warn=(s=this,function(e){s.console&&console.warn&&console.warn(e)}),j.utils.asString=function(e){return null==e?"":e.toString()},j.utils.clone=function(e){if(null==e)return e;for(var t=Object.create(null),r=Object.keys(e),n=0;n<r.length;n++){var i=r[n],s=e[i];if(Array.isArray(s))t[i]=s.slice();else{if("string"!=typeof s&&"number"!=typeof s&&"boolean"!=typeof s)throw new TypeError("clone is not deep and does not support nested objects");t[i]=s}}return t},j.FieldRef=function(e,t,r){this.docRef=e,this.fieldName=t,this._stringValue=r},j.FieldRef.joiner="/",j.FieldRef.fromString=function(e){var t=e.indexOf(j.FieldRef.joiner);if(-1===t)throw"malformed field ref string";var r=e.slice(0,t),n=e.slice(t+1);return new j.FieldRef(n,r,e)},j.FieldRef.prototype.toString=function(){return null==this._stringValue&&(this._stringValue=this.fieldName+j.FieldRef.joiner+this.docRef),this._stringValue},j.Set=function(e){if(this.elements=Object.create(null),e){this.length=e.length;for(var t=0;t<this.length;t++)this.elements[e[t]]=!0}else this.length=0},j.Set.complete={intersect:function(e){return e},union:function(){return this},contains:function(){return!0}},j.Set.empty={intersect:function(){return this},union:function(e){return e},contains:function(){return!1}},j.Set.prototype.contains=function(e){return!!this.elements[e]},j.Set.prototype.intersect=function(e){var t,r,n,i=[];if(e===j.Set.complete)return this;if(e===j.Set.empty)return e;this.length<e.length?(t=this,r=e):(t=e,r=this),n=Object.keys(t.elements);for(var s=0;s<n.length;s++){var o=n[s];o in r.elements&&i.push(o)}return new j.Set(i)},j.Set.prototype.union=function(e){return e===j.Set.complete?j.Set.complete:e===j.Set.empty?this:new j.Set(Object.keys(this.elements).concat(Object.keys(e.elements)))},j.idf=function(e,t){var r=0;for(var n in e)"_index"!=n&&(r+=Object.keys(e[n]).length);var i=(t-r+.5)/(r+.5);return Math.log(1+Math.abs(i))},j.Token=function(e,t){this.str=e||"",this.metadata=t||{}},j.Token.prototype.toString=function(){return this.str},j.Token.prototype.update=function(e){return this.str=e(this.str,this.metadata),this},j.Token.prototype.clone=function(e){return e=e||function(e){return e},new j.Token(e(this.str,this.metadata),this.metadata)},j.tokenizer=function(e,t){if(null==e||null==e)return[];if(Array.isArray(e))return e.map((function(e){return new j.Token(j.utils.asString(e).toLowerCase(),j.utils.clone(t))}));for(var r=e.toString().toLowerCase(),n=r.length,i=[],s=0,o=0;s<=n;s++){var a=s-o;if(r.charAt(s).match(j.tokenizer.separator)||s==n){if(a>0){var u=j.utils.clone(t)||{};u.position=[o,a],u.index=i.length,i.push(new j.Token(r.slice(o,s),u))}o=s+1}}return i},j.tokenizer.separator=/[\\s\\-]+/,j.Pipeline=function(){this._stack=[]},j.Pipeline.registeredFunctions=Object.create(null),j.Pipeline.registerFunction=function(e,t){t in this.registeredFunctions&&j.utils.warn("Overwriting existing registered function: "+t),e.label=t,j.Pipeline.registeredFunctions[e.label]=e},j.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||j.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\\n",e)},j.Pipeline.load=function(e){var t=new j.Pipeline;return e.forEach((function(e){var r=j.Pipeline.registeredFunctions[e];if(!r)throw new Error("Cannot load unregistered function: "+e);t.add(r)})),t},j.Pipeline.prototype.add=function(){Array.prototype.slice.call(arguments).forEach((function(e){j.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)}),this)},j.Pipeline.prototype.after=function(e,t){j.Pipeline.warnIfFunctionNotRegistered(t);var r=this._stack.indexOf(e);if(-1==r)throw new Error("Cannot find existingFn");r+=1,this._stack.splice(r,0,t)},j.Pipeline.prototype.before=function(e,t){j.Pipeline.warnIfFunctionNotRegistered(t);var r=this._stack.indexOf(e);if(-1==r)throw new Error("Cannot find existingFn");this._stack.splice(r,0,t)},j.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);-1!=t&&this._stack.splice(t,1)},j.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r<t;r++){for(var n=this._stack[r],i=[],s=0;s<e.length;s++){var o=n(e[s],s,e);if(null!=o&&""!==o)if(Array.isArray(o))for(var a=0;a<o.length;a++)i.push(o[a]);else i.push(o)}e=i}return e},j.Pipeline.prototype.runString=function(e,t){var r=new j.Token(e,t);return this.run([r]).map((function(e){return e.toString()}))},j.Pipeline.prototype.reset=function(){this._stack=[]},j.Pipeline.prototype.toJSON=function(){return this._stack.map((function(e){return j.Pipeline.warnIfFunctionNotRegistered(e),e.label}))},j.Vector=function(e){this._magnitude=0,this.elements=e||[]},j.Vector.prototype.positionForIndex=function(e){if(0==this.elements.length)return 0;for(var t=0,r=this.elements.length/2,n=r-t,i=Math.floor(n/2),s=this.elements[2*i];n>1&&(s<e&&(t=i),s>e&&(r=i),s!=e);)n=r-t,i=t+Math.floor(n/2),s=this.elements[2*i];return s==e||s>e?2*i:s<e?2*(i+1):void 0},j.Vector.prototype.insert=function(e,t){this.upsert(e,t,(function(){throw"duplicate index"}))},j.Vector.prototype.upsert=function(e,t,r){this._magnitude=0;var n=this.positionForIndex(e);this.elements[n]==e?this.elements[n+1]=r(this.elements[n+1],t):this.elements.splice(n,0,e,t)},j.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var e=0,t=this.elements.length,r=1;r<t;r+=2){var n=this.elements[r];e+=n*n}return this._magnitude=Math.sqrt(e)},j.Vector.prototype.dot=function(e){for(var t=0,r=this.elements,n=e.elements,i=r.length,s=n.length,o=0,a=0,u=0,l=0;u<i&&l<s;)(o=r[u])<(a=n[l])?u+=2:o>a?l+=2:o==a&&(t+=r[u+1]*n[l+1],u+=2,l+=2);return t},j.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},j.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t<this.elements.length;t+=2,r++)e[r]=this.elements[t];return e},j.Vector.prototype.toJSON=function(){return this.elements},j.stemmer=(o={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},a={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},h="^("+(l="[^aeiou][^aeiouy]*")+")?"+(c=(u="[aeiouy]")+"[aeiou]*")+l+"("+c+")?$",d="^("+l+")?"+c+l+c+l,f="^("+l+")?"+u,p=new RegExp("^("+l+")?"+c+l),y=new RegExp(d),m=new RegExp(h),g=new RegExp(f),x=/^(.+?)(ss|i)es$/,v=/^(.+?)([^s])s$/,w=/^(.+?)eed$/,Q=/^(.+?)(ed|ing)$/,k=/.$/,S=/(at|bl|iz)$/,E=new RegExp("([^aeiouylsz])\\\\1$"),L=new RegExp("^"+l+u+"[^aeiouwxy]$"),P=/^(.+?[^aeiou])y$/,b=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,T=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,O=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,I=/^(.+?)(s|t)(ion)$/,R=/^(.+?)e$/,F=/ll$/,C=new RegExp("^"+l+u+"[^aeiouwxy]$"),N=function(e){var t,r,n,i,s,u,l;if(e.length<3)return e;if("y"==(n=e.substr(0,1))&&(e=n.toUpperCase()+e.substr(1)),s=v,(i=x).test(e)?e=e.replace(i,"$1$2"):s.test(e)&&(e=e.replace(s,"$1$2")),s=Q,(i=w).test(e)){var c=i.exec(e);(i=p).test(c[1])&&(i=k,e=e.replace(i,""))}else s.test(e)&&(t=(c=s.exec(e))[1],(s=g).test(t)&&(u=E,l=L,(s=S).test(e=t)?e+="e":u.test(e)?(i=k,e=e.replace(i,"")):l.test(e)&&(e+="e")));return(i=P).test(e)&&(e=(t=(c=i.exec(e))[1])+"i"),(i=b).test(e)&&(t=(c=i.exec(e))[1],r=c[2],(i=p).test(t)&&(e=t+o[r])),(i=T).test(e)&&(t=(c=i.exec(e))[1],r=c[2],(i=p).test(t)&&(e=t+a[r])),s=I,(i=O).test(e)?(t=(c=i.exec(e))[1],(i=y).test(t)&&(e=t)):s.test(e)&&(t=(c=s.exec(e))[1]+c[2],(s=y).test(t)&&(e=t)),(i=R).test(e)&&(t=(c=i.exec(e))[1],s=m,u=C,((i=y).test(t)||s.test(t)&&!u.test(t))&&(e=t)),s=y,(i=F).test(e)&&s.test(e)&&(i=k,e=e.replace(i,"")),"y"==n&&(e=n.toLowerCase()+e.substr(1)),e},function(e){return e.update(N)}),j.Pipeline.registerFunction(j.stemmer,"stemmer"),j.generateStopWordFilter=function(e){var t=e.reduce((function(e,t){return e[t]=t,e}),{});return function(e){if(e&&t[e.toString()]!==e.toString())return e}},j.stopWordFilter=j.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),j.Pipeline.registerFunction(j.stopWordFilter,"stopWordFilter"),j.trimmer=function(e){return e.update((function(e){return e.replace(/^\\W+/,"").replace(/\\W+$/,"")}))},j.Pipeline.registerFunction(j.trimmer,"trimmer"),j.TokenSet=function(){this.final=!1,this.edges={},this.id=j.TokenSet._nextId,j.TokenSet._nextId+=1},j.TokenSet._nextId=1,j.TokenSet.fromArray=function(e){for(var t=new j.TokenSet.Builder,r=0,n=e.length;r<n;r++)t.insert(e[r]);return t.finish(),t.root},j.TokenSet.fromClause=function(e){return"editDistance"in e?j.TokenSet.fromFuzzyString(e.term,e.editDistance):j.TokenSet.fromString(e.term)},j.TokenSet.fromFuzzyString=function(e,t){for(var r=new j.TokenSet,n=[{node:r,editsRemaining:t,str:e}];n.length;){var i=n.pop();if(i.str.length>0){var s,o=i.str.charAt(0);o in i.node.edges?s=i.node.edges[o]:(s=new j.TokenSet,i.node.edges[o]=s),1==i.str.length&&(s.final=!0),n.push({node:s,editsRemaining:i.editsRemaining,str:i.str.slice(1)})}if(0!=i.editsRemaining){if("*"in i.node.edges)var a=i.node.edges["*"];else a=new j.TokenSet,i.node.edges["*"]=a;if(0==i.str.length&&(a.final=!0),n.push({node:a,editsRemaining:i.editsRemaining-1,str:i.str}),i.str.length>1&&n.push({node:i.node,editsRemaining:i.editsRemaining-1,str:i.str.slice(1)}),1==i.str.length&&(i.node.final=!0),i.str.length>=1){if("*"in i.node.edges)var u=i.node.edges["*"];else u=new j.TokenSet,i.node.edges["*"]=u;1==i.str.length&&(u.final=!0),n.push({node:u,editsRemaining:i.editsRemaining-1,str:i.str.slice(1)})}if(i.str.length>1){var l,c=i.str.charAt(0),h=i.str.charAt(1);h in i.node.edges?l=i.node.edges[h]:(l=new j.TokenSet,i.node.edges[h]=l),1==i.str.length&&(l.final=!0),n.push({node:l,editsRemaining:i.editsRemaining-1,str:c+i.str.slice(2)})}}}return r},j.TokenSet.fromString=function(e){for(var t=new j.TokenSet,r=t,n=0,i=e.length;n<i;n++){var s=e[n],o=n==i-1;if("*"==s)t.edges[s]=t,t.final=o;else{var a=new j.TokenSet;a.final=o,t.edges[s]=a,t=a}}return r},j.TokenSet.prototype.toArray=function(){for(var e=[],t=[{prefix:"",node:this}];t.length;){var r=t.pop(),n=Object.keys(r.node.edges),i=n.length;r.node.final&&(r.prefix.charAt(0),e.push(r.prefix));for(var s=0;s<i;s++){var o=n[s];t.push({prefix:r.prefix.concat(o),node:r.node.edges[o]})}}return e},j.TokenSet.prototype.toString=function(){if(this._str)return this._str;for(var e=this.final?"1":"0",t=Object.keys(this.edges).sort(),r=t.length,n=0;n<r;n++){var i=t[n];e=e+i+this.edges[i].id}return e},j.TokenSet.prototype.intersect=function(e){for(var t=new j.TokenSet,r=void 0,n=[{qNode:e,output:t,node:this}];n.length;){r=n.pop();for(var i=Object.keys(r.qNode.edges),s=i.length,o=Object.keys(r.node.edges),a=o.length,u=0;u<s;u++)for(var l=i[u],c=0;c<a;c++){var h=o[c];if(h==l||"*"==l){var d=r.node.edges[h],f=r.qNode.edges[l],p=d.final&&f.final,y=void 0;h in r.output.edges?(y=r.output.edges[h]).final=y.final||p:((y=new j.TokenSet).final=p,r.output.edges[h]=y),n.push({qNode:f,output:y,node:d})}}}return t},j.TokenSet.Builder=function(){this.previousWord="",this.root=new j.TokenSet,this.uncheckedNodes=[],this.minimizedNodes={}},j.TokenSet.Builder.prototype.insert=function(e){var t,r=0;if(e<this.previousWord)throw new Error("Out of order word insertion");for(var n=0;n<e.length&&n<this.previousWord.length&&e[n]==this.previousWord[n];n++)r++;for(this.minimize(r),t=0==this.uncheckedNodes.length?this.root:this.uncheckedNodes[this.uncheckedNodes.length-1].child,n=r;n<e.length;n++){var i=new j.TokenSet,s=e[n];t.edges[s]=i,this.uncheckedNodes.push({parent:t,char:s,child:i}),t=i}t.final=!0,this.previousWord=e},j.TokenSet.Builder.prototype.finish=function(){this.minimize(0)},j.TokenSet.Builder.prototype.minimize=function(e){for(var t=this.uncheckedNodes.length-1;t>=e;t--){var r=this.uncheckedNodes[t],n=r.child.toString();n in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[n]:(r.child._str=n,this.minimizedNodes[n]=r.child),this.uncheckedNodes.pop()}},j.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},j.Index.prototype.search=function(e){return this.query((function(t){new j.QueryParser(e,t).parse()}))},j.Index.prototype.query=function(e){for(var t=new j.Query(this.fields),r=Object.create(null),n=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=0;a<this.fields.length;a++)n[this.fields[a]]=new j.Vector;for(e.call(t,t),a=0;a<t.clauses.length;a++){var u,l=t.clauses[a],c=j.Set.empty;u=l.usePipeline?this.pipeline.runString(l.term,{fields:l.fields}):[l.term];for(var h=0;h<u.length;h++){var d=u[h];l.term=d;var f=j.TokenSet.fromClause(l),p=this.tokenSet.intersect(f).toArray();if(0===p.length&&l.presence===j.Query.presence.REQUIRED){for(var y=0;y<l.fields.length;y++)s[R=l.fields[y]]=j.Set.empty;break}for(var m=0;m<p.length;m++){var g=p[m],x=this.invertedIndex[g],v=x._index;for(y=0;y<l.fields.length;y++){var w=x[R=l.fields[y]],Q=Object.keys(w),k=g+"/"+R,S=new j.Set(Q);if(l.presence==j.Query.presence.REQUIRED&&(c=c.union(S),void 0===s[R]&&(s[R]=j.Set.complete)),l.presence!=j.Query.presence.PROHIBITED){if(n[R].upsert(v,l.boost,(function(e,t){return e+t})),!i[k]){for(var E=0;E<Q.length;E++){var L,P=Q[E],b=new j.FieldRef(P,R),T=w[P];void 0===(L=r[b])?r[b]=new j.MatchData(g,R,T):L.add(g,R,T)}i[k]=!0}}else void 0===o[R]&&(o[R]=j.Set.empty),o[R]=o[R].union(S)}}}if(l.presence===j.Query.presence.REQUIRED)for(y=0;y<l.fields.length;y++)s[R=l.fields[y]]=s[R].intersect(c)}var O=j.Set.complete,I=j.Set.empty;for(a=0;a<this.fields.length;a++){var R;s[R=this.fields[a]]&&(O=O.intersect(s[R])),o[R]&&(I=I.union(o[R]))}var F=Object.keys(r),C=[],N=Object.create(null);if(t.isNegated())for(F=Object.keys(this.fieldVectors),a=0;a<F.length;a++){b=F[a];var _=j.FieldRef.fromString(b);r[b]=new j.MatchData}for(a=0;a<F.length;a++){var D=(_=j.FieldRef.fromString(F[a])).docRef;if(O.contains(D)&&!I.contains(D)){var A,B=this.fieldVectors[_],z=n[_.fieldName].similarity(B);if(void 0!==(A=N[D]))A.score+=z,A.matchData.combine(r[_]);else{var V={ref:D,score:z,matchData:r[_]};N[D]=V,C.push(V)}}}return C.sort((function(e,t){return t.score-e.score}))},j.Index.prototype.toJSON=function(){var e=Object.keys(this.invertedIndex).sort().map((function(e){return[e,this.invertedIndex[e]]}),this),t=Object.keys(this.fieldVectors).map((function(e){return[e,this.fieldVectors[e].toJSON()]}),this);return{version:j.version,fields:this.fields,fieldVectors:t,invertedIndex:e,pipeline:this.pipeline.toJSON()}},j.Index.load=function(e){var t={},r={},n=e.fieldVectors,i=Object.create(null),s=e.invertedIndex,o=new j.TokenSet.Builder,a=j.Pipeline.load(e.pipeline);e.version!=j.version&&j.utils.warn("Version mismatch when loading serialised index. Current version of lunr \'"+j.version+"\' does not match serialized index \'"+e.version+"\'");for(var u=0;u<n.length;u++){var l=(h=n[u])[0],c=h[1];r[l]=new j.Vector(c)}for(u=0;u<s.length;u++){var h,d=(h=s[u])[0],f=h[1];o.insert(d),i[d]=f}return o.finish(),t.fields=e.fields,t.fieldVectors=r,t.invertedIndex=i,t.tokenSet=o.root,t.pipeline=a,new j.Index(t)},j.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=j.tokenizer,this.pipeline=new j.Pipeline,this.searchPipeline=new j.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},j.Builder.prototype.ref=function(e){this._ref=e},j.Builder.prototype.field=function(e,t){if(/\\//.test(e))throw new RangeError("Field \'"+e+"\' contains illegal character \'/\'");this._fields[e]=t||{}},j.Builder.prototype.b=function(e){this._b=e<0?0:e>1?1:e},j.Builder.prototype.k1=function(e){this._k1=e},j.Builder.prototype.add=function(e,t){var r=e[this._ref],n=Object.keys(this._fields);this._documents[r]=t||{},this.documentCount+=1;for(var i=0;i<n.length;i++){var s=n[i],o=this._fields[s].extractor,a=o?o(e):e[s],u=this.tokenizer(a,{fields:[s]}),l=this.pipeline.run(u),c=new j.FieldRef(r,s),h=Object.create(null);this.fieldTermFrequencies[c]=h,this.fieldLengths[c]=0,this.fieldLengths[c]+=l.length;for(var d=0;d<l.length;d++){var f=l[d];if(null==h[f]&&(h[f]=0),h[f]+=1,null==this.invertedIndex[f]){var p=Object.create(null);p._index=this.termIndex,this.termIndex+=1;for(var y=0;y<n.length;y++)p[n[y]]=Object.create(null);this.invertedIndex[f]=p}null==this.invertedIndex[f][s][r]&&(this.invertedIndex[f][s][r]=Object.create(null));for(var m=0;m<this.metadataWhitelist.length;m++){var g=this.metadataWhitelist[m],x=f.metadata[g];null==this.invertedIndex[f][s][r][g]&&(this.invertedIndex[f][s][r][g]=[]),this.invertedIndex[f][s][r][g].push(x)}}}},j.Builder.prototype.calculateAverageFieldLengths=function(){for(var e=Object.keys(this.fieldLengths),t=e.length,r={},n={},i=0;i<t;i++){var s=j.FieldRef.fromString(e[i]),o=s.fieldName;n[o]||(n[o]=0),n[o]+=1,r[o]||(r[o]=0),r[o]+=this.fieldLengths[s]}var a=Object.keys(this._fields);for(i=0;i<a.length;i++){var u=a[i];r[u]=r[u]/n[u]}this.averageFieldLength=r},j.Builder.prototype.createFieldVectors=function(){for(var e={},t=Object.keys(this.fieldTermFrequencies),r=t.length,n=Object.create(null),i=0;i<r;i++){for(var s=j.FieldRef.fromString(t[i]),o=s.fieldName,a=this.fieldLengths[s],u=new j.Vector,l=this.fieldTermFrequencies[s],c=Object.keys(l),h=c.length,d=this._fields[o].boost||1,f=this._documents[s.docRef].boost||1,p=0;p<h;p++){var y,m,g,x=c[p],v=l[x],w=this.invertedIndex[x]._index;void 0===n[x]?(y=j.idf(this.invertedIndex[x],this.documentCount),n[x]=y):y=n[x],m=y*((this._k1+1)*v)/(this._k1*(1-this._b+this._b*(a/this.averageFieldLength[o]))+v),m*=d,m*=f,g=Math.round(1e3*m)/1e3,u.insert(w,g)}e[s]=u}this.fieldVectors=e},j.Builder.prototype.createTokenSet=function(){this.tokenSet=j.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},j.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new j.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},j.Builder.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},j.MatchData=function(e,t,r){for(var n=Object.create(null),i=Object.keys(r||{}),s=0;s<i.length;s++){var o=i[s];n[o]=r[o].slice()}this.metadata=Object.create(null),void 0!==e&&(this.metadata[e]=Object.create(null),this.metadata[e][t]=n)},j.MatchData.prototype.combine=function(e){for(var t=Object.keys(e.metadata),r=0;r<t.length;r++){var n=t[r],i=Object.keys(e.metadata[n]);null==this.metadata[n]&&(this.metadata[n]=Object.create(null));for(var s=0;s<i.length;s++){var o=i[s],a=Object.keys(e.metadata[n][o]);null==this.metadata[n][o]&&(this.metadata[n][o]=Object.create(null));for(var u=0;u<a.length;u++){var l=a[u];null==this.metadata[n][o][l]?this.metadata[n][o][l]=e.metadata[n][o][l]:this.metadata[n][o][l]=this.metadata[n][o][l].concat(e.metadata[n][o][l])}}}},j.MatchData.prototype.add=function(e,t,r){if(!(e in this.metadata))return this.metadata[e]=Object.create(null),void(this.metadata[e][t]=r);if(t in this.metadata[e])for(var n=Object.keys(r),i=0;i<n.length;i++){var s=n[i];s in this.metadata[e][t]?this.metadata[e][t][s]=this.metadata[e][t][s].concat(r[s]):this.metadata[e][t][s]=r[s]}else this.metadata[e][t]=r},j.Query=function(e){this.clauses=[],this.allFields=e},j.Query.wildcard=new String("*"),j.Query.wildcard.NONE=0,j.Query.wildcard.LEADING=1,j.Query.wildcard.TRAILING=2,j.Query.presence={OPTIONAL:1,REQUIRED:2,PROHIBITED:3},j.Query.prototype.clause=function(e){return"fields"in e||(e.fields=this.allFields),"boost"in e||(e.boost=1),"usePipeline"in e||(e.usePipeline=!0),"wildcard"in e||(e.wildcard=j.Query.wildcard.NONE),e.wildcard&j.Query.wildcard.LEADING&&e.term.charAt(0)!=j.Query.wildcard&&(e.term="*"+e.term),e.wildcard&j.Query.wildcard.TRAILING&&e.term.slice(-1)!=j.Query.wildcard&&(e.term=e.term+"*"),"presence"in e||(e.presence=j.Query.presence.OPTIONAL),this.clauses.push(e),this},j.Query.prototype.isNegated=function(){for(var e=0;e<this.clauses.length;e++)if(this.clauses[e].presence!=j.Query.presence.PROHIBITED)return!1;return!0},j.Query.prototype.term=function(e,t){if(Array.isArray(e))return e.forEach((function(e){this.term(e,j.utils.clone(t))}),this),this;var r=t||{};return r.term=e.toString(),this.clause(r),this},j.QueryParseError=function(e,t,r){this.name="QueryParseError",this.message=e,this.start=t,this.end=r},j.QueryParseError.prototype=new Error,j.QueryLexer=function(e){this.lexemes=[],this.str=e,this.length=e.length,this.pos=0,this.start=0,this.escapeCharPositions=[]},j.QueryLexer.prototype.run=function(){for(var e=j.QueryLexer.lexText;e;)e=e(this)},j.QueryLexer.prototype.sliceString=function(){for(var e=[],t=this.start,r=this.pos,n=0;n<this.escapeCharPositions.length;n++)r=this.escapeCharPositions[n],e.push(this.str.slice(t,r)),t=r+1;return e.push(this.str.slice(t,this.pos)),this.escapeCharPositions.length=0,e.join("")},j.QueryLexer.prototype.emit=function(e){this.lexemes.push({type:e,str:this.sliceString(),start:this.start,end:this.pos}),this.start=this.pos},j.QueryLexer.prototype.escapeCharacter=function(){this.escapeCharPositions.push(this.pos-1),this.pos+=1},j.QueryLexer.prototype.next=function(){if(this.pos>=this.length)return j.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},j.QueryLexer.prototype.width=function(){return this.pos-this.start},j.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},j.QueryLexer.prototype.backup=function(){this.pos-=1},j.QueryLexer.prototype.acceptDigitRun=function(){var e,t;do{t=(e=this.next()).charCodeAt(0)}while(t>47&&t<58);e!=j.QueryLexer.EOS&&this.backup()},j.QueryLexer.prototype.more=function(){return this.pos<this.length},j.QueryLexer.EOS="EOS",j.QueryLexer.FIELD="FIELD",j.QueryLexer.TERM="TERM",j.QueryLexer.EDIT_DISTANCE="EDIT_DISTANCE",j.QueryLexer.BOOST="BOOST",j.QueryLexer.PRESENCE="PRESENCE",j.QueryLexer.lexField=function(e){return e.backup(),e.emit(j.QueryLexer.FIELD),e.ignore(),j.QueryLexer.lexText},j.QueryLexer.lexTerm=function(e){if(e.width()>1&&(e.backup(),e.emit(j.QueryLexer.TERM)),e.ignore(),e.more())return j.QueryLexer.lexText},j.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(j.QueryLexer.EDIT_DISTANCE),j.QueryLexer.lexText},j.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(j.QueryLexer.BOOST),j.QueryLexer.lexText},j.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(j.QueryLexer.TERM)},j.QueryLexer.termSeparator=j.tokenizer.separator,j.QueryLexer.lexText=function(e){for(;;){var t=e.next();if(t==j.QueryLexer.EOS)return j.QueryLexer.lexEOS;if(92!=t.charCodeAt(0)){if(":"==t)return j.QueryLexer.lexField;if("~"==t)return e.backup(),e.width()>0&&e.emit(j.QueryLexer.TERM),j.QueryLexer.lexEditDistance;if("^"==t)return e.backup(),e.width()>0&&e.emit(j.QueryLexer.TERM),j.QueryLexer.lexBoost;if("+"==t&&1===e.width())return e.emit(j.QueryLexer.PRESENCE),j.QueryLexer.lexText;if("-"==t&&1===e.width())return e.emit(j.QueryLexer.PRESENCE),j.QueryLexer.lexText;if(t.match(j.QueryLexer.termSeparator))return j.QueryLexer.lexTerm}else e.escapeCharacter()}},j.QueryParser=function(e,t){this.lexer=new j.QueryLexer(e),this.query=t,this.currentClause={},this.lexemeIdx=0},j.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=j.QueryParser.parseClause;e;)e=e(this);return this.query},j.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},j.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},j.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},j.QueryParser.parseClause=function(e){var t=e.peekLexeme();if(null!=t)switch(t.type){case j.QueryLexer.PRESENCE:return j.QueryParser.parsePresence;case j.QueryLexer.FIELD:return j.QueryParser.parseField;case j.QueryLexer.TERM:return j.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+t.type;throw t.str.length>=1&&(r+=" with value \'"+t.str+"\'"),new j.QueryParseError(r,t.start,t.end)}},j.QueryParser.parsePresence=function(e){var t=e.consumeLexeme();if(null!=t){switch(t.str){case"-":e.currentClause.presence=j.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=j.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator\'"+t.str+"\'";throw new j.QueryParseError(r,t.start,t.end)}var n=e.peekLexeme();if(null==n)throw r="expecting term or field, found nothing",new j.QueryParseError(r,t.start,t.end);switch(n.type){case j.QueryLexer.FIELD:return j.QueryParser.parseField;case j.QueryLexer.TERM:return j.QueryParser.parseTerm;default:throw r="expecting term or field, found \'"+n.type+"\'",new j.QueryParseError(r,n.start,n.end)}}},j.QueryParser.parseField=function(e){var t=e.consumeLexeme();if(null!=t){if(-1==e.query.allFields.indexOf(t.str)){var r=e.query.allFields.map((function(e){return"\'"+e+"\'"})).join(", "),n="unrecognised field \'"+t.str+"\', possible fields: "+r;throw new j.QueryParseError(n,t.start,t.end)}e.currentClause.fields=[t.str];var i=e.peekLexeme();if(null==i)throw n="expecting term, found nothing",new j.QueryParseError(n,t.start,t.end);if(i.type===j.QueryLexer.TERM)return j.QueryParser.parseTerm;throw n="expecting term, found \'"+i.type+"\'",new j.QueryParseError(n,i.start,i.end)}},j.QueryParser.parseTerm=function(e){var t=e.consumeLexeme();if(null!=t){e.currentClause.term=t.str.toLowerCase(),-1!=t.str.indexOf("*")&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(null!=r)switch(r.type){case j.QueryLexer.TERM:return e.nextClause(),j.QueryParser.parseTerm;case j.QueryLexer.FIELD:return e.nextClause(),j.QueryParser.parseField;case j.QueryLexer.EDIT_DISTANCE:return j.QueryParser.parseEditDistance;case j.QueryLexer.BOOST:return j.QueryParser.parseBoost;case j.QueryLexer.PRESENCE:return e.nextClause(),j.QueryParser.parsePresence;default:var n="Unexpected lexeme type \'"+r.type+"\'";throw new j.QueryParseError(n,r.start,r.end)}else e.nextClause()}},j.QueryParser.parseEditDistance=function(e){var t=e.consumeLexeme();if(null!=t){var r=parseInt(t.str,10);if(isNaN(r)){var n="edit distance must be numeric";throw new j.QueryParseError(n,t.start,t.end)}e.currentClause.editDistance=r;var i=e.peekLexeme();if(null!=i)switch(i.type){case j.QueryLexer.TERM:return e.nextClause(),j.QueryParser.parseTerm;case j.QueryLexer.FIELD:return e.nextClause(),j.QueryParser.parseField;case j.QueryLexer.EDIT_DISTANCE:return j.QueryParser.parseEditDistance;case j.QueryLexer.BOOST:return j.QueryParser.parseBoost;case j.QueryLexer.PRESENCE:return e.nextClause(),j.QueryParser.parsePresence;default:throw n="Unexpected lexeme type \'"+i.type+"\'",new j.QueryParseError(n,i.start,i.end)}else e.nextClause()}},j.QueryParser.parseBoost=function(e){var t=e.consumeLexeme();if(null!=t){var r=parseInt(t.str,10);if(isNaN(r)){var n="boost must be numeric";throw new j.QueryParseError(n,t.start,t.end)}e.currentClause.boost=r;var i=e.peekLexeme();if(null!=i)switch(i.type){case j.QueryLexer.TERM:return e.nextClause(),j.QueryParser.parseTerm;case j.QueryLexer.FIELD:return e.nextClause(),j.QueryParser.parseField;case j.QueryLexer.EDIT_DISTANCE:return j.QueryParser.parseEditDistance;case j.QueryLexer.BOOST:return j.QueryParser.parseBoost;case j.QueryLexer.PRESENCE:return e.nextClause(),j.QueryParser.parsePresence;default:throw n="Unexpected lexeme type \'"+i.type+"\'",new j.QueryParseError(n,i.start,i.end)}else e.nextClause()}},void 0===(i="function"==typeof(n=function(){return j})?n.call(t,r,t,e):n)||(e.exports=i)}()}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var n={};!function(){"use strict";r.d(n,{add:function(){return c},dispose:function(){return y},done:function(){return h},fromExternalJS:function(){return f},load:function(){return p},search:function(){return m},toJS:function(){return d}});var e=r(336),t=(e,t,r)=>new Promise(((n,i)=>{var s=e=>{try{a(r.next(e))}catch(e){i(e)}},o=e=>{try{a(r.throw(e))}catch(e){i(e)}},a=e=>e.done?n(e.value):Promise.resolve(e.value).then(s,o);a((r=r.apply(e,t)).next())}));let i,s,o,a=[];function u(){i=new e.Builder,i.field("title"),i.field("description"),i.ref("ref"),i.pipeline.add(e.trimmer,e.stopWordFilter,e.stemmer),o=new Promise((e=>{s=e}))}e.tokenizer.separator=/\\s+/,u();const l=t=>{const r=e.trimmer(new e.Token(t,{}));return"*"+e.stemmer(r)+"*"};function c(e,t,r){const n=a.push(r)-1,s={title:e.toLowerCase(),description:t.toLowerCase(),ref:n};i.add(s)}function h(){return t(this,null,(function*(){s(i.build())}))}function d(){return t(this,null,(function*(){return{store:a,index:(yield o).toJSON()}}))}function f(e,r){return t(this,null,(function*(){try{if(importScripts(e),!self[r])throw new Error("Broken index file format");p(self[r])}catch(e){console.error("Failed to load search index: "+e.message)}}))}function p(r){return t(this,null,(function*(){a=r.store,s(e.Index.load(r.index))}))}function y(){return t(this,null,(function*(){a=[],u()}))}function m(e,r=0){return t(this,null,(function*(){if(0===e.trim().length)return[];let t=(yield o).query((t=>{e.trim().toLowerCase().split(/\\s+/).forEach((e=>{if(1===e.length)return;const r=l(e);t.term(r,{})}))}));return r>0&&(t=t.slice(0,r)),t.map((e=>({meta:a[e.ref],score:e.score})))}))}addEventListener("message",(function(e){var t,r=e.data,i=r.type,s=r.method,o=r.id,a=r.params;"RPC"===i&&s&&((t=n[s])?Promise.resolve().then((function(){return t.apply(n,a)})):Promise.reject("No such method")).then((function(e){postMessage({type:"RPC",id:o,result:e})})).catch((function(e){var t={message:e};e.stack&&(t.message=e.message,t.stack=e.stack,t.name=e.name),postMessage({type:"RPC",id:o,error:t})}))})),postMessage({type:"RPC",method:"ready"})}()}();\n//# sourceMappingURL=756674defce81e90acea.worker.js.map'])),{name:"[fullhash].worker.js"});return r(e,i),e}},314:function(e){e.exports=function(e,t){var n=0,r={};e.addEventListener("message",(function(t){var n=t.data;if("RPC"===n.type)if(n.id){var i=r[n.id];i&&(delete r[n.id],n.error?i[1](Object.assign(Error(n.error.message),n.error)):i[0](n.result))}else{var o=document.createEvent("Event");o.initEvent(n.method,!1,!1),o.data=n.params,e.dispatchEvent(o)}})),t.forEach((function(t){e[t]=function(){var i=arguments;return new Promise((function(o,s){var a=++n;r[a]=[o,s],e.postMessage({type:"RPC",id:a,method:t,params:[].slice.call(i)})}))}}))}},766:function(e){"use strict";e.exports=n(472)},376:function(e){"use strict";e.exports=n(4445)},322:function(e){"use strict";e.exports=n(5114)},66:function(e){"use strict";e.exports=n(5006)},416:function(e){"use strict";e.exports=void 0},177:function(){},109:function(e){"use strict";e.exports={i8:"7.0.6"}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,exports:{}};return e[n](o,o.exports,r),o.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nc=void 0;var i={};return function(){"use strict";r.r(i),r.d(i,{AUTH_TYPES:function(){return lc},ApiContentWrap:function(){return rd},ApiInfo:function(){return bc},ApiInfoModel:function(){return Yn},ApiLogo:function(){return Oc},AppStore:function(){return dc},ArraySchema:function(){return ml},BackgroundStub:function(){return id},BodyContent:function(){return fu},COMPONENT_REGEXP:function(){return Wn},CallbackModel:function(){return fr},ClipboardService:function(){return qs},ContentItem:function(){return Ap},ContentItems:function(){return _p},DiscriminatorDropdown:function(){return rl},Dropdown:function(){return ds},DropdownLabel:function(){return la},DropdownOrLabel:function(){return ws},DropdownWrapper:function(){return ca},ErrorBoundary:function(){return ie},Example:function(){return oa},ExampleModel:function(){return qr},ExternalExample:function(){return sa},FieldModel:function(){return Yr},GROUP_DEPTH:function(){return Gi},GroupModel:function(){return Fi},HistoryService:function(){return Vt},IS_BROWSER:function(){return a},InvertedSimpleDropdown:function(){return ua},JsonPointer:function(){return Se},JsonViewer:function(){return ea},LEGACY_REGEXP:function(){return Un},Loading:function(){return le},MDX_COMPONENT_REGEXP:function(){return qn},Markdown:function(){return Ls},MarkdownRenderer:function(){return Qn},MarkerService:function(){return Yt},MediaContentModel:function(){return ei},MediaTypeModel:function(){return Xr},MediaTypesSwitch:function(){return nu},MenuBuilder:function(){return Xi},MenuItem:function(){return Dp},MenuItemLabel:function(){return Dc},MenuItemLi:function(){return $c},MenuItemTitle:function(){return Fc},MenuItemUl:function(){return Lc},MenuItems:function(){return Vp},MenuStore:function(){return to},MiddlePanel:function(){return ao},MimeLabel:function(){return aa},NoSampleLabel:function(){return pa},OLD_SECURITY_DEFINITIONS_JSX_NAME:function(){return ht},ObjectSchema:function(){return il},OneOfButton:function(){return El},OneOfSchema:function(){return _l},OpenAPIParser:function(){return _r},Operation:function(){return vp},OperationBadge:function(){return Rc},OperationItem:function(){return Pp},OperationMenuItemContent:function(){return Fp},OperationModel:function(){return yi},OptionsConsumer:function(){return de},OptionsContext:function(){return ue},OptionsProvider:function(){return pe},Parameters:function(){return pu},PayloadSamples:function(){return Xu},Redoc:function(){return fd},RedocAttribution:function(){return Bc},RedocNormalizedOptions:function(){return Q},RedocStandalone:function(){return xd},RedocWrap:function(){return nd},RequestBodyModel:function(){return ti},ResponseDetails:function(){return ju},ResponseHeaders:function(){return ku},ResponseModel:function(){return pi},ResponseSamples:function(){return cp},ResponseTitle:function(){return yu},ResponseView:function(){return Tu},ResponsesList:function(){return Iu},RightPanel:function(){return co},Row:function(){return po},SCHEMA_DEFINITION_JSX_NAME:function(){return mt},SECTION_ATTR:function(){return eo},SECURITY_DEFINITIONS_JSX_NAME:function(){return ft},SECURITY_SCHEMES_SECTION_PREFIX:function(){return gt},Schema:function(){return Ml},SchemaDefinition:function(){return Vl},SchemaModel:function(){return Fr},ScrollService:function(){return oo},SearchBox:function(){return dd},SearchStore:function(){return so},Section:function(){return lo},SectionItem:function(){return Tp},SecurityDefs:function(){return cc},SecuritySchemeModel:function(){return Ai},SecuritySchemesModel:function(){return ji},SideMenu:function(){return Hp},SideNavStyleEnum:function(){return L},SimpleDropdown:function(){return fs},SourceCode:function(){return ta},SourceCodeWithCopy:function(){return na},SpecStore:function(){return Li},StickyResponsiveSidebar:function(){return td},StoreBuilder:function(){return Oo},StoreConsumer:function(){return ko},StoreContext:function(){return xo},StoreProvider:function(){return wo},StyledMarkdownBlock:function(){return Ss},ThemeProvider:function(){return Z},Throttle:function(){return At},alphabeticallyByProp:function(){return zt},appendToMdHeading:function(){return v},argValueToBoolean:function(){return W},buildComponentComment:function(){return Vn},concatRefStacks:function(){return Er},convertSwagger2OpenAPI:function(){return be},createGlobalStyle:function(){return K},createStore:function(){return pc},css:function(){return X},debugTime:function(){return jt},debugTimeEnd:function(){return Tt},detectType:function(){return qe},escapeHTMLAttrChars:function(){return T},expandDefaultServerVariables:function(){return pt},extensionsHook:function(){return ne},extractExtensions:function(){return xt},flattenByProp:function(){return m},getBasePath:function(){return E},getContentWithLegacyExamples:function(){return kt},getDefinitionName:function(){return rt},getOperationSummary:function(){return ze},getSerializedValue:function(){return Ze},getStatusCodeType:function(){return De},highlight:function(){return _t},history:function(){return Qt},html2Str:function(){return c},humanizeConstraints:function(){return st},humanizeNumberRange:function(){return ot},isAbsoluteUrl:function(){return O},isArray:function(){return I},isBoolean:function(){return C},isFormUrlEncoded:function(){return Qe},isJsonLike:function(){return Ve},isNamedDefinition:function(){return nt},isNumeric:function(){return y},isObject:function(){return x},isOperationName:function(){return Be},isPayloadSample:function(){return mi},isPrimitiveType:function(){return We},isRedocExtension:function(){return bt},isStatusCode:function(){return Me},keyframes:function(){return J},langFromMime:function(){return et},loadAndBundleSpec:function(){return ve},mapLang:function(){return Et},mapValues:function(){return h},mapWithLast:function(){return f},media:function(){return ee},memoize:function(){return Bt},menuItemDepth:function(){return Mc},mergeObjects:function(){return b},mergeParams:function(){return ct},mergeSimilarMediaTypes:function(){return ut},normalizeServers:function(){return dt},pluralizeType:function(){return wt},pushRef:function(){return Sr},querySelector:function(){return l},removeQueryStringAndHash:function(){return A},resolveUrl:function(){return S},safeSlugify:function(){return k},scrollIntoViewIfNeeded:function(){return u},serializeParameterValue:function(){return Je},serializeParameterValueWithMime:function(){return Ke},setSecuritySchemePrefix:function(){return yt},shortenHTTPVerb:function(){return vt},sortByField:function(){return lt},sortByRequired:function(){return at},stripTrailingSlash:function(){return g},styled:function(){return te},titleize:function(){return _},unescapeHTMLChars:function(){return P},urlFormEncodePayload:function(){return Xe},useStore:function(){return So}});var e=n(7294),t=n(1303);const o={spacing:{unit:5,sectionHorizontal:({spacing:e})=>8*e.unit,sectionVertical:({spacing:e})=>8*e.unit},breakpoints:{small:"50rem",medium:"75rem",large:"105rem"},colors:{tonalOffset:.2,primary:{main:"#32329f",light:({colors:e})=>(0,t.lighten)(e.tonalOffset,e.primary.main),dark:({colors:e})=>(0,t.darken)(e.tonalOffset,e.primary.main),contrastText:({colors:e})=>(0,t.readableColor)(e.primary.main)},success:{main:"#1d8127",light:({colors:e})=>(0,t.lighten)(2*e.tonalOffset,e.success.main),dark:({colors:e})=>(0,t.darken)(e.tonalOffset,e.success.main),contrastText:({colors:e})=>(0,t.readableColor)(e.success.main)},warning:{main:"#ffa500",light:({colors:e})=>(0,t.lighten)(e.tonalOffset,e.warning.main),dark:({colors:e})=>(0,t.darken)(e.tonalOffset,e.warning.main),contrastText:"#ffffff"},error:{main:"#d41f1c",light:({colors:e})=>(0,t.lighten)(e.tonalOffset,e.error.main),dark:({colors:e})=>(0,t.darken)(e.tonalOffset,e.error.main),contrastText:({colors:e})=>(0,t.readableColor)(e.error.main)},gray:{50:"#FAFAFA",100:"#F5F5F5"},text:{primary:"#333333",secondary:({colors:e})=>(0,t.lighten)(e.tonalOffset,e.text.primary)},border:{dark:"rgba(0,0,0, 0.1)",light:"#ffffff"},responses:{success:{color:({colors:e})=>e.success.main,backgroundColor:({colors:e})=>(0,t.transparentize)(.93,e.success.main),tabTextColor:({colors:e})=>e.responses.success.color},error:{color:({colors:e})=>e.error.main,backgroundColor:({colors:e})=>(0,t.transparentize)(.93,e.error.main),tabTextColor:({colors:e})=>e.responses.error.color},redirect:{color:({colors:e})=>e.warning.main,backgroundColor:({colors:e})=>(0,t.transparentize)(.9,e.responses.redirect.color),tabTextColor:({colors:e})=>e.responses.redirect.color},info:{color:"#87ceeb",backgroundColor:({colors:e})=>(0,t.transparentize)(.9,e.responses.info.color),tabTextColor:({colors:e})=>e.responses.info.color}},http:{get:"#2F8132",post:"#186FAF",put:"#95507c",options:"#947014",patch:"#bf581d",delete:"#cc3333",basic:"#707070",link:"#07818F",head:"#A23DAD"}},schema:{linesColor:e=>(0,t.lighten)(e.colors.tonalOffset,(0,t.desaturate)(e.colors.tonalOffset,e.colors.primary.main)),defaultDetailsWidth:"75%",typeNameColor:e=>e.colors.text.secondary,typeTitleColor:e=>e.schema.typeNameColor,requireLabelColor:e=>e.colors.error.main,labelsTextSize:"0.9em",nestingSpacing:"1em",nestedBackground:"#fafafa",arrow:{size:"1.1em",color:e=>e.colors.text.secondary}},typography:{fontSize:"14px",lineHeight:"1.5em",fontWeightRegular:"400",fontWeightBold:"600",fontWeightLight:"300",fontFamily:"Roboto, sans-serif",smoothing:"antialiased",optimizeSpeed:!0,headings:{fontFamily:"Montserrat, sans-serif",fontWeight:"400",lineHeight:"1.6em"},code:{fontSize:"13px",fontFamily:"Courier, monospace",lineHeight:({typography:e})=>e.lineHeight,fontWeight:({typography:e})=>e.fontWeightRegular,color:"#e53935",backgroundColor:"rgba(38, 50, 56, 0.05)",wrap:!1},links:{color:({colors:e})=>e.primary.main,visited:({typography:e})=>e.links.color,hover:({typography:e})=>(0,t.lighten)(.2,e.links.color),textDecoration:"auto",hoverTextDecoration:"auto"}},sidebar:{width:"260px",backgroundColor:"#fafafa",textColor:"#333333",activeTextColor:e=>e.sidebar.textColor!==o.sidebar.textColor?e.sidebar.textColor:e.colors.primary.main,groupItems:{activeBackgroundColor:e=>(0,t.darken)(.1,e.sidebar.backgroundColor),activeTextColor:e=>e.sidebar.activeTextColor,textTransform:"uppercase"},level1Items:{activeBackgroundColor:e=>(0,t.darken)(.05,e.sidebar.backgroundColor),activeTextColor:e=>e.sidebar.activeTextColor,textTransform:"none"},arrow:{size:"1.5em",color:e=>e.sidebar.textColor}},logo:{maxHeight:({sidebar:e})=>e.width,maxWidth:({sidebar:e})=>e.width,gutter:"2px"},rightPanel:{backgroundColor:"#263238",width:"40%",textColor:"#ffffff",servers:{overlay:{backgroundColor:"#fafafa",textColor:"#263238"},url:{backgroundColor:"#fff"}}},codeBlock:{backgroundColor:({rightPanel:e})=>(0,t.darken)(.1,e.backgroundColor)},fab:{backgroundColor:"#f2f2f2",color:"#0065FB"}};var s=o;const a="undefined"!=typeof window&&"HTMLElement"in window;function l(e){return"undefined"!=typeof document?document.querySelector(e):null}function c(e){return e.split(/<[^>]+>/).map((e=>e.trim())).filter((e=>e.length>0)).join(" ")}function u(e,t=!0){const n=e.parentNode;if(!n)return;const r=window.getComputedStyle(n,void 0),i=parseInt(r.getPropertyValue("border-top-width"),10),o=parseInt(r.getPropertyValue("border-left-width"),10),s=e.offsetTop-n.offsetTop<n.scrollTop,a=e.offsetTop-n.offsetTop+e.clientHeight-i>n.scrollTop+n.clientHeight,l=e.offsetLeft-n.offsetLeft<n.scrollLeft,c=e.offsetLeft-n.offsetLeft+e.clientWidth-o>n.scrollLeft+n.clientWidth,u=s&&!a;(s||a)&&t&&(n.scrollTop=e.offsetTop-n.offsetTop-n.clientHeight/2-i+e.clientHeight/2),(l||c)&&t&&(n.scrollLeft=e.offsetLeft-n.offsetLeft-n.clientWidth/2-o+e.clientWidth/2),(s||a||l||c)&&!t&&e.scrollIntoView(u)}var p=n(1304),d=r.n(p);function f(e,t){const n=[];for(let r=0;r<e.length-1;r++)n.push(t(e[r],!1));return 0!==e.length&&n.push(t(e[e.length-1],!0)),n}function h(e,t){const n={};for(const r in e)e.hasOwnProperty(r)&&(n[r]=t(e[r],r,e));return n}function m(e,t){const n=[],r=e=>{for(const i of e)n.push(i),i[t]&&r(i[t])};return r(e),n}function g(e){return e.endsWith("/")?e.substring(0,e.length-1):e}function y(e){return!isNaN(parseFloat(e))&&isFinite(e)}function v(e,t,n){const r=new RegExp(`(^|\\n)#\\s?${t}\\s*\\n`,"i"),i=new RegExp(`((\\n|^)#\\s*${t}\\s*(\\n|$)(?:.|\\n)*?)(\\n#|$)`,"i");if(r.test(e))return e.replace(i,`$1\n\n${n}\n$4`);{const r=""===e||e.endsWith("\n\n")?"":e.endsWith("\n")?"\n":"\n\n";return`${e}${r}# ${t}\n\n${n}`}}const b=(e,...t)=>{if(!t.length)return e;const n=t.shift();return void 0===n?e:(w(e)&&w(n)&&Object.keys(n).forEach((t=>{w(n[t])?(e[t]||(e[t]={}),b(e[t],n[t])):e[t]=n[t]})),b(e,...t))},x=e=>null!==e&&"object"==typeof e,w=e=>x(e)&&!I(e);function k(e){return d()(e)||e.toString().toLowerCase().replace(/\s+/g,"-").replace(/&/g,"-and-").replace(/\--+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}function O(e){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(e)}function S(e,t){let n;if(t.startsWith("//"))try{n=`${new URL(e).protocol||"https:"}${t}`}catch(e){n=`https:${t}`}else if(O(t))n=t;else if(t.startsWith("/"))try{const r=new URL(e);r.pathname=t,n=r.href}catch(e){n=t}else n=g(e)+"/"+t;return g(n)}function E(e){try{return j(e).pathname}catch(t){return e}}function _(e){return e.charAt(0).toUpperCase()+e.slice(1)}function A(e){try{const t=j(e);return t.search="",t.hash="",t.toString()}catch(t){return e}}function j(e){return"undefined"==typeof URL?new(r(416).URL)(e):new URL(e)}function T(e){return e.replace(/["\\]/g,"\\$&")}function P(e){return e.replace(/&#(\d+);/g,((e,t)=>String.fromCharCode(parseInt(t,10)))).replace(/&/g,"&").replace(/"/g,'"')}function I(e){return Array.isArray(e)}function C(e){return"boolean"==typeof e}const R={enum:"Enum",enumSingleValue:"Value",enumArray:"Items",default:"Default",deprecated:"Deprecated",example:"Example",examples:"Examples",recursive:"Recursive",arrayOf:"Array of ",webhook:"Event",const:"Value",noResultsFound:"No results found",download:"Download",downloadSpecification:"Download OpenAPI specification",responses:"Responses",callbackResponses:"Callback responses",requestSamples:"Request samples",responseSamples:"Response samples"};function N(e,t){const n=R[e];return void 0!==t?n[t]:n}var L=(e=>(e.SummaryOnly="summary-only",e.PathOnly="path-only",e.IdOnly="id-only",e))(L||{}),$=Object.defineProperty,M=Object.defineProperties,D=Object.getOwnPropertyDescriptors,F=Object.getOwnPropertySymbols,B=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable,U=(e,t,n)=>t in e?$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,q=(e,t)=>{for(var n in t||(t={}))B.call(t,n)&&U(e,n,t[n]);if(F)for(var n of F(t))z.call(t,n)&&U(e,n,t[n]);return e};function W(e,t){return void 0===e?t||!1:"string"==typeof e?"false"!==e:e}function V(e){return"string"==typeof e?parseInt(e,10):"number"==typeof e?e:void 0}class Q{static normalizeExpandResponses(e){if("all"===e)return"all";if("string"==typeof e){const t={};return e.split(",").forEach((e=>{t[e.trim()]=!0})),t}return void 0!==e&&console.warn(`expandResponses must be a string but received value "${e}" of type ${typeof e}`),{}}static normalizeHideHostname(e){return!!e}static normalizeScrollYOffset(e){if("string"==typeof e&&!y(e)){const t=l(e);t||console.warn("scrollYOffset value is a selector to non-existing element. Using offset 0 by default");const n=t&&t.getBoundingClientRect().bottom||0;return()=>n}return"number"==typeof e||y(e)?()=>"number"==typeof e?e:parseFloat(e):"function"==typeof e?()=>{const t=e();return"number"!=typeof t&&console.warn(`scrollYOffset should return number but returned value "${t}" of type ${typeof t}`),t}:(void 0!==e&&console.warn("Wrong value for scrollYOffset ReDoc option: should be string, number or function"),()=>0)}static normalizeShowExtensions(e){if(void 0===e)return!1;if(""===e)return!0;if("string"!=typeof e)return e;switch(e){case"true":return!0;case"false":return!1;default:return e.split(",").map((e=>e.trim()))}}static normalizeSideNavStyle(e){const t=L.SummaryOnly;if("string"!=typeof e)return t;switch(e){case t:return e;case L.PathOnly:return L.PathOnly;case L.IdOnly:return L.IdOnly;default:return t}}static normalizePayloadSampleIdx(e){return"number"==typeof e?Math.max(0,e):"string"==typeof e&&isFinite(e)?parseInt(e,10):0}static normalizeJsonSampleExpandLevel(e){return"all"===e?1/0:isNaN(Number(e))?2:Math.ceil(Number(e))}static normalizeGeneratedPayloadSamplesMaxDepth(e){return isNaN(Number(e))?10:Math.max(0,Number(e))}constructor(e,t={}){var n,r,i,o,a;const l=(e=q(q({},t),e)).theme&&e.theme.extensionsHook;var c,u;(null==(n=e.theme)?void 0:n.menu)&&!(null==(r=e.theme)?void 0:r.sidebar)&&(console.warn('Theme setting "menu" is deprecated. Rename to "sidebar"'),e.theme.sidebar=e.theme.menu),(null==(i=e.theme)?void 0:i.codeSample)&&!(null==(o=e.theme)?void 0:o.codeBlock)&&(console.warn('Theme setting "codeSample" is deprecated. Rename to "codeBlock"'),e.theme.codeBlock=e.theme.codeSample),this.theme=function(e){const t={};let n=0;const r=(i,o)=>{Object.keys(i).forEach((s=>{const a=(o?o+".":"")+s,l=i[s];"function"==typeof l?Object.defineProperty(i,s,{get(){if(!t[a]){if(n++,n>1e3)throw new Error(`Theme probably contains circular dependency at ${a}: ${l.toString()}`);t[a]=l(e)}return t[a]},enumerable:!0}):"object"==typeof l&&r(l,a)}))};return r(e,""),JSON.parse(JSON.stringify(e))}(b({},s,(c=q({},e.theme),M(c,D({extensionsHook:void 0}))))),this.theme.extensionsHook=l,u=e.labels,Object.assign(R,u),this.scrollYOffset=Q.normalizeScrollYOffset(e.scrollYOffset),this.hideHostname=Q.normalizeHideHostname(e.hideHostname),this.expandResponses=Q.normalizeExpandResponses(e.expandResponses),this.requiredPropsFirst=W(e.requiredPropsFirst),this.sortPropsAlphabetically=W(e.sortPropsAlphabetically),this.sortEnumValuesAlphabetically=W(e.sortEnumValuesAlphabetically),this.sortOperationsAlphabetically=W(e.sortOperationsAlphabetically),this.sortTagsAlphabetically=W(e.sortTagsAlphabetically),this.nativeScrollbars=W(e.nativeScrollbars),this.pathInMiddlePanel=W(e.pathInMiddlePanel),this.untrustedSpec=W(e.untrustedSpec),this.hideDownloadButton=W(e.hideDownloadButton),this.downloadFileName=e.downloadFileName,this.downloadDefinitionUrl=e.downloadDefinitionUrl,this.disableSearch=W(e.disableSearch),this.onlyRequiredInSamples=W(e.onlyRequiredInSamples),this.showExtensions=Q.normalizeShowExtensions(e.showExtensions),this.sideNavStyle=Q.normalizeSideNavStyle(e.sideNavStyle),this.hideSingleRequestSampleTab=W(e.hideSingleRequestSampleTab),this.hideRequestPayloadSample=W(e.hideRequestPayloadSample),this.menuToggle=W(e.menuToggle,!0),this.jsonSampleExpandLevel=Q.normalizeJsonSampleExpandLevel(e.jsonSampleExpandLevel),this.enumSkipQuotes=W(e.enumSkipQuotes),this.hideSchemaTitles=W(e.hideSchemaTitles),this.simpleOneOfTypeLabel=W(e.simpleOneOfTypeLabel),this.payloadSampleIdx=Q.normalizePayloadSampleIdx(e.payloadSampleIdx),this.expandSingleSchemaField=W(e.expandSingleSchemaField),this.schemaExpansionLevel=function(e,t=0){return"all"===e?1/0:V(e)||t}(e.schemaExpansionLevel),this.showObjectSchemaExamples=W(e.showObjectSchemaExamples),this.showSecuritySchemeType=W(e.showSecuritySchemeType),this.hideSecuritySection=W(e.hideSecuritySection),this.unstable_ignoreMimeParameters=W(e.unstable_ignoreMimeParameters),this.allowedMdComponents=e.allowedMdComponents||{},this.expandDefaultServerVariables=W(e.expandDefaultServerVariables),this.maxDisplayedEnumValues=V(e.maxDisplayedEnumValues);const p=I(e.ignoreNamedSchemas)?e.ignoreNamedSchemas:null==(a=e.ignoreNamedSchemas)?void 0:a.split(",").map((e=>e.trim()));this.ignoreNamedSchemas=new Set(p),this.hideSchemaPattern=W(e.hideSchemaPattern),this.generatedPayloadSamplesMaxDepth=Q.normalizeGeneratedPayloadSamplesMaxDepth(e.generatedPayloadSamplesMaxDepth),this.nonce=e.nonce,this.hideFab=W(e.hideFab),this.minCharacterLengthToInitSearch=V(e.minCharacterLengthToInitSearch)||3,this.showWebhookVerb=W(e.showWebhookVerb)}}var H=n(508),Y=r.n(H);const{default:G,css:X,createGlobalStyle:K,keyframes:J,ThemeProvider:Z}=H,ee={lessThan:(e,t,n)=>(...r)=>X` + @media ${t?"print, ":""} screen and (max-width: ${t=>t.theme.breakpoints[e]}) ${n||""} { + ${X(...r)}; + } + `,greaterThan:e=>(...t)=>X` + @media (min-width: ${t=>t.theme.breakpoints[e]}) { + ${X(...t)}; + } + `,between:(e,t)=>(...n)=>X` + @media (min-width: ${t=>t.theme.breakpoints[e]}) and (max-width: ${e=>e.theme.breakpoints[t]}) { + ${X(...n)}; + } + `};var te=G;function ne(e){return t=>{if(t.theme.extensionsHook)return t.theme.extensionsHook(e,t)}}const re=te.div` + padding: 20px; + color: red; +`;class ie extends e.Component{constructor(e){super(e),this.state={error:void 0}}componentDidCatch(e){return this.setState({error:e}),!1}render(){return this.state.error?e.createElement(re,null,e.createElement("h1",null,"Something went wrong..."),e.createElement("small",null," ",this.state.error.message," "),e.createElement("p",null,e.createElement("details",null,e.createElement("summary",null,"Stack trace"),e.createElement("pre",null,this.state.error.stack))),e.createElement("small",null," ReDoc Version: ","2.1.3")," ",e.createElement("br",null),e.createElement("small",null," Commit: ","b2d8e0f")):e.createElement(e.Fragment,null,e.Children.only(this.props.children))}}const oe=J` + 0% { + transform: rotate(0deg); } + 100% { + transform: rotate(360deg); + } +`,se=te((t=>e.createElement("svg",{className:t.className,version:"1.1",width:"512",height:"512",viewBox:"0 0 512 512"},e.createElement("path",{d:"M275.682 147.999c0 10.864-8.837 19.661-19.682 19.661v0c-10.875 0-19.681-8.796-19.681-19.661v-96.635c0-10.885 8.806-19.661 19.681-19.661v0c10.844 0 19.682 8.776 19.682 19.661v96.635z"}),e.createElement("path",{d:"M275.682 460.615c0 10.865-8.837 19.682-19.682 19.682v0c-10.875 0-19.681-8.817-19.681-19.682v-96.604c0-10.885 8.806-19.681 19.681-19.681v0c10.844 0 19.682 8.796 19.682 19.682v96.604z"}),e.createElement("path",{d:"M147.978 236.339c10.885 0 19.681 8.755 19.681 19.641v0c0 10.885-8.796 19.702-19.681 19.702h-96.624c-10.864 0-19.661-8.817-19.661-19.702v0c0-10.885 8.796-19.641 19.661-19.641h96.624z"}),e.createElement("path",{d:"M460.615 236.339c10.865 0 19.682 8.755 19.682 19.641v0c0 10.885-8.817 19.702-19.682 19.702h-96.584c-10.885 0-19.722-8.817-19.722-19.702v0c0-10.885 8.837-19.641 19.722-19.641h96.584z"}),e.createElement("path",{d:"M193.546 165.703c7.69 7.66 7.68 20.142 0 27.822v0c-7.701 7.701-20.162 7.701-27.853 0.020l-68.311-68.322c-7.68-7.701-7.68-20.142 0-27.863v0c7.68-7.68 20.121-7.68 27.822 0l68.342 68.342z"}),e.createElement("path",{d:"M414.597 386.775c7.7 7.68 7.7 20.163 0.021 27.863v0c-7.7 7.659-20.142 7.659-27.843-0.062l-68.311-68.26c-7.68-7.7-7.68-20.204 0-27.863v0c7.68-7.7 20.163-7.7 27.842 0l68.291 68.322z"}),e.createElement("path",{d:"M165.694 318.464c7.69-7.7 20.153-7.7 27.853 0v0c7.68 7.659 7.69 20.163 0 27.863l-68.342 68.322c-7.67 7.659-20.142 7.659-27.822-0.062v0c-7.68-7.68-7.68-20.122 0-27.801l68.311-68.322z"}),e.createElement("path",{d:"M386.775 97.362c7.7-7.68 20.142-7.68 27.822 0v0c7.7 7.68 7.7 20.183 0.021 27.863l-68.322 68.311c-7.68 7.68-20.163 7.68-27.843-0.020v0c-7.68-7.68-7.68-20.162 0-27.822l68.322-68.332z"}))))` + animation: 2s ${oe} linear infinite; + width: 50px; + height: 50px; + content: ''; + display: inline-block; + margin-left: -25px; + + path { + fill: ${e=>e.color}; + } +`,ae=te.div` + font-family: helvetica, sans; + width: 100%; + text-align: center; + font-size: 25px; + margin: 30px 0 20px 0; + color: ${e=>e.color}; +`;class le extends e.PureComponent{render(){return e.createElement("div",{style:{textAlign:"center"}},e.createElement(ae,{color:this.props.color},"Loading ..."),e.createElement(se,{color:this.props.color}))}}var ce=n(5697);const ue=e.createContext(new Q({})),pe=ue.Provider,de=ue.Consumer;var fe=n(8949),he=n(3675),me=n(3777),ge=r(925),ye=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}));function ve(e){return ye(this,null,(function*(){const t=new me.Config({}),n={config:t,base:a?window.location.href:process.cwd()};a&&(t.resolve.http.customFetch=r.g.fetch),"object"==typeof e&&null!==e?n.doc={source:{absoluteRef:""},parsed:e}:n.ref=e;const{bundle:{parsed:i}}=yield(0,he.bundle)(n);return void 0!==i.swagger?be(i):i}))}function be(e){return console.warn("[ReDoc Compatibility mode]: Converting OpenAPI 2.0 to OpenAPI 3.0"),new Promise(((t,n)=>(0,ge.convertObj)(e,{patch:!0,warnOnly:!0,text:"{}",anchors:!0},((e,r)=>{if(e)return n(e);t(r&&r.openapi)}))))}var xe=n(1851),we=n(6729),ke=n(3573);const Oe=ke.parse;class Se{static baseName(e,t=1){const n=Se.parse(e);return n[n.length-t]}static dirName(e,t=1){const n=Se.parse(e);return ke.compile(n.slice(0,n.length-t))}static relative(e,t){const n=Se.parse(e);return Se.parse(t).slice(n.length)}static parse(e){let t=e;return"#"===t.charAt(0)&&(t=t.substring(1)),Oe(t)}static join(e,t){const n=Se.parse(e).concat(t);return ke.compile(n)}static get(e,t){return ke.get(e,t)}static compile(e){return ke.compile(e)}static escape(e){return ke.escape(e)}}ke.parse=Se.parse,Object.assign(Se,ke);var Ee=r(470),_e=n(3578),Ae=Object.defineProperty,je=Object.defineProperties,Te=Object.getOwnPropertyDescriptors,Pe=Object.getOwnPropertySymbols,Ie=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable,Re=(e,t,n)=>t in e?Ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ne=(e,t)=>{for(var n in t||(t={}))Ie.call(t,n)&&Re(e,n,t[n]);if(Pe)for(var n of Pe(t))Ce.call(t,n)&&Re(e,n,t[n]);return e},Le=(e,t)=>je(e,Te(t));function $e(e){return"string"==typeof e&&/\dxx/i.test(e)}function Me(e){return"default"===e||y(e)||$e(e)}function De(e,t=!1){if("default"===e)return t?"error":"success";let n="string"==typeof e?parseInt(e,10):e;if($e(e)&&(n*=100),n<100||n>599)throw new Error("invalid HTTP code");let r="success";return n>=300&&n<400?r="redirect":n>=400?r="error":n<200&&(r="info"),r}const Fe={get:!0,post:!0,put:!0,head:!0,patch:!0,delete:!0,options:!0,$ref:!0};function Be(e){return e in Fe}function ze(e){return e.summary||e.operationId||e.description&&e.description.substring(0,50)||e.pathName||"<no summary>"}const Ue={multipleOf:"number",maximum:"number",exclusiveMaximum:"number",minimum:"number",exclusiveMinimum:"number",maxLength:"string",minLength:"string",pattern:"string",contentEncoding:"string",contentMediaType:"string",items:"array",maxItems:"array",minItems:"array",uniqueItems:"array",maxProperties:"object",minProperties:"object",required:"object",additionalProperties:"object",unevaluatedProperties:"object",properties:"object",patternProperties:"object"};function qe(e){if(void 0!==e.type&&!I(e.type))return e.type;const t=Object.keys(Ue);for(const n of t){const t=Ue[n];if(void 0!==e[n])return t}return"any"}function We(e,t=e.type){if(e["x-circular-ref"])return!0;if(void 0!==e.oneOf||void 0!==e.anyOf)return!1;if(e.if&&e.then||e.if&&e.else)return!1;let n=!0;const r=I(t);return("object"===t||r&&(null==t?void 0:t.includes("object")))&&(n=void 0!==e.properties?0===Object.keys(e.properties).length:void 0===e.additionalProperties&&void 0===e.unevaluatedProperties&&void 0===e.patternProperties),!I(e.items)&&!I(e.prefixItems)&&(void 0!==e.items&&!C(e.items)&&("array"===t||r&&(null==t?void 0:t.includes("array")))&&(n=We(e.items,e.items.type)),n)}function Ve(e){return-1!==e.search(/json/i)}function Qe(e){return"application/x-www-form-urlencoded"===e}function He(e,t,n){return I(e)?e.map((e=>e.toString())).join(n):"object"==typeof e?Object.keys(e).map((t=>`${t}${n}${e[t]}`)).join(n):t+"="+e.toString()}function Ye(e,t){return I(e)?(console.warn("deepObject style cannot be used with array value:"+e.toString()),""):"object"==typeof e?Object.keys(e).map((n=>`${t}[${n}]=${e[n]}`)).join("&"):(console.warn("deepObject style cannot be used with non-object value:"+e.toString()),"")}function Ge(e,t,n){const r="__redoc_param_name__",i=t?"*":"";return _e.parse(`{?${r}${i}}`).expand({[r]:n}).substring(1).replace(/__redoc_param_name__/g,e)}function Xe(e,t={}){if(I(e))throw new Error("Payload must have fields: "+e.toString());return Object.keys(e).map((n=>{const r=e[n],{style:i="form",explode:o=!0}=t[n]||{};switch(i){case"form":return Ge(n,o,r);case"spaceDelimited":return He(r,n,"%20");case"pipeDelimited":return He(r,n,"|");case"deepObject":return Ye(r,n);default:return console.warn("Incorrect or unsupported encoding style: "+i),""}})).join("&")}function Ke(e,t){return Ve(t)?JSON.stringify(e):(console.warn(`Parameter serialization as ${t} is not supported`),"")}function Je(e,t){const{name:n,style:r,explode:i=!1,serializationMime:o}=e;if(o)switch(e.in){case"path":case"header":return Ke(t,o);case"cookie":case"query":return`${n}=${Ke(t,o)}`;default:return console.warn("Unexpected parameter location: "+e.in),""}if(!r)return console.warn(`Missing style attribute or content for parameter ${n}`),"";switch(e.in){case"path":return function(e,t,n,r){const i=n?"*":"";let o="";"label"===t?o=".":"matrix"===t&&(o=";");const s="__redoc_param_name__";return _e.parse(`{${o}${s}${i}}`).expand({[s]:r}).replace(/__redoc_param_name__/g,e)}(n,r,i,t);case"query":return function(e,t,n,r){switch(t){case"form":return Ge(e,n,r);case"spaceDelimited":return I(r)?n?Ge(e,n,r):`${e}=${r.join("%20")}`:(console.warn("The style spaceDelimited is only applicable to arrays"),"");case"pipeDelimited":return I(r)?n?Ge(e,n,r):`${e}=${r.join("|")}`:(console.warn("The style pipeDelimited is only applicable to arrays"),"");case"deepObject":return!n||I(r)||"object"!=typeof r?(console.warn("The style deepObject is only applicable for objects with explode=true"),""):Ye(r,e);default:return console.warn("Unexpected style for query: "+t),""}}(n,r,i,t);case"header":return function(e,t,n){if("simple"===e){const e=t?"*":"",r="__redoc_param_name__",i=_e.parse(`{${r}${e}}`);return decodeURIComponent(i.expand({[r]:n}))}return console.warn("Unexpected style for header: "+e),""}(r,i,t);case"cookie":return function(e,t,n,r){return"form"===t?Ge(e,n,r):(console.warn("Unexpected style for cookie: "+t),"")}(n,r,i,t);default:return console.warn("Unexpected parameter location: "+e.in),""}}function Ze(e,t){return e.in?decodeURIComponent(Je(e,t)):String(t)}function et(e){return-1!==e.search(/xml/i)?"xml":-1!==e.search(/csv/i)?"csv":-1!==e.search(/plain/i)?"tex":"clike"}const tt=/^#\/components\/(schemas|pathItems)\/([^/]+)$/;function nt(e){return tt.test(e||"")}function rt(e){var t;const[n]=(null==(t=null==e?void 0:e.match(tt))?void 0:t.reverse())||[];return n}function it(e,t,n){let r;return void 0!==t&&void 0!==n?r=t===n?`= ${t} ${e}`:`[ ${t} .. ${n} ] ${e}`:void 0!==n?r=`<= ${n} ${e}`:void 0!==t&&(r=1===t?"non-empty":`>= ${t} ${e}`),r}function ot(e){var t,n;const r="number"==typeof e.exclusiveMinimum?Math.min(e.exclusiveMinimum,null!=(t=e.minimum)?t:1/0):e.minimum,i="number"==typeof e.exclusiveMaximum?Math.max(e.exclusiveMaximum,null!=(n=e.maximum)?n:-1/0):e.maximum,o="number"==typeof e.exclusiveMinimum||e.exclusiveMinimum,s="number"==typeof e.exclusiveMaximum||e.exclusiveMaximum;return void 0!==r&&void 0!==i?`${o?"( ":"[ "}${r} .. ${i}${s?" )":" ]"}`:void 0!==i?`${s?"< ":"<= "}${i}`:void 0!==r?`${o?"> ":">= "}${r}`:void 0}function st(e){const t=[],n=it("characters",e.minLength,e.maxLength);void 0!==n&&t.push(n);const r=it("items",e.minItems,e.maxItems);void 0!==r&&t.push(r);const i=it("properties",e.minProperties,e.maxProperties);void 0!==i&&t.push(i);const o=function(e){if(void 0===e)return;const t=e.toString(10);return/^0\.0*1$/.test(t)?`decimal places <= ${t.split(".")[1].length}`:`multiple of ${t}`}(e.multipleOf);void 0!==o&&t.push(o);const s=ot(e);return void 0!==s&&t.push(s),e.uniqueItems&&t.push("unique"),t}function at(e,t=[]){const n=[],r=[],i=[];return e.forEach((e=>{e.required?t.includes(e.name)?r.push(e):i.push(e):n.push(e)})),r.sort(((e,n)=>t.indexOf(e.name)-t.indexOf(n.name))),[...r,...i,...n]}function lt(e,t){return[...e].sort(((e,n)=>e[t].localeCompare(n[t])))}function ct(e,t=[],n=[]){const r={};return n.forEach((t=>{({resolved:t}=e.deref(t)),r[t.name+"_"+t.in]=!0})),(t=t.filter((t=>(({resolved:t}=e.deref(t)),!r[t.name+"_"+t.in])))).concat(n)}function ut(e){const t={};return Object.keys(e).forEach((n=>{const r=e[n],i=n.split(";")[0].trim();t[i]?t[i]=Ne(Ne({},t[i]),r):t[i]=r})),t}function pt(e,t={}){return e.replace(/(?:{)([\w-.]+)(?:})/g,((e,n)=>t[n]&&t[n].default||e))}function dt(e,t){const n=void 0===e?A((()=>{if(!a)return"";const e=window.location.href;return e.endsWith(".html")?(0,Ee.dirname)(e):e})()):(0,Ee.dirname)(e);return 0===t.length&&(t=[{url:"/"}]),t.map((e=>{return Le(Ne({},e),{url:(t=e.url,S(n,t)),description:e.description||""});var t}))}const ft="SecurityDefinitions",ht="security-definitions",mt="SchemaDefinition";let gt="section/Authentication/";function yt(e){gt=e}const vt=e=>({delete:"del",options:"opts"}[e]||e);function bt(e){return e in{"x-circular-ref":!0,"x-parentRefs":!0,"x-refsStack":!0,"x-code-samples":!0,"x-codeSamples":!0,"x-displayName":!0,"x-examples":!0,"x-ignoredHeaderParameters":!0,"x-logo":!0,"x-nullable":!0,"x-servers":!0,"x-tagGroups":!0,"x-traitTag":!0,"x-additionalPropertiesName":!0,"x-explicitMappingOnly":!0}}function xt(e,t){return Object.keys(e).filter((e=>!0===t?e.startsWith("x-")&&!bt(e):e.startsWith("x-")&&t.indexOf(e)>-1)).reduce(((t,n)=>(t[n]=e[n],t)),{})}function wt(e){return e.split(" or ").map((e=>e.replace(/^(string|object|number|integer|array|boolean)s?( ?.*)/,"$1s$2"))).join(" or ")}function kt(e){let t=e.content;const n=e["x-examples"],r=e["x-example"];if(n){t=Ne({},t);for(const e of Object.keys(n)){const r=n[e];t[e]=Le(Ne({},t[e]),{examples:r})}}else if(r){t=Ne({},t);for(const e of Object.keys(r)){const n=r[e];t[e]=Le(Ne({},t[e]),{example:n})}}return t}var Ot=n(5660);n(7874),n(4279),n(5433),n(6213),n(2731),n(9016),n(7046),n(57),n(2503),n(6841),n(6854),n(4335),n(1426),n(288),n(9945),n(366),n(2939),n(9385),n(2886),n(5266),n(874),n(3358),n(7899);const St="clike";function Et(e){return{json:"js","c++":"cpp","c#":"csharp","objective-c":"objectivec",shell:"bash",viml:"vim"}[e]||St}function _t(e,t=St){t=t.toLowerCase();let n=Ot.languages[t];return n||(n=Ot.languages[Et(t)]),Ot.highlight(e.toString(),n,t)}function At(e){return(t,n,r)=>{r.value=function(e,t){let n,r,i,o=null,s=0;const a=()=>{s=(new Date).getTime(),o=null,i=e.apply(n,r),o||(n=r=null)};return function(){const l=(new Date).getTime(),c=t-(l-s);return n=this,r=arguments,c<=0||c>t?(o&&(clearTimeout(o),o=null),s=l,i=e.apply(n,r),o||(n=r=null)):o||(o=setTimeout(a,c)),i}}(r.value,e)}}function jt(e){}function Tt(e){}Ot.languages.insertBefore("javascript","string",{"property string":{pattern:/([{,]\s*)"(?:\\.|[^\\"\r\n])*"(?=\s*:)/i,lookbehind:!0}},void 0),Ot.languages.insertBefore("javascript","punctuation",{property:{pattern:/([{,]\s*)[a-z]\w*(?=\s*:)/i,lookbehind:!0}},void 0);var Pt=Object.defineProperty,It=Object.defineProperties,Ct=Object.getOwnPropertyDescriptors,Rt=Object.getOwnPropertySymbols,Nt=Object.prototype.hasOwnProperty,Lt=Object.prototype.propertyIsEnumerable,$t=(e,t,n)=>t in e?Pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mt=(e,t)=>{for(var n in t||(t={}))Nt.call(t,n)&&$t(e,n,t[n]);if(Rt)for(var n of Rt(t))Lt.call(t,n)&&$t(e,n,t[n]);return e},Dt=(e,t)=>It(e,Ct(t));const Ft={};function Bt(e,t,n){if("function"==typeof n.value)return function(e,t,n){if(!n.value||n.value.length>0)throw new Error("@memoize decorator can only be applied to methods of zero arguments");const r=`_memoized_${t}`,i=n.value;return e[r]=Ft,Dt(Mt({},n),{value(){return this[r]===Ft&&(this[r]=i.call(this)),this[r]}})}(e,t,n);if("function"==typeof n.get)return function(e,t,n){const r=`_memoized_${t}`,i=n.get;return e[r]=Ft,Dt(Mt({},n),{get(){return this[r]===Ft&&(this[r]=i.call(this)),this[r]}})}(e,t,n);throw new Error("@memoize decorator can be applied to methods or getters, got "+String(n.value)+" instead")}function zt(e){let t=1;return"-"===e[0]&&(t=-1,e=e.substr(1)),(n,r)=>-1==t?r[e].localeCompare(n[e]):n[e].localeCompare(r[e])}var Ut=Object.defineProperty,qt=Object.getOwnPropertyDescriptor;const Wt="hashchange";class Vt{constructor(){this.emit=()=>{this._emiter.emit(Wt,this.currentId)},this._emiter=new we.EventEmitter,this.bind()}get currentId(){return a?decodeURIComponent(window.location.hash.substring(1)):""}linkForId(e){return e?"#"+e:""}subscribe(e){const t=this._emiter.addListener(Wt,e);return()=>t.removeListener(Wt,e)}bind(){a&&window.addEventListener("hashchange",this.emit,!1)}dispose(){a&&window.removeEventListener("hashchange",this.emit)}replace(e,t=!1){a&&null!=e&&e!==this.currentId&&(t?window.history.replaceState(null,"",window.location.href.split("#")[0]+this.linkForId(e)):(window.history.pushState(null,"",window.location.href.split("#")[0]+this.linkForId(e)),this.emit()))}}((e,t,n,r)=>{for(var i,o=qt(t,n),s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(t,n,o)||o);o&&Ut(t,n,o)})([xe.bind,xe.debounce],Vt.prototype,"replace");const Qt=new Vt;var Ht=n(813);class Yt{constructor(){this.map=new Map,this.prevTerm=""}add(e){this.map.set(e,new Ht(e))}delete(e){this.map.delete(e)}addOnly(e){this.map.forEach(((t,n)=>{-1===e.indexOf(n)&&(t.unmark(),this.map.delete(n))}));for(const t of e)this.map.has(t)||this.map.set(t,new Ht(t))}clearAll(){this.unmark(),this.map.clear()}mark(e){(e||this.prevTerm)&&(this.map.forEach((t=>{t.unmark(),t.mark(e||this.prevTerm)})),this.prevTerm=e||this.prevTerm)}unmark(){this.map.forEach((e=>e.unmark())),this.prevTerm=""}}let Gt={baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const Xt=/[&<>"']/,Kt=/[&<>"']/g,Jt=/[<>"']|&(?!#?\w+;)/,Zt=/[<>"']|&(?!#?\w+;)/g,en={"&":"&","<":"<",">":">",'"':""","'":"'"},tn=e=>en[e];function nn(e,t){if(t){if(Xt.test(e))return e.replace(Kt,tn)}else if(Jt.test(e))return e.replace(Zt,tn);return e}const rn=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function on(e){return e.replace(rn,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const sn=/(^|[^\[])\^/g;function an(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(sn,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const ln=/[^\w:]/g,cn=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function un(e,t,n){if(e){let t;try{t=decodeURIComponent(on(n)).replace(ln,"").toLowerCase()}catch(e){return null}if(0===t.indexOf("javascript:")||0===t.indexOf("vbscript:")||0===t.indexOf("data:"))return null}t&&!cn.test(n)&&(n=function(e,t){pn[" "+e]||(dn.test(e)?pn[" "+e]=e+"/":pn[" "+e]=vn(e,"/",!0));const n=-1===(e=pn[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(fn,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(hn,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const pn={},dn=/^[^:]+:\/*[^/]*$/,fn=/^([^:]+:)[\s\S]*$/,hn=/^([^:]+:\/*[^/]*)[\s\S]*$/,mn={exec:function(){}};function gn(e){let t,n,r=1;for(;r<arguments.length;r++)for(n in t=arguments[r],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function yn(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function vn(e,t,n){const r=e.length;if(0===r)return"";let i=0;for(;i<r;){const o=e.charAt(r-i-1);if(o!==t||n){if(o===t||!n)break;i++}else i++}return e.slice(0,r-i)}function bn(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function xn(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function wn(e,t,n,r){const i=t.href,o=t.title?nn(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s,[])};return r.state.inLink=!1,e}return{type:"image",raw:n,href:i,title:o,text:nn(s)}}class kn{constructor(e){this.options=e||Gt}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:vn(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=vn(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}const n={type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:[]};return this.lexer.inline(n.text,n.tokens),n}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(e,[]),text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,i,o,s,a,l,c,u,p,d,f,h=t[1].trim();const m=h.length>1,g={type:"list",raw:"",ordered:m,start:m?+h.slice(0,-1):"",loose:!1,items:[]};h=m?`\\d{1,9}\\${h.slice(-1)}`:`\\${h}`,this.options.pedantic&&(h=m?h:"[*+-]");const y=new RegExp(`^( {0,3}${h})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;e&&(f=!1,t=y.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),c=t[2].split("\n",1)[0],u=e.split("\n",1)[0],this.options.pedantic?(o=2,d=c.trimLeft()):(o=t[2].search(/[^ ]/),o=o>4?1:o,d=c.slice(o),o+=t[1].length),a=!1,!c&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),f=!0),!f){const t=new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,o-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`);for(;e&&(p=e.split("\n",1)[0],c=p,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!t.test(c))&&!r.test(e);){if(c.search(/[^ ]/)>=o||!c.trim())d+="\n"+c.slice(o);else{if(a)break;d+="\n"+c}a||c.trim()||(a=!0),n+=p+"\n",e=e.substring(p.length+1)}}g.loose||(l?g.loose=!0:/\n *\n *$/.test(n)&&(l=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(d),r&&(i="[ ] "!==r[0],d=d.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:n,task:!!r,checked:i,loose:!1,text:d}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=d.trimRight(),g.raw=g.raw.trimRight();const v=g.items.length;for(s=0;s<v;s++){this.lexer.state.top=!1,g.items[s].tokens=this.lexer.blockTokens(g.items[s].text,[]);const e=g.items[s].tokens.filter((e=>"space"===e.type)),t=e.every((e=>{const t=e.raw.split("");let n=0;for(const r of t)if("\n"===r&&(n+=1),n>1)return!0;return!1}));!g.loose&&e.length&&t&&(g.loose=!0,g.items[s].loose=!0)}return g}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};return this.options.sanitize&&(e.type="paragraph",e.text=this.options.sanitizer?this.options.sanitizer(t[0]):nn(t[0]),e.tokens=[],this.lexer.inline(e.text,e.tokens)),e}}def(e){const t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:yn(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,i,o,s=e.align.length;for(n=0;n<s;n++)/^ *-+: *$/.test(e.align[n])?e.align[n]="right":/^ *:-+: *$/.test(e.align[n])?e.align[n]="center":/^ *:-+ *$/.test(e.align[n])?e.align[n]="left":e.align[n]=null;for(s=e.rows.length,n=0;n<s;n++)e.rows[n]=yn(e.rows[n],e.header.length).map((e=>({text:e})));for(s=e.header.length,r=0;r<s;r++)e.header[r].tokens=[],this.lexer.inlineTokens(e.header[r].text,e.header[r].tokens);for(s=e.rows.length,r=0;r<s;r++)for(o=e.rows[r],i=0;i<o.length;i++)o[i].tokens=[],this.lexer.inlineTokens(o[i].text,o[i].tokens);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t){const e={type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e={type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}text(e){const t=this.rules.block.text.exec(e);if(t){const e={type:"text",raw:t[0],text:t[0],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:nn(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):nn(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=vn(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,i=0;for(;i<n;i++)if("\\"===e[i])i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),wn(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return wn(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const i=r[1]||r[2]||"";if(!i||i&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let i,o,s=n,a=0;const l="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(o=i.length,r[3]||r[4]){s+=o;continue}if((r[5]||r[6])&&n%3&&!((n+o)%3)){a+=o;continue}if(s-=o,s>0)continue;if(o=Math.min(o,o+s+a),Math.min(n,o)%2){const t=e.slice(1,n+r.index+o);return{type:"em",raw:e.slice(0,n+r.index+o+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}const t=e.slice(2,n+r.index+o-1);return{type:"strong",raw:e.slice(0,n+r.index+o+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=nn(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2],[])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=nn(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=nn(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=nn(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=nn(n[0]),r="www."===n[1]?"http://"+e:e}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):nn(n[0]):n[0]:nn(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const On={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?<?([^\s>]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:mn,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};On.def=an(On.def).replace("label",On._label).replace("title",On._title).getRegex(),On.bullet=/(?:[*+-]|\d{1,9}[.)])/,On.listItemStart=an(/^( *)(bull) */).replace("bull",On.bullet).getRegex(),On.list=an(On.list).replace(/bull/g,On.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+On.def.source+")").getRegex(),On._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",On._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,On.html=an(On.html,"i").replace("comment",On._comment).replace("tag",On._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),On.paragraph=an(On._paragraph).replace("hr",On.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",On._tag).getRegex(),On.blockquote=an(On.blockquote).replace("paragraph",On.paragraph).getRegex(),On.normal=gn({},On),On.gfm=gn({},On.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),On.gfm.table=an(On.gfm.table).replace("hr",On.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",On._tag).getRegex(),On.gfm.paragraph=an(On._paragraph).replace("hr",On.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",On.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",On._tag).getRegex(),On.pedantic=gn({},On.normal,{html:an("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",On._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:mn,paragraph:an(On.normal._paragraph).replace("hr",On.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",On.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const Sn={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:mn,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:mn,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function En(e){return e.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201c").replace(/"/g,"\u201d").replace(/\.{3}/g,"\u2026")}function _n(e){let t,n,r="";const i=e.length;for(t=0;t<i;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}Sn._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Sn.punctuation=an(Sn.punctuation).replace(/punctuation/g,Sn._punctuation).getRegex(),Sn.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Sn.escapedEmSt=/\\\*|\\_/g,Sn._comment=an(On._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Sn.emStrong.lDelim=an(Sn.emStrong.lDelim).replace(/punct/g,Sn._punctuation).getRegex(),Sn.emStrong.rDelimAst=an(Sn.emStrong.rDelimAst,"g").replace(/punct/g,Sn._punctuation).getRegex(),Sn.emStrong.rDelimUnd=an(Sn.emStrong.rDelimUnd,"g").replace(/punct/g,Sn._punctuation).getRegex(),Sn._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Sn._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Sn._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Sn.autolink=an(Sn.autolink).replace("scheme",Sn._scheme).replace("email",Sn._email).getRegex(),Sn._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Sn.tag=an(Sn.tag).replace("comment",Sn._comment).replace("attribute",Sn._attribute).getRegex(),Sn._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Sn._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Sn._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Sn.link=an(Sn.link).replace("label",Sn._label).replace("href",Sn._href).replace("title",Sn._title).getRegex(),Sn.reflink=an(Sn.reflink).replace("label",Sn._label).replace("ref",On._label).getRegex(),Sn.nolink=an(Sn.nolink).replace("ref",On._label).getRegex(),Sn.reflinkSearch=an(Sn.reflinkSearch,"g").replace("reflink",Sn.reflink).replace("nolink",Sn.nolink).getRegex(),Sn.normal=gn({},Sn),Sn.pedantic=gn({},Sn.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:an(/^!?\[(label)\]\((.*?)\)/).replace("label",Sn._label).getRegex(),reflink:an(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Sn._label).getRegex()}),Sn.gfm=gn({},Sn.normal,{escape:an(Sn.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),Sn.gfm.url=an(Sn.gfm.url,"i").replace("email",Sn.gfm._extended_email).getRegex(),Sn.breaks=gn({},Sn.gfm,{br:an(Sn.br).replace("{2,}","*").getRegex(),text:an(Sn.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});class An{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Gt,this.options.tokenizer=this.options.tokenizer||new kn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:On.normal,inline:Sn.normal};this.options.pedantic?(t.block=On.pedantic,t.inline=Sn.pedantic):this.options.gfm&&(t.block=On.gfm,this.options.breaks?t.inline=Sn.breaks:t.inline=Sn.gfm),this.tokenizer.rules=t}static get rules(){return{block:On,inline:Sn}}static lex(e,t){return new An(t).lex(e)}static lexInline(e,t){return new An(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,i,o;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(i=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i)))r=t[t.length-1],o&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),o=i.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t){this.inlineQueue.push({src:e,tokens:t})}inlineTokens(e,t=[]){let n,r,i,o,s,a,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,o.index)+"["+xn("a",o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,o.index)+"["+xn("a",o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,o.index)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(s||(a=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,l,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,_n))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,_n))){if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(i,En))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),s=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class jn{constructor(e){this.options=e||Gt}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="'+this.options.langPrefix+nn(r,!0)+'">'+(n?e:nn(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:nn(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e){return e}heading(e,t,n,r){return this.options.headerIds?`<h${t} id="${this.options.headerPrefix+r.slug(n)}">${e}</h${t}>\n`:`<h${t}>${e}</h${t}>\n`}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){if(null===(e=un(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+nn(e)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){if(null===(e=un(this.options.sanitize,this.options.baseUrl,e)))return n;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${t}"`),r+=this.options.xhtml?"/>":">",r}text(e){return e}}class Tn{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class Pn{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class In{constructor(e){this.options=e||Gt,this.options.renderer=this.options.renderer||new jn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Tn,this.slugger=new Pn}static parse(e,t){return new In(t).parse(e)}static parseInline(e,t){return new In(t).parseInline(e)}parse(e,t=!0){let n,r,i,o,s,a,l,c,u,p,d,f,h,m,g,y,v,b,x,w="";const k=e.length;for(n=0;n<k;n++)if(p=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[p.type]&&(x=this.options.extensions.renderers[p.type].call({parser:this},p),!1!==x||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(p.type)))w+=x||"";else switch(p.type){case"space":continue;case"hr":w+=this.renderer.hr();continue;case"heading":w+=this.renderer.heading(this.parseInline(p.tokens),p.depth,on(this.parseInline(p.tokens,this.textRenderer)),this.slugger);continue;case"code":w+=this.renderer.code(p.text,p.lang,p.escaped);continue;case"table":for(c="",l="",o=p.header.length,r=0;r<o;r++)l+=this.renderer.tablecell(this.parseInline(p.header[r].tokens),{header:!0,align:p.align[r]});for(c+=this.renderer.tablerow(l),u="",o=p.rows.length,r=0;r<o;r++){for(a=p.rows[r],l="",s=a.length,i=0;i<s;i++)l+=this.renderer.tablecell(this.parseInline(a[i].tokens),{header:!1,align:p.align[i]});u+=this.renderer.tablerow(l)}w+=this.renderer.table(c,u);continue;case"blockquote":u=this.parse(p.tokens),w+=this.renderer.blockquote(u);continue;case"list":for(d=p.ordered,f=p.start,h=p.loose,o=p.items.length,u="",r=0;r<o;r++)g=p.items[r],y=g.checked,v=g.task,m="",g.task&&(b=this.renderer.checkbox(y),h?g.tokens.length>0&&"paragraph"===g.tokens[0].type?(g.tokens[0].text=b+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=b+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:b}):m+=b),m+=this.parse(g.tokens,h),u+=this.renderer.listitem(m,v,y);w+=this.renderer.list(u,d,f);continue;case"html":w+=this.renderer.html(p.text);continue;case"paragraph":w+=this.renderer.paragraph(this.parseInline(p.tokens));continue;case"text":for(u=p.tokens?this.parseInline(p.tokens):p.text;n+1<k&&"text"===e[n+1].type;)p=e[++n],u+="\n"+(p.tokens?this.parseInline(p.tokens):p.text);w+=t?this.renderer.paragraph(u):u;continue;default:{const e='Token with "'+p.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return w}parseInline(e,t){t=t||this.renderer;let n,r,i,o="";const s=e.length;for(n=0;n<s;n++)if(r=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]&&(i=this.options.extensions.renderers[r.type].call({parser:this},r),!1!==i||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)))o+=i||"";else switch(r.type){case"escape":case"text":o+=t.text(r.text);break;case"html":o+=t.html(r.text);break;case"link":o+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":o+=t.image(r.href,r.title,r.text);break;case"strong":o+=t.strong(this.parseInline(r.tokens,t));break;case"em":o+=t.em(this.parseInline(r.tokens,t));break;case"codespan":o+=t.codespan(r.text);break;case"br":o+=t.br();break;case"del":o+=t.del(this.parseInline(r.tokens,t));break;default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return o}}function Cn(e,t,n){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(n=t,t=null),bn(t=gn({},Cn.defaults,t||{})),n){const r=t.highlight;let i;try{i=An.lex(e,t)}catch(e){return n(e)}const o=function(e){let o;if(!e)try{t.walkTokens&&Cn.walkTokens(i,t.walkTokens),o=In.parse(i,t)}catch(t){e=t}return t.highlight=r,e?n(e):n(null,o)};if(!r||r.length<3)return o();if(delete t.highlight,!i.length)return o();let s=0;return Cn.walkTokens(i,(function(e){"code"===e.type&&(s++,setTimeout((()=>{r(e.text,e.lang,(function(t,n){if(t)return o(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),s--,0===s&&o()}))}),0))})),void(0===s&&o())}try{const n=An.lex(e,t);return t.walkTokens&&Cn.walkTokens(n,t.walkTokens),In.parse(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+nn(e.message+"",!0)+"</pre>";throw e}}Cn.options=Cn.setOptions=function(e){var t;return gn(Cn.defaults,e),t=Cn.defaults,Gt=t,Cn},Cn.getDefaults=function(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}},Cn.defaults=Gt,Cn.use=function(...e){const t=gn({},...e),n=Cn.defaults.extensions||{renderers:{},childTokens:{}};let r;e.forEach((e=>{if(e.extensions&&(r=!0,e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=n.renderers?n.renderers[e.name]:null;n.renderers[e.name]=t?function(...n){let r=e.renderer.apply(this,n);return!1===r&&(r=t.apply(this,n)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&("block"===e.level?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:"inline"===e.level&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)}))),e.renderer){const n=Cn.defaults.renderer||new jn;for(const t in e.renderer){const r=n[t];n[t]=(...i)=>{let o=e.renderer[t].apply(n,i);return!1===o&&(o=r.apply(n,i)),o}}t.renderer=n}if(e.tokenizer){const n=Cn.defaults.tokenizer||new kn;for(const t in e.tokenizer){const r=n[t];n[t]=(...i)=>{let o=e.tokenizer[t].apply(n,i);return!1===o&&(o=r.apply(n,i)),o}}t.tokenizer=n}if(e.walkTokens){const n=Cn.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens.call(this,t),n&&n.call(this,t)}}r&&(t.extensions=n),Cn.setOptions(t)}))},Cn.walkTokens=function(e,t){for(const n of e)switch(t.call(Cn,n),n.type){case"table":for(const e of n.header)Cn.walkTokens(e.tokens,t);for(const e of n.rows)for(const n of e)Cn.walkTokens(n.tokens,t);break;case"list":Cn.walkTokens(n.items,t);break;default:Cn.defaults.extensions&&Cn.defaults.extensions.childTokens&&Cn.defaults.extensions.childTokens[n.type]?Cn.defaults.extensions.childTokens[n.type].forEach((function(e){Cn.walkTokens(n[e],t)})):n.tokens&&Cn.walkTokens(n.tokens,t)}},Cn.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");bn(t=gn({},Cn.defaults,t||{}));try{const n=An.lexInline(e,t);return t.walkTokens&&Cn.walkTokens(n,t.walkTokens),In.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+nn(e.message+"",!0)+"</pre>";throw e}},Cn.Parser=In,Cn.parser=In.parse,Cn.Renderer=jn,Cn.TextRenderer=Tn,Cn.Lexer=An,Cn.lexer=An.lex,Cn.Tokenizer=kn,Cn.Slugger=Pn,Cn.parse=Cn,Cn.options,Cn.setOptions,Cn.use,Cn.walkTokens,Cn.parseInline,In.parse,An.lex;var Rn=Object.defineProperty,Nn=Object.defineProperties,Ln=Object.getOwnPropertyDescriptors,$n=Object.getOwnPropertySymbols,Mn=Object.prototype.hasOwnProperty,Dn=Object.prototype.propertyIsEnumerable,Fn=(e,t,n)=>t in e?Rn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bn=(e,t)=>{for(var n in t||(t={}))Mn.call(t,n)&&Fn(e,n,t[n]);if($n)for(var n of $n(t))Dn.call(t,n)&&Fn(e,n,t[n]);return e};const zn=new Cn.Renderer;Cn.setOptions({renderer:zn,highlight:(e,t)=>_t(e,t)});const Un="^ {0,3}\x3c!-- ReDoc-Inject:\\s+?<({component}).*?/?>\\s+?--\x3e\\s*$",qn="(?:^ {0,3}<({component})([\\s\\S]*?)>([\\s\\S]*?)</\\2>|^ {0,3}<({component})([\\s\\S]*?)(?:/>|\\n{2,}))",Wn="(?:"+Un+"|"+qn+")";function Vn(e){return`\x3c!-- ReDoc-Inject: <${e}> --\x3e`}class Qn{constructor(e,t){this.options=e,this.parentId=t,this.headings=[],this.headingRule=(e,t,n,r)=>(1===t?this.currentTopHeading=this.saveHeading(e,t):2===t&&this.saveHeading(e,t,this.currentTopHeading&&this.currentTopHeading.items,this.currentTopHeading&&this.currentTopHeading.id),this.originalHeadingRule(e,t,n,r)),this.parentId=t,this.parser=new Cn.Parser,this.headingEnhanceRenderer=new Cn.Renderer,this.originalHeadingRule=this.headingEnhanceRenderer.heading.bind(this.headingEnhanceRenderer),this.headingEnhanceRenderer.heading=this.headingRule}static containsComponent(e,t){return new RegExp(Wn.replace(/{component}/g,t),"gmi").test(e)}static getTextBeforeHading(e,t){const n=e.search(new RegExp(`^##?\\s+${t}`,"m"));return n>-1?e.substring(0,n):e}saveHeading(e,t,n=this.headings,r){e=P(e);const i={id:r?`${r}/${k(e)}`:`${this.parentId||"section"}/${k(e)}`,name:e,level:t,items:[]};return n.push(i),i}flattenHeadings(e){if(void 0===e)return[];const t=[];for(const n of e)t.push(n),t.push(...this.flattenHeadings(n.items));return t}attachHeadingsDescriptions(e){const t=e=>new RegExp(`##?\\s+${e.name.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}s*(\n|\r\n|$|s*)`),n=this.flattenHeadings(this.headings);if(n.length<1)return;let r=n[0],i=t(r),o=e.search(i);for(let s=1;s<n.length;s++){const a=n[s],l=t(a),c=e.substr(o+1).search(l)+o+1;r.description=e.substring(o,c).replace(i,"").trim(),r=a,i=l,o=c}r.description=e.substring(o).replace(i,"").trim()}renderMd(e,t=!1){const n=t?{renderer:this.headingEnhanceRenderer}:void 0;return Cn(e.toString(),n)}extractHeadings(e){this.renderMd(e,!0),this.attachHeadingsDescriptions(e);const t=this.headings;return this.headings=[],t}renderMdWithComponents(e){const t=this.options&&this.options.allowedMdComponents;if(!t||0===Object.keys(t).length)return[this.renderMd(e)];const n=Object.keys(t).join("|"),r=new RegExp(Wn.replace(/{component}/g,n),"mig"),i=[],o=[];let s=r.exec(e),a=0;for(;s;){i.push(e.substring(a,s.index)),a=r.lastIndex;const n=t[s[1]||s[2]||s[5]],u=s[3]||s[6],p=s[4];n&&o.push({component:n.component,propsSelector:n.propsSelector,props:(l=Bn(Bn({},Hn(u)),n.props),c={children:p},Nn(l,Ln(c)))}),s=r.exec(e)}var l,c;i.push(e.substring(a));const u=[];for(let p=0;p<i.length;p++){const e=i[p];e&&u.push(this.renderMd(e)),o[p]&&u.push(o[p])}return u}}function Hn(e){if(!e)return{};const t=/([\w-]+)\s*=\s*(?:{([^}]+?)}|"([^"]+?)")/gim,n={};let r;for(;null!==(r=t.exec(e));)if(r[3])n[r[1]]=r[3];else if(r[2]){let t;try{t=JSON.parse(r[2])}catch(e){}n[r[1]]=t}return n}class Yn{constructor(e,t=new Q({})){this.parser=e,this.options=t,Object.assign(this,e.spec.info),this.description=e.spec.info.description||"",this.summary=e.spec.info.summary||"";const n=this.description.search(/^\s*##?\s+/m);n>-1&&(this.description=this.description.substring(0,n)),this.downloadLink=this.getDownloadLink(),this.downloadFileName=this.getDownloadFileName()}getDownloadLink(){if(this.options.downloadDefinitionUrl)return this.options.downloadDefinitionUrl;if(this.parser.specUrl)return this.parser.specUrl;if(a&&window.Blob&&window.URL&&window.URL.createObjectURL){const e=new Blob([JSON.stringify(this.parser.spec,null,2)],{type:"application/json"});return window.URL.createObjectURL(e)}}getDownloadFileName(){return this.parser.specUrl||this.options.downloadDefinitionUrl?this.options.downloadFileName:this.options.downloadFileName||"openapi.json"}}var Gn=Object.defineProperty,Xn=Object.defineProperties,Kn=Object.getOwnPropertyDescriptors,Jn=Object.getOwnPropertySymbols,Zn=Object.prototype.hasOwnProperty,er=Object.prototype.propertyIsEnumerable,tr=(e,t,n)=>t in e?Gn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;class nr{constructor(e,t){const n=t.spec.components&&t.spec.components.securitySchemes||{};this.schemes=Object.keys(e||{}).map((r=>{const{resolved:i}=t.deref(n[r]),o=e[r]||[];if(!i)return void console.warn(`Non existing security scheme referenced: ${r}. Skipping`);const s=i["x-displayName"]||r;return a=((e,t)=>{for(var n in t||(t={}))Zn.call(t,n)&&tr(e,n,t[n]);if(Jn)for(var n of Jn(t))er.call(t,n)&&tr(e,n,t[n]);return e})({},i),Xn(a,Kn({id:r,sectionId:r,displayName:s,scopes:o}));var a})).filter((e=>void 0!==e))}}var rr=Object.defineProperty,ir=Object.defineProperties,or=Object.getOwnPropertyDescriptor,sr=Object.getOwnPropertyDescriptors,ar=Object.getOwnPropertySymbols,lr=Object.prototype.hasOwnProperty,cr=Object.prototype.propertyIsEnumerable,ur=(e,t,n)=>t in e?rr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pr=(e,t)=>{for(var n in t||(t={}))lr.call(t,n)&&ur(e,n,t[n]);if(ar)for(var n of ar(t))cr.call(t,n)&&ur(e,n,t[n]);return e},dr=(e,t,n,r)=>{for(var i,o=r>1?void 0:r?or(t,n):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&rr(t,n,o),o};class fr{constructor(e,t,n,r,i){this.expanded=!1,this.operations=[],(0,fe.makeObservable)(this),this.name=t;const{resolved:o}=e.deref(n);for(const l of Object.keys(o)){const n=o[l],c=Object.keys(n).filter(Be);for(const o of c){const c=n[o],u=new yi(e,(s=pr({},c),a={pathName:l,pointer:Se.compile([r,t,l,o]),httpVerb:o,pathParameters:n.parameters||[],pathServers:n.servers},ir(s,sr(a))),void 0,i,!0);this.operations.push(u)}}var s,a}toggle(){this.expanded=!this.expanded}}dr([fe.observable],fr.prototype,"expanded",2),dr([fe.action],fr.prototype,"toggle",1);var hr=Object.defineProperty,mr=Object.defineProperties,gr=Object.getOwnPropertyDescriptors,yr=Object.getOwnPropertySymbols,vr=Object.prototype.hasOwnProperty,br=Object.prototype.propertyIsEnumerable,xr=(e,t,n)=>t in e?hr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wr=(e,t)=>{for(var n in t||(t={}))vr.call(t,n)&&xr(e,n,t[n]);if(yr)for(var n of yr(t))br.call(t,n)&&xr(e,n,t[n]);return e},kr=(e,t)=>mr(e,gr(t)),Or=(e,t)=>{var n={};for(var r in e)vr.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&yr)for(var r of yr(e))t.indexOf(r)<0&&br.call(e,r)&&(n[r]=e[r]);return n};function Sr(e,t){return t&&e[e.length-1]!==t?[...e,t]:e}function Er(e,t){return t?e.concat(t):e}class _r{constructor(e,t,n=new Q({})){this.options=n,this.allowMergeRefs=!1,this.byRef=e=>{let t;if(this.spec){"#"!==e.charAt(0)&&(e="#"+e),e=decodeURIComponent(e);try{t=Se.get(this.spec,e)}catch(e){}return t||{}}},this.validate(e),this.spec=e,this.allowMergeRefs=e.openapi.startsWith("3.1");const r=a?window.location.href:"";"string"==typeof t&&(this.specUrl=r?new URL(t,r).href:t)}validate(e){if(void 0===e.openapi)throw new Error("Document must be valid OpenAPI 3.0.0 definition")}isRef(e){return!!e&&void 0!==e.$ref&&null!==e.$ref}deref(e,t=[],n=!1){const r=null==e?void 0:e["x-refsStack"];if(t=Er(t,r),this.isRef(e)){const r=rt(e.$ref);if(r&&this.options.ignoreNamedSchemas.has(r))return{resolved:{type:"object",title:r},refsStack:t};let i=this.byRef(e.$ref);if(!i)throw new Error(`Failed to resolve $ref "${e.$ref}"`);let o=t;if(t.includes(e.$ref)||t.length>999)i=Object.assign({},i,{"x-circular-ref":!0});else if(this.isRef(i)){const e=this.deref(i,t,n);o=e.refsStack,i=e.resolved}return o=Sr(t,e.$ref),i=this.allowMergeRefs?this.mergeRefs(e,i,n):i,{resolved:i,refsStack:o}}return{resolved:e,refsStack:Er(t,r)}}mergeRefs(e,t,n){const r=e,{$ref:i}=r,o=Or(r,["$ref"]),s=Object.keys(o);if(0===s.length)return t;if(n&&s.some((e=>!["description","title","externalDocs","x-refsStack","x-parentRefs","readOnly","writeOnly"].includes(e)))){const e=o,{description:n,title:r,readOnly:i,writeOnly:s}=e;return{allOf:[{description:n,title:r,readOnly:i,writeOnly:s},t,Or(e,["description","title","readOnly","writeOnly"])]}}return wr(wr({},t),o)}mergeAllOf(e,t,n){var r;if(e["x-circular-ref"])return e;if(void 0===(e=this.hoistOneOfs(e,n)).allOf)return e;let i=kr(wr({},e),{"x-parentRefs":[],allOf:void 0,title:e.title||rt(t)});void 0!==i.properties&&"object"==typeof i.properties&&(i.properties=wr({},i.properties)),void 0!==i.items&&"object"==typeof i.items&&(i.items=wr({},i.items));const o=function(e,t){const n=new Set;return e.filter((e=>{const t=e.$ref;return!t||t&&!n.has(t)&&n.add(t)}))}(e.allOf.map((e=>{var t;const{resolved:r,refsStack:o}=this.deref(e,n,!0),s=e.$ref||void 0,a=this.mergeAllOf(r,s,o);if(!a["x-circular-ref"]||!a.allOf)return s&&(null==(t=i["x-parentRefs"])||t.push(...a["x-parentRefs"]||[],s)),{$ref:s,refsStack:Sr(o,s),schema:a}})).filter((e=>void 0!==e)));for(const{schema:s,refsStack:a}of o){const e=s,{type:n,enum:o,properties:l,items:c,required:u,title:p,description:d,readOnly:f,writeOnly:h,oneOf:m,anyOf:g,"x-circular-ref":y}=e,v=Or(e,["type","enum","properties","items","required","title","description","readOnly","writeOnly","oneOf","anyOf","x-circular-ref"]);if(i.type!==n&&void 0!==i.type&&void 0!==n&&console.warn(`Incompatible types in allOf at "${t}": "${i.type}" and "${n}"`),void 0!==n&&(Array.isArray(n)&&Array.isArray(i.type)?i.type=[...n,...i.type]:i.type=n),void 0!==o&&(Array.isArray(o)&&Array.isArray(i.enum)?i.enum=Array.from(new Set([...o,...i.enum])):i.enum=o),void 0!==l&&"object"==typeof l){i.properties=i.properties||{};for(const e in l){const n=Er(a,null==(r=l[e])?void 0:r["x-refsStack"]);if(i.properties[e]){if(!y){const r=this.mergeAllOf({allOf:[i.properties[e],kr(wr({},l[e]),{"x-refsStack":n})],"x-refsStack":n},t+"/properties/"+e,n);i.properties[e]=r}}else i.properties[e]=kr(wr({},l[e]),{"x-refsStack":n})}}if(void 0!==c&&!y){const e="boolean"==typeof i.items?{}:Object.assign({},i.items),n="boolean"==typeof s.items?{}:Object.assign({},s.items);i.items=this.mergeAllOf({allOf:[e,n]},t+"/items",a)}void 0!==m&&(i.oneOf=m),void 0!==g&&(i.anyOf=g),void 0!==u&&(i.required=[...i.required||[],...u]),i=wr(kr(wr({},i),{title:i.title||p,description:i.description||d,readOnly:void 0!==i.readOnly?i.readOnly:f,writeOnly:void 0!==i.writeOnly?i.writeOnly:h,"x-circular-ref":i["x-circular-ref"]||y}),v)}return i}findDerived(e){const t={},n=this.spec.components&&this.spec.components.schemas||{};for(const r in n){const{resolved:i}=this.deref(n[r]);void 0!==i.allOf&&i.allOf.find((t=>void 0!==t.$ref&&e.indexOf(t.$ref)>-1))&&(t["#/components/schemas/"+r]=[i["x-discriminator-value"]||r])}return t}hoistOneOfs(e,t){if(void 0===e.allOf)return e;const n=e.allOf;for(let r=0;r<n.length;r++){const e=n[r];if(Array.isArray(e.oneOf)){const i=n.slice(0,r),o=n.slice(r+1);return{oneOf:e.oneOf.map((e=>({allOf:[...i,e,...o],"x-refsStack":t})))}}}return e}}var Ar=Object.defineProperty,jr=Object.defineProperties,Tr=Object.getOwnPropertyDescriptor,Pr=Object.getOwnPropertyDescriptors,Ir=Object.getOwnPropertySymbols,Cr=Object.prototype.hasOwnProperty,Rr=Object.prototype.propertyIsEnumerable,Nr=(e,t,n)=>t in e?Ar(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Lr=(e,t)=>{for(var n in t||(t={}))Cr.call(t,n)&&Nr(e,n,t[n]);if(Ir)for(var n of Ir(t))Rr.call(t,n)&&Nr(e,n,t[n]);return e},$r=(e,t)=>jr(e,Pr(t)),Mr=(e,t,n,r)=>{for(var i,o=r>1?void 0:r?Tr(t,n):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Ar(t,n,o),o};const Dr=class{constructor(e,t,n,r,i=!1,o=[]){this.options=r,this.refsStack=o,this.typePrefix="",this.isCircular=!1,this.activeOneOf=0,(0,fe.makeObservable)(this),this.pointer=t.$ref||n||"";const{resolved:s,refsStack:a}=e.deref(t,o,!0);this.refsStack=Sr(a,this.pointer),this.rawSchema=s,this.schema=e.mergeAllOf(this.rawSchema,this.pointer,this.refsStack),this.init(e,i),r.showExtensions&&(this.extensions=xt(this.schema,r.showExtensions))}activateOneOf(e){this.activeOneOf=e}hasType(e){return this.type===e||I(this.type)&&this.type.includes(e)}init(e,t){var n,r,i,o,s,a,l,c;const u=this.schema;if(this.isCircular=!!u["x-circular-ref"],this.title=u.title||nt(this.pointer)&&Se.baseName(this.pointer)||"",this.description=u.description||"",this.type=u.type||qe(u),this.format=u.format,this.enum=u.enum||[],this.example=u.example,this.examples=u.examples,this.deprecated=!!u.deprecated,this.pattern=u.pattern,this.externalDocs=u.externalDocs,this.constraints=st(u),this.displayFormat=this.format,this.isPrimitive=We(u,this.type),this.default=u.default,this.readOnly=!!u.readOnly,this.writeOnly=!!u.writeOnly,this.const=u.const||"",this.contentEncoding=u.contentEncoding,this.contentMediaType=u.contentMediaType,this.minItems=u.minItems,this.maxItems=u.maxItems,(u.nullable||u["x-nullable"])&&(I(this.type)&&!this.type.some((e=>null===e||"null"===e))?this.type=[...this.type,"null"]:I(this.type)||null===this.type&&"null"===this.type||(this.type=[this.type,"null"])),this.displayType=I(this.type)?this.type.map((e=>null===e?"null":e)).join(" or "):this.type,!this.isCircular)if(u.if&&u.then||u.if&&u.else)this.initConditionalOperators(u,e);else if(t||void 0===zr(u)){if(t&&I(u.oneOf)&&u.oneOf.find((e=>e.$ref===this.pointer))&&delete u.oneOf,void 0!==u.oneOf)return this.initOneOf(u.oneOf,e),this.oneOfType="One of",void(void 0!==u.anyOf&&console.warn(`oneOf and anyOf are not supported on the same level. Skipping anyOf at ${this.pointer}`));if(void 0!==u.anyOf)return this.initOneOf(u.anyOf,e),void(this.oneOfType="Any of");if(this.hasType("object"))this.fields=Br(e,u,this.pointer,this.options,this.refsStack);else if(this.hasType("array")&&(I(u.items)||I(u.prefixItems)?this.fields=Br(e,u,this.pointer,this.options,this.refsStack):u.items&&(this.items=new Dr(e,u.items,this.pointer+"/items",this.options,!1,this.refsStack)),this.displayType=u.prefixItems||I(u.items)?"items":wt((null==(n=this.items)?void 0:n.displayType)||this.displayType),this.displayFormat=(null==(r=this.items)?void 0:r.format)||"",this.typePrefix=(null==(i=this.items)?void 0:i.typePrefix)||""+N("arrayOf"),this.title=this.title||(null==(o=this.items)?void 0:o.title)||"",this.isPrimitive=void 0!==(null==(s=this.items)?void 0:s.isPrimitive)?null==(a=this.items)?void 0:a.isPrimitive:this.isPrimitive,void 0===this.example&&void 0!==(null==(l=this.items)?void 0:l.example)&&(this.example=[this.items.example]),(null==(c=this.items)?void 0:c.isPrimitive)&&(this.enum=this.items.enum),I(this.type))){const e=this.type.filter((e=>"array"!==e));e.length&&(this.displayType+=` or ${e.join(" or ")}`)}this.enum.length&&this.options.sortEnumValuesAlphabetically&&this.enum.sort()}else this.initDiscriminator(u,e)}initOneOf(e,t){if(this.oneOf=e.map(((e,n)=>{const{resolved:r,refsStack:i}=t.deref(e,this.refsStack,!0),o=t.mergeAllOf(r,this.pointer+"/oneOf/"+n,i),s=nt(e.$ref)&&!o.title?Se.baseName(e.$ref):`${o.title||""}${void 0!==o.const&&JSON.stringify(o.const)||""}`;return new Dr(t,$r(Lr({},o),{title:s,allOf:[$r(Lr({},this.schema),{oneOf:void 0,anyOf:void 0})],discriminator:r.allOf?void 0:o.discriminator}),e.$ref||this.pointer+"/oneOf/"+n,this.options,!1,i)})),this.options.simpleOneOfTypeLabel){const e=function(e){const t=new Set;return function e(n){for(const r of n.oneOf||[])r.oneOf?e(r):r.type&&t.add(r.type)}(e),Array.from(t.values())}(this);this.displayType=e.join(" or ")}else this.displayType=this.oneOf.map((e=>{let t=e.typePrefix+(e.title?`${e.title} (${e.displayType})`:e.displayType);return t.indexOf(" or ")>-1&&(t=`(${t})`),t})).join(" or ")}initDiscriminator(e,t){const n=zr(e);this.discriminatorProp=n.propertyName;const r=t.findDerived([...this.schema["x-parentRefs"]||[],this.pointer]);if(e.oneOf)for(const u of e.oneOf){if(void 0===u.$ref)continue;const e=Se.baseName(u.$ref);r[u.$ref]=e}const i=n.mapping||{};let o=n["x-explicitMappingOnly"]||!1;0===Object.keys(i).length&&(o=!1);const s={};for(const u in i){const e=i[u];I(s[e])?s[e].push(u):s[e]=[u]}const a=Lr(o?{}:Lr({},r),s);let l=[];for(const u of Object.keys(a)){const e=a[u];if(I(e))for(const t of e)l.push({$ref:u,name:t});else l.push({$ref:u,name:e})}const c=Object.keys(i);0!==c.length&&(l=l.sort(((e,t)=>{const n=c.indexOf(e.name),r=c.indexOf(t.name);return n<0&&r<0?e.name.localeCompare(t.name):n<0?1:r<0?-1:n-r}))),this.oneOf=l.map((({$ref:e,name:n})=>{const r=new Dr(t,{$ref:e},e,this.options,!0,this.refsStack.slice(0,-1));return r.title=n,r}))}initConditionalOperators(e,t){const n=e,{if:r,else:i={},then:o={}}=n,s=((e,t)=>{var n={};for(var r in e)Cr.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Ir)for(var r of Ir(e))t.indexOf(r)<0&&Rr.call(e,r)&&(n[r]=e[r]);return n})(n,["if","else","then"]),a=[{allOf:[s,o,r],title:r&&r["x-displayName"]||(null==r?void 0:r.title)||"case 1"},{allOf:[s,i],title:i&&i["x-displayName"]||(null==i?void 0:i.title)||"case 2"}];this.oneOf=a.map(((e,n)=>new Dr(t,Lr({},e),this.pointer+"/oneOf/"+n,this.options,!1,this.refsStack))),this.oneOfType="One of"}};let Fr=Dr;function Br(e,t,n,r,i){const o=t.properties||t.prefixItems||t.items||{},s=t.patternProperties||{},a=t.additionalProperties||t.unevaluatedProperties,l=t.prefixItems?t.items:t.additionalItems,c=t.default;let u=Object.keys(o||[]).map((s=>{let a=o[s];a||(console.warn(`Field "${s}" is invalid, skipping.\n Field must be an object but got ${typeof a} at "${n}"`),a={});const l=void 0!==t.required&&t.required.indexOf(s)>-1;return new Yr(e,{name:t.properties?s:`[${s}]`,required:l,schema:$r(Lr({},a),{default:void 0===a.default&&c?c[s]:a.default})},n+"/properties/"+s,r,i)}));return r.sortPropsAlphabetically&&(u=lt(u,"name")),r.requiredPropsFirst&&(u=at(u,r.sortPropsAlphabetically?void 0:t.required)),u.push(...Object.keys(s).map((t=>{let o=s[t];return o||(console.warn(`Field "${t}" is invalid, skipping.\n Field must be an object but got ${typeof o} at "${n}"`),o={}),new Yr(e,{name:t,required:!1,schema:o,kind:"patternProperties"},`${n}/patternProperties/${t}`,r,i)}))),"object"!=typeof a&&!0!==a||u.push(new Yr(e,{name:("object"==typeof a&&a["x-additionalPropertiesName"]||"property name").concat("*"),required:!1,schema:!0===a?{}:a,kind:"additionalProperties"},n+"/additionalProperties",r,i)),u.push(...function({parser:e,schema:t=!1,fieldsCount:n,$ref:r,options:i,refsStack:o}){return C(t)?t?[new Yr(e,{name:`[${n}...]`,schema:{}},`${r}/additionalItems`,i,o)]:[]:I(t)?[...t.map(((t,s)=>new Yr(e,{name:`[${n+s}]`,schema:t},`${r}/additionalItems`,i,o)))]:x(t)?[new Yr(e,{name:`[${n}...]`,schema:t},`${r}/additionalItems`,i,o)]:[]}({parser:e,schema:l,fieldsCount:u.length,$ref:n,options:r,refsStack:i})),u}function zr(e){return e.discriminator||e["x-discriminator"]}Mr([fe.observable],Fr.prototype,"activeOneOf",2),Mr([fe.action],Fr.prototype,"activateOneOf",1);const Ur={};class qr{constructor(e,t,n,r){this.mime=n;const{resolved:i}=e.deref(t);this.value=i.value,this.summary=i.summary,this.description=i.description,i.externalValue&&(this.externalValueUrl=new URL(i.externalValue,e.specUrl).href),Qe(n)&&this.value&&"object"==typeof this.value&&(this.value=Xe(this.value,r))}getExternalValue(e){return this.externalValueUrl?(this.externalValueUrl in Ur||(Ur[this.externalValueUrl]=fetch(this.externalValueUrl).then((t=>t.text().then((n=>{if(!t.ok)return Promise.reject(new Error(n));if(!Ve(e))return n;try{return JSON.parse(n)}catch(e){return n}}))))),Ur[this.externalValueUrl]):Promise.resolve(void 0)}}var Wr=Object.defineProperty,Vr=Object.getOwnPropertyDescriptor,Qr=(e,t,n,r)=>{for(var i,o=r>1?void 0:r?Vr(t,n):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Wr(t,n,o),o};const Hr={path:{style:"simple",explode:!1},query:{style:"form",explode:!0},header:{style:"simple",explode:!1},cookie:{style:"form",explode:!0}};class Yr{constructor(e,t,n,r,i){var o,s,a,l,c;this.expanded=void 0,(0,fe.makeObservable)(this);const{resolved:u}=e.deref(t);this.kind=t.kind||"field",this.name=t.name||u.name,this.in=u.in,this.required=!!u.required;let p=u.schema,d="";if(!p&&u.in&&u.content&&(d=Object.keys(u.content)[0],p=u.content[d]&&u.content[d].schema),this.schema=new Fr(e,p||{},n,r,!1,i),this.description=void 0===u.description?this.schema.description||"":u.description,this.example=u.example||this.schema.example,void 0!==u.examples||void 0!==this.schema.examples){const t=u.examples||this.schema.examples;this.examples=I(t)?t:h(t,((t,n)=>new qr(e,t,n,u.encoding)))}d?this.serializationMime=d:u.style?this.style=u.style:this.in&&(this.style=null!=(s=null==(o=Hr[this.in])?void 0:o.style)?s:"form"),void 0===u.explode&&this.in?this.explode=null==(l=null==(a=Hr[this.in])?void 0:a.explode)||l:this.explode=!!u.explode,this.deprecated=void 0===u.deprecated?!!this.schema.deprecated:u.deprecated,r.showExtensions&&(this.extensions=xt(u,r.showExtensions)),this.const=(null==(c=this.schema)?void 0:c.const)||(null==u?void 0:u.const)||""}toggle(){this.expanded=!this.expanded}collapse(){this.expanded=!1}expand(){this.expanded=!0}}Qr([fe.observable],Yr.prototype,"expanded",2),Qr([fe.action],Yr.prototype,"toggle",1),Qr([fe.action],Yr.prototype,"collapse",1),Qr([fe.action],Yr.prototype,"expand",1);var Gr=n(5900);class Xr{constructor(e,t,n,r,i){this.name=t,this.isRequestType=n,this.schema=r.schema&&new Fr(e,r.schema,"",i),this.onlyRequiredInSamples=i.onlyRequiredInSamples,this.generatedPayloadSamplesMaxDepth=i.generatedPayloadSamplesMaxDepth,void 0!==r.examples?this.examples=h(r.examples,(n=>new qr(e,n,t,r.encoding))):void 0!==r.example?this.examples={default:new qr(e,{value:e.deref(r.example).resolved},t,r.encoding)}:Ve(t)&&this.generateExample(e,r)}generateExample(e,t){const n={skipReadOnly:this.isRequestType,skipWriteOnly:!this.isRequestType,skipNonRequired:this.isRequestType&&this.onlyRequiredInSamples,maxSampleDepth:this.generatedPayloadSamplesMaxDepth};if(this.schema&&this.schema.oneOf){this.examples={};for(const r of this.schema.oneOf){const i=Gr.sample(r.rawSchema,n,e.spec);this.schema.discriminatorProp&&"object"==typeof i&&i&&(i[this.schema.discriminatorProp]=r.title),this.examples[r.title]=new qr(e,{value:i},this.name,t.encoding)}}else this.schema&&(this.examples={default:new qr(e,{value:Gr.sample(t.schema,n,e.spec)},this.name,t.encoding)})}}var Kr=Object.defineProperty,Jr=Object.getOwnPropertyDescriptor,Zr=(e,t,n,r)=>{for(var i,o=r>1?void 0:r?Jr(t,n):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Kr(t,n,o),o};class ei{constructor(e,t,n,r){this.isRequestType=n,this.activeMimeIdx=0,(0,fe.makeObservable)(this),r.unstable_ignoreMimeParameters&&(t=ut(t)),this.mediaTypes=Object.keys(t).map((i=>{const o=t[i];return new Xr(e,i,n,o,r)}))}activate(e){this.activeMimeIdx=e}get active(){return this.mediaTypes[this.activeMimeIdx]}get hasSample(){return this.mediaTypes.filter((e=>!!e.examples)).length>0}}Zr([fe.observable],ei.prototype,"activeMimeIdx",2),Zr([fe.action],ei.prototype,"activate",1),Zr([fe.computed],ei.prototype,"active",1);class ti{constructor({parser:e,infoOrRef:t,options:n,isEvent:r}){const i=!r,{resolved:o}=e.deref(t);this.description=o.description||"",this.required=o.required;const s=kt(o);void 0!==s&&(this.content=new ei(e,s,i,n))}}var ni=Object.defineProperty,ri=Object.defineProperties,ii=Object.getOwnPropertyDescriptor,oi=Object.getOwnPropertyDescriptors,si=Object.getOwnPropertySymbols,ai=Object.prototype.hasOwnProperty,li=Object.prototype.propertyIsEnumerable,ci=(e,t,n)=>t in e?ni(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ui=(e,t,n,r)=>{for(var i,o=r>1?void 0:r?ii(t,n):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&ni(t,n,o),o};class pi{constructor({parser:e,code:t,defaultAsError:n,infoOrRef:r,options:i,isEvent:o}){this.expanded=!1,this.headers=[],(0,fe.makeObservable)(this),this.expanded="all"===i.expandResponses||i.expandResponses[t];const{resolved:s}=e.deref(r);this.code=t,void 0!==s.content&&(this.content=new ei(e,s.content,o,i)),void 0!==s["x-summary"]?(this.summary=s["x-summary"],this.description=s.description||""):(this.summary=s.description||"",this.description=""),this.type=De(t,n);const a=s.headers;void 0!==a&&(this.headers=Object.keys(a).map((t=>{const n=a[t];return new Yr(e,(r=((e,t)=>{for(var n in t||(t={}))ai.call(t,n)&&ci(e,n,t[n]);if(si)for(var n of si(t))li.call(t,n)&&ci(e,n,t[n]);return e})({},n),ri(r,oi({name:t}))),"",i);var r}))),i.showExtensions&&(this.extensions=xt(s,i.showExtensions))}toggle(){this.expanded=!this.expanded}}ui([fe.observable],pi.prototype,"expanded",2),ui([fe.action],pi.prototype,"toggle",1);var di=Object.defineProperty,fi=Object.getOwnPropertyDescriptor,hi=(e,t,n,r)=>{for(var i,o=r>1?void 0:r?fi(t,n):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&di(t,n,o),o};function mi(e){return"payload"===e.lang&&e.requestBodyContent}let gi=!1;class yi{constructor(e,t,n,r,i=!1){this.parser=e,this.operationSpec=t,this.options=r,this.type="operation",this.items=[],this.ready=!0,this.active=!1,this.expanded=!1,(0,fe.makeObservable)(this),this.pointer=t.pointer,this.description=t.description,this.parent=n,this.externalDocs=t.externalDocs,this.deprecated=!!t.deprecated,this.httpVerb=t.httpVerb,this.deprecated=!!t.deprecated,this.operationId=t.operationId,this.path=t.pathName,this.isCallback=i,this.isWebhook=t.isWebhook,this.isEvent=this.isCallback||this.isWebhook,this.name=ze(t),this.sidebarLabel=r.sideNavStyle===L.IdOnly?this.operationId||this.path:r.sideNavStyle===L.PathOnly?this.path:this.name,this.isCallback?(this.security=(t.security||[]).map((t=>new nr(t,e))),this.servers=dt("",t.servers||t.pathServers||[])):(this.operationHash=t.operationId&&"operation/"+t.operationId,this.id=void 0!==t.operationId?(n?n.id+"/":"")+this.operationHash:void 0!==n?n.id+this.pointer:this.pointer,this.security=(t.security||e.spec.security||[]).map((t=>new nr(t,e))),this.servers=dt(e.specUrl,t.servers||t.pathServers||e.spec.servers||[])),r.showExtensions&&(this.extensions=xt(t,r.showExtensions))}activate(){this.active=!0}deactivate(){this.active=!1}toggle(){this.expanded=!this.expanded}expand(){this.parent&&this.parent.expand()}collapse(){}get requestBody(){return this.operationSpec.requestBody&&new ti({parser:this.parser,infoOrRef:this.operationSpec.requestBody,options:this.options,isEvent:this.isEvent})}get codeSamples(){const{payloadSampleIdx:e,hideRequestPayloadSample:t}=this.options;let n=this.operationSpec["x-codeSamples"]||this.operationSpec["x-code-samples"]||[];this.operationSpec["x-code-samples"]&&!gi&&(gi=!0,console.warn('"x-code-samples" is deprecated. Use "x-codeSamples" instead'));const r=this.requestBody&&this.requestBody.content;if(r&&r.hasSample&&!t){const t=Math.min(n.length,e);n=[...n.slice(0,t),{lang:"payload",label:"Payload",source:"",requestBodyContent:r},...n.slice(t)]}return n}get parameters(){const e=ct(this.parser,this.operationSpec.pathParameters,this.operationSpec.parameters).map((e=>new Yr(this.parser,e,this.pointer,this.options)));return this.options.sortPropsAlphabetically?lt(e,"name"):this.options.requiredPropsFirst?at(e):e}get responses(){let e=!1;return Object.keys(this.operationSpec.responses||[]).filter((t=>"default"===t||("success"===De(t)&&(e=!0),Me(t)))).map((t=>new pi({parser:this.parser,code:t,defaultAsError:e,infoOrRef:this.operationSpec.responses[t],options:this.options,isEvent:this.isEvent})))}get callbacks(){return Object.keys(this.operationSpec.callbacks||[]).map((e=>new fr(this.parser,e,this.operationSpec.callbacks[e],this.pointer,this.options)))}}hi([fe.observable],yi.prototype,"ready",2),hi([fe.observable],yi.prototype,"active",2),hi([fe.observable],yi.prototype,"expanded",2),hi([fe.action],yi.prototype,"activate",1),hi([fe.action],yi.prototype,"deactivate",1),hi([fe.action],yi.prototype,"toggle",1),hi([Bt],yi.prototype,"requestBody",1),hi([Bt],yi.prototype,"codeSamples",1),hi([Bt],yi.prototype,"parameters",1),hi([Bt],yi.prototype,"responses",1),hi([Bt],yi.prototype,"callbacks",1);var vi=Object.defineProperty,bi=Object.defineProperties,xi=Object.getOwnPropertyDescriptors,wi=Object.getOwnPropertySymbols,ki=Object.prototype.hasOwnProperty,Oi=Object.prototype.propertyIsEnumerable,Si=(e,t,n)=>t in e?vi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ei=(e,t)=>{for(var n in t||(t={}))ki.call(t,n)&&Si(e,n,t[n]);if(wi)for(var n of wi(t))Oi.call(t,n)&&Si(e,n,t[n]);return e};class _i{constructor(e,t,n){this.operations=[];const{resolved:r}=e.deref(n||{});this.initWebhooks(e,r,t)}initWebhooks(e,t,n){for(const i of Object.keys(t)){const o=t[i],s=Object.keys(o).filter(Be);for(const t of s){const i=o[t];if(o.$ref){const r=e.deref(o||{});this.initWebhooks(e,{[t]:r},n)}if(!i)continue;const s=new yi(e,(r=Ei({},i),bi(r,xi({httpVerb:t}))),void 0,n,!1);this.operations.push(s)}}var r}}class Ai{constructor(e,t,n){const{resolved:r}=e.deref(n);this.id=t,this.sectionId=gt+t,this.type=r.type,this.displayName=r["x-displayName"]||t,this.description=r.description||"","apiKey"===r.type&&(this.apiKey={name:r.name,in:r.in}),"http"===r.type&&(this.http={scheme:r.scheme,bearerFormat:r.bearerFormat}),"openIdConnect"===r.type&&(this.openId={connectUrl:r.openIdConnectUrl}),"oauth2"===r.type&&r.flows&&(this.flows=r.flows)}}class ji{constructor(e){const t=e.spec.components&&e.spec.components.securitySchemes||{};this.schemes=Object.keys(t).map((n=>new Ai(e,n,t[n])))}}var Ti=Object.defineProperty,Pi=Object.getOwnPropertySymbols,Ii=Object.prototype.hasOwnProperty,Ci=Object.prototype.propertyIsEnumerable,Ri=(e,t,n)=>t in e?Ti(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ni=(e,t)=>{for(var n in t||(t={}))Ii.call(t,n)&&Ri(e,n,t[n]);if(Pi)for(var n of Pi(t))Ci.call(t,n)&&Ri(e,n,t[n]);return e};class Li{constructor(e,t,n){var r,i,o;this.options=n,this.parser=new _r(e,t,n),this.info=new Yn(this.parser,this.options),this.externalDocs=this.parser.spec.externalDocs,this.contentItems=Xi.buildStructure(this.parser,this.options),this.securitySchemes=new ji(this.parser);const s=Ni(Ni({},null==(i=null==(r=this.parser)?void 0:r.spec)?void 0:i["x-webhooks"]),null==(o=this.parser)?void 0:o.spec.webhooks);this.webhooks=new _i(this.parser,n,s)}}var $i=Object.defineProperty,Mi=Object.getOwnPropertyDescriptor,Di=(e,t,n,r)=>{for(var i,o=r>1?void 0:r?Mi(t,n):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&$i(t,n,o),o};class Fi{constructor(e,t,n){this.items=[],this.active=!1,this.expanded=!1,(0,fe.makeObservable)(this),this.id=t.id||e+"/"+k(t.name),this.type=e,this.name=t["x-displayName"]||t.name,this.level=t.level||1,this.sidebarLabel=this.name,this.description=t.description||"";const r=t.items;r&&r.length&&(this.description=Qn.getTextBeforeHading(this.description,r[0].name)),this.parent=n,this.externalDocs=t.externalDocs,"group"===this.type&&(this.expanded=!0)}activate(){this.active=!0}expand(){this.parent&&this.parent.expand(),this.expanded=!0}collapse(){"group"!==this.type&&(this.expanded=!1)}deactivate(){this.active=!1}}Di([fe.observable],Fi.prototype,"active",2),Di([fe.observable],Fi.prototype,"expanded",2),Di([fe.action],Fi.prototype,"activate",1),Di([fe.action],Fi.prototype,"expand",1),Di([fe.action],Fi.prototype,"collapse",1),Di([fe.action],Fi.prototype,"deactivate",1);var Bi=Object.defineProperty,zi=Object.defineProperties,Ui=Object.getOwnPropertyDescriptors,qi=Object.getOwnPropertySymbols,Wi=Object.prototype.hasOwnProperty,Vi=Object.prototype.propertyIsEnumerable,Qi=(e,t,n)=>t in e?Bi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Hi=(e,t)=>{for(var n in t||(t={}))Wi.call(t,n)&&Qi(e,n,t[n]);if(qi)for(var n of qi(t))Vi.call(t,n)&&Qi(e,n,t[n]);return e},Yi=(e,t)=>zi(e,Ui(t));const Gi=0;class Xi{static buildStructure(e,t){const n=e.spec,r=[],i=Xi.getTagsWithOperations(e,n);return r.push(...Xi.addMarkdownItems(n.info.description||"",void 0,1,t)),n["x-tagGroups"]&&n["x-tagGroups"].length>0?r.push(...Xi.getTagGroupsItems(e,void 0,n["x-tagGroups"],i,t)):r.push(...Xi.getTagsItems(e,i,void 0,void 0,t)),r}static addMarkdownItems(e,t,n,r){const i=new Qn(r,null==t?void 0:t.id).extractHeadings(e||"");i.length&&t&&t.description&&(t.description=Qn.getTextBeforeHading(t.description,i[0].name));const o=(e,t,n=1)=>t.map((t=>{const r=new Fi("section",t,e);return r.depth=n,t.items&&(r.items=o(r,t.items,n+1)),r}));return o(t,i,n)}static getTagGroupsItems(e,t,n,r,i){const o=[];for(const s of n){const n=new Fi("group",s,t);n.depth=Gi,n.items=Xi.getTagsItems(e,r,n,s,i),o.push(n)}return o}static getTagsItems(e,t,n,r,i){let o;o=void 0===r?Object.keys(t):r.tags;const s=o.map((e=>t[e]?(t[e].used=!0,t[e]):(console.warn(`Non-existing tag "${e}" is added to the group "${r.name}"`),null))),a=[];for(const l of s){if(!l)continue;const t=new Fi("tag",l,n);if(t.depth=Gi+1,""===l.name){const n=[...Xi.addMarkdownItems(l.description||"",t,t.depth+1,i),...this.getOperationsItems(e,void 0,l,t.depth+1,i)];a.push(...n);continue}const r=this.getTagRelatedSchema({parser:e,tag:l,parent:t});t.items=[...r,...Xi.addMarkdownItems(l.description||"",t,t.depth+1,i),...this.getOperationsItems(e,t,l,t.depth+1,i)],a.push(t)}return i.sortTagsAlphabetically&&a.sort(zt("name")),a}static getOperationsItems(e,t,n,r,i){if(0===n.operations.length)return[];const o=[];for(const s of n.operations){const n=new yi(e,s,t,i);n.depth=r,o.push(n)}return i.sortOperationsAlphabetically&&o.sort(zt("name")),o}static getTagsWithOperations(e,t){const n={},r=t["x-webhooks"]||t.webhooks;for(const o of t.tags||[])n[o.name]=Yi(Hi({},o),{operations:[]});function i(e,t,r){for(const o of Object.keys(t)){const s=t[o],a=Object.keys(s).filter(Be);for(const t of a){const a=s[t];if(s.$ref){const{resolved:t}=e.deref(s);i(e,{[o]:t},r);continue}let l=null==a?void 0:a.tags;l&&l.length||(l=[""]);for(const e of l){let i=n[e];void 0===i&&(i={name:e,operations:[]},n[e]=i),i["x-traitTag"]||i.operations.push(Yi(Hi({},a),{pathName:o,pointer:Se.compile(["paths",o,t]),httpVerb:t,pathParameters:s.parameters||[],pathServers:s.servers,isWebhook:!!r}))}}}}return r&&i(e,r,!0),t.paths&&i(e,t.paths),n}static getTagRelatedSchema({parser:e,tag:t,parent:n}){var r;return Object.entries((null==(r=e.spec.components)?void 0:r.schemas)||{}).map((([e,r])=>{const i=r["x-tags"];if(!(null==i?void 0:i.includes(t.name)))return null;const o=new Fi("schema",{name:e,"x-displayName":`${r.title||e}`,description:`<SchemaDefinition showWriteOnly={true} schemaRef="#/components/schemas/${e}" />`},n);return o.depth=n.depth+1,o})).filter(Boolean)}}var Ki=Object.defineProperty,Ji=Object.getOwnPropertyDescriptor,Zi=(e,t,n,r)=>{for(var i,o=r>1?void 0:r?Ji(t,n):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Ki(t,n,o),o};const eo="data-section-id";class to{constructor(e,t,n){this.scroll=t,this.history=n,this.activeItemIdx=-1,this.sideBarOpened=!1,this.updateOnScroll=e=>{const t=e?1:-1;let n=this.activeItemIdx;for(;(-1!==n||e)&&!(n>=this.flatItems.length-1&&e);){if(e){const e=this.getElementAtOrFirstChild(n+1);if(this.scroll.isElementBellow(e))break}else{const e=this.getElementAt(n);if(this.scroll.isElementAbove(e))break}n+=t}this.activate(this.flatItems[n],!0,!0)},this.updateOnHistory=(e=this.history.currentId)=>{if(!e)return;let t;t=this.flatItems.find((t=>t.id===e)),t?this.activateAndScroll(t,!1):(e.startsWith(gt)&&(t=this.flatItems.find((e=>gt.startsWith(e.id))),this.activateAndScroll(t,!1)),this.scroll.scrollIntoViewBySelector(`[${eo}="${T(e)}"]`))},this.getItemById=e=>this.flatItems.find((t=>t.id===e)),(0,fe.makeObservable)(this),this.items=e.contentItems,this.flatItems=m(this.items||[],"items"),this.flatItems.forEach(((e,t)=>e.absoluteIdx=t)),this.subscribe()}static updateOnHistory(e=Qt.currentId,t){e&&t.scrollIntoViewBySelector(`[${eo}="${T(e)}"]`)}subscribe(){this._unsubscribe=this.scroll.subscribe(this.updateOnScroll),this._hashUnsubscribe=this.history.subscribe(this.updateOnHistory)}toggleSidebar(){this.sideBarOpened=!this.sideBarOpened}closeSidebar(){this.sideBarOpened=!1}getElementAt(e){const t=this.flatItems[e];return t&&l(`[${eo}="${T(t.id)}"]`)||null}getElementAtOrFirstChild(e){let t=this.flatItems[e];return t&&"group"===t.type&&(t=t.items[0]),t&&l(`[${eo}="${T(t.id)}"]`)||null}get activeItem(){return this.flatItems[this.activeItemIdx]||void 0}activate(e,t=!0,n=!1){if((this.activeItem&&this.activeItem.id)!==(e&&e.id)&&(!e||"group"!==e.type)){if(this.deactivate(this.activeItem),!e)return this.activeItemIdx=-1,void this.history.replace("",n);e.depth<=Gi||(this.activeItemIdx=e.absoluteIdx,t&&this.history.replace(encodeURI(e.id),n),e.activate(),e.expand())}}deactivate(e){if(void 0!==e)for(e.deactivate();void 0!==e;)e.collapse(),e=e.parent}activateAndScroll(e,t,n){const r=e&&this.getItemById(e.id)||e;this.activate(r,t,n),this.scrollToActive(),r&&r.items.length||this.closeSidebar()}scrollToActive(){this.scroll.scrollIntoView(this.getElementAt(this.activeItemIdx))}dispose(){this._unsubscribe(),this._hashUnsubscribe()}}Zi([fe.observable],to.prototype,"activeItemIdx",2),Zi([fe.observable],to.prototype,"sideBarOpened",2),Zi([fe.action],to.prototype,"toggleSidebar",1),Zi([fe.action],to.prototype,"closeSidebar",1),Zi([fe.action],to.prototype,"activate",1),Zi([fe.action.bound],to.prototype,"activateAndScroll",1);var no=Object.defineProperty,ro=Object.getOwnPropertyDescriptor;const io="scroll";class oo{constructor(e){this.options=e,this._prevOffsetY=0,this._scrollParent=a?window:void 0,this._emiter=new we,this.bind()}bind(){this._prevOffsetY=this.scrollY(),this._scrollParent&&this._scrollParent.addEventListener("scroll",this.handleScroll)}dispose(){this._scrollParent&&this._scrollParent.removeEventListener("scroll",this.handleScroll),this._emiter.removeAllListeners(io)}scrollY(){return"undefined"!=typeof HTMLElement&&this._scrollParent instanceof HTMLElement?this._scrollParent.scrollTop:void 0!==this._scrollParent?this._scrollParent.pageYOffset:0}isElementBellow(e){if(null!==e)return e.getBoundingClientRect().top>this.options.scrollYOffset()}isElementAbove(e){if(null===e)return;const t=e.getBoundingClientRect().top;return(t>0?Math.floor(t):Math.ceil(t))<=this.options.scrollYOffset()}subscribe(e){const t=this._emiter.addListener(io,e);return()=>t.removeListener(io,e)}scrollIntoView(e){null!==e&&(e.scrollIntoView(),this._scrollParent&&this._scrollParent.scrollBy&&this._scrollParent.scrollBy(0,1-this.options.scrollYOffset()))}scrollIntoViewBySelector(e){const t=l(e);this.scrollIntoView(t)}handleScroll(){const e=this.scrollY()-this._prevOffsetY>0;this._prevOffsetY=this.scrollY(),this._emiter.emit(io,e)}}((e,t,n,r)=>{for(var i,o=ro(t,n),s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(t,n,o)||o);o&&no(t,n,o)})([xe.bind,At(100)],oo.prototype,"handleScroll");class so{constructor(){this.searchWorker=function(){let e;if(a)try{e=r(595)}catch(t){e=r(388).ZP}else e=r(388).ZP;return new e}()}indexItems(e){const t=e=>{e.forEach((e=>{"group"!==e.type&&this.add(e.name,(e.description||"").concat(" ",e.path||""),e.id),t(e.items)}))};t(e),this.searchWorker.done()}add(e,t,n){this.searchWorker.add(e,t,n)}dispose(){this.searchWorker.terminate(),this.searchWorker.dispose()}search(e){return this.searchWorker.search(e)}toJS(){return e=this,t=function*(){return this.searchWorker.toJS()},new Promise(((n,r)=>{var i=e=>{try{s(t.next(e))}catch(e){r(e)}},o=e=>{try{s(t.throw(e))}catch(e){r(e)}},s=e=>e.done?n(e.value):Promise.resolve(e.value).then(i,o);s((t=t.apply(e,null)).next())}));var e,t}load(e){this.searchWorker.load(e)}fromExternalJS(e,t){e&&t&&this.searchWorker.fromExternalJS(e,t)}}const ao=te.div` + width: calc(100% - ${e=>e.theme.rightPanel.width}); + padding: 0 ${e=>e.theme.spacing.sectionHorizontal}px; + + ${({$compact:e,theme:t})=>ee.lessThan("medium",!0)` + width: 100%; + padding: ${`${e?0:t.spacing.sectionVertical}px ${t.spacing.sectionHorizontal}px`}; + `}; +`,lo=te.div.attrs((e=>({[eo]:e.id})))` + padding: ${e=>e.theme.spacing.sectionVertical}px 0; + + &:last-child { + min-height: calc(100vh + 1px); + } + + & > &:last-child { + min-height: initial; + } + + ${ee.lessThan("medium",!0)` + padding: 0; + `} + ${({$underlined:e})=>e?"\n position: relative;\n\n &:not(:last-of-type):after {\n position: absolute;\n bottom: 0;\n width: 100%;\n display: block;\n content: '';\n border-bottom: 1px solid rgba(0, 0, 0, 0.2);\n }\n ":""} +`,co=te.div` + width: ${e=>e.theme.rightPanel.width}; + color: ${({theme:e})=>e.rightPanel.textColor}; + background-color: ${e=>e.theme.rightPanel.backgroundColor}; + padding: 0 ${e=>e.theme.spacing.sectionHorizontal}px; + + ${ee.lessThan("medium",!0)` + width: 100%; + padding: ${e=>`${e.theme.spacing.sectionVertical}px ${e.theme.spacing.sectionHorizontal}px`}; + `}; +`,uo=te(co)` + background-color: ${e=>e.theme.rightPanel.backgroundColor}; +`,po=te.div` + display: flex; + width: 100%; + padding: 0; + + ${ee.lessThan("medium",!0)` + flex-direction: column; + `}; +`,fo={1:"1.85714em",2:"1.57143em",3:"1.27em"},ho=e=>X` + font-family: ${({theme:e})=>e.typography.headings.fontFamily}; + font-weight: ${({theme:e})=>e.typography.headings.fontWeight}; + font-size: ${fo[e]}; + line-height: ${({theme:e})=>e.typography.headings.lineHeight}; +`,mo=te.h1` + ${ho(1)}; + color: ${({theme:e})=>e.colors.text.primary}; + + ${ne("H1")}; +`,go=te.h2` + ${ho(2)}; + color: ${({theme:e})=>e.colors.text.primary}; + margin: 0 0 20px; + + ${ne("H2")}; +`,yo=(te.h2` + ${ho(3)}; + color: ${({theme:e})=>e.colors.text.primary}; + + ${ne("H3")}; +`,te.h3` + color: ${({theme:e})=>e.rightPanel.textColor}; + + ${ne("RightPanelHeader")}; +`),vo=te.h5` + border-bottom: 1px solid rgba(38, 50, 56, 0.3); + margin: 1em 0 1em 0; + color: rgba(38, 50, 56, 0.5); + font-weight: normal; + text-transform: uppercase; + font-size: 0.929em; + line-height: 20px; + + ${ne("UnderlinedHeader")}; +`;var bo=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}));const xo=(0,e.createContext)(void 0),{Provider:wo,Consumer:ko}=xo;function Oo(t){const{spec:n,specUrl:r,options:i,onLoaded:o,children:s}=t,[a,l]=e.useState(null),[c,u]=e.useState(null);if(c)throw c;e.useEffect((()=>{!function(){bo(this,null,(function*(){if(n||r){l(null);try{const e=yield ve(n||r);l(e)}catch(e){throw o&&o(e),u(e),e}}}))}()}),[n,r]);const p=e.useMemo((()=>{if(!a)return null;try{return new dc(a,r,i)}catch(e){throw o&&o(e),e}}),[a,r,i]);return e.useEffect((()=>{p&&o&&o()}),[p,o]),s({loading:!p,store:p})}function So(){return(0,e.useContext)(xo)}const Eo=e=>X` + ${e} { + cursor: pointer; + margin-left: -20px; + padding: 0; + line-height: 1; + width: 20px; + display: inline-block; + outline: 0; + } + ${e}:before { + content: ''; + width: 15px; + height: 15px; + background-size: contain; + background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjUxMiIgaGVpZ2h0PSI1MTIiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA1MTIgNTEyIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBmaWxsPSIjMDEwMTAxIiBkPSJNNDU5LjcgMjMzLjRsLTkwLjUgOTAuNWMtNTAgNTAtMTMxIDUwLTE4MSAwIC03LjktNy44LTE0LTE2LjctMTkuNC0yNS44bDQyLjEtNDIuMWMyLTIgNC41LTMuMiA2LjgtNC41IDIuOSA5LjkgOCAxOS4zIDE1LjggMjcuMiAyNSAyNSA2NS42IDI0LjkgOTAuNSAwbDkwLjUtOTAuNWMyNS0yNSAyNS02NS42IDAtOTAuNSAtMjQuOS0yNS02NS41LTI1LTkwLjUgMGwtMzIuMiAzMi4yYy0yNi4xLTEwLjItNTQuMi0xMi45LTgxLjYtOC45bDY4LjYtNjguNmM1MC01MCAxMzEtNTAgMTgxIDBDNTA5LjYgMTAyLjMgNTA5LjYgMTgzLjQgNDU5LjcgMjMzLjR6TTIyMC4zIDM4Mi4ybC0zMi4yIDMyLjJjLTI1IDI0LjktNjUuNiAyNC45LTkwLjUgMCAtMjUtMjUtMjUtNjUuNiAwLTkwLjVsOTAuNS05MC41YzI1LTI1IDY1LjUtMjUgOTAuNSAwIDcuOCA3LjggMTIuOSAxNy4yIDE1LjggMjcuMSAyLjQtMS40IDQuOC0yLjUgNi44LTQuNWw0Mi4xLTQyYy01LjQtOS4yLTExLjYtMTgtMTkuNC0yNS44IC01MC01MC0xMzEtNTAtMTgxIDBsLTkwLjUgOTAuNWMtNTAgNTAtNTAgMTMxIDAgMTgxIDUwIDUwIDEzMSA1MCAxODEgMGw2OC42LTY4LjZDMjc0LjYgMzk1LjEgMjQ2LjQgMzkyLjMgMjIwLjMgMzgyLjJ6Ii8+PC9zdmc+Cg=='); + opacity: 0.5; + visibility: hidden; + display: inline-block; + vertical-align: middle; + } + + h1:hover > ${e}::before, h2:hover > ${e}::before, ${e}:hover::before { + visibility: visible; + } +`,_o=te((function(t){const n=e.useContext(xo),r=e.useCallback((e=>{n&&function(e,t,n){t.defaultPrevented||0!==t.button||(e=>!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey))(t)||(t.preventDefault(),e.replace(encodeURI(n)))}(n.menu.history,e,t.to)}),[n,t.to]);return n?e.createElement("a",{className:t.className,href:n.menu.history.linkForId(t.to),onClick:r,"aria-label":t.to},t.children):null}))` + ${Eo("&")}; +`;function Ao(t){return e.createElement(_o,{to:t.to})}const jo={left:"90deg",right:"-90deg",up:"-180deg",down:"0"},To=te((t=>e.createElement("svg",{className:t.className,style:t.style,version:"1.1",viewBox:"0 0 24 24",x:"0",xmlns:"http://www.w3.org/2000/svg",y:"0","aria-hidden":"true"},e.createElement("polygon",{points:"17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "}))))` + height: ${e=>e.size||"18px"}; + width: ${e=>e.size||"18px"}; + min-width: ${e=>e.size||"18px"}; + vertical-align: middle; + float: ${e=>e.float||""}; + transition: transform 0.2s ease-out; + transform: rotateZ(${e=>jo[e.direction||"down"]}); + + polygon { + fill: ${({color:e,theme:t})=>e&&t.colors.responses[e]&&t.colors.responses[e].color||e}; + } +`,Po=te.span` + display: inline-block; + padding: 2px 8px; + margin: 0; + background-color: ${e=>e.theme.colors[e.type].main}; + color: ${e=>e.theme.colors[e.type].contrastText}; + font-size: ${e=>e.theme.typography.code.fontSize}; + vertical-align: middle; + line-height: 1.6; + border-radius: 4px; + font-weight: ${({theme:e})=>e.typography.fontWeightBold}; + font-size: 12px; + + span[type] { + margin-left: 4px; + } +`,Io=X` + text-decoration: line-through; + color: #707070; +`,Co=te.caption` + text-align: right; + font-size: 0.9em; + font-weight: normal; + color: ${e=>e.theme.colors.text.secondary}; +`,Ro=te.td` + border-left: 1px solid ${e=>e.theme.schema.linesColor}; + box-sizing: border-box; + position: relative; + padding: 10px 10px 10px 0; + + ${ee.lessThan("small")` + display: block; + overflow: hidden; + `} + + tr:first-of-type > &, + tr.last > & { + border-left-width: 0; + background-position: top left; + background-repeat: no-repeat; + background-size: 1px 100%; + } + + tr:first-of-type > & { + background-image: linear-gradient( + to bottom, + transparent 0%, + transparent 22px, + ${e=>e.theme.schema.linesColor} 22px, + ${e=>e.theme.schema.linesColor} 100% + ); + } + + tr.last > & { + background-image: linear-gradient( + to bottom, + ${e=>e.theme.schema.linesColor} 0%, + ${e=>e.theme.schema.linesColor} 22px, + transparent 22px, + transparent 100% + ); + } + + tr.last + tr > & { + border-left-color: transparent; + } + + tr.last:first-child > & { + background: none; + border-left-color: transparent; + } +`,No=te(Ro)` + padding: 0; +`,Lo=te(Ro)` + vertical-align: top; + line-height: 20px; + white-space: nowrap; + font-size: 13px; + font-family: ${e=>e.theme.typography.code.fontFamily}; + + &.deprecated { + ${Io}; + } + + ${({kind:e})=>"patternProperties"===e&&X` + > span.property-name { + display: inline-table; + white-space: break-spaces; + margin-right: 20px; + + ::before, + ::after { + content: '/'; + filter: opacity(0.2); + } + } + `} + + ${({kind:e=""})=>["field","additionalProperties","patternProperties"].includes(e)?"":"font-style: italic"}; + + ${ne("PropertyNameCell")}; +`,$o=te.td` + border-bottom: 1px solid #9fb4be; + padding: 10px 0; + width: ${e=>e.theme.schema.defaultDetailsWidth}; + box-sizing: border-box; + + tr.expanded & { + border-bottom: none; + } + + ${ee.lessThan("small")` + padding: 0 20px; + border-bottom: none; + border-left: 1px solid ${e=>e.theme.schema.linesColor}; + + tr.last > & { + border-left: none; + } + `} + + ${ne("PropertyDetailsCell")}; +`,Mo=te.span` + color: ${e=>e.theme.schema.linesColor}; + font-family: ${e=>e.theme.typography.code.fontFamily}; + margin-right: 10px; + + &::before { + content: ''; + display: inline-block; + vertical-align: middle; + width: 10px; + height: 1px; + background: ${e=>e.theme.schema.linesColor}; + } + + &::after { + content: ''; + display: inline-block; + vertical-align: middle; + width: 1px; + background: ${e=>e.theme.schema.linesColor}; + height: 7px; + } +`,Do=te.div` + padding: ${({theme:e})=>e.schema.nestingSpacing}; +`,Fo=te.table` + border-collapse: separate; + border-radius: 3px; + font-size: ${e=>e.theme.typography.fontSize}; + + border-spacing: 0; + width: 100%; + + > tr { + vertical-align: middle; + } + + ${ee.lessThan("small")` + display: block; + > tr, > tbody > tr { + display: block; + } + `} + + ${ee.lessThan("small",!1," and (-ms-high-contrast:none)")` + td { + float: left; + width: 100%; + } + `} + + & + ${Do}, + & + ${Do} + ${Do} + ${Do}, + & + ${Do} + ${Do} + ${Do} + ${Do} + ${Do} { + margin: ${({theme:e})=>e.schema.nestingSpacing}; + margin-right: 0; + background: ${({theme:e})=>e.schema.nestedBackground}; + } + + & + ${Do} + ${Do}, + & + ${Do} + ${Do} + ${Do} + ${Do}, + & + ${Do} + ${Do} + ${Do} + ${Do} + ${Do} + ${Do} { + background: #ffffff; + } +`,Bo=te.div` + margin: 0 0 3px 0; + display: inline-block; +`,zo=te.span` + font-size: 0.9em; + margin-right: 10px; + color: ${e=>e.theme.colors.primary.main}; + font-family: ${e=>e.theme.typography.headings.fontFamily}; +} +`,Uo=te.button` + display: inline-block; + margin-right: 10px; + margin-bottom: 5px; + font-size: 0.8em; + cursor: pointer; + border: 1px solid ${e=>e.theme.colors.primary.main}; + padding: 2px 10px; + line-height: 1.5em; + outline: none; + &:focus { + box-shadow: 0 0 0 1px ${e=>e.theme.colors.primary.main}; + } + + ${({$deprecated:e})=>e&&Io||""}; + + ${e=>e.$active?`\n color: white;\n background-color: ${e.theme.colors.primary.main};\n &:focus {\n box-shadow: none;\n background-color: ${(0,t.darken)(.15,e.theme.colors.primary.main)};\n }\n `:`\n color: ${e.theme.colors.primary.main};\n background-color: white;\n `} +`,qo=te.div` + font-size: 0.9em; + font-family: ${e=>e.theme.typography.code.fontFamily}; + &::after { + content: ' ['; + } +`,Wo=te.div` + font-size: 0.9em; + font-family: ${e=>e.theme.typography.code.fontFamily}; + &::after { + content: ']'; + } +`;var Vo=n(8369);const Qo=te(Vo.Tabs)` + > ul { + list-style: none; + padding: 0; + margin: 0; + margin: 0 -5px; + + > li { + padding: 5px 10px; + display: inline-block; + + background-color: ${({theme:e})=>e.codeBlock.backgroundColor}; + border-bottom: 1px solid rgba(0, 0, 0, 0.5); + cursor: pointer; + text-align: center; + outline: none; + color: ${({theme:e})=>(0,t.darken)(e.colors.tonalOffset,e.rightPanel.textColor)}; + margin: 0 + ${({theme:e})=>`${e.spacing.unit}px ${e.spacing.unit}px ${e.spacing.unit}px`}; + border: 1px solid ${({theme:e})=>(0,t.darken)(.05,e.codeBlock.backgroundColor)}; + border-radius: 5px; + min-width: 60px; + font-size: 0.9em; + font-weight: bold; + + &.react-tabs__tab--selected { + color: ${e=>e.theme.colors.text.primary}; + background: ${({theme:e})=>e.rightPanel.textColor}; + &:focus { + outline: auto; + } + } + + &:only-child { + flex: none; + min-width: 100px; + } + + &.tab-success { + color: ${e=>e.theme.colors.responses.success.tabTextColor}; + } + + &.tab-redirect { + color: ${e=>e.theme.colors.responses.redirect.tabTextColor}; + } + + &.tab-info { + color: ${e=>e.theme.colors.responses.info.tabTextColor}; + } + + &.tab-error { + color: ${e=>e.theme.colors.responses.error.tabTextColor}; + } + } + } + > .react-tabs__tab-panel { + background: ${({theme:e})=>e.codeBlock.backgroundColor}; + & > div, + & > pre { + padding: ${e=>4*e.theme.spacing.unit}px; + margin: 0; + } + + & > div > pre { + padding: 0; + } + } +`,Ho=(te(Qo)` + > ul { + display: block; + > li { + padding: 2px 5px; + min-width: auto; + margin: 0 15px 0 0; + font-size: 13px; + font-weight: normal; + border-bottom: 1px dashed; + color: ${({theme:e})=>(0,t.darken)(e.colors.tonalOffset,e.rightPanel.textColor)}; + border-radius: 0; + background: none; + + &:last-child { + margin-right: 0; + } + + &.react-tabs__tab--selected { + color: ${({theme:e})=>e.rightPanel.textColor}; + background: none; + } + } + } + > .react-tabs__tab-panel { + & > div, + & > pre { + padding: ${e=>2*e.theme.spacing.unit}px 0; + } + } +`,te.div` + /** + * Based on prism-dark.css + */ + + code[class*='language-'], + pre[class*='language-'] { + /* color: white; + background: none; */ + text-shadow: 0 -0.1em 0.2em black; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; + } + + @media print { + code[class*='language-'], + pre[class*='language-'] { + text-shadow: none; + } + } + + /* Code blocks */ + pre[class*='language-'] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; + } + + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: hsl(30, 20%, 50%); + } + + .token.punctuation { + opacity: 0.7; + } + + .namespace { + opacity: 0.7; + } + + .token.property, + .token.tag, + .token.number, + .token.constant, + .token.symbol { + color: #4a8bb3; + } + + .token.boolean { + color: #e64441; + } + + .token.selector, + .token.attr-name, + .token.string, + .token.char, + .token.builtin, + .token.inserted { + color: #a0fbaa; + & + a, + & + a:visited { + color: #4ed2ba; + text-decoration: underline; + } + } + + .token.property.string { + color: white; + } + + .token.operator, + .token.entity, + .token.url, + .token.variable { + color: hsl(40, 90%, 60%); + } + + .token.atrule, + .token.attr-value, + .token.keyword { + color: hsl(350, 40%, 70%); + } + + .token.regex, + .token.important { + color: #e90; + } + + .token.important, + .token.bold { + font-weight: bold; + } + .token.italic { + font-style: italic; + } + + .token.entity { + cursor: help; + } + + .token.deleted { + color: red; + } + + ${ne("Prism")}; +`),Yo=te.div` + opacity: 0.7; + transition: opacity 0.3s ease; + text-align: right; + &:focus-within { + opacity: 1; + } + > button { + background-color: transparent; + border: 0; + color: inherit; + padding: 2px 10px; + font-family: ${({theme:e})=>e.typography.fontFamily}; + font-size: ${({theme:e})=>e.typography.fontSize}; + line-height: ${({theme:e})=>e.typography.lineHeight}; + cursor: pointer; + outline: 0; + + :hover, + :focus { + background: rgba(255, 255, 255, 0.1); + } + } +`,Go=te.div` + &:hover ${Yo} { + opacity: 1; + } +`,Xo=te(Ho).attrs({as:"pre"})` + font-family: ${e=>e.theme.typography.code.fontFamily}; + font-size: ${e=>e.theme.typography.code.fontSize}; + overflow-x: auto; + margin: 0; + + white-space: ${({theme:e})=>e.typography.code.wrap?"pre-wrap":"pre"}; +`;var Ko=n(4772),Jo=r.n(Ko),Zo=Object.defineProperty,es=Object.getOwnPropertySymbols,ts=Object.prototype.hasOwnProperty,ns=Object.prototype.propertyIsEnumerable,rs=(e,t,n)=>t in e?Zo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const is=Jo()||Ko;let os="";a&&(os=r(232),os="function"==typeof os.toString&&os.toString()||"",os="[object Object]"===os?"":os);const ss=K`${os}`,as=te.div` + position: relative; +`;class ls extends e.Component{constructor(){super(...arguments),this.handleRef=e=>{this._container=e}}componentDidMount(){const e=this._container.parentElement&&this._container.parentElement.scrollTop||0;this.inst=new is(this._container,this.props.options||{}),this._container.scrollTo&&this._container.scrollTo(0,e)}componentDidUpdate(){this.inst.update()}componentWillUnmount(){this.inst.destroy()}render(){const{children:t,className:n,updateFn:r}=this.props;return r&&r(this.componentDidUpdate.bind(this)),e.createElement(e.Fragment,null,os&&e.createElement(ss,null),e.createElement(as,{className:`scrollbar-container ${n}`,ref:this.handleRef},t))}}function cs(t){return e.createElement(ue.Consumer,null,(n=>n.nativeScrollbars?e.createElement("div",{style:{overflow:"auto",overscrollBehavior:"contain",msOverflowStyle:"-ms-autohiding-scrollbar"}},t.children):e.createElement(ls,((e,t)=>{for(var n in t||(t={}))ts.call(t,n)&&rs(e,n,t[n]);if(es)for(var n of es(t))ns.call(t,n)&&rs(e,n,t[n]);return e})({},t),t.children)))}const us=te((({className:t,style:n})=>e.createElement("svg",{className:t,style:n,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},e.createElement("polyline",{points:"6 9 12 15 18 9"}))))` + position: absolute; + pointer-events: none; + z-index: 1; + top: 50%; + -webkit-transform: translateY(-50%); + -ms-transform: translateY(-50%); + transform: translateY(-50%); + right: 8px; + margin: auto; + text-align: center; + polyline { + color: ${e=>"dark"===e.variant&&"white"}; + } +`,ps=e.memo((t=>{const{options:n,onChange:r,placeholder:i,value:o="",variant:s,className:a}=t;return e.createElement("div",{className:a},e.createElement(us,{variant:s}),e.createElement("select",{onChange:e=>{const{selectedIndex:t}=e.target;r(n[i?t-1:t])},value:o,className:"dropdown-select"},i&&e.createElement("option",{disabled:!0,hidden:!0,value:i},i),n.map((({idx:t,value:n,title:r},i)=>e.createElement("option",{key:t||n+i,value:n},r||n)))),e.createElement("label",null,o))})),ds=Y()(ps)` + label { + box-sizing: border-box; + min-width: 100px; + outline: none; + display: inline-block; + font-family: ${e=>e.theme.typography.headings.fontFamily}; + color: ${({theme:e})=>e.colors.text.primary}; + vertical-align: bottom; + width: ${({fullWidth:e})=>e?"100%":"auto"}; + text-transform: none; + padding: 0 22px 0 4px; + + font-size: 0.929em; + line-height: 1.5em; + font-family: inherit; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } + .dropdown-select { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + opacity: 0; + border: none; + appearance: none; + cursor: pointer; + + color: ${({theme:e})=>e.colors.text.primary}; + line-height: inherit; + font-family: inherit; + } + box-sizing: border-box; + min-width: 100px; + outline: none; + display: inline-block; + border-radius: 2px; + border: 1px solid rgba(38, 50, 56, 0.5); + vertical-align: bottom; + padding: 2px 0px 2px 6px; + position: relative; + width: auto; + background: white; + color: #263238; + font-family: ${e=>e.theme.typography.headings.fontFamily}; + font-size: 0.929em; + line-height: 1.5em; + cursor: pointer; + transition: border 0.25s ease, color 0.25s ease, box-shadow 0.25s ease; + + &:hover, + &:focus-within { + border: 1px solid ${e=>e.theme.colors.primary.main}; + color: ${e=>e.theme.colors.primary.main}; + box-shadow: 0px 0px 0px 1px ${e=>e.theme.colors.primary.main}; + } +`,fs=Y()(ds)` + margin-left: 10px; + text-transform: none; + font-size: 0.969em; + + font-size: 1em; + border: none; + padding: 0 1.2em 0 0; + background: transparent; + + &:hover, + &:focus-within { + border: none; + box-shadow: none; + label { + color: ${e=>e.theme.colors.primary.main}; + text-shadow: 0px 0px 0px ${e=>e.theme.colors.primary.main}; + } + } +`,hs=Y().span` + margin-left: 10px; + text-transform: none; + font-size: 0.929em; + color: black; +`;var ms=Object.defineProperty,gs=Object.getOwnPropertySymbols,ys=Object.prototype.hasOwnProperty,vs=Object.prototype.propertyIsEnumerable,bs=(e,t,n)=>t in e?ms(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xs=(e,t)=>{for(var n in t||(t={}))ys.call(t,n)&&bs(e,n,t[n]);if(gs)for(var n of gs(t))vs.call(t,n)&&bs(e,n,t[n]);return e};function ws(t){const{Label:n=hs,Dropdown:r=fs}=t;return 1===t.options.length?e.createElement(n,null,t.options[0].value):e.createElement(r,xs({},t))}var ks=n(7856);const Os=X` + a { + text-decoration: ${e=>e.theme.typography.links.textDecoration}; + color: ${e=>e.theme.typography.links.color}; + + &:visited { + color: ${e=>e.theme.typography.links.visited}; + } + + &:hover { + color: ${e=>e.theme.typography.links.hover}; + text-decoration: ${e=>e.theme.typography.links.hoverTextDecoration}; + } + } +`,Ss=te(Ho)` + font-family: ${e=>e.theme.typography.fontFamily}; + font-weight: ${e=>e.theme.typography.fontWeightRegular}; + line-height: ${e=>e.theme.typography.lineHeight}; + + p { + &:last-child { + margin-bottom: 0; + } + } + + ${({$compact:e})=>e&&"\n p:first-child {\n margin-top: 0;\n }\n p:last-child {\n margin-bottom: 0;\n }\n "} + + ${({$inline:e})=>e&&" p {\n display: inline-block;\n }"} + + h1 { + ${ho(1)}; + color: ${e=>e.theme.colors.primary.main}; + margin-top: 0; + } + + h2 { + ${ho(2)}; + color: ${e=>e.theme.colors.text.primary}; + } + + code { + color: ${({theme:e})=>e.typography.code.color}; + background-color: ${({theme:e})=>e.typography.code.backgroundColor}; + + font-family: ${e=>e.theme.typography.code.fontFamily}; + border-radius: 2px; + border: 1px solid rgba(38, 50, 56, 0.1); + padding: 0 ${({theme:e})=>e.spacing.unit}px; + font-size: ${e=>e.theme.typography.code.fontSize}; + font-weight: ${({theme:e})=>e.typography.code.fontWeight}; + + word-break: break-word; + } + + pre { + font-family: ${e=>e.theme.typography.code.fontFamily}; + white-space: ${({theme:e})=>e.typography.code.wrap?"pre-wrap":"pre"}; + background-color: ${({theme:e})=>e.codeBlock.backgroundColor}; + color: white; + padding: ${e=>4*e.theme.spacing.unit}px; + overflow-x: auto; + line-height: normal; + border-radius: 0; + border: 1px solid rgba(38, 50, 56, 0.1); + + code { + background-color: transparent; + color: white; + padding: 0; + + &:before, + &:after { + content: none; + } + } + } + + blockquote { + margin: 0; + margin-bottom: 1em; + padding: 0 15px; + color: #777; + border-left: 4px solid #ddd; + } + + img { + max-width: 100%; + box-sizing: content-box; + } + + ul, + ol { + padding-left: 2em; + margin: 0; + margin-bottom: 1em; + + ul, + ol { + margin-bottom: 0; + margin-top: 0; + } + } + + table { + display: block; + width: 100%; + overflow: auto; + word-break: normal; + word-break: keep-all; + border-collapse: collapse; + border-spacing: 0; + margin-top: 1.5em; + margin-bottom: 1.5em; + } + + table tr { + background-color: #fff; + border-top: 1px solid #ccc; + + &:nth-child(2n) { + background-color: ${({theme:e})=>e.schema.nestedBackground}; + } + } + + table th, + table td { + padding: 6px 13px; + border: 1px solid #ddd; + } + + table th { + text-align: left; + font-weight: bold; + } + + ${Eo(".share-link")}; + + ${Os} + + ${ne("Markdown")}; +`;var Es=Object.defineProperty,_s=Object.defineProperties,As=Object.getOwnPropertyDescriptors,js=Object.getOwnPropertySymbols,Ts=Object.prototype.hasOwnProperty,Ps=Object.prototype.propertyIsEnumerable,Is=(e,t,n)=>t in e?Es(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cs=(e,t)=>{for(var n in t||(t={}))Ts.call(t,n)&&Is(e,n,t[n]);if(js)for(var n of js(t))Ps.call(t,n)&&Is(e,n,t[n]);return e};const Rs=Y()((t=>e.createElement(Ss,Cs({},t))))` + display: inline; +`;function Ns(t){var n=t,{inline:r,compact:i}=n,o=((e,t)=>{var n={};for(var r in e)Ts.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&js)for(var r of js(e))t.indexOf(r)<0&&Ps.call(e,r)&&(n[r]=e[r]);return n})(n,["inline","compact"]);const s=r?Rs:Ss;return e.createElement(de,null,(t=>{return e.createElement(s,(n=Cs({className:"redoc-markdown "+(o.className||""),dangerouslySetInnerHTML:{__html:(a=t.untrustedSpec,l=o.html,a?ks.sanitize(l):l)},"data-role":o["data-role"]},o),_s(n,As({$inline:r,$compact:i}))));var n,a,l}))}class Ls extends e.Component{render(){const{source:t,inline:n,compact:r,className:i,"data-role":o}=this.props,s=new Qn;return e.createElement(Ns,{html:s.renderMd(t),inline:n,compact:r,className:i,"data-role":o})}}const $s=te.div` + position: relative; +`,Ms=te.div` + position: absolute; + min-width: 80px; + max-width: 500px; + background: #fff; + bottom: 100%; + left: 50%; + margin-bottom: 10px; + transform: translateX(-50%); + + border-radius: 4px; + padding: 0.3em 0.6em; + text-align: center; + box-shadow: 0px 0px 5px 0px rgba(204, 204, 204, 1); +`,Ds=te.div` + background: #fff; + color: #000; + display: inline; + font-size: 0.85em; + white-space: nowrap; +`,Fs=te.div` + position: absolute; + width: 0; + height: 0; + bottom: -5px; + left: 50%; + margin-left: -5px; + border-left: solid transparent 5px; + border-right: solid transparent 5px; + border-top: solid #fff 5px; +`,Bs=te.div` + position: absolute; + width: 100%; + height: 20px; + bottom: -20px; +`;class zs extends e.Component{render(){const{open:t,title:n,children:r}=this.props;return e.createElement($s,null,r,t&&e.createElement(Ms,null,e.createElement(Ds,null,n),e.createElement(Fs,null),e.createElement(Bs,null)))}}const Us="undefined"!=typeof document&&document.queryCommandSupported&&document.queryCommandSupported("copy");class qs{static isSupported(){return Us}static selectElement(e){let t,n;document.body.createTextRange?(t=document.body.createTextRange(),t.moveToElementText(e),t.select()):document.createRange&&window.getSelection&&(n=window.getSelection(),t=document.createRange(),t.selectNodeContents(e),n.removeAllRanges(),n.addRange(t))}static deselect(){if(document.selection)document.selection.empty();else if(window.getSelection){const e=window.getSelection();e&&e.removeAllRanges()}}static copySelected(){let e;try{e=document.execCommand("copy")}catch(t){e=!1}return e}static copyElement(e){qs.selectElement(e);const t=qs.copySelected();return t&&qs.deselect(),t}static copyCustom(e){const t=document.createElement("textarea");t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.width="2em",t.style.height="2em",t.style.padding="0",t.style.border="none",t.style.outline="none",t.style.boxShadow="none",t.style.background="transparent",t.value=e,document.body.appendChild(t),t.select();const n=qs.copySelected();return document.body.removeChild(t),n}}const Ws=t=>{const[n,r]=e.useState(!1),i=()=>{const e="string"==typeof t.data?t.data:JSON.stringify(t.data,null,2);qs.copyCustom(e),o()},o=()=>{r(!0),setTimeout((()=>{r(!1)}),1500)};return t.children({renderCopyButton:()=>e.createElement("button",{onClick:i},e.createElement(zs,{title:qs.isSupported()?"Copied":"Not supported in your browser",open:n},"Copy"))})};let Vs=1;function Qs(e,t){Vs=1;let n="";return n+='<div class="redoc-json">',n+="<code>",n+=Ks(e,t),n+="</code>",n+="</div>",n}function Hs(e){return void 0!==e?e.toString().replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">"):""}function Ys(e){return JSON.stringify(e).slice(1,-1)}function Gs(e,t){return'<span class="'+t+'">'+Hs(e)+"</span>"}function Xs(e){return'<span class="token punctuation">'+e+"</span>"}function Ks(e,t){const n=typeof e;let r="";return null==e?r+=Gs("null","token keyword"):e&&e.constructor===Array?(Vs++,r+=function(e,t){const n=Vs>t?"collapsed":"";let r=`<button class="collapser" aria-label="${Vs>t+1?"expand":"collapse"}"></button>${Xs("[")}<span class="ellipsis"></span><ul class="array collapsible">`,i=!1;const o=e.length;for(let s=0;s<o;s++)i=!0,r+='<li><div class="hoverable '+n+'">',r+=Ks(e[s],t),s<o-1&&(r+=","),r+="</div></li>";return r+=`</ul>${Xs("]")}`,i||(r=Xs("[ ]")),r}(e,t),Vs--):e&&e.constructor===Date?r+=Gs('"'+e.toISOString()+'"',"token string"):"object"===n?(Vs++,r+=function(e,t){const n=Vs>t?"collapsed":"",r=Object.keys(e),i=r.length;let o=`<button class="collapser" aria-label="${Vs>t+1?"expand":"collapse"}"></button>${Xs("{")}<span class="ellipsis"></span><ul class="obj collapsible">`,s=!1;for(let a=0;a<i;a++){const l=r[a];s=!0,o+='<li><div class="hoverable '+n+'">',o+='<span class="property token string">"'+Hs(l)+'"</span>: ',o+=Ks(e[l],t),a<i-1&&(o+=Xs(",")),o+="</div></li>"}return o+=`</ul>${Xs("}")}`,s||(o=Xs("{ }")),o}(e,t),Vs--):"number"===n?r+=Gs(e,"token number"):"string"===n?/^(http|https):\/\/[^\s]+$/.test(e)?r+=Gs('"',"token string")+'<a href="'+encodeURI(e)+'">'+Hs(Ys(e))+"</a>"+Gs('"',"token string"):r+=Gs('"'+Ys(e)+'"',"token string"):"boolean"===n&&(r+=Gs(e,"token boolean")),r}const Js=X` + .redoc-json code > .collapser { + display: none; + pointer-events: none; + } + + font-family: ${e=>e.theme.typography.code.fontFamily}; + font-size: ${e=>e.theme.typography.code.fontSize}; + + white-space: ${({theme:e})=>e.typography.code.wrap?"pre-wrap":"pre"}; + contain: content; + overflow-x: auto; + + .callback-function { + color: gray; + } + + .collapser:after { + content: '-'; + cursor: pointer; + } + + .collapsed > .collapser:after { + content: '+'; + cursor: pointer; + } + + .ellipsis:after { + content: ' … '; + } + + .collapsible { + margin-left: 2em; + } + + .hoverable { + padding-top: 1px; + padding-bottom: 1px; + padding-left: 2px; + padding-right: 2px; + border-radius: 2px; + } + + .hovered { + background-color: rgba(235, 238, 249, 1); + } + + .collapser { + background-color: transparent; + border: 0; + color: #fff; + font-family: ${e=>e.theme.typography.code.fontFamily}; + font-size: ${e=>e.theme.typography.code.fontSize}; + padding-right: 6px; + padding-left: 6px; + padding-top: 0; + padding-bottom: 0; + display: flex; + align-items: center; + justify-content: center; + width: 15px; + height: 15px; + position: absolute; + top: 4px; + left: -1.5em; + cursor: default; + user-select: none; + -webkit-user-select: none; + padding: 2px; + &:focus { + outline-color: #fff; + outline-style: dotted; + outline-width: 1px; + } + } + + ul { + list-style-type: none; + padding: 0px; + margin: 0px 0px 0px 26px; + } + + li { + position: relative; + display: block; + } + + .hoverable { + display: inline-block; + } + + .selected { + outline-style: solid; + outline-width: 1px; + outline-style: dotted; + } + + .collapsed > .collapsible { + display: none; + } + + .ellipsis { + display: none; + } + + .collapsed > .ellipsis { + display: inherit; + } +`,Zs=te.div` + &:hover > ${Yo} { + opacity: 1; + } +`,ea=te((t=>{const[n,r]=e.useState(),i=({renderCopyButton:n})=>{const i=t.data&&Object.values(t.data).some((e=>"object"==typeof e&&null!==e));return e.createElement(Zs,null,e.createElement(Yo,null,n(),i&&e.createElement(e.Fragment,null,e.createElement("button",{onClick:o}," Expand all "),e.createElement("button",{onClick:s}," Collapse all "))),e.createElement(ue.Consumer,null,(n=>e.createElement(Ho,{className:t.className,ref:e=>r(e),dangerouslySetInnerHTML:{__html:Qs(t.data,n.jsonSampleExpandLevel)}}))))},o=()=>{const e=null==n?void 0:n.getElementsByClassName("collapsible");for(const t of Array.prototype.slice.call(e)){const e=t.parentNode;e.classList.remove("collapsed"),e.querySelector(".collapser").setAttribute("aria-label","collapse")}},s=()=>{const e=null==n?void 0:n.getElementsByClassName("collapsible"),t=Array.prototype.slice.call(e,1);for(const n of t){const e=n.parentNode;e.classList.add("collapsed"),e.querySelector(".collapser").setAttribute("aria-label","expand")}},a=e=>{let t;"collapser"===e.className&&(t=e.parentElement.getElementsByClassName("collapsible")[0],t.parentElement.classList.contains("collapsed")?(t.parentElement.classList.remove("collapsed"),e.setAttribute("aria-label","collapse")):(t.parentElement.classList.add("collapsed"),e.setAttribute("aria-label","expand")))},l=e.useCallback((e=>{a(e.target)}),[]),c=e.useCallback((e=>{"Enter"===e.key&&a(e.target)}),[]);return e.useEffect((()=>(null==n||n.addEventListener("click",l),null==n||n.addEventListener("focus",c),()=>{null==n||n.removeEventListener("click",l),null==n||n.removeEventListener("focus",c)})),[l,c,n]),e.createElement(Ws,{data:t.data},i)}))` + ${Js}; +`,ta=t=>{const{source:n,lang:r}=t;return e.createElement(Xo,{dangerouslySetInnerHTML:{__html:_t(n,r)}})},na=t=>{const{source:n,lang:r}=t;return e.createElement(Ws,{data:n},(({renderCopyButton:t})=>e.createElement(Go,null,e.createElement(Yo,null,t()),e.createElement(ta,{lang:r,source:n}))))};function ra({value:t,mimeType:n}){return Ve(n)?e.createElement(ea,{data:t}):("object"==typeof t&&(t=JSON.stringify(t,null,2)),e.createElement(na,{lang:et(n),source:t}))}var ia=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}));function oa({example:t,mimeType:n}){return void 0===t.value&&t.externalValueUrl?e.createElement(sa,{example:t,mimeType:n}):e.createElement(ra,{value:t.value,mimeType:n})}function sa({example:t,mimeType:n}){const r=function(t,n){const[,r]=(0,e.useState)(!0),i=(0,e.useRef)(void 0),o=(0,e.useRef)(void 0);return o.current!==t&&(i.current=void 0),o.current=t,(0,e.useEffect)((()=>{(()=>{ia(this,null,(function*(){r(!0);try{i.current=yield t.getExternalValue(n)}catch(e){i.current=e}r(!1)}))})()}),[t,n]),i.current}(t,n);return void 0===r?e.createElement("span",null,"Loading..."):r instanceof Error?e.createElement(Xo,null,"Error loading external example: ",e.createElement("br",null),e.createElement("a",{className:"token string",href:t.externalValueUrl,target:"_blank",rel:"noopener noreferrer"},t.externalValueUrl)):e.createElement(ra,{value:r,mimeType:n})}const aa=te.div` + padding: 0.9em; + background-color: ${({theme:e})=>(0,t.transparentize)(.6,e.rightPanel.backgroundColor)}; + margin: 0 0 10px 0; + display: block; + font-family: ${({theme:e})=>e.typography.headings.fontFamily}; + font-size: 0.929em; + line-height: 1.5em; +`,la=te.span` + font-family: ${({theme:e})=>e.typography.headings.fontFamily}; + font-size: 12px; + position: absolute; + z-index: 1; + top: -11px; + left: 12px; + font-weight: ${({theme:e})=>e.typography.fontWeightBold}; + color: ${({theme:e})=>(0,t.transparentize)(.3,e.rightPanel.textColor)}; +`,ca=te.div` + position: relative; +`,ua=te(ds)` + label { + color: ${({theme:e})=>e.rightPanel.textColor}; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + font-size: 1em; + text-transform: none; + border: none; + } + margin: 0 0 10px 0; + display: block; + background-color: ${({theme:e})=>(0,t.transparentize)(.6,e.rightPanel.backgroundColor)}; + border: none; + padding: 0.9em 1.6em 0.9em 0.9em; + box-shadow: none; + &:hover, + &:focus-within { + border: none; + box-shadow: none; + background-color: ${({theme:e})=>(0,t.transparentize)(.3,e.rightPanel.backgroundColor)}; + } +`,pa=te.div` + font-family: ${e=>e.theme.typography.code.fontFamily}; + font-size: 12px; + color: #ee807f; +`;class da extends e.Component{constructor(){super(...arguments),this.state={activeIdx:0},this.switchMedia=({idx:e})=>{void 0!==e&&this.setState({activeIdx:e})}}render(){const{activeIdx:t}=this.state,n=this.props.mediaType.examples||{},r=this.props.mediaType.name,i=e.createElement(pa,null,"No sample"),o=Object.keys(n);if(0===o.length)return i;if(o.length>1){const i=o.map(((e,t)=>({value:n[e].summary||e,idx:t}))),s=n[o[t]],a=s.description;return e.createElement(fa,null,e.createElement(ca,null,e.createElement(la,null,"Example"),this.props.renderDropdown({value:i[t].value,options:i,onChange:this.switchMedia,ariaLabel:"Example"})),e.createElement("div",null,a&&e.createElement(Ls,{source:a}),e.createElement(oa,{example:s,mimeType:r})))}{const t=n[o[0]];return e.createElement(fa,null,t.description&&e.createElement(Ls,{source:t.description}),e.createElement(oa,{example:t,mimeType:r}))}}}const fa=te.div` + margin-top: 15px; +`;var ha=n(4851);const ma=te(Lo)` + button { + background-color: transparent; + border: 0; + outline: 0; + font-size: 13px; + font-family: ${e=>e.theme.typography.code.fontFamily}; + cursor: pointer; + padding: 0; + color: ${e=>e.theme.colors.text.primary}; + &:focus { + font-weight: ${({theme:e})=>e.typography.fontWeightBold}; + } + ${({kind:e})=>"patternProperties"===e&&X` + display: inline-flex; + margin-right: 20px; + + > span.property-name { + white-space: break-spaces; + text-align: left; + + ::before, + ::after { + content: '/'; + filter: opacity(0.2); + } + } + + > svg { + align-self: center; + } + `} + } + ${To} { + height: ${({theme:e})=>e.schema.arrow.size}; + width: ${({theme:e})=>e.schema.arrow.size}; + polygon { + fill: ${({theme:e})=>e.schema.arrow.color}; + } + } +`,ga=te.span` + vertical-align: middle; + font-size: ${({theme:e})=>e.typography.code.fontSize}; + line-height: 20px; +`,ya=te(ga)` + color: ${e=>(0,t.transparentize)(.1,e.theme.schema.typeNameColor)}; +`,va=te(ga)` + color: ${e=>e.theme.schema.typeNameColor}; +`,ba=te(ga)` + color: ${e=>e.theme.schema.typeTitleColor}; + word-break: break-word; +`,xa=va,wa=te(ga).attrs({as:"div"})` + color: ${e=>e.theme.schema.requireLabelColor}; + font-size: ${e=>e.theme.schema.labelsTextSize}; + font-weight: normal; + margin-left: 20px; + line-height: 1; +`,ka=te(wa)` + color: ${e=>e.theme.colors.primary.light}; +`,Oa=te(ga)` + color: ${({theme:e})=>e.colors.warning.main}; + font-size: 13px; +`,Sa=te(ga)` + color: #0e7c86; + &::before, + &::after { + font-weight: bold; + } +`,Ea=te(ga)` + border-radius: 2px; + word-break: break-word; + ${({theme:e})=>`\n background-color: ${(0,t.transparentize)(.95,e.colors.text.primary)};\n color: ${(0,t.transparentize)(.1,e.colors.text.primary)};\n\n padding: 0 ${e.spacing.unit}px;\n border: 1px solid ${(0,t.transparentize)(.9,e.colors.text.primary)};\n font-family: ${e.typography.code.fontFamily};\n}`}; + & + & { + margin-left: 0; + } + ${ne("ExampleValue")}; +`,_a=te(Ea)``,Aa=te(ga)` + border-radius: 2px; + ${({theme:e})=>`\n background-color: ${(0,t.transparentize)(.95,e.colors.primary.light)};\n color: ${(0,t.transparentize)(.1,e.colors.primary.main)};\n\n margin: 0 ${e.spacing.unit}px;\n padding: 0 ${e.spacing.unit}px;\n border: 1px solid ${(0,t.transparentize)(.9,e.colors.primary.main)};\n}`}; + & + & { + margin-left: 0; + } + ${ne("ConstraintItem")}; +`,ja=te.button` + background-color: transparent; + border: 0; + color: ${({theme:e})=>e.colors.text.secondary}; + margin-left: ${({theme:e})=>e.spacing.unit}px; + border-radius: 2px; + cursor: pointer; + outline-color: ${({theme:e})=>e.colors.text.secondary}; + font-size: 12px; +`;Object.defineProperty,Object.getOwnPropertyDescriptor;const Ta=te.div` + ${Os}; + ${({$compact:e})=>e?"":"margin: 1em 0"} +`;let Pa=class extends e.Component{render(){const{externalDocs:t}=this.props;return t&&t.url?e.createElement(Ta,{$compact:this.props.compact},e.createElement("a",{href:t.url},t.description||t.url)):null}};Pa=((e,t,n,r)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([ha.observer],Pa);class Ia extends e.PureComponent{constructor(){super(...arguments),this.state={collapsed:!0}}toggle(){this.setState({collapsed:!this.state.collapsed})}render(){const{values:t,isArrayType:n}=this.props,{collapsed:r}=this.state,{enumSkipQuotes:i,maxDisplayedEnumValues:o}=this.context;if(!t.length)return null;const s=this.state.collapsed&&o?t.slice(0,o):t,a=!!o&&t.length>o,l=o?r?`\u2026 ${t.length-o} more`:"Hide":"";return e.createElement("div",null,e.createElement(ga,null,n?N("enumArray"):""," ",1===t.length?N("enumSingleValue"):N("enum"),":")," ",s.map(((t,n)=>{const r=i?String(t):JSON.stringify(t);return e.createElement(e.Fragment,{key:n},e.createElement(Ea,null,r)," ")})),a?e.createElement(Ca,{onClick:()=>{this.toggle()}},l):null)}}Ia.contextType=ue;const Ca=te.span` + color: ${e=>e.theme.colors.primary.main}; + vertical-align: middle; + font-size: 13px; + line-height: 20px; + padding: 0 5px; + cursor: pointer; +`,Ra=te(Ss)` + margin: 2px 0; +`;class Na extends e.PureComponent{render(){const t=this.props.extensions;return e.createElement(ue.Consumer,null,(n=>e.createElement(e.Fragment,null,n.showExtensions&&Object.keys(t).map((n=>e.createElement(Ra,{key:n},e.createElement(ga,null," ",n.substring(2),": ")," ",e.createElement(_a,null,"string"==typeof t[n]?t[n]:JSON.stringify(t[n]))))))))}}function La({field:t}){return t.examples?e.createElement(e.Fragment,null,e.createElement(ga,null," ",N("examples"),": "),I(t.examples)?t.examples.map(((n,r)=>{const i=Ze(t,n),o=t.in?String(i):JSON.stringify(i);return e.createElement(e.Fragment,{key:r},e.createElement(Ea,null,o)," ")})):e.createElement($a,null,Object.values(t.examples).map(((n,r)=>e.createElement("li",{key:r+n.value},e.createElement(Ea,null,Ze(t,n.value))," -"," ",n.summary||n.description))))):null}const $a=te.ul` + margin-top: 1em; + list-style-position: outside; +`;class Ma extends e.PureComponent{render(){return 0===this.props.constraints.length?null:e.createElement("span",null," ",this.props.constraints.map((t=>e.createElement(Aa,{key:t}," ",t," "))))}}const Da=e.memo((function({value:t,label:n,raw:r}){if(void 0===t)return null;const i=r?String(t):JSON.stringify(t);return e.createElement("div",null,e.createElement(ga,null," ",n," ")," ",e.createElement(Ea,null,i))})),Fa=45;function Ba(t){const n=t.schema.pattern,{hideSchemaPattern:r}=e.useContext(ue),[i,o]=e.useState(!1),s=e.useCallback((()=>o(!i)),[i]);return!n||r?null:e.createElement(e.Fragment,null,e.createElement(Sa,null,i||n.length<Fa?n:`${n.substr(0,Fa)}...`),n.length>Fa&&e.createElement(ja,{onClick:s},i?"Hide pattern":"Show pattern"))}function za({schema:t}){var n;const{hideSchemaPattern:r}=e.useContext(ue);return t&&((null==t?void 0:t.pattern)&&!r||t.items||t.displayFormat||(null==(n=t.constraints)?void 0:n.length))?"string"===t.type&&t.pattern?e.createElement(Ua,null,"[",e.createElement(Ba,{schema:t}),"]"):e.createElement(Ua,null,"[ items",t.displayFormat&&e.createElement(xa,null," <",t.displayFormat," >"),e.createElement(Ma,{constraints:t.constraints}),e.createElement(Ba,{schema:t}),t.items&&e.createElement(za,{schema:t.items})," ]"):null}const Ua=te(ya)` + margin: 0 5px; + vertical-align: text-top; +`;var qa=Object.defineProperty,Wa=Object.getOwnPropertySymbols,Va=Object.prototype.hasOwnProperty,Qa=Object.prototype.propertyIsEnumerable,Ha=(e,t,n)=>t in e?qa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ya=(e,t)=>{for(var n in t||(t={}))Va.call(t,n)&&Ha(e,n,t[n]);if(Wa)for(var n of Wa(t))Qa.call(t,n)&&Ha(e,n,t[n]);return e};const Ga=(0,ha.observer)((t=>{const{enumSkipQuotes:n,hideSchemaTitles:r}=e.useContext(ue),{showExamples:i,field:o,renderDiscriminatorSwitch:s}=t,{schema:a,description:l,deprecated:c,extensions:u,in:p,const:d}=o,f="array"===a.type,h=n||"header"===p,m=e.useMemo((()=>!i||void 0===o.example&&void 0===o.examples?null:void 0!==o.examples?e.createElement(La,{field:o}):e.createElement(Da,{label:N("example")+":",value:Ze(o,o.example),raw:Boolean(o.in)})),[o,i]),g=x(a.default)&&o.in?Ze(o,a.default).replace(`${o.name}=`,""):a.default;return e.createElement("div",null,e.createElement("div",null,e.createElement(ya,null,a.typePrefix),e.createElement(va,null,a.displayType),a.displayFormat&&e.createElement(xa,null," ","<",a.displayFormat,">"," "),a.contentEncoding&&e.createElement(xa,null," ","<",a.contentEncoding,">"," "),a.contentMediaType&&e.createElement(xa,null," ","<",a.contentMediaType,">"," "),a.title&&!r&&e.createElement(ba,null," (",a.title,") "),e.createElement(Ma,{constraints:a.constraints}),e.createElement(Ba,{schema:a}),a.isCircular&&e.createElement(Oa,null," ",N("recursive")," "),f&&a.items&&e.createElement(za,{schema:a.items})),c&&e.createElement("div",null,e.createElement(Po,{type:"warning"}," ",N("deprecated")," ")),e.createElement(Da,{raw:h,label:N("default")+":",value:g}),!s&&e.createElement(Ia,{isArrayType:f,values:a.enum})," ",m,e.createElement(Na,{extensions:Ya(Ya({},u),a.extensions)}),e.createElement("div",null,e.createElement(Ls,{compact:!0,source:l})),a.externalDocs&&e.createElement(Pa,{externalDocs:a.externalDocs,compact:!0}),s&&s(t)||null,d&&e.createElement(Da,{label:N("const")+":",value:d})||null)})),Xa=e.memo(Ga);var Ka=Object.defineProperty,Ja=(Object.getOwnPropertyDescriptor,Object.getOwnPropertySymbols),Za=Object.prototype.hasOwnProperty,el=Object.prototype.propertyIsEnumerable,tl=(e,t,n)=>t in e?Ka(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;let nl=class extends e.Component{constructor(){super(...arguments),this.toggle=()=>{void 0===this.props.field.expanded&&this.props.expandByDefault?this.props.field.collapse():this.props.field.toggle()},this.handleKeyPress=e=>{"Enter"===e.key&&(e.preventDefault(),this.toggle())}}render(){const{className:t="",field:n,isLast:r,expandByDefault:i}=this.props,{name:o,deprecated:s,required:a,kind:l}=n,c=!n.schema.isPrimitive&&!n.schema.isCircular,u=void 0===n.expanded?i:n.expanded,p=e.createElement(e.Fragment,null,"additionalProperties"===l&&e.createElement(ka,null,"additional property"),"patternProperties"===l&&e.createElement(ka,null,"pattern property"),a&&e.createElement(wa,null,"required")),d=c?e.createElement(ma,{className:s?"deprecated":"",kind:l,title:o},e.createElement(Mo,null),e.createElement("button",{onClick:this.toggle,onKeyPress:this.handleKeyPress,"aria-label":`expand ${o}`},e.createElement("span",{className:"property-name"},o),e.createElement(To,{direction:u?"down":"right"})),p):e.createElement(Lo,{className:s?"deprecated":void 0,kind:l,title:o},e.createElement(Mo,null),e.createElement("span",{className:"property-name"},o),p);return e.createElement(e.Fragment,null,e.createElement("tr",{className:r?"last "+t:t},d,e.createElement($o,null,e.createElement(Xa,((e,t)=>{for(var n in t||(t={}))Za.call(t,n)&&tl(e,n,t[n]);if(Ja)for(var n of Ja(t))el.call(t,n)&&tl(e,n,t[n]);return e})({},this.props)))),u&&c&&e.createElement("tr",{key:n.name+"inner"},e.createElement(No,{colSpan:2},e.createElement(Do,null,e.createElement(Ml,{schema:n.schema,skipReadOnly:this.props.skipReadOnly,skipWriteOnly:this.props.skipWriteOnly,showTitle:this.props.showTitle,level:this.props.level})))))}};nl=((e,t,n,r)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([ha.observer],nl),Object.defineProperty,Object.getOwnPropertyDescriptor;let rl=class extends e.Component{constructor(){super(...arguments),this.changeActiveChild=e=>{void 0!==e.idx&&this.props.parent.activateOneOf(e.idx)}}sortOptions(e,t){if(0===t.length)return;const n={};t.forEach(((e,t)=>{n[e]=t})),e.sort(((e,t)=>n[e.value]>n[t.value]?1:-1))}render(){const{parent:t,enumValues:n}=this.props;if(void 0===t.oneOf)return null;const r=t.oneOf.map(((e,t)=>({value:e.title,idx:t}))),i=r[t.activeOneOf].value;return this.sortOptions(r,n),e.createElement(ds,{value:i,options:r,onChange:this.changeActiveChild,ariaLabel:"Example"})}};rl=((e,t,n,r)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([ha.observer],rl);const il=(0,ha.observer)((({schema:{fields:t=[],title:n},showTitle:r,discriminator:i,skipReadOnly:o,skipWriteOnly:s,level:a})=>{const{expandSingleSchemaField:l,showObjectSchemaExamples:c,schemaExpansionLevel:u}=e.useContext(ue),p=e.useMemo((()=>o||s?t.filter((e=>!(o&&e.schema.readOnly||s&&e.schema.writeOnly))):t),[o,s,t]),d=l&&1===p.length||u>=a;return e.createElement(Fo,null,r&&e.createElement(Co,null,n),e.createElement("tbody",null,f(p,((t,n)=>e.createElement(nl,{key:t.name,isLast:n,field:t,expandByDefault:d,renderDiscriminatorSwitch:(null==i?void 0:i.fieldName)===t.name?()=>e.createElement(rl,{parent:i.parentSchema,enumValues:t.schema.enum}):void 0,className:t.expanded?"expanded":void 0,showExamples:c,skipReadOnly:o,skipWriteOnly:s,showTitle:r,level:a})))))}));var ol=Object.defineProperty,sl=Object.defineProperties,al=Object.getOwnPropertyDescriptors,ll=Object.getOwnPropertySymbols,cl=Object.prototype.hasOwnProperty,ul=Object.prototype.propertyIsEnumerable,pl=(e,t,n)=>t in e?ol(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dl=(e,t)=>{for(var n in t||(t={}))cl.call(t,n)&&pl(e,n,t[n]);if(ll)for(var n of ll(t))ul.call(t,n)&&pl(e,n,t[n]);return e},fl=(e,t)=>sl(e,al(t));const hl=te.div` + padding-left: ${({theme:e})=>2*e.spacing.unit}px; +`;class ml extends e.PureComponent{render(){const t=this.props.schema,n=t.items,r=void 0===t.minItems&&void 0===t.maxItems?"":`(${st(t)})`;return t.fields?e.createElement(il,fl(dl({},this.props),{level:this.props.level})):!t.displayType||n||r.length?e.createElement("div",null,e.createElement(qo,null," Array ",r),e.createElement(hl,null,e.createElement(Ml,fl(dl({},this.props),{schema:n}))),e.createElement(Wo,null)):e.createElement("div",null,e.createElement(va,null,t.displayType))}}var gl=Object.defineProperty,yl=Object.defineProperties,vl=Object.getOwnPropertyDescriptor,bl=Object.getOwnPropertyDescriptors,xl=Object.getOwnPropertySymbols,wl=Object.prototype.hasOwnProperty,kl=Object.prototype.propertyIsEnumerable,Ol=(e,t,n)=>t in e?gl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sl=(e,t,n,r)=>{for(var i,o=r>1?void 0:r?vl(t,n):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&gl(t,n,o),o};let El=class extends e.Component{constructor(){super(...arguments),this.activateOneOf=()=>{this.props.schema.activateOneOf(this.props.idx)}}render(){const{idx:t,schema:n,subSchema:r}=this.props;return e.createElement(Uo,{$deprecated:r.deprecated,$active:t===n.activeOneOf,onClick:this.activateOneOf},r.title||r.typePrefix+r.displayType)}};El=Sl([ha.observer],El);let _l=class extends e.Component{render(){const{schema:{oneOf:t},schema:n}=this.props;if(void 0===t)return null;const r=t[n.activeOneOf];return e.createElement("div",null,e.createElement(zo,null," ",n.oneOfType," "),e.createElement(Bo,null,t.map(((t,r)=>e.createElement(El,{key:t.pointer,schema:n,subSchema:t,idx:r})))),e.createElement("div",null,t[n.activeOneOf].deprecated&&e.createElement(Po,{type:"warning"},"Deprecated")),e.createElement(Ma,{constraints:r.constraints}),e.createElement(Ml,(i=((e,t)=>{for(var n in t||(t={}))wl.call(t,n)&&Ol(e,n,t[n]);if(xl)for(var n of xl(t))kl.call(t,n)&&Ol(e,n,t[n]);return e})({},this.props),yl(i,bl({schema:r})))));var i}};_l=Sl([ha.observer],_l);const Al=(0,ha.observer)((({schema:t})=>e.createElement("div",null,e.createElement(va,null,t.displayType),t.title&&e.createElement(ba,null," ",t.title," "),e.createElement(Oa,null," ",N("recursive")," "))));var jl=Object.defineProperty,Tl=Object.defineProperties,Pl=(Object.getOwnPropertyDescriptor,Object.getOwnPropertyDescriptors),Il=Object.getOwnPropertySymbols,Cl=Object.prototype.hasOwnProperty,Rl=Object.prototype.propertyIsEnumerable,Nl=(e,t,n)=>t in e?jl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ll=(e,t)=>{for(var n in t||(t={}))Cl.call(t,n)&&Nl(e,n,t[n]);if(Il)for(var n of Il(t))Rl.call(t,n)&&Nl(e,n,t[n]);return e},$l=(e,t)=>Tl(e,Pl(t));let Ml=class extends e.Component{render(){var t;const n=this.props,{schema:r}=n,i=((e,t)=>{var n={};for(var r in e)Cl.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Il)for(var r of Il(e))t.indexOf(r)<0&&Rl.call(e,r)&&(n[r]=e[r]);return n})(n,["schema"]),o=(i.level||0)+1;if(!r)return e.createElement("em",null," Schema not provided ");const{type:s,oneOf:a,discriminatorProp:l,isCircular:c}=r;if(c)return e.createElement(Al,{schema:r});if(void 0!==l){if(!a||!a.length)return console.warn(`Looks like you are using discriminator wrong: you don't have any definition inherited from the ${r.title}`),null;const t=a[r.activeOneOf];return t.isCircular?e.createElement(Al,{schema:t}):e.createElement(il,$l(Ll({},i),{level:o,schema:t,discriminator:{fieldName:l,parentSchema:r}}))}if(void 0!==a)return e.createElement(_l,Ll({schema:r},i));const u=I(s)?s:[s];if(u.includes("object")){if(null==(t=r.fields)?void 0:t.length)return e.createElement(il,$l(Ll({},this.props),{level:o}))}else if(u.includes("array"))return e.createElement(ml,$l(Ll({},this.props),{level:o}));const p={schema:r,name:"",required:!1,description:r.description,externalDocs:r.externalDocs,deprecated:!1,toggle:()=>null,expanded:!1};return e.createElement("div",null,e.createElement(Xa,{field:p}))}};Ml=((e,t,n,r)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([ha.observer],Ml);var Dl=Object.defineProperty,Fl=Object.defineProperties,Bl=Object.getOwnPropertyDescriptors,zl=Object.getOwnPropertySymbols,Ul=Object.prototype.hasOwnProperty,ql=Object.prototype.propertyIsEnumerable,Wl=(e,t,n)=>t in e?Dl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;class Vl extends e.PureComponent{constructor(){super(...arguments),this.renderDropdown=t=>{return e.createElement(ws,(n=((e,t)=>{for(var n in t||(t={}))Ul.call(t,n)&&Wl(e,n,t[n]);if(zl)for(var n of zl(t))ql.call(t,n)&&Wl(e,n,t[n]);return e})({Label:hs,Dropdown:ua},t),Fl(n,Bl({variant:"dark"}))));var n}}static getMediaType(e,t){if(!e)return{};const n={schema:{$ref:e}};return t&&(n.examples={example:{$ref:t}}),n}get mediaModel(){const{parser:e,schemaRef:t,exampleRef:n,options:r}=this.props;return this._mediaModel||(this._mediaModel=new Xr(e,"json",!1,Vl.getMediaType(t,n),r)),this._mediaModel}render(){const{showReadOnly:t=!0,showWriteOnly:n=!1,showExample:r=!0}=this.props;return e.createElement(lo,null,e.createElement(po,null,e.createElement(ao,null,e.createElement(Ml,{skipWriteOnly:!n,skipReadOnly:!t,schema:this.mediaModel.schema})),r&&e.createElement(uo,null,e.createElement(Ql,null,e.createElement(da,{renderDropdown:this.renderDropdown,mediaType:this.mediaModel})))))}}const Ql=te.div` + background: ${({theme:e})=>e.codeBlock.backgroundColor}; + & > div, + & > pre { + padding: ${e=>4*e.theme.spacing.unit}px; + margin: 0; + } + + & > div > pre { + padding: 0; + } +`,Hl=(Y().div` + background-color: #e4e7eb; +`,Y().ul` + display: inline; + list-style: none; + padding: 0; + + li { + display: inherit; + + &:after { + content: ','; + } + &:last-child:after { + content: none; + } + } +`,Y().code` + font-size: ${e=>e.theme.typography.code.fontSize}; + font-family: ${e=>e.theme.typography.code.fontFamily}; + margin: 0 3px; + padding: 0.2em; + display: inline-block; + line-height: 1; + + &:after { + content: ','; + font-weight: normal; + } + + &:last-child:after { + content: none; + } +`),Yl=Y().span` + &:after { + content: ' and '; + font-weight: normal; + } + + &:last-child:after { + content: none; + } + + ${Os}; +`,Gl=Y().span` + ${e=>!e.$expanded&&"white-space: nowrap;"} + &:after { + content: ' or '; + ${e=>e.$expanded&&"content: ' or \\a';"} + white-space: pre; + } + + &:last-child:after, + &:only-child:after { + content: none; + } + + ${Os}; +`,Xl=Y().div` + flex: 1 1 auto; + cursor: pointer; +`,Kl=Y().div` + width: ${e=>e.theme.schema.defaultDetailsWidth}; + text-overflow: ellipsis; + border-radius: 4px; + overflow: hidden; + ${e=>e.$expanded&&`background: ${e.theme.colors.gray[100]};\n padding: 8px 9.6px;\n margin: 20px 0;\n width: 100%;\n `}; + ${ee.lessThan("small")` + margin-top: 10px; + `} +`,Jl=Y()(vo)` + display: inline-block; + margin: 0; +`,Zl=Y().div` + width: 100%; + display: flex; + margin: 1em 0; + flex-direction: ${e=>e.$expanded?"column":"row"}; + ${ee.lessThan("small")` + flex-direction: column; + `} +`,ec=Y().div` + margin: 0.5em 0; +`,tc=Y().div` + border-bottom: 1px solid ${({theme:e})=>e.colors.border.dark}; + margin-bottom: 1.5em; + padding-bottom: 0.7em; + + h5 { + line-height: 1em; + margin: 0 0 0.6em; + font-size: ${({theme:e})=>e.typography.fontSize}; + } + + .redoc-markdown p:first-child { + display: inline; + } +`;function nc({children:t,height:n}){const r=e.createRef(),[i,o]=e.useState(!1),[s,a]=e.useState(!1);return e.useEffect((()=>{r.current&&r.current.clientHeight+20<r.current.scrollHeight&&a(!0)}),[r]),e.createElement(e.Fragment,null,e.createElement(rc,{ref:r,className:i?"":"container",style:{height:i?"auto":n}},t),e.createElement(ic,{$dimmed:!i},s&&e.createElement(oc,{onClick:()=>{o(!i)}},i?"See less":"See more")))}const rc=Y().div` + overflow-y: hidden; +`,ic=Y().div` + text-align: center; + line-height: 1.5em; + ${({$dimmed:e})=>e&&"background-image: linear-gradient(to bottom, transparent,rgb(255 255 255));\n position: relative;\n top: -0.5em;\n padding-top: 0.5em;\n background-position-y: -1em;\n "} +`,oc=Y().a` + cursor: pointer; +`,sc=e.memo((function(t){const{type:n,flow:r,RequiredScopes:i}=t,o=Object.keys((null==r?void 0:r.scopes)||{});return e.createElement(e.Fragment,null,e.createElement(ec,null,e.createElement("b",null,"Flow type: "),e.createElement("code",null,n," ")),("implicit"===n||"authorizationCode"===n)&&e.createElement(ec,null,e.createElement("strong",null," Authorization URL: "),e.createElement("code",null,e.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:r.authorizationUrl},r.authorizationUrl))),("password"===n||"clientCredentials"===n||"authorizationCode"===n)&&e.createElement(ec,null,e.createElement("b",null," Token URL: "),e.createElement("code",null,r.tokenUrl)),r.refreshUrl&&e.createElement(ec,null,e.createElement("strong",null," Refresh URL: "),e.createElement("code",null,r.refreshUrl)),!!o.length&&e.createElement(e.Fragment,null,i||null,e.createElement(ec,null,e.createElement("b",null," Scopes: ")),e.createElement(nc,{height:"4em"},e.createElement("ul",null,o.map((t=>e.createElement("li",{key:t},e.createElement("code",null,t)," -"," ",e.createElement(Ls,{className:"redoc-markdown",inline:!0,source:r.scopes[t]||""}))))))))}));function ac(t){const{RequiredScopes:n,scheme:r}=t;return e.createElement(Ss,null,r.apiKey?e.createElement(e.Fragment,null,e.createElement(ec,null,e.createElement("b",null,_(r.apiKey.in||"")," parameter name: "),e.createElement("code",null,r.apiKey.name)),n):r.http?e.createElement(e.Fragment,null,e.createElement(ec,null,e.createElement("b",null,"HTTP Authorization Scheme: "),e.createElement("code",null,r.http.scheme)),e.createElement(ec,null,"bearer"===r.http.scheme&&r.http.bearerFormat&&e.createElement(e.Fragment,null,e.createElement("b",null,"Bearer format: "),e.createElement("code",null,r.http.bearerFormat))),n):r.openId?e.createElement(e.Fragment,null,e.createElement(ec,null,e.createElement("b",null,"Connect URL: "),e.createElement("code",null,e.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:r.openId.connectUrl},r.openId.connectUrl))),n):r.flows?Object.keys(r.flows).map((t=>e.createElement(sc,{key:t,type:t,RequiredScopes:n,flow:r.flows[t]}))):null)}const lc={oauth2:"OAuth2",apiKey:"API Key",http:"HTTP",openIdConnect:"OpenID Connect"};class cc extends e.PureComponent{render(){return this.props.securitySchemes.schemes.map((t=>e.createElement(lo,{id:t.sectionId,key:t.id},e.createElement(po,null,e.createElement(ao,null,e.createElement(go,null,e.createElement(Ao,{to:t.sectionId}),t.displayName),e.createElement(Ls,{source:t.description||""}),e.createElement(tc,null,e.createElement(ec,null,e.createElement("b",null,"Security Scheme Type: "),e.createElement("span",null,lc[t.type]||t.type)),e.createElement(ac,{scheme:t})))))))}}var uc=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}));function pc(e,t){return uc(this,arguments,(function*(e,t,n={}){const r=yield ve(e||t);return new dc(r,t,n)}))}class dc{constructor(e,t,n={},r=!0){this.marker=new Yt,this.disposer=null,this.rawOptions=n,this.options=new Q(n,fc),this.scroll=new oo(this.options),to.updateOnHistory(Qt.currentId,this.scroll),this.spec=new Li(e,t,this.options),this.menu=new to(this.spec,this.scroll,Qt),this.options.disableSearch||(this.search=new so,r&&this.search.indexItems(this.menu.items),this.disposer=(0,fe.observe)(this.menu,"activeItemIdx",(e=>{this.updateMarkOnMenu(e.newValue)})))}static fromJS(e){const t=new dc(e.spec.data,e.spec.url,e.options,!1);return t.menu.activeItemIdx=e.menu.activeItemIdx||0,t.menu.activate(t.menu.flatItems[t.menu.activeItemIdx]),t.options.disableSearch||t.search.load(e.searchIndex),t}onDidMount(){this.menu.updateOnHistory(),this.updateMarkOnMenu(this.menu.activeItemIdx)}dispose(){this.scroll.dispose(),this.menu.dispose(),this.search&&this.search.dispose(),null!=this.disposer&&this.disposer()}toJS(){return uc(this,null,(function*(){return{menu:{activeItemIdx:this.menu.activeItemIdx},spec:{url:this.spec.parser.specUrl,data:this.spec.parser.spec},searchIndex:this.search?yield this.search.toJS():void 0,options:this.rawOptions}}))}updateMarkOnMenu(e){const t=Math.max(0,e),n=Math.min(this.menu.flatItems.length,t+5),r=[];for(let i=t;i<n;i++){const e=this.menu.getElementAt(i);e&&r.push(e)}if(-1===e&&a){const e=document.querySelector('[data-role="redoc-description"]'),t=document.querySelector('[data-role="redoc-summary"]');e&&r.push(e),t&&r.push(t)}this.marker.addOnly(r),this.marker.mark()}}const fc={allowedMdComponents:{[ft]:{component:cc,propsSelector:e=>({securitySchemes:e.spec.securitySchemes})},[ht]:{component:cc,propsSelector:e=>({securitySchemes:e.spec.securitySchemes})},[mt]:{component:Vl,propsSelector:e=>({parser:e.spec.parser,options:e.options})}}},hc=te(mo)` + margin-top: 0; + margin-bottom: 0.5em; + + ${ne("ApiHeader")}; +`,mc=te.a` + border: 1px solid ${e=>e.theme.colors.primary.main}; + color: ${e=>e.theme.colors.primary.main}; + font-weight: normal; + margin-left: 0.5em; + padding: 4px 8px 4px; + display: inline-block; + text-decoration: none; + cursor: pointer; + + ${ne("DownloadButton")}; +`,gc=te.span` + &::before { + content: '|'; + display: inline-block; + opacity: 0.5; + width: ${15}px; + text-align: center; + } + + &:last-child::after { + display: none; + } +`,yc=te.div` + overflow: hidden; +`,vc=te.div` + display: flex; + flex-wrap: wrap; + // hide separator on new lines: idea from https://stackoverflow.com/a/31732902/1749888 + margin-left: -${15}px; +`;Object.defineProperty,Object.getOwnPropertyDescriptor;let bc=class extends e.Component{constructor(){super(...arguments),this.handleDownloadClick=e=>{e.target.href||(e.target.href=this.props.store.spec.info.downloadLink)}}render(){const{store:t}=this.props,{info:n,externalDocs:r}=t.spec,i=t.options.hideDownloadButton,o=n.downloadFileName,s=n.downloadLink,a=n.license&&e.createElement(gc,null,"License:"," ",n.license.identifier?n.license.identifier:e.createElement("a",{href:n.license.url},n.license.name))||null,l=n.contact&&n.contact.url&&e.createElement(gc,null,"URL: ",e.createElement("a",{href:n.contact.url},n.contact.url))||null,c=n.contact&&n.contact.email&&e.createElement(gc,null,n.contact.name||"E-mail",":"," ",e.createElement("a",{href:"mailto:"+n.contact.email},n.contact.email))||null,u=n.termsOfService&&e.createElement(gc,null,e.createElement("a",{href:n.termsOfService},"Terms of Service"))||null,p=n.version&&e.createElement("span",null,"(",n.version,")")||null;return e.createElement(lo,null,e.createElement(po,null,e.createElement(ao,{className:"api-info"},e.createElement(hc,null,n.title," ",p),!i&&e.createElement("p",null,N("downloadSpecification"),":",e.createElement(mc,{download:o||!0,target:"_blank",href:s,onClick:this.handleDownloadClick},N("download"))),e.createElement(Ss,null,(n.license||n.contact||n.termsOfService)&&e.createElement(yc,null,e.createElement(vc,null,c," ",l," ",a," ",u))||null),e.createElement(Ls,{source:t.spec.info.summary,"data-role":"redoc-summary"}),e.createElement(Ls,{source:t.spec.info.description,"data-role":"redoc-description"}),r&&e.createElement(Pa,{externalDocs:r}))))}};bc=((e,t,n,r)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([ha.observer],bc);const xc=te.img` + max-height: ${e=>e.theme.logo.maxHeight}; + max-width: ${e=>e.theme.logo.maxWidth}; + padding: ${e=>e.theme.logo.gutter}; + width: 100%; + display: block; +`,wc=te.div` + text-align: center; +`,kc=te.a` + display: inline-block; +`;Object.defineProperty,Object.getOwnPropertyDescriptor;let Oc=class extends e.Component{render(){const{info:t}=this.props,n=t["x-logo"];if(!n||!n.url)return null;const r=n.href||t.contact&&t.contact.url,i=n.altText?n.altText:"logo",o=e.createElement(xc,{src:n.url,alt:i});return e.createElement(wc,{style:{backgroundColor:n.backgroundColor}},r?(s=r,t=>e.createElement(kc,{href:s},t))(o):o);var s}};Oc=((e,t,n,r)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([ha.observer],Oc);var Sc=Object.defineProperty,Ec=Object.getOwnPropertySymbols,_c=Object.prototype.hasOwnProperty,Ac=Object.prototype.propertyIsEnumerable,jc=(e,t,n)=>t in e?Sc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Tc=(e,t)=>{for(var n in t||(t={}))_c.call(t,n)&&jc(e,n,t[n]);if(Ec)for(var n of Ec(t))Ac.call(t,n)&&jc(e,n,t[n]);return e};class Pc extends e.Component{render(){return e.createElement(de,null,(t=>e.createElement(ko,null,(e=>this.renderWithOptionsAndStore(t,e)))))}renderWithOptionsAndStore(t,n){const{source:r,htmlWrap:i=(e=>e)}=this.props;if(!n)throw new Error("When using components in markdown, store prop must be provided");const o=new Qn(t,this.props.parentId).renderMdWithComponents(r);return o.length?o.map(((t,r)=>{if("string"==typeof t)return e.cloneElement(i(e.createElement(Ns,{html:t,inline:!1,compact:!1})),{key:r});const o=t.component;return e.createElement(o,Tc({key:r},Tc(Tc({},t.props),t.propsSelector(n))))})):null}}var Ic=n(4184),Cc=r.n(Ic);const Rc=te.span.attrs((e=>({className:`operation-type ${e.type}`})))` + width: 9ex; + display: inline-block; + height: ${e=>e.theme.typography.code.fontSize}; + line-height: ${e=>e.theme.typography.code.fontSize}; + background-color: #333; + border-radius: 3px; + background-repeat: no-repeat; + background-position: 6px 4px; + font-size: 7px; + font-family: Verdana, sans-serif; // web-safe + color: white; + text-transform: uppercase; + text-align: center; + font-weight: bold; + vertical-align: middle; + margin-right: 6px; + margin-top: 2px; + + &.get { + background-color: ${({theme:e})=>e.colors.http.get}; + } + + &.post { + background-color: ${({theme:e})=>e.colors.http.post}; + } + + &.put { + background-color: ${({theme:e})=>e.colors.http.put}; + } + + &.options { + background-color: ${({theme:e})=>e.colors.http.options}; + } + + &.patch { + background-color: ${({theme:e})=>e.colors.http.patch}; + } + + &.delete { + background-color: ${({theme:e})=>e.colors.http.delete}; + } + + &.basic { + background-color: ${({theme:e})=>e.colors.http.basic}; + } + + &.link { + background-color: ${({theme:e})=>e.colors.http.link}; + } + + &.head { + background-color: ${({theme:e})=>e.colors.http.head}; + } + + &.hook { + background-color: ${({theme:e})=>e.colors.primary.main}; + } + + &.schema { + background-color: ${({theme:e})=>e.colors.http.basic}; + } +`;function Nc(e,{theme:t},n){return e>1?t.sidebar.level1Items[n]:1===e?t.sidebar.groupItems[n]:""}const Lc=te.ul` + margin: 0; + padding: 0; + + &:first-child { + padding-bottom: 32px; + } + + & & { + font-size: 0.929em; + } + + ${e=>e.$expanded?"":"display: none;"}; +`,$c=te.li` + list-style: none inside none; + overflow: hidden; + text-overflow: ellipsis; + padding: 0; + ${e=>0===e.depth?"margin-top: 15px":""}; +`,Mc={0:X` + opacity: 0.7; + text-transform: ${({theme:e})=>e.sidebar.groupItems.textTransform}; + font-size: 0.8em; + padding-bottom: 0; + cursor: default; + `,1:X` + font-size: 0.929em; + text-transform: ${({theme:e})=>e.sidebar.level1Items.textTransform}; + `},Dc=te.label.attrs((e=>({className:Cc()("-depth"+e.$depth,{active:e.$active})})))` + cursor: pointer; + color: ${e=>e.$active?Nc(e.$depth,e,"activeTextColor"):e.theme.sidebar.textColor}; + margin: 0; + padding: 12.5px ${e=>4*e.theme.spacing.unit}px; + ${({$depth:e,$type:t,theme:n})=>"section"===t&&e>1&&"padding-left: "+8*n.spacing.unit+"px;"||""} + display: flex; + justify-content: space-between; + font-family: ${e=>e.theme.typography.headings.fontFamily}; + ${e=>Mc[e.$depth]}; + background-color: ${e=>e.$active?Nc(e.$depth,e,"activeBackgroundColor"):e.theme.sidebar.backgroundColor}; + + ${e=>e.$deprecated&&Io||""}; + + &:hover { + color: ${e=>Nc(e.$depth,e,"activeTextColor")}; + background-color: ${e=>Nc(e.$depth,e,"activeBackgroundColor")}; + } + + ${To} { + height: ${({theme:e})=>e.sidebar.arrow.size}; + width: ${({theme:e})=>e.sidebar.arrow.size}; + polygon { + fill: ${({theme:e})=>e.sidebar.arrow.color}; + } + } +`,Fc=te.span` + display: inline-block; + vertical-align: middle; + width: ${e=>e.width?e.width:"auto"}; + overflow: hidden; + text-overflow: ellipsis; +`,Bc=te.div` + ${({theme:e})=>X` + font-size: 0.8em; + margin-top: ${2*e.spacing.unit}px; + text-align: center; + position: fixed; + width: ${e.sidebar.width}; + bottom: 0; + background: ${e.sidebar.backgroundColor}; + + a, + a:visited, + a:hover { + color: ${e.sidebar.textColor} !important; + padding: ${e.spacing.unit}px 0; + border-top: 1px solid ${(0,t.darken)(.1,e.sidebar.backgroundColor)}; + text-decoration: none; + display: flex; + align-items: center; + justify-content: center; + } + `}; + img { + width: 15px; + margin-right: 5px; + } + + ${ee.lessThan("small")` + width: 100%; + `}; +`,zc=te.button` + border: 0; + width: 100%; + text-align: left; + & > * { + vertical-align: middle; + } + + ${To} { + polygon { + fill: ${({theme:e})=>(0,t.darken)(e.colors.tonalOffset,e.colors.gray[100])}; + } + } +`,Uc=te.span` + text-decoration: ${e=>e.$deprecated?"line-through":"none"}; + margin-right: 8px; +`,qc=te(Rc)` + margin: 0 5px 0 0; +`,Wc=te((t=>{const{name:n,opened:r,className:i,onClick:o,httpVerb:s,deprecated:a}=t;return e.createElement(zc,{className:i,onClick:o||void 0},e.createElement(qc,{type:s},vt(s)),e.createElement(To,{size:"1.5em",direction:r?"down":"right",float:"left"}),e.createElement(Uc,{$deprecated:a},n),a?e.createElement(Po,{type:"warning"}," ",N("deprecated")," "):null)}))` + padding: 10px; + border-radius: 2px; + margin-bottom: 4px; + line-height: 1.5em; + background-color: ${({theme:e})=>e.colors.gray[100]}; + cursor: pointer; + outline-color: ${({theme:e})=>(0,t.darken)(e.colors.tonalOffset,e.colors.gray[100])}; +`,Vc=te.div` + padding: 10px 25px; + background-color: ${({theme:e})=>e.colors.gray[50]}; + margin-bottom: 5px; + margin-top: 5px; +`;class Qc extends e.PureComponent{constructor(){super(...arguments),this.selectElement=()=>{qs.selectElement(this.child)}}render(){const{children:t}=this.props;return e.createElement("div",{ref:e=>this.child=e,onClick:this.selectElement,onFocus:this.selectElement,tabIndex:0,role:"button"},t)}}const Hc=te.div` + cursor: pointer; + position: relative; + margin-bottom: 5px; +`,Yc=te.span` + font-family: ${e=>e.theme.typography.code.fontFamily}; + margin-left: 10px; + flex: 1; + overflow-x: hidden; + text-overflow: ellipsis; +`,Gc=te.button` + outline: 0; + color: inherit; + width: 100%; + text-align: left; + cursor: pointer; + padding: 10px 30px 10px ${e=>e.$inverted?"10px":"20px"}; + border-radius: ${e=>e.$inverted?"0":"4px 4px 0 0"}; + background-color: ${e=>e.$inverted?"transparent":e.theme.codeBlock.backgroundColor}; + display: flex; + white-space: nowrap; + align-items: center; + border: ${e=>e.$inverted?"0":"1px solid transparent"}; + border-bottom: ${e=>e.$inverted?"1px solid #ccc":"0"}; + transition: border-color 0.25s ease; + + ${e=>e.$expanded&&!e.$inverted&&`border-color: ${e.theme.colors.border.dark};`||""} + + .${Yc} { + color: ${e=>e.$inverted?e.theme.colors.text.primary:"#ffffff"}; + } + &:focus { + box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.45), 0 2px 0 rgba(128, 128, 128, 0.25); + } +`,Xc=te.span.attrs((e=>({className:`http-verb ${e.type}`})))` + font-size: ${e=>e.$compact?"0.8em":"0.929em"}; + line-height: ${e=>e.$compact?"18px":"20px"}; + background-color: ${e=>e.theme.colors.http[e.type]||"#999999"}; + color: #ffffff; + padding: ${e=>e.$compact?"2px 8px":"3px 10px"}; + text-transform: uppercase; + font-family: ${e=>e.theme.typography.headings.fontFamily}; + margin: 0; +`,Kc=te.div` + position: absolute; + width: 100%; + z-index: 100; + background: ${e=>e.theme.rightPanel.servers.overlay.backgroundColor}; + color: ${e=>e.theme.rightPanel.servers.overlay.textColor}; + box-sizing: border-box; + box-shadow: 0 0 6px rgba(0, 0, 0, 0.33); + overflow: hidden; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + transition: all 0.25s ease; + visibility: hidden; + ${e=>e.$expanded?"visibility: visible;":"transform: translateY(-50%) scaleY(0);"} +`,Jc=te.div` + padding: 10px; +`,Zc=te.div` + padding: 5px; + border: 1px solid #ccc; + background: ${e=>e.theme.rightPanel.servers.url.backgroundColor}; + word-break: break-all; + color: ${e=>e.theme.colors.primary.main}; + > span { + color: ${e=>e.theme.colors.text.primary}; + } +`;class eu extends e.Component{constructor(e){super(e),this.toggle=()=>{this.setState({expanded:!this.state.expanded})},this.state={expanded:!1}}render(){const{operation:t,inverted:n,hideHostname:r}=this.props,{expanded:i}=this.state;return e.createElement(ue.Consumer,null,(o=>e.createElement(Hc,null,e.createElement(Gc,{onClick:this.toggle,$expanded:i,$inverted:n},e.createElement(Xc,{type:t.httpVerb,$compact:this.props.compact},t.httpVerb),e.createElement(Yc,null,t.path),e.createElement(To,{float:"right",color:n?"black":"white",size:"20px",direction:i?"up":"down",style:{marginRight:"-25px"}})),e.createElement(Kc,{$expanded:i,"aria-hidden":!i},t.servers.map((n=>{const i=o.expandDefaultServerVariables?pt(n.url,n.variables):n.url,s=E(i);return e.createElement(Jc,{key:i},e.createElement(Ls,{source:n.description||"",compact:!0}),e.createElement(Qc,null,e.createElement(Zc,null,e.createElement("span",null,r||o.hideHostname?"/"===s?"":s:i),t.path)))}))))))}}class tu extends e.PureComponent{render(){const{place:t,parameters:n}=this.props;return n&&n.length?e.createElement("div",{key:t},e.createElement(vo,null,t," Parameters"),e.createElement(Fo,null,e.createElement("tbody",null,f(n,((t,n)=>e.createElement(nl,{key:t.name,isLast:n,field:t,showExamples:!0})))))):null}}Object.defineProperty,Object.getOwnPropertyDescriptor;let nu=class extends e.Component{constructor(){super(...arguments),this.switchMedia=({idx:e})=>{this.props.content&&void 0!==e&&this.props.content.activate(e)}}render(){const{content:t}=this.props;if(!t||!t.mediaTypes||!t.mediaTypes.length)return null;const n=t.activeMimeIdx,r=t.mediaTypes.map(((e,t)=>({value:e.name,idx:t}))),i=({children:t})=>this.props.withLabel?e.createElement(ca,null,e.createElement(la,null,"Content type"),t):t;return e.createElement(e.Fragment,null,e.createElement(i,null,this.props.renderDropdown({value:r[n].value,options:r,onChange:this.switchMedia,ariaLabel:"Content type"})),this.props.children(t.active))}};nu=((e,t,n,r)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([ha.observer],nu);var ru=Object.defineProperty,iu=Object.getOwnPropertySymbols,ou=Object.prototype.hasOwnProperty,su=Object.prototype.propertyIsEnumerable,au=(e,t,n)=>t in e?ru(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lu=(e,t)=>{for(var n in t||(t={}))ou.call(t,n)&&au(e,n,t[n]);if(iu)for(var n of iu(t))su.call(t,n)&&au(e,n,t[n]);return e},cu=(e,t)=>{var n={};for(var r in e)ou.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&iu)for(var r of iu(e))t.indexOf(r)<0&&su.call(e,r)&&(n[r]=e[r]);return n};const uu=["path","query","cookie","header"];class pu extends e.PureComponent{orderParams(e){const t={};return e.forEach((e=>{var n,r,i;i=e,(n=t)[r=e.in]||(n[r]=[]),n[r].push(i)})),t}render(){const{body:t,parameters:n=[]}=this.props;if(void 0===t&&void 0===n)return null;const r=this.orderParams(n),i=n.length>0?uu:[],o=t&&t.content,s=t&&t.description,a=t&&t.required;return e.createElement(e.Fragment,null,i.map((t=>e.createElement(tu,{key:t,place:t,parameters:r[t]}))),o&&e.createElement(fu,{content:o,description:s,bodyRequired:a}))}}function du(t){var n=t,{bodyRequired:r}=n,i=cu(n,["bodyRequired"]);const o="boolean"==typeof r&&!!r,s="boolean"==typeof r&&!r;return e.createElement(vo,{key:"header"},"Request Body schema: ",e.createElement(ws,lu({},i)),o&&e.createElement(mu,null,"required"),s&&e.createElement(gu,null,"optional"))}function fu(t){const{content:n,description:r,bodyRequired:i}=t,{isRequestType:o}=n;return e.createElement(nu,{content:n,renderDropdown:t=>e.createElement(du,lu({bodyRequired:i},t))},(({schema:t})=>e.createElement(e.Fragment,null,void 0!==r&&e.createElement(Ls,{source:r}),"object"===(null==t?void 0:t.type)&&e.createElement(Ma,{constraints:(null==t?void 0:t.constraints)||[]}),e.createElement(Ml,{skipReadOnly:o,skipWriteOnly:!o,key:"schema",schema:t}))))}const hu="\n text-transform: lowercase;\n margin-left: 0;\n line-height: 1.5em;\n",mu=te(wa)` + ${hu} +`,gu=te("div")` + ${hu} + color: ${({theme:e})=>e.colors.text.secondary}; + font-size: ${e=>e.theme.schema.labelsTextSize}; +`,yu=e.memo((function({title:t,type:n,empty:r,code:i,opened:o,className:s,onClick:a}){return e.createElement("button",{className:s,onClick:!r&&a||void 0,"aria-expanded":o,disabled:r},!r&&e.createElement(To,{size:"1.5em",color:n,direction:o?"down":"right",float:"left"}),e.createElement(wu,null,i," "),e.createElement(Ls,{compact:!0,inline:!0,source:t}))})),vu=te(yu)` + display: block; + border: 0; + width: 100%; + text-align: left; + padding: 10px; + border-radius: 2px; + margin-bottom: 4px; + line-height: 1.5em; + cursor: pointer; + + color: ${e=>e.theme.colors.responses[e.type].color}; + background-color: ${e=>e.theme.colors.responses[e.type].backgroundColor}; + &:focus { + outline: auto ${e=>e.theme.colors.responses[e.type].color}; + } + ${e=>e.empty?'\ncursor: default;\n&::before {\n content: "\u2014";\n font-weight: bold;\n width: 1.5em;\n text-align: center;\n display: inline-block;\n vertical-align: top;\n}\n&:focus {\n outline: 0;\n}\n':""}; +`,bu=te.div` + padding: 10px; +`,xu=te(vo).attrs({as:"caption"})` + text-align: left; + margin-top: 1em; + caption-side: top; +`,wu=te.strong` + vertical-align: top; +`;class ku extends e.PureComponent{render(){const{headers:t}=this.props;return void 0===t||0===t.length?null:e.createElement(Fo,null,e.createElement(xu,null," Response Headers "),e.createElement("tbody",null,f(t,((t,n)=>e.createElement(nl,{isLast:n,key:t.name,field:t,showExamples:!0})))))}}var Ou=Object.defineProperty,Su=Object.getOwnPropertySymbols,Eu=Object.prototype.hasOwnProperty,_u=Object.prototype.propertyIsEnumerable,Au=(e,t,n)=>t in e?Ou(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;class ju extends e.PureComponent{constructor(){super(...arguments),this.renderDropdown=t=>e.createElement(vo,{key:"header"},"Response Schema: ",e.createElement(ws,((e,t)=>{for(var n in t||(t={}))Eu.call(t,n)&&Au(e,n,t[n]);if(Su)for(var n of Su(t))_u.call(t,n)&&Au(e,n,t[n]);return e})({},t)))}render(){const{description:t,extensions:n,headers:r,content:i}=this.props.response;return e.createElement(e.Fragment,null,t&&e.createElement(Ls,{source:t}),e.createElement(Na,{extensions:n}),e.createElement(ku,{headers:r}),e.createElement(nu,{content:i,renderDropdown:this.renderDropdown},(({schema:t})=>e.createElement(e.Fragment,null,"object"===(null==t?void 0:t.type)&&e.createElement(Ma,{constraints:(null==t?void 0:t.constraints)||[]}),e.createElement(Ml,{skipWriteOnly:!0,key:"schema",schema:t})))))}}const Tu=(0,ha.observer)((({response:t})=>{const{extensions:n,headers:r,type:i,summary:o,description:s,code:a,expanded:l,content:c}=t,u=e.useMemo((()=>void 0===c?[]:c.mediaTypes.filter((e=>void 0!==e.schema))),[c]),p=e.useMemo((()=>!(n&&0!==Object.keys(n).length||0!==r.length||0!==u.length||s)),[n,r,u,s]);return e.createElement("div",null,e.createElement(vu,{onClick:()=>t.toggle(),type:i,empty:p,title:o||"",code:a,opened:l}),l&&!p&&e.createElement(bu,null,e.createElement(ju,{response:t})))})),Pu=te.h3` + font-size: 1.3em; + padding: 0.2em 0; + margin: 3em 0 1.1em; + color: ${({theme:e})=>e.colors.text.primary}; + font-weight: normal; +`;class Iu extends e.PureComponent{render(){const{responses:t,isCallback:n}=this.props;return t&&0!==t.length?e.createElement("div",null,e.createElement(Pu,null,N(n?"callbackResponses":"responses")),t.map((t=>e.createElement(Tu,{key:t.code,response:t})))):null}}function Cu(t){const{security:n,showSecuritySchemeType:r,expanded:i}=t,o=n.schemes.length>1;return 0===n.schemes.length?e.createElement(Gl,{$expanded:i},"None"):e.createElement(Gl,{$expanded:i},o&&"(",n.schemes.map((t=>e.createElement(Yl,{key:t.id},r&&`${lc[t.type]||t.type}: `,e.createElement("i",null,t.displayName),i&&t.scopes.length?[" (",t.scopes.map((t=>e.createElement(Hl,{key:t},t))),") "]:null))),o&&") ")}const Ru=({scopes:t})=>t.length?e.createElement("div",null,e.createElement("b",null,"Required scopes: "),t.map(((t,n)=>e.createElement(e.Fragment,{key:n},e.createElement("code",null,t)," ")))):null;function Nu(t){const n=So(),r=null==n?void 0:n.options.showSecuritySchemeType,[i,o]=(0,e.useState)(!1),{securities:s}=t;if(!(null==s?void 0:s.length)||(null==n?void 0:n.options.hideSecuritySection))return null;const a=null==n?void 0:n.spec.securitySchemes.schemes.filter((({id:e})=>s.find((t=>t.schemes.find((t=>t.id===e))))));return e.createElement(e.Fragment,null,e.createElement(Zl,{$expanded:i},e.createElement(Xl,{onClick:()=>o(!i)},e.createElement(Jl,null,"Authorizations:"),e.createElement(To,{size:"1.3em",direction:i?"down":"right"})),e.createElement(Kl,{$expanded:i},s.map(((t,n)=>e.createElement(Cu,{key:n,expanded:i,showSecuritySchemeType:r,security:t}))))),i&&(null==a?void 0:a.length)&&a.map(((t,n)=>e.createElement(tc,{key:n},e.createElement("h5",null,e.createElement(Lu,null)," ",lc[t.type]||t.type,": ",t.id),e.createElement(Ls,{source:t.description||""}),e.createElement(ac,{key:t.id,scheme:t,RequiredScopes:e.createElement(Ru,{scopes:$u(t.id,s)})})))))}const Lu=()=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"11",height:"11"},e.createElement("path",{fill:"currentColor",d:"M18 10V6A6 6 0 0 0 6 6v4H3v14h18V10h-3zM8 6c0-2.206 1.794-4 4-4s4 1.794 4 4v4H8V6zm11 16H5V12h14v10z"}));function $u(e,t){const n=[];let r=t.length;for(;r--;){const i=t[r];let o=i.schemes.length;for(;o--;){const t=i.schemes[o];t.id===e&&Array.isArray(t.scopes)&&n.push(...t.scopes)}}return Array.from(new Set(n))}Object.defineProperty,Object.getOwnPropertyDescriptor;let Mu=class extends e.Component{render(){const{operation:t}=this.props,{description:n,externalDocs:r}=t,i=!(!n&&!r);return e.createElement(Vc,null,i&&e.createElement(Du,null,void 0!==n&&e.createElement(Ls,{source:n}),r&&e.createElement(Pa,{externalDocs:r})),e.createElement(eu,{operation:this.props.operation,inverted:!0,compact:!0}),e.createElement(Na,{extensions:t.extensions}),e.createElement(Nu,{securities:t.security}),e.createElement(pu,{parameters:t.parameters,body:t.requestBody}),e.createElement(Iu,{responses:t.responses,isCallback:t.isCallback}))}};Mu=((e,t,n,r)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([ha.observer],Mu);const Du=te.div` + margin-bottom: ${({theme:e})=>3*e.spacing.unit}px; +`;Object.defineProperty,Object.getOwnPropertyDescriptor;let Fu=class extends e.Component{constructor(){super(...arguments),this.toggle=()=>{this.props.callbackOperation.toggle()}}render(){const{name:t,expanded:n,httpVerb:r,deprecated:i}=this.props.callbackOperation;return e.createElement(e.Fragment,null,e.createElement(Wc,{onClick:this.toggle,name:t,opened:n,httpVerb:r,deprecated:i}),n&&e.createElement(Mu,{operation:this.props.callbackOperation}))}};Fu=((e,t,n,r)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([ha.observer],Fu);class Bu extends e.PureComponent{render(){const{callbacks:t}=this.props;return t&&0!==t.length?e.createElement("div",null,e.createElement(zu,null," Callbacks "),t.map((t=>t.operations.map(((n,r)=>e.createElement(Fu,{key:`${t.name}_${r}`,callbackOperation:n})))))):null}}const zu=te.h3` + font-size: 1.3em; + padding: 0.2em 0; + margin: 3em 0 1.1em; + color: ${({theme:e})=>e.colors.text.primary}; + font-weight: normal; +`;Object.defineProperty,Object.getOwnPropertyDescriptor;let Uu=class extends e.Component{constructor(e){super(e),this.switchItem=({idx:e})=>{this.props.items&&void 0!==e&&this.setState({activeItemIdx:e})},this.state={activeItemIdx:0}}render(){const{items:t}=this.props;if(!t||!t.length)return null;const n=({children:t})=>this.props.label?e.createElement(ca,null,e.createElement(la,null,this.props.label),t):t;return e.createElement(e.Fragment,null,e.createElement(n,null,this.props.renderDropdown({value:this.props.options[this.state.activeItemIdx].value,options:this.props.options,onChange:this.switchItem,ariaLabel:this.props.label||"Callback"})),this.props.children(t[this.state.activeItemIdx]))}};Uu=((e,t,n,r)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([ha.observer],Uu);var qu=Object.defineProperty,Wu=Object.defineProperties,Vu=(Object.getOwnPropertyDescriptor,Object.getOwnPropertyDescriptors),Qu=Object.getOwnPropertySymbols,Hu=Object.prototype.hasOwnProperty,Yu=Object.prototype.propertyIsEnumerable,Gu=(e,t,n)=>t in e?qu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;let Xu=class extends e.Component{constructor(){super(...arguments),this.renderDropdown=t=>{return e.createElement(ws,(n=((e,t)=>{for(var n in t||(t={}))Hu.call(t,n)&&Gu(e,n,t[n]);if(Qu)for(var n of Qu(t))Yu.call(t,n)&&Gu(e,n,t[n]);return e})({Label:aa,Dropdown:ua},t),Wu(n,Vu({variant:"dark"}))));var n}}render(){const t=this.props.content;return void 0===t?null:e.createElement(nu,{content:t,renderDropdown:this.renderDropdown,withLabel:!0},(t=>e.createElement(da,{key:"samples",mediaType:t,renderDropdown:this.renderDropdown})))}};Xu=((e,t,n,r)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([ha.observer],Xu);class Ku extends e.Component{render(){const t=this.props.callback.codeSamples.find((e=>mi(e)));return t?e.createElement(Ju,null,e.createElement(Xu,{content:t.requestBodyContent})):null}}const Ju=te.div` + margin-top: 15px; +`;var Zu=Object.defineProperty,ep=Object.defineProperties,tp=(Object.getOwnPropertyDescriptor,Object.getOwnPropertyDescriptors),np=Object.getOwnPropertySymbols,rp=Object.prototype.hasOwnProperty,ip=Object.prototype.propertyIsEnumerable,op=(e,t,n)=>t in e?Zu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;let sp=class extends e.Component{constructor(){super(...arguments),this.renderDropdown=t=>{return e.createElement(ws,(n=((e,t)=>{for(var n in t||(t={}))rp.call(t,n)&&op(e,n,t[n]);if(np)for(var n of np(t))ip.call(t,n)&&op(e,n,t[n]);return e})({Label:aa,Dropdown:ua},t),ep(n,tp({variant:"dark"}))));var n}}render(){const{callbacks:t}=this.props;if(!t||0===t.length)return null;const n=t.map((e=>e.operations.map((e=>e)))).reduce(((e,t)=>e.concat(t)),[]);if(!n.some((e=>e.codeSamples.length>0)))return null;const r=n.map(((e,t)=>({value:`${e.httpVerb.toUpperCase()}: ${e.name}`,idx:t})));return e.createElement("div",null,e.createElement(yo,null," Callback payload samples "),e.createElement(ap,null,e.createElement(Uu,{items:n,renderDropdown:this.renderDropdown,label:"Callback",options:r},(t=>e.createElement(Ku,{key:"callbackPayloadSample",callback:t,renderDropdown:this.renderDropdown})))))}};sp.contextType=ue,sp=((e,t,n,r)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([ha.observer],sp);const ap=te.div` + background: ${({theme:e})=>e.codeBlock.backgroundColor}; + padding: ${e=>4*e.theme.spacing.unit}px; +`;Object.defineProperty,Object.getOwnPropertyDescriptor;let lp=class extends e.Component{render(){const{operation:t}=this.props,n=t.codeSamples,r=n.length>0,i=1===n.length&&this.context.hideSingleRequestSampleTab;return r&&e.createElement("div",null,e.createElement(yo,null," ",N("requestSamples")," "),e.createElement(Qo,{defaultIndex:0},e.createElement(Vo.TabList,{hidden:i},n.map((t=>e.createElement(Vo.Tab,{key:t.lang+"_"+(t.label||"")},void 0!==t.label?t.label:t.lang)))),n.map((t=>e.createElement(Vo.TabPanel,{key:t.lang+"_"+(t.label||"")},mi(t)?e.createElement("div",null,e.createElement(Xu,{content:t.requestBodyContent})):e.createElement(na,{lang:t.lang,source:t.source}))))))||null}};lp.contextType=ue,lp=((e,t,n,r)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([ha.observer],lp),Object.defineProperty,Object.getOwnPropertyDescriptor;let cp=class extends e.Component{render(){const{operation:t}=this.props,n=t.responses.filter((e=>e.content&&e.content.hasSample));return n.length>0&&e.createElement("div",null,e.createElement(yo,null," ",N("responseSamples")," "),e.createElement(Qo,{defaultIndex:0},e.createElement(Vo.TabList,null,n.map((t=>e.createElement(Vo.Tab,{className:"tab-"+t.type,key:t.code},t.code)))),n.map((t=>e.createElement(Vo.TabPanel,{key:t.code},e.createElement("div",null,e.createElement(Xu,{content:t.content})))))))||null}};cp=((e,t,n,r)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([ha.observer],cp);var up=Object.defineProperty,pp=Object.defineProperties,dp=Object.getOwnPropertyDescriptors,fp=Object.getOwnPropertySymbols,hp=Object.prototype.hasOwnProperty,mp=Object.prototype.propertyIsEnumerable,gp=(e,t,n)=>t in e?up(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const yp=te.div` + margin-bottom: ${({theme:e})=>6*e.spacing.unit}px; +`,vp=(0,ha.observer)((({operation:t})=>{const{name:n,description:r,deprecated:i,externalDocs:o,isWebhook:s,httpVerb:a}=t,l=!(!r&&!o),{showWebhookVerb:c}=e.useContext(ue);return e.createElement(ue.Consumer,null,(u=>{return e.createElement(po,(p=((e,t)=>{for(var n in t||(t={}))hp.call(t,n)&&gp(e,n,t[n]);if(fp)for(var n of fp(t))mp.call(t,n)&&gp(e,n,t[n]);return e})({},{[eo]:t.operationHash}),d={id:t.operationHash},pp(p,dp(d))),e.createElement(ao,null,e.createElement(go,null,e.createElement(Ao,{to:t.id}),n," ",i&&e.createElement(Po,{type:"warning"}," Deprecated "),s&&e.createElement(Po,{type:"primary"}," ","Webhook ",c&&a&&"| "+a.toUpperCase())),u.pathInMiddlePanel&&!s&&e.createElement(eu,{operation:t,inverted:!0}),l&&e.createElement(yp,null,void 0!==r&&e.createElement(Ls,{source:r}),o&&e.createElement(Pa,{externalDocs:o})),e.createElement(Na,{extensions:t.extensions}),e.createElement(Nu,{securities:t.security}),e.createElement(pu,{parameters:t.parameters,body:t.requestBody}),e.createElement(Iu,{responses:t.responses}),e.createElement(Bu,{callbacks:t.callbacks})),e.createElement(uo,null,!u.pathInMiddlePanel&&!s&&e.createElement(eu,{operation:t}),e.createElement(lp,{operation:t}),e.createElement(cp,{operation:t}),e.createElement(sp,{callbacks:t.callbacks})));var p,d}))}));var bp=Object.defineProperty,xp=Object.getOwnPropertyDescriptor,wp=Object.getOwnPropertySymbols,kp=Object.prototype.hasOwnProperty,Op=Object.prototype.propertyIsEnumerable,Sp=(e,t,n)=>t in e?bp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ep=(e,t,n,r)=>{for(var i,o=r>1?void 0:r?xp(t,n):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&bp(t,n,o),o};let _p=class extends e.Component{render(){const t=this.props.items;return 0===t.length?null:t.map((t=>e.createElement(Ap,{key:t.id,item:t})))}};_p=Ep([ha.observer],_p);let Ap=class extends e.Component{render(){const t=this.props.item;let n;const{type:r}=t;switch(r){case"group":n=null;break;case"tag":case"section":default:n=e.createElement(Tp,((e,t)=>{for(var n in t||(t={}))kp.call(t,n)&&Sp(e,n,t[n]);if(wp)for(var n of wp(t))Op.call(t,n)&&Sp(e,n,t[n]);return e})({},this.props));break;case"operation":n=e.createElement(Pp,{item:t})}return e.createElement(e.Fragment,null,n&&e.createElement(lo,{id:t.id,$underlined:"operation"===t.type},n),t.items&&e.createElement(_p,{items:t.items}))}};Ap=Ep([ha.observer],Ap);const jp=t=>e.createElement(ao,{$compact:!0},t);let Tp=class extends e.Component{render(){const{name:t,description:n,externalDocs:r,level:i}=this.props.item,o=2===i?go:mo;return e.createElement(e.Fragment,null,e.createElement(po,null,e.createElement(ao,{$compact:!1},e.createElement(o,null,e.createElement(Ao,{to:this.props.item.id}),t))),e.createElement(Pc,{parentId:this.props.item.id,source:n||"",htmlWrap:jp}),r&&e.createElement(po,null,e.createElement(ao,null,e.createElement(Pa,{externalDocs:r}))))}};Tp=Ep([ha.observer],Tp);let Pp=class extends e.Component{render(){return e.createElement(vp,{operation:this.props.item})}};Pp=Ep([ha.observer],Pp);var Ip=Object.defineProperty,Cp=Object.defineProperties,Rp=(Object.getOwnPropertyDescriptor,Object.getOwnPropertyDescriptors),Np=Object.getOwnPropertySymbols,Lp=Object.prototype.hasOwnProperty,$p=Object.prototype.propertyIsEnumerable,Mp=(e,t,n)=>t in e?Ip(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;let Dp=class extends e.Component{constructor(){super(...arguments),this.ref=e.createRef(),this.activate=e=>{this.props.onActivate(this.props.item),e.stopPropagation()}}componentDidMount(){this.scrollIntoViewIfActive()}componentDidUpdate(){this.scrollIntoViewIfActive()}scrollIntoViewIfActive(){this.props.item.active&&this.ref.current&&u(this.ref.current)}render(){const{item:t,withoutChildren:n}=this.props;return e.createElement($c,{tabIndex:0,onClick:this.activate,depth:t.depth,"data-item-id":t.id,role:"menuitem"},"operation"===t.type?e.createElement(Fp,(r=((e,t)=>{for(var n in t||(t={}))Lp.call(t,n)&&Mp(e,n,t[n]);if(Np)for(var n of Np(t))$p.call(t,n)&&Mp(e,n,t[n]);return e})({},this.props),Cp(r,Rp({item:t})))):e.createElement(Dc,{$depth:t.depth,$active:t.active,$type:t.type,ref:this.ref},"schema"===t.type&&e.createElement(Rc,{type:"schema"},"schema"),e.createElement(Fc,{width:"calc(100% - 38px)",title:t.sidebarLabel},t.sidebarLabel,this.props.children),t.depth>0&&t.items.length>0&&e.createElement(To,{float:"right",direction:t.expanded?"down":"right"})||null),!n&&t.items&&t.items.length>0&&e.createElement(Vp,{expanded:t.expanded,items:t.items,onActivate:this.props.onActivate}));var r}};Dp=((e,t,n,r)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([ha.observer],Dp);const Fp=(0,ha.observer)((t=>{const{item:n}=t,r=e.createRef(),{showWebhookVerb:i}=e.useContext(ue);return e.useEffect((()=>{t.item.active&&r.current&&u(r.current)}),[t.item.active,r]),e.createElement(Dc,{$depth:n.depth,$active:n.active,$deprecated:n.deprecated,ref:r},n.isWebhook?e.createElement(Rc,{type:"hook"},i?n.httpVerb:N("webhook")):e.createElement(Rc,{type:n.httpVerb},vt(n.httpVerb)),e.createElement(Fc,{tabIndex:0,width:"calc(100% - 38px)"},n.sidebarLabel,t.children))}));var Bp=Object.defineProperty,zp=(Object.getOwnPropertyDescriptor,Object.getOwnPropertySymbols),Up=Object.prototype.hasOwnProperty,qp=Object.prototype.propertyIsEnumerable,Wp=(e,t,n)=>t in e?Bp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;let Vp=class extends e.Component{render(){const{items:t,root:n,className:r}=this.props,i=null==this.props.expanded||this.props.expanded;return e.createElement(Lc,((e,t)=>{for(var n in t||(t={}))Up.call(t,n)&&Wp(e,n,t[n]);if(zp)for(var n of zp(t))qp.call(t,n)&&Wp(e,n,t[n]);return e})({className:r,style:this.props.style,$expanded:i},n?{role:"menu"}:{}),t.map(((t,n)=>e.createElement(Dp,{key:n,item:t,onActivate:this.props.onActivate}))))}};function Qp(){const[t,n]=(0,e.useState)(!1);return(0,e.useEffect)((()=>{n(!0)}),[]),t?e.createElement("img",{alt:"redocly logo",onError:()=>n(!1),src:"https://cdn.redoc.ly/redoc/logo-mini.svg"}):null}Vp=((e,t,n,r)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([ha.observer],Vp),Object.defineProperty,Object.getOwnPropertyDescriptor;let Hp=class extends e.Component{constructor(){super(...arguments),this.activate=e=>{if(e&&e.active&&this.context.menuToggle)return e.expanded?e.collapse():e.expand();this.props.menu.activateAndScroll(e,!0),setTimeout((()=>{this._updateScroll&&this._updateScroll()}))},this.saveScrollUpdate=e=>{this._updateScroll=e}}render(){const t=this.props.menu;return e.createElement(cs,{updateFn:this.saveScrollUpdate,className:this.props.className,options:{wheelPropagation:!1}},e.createElement(Vp,{items:t.items,onActivate:this.activate,root:!0}),e.createElement(Bc,null,e.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://redocly.com/redoc/"},e.createElement(Qp,null),"API docs by Redocly")))}};Hp.contextType=ue,Hp=((e,t,n,r)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([ha.observer],Hp);const Yp=({open:t})=>{const n=t?8:-4;return e.createElement(Xp,null,e.createElement(Gp,{size:15,style:{transform:`translate(2px, ${n}px) rotate(180deg)`,transition:"transform 0.2s ease"}}),e.createElement(Gp,{size:15,style:{transform:`translate(2px, ${0-n}px)`,transition:"transform 0.2s ease"}}))},Gp=({size:t=10,className:n="",style:r})=>e.createElement("svg",{className:n,style:r||{},viewBox:"0 0 926.23699 573.74994",version:"1.1",x:"0px",y:"0px",width:t,height:t},e.createElement("g",{transform:"translate(904.92214,-879.1482)"},e.createElement("path",{d:"\n m -673.67664,1221.6502 -231.2455,-231.24803 55.6165,\n -55.627 c 30.5891,-30.59485 56.1806,-55.627 56.8701,-55.627 0.6894,\n 0 79.8637,78.60862 175.9427,174.68583 l 174.6892,174.6858 174.6892,\n -174.6858 c 96.079,-96.07721 175.253196,-174.68583 175.942696,\n -174.68583 0.6895,0 26.281,25.03215 56.8701,\n 55.627 l 55.6165,55.627 -231.245496,231.24803 c -127.185,127.1864\n -231.5279,231.248 -231.873,231.248 -0.3451,0 -104.688,\n -104.0616 -231.873,-231.248 z\n ",fill:"currentColor"}))),Xp=te.div` + user-select: none; + width: 20px; + height: 20px; + align-self: center; + display: flex; + flex-direction: column; + color: ${e=>e.theme.colors.primary.main}; +`;let Kp;Object.defineProperty,Object.getOwnPropertyDescriptor,a&&(Kp=r(322));const Jp=Kp&&Kp(),Zp=te.div` + width: ${e=>e.theme.sidebar.width}; + background-color: ${e=>e.theme.sidebar.backgroundColor}; + overflow: hidden; + display: flex; + flex-direction: column; + + backface-visibility: hidden; + /* contain: strict; TODO: breaks layout since Chrome 80*/ + + height: 100vh; + position: sticky; + position: -webkit-sticky; + top: 0; + + ${ee.lessThan("small")` + position: fixed; + z-index: 20; + width: 100%; + background: ${({theme:e})=>e.sidebar.backgroundColor}; + display: ${e=>e.$open?"flex":"none"}; + `}; + + @media print { + display: none; + } +`,ed=te.div` + outline: none; + user-select: none; + background-color: ${({theme:e})=>e.fab.backgroundColor}; + color: ${e=>e.theme.colors.primary.main}; + display: none; + cursor: pointer; + position: fixed; + right: 20px; + z-index: 100; + border-radius: 50%; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.3); + ${ee.lessThan("small")` + display: flex; + `}; + + bottom: 44px; + + width: 60px; + height: 60px; + padding: 0 20px; + svg { + color: ${({theme:e})=>e.fab.color}; + } + + @media print { + display: none; + } +`;let td=class extends e.Component{constructor(){super(...arguments),this.state={offsetTop:"0px"},this.toggleNavMenu=()=>{this.props.menu.toggleSidebar()}}componentDidMount(){Jp&&Jp.add(this.stickyElement),this.setState({offsetTop:this.getScrollYOffset(this.context)})}componentWillUnmount(){Jp&&Jp.remove(this.stickyElement)}getScrollYOffset(e){let t;return t=void 0!==this.props.scrollYOffset?Q.normalizeScrollYOffset(this.props.scrollYOffset)():e.scrollYOffset(),t+"px"}render(){const t=this.props.menu.sideBarOpened,n=this.state.offsetTop;return e.createElement(e.Fragment,null,e.createElement(Zp,{$open:t,className:this.props.className,style:{top:n,height:`calc(100vh - ${n})`},ref:e=>{this.stickyElement=e}},this.props.children),!this.context.hideFab&&e.createElement(ed,{onClick:this.toggleNavMenu},e.createElement(Yp,{open:t})))}};td.contextType=ue,td=((e,t,n,r)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([ha.observer],td);const nd=te.div` + ${({theme:e})=>`\n font-family: ${e.typography.fontFamily};\n font-size: ${e.typography.fontSize};\n font-weight: ${e.typography.fontWeightRegular};\n line-height: ${e.typography.lineHeight};\n color: ${e.colors.text.primary};\n display: flex;\n position: relative;\n text-align: left;\n\n -webkit-font-smoothing: ${e.typography.smoothing};\n font-smoothing: ${e.typography.smoothing};\n ${e.typography.optimizeSpeed?"text-rendering: optimizeSpeed !important":""};\n\n tap-highlight-color: rgba(0, 0, 0, 0);\n text-size-adjust: 100%;\n\n * {\n box-sizing: border-box;\n -webkit-tap-highlight-color: rgba(255, 255, 255, 0);\n }\n`}; +`,rd=te.div` + z-index: 1; + position: relative; + overflow: hidden; + width: calc(100% - ${e=>e.theme.sidebar.width}); + ${ee.lessThan("small",!0)` + width: 100%; + `}; + + contain: layout; +`,id=te.div` + background: ${({theme:e})=>e.rightPanel.backgroundColor}; + position: absolute; + top: 0; + bottom: 0; + right: 0; + width: ${({theme:e})=>{if(e.rightPanel.width.endsWith("%")){const t=parseInt(e.rightPanel.width,10);return`calc((100% - ${e.sidebar.width}) * ${t/100})`}return e.rightPanel.width}}; + ${ee.lessThan("medium",!0)` + display: none; + `}; +`,od=te.div` + padding: 5px 0; +`,sd=te.input.attrs((()=>({className:"search-input"})))` + width: calc(100% - ${e=>8*e.theme.spacing.unit}px); + box-sizing: border-box; + margin: 0 ${e=>4*e.theme.spacing.unit}px; + padding: 5px ${e=>2*e.theme.spacing.unit}px 5px + ${e=>4*e.theme.spacing.unit}px; + border: 0; + border-bottom: 1px solid + ${({theme:e})=>((0,t.getLuminance)(e.sidebar.backgroundColor)>.5?t.darken:t.lighten)(.1,e.sidebar.backgroundColor)}; + font-family: ${({theme:e})=>e.typography.fontFamily}; + font-weight: bold; + font-size: 13px; + color: ${e=>e.theme.sidebar.textColor}; + background-color: transparent; + outline: none; +`,ad=te((t=>e.createElement("svg",{className:t.className,version:"1.1",viewBox:"0 0 1000 1000",x:"0px",xmlns:"http://www.w3.org/2000/svg",y:"0px"},e.createElement("path",{d:"M968.2,849.4L667.3,549c83.9-136.5,66.7-317.4-51.7-435.6C477.1-25,252.5-25,113.9,113.4c-138.5,138.3-138.5,362.6,0,501C219.2,730.1,413.2,743,547.6,666.5l301.9,301.4c43.6,43.6,76.9,14.9,104.2-12.4C981,928.3,1011.8,893,968.2,849.4z M524.5,522c-88.9,88.7-233,88.7-321.8,0c-88.9-88.7-88.9-232.6,0-321.3c88.9-88.7,233-88.7,321.8,0C613.4,289.4,613.4,433.3,524.5,522z"})))).attrs({className:"search-icon"})` + position: absolute; + left: ${e=>4*e.theme.spacing.unit}px; + height: 1.8em; + width: 0.9em; + + path { + fill: ${e=>e.theme.sidebar.textColor}; + } +`,ld=te.div` + padding: ${e=>e.theme.spacing.unit}px 0; + background-color: ${({theme:e})=>(0,t.darken)(.05,e.sidebar.backgroundColor)}}; + color: ${e=>e.theme.sidebar.textColor}; + min-height: 150px; + max-height: 250px; + border-top: ${({theme:e})=>(0,t.darken)(.1,e.sidebar.backgroundColor)}}; + border-bottom: ${({theme:e})=>(0,t.darken)(.1,e.sidebar.backgroundColor)}}; + margin-top: 10px; + line-height: 1.4; + font-size: 0.9em; + + li { + background-color: inherit; + } + + ${Dc} { + padding-top: 6px; + padding-bottom: 6px; + + &:hover, + &.active { + background-color: ${({theme:e})=>(0,t.darken)(.1,e.sidebar.backgroundColor)}; + } + + > svg { + display: none; + } + } +`,cd=te.i` + position: absolute; + display: inline-block; + width: ${e=>2*e.theme.spacing.unit}px; + text-align: center; + right: ${e=>4*e.theme.spacing.unit}px; + line-height: 2em; + vertical-align: middle; + margin-right: 2px; + cursor: pointer; + font-style: normal; + color: '#666'; +`;var ud=Object.defineProperty,pd=Object.getOwnPropertyDescriptor;class dd extends e.PureComponent{constructor(e){super(e),this.activeItemRef=null,this.clear=()=>{this.setState({results:[],noResults:!1,term:"",activeItemIdx:-1}),this.props.marker.unmark()},this.handleKeyDown=e=>{if(27===e.keyCode&&this.clear(),40===e.keyCode&&(this.setState({activeItemIdx:Math.min(this.state.activeItemIdx+1,this.state.results.length-1)}),e.preventDefault()),38===e.keyCode&&(this.setState({activeItemIdx:Math.max(0,this.state.activeItemIdx-1)}),e.preventDefault()),13===e.keyCode){const e=this.state.results[this.state.activeItemIdx];if(e){const t=this.props.getItemById(e.meta);t&&this.props.onActivate(t)}}},this.search=e=>{const{minCharacterLengthToInitSearch:t}=this.context,n=e.target.value;n.length<t?this.clearResults(n):this.setState({term:n},(()=>this.searchCallback(this.state.term)))},this.state={results:[],noResults:!1,term:"",activeItemIdx:-1}}clearResults(e){this.setState({results:[],noResults:!1,term:e}),this.props.marker.unmark()}setResults(e,t){this.setState({results:e,noResults:0===e.length}),this.props.marker.mark(t)}searchCallback(e){this.props.search.search(e).then((t=>{this.setResults(t,e)}))}render(){const{activeItemIdx:t}=this.state,n=this.state.results.filter((e=>this.props.getItemById(e.meta))).map((e=>({item:this.props.getItemById(e.meta),score:e.score}))).sort(((e,t)=>t.score-e.score));return e.createElement(od,{role:"search"},this.state.term&&e.createElement(cd,{onClick:this.clear},"\xd7"),e.createElement(ad,null),e.createElement(sd,{value:this.state.term,onKeyDown:this.handleKeyDown,placeholder:"Search...","aria-label":"Search",type:"text",onChange:this.search}),n.length>0&&e.createElement(cs,{options:{wheelPropagation:!1}},e.createElement(ld,{"data-role":"search:results"},n.map(((n,r)=>e.createElement(Dp,{item:Object.create(n.item,{active:{value:r===t}}),onActivate:this.props.onActivate,withoutChildren:!0,key:n.item.id,"data-role":"search:result"}))))),this.state.term&&this.state.noResults?e.createElement(ld,{"data-role":"search:results"},N("noResultsFound")):null)}}dd.contextType=ue,((e,t,n,r)=>{for(var i,o=pd(t,n),s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(t,n,o)||o);o&&ud(t,n,o)})([xe.bind,(0,xe.debounce)(400)],dd.prototype,"searchCallback");class fd extends e.Component{componentDidMount(){this.props.store.onDidMount()}componentWillUnmount(){this.props.store.dispose()}render(){const{store:{spec:t,menu:n,options:r,search:i,marker:o}}=this.props,s=this.props.store;return e.createElement(Z,{theme:r.theme},e.createElement(wo,{value:s},e.createElement(pe,{value:r},e.createElement(nd,{className:"redoc-wrap"},e.createElement(td,{menu:n,className:"menu-content"},e.createElement(Oc,{info:t.info}),!r.disableSearch&&e.createElement(dd,{search:i,marker:o,getItemById:n.getItemById,onActivate:n.activateAndScroll})||null,e.createElement(Hp,{menu:n})),e.createElement(rd,{className:"api-content"},e.createElement(bc,{store:s}),e.createElement(_p,{items:n.items})),e.createElement(id,null)))))}}fd.propTypes={store:ce.instanceOf(dc).isRequired};var hd=Object.defineProperty,md=Object.getOwnPropertySymbols,gd=Object.prototype.hasOwnProperty,yd=Object.prototype.propertyIsEnumerable,vd=(e,t,n)=>t in e?hd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bd=(e,t)=>{for(var n in t||(t={}))gd.call(t,n)&&vd(e,n,t[n]);if(md)for(var n of md(t))yd.call(t,n)&&vd(e,n,t[n]);return e};const xd=function(t){const{spec:n,specUrl:i,options:o={},onLoaded:s}=t,a=W(o.hideLoading,!1),l=new Q(o);if(void 0!==l.nonce)try{r.nc=l.nonce}catch(e){}return e.createElement(ie,null,e.createElement(Oo,{spec:n?bd({},n):void 0,specUrl:i,options:o,onLoaded:s},(({loading:t,store:n})=>t?a?null:e.createElement(le,{color:l.theme.colors.primary.main}):e.createElement(fd,{store:n}))))}}(),i}()},1304:function(e){var t;t=function(){var e=JSON.parse('{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","\xa2":"cent","\xa3":"pound","\xa4":"currency","\xa5":"yen","\xa9":"(c)","\xaa":"a","\xae":"(r)","\xba":"o","\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xc6":"AE","\xc7":"C","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xd0":"D","\xd1":"N","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xdd":"Y","\xde":"TH","\xdf":"ss","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xe6":"ae","\xe7":"c","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xf0":"d","\xf1":"n","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xfd":"y","\xfe":"th","\xff":"y","\u0100":"A","\u0101":"a","\u0102":"A","\u0103":"a","\u0104":"A","\u0105":"a","\u0106":"C","\u0107":"c","\u010c":"C","\u010d":"c","\u010e":"D","\u010f":"d","\u0110":"DJ","\u0111":"dj","\u0112":"E","\u0113":"e","\u0116":"E","\u0117":"e","\u0118":"e","\u0119":"e","\u011a":"E","\u011b":"e","\u011e":"G","\u011f":"g","\u0122":"G","\u0123":"g","\u0128":"I","\u0129":"i","\u012a":"i","\u012b":"i","\u012e":"I","\u012f":"i","\u0130":"I","\u0131":"i","\u0136":"k","\u0137":"k","\u013b":"L","\u013c":"l","\u013d":"L","\u013e":"l","\u0141":"L","\u0142":"l","\u0143":"N","\u0144":"n","\u0145":"N","\u0146":"n","\u0147":"N","\u0148":"n","\u014c":"O","\u014d":"o","\u0150":"O","\u0151":"o","\u0152":"OE","\u0153":"oe","\u0154":"R","\u0155":"r","\u0158":"R","\u0159":"r","\u015a":"S","\u015b":"s","\u015e":"S","\u015f":"s","\u0160":"S","\u0161":"s","\u0162":"T","\u0163":"t","\u0164":"T","\u0165":"t","\u0168":"U","\u0169":"u","\u016a":"u","\u016b":"u","\u016e":"U","\u016f":"u","\u0170":"U","\u0171":"u","\u0172":"U","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017a":"z","\u017b":"Z","\u017c":"z","\u017d":"Z","\u017e":"z","\u018f":"E","\u0192":"f","\u01a0":"O","\u01a1":"o","\u01af":"U","\u01b0":"u","\u01c8":"LJ","\u01c9":"lj","\u01cb":"NJ","\u01cc":"nj","\u0218":"S","\u0219":"s","\u021a":"T","\u021b":"t","\u0259":"e","\u02da":"o","\u0386":"A","\u0388":"E","\u0389":"H","\u038a":"I","\u038c":"O","\u038e":"Y","\u038f":"W","\u0390":"i","\u0391":"A","\u0392":"B","\u0393":"G","\u0394":"D","\u0395":"E","\u0396":"Z","\u0397":"H","\u0398":"8","\u0399":"I","\u039a":"K","\u039b":"L","\u039c":"M","\u039d":"N","\u039e":"3","\u039f":"O","\u03a0":"P","\u03a1":"R","\u03a3":"S","\u03a4":"T","\u03a5":"Y","\u03a6":"F","\u03a7":"X","\u03a8":"PS","\u03a9":"W","\u03aa":"I","\u03ab":"Y","\u03ac":"a","\u03ad":"e","\u03ae":"h","\u03af":"i","\u03b0":"y","\u03b1":"a","\u03b2":"b","\u03b3":"g","\u03b4":"d","\u03b5":"e","\u03b6":"z","\u03b7":"h","\u03b8":"8","\u03b9":"i","\u03ba":"k","\u03bb":"l","\u03bc":"m","\u03bd":"n","\u03be":"3","\u03bf":"o","\u03c0":"p","\u03c1":"r","\u03c2":"s","\u03c3":"s","\u03c4":"t","\u03c5":"y","\u03c6":"f","\u03c7":"x","\u03c8":"ps","\u03c9":"w","\u03ca":"i","\u03cb":"y","\u03cc":"o","\u03cd":"y","\u03ce":"w","\u0401":"Yo","\u0402":"DJ","\u0404":"Ye","\u0406":"I","\u0407":"Yi","\u0408":"J","\u0409":"LJ","\u040a":"NJ","\u040b":"C","\u040f":"DZ","\u0410":"A","\u0411":"B","\u0412":"V","\u0413":"G","\u0414":"D","\u0415":"E","\u0416":"Zh","\u0417":"Z","\u0418":"I","\u0419":"J","\u041a":"K","\u041b":"L","\u041c":"M","\u041d":"N","\u041e":"O","\u041f":"P","\u0420":"R","\u0421":"S","\u0422":"T","\u0423":"U","\u0424":"F","\u0425":"H","\u0426":"C","\u0427":"Ch","\u0428":"Sh","\u0429":"Sh","\u042a":"U","\u042b":"Y","\u042c":"","\u042d":"E","\u042e":"Yu","\u042f":"Ya","\u0430":"a","\u0431":"b","\u0432":"v","\u0433":"g","\u0434":"d","\u0435":"e","\u0436":"zh","\u0437":"z","\u0438":"i","\u0439":"j","\u043a":"k","\u043b":"l","\u043c":"m","\u043d":"n","\u043e":"o","\u043f":"p","\u0440":"r","\u0441":"s","\u0442":"t","\u0443":"u","\u0444":"f","\u0445":"h","\u0446":"c","\u0447":"ch","\u0448":"sh","\u0449":"sh","\u044a":"u","\u044b":"y","\u044c":"","\u044d":"e","\u044e":"yu","\u044f":"ya","\u0451":"yo","\u0452":"dj","\u0454":"ye","\u0456":"i","\u0457":"yi","\u0458":"j","\u0459":"lj","\u045a":"nj","\u045b":"c","\u045d":"u","\u045f":"dz","\u0490":"G","\u0491":"g","\u0492":"GH","\u0493":"gh","\u049a":"KH","\u049b":"kh","\u04a2":"NG","\u04a3":"ng","\u04ae":"UE","\u04af":"ue","\u04b0":"U","\u04b1":"u","\u04ba":"H","\u04bb":"h","\u04d8":"AE","\u04d9":"ae","\u04e8":"OE","\u04e9":"oe","\u0e3f":"baht","\u10d0":"a","\u10d1":"b","\u10d2":"g","\u10d3":"d","\u10d4":"e","\u10d5":"v","\u10d6":"z","\u10d7":"t","\u10d8":"i","\u10d9":"k","\u10da":"l","\u10db":"m","\u10dc":"n","\u10dd":"o","\u10de":"p","\u10df":"zh","\u10e0":"r","\u10e1":"s","\u10e2":"t","\u10e3":"u","\u10e4":"f","\u10e5":"k","\u10e6":"gh","\u10e7":"q","\u10e8":"sh","\u10e9":"ch","\u10ea":"ts","\u10eb":"dz","\u10ec":"ts","\u10ed":"ch","\u10ee":"kh","\u10ef":"j","\u10f0":"h","\u1e80":"W","\u1e81":"w","\u1e82":"W","\u1e83":"w","\u1e84":"W","\u1e85":"w","\u1e9e":"SS","\u1ea0":"A","\u1ea1":"a","\u1ea2":"A","\u1ea3":"a","\u1ea4":"A","\u1ea5":"a","\u1ea6":"A","\u1ea7":"a","\u1ea8":"A","\u1ea9":"a","\u1eaa":"A","\u1eab":"a","\u1eac":"A","\u1ead":"a","\u1eae":"A","\u1eaf":"a","\u1eb0":"A","\u1eb1":"a","\u1eb2":"A","\u1eb3":"a","\u1eb4":"A","\u1eb5":"a","\u1eb6":"A","\u1eb7":"a","\u1eb8":"E","\u1eb9":"e","\u1eba":"E","\u1ebb":"e","\u1ebc":"E","\u1ebd":"e","\u1ebe":"E","\u1ebf":"e","\u1ec0":"E","\u1ec1":"e","\u1ec2":"E","\u1ec3":"e","\u1ec4":"E","\u1ec5":"e","\u1ec6":"E","\u1ec7":"e","\u1ec8":"I","\u1ec9":"i","\u1eca":"I","\u1ecb":"i","\u1ecc":"O","\u1ecd":"o","\u1ece":"O","\u1ecf":"o","\u1ed0":"O","\u1ed1":"o","\u1ed2":"O","\u1ed3":"o","\u1ed4":"O","\u1ed5":"o","\u1ed6":"O","\u1ed7":"o","\u1ed8":"O","\u1ed9":"o","\u1eda":"O","\u1edb":"o","\u1edc":"O","\u1edd":"o","\u1ede":"O","\u1edf":"o","\u1ee0":"O","\u1ee1":"o","\u1ee2":"O","\u1ee3":"o","\u1ee4":"U","\u1ee5":"u","\u1ee6":"U","\u1ee7":"u","\u1ee8":"U","\u1ee9":"u","\u1eea":"U","\u1eeb":"u","\u1eec":"U","\u1eed":"u","\u1eee":"U","\u1eef":"u","\u1ef0":"U","\u1ef1":"u","\u1ef2":"Y","\u1ef3":"y","\u1ef4":"Y","\u1ef5":"y","\u1ef6":"Y","\u1ef7":"y","\u1ef8":"Y","\u1ef9":"y","\u2018":"\'","\u2019":"\'","\u201c":"\\"","\u201d":"\\"","\u2020":"+","\u2022":"*","\u2026":"...","\u20a0":"ecu","\u20a2":"cruzeiro","\u20a3":"french franc","\u20a4":"lira","\u20a5":"mill","\u20a6":"naira","\u20a7":"peseta","\u20a8":"rupee","\u20a9":"won","\u20aa":"new shequel","\u20ab":"dong","\u20ac":"euro","\u20ad":"kip","\u20ae":"tugrik","\u20af":"drachma","\u20b0":"penny","\u20b1":"peso","\u20b2":"guarani","\u20b3":"austral","\u20b4":"hryvnia","\u20b5":"cedi","\u20b8":"kazakhstani tenge","\u20b9":"indian rupee","\u20ba":"turkish lira","\u20bd":"russian ruble","\u20bf":"bitcoin","\u2120":"sm","\u2122":"tm","\u2202":"d","\u2206":"delta","\u2211":"sum","\u221e":"infinity","\u2665":"love","\u5143":"yuan","\u5186":"yen","\ufdfc":"rial"}'),t=JSON.parse('{"de":{"\xc4":"AE","\xe4":"ae","\xd6":"OE","\xf6":"oe","\xdc":"UE","\xfc":"ue","%":"prozent","&":"und","|":"oder","\u2211":"summe","\u221e":"unendlich","\u2665":"liebe"},"vi":{"\u0110":"D","\u0111":"d"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","\xa2":"centime","\xa3":"livre","\xa4":"devise","\u20a3":"franc","\u2211":"somme","\u221e":"infini","\u2665":"amour"}}');function n(n,r){if("string"!=typeof n)throw new Error("slugify: string argument expected");var i=t[(r="string"==typeof r?{replacement:r}:r||{}).locale]||{},o=void 0===r.replacement?"-":r.replacement,s=n.split("").reduce((function(t,n){return t+(i[n]||e[n]||n).replace(r.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")}),"").trim().replace(new RegExp("[\\s"+o+"]+","g"),o);return r.lower&&(s=s.toLowerCase()),r.strict&&(s=s.replace(new RegExp("[^a-zA-Z0-9"+o+"]","g"),"").replace(new RegExp("[\\s"+o+"]+","g"),o)),s}return n.extend=function(t){for(var n in t)e[n]=t[n]},n},e.exports=t(),e.exports.default=t()},5114:e=>{e.exports=function(e,t){e||(e=document),t||(t=window);var n,r,i=[],o=!1,s=e.documentElement,a=function(){},l="hidden",c="visibilitychange";void 0!==e.webkitHidden&&(l="webkitHidden",c="webkitvisibilitychange"),t.getComputedStyle||f();for(var u=["","-webkit-","-moz-","-ms-"],p=document.createElement("div"),d=u.length-1;d>=0;d--){try{p.style.position=u[d]+"sticky"}catch($){}""!=p.style.position&&f()}function f(){P=L=I=C=R=N=a}function h(e){return parseFloat(e)||0}function m(){n={top:t.pageYOffset,left:t.pageXOffset}}function g(){if(t.pageXOffset!=n.left)return m(),void I();t.pageYOffset!=n.top&&(m(),v())}function y(e){setTimeout((function(){t.pageYOffset!=n.top&&(n.top=t.pageYOffset,v())}),0)}function v(){for(var e=i.length-1;e>=0;e--)b(i[e])}function b(e){if(e.inited){var t=n.top<=e.limit.start?0:n.top>=e.limit.end?2:1;e.mode!=t&&function(e,t){var n=e.node.style;switch(t){case 0:n.position="absolute",n.left=e.offset.left+"px",n.right=e.offset.right+"px",n.top=e.offset.top+"px",n.bottom="auto",n.width="auto",n.marginLeft=0,n.marginRight=0,n.marginTop=0;break;case 1:n.position="fixed",n.left=e.box.left+"px",n.right=e.box.right+"px",n.top=e.css.top,n.bottom="auto",n.width="auto",n.marginLeft=0,n.marginRight=0,n.marginTop=0;break;case 2:n.position="absolute",n.left=e.offset.left+"px",n.right=e.offset.right+"px",n.top="auto",n.bottom=0,n.width="auto",n.marginLeft=0,n.marginRight=0}e.mode=t}(e,t)}}function x(e){isNaN(parseFloat(e.computed.top))||e.isCell||(e.inited=!0,e.clone||function(e){e.clone=document.createElement("div");var t=e.node.nextSibling||e.node,n=e.clone.style;n.height=e.height+"px",n.width=e.width+"px",n.marginTop=e.computed.marginTop,n.marginBottom=e.computed.marginBottom,n.marginLeft=e.computed.marginLeft,n.marginRight=e.computed.marginRight,n.padding=n.border=n.borderSpacing=0,n.fontSize="1em",n.position="static",n.cssFloat=e.computed.cssFloat,e.node.parentNode.insertBefore(e.clone,t)}(e),"absolute"!=e.parent.computed.position&&"relative"!=e.parent.computed.position&&(e.parent.node.style.position="relative"),b(e),e.parent.height=e.parent.node.offsetHeight,e.docOffsetTop=E(e.clone))}function w(e){var t=!0;e.clone&&function(e){e.clone.parentNode.removeChild(e.clone),e.clone=void 0}(e),function(e,t){for(key in t)t.hasOwnProperty(key)&&(e[key]=t[key])}(e.node.style,e.css);for(var n=i.length-1;n>=0;n--)if(i[n].node!==e.node&&i[n].parent.node===e.parent.node){t=!1;break}t&&(e.parent.node.style.position=e.parent.css.position),e.mode=-1}function k(){for(var e=i.length-1;e>=0;e--)x(i[e])}function O(){for(var e=i.length-1;e>=0;e--)w(i[e])}function S(e){var t=getComputedStyle(e),n=e.parentNode,r=getComputedStyle(n),i=e.style.position;e.style.position="relative";var o={top:t.top,marginTop:t.marginTop,marginBottom:t.marginBottom,marginLeft:t.marginLeft,marginRight:t.marginRight,cssFloat:t.cssFloat},a={top:h(t.top),marginBottom:h(t.marginBottom),paddingLeft:h(t.paddingLeft),paddingRight:h(t.paddingRight),borderLeftWidth:h(t.borderLeftWidth),borderRightWidth:h(t.borderRightWidth)};e.style.position=i;var l={position:e.style.position,top:e.style.top,bottom:e.style.bottom,left:e.style.left,right:e.style.right,width:e.style.width,marginTop:e.style.marginTop,marginLeft:e.style.marginLeft,marginRight:e.style.marginRight},c=_(e),u=_(n),p={node:n,css:{position:n.style.position},computed:{position:r.position},numeric:{borderLeftWidth:h(r.borderLeftWidth),borderRightWidth:h(r.borderRightWidth),borderTopWidth:h(r.borderTopWidth),borderBottomWidth:h(r.borderBottomWidth)}};return{node:e,box:{left:c.win.left,right:s.clientWidth-c.win.right},offset:{top:c.win.top-u.win.top-p.numeric.borderTopWidth,left:c.win.left-u.win.left-p.numeric.borderLeftWidth,right:-c.win.right+u.win.right-p.numeric.borderRightWidth},css:l,isCell:"table-cell"==t.display,computed:o,numeric:a,width:c.win.right-c.win.left,height:c.win.bottom-c.win.top,mode:-1,inited:!1,parent:p,limit:{start:c.doc.top-a.top,end:u.doc.top+n.offsetHeight-p.numeric.borderBottomWidth-e.offsetHeight-a.top-a.marginBottom}}}function E(e){for(var t=0;e;)t+=e.offsetTop,e=e.offsetParent;return t}function _(e){var n=e.getBoundingClientRect();return{doc:{top:n.top+t.pageYOffset,left:n.left+t.pageXOffset},win:n}}function A(){r=setInterval((function(){!function(){for(var e=i.length-1;e>=0;e--)if(i[e].inited){var t=Math.abs(E(i[e].clone)-i[e].docOffsetTop),n=Math.abs(i[e].parent.node.offsetHeight-i[e].parent.height);if(t>=2||n>=2)return!1}return!0}()&&I()}),500)}function j(){clearInterval(r)}function T(){o&&(document[l]?j():A())}function P(){o||(m(),k(),t.addEventListener("scroll",g),t.addEventListener("wheel",y),t.addEventListener("resize",I),t.addEventListener("orientationchange",I),e.addEventListener(c,T),A(),o=!0)}function I(){if(o){O();for(var e=i.length-1;e>=0;e--)i[e]=S(i[e].node);k()}}function C(){t.removeEventListener("scroll",g),t.removeEventListener("wheel",y),t.removeEventListener("resize",I),t.removeEventListener("orientationchange",I),e.removeEventListener(c,T),j(),o=!1}function R(){C(),O()}function N(){for(R();i.length;)i.pop()}function L(e){for(var t=i.length-1;t>=0;t--)if(i[t].node===e)return;var n=S(e);i.push(n),o?x(n):P()}return m(),{stickies:i,add:L,remove:function(e){for(var t=i.length-1;t>=0;t--)i[t].node===e&&(w(i[t]),i.splice(t,1))},init:P,rebuild:I,pause:C,stop:R,kill:N}}},508:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ServerStyleSheet:()=>Zt,StyleSheetConsumer:()=>St,StyleSheetContext:()=>Ot,StyleSheetManager:()=>At,ThemeConsumer:()=>Dt,ThemeContext:()=>Mt,ThemeProvider:()=>Bt,__PRIVATE__:()=>en,createGlobalStyle:()=>Xt,css:()=>Vt,default:()=>Yt,isStyledComponent:()=>Qe,keyframes:()=>Kt,styled:()=>Yt,useTheme:()=>Ft,version:()=>ue,withTheme:()=>Jt});var r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.create;function i(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}Object.create;"function"==typeof SuppressedError&&SuppressedError;var o=n(7294),s=n(6774),a=n.n(s),l="-ms-",c="-moz-",u="-webkit-",p="comm",d="rule",f="decl",h="@import",m="@keyframes",g="@layer",y=Math.abs,v=String.fromCharCode,b=Object.assign;function x(e){return e.trim()}function w(e,t){return(e=t.exec(e))?e[0]:e}function k(e,t,n){return e.replace(t,n)}function O(e,t){return e.indexOf(t)}function S(e,t){return 0|e.charCodeAt(t)}function E(e,t,n){return e.slice(t,n)}function _(e){return e.length}function A(e){return e.length}function j(e,t){return t.push(e),e}function T(e,t){return e.filter((function(e){return!w(e,t)}))}var P=1,I=1,C=0,R=0,N=0,L="";function $(e,t,n,r,i,o,s,a){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:P,column:I,length:s,return:"",siblings:a}}function M(e,t){return b($("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function D(e){for(;e.root;)e=M(e.root,{children:[e]});j(e,e.siblings)}function F(){return N=R>0?S(L,--R):0,I--,10===N&&(I=1,P--),N}function B(){return N=R<C?S(L,R++):0,I++,10===N&&(I=1,P++),N}function z(){return S(L,R)}function U(){return R}function q(e,t){return E(L,e,t)}function W(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function V(e){return P=I=1,C=_(L=e),R=0,[]}function Q(e){return L="",e}function H(e){return x(q(R-1,X(91===e?e+2:40===e?e+1:e)))}function Y(e){for(;(N=z())&&N<33;)B();return W(e)>2||W(N)>3?"":" "}function G(e,t){for(;--t&&B()&&!(N<48||N>102||N>57&&N<65||N>70&&N<97););return q(e,U()+(t<6&&32==z()&&32==B()))}function X(e){for(;B();)switch(N){case e:return R;case 34:case 39:34!==e&&39!==e&&X(N);break;case 40:41===e&&X(e);break;case 92:B()}return R}function K(e,t){for(;B()&&e+N!==57&&(e+N!==84||47!==z()););return"/*"+q(t,R-1)+"*"+v(47===e?e:B())}function J(e){for(;!W(z());)B();return q(e,R)}function Z(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function ee(e,t,n,r){switch(e.type){case g:if(e.children.length)break;case h:case f:return e.return=e.return||e.value;case p:return"";case m:return e.return=e.value+"{"+Z(e.children,r)+"}";case d:if(!_(e.value=e.props.join(",")))return""}return _(n=Z(e.children,r))?e.return=e.value+"{"+n+"}":""}function te(e,t,n){switch(function(e,t){return 45^S(e,0)?(((t<<2^S(e,0))<<2^S(e,1))<<2^S(e,2))<<2^S(e,3):0}(e,t)){case 5103:return u+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return u+e+e;case 4789:return c+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return u+e+c+e+l+e+e;case 5936:switch(S(e,t+11)){case 114:return u+e+l+k(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return u+e+l+k(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return u+e+l+k(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return u+e+l+e+e;case 6165:return u+e+l+"flex-"+e+e;case 5187:return u+e+k(e,/(\w+).+(:[^]+)/,u+"box-$1$2"+l+"flex-$1$2")+e;case 5443:return u+e+l+"flex-item-"+k(e,/flex-|-self/g,"")+(w(e,/flex-|baseline/)?"":l+"grid-row-"+k(e,/flex-|-self/g,""))+e;case 4675:return u+e+l+"flex-line-pack"+k(e,/align-content|flex-|-self/g,"")+e;case 5548:return u+e+l+k(e,"shrink","negative")+e;case 5292:return u+e+l+k(e,"basis","preferred-size")+e;case 6060:return u+"box-"+k(e,"-grow","")+u+e+l+k(e,"grow","positive")+e;case 4554:return u+k(e,/([^-])(transform)/g,"$1"+u+"$2")+e;case 6187:return k(k(k(e,/(zoom-|grab)/,u+"$1"),/(image-set)/,u+"$1"),e,"")+e;case 5495:case 3959:return k(e,/(image-set\([^]*)/,u+"$1$`$1");case 4968:return k(k(e,/(.+:)(flex-)?(.*)/,u+"box-pack:$3"+l+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+u+e+e;case 4200:if(!w(e,/flex-|baseline/))return l+"grid-column-align"+E(e,t)+e;break;case 2592:case 3360:return l+k(e,"template-","")+e;case 4384:case 3616:return n&&n.some((function(e,n){return t=n,w(e.props,/grid-\w+-end/)}))?~O(e+(n=n[t].value),"span")?e:l+k(e,"-start","")+e+l+"grid-row-span:"+(~O(n,"span")?w(n,/\d+/):+w(n,/\d+/)-+w(e,/\d+/))+";":l+k(e,"-start","")+e;case 4896:case 4128:return n&&n.some((function(e){return w(e.props,/grid-\w+-start/)}))?e:l+k(k(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return k(e,/(.+)-inline(.+)/,u+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(_(e)-1-t>6)switch(S(e,t+1)){case 109:if(45!==S(e,t+4))break;case 102:return k(e,/(.+:)(.+)-([^]+)/,"$1"+u+"$2-$3$1"+c+(108==S(e,t+3)?"$3":"$2-$3"))+e;case 115:return~O(e,"stretch")?te(k(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return k(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,n,r,i,o,s,a){return l+n+":"+r+a+(i?l+n+"-span:"+(o?s:+s-+r)+a:"")+e}));case 4949:if(121===S(e,t+6))return k(e,":",":"+u)+e;break;case 6444:switch(S(e,45===S(e,14)?18:11)){case 120:return k(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+u+(45===S(e,14)?"inline-":"")+"box$3$1"+u+"$2$3$1"+l+"$2box$3")+e;case 100:return k(e,":",":"+l)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return k(e,"scroll-","scroll-snap-")+e}return e}function ne(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case f:return void(e.return=te(e.value,e.length,n));case m:return Z([M(e,{value:k(e.value,"@","@"+u)})],r);case d:if(e.length)return function(e,t){return e.map(t).join("")}(n=e.props,(function(t){switch(w(t,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":D(M(e,{props:[k(t,/:(read-\w+)/,":"+c+"$1")]})),D(M(e,{props:[t]})),b(e,{props:T(n,r)});break;case"::placeholder":D(M(e,{props:[k(t,/:(plac\w+)/,":"+u+"input-$1")]})),D(M(e,{props:[k(t,/:(plac\w+)/,":"+c+"$1")]})),D(M(e,{props:[k(t,/:(plac\w+)/,l+"input-$1")]})),D(M(e,{props:[t]})),b(e,{props:T(n,r)})}return""}))}}function re(e){return Q(ie("",null,null,null,[""],e=V(e),0,[0],e))}function ie(e,t,n,r,i,o,s,a,l){for(var c=0,u=0,p=s,d=0,f=0,h=0,m=1,g=1,y=1,b=0,x="",w=i,E=o,A=r,T=x;g;)switch(h=b,b=B()){case 40:if(108!=h&&58==S(T,p-1)){-1!=O(T+=k(H(b),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:T+=H(b);break;case 9:case 10:case 13:case 32:T+=Y(h);break;case 92:T+=G(U()-1,7);continue;case 47:switch(z()){case 42:case 47:j(se(K(B(),U()),t,n,l),l);break;default:T+="/"}break;case 123*m:a[c++]=_(T)*y;case 125*m:case 59:case 0:switch(b){case 0:case 125:g=0;case 59+u:-1==y&&(T=k(T,/\f/g,"")),f>0&&_(T)-p&&j(f>32?ae(T+";",r,n,p-1,l):ae(k(T," ","")+";",r,n,p-2,l),l);break;case 59:T+=";";default:if(j(A=oe(T,t,n,c,u,i,a,x,w=[],E=[],p,o),o),123===b)if(0===u)ie(T,t,A,A,w,o,p,a,E);else switch(99===d&&110===S(T,3)?100:d){case 100:case 108:case 109:case 115:ie(e,A,A,r&&j(oe(e,A,A,0,0,i,a,x,i,w=[],p,E),E),i,E,p,a,r?w:E);break;default:ie(T,A,A,A,[""],E,0,a,E)}}c=u=f=0,m=y=1,x=T="",p=s;break;case 58:p=1+_(T),f=h;default:if(m<1)if(123==b)--m;else if(125==b&&0==m++&&125==F())continue;switch(T+=v(b),b*m){case 38:y=u>0?1:(T+="\f",-1);break;case 44:a[c++]=(_(T)-1)*y,y=1;break;case 64:45===z()&&(T+=H(B())),d=z(),u=p=_(x=T+=J(U())),b++;break;case 45:45===h&&2==_(T)&&(m=0)}}return o}function oe(e,t,n,r,i,o,s,a,l,c,u,p){for(var f=i-1,h=0===i?o:[""],m=A(h),g=0,v=0,b=0;g<r;++g)for(var w=0,O=E(e,f+1,f=y(v=s[g])),S=e;w<m;++w)(S=x(v>0?h[w]+" "+O:k(O,/&\f/g,h[w])))&&(l[b++]=S);return $(e,t,n,0===i?d:a,l,c,u,p)}function se(e,t,n,r){return $(e,t,n,p,v(N),E(e,2,-2),0,r)}function ae(e,t,n,r,i){return $(e,t,n,f,E(e,0,r),E(e,r+1,-1),r,i)}var le={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},ce="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",ue="6.1.1",pe="undefined"!=typeof window&&"HTMLElement"in window,de=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY&&("false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY)),fe={},he=(new Set,Object.freeze([])),me=Object.freeze({});function ge(e,t,n){return void 0===n&&(n=me),e.theme!==n.theme&&e.theme||t||n.theme}var ye=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),ve=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,be=/(^-|-$)/g;function xe(e){return e.replace(ve,"-").replace(be,"")}var we=/(a)(d)/gi,ke=function(e){return String.fromCharCode(e+(e>25?39:97))};function Oe(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=ke(t%52)+n;return(ke(t%52)+n).replace(we,"$1-$2")}var Se,Ee=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},_e=function(e){return Ee(5381,e)};function Ae(e){return Oe(_e(e)>>>0)}function je(e){return e.displayName||e.name||"Component"}function Te(e){return"string"==typeof e&&!0}var Pe="function"==typeof Symbol&&Symbol.for,Ie=Pe?Symbol.for("react.memo"):60115,Ce=Pe?Symbol.for("react.forward_ref"):60112,Re={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Ne={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Le={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},$e=((Se={})[Ce]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Se[Ie]=Le,Se);function Me(e){return("type"in(t=e)&&t.type.$$typeof)===Ie?Le:"$$typeof"in e?$e[e.$$typeof]:Re;var t}var De=Object.defineProperty,Fe=Object.getOwnPropertyNames,Be=Object.getOwnPropertySymbols,ze=Object.getOwnPropertyDescriptor,Ue=Object.getPrototypeOf,qe=Object.prototype;function We(e,t,n){if("string"!=typeof t){if(qe){var r=Ue(t);r&&r!==qe&&We(e,r,n)}var i=Fe(t);Be&&(i=i.concat(Be(t)));for(var o=Me(e),s=Me(t),a=0;a<i.length;++a){var l=i[a];if(!(l in Ne||n&&n[l]||s&&l in s||o&&l in o)){var c=ze(t,l);try{De(e,l,c)}catch(e){}}}}return e}function Ve(e){return"function"==typeof e}function Qe(e){return"object"==typeof e&&"styledComponentId"in e}function He(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function Ye(e,t){if(0===e.length)return"";for(var n=e[0],r=1;r<e.length;r++)n+=t?t+e[r]:e[r];return n}function Ge(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function Xe(e,t,n){if(void 0===n&&(n=!1),!n&&!Ge(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=Xe(e[r],t[r]);else if(Ge(t))for(var r in t)e[r]=Xe(e[r],t[r]);return e}function Ke(e,t){Object.defineProperty(e,"toString",{value:t})}function Je(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):""))}var Ze=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,i=r;e>=i;)if((i<<=1)<0)throw Je(16,"".concat(e));this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var o=r;o<i;o++)this.groupSizes[o]=0}for(var s=this.indexOfGroup(e+1),a=(o=0,t.length);o<a;o++)this.tag.insertRule(s,t[o])&&(this.groupSizes[e]++,s++)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var i=n;i<r;i++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n,o=r;o<i;o++)t+="".concat(this.tag.getRule(o)).concat("/*!sc*/\n");return t},e}(),et=new Map,tt=new Map,nt=1,rt=function(e){if(et.has(e))return et.get(e);for(;tt.has(nt);)nt++;var t=nt++;return et.set(e,t),tt.set(t,e),t},it=function(e,t){nt=t+1,et.set(e,t),tt.set(t,e)},ot="style[".concat(ce,"][").concat("data-styled-version",'="').concat("6.1.1",'"]'),st=new RegExp("^".concat(ce,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),at=function(e,t,n){for(var r,i=n.split(","),o=0,s=i.length;o<s;o++)(r=i[o])&&e.registerName(t,r)},lt=function(e,t){for(var n,r=(null!==(n=t.textContent)&&void 0!==n?n:"").split("/*!sc*/\n"),i=[],o=0,s=r.length;o<s;o++){var a=r[o].trim();if(a){var l=a.match(st);if(l){var c=0|parseInt(l[1],10),u=l[2];0!==c&&(it(u,c),at(e,u,l[3]),e.getTag().insertRules(c,i)),i.length=0}else i.push(a)}}};function ct(){return n.nc}var ut=function(e){var t=document.head,n=e||t,r=document.createElement("style"),i=function(e){var t=Array.from(e.querySelectorAll("style[".concat(ce,"]")));return t[t.length-1]}(n),o=void 0!==i?i.nextSibling:null;r.setAttribute(ce,"active"),r.setAttribute("data-styled-version","6.1.1");var s=ct();return s&&r.setAttribute("nonce",s),n.insertBefore(r,o),r},pt=function(){function e(e){this.element=ut(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var i=t[n];if(i.ownerNode===e)return i}throw Je(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),dt=function(){function e(e){this.element=ut(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),ft=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),ht=pe,mt={isServer:!pe,useCSSOMInjection:!de},gt=function(){function e(e,t,n){void 0===e&&(e=me),void 0===t&&(t={});var i=this;this.options=r(r({},mt),e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&pe&&ht&&(ht=!1,function(e){for(var t=document.querySelectorAll(ot),n=0,r=t.length;n<r;n++){var i=t[n];i&&"active"!==i.getAttribute(ce)&&(lt(e,i),i.parentNode&&i.parentNode.removeChild(i))}}(this)),Ke(this,(function(){return function(e){for(var t=e.getTag(),n=t.length,r="",i=function(n){var i=function(e){return tt.get(e)}(n);if(void 0===i)return"continue";var o=e.names.get(i),s=t.getGroup(n);if(void 0===o||0===s.length)return"continue";var a="".concat(ce,".g").concat(n,'[id="').concat(i,'"]'),l="";void 0!==o&&o.forEach((function(e){e.length>0&&(l+="".concat(e,","))})),r+="".concat(s).concat(a,'{content:"').concat(l,'"}').concat("/*!sc*/\n")},o=0;o<n;o++)i(o);return r}(i)}))}return e.registerId=function(e){return rt(e)},e.prototype.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(r(r({},this.options),t),this.gs,n&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new ft(n):t?new pt(n):new dt(n)}(this.options),new Ze(e)));var e},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(rt(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(rt(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(rt(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),yt=/&/g,vt=/^\s*\/\/.*$/gm;function bt(e,t){return e.map((function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map((function(e){return"".concat(t," ").concat(e)}))),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=bt(e.children,t)),e}))}function xt(e){var t,n,r,i=void 0===e?me:e,o=i.options,s=void 0===o?me:o,a=i.plugins,l=void 0===a?he:a,c=function(e,r,i){return i===n||i.startsWith(n)&&i.endsWith(n)&&i.replaceAll(n,"").length>0?".".concat(t):e},u=l.slice();u.push((function(e){e.type===d&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(yt,n).replace(r,c))})),s.prefix&&u.push(ne),u.push(ee);var p=function(e,i,o,a){void 0===i&&(i=""),void 0===o&&(o=""),void 0===a&&(a="&"),t=a,n=i,r=new RegExp("\\".concat(n,"\\b"),"g");var l=e.replace(vt,""),c=re(o||i?"".concat(o," ").concat(i," { ").concat(l," }"):l);s.namespace&&(c=bt(c,s.namespace));var p,d,f,h=[];return Z(c,(p=u.concat((f=function(e){return h.push(e)},function(e){e.root||(e=e.return)&&f(e)})),d=A(p),function(e,t,n,r){for(var i="",o=0;o<d;o++)i+=p[o](e,t,n,r)||"";return i})),h};return p.hash=l.length?l.reduce((function(e,t){return t.name||Je(15),Ee(e,t.name)}),5381).toString():"",p}var wt=new gt,kt=xt(),Ot=o.createContext({shouldForwardProp:void 0,styleSheet:wt,stylis:kt}),St=Ot.Consumer,Et=o.createContext(void 0);function _t(){return(0,o.useContext)(Ot)}function At(e){var t=(0,o.useState)(e.stylisPlugins),n=t[0],r=t[1],i=_t().styleSheet,s=(0,o.useMemo)((function(){var t=i;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target,i]),l=(0,o.useMemo)((function(){return xt({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:n})}),[e.enableVendorPrefixes,e.namespace,n]);(0,o.useEffect)((function(){a()(n,e.stylisPlugins)||r(e.stylisPlugins)}),[e.stylisPlugins]);var c=(0,o.useMemo)((function(){return{shouldForwardProp:e.shouldForwardProp,styleSheet:s,stylis:l}}),[e.shouldForwardProp,s,l]);return o.createElement(Ot.Provider,{value:c},o.createElement(Et.Provider,{value:l},e.children))}var jt=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=kt);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,Ke(this,(function(){throw Je(12,String(n.name))}))}return e.prototype.getName=function(e){return void 0===e&&(e=kt),this.name+e.hash},e}(),Tt=function(e){return e>="A"&&e<="Z"};function Pt(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;Tt(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var It=function(e){return null==e||!1===e||""===e},Ct=function(e){var t,n,r=[];for(var o in e){var s=e[o];e.hasOwnProperty(o)&&!It(s)&&(Array.isArray(s)&&s.isCss||Ve(s)?r.push("".concat(Pt(o),":"),s,";"):Ge(s)?r.push.apply(r,i(i(["".concat(o," {")],Ct(s),!1),["}"],!1)):r.push("".concat(Pt(o),": ").concat((t=o,null==(n=s)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||t in le||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function Rt(e,t,n,r){return It(e)?[]:Qe(e)?[".".concat(e.styledComponentId)]:Ve(e)?!Ve(i=e)||i.prototype&&i.prototype.isReactComponent||!t?[e]:Rt(e(t),t,n,r):e instanceof jt?n?(e.inject(n,r),[e.getName(r)]):[e]:Ge(e)?Ct(e):Array.isArray(e)?Array.prototype.concat.apply(he,e.map((function(e){return Rt(e,t,n,r)}))):[e.toString()];var i}function Nt(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(Ve(n)&&!Qe(n))return!1}return!0}var Lt=_e("6.1.1"),$t=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&Nt(e),this.componentId=t,this.baseHash=Ee(Lt,t),this.baseStyle=n,gt.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))r=He(r,this.staticRulesId);else{var i=Ye(Rt(this.rules,e,t,n)),o=Oe(Ee(this.baseHash,i)>>>0);if(!t.hasNameForId(this.componentId,o)){var s=n(i,".".concat(o),void 0,this.componentId);t.insertRules(this.componentId,o,s)}r=He(r,o),this.staticRulesId=o}else{for(var a=Ee(this.baseHash,n.hash),l="",c=0;c<this.rules.length;c++){var u=this.rules[c];if("string"==typeof u)l+=u;else if(u){var p=Ye(Rt(u,e,t,n));a=Ee(a,p+c),l+=p}}if(l){var d=Oe(a>>>0);t.hasNameForId(this.componentId,d)||t.insertRules(this.componentId,d,n(l,".".concat(d),void 0,this.componentId)),r=He(r,d)}}return r},e}(),Mt=o.createContext(void 0),Dt=Mt.Consumer;function Ft(){var e=(0,o.useContext)(Mt);if(!e)throw Je(18);return e}function Bt(e){var t=o.useContext(Mt),n=(0,o.useMemo)((function(){return function(e,t){if(!e)throw Je(14);if(Ve(e))return e(t);if(Array.isArray(e)||"object"!=typeof e)throw Je(8);return t?r(r({},t),e):e}(e.theme,t)}),[e.theme,t]);return e.children?o.createElement(Mt.Provider,{value:n},e.children):null}var zt={};new Set;function Ut(e,t,n){var i=Qe(e),s=e,a=!Te(e),l=t.attrs,c=void 0===l?he:l,u=t.componentId,p=void 0===u?function(e,t){var n="string"!=typeof e?"sc":xe(e);zt[n]=(zt[n]||0)+1;var r="".concat(n,"-").concat(Ae("6.1.1"+n+zt[n]));return t?"".concat(t,"-").concat(r):r}(t.displayName,t.parentComponentId):u,d=t.displayName,f=void 0===d?function(e){return Te(e)?"styled.".concat(e):"Styled(".concat(je(e),")")}(e):d,h=t.displayName&&t.componentId?"".concat(xe(t.displayName),"-").concat(t.componentId):t.componentId||p,m=i&&s.attrs?s.attrs.concat(c).filter(Boolean):c,g=t.shouldForwardProp;if(i&&s.shouldForwardProp){var y=s.shouldForwardProp;if(t.shouldForwardProp){var v=t.shouldForwardProp;g=function(e,t){return y(e,t)&&v(e,t)}}else g=y}var b=new $t(n,h,i?s.componentStyle:void 0);function x(e,t){return function(e,t,n){var i=e.attrs,s=e.componentStyle,a=e.defaultProps,l=e.foldedComponentIds,c=e.styledComponentId,u=e.target,p=o.useContext(Mt),d=_t(),f=e.shouldForwardProp||d.shouldForwardProp,h=function(e,t,n){for(var i,o=r(r({},t),{className:void 0,theme:n}),s=0;s<e.length;s+=1){var a=Ve(i=e[s])?i(o):i;for(var l in a)o[l]="className"===l?He(o[l],a[l]):"style"===l?r(r({},o[l]),a[l]):a[l]}return t.className&&(o.className=He(o.className,t.className)),o}(i,t,ge(t,p,a)||me),m=h.as||u,g={};for(var y in h)void 0===h[y]||"$"===y[0]||"as"===y||"theme"===y||("forwardedAs"===y?g.as=h.forwardedAs:f&&!f(y,m)||(g[y]=h[y]));var v=function(e,t){var n=_t();return e.generateAndInjectStyles(t,n.styleSheet,n.stylis)}(s,h),b=He(l,c);return v&&(b+=" "+v),h.className&&(b+=" "+h.className),g[Te(m)&&!ye.has(m)?"class":"className"]=b,g.ref=n,(0,o.createElement)(m,g)}(w,e,t)}x.displayName=f;var w=o.forwardRef(x);return w.attrs=m,w.componentStyle=b,w.displayName=f,w.shouldForwardProp=g,w.foldedComponentIds=i?He(s.foldedComponentIds,s.styledComponentId):"",w.styledComponentId=h,w.target=i?s.target:e,Object.defineProperty(w,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=i?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,i=t;r<i.length;r++)Xe(e,i[r],!0);return e}({},s.defaultProps,e):e}}),Ke(w,(function(){return".".concat(w.styledComponentId)})),a&&We(w,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),w}function qt(e,t){for(var n=[e[0]],r=0,i=t.length;r<i;r+=1)n.push(t[r],e[r+1]);return n}var Wt=function(e){return Object.assign(e,{isCss:!0})};function Vt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(Ve(e)||Ge(e))return Wt(Rt(qt(he,i([e],t,!0))));var r=e;return 0===t.length&&1===r.length&&"string"==typeof r[0]?Rt(r):Wt(Rt(qt(r,t)))}function Qt(e,t,n){if(void 0===n&&(n=me),!t)throw Je(1,t);var o=function(r){for(var o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];return e(t,n,Vt.apply(void 0,i([r],o,!1)))};return o.attrs=function(i){return Qt(e,t,r(r({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},o.withConfig=function(i){return Qt(e,t,r(r({},n),i))},o}var Ht=function(e){return Qt(Ut,e)},Yt=Ht;ye.forEach((function(e){Yt[e]=Ht(e)}));var Gt=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=Nt(e),gt.registerId(this.componentId+1)}return e.prototype.createStyles=function(e,t,n,r){var i=r(Ye(Rt(this.rules,t,n,r)),""),o=this.componentId+e;n.insertRules(o,o,i)},e.prototype.removeStyles=function(e,t){t.clearRules(this.componentId+e)},e.prototype.renderStyles=function(e,t,n,r){e>2&>.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)},e}();function Xt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var s=Vt.apply(void 0,i([e],t,!1)),a="sc-global-".concat(Ae(JSON.stringify(s))),l=new Gt(s,a),c=function(e){var t=_t(),n=o.useContext(Mt),r=o.useRef(t.styleSheet.allocateGSInstance(a)).current;return t.styleSheet.server&&u(r,e,t.styleSheet,n,t.stylis),o.useLayoutEffect((function(){if(!t.styleSheet.server)return u(r,e,t.styleSheet,n,t.stylis),function(){return l.removeStyles(r,t.styleSheet)}}),[r,e,t.styleSheet,n,t.stylis]),null};function u(e,t,n,i,o){if(l.isStatic)l.renderStyles(e,fe,n,o);else{var s=r(r({},t),{theme:ge(t,i,c.defaultProps)});l.renderStyles(e,s,n,o)}}return o.memo(c)}function Kt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Ye(Vt.apply(void 0,i([e],t,!1))),o=Ae(r);return new jt(o,r)}function Jt(e){var t=o.forwardRef((function(t,n){var i=ge(t,o.useContext(Mt),e.defaultProps);return o.createElement(e,r({},t,{theme:i,ref:n}))}));return t.displayName="WithTheme(".concat(je(e),")"),We(t,e)}var Zt=function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString(),n=ct(),r=Ye([n&&'nonce="'.concat(n,'"'),"".concat(ce,'="true"'),"".concat("data-styled-version",'="').concat("6.1.1",'"')].filter(Boolean)," ");return"<style ".concat(r,">").concat(t,"</style>")},this.getStyleTags=function(){if(e.sealed)throw Je(2);return e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)throw Je(2);var n=((t={})[ce]="",t["data-styled-version"]="6.1.1",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),i=ct();return i&&(n.nonce=i),[o.createElement("style",r({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new gt({isServer:!0}),this.sealed=!1}return e.prototype.collectStyles=function(e){if(this.sealed)throw Je(2);return o.createElement(At,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){throw Je(3)},e}(),en={StyleSheet:gt,mainSheet:wt};"__sc-".concat(ce,"__")},3578:function(e){e.exports=function(){function e(){}return e.prototype.encodeReserved=function(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map((function(e){return/%[0-9A-Fa-f]/.test(e)||(e=encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]")),e})).join("")},e.prototype.encodeUnreserved=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))},e.prototype.encodeValue=function(e,t,n){return t="+"===e||"#"===e?this.encodeReserved(t):this.encodeUnreserved(t),n?this.encodeUnreserved(n)+"="+t:t},e.prototype.isDefined=function(e){return null!=e},e.prototype.isKeyOperator=function(e){return";"===e||"&"===e||"?"===e},e.prototype.getValues=function(e,t,n,r){var i=e[n],o=[];if(this.isDefined(i)&&""!==i)if("string"==typeof i||"number"==typeof i||"boolean"==typeof i)i=i.toString(),r&&"*"!==r&&(i=i.substring(0,parseInt(r,10))),o.push(this.encodeValue(t,i,this.isKeyOperator(t)?n:null));else if("*"===r)Array.isArray(i)?i.filter(this.isDefined).forEach((function(e){o.push(this.encodeValue(t,e,this.isKeyOperator(t)?n:null))}),this):Object.keys(i).forEach((function(e){this.isDefined(i[e])&&o.push(this.encodeValue(t,i[e],e))}),this);else{var s=[];Array.isArray(i)?i.filter(this.isDefined).forEach((function(e){s.push(this.encodeValue(t,e))}),this):Object.keys(i).forEach((function(e){this.isDefined(i[e])&&(s.push(this.encodeUnreserved(e)),s.push(this.encodeValue(t,i[e].toString())))}),this),this.isKeyOperator(t)?o.push(this.encodeUnreserved(n)+"="+s.join(",")):0!==s.length&&o.push(s.join(","))}else";"===t?this.isDefined(i)&&o.push(this.encodeUnreserved(n)):""!==i||"&"!==t&&"?"!==t?""===i&&o.push(""):o.push(this.encodeUnreserved(n)+"=");return o},e.prototype.parse=function(e){var t=this,n=["+","#",".","/",";","?","&"];return{expand:function(r){return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,(function(e,i,o){if(i){var s=null,a=[];if(-1!==n.indexOf(i.charAt(0))&&(s=i.charAt(0),i=i.substr(1)),i.split(/,/g).forEach((function(e){var n=/([^:\*]*)(?::(\d+)|(\*))?/.exec(e);a.push.apply(a,t.getValues(r,s,n[1],n[2]||n[3]))})),s&&"+"!==s){var l=",";return"?"===s?l="&":"#"!==s&&(l=s),(0!==a.length?s:"")+a.join(l)}return a.join(",")}return t.encodeReserved(o)}))}}},new e}()},5006:(e,t,n)=>{e.exports=n(6128).YAML},6128:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function d(e,t,n){return d=p()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&u(i,n.prototype),i},d.apply(null,arguments)}function f(e){var t="function"==typeof Map?new Map:void 0;return f=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return d(e,arguments,c(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),u(r,e)},f(e)}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?h(e):t}function g(e){var t=p();return function(){var n,r=c(e);if(t){var i=c(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return m(this,n)}}function y(e,t,n){return y="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=c(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}},y(e,t,n||e)}function v(e,t){return x(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(l){i=!0,o=l}finally{try{r||null==a.return||a.return()}finally{if(i)throw o}}return n}(e,t)||w(e,t)||O()}function b(e){return x(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||w(e)||O()}function x(e){if(Array.isArray(e))return e}function w(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function O(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function S(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=w(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}n.d(t,{YAML:()=>nn});var E={ANCHOR:"&",COMMENT:"#",TAG:"!",DIRECTIVES_END:"-",DOCUMENT_END:"."},_={ALIAS:"ALIAS",BLANK_LINE:"BLANK_LINE",BLOCK_FOLDED:"BLOCK_FOLDED",BLOCK_LITERAL:"BLOCK_LITERAL",COMMENT:"COMMENT",DIRECTIVE:"DIRECTIVE",DOCUMENT:"DOCUMENT",FLOW_MAP:"FLOW_MAP",FLOW_SEQ:"FLOW_SEQ",MAP:"MAP",MAP_KEY:"MAP_KEY",MAP_VALUE:"MAP_VALUE",PLAIN:"PLAIN",QUOTE_DOUBLE:"QUOTE_DOUBLE",QUOTE_SINGLE:"QUOTE_SINGLE",SEQ:"SEQ",SEQ_ITEM:"SEQ_ITEM"},A="tag:yaml.org,2002:",j={MAP:"tag:yaml.org,2002:map",SEQ:"tag:yaml.org,2002:seq",STR:"tag:yaml.org,2002:str"};function T(e){for(var t=[0],n=e.indexOf("\n");-1!==n;)n+=1,t.push(n),n=e.indexOf("\n",n);return t}function P(e){var t,n;return"string"==typeof e?(t=T(e),n=e):(Array.isArray(e)&&(e=e[0]),e&&e.context&&(e.lineStarts||(e.lineStarts=T(e.context.src)),t=e.lineStarts,n=e.context.src)),{lineStarts:t,src:n}}function I(e,t){if("number"!=typeof e||e<0)return null;var n=P(t),r=n.lineStarts,i=n.src;if(!r||!i||e>i.length)return null;for(var o=0;o<r.length;++o){var s=r[o];if(e<s)return{line:o,col:e-r[o-1]+1};if(e===s)return{line:o+1,col:1}}var a=r.length;return{line:a,col:e-r[a-1]+1}}function C(e,t){var n=e.start,r=e.end,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:80,o=function(e,t){var n=P(t),r=n.lineStarts,i=n.src;if(!r||!(e>=1)||e>r.length)return null;for(var o=r[e-1],s=r[e];s&&s>o&&"\n"===i[s-1];)--s;return i.slice(o,s)}(n.line,t);if(!o)return null;var s=n.col;if(o.length>i)if(s<=i-10)o=o.substr(0,i-1)+"\u2026";else{var a=Math.round(i/2);o.length>s+a&&(o=o.substr(0,s+a-1)+"\u2026"),s-=o.length-i,o="\u2026"+o.substr(1-i)}var l=1,c="";r&&(r.line===n.line&&s+(r.col-n.col)<=i+1?l=r.col-n.col:(l=Math.min(o.length+1,i)-s,c="\u2026"));var u=s>1?" ".repeat(s-1):"",p="^".repeat(l);return"".concat(o,"\n").concat(u).concat(p).concat(c)}var R=function(){function e(t,n){i(this,e),this.start=t,this.end=n||t}return s(e,[{key:"isEmpty",value:function(){return"number"!=typeof this.start||!this.end||this.end<=this.start}},{key:"setOrigRange",value:function(e,t){var n=this.start,r=this.end;if(0===e.length||r<=e[0])return this.origStart=n,this.origEnd=r,t;for(var i=t;i<e.length&&!(e[i]>n);)++i;this.origStart=n+i;for(var o=i;i<e.length&&!(e[i]>=r);)++i;return this.origEnd=r+i,o}}],[{key:"copy",value:function(t){return new e(t.start,t.end)}}]),e}(),N=function(){function e(t,n,r){i(this,e),Object.defineProperty(this,"context",{value:r||null,writable:!0}),this.error=null,this.range=null,this.valueRange=null,this.props=n||[],this.type=t,this.value=null}return s(e,[{key:"getPropValue",value:function(e,t,n){if(!this.context)return null;var r=this.context.src,i=this.props[e];return i&&r[i.start]===t?r.slice(i.start+(n?1:0),i.end):null}},{key:"anchor",get:function(){for(var e=0;e<this.props.length;++e){var t=this.getPropValue(e,E.ANCHOR,!0);if(null!=t)return t}return null}},{key:"comment",get:function(){for(var e=[],t=0;t<this.props.length;++t){var n=this.getPropValue(t,E.COMMENT,!0);null!=n&&e.push(n)}return e.length>0?e.join("\n"):null}},{key:"commentHasRequiredWhitespace",value:function(t){var n=this.context.src;if(this.header&&t===this.header.end)return!1;if(!this.valueRange)return!1;var r=this.valueRange.end;return t!==r||e.atBlank(n,r-1)}},{key:"hasComment",get:function(){if(this.context)for(var e=this.context.src,t=0;t<this.props.length;++t)if(e[this.props[t].start]===E.COMMENT)return!0;return!1}},{key:"hasProps",get:function(){if(this.context)for(var e=this.context.src,t=0;t<this.props.length;++t)if(e[this.props[t].start]!==E.COMMENT)return!0;return!1}},{key:"includesTrailingLines",get:function(){return!1}},{key:"jsonLike",get:function(){return-1!==[_.FLOW_MAP,_.FLOW_SEQ,_.QUOTE_DOUBLE,_.QUOTE_SINGLE].indexOf(this.type)}},{key:"rangeAsLinePos",get:function(){if(this.range&&this.context){var e=I(this.range.start,this.context.root);if(e)return{start:e,end:I(this.range.end,this.context.root)}}}},{key:"rawValue",get:function(){if(!this.valueRange||!this.context)return null;var e=this.valueRange,t=e.start,n=e.end;return this.context.src.slice(t,n)}},{key:"tag",get:function(){for(var e=0;e<this.props.length;++e){var t=this.getPropValue(e,E.TAG,!1);if(null!=t){if("<"===t[1])return{verbatim:t.slice(2,-1)};var n=v(t.match(/^(.*!)([^!]*)$/),3);return n[0],{handle:n[1],suffix:n[2]}}}return null}},{key:"valueRangeContainsNewline",get:function(){if(!this.valueRange||!this.context)return!1;for(var e=this.valueRange,t=e.start,n=e.end,r=this.context.src,i=t;i<n;++i)if("\n"===r[i])return!0;return!1}},{key:"parseComment",value:function(t){var n=this.context.src;if(n[t]===E.COMMENT){var r=e.endOfLine(n,t+1),i=new R(t,r);return this.props.push(i),r}return t}},{key:"setOrigRanges",value:function(e,t){return this.range&&(t=this.range.setOrigRange(e,t)),this.valueRange&&this.valueRange.setOrigRange(e,t),this.props.forEach((function(n){return n.setOrigRange(e,t)})),t}},{key:"toString",value:function(){var t=this.context.src,n=this.range,r=this.value;if(null!=r)return r;var i=t.slice(n.start,n.end);return e.addStringTerminator(t,n.end,i)}}],[{key:"addStringTerminator",value:function(t,n,r){if("\n"===r[r.length-1])return r;var i=e.endOfWhiteSpace(t,n);return i>=t.length||"\n"===t[i]?r+"\n":r}},{key:"atDocumentBoundary",value:function(e,t,n){var r=e[t];if(!r)return!0;var i=e[t-1];if(i&&"\n"!==i)return!1;if(n){if(r!==n)return!1}else if(r!==E.DIRECTIVES_END&&r!==E.DOCUMENT_END)return!1;var o=e[t+1],s=e[t+2];if(o!==r||s!==r)return!1;var a=e[t+3];return!a||"\n"===a||"\t"===a||" "===a}},{key:"endOfIdentifier",value:function(e,t){for(var n=e[t],r="<"===n,i=r?["\n","\t"," ",">"]:["\n","\t"," ","[","]","{","}",","];n&&-1===i.indexOf(n);)n=e[t+=1];return r&&">"===n&&(t+=1),t}},{key:"endOfIndent",value:function(e,t){for(var n=e[t];" "===n;)n=e[t+=1];return t}},{key:"endOfLine",value:function(e,t){for(var n=e[t];n&&"\n"!==n;)n=e[t+=1];return t}},{key:"endOfWhiteSpace",value:function(e,t){for(var n=e[t];"\t"===n||" "===n;)n=e[t+=1];return t}},{key:"startOfLine",value:function(e,t){var n=e[t-1];if("\n"===n)return t;for(;n&&"\n"!==n;)n=e[t-=1];return t+1}},{key:"endOfBlockIndent",value:function(t,n,r){var i=e.endOfIndent(t,r);if(i>r+n)return i;var o=e.endOfWhiteSpace(t,i),s=t[o];return s&&"\n"!==s?null:o}},{key:"atBlank",value:function(e,t,n){var r=e[t];return"\n"===r||"\t"===r||" "===r||n&&!r}},{key:"nextNodeIsIndented",value:function(e,t,n){return!(!e||t<0)&&(t>0||n&&"-"===e)}},{key:"normalizeOffset",value:function(t,n){var r=t[n];return r?"\n"!==r&&"\n"===t[n-1]?n-1:e.endOfWhiteSpace(t,n):n}},{key:"foldNewline",value:function(t,n,r){for(var i=0,o=!1,s="",a=t[n+1];" "===a||"\t"===a||"\n"===a;){switch(a){case"\n":i=0,n+=1,s+="\n";break;case"\t":i<=r&&(o=!0),n=e.endOfWhiteSpace(t,n+2)-1;break;case" ":i+=1,n+=1}a=t[n+1]}return s||(s=" "),a&&i<=r&&(o=!0),{fold:s,offset:n,error:o}}}]),e}(),L=function(e){l(n,e);var t=g(n);function n(e,r,o){var s;if(i(this,n),!(o&&r instanceof N))throw new Error("Invalid arguments for new ".concat(e));return(s=t.call(this)).name=e,s.message=o,s.source=r,s}return s(n,[{key:"makePretty",value:function(){if(this.source){this.nodeType=this.source.type;var e=this.source.context&&this.source.context.root;if("number"==typeof this.offset){this.range=new R(this.offset,this.offset+1);var t=e&&I(this.offset,e);if(t){var n={line:t.line,col:t.col+1};this.linePos={start:t,end:n}}delete this.offset}else this.range=this.source.range,this.linePos=this.source.rangeAsLinePos;if(this.linePos){var r=this.linePos.start,i=r.line,o=r.col;this.message+=" at line ".concat(i,", column ").concat(o);var s=e&&C(this.linePos,e);s&&(this.message+=":\n\n".concat(s,"\n"))}delete this.source}}}]),n}(f(Error)),$=function(e){l(n,e);var t=g(n);function n(e,r){return i(this,n),t.call(this,"YAMLReferenceError",e,r)}return n}(L),M=function(e){l(n,e);var t=g(n);function n(e,r){return i(this,n),t.call(this,"YAMLSemanticError",e,r)}return n}(L),D=function(e){l(n,e);var t=g(n);function n(e,r){return i(this,n),t.call(this,"YAMLSyntaxError",e,r)}return n}(L),F=function(e){l(n,e);var t=g(n);function n(e,r){return i(this,n),t.call(this,"YAMLWarning",e,r)}return n}(L),B=function(e){l(n,e);var t=g(n);function n(){return i(this,n),t.apply(this,arguments)}return s(n,[{key:"strValue",get:function(){if(!this.valueRange||!this.context)return null;for(var e=this.valueRange,t=e.start,n=e.end,r=this.context.src,i=r[n-1];t<n&&("\n"===i||"\t"===i||" "===i);)i=r[--n-1];for(var o="",s=t;s<n;++s){var a=r[s];if("\n"===a){var l=N.foldNewline(r,s,-1);o+=l.fold,s=l.offset}else if(" "===a||"\t"===a){for(var c=s,u=r[s+1];s<n&&(" "===u||"\t"===u);)u=r[(s+=1)+1];"\n"!==u&&(o+=s>c?r.slice(c,s+1):a)}else o+=a}var p=r[t];switch(p){case"\t":return{errors:[new M(this,"Plain value cannot start with a tab character")],str:o};case"@":case"`":var d="Plain value cannot start with reserved character ".concat(p);return{errors:[new M(this,d)],str:o};default:return o}}},{key:"parseBlockValue",value:function(e){for(var t=this.context,r=t.indent,i=t.inFlow,o=t.src,s=e,a=e,l=o[s];"\n"===l&&!N.atDocumentBoundary(o,s+1);l=o[s]){var c=N.endOfBlockIndent(o,r,s+1);if(null===c||"#"===o[c])break;s="\n"===o[c]?c:a=n.endOfLine(o,c,i)}return this.valueRange.isEmpty()&&(this.valueRange.start=e),this.valueRange.end=a,a}},{key:"parse",value:function(e,t){this.context=e;var r=e.inFlow,i=e.src,o=t,s=i[o];return s&&"#"!==s&&"\n"!==s&&(o=n.endOfLine(i,t,r)),this.valueRange=new R(t,o),o=N.endOfWhiteSpace(i,o),o=this.parseComment(o),this.hasComment&&!this.valueRange.isEmpty()||(o=this.parseBlockValue(o)),o}}],[{key:"endOfLine",value:function(e,t,n){for(var r=e[t],i=t;r&&"\n"!==r&&(!n||"["!==r&&"]"!==r&&"{"!==r&&"}"!==r&&","!==r);){var o=e[i+1];if(":"===r&&(!o||"\n"===o||"\t"===o||" "===o||n&&","===o))break;if((" "===r||"\t"===r)&&"#"===o)break;i+=1,r=o}return i}}]),n}(N),z=function(e){l(n,e);var t=g(n);function n(){return i(this,n),t.call(this,_.BLANK_LINE)}return s(n,[{key:"includesTrailingLines",get:function(){return!0}},{key:"parse",value:function(e,t){return this.context=e,this.range=new R(t,t+1),t+1}}]),n}(N),U=function(e){l(n,e);var t=g(n);function n(e,r){var o;return i(this,n),(o=t.call(this,e,r)).node=null,o}return s(n,[{key:"includesTrailingLines",get:function(){return!!this.node&&this.node.includesTrailingLines}},{key:"parse",value:function(e,t){this.context=e;var n=e.parseNode,r=e.src,i=e.atLineStart,o=e.lineStart;i||this.type!==_.SEQ_ITEM||(this.error=new M(this,"Sequence items must not have preceding content on the same line"));for(var s=i?t-o:e.indent,a=N.endOfWhiteSpace(r,t+1),l=r[a],c="#"===l,u=[],p=null;"\n"===l||"#"===l;){if("#"===l){var d=N.endOfLine(r,a+1);u.push(new R(a,d)),a=d}else{i=!0,o=a+1,"\n"===r[N.endOfWhiteSpace(r,o)]&&0===u.length&&(o=(p=new z).parse({src:r},o)),a=N.endOfIndent(r,o)}l=r[a]}if(N.nextNodeIsIndented(l,a-(o+s),this.type!==_.SEQ_ITEM)?this.node=n({atLineStart:i,inCollection:!1,indent:s,lineStart:o,parent:this},a):l&&o>t+1&&(a=o-1),this.node){if(p){var f=e.parent.items||e.parent.contents;f&&f.push(p)}u.length&&Array.prototype.push.apply(this.props,u),a=this.node.range.end}else if(c){var h=u[0];this.props.push(h),a=h.end}else a=N.endOfLine(r,t+1);var m=this.node?this.node.valueRange.end:a;return this.valueRange=new R(t,m),a}},{key:"setOrigRanges",value:function(e,t){return t=y(c(n.prototype),"setOrigRanges",this).call(this,e,t),this.node?this.node.setOrigRanges(e,t):t}},{key:"toString",value:function(){var e=this.context.src,t=this.node,n=this.range,r=this.value;if(null!=r)return r;var i=t?e.slice(n.start,t.range.start)+String(t):e.slice(n.start,n.end);return N.addStringTerminator(e,n.end,i)}}]),n}(N),q=function(e){l(n,e);var t=g(n);function n(){return i(this,n),t.call(this,_.COMMENT)}return s(n,[{key:"parse",value:function(e,t){this.context=e;var n=this.parseComment(t);return this.range=new R(t,n),n}}]),n}(N);function W(e){for(var t=e;t instanceof U;)t=t.node;if(!(t instanceof V))return null;for(var n=t.items.length,r=-1,i=n-1;i>=0;--i){var o=t.items[i];if(o.type===_.COMMENT){var s=o.context,a=s.indent,l=s.lineStart;if(a>0&&o.range.start>=l+a)break;r=i}else{if(o.type!==_.BLANK_LINE)break;r=i}}if(-1===r)return null;for(var c=t.items.splice(r,n-r),u=c[0].range.start;t.range.end=u,t.valueRange&&t.valueRange.end>u&&(t.valueRange.end=u),t!==e;)t=t.context.parent;return c}var V=function(e){l(n,e);var t=g(n);function n(e){var r;i(this,n),r=t.call(this,e.type===_.SEQ_ITEM?_.SEQ:_.MAP);for(var o=e.props.length-1;o>=0;--o)if(e.props[o].start<e.context.lineStart){r.props=e.props.slice(0,o+1),e.props=e.props.slice(o+1);var s=e.props[0]||e.valueRange;e.range.start=s.start;break}r.items=[e];var a=W(e);return a&&Array.prototype.push.apply(r.items,a),r}return s(n,[{key:"includesTrailingLines",get:function(){return this.items.length>0}},{key:"parse",value:function(e,t){this.context=e;var r=e.parseNode,i=e.src,o=N.startOfLine(i,t),s=this.items[0];s.context.parent=this,this.valueRange=R.copy(s.valueRange);for(var a=s.range.start-s.context.lineStart,l=t,c=i[l=N.normalizeOffset(i,l)],u=N.endOfWhiteSpace(i,o)===l,p=!1;c;){for(;"\n"===c||"#"===c;){if(u&&"\n"===c&&!p){var d=new z;if(l=d.parse({src:i},l),this.valueRange.end=l,l>=i.length){c=null;break}this.items.push(d),l-=1}else if("#"===c){if(l<o+a&&!n.nextContentHasIndent(i,l,a))return l;var f=new q;if(l=f.parse({indent:a,lineStart:o,src:i},l),this.items.push(f),this.valueRange.end=l,l>=i.length){c=null;break}}if(o=l+1,l=N.endOfIndent(i,o),N.atBlank(i,l)){var h=N.endOfWhiteSpace(i,l),m=i[h];m&&"\n"!==m&&"#"!==m||(l=h)}c=i[l],u=!0}if(!c)break;if(l!==o+a&&(u||":"!==c)){if(l<o+a){o>t&&(l=o);break}if(!this.error){this.error=new D(this,"All collection items must start at the same column")}}if(s.type===_.SEQ_ITEM){if("-"!==c){o>t&&(l=o);break}}else if("-"===c&&!this.error){var g=i[l+1];if(!g||"\n"===g||"\t"===g||" "===g){this.error=new D(this,"A collection cannot be both a mapping and a sequence")}}var y=r({atLineStart:u,inCollection:!0,indent:a,lineStart:o,parent:this},l);if(!y)return l;if(this.items.push(y),this.valueRange.end=y.valueRange.end,c=i[l=N.normalizeOffset(i,y.range.end)],u=!1,p=y.includesTrailingLines,c){for(var v=l-1,b=i[v];" "===b||"\t"===b;)b=i[--v];"\n"===b&&(o=v+1,u=!0)}var x=W(y);x&&Array.prototype.push.apply(this.items,x)}return l}},{key:"setOrigRanges",value:function(e,t){return t=y(c(n.prototype),"setOrigRanges",this).call(this,e,t),this.items.forEach((function(n){t=n.setOrigRanges(e,t)})),t}},{key:"toString",value:function(){var e=this.context.src,t=this.items,n=this.range,r=this.value;if(null!=r)return r;for(var i=e.slice(n.start,t[0].range.start)+String(t[0]),o=1;o<t.length;++o){var s=t[o],a=s.context,l=a.atLineStart,c=a.indent;if(l)for(var u=0;u<c;++u)i+=" ";i+=String(s)}return N.addStringTerminator(e,n.end,i)}}],[{key:"nextContentHasIndent",value:function(e,t,r){var i=N.endOfLine(e,t)+1,o=e[t=N.endOfWhiteSpace(e,i)];return!!o&&(t>=i+r||("#"===o||"\n"===o)&&n.nextContentHasIndent(e,t,r))}}]),n}(N),Q=function(e){l(n,e);var t=g(n);function n(){var e;return i(this,n),(e=t.call(this,_.DIRECTIVE)).name=null,e}return s(n,[{key:"parameters",get:function(){var e=this.rawValue;return e?e.trim().split(/[ \t]+/):[]}},{key:"parseName",value:function(e){for(var t=this.context.src,n=e,r=t[n];r&&"\n"!==r&&"\t"!==r&&" "!==r;)r=t[n+=1];return this.name=t.slice(e,n),n}},{key:"parseParameters",value:function(e){for(var t=this.context.src,n=e,r=t[n];r&&"\n"!==r&&"#"!==r;)r=t[n+=1];return this.valueRange=new R(e,n),n}},{key:"parse",value:function(e,t){this.context=e;var n=this.parseName(t+1);return n=this.parseParameters(n),n=this.parseComment(n),this.range=new R(t,n),n}}]),n}(N),H=function(e){l(n,e);var t=g(n);function n(){var e;return i(this,n),(e=t.call(this,_.DOCUMENT)).directives=null,e.contents=null,e.directivesEndMarker=null,e.documentEndMarker=null,e}return s(n,[{key:"parseDirectives",value:function(e){var t=this.context.src;this.directives=[];for(var r=!0,i=!1,o=e;!N.atDocumentBoundary(t,o,E.DIRECTIVES_END);)switch(t[o=n.startCommentOrEndBlankLine(t,o)]){case"\n":if(r){var s=new z;(o=s.parse({src:t},o))<t.length&&this.directives.push(s)}else o+=1,r=!0;break;case"#":var a=new q;o=a.parse({src:t},o),this.directives.push(a),r=!1;break;case"%":var l=new Q;o=l.parse({parent:this,src:t},o),this.directives.push(l),i=!0,r=!1;break;default:return i?this.error=new M(this,"Missing directives-end indicator line"):this.directives.length>0&&(this.contents=this.directives,this.directives=[]),o}return t[o]?(this.directivesEndMarker=new R(o,o+3),o+3):(i?this.error=new M(this,"Missing directives-end indicator line"):this.directives.length>0&&(this.contents=this.directives,this.directives=[]),o)}},{key:"parseContents",value:function(e){var t=this.context,r=t.parseNode,i=t.src;this.contents||(this.contents=[]);for(var o=e;"-"===i[o-1];)o-=1;var s=N.endOfWhiteSpace(i,e),a=o===e;for(this.valueRange=new R(s);!N.atDocumentBoundary(i,s,E.DOCUMENT_END);){switch(i[s]){case"\n":if(a){var l=new z;(s=l.parse({src:i},s))<i.length&&this.contents.push(l)}else s+=1,a=!0;o=s;break;case"#":var c=new q;s=c.parse({src:i},s),this.contents.push(c),a=!1;break;default:var u=N.endOfIndent(i,s),p=r({atLineStart:a,indent:-1,inFlow:!1,inCollection:!1,lineStart:o,parent:this},u);if(!p)return this.valueRange.end=u;this.contents.push(p),s=p.range.end,a=!1;var d=W(p);d&&Array.prototype.push.apply(this.contents,d)}s=n.startCommentOrEndBlankLine(i,s)}if(this.valueRange.end=s,i[s]&&(this.documentEndMarker=new R(s,s+3),i[s+=3])){if("#"===i[s=N.endOfWhiteSpace(i,s)]){var f=new q;s=f.parse({src:i},s),this.contents.push(f)}switch(i[s]){case"\n":s+=1;break;case void 0:break;default:this.error=new D(this,"Document end marker line cannot have a non-comment suffix")}}return s}},{key:"parse",value:function(e,t){e.root=this,this.context=e;var n=65279===e.src.charCodeAt(t)?t+1:t;return n=this.parseDirectives(n),n=this.parseContents(n)}},{key:"setOrigRanges",value:function(e,t){return t=y(c(n.prototype),"setOrigRanges",this).call(this,e,t),this.directives.forEach((function(n){t=n.setOrigRanges(e,t)})),this.directivesEndMarker&&(t=this.directivesEndMarker.setOrigRange(e,t)),this.contents.forEach((function(n){t=n.setOrigRanges(e,t)})),this.documentEndMarker&&(t=this.documentEndMarker.setOrigRange(e,t)),t}},{key:"toString",value:function(){var e=this.contents,t=this.directives,n=this.value;if(null!=n)return n;var r=t.join("");return e.length>0&&((t.length>0||e[0].type===_.COMMENT)&&(r+="---\n"),r+=e.join("")),"\n"!==r[r.length-1]&&(r+="\n"),r}}],[{key:"startCommentOrEndBlankLine",value:function(e,t){var n=N.endOfWhiteSpace(e,t),r=e[n];return"#"===r||"\n"===r?n:t}}]),n}(N),Y=function(e){l(n,e);var t=g(n);function n(){return i(this,n),t.apply(this,arguments)}return s(n,[{key:"parse",value:function(e,t){this.context=e;var n=e.src,r=N.endOfIdentifier(n,t+1);return this.valueRange=new R(t+1,r),r=N.endOfWhiteSpace(n,r),r=this.parseComment(r)}}]),n}(N),G="CLIP",X="KEEP",K="STRIP",J=function(e){l(n,e);var t=g(n);function n(e,r){var o;return i(this,n),(o=t.call(this,e,r)).blockIndent=null,o.chomping=G,o.header=null,o}return s(n,[{key:"includesTrailingLines",get:function(){return this.chomping===X}},{key:"strValue",get:function(){if(!this.valueRange||!this.context)return null;var e=this.valueRange,t=e.start,n=e.end,r=this.context,i=r.indent,o=r.src;if(this.valueRange.isEmpty())return"";for(var s=null,a=o[n-1];"\n"===a||"\t"===a||" "===a;){if((n-=1)<=t){if(this.chomping===X)break;return""}"\n"===a&&(s=n),a=o[n-1]}var l=n+1;s&&(this.chomping===X?(l=s,n=this.valueRange.end):n=s);for(var c=i+this.blockIndent,u=this.type===_.BLOCK_FOLDED,p=!0,d="",f="",h=!1,m=t;m<n;++m){for(var g=0;g<c&&" "===o[m];++g)m+=1;var y=o[m];if("\n"===y)"\n"===f?d+="\n":f="\n";else{var v=N.endOfLine(o,m),b=o.slice(m,v);m=v,u&&(" "===y||"\t"===y)&&m<l?(" "===f?f="\n":h||p||"\n"!==f||(f="\n\n"),d+=f+b,f=v<n&&o[v]||"",h=!0):(d+=f+b,f=u&&m<l?" ":"\n",h=!1),p&&""!==b&&(p=!1)}}return this.chomping===K?d:d+"\n"}},{key:"parseBlockHeader",value:function(e){for(var t=this.context.src,n=e+1,r="";;){var i=t[n];switch(i){case"-":this.chomping=K;break;case"+":this.chomping=X;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":r+=i;break;default:return this.blockIndent=Number(r)||null,this.header=new R(e,n),n}n+=1}}},{key:"parseBlockValue",value:function(e){for(var t=this.context,n=t.indent,r=t.src,i=!!this.blockIndent,o=e,s=e,a=1,l=r[o];"\n"===l&&(o+=1,!N.atDocumentBoundary(r,o));l=r[o]){var c=N.endOfBlockIndent(r,n,o);if(null===c)break;var u=r[c],p=c-(o+n);if(this.blockIndent){if(u&&"\n"!==u&&p<this.blockIndent){if("#"===r[c])break;if(!this.error){var d="Block scalars must not be less indented than their ".concat(i?"explicit indentation indicator":"first line");this.error=new M(this,d)}}}else if("\n"!==r[c]){if(p<a){this.error=new M(this,"Block scalars with more-indented leading empty lines must use an explicit indentation indicator")}this.blockIndent=p}else p>a&&(a=p);o="\n"===r[c]?c:s=N.endOfLine(r,c)}return this.chomping!==X&&(o=r[s]?s+1:s),this.valueRange=new R(e+1,o),o}},{key:"parse",value:function(e,t){this.context=e;var n=e.src,r=this.parseBlockHeader(t);return r=N.endOfWhiteSpace(n,r),r=this.parseComment(r),r=this.parseBlockValue(r)}},{key:"setOrigRanges",value:function(e,t){return t=y(c(n.prototype),"setOrigRanges",this).call(this,e,t),this.header?this.header.setOrigRange(e,t):t}}]),n}(N),Z=function(e){l(n,e);var t=g(n);function n(e,r){var o;return i(this,n),(o=t.call(this,e,r)).items=null,o}return s(n,[{key:"prevNodeIsJsonLike",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.items.length,t=this.items[e-1];return!!t&&(t.jsonLike||t.type===_.COMMENT&&this.prevNodeIsJsonLike(e-1))}},{key:"parse",value:function(e,t){this.context=e;var n=e.parseNode,r=e.src,i=e.indent,o=e.lineStart,s=r[t];this.items=[{char:s,offset:t}];var a=N.endOfWhiteSpace(r,t+1);for(s=r[a];s&&"]"!==s&&"}"!==s;){switch(s){case"\n":if(o=a+1,"\n"===r[N.endOfWhiteSpace(r,o)]){var l=new z;o=l.parse({src:r},o),this.items.push(l)}if((a=N.endOfIndent(r,o))<=o+i&&(s=r[a],a<o+i||"]"!==s&&"}"!==s)){this.error=new M(this,"Insufficient indentation in flow collection")}break;case",":this.items.push({char:s,offset:a}),a+=1;break;case"#":var c=new q;a=c.parse({src:r},a),this.items.push(c);break;case"?":case":":var u=r[a+1];if("\n"===u||"\t"===u||" "===u||","===u||":"===s&&this.prevNodeIsJsonLike()){this.items.push({char:s,offset:a}),a+=1;break}default:var p=n({atLineStart:!1,inCollection:!1,inFlow:!0,indent:-1,lineStart:o,parent:this},a);if(!p)return this.valueRange=new R(t,a),a;this.items.push(p),a=N.normalizeOffset(r,p.range.end)}s=r[a=N.endOfWhiteSpace(r,a)]}return this.valueRange=new R(t,a+1),s&&(this.items.push({char:s,offset:a}),a=N.endOfWhiteSpace(r,a+1),a=this.parseComment(a)),a}},{key:"setOrigRanges",value:function(e,t){return t=y(c(n.prototype),"setOrigRanges",this).call(this,e,t),this.items.forEach((function(n){if(n instanceof N)t=n.setOrigRanges(e,t);else if(0===e.length)n.origOffset=n.offset;else{for(var r=t;r<e.length&&!(e[r]>n.offset);)++r;n.origOffset=n.offset+r,t=r}})),t}},{key:"toString",value:function(){var e=this.context.src,t=this.items,n=this.range,r=this.value;if(null!=r)return r;var i=t.filter((function(e){return e instanceof N})),o="",s=n.start;return i.forEach((function(t){var n=e.slice(s,t.range.start);s=t.range.end,"\n"===(o+=n+String(t))[o.length-1]&&"\n"!==e[s-1]&&"\n"===e[s]&&(s+=1)})),o+=e.slice(s,n.end),N.addStringTerminator(e,n.end,o)}}]),n}(N),ee=function(e){l(n,e);var t=g(n);function n(){return i(this,n),t.apply(this,arguments)}return s(n,[{key:"strValue",get:function(){if(!this.valueRange||!this.context)return null;var e=[],t=this.valueRange,n=t.start,r=t.end,i=this.context,o=i.indent,s=i.src;'"'!==s[r-1]&&e.push(new D(this,'Missing closing "quote'));for(var a="",l=n+1;l<r-1;++l){var c=s[l];if("\n"===c){N.atDocumentBoundary(s,l+1)&&e.push(new M(this,"Document boundary indicators are not allowed within string values"));var u=N.foldNewline(s,l,o);a+=u.fold,l=u.offset,u.error&&e.push(new M(this,"Multi-line double-quoted string needs to be sufficiently indented"))}else if("\\"===c)switch(s[l+=1]){case"0":a+="\0";break;case"a":a+="\x07";break;case"b":a+="\b";break;case"e":a+="\x1b";break;case"f":a+="\f";break;case"n":a+="\n";break;case"r":a+="\r";break;case"t":case"\t":a+="\t";break;case"v":a+="\v";break;case"N":a+="\x85";break;case"_":a+="\xa0";break;case"L":a+="\u2028";break;case"P":a+="\u2029";break;case" ":a+=" ";break;case'"':a+='"';break;case"/":a+="/";break;case"\\":a+="\\";break;case"x":a+=this.parseCharCode(l+1,2,e),l+=2;break;case"u":a+=this.parseCharCode(l+1,4,e),l+=4;break;case"U":a+=this.parseCharCode(l+1,8,e),l+=8;break;case"\n":for(;" "===s[l+1]||"\t"===s[l+1];)l+=1;break;default:e.push(new D(this,"Invalid escape sequence ".concat(s.substr(l-1,2)))),a+="\\"+s[l]}else if(" "===c||"\t"===c){for(var p=l,d=s[l+1];" "===d||"\t"===d;)d=s[(l+=1)+1];"\n"!==d&&(a+=l>p?s.slice(p,l+1):c)}else a+=c}return e.length>0?{errors:e,str:a}:a}},{key:"parseCharCode",value:function(e,t,n){var r=this.context.src,i=r.substr(e,t),o=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;return isNaN(o)?(n.push(new D(this,"Invalid escape sequence ".concat(r.substr(e-2,t+2)))),r.substr(e-2,t+2)):String.fromCodePoint(o)}},{key:"parse",value:function(e,t){this.context=e;var r=e.src,i=n.endOfQuote(r,t+1);return this.valueRange=new R(t,i),i=N.endOfWhiteSpace(r,i),i=this.parseComment(i)}}],[{key:"endOfQuote",value:function(e,t){for(var n=e[t];n&&'"'!==n;)n=e[t+="\\"===n?2:1];return t+1}}]),n}(N),te=function(e){l(n,e);var t=g(n);function n(){return i(this,n),t.apply(this,arguments)}return s(n,[{key:"strValue",get:function(){if(!this.valueRange||!this.context)return null;var e=[],t=this.valueRange,n=t.start,r=t.end,i=this.context,o=i.indent,s=i.src;"'"!==s[r-1]&&e.push(new D(this,"Missing closing 'quote"));for(var a="",l=n+1;l<r-1;++l){var c=s[l];if("\n"===c){N.atDocumentBoundary(s,l+1)&&e.push(new M(this,"Document boundary indicators are not allowed within string values"));var u=N.foldNewline(s,l,o);a+=u.fold,l=u.offset,u.error&&e.push(new M(this,"Multi-line single-quoted string needs to be sufficiently indented"))}else if("'"===c)a+=c,"'"!==s[l+=1]&&e.push(new D(this,"Unescaped single quote? This should not happen."));else if(" "===c||"\t"===c){for(var p=l,d=s[l+1];" "===d||"\t"===d;)d=s[(l+=1)+1];"\n"!==d&&(a+=l>p?s.slice(p,l+1):c)}else a+=c}return e.length>0?{errors:e,str:a}:a}},{key:"parse",value:function(e,t){this.context=e;var r=e.src,i=n.endOfQuote(r,t+1);return this.valueRange=new R(t,i),i=N.endOfWhiteSpace(r,i),i=this.parseComment(i)}}],[{key:"endOfQuote",value:function(e,t){for(var n=e[t];n;)if("'"===n){if("'"!==e[t+1])break;n=e[t+=2]}else n=e[t+=1];return t+1}}]),n}(N);var ne=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.atLineStart,s=r.inCollection,l=r.inFlow,c=r.indent,u=r.lineStart,p=r.parent;i(this,e),a(this,"parseNode",(function(n,r){if(N.atDocumentBoundary(t.src,r))return null;var i=new e(t,n),o=i.parseProps(r),s=o.props,a=o.type,l=o.valueStart,c=function(e,t){switch(e){case _.ALIAS:return new Y(e,t);case _.BLOCK_FOLDED:case _.BLOCK_LITERAL:return new J(e,t);case _.FLOW_MAP:case _.FLOW_SEQ:return new Z(e,t);case _.MAP_KEY:case _.MAP_VALUE:case _.SEQ_ITEM:return new U(e,t);case _.COMMENT:case _.PLAIN:return new B(e,t);case _.QUOTE_DOUBLE:return new ee(e,t);case _.QUOTE_SINGLE:return new te(e,t);default:return null}}(a,s),u=c.parse(i,l);if(c.range=new R(r,u),u<=r&&(c.error=new Error("Node#parse consumed no characters"),c.error.parseEnd=u,c.error.source=c,c.range.end=r+1),i.nodeStartsCollection(c)){c.error||i.atLineStart||i.parent.type!==_.DOCUMENT||(c.error=new D(c,"Block collection must not have preceding content here (e.g. directives-end indicator)"));var p=new V(c);return u=p.parse(new e(i),u),p.range=new R(r,u),p}return c})),this.atLineStart=null!=o?o:n.atLineStart||!1,this.inCollection=null!=s?s:n.inCollection||!1,this.inFlow=null!=l?l:n.inFlow||!1,this.indent=null!=c?c:n.indent,this.lineStart=null!=u?u:n.lineStart,this.parent=null!=p?p:n.parent||{},this.root=n.root,this.src=n.src}return s(e,[{key:"nodeStartsCollection",value:function(e){var t=this.inCollection,n=this.inFlow,r=this.src;if(t||n)return!1;if(e instanceof U)return!0;var i=e.range.end;return"\n"!==r[i]&&"\n"!==r[i-1]&&":"===r[i=N.endOfWhiteSpace(r,i)]}},{key:"parseProps",value:function(t){for(var n=this.inFlow,r=this.parent,i=this.src,o=[],s=!1,a=i[t=this.atLineStart?N.endOfIndent(i,t):N.endOfWhiteSpace(i,t)];a===E.ANCHOR||a===E.COMMENT||a===E.TAG||"\n"===a;){if("\n"===a){var l=t,c=void 0;do{c=l+1,l=N.endOfIndent(i,c)}while("\n"===i[l]);var u=l-(c+this.indent),p=r.type===_.SEQ_ITEM&&r.context.atLineStart;if("#"!==i[l]&&!N.nextNodeIsIndented(i[l],u,!p))break;this.atLineStart=!0,this.lineStart=c,s=!1,t=l}else if(a===E.COMMENT){var d=N.endOfLine(i,t+1);o.push(new R(t,d)),t=d}else{var f=N.endOfIdentifier(i,t+1);a===E.TAG&&","===i[f]&&/^[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+,\d\d\d\d(-\d\d){0,2}\/\S/.test(i.slice(t+1,f+13))&&(f=N.endOfIdentifier(i,f+5)),o.push(new R(t,f)),s=!0,t=N.endOfWhiteSpace(i,f)}a=i[t]}return s&&":"===a&&N.atBlank(i,t+1,!0)&&(t-=1),{props:o,type:e.parseType(i,t,n),valueStart:t}}}],[{key:"parseType",value:function(e,t,n){switch(e[t]){case"*":return _.ALIAS;case">":return _.BLOCK_FOLDED;case"|":return _.BLOCK_LITERAL;case"{":return _.FLOW_MAP;case"[":return _.FLOW_SEQ;case"?":return!n&&N.atBlank(e,t+1,!0)?_.MAP_KEY:_.PLAIN;case":":return!n&&N.atBlank(e,t+1,!0)?_.MAP_VALUE:_.PLAIN;case"-":return!n&&N.atBlank(e,t+1,!0)?_.SEQ_ITEM:_.PLAIN;case'"':return _.QUOTE_DOUBLE;case"'":return _.QUOTE_SINGLE;default:return _.PLAIN}}}]),e}();function re(e){var t=[];-1!==e.indexOf("\r")&&(e=e.replace(/\r\n?/g,(function(e,n){return e.length>1&&t.push(n),"\n"})));var n=[],r=0;do{var i=new H,o=new ne({src:e});r=i.parse(o,r),n.push(i)}while(r<e.length);return n.setOrigRanges=function(){if(0===t.length)return!1;for(var e=1;e<t.length;++e)t[e]-=e;for(var r=0,i=0;i<n.length;++i)r=n[i].setOrigRanges(t,r);return t.splice(0,t.length),!0},n.toString=function(){return n.join("...\n")},n}function ie(e,t,n){return n?-1===n.indexOf("\n")?"".concat(e," #").concat(n):"".concat(e,"\n")+n.replace(/^/gm,"".concat(t||"","#")):e}var oe=function e(){i(this,e)};function se(e,t,n){if(Array.isArray(e))return e.map((function(e,t){return se(e,String(t),n)}));if(e&&"function"==typeof e.toJSON){var r=n&&n.anchors&&n.anchors.get(e);r&&(n.onCreate=function(e){r.res=e,delete n.onCreate});var i=e.toJSON(t,n);return r&&n.onCreate&&n.onCreate(i),i}return n&&n.keep||"bigint"!=typeof e?e:Number(e)}var ae=function(e){l(n,e);var t=g(n);function n(e){var r;return i(this,n),(r=t.call(this)).value=e,r}return s(n,[{key:"toJSON",value:function(e,t){return t&&t.keep?this.value:se(this.value,e,t)}},{key:"toString",value:function(){return String(this.value)}}]),n}(oe);function le(e,t,n){for(var r=n,i=t.length-1;i>=0;--i){var o=t[i];if(Number.isInteger(o)&&o>=0){var s=[];s[o]=r,r=s}else{var a={};Object.defineProperty(a,o,{value:r,writable:!0,enumerable:!0,configurable:!0}),r=a}}return e.createNode(r,!1)}var ce=function(e){return null==e||"object"===r(e)&&e[Symbol.iterator]().next().done},ue=function(e){l(n,e);var t=g(n);function n(e){var r;return i(this,n),a(h(r=t.call(this)),"items",[]),r.schema=e,r}return s(n,[{key:"addIn",value:function(e,t){if(ce(e))this.add(t);else{var r=b(e),i=r[0],o=r.slice(1),s=this.get(i,!0);if(s instanceof n)s.addIn(o,t);else{if(void 0!==s||!this.schema)throw new Error("Expected YAML collection at ".concat(i,". Remaining path: ").concat(o));this.set(i,le(this.schema,o,t))}}}},{key:"deleteIn",value:function(e){var t=b(e),r=t[0],i=t.slice(1);if(0===i.length)return this.delete(r);var o=this.get(r,!0);if(o instanceof n)return o.deleteIn(i);throw new Error("Expected YAML collection at ".concat(r,". Remaining path: ").concat(i))}},{key:"getIn",value:function(e,t){var r=b(e),i=r[0],o=r.slice(1),s=this.get(i,!0);return 0===o.length?!t&&s instanceof ae?s.value:s:s instanceof n?s.getIn(o,t):void 0}},{key:"hasAllNullValues",value:function(){return this.items.every((function(e){if(!e||"PAIR"!==e.type)return!1;var t=e.value;return null==t||t instanceof ae&&null==t.value&&!t.commentBefore&&!t.comment&&!t.tag}))}},{key:"hasIn",value:function(e){var t=b(e),r=t[0],i=t.slice(1);if(0===i.length)return this.has(r);var o=this.get(r,!0);return o instanceof n&&o.hasIn(i)}},{key:"setIn",value:function(e,t){var r=b(e),i=r[0],o=r.slice(1);if(0===o.length)this.set(i,t);else{var s=this.get(i,!0);if(s instanceof n)s.setIn(o,t);else{if(void 0!==s||!this.schema)throw new Error("Expected YAML collection at ".concat(i,". Remaining path: ").concat(o));this.set(i,le(this.schema,o,t))}}}},{key:"toJSON",value:function(){return null}},{key:"toString",value:function(e,t,r,i){var o=this,s=t.blockItem,a=t.flowChars,l=t.isMap,c=t.itemIndent,u=e,p=u.indent,d=u.indentStep,f=u.stringify,h=this.type===_.FLOW_MAP||this.type===_.FLOW_SEQ||e.inFlow;h&&(c+=d);var m=l&&this.hasAllNullValues();e=Object.assign({},e,{allNullValues:m,indent:c,inFlow:h,type:null});var g,y=!1,v=!1,b=this.items.reduce((function(t,n,r){var i;n&&(!y&&n.spaceBefore&&t.push({type:"comment",str:""}),n.commentBefore&&n.commentBefore.match(/^.*$/gm).forEach((function(e){t.push({type:"comment",str:"#".concat(e)})})),n.comment&&(i=n.comment),h&&(!y&&n.spaceBefore||n.commentBefore||n.comment||n.key&&(n.key.commentBefore||n.key.comment)||n.value&&(n.value.commentBefore||n.value.comment))&&(v=!0)),y=!1;var s=f(n,e,(function(){return i=null}),(function(){return y=!0}));return h&&!v&&s.includes("\n")&&(v=!0),h&&r<o.items.length-1&&(s+=","),s=ie(s,c,i),y&&(i||h)&&(y=!1),t.push({type:"item",str:s}),t}),[]);if(0===b.length)g=a.start+a.end;else if(h){var x=a.start,w=a.end,k=b.map((function(e){return e.str}));if(v||k.reduce((function(e,t){return e+t.length+2}),2)>n.maxFlowStringSingleLineLength){g=x;var O,E=S(k);try{for(E.s();!(O=E.n()).done;){var A=O.value;g+=A?"\n".concat(d).concat(p).concat(A):"\n"}}catch(C){E.e(C)}finally{E.f()}g+="\n".concat(p).concat(w)}else g="".concat(x," ").concat(k.join(" ")," ").concat(w)}else{var j=b.map(s);g=j.shift();var T,P=S(j);try{for(P.s();!(T=P.n()).done;){var I=T.value;g+=I?"\n".concat(p).concat(I):"\n"}}catch(C){P.e(C)}finally{P.f()}}return this.comment?(g+="\n"+this.comment.replace(/^/gm,"".concat(p,"#")),r&&r()):y&&i&&i(),g}}]),n}(oe);function pe(e){var t=e instanceof ae?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),Number.isInteger(t)&&t>=0?t:null}a(ue,"maxFlowStringSingleLineLength",60);var de=function(e){l(n,e);var t=g(n);function n(){return i(this,n),t.apply(this,arguments)}return s(n,[{key:"add",value:function(e){this.items.push(e)}},{key:"delete",value:function(e){var t=pe(e);return"number"==typeof t&&this.items.splice(t,1).length>0}},{key:"get",value:function(e,t){var n=pe(e);if("number"==typeof n){var r=this.items[n];return!t&&r instanceof ae?r.value:r}}},{key:"has",value:function(e){var t=pe(e);return"number"==typeof t&&t<this.items.length}},{key:"set",value:function(e,t){var n=pe(e);if("number"!=typeof n)throw new Error("Expected a valid index, not ".concat(e,"."));this.items[n]=t}},{key:"toJSON",value:function(e,t){var n=[];t&&t.onCreate&&t.onCreate(n);var r,i=0,o=S(this.items);try{for(o.s();!(r=o.n()).done;){var s=r.value;n.push(se(s,String(i++),t))}}catch(a){o.e(a)}finally{o.f()}return n}},{key:"toString",value:function(e,t,r){return e?y(c(n.prototype),"toString",this).call(this,e,{blockItem:function(e){return"comment"===e.type?e.str:"- ".concat(e.str)},flowChars:{start:"[",end:"]"},isMap:!1,itemIndent:(e.indent||"")+" "},t,r):JSON.stringify(this)}}]),n}(ue),fe=function(e){l(n,e);var t=g(n);function n(e){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return i(this,n),(r=t.call(this)).key=e,r.value=o,r.type=n.Type.PAIR,r}return s(n,[{key:"commentBefore",get:function(){return this.key instanceof oe?this.key.commentBefore:void 0},set:function(e){if(null==this.key&&(this.key=new ae(null)),!(this.key instanceof oe)){throw new Error("Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.")}this.key.commentBefore=e}},{key:"addToJSMap",value:function(e,t){var n=se(this.key,"",e);if(t instanceof Map){var i=se(this.value,n,e);t.set(n,i)}else if(t instanceof Set)t.add(n);else{var o=function(e,t,n){return null===t?"":"object"!==r(t)?String(t):e instanceof oe&&n&&n.doc?e.toString({anchors:Object.create(null),doc:n.doc,indent:"",indentStep:n.indentStep,inFlow:!0,inStringifyKey:!0,stringify:n.stringify}):JSON.stringify(t)}(this.key,n,e),s=se(this.value,o,e);o in t?Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):t[o]=s}return t}},{key:"toJSON",value:function(e,t){var n=t&&t.mapAsMap?new Map:{};return this.addToJSMap(t,n)}},{key:"toString",value:function(e,t,n){if(!e||!e.doc)return JSON.stringify(this);var i=e.doc.options,o=i.indent,s=i.indentSeq,a=i.simpleKeys,l=this.key,c=this.value,u=l instanceof oe&&l.comment;if(a){if(u)throw new Error("With simple keys, key nodes cannot have comments");if(l instanceof ue){throw new Error("With simple keys, collection cannot be used as a key value")}}var p=!a&&(!l||u||(l instanceof oe?l instanceof ue||l.type===_.BLOCK_FOLDED||l.type===_.BLOCK_LITERAL:"object"===r(l))),d=e,f=d.doc,h=d.indent,m=d.indentStep,g=d.stringify;e=Object.assign({},e,{implicitKey:!p,indent:h+m});var y=!1,v=g(l,e,(function(){return u=null}),(function(){return y=!0}));if(v=ie(v,e.indent,u),!p&&v.length>1024){if(a)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(e.allNullValues&&!a)return this.comment?(v=ie(v,e.indent,this.comment),t&&t()):y&&!u&&n&&n(),e.inFlow&&!p?v:"? ".concat(v);v=p?"? ".concat(v,"\n").concat(h,":"):"".concat(v,":"),this.comment&&(v=ie(v,e.indent,this.comment),t&&t());var b="",x=null;if(c instanceof oe){if(c.spaceBefore&&(b="\n"),c.commentBefore){var w=c.commentBefore.replace(/^/gm,"".concat(e.indent,"#"));b+="\n".concat(w)}x=c.comment}else c&&"object"===r(c)&&(c=f.schema.createNode(c,!0));e.implicitKey=!1,!p&&!this.comment&&c instanceof ae&&(e.indentAtStart=v.length+1),y=!1,!s&&o>=2&&!e.inFlow&&!p&&c instanceof de&&c.type!==_.FLOW_SEQ&&!c.tag&&!f.anchors.getName(c)&&(e.indent=e.indent.substr(2));var k=g(c,e,(function(){return x=null}),(function(){return y=!0})),O=" ";if(b||this.comment)O="".concat(b,"\n").concat(e.indent);else if(!p&&c instanceof ue){("["===k[0]||"{"===k[0])&&!k.includes("\n")||(O="\n".concat(e.indent))}else"\n"===k[0]&&(O="");return y&&!x&&n&&n(),ie(v+O+k,e.indent,x)}}]),n}(oe);a(fe,"Type",{PAIR:"PAIR",MERGE_PAIR:"MERGE_PAIR"});var he=function e(t,n){if(t instanceof me){var r=n.get(t.source);return r.count*r.aliasCount}if(t instanceof ue){var i,o=0,s=S(t.items);try{for(s.s();!(i=s.n()).done;){var a=e(i.value,n);a>o&&(o=a)}}catch(u){s.e(u)}finally{s.f()}return o}if(t instanceof fe){var l=e(t.key,n),c=e(t.value,n);return Math.max(l,c)}return 1},me=function(e){l(n,e);var t=g(n);function n(e){var r;return i(this,n),(r=t.call(this)).source=e,r.type=_.ALIAS,r}return s(n,[{key:"tag",set:function(e){throw new Error("Alias nodes cannot have tags")}},{key:"toJSON",value:function(e,t){if(!t)return se(this.source,e,t);var n=t.anchors,r=t.maxAliasCount,i=n.get(this.source);if(!i||void 0===i.res){var o="This should not happen: Alias anchor was not resolved?";throw this.cstNode?new $(this.cstNode,o):new ReferenceError(o)}if(r>=0&&(i.count+=1,0===i.aliasCount&&(i.aliasCount=he(this.source,n)),i.count*i.aliasCount>r)){var s="Excessive alias count indicates a resource exhaustion attack";throw this.cstNode?new $(this.cstNode,s):new ReferenceError(s)}return i.res}},{key:"toString",value:function(e){return n.stringify(this,e)}}],[{key:"stringify",value:function(e,t){var n=e.range,r=e.source,i=t.anchors,o=t.doc,s=t.implicitKey,a=t.inStringifyKey,l=Object.keys(i).find((function(e){return i[e]===r}));if(!l&&a&&(l=o.anchors.getName(r)||o.anchors.newName()),l)return"*".concat(l).concat(s?" ":"");var c=o.anchors.getName(r)?"Alias node must be after source node":"Source node not found for alias node";throw new Error("".concat(c," [").concat(n,"]"))}}]),n}(oe);function ge(e,t){var n,r=t instanceof ae?t.value:t,i=S(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o instanceof fe){if(o.key===t||o.key===r)return o;if(o.key&&o.key.value===r)return o}}}catch(s){i.e(s)}finally{i.f()}}a(me,"default",!0);var ye=function(e){l(n,e);var t=g(n);function n(){return i(this,n),t.apply(this,arguments)}return s(n,[{key:"add",value:function(e,t){e?e instanceof fe||(e=new fe(e.key||e,e.value)):e=new fe(e);var n=ge(this.items,e.key),r=this.schema&&this.schema.sortMapEntries;if(n){if(!t)throw new Error("Key ".concat(e.key," already set"));n.value=e.value}else if(r){var i=this.items.findIndex((function(t){return r(e,t)<0}));-1===i?this.items.push(e):this.items.splice(i,0,e)}else this.items.push(e)}},{key:"delete",value:function(e){var t=ge(this.items,e);return!!t&&this.items.splice(this.items.indexOf(t),1).length>0}},{key:"get",value:function(e,t){var n=ge(this.items,e),r=n&&n.value;return!t&&r instanceof ae?r.value:r}},{key:"has",value:function(e){return!!ge(this.items,e)}},{key:"set",value:function(e,t){this.add(new fe(e,t),!0)}},{key:"toJSON",value:function(e,t,n){var r=n?new n:t&&t.mapAsMap?new Map:{};t&&t.onCreate&&t.onCreate(r);var i,o=S(this.items);try{for(o.s();!(i=o.n()).done;){i.value.addToJSMap(t,r)}}catch(s){o.e(s)}finally{o.f()}return r}},{key:"toString",value:function(e,t,r){if(!e)return JSON.stringify(this);var i,o=S(this.items);try{for(o.s();!(i=o.n()).done;){var s=i.value;if(!(s instanceof fe))throw new Error("Map items must all be pairs; found ".concat(JSON.stringify(s)," instead"))}}catch(a){o.e(a)}finally{o.f()}return y(c(n.prototype),"toString",this).call(this,e,{blockItem:function(e){return e.str},flowChars:{start:"{",end:"}"},isMap:!0,itemIndent:e.indent||""},t,r)}}]),n}(ue),ve="<<",be=function(e){l(n,e);var t=g(n);function n(e){var r;if(i(this,n),e instanceof fe){var o=e.value;o instanceof de||((o=new de).items.push(e.value),o.range=e.value.range),(r=t.call(this,e.key,o)).range=e.range}else r=t.call(this,new ae(ve),new de);return r.type=fe.Type.MERGE_PAIR,m(r)}return s(n,[{key:"addToJSMap",value:function(e,t){var n,r=S(this.value.items);try{for(r.s();!(n=r.n()).done;){var i=n.value.source;if(!(i instanceof ye))throw new Error("Merge sources must be maps");var o,s=S(i.toJSON(null,e,Map));try{for(s.s();!(o=s.n()).done;){var a=v(o.value,2),l=a[0],c=a[1];t instanceof Map?t.has(l)||t.set(l,c):t instanceof Set?t.add(l):Object.prototype.hasOwnProperty.call(t,l)||Object.defineProperty(t,l,{value:c,writable:!0,enumerable:!0,configurable:!0})}}catch(u){s.e(u)}finally{s.f()}}}catch(u){r.e(u)}finally{r.f()}return t}},{key:"toString",value:function(e,t){var r=this.value;if(r.items.length>1)return y(c(n.prototype),"toString",this).call(this,e,t);this.value=r.items[0];var i=y(c(n.prototype),"toString",this).call(this,e,t);return this.value=r,i}}]),n}(fe),xe={defaultType:_.BLOCK_LITERAL,lineWidth:76},we={trueStr:"true",falseStr:"false"},ke={asBigInt:!1},Oe={nullStr:"null"},Se={defaultType:_.PLAIN,doubleQuoted:{jsonEncoding:!1,minMultiLineLength:40},fold:{lineWidth:80,minContentWidth:20}};function Ee(e,t,n){var r,i=S(t);try{for(i.s();!(r=i.n()).done;){var o=r.value,s=o.format,a=o.test,l=o.resolve;if(a){var c=e.match(a);if(c){var u=l.apply(null,c);return u instanceof ae||(u=new ae(u)),s&&(u.format=s),u}}}}catch(p){i.e(p)}finally{i.f()}return n&&(e=n(e)),new ae(e)}var _e="flow",Ae="block",je="quoted",Te=function(e,t){for(var n=e[t+1];" "===n||"\t"===n;){do{n=e[t+=1]}while(n&&"\n"!==n);n=e[t+1]}return t};function Pe(e,t,n,r){var i=r.indentAtStart,o=r.lineWidth,s=void 0===o?80:o,a=r.minContentWidth,l=void 0===a?20:a,c=r.onFold,u=r.onOverflow;if(!s||s<0)return e;var p=Math.max(1+l,1+s-t.length);if(e.length<=p)return e;var d=[],f={},h=s-t.length;"number"==typeof i&&(i>s-Math.max(2,l)?d.push(0):h=s-i);var m,g=void 0,y=void 0,v=!1,b=-1,x=-1,w=-1;for(n===Ae&&-1!==(b=Te(e,b))&&(h=b+p);m=e[b+=1];){if(n===je&&"\\"===m){switch(x=b,e[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}w=b}if("\n"===m)n===Ae&&(b=Te(e,b)),h=b+p,g=void 0;else{if(" "===m&&y&&" "!==y&&"\n"!==y&&"\t"!==y){var k=e[b+1];k&&" "!==k&&"\n"!==k&&"\t"!==k&&(g=b)}if(b>=h)if(g)d.push(g),h=g+p,g=void 0;else if(n===je){for(;" "===y||"\t"===y;)y=m,m=e[b+=1],v=!0;var O=b>w+1?b-2:x-1;if(f[O])return e;d.push(O),f[O]=!0,h=O+p,g=void 0}else v=!0}y=m}if(v&&u&&u(),0===d.length)return e;c&&c();for(var S=e.slice(0,d[0]),E=0;E<d.length;++E){var _=d[E],A=d[E+1]||e.length;0===_?S="\n".concat(t).concat(e.slice(0,A)):(n===je&&f[_]&&(S+="".concat(e[_],"\\")),S+="\n".concat(t).concat(e.slice(_+1,A)))}return S}var Ie=function(e){var t=e.indentAtStart;return t?Object.assign({indentAtStart:t},Se.fold):Se.fold},Ce=function(e){return/^(%|---|\.\.\.)/m.test(e)};function Re(e,t){var n=t.implicitKey,r=Se.doubleQuoted,i=r.jsonEncoding,o=r.minMultiLineLength,s=JSON.stringify(e);if(i)return s;for(var a=t.indent||(Ce(e)?" ":""),l="",c=0,u=0,p=s[u];p;p=s[++u])if(" "===p&&"\\"===s[u+1]&&"n"===s[u+2]&&(l+=s.slice(c,u)+"\\ ",c=u+=1,p="\\"),"\\"===p)switch(s[u+1]){case"u":l+=s.slice(c,u);var d=s.substr(u+2,4);switch(d){case"0000":l+="\\0";break;case"0007":l+="\\a";break;case"000b":l+="\\v";break;case"001b":l+="\\e";break;case"0085":l+="\\N";break;case"00a0":l+="\\_";break;case"2028":l+="\\L";break;case"2029":l+="\\P";break;default:"00"===d.substr(0,2)?l+="\\x"+d.substr(2):l+=s.substr(u,6)}c=(u+=5)+1;break;case"n":if(n||'"'===s[u+2]||s.length<o)u+=1;else{for(l+=s.slice(c,u)+"\n\n";"\\"===s[u+2]&&"n"===s[u+3]&&'"'!==s[u+4];)l+="\n",u+=2;l+=a," "===s[u+2]&&(l+="\\"),c=(u+=1)+1}break;default:u+=1}return l=c?l+s.slice(c):s,n?l:Pe(l,a,je,Ie(t))}function Ne(e,t){if(t.implicitKey){if(/\n/.test(e))return Re(e,t)}else if(/[ \t]\n|\n[ \t]/.test(e))return Re(e,t);var n=t.indent||(Ce(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,"$&\n".concat(n))+"'";return t.implicitKey?r:Pe(r,n,_e,Ie(t))}function Le(e,t,n,r){var i=e.comment,o=e.type,s=e.value;if(/\n[\t ]+$/.test(s)||/^\s*$/.test(s))return Re(s,t);var a=t.indent||(t.forceBlockIndent||Ce(s)?" ":""),l=a?"2":"1",c=o!==_.BLOCK_FOLDED&&(o===_.BLOCK_LITERAL||!function(e,t,n){if(!t||t<0)return!1;var r=t-n,i=e.length;if(i<=r)return!1;for(var o=0,s=0;o<i;++o)if("\n"===e[o]){if(o-s>r)return!0;if(i-(s=o+1)<=r)return!1}return!0}(s,Se.fold.lineWidth,a.length)),u=c?"|":">";if(!s)return u+"\n";var p="",d="";if(s=s.replace(/[\n\t ]*$/,(function(e){var t=e.indexOf("\n");return-1===t?u+="-":s!==e&&t===e.length-1||(u+="+",r&&r()),d=e.replace(/\n$/,""),""})).replace(/^[\n ]*/,(function(e){-1!==e.indexOf(" ")&&(u+=l);var t=e.match(/ +$/);return t?(p=e.slice(0,-t[0].length),t[0]):(p=e,"")})),d&&(d=d.replace(/\n+(?!\n|$)/g,"$&".concat(a))),p&&(p=p.replace(/\n+/g,"$&".concat(a))),i&&(u+=" #"+i.replace(/ ?[\r\n]+/g," "),n&&n()),!s)return"".concat(u).concat(l,"\n").concat(a).concat(d);if(c)return s=s.replace(/\n+/g,"$&".concat(a)),"".concat(u,"\n").concat(a).concat(p).concat(s).concat(d);s=s.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,"$&".concat(a));var f=Pe("".concat(p).concat(s).concat(d),a,Ae,Se.fold);return"".concat(u,"\n").concat(a).concat(f)}function $e(e,t,n,r){var i=Se.defaultType,o=t.implicitKey,s=t.inFlow,a=e,l=a.type,c=a.value;"string"!=typeof c&&(c=String(c),e=Object.assign({},e,{value:c}));var u=function(i){switch(i){case _.BLOCK_FOLDED:case _.BLOCK_LITERAL:return Le(e,t,n,r);case _.QUOTE_DOUBLE:return Re(c,t);case _.QUOTE_SINGLE:return Ne(c,t);case _.PLAIN:return function(e,t,n,r){var i=e.comment,o=e.type,s=e.value,a=t.actualString,l=t.implicitKey,c=t.indent,u=t.inFlow;if(l&&/[\n[\]{},]/.test(s)||u&&/[[\]{},]/.test(s))return Re(s,t);if(!s||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||u||-1===s.indexOf("\n")?-1!==s.indexOf('"')&&-1===s.indexOf("'")?Ne(s,t):Re(s,t):Le(e,t,n,r);if(!l&&!u&&o!==_.PLAIN&&-1!==s.indexOf("\n"))return Le(e,t,n,r);if(""===c&&Ce(s))return t.forceBlockIndent=!0,Le(e,t,n,r);var p=s.replace(/\n+/g,"$&\n".concat(c));if(a){var d=t.doc.schema.tags;if("string"!=typeof Ee(p,d,d.scalarFallback).value)return Re(s,t)}var f=l?p:Pe(p,c,_e,Ie(t));return!i||u||-1===f.indexOf("\n")&&-1===i.indexOf("\n")?f:(n&&n(),function(e,t,n){if(!n)return e;var r=n.replace(/[\s\S]^/gm,"$&".concat(t,"#"));return"#".concat(r,"\n").concat(t).concat(e)}(f,c,i))}(e,t,n,r);default:return null}};l!==_.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(c)?l=_.QUOTE_DOUBLE:!o&&!s||l!==_.BLOCK_FOLDED&&l!==_.BLOCK_LITERAL||(l=_.QUOTE_DOUBLE);var p=u(l);if(null===p&&null===(p=u(i)))throw new Error("Unsupported default string type ".concat(i));return p}function Me(e){var t=e.format,n=e.minFractionDigits,r=e.tag,i=e.value;if("bigint"==typeof i)return String(i);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";var o=JSON.stringify(i);if(!t&&n&&(!r||"tag:yaml.org,2002:float"===r)&&/^\d/.test(o)){var s=o.indexOf(".");s<0&&(s=o.length,o+=".");for(var a=n-(o.length-s-1);a-- >0;)o+="0"}return o}function De(e,t){var n,r,i;switch(t.type){case _.FLOW_MAP:n="}",r="flow map";break;case _.FLOW_SEQ:n="]",r="flow sequence";break;default:return void e.push(new M(t,"Not a flow collection!?"))}for(var o=t.items.length-1;o>=0;--o){var s=t.items[o];if(!s||s.type!==_.COMMENT){i=s;break}}if(i&&i.char!==n){var a,l="Expected ".concat(r," to end with ").concat(n);"number"==typeof i.offset?(a=new M(t,l)).offset=i.offset+1:(a=new M(i,l),i.range&&i.range.end&&(a.offset=i.range.end-i.range.start)),e.push(a)}}function Fe(e,t){var n=t.context.src[t.range.start-1];if("\n"!==n&&"\t"!==n&&" "!==n){e.push(new M(t,"Comments must be separated from other tokens by white space characters"))}}function Be(e,t){var n=String(t),r=n.substr(0,8)+"..."+n.substr(-8);return new M(e,'The "'.concat(r,'" key is too long'))}function ze(e,t){var n,r=S(t);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i.afterKey,s=i.before,a=i.comment,l=e.items[s];l?(o&&l.value&&(l=l.value),void 0===a?!o&&l.commentBefore||(l.spaceBefore=!0):l.commentBefore?l.commentBefore+="\n"+a:l.commentBefore=a):void 0!==a&&(e.comment?e.comment+="\n"+a:e.comment=a)}}catch(c){r.e(c)}finally{r.f()}}function Ue(e,t){var n=t.strValue;return n?"string"==typeof n?n:(n.errors.forEach((function(n){n.source||(n.source=t),e.errors.push(n)})),n.str):""}function qe(e,t){var n=t.tag,r=t.type,i=!1;if(n){var o=n.handle,s=n.suffix,a=n.verbatim;if(a){if("!"!==a&&"!!"!==a)return a;var l="Verbatim tags aren't resolved, so ".concat(a," is invalid.");e.errors.push(new M(t,l))}else if("!"!==o||s)try{return function(e,t){var n=t.tag,r=n.handle,i=n.suffix,o=e.tagPrefixes.find((function(e){return e.handle===r}));if(!o){var s=e.getDefaults().tagPrefixes;if(s&&(o=s.find((function(e){return e.handle===r}))),!o)throw new M(t,"The ".concat(r," tag handle is non-default and was not declared."))}if(!i)throw new M(t,"The ".concat(r," tag has no suffix."));if("!"===r&&"1.0"===(e.version||e.options.version)){if("^"===i[0])return e.warnings.push(new F(t,"YAML 1.0 ^ tag expansion is not supported")),i;if(/[:/]/.test(i)){var a=i.match(/^([a-z0-9-]+)\/(.*)/i);return a?"tag:".concat(a[1],".yaml.org,2002:").concat(a[2]):"tag:".concat(i)}}return o.prefix+decodeURIComponent(i)}(e,t)}catch(c){e.errors.push(c)}else i=!0}switch(r){case _.BLOCK_FOLDED:case _.BLOCK_LITERAL:case _.QUOTE_DOUBLE:case _.QUOTE_SINGLE:return j.STR;case _.FLOW_MAP:case _.MAP:return j.MAP;case _.FLOW_SEQ:case _.SEQ:return j.SEQ;case _.PLAIN:return i?j.STR:null;default:return null}}function We(e,t,n){var r,i=e.schema.tags,o=[],s=S(i);try{for(s.s();!(r=s.n()).done;){var a=r.value;if(a.tag===n){if(!a.test){var l=a.resolve(e,t);return l instanceof ue?l:new ae(l)}o.push(a)}}}catch(u){s.e(u)}finally{s.f()}var c=Ue(e,t);return"string"==typeof c&&o.length>0?Ee(c,o,i.scalarFallback):null}function Ve(e,t,n){try{var r=We(e,t,n);if(r)return n&&t.tag&&(r.tag=n),r}catch(l){return l.source||(l.source=t),e.errors.push(l),null}try{var i=function(e){switch(e.type){case _.FLOW_MAP:case _.MAP:return j.MAP;case _.FLOW_SEQ:case _.SEQ:return j.SEQ;default:return j.STR}}(t);if(!i)throw new Error("The tag ".concat(n," is unavailable"));var o="The tag ".concat(n," is unavailable, falling back to ").concat(i);e.warnings.push(new F(t,o));var s=We(e,t,i);return s.tag=n,s}catch(l){var a=new $(t,l.message);return a.stack=l.stack,e.errors.push(a),null}}var Qe=function(e){if(!e)return!1;var t=e.type;return t===_.MAP_KEY||t===_.MAP_VALUE||t===_.SEQ_ITEM};function He(e,t){if(!t)return null;t.error&&e.errors.push(t.error);var n=function(e,t){var n,r={before:[],after:[]},i=!1,o=!1,s=S(Qe(t.context.parent)?t.context.parent.props.concat(t.props):t.props);try{for(s.s();!(n=s.n()).done;){var a=n.value,l=a.start,c=a.end;switch(t.context.src[l]){case E.COMMENT:t.commentHasRequiredWhitespace(l)||e.push(new M(t,"Comments must be separated from other tokens by white space characters"));var u=t.header,p=t.valueRange;(p&&(l>p.start||u&&l>u.start)?r.after:r.before).push(t.context.src.slice(l+1,c));break;case E.ANCHOR:i&&e.push(new M(t,"A node can have at most one anchor")),i=!0;break;case E.TAG:o&&e.push(new M(t,"A node can have at most one tag")),o=!0}}}catch(d){s.e(d)}finally{s.f()}return{comments:r,hasAnchor:i,hasTag:o}}(e.errors,t),r=n.comments,i=n.hasAnchor,o=n.hasTag;if(i){var s=e.anchors,a=t.anchor,l=s.getNode(a);l&&(s.map[s.newName(a)]=l),s.map[a]=t}if(t.type===_.ALIAS&&(i||o)){e.errors.push(new M(t,"An alias node must not specify any properties"))}var c=function(e,t){var n=e.anchors,r=e.errors,i=e.schema;if(t.type===_.ALIAS){var o=t.rawValue,s=n.getNode(o);if(!s){var a="Aliased anchor not found: ".concat(o);return r.push(new $(t,a)),null}var l=new me(s);return n._cstAliases.push(l),l}var c=qe(e,t);if(c)return Ve(e,t,c);if(t.type!==_.PLAIN){var u="Failed to resolve ".concat(t.type," node here");return r.push(new D(t,u)),null}try{return Ee(Ue(e,t),i.tags,i.tags.scalarFallback)}catch(p){return p.source||(p.source=t),r.push(p),null}}(e,t);if(c){c.range=[t.range.start,t.range.end],e.options.keepCstNodes&&(c.cstNode=t),e.options.keepNodeTypes&&(c.type=t.type);var u=r.before.join("\n");u&&(c.commentBefore=c.commentBefore?"".concat(c.commentBefore,"\n").concat(u):u);var p=r.after.join("\n");p&&(c.comment=c.comment?"".concat(c.comment,"\n").concat(p):p)}return t.resolved=c}function Ye(e,t){if(t.type!==_.MAP&&t.type!==_.FLOW_MAP){var n="A ".concat(t.type," node cannot be resolved as a mapping");return e.errors.push(new D(t,n)),null}var r=t.type===_.FLOW_MAP?function(e,t){for(var n=[],r=[],i=void 0,o=!1,s="{",a=0;a<t.items.length;++a){var l=t.items[a];if("string"==typeof l.char){var c=l.char,u=l.offset;if("?"===c&&void 0===i&&!o){o=!0,s=":";continue}if(":"===c){if(void 0===i&&(i=null),":"===s){s=",";continue}}else if(o&&(void 0===i&&","!==c&&(i=null),o=!1),void 0!==i&&(r.push(new fe(i)),i=void 0,","===c)){s=":";continue}if("}"===c){if(a===t.items.length-1)continue}else if(c===s){s=":";continue}var p="Flow map contains an unexpected ".concat(c),d=new D(t,p);d.offset=u,e.errors.push(d)}else l.type===_.BLANK_LINE?n.push({afterKey:!!i,before:r.length}):l.type===_.COMMENT?(Fe(e.errors,l),n.push({afterKey:!!i,before:r.length,comment:l.comment})):void 0===i?(","===s&&e.errors.push(new M(l,"Separator , missing in flow map")),i=He(e,l)):(","!==s&&e.errors.push(new M(l,"Indicator : missing in flow map entry")),r.push(new fe(i,He(e,l))),i=void 0,o=!1)}De(e.errors,t),void 0!==i&&r.push(new fe(i));return{comments:n,items:r}}(e,t):function(e,t){for(var n=[],r=[],i=void 0,o=null,s=0;s<t.items.length;++s){var a=t.items[s];switch(a.type){case _.BLANK_LINE:n.push({afterKey:!!i,before:r.length});break;case _.COMMENT:n.push({afterKey:!!i,before:r.length,comment:a.comment});break;case _.MAP_KEY:void 0!==i&&r.push(new fe(i)),a.error&&e.errors.push(a.error),i=He(e,a.node),o=null;break;case _.MAP_VALUE:if(void 0===i&&(i=null),a.error&&e.errors.push(a.error),!a.context.atLineStart&&a.node&&a.node.type===_.MAP&&!a.node.context.atLineStart){var l="Nested mappings are not allowed in compact mappings";e.errors.push(new M(a.node,l))}var c=a.node;if(!c&&a.props.length>0){(c=new B(_.PLAIN,[])).context={parent:a,src:a.context.src};var u=a.range.start+1;if(c.range={start:u,end:u},c.valueRange={start:u,end:u},"number"==typeof a.range.origStart){var p=a.range.origStart+1;c.range.origStart=c.range.origEnd=p,c.valueRange.origStart=c.valueRange.origEnd=p}}var d=new fe(i,He(e,c));Xe(a,d),r.push(d),i&&"number"==typeof o&&a.range.start>o+1024&&e.errors.push(Be(t,i)),i=void 0,o=null;break;default:void 0!==i&&r.push(new fe(i)),i=He(e,a),o=a.range.start,a.error&&e.errors.push(a.error);e:for(var f=s+1;;++f){var h=t.items[f];switch(h&&h.type){case _.BLANK_LINE:case _.COMMENT:continue e;case _.MAP_VALUE:break e;default:var m="Implicit map keys need to be followed by map values";e.errors.push(new M(a,m));break e}}if(a.valueRangeContainsNewline){var g="Implicit map keys need to be on a single line";e.errors.push(new M(a,g))}}}void 0!==i&&r.push(new fe(i));return{comments:n,items:r}}(e,t),i=r.comments,o=r.items,s=new ye;s.items=o,ze(s,i);for(var a=!1,l=0;l<o.length;++l){var c=o[l].key;if(c instanceof ue&&(a=!0),e.schema.merge&&c&&c.value===ve){o[l]=new be(o[l]);var u=o[l].value.items,p=null;u.some((function(e){if(e instanceof me){var t=e.source.type;return t!==_.MAP&&t!==_.FLOW_MAP&&(p="Merge nodes aliases can only point to maps")}return p="Merge nodes can only have Alias nodes as values"})),p&&e.errors.push(new M(t,p))}else for(var d=l+1;d<o.length;++d){var f=o[d].key;if(c===f||c&&f&&Object.prototype.hasOwnProperty.call(c,"value")&&c.value===f.value){var h='Map keys must be unique; "'.concat(c,'" is repeated');e.errors.push(new M(t,h));break}}}if(a&&!e.options.mapAsMap){e.warnings.push(new F(t,"Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this."))}return t.resolved=s,s}var Ge=function(e){var t=e.context,n=t.lineStart,r=t.node,i=t.src,o=e.props;if(0===o.length)return!1;var s=o[0].start;if(r&&s>r.valueRange.start)return!1;if(i[s]!==E.COMMENT)return!1;for(var a=n;a<s;++a)if("\n"===i[a])return!1;return!0};function Xe(e,t){if(Ge(e)){var n=e.getPropValue(0,E.COMMENT,!0),r=!1,i=t.value.commentBefore;if(i&&i.startsWith(n))t.value.commentBefore=i.substr(n.length+1),r=!0;else{var o=t.value.comment;!e.node&&o&&o.startsWith(n)&&(t.value.comment=o.substr(n.length+1),r=!0)}r&&(t.comment=n)}}function Ke(e,t){if(t.type!==_.SEQ&&t.type!==_.FLOW_SEQ){var n="A ".concat(t.type," node cannot be resolved as a sequence");return e.errors.push(new D(t,n)),null}var r=t.type===_.FLOW_SEQ?function(e,t){for(var n=[],r=[],i=!1,o=void 0,s=null,a="[",l=null,c=0;c<t.items.length;++c){var u=t.items[c];if("string"==typeof u.char){var p=u.char,d=u.offset;if(":"===p||!i&&void 0===o||(i&&void 0===o&&(o=a?r.pop():null),r.push(new fe(o)),i=!1,o=void 0,s=null),p===a)a=null;else if(a||"?"!==p){if("["!==a&&":"===p&&void 0===o){if(","===a){if((o=r.pop())instanceof fe){var f=new M(t,"Chaining flow sequence pairs is invalid");f.offset=d,e.errors.push(f)}if(!i&&"number"==typeof s){var h=u.range?u.range.start:u.offset;h>s+1024&&e.errors.push(Be(t,o));for(var m=l.context.src,g=s;g<h;++g)if("\n"===m[g]){var y="Implicit keys of flow sequence pairs need to be on a single line";e.errors.push(new M(l,y));break}}}else o=null;s=null,i=!1,a=null}else if("["===a||"]"!==p||c<t.items.length-1){var v="Flow sequence contains an unexpected ".concat(p),b=new D(t,v);b.offset=d,e.errors.push(b)}}else i=!0}else if(u.type===_.BLANK_LINE)n.push({before:r.length});else if(u.type===_.COMMENT)Fe(e.errors,u),n.push({comment:u.comment,before:r.length});else{if(a){var x="Expected a ".concat(a," in flow sequence");e.errors.push(new M(u,x))}var w=He(e,u);void 0===o?(r.push(w),l=u):(r.push(new fe(o,w)),o=void 0),s=u.range.start,a=","}}De(e.errors,t),void 0!==o&&r.push(new fe(o));return{comments:n,items:r}}(e,t):function(e,t){for(var n=[],r=[],i=0;i<t.items.length;++i){var o=t.items[i];switch(o.type){case _.BLANK_LINE:n.push({before:r.length});break;case _.COMMENT:n.push({comment:o.comment,before:r.length});break;case _.SEQ_ITEM:if(o.error&&e.errors.push(o.error),r.push(He(e,o.node)),o.hasProps){var s="Sequence items cannot have tags or anchors before the - indicator";e.errors.push(new M(o,s))}break;default:o.error&&e.errors.push(o.error),e.errors.push(new D(o,"Unexpected ".concat(o.type," node in sequence")))}}return{comments:n,items:r}}(e,t),i=r.comments,o=r.items,s=new de;if(s.items=o,ze(s,i),!e.options.mapAsMap&&o.some((function(e){return e instanceof fe&&e.key instanceof ue}))){e.warnings.push(new F(t,"Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this."))}return t.resolved=s,s}var Je={identify:function(e){return e instanceof Uint8Array},default:!1,tag:"tag:yaml.org,2002:binary",resolve:function(e,t){var n=Ue(e,t);if("function"==typeof Buffer)return Buffer.from(n,"base64");if("function"==typeof atob){for(var r=atob(n.replace(/[\n\r]/g,"")),i=new Uint8Array(r.length),o=0;o<r.length;++o)i[o]=r.charCodeAt(o);return i}return e.errors.push(new $(t,"This environment does not support reading binary tags; either Buffer or atob is required")),null},options:xe,stringify:function(e,t,n,r){var i,o=e.comment,s=e.type,a=e.value;if("function"==typeof Buffer)i=a instanceof Buffer?a.toString("base64"):Buffer.from(a.buffer).toString("base64");else{if("function"!=typeof btoa)throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");for(var l="",c=0;c<a.length;++c)l+=String.fromCharCode(a[c]);i=btoa(l)}if(s||(s=xe.defaultType),s===_.QUOTE_DOUBLE)a=i;else{for(var u=xe.lineWidth,p=Math.ceil(i.length/u),d=new Array(p),f=0,h=0;f<p;++f,h+=u)d[f]=i.substr(h,u);a=d.join(s===_.BLOCK_LITERAL?"\n":" ")}return $e({comment:o,type:s,value:a},t,n,r)}};function Ze(e,t){for(var n=Ke(e,t),r=0;r<n.items.length;++r){var i=n.items[r];if(!(i instanceof fe)){if(i instanceof ye){if(i.items.length>1){throw new M(t,"Each pair must have its own sequence indicator")}var o=i.items[0]||new fe;i.commentBefore&&(o.commentBefore=o.commentBefore?"".concat(i.commentBefore,"\n").concat(o.commentBefore):i.commentBefore),i.comment&&(o.comment=o.comment?"".concat(i.comment,"\n").concat(o.comment):i.comment),i=o}n.items[r]=i instanceof fe?i:new fe(i)}}return n}function et(e,t,n){var r=new de(e);r.tag="tag:yaml.org,2002:pairs";var i,o=S(t);try{for(o.s();!(i=o.n()).done;){var s=i.value,a=void 0,l=void 0;if(Array.isArray(s)){if(2!==s.length)throw new TypeError("Expected [key, value] tuple: ".concat(s));a=s[0],l=s[1]}else if(s&&s instanceof Object){var c=Object.keys(s);if(1!==c.length)throw new TypeError("Expected { key: value } tuple: ".concat(s));l=s[a=c[0]]}else a=s;var u=e.createPair(a,l,n);r.items.push(u)}}catch(p){o.e(p)}finally{o.f()}return r}var tt={default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ze,createNode:et},nt=function(e){l(n,e);var t=g(n);function n(){var e;return i(this,n),a(h(e=t.call(this)),"add",ye.prototype.add.bind(h(e))),a(h(e),"delete",ye.prototype.delete.bind(h(e))),a(h(e),"get",ye.prototype.get.bind(h(e))),a(h(e),"has",ye.prototype.has.bind(h(e))),a(h(e),"set",ye.prototype.set.bind(h(e))),e.tag=n.tag,e}return s(n,[{key:"toJSON",value:function(e,t){var n=new Map;t&&t.onCreate&&t.onCreate(n);var r,i=S(this.items);try{for(i.s();!(r=i.n()).done;){var o=r.value,s=void 0,a=void 0;if(o instanceof fe?(s=se(o.key,"",t),a=se(o.value,s,t)):s=se(o,"",t),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,a)}}catch(l){i.e(l)}finally{i.f()}return n}}]),n}(de);a(nt,"tag","tag:yaml.org,2002:omap");var rt={identify:function(e){return e instanceof Map},nodeClass:nt,default:!1,tag:"tag:yaml.org,2002:omap",resolve:function(e,t){var n,r=Ze(e,t),i=[],o=S(r.items);try{for(o.s();!(n=o.n()).done;){var s=n.value.key;if(s instanceof ae){if(i.includes(s.value)){throw new M(t,"Ordered maps must not include duplicate keys")}i.push(s.value)}}}catch(a){o.e(a)}finally{o.f()}return Object.assign(new nt,r)},createNode:function(e,t,n){var r=et(e,t,n),i=new nt;return i.items=r.items,i}},it=function(e){l(n,e);var t=g(n);function n(){var e;return i(this,n),(e=t.call(this)).tag=n.tag,e}return s(n,[{key:"add",value:function(e){var t=e instanceof fe?e:new fe(e);ge(this.items,t.key)||this.items.push(t)}},{key:"get",value:function(e,t){var n=ge(this.items,e);return!t&&n instanceof fe?n.key instanceof ae?n.key.value:n.key:n}},{key:"set",value:function(e,t){if("boolean"!=typeof t)throw new Error("Expected boolean value for set(key, value) in a YAML set, not ".concat(r(t)));var n=ge(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new fe(e))}},{key:"toJSON",value:function(e,t){return y(c(n.prototype),"toJSON",this).call(this,e,t,Set)}},{key:"toString",value:function(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues())return y(c(n.prototype),"toString",this).call(this,e,t,r);throw new Error("Set items must all have null values")}}]),n}(ye);a(it,"tag","tag:yaml.org,2002:set");var ot={identify:function(e){return e instanceof Set},nodeClass:it,default:!1,tag:"tag:yaml.org,2002:set",resolve:function(e,t){var n=Ye(e,t);if(!n.hasAllNullValues())throw new M(t,"Set items must all have null values");return Object.assign(new it,n)},createNode:function(e,t,n){var r,i=new it,o=S(t);try{for(o.s();!(r=o.n()).done;){var s=r.value;i.items.push(e.createPair(s,null,n))}}catch(a){o.e(a)}finally{o.f()}return i}},st=function(e,t){var n=t.split(":").reduce((function(e,t){return 60*e+Number(t)}),0);return"-"===e?-n:n},at=function(e){var t=e.value;if(isNaN(t)||!isFinite(t))return Me(t);var n="";t<0&&(n="-",t=Math.abs(t));var r=[t%60];return t<60?r.unshift(0):(t=Math.round((t-r[0])/60),r.unshift(t%60),t>=60&&(t=Math.round((t-r[0])/60),r.unshift(t))),n+r.map((function(e){return e<10?"0"+String(e):String(e)})).join(":").replace(/000000\d*$/,"")},lt={identify:function(e){return"number"==typeof e},default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,resolve:function(e,t,n){return st(t,n.replace(/_/g,""))},stringify:at},ct={identify:function(e){return"number"==typeof e},default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,resolve:function(e,t,n){return st(t,n.replace(/_/g,""))},stringify:at},ut={identify:function(e){return e instanceof Date},default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^(?:([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?)$"),resolve:function(e,t,n,r,i,o,s,a,l){a&&(a=(a+"00").substr(1,3));var c=Date.UTC(t,n-1,r,i||0,o||0,s||0,a||0);if(l&&"Z"!==l){var u=st(l[0],l.slice(1));Math.abs(u)<30&&(u*=60),c-=6e4*u}return new Date(c)},stringify:function(e){return e.value.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")}};function pt(e){var t="undefined"!=typeof process&&process.env||{};return e?"undefined"!=typeof YAML_SILENCE_DEPRECATION_WARNINGS?!YAML_SILENCE_DEPRECATION_WARNINGS:!t.YAML_SILENCE_DEPRECATION_WARNINGS:"undefined"!=typeof YAML_SILENCE_WARNINGS?!YAML_SILENCE_WARNINGS:!t.YAML_SILENCE_WARNINGS}function dt(e,t){if(pt(!1)){var n="undefined"!=typeof process&&process.emitWarning;n?n(e,t):console.warn(t?"".concat(t,": ").concat(e):e)}}var ft={};var ht={createNode:function(e,t,n){var i=new ye(e);if(t instanceof Map){var o,s=S(t);try{for(s.s();!(o=s.n()).done;){var a=v(o.value,2),l=a[0],c=a[1];i.items.push(e.createPair(l,c,n))}}catch(f){s.e(f)}finally{s.f()}}else if(t&&"object"===r(t))for(var u=0,p=Object.keys(t);u<p.length;u++){var d=p[u];i.items.push(e.createPair(d,t[d],n))}return"function"==typeof e.sortMapEntries&&i.items.sort(e.sortMapEntries),i},default:!0,nodeClass:ye,tag:"tag:yaml.org,2002:map",resolve:Ye};var mt={createNode:function(e,t,n){var r=new de(e);if(t&&t[Symbol.iterator]){var i,o=S(t);try{for(o.s();!(i=o.n()).done;){var s=i.value,a=e.createNode(s,n.wrapScalars,null,n);r.items.push(a)}}catch(l){o.e(l)}finally{o.f()}}return r},default:!0,nodeClass:de,tag:"tag:yaml.org,2002:seq",resolve:Ke},gt=[ht,mt,{identify:function(e){return"string"==typeof e},default:!0,tag:"tag:yaml.org,2002:str",resolve:Ue,stringify:function(e,t,n,r){return $e(e,t=Object.assign({actualString:!0},t),n,r)},options:Se}],yt=function(e){return"bigint"==typeof e||Number.isInteger(e)},vt=function(e,t,n){return ke.asBigInt?BigInt(e):parseInt(t,n)};function bt(e,t,n){var r=e.value;return yt(r)&&r>=0?n+r.toString(t):Me(e)}var xt={identify:function(e){return null==e},createNode:function(e,t,n){return n.wrapScalars?new ae(null):null},default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:function(){return null},options:Oe,stringify:function(){return Oe.nullStr}},wt={identify:function(e){return"boolean"==typeof e},default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:function(e){return"t"===e[0]||"T"===e[0]},options:we,stringify:function(e){return e.value?we.trueStr:we.falseStr}},kt={identify:function(e){return yt(e)&&e>=0},default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o([0-7]+)$/,resolve:function(e,t){return vt(e,t,8)},options:ke,stringify:function(e){return bt(e,8,"0o")}},Ot={identify:yt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:function(e){return vt(e,e,10)},options:ke,stringify:Me},St={identify:function(e){return yt(e)&&e>=0},default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x([0-9a-fA-F]+)$/,resolve:function(e,t){return vt(e,t,16)},options:ke,stringify:function(e){return bt(e,16,"0x")}},Et={identify:function(e){return"number"==typeof e},default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:function(e,t){return t?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY},stringify:Me},_t={identify:function(e){return"number"==typeof e},default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:function(e){return parseFloat(e)},stringify:function(e){var t=e.value;return Number(t).toExponential()}},At={identify:function(e){return"number"==typeof e},default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,resolve:function(e,t,n){var r=t||n,i=new ae(parseFloat(e));return r&&"0"===r[r.length-1]&&(i.minFractionDigits=r.length),i},stringify:Me},jt=gt.concat([xt,wt,kt,Ot,St,Et,_t,At]),Tt=function(e){return"bigint"==typeof e||Number.isInteger(e)},Pt=function(e){var t=e.value;return JSON.stringify(t)},It=[ht,mt,{identify:function(e){return"string"==typeof e},default:!0,tag:"tag:yaml.org,2002:str",resolve:Ue,stringify:Pt},{identify:function(e){return null==e},createNode:function(e,t,n){return n.wrapScalars?new ae(null):null},default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:function(){return null},stringify:Pt},{identify:function(e){return"boolean"==typeof e},default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:function(e){return"true"===e},stringify:Pt},{identify:Tt,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:function(e){return ke.asBigInt?BigInt(e):parseInt(e,10)},stringify:function(e){var t=e.value;return Tt(t)?t.toString():JSON.stringify(t)}},{identify:function(e){return"number"==typeof e},default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:function(e){return parseFloat(e)},stringify:Pt}];It.scalarFallback=function(e){throw new SyntaxError("Unresolved plain scalar ".concat(JSON.stringify(e)))};var Ct=function(e){return e.value?we.trueStr:we.falseStr},Rt=function(e){return"bigint"==typeof e||Number.isInteger(e)};function Nt(e,t,n){var r=t.replace(/_/g,"");if(ke.asBigInt){switch(n){case 2:r="0b".concat(r);break;case 8:r="0o".concat(r);break;case 16:r="0x".concat(r)}var i=BigInt(r);return"-"===e?BigInt(-1)*i:i}var o=parseInt(r,n);return"-"===e?-1*o:o}function Lt(e,t,n){var r=e.value;if(Rt(r)){var i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return Me(e)}var $t=gt.concat([{identify:function(e){return null==e},createNode:function(e,t,n){return n.wrapScalars?new ae(null):null},default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:function(){return null},options:Oe,stringify:function(){return Oe.nullStr}},{identify:function(e){return"boolean"==typeof e},default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:function(){return!0},options:we,stringify:Ct},{identify:function(e){return"boolean"==typeof e},default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:function(){return!1},options:we,stringify:Ct},{identify:Rt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^([-+]?)0b([0-1_]+)$/,resolve:function(e,t,n){return Nt(t,n,2)},stringify:function(e){return Lt(e,2,"0b")}},{identify:Rt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^([-+]?)0([0-7_]+)$/,resolve:function(e,t,n){return Nt(t,n,8)},stringify:function(e){return Lt(e,8,"0")}},{identify:Rt,default:!0,tag:"tag:yaml.org,2002:int",test:/^([-+]?)([0-9][0-9_]*)$/,resolve:function(e,t,n){return Nt(t,n,10)},stringify:Me},{identify:Rt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^([-+]?)0x([0-9a-fA-F_]+)$/,resolve:function(e,t,n){return Nt(t,n,16)},stringify:function(e){return Lt(e,16,"0x")}},{identify:function(e){return"number"==typeof e},default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:function(e,t){return t?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY},stringify:Me},{identify:function(e){return"number"==typeof e},default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:function(e){return parseFloat(e.replace(/_/g,""))},stringify:function(e){var t=e.value;return Number(t).toExponential()}},{identify:function(e){return"number"==typeof e},default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/,resolve:function(e,t){var n=new ae(parseFloat(e.replace(/_/g,"")));if(t){var r=t.replace(/_/g,"");"0"===r[r.length-1]&&(n.minFractionDigits=r.length)}return n},stringify:Me}],Je,rt,tt,ot,lt,ct,ut),Mt={core:jt,failsafe:gt,json:It,yaml11:$t},Dt={binary:Je,bool:wt,float:At,floatExp:_t,floatNaN:Et,floatTime:ct,int:Ot,intHex:St,intOct:kt,intTime:lt,map:ht,null:xt,omap:rt,pairs:tt,seq:mt,set:ot,timestamp:ut};function Ft(e,t,n){if(e instanceof oe)return e;var i=n.defaultPrefix,o=n.onTagObj,s=n.prevObjects,a=n.schema,l=n.wrapScalars;t&&t.startsWith("!!")&&(t=i+t.slice(2));var c=function(e,t,n){if(t){var r=n.filter((function(e){return e.tag===t})),i=r.find((function(e){return!e.format}))||r[0];if(!i)throw new Error("Tag ".concat(t," not found"));return i}return n.find((function(t){return(t.identify&&t.identify(e)||t.class&&e instanceof t.class)&&!t.format}))}(e,t,a.tags);if(!c){if("function"==typeof e.toJSON&&(e=e.toJSON()),!e||"object"!==r(e))return l?new ae(e):e;c=e instanceof Map?ht:e[Symbol.iterator]?mt:ht}o&&(o(c),delete n.onTagObj);var u={value:void 0,node:void 0};if(e&&"object"===r(e)&&s){var p=s.get(e);if(p){var d=new me(p);return n.aliasNodes.push(d),d}u.value=e,s.set(e,u)}return u.node=c.createNode?c.createNode(n.schema,e,n):l?new ae(e):e,t&&u.node instanceof oe&&(u.node.tag=t),u.node}var Bt=function(e,t){return e.key<t.key?-1:e.key>t.key?1:0},zt=function(){function e(t){var n=t.customTags,r=t.merge,o=t.schema,s=t.sortMapEntries,a=t.tags;i(this,e),this.merge=!!r,this.name=o,this.sortMapEntries=!0===s?Bt:s||null,!n&&a&&function(e,t){if(!ft[e]&&pt(!0)){ft[e]=!0;var n="The option '".concat(e,"' will be removed in a future release");dt(n+=t?", use '".concat(t,"' instead."):".","DeprecationWarning")}}("tags","customTags"),this.tags=function(e,t,n,r){var i=e[r.replace(/\W/g,"")];if(!i){var o=Object.keys(e).map((function(e){return JSON.stringify(e)})).join(", ");throw new Error('Unknown schema "'.concat(r,'"; use one of ').concat(o))}if(Array.isArray(n)){var s,a=S(n);try{for(a.s();!(s=a.n()).done;){var l=s.value;i=i.concat(l)}}catch(f){a.e(f)}finally{a.f()}}else"function"==typeof n&&(i=n(i.slice()));for(var c=0;c<i.length;++c){var u=i[c];if("string"==typeof u){var p=t[u];if(!p){var d=Object.keys(t).map((function(e){return JSON.stringify(e)})).join(", ");throw new Error('Unknown custom tag "'.concat(u,'"; use one of ').concat(d))}i[c]=p}}return i}(Mt,Dt,n||a,o)}return s(e,[{key:"createNode",value:function(t,n,r,i){var o={defaultPrefix:e.defaultPrefix,schema:this,wrapScalars:n};return Ft(t,r,i?Object.assign(i,o):o)}},{key:"createPair",value:function(e,t,n){n||(n={wrapScalars:!0});var r=this.createNode(e,n.wrapScalars,null,n),i=this.createNode(t,n.wrapScalars,null,n);return new fe(r,i)}}]),e}();a(zt,"defaultPrefix",A),a(zt,"defaultTags",j);var Ut={anchorPrefix:"a",customTags:null,indent:2,indentSeq:!0,keepCstNodes:!1,keepNodeTypes:!0,keepBlobsInJSON:!0,mapAsMap:!1,maxAliasCount:100,prettyErrors:!1,simpleKeys:!1,version:"1.2"},qt={get binary(){return xe},set binary(e){Object.assign(xe,e)},get bool(){return we},set bool(e){Object.assign(we,e)},get int(){return ke},set int(e){Object.assign(ke,e)},get null(){return Oe},set null(e){Object.assign(Oe,e)},get str(){return Se},set str(e){Object.assign(Se,e)}},Wt={"1.0":{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:A},{handle:"!!",prefix:"tag:private.yaml.org,2002:"}]},1.1:{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:A}]},1.2:{schema:"core",merge:!1,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:A}]}};function Vt(e,t){if("1.0"===(e.version||e.options.version)){var n=t.match(/^tag:private\.yaml\.org,2002:([^:/]+)$/);if(n)return"!"+n[1];var r=t.match(/^tag:([a-zA-Z0-9-]+)\.yaml\.org,2002:(.*)/);return r?"!".concat(r[1],"/").concat(r[2]):"!".concat(t.replace(/^tag:/,""))}var i=e.tagPrefixes.find((function(e){return 0===t.indexOf(e.prefix)}));if(!i){var o=e.getDefaults().tagPrefixes;i=o&&o.find((function(e){return 0===t.indexOf(e.prefix)}))}if(!i)return"!"===t[0]?t:"!<".concat(t,">");var s=t.substr(i.prefix.length).replace(/[!,[\]{}]/g,(function(e){return{"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"}[e]}));return i.handle+s}function Qt(e,t,n,i){var o,s=t.doc,a=s.anchors,l=s.schema;if(!(e instanceof oe)){var c={aliasNodes:[],onTagObj:function(e){return o=e},prevObjects:new Map};e=l.createNode(e,!0,null,c);var u,p=S(c.aliasNodes);try{for(p.s();!(u=p.n()).done;){var d=u.value;d.source=d.source.node;var f=a.getName(d.source);f||(f=a.newName(),a.map[f]=d.source)}}catch(g){p.e(g)}finally{p.f()}}if(e instanceof fe)return e.toString(t,n,i);o||(o=function(e,t){if(t instanceof me)return me;if(t.tag){var n=e.filter((function(e){return e.tag===t.tag}));if(n.length>0)return n.find((function(e){return e.format===t.format}))||n[0]}var i,o;if(t instanceof ae){o=t.value;var s=e.filter((function(e){return e.identify&&e.identify(o)||e.class&&o instanceof e.class}));i=s.find((function(e){return e.format===t.format}))||s.find((function(e){return!e.format}))}else o=t,i=e.find((function(e){return e.nodeClass&&o instanceof e.nodeClass}));if(!i){var a=o&&o.constructor?o.constructor.name:r(o);throw new Error("Tag not resolved for ".concat(a," value"))}return i}(l.tags,e));var h=function(e,t,n){var r=n.anchors,i=n.doc,o=[],s=i.anchors.getName(e);return s&&(r[s]=e,o.push("&".concat(s))),e.tag?o.push(Vt(i,e.tag)):t.default||o.push(Vt(i,t.tag)),o.join(" ")}(e,o,t);h.length>0&&(t.indentAtStart=(t.indentAtStart||0)+h.length+1);var m="function"==typeof o.stringify?o.stringify(e,t,n,i):e instanceof ae?$e(e,t,n,i):e.toString(t,n,i);return h?e instanceof ae||"{"===m[0]||"["===m[0]?"".concat(h," ").concat(m):"".concat(h,"\n").concat(t.indent).concat(m):m}var Ht=function(){function e(t){i(this,e),a(this,"map",Object.create(null)),this.prefix=t}return s(e,[{key:"createAlias",value:function(e,t){return this.setAnchor(e,t),new me(e)}},{key:"createMergePair",value:function(){for(var e=this,t=new be,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.value.items=r.map((function(t){if(t instanceof me){if(t.source instanceof ye)return t}else if(t instanceof ye)return e.createAlias(t);throw new Error("Merge sources must be Map nodes or their Aliases")})),t}},{key:"getName",value:function(e){var t=this.map;return Object.keys(t).find((function(n){return t[n]===e}))}},{key:"getNames",value:function(){return Object.keys(this.map)}},{key:"getNode",value:function(e){return this.map[e]}},{key:"newName",value:function(e){e||(e=this.prefix);for(var t=Object.keys(this.map),n=1;;++n){var r="".concat(e).concat(n);if(!t.includes(r))return r}}},{key:"resolveNodes",value:function(){var e=this.map,t=this._cstAliases;Object.keys(e).forEach((function(t){e[t]=e[t].resolved})),t.forEach((function(e){e.source=e.source.resolved})),delete this._cstAliases}},{key:"setAnchor",value:function(t,n){if(null!=t&&!e.validAnchorNode(t))throw new Error("Anchors may only be set for Scalar, Seq and Map nodes");if(n&&/[\x00-\x19\s,[\]{}]/.test(n))throw new Error("Anchor names must not contain whitespace or control characters");var r=this.map,i=t&&Object.keys(r).find((function(e){return r[e]===t}));if(i){if(!n)return i;i!==n&&(delete r[i],r[n]=t)}else{if(!n){if(!t)return null;n=this.newName()}r[n]=t}return n}}],[{key:"validAnchorNode",value:function(e){return e instanceof ae||e instanceof de||e instanceof ye}}]),e}(),Yt=function e(t,n){if(t&&"object"===r(t)){var i=t.tag;t instanceof ue?(i&&(n[i]=!0),t.items.forEach((function(t){return e(t,n)}))):t instanceof fe?(e(t.key,n),e(t.value,n)):t instanceof ae&&i&&(n[i]=!0)}return n},Gt=function(e){return Object.keys(Yt(e,{}))};function Xt(e,t){var n=e.tagPrefixes,r=v(t.parameters,2),i=r[0],o=r[1];if(!i||!o){throw new M(t,"Insufficient parameters given for %TAG directive")}if(n.some((function(e){return e.handle===i}))){throw new M(t,"The %TAG directive must only be given at most once per handle in the same document.")}return{handle:i,prefix:o}}function Kt(e,t){var n=v(t.parameters,1)[0];if("YAML:1.0"===t.name&&(n="1.0"),!n){throw new M(t,"Insufficient parameters given for %YAML directive")}if(!Wt[n]){var r=e.version||e.options.version,i="Document will be parsed as YAML ".concat(r," rather than YAML ").concat(n);e.warnings.push(new F(t,i))}return n}function Jt(e){if(e instanceof ue)return!0;throw new Error("Expected a YAML collection as document contents")}var Zt=function(){function e(t){i(this,e),this.anchors=new Ht(t.anchorPrefix),this.commentBefore=null,this.comment=null,this.contents=null,this.directivesEndMarker=null,this.errors=[],this.options=t,this.schema=null,this.tagPrefixes=[],this.version=null,this.warnings=[]}return s(e,[{key:"add",value:function(e){return Jt(this.contents),this.contents.add(e)}},{key:"addIn",value:function(e,t){Jt(this.contents),this.contents.addIn(e,t)}},{key:"delete",value:function(e){return Jt(this.contents),this.contents.delete(e)}},{key:"deleteIn",value:function(e){return ce(e)?null!=this.contents&&(this.contents=null,!0):(Jt(this.contents),this.contents.deleteIn(e))}},{key:"getDefaults",value:function(){return e.defaults[this.version]||e.defaults[this.options.version]||{}}},{key:"get",value:function(e,t){return this.contents instanceof ue?this.contents.get(e,t):void 0}},{key:"getIn",value:function(e,t){return ce(e)?!t&&this.contents instanceof ae?this.contents.value:this.contents:this.contents instanceof ue?this.contents.getIn(e,t):void 0}},{key:"has",value:function(e){return this.contents instanceof ue&&this.contents.has(e)}},{key:"hasIn",value:function(e){return ce(e)?void 0!==this.contents:this.contents instanceof ue&&this.contents.hasIn(e)}},{key:"set",value:function(e,t){Jt(this.contents),this.contents.set(e,t)}},{key:"setIn",value:function(e,t){ce(e)?this.contents=t:(Jt(this.contents),this.contents.setIn(e,t))}},{key:"setSchema",value:function(e,t){if(e||t||!this.schema){"number"==typeof e&&(e=e.toFixed(1)),"1.0"===e||"1.1"===e||"1.2"===e?(this.version?this.version=e:this.options.version=e,delete this.options.schema):e&&"string"==typeof e&&(this.options.schema=e),Array.isArray(t)&&(this.options.customTags=t);var n=Object.assign({},this.getDefaults(),this.options);this.schema=new zt(n)}}},{key:"parse",value:function(e,t){this.options.keepCstNodes&&(this.cstNode=e),this.options.keepNodeTypes&&(this.type="DOCUMENT");var n=e.directives,r=void 0===n?[]:n,i=e.contents,o=void 0===i?[]:i,s=e.directivesEndMarker,a=e.error,l=e.valueRange;if(a&&(a.source||(a.source=this),this.errors.push(a)),function(e,t,n){var r,i=[],o=!1,s=S(t);try{for(s.s();!(r=s.n()).done;){var l=r.value,c=l.comment,u=l.name;switch(u){case"TAG":try{e.tagPrefixes.push(Xt(e,l))}catch(a){e.errors.push(a)}o=!0;break;case"YAML":case"YAML:1.0":e.version&&e.errors.push(new M(l,"The %YAML directive must only be given at most once per document."));try{e.version=Kt(e,l)}catch(a){e.errors.push(a)}o=!0;break;default:if(u){var p="YAML only supports %TAG and %YAML directives, and not %".concat(u);e.warnings.push(new F(l,p))}}c&&i.push(c)}}catch(d){s.e(d)}finally{s.f()}n&&!o&&"1.1"===(e.version||n.version||e.options.version)&&(e.tagPrefixes=n.tagPrefixes.map((function(e){return{handle:e.handle,prefix:e.prefix}})),e.version=n.version);e.commentBefore=i.join("\n")||null}(this,r,t),s&&(this.directivesEndMarker=!0),this.range=l?[l.start,l.end]:null,this.setSchema(),this.anchors._cstAliases=[],function(e,t){var n,r={before:[],after:[]},i=void 0,o=!1,s=S(t);try{for(s.s();!(n=s.n()).done;){var a=n.value;if(a.valueRange){if(void 0!==i){e.errors.push(new D(a,"Document contains trailing content not separated by a ... or --- line"));break}var l=He(e,a);o&&(l.spaceBefore=!0,o=!1),i=l}else null!==a.comment?(void 0===i?r.before:r.after).push(a.comment):a.type===_.BLANK_LINE&&(o=!0,void 0===i&&r.before.length>0&&!e.commentBefore&&(e.commentBefore=r.before.join("\n"),r.before=[]))}}catch(p){s.e(p)}finally{s.f()}if(e.contents=i||null,i){var c=r.before.join("\n");if(c){var u=i instanceof ue&&i.items[0]?i.items[0]:i;u.commentBefore=u.commentBefore?"".concat(c,"\n").concat(u.commentBefore):c}e.comment=r.after.join("\n")||null}else e.comment=r.before.concat(r.after).join("\n")||null}(this,o),this.anchors.resolveNodes(),this.options.prettyErrors){var c,u=S(this.errors);try{for(u.s();!(c=u.n()).done;){var p=c.value;p instanceof L&&p.makePretty()}}catch(m){u.e(m)}finally{u.f()}var d,f=S(this.warnings);try{for(f.s();!(d=f.n()).done;){var h=d.value;h instanceof L&&h.makePretty()}}catch(m){f.e(m)}finally{f.f()}}return this}},{key:"listNonDefaultTags",value:function(){return Gt(this.contents).filter((function(e){return 0!==e.indexOf(zt.defaultPrefix)}))}},{key:"setTagPrefix",value:function(e,t){if("!"!==e[0]||"!"!==e[e.length-1])throw new Error("Handle must start and end with !");if(t){var n=this.tagPrefixes.find((function(t){return t.handle===e}));n?n.prefix=t:this.tagPrefixes.push({handle:e,prefix:t})}else this.tagPrefixes=this.tagPrefixes.filter((function(t){return t.handle!==e}))}},{key:"toJSON",value:function(e,t){var n=this,r=this.options,i=r.keepBlobsInJSON,o=r.mapAsMap,s=r.maxAliasCount,a=i&&("string"!=typeof e||!(this.contents instanceof ae)),l={doc:this,indentStep:" ",keep:a,mapAsMap:a&&!!o,maxAliasCount:s,stringify:Qt},c=Object.keys(this.anchors.map);c.length>0&&(l.anchors=new Map(c.map((function(e){return[n.anchors.map[e],{alias:[],aliasCount:0,count:1}]}))));var u=se(this.contents,e,l);if("function"==typeof t&&l.anchors){var p,d=S(l.anchors.values());try{for(d.s();!(p=d.n()).done;){var f=p.value,h=f.count;t(f.res,h)}}catch(m){d.e(m)}finally{d.f()}}return u}},{key:"toString",value:function(){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");var e=this.options.indent;if(!Number.isInteger(e)||e<=0){var t=JSON.stringify(e);throw new Error('"indent" option must be a positive integer, not '.concat(t))}this.setSchema();var n=[],r=!1;if(this.version){var i="%YAML 1.2";"yaml-1.1"===this.schema.name&&("1.0"===this.version?i="%YAML:1.0":"1.1"===this.version&&(i="%YAML 1.1")),n.push(i),r=!0}var o=this.listNonDefaultTags();this.tagPrefixes.forEach((function(e){var t=e.handle,i=e.prefix;o.some((function(e){return 0===e.indexOf(i)}))&&(n.push("%TAG ".concat(t," ").concat(i)),r=!0)})),(r||this.directivesEndMarker)&&n.push("---"),this.commentBefore&&(!r&&this.directivesEndMarker||n.unshift(""),n.unshift(this.commentBefore.replace(/^/gm,"#")));var s={anchors:Object.create(null),doc:this,indent:"",indentStep:" ".repeat(e),stringify:Qt},a=!1,l=null;if(this.contents){this.contents instanceof oe&&(this.contents.spaceBefore&&(r||this.directivesEndMarker)&&n.push(""),this.contents.commentBefore&&n.push(this.contents.commentBefore.replace(/^/gm,"#")),s.forceBlockIndent=!!this.comment,l=this.contents.comment);var c=l?null:function(){return a=!0},u=Qt(this.contents,s,(function(){return l=null}),c);n.push(ie(u,"",l))}else void 0!==this.contents&&n.push(Qt(this.contents,s));return this.comment&&(a&&!l||""===n[n.length-1]||n.push(""),n.push(this.comment.replace(/^/gm,"#"))),n.join("\n")+"\n"}}]),e}();a(Zt,"defaults",Wt);var en=function(e){l(n,e);var t=g(n);function n(e){return i(this,n),t.call(this,Object.assign({},Ut,e))}return n}(Zt);function tn(e,t){var n=re(e),r=new en(t).parse(n[0]);if(n.length>1){r.errors.unshift(new M(n[1],"Source contains multiple documents; please use YAML.parseAllDocuments()"))}return r}var nn={createNode:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;void 0===n&&"string"==typeof t&&(n=t,t=!0);var r=Object.assign({},Zt.defaults[Ut.version],Ut);return new zt(r).createNode(e,t,n)},defaultOptions:Ut,Document:en,parse:function(e,t){var n=tn(e,t);if(n.warnings.forEach((function(e){return dt(e)})),n.errors.length>0)throw n.errors[0];return n.toJSON()},parseAllDocuments:function(e,t){var n,r,i=[],o=S(re(e));try{for(o.s();!(r=o.n()).done;){var s=r.value,a=new en(t);a.parse(s,n),i.push(a),n=a}}catch(l){o.e(l)}finally{o.f()}return i},parseCST:re,parseDocument:tn,scalarOptions:qt,stringify:function(e,t){var n=new en(t);return n.contents=e,String(n)}}},3244:e=>{"use strict";e.exports={i8:"1.4.1"}}}]); \ No newline at end of file diff --git a/assets/js/180.266d3c72.js.LICENSE.txt b/assets/js/180.266d3c72.js.LICENSE.txt new file mode 100644 index 0000000..f32a035 --- /dev/null +++ b/assets/js/180.266d3c72.js.LICENSE.txt @@ -0,0 +1,101 @@ +/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ + +/*! + * Stickyfill -- `position: sticky` polyfill + * v. 1.1.1 | https://github.com/wilddeer/stickyfill + * Copyright Oleg Korsunsky | http://wd.dizaina.net/ + * + * MIT License + */ + +/*! + * lunr.Builder + * Copyright (C) 2020 Oliver Nightingale + */ + +/*! + * lunr.Index + * Copyright (C) 2020 Oliver Nightingale + */ + +/*! + * lunr.Pipeline + * Copyright (C) 2020 Oliver Nightingale + */ + +/*! + * lunr.Set + * Copyright (C) 2020 Oliver Nightingale + */ + +/*! + * lunr.TokenSet + * Copyright (C) 2020 Oliver Nightingale + */ + +/*! + * lunr.Vector + * Copyright (C) 2020 Oliver Nightingale + */ + +/*! + * lunr.stemmer + * Copyright (C) 2020 Oliver Nightingale + * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt + */ + +/*! + * lunr.stopWordFilter + * Copyright (C) 2020 Oliver Nightingale + */ + +/*! + * lunr.tokenizer + * Copyright (C) 2020 Oliver Nightingale + */ + +/*! + * lunr.trimmer + * Copyright (C) 2020 Oliver Nightingale + */ + +/*! + * lunr.utils + * Copyright (C) 2020 Oliver Nightingale + */ + +/*! + * perfect-scrollbar v1.5.3 + * Copyright 2021 Hyunje Jun, MDBootstrap and Contributors + * Licensed under MIT + */ + +/*! @license DOMPurify 2.4.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.7/LICENSE */ + +/*! For license information please see redoc.browser.lib.js.LICENSE.txt */ + +/*!*************************************************** +* mark.js v8.11.1 +* https://markjs.io/ +* Copyright (c) 2014–2018, Julian Kühnel +* Released under the MIT license https://git.io/vwTVl +*****************************************************/ + +/** + * Prism: Lightweight, robust, elegant syntax highlighting + * + * @license MIT <https://opensource.org/licenses/MIT> + * @author Lea Verou <https://lea.verou.me> + * @namespace + * @public + */ + +/** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9 + * Copyright (C) 2020 Oliver Nightingale + * @license MIT + */ diff --git a/assets/js/1a4e3797.2adc3808.js b/assets/js/1a4e3797.2adc3808.js deleted file mode 100644 index b80c578..0000000 --- a/assets/js/1a4e3797.2adc3808.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see 1a4e3797.2adc3808.js.LICENSE.txt */ -(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[7920],{7331:e=>{function t(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function n(e){return"object"==typeof e&&null!==e}function i(e){return void 0===e}e.exports=t,t.prototype._events=void 0,t.prototype._maxListeners=void 0,t.defaultMaxListeners=10,t.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},t.prototype.emit=function(e){var t,a,s,c,u,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||n(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var h=new Error('Uncaught, unspecified "error" event. ('+t+")");throw h.context=t,h}if(i(a=this._events[e]))return!1;if(r(a))switch(arguments.length){case 1:a.call(this);break;case 2:a.call(this,arguments[1]);break;case 3:a.call(this,arguments[1],arguments[2]);break;default:c=Array.prototype.slice.call(arguments,1),a.apply(this,c)}else if(n(a))for(c=Array.prototype.slice.call(arguments,1),s=(o=a.slice()).length,u=0;u<s;u++)o[u].apply(this,c);return!0},t.prototype.addListener=function(e,a){var s;if(!r(a))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,r(a.listener)?a.listener:a),this._events[e]?n(this._events[e])?this._events[e].push(a):this._events[e]=[this._events[e],a]:this._events[e]=a,n(this._events[e])&&!this._events[e].warned&&(s=i(this._maxListeners)?t.defaultMaxListeners:this._maxListeners)&&s>0&&this._events[e].length>s&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(e,t){if(!r(t))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},t.prototype.removeListener=function(e,t){var i,a,s,c;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(s=(i=this._events[e]).length,a=-1,i===t||r(i.listener)&&i.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(n(i)){for(c=s;c-- >0;)if(i[c]===t||i[c].listener&&i[c].listener===t){a=c;break}if(a<0)return this;1===i.length?(i.length=0,delete this._events[e]):i.splice(a,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},t.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},t.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},t.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},t.listenerCount=function(e,t){return e.listenerCount(t)}},8131:(e,t,r)=>{"use strict";var n=r(9374),i=r(7775),a=r(3076);function s(e,t,r){return new n(e,t,r)}s.version=r(4336),s.AlgoliaSearchHelper=n,s.SearchParameters=i,s.SearchResults=a,e.exports=s},8078:(e,t,r)=>{"use strict";var n=r(7331);function i(e,t){this.main=e,this.fn=t,this.lastResults=null}r(4853)(i,n),i.prototype.detach=function(){this.removeAllListeners(),this.main.detachDerivedHelper(this)},i.prototype.getModifiedState=function(e){return this.fn(e)},e.exports=i},2437:(e,t,r)=>{"use strict";var n=r(2344),i=r(9803),a=r(116),s={addRefinement:function(e,t,r){if(s.isRefined(e,t,r))return e;var i=""+r,a=e[t]?e[t].concat(i):[i],c={};return c[t]=a,n({},c,e)},removeRefinement:function(e,t,r){if(void 0===r)return s.clearRefinement(e,(function(e,r){return t===r}));var n=""+r;return s.clearRefinement(e,(function(e,r){return t===r&&n===e}))},toggleRefinement:function(e,t,r){if(void 0===r)throw new Error("toggleRefinement should be used with a value");return s.isRefined(e,t,r)?s.removeRefinement(e,t,r):s.addRefinement(e,t,r)},clearRefinement:function(e,t,r){if(void 0===t)return a(e)?{}:e;if("string"==typeof t)return i(e,[t]);if("function"==typeof t){var n=!1,s=Object.keys(e).reduce((function(i,a){var s=e[a]||[],c=s.filter((function(e){return!t(e,a,r)}));return c.length!==s.length&&(n=!0),i[a]=c,i}),{});return n?s:e}},isRefined:function(e,t,r){var n=!!e[t]&&e[t].length>0;if(void 0===r||!n)return n;var i=""+r;return-1!==e[t].indexOf(i)}};e.exports=s},7775:(e,t,r)=>{"use strict";var n=r(185),i=r(2344),a=r(2686),s=r(7888),c=r(8023),u=r(9803),o=r(116),h=r(6801),f=r(2437);function l(e,t){return Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((function(e,r){return l(t[r],e)})):e===t}function m(e){var t=e?m._parseNumbers(e):{};void 0===t.userToken||h(t.userToken)||console.warn("[algoliasearch-helper] The `userToken` parameter is invalid. This can lead to wrong analytics.\n - Format: [a-zA-Z0-9_-]{1,64}"),this.facets=t.facets||[],this.disjunctiveFacets=t.disjunctiveFacets||[],this.hierarchicalFacets=t.hierarchicalFacets||[],this.facetsRefinements=t.facetsRefinements||{},this.facetsExcludes=t.facetsExcludes||{},this.disjunctiveFacetsRefinements=t.disjunctiveFacetsRefinements||{},this.numericRefinements=t.numericRefinements||{},this.tagRefinements=t.tagRefinements||[],this.hierarchicalFacetsRefinements=t.hierarchicalFacetsRefinements||{};var r=this;Object.keys(t).forEach((function(e){var n=-1!==m.PARAMETERS.indexOf(e),i=void 0!==t[e];!n&&i&&(r[e]=t[e])}))}m.PARAMETERS=Object.keys(new m),m._parseNumbers=function(e){if(e instanceof m)return e;var t={};if(["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"].forEach((function(r){var n=e[r];if("string"==typeof n){var i=parseFloat(n);t[r]=isNaN(i)?n:i}})),Array.isArray(e.insideBoundingBox)&&(t.insideBoundingBox=e.insideBoundingBox.map((function(e){return Array.isArray(e)?e.map((function(e){return parseFloat(e)})):e}))),e.numericRefinements){var r={};Object.keys(e.numericRefinements).forEach((function(t){var n=e.numericRefinements[t]||{};r[t]={},Object.keys(n).forEach((function(e){var i=n[e].map((function(e){return Array.isArray(e)?e.map((function(e){return"string"==typeof e?parseFloat(e):e})):"string"==typeof e?parseFloat(e):e}));r[t][e]=i}))})),t.numericRefinements=r}return n({},e,t)},m.make=function(e){var t=new m(e);return(e.hierarchicalFacets||[]).forEach((function(e){if(e.rootPath){var r=t.getHierarchicalRefinement(e.name);r.length>0&&0!==r[0].indexOf(e.rootPath)&&(t=t.clearRefinements(e.name)),0===(r=t.getHierarchicalRefinement(e.name)).length&&(t=t.toggleHierarchicalFacetRefinement(e.name,e.rootPath))}})),t},m.validate=function(e,t){var r=t||{};return e.tagFilters&&r.tagRefinements&&r.tagRefinements.length>0?new Error("[Tags] Cannot switch from the managed tag API to the advanced API. It is probably an error, if it is really what you want, you should first clear the tags with clearTags method."):e.tagRefinements.length>0&&r.tagFilters?new Error("[Tags] Cannot switch from the advanced tag API to the managed API. It is probably an error, if it is not, you should first clear the tags with clearTags method."):e.numericFilters&&r.numericRefinements&&o(r.numericRefinements)?new Error("[Numeric filters] Can't switch from the advanced to the managed API. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):o(e.numericRefinements)&&r.numericFilters?new Error("[Numeric filters] Can't switch from the managed API to the advanced. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):null},m.prototype={constructor:m,clearRefinements:function(e){var t={numericRefinements:this._clearNumericRefinements(e),facetsRefinements:f.clearRefinement(this.facetsRefinements,e,"conjunctiveFacet"),facetsExcludes:f.clearRefinement(this.facetsExcludes,e,"exclude"),disjunctiveFacetsRefinements:f.clearRefinement(this.disjunctiveFacetsRefinements,e,"disjunctiveFacet"),hierarchicalFacetsRefinements:f.clearRefinement(this.hierarchicalFacetsRefinements,e,"hierarchicalFacet")};return t.numericRefinements===this.numericRefinements&&t.facetsRefinements===this.facetsRefinements&&t.facetsExcludes===this.facetsExcludes&&t.disjunctiveFacetsRefinements===this.disjunctiveFacetsRefinements&&t.hierarchicalFacetsRefinements===this.hierarchicalFacetsRefinements?this:this.setQueryParameters(t)},clearTags:function(){return void 0===this.tagFilters&&0===this.tagRefinements.length?this:this.setQueryParameters({tagFilters:void 0,tagRefinements:[]})},setIndex:function(e){return e===this.index?this:this.setQueryParameters({index:e})},setQuery:function(e){return e===this.query?this:this.setQueryParameters({query:e})},setPage:function(e){return e===this.page?this:this.setQueryParameters({page:e})},setFacets:function(e){return this.setQueryParameters({facets:e})},setDisjunctiveFacets:function(e){return this.setQueryParameters({disjunctiveFacets:e})},setHitsPerPage:function(e){return this.hitsPerPage===e?this:this.setQueryParameters({hitsPerPage:e})},setTypoTolerance:function(e){return this.typoTolerance===e?this:this.setQueryParameters({typoTolerance:e})},addNumericRefinement:function(e,t,r){var i=c(r);if(this.isNumericRefined(e,t,i))return this;var a=n({},this.numericRefinements);return a[e]=n({},a[e]),a[e][t]?(a[e][t]=a[e][t].slice(),a[e][t].push(i)):a[e][t]=[i],this.setQueryParameters({numericRefinements:a})},getConjunctiveRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsRefinements[e]||[]},getDisjunctiveRefinements:function(e){return this.isDisjunctiveFacet(e)&&this.disjunctiveFacetsRefinements[e]||[]},getHierarchicalRefinement:function(e){return this.hierarchicalFacetsRefinements[e]||[]},getExcludeRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsExcludes[e]||[]},removeNumericRefinement:function(e,t,r){return void 0!==r?this.isNumericRefined(e,t,r)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(n,i){return i===e&&n.op===t&&l(n.val,c(r))}))}):this:void 0!==t?this.isNumericRefined(e,t)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(r,n){return n===e&&r.op===t}))}):this:this.isNumericRefined(e)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(t,r){return r===e}))}):this},getNumericRefinements:function(e){return this.numericRefinements[e]||{}},getNumericRefinement:function(e,t){return this.numericRefinements[e]&&this.numericRefinements[e][t]},_clearNumericRefinements:function(e){if(void 0===e)return o(this.numericRefinements)?{}:this.numericRefinements;if("string"==typeof e)return u(this.numericRefinements,[e]);if("function"==typeof e){var t=!1,r=this.numericRefinements,n=Object.keys(r).reduce((function(n,i){var a=r[i],s={};return a=a||{},Object.keys(a).forEach((function(r){var n=a[r]||[],c=[];n.forEach((function(t){e({val:t,op:r},i,"numeric")||c.push(t)})),c.length!==n.length&&(t=!0),s[r]=c})),n[i]=s,n}),{});return t?n:this.numericRefinements}},addFacet:function(e){return this.isConjunctiveFacet(e)?this:this.setQueryParameters({facets:this.facets.concat([e])})},addDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this:this.setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.concat([e])})},addHierarchicalFacet:function(e){if(this.isHierarchicalFacet(e.name))throw new Error("Cannot declare two hierarchical facets with the same name: `"+e.name+"`");return this.setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.concat([e])})},addFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsRefinements,e,t)?this:this.setQueryParameters({facetsRefinements:f.addRefinement(this.facetsRefinements,e,t)})},addExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsExcludes,e,t)?this:this.setQueryParameters({facetsExcludes:f.addRefinement(this.facetsExcludes,e,t)})},addDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return f.isRefined(this.disjunctiveFacetsRefinements,e,t)?this:this.setQueryParameters({disjunctiveFacetsRefinements:f.addRefinement(this.disjunctiveFacetsRefinements,e,t)})},addTagRefinement:function(e){if(this.isTagRefined(e))return this;var t={tagRefinements:this.tagRefinements.concat(e)};return this.setQueryParameters(t)},removeFacet:function(e){return this.isConjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({facets:this.facets.filter((function(t){return t!==e}))}):this},removeDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.filter((function(t){return t!==e}))}):this},removeHierarchicalFacet:function(e){return this.isHierarchicalFacet(e)?this.clearRefinements(e).setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.filter((function(t){return t.name!==e}))}):this},removeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsRefinements,e,t)?this.setQueryParameters({facetsRefinements:f.removeRefinement(this.facetsRefinements,e,t)}):this},removeExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsExcludes,e,t)?this.setQueryParameters({facetsExcludes:f.removeRefinement(this.facetsExcludes,e,t)}):this},removeDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return f.isRefined(this.disjunctiveFacetsRefinements,e,t)?this.setQueryParameters({disjunctiveFacetsRefinements:f.removeRefinement(this.disjunctiveFacetsRefinements,e,t)}):this},removeTagRefinement:function(e){if(!this.isTagRefined(e))return this;var t={tagRefinements:this.tagRefinements.filter((function(t){return t!==e}))};return this.setQueryParameters(t)},toggleRefinement:function(e,t){return this.toggleFacetRefinement(e,t)},toggleFacetRefinement:function(e,t){if(this.isHierarchicalFacet(e))return this.toggleHierarchicalFacetRefinement(e,t);if(this.isConjunctiveFacet(e))return this.toggleConjunctiveFacetRefinement(e,t);if(this.isDisjunctiveFacet(e))return this.toggleDisjunctiveFacetRefinement(e,t);throw new Error("Cannot refine the undeclared facet "+e+"; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets")},toggleConjunctiveFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsRefinements:f.toggleRefinement(this.facetsRefinements,e,t)})},toggleExcludeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsExcludes:f.toggleRefinement(this.facetsExcludes,e,t)})},toggleDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return this.setQueryParameters({disjunctiveFacetsRefinements:f.toggleRefinement(this.disjunctiveFacetsRefinements,e,t)})},toggleHierarchicalFacetRefinement:function(e,t){if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration");var r=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),n={};return void 0!==this.hierarchicalFacetsRefinements[e]&&this.hierarchicalFacetsRefinements[e].length>0&&(this.hierarchicalFacetsRefinements[e][0]===t||0===this.hierarchicalFacetsRefinements[e][0].indexOf(t+r))?-1===t.indexOf(r)?n[e]=[]:n[e]=[t.slice(0,t.lastIndexOf(r))]:n[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:i({},n,this.hierarchicalFacetsRefinements)})},addHierarchicalFacetRefinement:function(e,t){if(this.isHierarchicalFacetRefined(e))throw new Error(e+" is already refined.");if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration.");var r={};return r[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:i({},r,this.hierarchicalFacetsRefinements)})},removeHierarchicalFacetRefinement:function(e){if(!this.isHierarchicalFacetRefined(e))return this;var t={};return t[e]=[],this.setQueryParameters({hierarchicalFacetsRefinements:i({},t,this.hierarchicalFacetsRefinements)})},toggleTagRefinement:function(e){return this.isTagRefined(e)?this.removeTagRefinement(e):this.addTagRefinement(e)},isDisjunctiveFacet:function(e){return this.disjunctiveFacets.indexOf(e)>-1},isHierarchicalFacet:function(e){return void 0!==this.getHierarchicalFacetByName(e)},isConjunctiveFacet:function(e){return this.facets.indexOf(e)>-1},isFacetRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&f.isRefined(this.facetsRefinements,e,t)},isExcludeRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&f.isRefined(this.facetsExcludes,e,t)},isDisjunctiveFacetRefined:function(e,t){return!!this.isDisjunctiveFacet(e)&&f.isRefined(this.disjunctiveFacetsRefinements,e,t)},isHierarchicalFacetRefined:function(e,t){if(!this.isHierarchicalFacet(e))return!1;var r=this.getHierarchicalRefinement(e);return t?-1!==r.indexOf(t):r.length>0},isNumericRefined:function(e,t,r){if(void 0===r&&void 0===t)return!!this.numericRefinements[e];var n=this.numericRefinements[e]&&void 0!==this.numericRefinements[e][t];if(void 0===r||!n)return n;var i,a,u=c(r),o=void 0!==(i=this.numericRefinements[e][t],a=u,s(i,(function(e){return l(e,a)})));return n&&o},isTagRefined:function(e){return-1!==this.tagRefinements.indexOf(e)},getRefinedDisjunctiveFacets:function(){var e=this,t=a(Object.keys(this.numericRefinements).filter((function(t){return Object.keys(e.numericRefinements[t]).length>0})),this.disjunctiveFacets);return Object.keys(this.disjunctiveFacetsRefinements).filter((function(t){return e.disjunctiveFacetsRefinements[t].length>0})).concat(t).concat(this.getRefinedHierarchicalFacets())},getRefinedHierarchicalFacets:function(){var e=this;return a(this.hierarchicalFacets.map((function(e){return e.name})),Object.keys(this.hierarchicalFacetsRefinements).filter((function(t){return e.hierarchicalFacetsRefinements[t].length>0})))},getUnrefinedDisjunctiveFacets:function(){var e=this.getRefinedDisjunctiveFacets();return this.disjunctiveFacets.filter((function(t){return-1===e.indexOf(t)}))},managedParameters:["index","facets","disjunctiveFacets","facetsRefinements","hierarchicalFacets","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacetsRefinements"],getQueryParams:function(){var e=this.managedParameters,t={},r=this;return Object.keys(this).forEach((function(n){var i=r[n];-1===e.indexOf(n)&&void 0!==i&&(t[n]=i)})),t},setQueryParameter:function(e,t){if(this[e]===t)return this;var r={};return r[e]=t,this.setQueryParameters(r)},setQueryParameters:function(e){if(!e)return this;var t=m.validate(this,e);if(t)throw t;var r=this,n=m._parseNumbers(e),i=Object.keys(this).reduce((function(e,t){return e[t]=r[t],e}),{}),a=Object.keys(n).reduce((function(e,t){var r=void 0!==e[t],i=void 0!==n[t];return r&&!i?u(e,[t]):(i&&(e[t]=n[t]),e)}),i);return new this.constructor(a)},resetPage:function(){return void 0===this.page?this:this.setPage(0)},_getHierarchicalFacetSortBy:function(e){return e.sortBy||["isRefined:desc","name:asc"]},_getHierarchicalFacetSeparator:function(e){return e.separator||" > "},_getHierarchicalRootPath:function(e){return e.rootPath||null},_getHierarchicalShowParentLevel:function(e){return"boolean"!=typeof e.showParentLevel||e.showParentLevel},getHierarchicalFacetByName:function(e){return s(this.hierarchicalFacets,(function(t){return t.name===e}))},getHierarchicalFacetBreadcrumb:function(e){if(!this.isHierarchicalFacet(e))return[];var t=this.getHierarchicalRefinement(e)[0];if(!t)return[];var r=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e));return t.split(r).map((function(e){return e.trim()}))},toString:function(){return JSON.stringify(this,null,2)}},e.exports=m},210:(e,t,r)=>{"use strict";e.exports=function(e){return function(t,r){var s=e.hierarchicalFacets[r],o=e.hierarchicalFacetsRefinements[s.name]&&e.hierarchicalFacetsRefinements[s.name][0]||"",h=e._getHierarchicalFacetSeparator(s),f=e._getHierarchicalRootPath(s),l=e._getHierarchicalShowParentLevel(s),m=a(e._getHierarchicalFacetSortBy(s)),d=t.every((function(e){return e.exhaustive})),p=function(e,t,r,a,s){return function(o,h,f){var l=o;if(f>0){var m=0;for(l=o;m<f;){var d=l&&Array.isArray(l.data)?l.data:[];l=i(d,(function(e){return e.isRefined})),m++}}if(l){var p=Object.keys(h.data).map((function(e){return[e,h.data[e]]})).filter((function(e){return function(e,t,r,n,i,a){if(i&&(0!==e.indexOf(i)||i===e))return!1;return!i&&-1===e.indexOf(n)||i&&e.split(n).length-i.split(n).length==1||-1===e.indexOf(n)&&-1===r.indexOf(n)||0===r.indexOf(e)||0===e.indexOf(t+n)&&(a||0===e.indexOf(r))}(e[0],l.path||r,s,t,r,a)}));l.data=n(p.map((function(e){var r=e[0];return function(e,t,r,n,i){var a=t.split(r);return{name:a[a.length-1].trim(),path:t,escapedValue:c(t),count:e,isRefined:n===t||0===n.indexOf(t+r),exhaustive:i,data:null}}(e[1],r,t,u(s),h.exhaustive)})),e[0],e[1])}return o}}(m,h,f,l,o),v=t;return f&&(v=t.slice(f.split(h).length)),v.reduce(p,{name:e.hierarchicalFacets[r].name,count:null,isRefined:!0,path:null,escapedValue:null,exhaustive:d,data:null})}};var n=r(2148),i=r(7888),a=r(2293),s=r(4039),c=s.escapeFacetValue,u=s.unescapeFacetValue},3076:(e,t,r)=>{"use strict";var n=r(185),i=r(2344),a=r(2148),s=r(4587),c=r(7888),u=r(9725),o=r(2293),h=r(4039),f=h.escapeFacetValue,l=h.unescapeFacetValue,m=r(210);function d(e){var t={};return e.forEach((function(e,r){t[e]=r})),t}function p(e,t,r){t&&t[r]&&(e.stats=t[r])}function v(e,t,r){var a=t[0];this._rawResults=t;var o=this;Object.keys(a).forEach((function(e){o[e]=a[e]})),Object.keys(r||{}).forEach((function(e){o[e]=r[e]})),this.processingTimeMS=t.reduce((function(e,t){return void 0===t.processingTimeMS?e:e+t.processingTimeMS}),0),this.disjunctiveFacets=[],this.hierarchicalFacets=e.hierarchicalFacets.map((function(){return[]})),this.facets=[];var h=e.getRefinedDisjunctiveFacets(),f=d(e.facets),v=d(e.disjunctiveFacets),g=1,y=a.facets||{};Object.keys(y).forEach((function(t){var r,n,i=y[t],s=(r=e.hierarchicalFacets,n=t,c(r,(function(e){return(e.attributes||[]).indexOf(n)>-1})));if(s){var h=s.attributes.indexOf(t),l=u(e.hierarchicalFacets,(function(e){return e.name===s.name}));o.hierarchicalFacets[l][h]={attribute:t,data:i,exhaustive:a.exhaustiveFacetsCount}}else{var m,d=-1!==e.disjunctiveFacets.indexOf(t),g=-1!==e.facets.indexOf(t);d&&(m=v[t],o.disjunctiveFacets[m]={name:t,data:i,exhaustive:a.exhaustiveFacetsCount},p(o.disjunctiveFacets[m],a.facets_stats,t)),g&&(m=f[t],o.facets[m]={name:t,data:i,exhaustive:a.exhaustiveFacetsCount},p(o.facets[m],a.facets_stats,t))}})),this.hierarchicalFacets=s(this.hierarchicalFacets),h.forEach((function(r){var s=t[g],c=s&&s.facets?s.facets:{},h=e.getHierarchicalFacetByName(r);Object.keys(c).forEach((function(t){var r,f=c[t];if(h){r=u(e.hierarchicalFacets,(function(e){return e.name===h.name}));var m=u(o.hierarchicalFacets[r],(function(e){return e.attribute===t}));if(-1===m)return;o.hierarchicalFacets[r][m].data=n({},o.hierarchicalFacets[r][m].data,f)}else{r=v[t];var d=a.facets&&a.facets[t]||{};o.disjunctiveFacets[r]={name:t,data:i({},f,d),exhaustive:s.exhaustiveFacetsCount},p(o.disjunctiveFacets[r],s.facets_stats,t),e.disjunctiveFacetsRefinements[t]&&e.disjunctiveFacetsRefinements[t].forEach((function(n){!o.disjunctiveFacets[r].data[n]&&e.disjunctiveFacetsRefinements[t].indexOf(l(n))>-1&&(o.disjunctiveFacets[r].data[n]=0)}))}})),g++})),e.getRefinedHierarchicalFacets().forEach((function(r){var n=e.getHierarchicalFacetByName(r),a=e._getHierarchicalFacetSeparator(n),s=e.getHierarchicalRefinement(r);0===s.length||s[0].split(a).length<2||t.slice(g).forEach((function(t){var r=t&&t.facets?t.facets:{};Object.keys(r).forEach((function(t){var c=r[t],h=u(e.hierarchicalFacets,(function(e){return e.name===n.name})),f=u(o.hierarchicalFacets[h],(function(e){return e.attribute===t}));if(-1!==f){var l={};if(s.length>0){var m=s[0].split(a)[0];l[m]=o.hierarchicalFacets[h][f].data[m]}o.hierarchicalFacets[h][f].data=i(l,c,o.hierarchicalFacets[h][f].data)}})),g++}))})),Object.keys(e.facetsExcludes).forEach((function(t){var r=e.facetsExcludes[t],n=f[t];o.facets[n]={name:t,data:a.facets[t],exhaustive:a.exhaustiveFacetsCount},r.forEach((function(e){o.facets[n]=o.facets[n]||{name:t},o.facets[n].data=o.facets[n].data||{},o.facets[n].data[e]=0}))})),this.hierarchicalFacets=this.hierarchicalFacets.map(m(e)),this.facets=s(this.facets),this.disjunctiveFacets=s(this.disjunctiveFacets),this._state=e}function g(e,t){function r(e){return e.name===t}if(e._state.isConjunctiveFacet(t)){var n=c(e.facets,r);return n?Object.keys(n.data).map((function(r){var i=f(r);return{name:r,escapedValue:i,count:n.data[r],isRefined:e._state.isFacetRefined(t,i),isExcluded:e._state.isExcludeRefined(t,r)}})):[]}if(e._state.isDisjunctiveFacet(t)){var i=c(e.disjunctiveFacets,r);return i?Object.keys(i.data).map((function(r){var n=f(r);return{name:r,escapedValue:n,count:i.data[r],isRefined:e._state.isDisjunctiveFacetRefined(t,n)}})):[]}if(e._state.isHierarchicalFacet(t)){var a=c(e.hierarchicalFacets,r);if(!a)return a;var s=e._state.getHierarchicalFacetByName(t),u=l(e._state.getHierarchicalRefinement(t)[0]||"").split(e._state._getHierarchicalFacetSeparator(s));return u.unshift(t),y(a,u,0),a}}function y(e,t,r){e.isRefined=e.name===t[r],e.data&&e.data.forEach((function(e){y(e,t,r+1)}))}function R(e,t,r,n){if(n=n||0,Array.isArray(t))return e(t,r[n]);if(!t.data||0===t.data.length)return t;var a=t.data.map((function(t){return R(e,t,r,n+1)})),s=e(a,r[n]);return i({data:s},t)}function F(e,t){var r=c(e,(function(e){return e.name===t}));return r&&r.stats}function b(e,t,r,n,i){var a=c(i,(function(e){return e.name===r})),s=a&&a.data&&a.data[n]?a.data[n]:0,u=a&&a.exhaustive||!1;return{type:t,attributeName:r,name:n,count:s,exhaustive:u}}v.prototype.getFacetByName=function(e){function t(t){return t.name===e}return c(this.facets,t)||c(this.disjunctiveFacets,t)||c(this.hierarchicalFacets,t)},v.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"],v.prototype.getFacetValues=function(e,t){var r=g(this,e);if(r){var n,s=i({},t,{sortBy:v.DEFAULT_SORT,facetOrdering:!(t&&t.sortBy)}),c=this;if(Array.isArray(r))n=[e];else n=c._state.getHierarchicalFacetByName(r.name).attributes;return R((function(e,t){if(s.facetOrdering){var r=function(e,t){return e.renderingContent&&e.renderingContent.facetOrdering&&e.renderingContent.facetOrdering.values&&e.renderingContent.facetOrdering.values[t]}(c,t);if(Boolean(r))return function(e,t){var r=[],n=[],i=(t.order||[]).reduce((function(e,t,r){return e[t]=r,e}),{});e.forEach((function(e){var t=e.path||e.name;void 0!==i[t]?r[i[t]]=e:n.push(e)})),r=r.filter((function(e){return e}));var s,c=t.sortRemainingBy;return"hidden"===c?r:(s="alpha"===c?[["path","name"],["asc","asc"]]:[["count"],["desc"]],r.concat(a(n,s[0],s[1])))}(e,r)}if(Array.isArray(s.sortBy)){var n=o(s.sortBy,v.DEFAULT_SORT);return a(e,n[0],n[1])}if("function"==typeof s.sortBy)return function(e,t){return t.sort(e)}(s.sortBy,e);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")}),r,n)}},v.prototype.getFacetStats=function(e){return this._state.isConjunctiveFacet(e)?F(this.facets,e):this._state.isDisjunctiveFacet(e)?F(this.disjunctiveFacets,e):void 0},v.prototype.getRefinements=function(){var e=this._state,t=this,r=[];return Object.keys(e.facetsRefinements).forEach((function(n){e.facetsRefinements[n].forEach((function(i){r.push(b(e,"facet",n,i,t.facets))}))})),Object.keys(e.facetsExcludes).forEach((function(n){e.facetsExcludes[n].forEach((function(i){r.push(b(e,"exclude",n,i,t.facets))}))})),Object.keys(e.disjunctiveFacetsRefinements).forEach((function(n){e.disjunctiveFacetsRefinements[n].forEach((function(i){r.push(b(e,"disjunctive",n,i,t.disjunctiveFacets))}))})),Object.keys(e.hierarchicalFacetsRefinements).forEach((function(n){e.hierarchicalFacetsRefinements[n].forEach((function(i){r.push(function(e,t,r,n){var i=e.getHierarchicalFacetByName(t),a=e._getHierarchicalFacetSeparator(i),s=r.split(a),u=c(n,(function(e){return e.name===t})),o=s.reduce((function(e,t){var r=e&&c(e.data,(function(e){return e.name===t}));return void 0!==r?r:e}),u),h=o&&o.count||0,f=o&&o.exhaustive||!1,l=o&&o.path||"";return{type:"hierarchical",attributeName:t,name:l,count:h,exhaustive:f}}(e,n,i,t.hierarchicalFacets))}))})),Object.keys(e.numericRefinements).forEach((function(t){var n=e.numericRefinements[t];Object.keys(n).forEach((function(e){n[e].forEach((function(n){r.push({type:"numeric",attributeName:t,name:n,numericValue:n,operator:e})}))}))})),e.tagRefinements.forEach((function(e){r.push({type:"tag",attributeName:"_tags",name:e})})),r},e.exports=v},9374:(e,t,r)=>{"use strict";var n=r(7775),i=r(3076),a=r(8078),s=r(6394),c=r(7331),u=r(4853),o=r(116),h=r(9803),f=r(185),l=r(4336),m=r(4039).escapeFacetValue;function d(e,t,r){"function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper ("+l+")"),this.setClient(e);var i=r||{};i.index=t,this.state=n.make(i),this.lastResults=null,this._queryId=0,this._lastQueryIdReceived=-1,this.derivedHelpers=[],this._currentNbQueries=0}function p(e){if(e<0)throw new Error("Page requested below 0.");return this._change({state:this.state.setPage(e),isPageReset:!1}),this}function v(){return this.state.page}u(d,c),d.prototype.search=function(){return this._search({onlyWithDerivedHelpers:!1}),this},d.prototype.searchOnlyWithDerivedHelpers=function(){return this._search({onlyWithDerivedHelpers:!0}),this},d.prototype.getQuery=function(){var e=this.state;return s._getHitsSearchParams(e)},d.prototype.searchOnce=function(e,t){var r=e?this.state.setQueryParameters(e):this.state,n=s._getQueries(r.index,r),a=this;if(this._currentNbQueries++,this.emit("searchOnce",{state:r}),!t)return this.client.search(n).then((function(e){return a._currentNbQueries--,0===a._currentNbQueries&&a.emit("searchQueueEmpty"),{content:new i(r,e.results),state:r,_originalResponse:e}}),(function(e){throw a._currentNbQueries--,0===a._currentNbQueries&&a.emit("searchQueueEmpty"),e}));this.client.search(n).then((function(e){a._currentNbQueries--,0===a._currentNbQueries&&a.emit("searchQueueEmpty"),t(null,new i(r,e.results),r)})).catch((function(e){a._currentNbQueries--,0===a._currentNbQueries&&a.emit("searchQueueEmpty"),t(e,null,r)}))},d.prototype.findAnswers=function(e){console.warn("[algoliasearch-helper] answers is no longer supported");var t=this.state,r=this.derivedHelpers[0];if(!r)return Promise.resolve([]);var n=r.getModifiedState(t),i=f({attributesForPrediction:e.attributesForPrediction,nbHits:e.nbHits},{params:h(s._getHitsSearchParams(n),["attributesToSnippet","hitsPerPage","restrictSearchableAttributes","snippetEllipsisText"])}),a="search for answers was called, but this client does not have a function client.initIndex(index).findAnswers";if("function"!=typeof this.client.initIndex)throw new Error(a);var c=this.client.initIndex(n.index);if("function"!=typeof c.findAnswers)throw new Error(a);return c.findAnswers(n.query,e.queryLanguages,i)},d.prototype.searchForFacetValues=function(e,t,r,n){var i="function"==typeof this.client.searchForFacetValues,a="function"==typeof this.client.initIndex;if(!i&&!a&&"function"!=typeof this.client.search)throw new Error("search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues or client.initIndex(index).searchForFacetValues");var c=this.state.setQueryParameters(n||{}),u=c.isDisjunctiveFacet(e),o=s.getSearchForFacetQuery(e,t,r,c);this._currentNbQueries++;var h,f=this;return i?h=this.client.searchForFacetValues([{indexName:c.index,params:o}]):a?h=this.client.initIndex(c.index).searchForFacetValues(o):(delete o.facetName,h=this.client.search([{type:"facet",facet:e,indexName:c.index,params:o}]).then((function(e){return e.results[0]}))),this.emit("searchForFacetValues",{state:c,facet:e,query:t}),h.then((function(t){return f._currentNbQueries--,0===f._currentNbQueries&&f.emit("searchQueueEmpty"),(t=Array.isArray(t)?t[0]:t).facetHits.forEach((function(t){t.escapedValue=m(t.value),t.isRefined=u?c.isDisjunctiveFacetRefined(e,t.escapedValue):c.isFacetRefined(e,t.escapedValue)})),t}),(function(e){throw f._currentNbQueries--,0===f._currentNbQueries&&f.emit("searchQueueEmpty"),e}))},d.prototype.setQuery=function(e){return this._change({state:this.state.resetPage().setQuery(e),isPageReset:!0}),this},d.prototype.clearRefinements=function(e){return this._change({state:this.state.resetPage().clearRefinements(e),isPageReset:!0}),this},d.prototype.clearTags=function(){return this._change({state:this.state.resetPage().clearTags(),isPageReset:!0}),this},d.prototype.addDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)},d.prototype.addHierarchicalFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addHierarchicalFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.addNumericRefinement=function(e,t,r){return this._change({state:this.state.resetPage().addNumericRefinement(e,t,r),isPageReset:!0}),this},d.prototype.addFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)},d.prototype.addFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().addExcludeRefinement(e,t),isPageReset:!0}),this},d.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)},d.prototype.addTag=function(e){return this._change({state:this.state.resetPage().addTagRefinement(e),isPageReset:!0}),this},d.prototype.removeNumericRefinement=function(e,t,r){return this._change({state:this.state.resetPage().removeNumericRefinement(e,t,r),isPageReset:!0}),this},d.prototype.removeDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)},d.prototype.removeHierarchicalFacetRefinement=function(e){return this._change({state:this.state.resetPage().removeHierarchicalFacetRefinement(e),isPageReset:!0}),this},d.prototype.removeFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)},d.prototype.removeFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().removeExcludeRefinement(e,t),isPageReset:!0}),this},d.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)},d.prototype.removeTag=function(e){return this._change({state:this.state.resetPage().removeTagRefinement(e),isPageReset:!0}),this},d.prototype.toggleFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().toggleExcludeFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)},d.prototype.toggleRefinement=function(e,t){return this.toggleFacetRefinement(e,t)},d.prototype.toggleFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().toggleFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.toggleRefine=function(){return this.toggleFacetRefinement.apply(this,arguments)},d.prototype.toggleTag=function(e){return this._change({state:this.state.resetPage().toggleTagRefinement(e),isPageReset:!0}),this},d.prototype.nextPage=function(){var e=this.state.page||0;return this.setPage(e+1)},d.prototype.previousPage=function(){var e=this.state.page||0;return this.setPage(e-1)},d.prototype.setCurrentPage=p,d.prototype.setPage=p,d.prototype.setIndex=function(e){return this._change({state:this.state.resetPage().setIndex(e),isPageReset:!0}),this},d.prototype.setQueryParameter=function(e,t){return this._change({state:this.state.resetPage().setQueryParameter(e,t),isPageReset:!0}),this},d.prototype.setState=function(e){return this._change({state:n.make(e),isPageReset:!1}),this},d.prototype.overrideStateWithoutTriggeringChangeEvent=function(e){return this.state=new n(e),this},d.prototype.hasRefinements=function(e){return!!o(this.state.getNumericRefinements(e))||(this.state.isConjunctiveFacet(e)?this.state.isFacetRefined(e):this.state.isDisjunctiveFacet(e)?this.state.isDisjunctiveFacetRefined(e):!!this.state.isHierarchicalFacet(e)&&this.state.isHierarchicalFacetRefined(e))},d.prototype.isExcluded=function(e,t){return this.state.isExcludeRefined(e,t)},d.prototype.isDisjunctiveRefined=function(e,t){return this.state.isDisjunctiveFacetRefined(e,t)},d.prototype.hasTag=function(e){return this.state.isTagRefined(e)},d.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)},d.prototype.getIndex=function(){return this.state.index},d.prototype.getCurrentPage=v,d.prototype.getPage=v,d.prototype.getTags=function(){return this.state.tagRefinements},d.prototype.getRefinements=function(e){var t=[];if(this.state.isConjunctiveFacet(e))this.state.getConjunctiveRefinements(e).forEach((function(e){t.push({value:e,type:"conjunctive"})})),this.state.getExcludeRefinements(e).forEach((function(e){t.push({value:e,type:"exclude"})}));else if(this.state.isDisjunctiveFacet(e)){this.state.getDisjunctiveRefinements(e).forEach((function(e){t.push({value:e,type:"disjunctive"})}))}var r=this.state.getNumericRefinements(e);return Object.keys(r).forEach((function(e){var n=r[e];t.push({value:n,operator:e,type:"numeric"})})),t},d.prototype.getNumericRefinement=function(e,t){return this.state.getNumericRefinement(e,t)},d.prototype.getHierarchicalFacetBreadcrumb=function(e){return this.state.getHierarchicalFacetBreadcrumb(e)},d.prototype._search=function(e){var t=this.state,r=[],n=[];e.onlyWithDerivedHelpers||(n=s._getQueries(t.index,t),r.push({state:t,queriesCount:n.length,helper:this}),this.emit("search",{state:t,results:this.lastResults}));var i=this.derivedHelpers.map((function(e){var n=e.getModifiedState(t),i=s._getQueries(n.index,n);return r.push({state:n,queriesCount:i.length,helper:e}),e.emit("search",{state:n,results:e.lastResults}),i})),a=Array.prototype.concat.apply(n,i),c=this._queryId++;this._currentNbQueries++;try{this.client.search(a).then(this._dispatchAlgoliaResponse.bind(this,r,c)).catch(this._dispatchAlgoliaError.bind(this,c))}catch(u){this.emit("error",{error:u})}},d.prototype._dispatchAlgoliaResponse=function(e,t,r){if(!(t<this._lastQueryIdReceived)){this._currentNbQueries-=t-this._lastQueryIdReceived,this._lastQueryIdReceived=t,0===this._currentNbQueries&&this.emit("searchQueueEmpty");var n=r.results.slice();e.forEach((function(e){var t=e.state,r=e.queriesCount,a=e.helper,s=n.splice(0,r),c=a.lastResults=new i(t,s);a.emit("result",{results:c,state:t})}))}},d.prototype._dispatchAlgoliaError=function(e,t){e<this._lastQueryIdReceived||(this._currentNbQueries-=e-this._lastQueryIdReceived,this._lastQueryIdReceived=e,this.emit("error",{error:t}),0===this._currentNbQueries&&this.emit("searchQueueEmpty"))},d.prototype.containsRefinement=function(e,t,r,n){return e||0!==t.length||0!==r.length||0!==n.length},d.prototype._hasDisjunctiveRefinements=function(e){return this.state.disjunctiveRefinements[e]&&this.state.disjunctiveRefinements[e].length>0},d.prototype._change=function(e){var t=e.state,r=e.isPageReset;t!==this.state&&(this.state=t,this.emit("change",{state:this.state,results:this.lastResults,isPageReset:r}))},d.prototype.clearCache=function(){return this.client.clearCache&&this.client.clearCache(),this},d.prototype.setClient=function(e){return this.client===e||("function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper ("+l+")"),this.client=e),this},d.prototype.getClient=function(){return this.client},d.prototype.derive=function(e){var t=new a(this,e);return this.derivedHelpers.push(t),t},d.prototype.detachDerivedHelper=function(e){var t=this.derivedHelpers.indexOf(e);if(-1===t)throw new Error("Derived helper already detached");this.derivedHelpers.splice(t,1)},d.prototype.hasPendingRequests=function(){return this._currentNbQueries>0},e.exports=d},4587:e=>{"use strict";e.exports=function(e){return Array.isArray(e)?e.filter(Boolean):[]}},2344:e=>{"use strict";e.exports=function(){var e=Array.prototype.slice.call(arguments);return e.reduceRight((function(e,t){return Object.keys(Object(t)).forEach((function(r){void 0!==t[r]&&(void 0!==e[r]&&delete e[r],e[r]=t[r])})),e}),{})}},4039:e=>{"use strict";e.exports={escapeFacetValue:function(e){return"string"!=typeof e?e:String(e).replace(/^-/,"\\-")},unescapeFacetValue:function(e){return"string"!=typeof e?e:e.replace(/^\\-/,"-")}}},7888:e=>{"use strict";e.exports=function(e,t){if(Array.isArray(e))for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}},9725:e=>{"use strict";e.exports=function(e,t){if(!Array.isArray(e))return-1;for(var r=0;r<e.length;r++)if(t(e[r]))return r;return-1}},2293:(e,t,r)=>{"use strict";var n=r(7888);e.exports=function(e,t){var r=(t||[]).map((function(e){return e.split(":")}));return e.reduce((function(e,t){var i=t.split(":"),a=n(r,(function(e){return e[0]===i[0]}));return i.length>1||!a?(e[0].push(i[0]),e[1].push(i[1]),e):(e[0].push(a[0]),e[1].push(a[1]),e)}),[[],[]])}},4853:e=>{"use strict";e.exports=function(e,t){e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}},2686:e=>{"use strict";e.exports=function(e,t){return e.filter((function(r,n){return t.indexOf(r)>-1&&e.indexOf(r)===n}))}},185:e=>{"use strict";function t(e){return"function"==typeof e||Array.isArray(e)||"[object Object]"===Object.prototype.toString.call(e)}function r(e,n){if(e===n)return e;for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&"__proto__"!==i&&"constructor"!==i){var a=n[i],s=e[i];void 0!==s&&void 0===a||(t(s)&&t(a)?e[i]=r(s,a):e[i]="object"==typeof(c=a)&&null!==c?r(Array.isArray(c)?[]:{},c):c)}var c;return e}e.exports=function(e){t(e)||(e={});for(var n=1,i=arguments.length;n<i;n++){var a=arguments[n];t(a)&&r(e,a)}return e}},116:e=>{"use strict";e.exports=function(e){return e&&Object.keys(e).length>0}},9803:e=>{"use strict";e.exports=function(e,t){if(null===e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}},2148:e=>{"use strict";function t(e,t){if(e!==t){var r=void 0!==e,n=null===e,i=void 0!==t,a=null===t;if(!a&&e>t||n&&i||!r)return 1;if(!n&&e<t||a&&r||!i)return-1}return 0}e.exports=function(e,r,n){if(!Array.isArray(e))return[];Array.isArray(n)||(n=[]);var i=e.map((function(e,t){return{criteria:r.map((function(t){return e[t]})),index:t,value:e}}));return i.sort((function(e,r){for(var i=-1;++i<e.criteria.length;){var a=t(e.criteria[i],r.criteria[i]);if(a)return i>=n.length?a:"desc"===n[i]?-a:a}return e.index-r.index})),i.map((function(e){return e.value}))}},8023:e=>{"use strict";e.exports=function e(t){if("number"==typeof t)return t;if("string"==typeof t)return parseFloat(t);if(Array.isArray(t))return t.map(e);throw new Error("The value should be a number, a parsable string or an array of those.")}},6394:(e,t,r)=>{"use strict";var n=r(185);function i(e){return Object.keys(e).sort((function(e,t){return e.localeCompare(t)})).reduce((function(t,r){return t[r]=e[r],t}),{})}var a={_getQueries:function(e,t){var r=[];return r.push({indexName:e,params:a._getHitsSearchParams(t)}),t.getRefinedDisjunctiveFacets().forEach((function(n){r.push({indexName:e,params:a._getDisjunctiveFacetSearchParams(t,n)})})),t.getRefinedHierarchicalFacets().forEach((function(n){var i=t.getHierarchicalFacetByName(n),s=t.getHierarchicalRefinement(n),c=t._getHierarchicalFacetSeparator(i);if(s.length>0&&s[0].split(c).length>1){var u=s[0].split(c).slice(0,-1).reduce((function(e,t,r){return e.concat({attribute:i.attributes[r],value:0===r?t:[e[e.length-1].value,t].join(c)})}),[]);u.forEach((function(n,s){var c=a._getDisjunctiveFacetSearchParams(t,n.attribute,0===s);function o(e){return i.attributes.some((function(t){return t===e.split(":")[0]}))}var h=(c.facetFilters||[]).reduce((function(e,t){if(Array.isArray(t)){var r=t.filter((function(e){return!o(e)}));r.length>0&&e.push(r)}return"string"!=typeof t||o(t)||e.push(t),e}),[]),f=u[s-1];c.facetFilters=s>0?h.concat(f.attribute+":"+f.value):h.length>0?h:void 0,r.push({indexName:e,params:c})}))}})),r},_getHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets).concat(a._getHitsHierarchicalFacetsAttributes(e)),r=a._getFacetFilters(e),s=a._getNumericFilters(e),c=a._getTagFilters(e),u={facets:t.indexOf("*")>-1?["*"]:t,tagFilters:c};return r.length>0&&(u.facetFilters=r),s.length>0&&(u.numericFilters=s),i(n({},e.getQueryParams(),u))},_getDisjunctiveFacetSearchParams:function(e,t,r){var s=a._getFacetFilters(e,t,r),c=a._getNumericFilters(e,t),u=a._getTagFilters(e),o={hitsPerPage:0,page:0,analytics:!1,clickAnalytics:!1};u.length>0&&(o.tagFilters=u);var h=e.getHierarchicalFacetByName(t);return o.facets=h?a._getDisjunctiveHierarchicalFacetAttribute(e,h,r):t,c.length>0&&(o.numericFilters=c),s.length>0&&(o.facetFilters=s),i(n({},e.getQueryParams(),o))},_getNumericFilters:function(e,t){if(e.numericFilters)return e.numericFilters;var r=[];return Object.keys(e.numericRefinements).forEach((function(n){var i=e.numericRefinements[n]||{};Object.keys(i).forEach((function(e){var a=i[e]||[];t!==n&&a.forEach((function(t){if(Array.isArray(t)){var i=t.map((function(t){return n+e+t}));r.push(i)}else r.push(n+e+t)}))}))})),r},_getTagFilters:function(e){return e.tagFilters?e.tagFilters:e.tagRefinements.join(",")},_getFacetFilters:function(e,t,r){var n=[],i=e.facetsRefinements||{};Object.keys(i).forEach((function(e){(i[e]||[]).forEach((function(t){n.push(e+":"+t)}))}));var a=e.facetsExcludes||{};Object.keys(a).forEach((function(e){(a[e]||[]).forEach((function(t){n.push(e+":-"+t)}))}));var s=e.disjunctiveFacetsRefinements||{};Object.keys(s).forEach((function(e){var r=s[e]||[];if(e!==t&&r&&0!==r.length){var i=[];r.forEach((function(t){i.push(e+":"+t)})),n.push(i)}}));var c=e.hierarchicalFacetsRefinements||{};return Object.keys(c).forEach((function(i){var a=(c[i]||[])[0];if(void 0!==a){var s,u,o=e.getHierarchicalFacetByName(i),h=e._getHierarchicalFacetSeparator(o),f=e._getHierarchicalRootPath(o);if(t===i){if(-1===a.indexOf(h)||!f&&!0===r||f&&f.split(h).length===a.split(h).length)return;f?(u=f.split(h).length-1,a=f):(u=a.split(h).length-2,a=a.slice(0,a.lastIndexOf(h))),s=o.attributes[u]}else u=a.split(h).length-1,s=o.attributes[u];s&&n.push([s+":"+a])}})),n},_getHitsHierarchicalFacetsAttributes:function(e){return e.hierarchicalFacets.reduce((function(t,r){var n=e.getHierarchicalRefinement(r.name)[0];if(!n)return t.push(r.attributes[0]),t;var i=e._getHierarchicalFacetSeparator(r),a=n.split(i).length,s=r.attributes.slice(0,a+1);return t.concat(s)}),[])},_getDisjunctiveHierarchicalFacetAttribute:function(e,t,r){var n=e._getHierarchicalFacetSeparator(t);if(!0===r){var i=e._getHierarchicalRootPath(t),a=0;return i&&(a=i.split(n).length),[t.attributes[a]]}var s=(e.getHierarchicalRefinement(t.name)[0]||"").split(n).length-1;return t.attributes.slice(0,s+1)},getSearchForFacetQuery:function(e,t,r,s){var c=s.isDisjunctiveFacet(e)?s.clearRefinements(e):s,u={facetQuery:t,facetName:e};return"number"==typeof r&&(u.maxFacetHits=r),i(n({},a._getHitsSearchParams(c),u))}};e.exports=a},6801:e=>{"use strict";e.exports=function(e){return null!==e&&/^[a-zA-Z0-9_-]{1,64}$/.test(e)}},4336:e=>{"use strict";e.exports="3.12.0"},290:function(e){e.exports=function(){"use strict";function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(r){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){e(r,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))}))}return r}function n(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var s,c=e[Symbol.iterator]();!(n=(s=c.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==c.return||c.return()}finally{if(i)throw a}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function a(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function s(e){var t,r="algoliasearch-client-js-".concat(e.key),n=function(){return void 0===t&&(t=e.localStorage||window.localStorage),t},a=function(){return JSON.parse(n().getItem(r)||"{}")};return{get:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){var r=JSON.stringify(e),n=a()[r];return Promise.all([n||t(),void 0!==n])})).then((function(e){var t=i(e,2),n=t[0],a=t[1];return Promise.all([n,a||r.miss(n)])})).then((function(e){return i(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var i=a();return i[JSON.stringify(e)]=t,n().setItem(r,JSON.stringify(i)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=a();delete t[JSON.stringify(e)],n().setItem(r,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){n().removeItem(r)}))}}}function c(e){var t=a(e.caches),r=t.shift();return void 0===r?{get:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then((function(e){return Promise.all([e,r.miss(e)])})).then((function(e){return i(e,1)[0]}))},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return r.get(e,n,i).catch((function(){return c({caches:t}).get(e,n,i)}))},set:function(e,n){return r.set(e,n).catch((function(){return c({caches:t}).set(e,n)}))},delete:function(e){return r.delete(e).catch((function(){return c({caches:t}).delete(e)}))},clear:function(){return r.clear().catch((function(){return c({caches:t}).clear()}))}}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(r,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},a=JSON.stringify(r);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);var s=n(),c=i&&i.miss||function(){return Promise.resolve()};return s.then((function(e){return c(e)})).then((function(){return s}))},set:function(r,n){return t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function o(e){for(var t=e.length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function h(e,t){return t?(Object.keys(t).forEach((function(r){e[r]=t[r](e)})),e):e}function f(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=0;return e.replace(/%s/g,(function(){return encodeURIComponent(r[i++])}))}var l={WithinQueryParameters:0,WithinHeaders:1};function m(e,t){var r=e||{},n=r.data||{};return Object.keys(r).forEach((function(e){-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(n[e]=r[e])})),{data:Object.entries(n).length>0?n:void 0,timeout:r.timeout||t,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}var d={Read:1,Write:2,Any:3},p=1,v=2,g=3;function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;return r(r({},e),{},{status:t,lastUpdate:Date.now()})}function R(e){return"string"==typeof e?{protocol:"https",url:e,accept:d.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||d.Any}}var F="GET",b="POST";function P(e,t){return Promise.all(t.map((function(t){return e.get(t,(function(){return Promise.resolve(y(t))}))}))).then((function(e){var r=e.filter((function(e){return function(e){return e.status===p||Date.now()-e.lastUpdate>12e4}(e)})),n=e.filter((function(e){return function(e){return e.status===g&&Date.now()-e.lastUpdate<=12e4}(e)})),i=[].concat(a(r),a(n));return{getTimeout:function(e,t){return(0===n.length&&0===e?1:n.length+3+e)*t},statelessHosts:i.length>0?i.map((function(e){return R(e)})):t}}))}function j(e,t,n,i){var s=[],c=function(e,t){if(e.method!==F&&(void 0!==e.data||void 0!==t.data)){var n=Array.isArray(e.data)?e.data:r(r({},e.data),t.data);return JSON.stringify(n)}}(n,i),u=function(e,t){var n=r(r({},e.headers),t.headers),i={};return Object.keys(n).forEach((function(e){var t=n[e];i[e.toLowerCase()]=t})),i}(e,i),o=n.method,h=n.method!==F?{}:r(r({},n.data),i.data),f=r(r(r({"x-algolia-agent":e.userAgent.value},e.queryParameters),h),i.queryParameters),l=0,m=function t(r,a){var h=r.pop();if(void 0===h)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:w(s)};var m={data:c,headers:u,method:o,url:E(h,n.path,f),connectTimeout:a(l,e.timeouts.connect),responseTimeout:a(l,i.timeout)},d=function(e){var t={request:m,response:e,host:h,triesLeft:r.length};return s.push(t),t},p={onSuccess:function(e){return function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e)},onRetry:function(n){var i=d(n);return n.isTimedOut&&l++,Promise.all([e.logger.info("Retryable failure",O(i)),e.hostsCache.set(h,y(h,n.isTimedOut?g:v))]).then((function(){return t(r,a)}))},onFail:function(e){throw d(e),function(e,t){var r=e.content,n=e.status,i=r;try{i=JSON.parse(r).message}catch(e){}return function(e,t,r){return{name:"ApiError",message:e,status:t,transporterStackTrace:r}}(i,n,t)}(e,w(s))}};return e.requester.send(m).then((function(e){return function(e,t){return function(e){var t=e.status;return e.isTimedOut||function(e){var t=e.isTimedOut,r=e.status;return!t&&0==~~r}(e)||2!=~~(t/100)&&4!=~~(t/100)}(e)?t.onRetry(e):2==~~(e.status/100)?t.onSuccess(e):t.onFail(e)}(e,p)}))};return P(e.hostsCache,t).then((function(e){return m(a(e.statelessHosts).reverse(),e.getTimeout)}))}function _(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var r="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(r)&&(t.value="".concat(t.value).concat(r)),t}};return t}function E(e,t,r){var n=x(r),i="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return n.length&&(i+="?".concat(n)),i}function x(e){return Object.keys(e).map((function(t){return f("%s=%s",t,(r=e[t],"[object Object]"===Object.prototype.toString.call(r)||"[object Array]"===Object.prototype.toString.call(r)?JSON.stringify(e[t]):e[t]));var r})).join("&")}function w(e){return e.map((function(e){return O(e)}))}function O(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return r(r({},e),{},{request:r(r({},e.request),{},{headers:r(r({},e.request.headers),t)})})}var N=function(e){var t=e.appId,n=function(e,t,r){var n={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers:function(){return e===l.WithinHeaders?n:{}},queryParameters:function(){return e===l.WithinQueryParameters?n:{}}}}(void 0!==e.authMode?e.authMode:l.WithinHeaders,t,e.apiKey),a=function(e){var t=e.hostsCache,r=e.logger,n=e.requester,a=e.requestsCache,s=e.responsesCache,c=e.timeouts,u=e.userAgent,o=e.hosts,h=e.queryParameters,f={hostsCache:t,logger:r,requester:n,requestsCache:a,responsesCache:s,timeouts:c,userAgent:u,headers:e.headers,queryParameters:h,hosts:o.map((function(e){return R(e)})),read:function(e,t){var r=m(t,f.timeouts.read),n=function(){return j(f,f.hosts.filter((function(e){return 0!=(e.accept&d.Read)})),e,r)};if(!0!==(void 0!==r.cacheable?r.cacheable:e.cacheable))return n();var a={request:e,mappedRequestOptions:r,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(a,(function(){return f.requestsCache.get(a,(function(){return f.requestsCache.set(a,n()).then((function(e){return Promise.all([f.requestsCache.delete(a),e])}),(function(e){return Promise.all([f.requestsCache.delete(a),Promise.reject(e)])})).then((function(e){var t=i(e,2);return t[0],t[1]}))}))}),{miss:function(e){return f.responsesCache.set(a,e)}})},write:function(e,t){return j(f,f.hosts.filter((function(e){return 0!=(e.accept&d.Write)})),e,m(t,f.timeouts.write))}};return f}(r(r({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:d.Read},{url:"".concat(t,".algolia.net"),accept:d.Write}].concat(o([{url:"".concat(t,"-1.algolianet.com")},{url:"".concat(t,"-2.algolianet.com")},{url:"".concat(t,"-3.algolianet.com")}]))},e),{},{headers:r(r(r({},n.headers()),{"content-type":"application/x-www-form-urlencoded"}),e.headers),queryParameters:r(r({},n.queryParameters()),e.queryParameters)}));return h({transporter:a,appId:t,addAlgoliaAgent:function(e,t){a.userAgent.add({segment:e,version:t})},clearCache:function(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then((function(){}))}},e.methods)},A=function(e){return function(t,r){return t.method===F?e.transporter.read(t,r):e.transporter.write(t,r)}},H=function(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h({transporter:e.transporter,appId:e.appId,indexName:t},r.methods)}},S=function(e){return function(t,n){var i=t.map((function(e){return r(r({},e),{},{params:x(e.params||{})})}));return e.transporter.read({method:b,path:"1/indexes/*/queries",data:{requests:i},cacheable:!0},n)}},T=function(e){return function(t,i){return Promise.all(t.map((function(t){var a=t.params,s=a.facetName,c=a.facetQuery,u=n(a,["facetName","facetQuery"]);return H(e)(t.indexName,{methods:{searchForFacetValues:k}}).searchForFacetValues(s,c,r(r({},i),u))})))}},Q=function(e){return function(t,r,n){return e.transporter.read({method:b,path:f("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:r},cacheable:!0},n)}},C=function(e){return function(t,r){return e.transporter.read({method:b,path:f("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},r)}},k=function(e){return function(t,r,n){return e.transporter.read({method:b,path:f("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:r},cacheable:!0},n)}},D=1,I=2,q=3;function V(e,t,n){var i,a={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(e){return new Promise((function(t){var r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return r.setRequestHeader(t,e.headers[t])}));var n,i=function(e,n){return setTimeout((function(){r.abort(),t({status:0,content:n,isTimedOut:!0})}),1e3*e)},a=i(e.connectTimeout,"Connection timeout");r.onreadystatechange=function(){r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=i(e.responseTimeout,"Socket timeout"))},r.onerror=function(){0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=function(){clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},logger:(i=q,{debug:function(e,t){return D>=i&&console.debug(e,t),Promise.resolve()},info:function(e,t){return I>=i&&console.info(e,t),Promise.resolve()},error:function(e,t){return console.error(e,t),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:c({caches:[s({key:"".concat("4.17.0","-").concat(e)}),u()]}),userAgent:_("4.17.0").add({segment:"Browser",version:"lite"}),authMode:l.WithinQueryParameters};return N(r(r(r({},a),n),{},{methods:{search:S,searchForFacetValues:T,multipleQueries:S,multipleSearchForFacetValues:T,customRequest:A,initIndex:function(e){return function(t){return H(e)(t,{methods:{search:C,searchForFacetValues:k,findAnswers:Q}})}}}}))}return V.version="4.17.0",V}()},6675:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>z});var n=r(7294),i=r(6010),a=r(8131),s=r.n(a),c=r(290),u=r.n(c),o=r(412),h=r(5742),f=r(9960),l=r(143),m=r(2263);const d=["zero","one","two","few","many","other"];function p(e){return d.filter((t=>e.includes(t)))}const v={locale:"en",pluralForms:p(["one","other"]),select:e=>1===e?"one":"other"};function g(){const{i18n:{currentLocale:e}}=(0,m.Z)();return(0,n.useMemo)((()=>{try{return function(e){const t=new Intl.PluralRules(e);return{locale:e,pluralForms:p(t.resolvedOptions().pluralCategories),select:e=>t.select(e)}}(e)}catch(t){return console.error(`Failed to use Intl.PluralRules for locale "${e}".\nDocusaurus will fallback to the default (English) implementation.\nError: ${t.message}\n`),v}}),[e])}function y(){const e=g();return{selectMessage:(t,r)=>function(e,t,r){const n=e.split("|");if(1===n.length)return n[0];n.length>r.pluralForms.length&&console.error(`For locale=${r.locale}, a maximum of ${r.pluralForms.length} plural forms are expected (${r.pluralForms.join(",")}), but the message contains ${n.length}: ${e}`);const i=r.select(t),a=r.pluralForms.indexOf(i);return n[Math.min(a,n.length-1)]}(r,t,e)}}var R=r(6177),F=r(902),b=r(833),P=r(2128),j=r(5999),_=r(6278),E=r(239),x=r(7452);const w="searchQueryInput_u2C7",O="searchVersionInput_m0Ui",N="searchResultsColumn_JPFH",A="algoliaLogo_rT1R",H="algoliaLogoPathFill_WdUC",S="searchResultItem_Tv2o",T="searchResultItemHeading_KbCB",Q="searchResultItemPath_lhe1",C="searchResultItemSummary_AEaO",k="searchQueryColumn_RTkw",D="searchVersionColumn_ypXd",I="searchLogoColumn_rJIA",q="loadingSpinner_XVxU",V="loader_vvXV";function L(e){let{docsSearchVersionsHelpers:t}=e;const r=Object.entries(t.allDocsData).filter((e=>{let[,t]=e;return t.versions.length>1}));return n.createElement("div",{className:(0,i.Z)("col","col--3","padding-left--none",D)},r.map((e=>{let[i,a]=e;const s=r.length>1?`${i}: `:"";return n.createElement("select",{key:i,onChange:e=>t.setSearchVersion(i,e.target.value),defaultValue:t.searchVersions[i],className:O},a.versions.map(((e,t)=>n.createElement("option",{key:t,label:`${s}${e.label}`,value:e.name}))))})))}function B(){const{i18n:{currentLocale:e}}=(0,m.Z)(),{algolia:{appId:t,apiKey:r,indexName:a}}=(0,_.L)(),c=(0,E.l)(),d=function(){const{selectMessage:e}=y();return t=>e(t,(0,j.I)({id:"theme.SearchPage.documentsFound.plurals",description:'Pluralized label for "{count} documents found". Use as much plural forms (separated by "|") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)',message:"One document found|{count} documents found"},{count:t}))}(),p=function(){const e=(0,l._r)(),[t,r]=(0,n.useState)((()=>Object.entries(e).reduce(((e,t)=>{let[r,n]=t;return{...e,[r]:n.versions[0].name}}),{}))),i=Object.values(e).some((e=>e.versions.length>1));return{allDocsData:e,versioningEnabled:i,searchVersions:t,setSearchVersion:(e,t)=>r((r=>({...r,[e]:t})))}}(),[v,g]=(0,R.K)(),b={items:[],query:null,totalResults:null,totalPages:null,lastPage:null,hasMore:null,loading:null},[O,D]=(0,n.useReducer)(((e,t)=>{switch(t.type){case"reset":return b;case"loading":return{...e,loading:!0};case"update":return v!==t.value.query?e:{...t.value,items:0===t.value.lastPage?t.value.items:e.items.concat(t.value.items)};case"advance":{const t=e.totalPages>e.lastPage+1;return{...e,lastPage:t?e.lastPage+1:e.lastPage,hasMore:t}}default:return e}}),b),B=u()(t,r),z=s()(B,a,{hitsPerPage:15,advancedSyntax:!0,disjunctiveFacets:["language","docusaurus_tag"]});z.on("result",(e=>{let{results:{query:t,hits:r,page:n,nbHits:i,nbPages:a}}=e;if(""===t||!Array.isArray(r))return void D({type:"reset"});const s=e=>e.replace(/algolia-docsearch-suggestion--highlight/g,"search-result-match"),u=r.map((e=>{let{url:t,_highlightResult:{hierarchy:r},_snippetResult:n={}}=e;const i=Object.keys(r).map((e=>s(r[e].value)));return{title:i.pop(),url:c(t),summary:n.content?`${s(n.content.value)}...`:"",breadcrumbs:i}}));D({type:"update",value:{items:u,query:t,totalResults:i,totalPages:a,lastPage:n,hasMore:a>n+1,loading:!1}})}));const[M,J]=(0,n.useState)(null),W=(0,n.useRef)(0),U=(0,n.useRef)(o.Z.canUseIntersectionObserver&&new IntersectionObserver((e=>{const{isIntersecting:t,boundingClientRect:{y:r}}=e[0];t&&W.current>r&&D({type:"advance"}),W.current=r}),{threshold:1})),Z=()=>v?(0,j.I)({id:"theme.SearchPage.existingResultsTitle",message:'Search results for "{query}"',description:"The search page title for non-empty query"},{query:v}):(0,j.I)({id:"theme.SearchPage.emptyResultsTitle",message:"Search the documentation",description:"The search page title for empty query"}),$=(0,F.zX)((function(t){void 0===t&&(t=0),z.addDisjunctiveFacetRefinement("docusaurus_tag","default"),z.addDisjunctiveFacetRefinement("language",e),Object.entries(p.searchVersions).forEach((e=>{let[t,r]=e;z.addDisjunctiveFacetRefinement("docusaurus_tag",`docs-${t}-${r}`)})),z.setQuery(v).setPage(t).search()}));return(0,n.useEffect)((()=>{if(!M)return;const e=U.current;return e?(e.observe(M),()=>e.unobserve(M)):()=>!0}),[M]),(0,n.useEffect)((()=>{D({type:"reset"}),v&&(D({type:"loading"}),setTimeout((()=>{$()}),300))}),[v,p.searchVersions,$]),(0,n.useEffect)((()=>{O.lastPage&&0!==O.lastPage&&$(O.lastPage)}),[$,O.lastPage]),n.createElement(x.Z,null,n.createElement(h.Z,null,n.createElement("title",null,(0,P.p)(Z())),n.createElement("meta",{property:"robots",content:"noindex, follow"})),n.createElement("div",{className:"container margin-vert--lg"},n.createElement("h1",null,Z()),n.createElement("form",{className:"row",onSubmit:e=>e.preventDefault()},n.createElement("div",{className:(0,i.Z)("col",k,{"col--9":p.versioningEnabled,"col--12":!p.versioningEnabled})},n.createElement("input",{type:"search",name:"q",className:w,placeholder:(0,j.I)({id:"theme.SearchPage.inputPlaceholder",message:"Type your search here",description:"The placeholder for search page input"}),"aria-label":(0,j.I)({id:"theme.SearchPage.inputLabel",message:"Search",description:"The ARIA label for search page input"}),onChange:e=>g(e.target.value),value:v,autoComplete:"off",autoFocus:!0})),p.versioningEnabled&&n.createElement(L,{docsSearchVersionsHelpers:p})),n.createElement("div",{className:"row"},n.createElement("div",{className:(0,i.Z)("col","col--8",N)},!!O.totalResults&&d(O.totalResults)),n.createElement("div",{className:(0,i.Z)("col","col--4","text--right",I)},n.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://www.algolia.com/","aria-label":(0,j.I)({id:"theme.SearchPage.algoliaLabel",message:"Search by Algolia",description:"The ARIA label for Algolia mention"})},n.createElement("svg",{viewBox:"0 0 168 24",className:A},n.createElement("g",{fill:"none"},n.createElement("path",{className:H,d:"M120.925 18.804c-4.386.02-4.386-3.54-4.386-4.106l-.007-13.336 2.675-.424v13.254c0 .322 0 2.358 1.718 2.364v2.248zm-10.846-2.18c.821 0 1.43-.047 1.855-.129v-2.719a6.334 6.334 0 0 0-1.574-.199 5.7 5.7 0 0 0-.897.069 2.699 2.699 0 0 0-.814.24c-.24.116-.439.28-.582.491-.15.212-.219.335-.219.656 0 .628.219.991.616 1.23s.938.362 1.615.362zm-.233-9.7c.883 0 1.629.109 2.231.328.602.218 1.088.525 1.444.915.363.396.609.922.76 1.483.157.56.232 1.175.232 1.85v6.874a32.5 32.5 0 0 1-1.868.314c-.834.123-1.772.185-2.813.185-.69 0-1.327-.069-1.895-.198a4.001 4.001 0 0 1-1.471-.636 3.085 3.085 0 0 1-.951-1.134c-.226-.465-.343-1.12-.343-1.803 0-.656.13-1.073.384-1.525a3.24 3.24 0 0 1 1.047-1.106c.445-.287.95-.492 1.532-.615a8.8 8.8 0 0 1 1.82-.185 8.404 8.404 0 0 1 1.972.24v-.438c0-.307-.035-.6-.11-.874a1.88 1.88 0 0 0-.384-.73 1.784 1.784 0 0 0-.724-.493 3.164 3.164 0 0 0-1.143-.205c-.616 0-1.177.075-1.69.164a7.735 7.735 0 0 0-1.26.307l-.321-2.192c.335-.117.834-.233 1.478-.349a10.98 10.98 0 0 1 2.073-.178zm52.842 9.626c.822 0 1.43-.048 1.854-.13V13.7a6.347 6.347 0 0 0-1.574-.199c-.294 0-.595.021-.896.069a2.7 2.7 0 0 0-.814.24 1.46 1.46 0 0 0-.582.491c-.15.212-.218.335-.218.656 0 .628.218.991.615 1.23.404.245.938.362 1.615.362zm-.226-9.694c.883 0 1.629.108 2.231.327.602.219 1.088.526 1.444.915.355.39.609.923.759 1.483a6.8 6.8 0 0 1 .233 1.852v6.873c-.41.088-1.034.19-1.868.314-.834.123-1.772.184-2.813.184-.69 0-1.327-.068-1.895-.198a4.001 4.001 0 0 1-1.471-.635 3.085 3.085 0 0 1-.951-1.134c-.226-.465-.343-1.12-.343-1.804 0-.656.13-1.073.384-1.524.26-.45.608-.82 1.047-1.107.445-.286.95-.491 1.532-.614a8.803 8.803 0 0 1 2.751-.13c.329.034.671.096 1.04.185v-.437a3.3 3.3 0 0 0-.109-.875 1.873 1.873 0 0 0-.384-.731 1.784 1.784 0 0 0-.724-.492 3.165 3.165 0 0 0-1.143-.205c-.616 0-1.177.075-1.69.164a7.75 7.75 0 0 0-1.26.307l-.321-2.193c.335-.116.834-.232 1.478-.348a11.633 11.633 0 0 1 2.073-.177zm-8.034-1.271a1.626 1.626 0 0 1-1.628-1.62c0-.895.725-1.62 1.628-1.62.904 0 1.63.725 1.63 1.62 0 .895-.733 1.62-1.63 1.62zm1.348 13.22h-2.689V7.27l2.69-.423v11.956zm-4.714 0c-4.386.02-4.386-3.54-4.386-4.107l-.008-13.336 2.676-.424v13.254c0 .322 0 2.358 1.718 2.364v2.248zm-8.698-5.903c0-1.156-.253-2.119-.746-2.788-.493-.677-1.183-1.01-2.067-1.01-.882 0-1.574.333-2.065 1.01-.493.676-.733 1.632-.733 2.788 0 1.168.246 1.953.74 2.63.492.683 1.183 1.018 2.066 1.018.882 0 1.574-.342 2.067-1.019.492-.683.738-1.46.738-2.63zm2.737-.007c0 .902-.13 1.584-.397 2.33a5.52 5.52 0 0 1-1.128 1.906 4.986 4.986 0 0 1-1.752 1.223c-.685.286-1.739.45-2.265.45-.528-.006-1.574-.157-2.252-.45a5.096 5.096 0 0 1-1.744-1.223c-.487-.527-.863-1.162-1.137-1.906a6.345 6.345 0 0 1-.41-2.33c0-.902.123-1.77.397-2.508a5.554 5.554 0 0 1 1.15-1.892 5.133 5.133 0 0 1 1.75-1.216c.679-.287 1.425-.423 2.232-.423.808 0 1.553.142 2.237.423a4.88 4.88 0 0 1 1.753 1.216 5.644 5.644 0 0 1 1.135 1.892c.287.738.431 1.606.431 2.508zm-20.138 0c0 1.12.246 2.363.738 2.882.493.52 1.13.78 1.91.78.424 0 .828-.062 1.204-.178.377-.116.677-.253.917-.417V9.33a10.476 10.476 0 0 0-1.766-.226c-.971-.028-1.71.37-2.23 1.004-.513.636-.773 1.75-.773 2.788zm7.438 5.274c0 1.824-.466 3.156-1.404 4.004-.936.846-2.367 1.27-4.296 1.27-.705 0-2.17-.137-3.34-.396l.431-2.118c.98.205 2.272.26 2.95.26 1.074 0 1.84-.219 2.299-.656.459-.437.684-1.086.684-1.948v-.437a8.07 8.07 0 0 1-1.047.397c-.43.13-.93.198-1.492.198-.739 0-1.41-.116-2.018-.349a4.206 4.206 0 0 1-1.567-1.025c-.431-.45-.774-1.017-1.013-1.694-.24-.677-.363-1.885-.363-2.773 0-.834.13-1.88.384-2.577.26-.696.629-1.298 1.129-1.796.493-.498 1.095-.881 1.8-1.162a6.605 6.605 0 0 1 2.428-.457c.87 0 1.67.109 2.45.24.78.129 1.444.265 1.985.415V18.17zM6.972 6.677v1.627c-.712-.446-1.52-.67-2.425-.67-.585 0-1.045.13-1.38.391a1.24 1.24 0 0 0-.502 1.03c0 .425.164.765.494 1.02.33.256.835.532 1.516.83.447.192.795.356 1.045.495.25.138.537.332.862.582.324.25.563.548.718.894.154.345.23.741.23 1.188 0 .947-.334 1.691-1.004 2.234-.67.542-1.537.814-2.601.814-1.18 0-2.16-.229-2.936-.686v-1.708c.84.628 1.814.942 2.92.942.585 0 1.048-.136 1.388-.407.34-.271.51-.646.51-1.125 0-.287-.1-.55-.302-.79-.203-.24-.42-.42-.655-.542-.234-.123-.585-.29-1.053-.503a61.27 61.27 0 0 1-.582-.271 13.67 13.67 0 0 1-.55-.287 4.275 4.275 0 0 1-.567-.351 6.92 6.92 0 0 1-.455-.4c-.18-.17-.31-.34-.39-.51-.08-.17-.155-.37-.224-.598a2.553 2.553 0 0 1-.104-.742c0-.915.333-1.638.998-2.17.664-.532 1.523-.798 2.576-.798.968 0 1.793.17 2.473.51zm7.468 5.696v-.287c-.022-.607-.187-1.088-.495-1.444-.309-.357-.75-.535-1.324-.535-.532 0-.99.194-1.373.583-.382.388-.622.949-.717 1.683h3.909zm1.005 2.792v1.404c-.596.34-1.383.51-2.362.51-1.255 0-2.255-.377-3-1.132-.744-.755-1.116-1.744-1.116-2.968 0-1.297.34-2.316 1.021-3.055.68-.74 1.548-1.11 2.6-1.11 1.033 0 1.852.323 2.458.966.606.644.91 1.572.91 2.784 0 .33-.033.676-.096 1.038h-5.314c.107.702.405 1.239.894 1.611.49.372 1.106.558 1.85.558.862 0 1.58-.202 2.155-.606zm6.605-1.77h-1.212c-.596 0-1.045.116-1.349.35-.303.234-.454.532-.454.894 0 .372.117.664.35.877.235.213.575.32 1.022.32.51 0 .912-.142 1.204-.424.293-.281.44-.651.44-1.108v-.91zm-4.068-2.554V9.325c.627-.361 1.457-.542 2.489-.542 2.116 0 3.175 1.026 3.175 3.08V17h-1.548v-.957c-.415.68-1.143 1.02-2.186 1.02-.766 0-1.38-.22-1.843-.661-.462-.442-.694-1.003-.694-1.684 0-.776.293-1.38.878-1.81.585-.431 1.404-.647 2.457-.647h1.34V11.8c0-.554-.133-.971-.399-1.253-.266-.282-.707-.423-1.324-.423a4.07 4.07 0 0 0-2.345.718zm9.333-1.93v1.42c.394-1 1.101-1.5 2.123-1.5.148 0 .313.016.494.048v1.531a1.885 1.885 0 0 0-.75-.143c-.542 0-.989.24-1.34.718-.351.479-.527 1.048-.527 1.707V17h-1.563V8.91h1.563zm5.01 4.084c.022.82.272 1.492.75 2.019.479.526 1.15.79 2.01.79.639 0 1.235-.176 1.788-.527v1.404c-.521.319-1.186.479-1.995.479-1.265 0-2.276-.4-3.031-1.197-.755-.798-1.133-1.792-1.133-2.984 0-1.16.38-2.151 1.14-2.975.761-.825 1.79-1.237 3.088-1.237.702 0 1.346.149 1.93.447v1.436a3.242 3.242 0 0 0-1.77-.495c-.84 0-1.513.266-2.019.798-.505.532-.758 1.213-.758 2.042zM40.24 5.72v4.579c.458-1 1.293-1.5 2.505-1.5.787 0 1.42.245 1.899.734.479.49.718 1.17.718 2.042V17h-1.564v-5.106c0-.553-.14-.98-.422-1.284-.282-.303-.652-.455-1.11-.455-.531 0-1.002.202-1.411.606-.41.405-.615 1.022-.615 1.851V17h-1.563V5.72h1.563zm14.966 10.02c.596 0 1.096-.253 1.5-.758.404-.506.606-1.157.606-1.955 0-.915-.202-1.62-.606-2.114-.404-.495-.92-.742-1.548-.742-.553 0-1.05.224-1.491.67-.442.447-.662 1.133-.662 2.058 0 .958.212 1.67.638 2.138.425.469.946.703 1.563.703zM53.004 5.72v4.42c.574-.894 1.388-1.341 2.44-1.341 1.022 0 1.857.383 2.506 1.149.649.766.973 1.781.973 3.047 0 1.138-.309 2.109-.925 2.912-.617.803-1.463 1.205-2.537 1.205-1.075 0-1.894-.447-2.457-1.34V17h-1.58V5.72h1.58zm9.908 11.104l-3.223-7.913h1.739l1.005 2.632 1.26 3.415c.096-.32.48-1.458 1.15-3.415l.909-2.632h1.66l-2.92 7.866c-.777 2.074-1.963 3.11-3.559 3.11a2.92 2.92 0 0 1-.734-.079v-1.34c.17.042.351.064.543.064 1.032 0 1.755-.57 2.17-1.708z"}),n.createElement("path",{fill:"#5468FF",d:"M78.988.938h16.594a2.968 2.968 0 0 1 2.966 2.966V20.5a2.967 2.967 0 0 1-2.966 2.964H78.988a2.967 2.967 0 0 1-2.966-2.964V3.897A2.961 2.961 0 0 1 78.988.938z"}),n.createElement("path",{fill:"white",d:"M89.632 5.967v-.772a.978.978 0 0 0-.978-.977h-2.28a.978.978 0 0 0-.978.977v.793c0 .088.082.15.171.13a7.127 7.127 0 0 1 1.984-.28c.65 0 1.295.088 1.917.259.082.02.164-.04.164-.13m-6.248 1.01l-.39-.389a.977.977 0 0 0-1.382 0l-.465.465a.973.973 0 0 0 0 1.38l.383.383c.062.061.15.047.205-.014.226-.307.472-.601.746-.874.281-.28.568-.526.883-.751.068-.042.075-.137.02-.2m4.16 2.453v3.341c0 .096.104.165.192.117l2.97-1.537c.068-.034.089-.117.055-.184a3.695 3.695 0 0 0-3.08-1.866c-.068 0-.136.054-.136.13m0 8.048a4.489 4.489 0 0 1-4.49-4.482 4.488 4.488 0 0 1 4.49-4.482 4.488 4.488 0 0 1 4.489 4.482 4.484 4.484 0 0 1-4.49 4.482m0-10.85a6.363 6.363 0 1 0 0 12.729 6.37 6.37 0 0 0 6.372-6.368 6.358 6.358 0 0 0-6.371-6.36"})))))),O.items.length>0?n.createElement("main",null,O.items.map(((e,t)=>{let{title:r,url:a,summary:s,breadcrumbs:c}=e;return n.createElement("article",{key:t,className:S},n.createElement("h2",{className:T},n.createElement(f.Z,{to:a,dangerouslySetInnerHTML:{__html:r}})),c.length>0&&n.createElement("nav",{"aria-label":"breadcrumbs"},n.createElement("ul",{className:(0,i.Z)("breadcrumbs",Q)},c.map(((e,t)=>n.createElement("li",{key:t,className:"breadcrumbs__item",dangerouslySetInnerHTML:{__html:e}}))))),s&&n.createElement("p",{className:C,dangerouslySetInnerHTML:{__html:s}}))}))):[v&&!O.loading&&n.createElement("p",{key:"no-results"},n.createElement(j.Z,{id:"theme.SearchPage.noResultsText",description:"The paragraph for empty search result"},"No results were found")),!!O.loading&&n.createElement("div",{key:"spinner",className:q})],O.hasMore&&n.createElement("div",{className:V,ref:J},n.createElement(j.Z,{id:"theme.SearchPage.fetchingNewResults",description:"The paragraph for fetching new search results"},"Fetching new results..."))))}function z(){return n.createElement(b.FG,{className:"search-page-wrapper"},n.createElement(B,null))}}}]); \ No newline at end of file diff --git a/assets/js/1a4e3797.2adc3808.js.LICENSE.txt b/assets/js/1a4e3797.2adc3808.js.LICENSE.txt deleted file mode 100644 index 137dcba..0000000 --- a/assets/js/1a4e3797.2adc3808.js.LICENSE.txt +++ /dev/null @@ -1 +0,0 @@ -/*! algoliasearch-lite.umd.js | 4.17.0 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */ diff --git a/assets/js/1a4e3797.98c7b9ce.js b/assets/js/1a4e3797.98c7b9ce.js new file mode 100644 index 0000000..256ce22 --- /dev/null +++ b/assets/js/1a4e3797.98c7b9ce.js @@ -0,0 +1,2 @@ +/*! For license information please see 1a4e3797.98c7b9ce.js.LICENSE.txt */ +(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[7920],{7331:e=>{function t(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function n(e){return"object"==typeof e&&null!==e}function i(e){return void 0===e}e.exports=t,t.prototype._events=void 0,t.prototype._maxListeners=void 0,t.defaultMaxListeners=10,t.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},t.prototype.emit=function(e){var t,a,s,c,u,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||n(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var h=new Error('Uncaught, unspecified "error" event. ('+t+")");throw h.context=t,h}if(i(a=this._events[e]))return!1;if(r(a))switch(arguments.length){case 1:a.call(this);break;case 2:a.call(this,arguments[1]);break;case 3:a.call(this,arguments[1],arguments[2]);break;default:c=Array.prototype.slice.call(arguments,1),a.apply(this,c)}else if(n(a))for(c=Array.prototype.slice.call(arguments,1),s=(o=a.slice()).length,u=0;u<s;u++)o[u].apply(this,c);return!0},t.prototype.addListener=function(e,a){var s;if(!r(a))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,r(a.listener)?a.listener:a),this._events[e]?n(this._events[e])?this._events[e].push(a):this._events[e]=[this._events[e],a]:this._events[e]=a,n(this._events[e])&&!this._events[e].warned&&(s=i(this._maxListeners)?t.defaultMaxListeners:this._maxListeners)&&s>0&&this._events[e].length>s&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(e,t){if(!r(t))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},t.prototype.removeListener=function(e,t){var i,a,s,c;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(s=(i=this._events[e]).length,a=-1,i===t||r(i.listener)&&i.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(n(i)){for(c=s;c-- >0;)if(i[c]===t||i[c].listener&&i[c].listener===t){a=c;break}if(a<0)return this;1===i.length?(i.length=0,delete this._events[e]):i.splice(a,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},t.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},t.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},t.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},t.listenerCount=function(e,t){return e.listenerCount(t)}},8131:(e,t,r)=>{"use strict";var n=r(9374),i=r(7775),a=r(3076);function s(e,t,r){return new n(e,t,r)}s.version=r(4336),s.AlgoliaSearchHelper=n,s.SearchParameters=i,s.SearchResults=a,e.exports=s},8078:(e,t,r)=>{"use strict";var n=r(7331);function i(e,t){this.main=e,this.fn=t,this.lastResults=null}r(4853)(i,n),i.prototype.detach=function(){this.removeAllListeners(),this.main.detachDerivedHelper(this)},i.prototype.getModifiedState=function(e){return this.fn(e)},e.exports=i},2437:(e,t,r)=>{"use strict";var n=r(2344),i=r(116),a=r(9803),s={addRefinement:function(e,t,r){if(s.isRefined(e,t,r))return e;var i=""+r,a=e[t]?e[t].concat(i):[i],c={};return c[t]=a,n({},c,e)},removeRefinement:function(e,t,r){if(void 0===r)return s.clearRefinement(e,(function(e,r){return t===r}));var n=""+r;return s.clearRefinement(e,(function(e,r){return t===r&&n===e}))},toggleRefinement:function(e,t,r){if(void 0===r)throw new Error("toggleRefinement should be used with a value");return s.isRefined(e,t,r)?s.removeRefinement(e,t,r):s.addRefinement(e,t,r)},clearRefinement:function(e,t,r){if(void 0===t)return i(e)?{}:e;if("string"==typeof t)return a(e,[t]);if("function"==typeof t){var n=!1,s=Object.keys(e).reduce((function(i,a){var s=e[a]||[],c=s.filter((function(e){return!t(e,a,r)}));return c.length!==s.length&&(n=!0),i[a]=c,i}),{});return n?s:e}},isRefined:function(e,t,r){var n=Boolean(e[t])&&e[t].length>0;if(void 0===r||!n)return n;var i=""+r;return-1!==e[t].indexOf(i)}};e.exports=s},7775:(e,t,r)=>{"use strict";var n=r(2344),i=r(7888),a=r(2686),s=r(185),c=r(116),u=r(9803),o=r(8023),h=r(6801),f=r(2437);function l(e,t){return Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((function(e,r){return l(t[r],e)})):e===t}function m(e){var t=e?m._parseNumbers(e):{};void 0===t.userToken||h(t.userToken)||console.warn("[algoliasearch-helper] The `userToken` parameter is invalid. This can lead to wrong analytics.\n - Format: [a-zA-Z0-9_-]{1,64}"),this.facets=t.facets||[],this.disjunctiveFacets=t.disjunctiveFacets||[],this.hierarchicalFacets=t.hierarchicalFacets||[],this.facetsRefinements=t.facetsRefinements||{},this.facetsExcludes=t.facetsExcludes||{},this.disjunctiveFacetsRefinements=t.disjunctiveFacetsRefinements||{},this.numericRefinements=t.numericRefinements||{},this.tagRefinements=t.tagRefinements||[],this.hierarchicalFacetsRefinements=t.hierarchicalFacetsRefinements||{};var r=this;Object.keys(t).forEach((function(e){var n=-1!==m.PARAMETERS.indexOf(e),i=void 0!==t[e];!n&&i&&(r[e]=t[e])}))}m.PARAMETERS=Object.keys(new m),m._parseNumbers=function(e){if(e instanceof m)return e;var t={};if(["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"].forEach((function(r){var n=e[r];if("string"==typeof n){var i=parseFloat(n);t[r]=isNaN(i)?n:i}})),Array.isArray(e.insideBoundingBox)&&(t.insideBoundingBox=e.insideBoundingBox.map((function(e){return Array.isArray(e)?e.map((function(e){return parseFloat(e)})):e}))),e.numericRefinements){var r={};Object.keys(e.numericRefinements).forEach((function(t){var n=e.numericRefinements[t]||{};r[t]={},Object.keys(n).forEach((function(e){var i=n[e].map((function(e){return Array.isArray(e)?e.map((function(e){return"string"==typeof e?parseFloat(e):e})):"string"==typeof e?parseFloat(e):e}));r[t][e]=i}))})),t.numericRefinements=r}return s({},e,t)},m.make=function(e){var t=new m(e);return(e.hierarchicalFacets||[]).forEach((function(e){if(e.rootPath){var r=t.getHierarchicalRefinement(e.name);r.length>0&&0!==r[0].indexOf(e.rootPath)&&(t=t.clearRefinements(e.name)),0===(r=t.getHierarchicalRefinement(e.name)).length&&(t=t.toggleHierarchicalFacetRefinement(e.name,e.rootPath))}})),t},m.validate=function(e,t){var r=t||{};return e.tagFilters&&r.tagRefinements&&r.tagRefinements.length>0?new Error("[Tags] Cannot switch from the managed tag API to the advanced API. It is probably an error, if it is really what you want, you should first clear the tags with clearTags method."):e.tagRefinements.length>0&&r.tagFilters?new Error("[Tags] Cannot switch from the advanced tag API to the managed API. It is probably an error, if it is not, you should first clear the tags with clearTags method."):e.numericFilters&&r.numericRefinements&&c(r.numericRefinements)?new Error("[Numeric filters] Can't switch from the advanced to the managed API. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):c(e.numericRefinements)&&r.numericFilters?new Error("[Numeric filters] Can't switch from the managed API to the advanced. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):null},m.prototype={constructor:m,clearRefinements:function(e){var t={numericRefinements:this._clearNumericRefinements(e),facetsRefinements:f.clearRefinement(this.facetsRefinements,e,"conjunctiveFacet"),facetsExcludes:f.clearRefinement(this.facetsExcludes,e,"exclude"),disjunctiveFacetsRefinements:f.clearRefinement(this.disjunctiveFacetsRefinements,e,"disjunctiveFacet"),hierarchicalFacetsRefinements:f.clearRefinement(this.hierarchicalFacetsRefinements,e,"hierarchicalFacet")};return t.numericRefinements===this.numericRefinements&&t.facetsRefinements===this.facetsRefinements&&t.facetsExcludes===this.facetsExcludes&&t.disjunctiveFacetsRefinements===this.disjunctiveFacetsRefinements&&t.hierarchicalFacetsRefinements===this.hierarchicalFacetsRefinements?this:this.setQueryParameters(t)},clearTags:function(){return void 0===this.tagFilters&&0===this.tagRefinements.length?this:this.setQueryParameters({tagFilters:void 0,tagRefinements:[]})},setIndex:function(e){return e===this.index?this:this.setQueryParameters({index:e})},setQuery:function(e){return e===this.query?this:this.setQueryParameters({query:e})},setPage:function(e){return e===this.page?this:this.setQueryParameters({page:e})},setFacets:function(e){return this.setQueryParameters({facets:e})},setDisjunctiveFacets:function(e){return this.setQueryParameters({disjunctiveFacets:e})},setHitsPerPage:function(e){return this.hitsPerPage===e?this:this.setQueryParameters({hitsPerPage:e})},setTypoTolerance:function(e){return this.typoTolerance===e?this:this.setQueryParameters({typoTolerance:e})},addNumericRefinement:function(e,t,r){var n=o(r);if(this.isNumericRefined(e,t,n))return this;var i=s({},this.numericRefinements);return i[e]=s({},i[e]),i[e][t]?(i[e][t]=i[e][t].slice(),i[e][t].push(n)):i[e][t]=[n],this.setQueryParameters({numericRefinements:i})},getConjunctiveRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsRefinements[e]||[]},getDisjunctiveRefinements:function(e){return this.isDisjunctiveFacet(e)&&this.disjunctiveFacetsRefinements[e]||[]},getHierarchicalRefinement:function(e){return this.hierarchicalFacetsRefinements[e]||[]},getExcludeRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsExcludes[e]||[]},removeNumericRefinement:function(e,t,r){var n=r;return void 0!==n?this.isNumericRefined(e,t,n)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(r,i){return i===e&&r.op===t&&l(r.val,o(n))}))}):this:void 0!==t?this.isNumericRefined(e,t)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(r,n){return n===e&&r.op===t}))}):this:this.isNumericRefined(e)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(t,r){return r===e}))}):this},getNumericRefinements:function(e){return this.numericRefinements[e]||{}},getNumericRefinement:function(e,t){return this.numericRefinements[e]&&this.numericRefinements[e][t]},_clearNumericRefinements:function(e){if(void 0===e)return c(this.numericRefinements)?{}:this.numericRefinements;if("string"==typeof e)return u(this.numericRefinements,[e]);if("function"==typeof e){var t=!1,r=this.numericRefinements,n=Object.keys(r).reduce((function(n,i){var a=r[i],s={};return a=a||{},Object.keys(a).forEach((function(r){var n=a[r]||[],c=[];n.forEach((function(t){e({val:t,op:r},i,"numeric")||c.push(t)})),c.length!==n.length&&(t=!0),s[r]=c})),n[i]=s,n}),{});return t?n:this.numericRefinements}},addFacet:function(e){return this.isConjunctiveFacet(e)?this:this.setQueryParameters({facets:this.facets.concat([e])})},addDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this:this.setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.concat([e])})},addHierarchicalFacet:function(e){if(this.isHierarchicalFacet(e.name))throw new Error("Cannot declare two hierarchical facets with the same name: `"+e.name+"`");return this.setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.concat([e])})},addFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsRefinements,e,t)?this:this.setQueryParameters({facetsRefinements:f.addRefinement(this.facetsRefinements,e,t)})},addExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsExcludes,e,t)?this:this.setQueryParameters({facetsExcludes:f.addRefinement(this.facetsExcludes,e,t)})},addDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return f.isRefined(this.disjunctiveFacetsRefinements,e,t)?this:this.setQueryParameters({disjunctiveFacetsRefinements:f.addRefinement(this.disjunctiveFacetsRefinements,e,t)})},addTagRefinement:function(e){if(this.isTagRefined(e))return this;var t={tagRefinements:this.tagRefinements.concat(e)};return this.setQueryParameters(t)},removeFacet:function(e){return this.isConjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({facets:this.facets.filter((function(t){return t!==e}))}):this},removeDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.filter((function(t){return t!==e}))}):this},removeHierarchicalFacet:function(e){return this.isHierarchicalFacet(e)?this.clearRefinements(e).setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.filter((function(t){return t.name!==e}))}):this},removeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsRefinements,e,t)?this.setQueryParameters({facetsRefinements:f.removeRefinement(this.facetsRefinements,e,t)}):this},removeExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsExcludes,e,t)?this.setQueryParameters({facetsExcludes:f.removeRefinement(this.facetsExcludes,e,t)}):this},removeDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return f.isRefined(this.disjunctiveFacetsRefinements,e,t)?this.setQueryParameters({disjunctiveFacetsRefinements:f.removeRefinement(this.disjunctiveFacetsRefinements,e,t)}):this},removeTagRefinement:function(e){if(!this.isTagRefined(e))return this;var t={tagRefinements:this.tagRefinements.filter((function(t){return t!==e}))};return this.setQueryParameters(t)},toggleRefinement:function(e,t){return this.toggleFacetRefinement(e,t)},toggleFacetRefinement:function(e,t){if(this.isHierarchicalFacet(e))return this.toggleHierarchicalFacetRefinement(e,t);if(this.isConjunctiveFacet(e))return this.toggleConjunctiveFacetRefinement(e,t);if(this.isDisjunctiveFacet(e))return this.toggleDisjunctiveFacetRefinement(e,t);throw new Error("Cannot refine the undeclared facet "+e+"; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets")},toggleConjunctiveFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsRefinements:f.toggleRefinement(this.facetsRefinements,e,t)})},toggleExcludeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsExcludes:f.toggleRefinement(this.facetsExcludes,e,t)})},toggleDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return this.setQueryParameters({disjunctiveFacetsRefinements:f.toggleRefinement(this.disjunctiveFacetsRefinements,e,t)})},toggleHierarchicalFacetRefinement:function(e,t){if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration");var r=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),i={};return void 0!==this.hierarchicalFacetsRefinements[e]&&this.hierarchicalFacetsRefinements[e].length>0&&(this.hierarchicalFacetsRefinements[e][0]===t||0===this.hierarchicalFacetsRefinements[e][0].indexOf(t+r))?-1===t.indexOf(r)?i[e]=[]:i[e]=[t.slice(0,t.lastIndexOf(r))]:i[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:n({},i,this.hierarchicalFacetsRefinements)})},addHierarchicalFacetRefinement:function(e,t){if(this.isHierarchicalFacetRefined(e))throw new Error(e+" is already refined.");if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration.");var r={};return r[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:n({},r,this.hierarchicalFacetsRefinements)})},removeHierarchicalFacetRefinement:function(e){if(!this.isHierarchicalFacetRefined(e))return this;var t={};return t[e]=[],this.setQueryParameters({hierarchicalFacetsRefinements:n({},t,this.hierarchicalFacetsRefinements)})},toggleTagRefinement:function(e){return this.isTagRefined(e)?this.removeTagRefinement(e):this.addTagRefinement(e)},isDisjunctiveFacet:function(e){return this.disjunctiveFacets.indexOf(e)>-1},isHierarchicalFacet:function(e){return void 0!==this.getHierarchicalFacetByName(e)},isConjunctiveFacet:function(e){return this.facets.indexOf(e)>-1},isFacetRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&f.isRefined(this.facetsRefinements,e,t)},isExcludeRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&f.isRefined(this.facetsExcludes,e,t)},isDisjunctiveFacetRefined:function(e,t){return!!this.isDisjunctiveFacet(e)&&f.isRefined(this.disjunctiveFacetsRefinements,e,t)},isHierarchicalFacetRefined:function(e,t){if(!this.isHierarchicalFacet(e))return!1;var r=this.getHierarchicalRefinement(e);return t?-1!==r.indexOf(t):r.length>0},isNumericRefined:function(e,t,r){if(void 0===r&&void 0===t)return Boolean(this.numericRefinements[e]);var n=this.numericRefinements[e]&&void 0!==this.numericRefinements[e][t];if(void 0===r||!n)return n;var a,s,c=o(r),u=void 0!==(a=this.numericRefinements[e][t],s=c,i(a,(function(e){return l(e,s)})));return n&&u},isTagRefined:function(e){return-1!==this.tagRefinements.indexOf(e)},getRefinedDisjunctiveFacets:function(){var e=this,t=a(Object.keys(this.numericRefinements).filter((function(t){return Object.keys(e.numericRefinements[t]).length>0})),this.disjunctiveFacets);return Object.keys(this.disjunctiveFacetsRefinements).filter((function(t){return e.disjunctiveFacetsRefinements[t].length>0})).concat(t).concat(this.getRefinedHierarchicalFacets()).sort()},getRefinedHierarchicalFacets:function(){var e=this;return a(this.hierarchicalFacets.map((function(e){return e.name})),Object.keys(this.hierarchicalFacetsRefinements).filter((function(t){return e.hierarchicalFacetsRefinements[t].length>0}))).sort()},getUnrefinedDisjunctiveFacets:function(){var e=this.getRefinedDisjunctiveFacets();return this.disjunctiveFacets.filter((function(t){return-1===e.indexOf(t)}))},managedParameters:["index","facets","disjunctiveFacets","facetsRefinements","hierarchicalFacets","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacetsRefinements"],getQueryParams:function(){var e=this.managedParameters,t={},r=this;return Object.keys(this).forEach((function(n){var i=r[n];-1===e.indexOf(n)&&void 0!==i&&(t[n]=i)})),t},setQueryParameter:function(e,t){if(this[e]===t)return this;var r={};return r[e]=t,this.setQueryParameters(r)},setQueryParameters:function(e){if(!e)return this;var t=m.validate(this,e);if(t)throw t;var r=this,n=m._parseNumbers(e),i=Object.keys(this).reduce((function(e,t){return e[t]=r[t],e}),{}),a=Object.keys(n).reduce((function(e,t){var r=void 0!==e[t],i=void 0!==n[t];return r&&!i?u(e,[t]):(i&&(e[t]=n[t]),e)}),i);return new this.constructor(a)},resetPage:function(){return void 0===this.page?this:this.setPage(0)},_getHierarchicalFacetSortBy:function(e){return e.sortBy||["isRefined:desc","name:asc"]},_getHierarchicalFacetSeparator:function(e){return e.separator||" > "},_getHierarchicalRootPath:function(e){return e.rootPath||null},_getHierarchicalShowParentLevel:function(e){return"boolean"!=typeof e.showParentLevel||e.showParentLevel},getHierarchicalFacetByName:function(e){return i(this.hierarchicalFacets,(function(t){return t.name===e}))},getHierarchicalFacetBreadcrumb:function(e){if(!this.isHierarchicalFacet(e))return[];var t=this.getHierarchicalRefinement(e)[0];if(!t)return[];var r=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e));return t.split(r).map((function(e){return e.trim()}))},toString:function(){return JSON.stringify(this,null,2)}},e.exports=m},210:(e,t,r)=>{"use strict";e.exports=function(e){return function(t,r){var n=e.hierarchicalFacets[r],o=e.hierarchicalFacetsRefinements[n.name]&&e.hierarchicalFacetsRefinements[n.name][0]||"",h=e._getHierarchicalFacetSeparator(n),f=e._getHierarchicalRootPath(n),l=e._getHierarchicalShowParentLevel(n),m=a(e._getHierarchicalFacetSortBy(n)),d=t.every((function(e){return e.exhaustive})),p=function(e,t,r,n,a){return function(o,h,f){var l=o;if(f>0){var m=0;for(l=o;m<f;){var d=l&&Array.isArray(l.data)?l.data:[];l=i(d,(function(e){return e.isRefined})),m++}}if(l){var p=Object.keys(h.data).map((function(e){return[e,h.data[e]]})).filter((function(e){return function(e,t,r,n,i,a){if(i&&(0!==e.indexOf(i)||i===e))return!1;return!i&&-1===e.indexOf(n)||i&&e.split(n).length-i.split(n).length==1||-1===e.indexOf(n)&&-1===r.indexOf(n)||0===r.indexOf(e)||0===e.indexOf(t+n)&&(a||0===e.indexOf(r))}(e[0],l.path||r,a,t,r,n)}));l.data=s(p.map((function(e){var r=e[0];return function(e,t,r,n,i){var a=t.split(r);return{name:a[a.length-1].trim(),path:t,escapedValue:c(t),count:e,isRefined:n===t||0===n.indexOf(t+r),exhaustive:i,data:null}}(e[1],r,t,u(a),h.exhaustive)})),e[0],e[1])}return o}}(m,h,f,l,o),v=t;return f&&(v=t.slice(f.split(h).length)),v.reduce(p,{name:e.hierarchicalFacets[r].name,count:null,isRefined:!0,path:null,escapedValue:null,exhaustive:d,data:null})}};var n=r(4039),i=r(7888),a=r(2293),s=r(2148),c=n.escapeFacetValue,u=n.unescapeFacetValue},3076:(e,t,r)=>{"use strict";var n=r(4587),i=r(2344),a=r(4039),s=r(7888),c=r(9725),u=r(2293),o=r(185),h=r(2148),f=a.escapeFacetValue,l=a.unescapeFacetValue,m=r(210);function d(e){var t={};return e.forEach((function(e,r){t[e]=r})),t}function p(e,t,r){t&&t[r]&&(e.stats=t[r])}function v(e,t,r){var a=t[0];this._rawResults=t;var u=this;Object.keys(a).forEach((function(e){u[e]=a[e]})),Object.keys(r||{}).forEach((function(e){u[e]=r[e]})),this.processingTimeMS=t.reduce((function(e,t){return void 0===t.processingTimeMS?e:e+t.processingTimeMS}),0),this.disjunctiveFacets=[],this.hierarchicalFacets=e.hierarchicalFacets.map((function(){return[]})),this.facets=[];var h=e.getRefinedDisjunctiveFacets(),f=d(e.facets),v=d(e.disjunctiveFacets),g=1,y=a.facets||{};Object.keys(y).forEach((function(t){var r,n,i=y[t],o=(r=e.hierarchicalFacets,n=t,s(r,(function(e){return(e.attributes||[]).indexOf(n)>-1})));if(o){var h=o.attributes.indexOf(t),l=c(e.hierarchicalFacets,(function(e){return e.name===o.name}));u.hierarchicalFacets[l][h]={attribute:t,data:i,exhaustive:a.exhaustiveFacetsCount}}else{var m,d=-1!==e.disjunctiveFacets.indexOf(t),g=-1!==e.facets.indexOf(t);d&&(m=v[t],u.disjunctiveFacets[m]={name:t,data:i,exhaustive:a.exhaustiveFacetsCount},p(u.disjunctiveFacets[m],a.facets_stats,t)),g&&(m=f[t],u.facets[m]={name:t,data:i,exhaustive:a.exhaustiveFacetsCount},p(u.facets[m],a.facets_stats,t))}})),this.hierarchicalFacets=n(this.hierarchicalFacets),h.forEach((function(r){var n=t[g],s=n&&n.facets?n.facets:{},h=e.getHierarchicalFacetByName(r);Object.keys(s).forEach((function(t){var r,f=s[t];if(h){r=c(e.hierarchicalFacets,(function(e){return e.name===h.name}));var m=c(u.hierarchicalFacets[r],(function(e){return e.attribute===t}));if(-1===m)return;u.hierarchicalFacets[r][m].data=o({},u.hierarchicalFacets[r][m].data,f)}else{r=v[t];var d=a.facets&&a.facets[t]||{};u.disjunctiveFacets[r]={name:t,data:i({},f,d),exhaustive:n.exhaustiveFacetsCount},p(u.disjunctiveFacets[r],n.facets_stats,t),e.disjunctiveFacetsRefinements[t]&&e.disjunctiveFacetsRefinements[t].forEach((function(n){!u.disjunctiveFacets[r].data[n]&&e.disjunctiveFacetsRefinements[t].indexOf(l(n))>-1&&(u.disjunctiveFacets[r].data[n]=0)}))}})),g++})),e.getRefinedHierarchicalFacets().forEach((function(r){var n=e.getHierarchicalFacetByName(r),a=e._getHierarchicalFacetSeparator(n),s=e.getHierarchicalRefinement(r);0===s.length||s[0].split(a).length<2||t.slice(g).forEach((function(t){var r=t&&t.facets?t.facets:{};Object.keys(r).forEach((function(t){var o=r[t],h=c(e.hierarchicalFacets,(function(e){return e.name===n.name})),f=c(u.hierarchicalFacets[h],(function(e){return e.attribute===t}));if(-1!==f){var l={};if(s.length>0){var m=s[0].split(a)[0];l[m]=u.hierarchicalFacets[h][f].data[m]}u.hierarchicalFacets[h][f].data=i(l,o,u.hierarchicalFacets[h][f].data)}})),g++}))})),Object.keys(e.facetsExcludes).forEach((function(t){var r=e.facetsExcludes[t],n=f[t];u.facets[n]={name:t,data:y[t],exhaustive:a.exhaustiveFacetsCount},r.forEach((function(e){u.facets[n]=u.facets[n]||{name:t},u.facets[n].data=u.facets[n].data||{},u.facets[n].data[e]=0}))})),this.hierarchicalFacets=this.hierarchicalFacets.map(m(e)),this.facets=n(this.facets),this.disjunctiveFacets=n(this.disjunctiveFacets),this._state=e}function g(e,t){function r(e){return e.name===t}if(e._state.isConjunctiveFacet(t)){var n=s(e.facets,r);return n?Object.keys(n.data).map((function(r){var i=f(r);return{name:r,escapedValue:i,count:n.data[r],isRefined:e._state.isFacetRefined(t,i),isExcluded:e._state.isExcludeRefined(t,r)}})):[]}if(e._state.isDisjunctiveFacet(t)){var i=s(e.disjunctiveFacets,r);return i?Object.keys(i.data).map((function(r){var n=f(r);return{name:r,escapedValue:n,count:i.data[r],isRefined:e._state.isDisjunctiveFacetRefined(t,n)}})):[]}if(e._state.isHierarchicalFacet(t)){var a=s(e.hierarchicalFacets,r);if(!a)return a;var c=e._state.getHierarchicalFacetByName(t),u=e._state._getHierarchicalFacetSeparator(c),o=l(e._state.getHierarchicalRefinement(t)[0]||"");0===o.indexOf(c.rootPath)&&(o=o.replace(c.rootPath+u,""));var h=o.split(u);return h.unshift(t),y(a,h,0),a}}function y(e,t,r){e.isRefined=e.name===t[r],e.data&&e.data.forEach((function(e){y(e,t,r+1)}))}function R(e,t,r,n){if(n=n||0,Array.isArray(t))return e(t,r[n]);if(!t.data||0===t.data.length)return t;var a=t.data.map((function(t){return R(e,t,r,n+1)})),s=e(a,r[n]);return i({data:s},t)}function F(e,t){var r=s(e,(function(e){return e.name===t}));return r&&r.stats}function b(e,t,r,n,i){var a=s(i,(function(e){return e.name===r})),c=a&&a.data&&a.data[n]?a.data[n]:0,u=a&&a.exhaustive||!1;return{type:t,attributeName:r,name:n,count:c,exhaustive:u}}v.prototype.getFacetByName=function(e){function t(t){return t.name===e}return s(this.facets,t)||s(this.disjunctiveFacets,t)||s(this.hierarchicalFacets,t)},v.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"],v.prototype.getFacetValues=function(e,t){var r=g(this,e);if(r){var n,a=i({},t,{sortBy:v.DEFAULT_SORT,facetOrdering:!(t&&t.sortBy)}),s=this;if(Array.isArray(r))n=[e];else n=s._state.getHierarchicalFacetByName(r.name).attributes;return R((function(e,t){if(a.facetOrdering){var r=function(e,t){return e.renderingContent&&e.renderingContent.facetOrdering&&e.renderingContent.facetOrdering.values&&e.renderingContent.facetOrdering.values[t]}(s,t);if(r)return function(e,t){var r=[],n=[],i=(t.order||[]).reduce((function(e,t,r){return e[t]=r,e}),{});e.forEach((function(e){var t=e.path||e.name;void 0!==i[t]?r[i[t]]=e:n.push(e)})),r=r.filter((function(e){return e}));var a,s=t.sortRemainingBy;return"hidden"===s?r:(a="alpha"===s?[["path","name"],["asc","asc"]]:[["count"],["desc"]],r.concat(h(n,a[0],a[1])))}(e,r)}if(Array.isArray(a.sortBy)){var n=u(a.sortBy,v.DEFAULT_SORT);return h(e,n[0],n[1])}if("function"==typeof a.sortBy)return function(e,t){return t.sort(e)}(a.sortBy,e);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")}),r,n)}},v.prototype.getFacetStats=function(e){return this._state.isConjunctiveFacet(e)?F(this.facets,e):this._state.isDisjunctiveFacet(e)?F(this.disjunctiveFacets,e):void 0},v.prototype.getRefinements=function(){var e=this._state,t=this,r=[];return Object.keys(e.facetsRefinements).forEach((function(n){e.facetsRefinements[n].forEach((function(i){r.push(b(e,"facet",n,i,t.facets))}))})),Object.keys(e.facetsExcludes).forEach((function(n){e.facetsExcludes[n].forEach((function(i){r.push(b(e,"exclude",n,i,t.facets))}))})),Object.keys(e.disjunctiveFacetsRefinements).forEach((function(n){e.disjunctiveFacetsRefinements[n].forEach((function(i){r.push(b(e,"disjunctive",n,i,t.disjunctiveFacets))}))})),Object.keys(e.hierarchicalFacetsRefinements).forEach((function(n){e.hierarchicalFacetsRefinements[n].forEach((function(i){r.push(function(e,t,r,n){var i=e.getHierarchicalFacetByName(t),a=e._getHierarchicalFacetSeparator(i),c=r.split(a),u=s(n,(function(e){return e.name===t})),o=c.reduce((function(e,t){var r=e&&s(e.data,(function(e){return e.name===t}));return void 0!==r?r:e}),u),h=o&&o.count||0,f=o&&o.exhaustive||!1,l=o&&o.path||"";return{type:"hierarchical",attributeName:t,name:l,count:h,exhaustive:f}}(e,n,i,t.hierarchicalFacets))}))})),Object.keys(e.numericRefinements).forEach((function(t){var n=e.numericRefinements[t];Object.keys(n).forEach((function(e){n[e].forEach((function(n){r.push({type:"numeric",attributeName:t,name:n,numericValue:n,operator:e})}))}))})),e.tagRefinements.forEach((function(e){r.push({type:"tag",attributeName:"_tags",name:e})})),r},e.exports=v},9374:(e,t,r)=>{"use strict";var n=r(7331),i=r(8078),a=r(4039).escapeFacetValue,s=r(4853),c=r(185),u=r(116),o=r(9803),h=r(6394),f=r(7775),l=r(3076),m=r(4336);function d(e,t,r){"function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper ("+m+")"),this.setClient(e);var n=r||{};n.index=t,this.state=f.make(n),this.lastResults=null,this._queryId=0,this._lastQueryIdReceived=-1,this.derivedHelpers=[],this._currentNbQueries=0}function p(e){if(e<0)throw new Error("Page requested below 0.");return this._change({state:this.state.setPage(e),isPageReset:!1}),this}function v(){return this.state.page}s(d,n),d.prototype.search=function(){return this._search({onlyWithDerivedHelpers:!1}),this},d.prototype.searchOnlyWithDerivedHelpers=function(){return this._search({onlyWithDerivedHelpers:!0}),this},d.prototype.getQuery=function(){var e=this.state;return h._getHitsSearchParams(e)},d.prototype.searchOnce=function(e,t){var r=e?this.state.setQueryParameters(e):this.state,n=h._getQueries(r.index,r),i=this;if(this._currentNbQueries++,this.emit("searchOnce",{state:r}),!t)return this.client.search(n).then((function(e){return i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),{content:new l(r,e.results),state:r,_originalResponse:e}}),(function(e){throw i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),e}));this.client.search(n).then((function(e){i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),t(null,new l(r,e.results),r)})).catch((function(e){i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),t(e,null,r)}))},d.prototype.findAnswers=function(e){console.warn("[algoliasearch-helper] answers is no longer supported");var t=this.state,r=this.derivedHelpers[0];if(!r)return Promise.resolve([]);var n=r.getModifiedState(t),i=c({attributesForPrediction:e.attributesForPrediction,nbHits:e.nbHits},{params:o(h._getHitsSearchParams(n),["attributesToSnippet","hitsPerPage","restrictSearchableAttributes","snippetEllipsisText"])}),a="search for answers was called, but this client does not have a function client.initIndex(index).findAnswers";if("function"!=typeof this.client.initIndex)throw new Error(a);var s=this.client.initIndex(n.index);if("function"!=typeof s.findAnswers)throw new Error(a);return s.findAnswers(n.query,e.queryLanguages,i)},d.prototype.searchForFacetValues=function(e,t,r,n){var i="function"==typeof this.client.searchForFacetValues,s="function"==typeof this.client.initIndex;if(!i&&!s&&"function"!=typeof this.client.search)throw new Error("search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues or client.initIndex(index).searchForFacetValues");var c=this.state.setQueryParameters(n||{}),u=c.isDisjunctiveFacet(e),o=h.getSearchForFacetQuery(e,t,r,c);this._currentNbQueries++;var f,l=this;return i?f=this.client.searchForFacetValues([{indexName:c.index,params:o}]):s?f=this.client.initIndex(c.index).searchForFacetValues(o):(delete o.facetName,f=this.client.search([{type:"facet",facet:e,indexName:c.index,params:o}]).then((function(e){return e.results[0]}))),this.emit("searchForFacetValues",{state:c,facet:e,query:t}),f.then((function(t){return l._currentNbQueries--,0===l._currentNbQueries&&l.emit("searchQueueEmpty"),(t=Array.isArray(t)?t[0]:t).facetHits.forEach((function(t){t.escapedValue=a(t.value),t.isRefined=u?c.isDisjunctiveFacetRefined(e,t.escapedValue):c.isFacetRefined(e,t.escapedValue)})),t}),(function(e){throw l._currentNbQueries--,0===l._currentNbQueries&&l.emit("searchQueueEmpty"),e}))},d.prototype.setQuery=function(e){return this._change({state:this.state.resetPage().setQuery(e),isPageReset:!0}),this},d.prototype.clearRefinements=function(e){return this._change({state:this.state.resetPage().clearRefinements(e),isPageReset:!0}),this},d.prototype.clearTags=function(){return this._change({state:this.state.resetPage().clearTags(),isPageReset:!0}),this},d.prototype.addDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)},d.prototype.addHierarchicalFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addHierarchicalFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.addNumericRefinement=function(e,t,r){return this._change({state:this.state.resetPage().addNumericRefinement(e,t,r),isPageReset:!0}),this},d.prototype.addFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)},d.prototype.addFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().addExcludeRefinement(e,t),isPageReset:!0}),this},d.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)},d.prototype.addTag=function(e){return this._change({state:this.state.resetPage().addTagRefinement(e),isPageReset:!0}),this},d.prototype.removeNumericRefinement=function(e,t,r){return this._change({state:this.state.resetPage().removeNumericRefinement(e,t,r),isPageReset:!0}),this},d.prototype.removeDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)},d.prototype.removeHierarchicalFacetRefinement=function(e){return this._change({state:this.state.resetPage().removeHierarchicalFacetRefinement(e),isPageReset:!0}),this},d.prototype.removeFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)},d.prototype.removeFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().removeExcludeRefinement(e,t),isPageReset:!0}),this},d.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)},d.prototype.removeTag=function(e){return this._change({state:this.state.resetPage().removeTagRefinement(e),isPageReset:!0}),this},d.prototype.toggleFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().toggleExcludeFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)},d.prototype.toggleRefinement=function(e,t){return this.toggleFacetRefinement(e,t)},d.prototype.toggleFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().toggleFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.toggleRefine=function(){return this.toggleFacetRefinement.apply(this,arguments)},d.prototype.toggleTag=function(e){return this._change({state:this.state.resetPage().toggleTagRefinement(e),isPageReset:!0}),this},d.prototype.nextPage=function(){var e=this.state.page||0;return this.setPage(e+1)},d.prototype.previousPage=function(){var e=this.state.page||0;return this.setPage(e-1)},d.prototype.setCurrentPage=p,d.prototype.setPage=p,d.prototype.setIndex=function(e){return this._change({state:this.state.resetPage().setIndex(e),isPageReset:!0}),this},d.prototype.setQueryParameter=function(e,t){return this._change({state:this.state.resetPage().setQueryParameter(e,t),isPageReset:!0}),this},d.prototype.setState=function(e){return this._change({state:f.make(e),isPageReset:!1}),this},d.prototype.overrideStateWithoutTriggeringChangeEvent=function(e){return this.state=new f(e),this},d.prototype.hasRefinements=function(e){return!!u(this.state.getNumericRefinements(e))||(this.state.isConjunctiveFacet(e)?this.state.isFacetRefined(e):this.state.isDisjunctiveFacet(e)?this.state.isDisjunctiveFacetRefined(e):!!this.state.isHierarchicalFacet(e)&&this.state.isHierarchicalFacetRefined(e))},d.prototype.isExcluded=function(e,t){return this.state.isExcludeRefined(e,t)},d.prototype.isDisjunctiveRefined=function(e,t){return this.state.isDisjunctiveFacetRefined(e,t)},d.prototype.hasTag=function(e){return this.state.isTagRefined(e)},d.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)},d.prototype.getIndex=function(){return this.state.index},d.prototype.getCurrentPage=v,d.prototype.getPage=v,d.prototype.getTags=function(){return this.state.tagRefinements},d.prototype.getRefinements=function(e){var t=[];if(this.state.isConjunctiveFacet(e))this.state.getConjunctiveRefinements(e).forEach((function(e){t.push({value:e,type:"conjunctive"})})),this.state.getExcludeRefinements(e).forEach((function(e){t.push({value:e,type:"exclude"})}));else if(this.state.isDisjunctiveFacet(e)){this.state.getDisjunctiveRefinements(e).forEach((function(e){t.push({value:e,type:"disjunctive"})}))}var r=this.state.getNumericRefinements(e);return Object.keys(r).forEach((function(e){var n=r[e];t.push({value:n,operator:e,type:"numeric"})})),t},d.prototype.getNumericRefinement=function(e,t){return this.state.getNumericRefinement(e,t)},d.prototype.getHierarchicalFacetBreadcrumb=function(e){return this.state.getHierarchicalFacetBreadcrumb(e)},d.prototype._search=function(e){var t=this.state,r=[],n=[];e.onlyWithDerivedHelpers||(n=h._getQueries(t.index,t),r.push({state:t,queriesCount:n.length,helper:this}),this.emit("search",{state:t,results:this.lastResults}));var i=this.derivedHelpers.map((function(e){var n=e.getModifiedState(t),i=n.index?h._getQueries(n.index,n):[];return r.push({state:n,queriesCount:i.length,helper:e}),e.emit("search",{state:n,results:e.lastResults}),i})),a=Array.prototype.concat.apply(n,i),s=this._queryId++;if(this._currentNbQueries++,!a.length)return Promise.resolve({results:[]}).then(this._dispatchAlgoliaResponse.bind(this,r,s));try{this.client.search(a).then(this._dispatchAlgoliaResponse.bind(this,r,s)).catch(this._dispatchAlgoliaError.bind(this,s))}catch(c){this.emit("error",{error:c})}},d.prototype._dispatchAlgoliaResponse=function(e,t,r){if(!(t<this._lastQueryIdReceived)){this._currentNbQueries-=t-this._lastQueryIdReceived,this._lastQueryIdReceived=t,0===this._currentNbQueries&&this.emit("searchQueueEmpty");var n=r.results.slice();e.forEach((function(e){var t=e.state,r=e.queriesCount,i=e.helper,a=n.splice(0,r);t.index?(i.lastResults=new l(t,a),i.emit("result",{results:i.lastResults,state:t})):i.emit("result",{results:null,state:t})}))}},d.prototype._dispatchAlgoliaError=function(e,t){e<this._lastQueryIdReceived||(this._currentNbQueries-=e-this._lastQueryIdReceived,this._lastQueryIdReceived=e,this.emit("error",{error:t}),0===this._currentNbQueries&&this.emit("searchQueueEmpty"))},d.prototype.containsRefinement=function(e,t,r,n){return e||0!==t.length||0!==r.length||0!==n.length},d.prototype._hasDisjunctiveRefinements=function(e){return this.state.disjunctiveRefinements[e]&&this.state.disjunctiveRefinements[e].length>0},d.prototype._change=function(e){var t=e.state,r=e.isPageReset;t!==this.state&&(this.state=t,this.emit("change",{state:this.state,results:this.lastResults,isPageReset:r}))},d.prototype.clearCache=function(){return this.client.clearCache&&this.client.clearCache(),this},d.prototype.setClient=function(e){return this.client===e||("function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper ("+m+")"),this.client=e),this},d.prototype.getClient=function(){return this.client},d.prototype.derive=function(e){var t=new i(this,e);return this.derivedHelpers.push(t),t},d.prototype.detachDerivedHelper=function(e){var t=this.derivedHelpers.indexOf(e);if(-1===t)throw new Error("Derived helper already detached");this.derivedHelpers.splice(t,1)},d.prototype.hasPendingRequests=function(){return this._currentNbQueries>0},e.exports=d},4587:e=>{"use strict";e.exports=function(e){return Array.isArray(e)?e.filter(Boolean):[]}},2344:e=>{"use strict";e.exports=function(){return Array.prototype.slice.call(arguments).reduceRight((function(e,t){return Object.keys(Object(t)).forEach((function(r){void 0!==t[r]&&(void 0!==e[r]&&delete e[r],e[r]=t[r])})),e}),{})}},4039:e=>{"use strict";e.exports={escapeFacetValue:function(e){return"string"!=typeof e?e:String(e).replace(/^-/,"\\-")},unescapeFacetValue:function(e){return"string"!=typeof e?e:e.replace(/^\\-/,"-")}}},7888:e=>{"use strict";e.exports=function(e,t){if(Array.isArray(e))for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}},9725:e=>{"use strict";e.exports=function(e,t){if(!Array.isArray(e))return-1;for(var r=0;r<e.length;r++)if(t(e[r]))return r;return-1}},2293:(e,t,r)=>{"use strict";var n=r(7888);e.exports=function(e,t){var r=(t||[]).map((function(e){return e.split(":")}));return e.reduce((function(e,t){var i=t.split(":"),a=n(r,(function(e){return e[0]===i[0]}));return i.length>1||!a?(e[0].push(i[0]),e[1].push(i[1]),e):(e[0].push(a[0]),e[1].push(a[1]),e)}),[[],[]])}},4853:e=>{"use strict";e.exports=function(e,t){e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}},2686:e=>{"use strict";e.exports=function(e,t){return e.filter((function(r,n){return t.indexOf(r)>-1&&e.indexOf(r)===n}))}},185:e=>{"use strict";function t(e){return"function"==typeof e||Array.isArray(e)||"[object Object]"===Object.prototype.toString.call(e)}function r(e,n){if(e===n)return e;for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&"__proto__"!==i&&"constructor"!==i){var a=n[i],s=e[i];void 0!==s&&void 0===a||(t(s)&&t(a)?e[i]=r(s,a):e[i]="object"==typeof(c=a)&&null!==c?r(Array.isArray(c)?[]:{},c):c)}var c;return e}e.exports=function(e){t(e)||(e={});for(var n=1,i=arguments.length;n<i;n++){var a=arguments[n];t(a)&&r(e,a)}return e}},116:e=>{"use strict";e.exports=function(e){return e&&Object.keys(e).length>0}},9803:e=>{"use strict";e.exports=function(e,t){if(null===e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}},2148:e=>{"use strict";function t(e,t){if(e!==t){var r=void 0!==e,n=null===e,i=void 0!==t,a=null===t;if(!a&&e>t||n&&i||!r)return 1;if(!n&&e<t||a&&r||!i)return-1}return 0}e.exports=function(e,r,n){if(!Array.isArray(e))return[];Array.isArray(n)||(n=[]);var i=e.map((function(e,t){return{criteria:r.map((function(t){return e[t]})),index:t,value:e}}));return i.sort((function(e,r){for(var i=-1;++i<e.criteria.length;){var a=t(e.criteria[i],r.criteria[i]);if(a)return i>=n.length?a:"desc"===n[i]?-a:a}return e.index-r.index})),i.map((function(e){return e.value}))}},8023:e=>{"use strict";e.exports=function e(t){if("number"==typeof t)return t;if("string"==typeof t)return parseFloat(t);if(Array.isArray(t))return t.map(e);throw new Error("The value should be a number, a parsable string or an array of those.")}},6394:(e,t,r)=>{"use strict";var n=r(185);function i(e){return Object.keys(e).sort().reduce((function(t,r){return t[r]=e[r],t}),{})}var a={_getQueries:function(e,t){var r=[];return r.push({indexName:e,params:a._getHitsSearchParams(t)}),t.getRefinedDisjunctiveFacets().forEach((function(n){r.push({indexName:e,params:a._getDisjunctiveFacetSearchParams(t,n)})})),t.getRefinedHierarchicalFacets().forEach((function(n){var i=t.getHierarchicalFacetByName(n),s=t.getHierarchicalRefinement(n),c=t._getHierarchicalFacetSeparator(i);if(s.length>0&&s[0].split(c).length>1){var u=s[0].split(c).slice(0,-1).reduce((function(e,t,r){return e.concat({attribute:i.attributes[r],value:0===r?t:[e[e.length-1].value,t].join(c)})}),[]);u.forEach((function(n,s){var c=a._getDisjunctiveFacetSearchParams(t,n.attribute,0===s);function o(e){return i.attributes.some((function(t){return t===e.split(":")[0]}))}var h=(c.facetFilters||[]).reduce((function(e,t){if(Array.isArray(t)){var r=t.filter((function(e){return!o(e)}));r.length>0&&e.push(r)}return"string"!=typeof t||o(t)||e.push(t),e}),[]),f=u[s-1];c.facetFilters=s>0?h.concat(f.attribute+":"+f.value):h.length>0?h:void 0,r.push({indexName:e,params:c})}))}})),r},_getHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets).concat(a._getHitsHierarchicalFacetsAttributes(e)).sort(),r=a._getFacetFilters(e),s=a._getNumericFilters(e),c=a._getTagFilters(e),u={facets:t.indexOf("*")>-1?["*"]:t,tagFilters:c};return r.length>0&&(u.facetFilters=r),s.length>0&&(u.numericFilters=s),i(n({},e.getQueryParams(),u))},_getDisjunctiveFacetSearchParams:function(e,t,r){var s=a._getFacetFilters(e,t,r),c=a._getNumericFilters(e,t),u=a._getTagFilters(e),o={hitsPerPage:0,page:0,analytics:!1,clickAnalytics:!1};u.length>0&&(o.tagFilters=u);var h=e.getHierarchicalFacetByName(t);return o.facets=h?a._getDisjunctiveHierarchicalFacetAttribute(e,h,r):t,c.length>0&&(o.numericFilters=c),s.length>0&&(o.facetFilters=s),i(n({},e.getQueryParams(),o))},_getNumericFilters:function(e,t){if(e.numericFilters)return e.numericFilters;var r=[];return Object.keys(e.numericRefinements).forEach((function(n){var i=e.numericRefinements[n]||{};Object.keys(i).forEach((function(e){var a=i[e]||[];t!==n&&a.forEach((function(t){if(Array.isArray(t)){var i=t.map((function(t){return n+e+t}));r.push(i)}else r.push(n+e+t)}))}))})),r},_getTagFilters:function(e){return e.tagFilters?e.tagFilters:e.tagRefinements.join(",")},_getFacetFilters:function(e,t,r){var n=[],i=e.facetsRefinements||{};Object.keys(i).sort().forEach((function(e){(i[e]||[]).sort().forEach((function(t){n.push(e+":"+t)}))}));var a=e.facetsExcludes||{};Object.keys(a).sort().forEach((function(e){(a[e]||[]).sort().forEach((function(t){n.push(e+":-"+t)}))}));var s=e.disjunctiveFacetsRefinements||{};Object.keys(s).sort().forEach((function(e){var r=s[e]||[];if(e!==t&&r&&0!==r.length){var i=[];r.sort().forEach((function(t){i.push(e+":"+t)})),n.push(i)}}));var c=e.hierarchicalFacetsRefinements||{};return Object.keys(c).sort().forEach((function(i){var a=(c[i]||[])[0];if(void 0!==a){var s,u,o=e.getHierarchicalFacetByName(i),h=e._getHierarchicalFacetSeparator(o),f=e._getHierarchicalRootPath(o);if(t===i){if(-1===a.indexOf(h)||!f&&!0===r||f&&f.split(h).length===a.split(h).length)return;f?(u=f.split(h).length-1,a=f):(u=a.split(h).length-2,a=a.slice(0,a.lastIndexOf(h))),s=o.attributes[u]}else u=a.split(h).length-1,s=o.attributes[u];s&&n.push([s+":"+a])}})),n},_getHitsHierarchicalFacetsAttributes:function(e){return e.hierarchicalFacets.reduce((function(t,r){var n=e.getHierarchicalRefinement(r.name)[0];if(!n)return t.push(r.attributes[0]),t;var i=e._getHierarchicalFacetSeparator(r),a=n.split(i).length,s=r.attributes.slice(0,a+1);return t.concat(s)}),[])},_getDisjunctiveHierarchicalFacetAttribute:function(e,t,r){var n=e._getHierarchicalFacetSeparator(t);if(!0===r){var i=e._getHierarchicalRootPath(t),a=0;return i&&(a=i.split(n).length),[t.attributes[a]]}var s=(e.getHierarchicalRefinement(t.name)[0]||"").split(n).length-1;return t.attributes.slice(0,s+1)},getSearchForFacetQuery:function(e,t,r,s){var c=s.isDisjunctiveFacet(e)?s.clearRefinements(e):s,u={facetQuery:t,facetName:e};return"number"==typeof r&&(u.maxFacetHits=r),i(n({},a._getHitsSearchParams(c),u))}};e.exports=a},6801:e=>{"use strict";e.exports=function(e){return null!==e&&/^[a-zA-Z0-9_-]{1,64}$/.test(e)}},4336:e=>{"use strict";e.exports="3.15.0"},290:function(e){e.exports=function(){"use strict";function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(r){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){e(r,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))}))}return r}function n(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var s,c=e[Symbol.iterator]();!(n=(s=c.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==c.return||c.return()}finally{if(i)throw a}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function a(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function s(e){var t,r="algoliasearch-client-js-".concat(e.key),n=function(){return void 0===t&&(t=e.localStorage||window.localStorage),t},a=function(){return JSON.parse(n().getItem(r)||"{}")},s=function(e){n().setItem(r,JSON.stringify(e))},c=function(){var t=e.timeToLive?1e3*e.timeToLive:null,r=a(),n=Object.fromEntries(Object.entries(r).filter((function(e){return void 0!==i(e,2)[1].timestamp})));if(s(n),t){var c=Object.fromEntries(Object.entries(n).filter((function(e){var r=i(e,2)[1],n=(new Date).getTime();return!(r.timestamp+t<n)})));s(c)}};return{get:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){c();var t=JSON.stringify(e);return a()[t]})).then((function(e){return Promise.all([e?e.value:t(),void 0!==e])})).then((function(e){var t=i(e,2),n=t[0],a=t[1];return Promise.all([n,a||r.miss(n)])})).then((function(e){return i(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var i=a();return i[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},n().setItem(r,JSON.stringify(i)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=a();delete t[JSON.stringify(e)],n().setItem(r,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){n().removeItem(r)}))}}}function c(e){var t=a(e.caches),r=t.shift();return void 0===r?{get:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then((function(e){return Promise.all([e,r.miss(e)])})).then((function(e){return i(e,1)[0]}))},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return r.get(e,n,i).catch((function(){return c({caches:t}).get(e,n,i)}))},set:function(e,n){return r.set(e,n).catch((function(){return c({caches:t}).set(e,n)}))},delete:function(e){return r.delete(e).catch((function(){return c({caches:t}).delete(e)}))},clear:function(){return r.clear().catch((function(){return c({caches:t}).clear()}))}}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(r,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},a=JSON.stringify(r);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);var s=n(),c=i&&i.miss||function(){return Promise.resolve()};return s.then((function(e){return c(e)})).then((function(){return s}))},set:function(r,n){return t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function o(e){for(var t=e.length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function h(e,t){return t?(Object.keys(t).forEach((function(r){e[r]=t[r](e)})),e):e}function f(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=0;return e.replace(/%s/g,(function(){return encodeURIComponent(r[i++])}))}var l={WithinQueryParameters:0,WithinHeaders:1};function m(e,t){var r=e||{},n=r.data||{};return Object.keys(r).forEach((function(e){-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(n[e]=r[e])})),{data:Object.entries(n).length>0?n:void 0,timeout:r.timeout||t,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}var d={Read:1,Write:2,Any:3},p=1,v=2,g=3;function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;return r(r({},e),{},{status:t,lastUpdate:Date.now()})}function R(e){return"string"==typeof e?{protocol:"https",url:e,accept:d.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||d.Any}}var F="GET",b="POST";function P(e,t){return Promise.all(t.map((function(t){return e.get(t,(function(){return Promise.resolve(y(t))}))}))).then((function(e){var r=e.filter((function(e){return function(e){return e.status===p||Date.now()-e.lastUpdate>12e4}(e)})),n=e.filter((function(e){return function(e){return e.status===g&&Date.now()-e.lastUpdate<=12e4}(e)})),i=[].concat(a(r),a(n));return{getTimeout:function(e,t){return(0===n.length&&0===e?1:n.length+3+e)*t},statelessHosts:i.length>0?i.map((function(e){return R(e)})):t}}))}function j(e,t,n,i){var s=[],c=function(e,t){if(e.method!==F&&(void 0!==e.data||void 0!==t.data)){var n=Array.isArray(e.data)?e.data:r(r({},e.data),t.data);return JSON.stringify(n)}}(n,i),u=function(e,t){var n=r(r({},e.headers),t.headers),i={};return Object.keys(n).forEach((function(e){var t=n[e];i[e.toLowerCase()]=t})),i}(e,i),o=n.method,h=n.method!==F?{}:r(r({},n.data),i.data),f=r(r(r({"x-algolia-agent":e.userAgent.value},e.queryParameters),h),i.queryParameters),l=0,m=function t(r,a){var h=r.pop();if(void 0===h)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:O(s)};var m={data:c,headers:u,method:o,url:E(h,n.path,f),connectTimeout:a(l,e.timeouts.connect),responseTimeout:a(l,i.timeout)},d=function(e){var t={request:m,response:e,host:h,triesLeft:r.length};return s.push(t),t},p={onSuccess:function(e){return function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e)},onRetry:function(n){var i=d(n);return n.isTimedOut&&l++,Promise.all([e.logger.info("Retryable failure",w(i)),e.hostsCache.set(h,y(h,n.isTimedOut?g:v))]).then((function(){return t(r,a)}))},onFail:function(e){throw d(e),function(e,t){var r=e.content,n=e.status,i=r;try{i=JSON.parse(r).message}catch(e){}return function(e,t,r){return{name:"ApiError",message:e,status:t,transporterStackTrace:r}}(i,n,t)}(e,O(s))}};return e.requester.send(m).then((function(e){return function(e,t){return function(e){var t=e.status;return e.isTimedOut||function(e){var t=e.isTimedOut,r=e.status;return!t&&0==~~r}(e)||2!=~~(t/100)&&4!=~~(t/100)}(e)?t.onRetry(e):2==~~(e.status/100)?t.onSuccess(e):t.onFail(e)}(e,p)}))};return P(e.hostsCache,t).then((function(e){return m(a(e.statelessHosts).reverse(),e.getTimeout)}))}function _(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var r="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(r)&&(t.value="".concat(t.value).concat(r)),t}};return t}function E(e,t,r){var n=x(r),i="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return n.length&&(i+="?".concat(n)),i}function x(e){return Object.keys(e).map((function(t){return f("%s=%s",t,(r=e[t],"[object Object]"===Object.prototype.toString.call(r)||"[object Array]"===Object.prototype.toString.call(r)?JSON.stringify(e[t]):e[t]));var r})).join("&")}function O(e){return e.map((function(e){return w(e)}))}function w(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return r(r({},e),{},{request:r(r({},e.request),{},{headers:r(r({},e.request.headers),t)})})}var N=function(e){var t=e.appId,n=function(e,t,r){var n={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers:function(){return e===l.WithinHeaders?n:{}},queryParameters:function(){return e===l.WithinQueryParameters?n:{}}}}(void 0!==e.authMode?e.authMode:l.WithinHeaders,t,e.apiKey),a=function(e){var t=e.hostsCache,r=e.logger,n=e.requester,a=e.requestsCache,s=e.responsesCache,c=e.timeouts,u=e.userAgent,o=e.hosts,h=e.queryParameters,f={hostsCache:t,logger:r,requester:n,requestsCache:a,responsesCache:s,timeouts:c,userAgent:u,headers:e.headers,queryParameters:h,hosts:o.map((function(e){return R(e)})),read:function(e,t){var r=m(t,f.timeouts.read),n=function(){return j(f,f.hosts.filter((function(e){return 0!=(e.accept&d.Read)})),e,r)};if(!0!==(void 0!==r.cacheable?r.cacheable:e.cacheable))return n();var a={request:e,mappedRequestOptions:r,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(a,(function(){return f.requestsCache.get(a,(function(){return f.requestsCache.set(a,n()).then((function(e){return Promise.all([f.requestsCache.delete(a),e])}),(function(e){return Promise.all([f.requestsCache.delete(a),Promise.reject(e)])})).then((function(e){var t=i(e,2);return t[0],t[1]}))}))}),{miss:function(e){return f.responsesCache.set(a,e)}})},write:function(e,t){return j(f,f.hosts.filter((function(e){return 0!=(e.accept&d.Write)})),e,m(t,f.timeouts.write))}};return f}(r(r({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:d.Read},{url:"".concat(t,".algolia.net"),accept:d.Write}].concat(o([{url:"".concat(t,"-1.algolianet.com")},{url:"".concat(t,"-2.algolianet.com")},{url:"".concat(t,"-3.algolianet.com")}]))},e),{},{headers:r(r(r({},n.headers()),{"content-type":"application/x-www-form-urlencoded"}),e.headers),queryParameters:r(r({},n.queryParameters()),e.queryParameters)}));return h({transporter:a,appId:t,addAlgoliaAgent:function(e,t){a.userAgent.add({segment:e,version:t})},clearCache:function(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then((function(){}))}},e.methods)},A=function(e){return function(t,r){return t.method===F?e.transporter.read(t,r):e.transporter.write(t,r)}},H=function(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h({transporter:e.transporter,appId:e.appId,indexName:t},r.methods)}},S=function(e){return function(t,n){var i=t.map((function(e){return r(r({},e),{},{params:x(e.params||{})})}));return e.transporter.read({method:b,path:"1/indexes/*/queries",data:{requests:i},cacheable:!0},n)}},T=function(e){return function(t,i){return Promise.all(t.map((function(t){var a=t.params,s=a.facetName,c=a.facetQuery,u=n(a,["facetName","facetQuery"]);return H(e)(t.indexName,{methods:{searchForFacetValues:I}}).searchForFacetValues(s,c,r(r({},i),u))})))}},Q=function(e){return function(t,r,n){return e.transporter.read({method:b,path:f("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:r},cacheable:!0},n)}},C=function(e){return function(t,r){return e.transporter.read({method:b,path:f("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},r)}},I=function(e){return function(t,r,n){return e.transporter.read({method:b,path:f("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:r},cacheable:!0},n)}},k=1,D=2,q=3;function V(e,t,n){var i,a={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(e){return new Promise((function(t){var r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return r.setRequestHeader(t,e.headers[t])}));var n,i=function(e,n){return setTimeout((function(){r.abort(),t({status:0,content:n,isTimedOut:!0})}),1e3*e)},a=i(e.connectTimeout,"Connection timeout");r.onreadystatechange=function(){r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=i(e.responseTimeout,"Socket timeout"))},r.onerror=function(){0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=function(){clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},logger:(i=q,{debug:function(e,t){return k>=i&&console.debug(e,t),Promise.resolve()},info:function(e,t){return D>=i&&console.info(e,t),Promise.resolve()},error:function(e,t){return console.error(e,t),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:c({caches:[s({key:"".concat("4.20.0","-").concat(e)}),u()]}),userAgent:_("4.20.0").add({segment:"Browser",version:"lite"}),authMode:l.WithinQueryParameters};return N(r(r(r({},a),n),{},{methods:{search:S,searchForFacetValues:T,multipleQueries:S,multipleSearchForFacetValues:T,customRequest:A,initIndex:function(e){return function(t){return H(e)(t,{methods:{search:C,searchForFacetValues:I,findAnswers:Q}})}}}}))}return V.version="4.20.0",V}()},6675:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>A});var n=r(7294),i=r(6010),a=r(8131),s=r.n(a),c=r(290),u=r.n(c),o=r(412),h=r(5742),f=r(9960),l=r(143),m=r(2263);const d=["zero","one","two","few","many","other"];function p(e){return d.filter((t=>e.includes(t)))}const v={locale:"en",pluralForms:p(["one","other"]),select:e=>1===e?"one":"other"};function g(){const{i18n:{currentLocale:e}}=(0,m.Z)();return(0,n.useMemo)((()=>{try{return function(e){const t=new Intl.PluralRules(e);return{locale:e,pluralForms:p(t.resolvedOptions().pluralCategories),select:e=>t.select(e)}}(e)}catch(t){return console.error(`Failed to use Intl.PluralRules for locale "${e}".\nDocusaurus will fallback to the default (English) implementation.\nError: ${t.message}\n`),v}}),[e])}function y(){const e=g();return{selectMessage:(t,r)=>function(e,t,r){const n=e.split("|");if(1===n.length)return n[0];n.length>r.pluralForms.length&&console.error(`For locale=${r.locale}, a maximum of ${r.pluralForms.length} plural forms are expected (${r.pluralForms.join(",")}), but the message contains ${n.length}: ${e}`);const i=r.select(t),a=r.pluralForms.indexOf(i);return n[Math.min(a,n.length-1)]}(r,t,e)}}var R=r(6177),F=r(902),b=r(833),P=r(2128),j=r(5999),_=r(6278),E=r(239),x=r(7452);const O={searchQueryInput:"searchQueryInput_u2C7",searchVersionInput:"searchVersionInput_m0Ui",searchResultsColumn:"searchResultsColumn_JPFH",algoliaLogo:"algoliaLogo_rT1R",algoliaLogoPathFill:"algoliaLogoPathFill_WdUC",searchResultItem:"searchResultItem_Tv2o",searchResultItemHeading:"searchResultItemHeading_KbCB",searchResultItemPath:"searchResultItemPath_lhe1",searchResultItemSummary:"searchResultItemSummary_AEaO",searchQueryColumn:"searchQueryColumn_RTkw",searchVersionColumn:"searchVersionColumn_ypXd",searchLogoColumn:"searchLogoColumn_rJIA",loadingSpinner:"loadingSpinner_XVxU","loading-spin":"loading-spin_vzvp",loader:"loader_vvXV"};function w(e){let{docsSearchVersionsHelpers:t}=e;const r=Object.entries(t.allDocsData).filter((e=>{let[,t]=e;return t.versions.length>1}));return n.createElement("div",{className:(0,i.Z)("col","col--3","padding-left--none",O.searchVersionColumn)},r.map((e=>{let[i,a]=e;const s=r.length>1?`${i}: `:"";return n.createElement("select",{key:i,onChange:e=>t.setSearchVersion(i,e.target.value),defaultValue:t.searchVersions[i],className:O.searchVersionInput},a.versions.map(((e,t)=>n.createElement("option",{key:t,label:`${s}${e.label}`,value:e.name}))))})))}function N(){const{i18n:{currentLocale:e}}=(0,m.Z)(),{algolia:{appId:t,apiKey:r,indexName:a}}=(0,_.L)(),c=(0,E.l)(),d=function(){const{selectMessage:e}=y();return t=>e(t,(0,j.I)({id:"theme.SearchPage.documentsFound.plurals",description:'Pluralized label for "{count} documents found". Use as much plural forms (separated by "|") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)',message:"One document found|{count} documents found"},{count:t}))}(),p=function(){const e=(0,l._r)(),[t,r]=(0,n.useState)((()=>Object.entries(e).reduce(((e,t)=>{let[r,n]=t;return{...e,[r]:n.versions[0].name}}),{}))),i=Object.values(e).some((e=>e.versions.length>1));return{allDocsData:e,versioningEnabled:i,searchVersions:t,setSearchVersion:(e,t)=>r((r=>({...r,[e]:t})))}}(),[v,g]=(0,R.K)(),b={items:[],query:null,totalResults:null,totalPages:null,lastPage:null,hasMore:null,loading:null},[N,A]=(0,n.useReducer)(((e,t)=>{switch(t.type){case"reset":return b;case"loading":return{...e,loading:!0};case"update":return v!==t.value.query?e:{...t.value,items:0===t.value.lastPage?t.value.items:e.items.concat(t.value.items)};case"advance":{const t=e.totalPages>e.lastPage+1;return{...e,lastPage:t?e.lastPage+1:e.lastPage,hasMore:t}}default:return e}}),b),H=u()(t,r),S=s()(H,a,{hitsPerPage:15,advancedSyntax:!0,disjunctiveFacets:["language","docusaurus_tag"]});S.on("result",(e=>{let{results:{query:t,hits:r,page:n,nbHits:i,nbPages:a}}=e;if(""===t||!Array.isArray(r))return void A({type:"reset"});const s=e=>e.replace(/algolia-docsearch-suggestion--highlight/g,"search-result-match"),u=r.map((e=>{let{url:t,_highlightResult:{hierarchy:r},_snippetResult:n={}}=e;const i=Object.keys(r).map((e=>s(r[e].value)));return{title:i.pop(),url:c(t),summary:n.content?`${s(n.content.value)}...`:"",breadcrumbs:i}}));A({type:"update",value:{items:u,query:t,totalResults:i,totalPages:a,lastPage:n,hasMore:a>n+1,loading:!1}})}));const[T,Q]=(0,n.useState)(null),C=(0,n.useRef)(0),I=(0,n.useRef)(o.Z.canUseIntersectionObserver&&new IntersectionObserver((e=>{const{isIntersecting:t,boundingClientRect:{y:r}}=e[0];t&&C.current>r&&A({type:"advance"}),C.current=r}),{threshold:1})),k=()=>v?(0,j.I)({id:"theme.SearchPage.existingResultsTitle",message:'Search results for "{query}"',description:"The search page title for non-empty query"},{query:v}):(0,j.I)({id:"theme.SearchPage.emptyResultsTitle",message:"Search the documentation",description:"The search page title for empty query"}),D=(0,F.zX)((function(t){void 0===t&&(t=0),S.addDisjunctiveFacetRefinement("docusaurus_tag","default"),S.addDisjunctiveFacetRefinement("language",e),Object.entries(p.searchVersions).forEach((e=>{let[t,r]=e;S.addDisjunctiveFacetRefinement("docusaurus_tag",`docs-${t}-${r}`)})),S.setQuery(v).setPage(t).search()}));return(0,n.useEffect)((()=>{if(!T)return;const e=I.current;return e?(e.observe(T),()=>e.unobserve(T)):()=>!0}),[T]),(0,n.useEffect)((()=>{A({type:"reset"}),v&&(A({type:"loading"}),setTimeout((()=>{D()}),300))}),[v,p.searchVersions,D]),(0,n.useEffect)((()=>{N.lastPage&&0!==N.lastPage&&D(N.lastPage)}),[D,N.lastPage]),n.createElement(x.Z,null,n.createElement(h.Z,null,n.createElement("title",null,(0,P.p)(k())),n.createElement("meta",{property:"robots",content:"noindex, follow"})),n.createElement("div",{className:"container margin-vert--lg"},n.createElement("h1",null,k()),n.createElement("form",{className:"row",onSubmit:e=>e.preventDefault()},n.createElement("div",{className:(0,i.Z)("col",O.searchQueryColumn,{"col--9":p.versioningEnabled,"col--12":!p.versioningEnabled})},n.createElement("input",{type:"search",name:"q",className:O.searchQueryInput,placeholder:(0,j.I)({id:"theme.SearchPage.inputPlaceholder",message:"Type your search here",description:"The placeholder for search page input"}),"aria-label":(0,j.I)({id:"theme.SearchPage.inputLabel",message:"Search",description:"The ARIA label for search page input"}),onChange:e=>g(e.target.value),value:v,autoComplete:"off",autoFocus:!0})),p.versioningEnabled&&n.createElement(w,{docsSearchVersionsHelpers:p})),n.createElement("div",{className:"row"},n.createElement("div",{className:(0,i.Z)("col","col--8",O.searchResultsColumn)},!!N.totalResults&&d(N.totalResults)),n.createElement("div",{className:(0,i.Z)("col","col--4","text--right",O.searchLogoColumn)},n.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://www.algolia.com/","aria-label":(0,j.I)({id:"theme.SearchPage.algoliaLabel",message:"Search by Algolia",description:"The ARIA label for Algolia mention"})},n.createElement("svg",{viewBox:"0 0 168 24",className:O.algoliaLogo},n.createElement("g",{fill:"none"},n.createElement("path",{className:O.algoliaLogoPathFill,d:"M120.925 18.804c-4.386.02-4.386-3.54-4.386-4.106l-.007-13.336 2.675-.424v13.254c0 .322 0 2.358 1.718 2.364v2.248zm-10.846-2.18c.821 0 1.43-.047 1.855-.129v-2.719a6.334 6.334 0 0 0-1.574-.199 5.7 5.7 0 0 0-.897.069 2.699 2.699 0 0 0-.814.24c-.24.116-.439.28-.582.491-.15.212-.219.335-.219.656 0 .628.219.991.616 1.23s.938.362 1.615.362zm-.233-9.7c.883 0 1.629.109 2.231.328.602.218 1.088.525 1.444.915.363.396.609.922.76 1.483.157.56.232 1.175.232 1.85v6.874a32.5 32.5 0 0 1-1.868.314c-.834.123-1.772.185-2.813.185-.69 0-1.327-.069-1.895-.198a4.001 4.001 0 0 1-1.471-.636 3.085 3.085 0 0 1-.951-1.134c-.226-.465-.343-1.12-.343-1.803 0-.656.13-1.073.384-1.525a3.24 3.24 0 0 1 1.047-1.106c.445-.287.95-.492 1.532-.615a8.8 8.8 0 0 1 1.82-.185 8.404 8.404 0 0 1 1.972.24v-.438c0-.307-.035-.6-.11-.874a1.88 1.88 0 0 0-.384-.73 1.784 1.784 0 0 0-.724-.493 3.164 3.164 0 0 0-1.143-.205c-.616 0-1.177.075-1.69.164a7.735 7.735 0 0 0-1.26.307l-.321-2.192c.335-.117.834-.233 1.478-.349a10.98 10.98 0 0 1 2.073-.178zm52.842 9.626c.822 0 1.43-.048 1.854-.13V13.7a6.347 6.347 0 0 0-1.574-.199c-.294 0-.595.021-.896.069a2.7 2.7 0 0 0-.814.24 1.46 1.46 0 0 0-.582.491c-.15.212-.218.335-.218.656 0 .628.218.991.615 1.23.404.245.938.362 1.615.362zm-.226-9.694c.883 0 1.629.108 2.231.327.602.219 1.088.526 1.444.915.355.39.609.923.759 1.483a6.8 6.8 0 0 1 .233 1.852v6.873c-.41.088-1.034.19-1.868.314-.834.123-1.772.184-2.813.184-.69 0-1.327-.068-1.895-.198a4.001 4.001 0 0 1-1.471-.635 3.085 3.085 0 0 1-.951-1.134c-.226-.465-.343-1.12-.343-1.804 0-.656.13-1.073.384-1.524.26-.45.608-.82 1.047-1.107.445-.286.95-.491 1.532-.614a8.803 8.803 0 0 1 2.751-.13c.329.034.671.096 1.04.185v-.437a3.3 3.3 0 0 0-.109-.875 1.873 1.873 0 0 0-.384-.731 1.784 1.784 0 0 0-.724-.492 3.165 3.165 0 0 0-1.143-.205c-.616 0-1.177.075-1.69.164a7.75 7.75 0 0 0-1.26.307l-.321-2.193c.335-.116.834-.232 1.478-.348a11.633 11.633 0 0 1 2.073-.177zm-8.034-1.271a1.626 1.626 0 0 1-1.628-1.62c0-.895.725-1.62 1.628-1.62.904 0 1.63.725 1.63 1.62 0 .895-.733 1.62-1.63 1.62zm1.348 13.22h-2.689V7.27l2.69-.423v11.956zm-4.714 0c-4.386.02-4.386-3.54-4.386-4.107l-.008-13.336 2.676-.424v13.254c0 .322 0 2.358 1.718 2.364v2.248zm-8.698-5.903c0-1.156-.253-2.119-.746-2.788-.493-.677-1.183-1.01-2.067-1.01-.882 0-1.574.333-2.065 1.01-.493.676-.733 1.632-.733 2.788 0 1.168.246 1.953.74 2.63.492.683 1.183 1.018 2.066 1.018.882 0 1.574-.342 2.067-1.019.492-.683.738-1.46.738-2.63zm2.737-.007c0 .902-.13 1.584-.397 2.33a5.52 5.52 0 0 1-1.128 1.906 4.986 4.986 0 0 1-1.752 1.223c-.685.286-1.739.45-2.265.45-.528-.006-1.574-.157-2.252-.45a5.096 5.096 0 0 1-1.744-1.223c-.487-.527-.863-1.162-1.137-1.906a6.345 6.345 0 0 1-.41-2.33c0-.902.123-1.77.397-2.508a5.554 5.554 0 0 1 1.15-1.892 5.133 5.133 0 0 1 1.75-1.216c.679-.287 1.425-.423 2.232-.423.808 0 1.553.142 2.237.423a4.88 4.88 0 0 1 1.753 1.216 5.644 5.644 0 0 1 1.135 1.892c.287.738.431 1.606.431 2.508zm-20.138 0c0 1.12.246 2.363.738 2.882.493.52 1.13.78 1.91.78.424 0 .828-.062 1.204-.178.377-.116.677-.253.917-.417V9.33a10.476 10.476 0 0 0-1.766-.226c-.971-.028-1.71.37-2.23 1.004-.513.636-.773 1.75-.773 2.788zm7.438 5.274c0 1.824-.466 3.156-1.404 4.004-.936.846-2.367 1.27-4.296 1.27-.705 0-2.17-.137-3.34-.396l.431-2.118c.98.205 2.272.26 2.95.26 1.074 0 1.84-.219 2.299-.656.459-.437.684-1.086.684-1.948v-.437a8.07 8.07 0 0 1-1.047.397c-.43.13-.93.198-1.492.198-.739 0-1.41-.116-2.018-.349a4.206 4.206 0 0 1-1.567-1.025c-.431-.45-.774-1.017-1.013-1.694-.24-.677-.363-1.885-.363-2.773 0-.834.13-1.88.384-2.577.26-.696.629-1.298 1.129-1.796.493-.498 1.095-.881 1.8-1.162a6.605 6.605 0 0 1 2.428-.457c.87 0 1.67.109 2.45.24.78.129 1.444.265 1.985.415V18.17zM6.972 6.677v1.627c-.712-.446-1.52-.67-2.425-.67-.585 0-1.045.13-1.38.391a1.24 1.24 0 0 0-.502 1.03c0 .425.164.765.494 1.02.33.256.835.532 1.516.83.447.192.795.356 1.045.495.25.138.537.332.862.582.324.25.563.548.718.894.154.345.23.741.23 1.188 0 .947-.334 1.691-1.004 2.234-.67.542-1.537.814-2.601.814-1.18 0-2.16-.229-2.936-.686v-1.708c.84.628 1.814.942 2.92.942.585 0 1.048-.136 1.388-.407.34-.271.51-.646.51-1.125 0-.287-.1-.55-.302-.79-.203-.24-.42-.42-.655-.542-.234-.123-.585-.29-1.053-.503a61.27 61.27 0 0 1-.582-.271 13.67 13.67 0 0 1-.55-.287 4.275 4.275 0 0 1-.567-.351 6.92 6.92 0 0 1-.455-.4c-.18-.17-.31-.34-.39-.51-.08-.17-.155-.37-.224-.598a2.553 2.553 0 0 1-.104-.742c0-.915.333-1.638.998-2.17.664-.532 1.523-.798 2.576-.798.968 0 1.793.17 2.473.51zm7.468 5.696v-.287c-.022-.607-.187-1.088-.495-1.444-.309-.357-.75-.535-1.324-.535-.532 0-.99.194-1.373.583-.382.388-.622.949-.717 1.683h3.909zm1.005 2.792v1.404c-.596.34-1.383.51-2.362.51-1.255 0-2.255-.377-3-1.132-.744-.755-1.116-1.744-1.116-2.968 0-1.297.34-2.316 1.021-3.055.68-.74 1.548-1.11 2.6-1.11 1.033 0 1.852.323 2.458.966.606.644.91 1.572.91 2.784 0 .33-.033.676-.096 1.038h-5.314c.107.702.405 1.239.894 1.611.49.372 1.106.558 1.85.558.862 0 1.58-.202 2.155-.606zm6.605-1.77h-1.212c-.596 0-1.045.116-1.349.35-.303.234-.454.532-.454.894 0 .372.117.664.35.877.235.213.575.32 1.022.32.51 0 .912-.142 1.204-.424.293-.281.44-.651.44-1.108v-.91zm-4.068-2.554V9.325c.627-.361 1.457-.542 2.489-.542 2.116 0 3.175 1.026 3.175 3.08V17h-1.548v-.957c-.415.68-1.143 1.02-2.186 1.02-.766 0-1.38-.22-1.843-.661-.462-.442-.694-1.003-.694-1.684 0-.776.293-1.38.878-1.81.585-.431 1.404-.647 2.457-.647h1.34V11.8c0-.554-.133-.971-.399-1.253-.266-.282-.707-.423-1.324-.423a4.07 4.07 0 0 0-2.345.718zm9.333-1.93v1.42c.394-1 1.101-1.5 2.123-1.5.148 0 .313.016.494.048v1.531a1.885 1.885 0 0 0-.75-.143c-.542 0-.989.24-1.34.718-.351.479-.527 1.048-.527 1.707V17h-1.563V8.91h1.563zm5.01 4.084c.022.82.272 1.492.75 2.019.479.526 1.15.79 2.01.79.639 0 1.235-.176 1.788-.527v1.404c-.521.319-1.186.479-1.995.479-1.265 0-2.276-.4-3.031-1.197-.755-.798-1.133-1.792-1.133-2.984 0-1.16.38-2.151 1.14-2.975.761-.825 1.79-1.237 3.088-1.237.702 0 1.346.149 1.93.447v1.436a3.242 3.242 0 0 0-1.77-.495c-.84 0-1.513.266-2.019.798-.505.532-.758 1.213-.758 2.042zM40.24 5.72v4.579c.458-1 1.293-1.5 2.505-1.5.787 0 1.42.245 1.899.734.479.49.718 1.17.718 2.042V17h-1.564v-5.106c0-.553-.14-.98-.422-1.284-.282-.303-.652-.455-1.11-.455-.531 0-1.002.202-1.411.606-.41.405-.615 1.022-.615 1.851V17h-1.563V5.72h1.563zm14.966 10.02c.596 0 1.096-.253 1.5-.758.404-.506.606-1.157.606-1.955 0-.915-.202-1.62-.606-2.114-.404-.495-.92-.742-1.548-.742-.553 0-1.05.224-1.491.67-.442.447-.662 1.133-.662 2.058 0 .958.212 1.67.638 2.138.425.469.946.703 1.563.703zM53.004 5.72v4.42c.574-.894 1.388-1.341 2.44-1.341 1.022 0 1.857.383 2.506 1.149.649.766.973 1.781.973 3.047 0 1.138-.309 2.109-.925 2.912-.617.803-1.463 1.205-2.537 1.205-1.075 0-1.894-.447-2.457-1.34V17h-1.58V5.72h1.58zm9.908 11.104l-3.223-7.913h1.739l1.005 2.632 1.26 3.415c.096-.32.48-1.458 1.15-3.415l.909-2.632h1.66l-2.92 7.866c-.777 2.074-1.963 3.11-3.559 3.11a2.92 2.92 0 0 1-.734-.079v-1.34c.17.042.351.064.543.064 1.032 0 1.755-.57 2.17-1.708z"}),n.createElement("path",{fill:"#5468FF",d:"M78.988.938h16.594a2.968 2.968 0 0 1 2.966 2.966V20.5a2.967 2.967 0 0 1-2.966 2.964H78.988a2.967 2.967 0 0 1-2.966-2.964V3.897A2.961 2.961 0 0 1 78.988.938z"}),n.createElement("path",{fill:"white",d:"M89.632 5.967v-.772a.978.978 0 0 0-.978-.977h-2.28a.978.978 0 0 0-.978.977v.793c0 .088.082.15.171.13a7.127 7.127 0 0 1 1.984-.28c.65 0 1.295.088 1.917.259.082.02.164-.04.164-.13m-6.248 1.01l-.39-.389a.977.977 0 0 0-1.382 0l-.465.465a.973.973 0 0 0 0 1.38l.383.383c.062.061.15.047.205-.014.226-.307.472-.601.746-.874.281-.28.568-.526.883-.751.068-.042.075-.137.02-.2m4.16 2.453v3.341c0 .096.104.165.192.117l2.97-1.537c.068-.034.089-.117.055-.184a3.695 3.695 0 0 0-3.08-1.866c-.068 0-.136.054-.136.13m0 8.048a4.489 4.489 0 0 1-4.49-4.482 4.488 4.488 0 0 1 4.49-4.482 4.488 4.488 0 0 1 4.489 4.482 4.484 4.484 0 0 1-4.49 4.482m0-10.85a6.363 6.363 0 1 0 0 12.729 6.37 6.37 0 0 0 6.372-6.368 6.358 6.358 0 0 0-6.371-6.36"})))))),N.items.length>0?n.createElement("main",null,N.items.map(((e,t)=>{let{title:r,url:a,summary:s,breadcrumbs:c}=e;return n.createElement("article",{key:t,className:O.searchResultItem},n.createElement("h2",{className:O.searchResultItemHeading},n.createElement(f.Z,{to:a,dangerouslySetInnerHTML:{__html:r}})),c.length>0&&n.createElement("nav",{"aria-label":"breadcrumbs"},n.createElement("ul",{className:(0,i.Z)("breadcrumbs",O.searchResultItemPath)},c.map(((e,t)=>n.createElement("li",{key:t,className:"breadcrumbs__item",dangerouslySetInnerHTML:{__html:e}}))))),s&&n.createElement("p",{className:O.searchResultItemSummary,dangerouslySetInnerHTML:{__html:s}}))}))):[v&&!N.loading&&n.createElement("p",{key:"no-results"},n.createElement(j.Z,{id:"theme.SearchPage.noResultsText",description:"The paragraph for empty search result"},"No results were found")),!!N.loading&&n.createElement("div",{key:"spinner",className:O.loadingSpinner})],N.hasMore&&n.createElement("div",{className:O.loader,ref:Q},n.createElement(j.Z,{id:"theme.SearchPage.fetchingNewResults",description:"The paragraph for fetching new search results"},"Fetching new results..."))))}function A(){return n.createElement(b.FG,{className:"search-page-wrapper"},n.createElement(N,null))}}}]); \ No newline at end of file diff --git a/assets/js/1a4e3797.98c7b9ce.js.LICENSE.txt b/assets/js/1a4e3797.98c7b9ce.js.LICENSE.txt new file mode 100644 index 0000000..8c17e74 --- /dev/null +++ b/assets/js/1a4e3797.98c7b9ce.js.LICENSE.txt @@ -0,0 +1 @@ +/*! algoliasearch-lite.umd.js | 4.20.0 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */ diff --git a/assets/js/1ae06ce2.b025e158.js b/assets/js/1ae06ce2.b025e158.js new file mode 100644 index 0000000..a676cdc --- /dev/null +++ b/assets/js/1ae06ce2.b025e158.js @@ -0,0 +1 @@ +(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[2432],{9874:(e,t,o)=>{"use strict";o.r(t),o.d(t,{assets:()=>f,contentTitle:()=>l,default:()=>x,frontMatter:()=>d,metadata:()=>b,toc:()=>m});var r=o(7462),n=o(7294),a=o(3905),i=o(2933),c=o(4996);const s={openapidoc:"openapidoc_oorz"};function p(e){let{src:t}=e;const o=(0,c.Z)(t);return n.createElement("div",{className:s.openapidoc},n.createElement(i.RedocStandalone,{specUrl:o,options:{disableSearch:!0,nativeScrollbars:!0,hideHostname:!0,pathInMiddlePanel:!0,scrollYOffset:"nav.navbar--fixed-top",theme:{colors:{primary:{main:"#5217b8"},secondary:{main:"#ffb300"}},sidebar:{width:"0px"}}}}))}const d={title:"Web Proxy API",sidebar_position:5,hide_table_of_contents:!0,hide_title:!0},l=void 0,b={unversionedId:"reference/web-proxy-api",id:"reference/web-proxy-api",title:"Web Proxy API",description:"",source:"@site/docs/reference/web-proxy-api.mdx",sourceDirName:"reference",slug:"/reference/web-proxy-api",permalink:"/docs/reference/web-proxy-api",draft:!1,tags:[],version:"current",lastUpdatedAt:1701726431,formattedLastUpdatedAt:"Dec 4, 2023",sidebarPosition:5,frontMatter:{title:"Web Proxy API",sidebar_position:5,hide_table_of_contents:!0,hide_title:!0},sidebar:"docSidebar",previous:{title:"Python SDK",permalink:"/docs/reference/python"},next:{title:"Javascript SDK",permalink:"/docs/reference/javascript"}},f={},m=[],u={toc:m},y="wrapper";function x(e){let{components:t,...o}=e;return(0,a.kt)(y,(0,r.Z)({},u,o,{components:t,mdxType:"MDXLayout"}),(0,a.kt)(p,{src:"/api/web-proxy-openapi.json",mdxType:"OpenApiDoc"}))}x.isMDXComponent=!0},5101:()=>{},2116:()=>{},4904:()=>{},6918:()=>{},4819:()=>{},3197:()=>{},996:()=>{}}]); \ No newline at end of file diff --git a/assets/js/1b039142.34999ad0.js b/assets/js/1b039142.34999ad0.js deleted file mode 100644 index bfdd51e..0000000 --- a/assets/js/1b039142.34999ad0.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[2147],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>d});var a=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},r=Object.keys(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=a.createContext({}),c=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=c(e.components);return a.createElement(s.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,r=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),m=c(n),d=o,h=m["".concat(s,".").concat(d)]||m[d]||u[d]||r;return n?a.createElement(h,i(i({ref:t},p),{},{components:n})):a.createElement(h,i({ref:t},p))}));function d(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=n.length,i=new Array(r);i[0]=m;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l.mdxType="string"==typeof e?e:o,i[1]=l;for(var c=2;c<r;c++)i[c]=n[c];return a.createElement.apply(null,i)}return a.createElement.apply(null,n)}m.displayName="MDXCreateElement"},9615:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>u,frontMatter:()=>r,metadata:()=>l,toc:()=>c});var a=n(7462),o=(n(7294),n(3905));const r={},i="Add a Web Client for the Human Player",l={unversionedId:"guide/tutorial/advanced-tutorials/web-client",id:"guide/tutorial/advanced-tutorials/web-client",title:"Add a Web Client for the Human Player",description:"This part of the tutorial follows step 5, make sure you've gone through it before starting this one. Alternatively the completed step 5 can be retrieved from the tutorial's repository.",source:"@site/docs/guide/tutorial/advanced-tutorials/7-web-client.md",sourceDirName:"guide/tutorial/advanced-tutorials",slug:"/guide/tutorial/advanced-tutorials/web-client",permalink:"/docs/guide/tutorial/advanced-tutorials/web-client",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:7,frontMatter:{},sidebar:"docSidebar",previous:{title:"Add a Human Player in the Loop",permalink:"/docs/guide/tutorial/advanced-tutorials/human-player"},next:{title:"Improve Operational Efficiency with a Cogment Directory for Service Discovery",permalink:"/docs/guide/tutorial/advanced-tutorials/directory"}},s={},c=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"The web client",id:"the-web-client",level:2},{value:"Creating a React app",id:"creating-a-react-app",level:2},{value:"Adding Material UI",id:"adding-material-ui",level:2},{value:"Update the run script",id:"update-the-run-script",level:2},{value:"The parameters file",id:"the-parameters-file",level:2},{value:"Adding Cogment to our web client",id:"adding-cogment-to-our-web-client",level:2},{value:"index.js / index.css",id:"indexjs--indexcss",level:2},{value:"App.js",id:"appjs",level:2},{value:"hooks/useActions.js",id:"hooksuseactionsjs",level:2},{value:"Making it look good",id:"making-it-look-good",level:2}],p={toc:c};function u(e){let{components:t,...n}=e;return(0,o.kt)("wrapper",(0,a.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"add-a-web-client-for-the-human-player"},"Add a Web Client for the Human Player"),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"This part of the tutorial follows ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/advanced-tutorials/human-player"},"step 5"),", make sure you've gone through it before starting this one. Alternatively the completed step 5 can be retrieved from the ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-tutorial-rps"},"tutorial's repository"),".")),(0,o.kt)("p",null,"In this step of the tutorial, we will go over a web client implementation, to enable Humans to play RPS, while being able to take advantage of various web technologies."),(0,o.kt)("h2",{id:"prerequisites"},"Prerequisites"),(0,o.kt)("p",null,"To develop a web client, we will need a working installation of Node.js, version 14 or later. You can download and install this from: ",(0,o.kt)("a",{parentName:"p",href:"https://nodejs.org/en/download/"},"https://nodejs.org/en/download/")),(0,o.kt)("h2",{id:"the-web-client"},"The web client"),(0,o.kt)("p",null,"In the previous steps, we triggered the trials by running ",(0,o.kt)("inlineCode",{parentName:"p"},"./run.sh trial_runner_start"),". This launched a trial using code in ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_runner/main.py"),". In this step we will trigger a trial using a React web app."),(0,o.kt)("p",null,"Before we start with the Cogment side of things, we'll need to get a few prerequisite files setup."),(0,o.kt)("h2",{id:"creating-a-react-app"},"Creating a React app"),(0,o.kt)("p",null,"First, we will initialize a React app. This can be done very simply by running from the root ",(0,o.kt)("inlineCode",{parentName:"p"},"rps")," folder:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"npx create-react-app web_client\n")),(0,o.kt)("p",null,"Once this is done, we will be able to open a React app in our browser by running the following commands:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"cd web_client\nnpm start\n")),(0,o.kt)("h2",{id:"adding-material-ui"},"Adding Material UI"),(0,o.kt)("p",null,"We will be using Material UI for this web client. This will provide us with a nice and clean way to add styles to our application, as well as some components which we will use to reduce code size."),(0,o.kt)("p",null,"Install Material UI by running the following commands from inside of the web_client folder:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"npm install @mui/material @emotion/react @emotion/styled\nnpm install @mui/icons-material\n")),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"Due to the nature of create-react-app when installed using the ",(0,o.kt)("inlineCode",{parentName:"p"},"npx")," command, the resulting installation will always utilize the latest version of React. This may cause dependecy issues when installing Material UI. As such, whenever such issues are encountered, please refer to the ",(0,o.kt)("a",{parentName:"p",href:"https://mui.com/material-ui/getting-started/installation/"},"Material UI documentation")," to confirm the correct required version of React.")),(0,o.kt)("h2",{id:"update-the-run-script"},"Update the run script"),(0,o.kt)("p",null,"In this tutorial we will add a new service that builds and serves the web clients. We will also need to configure the orchestrator to expose its services to the web client using grpcweb."),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"Cogment internally relies on ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/improbable-eng/grpc-web/tree/master/go/grpcwebproxy"},(0,o.kt)("inlineCode",{parentName:"a"},"grpcwebproxy"))," to allow its grpc endpoints to be utilized by web applications. Web applications cannot natively use the grpc protocol that all Cogment modules use to communicate with one another. Using this proxy to translate the web socket connections it accepts into grpc requests solves this issue.")),(0,o.kt)("p",null,"We will need to update the ",(0,o.kt)("inlineCode",{parentName:"p"},"run.sh")," script and the ",(0,o.kt)("inlineCode",{parentName:"p"},".env")," file to do that."),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"The ",(0,o.kt)("inlineCode",{parentName:"p"},"run.sh")," script that we use for this tutorial is a helpful way to build services and run them, you can take inspiration from it in your own projects.")),(0,o.kt)("p",null,"To prepare for the additional service, let's add the following environment variables to the ",(0,o.kt)("inlineCode",{parentName:"p"},".env")," file:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"ORCHESTRATOR_HTTP_PORT=9003 # This is the port that orchestrator will listen on for grpcweb connections.\nWEB_CLIENT_PORT=8000 # This is the port that the web client will listen on.\n")),(0,o.kt)("p",null,"In the ",(0,o.kt)("inlineCode",{parentName:"p"},"./run.sh")," script we will add two new commands to build and start the web client:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-bash"},'function web_client_build() {\n _load_dot_env # Load the environment variables from the dotenv file\n cp "${ROOT_DIR}/data.proto" "${ROOT_DIR}/cogment.yaml" "${ROOT_DIR}/web_client" # Copy the spec and protobuf files\n cd "${ROOT_DIR}/web_client"\n npm install # Install dependencies\n npx cogment-js-sdk-generate cogment.yaml # Run the code generation phase\n}\n\nfunction web_client_start() {\n _load_dot_env\n export PORT="${WEB_CLIENT_PORT}" # Define the PORT the web client will use\n export REACT_APP_ORCHESTRATOR_HTTP_ENDPOINT="http://${ORCHESTRATOR_HOST}:${ORCHESTRATOR_HTTP_PORT}" # Define the endpoint it will connect to\n cd "${ROOT_DIR}/web_client"\n npm start\n}\n')),(0,o.kt)("p",null,"We will also need to pass additional parameters to cogment when starting the orchestrator to enable the grpcweb server and to specifiy the trial parameters. The latter is needed because contrary to clients using the python sdk, web clients can't specify the trial parameters directly."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-bash"},'function orchestrator_start() {\n _load_dot_env\n cogment services orchestrator \\\n --actor_port="${ORCHESTRATOR_PORT}" \\\n --lifecycle_port="${ORCHESTRATOR_PORT}" \\\n --actor_web_port="${ORCHESTRATOR_HTTP_PORT}" \\\n --params="./params.yaml"\n}\n')),(0,o.kt)("p",null,"Finally in this file, we will add the web client build to the ",(0,o.kt)("inlineCode",{parentName:"p"},"build")," command."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"function build() {\n _run_sequence client_build environment_build random_agent_build web_client_build\n}\n")),(0,o.kt)("h2",{id:"the-parameters-file"},"The parameters file"),(0,o.kt)("p",null,"The parameters file is a ",(0,o.kt)("inlineCode",{parentName:"p"},".yaml")," file that specifies the default trial parameters to Cogment. In this tutorial, we will use the following parameters:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-yaml"},"trial_params:\n environment:\n endpoint: grpc://localhost:9001\n\n actors:\n - name: player_1\n actor_class: player\n endpoint: cogment://client\n - name: player_2\n actor_class: player\n implementation: heuristic_agent\n endpoint: grpc://localhost:9002\n")),(0,o.kt)("p",null,"Create a ",(0,o.kt)("inlineCode",{parentName:"p"},"params.yaml")," file in the root folder with the previous content."),(0,o.kt)("h2",{id:"adding-cogment-to-our-web-client"},"Adding Cogment to our web client"),(0,o.kt)("p",null,"The easiest way to add Cogment to any web client is to start with a React app, then follow the three steps below:"),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Install the Javascript SDK and typescript using:"),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-console"},"npm install @cogment/cogment-js-sdk\nnpm install --save-dev typescript\n")),(0,o.kt)("p",{parentName:"li"},"while inside of the ",(0,o.kt)("inlineCode",{parentName:"p"},"web_client")," folder")),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Copy the hooks folder from the ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-tutorial-rps"},"tutorial's repository"),", found at ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-tutorial-rps/tree/main/6-web-client/web_client/src"},"6-web-client/web_client/src/"),", into your src folder.")),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Navigate nack to the ",(0,o.kt)("inlineCode",{parentName:"p"},"rps")," folder then run the following command to generate Javascript files from your trial specs:"),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-console"},"./run.sh web_client_build\n")))),(0,o.kt)("p",null,"Now that all that's done, we can finally start coding our web client!"),(0,o.kt)("h1",{id:"code"},"CODE"),(0,o.kt)("blockquote",null,(0,o.kt)("p",{parentName:"blockquote"},"NOTE: For each of the following files, we will provide the styles in a code block. Feel free to skip these, or make your own; they are not important to the function of this application.")),(0,o.kt)("h2",{id:"indexjs--indexcss"},"index.js / index.css"),(0,o.kt)("p",null,"When we created our React app, these two files were generated automatically. Replace their content with the following:"),(0,o.kt)("blockquote",null,(0,o.kt)("p",{parentName:"blockquote"},"NOTE: These can also be downloaded from the ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-tutorial-rps"},"tutorial's repository"),".")),(0,o.kt)("p",null,"index.css:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-css"},"body {\n margin: 0;\n background-color: #c5cce8;\n}\n")),(0,o.kt)("p",null,"index.js"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-jsx"},'import React from "react";\nimport ReactDOM from "react-dom/client";\nimport "./index.css";\nimport { App } from "./App";\nimport {\n createTheme,\n responsiveFontSizes,\n ThemeProvider,\n} from "@mui/material/styles";\n\nlet theme = createTheme({\n palette: {\n primary: {\n light: "#c5cce8",\n main: "#6B80C4",\n },\n secondary: {\n main: "#ffb400",\n },\n },\n});\n\ntheme = responsiveFontSizes(theme);\n\nconst root = ReactDOM.createRoot(document.getElementById("root"));\nroot.render(\n <React.StrictMode>\n <ThemeProvider theme={theme}>\n <App />\n </ThemeProvider>\n </React.StrictMode>\n);\n')),(0,o.kt)("p",null,"This is simply to provide styles to our Material UI components. We haven't started with the actual Cogment part yet, which is exactly what we'll be doing next."),(0,o.kt)("h2",{id:"appjs"},"App.js"),(0,o.kt)("p",null,"We'll start with a few imports. Some of these files don't exist yet, so we'll be creating them:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-jsx"},'//First is some React imports\nimport React, { useEffect } from "react";\n\n//Then some imports for icons and Material UI functionality we\'ll be using\nimport { Box, Button, Typography } from "@mui/material";\nimport { useTheme } from "@mui/material/styles";\n\n//And here\'s the important part: we\'re importing the two things that will allow us to use Cogment.\n\n//First, the \'useActions\' hook which will give us our observations as a human agent, as well as allow us to send actions.\nimport { useActions } from "./hooks/useActions";\n\n//Second, our \'cogSettings\'. This is a file that was generated when we ran\n//`npx cogment-js-sdk-generate cogment.yaml`\n//This file tells our web client relevant information about our trials, environments, and actor classes.\nimport { cogSettings } from "./CogSettings";\n\n//These are messages which were defined in data.proto. These imports will need to change whenever their corresponding messages in data.proto are changed and `npx cogment-js-sdk-generate cogment.yaml` is run.\nimport { rps as PB } from "./data_pb";\n')),(0,o.kt)("p",null,'Then we add a function that will convert the play, encoded as the same "move" enum that we defined in our data.proto, to a string we can use in our application:'),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-jsx"},'function getMoveText(move) {\n switch (move) {\n case 0:\n return "rock";\n case 1:\n return "paper";\n case 2:\n return "scissors";\n default:\n throw new Error("Not a rock, paper, or scissors");\n }\n}\n')),(0,o.kt)("p",null,"Finally, the React component."),(0,o.kt)("p",null,"At the start of this component is the most important part of our application: the useAction hook."),(0,o.kt)("p",null,"This hook returns an array with 3 elements:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("p",{parentName:"li"},"event: this contains all the information about any observation, reward, or message we've received this tick. We will use this to see what plays we and the computer made.")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("p",{parentName:"li"},"startTrial: this is a function which takes no arguments, and is a very simple way to start a new trial with our player actor.")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("p",{parentName:"li"},"sendAction: this is a function which takes an argument of type 'Action'. This class can be imported from data_pb.js, but we'll see that later in this tutorial."))),(0,o.kt)("p",null,"This hook takes in 3 arguments:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("p",{parentName:"li"},"cogSettings: this is what's imported from CogSettings.js. It provides all the relevant information about data.proto to this hook so that it can function.")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("p",{parentName:"li"},"actorName: the name of the human actor which this web client will be representing. It should be aligned with what's defined in ",(0,o.kt)("inlineCode",{parentName:"p"},"params.yaml"),".")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("p",{parentName:"li"},"actorClass: the class of the human actor which this web client will be representing. It should be aligned with what's defined in ",(0,o.kt)("inlineCode",{parentName:"p"},"params.yaml"),"."))),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-jsx"},'export const App = () => {\n const [event, startTrial, sendAction] = useActions(\n cogSettings,\n "player_1",\n "player"\n );\n\n //Function to construct the Action which the player will send when they click either rock, paper, or scissors\n const choose = (move) => {\n const action = new PB.PlayerAction({\n move,\n });\n sendAction(action);\n };\n\n //This will start a trial as soon as we\'re connected to the orchestrator\n useEffect(() => {\n if (startTrial) startTrial();\n }, [startTrial]);\n\n //Get any observation from the current event, events have observations, messages, and rewards, and all three can be unpacked from the event object\n //We will also unpack a helpful variable called \'last\', this will allow us to know when the trial has ended\n const { observation, last } = event;\n\n const [gameState, setGameState] = useState({\n gameStage: "start",\n roundIndex: 0,\n lastMoveComputer: 0,\n lastMoveHuman: 0,\n });\n const [firstObservation, setFirstObservation] = useState(true);\n\n useEffect(() => {\n //Parse game state out of the observation\n //Some events don\'t contain an observation, so we need to store the observation contents in a state\n if (!observation) return;\n\n //The first observation is not useful, as it just contains the default game state, before players have made moves\n if (firstObservation) {\n setFirstObservation(false);\n return;\n }\n\n //Get all relevant information from the observation\n const roundIndex = gameState.roundIndex + 1;\n const gameStage = "playing";\n const lastMoveComputer = observation.them.lastMove;\n const lastMoveHuman = observation.me.lastMove;\n const lastWonComputer = observation.them.wonLast;\n const lastWonHuman = observation.me.wonLast;\n\n setGameState({\n gameStage,\n roundIndex,\n lastMoveComputer,\n lastMoveHuman,\n lastWonComputer,\n lastWonHuman,\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [observation]);\n\n //The layout of the page\n return (\n <Box>\n {/*\n Tell the player everything we know about the trial state, such as, plays, who won, etc...\n */}\n <Typography>Game stage: {gameState.gameStage}</Typography>\n <Typography>\n Human\'s move:{" "}\n {gameState.gameStage !== "start" &&\n getMoveText(gameState.lastMoveHuman)}\n </Typography>\n <Typography>\n Computer\'s move:{" "}\n {gameState.gameStage !== "start" &&\n getMoveText(gameState.lastMoveComputer)}\n </Typography>\n <Typography>\n Did Human win last round?{" "}\n {observation && gameState.lastWonHuman ? "Yes" : "No"}\n </Typography>\n <Typography>\n Did Computer win last round?{" "}\n {observation && gameState.lastWonComputer ? "Yes" : "No"}\n </Typography>\n <Button onClick={() => choose(0)}>Rock</Button>\n <Button onClick={() => choose(1)}>Paper</Button>\n <Button onClick={() => choose(2)}>Scissors</Button>\n </Box>\n );\n};\n')),(0,o.kt)("h2",{id:"hooksuseactionsjs"},"hooks/useActions.js"),(0,o.kt)("p",null,"This hook does multiple things. It starts a trial, joins a trial, sends actions, and receives information from the orchestrator. The following is its annotated code:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-jsx"},'import { Context } from "@cogment/cogment-js-sdk";\nimport { useEffect, useState } from "react";\n\nexport const useActions = (cogSettings, actorName, actorClass) => {\n const [event, setEvent] = useState({\n observation: null,\n actions: null,\n messages: null,\n rewards: null,\n type: null,\n last: false,\n });\n\n const [startTrial, setStartTrial] = useState(null);\n const [sendAction, setSendAction] = useState(null);\n\n //Set up the connection and register the actor only once, regardless of re-rendering\n useEffect(() => {\n const context = new Context(cogSettings, actorName);\n\n context.registerActor(\n async (actorSession) => {\n actorSession.start();\n\n //Double arrow function here beause react will turn a single one into a lazy loaded function\n setSendAction(() => (action) => {\n actorSession.doAction(action);\n });\n\n for await (const event of actorSession.eventLoop()) {\n const eventUseActions = event;\n\n eventUseActions.last = event.type === 3;\n\n setEvent(eventUseActions);\n }\n },\n actorName,\n actorClass\n );\n\n const endpoint = process.env.REACT_APP_ORCHESTRATOR_HTTP_ENDPOINT;\n const controller = context.getController(endpoint);\n\n //Need to output a function so that the user can start the trial when all actors are connected\n //Again, double arrow function cause react will turn a single one into a lazy loaded function\n setStartTrial(() => async () => {\n const trialId = await controller.startTrial();\n await context.joinTrial(trialId, endpoint, actorName);\n });\n }, [cogSettings, actorName, actorClass]);\n\n return [event, startTrial, sendAction];\n};\n')),(0,o.kt)("p",null,"We also need to create ",(0,o.kt)("inlineCode",{parentName:"p"},"web_client/.eslintignore")," and add the following to it to ignore checks on the generate files:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre"},"src/*_pb*\nsrc/cog_settings*\n")),(0,o.kt)("p",null,"You can now see our app fully functional running the following commands in the ",(0,o.kt)("inlineCode",{parentName:"p"},"rps")," folder:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"./run.sh build\n./run.sh services_start\n")),(0,o.kt)("p",null,"In another terminal, start the web client:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"}," ./run.sh web_client_start\n")),(0,o.kt)("p",null,"And opening up <localhost:8000> in our browser."),(0,o.kt)("p",null,"And with that we're done!"),(0,o.kt)("h2",{id:"making-it-look-good"},"Making it look good"),(0,o.kt)("p",null,"If we want a fancier interface, there is a completed UI in the tutorials repository that we can copy into our project. Then, along with some style code that can be found in the repository version of App.js, just replace the return statement from App.js with the following:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-jsx"},'<Box>\n <Header observation={observation} gameState={gameState} />\n <Container className={classes.container}>\n <Player\n score={humanScore}\n color={theme.palette.primary.main}\n IconClass={PersonIcon}\n choose={choose}\n isHuman\n />\n\n <Player\n score={computerScore}\n color={theme.palette.secondary.main}\n IconClass={ComputerIcon}\n selected={\n gameState !== "start" &&\n getMoveText(observation.them.lastRoundMove)\n }\n />\n </Container>\n</Box>\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/1b039142.844cbc15.js b/assets/js/1b039142.844cbc15.js new file mode 100644 index 0000000..0d440f9 --- /dev/null +++ b/assets/js/1b039142.844cbc15.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[2147],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>h});var a=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},r=Object.keys(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=a.createContext({}),c=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=c(e.components);return a.createElement(s.Provider,{value:t},e.children)},u="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,r=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=c(n),d=o,h=u["".concat(s,".").concat(d)]||u[d]||m[d]||r;return n?a.createElement(h,i(i({ref:t},p),{},{components:n})):a.createElement(h,i({ref:t},p))}));function h(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=n.length,i=new Array(r);i[0]=d;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[u]="string"==typeof e?e:o,i[1]=l;for(var c=2;c<r;c++)i[c]=n[c];return a.createElement.apply(null,i)}return a.createElement.apply(null,n)}d.displayName="MDXCreateElement"},9615:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>m,frontMatter:()=>r,metadata:()=>l,toc:()=>c});var a=n(7462),o=(n(7294),n(3905));const r={},i="Add a Web Client for the Human Player",l={unversionedId:"guide/tutorial/advanced-tutorials/web-client",id:"guide/tutorial/advanced-tutorials/web-client",title:"Add a Web Client for the Human Player",description:"This part of the tutorial follows step 5, make sure you've gone through it before starting this one. Alternatively the completed step 5 can be retrieved from the tutorial's repository.",source:"@site/docs/guide/tutorial/advanced-tutorials/7-web-client.md",sourceDirName:"guide/tutorial/advanced-tutorials",slug:"/guide/tutorial/advanced-tutorials/web-client",permalink:"/docs/guide/tutorial/advanced-tutorials/web-client",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:7,frontMatter:{},sidebar:"docSidebar",previous:{title:"Add a Human Player in the Loop",permalink:"/docs/guide/tutorial/advanced-tutorials/human-player"},next:{title:"Improve Operational Efficiency with a Cogment Directory for Service Discovery",permalink:"/docs/guide/tutorial/advanced-tutorials/directory"}},s={},c=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"The web client",id:"the-web-client",level:2},{value:"Creating a React app",id:"creating-a-react-app",level:2},{value:"Adding Material UI",id:"adding-material-ui",level:2},{value:"Update the run script",id:"update-the-run-script",level:2},{value:"The parameters file",id:"the-parameters-file",level:2},{value:"Adding Cogment to our web client",id:"adding-cogment-to-our-web-client",level:2},{value:"index.js / index.css",id:"indexjs--indexcss",level:2},{value:"App.js",id:"appjs",level:2},{value:"hooks/useActions.js",id:"hooksuseactionsjs",level:2},{value:"Making it look good",id:"making-it-look-good",level:2}],p={toc:c},u="wrapper";function m(e){let{components:t,...n}=e;return(0,o.kt)(u,(0,a.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"add-a-web-client-for-the-human-player"},"Add a Web Client for the Human Player"),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"This part of the tutorial follows ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/advanced-tutorials/human-player"},"step 5"),", make sure you've gone through it before starting this one. Alternatively the completed step 5 can be retrieved from the ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-tutorial-rps"},"tutorial's repository"),".")),(0,o.kt)("p",null,"In this step of the tutorial, we will go over a web client implementation, to enable Humans to play RPS, while being able to take advantage of various web technologies."),(0,o.kt)("h2",{id:"prerequisites"},"Prerequisites"),(0,o.kt)("p",null,"To develop a web client, we will need a working installation of Node.js, version 14 or later. You can download and install this from: ",(0,o.kt)("a",{parentName:"p",href:"https://nodejs.org/en/download/"},"https://nodejs.org/en/download/")),(0,o.kt)("h2",{id:"the-web-client"},"The web client"),(0,o.kt)("p",null,"In the previous steps, we triggered the trials by running ",(0,o.kt)("inlineCode",{parentName:"p"},"./run.sh trial_runner_start"),". This launched a trial using code in ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_runner/main.py"),". In this step we will trigger a trial using a React web app."),(0,o.kt)("p",null,"Before we start with the Cogment side of things, we'll need to get a few prerequisite files setup."),(0,o.kt)("h2",{id:"creating-a-react-app"},"Creating a React app"),(0,o.kt)("p",null,"First, we will initialize a React app. This can be done very simply by running from the root ",(0,o.kt)("inlineCode",{parentName:"p"},"rps")," folder:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"npx create-react-app web_client\n")),(0,o.kt)("p",null,"Once this is done, we will be able to open a React app in our browser by running the following commands:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"cd web_client\nnpm start\n")),(0,o.kt)("h2",{id:"adding-material-ui"},"Adding Material UI"),(0,o.kt)("p",null,"We will be using Material UI for this web client. This will provide us with a nice and clean way to add styles to our application, as well as some components which we will use to reduce code size."),(0,o.kt)("p",null,"Install Material UI by running the following commands from inside of the web_client folder:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"npm install @mui/material @emotion/react @emotion/styled\nnpm install @mui/icons-material\n")),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"Due to the nature of create-react-app when installed using the ",(0,o.kt)("inlineCode",{parentName:"p"},"npx")," command, the resulting installation will always utilize the latest version of React. This may cause dependecy issues when installing Material UI. As such, whenever such issues are encountered, please refer to the ",(0,o.kt)("a",{parentName:"p",href:"https://mui.com/material-ui/getting-started/installation/"},"Material UI documentation")," to confirm the correct required version of React.")),(0,o.kt)("h2",{id:"update-the-run-script"},"Update the run script"),(0,o.kt)("p",null,"In this tutorial we will add a new service that builds and serves the web clients. We will also need to configure the orchestrator to expose its services to the web client using grpcweb."),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"Cogment internally relies on ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/improbable-eng/grpc-web/tree/master/go/grpcwebproxy"},(0,o.kt)("inlineCode",{parentName:"a"},"grpcwebproxy"))," to allow its grpc endpoints to be utilized by web applications. Web applications cannot natively use the grpc protocol that all Cogment modules use to communicate with one another. Using this proxy to translate the web socket connections it accepts into grpc requests solves this issue.")),(0,o.kt)("p",null,"We will need to update the ",(0,o.kt)("inlineCode",{parentName:"p"},"run.sh")," script and the ",(0,o.kt)("inlineCode",{parentName:"p"},".env")," file to do that."),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"The ",(0,o.kt)("inlineCode",{parentName:"p"},"run.sh")," script that we use for this tutorial is a helpful way to build services and run them, you can take inspiration from it in your own projects.")),(0,o.kt)("p",null,"To prepare for the additional service, let's add the following environment variables to the ",(0,o.kt)("inlineCode",{parentName:"p"},".env")," file:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"ORCHESTRATOR_HTTP_PORT=9003 # This is the port that orchestrator will listen on for grpcweb connections.\nWEB_CLIENT_PORT=8000 # This is the port that the web client will listen on.\n")),(0,o.kt)("p",null,"In the ",(0,o.kt)("inlineCode",{parentName:"p"},"./run.sh")," script we will add two new commands to build and start the web client:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-bash"},'function web_client_build() {\n _load_dot_env # Load the environment variables from the dotenv file\n cp "${ROOT_DIR}/data.proto" "${ROOT_DIR}/cogment.yaml" "${ROOT_DIR}/web_client" # Copy the spec and protobuf files\n cd "${ROOT_DIR}/web_client"\n npm install # Install dependencies\n npx cogment-js-sdk-generate cogment.yaml # Run the code generation phase\n}\n\nfunction web_client_start() {\n _load_dot_env\n export PORT="${WEB_CLIENT_PORT}" # Define the PORT the web client will use\n export REACT_APP_ORCHESTRATOR_HTTP_ENDPOINT="http://${ORCHESTRATOR_HOST}:${ORCHESTRATOR_HTTP_PORT}" # Define the endpoint it will connect to\n cd "${ROOT_DIR}/web_client"\n npm start\n}\n')),(0,o.kt)("p",null,"We will also need to pass additional parameters to cogment when starting the orchestrator to enable the grpcweb server and to specifiy the trial parameters. The latter is needed because contrary to clients using the python sdk, web clients can't specify the trial parameters directly."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-bash"},'function orchestrator_start() {\n _load_dot_env\n cogment services orchestrator \\\n --actor_port="${ORCHESTRATOR_PORT}" \\\n --lifecycle_port="${ORCHESTRATOR_PORT}" \\\n --actor_web_port="${ORCHESTRATOR_HTTP_PORT}" \\\n --params="./params.yaml"\n}\n')),(0,o.kt)("p",null,"Finally in this file, we will add the web client build to the ",(0,o.kt)("inlineCode",{parentName:"p"},"build")," command."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"function build() {\n _run_sequence client_build environment_build random_agent_build web_client_build\n}\n")),(0,o.kt)("h2",{id:"the-parameters-file"},"The parameters file"),(0,o.kt)("p",null,"The parameters file is a ",(0,o.kt)("inlineCode",{parentName:"p"},".yaml")," file that specifies the default trial parameters to Cogment. In this tutorial, we will use the following parameters:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-yaml"},"trial_params:\n environment:\n endpoint: grpc://localhost:9001\n\n actors:\n - name: player_1\n actor_class: player\n endpoint: cogment://client\n - name: player_2\n actor_class: player\n implementation: heuristic_agent\n endpoint: grpc://localhost:9002\n")),(0,o.kt)("p",null,"Create a ",(0,o.kt)("inlineCode",{parentName:"p"},"params.yaml")," file in the root folder with the previous content."),(0,o.kt)("h2",{id:"adding-cogment-to-our-web-client"},"Adding Cogment to our web client"),(0,o.kt)("p",null,"The easiest way to add Cogment to any web client is to start with a React app, then follow the three steps below:"),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Install the Javascript SDK and typescript using:"),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-console"},"npm install @cogment/cogment-js-sdk\nnpm install --save-dev typescript\n")),(0,o.kt)("p",{parentName:"li"},"while inside of the ",(0,o.kt)("inlineCode",{parentName:"p"},"web_client")," folder")),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Copy the hooks folder from the ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-tutorial-rps"},"tutorial's repository"),", found at ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-tutorial-rps/tree/main/6-web-client/web_client/src"},"6-web-client/web_client/src/"),", into your src folder.")),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Navigate nack to the ",(0,o.kt)("inlineCode",{parentName:"p"},"rps")," folder then run the following command to generate Javascript files from your trial specs:"),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-console"},"./run.sh web_client_build\n")))),(0,o.kt)("p",null,"Now that all that's done, we can finally start coding our web client!"),(0,o.kt)("h1",{id:"code"},"CODE"),(0,o.kt)("blockquote",null,(0,o.kt)("p",{parentName:"blockquote"},"NOTE: For each of the following files, we will provide the styles in a code block. Feel free to skip these, or make your own; they are not important to the function of this application.")),(0,o.kt)("h2",{id:"indexjs--indexcss"},"index.js / index.css"),(0,o.kt)("p",null,"When we created our React app, these two files were generated automatically. Replace their content with the following:"),(0,o.kt)("blockquote",null,(0,o.kt)("p",{parentName:"blockquote"},"NOTE: These can also be downloaded from the ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-tutorial-rps"},"tutorial's repository"),".")),(0,o.kt)("p",null,"index.css:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-css"},"body {\n margin: 0;\n background-color: #c5cce8;\n}\n")),(0,o.kt)("p",null,"index.js"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-jsx"},'import React from "react";\nimport ReactDOM from "react-dom/client";\nimport "./index.css";\nimport { App } from "./App";\nimport {\n createTheme,\n responsiveFontSizes,\n ThemeProvider,\n} from "@mui/material/styles";\n\nlet theme = createTheme({\n palette: {\n primary: {\n light: "#c5cce8",\n main: "#6B80C4",\n },\n secondary: {\n main: "#ffb400",\n },\n },\n});\n\ntheme = responsiveFontSizes(theme);\n\nconst root = ReactDOM.createRoot(document.getElementById("root"));\nroot.render(\n <React.StrictMode>\n <ThemeProvider theme={theme}>\n <App />\n </ThemeProvider>\n </React.StrictMode>\n);\n')),(0,o.kt)("p",null,"This is simply to provide styles to our Material UI components. We haven't started with the actual Cogment part yet, which is exactly what we'll be doing next."),(0,o.kt)("h2",{id:"appjs"},"App.js"),(0,o.kt)("p",null,"We'll start with a few imports. Some of these files don't exist yet, so we'll be creating them:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-jsx"},'//First is some React imports\nimport React, { useEffect } from "react";\n\n//Then some imports for icons and Material UI functionality we\'ll be using\nimport { Box, Button, Typography } from "@mui/material";\nimport { useTheme } from "@mui/material/styles";\n\n//And here\'s the important part: we\'re importing the two things that will allow us to use Cogment.\n\n//First, the \'useActions\' hook which will give us our observations as a human agent, as well as allow us to send actions.\nimport { useActions } from "./hooks/useActions";\n\n//Second, our \'cogSettings\'. This is a file that was generated when we ran\n//`npx cogment-js-sdk-generate cogment.yaml`\n//This file tells our web client relevant information about our trials, environments, and actor classes.\nimport { cogSettings } from "./CogSettings";\n\n//These are messages which were defined in data.proto. These imports will need to change whenever their corresponding messages in data.proto are changed and `npx cogment-js-sdk-generate cogment.yaml` is run.\nimport { rps as PB } from "./data_pb";\n')),(0,o.kt)("p",null,'Then we add a function that will convert the play, encoded as the same "move" enum that we defined in our data.proto, to a string we can use in our application:'),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-jsx"},'function getMoveText(move) {\n switch (move) {\n case 0:\n return "rock";\n case 1:\n return "paper";\n case 2:\n return "scissors";\n default:\n throw new Error("Not a rock, paper, or scissors");\n }\n}\n')),(0,o.kt)("p",null,"Finally, the React component."),(0,o.kt)("p",null,"At the start of this component is the most important part of our application: the useAction hook."),(0,o.kt)("p",null,"This hook returns an array with 3 elements:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("p",{parentName:"li"},"event: this contains all the information about any observation, reward, or message we've received this tick. We will use this to see what plays we and the computer made.")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("p",{parentName:"li"},"startTrial: this is a function which takes no arguments, and is a very simple way to start a new trial with our player actor.")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("p",{parentName:"li"},"sendAction: this is a function which takes an argument of type 'Action'. This class can be imported from data_pb.js, but we'll see that later in this tutorial."))),(0,o.kt)("p",null,"This hook takes in 3 arguments:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("p",{parentName:"li"},"cogSettings: this is what's imported from CogSettings.js. It provides all the relevant information about data.proto to this hook so that it can function.")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("p",{parentName:"li"},"actorName: the name of the human actor which this web client will be representing. It should be aligned with what's defined in ",(0,o.kt)("inlineCode",{parentName:"p"},"params.yaml"),".")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("p",{parentName:"li"},"actorClass: the class of the human actor which this web client will be representing. It should be aligned with what's defined in ",(0,o.kt)("inlineCode",{parentName:"p"},"params.yaml"),"."))),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-jsx"},'export const App = () => {\n const [event, startTrial, sendAction] = useActions(\n cogSettings,\n "player_1",\n "player"\n );\n\n //Function to construct the Action which the player will send when they click either rock, paper, or scissors\n const choose = (move) => {\n const action = new PB.PlayerAction({\n move,\n });\n sendAction(action);\n };\n\n //This will start a trial as soon as we\'re connected to the orchestrator\n useEffect(() => {\n if (startTrial) startTrial();\n }, [startTrial]);\n\n //Get any observation from the current event, events have observations, messages, and rewards, and all three can be unpacked from the event object\n //We will also unpack a helpful variable called \'last\', this will allow us to know when the trial has ended\n const { observation, last } = event;\n\n const [gameState, setGameState] = useState({\n gameStage: "start",\n roundIndex: 0,\n lastMoveComputer: 0,\n lastMoveHuman: 0,\n });\n const [firstObservation, setFirstObservation] = useState(true);\n\n useEffect(() => {\n //Parse game state out of the observation\n //Some events don\'t contain an observation, so we need to store the observation contents in a state\n if (!observation) return;\n\n //The first observation is not useful, as it just contains the default game state, before players have made moves\n if (firstObservation) {\n setFirstObservation(false);\n return;\n }\n\n //Get all relevant information from the observation\n const roundIndex = gameState.roundIndex + 1;\n const gameStage = "playing";\n const lastMoveComputer = observation.them.lastMove;\n const lastMoveHuman = observation.me.lastMove;\n const lastWonComputer = observation.them.wonLast;\n const lastWonHuman = observation.me.wonLast;\n\n setGameState({\n gameStage,\n roundIndex,\n lastMoveComputer,\n lastMoveHuman,\n lastWonComputer,\n lastWonHuman,\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [observation]);\n\n //The layout of the page\n return (\n <Box>\n {/*\n Tell the player everything we know about the trial state, such as, plays, who won, etc...\n */}\n <Typography>Game stage: {gameState.gameStage}</Typography>\n <Typography>\n Human\'s move:{" "}\n {gameState.gameStage !== "start" &&\n getMoveText(gameState.lastMoveHuman)}\n </Typography>\n <Typography>\n Computer\'s move:{" "}\n {gameState.gameStage !== "start" &&\n getMoveText(gameState.lastMoveComputer)}\n </Typography>\n <Typography>\n Did Human win last round?{" "}\n {observation && gameState.lastWonHuman ? "Yes" : "No"}\n </Typography>\n <Typography>\n Did Computer win last round?{" "}\n {observation && gameState.lastWonComputer ? "Yes" : "No"}\n </Typography>\n <Button onClick={() => choose(0)}>Rock</Button>\n <Button onClick={() => choose(1)}>Paper</Button>\n <Button onClick={() => choose(2)}>Scissors</Button>\n </Box>\n );\n};\n')),(0,o.kt)("h2",{id:"hooksuseactionsjs"},"hooks/useActions.js"),(0,o.kt)("p",null,"This hook does multiple things. It starts a trial, joins a trial, sends actions, and receives information from the orchestrator. The following is its annotated code:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-jsx"},'import { Context } from "@cogment/cogment-js-sdk";\nimport { useEffect, useState } from "react";\n\nexport const useActions = (cogSettings, actorName, actorClass) => {\n const [event, setEvent] = useState({\n observation: null,\n actions: null,\n messages: null,\n rewards: null,\n type: null,\n last: false,\n });\n\n const [startTrial, setStartTrial] = useState(null);\n const [sendAction, setSendAction] = useState(null);\n\n //Set up the connection and register the actor only once, regardless of re-rendering\n useEffect(() => {\n const context = new Context(cogSettings, actorName);\n\n context.registerActor(\n async (actorSession) => {\n actorSession.start();\n\n //Double arrow function here beause react will turn a single one into a lazy loaded function\n setSendAction(() => (action) => {\n actorSession.doAction(action);\n });\n\n for await (const event of actorSession.eventLoop()) {\n const eventUseActions = event;\n\n eventUseActions.last = event.type === 3;\n\n setEvent(eventUseActions);\n }\n },\n actorName,\n actorClass\n );\n\n const endpoint = process.env.REACT_APP_ORCHESTRATOR_HTTP_ENDPOINT;\n const controller = context.getController(endpoint);\n\n //Need to output a function so that the user can start the trial when all actors are connected\n //Again, double arrow function cause react will turn a single one into a lazy loaded function\n setStartTrial(() => async () => {\n const trialId = await controller.startTrial();\n await context.joinTrial(trialId, endpoint, actorName);\n });\n }, [cogSettings, actorName, actorClass]);\n\n return [event, startTrial, sendAction];\n};\n')),(0,o.kt)("p",null,"We also need to create ",(0,o.kt)("inlineCode",{parentName:"p"},"web_client/.eslintignore")," and add the following to it to ignore checks on the generate files:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre"},"src/*_pb*\nsrc/cog_settings*\n")),(0,o.kt)("p",null,"You can now see our app fully functional running the following commands in the ",(0,o.kt)("inlineCode",{parentName:"p"},"rps")," folder:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"./run.sh build\n./run.sh services_start\n")),(0,o.kt)("p",null,"In another terminal, start the web client:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"}," ./run.sh web_client_start\n")),(0,o.kt)("p",null,"And opening up <localhost:8000> in our browser."),(0,o.kt)("p",null,"And with that we're done!"),(0,o.kt)("h2",{id:"making-it-look-good"},"Making it look good"),(0,o.kt)("p",null,"If we want a fancier interface, there is a completed UI in the tutorials repository that we can copy into our project. Then, along with some style code that can be found in the repository version of App.js, just replace the return statement from App.js with the following:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-jsx"},'<Box>\n <Header observation={observation} gameState={gameState} />\n <Container className={classes.container}>\n <Player\n score={humanScore}\n color={theme.palette.primary.main}\n IconClass={PersonIcon}\n choose={choose}\n isHuman\n />\n\n <Player\n score={computerScore}\n color={theme.palette.secondary.main}\n IconClass={ComputerIcon}\n selected={\n gameState !== "start" &&\n getMoveText(observation.them.lastRoundMove)\n }\n />\n </Container>\n</Box>\n')))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/1be78505.88fe94d0.js b/assets/js/1be78505.88fe94d0.js new file mode 100644 index 0000000..805f466 --- /dev/null +++ b/assets/js/1be78505.88fe94d0.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[9514,4972],{9963:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ge});var a=n(7294),o=n(6010),l=n(833),r=n(5281),c=n(3320),i=n(3438),s=n(4477),d=n(1116),m=n(7452),u=n(5999),b=n(2466),p=n(5936);const h={backToTopButton:"backToTopButton_sjWU",backToTopButtonShow:"backToTopButtonShow_xfvO"};function E(){const{shown:e,scrollToTop:t}=function(e){let{threshold:t}=e;const[n,o]=(0,a.useState)(!1),l=(0,a.useRef)(!1),{startScroll:r,cancelScroll:c}=(0,b.Ct)();return(0,b.RF)(((e,n)=>{let{scrollY:a}=e;const r=n?.scrollY;r&&(l.current?l.current=!1:a>=r?(c(),o(!1)):a<t?o(!1):a+window.innerHeight<document.documentElement.scrollHeight&&o(!0))})),(0,p.S)((e=>{e.location.hash&&(l.current=!0,o(!1))})),{shown:n,scrollToTop:()=>r(0)}}({threshold:300});return a.createElement("button",{"aria-label":(0,u.I)({id:"theme.BackToTopButton.buttonAriaLabel",message:"Scroll back to top",description:"The ARIA label for the back to top button"}),className:(0,o.Z)("clean-btn",r.k.common.backToTopButton,h.backToTopButton,e&&h.backToTopButtonShow),type:"button",onClick:t})}var f=n(1442),g=n(6550),v=n(7524),k=n(6668),_=n(1327),C=n(7462);function S(e){return a.createElement("svg",(0,C.Z)({width:"20",height:"20","aria-hidden":"true"},e),a.createElement("g",{fill:"#7a7a7a"},a.createElement("path",{d:"M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"}),a.createElement("path",{d:"M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"})))}const I={collapseSidebarButton:"collapseSidebarButton_PEFL",collapseSidebarButtonIcon:"collapseSidebarButtonIcon_kv0_"};function N(e){let{onClick:t}=e;return a.createElement("button",{type:"button",title:(0,u.I)({id:"theme.docs.sidebar.collapseButtonTitle",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),"aria-label":(0,u.I)({id:"theme.docs.sidebar.collapseButtonAriaLabel",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),className:(0,o.Z)("button button--secondary button--outline",I.collapseSidebarButton),onClick:t},a.createElement(S,{className:I.collapseSidebarButtonIcon}))}var T=n(9689),x=n(902);const Z=Symbol("EmptyContext"),B=a.createContext(Z);function w(e){let{children:t}=e;const[n,o]=(0,a.useState)(null),l=(0,a.useMemo)((()=>({expandedItem:n,setExpandedItem:o})),[n]);return a.createElement(B.Provider,{value:l},t)}var y=n(6043),L=n(8596),A=n(9960),M=n(2389);function F(e){let{categoryLabel:t,onClick:n}=e;return a.createElement("button",{"aria-label":(0,u.I)({id:"theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel",message:"Toggle the collapsible sidebar category '{label}'",description:"The ARIA label to toggle the collapsible sidebar category"},{label:t}),type:"button",className:"clean-btn menu__caret",onClick:n})}function H(e){let{item:t,onItemClick:n,activePath:l,level:c,index:s,...d}=e;const{items:m,label:u,collapsible:b,className:p,href:h}=t,{docs:{sidebar:{autoCollapseCategories:E}}}=(0,k.L)(),f=function(e){const t=(0,M.Z)();return(0,a.useMemo)((()=>e.href?e.href:!t&&e.collapsible?(0,i.Wl)(e):void 0),[e,t])}(t),g=(0,i._F)(t,l),v=(0,L.Mg)(h,l),{collapsed:_,setCollapsed:S}=(0,y.u)({initialState:()=>!!b&&(!g&&t.collapsed)}),{expandedItem:I,setExpandedItem:N}=function(){const e=(0,a.useContext)(B);if(e===Z)throw new x.i6("DocSidebarItemsExpandedStateProvider");return e}(),T=function(e){void 0===e&&(e=!_),N(e?null:s),S(e)};return function(e){let{isActive:t,collapsed:n,updateCollapsed:o}=e;const l=(0,x.D9)(t);(0,a.useEffect)((()=>{t&&!l&&n&&o(!1)}),[t,l,n,o])}({isActive:g,collapsed:_,updateCollapsed:T}),(0,a.useEffect)((()=>{b&&null!=I&&I!==s&&E&&S(!0)}),[b,I,s,S,E]),a.createElement("li",{className:(0,o.Z)(r.k.docs.docSidebarItemCategory,r.k.docs.docSidebarItemCategoryLevel(c),"menu__list-item",{"menu__list-item--collapsed":_},p)},a.createElement("div",{className:(0,o.Z)("menu__list-item-collapsible",{"menu__list-item-collapsible--active":v})},a.createElement(A.Z,(0,C.Z)({className:(0,o.Z)("menu__link",{"menu__link--sublist":b,"menu__link--sublist-caret":!h&&b,"menu__link--active":g}),onClick:b?e=>{n?.(t),h?T(!1):(e.preventDefault(),T())}:()=>{n?.(t)},"aria-current":v?"page":void 0,"aria-expanded":b?!_:void 0,href:b?f??"#":f},d),u),h&&b&&a.createElement(F,{categoryLabel:u,onClick:e=>{e.preventDefault(),T()}})),a.createElement(y.z,{lazy:!0,as:"ul",className:"menu__list",collapsed:_},a.createElement(j,{items:m,tabIndex:_?-1:0,onItemClick:n,activePath:l,level:c+1})))}var P=n(3919),W=n(9471);const D={menuExternalLink:"menuExternalLink_NmtK"};function R(e){let{item:t,onItemClick:n,activePath:l,level:c,index:s,...d}=e;const{href:m,label:u,className:b,autoAddBaseUrl:p}=t,h=(0,i._F)(t,l),E=(0,P.Z)(m);return a.createElement("li",{className:(0,o.Z)(r.k.docs.docSidebarItemLink,r.k.docs.docSidebarItemLinkLevel(c),"menu__list-item",b),key:u},a.createElement(A.Z,(0,C.Z)({className:(0,o.Z)("menu__link",!E&&D.menuExternalLink,{"menu__link--active":h}),autoAddBaseUrl:p,"aria-current":h?"page":void 0,to:m},E&&{onClick:n?()=>n(t):void 0},d),u,!E&&a.createElement(W.Z,null)))}const V={menuHtmlItem:"menuHtmlItem_M9Kj"};function U(e){let{item:t,level:n,index:l}=e;const{value:c,defaultStyle:i,className:s}=t;return a.createElement("li",{className:(0,o.Z)(r.k.docs.docSidebarItemLink,r.k.docs.docSidebarItemLinkLevel(n),i&&[V.menuHtmlItem,"menu__list-item"],s),key:l,dangerouslySetInnerHTML:{__html:c}})}function z(e){let{item:t,...n}=e;switch(t.type){case"category":return a.createElement(H,(0,C.Z)({item:t},n));case"html":return a.createElement(U,(0,C.Z)({item:t},n));default:return a.createElement(R,(0,C.Z)({item:t},n))}}function K(e){let{items:t,...n}=e;return a.createElement(w,null,t.map(((e,t)=>a.createElement(z,(0,C.Z)({key:t,item:e,index:t},n)))))}const j=(0,a.memo)(K),q={menu:"menu_SIkG",menuWithAnnouncementBar:"menuWithAnnouncementBar_GW3s"};function G(e){let{path:t,sidebar:n,className:l}=e;const c=function(){const{isActive:e}=(0,T.nT)(),[t,n]=(0,a.useState)(e);return(0,b.RF)((t=>{let{scrollY:a}=t;e&&n(0===a)}),[e]),e&&t}();return a.createElement("nav",{"aria-label":(0,u.I)({id:"theme.docs.sidebar.navAriaLabel",message:"Docs sidebar",description:"The ARIA label for the sidebar navigation"}),className:(0,o.Z)("menu thin-scrollbar",q.menu,c&&q.menuWithAnnouncementBar,l)},a.createElement("ul",{className:(0,o.Z)(r.k.docs.docSidebarMenu,"menu__list")},a.createElement(j,{items:n,activePath:t,level:1})))}const Y="sidebar_njMd",O="sidebarWithHideableNavbar_wUlq",X="sidebarHidden_VK0M",J="sidebarLogo_isFc";function Q(e){let{path:t,sidebar:n,onCollapse:l,isHidden:r}=e;const{navbar:{hideOnScroll:c},docs:{sidebar:{hideable:i}}}=(0,k.L)();return a.createElement("div",{className:(0,o.Z)(Y,c&&O,r&&X)},c&&a.createElement(_.Z,{tabIndex:-1,className:J}),a.createElement(G,{path:t,sidebar:n}),i&&a.createElement(N,{onClick:l}))}const $=a.memo(Q);var ee=n(3102),te=n(3163);const ne=e=>{let{sidebar:t,path:n}=e;const l=(0,te.e)();return a.createElement("ul",{className:(0,o.Z)(r.k.docs.docSidebarMenu,"menu__list")},a.createElement(j,{items:t,activePath:n,onItemClick:e=>{"category"===e.type&&e.href&&l.toggle(),"link"===e.type&&l.toggle()},level:1}))};function ae(e){return a.createElement(ee.Zo,{component:ne,props:e})}const oe=a.memo(ae);function le(e){const t=(0,v.i)(),n="desktop"===t||"ssr"===t,o="mobile"===t;return a.createElement(a.Fragment,null,n&&a.createElement($,e),o&&a.createElement(oe,e))}const re={expandButton:"expandButton_m80_",expandButtonIcon:"expandButtonIcon_BlDH"};function ce(e){let{toggleSidebar:t}=e;return a.createElement("div",{className:re.expandButton,title:(0,u.I)({id:"theme.docs.sidebar.expandButtonTitle",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),"aria-label":(0,u.I)({id:"theme.docs.sidebar.expandButtonAriaLabel",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),tabIndex:0,role:"button",onKeyDown:t,onClick:t},a.createElement(S,{className:re.expandButtonIcon}))}const ie={docSidebarContainer:"docSidebarContainer_b6E3",docSidebarContainerHidden:"docSidebarContainerHidden_b3ry",sidebarViewport:"sidebarViewport_Xe31"};function se(e){let{children:t}=e;const n=(0,d.V)();return a.createElement(a.Fragment,{key:n?.name??"noSidebar"},t)}function de(e){let{sidebar:t,hiddenSidebarContainer:n,setHiddenSidebarContainer:l}=e;const{pathname:c}=(0,g.TH)(),[i,s]=(0,a.useState)(!1),d=(0,a.useCallback)((()=>{i&&s(!1),!i&&(0,f.n)()&&s(!0),l((e=>!e))}),[l,i]);return a.createElement("aside",{className:(0,o.Z)(r.k.docs.docSidebarContainer,ie.docSidebarContainer,n&&ie.docSidebarContainerHidden),onTransitionEnd:e=>{e.currentTarget.classList.contains(ie.docSidebarContainer)&&n&&s(!0)}},a.createElement(se,null,a.createElement("div",{className:(0,o.Z)(ie.sidebarViewport,i&&ie.sidebarViewportHidden)},a.createElement(le,{sidebar:t,path:c,onCollapse:d,isHidden:i}),i&&a.createElement(ce,{toggleSidebar:d}))))}const me={docMainContainer:"docMainContainer_gTbr",docMainContainerEnhanced:"docMainContainerEnhanced_Uz_u",docItemWrapperEnhanced:"docItemWrapperEnhanced_czyv"};function ue(e){let{hiddenSidebarContainer:t,children:n}=e;const l=(0,d.V)();return a.createElement("main",{className:(0,o.Z)(me.docMainContainer,(t||!l)&&me.docMainContainerEnhanced)},a.createElement("div",{className:(0,o.Z)("container padding-top--md padding-bottom--lg",me.docItemWrapper,t&&me.docItemWrapperEnhanced)},n))}const be={docPage:"docPage__5DB",docsWrapper:"docsWrapper_BCFX","themedComponent--light":"themedComponent--light_NU7w"};function pe(e){let{children:t}=e;const n=(0,d.V)(),[o,l]=(0,a.useState)(!1);return a.createElement(m.Z,{wrapperClassName:be.docsWrapper},a.createElement(E,null),a.createElement("div",{className:be.docPage},n&&a.createElement(de,{sidebar:n.items,hiddenSidebarContainer:o,setHiddenSidebarContainer:l}),a.createElement(ue,{hiddenSidebarContainer:o},t)))}var he=n(4972),Ee=n(197);function fe(e){const{versionMetadata:t}=e;return a.createElement(a.Fragment,null,a.createElement(Ee.Z,{version:t.version,tag:(0,c.os)(t.pluginId,t.version)}),a.createElement(l.d,null,t.noIndex&&a.createElement("meta",{name:"robots",content:"noindex, nofollow"})))}function ge(e){const{versionMetadata:t}=e,n=(0,i.hI)(e);if(!n)return a.createElement(he.default,null);const{docElement:c,sidebarName:m,sidebarItems:u}=n;return a.createElement(a.Fragment,null,a.createElement(fe,e),a.createElement(l.FG,{className:(0,o.Z)(r.k.wrapper.docsPages,r.k.page.docsDocPage,e.versionMetadata.className)},a.createElement(s.q,{version:t},a.createElement(d.b,{name:m,items:u},a.createElement(pe,null,c)))))}},4972:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});var a=n(7294),o=n(5999),l=n(833),r=n(7452);function c(){return a.createElement(a.Fragment,null,a.createElement(l.d,{title:(0,o.I)({id:"theme.NotFound.title",message:"Page Not Found"})}),a.createElement(r.Z,null,a.createElement("main",{className:"container margin-vert--xl"},a.createElement("div",{className:"row"},a.createElement("div",{className:"col col--6 col--offset-3"},a.createElement("h1",{className:"hero__title"},a.createElement(o.Z,{id:"theme.NotFound.title",description:"The title of the 404 page"},"Page Not Found")),a.createElement("p",null,a.createElement(o.Z,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page"},"We could not find what you were looking for.")),a.createElement("p",null,a.createElement(o.Z,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page"},"Please contact the owner of the site that linked you to the original URL and let them know their link is broken.")))))))}},4477:(e,t,n)=>{n.d(t,{E:()=>c,q:()=>r});var a=n(7294),o=n(902);const l=a.createContext(null);function r(e){let{children:t,version:n}=e;return a.createElement(l.Provider,{value:n},t)}function c(){const e=(0,a.useContext)(l);if(null===e)throw new o.i6("DocsVersionProvider");return e}}}]); \ No newline at end of file diff --git a/assets/js/1be78505.b5adb11b.js b/assets/js/1be78505.b5adb11b.js deleted file mode 100644 index ff44378..0000000 --- a/assets/js/1be78505.b5adb11b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[9514,4972],{9963:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Ce});var a=n(7294),l=n(6010),o=n(833),r=n(5281),c=n(3320),i=n(3438),s=n(4477),d=n(1116),m=n(7452),u=n(5999),b=n(2466),p=n(5936);const h="backToTopButton_sjWU",E="backToTopButtonShow_xfvO";function f(){const{shown:e,scrollToTop:t}=function(e){let{threshold:t}=e;const[n,l]=(0,a.useState)(!1),o=(0,a.useRef)(!1),{startScroll:r,cancelScroll:c}=(0,b.Ct)();return(0,b.RF)(((e,n)=>{let{scrollY:a}=e;const r=null==n?void 0:n.scrollY;r&&(o.current?o.current=!1:a>=r?(c(),l(!1)):a<t?l(!1):a+window.innerHeight<document.documentElement.scrollHeight&&l(!0))})),(0,p.S)((e=>{e.location.hash&&(o.current=!0,l(!1))})),{shown:n,scrollToTop:()=>r(0)}}({threshold:300});return a.createElement("button",{"aria-label":(0,u.I)({id:"theme.BackToTopButton.buttonAriaLabel",message:"Scroll back to top",description:"The ARIA label for the back to top button"}),className:(0,l.Z)("clean-btn",r.k.common.backToTopButton,h,e&&E),type:"button",onClick:t})}var v=n(6775),g=n(7524),_=n(6668),k=n(1327),C=n(7462);function S(e){return a.createElement("svg",(0,C.Z)({width:"20",height:"20","aria-hidden":"true"},e),a.createElement("g",{fill:"#7a7a7a"},a.createElement("path",{d:"M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"}),a.createElement("path",{d:"M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"})))}const I="collapseSidebarButton_PEFL",N="collapseSidebarButtonIcon_kv0_";function Z(e){let{onClick:t}=e;return a.createElement("button",{type:"button",title:(0,u.I)({id:"theme.docs.sidebar.collapseButtonTitle",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),"aria-label":(0,u.I)({id:"theme.docs.sidebar.collapseButtonAriaLabel",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),className:(0,l.Z)("button button--secondary button--outline",I),onClick:t},a.createElement(S,{className:N}))}var x=n(9689),T=n(902);const y=Symbol("EmptyContext"),w=a.createContext(y);function L(e){let{children:t}=e;const[n,l]=(0,a.useState)(null),o=(0,a.useMemo)((()=>({expandedItem:n,setExpandedItem:l})),[n]);return a.createElement(w.Provider,{value:o},t)}var A=n(6043),M=n(8596),B=n(9960),F=n(2389);function H(e){let{categoryLabel:t,onClick:n}=e;return a.createElement("button",{"aria-label":(0,u.I)({id:"theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel",message:"Toggle the collapsible sidebar category '{label}'",description:"The ARIA label to toggle the collapsible sidebar category"},{label:t}),type:"button",className:"clean-btn menu__caret",onClick:n})}function P(e){let{item:t,onItemClick:n,activePath:o,level:c,index:s,...d}=e;const{items:m,label:u,collapsible:b,className:p,href:h}=t,{docs:{sidebar:{autoCollapseCategories:E}}}=(0,_.L)(),f=function(e){const t=(0,F.Z)();return(0,a.useMemo)((()=>e.href?e.href:!t&&e.collapsible?(0,i.Wl)(e):void 0),[e,t])}(t),v=(0,i._F)(t,o),g=(0,M.Mg)(h,o),{collapsed:k,setCollapsed:S}=(0,A.u)({initialState:()=>!!b&&(!v&&t.collapsed)}),{expandedItem:I,setExpandedItem:N}=function(){const e=(0,a.useContext)(w);if(e===y)throw new T.i6("DocSidebarItemsExpandedStateProvider");return e}(),Z=function(e){void 0===e&&(e=!k),N(e?null:s),S(e)};return function(e){let{isActive:t,collapsed:n,updateCollapsed:l}=e;const o=(0,T.D9)(t);(0,a.useEffect)((()=>{t&&!o&&n&&l(!1)}),[t,o,n,l])}({isActive:v,collapsed:k,updateCollapsed:Z}),(0,a.useEffect)((()=>{b&&null!=I&&I!==s&&E&&S(!0)}),[b,I,s,S,E]),a.createElement("li",{className:(0,l.Z)(r.k.docs.docSidebarItemCategory,r.k.docs.docSidebarItemCategoryLevel(c),"menu__list-item",{"menu__list-item--collapsed":k},p)},a.createElement("div",{className:(0,l.Z)("menu__list-item-collapsible",{"menu__list-item-collapsible--active":g})},a.createElement(B.Z,(0,C.Z)({className:(0,l.Z)("menu__link",{"menu__link--sublist":b,"menu__link--sublist-caret":!h&&b,"menu__link--active":v}),onClick:b?e=>{null==n||n(t),h?Z(!1):(e.preventDefault(),Z())}:()=>{null==n||n(t)},"aria-current":g?"page":void 0,"aria-expanded":b?!k:void 0,href:b?f??"#":f},d),u),h&&b&&a.createElement(H,{categoryLabel:u,onClick:e=>{e.preventDefault(),Z()}})),a.createElement(A.z,{lazy:!0,as:"ul",className:"menu__list",collapsed:k},a.createElement(q,{items:m,tabIndex:k?-1:0,onItemClick:n,activePath:o,level:c+1})))}var D=n(3919),W=n(9471);const R="menuExternalLink_NmtK";function V(e){let{item:t,onItemClick:n,activePath:o,level:c,index:s,...d}=e;const{href:m,label:u,className:b,autoAddBaseUrl:p}=t,h=(0,i._F)(t,o),E=(0,D.Z)(m);return a.createElement("li",{className:(0,l.Z)(r.k.docs.docSidebarItemLink,r.k.docs.docSidebarItemLinkLevel(c),"menu__list-item",b),key:u},a.createElement(B.Z,(0,C.Z)({className:(0,l.Z)("menu__link",!E&&R,{"menu__link--active":h}),autoAddBaseUrl:p,"aria-current":h?"page":void 0,to:m},E&&{onClick:n?()=>n(t):void 0},d),u,!E&&a.createElement(W.Z,null)))}const z="menuHtmlItem_M9Kj";function U(e){let{item:t,level:n,index:o}=e;const{value:c,defaultStyle:i,className:s}=t;return a.createElement("li",{className:(0,l.Z)(r.k.docs.docSidebarItemLink,r.k.docs.docSidebarItemLinkLevel(n),i&&[z,"menu__list-item"],s),key:o,dangerouslySetInnerHTML:{__html:c}})}function K(e){let{item:t,...n}=e;switch(t.type){case"category":return a.createElement(P,(0,C.Z)({item:t},n));case"html":return a.createElement(U,(0,C.Z)({item:t},n));default:return a.createElement(V,(0,C.Z)({item:t},n))}}function j(e){let{items:t,...n}=e;return a.createElement(L,null,t.map(((e,t)=>a.createElement(K,(0,C.Z)({key:t,item:e,index:t},n)))))}const q=(0,a.memo)(j),G="menu_SIkG",Y="menuWithAnnouncementBar_GW3s";function O(e){let{path:t,sidebar:n,className:o}=e;const c=function(){const{isActive:e}=(0,x.nT)(),[t,n]=(0,a.useState)(e);return(0,b.RF)((t=>{let{scrollY:a}=t;e&&n(0===a)}),[e]),e&&t}();return a.createElement("nav",{"aria-label":(0,u.I)({id:"theme.docs.sidebar.navAriaLabel",message:"Docs sidebar",description:"The ARIA label for the sidebar navigation"}),className:(0,l.Z)("menu thin-scrollbar",G,c&&Y,o)},a.createElement("ul",{className:(0,l.Z)(r.k.docs.docSidebarMenu,"menu__list")},a.createElement(q,{items:n,activePath:t,level:1})))}const X="sidebar_njMd",J="sidebarWithHideableNavbar_wUlq",Q="sidebarHidden_VK0M",$="sidebarLogo_isFc";function ee(e){let{path:t,sidebar:n,onCollapse:o,isHidden:r}=e;const{navbar:{hideOnScroll:c},docs:{sidebar:{hideable:i}}}=(0,_.L)();return a.createElement("div",{className:(0,l.Z)(X,c&&J,r&&Q)},c&&a.createElement(k.Z,{tabIndex:-1,className:$}),a.createElement(O,{path:t,sidebar:n}),i&&a.createElement(Z,{onClick:o}))}const te=a.memo(ee);var ne=n(3102),ae=n(3163);const le=e=>{let{sidebar:t,path:n}=e;const o=(0,ae.e)();return a.createElement("ul",{className:(0,l.Z)(r.k.docs.docSidebarMenu,"menu__list")},a.createElement(q,{items:t,activePath:n,onItemClick:e=>{"category"===e.type&&e.href&&o.toggle(),"link"===e.type&&o.toggle()},level:1}))};function oe(e){return a.createElement(ne.Zo,{component:le,props:e})}const re=a.memo(oe);function ce(e){const t=(0,g.i)(),n="desktop"===t||"ssr"===t,l="mobile"===t;return a.createElement(a.Fragment,null,n&&a.createElement(te,e),l&&a.createElement(re,e))}const ie="expandButton_m80_",se="expandButtonIcon_BlDH";function de(e){let{toggleSidebar:t}=e;return a.createElement("div",{className:ie,title:(0,u.I)({id:"theme.docs.sidebar.expandButtonTitle",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),"aria-label":(0,u.I)({id:"theme.docs.sidebar.expandButtonAriaLabel",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),tabIndex:0,role:"button",onKeyDown:t,onClick:t},a.createElement(S,{className:se}))}const me={docSidebarContainer:"docSidebarContainer_b6E3",docSidebarContainerHidden:"docSidebarContainerHidden_b3ry",sidebarViewport:"sidebarViewport_Xe31"};function ue(e){let{children:t}=e;const n=(0,d.V)();return a.createElement(a.Fragment,{key:(null==n?void 0:n.name)??"noSidebar"},t)}function be(e){let{sidebar:t,hiddenSidebarContainer:n,setHiddenSidebarContainer:o}=e;const{pathname:c}=(0,v.TH)(),[i,s]=(0,a.useState)(!1),d=(0,a.useCallback)((()=>{i&&s(!1),o((e=>!e))}),[o,i]);return a.createElement("aside",{className:(0,l.Z)(r.k.docs.docSidebarContainer,me.docSidebarContainer,n&&me.docSidebarContainerHidden),onTransitionEnd:e=>{e.currentTarget.classList.contains(me.docSidebarContainer)&&n&&s(!0)}},a.createElement(ue,null,a.createElement("div",{className:(0,l.Z)(me.sidebarViewport,i&&me.sidebarViewportHidden)},a.createElement(ce,{sidebar:t,path:c,onCollapse:d,isHidden:i}),i&&a.createElement(de,{toggleSidebar:d}))))}const pe={docMainContainer:"docMainContainer_gTbr",docMainContainerEnhanced:"docMainContainerEnhanced_Uz_u",docItemWrapperEnhanced:"docItemWrapperEnhanced_czyv"};function he(e){let{hiddenSidebarContainer:t,children:n}=e;const o=(0,d.V)();return a.createElement("main",{className:(0,l.Z)(pe.docMainContainer,(t||!o)&&pe.docMainContainerEnhanced)},a.createElement("div",{className:(0,l.Z)("container padding-top--md padding-bottom--lg",pe.docItemWrapper,t&&pe.docItemWrapperEnhanced)},n))}const Ee="docPage__5DB",fe="docsWrapper_BCFX";function ve(e){let{children:t}=e;const n=(0,d.V)(),[l,o]=(0,a.useState)(!1);return a.createElement(m.Z,{wrapperClassName:fe},a.createElement(f,null),a.createElement("div",{className:Ee},n&&a.createElement(be,{sidebar:n.items,hiddenSidebarContainer:l,setHiddenSidebarContainer:o}),a.createElement(he,{hiddenSidebarContainer:l},t)))}var ge=n(4972),_e=n(197);function ke(e){const{versionMetadata:t}=e;return a.createElement(a.Fragment,null,a.createElement(_e.Z,{version:t.version,tag:(0,c.os)(t.pluginId,t.version)}),a.createElement(o.d,null,t.noIndex&&a.createElement("meta",{name:"robots",content:"noindex, nofollow"})))}function Ce(e){const{versionMetadata:t}=e,n=(0,i.hI)(e);if(!n)return a.createElement(ge.default,null);const{docElement:c,sidebarName:m,sidebarItems:u}=n;return a.createElement(a.Fragment,null,a.createElement(ke,e),a.createElement(o.FG,{className:(0,l.Z)(r.k.wrapper.docsPages,r.k.page.docsDocPage,e.versionMetadata.className)},a.createElement(s.q,{version:t},a.createElement(d.b,{name:m,items:u},a.createElement(ve,null,c)))))}},4972:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});var a=n(7294),l=n(5999),o=n(833),r=n(7452);function c(){return a.createElement(a.Fragment,null,a.createElement(o.d,{title:(0,l.I)({id:"theme.NotFound.title",message:"Page Not Found"})}),a.createElement(r.Z,null,a.createElement("main",{className:"container margin-vert--xl"},a.createElement("div",{className:"row"},a.createElement("div",{className:"col col--6 col--offset-3"},a.createElement("h1",{className:"hero__title"},a.createElement(l.Z,{id:"theme.NotFound.title",description:"The title of the 404 page"},"Page Not Found")),a.createElement("p",null,a.createElement(l.Z,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page"},"We could not find what you were looking for.")),a.createElement("p",null,a.createElement(l.Z,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page"},"Please contact the owner of the site that linked you to the original URL and let them know their link is broken.")))))))}},4477:(e,t,n)=>{n.d(t,{E:()=>c,q:()=>r});var a=n(7294),l=n(902);const o=a.createContext(null);function r(e){let{children:t,version:n}=e;return a.createElement(o.Provider,{value:n},t)}function c(){const e=(0,a.useContext)(o);if(null===e)throw new l.i6("DocsVersionProvider");return e}}}]); \ No newline at end of file diff --git a/assets/js/25848ff4.57f5c5cf.js b/assets/js/25848ff4.57f5c5cf.js deleted file mode 100644 index 96962c7..0000000 --- a/assets/js/25848ff4.57f5c5cf.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[8403],{3905:(e,t,r)=>{r.d(t,{Zo:()=>l,kt:()=>d});var n=r(7294);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var p=n.createContext({}),s=function(e){var t=n.useContext(p),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},l=function(e){var t=s(e.components);return n.createElement(p.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},f=n.forwardRef((function(e,t){var r=e.components,o=e.mdxType,a=e.originalType,p=e.parentName,l=c(e,["components","mdxType","originalType","parentName"]),f=s(r),d=o,y=f["".concat(p,".").concat(d)]||f[d]||u[d]||a;return r?n.createElement(y,i(i({ref:t},l),{},{components:r})):n.createElement(y,i({ref:t},l))}));function d(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=r.length,i=new Array(a);i[0]=f;var c={};for(var p in t)hasOwnProperty.call(t,p)&&(c[p]=t[p]);c.originalType=e,c.mdxType="string"==typeof e?e:o,i[1]=c;for(var s=2;s<a;s++)i[s]=r[s];return n.createElement.apply(null,i)}return n.createElement.apply(null,r)}f.displayName="MDXCreateElement"},3349:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>i,default:()=>u,frontMatter:()=>a,metadata:()=>c,toc:()=>s});var n=r(7462),o=(r(7294),r(3905));const a={sidebar_position:1},i="Installation",c={unversionedId:"reference/python-enterprise/installation",id:"reference/python-enterprise/installation",title:"Installation",description:"This page is a work in progress",source:"@site/docs/reference/python-enterprise/installation.md",sourceDirName:"reference/python-enterprise",slug:"/reference/python-enterprise/installation",permalink:"/docs/reference/python-enterprise/installation",draft:!1,tags:[],version:"current",lastUpdatedAt:1682371745,formattedLastUpdatedAt:"Apr 24, 2023",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"docSidebar",previous:{title:"Javascript SDK",permalink:"/docs/reference/javascript"},next:{title:"Runner",permalink:"/docs/reference/python-enterprise/runner"}},p={},s=[],l={toc:s};function u(e){let{components:t,...r}=e;return(0,o.kt)("wrapper",(0,n.Z)({},l,r,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"installation"},"Installation"),(0,o.kt)("admonition",{title:"WIP",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"This page is a work in progress")))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/25848ff4.82af9e63.js b/assets/js/25848ff4.82af9e63.js new file mode 100644 index 0000000..0c66a3f --- /dev/null +++ b/assets/js/25848ff4.82af9e63.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[8403],{3905:(e,t,r)=>{r.d(t,{Zo:()=>l,kt:()=>y});var n=r(7294);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var p=n.createContext({}),s=function(e){var t=n.useContext(p),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},l=function(e){var t=s(e.components);return n.createElement(p.Provider,{value:t},e.children)},u="mdxType",f={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,o=e.mdxType,a=e.originalType,p=e.parentName,l=c(e,["components","mdxType","originalType","parentName"]),u=s(r),d=o,y=u["".concat(p,".").concat(d)]||u[d]||f[d]||a;return r?n.createElement(y,i(i({ref:t},l),{},{components:r})):n.createElement(y,i({ref:t},l))}));function y(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=r.length,i=new Array(a);i[0]=d;var c={};for(var p in t)hasOwnProperty.call(t,p)&&(c[p]=t[p]);c.originalType=e,c[u]="string"==typeof e?e:o,i[1]=c;for(var s=2;s<a;s++)i[s]=r[s];return n.createElement.apply(null,i)}return n.createElement.apply(null,r)}d.displayName="MDXCreateElement"},3349:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>i,default:()=>f,frontMatter:()=>a,metadata:()=>c,toc:()=>s});var n=r(7462),o=(r(7294),r(3905));const a={sidebar_position:1},i="Installation",c={unversionedId:"reference/python-enterprise/installation",id:"reference/python-enterprise/installation",title:"Installation",description:"This page is a work in progress",source:"@site/docs/reference/python-enterprise/installation.md",sourceDirName:"reference/python-enterprise",slug:"/reference/python-enterprise/installation",permalink:"/docs/reference/python-enterprise/installation",draft:!1,tags:[],version:"current",lastUpdatedAt:1682371745,formattedLastUpdatedAt:"Apr 24, 2023",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"docSidebar",previous:{title:"Javascript SDK",permalink:"/docs/reference/javascript"},next:{title:"Runner",permalink:"/docs/reference/python-enterprise/runner"}},p={},s=[],l={toc:s},u="wrapper";function f(e){let{components:t,...r}=e;return(0,o.kt)(u,(0,n.Z)({},l,r,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"installation"},"Installation"),(0,o.kt)("admonition",{title:"WIP",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"This page is a work in progress")))}f.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/2d986b69.356337e0.js b/assets/js/2d986b69.356337e0.js deleted file mode 100644 index 68fd54c..0000000 --- a/assets/js/2d986b69.356337e0.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[8769],{3905:(e,t,a)=>{a.d(t,{Zo:()=>d,kt:()=>h});var n=a(7294);function i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function r(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?l(Object(a),!0).forEach((function(t){i(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function o(e,t){if(null==e)return{};var a,n,i=function(e,t){if(null==e)return{};var a,n,i={},l=Object.keys(e);for(n=0;n<l.length;n++)a=l[n],t.indexOf(a)>=0||(i[a]=e[a]);return i}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)a=l[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var s=n.createContext({}),p=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):r(r({},t),e)),a},d=function(e){var t=p(e.components);return n.createElement(s.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},c=n.forwardRef((function(e,t){var a=e.components,i=e.mdxType,l=e.originalType,s=e.parentName,d=o(e,["components","mdxType","originalType","parentName"]),c=p(a),h=i,k=c["".concat(s,".").concat(h)]||c[h]||m[h]||l;return a?n.createElement(k,r(r({ref:t},d),{},{components:a})):n.createElement(k,r({ref:t},d))}));function h(e,t){var a=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var l=a.length,r=new Array(l);r[0]=c;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o.mdxType="string"==typeof e?e:i,r[1]=o;for(var p=2;p<l;p++)r[p]=a[p];return n.createElement.apply(null,r)}return n.createElement.apply(null,a)}c.displayName="MDXCreateElement"},5161:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>r,default:()=>m,frontMatter:()=>l,metadata:()=>o,toc:()=>p});var n=a(7462),i=(a(7294),a(3905));const l={sidebar_position:4,toc_min_heading_level:2,toc_max_heading_level:2},r="Python SDK",o={unversionedId:"reference/python",id:"reference/python",title:"Python SDK",description:"Repository Latest release",source:"@site/docs/reference/python.md",sourceDirName:"reference",slug:"/reference/python",permalink:"/docs/reference/python",draft:!1,tags:[],version:"current",lastUpdatedAt:1697829025,formattedLastUpdatedAt:"Oct 20, 2023",sidebarPosition:4,frontMatter:{sidebar_position:4,toc_min_heading_level:2,toc_max_heading_level:2},sidebar:"docSidebar",previous:{title:"Status",permalink:"/docs/reference/cli/status"},next:{title:"Javascript SDK",permalink:"/docs/reference/javascript"}},s={},p=[{value:"Installation",id:"installation",level:2},{value:"General usage",id:"general-usage",level:2},{value:"<code>asyncio</code>",id:"asyncio",level:3},{value:"Logging",id:"logging",level:3},{value:"Trial Specifications",id:"trial-specifications",level:3},{value:"Trial Parameters",id:"trial-parameters",level:3},{value:"Compiling the spec file into cog_settings.py",id:"compiling-the-spec-file-into-cog_settingspy",level:3},{value:"Top-level import",id:"top-level-import",level:3},{value:"class cogment.Context",id:"class-cogmentcontext",level:2},{value:"<code>__init__(self, user_id, cog_settings, asyncio_loop=None, prometheus_registry=prometheus_client.core.REGISTRY, directory_endpoint=None, directory_auth_token=None)</code>",id:"__init__self-user_id-cog_settings-asyncio_loopnone-prometheus_registryprometheus_clientcoreregistry-directory_endpointnone-directory_auth_tokennone",level:3},{value:"<code>has_specs(self)</code>",id:"has_specsself",level:3},{value:"<code>async serve_all_registered(self, served_endpoint=ServedEndpoint(), prometheus_port=None, directory_registration_host=None)</code>",id:"async-serve_all_registeredself-served_endpointservedendpoint-prometheus_portnone-directory_registration_hostnone",level:3},{value:"<code>async get_controller(self, endpoint=Endpoint())</code>",id:"async-get_controllerself-endpointendpoint",level:3},{value:"<code>async get_datastore(self, endpoint=Endpoint())</code>",id:"async-get_datastoreself-endpointendpoint",level:3},{value:"<code>async get_model_registry_v2(self, endpoint=Endpoint())</code>",id:"async-get_model_registry_v2self-endpointendpoint",level:3},{value:"<code>async join_trial(self, trial_id, endpoint=Endpoint(), impl_name=None, actor_name=None, actor_class=None)</code>",id:"async-join_trialself-trial_id-endpointendpoint-impl_namenone-actor_namenone-actor_classnone",level:3},{value:"<code>register_environment(self, impl, impl_name, properties={})</code>",id:"register_environmentself-impl-impl_name-properties",level:3},{value:"<code>register_actor(self, impl, impl_name, actor_classes=[], properties={})</code>",id:"register_actorself-impl-impl_name-actor_classes-properties",level:3},{value:"<code>register_pre_trial_hook(self, impl, properties={})</code>",id:"register_pre_trial_hookself-impl-properties",level:3},{value:"<code>register_datalog(self, impl, properties={})</code>",id:"register_datalogself-impl-properties",level:3},{value:"class Controller",id:"class-controller",level:2},{value:"<code>has_specs(self)</code>",id:"has_specsself-1",level:3},{value:"<code>async start_trial(self, trial_config=None, trial_id_requested=None, trial_params=None)</code>",id:"async-start_trialself-trial_confignone-trial_id_requestednone-trial_paramsnone",level:3},{value:"<code>async terminate_trial(self, trial_ids, hard=False)</code>",id:"async-terminate_trialself-trial_ids-hardfalse",level:3},{value:"<code>async get_trial_info(self, trial_ids)</code>",id:"async-get_trial_infoself-trial_ids",level:3},{value:"<code>async watch_trials(self, trial_state_filters=[], full_info=False)</code>",id:"async-watch_trialsself-trial_state_filters-full_infofalse",level:3},{value:"<code>async get_actors(self, trial_id)</code>",id:"async-get_actorsself-trial_id",level:3},{value:"<code>async get_remote_versions(self)</code>",id:"async-get_remote_versionsself",level:3},{value:"class Datastore",id:"class-datastore",level:2},{value:"<code>has_specs(self)</code>",id:"has_specsself-2",level:3},{value:"<code>async get_trials(self, ids=[], properties={})</code>",id:"async-get_trialsself-ids-properties",level:3},{value:"<code>async all_trials(self, bundle_size=1, wait_for_trials=0, properties={}, ids=[])</code>",id:"async-all_trialsself-bundle_size1-wait_for_trials0-properties-ids",level:3},{value:"<code>async delete_trials(self, ids)</code>",id:"async-delete_trialsself-ids",level:3},{value:"<code>async all_samples(self, trial_infos, actor_names=[], actor_classes=[], actor_implementations=[], fields=[])</code>",id:"async-all_samplesself-trial_infos-actor_names-actor_classes-actor_implementations-fields",level:3},{value:"class ModelRegistry",id:"class-modelregistry",level:2},{value:"<code>has_specs(self)</code>",id:"has_specsself-3",level:3},{value:"<code>async store_model(self, name, model, iteration_properties=None)</code>",id:"async-store_modelself-name-model-iteration_propertiesnone",level:3},{value:"<code>async publish_model(self, name, model, iteration_properties=None)</code>",id:"async-publish_modelself-name-model-iteration_propertiesnone",level:3},{value:"<code>async retrieve_model(self, name, iteration=-1)</code>",id:"async-retrieve_modelself-name-iteration-1",level:3},{value:"<code>async remove_model(self, name)</code>",id:"async-remove_modelself-name",level:3},{value:"<code>async list_models(self)</code>",id:"async-list_modelsself",level:3},{value:"<code>async list_iterations(self, model_name)</code>",id:"async-list_iterationsself-model_name",level:3},{value:"<code>async get_iteration_info(self, name, iteration)</code>",id:"async-get_iteration_infoself-name-iteration",level:3},{value:"<code>async update_model_info(self, name, properties)</code>",id:"async-update_model_infoself-name-properties",level:3},{value:"<code>async get_model_info(self, name)</code>",id:"async-get_model_infoself-name",level:3},{value:"<code>async iteration_updates(self, model_name)</code>",id:"async-iteration_updatesself-model_name",level:3},{value:"<code>async track_latest_model(self, name, deserialize_func=None, initial_wait=0)</code>",id:"async-track_latest_modelself-name-deserialize_funcnone-initial_wait0",level:3},{value:"class Session",id:"class-session",level:2},{value:"<code>get_trial_id(self)</code>",id:"get_trial_idself",level:3},{value:"<code>get_tick_id(self)</code>",id:"get_tick_idself",level:3},{value:"<code>is_trial_over(self)</code>",id:"is_trial_overself",level:3},{value:"<code>sending_done(self)</code>",id:"sending_doneself",level:3},{value:"<code>add_reward(self, value, confidence, to, tick_id=-1, user_data=None)</code>",id:"add_rewardself-value-confidence-to-tick_id-1-user_datanone",level:3},{value:"class EnvironmentSession(Session)",id:"class-environmentsessionsession",level:2},{value:"<code>start(self, observations = None, auto_done_sending=True)</code>",id:"startself-observations--none-auto_done_sendingtrue",level:3},{value:"<code>async all_events(self)</code>",id:"async-all_eventsself",level:3},{value:"<code>produce_observations(self, observations)</code>",id:"produce_observationsself-observations",level:3},{value:"<code>end(self, final_observations)</code>",id:"endself-final_observations",level:3},{value:"<code>get_active_actors(self)</code>",id:"get_active_actorsself",level:3},{value:"<code>send_message(self, payload, to)</code>",id:"send_messageself-payload-to",level:3},{value:"class ActorSession(Session)",id:"class-actorsessionsession",level:2},{value:"<code>start(self, auto_done_sending=True)</code>",id:"startself-auto_done_sendingtrue",level:3},{value:"<code>async all_events(self)</code>",id:"async-all_eventsself-1",level:3},{value:"<code>do_action(self, action)</code>",id:"do_actionself-action",level:3},{value:"<code>send_message(self, payload, to)</code>",id:"send_messageself-payload-to-1",level:3},{value:"class PrehookSession",id:"class-prehooksession",level:2},{value:"<code>get_trial_id(self)</code>",id:"get_trial_idself-1",level:3},{value:"<code>get_user_id(self)</code>",id:"get_user_idself",level:3},{value:"class DatalogSession",id:"class-datalogsession",level:2},{value:"<code>start(self)</code>",id:"startself",level:3},{value:"<code>all_samples(self)</code>",id:"all_samplesself",level:3},{value:"class cogment.Endpoint",id:"class-cogmentendpoint",level:2},{value:"<code>__init__(self, url="cogment://discover")</code>",id:"__init__self-urlcogmentdiscover",level:3},{value:"class cogment.ServedEndpoint",id:"class-cogmentservedendpoint",level:2},{value:"<code>__init__(self, port=0)</code>",id:"__init__self-port0",level:3},{value:"class cogment.TrialState(enum.Enum)",id:"class-cogmenttrialstateenumenum",level:2},{value:"class TrialInfo",id:"class-trialinfo",level:2},{value:"class ActorInfo",id:"class-actorinfo",level:2},{value:"class RecvEvent",id:"class-recvevent",level:2},{value:"class cogment.EventType(enum.Enum)",id:"class-cogmenteventtypeenumenum",level:3},{value:"class RecvObservation",id:"class-recvobservation",level:2},{value:"class cogment.ActorStatus(enum.Enum)",id:"class-cogmentactorstatusenumenum",level:2},{value:"class RecvAction",id:"class-recvaction",level:2},{value:"class RecvMessage",id:"class-recvmessage",level:2},{value:"class RecvReward",id:"class-recvreward",level:2},{value:"<code>get_nb_sources(self)</code>",id:"get_nb_sourcesself",level:3},{value:"<code>all_sources(self)</code>",id:"all_sourcesself",level:3},{value:"class RecvRewardSource",id:"class-recvrewardsource",level:2},{value:"class cogment.TrialParameters",id:"class-cogmenttrialparameters",level:2},{value:"<code>__init__(self, cog_settings, **kwargs)</code>",id:"__init__self-cog_settings-kwargs",level:3},{value:"<code>has_specs(self)</code>",id:"has_specsself-4",level:3},{value:"<code>get_serialization_type(self)</code>",id:"get_serialization_typeself",level:3},{value:"<code>serialize(self)</code>",id:"serializeself",level:3},{value:"<code>deserialize(self, raw_string, type=None)</code>",id:"deserializeself-raw_string-typenone",level:3},{value:"class cogment.ActorParameters",id:"class-cogmentactorparameters",level:2},{value:"<code>__init__(self, cog_settings, class_name, **kwargs)</code>",id:"__init__self-cog_settings-class_name-kwargs",level:3},{value:"<code>has_specs(self)</code>",id:"has_specsself-5",level:3},{value:"class cogment.LogSample",id:"class-cogmentlogsample",level:2},{value:"<code>__init__(self, params)</code>",id:"__init__self-params",level:3},{value:"<code>get_serialization_type(self)</code>",id:"get_serialization_typeself-1",level:3},{value:"<code>serialize(self)</code>",id:"serializeself-1",level:3},{value:"<code>deserialize(self, raw_string)</code>",id:"deserializeself-raw_string",level:3},{value:"<code>all_actor_names(self)</code>",id:"all_actor_namesself",level:3},{value:"<code>get_action(self, actor)</code>",id:"get_actionself-actor",level:3},{value:"<code>get_observation(self, actor)</code>",id:"get_observationself-actor",level:3},{value:"<code>all_rewards(self)</code>",id:"all_rewardsself",level:3},{value:"<code>all_messages(self)</code>",id:"all_messagesself",level:3},{value:"class ModelInfo",id:"class-modelinfo",level:2},{value:"class ModelIterationInfo",id:"class-modeliterationinfo",level:2},{value:"class LatestModel",id:"class-latestmodel",level:2},{value:"<code>async get(self)</code>",id:"async-getself",level:3},{value:"<code>is_deserialized(self)</code>",id:"is_deserializedself",level:3},{value:"<code>is_available(self)</code>",id:"is_availableself",level:3},{value:"<code>async wait_for_available(self)</code>",id:"async-wait_for_availableself",level:3},{value:"<code>async wait_for_newer(self, iteration)</code>",id:"async-wait_for_newerself-iteration",level:3},{value:"class cogment.DatastoreFields(enum.Enum)",id:"class-cogmentdatastorefieldsenumenum",level:2},{value:"class DatastoreTrialInfo",id:"class-datastoretrialinfo",level:2},{value:"<code>has_specs(self)</code>",id:"has_specsself-6",level:3},{value:"class DatastoreSample",id:"class-datastoresample",level:2},{value:"<code>has_specs(self)</code>",id:"has_specsself-7",level:3},{value:"class DatastoreActorData",id:"class-datastoreactordata",level:2},{value:"<code>has_specs(self)</code>",id:"has_specsself-8",level:3},{value:"<code>all_received_rewards(self)</code>",id:"all_received_rewardsself",level:3},{value:"<code>all_sent_rewards(self)</code>",id:"all_sent_rewardsself",level:3},{value:"<code>all_received_messages(self)</code>",id:"all_received_messagesself",level:3},{value:"<code>all_sent_messages(self)</code>",id:"all_sent_messagesself",level:3},{value:"class DatastoreReward",id:"class-datastorereward",level:2},{value:"class DatastoreMessage",id:"class-datastoremessage",level:2}],d={toc:p};function m(e){let{components:t,...a}=e;return(0,i.kt)("wrapper",(0,n.Z)({},d,a,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"python-sdk"},"Python SDK"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-py-sdk"},(0,i.kt)("img",{parentName:"a",src:"https://img.shields.io/badge/repository-cogment%2Fcogment--py--sdk-%235217b8?style=for-the-badge&logo=github",alt:"Repository"}))," ",(0,i.kt)("a",{parentName:"p",href:"https://pypi.org/project/cogment/"},(0,i.kt)("img",{parentName:"a",src:"https://img.shields.io/pypi/v/cogment?style=for-the-badge",alt:"Latest release"}))),(0,i.kt)("h2",{id:"installation"},"Installation"),(0,i.kt)("p",null,"The simplest way to install the python SDK is to just install it using pip: ",(0,i.kt)("inlineCode",{parentName:"p"},"pip install cogment"),"."),(0,i.kt)("p",null,"To install the generator (for ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings.py"),") it is done similarly with pip: ",(0,i.kt)("inlineCode",{parentName:"p"},"pip install cogment[generate]"),". If both are needed, installing the generator will install the Python SDK."),(0,i.kt)("p",null,"The basic requirement is Python 3.7."),(0,i.kt)("h2",{id:"general-usage"},"General usage"),(0,i.kt)("h3",{id:"asyncio"},(0,i.kt)("inlineCode",{parentName:"h3"},"asyncio")),(0,i.kt)("p",null,"The Python SDK is designed to run concurrently and asynchronously using the Python ",(0,i.kt)("inlineCode",{parentName:"p"},"asyncio")," library. As such, it should be run in an ",(0,i.kt)("inlineCode",{parentName:"p"},"asyncio.Task"),"."),(0,i.kt)("p",null,"E.g."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"asyncio.run(MyMainFunction())\n")),(0,i.kt)("h3",{id:"logging"},"Logging"),(0,i.kt)("p",null,"The Python SDK uses the ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.sdk")," logger, and the default log level is ",(0,i.kt)("inlineCode",{parentName:"p"},"INFO"),". E.g. to change the log level to ",(0,i.kt)("inlineCode",{parentName:"p"},"WARNING"),":"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'import cogment\nimport logging\n\nlogging.getLogger("cogment.sdk").setLevel(logging.WARNING)\n')),(0,i.kt)("p",null,"Or set the environment variable ",(0,i.kt)("inlineCode",{parentName:"p"},"COGMENT_LOG_LEVEL")," to one of the values: ",(0,i.kt)("inlineCode",{parentName:"p"},"off"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"error"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"warning"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"info"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"debug"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"trace")," (which match the respective Python levels ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.CRITICAL"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.ERROR"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.WARNING"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.INFO"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.DEBUG"),").\nSince the Cogment Python SDK does not output any critical logs, the ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.CRITICAL")," level effectively turns logging off.\nThe ",(0,i.kt)("inlineCode",{parentName:"p"},"trace")," level does not match a standard Python logging level and is mostly for internal use with a level lower than ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.DEBUG"),"."),(0,i.kt)("p",null,"The Cogment logger does not define a handler, and the handler management is left to the application (as is standard for a library in Python).\nThus the Python ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.lastResort")," handler will be used if no explicit handler is defined by the application (i.e. only warnings and errors will be output to stderr, with no formatting).\nThe application should enable a handler as required.\nE.g. for a default logging setup (including a stream handler):"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"import cogment\nimport logging\n\nlogging.basicConfig()\n")),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"Calling any of the module level functions ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.log"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.debug"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.info"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.warning"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.error"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.critical")," or ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.exception"),", will implicitly call ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.basicConfig"),".\nAnd calling ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.basicConfig")," does nothing if there is a root handler already defined.\nSee Python documentation for ",(0,i.kt)("a",{parentName:"p",href:"https://docs.python.org/3/library/logging.html#logging.basicConfig"},"logging.basicConfig"))),(0,i.kt)("h3",{id:"trial-specifications"},"Trial Specifications"),(0,i.kt)("p",null,"The specifications (specs) of a trial type are contained in a ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cogment-yaml"},"spec file")," and the imported files defined in the spec file. This file is typically named ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.yaml"),"."),(0,i.kt)("p",null,"For example, an ",(0,i.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#actors"},"actor")," class is defined by its required observation space and action space."),(0,i.kt)("p",null,'These "spaces" are defined by using protobuf message types (from the imported files). ',(0,i.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#observations--actions"},"Observations and actions")," will simply be instances of the appropriate type."),(0,i.kt)("p",null,"Messages and feedback user data don't have a set type, they can be any type of protobuf message as long as the receiver can manage that type (i.e. the object received is an instance of ",(0,i.kt)("inlineCode",{parentName:"p"},"google.protobuf.Any")," and the contained type should be checked against known types before handling). The type is determined by the provided message from the originator."),(0,i.kt)("h3",{id:"trial-parameters"},"Trial Parameters"),(0,i.kt)("p",null,"The trial ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters"},"parameters")," can come from the Controller ",(0,i.kt)("inlineCode",{parentName:"p"},"start_trial")," command, from the default parameters provided to the Orchestrator on startup, or from the pre-trial hooks (themselves provided to the Orchestrator on startup)."),(0,i.kt)("p",null,"The parameters are mostly independent of the spec file (cogment.yaml), except that the active actors listed in the parameters must have their actor class match an actor class defined in the spec file."),(0,i.kt)("p",null,"Below, when we refer to the trial parameters, we mean the final parameters after any pre-trial hooks."),(0,i.kt)("h3",{id:"compiling-the-spec-file-into-cog_settingspy"},"Compiling the spec file into cog_settings.py"),(0,i.kt)("p",null,"In order to use the specifications within python scripts, the ",(0,i.kt)("a",{parentName:"p",href:"#trial-specifications"},"spec file")," needs to be compiled into python modules. This is done by the Python SDK generator (see ","[#installation]",")."),(0,i.kt)("p",null,"The generator is used this way:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"$ python3 -m cogment.generate --spec cogment.yaml --output ./cog_settings.py\n")),(0,i.kt)("p",null,"This will create a ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings.py")," specs module in the current directory (",(0,i.kt)("inlineCode",{parentName:"p"},"--output ./"),"). The generator will also compile the imported ",(0,i.kt)("inlineCode",{parentName:"p"},"*.proto")," files into python modules that will be saved in the same location as the specified output file (",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings.py"),") and they will be named according to their proto names: ",(0,i.kt)("inlineCode",{parentName:"p"},"<name>.proto")," is compiled to ",(0,i.kt)("inlineCode",{parentName:"p"},"<name>_pb2.py"),"."),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings.py")," Python module is required by all API entry points."),(0,i.kt)("h3",{id:"top-level-import"},"Top-level import"),(0,i.kt)("p",null,"The main module of the Cogment SDK is ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment"),". But all cogment scripts need to start with a ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.Context"),", which also requires the generated module ",(0,i.kt)("a",{parentName:"p",href:"#compiling-the-spec-file-into-cog_settingspy"},"cog_settings")," (project specific definitions created from the spec file)."),(0,i.kt)("p",null,"If one needs to create a ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.TrialParameters")," or ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.ActorParameters")," from scratch, the ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings")," module is also required."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"import cog_settings\nimport cogment\n")),(0,i.kt)("h2",{id:"class-cogmentcontext"},"class cogment.Context"),(0,i.kt)("p",null,"Class to setup and run all the different aspects of Cogment trials."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"served_port"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The port on which ",(0,i.kt)("inlineCode",{parentName:"p"},"serve_all_registered")," is offering the various registered services. The port is 0 if no services are offered (e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"serve_all_registered")," was not called yet).\n",(0,i.kt)("inlineCode",{parentName:"p"},"asyncio_loop"),": ",(0,i.kt)("em",{parentName:"p"},"asyncio.EventLoop instance")," - The Python asyncio loop used by the context (note that the actual type is specific to the platform)."),(0,i.kt)("h3",{id:"__init__self-user_id-cog_settings-asyncio_loopnone-prometheus_registryprometheus_clientcoreregistry-directory_endpointnone-directory_auth_tokennone"},(0,i.kt)("inlineCode",{parentName:"h3"},"__init__(self, user_id, cog_settings, asyncio_loop=None, prometheus_registry=prometheus_client.core.REGISTRY, directory_endpoint=None, directory_auth_token=None)")),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"user_id"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Identifier for the user of this context."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"cog_settings"),": ",(0,i.kt)("em",{parentName:"li"},"module")," - Specs module associated with trials that will be run, observed or inquired (see ",(0,i.kt)("a",{parentName:"li",href:"#compiling-the-spec-file-into-cog_settingspy"},"cog_settings generation"),"). This can be None in some circumstances."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"asyncio_loop"),": ",(0,i.kt)("em",{parentName:"li"},"asyncio.EventLoop instance")," - The Python asyncio loop into which the Context should operate. If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", the current loop will be used."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"prometheus_registry"),": ",(0,i.kt)("em",{parentName:"li"},"prometheus_client.core.CollectorRegistry instance")," - Prometheus registry that'll be used by the Cogment metrics in this context. Can be set to ",(0,i.kt)("inlineCode",{parentName:"li"},"None")," to completely deactivate them. The default value is Prometheus' default global registry."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"directory_endpoint"),": ",(0,i.kt)("em",{parentName:"li"},"Endpoint instance"),' - Grpc endpoint (i.e. starting with "grpc://") to access the directory. The directory will be used to inquire discovery endpoints, and to register the services for discovery. If no endpoint is provided, a check for the environment variable ',(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_ENDPOINT")," will be made and if it exists, it will be used as the URL of a basic endpoint."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"directory_auth_token"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Authentication token for access to the directory. This token will be registered with the services, and must match registered tokens when inquiring the directory. If no token is provided, a check for the environment variable ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_AUTHENTICATION_TOKEN")," will be made and if it exists, it will be used as the token.")),(0,i.kt)("h3",{id:"has_specsself"},(0,i.kt)("inlineCode",{parentName:"h3"},"has_specs(self)")),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the specs are known. False otherwise. The specs are known if the ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings")," argument was provided and not ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),". A context instantiated without specs has limited functionality and will produce objects without specs (thus also having limited functionality)."),(0,i.kt)("h3",{id:"async-serve_all_registeredself-served_endpointservedendpoint-prometheus_portnone-directory_registration_hostnone"},(0,i.kt)("inlineCode",{parentName:"h3"},"async serve_all_registered(self, served_endpoint=ServedEndpoint(), prometheus_port=None, directory_registration_host=None)")),(0,i.kt)("p",null,"Method to start and run the communication server for the registered components (environment, actor, prehook, datalog). This coroutine will end when all activity has stopped. If a directory is defined in the Context, then this method will also register the services in the defined directory."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"served_endpoint"),": ",(0,i.kt)("em",{parentName:"li"},"ServedEndpoint instance")," - Details of the connection for the served components. If ",(0,i.kt)("inlineCode",{parentName:"li"},"served_endpoint.port")," is zero (0), then the system will choose a free port; in which case the port chosen is found in the ",(0,i.kt)("inlineCode",{parentName:"li"},"served_port")," attribute of the Context."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"prometheus_port"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - TCP/IP port number for Prometheus. Set to None to disable the Prometheus metrics server."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"directory_registration_host"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Hostname (or IP address) of the host to register to the directory (the port is taken from the ",(0,i.kt)("inlineCode",{parentName:"li"},"served_endpoint"),") for the services registered. If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", the SDK will determine the current host IP address automatically. In some circumstances, the IP address determined by the SDK may be wrong (e.g. multiple interfaces, load balancing, firewall), thus a host must be explicitly provided.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"async-get_controllerself-endpointendpoint"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_controller(self, endpoint=Endpoint())")),(0,i.kt)("p",null,"Method to get a controller instance to manage trials (start, stop, inquire, etc)."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"endpoint"),": ",(0,i.kt)("em",{parentName:"li"},(0,i.kt)("a",{parentName:"em",href:"#class-cogmentendpoint"},"Endpoint")," instance")," - Details of the connection to the Orchestrator.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"Controller instance")," - An instance of the ",(0,i.kt)("inlineCode",{parentName:"p"},"Controller")," class used to manage trials."),(0,i.kt)("h3",{id:"async-get_datastoreself-endpointendpoint"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_datastore(self, endpoint=Endpoint())")),(0,i.kt)("p",null,"Method to get a class instance to retrieve and manage data in a Datastore."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"endpoint"),": ",(0,i.kt)("em",{parentName:"li"},(0,i.kt)("a",{parentName:"em",href:"#class-cogmentendpoint"},"Endpoint")," instance")," - Details of the connection to the Datastore.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"Datastore instance")," - An instance of the ",(0,i.kt)("inlineCode",{parentName:"p"},"Datastore")," class."),(0,i.kt)("h3",{id:"async-get_model_registry_v2self-endpointendpoint"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_model_registry_v2(self, endpoint=Endpoint())")),(0,i.kt)("p",null,"Method to get a class instance to store and retrieve models in a Model Registry"),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"endpoint"),": ",(0,i.kt)("em",{parentName:"li"},(0,i.kt)("a",{parentName:"em",href:"#class-cogmentendpoint"},"Endpoint")," instance")," - Details of the connection to the Model Registry.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"ModelRegistry instance")," - An instance of the ",(0,i.kt)("inlineCode",{parentName:"p"},"ModelRegistry")," class."),(0,i.kt)("h3",{id:"async-join_trialself-trial_id-endpointendpoint-impl_namenone-actor_namenone-actor_classnone"},(0,i.kt)("inlineCode",{parentName:"h3"},"async join_trial(self, trial_id, endpoint=Endpoint(), impl_name=None, actor_name=None, actor_class=None)")),(0,i.kt)("p",null,"Method for an actor to asynchronously join an existing trial. This task will normally end after the user implementation has exited."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_id"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The UUID of the trial to join."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"endpoint"),": ",(0,i.kt)("em",{parentName:"li"},(0,i.kt)("a",{parentName:"em",href:"#class-cogmentendpoint"},"Endpoint")," instance")," - Details of the connection to the Orchestrator."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"impl_name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - ",(0,i.kt)("strong",{parentName:"li"},"deprecated")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Name of the actor joining the trial. If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_class")," will be used to find the actor to join. The name must match an active actor in the trial as found in the trial parameters in the sections ",(0,i.kt)("inlineCode",{parentName:"li"},"trial_params:actors:name")," with ",(0,i.kt)("inlineCode",{parentName:"li"},"trial_params:actors:endpoint"),' set to "cogment://client".'),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_class"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The class of actor to join the trial. If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_name")," will be used to find the actor to join. The class must match an active actor in the trial as found in the trial parameters in the sections ",(0,i.kt)("inlineCode",{parentName:"li"},"trial_params:actors:actor_class")," with ",(0,i.kt)("inlineCode",{parentName:"li"},"trial_params:actors:endpoint"),' set to "cogment://client".')),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"register_environmentself-impl-impl_name-properties"},(0,i.kt)("inlineCode",{parentName:"h3"},"register_environment(self, impl, impl_name, properties={})")),(0,i.kt)("p",null,"Method to register the asynchronous callback function that will run an environment for a trial."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"impl"),": ",(0,i.kt)("em",{parentName:"li"},"async function(EnvironmentSession instance)")," - Callback function to be registered."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"impl_name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Name for the environment being run by the given callback function."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"properties"),": ",(0,i.kt)("em",{parentName:"li"},"dict{str:str}")," : Properties associated with the environment to be registered in the directory. These properties may be used for inquiries into the directory to find this environment.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"register_actorself-impl-impl_name-actor_classes-properties"},(0,i.kt)("inlineCode",{parentName:"h3"},"register_actor(self, impl, impl_name, actor_classes=[], properties={})")),(0,i.kt)("p",null,"Method to register the asynchronous callback function that will run an actor for a trial."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"impl"),": ",(0,i.kt)("em",{parentName:"li"},"async func(ActorSession instance)")," - Callback function to be registered."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"impl_name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Name for the actor implementation being run by the given callback function."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes"),": ",(0,i.kt)("em",{parentName:"li"},"list","[str]")," - The actor class name(s) that can be run by the given callback function. The possible names are specified in the spec file under section ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes:name"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"properties"),": ",(0,i.kt)("em",{parentName:"li"},"dict{str:str}")," : Properties associated with the actor to be registered in the directory. These properties may be used for inquiries into the directory to find this actor.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"register_pre_trial_hookself-impl-properties"},(0,i.kt)("inlineCode",{parentName:"h3"},"register_pre_trial_hook(self, impl, properties={})")),(0,i.kt)("p",null,"Method to register an asynchronous callback function that will be called before a trial is started. Only one such function can be registered. But there may be multiple hook services for an Orchestrator. They are provided to the Orchestrator at startup. All hooks registered with the Orchestrator will be called in a pipeline fashion before each new trial."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"impl"),": ",(0,i.kt)("em",{parentName:"li"},"async func(PrehookSession instance)")," - Callback function to be registered. The ",(0,i.kt)("inlineCode",{parentName:"li"},"PrehookSession")," instance member data should be changed as needed for the new trial before returning from this function."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"properties"),": ",(0,i.kt)("em",{parentName:"li"},"dict{str:str}")," : Properties associated with the hook to be registered in the directory. These properties may be used for inquiries into the directory to find this hook.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"register_datalogself-impl-properties"},(0,i.kt)("inlineCode",{parentName:"h3"},"register_datalog(self, impl, properties={})")),(0,i.kt)("p",null,"Method to register an asynchronous callback function that will be called for each trial to serve log requests. Only one such function can be registered. This service is addressed in the trial parameters in the ",(0,i.kt)("inlineCode",{parentName:"p"},"datalog")," section."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"impl"),": ",(0,i.kt)("em",{parentName:"li"},"async func(DatalogSession instance)")," - Callback function to be registered"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"properties"),": ",(0,i.kt)("em",{parentName:"li"},"dict{str:str}")," : Properties associated with the datalog to be registered in the directory. These properties may be used for inquiries into the directory to find this datalog.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h2",{id:"class-controller"},"class Controller"),(0,i.kt)("p",null,"Class containing data and methods to control and manage trials."),(0,i.kt)("h3",{id:"has_specsself-1"},(0,i.kt)("inlineCode",{parentName:"h3"},"has_specs(self)")),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - Always True since the Controller does not rely on trial specs."),(0,i.kt)("h3",{id:"async-start_trialself-trial_confignone-trial_id_requestednone-trial_paramsnone"},(0,i.kt)("inlineCode",{parentName:"h3"},"async start_trial(self, trial_config=None, trial_id_requested=None, trial_params=None)")),(0,i.kt)("p",null,"Method to start a new trial.\nThe config and parameter options are mutually exclusive."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_config"),": ",(0,i.kt)("em",{parentName:"li"},"protobuf class instance")," - Configuration for the trial. The type is specified in the spec file under the section ",(0,i.kt)("inlineCode",{parentName:"li"},"trial:config_type"),". The config will be added to the default parameters (in the Orchestrator) and sent to the pre-trial hooks (if any). The pre-trial hooks will set the trial parameters according to the config. If there is no pre-trial hooks, the config is ignored and the default parameters are used. This cannot be provided with the ",(0,i.kt)("inlineCode",{parentName:"li"},"trial_params"),". \x3c!--- If this is a bytes string, it will be passed raw to the orchestrator. ---\x3e"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_id_requested"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The trial identifier requested for the new trial. It must be unique among all active trials and a limited set of the latest ended trials (this list of trials can be retrieved with ",(0,i.kt)("inlineCode",{parentName:"li"},"get_trial_info")," or ",(0,i.kt)("inlineCode",{parentName:"li"},"watch_trial"),"). If provided, the Orchestrator will try to use this trial_id, otherwise, a UUID will be created."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_params"),": ",(0,i.kt)("em",{parentName:"li"},"TrialParameters instance")," - Fully defined parameters to start the new trial. This will be used as the trial parameters (I.e. the default parameters and pre-trial hooks are ignored). This cannot be provided with the ",(0,i.kt)("inlineCode",{parentName:"li"},"trial_config"),".")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"str")," - The newly started trial ID. An empty string if the trial was not started due to a non-unique requested ID."),(0,i.kt)("h3",{id:"async-terminate_trialself-trial_ids-hardfalse"},(0,i.kt)("inlineCode",{parentName:"h3"},"async terminate_trial(self, trial_ids, hard=False)")),(0,i.kt)("p",null,"Method to request the end of a trial."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_ids"),": ",(0,i.kt)("em",{parentName:"li"},"list","[str]")," - The trial ID(s) to request to terminate. There must be at least one ID."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"hard"),": ",(0,i.kt)("em",{parentName:"li"},"bool")," - If ",(0,i.kt)("inlineCode",{parentName:"li"},"True"),", the termination will be forced and immediate, it will not wait for any action or observation. If ",(0,i.kt)("inlineCode",{parentName:"li"},"False"),", the trial will wait for the end of the next step, to end gracefully (i.e. wait for the next full set of actions and response observations), and the environment will have a chance to respond to an end request (an event of type ENDING).")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"async-get_trial_infoself-trial_ids"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_trial_info(self, trial_ids)")),(0,i.kt)("p",null,"Method to get information about a trial."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_ids"),": ",(0,i.kt)("em",{parentName:"li"},"list","[str]")," - The trial ID(s) from which to request information. If no ID is provided, returns information about all trials. Note that ended trials may only appear for a short time in this list after they have ended.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"list","[TrialInfo instance]")," - List of trial information, one per trial. Can be empty if no trial matches."),(0,i.kt)("h3",{id:"async-watch_trialsself-trial_state_filters-full_infofalse"},(0,i.kt)("inlineCode",{parentName:"h3"},"async watch_trials(self, trial_state_filters=[], full_info=False)")),(0,i.kt)("p",null,"Generator method to iterate, in real-time, through all trials with state matching the filters. When called, it will first iterate over the trials with current state matching the filters. Afterwards, it will wait, and yield in real-time, as trial states change and match the filters."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_state_filters"),": ",(0,i.kt)("em",{parentName:"li"},"list","[cogment.TrialState]")," - List of enum values from ",(0,i.kt)("inlineCode",{parentName:"li"},"cogment.TrialState")," for which we are interested in receiving state changes."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"full_info"),": ",(0,i.kt)("em",{parentName:"li"},"bool")," - If True, all the fields of the returned ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialInfo")," will be set. Otherwise only the trial ID and state will be set.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(TrialInfo instance)")," - A generator for the relevant trial info."),(0,i.kt)("h3",{id:"async-get_actorsself-trial_id"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_actors(self, trial_id)")),(0,i.kt)("p",null,"Method to get the list of configured actors in a trial."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_id"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The trial ID from which to request the list of actors.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"list","[ActorInfo instance]")," - List of actors configured in this trial."),(0,i.kt)("h3",{id:"async-get_remote_versionsself"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_remote_versions(self)")),(0,i.kt)("p",null,"Method to get the versions from the remote Orchestrator."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"dict")," - The key of the dictionary is the name of the component (",(0,i.kt)("em",{parentName:"p"},"str"),"), and the value is the version (",(0,i.kt)("em",{parentName:"p"},"str"),")."),(0,i.kt)("h2",{id:"class-datastore"},"class Datastore"),(0,i.kt)("p",null,"Class containing data and methods to retrieve historical (or real-time) trial samples from a Datastore.\nThis class can also be used to delete trials from a Datastore."),(0,i.kt)("h3",{id:"has_specsself-2"},(0,i.kt)("inlineCode",{parentName:"h3"},"has_specs(self)")),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the specs are known by this instance. False otherwise. Specs will be known if the top level Cogment Context has specs."),(0,i.kt)("h3",{id:"async-get_trialsself-ids-properties"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_trials(self, ids=[], properties={})")),(0,i.kt)("p",null,"Method to get information about historical (or ongoing) trials in the Datastore.\nThis method is more efficient than ",(0,i.kt)("inlineCode",{parentName:"p"},"all_trials()"),", but can be problematic if too many trials are to be returned."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"ids"),": ",(0,i.kt)("em",{parentName:"p"},"list","[str]")," - The trial IDs for which to request information. If no ID is provided (empty list), returns information about all trials in the Datastore.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"properties"),": ",(0,i.kt)("em",{parentName:"p"},"dict{str:str}")," - Properties that must match the trial properties (see ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters"},"trial parameters"),")."))),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"list","[DatastoreTrialInfo instance]")," - List of trial information, one per trial. Can be empty if no trial matches any of the provided trial IDs and properties."),(0,i.kt)("h3",{id:"async-all_trialsself-bundle_size1-wait_for_trials0-properties-ids"},(0,i.kt)("inlineCode",{parentName:"h3"},"async all_trials(self, bundle_size=1, wait_for_trials=0, properties={}, ids=[])")),(0,i.kt)("p",null,"Generator method to iterate through the trials in the Datastore that match the given properties."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"bundle_size"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - Number of trials to retrieve at a time from the Datastore. This may be increased to more efficiently inquire the Datastore at the price of increased memory use.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"wait_for_trials"),": ",(0,i.kt)("em",{parentName:"p"},"float")," - Number of seconds to wait for new trials (to reach bundle size). If 0, only the trials currently in the datastore will be returned. If the bundle size is not reached within that time limit, whatever trials were found are returned, and if no trials were found, the iterator exits.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"properties"),": ",(0,i.kt)("em",{parentName:"p"},"dict{str:str}")," - Properties that must match the trial properties (see ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters"},"trial parameters"),"). If empty, all trials match.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"ids"),": ",(0,i.kt)("em",{parentName:"p"},"list","[str]")," - The trial IDs that are considered for retrieval. If no ID is provided (empty list), all trials are considered."))),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(DatastoreTrialInfo instance)")," - A generator for the trials in the Datastore."),(0,i.kt)("h3",{id:"async-delete_trialsself-ids"},(0,i.kt)("inlineCode",{parentName:"h3"},"async delete_trials(self, ids)")),(0,i.kt)("p",null,"Method to delete historical trials recorded in the Datastore."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"ids"),": ",(0,i.kt)("em",{parentName:"li"},"list","[str]")," - The trial IDs to remove from the Datastore.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"async-all_samplesself-trial_infos-actor_names-actor_classes-actor_implementations-fields"},(0,i.kt)("inlineCode",{parentName:"h3"},"async all_samples(self, trial_infos, actor_names=[], actor_classes=[], actor_implementations=[], fields=[])")),(0,i.kt)("p",null,"Generator method to iterate through the samples from trials in the Datastore.\nThe samples can be historical (if the trial has ended) or real-time (if a trial is ongoing)."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"trial_infos"),": ",(0,i.kt)("em",{parentName:"p"},"list","[DatastoreTrialInfo]")," - Trials to request samples from. These should be the info instances received from ",(0,i.kt)("inlineCode",{parentName:"p"},"get_trials"),".")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"actor_names"),": ",(0,i.kt)("em",{parentName:"p"},"list","[str]")," - Names of actors to consider including in the samples. If empty, all actors will be considered.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes"),": ",(0,i.kt)("em",{parentName:"p"},"list","[str]")," - Actor classes to match for an actor to be included in the samples. If empty, actors in any class will be considered.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"actor_implementations"),": ",(0,i.kt)("em",{parentName:"p"},"list","[str]")," - Actor implementations to match for an actor to be included in the samples. If empty, actors with any implementation will be considered.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"fields"),": ",(0,i.kt)("em",{parentName:"p"},"list","[cogment.DatastoreFields]")," - Data fields to be filled in ",(0,i.kt)("inlineCode",{parentName:"p"},"DatastoreActorData")," (otherwise left empty). If the list is empty, all data will be filled in."))),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(DatastoreSample instance)")," - A generator for the samples from the Datastore."),(0,i.kt)("h2",{id:"class-modelregistry"},"class ModelRegistry"),(0,i.kt)("p",null,"Class containing data and methods to store and retrieve models from a ModelRegistry."),(0,i.kt)("h3",{id:"has_specsself-3"},(0,i.kt)("inlineCode",{parentName:"h3"},"has_specs(self)")),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - Always True since the ModelRegistry does not rely on trial specs."),(0,i.kt)("h3",{id:"async-store_modelself-name-model-iteration_propertiesnone"},(0,i.kt)("inlineCode",{parentName:"h3"},"async store_model(self, name, model, iteration_properties=None)")),(0,i.kt)("p",null,"Method to publish and save the model to storage in the Model Registry.\nWhen stored, a model name will be available until explicitly deleted."),(0,i.kt)("p",null,"If the model name already exists, the model will be saved as a new iteration of the existing model name.\nIteration numbers start at 1 (the first model sent to the Model Registry) and increase by 1 for every new iteration.\nBut not all iterations may be in storage (see ",(0,i.kt)("a",{parentName:"p",href:"#async-publish_modelself-name-model-iteration_propertiesnone"},"publish_model"),")."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The model name to be stored."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model"),": ",(0,i.kt)("em",{parentName:"li"},"bytes")," - The data representing the model."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"iteration_properties"),": ",(0,i.kt)("em",{parentName:"li"},"dict{str:str}")," - Custom information that is specific to this iteration and will be stored with it.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"ModelIterationInfo instance")," - The information about the newly stored model iteration."),(0,i.kt)("h3",{id:"async-publish_modelself-name-model-iteration_propertiesnone"},(0,i.kt)("inlineCode",{parentName:"h3"},"async publish_model(self, name, model, iteration_properties=None)")),(0,i.kt)("p",null,"Method to send a model to the Model Registry for the sole purpose of being published to other services.\nThis model will be transient and not saved in storage.\nIt will stay available in the Model Registry for a time, dependent on the Model Registry ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cli/model-registry#cache_max_items"},"max_cache_item")," option, then be deleted automatically."),(0,i.kt)("p",null,"If the model name already exists, the model will be seen as a new iteration of the existing model name.\nIteration numbers start at 1 (the first model sent to the Model Registry) and increase by 1 for every new iteration."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The model name to be published."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model"),": ",(0,i.kt)("em",{parentName:"li"},"bytes")," - The data representing the model."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"iteration_properties"),": ",(0,i.kt)("em",{parentName:"li"},"dict{str:str}")," - Custom information that is specific to this iteration.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"ModelIterationInfo instance")," - The information about the newly published model iteration."),(0,i.kt)("h3",{id:"async-retrieve_modelself-name-iteration-1"},(0,i.kt)("inlineCode",{parentName:"h3"},"async retrieve_model(self, name, iteration=-1)")),(0,i.kt)("p",null,"Method to retrieve the data of a specific model iteration from the ModelRegistry.\nTransient iterations may become unavailable at any time."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The model name to be retrieved."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"iteration"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - The number of the model iteration to be retrieved. If -1, then the latest (most recent) iteration will be retrieved.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bytes")," - The model data representing the specific iteration requested. ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if the iteration is not available (if ",(0,i.kt)("inlineCode",{parentName:"p"},"iteration")," = -1, it means the model has no iteration available)."),(0,i.kt)("h3",{id:"async-remove_modelself-name"},(0,i.kt)("inlineCode",{parentName:"h3"},"async remove_model(self, name)")),(0,i.kt)("p",null,"Method to delete a model (and all its stored and transient iterations) from the Model Registry."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The model name to be removed from the Model Registry.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"async-list_modelsself"},(0,i.kt)("inlineCode",{parentName:"h3"},"async list_models(self)")),(0,i.kt)("p",null,"Method to retrieve the list of all models stored in the Model Registry."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"list","[ModelInfo instance]")," - List of model info for all models stored in the Model Registry."),(0,i.kt)("h3",{id:"async-list_iterationsself-model_name"},(0,i.kt)("inlineCode",{parentName:"h3"},"async list_iterations(self, model_name)")),(0,i.kt)("p",null,"Method to retrieve the list of all available iterations for a model in the Model Registry."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The model name.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"list","[ModelIterationInfo instance]")," - List of iteration info for all available iterations of the model. This includes all stored iterations and all currently available transient iterations."),(0,i.kt)("h3",{id:"async-get_iteration_infoself-name-iteration"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_iteration_info(self, name, iteration)")),(0,i.kt)("p",null,"Method to retrieve information about a specific model iteration."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The model name."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"iteration"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - The iteration number. If -1, then information about the latest (most recent) iteration will be retrieved.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"ModelIterationInfo instance")," - The information about the model iteration. ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if the iteration is not available (if ",(0,i.kt)("inlineCode",{parentName:"p"},"iteration")," = -1, it means the model has no iteration available)."),(0,i.kt)("h3",{id:"async-update_model_infoself-name-properties"},(0,i.kt)("inlineCode",{parentName:"h3"},"async update_model_info(self, name, properties)")),(0,i.kt)("p",null,"Method to store or update properties associated with the model name (not specific to any iteration)."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The model name."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"properties"),": ",(0,i.kt)("em",{parentName:"li"},"dict{str:str}")," - Custom information that will be stored with the model name, independently of any iteration. If the model name already has properties, they will be overwritten.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"async-get_model_infoself-name"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_model_info(self, name)")),(0,i.kt)("p",null,"Method to retrieve information associated with the model name (not specific to any iteration)."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The model name.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"ModelInfo instance")," - Info associated with the model name, independent of any iteration. ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if the model is not found in the Model Registry."),(0,i.kt)("h3",{id:"async-iteration_updatesself-model_name"},(0,i.kt)("inlineCode",{parentName:"h3"},"async iteration_updates(self, model_name)")),(0,i.kt)("p",null,"Generator method to receive the information about the model iterations as they are stored or published."),(0,i.kt)("p",null,"Information about the latest iteration will be returned immediately, then the function will wait for new iterations to be stored or published to the Model Registry and return their information when they are made available."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The model name for which to receive iteration information.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(ModelIterationInfo instance)")," - A generator for the model iteration information."),(0,i.kt)("h3",{id:"async-track_latest_modelself-name-deserialize_funcnone-initial_wait0"},(0,i.kt)("inlineCode",{parentName:"h3"},"async track_latest_model(self, name, deserialize_func=None, initial_wait=0)")),(0,i.kt)("p",null,"Method to start automatically tracking a specific model and make the latest iteration available seamlessly."),(0,i.kt)("p",null,"A background task will be started (running ",(0,i.kt)("inlineCode",{parentName:"p"},"iteration_updates"),") to track the latest model iteration and retrieve it automatically.\nMultiple calls for the same model will not duplicate the background task and will point to the same underlying model.\nThus if the model is changed by a caller, all callers will see the changes (unless and until a new model is retrieved from the Model Registry)."),(0,i.kt)("p",null,"Due to background processing and caching, this method is not thread safe.\nIt is best used for simple cases.\nMore complicated use-cases should explicitly use ",(0,i.kt)("inlineCode",{parentName:"p"},"iteration_updates"),"."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The model name to track."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"deserialize_func"),": ",(0,i.kt)("em",{parentName:"li"},"func(bytes)")," - Callback function to deserialize the model iteration from a ",(0,i.kt)("inlineCode",{parentName:"li"},"bytes")," string to a user defined object instance. This is called asynchronously in the background to deserialize the raw bytes from the Model Registry, and the user object is made available in ",(0,i.kt)("inlineCode",{parentName:"li"},"LatestModel"),". If not provided, the raw ",(0,i.kt)("inlineCode",{parentName:"li"},"bytes")," string from the Model Registry is made available in ",(0,i.kt)("inlineCode",{parentName:"li"},"LatestModel")," instead of a user object."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"initial_wait"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - Number of seconds to wait for the model name to be available in the Model Registry. The method will return once the model name is available, or raise an exception if the model name was not available within the given time. The model name being available only means that it is registered in the Model Registry, not necessarily that it has iterations; i.e. the background task may wait more for iterations to be available.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"LatestModel instance")," - An instance of the ",(0,i.kt)("inlineCode",{parentName:"p"},"LatestModel")," class."),(0,i.kt)("h2",{id:"class-session"},"class Session"),(0,i.kt)("p",null,"Abstract class that manages aspects of a trial. Contains data and methods common to all sessions ."),(0,i.kt)("h3",{id:"get_trial_idself"},(0,i.kt)("inlineCode",{parentName:"h3"},"get_trial_id(self)")),(0,i.kt)("p",null,"Method to get the UUID of the trial managed by this session."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"str")," - UUID of the trial."),(0,i.kt)("h3",{id:"get_tick_idself"},(0,i.kt)("inlineCode",{parentName:"h3"},"get_tick_id(self)")),(0,i.kt)("p",null,"Method to get the current tick id of the trial (i.e. time step)."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"int")," - The current tick id."),(0,i.kt)("h3",{id:"is_trial_overself"},(0,i.kt)("inlineCode",{parentName:"h3"},"is_trial_over(self)")),(0,i.kt)("p",null,"Method to inquire if the current trial has ended."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the trial has ended, false otherwise."),(0,i.kt)("h3",{id:"sending_doneself"},(0,i.kt)("inlineCode",{parentName:"h3"},"sending_done(self)")),(0,i.kt)("p",null,"Method to notify the Orchestrator that all data for the trial, from this session, has been sent. This can be called only when the session is ending. When starting the session (see ",(0,i.kt)("inlineCode",{parentName:"p"},"EnvironmentSession")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"ActorSession"),"), if the ",(0,i.kt)("inlineCode",{parentName:"p"},"auto_done_sending")," parameter is True, this method should not be called, and if the parameter is False, it MUST be called to end the trial properly."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"add_rewardself-value-confidence-to-tick_id-1-user_datanone"},(0,i.kt)("inlineCode",{parentName:"h3"},"add_reward(self, value, confidence, to, tick_id=-1, user_data=None)")),(0,i.kt)("p",null,"Method to send a reward to one or more actors."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"value"),": ",(0,i.kt)("em",{parentName:"li"},"float")," - Value of the reward. This will be aggregated with other rewards for the same target actor."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"confidence"),": ",(0,i.kt)("em",{parentName:"li"},"float")," - Weight of this reward value in determining the final aggregated reward. Should be > 0."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"to"),": ",(0,i.kt)("em",{parentName:"li"},"list","[str]"),' - Target(s) of reward. A list value could be the name of an actor in the trial. Or it could represent a set of actors; A set of actors can be represented with the wildcard character "',(0,i.kt)("inlineCode",{parentName:"li"},"*"),'" for all actors (of all classes), or "',(0,i.kt)("inlineCode",{parentName:"li"},"actor_class.*"),'" for all actors of a specific class (the ',(0,i.kt)("inlineCode",{parentName:"li"},"actor_class")," is the name of the class as specified in the spec file)."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"tick_id"),": ",(0,i.kt)("em",{parentName:"li"},"int"),' - The tick id (time step) for which the reward should be applied. If "-1", then the reward applies to the current time step.'),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"user_data"),": ",(0,i.kt)("em",{parentName:"li"},"protobuf class instance")," - Extra user data to be sent with the reward. The class can be any protobuf class. It is the responsibility of the receiving actor to manage the class received (packed in a ",(0,i.kt)("inlineCode",{parentName:"li"},"google.protobuf.Any"),").")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h2",{id:"class-environmentsessionsession"},"class EnvironmentSession(Session)"),(0,i.kt)("p",null,"Class based on ",(0,i.kt)("inlineCode",{parentName:"p"},"Session"),", containing session data and methods necessary to run an environment for a trial. An instance of this class is passed as an argument to the environment callback function registered with ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.Context.register_environment"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"impl_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the implementation running this environment."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"config"),": ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - User configuration received for this environment instance. Can be ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if no configuration was provided. The type of the protobuf class is specified in the spec file in the section ",(0,i.kt)("inlineCode",{parentName:"p"},"environment:config_type"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the environment this instance represents."),(0,i.kt)("h3",{id:"startself-observations--none-auto_done_sendingtrue"},(0,i.kt)("inlineCode",{parentName:"h3"},"start(self, observations = None, auto_done_sending=True)")),(0,i.kt)("p",null,"Method to report that the environment is starting to run the trial. The method should be called before any other method in the session."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"observations"),": ",(0,i.kt)("em",{parentName:"p"},"list","[tuple(str, protobuf class instance)]")," - The initial observations from which the environment is starting the trial. This is the same as the parameter for ",(0,i.kt)("inlineCode",{parentName:"p"},"self.produce_observations"),". If not provided, then the first observation sent with ",(0,i.kt)("inlineCode",{parentName:"p"},"produce_observation")," will be used to initiate the trial (note that no actions will be received until the first observation is sent).")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"auto_done_sending"),": ",(0,i.kt)("em",{parentName:"p"},"bool")," - Controls when to notify the Orchestrator that all data has been sent. If True, the session will automatically send the notification after ",(0,i.kt)("inlineCode",{parentName:"p"},"end")," is called. If False, the user MUST call ",(0,i.kt)("inlineCode",{parentName:"p"},"sending_done")," (after ",(0,i.kt)("inlineCode",{parentName:"p"},"end"),") to end the trial properly."))),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"async-all_eventsself"},(0,i.kt)("inlineCode",{parentName:"h3"},"async all_events(self)")),(0,i.kt)("p",null,"Generator method to iterate over all events (actions, messages) as they are received. This will block and wait for an event.\nWhen this generator exits, the callback function (registered with ",(0,i.kt)("inlineCode",{parentName:"p"},"register_environment"),') should return to end the trial cleanly.\nThe generator will exit for various reasons indicating the termination of the trial, a loss of communication with the orchestrator, or if the generator is sent "False" (in which case the callback function does not necessarily need to exit).'),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(RecvEvent instance)")," - A generator for the events that arrive. The ",(0,i.kt)("inlineCode",{parentName:"p"},"RecvEvent")," instances received from this generator will only contain actions or messages; no observations nor rewards. When receiving actions in the event, the ",(0,i.kt)("inlineCode",{parentName:"p"},"self.produce_observation"),' method is normally used to "reply" (or ',(0,i.kt)("inlineCode",{parentName:"p"},"self.end")," to end the trial)."),(0,i.kt)("h3",{id:"produce_observationsself-observations"},(0,i.kt)("inlineCode",{parentName:"h3"},"produce_observations(self, observations)")),(0,i.kt)("p",null,"Method to send observations to actors. If called after receiving an event of type ",(0,i.kt)("inlineCode",{parentName:"p"},"EventType.ENDING"),", the observation will be considered the final observation (equivalent to calling ",(0,i.kt)("inlineCode",{parentName:"p"},"end()"),")."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"observations"),": ",(0,i.kt)("em",{parentName:"li"},"list","[tuple(str, protobuf class instance)]"),' - The observations to send to actors. The string in the tuple is the name of the destination actor (or "',"*",'" for all actors). The name of the actors can be found in trial parameters under ',(0,i.kt)("inlineCode",{parentName:"li"},"trial_params:actors:name"),". The protobuf class is the Observation Space for that actor, found in the spec file in the corresponding section ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes:observation:space"),".")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"endself-final_observations"},(0,i.kt)("inlineCode",{parentName:"h3"},"end(self, final_observations)")),(0,i.kt)("p",null,"Method to report the end of the environment. This will effectively end the trial. Message events can still arrive after this call."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"final_observations"),": ",(0,i.kt)("em",{parentName:"li"},"list","[tuple(str, protobuf class instance)]")," - The final observations to send to the actors. This is the same as the parameter for ",(0,i.kt)("inlineCode",{parentName:"li"},"self.produce_observations"),".")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"get_active_actorsself"},(0,i.kt)("inlineCode",{parentName:"h3"},"get_active_actors(self)")),(0,i.kt)("p",null,"Method to get the list of active actors in the trial."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"list","[ActorInfo instance]")," - List of active actors and classes involved in this trial."),(0,i.kt)("h3",{id:"send_messageself-payload-to"},(0,i.kt)("inlineCode",{parentName:"h3"},"send_message(self, payload, to)")),(0,i.kt)("p",null,"Method to send a message related to the current time step (tick id)."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"payload"),": ",(0,i.kt)("em",{parentName:"li"},"protobuf class instance")," - The message data to be sent. The class can be any protobuf class. It is the responsibility of the receiving environment to manage the class received (packed in a ",(0,i.kt)("inlineCode",{parentName:"li"},"google.protobuf.Any"),")."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"to"),": ",(0,i.kt)("em",{parentName:"li"},"list","[str]"),' - Targets of feedback. Each value could be the name of an actor in the trial. Or it could represent a set of actors (with wildcards); A set of actors can be represented with the wildcard character "',(0,i.kt)("inlineCode",{parentName:"li"},"*"),'" for all actors (of all classes), or "',(0,i.kt)("inlineCode",{parentName:"li"},"actor_class.*"),'" for all actors of a specific class (the ',(0,i.kt)("inlineCode",{parentName:"li"},"actor_class")," must match one of the classes listed in the trial parameters). Note that the wildcard does not include the environment.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h2",{id:"class-actorsessionsession"},"class ActorSession(Session)"),(0,i.kt)("p",null,"Class based on ",(0,i.kt)("inlineCode",{parentName:"p"},"Session"),", containing session/trial data and methods necessary to run an actor for a trial. An instance of this class is passed as argument to the actor callback function registered with ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.Context.register_actor"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"actor_class"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the class of actor this instance represents. Specified in the spec file as ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes:name"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"impl_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the implementation of the actor represented by this instance."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"config"),": ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - User configuration received for this actor instance. Can be ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," is no configuration was provided. The type of the protobuf class is specified in the spec file in the section ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes:config_type"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the actor this instance represents."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"env_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the environment running the trial this actor is participating in (used to send messages to the environment)."),(0,i.kt)("h3",{id:"startself-auto_done_sendingtrue"},(0,i.kt)("inlineCode",{parentName:"h3"},"start(self, auto_done_sending=True)")),(0,i.kt)("p",null,"Method to start the actor. This method should be called before any other method in the session."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"auto_done_sending"),": ",(0,i.kt)("em",{parentName:"li"},"bool")," - Controls when to notify the Orchestrator that all data has been sent. If True, the session will automatically send the notification after receiving the last observation. If False, the user MUST call ",(0,i.kt)("inlineCode",{parentName:"li"},"sending_done")," to end the trial properly.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"async-all_eventsself-1"},(0,i.kt)("inlineCode",{parentName:"h3"},"async all_events(self)")),(0,i.kt)("p",null,"Generator method to iterate over all events (observations, rewards, messages) as they are received. This will block and wait for an event.\nWhen this generator exits, the callback function (registered with ",(0,i.kt)("inlineCode",{parentName:"p"},"register_actor"),') should return to end the trial cleanly.\nThe generator will exit for various reasons indicating the end of the trial, a loss of communication with the orchestrator, or if the generator is sent "False".'),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(RecvEvent instance)")," - A generator for the events that arrive. The ",(0,i.kt)("inlineCode",{parentName:"p"},"RecvEvent")," instances received from this generator will not contain actions. When receiving an observation in the event, the ",(0,i.kt)("inlineCode",{parentName:"p"},"self.do_action"),' method is normally used to "reply" (if the event type is ',(0,i.kt)("inlineCode",{parentName:"p"},"EventType.ACTIVE"),")."),(0,i.kt)("h3",{id:"do_actionself-action"},(0,i.kt)("inlineCode",{parentName:"h3"},"do_action(self, action)")),(0,i.kt)("p",null,"Method to send actions to the environment."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"action"),": ",(0,i.kt)("em",{parentName:"li"},"protobuf class instance")," - An instance of the action space class specified in the corresponding section ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes:action:space")," of the spec file. If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", then no action space is sent (empty content) and the environment will receive a default initialized action space of the appropriate type.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"send_messageself-payload-to-1"},(0,i.kt)("inlineCode",{parentName:"h3"},"send_message(self, payload, to)")),(0,i.kt)("p",null,"Method to send a message related to the current time step (tick id)."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"payload"),": ",(0,i.kt)("em",{parentName:"li"},"protobuf class instance")," - The message data to be sent. The class can be any protobuf class. It is the responsibility of the receiving actor to manage the class received (packed in a ",(0,i.kt)("inlineCode",{parentName:"li"},"google.protobuf.Any"),")."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"to"),": ",(0,i.kt)("em",{parentName:"li"},"list","[str]")," - Targets of feedback. Each value could be the name of an actor in the trial, or the name of the environment (from ",(0,i.kt)("inlineCode",{parentName:"li"},"self.env_name"),'). Or it could represent a set of actors (with wildcards); A set of actors can be represented with the wildcard character "',(0,i.kt)("inlineCode",{parentName:"li"},"*"),'" for all actors (of all classes), or "',(0,i.kt)("inlineCode",{parentName:"li"},"actor_class.*"),'" for all actors of a specific class (the ',(0,i.kt)("inlineCode",{parentName:"li"},"actor_class")," must match one of the classes listed in the trial parameters). Note that the wildcard does not include the environment.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h2",{id:"class-prehooksession"},"class PrehookSession"),(0,i.kt)("p",null,"Class containing trial parameters to define the specifics of a trial. An instance of this class is passed as argument to the pre-trial hook callback function registered with ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.Context.register_pre_trial_hook"),". The first pre-trial hook to be called will receive the default parameters set in the Orchestrator, the following hooks will receive the parameters set by the preceding hooks."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trial_parameters"),": ",(0,i.kt)("em",{parentName:"p"},"TrialParameters instance")," - Parameters for the trial. Initially received with parameters from the previous hook, or default parameters from the Orchestrator if it is the first hook. Changes to this instance will be forwarded to the next hook, or to the Orchestrator if it is the last hook."),(0,i.kt)("h3",{id:"get_trial_idself-1"},(0,i.kt)("inlineCode",{parentName:"h3"},"get_trial_id(self)")),(0,i.kt)("p",null,"Method to retrieve the ID of the trial."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"str")," - ID of the trial."),(0,i.kt)("h3",{id:"get_user_idself"},(0,i.kt)("inlineCode",{parentName:"h3"},"get_user_id(self)")),(0,i.kt)("p",null,"Method to retrieve the identifier of the user that started the trial."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"str")," - Identifier of the user that started the trial."),(0,i.kt)("h2",{id:"class-datalogsession"},"class DatalogSession"),(0,i.kt)("p",null,"Class containing session data and methods necessary to manage the logging of trial run data. An instance of this class is passed as an argument to the datalog callback function registered with ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.Context.register_datalog"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trial_id"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - UUID of the trial managed by this instance."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"user_id"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Identifier of the user that started the trial."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trial_parameters"),": ",(0,i.kt)("em",{parentName:"p"},"cogment.TrialParameters instance")," - Parameters of the trial."),(0,i.kt)("h3",{id:"startself"},(0,i.kt)("inlineCode",{parentName:"h3"},"start(self)")),(0,i.kt)("p",null,"Method to start receiving samples."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"all_samplesself"},(0,i.kt)("inlineCode",{parentName:"h3"},"all_samples(self)")),(0,i.kt)("p",null,"Generator method to iterate over all samples as they are received (waiting for each in turn)."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(cogment.LogSample instance)")," - A generator for the samples received."),(0,i.kt)("h2",{id:"class-cogmentendpoint"},"class cogment.Endpoint"),(0,i.kt)("p",null,"Class enclosing the details for connecting to an Orchestrator."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"url"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - The URL where to connect to the Orchestrator."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"private_key"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - To use TLS for the connection, this must be set to the PEM-encoded private key."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"root_certificates"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - If using TLS for the connection (i.e. the ",(0,i.kt)("inlineCode",{parentName:"p"},"private_key")," is not ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),"), this can be set to the PEM-encoded root certificates. If not set and using TLS for the connection, the root certificates will be fetched from the system default location."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"certificate_chain"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - If using TLS for the connection, this can be set to the PEM-encoded certificate chain."),(0,i.kt)("h3",{id:"__init__self-urlcogmentdiscover"},(0,i.kt)("inlineCode",{parentName:"h3"},'__init__(self, url="cogment://discover")')),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"url"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The URL where to connect to the Orchestrator. By default this is a discovery URL that uses the Directory to find the corresponding endpoint.")),(0,i.kt)("h2",{id:"class-cogmentservedendpoint"},"class cogment.ServedEndpoint"),(0,i.kt)("p",null,"Class enclosing the details for connection from an Orchestrator."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"port"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The TCP/IP port where the service will be awaiting the Orchestrator connection."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"private_key_certificate_chain_pairs"),": ",(0,i.kt)("em",{parentName:"p"},"list","[tuple(str, str)]")," - To use TLS for incoming connections, this must be set to a list of tuples of the form (PEM-encoded private key, PEM-encoded certificate chain)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"root_certificates"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - If using TLS for the connection (i.e. ",(0,i.kt)("inlineCode",{parentName:"p"},"private_key_certificate_chain_pairs")," is not ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),"), this should be set to PEM-encoded Orchestrator root certificates that the server will use to verify Orchestrator authentication."),(0,i.kt)("h3",{id:"__init__self-port0"},(0,i.kt)("inlineCode",{parentName:"h3"},"__init__(self, port=0)")),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"port"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - The TCP/IP port where the service will be awaiting the Orchestrator connection. If 0, the system will choose a free port.")),(0,i.kt)("h2",{id:"class-cogmenttrialstateenumenum"},"class cogment.TrialState(enum.Enum)"),(0,i.kt)("p",null,"Enum representing the various states of trials."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"UNKNOWN: Should not be used."),(0,i.kt)("li",{parentName:"ul"},"INITIALIZING: The trial is in the process of starting."),(0,i.kt)("li",{parentName:"ul"},"PENDING: The trial is waiting for its final parameters, all the components to be ready, and the first observation."),(0,i.kt)("li",{parentName:"ul"},"RUNNING: The trial is running."),(0,i.kt)("li",{parentName:"ul"},"TERMINATING: The trial is in the process of ending (either a request to end has been received or the last observation has been received)."),(0,i.kt)("li",{parentName:"ul"},"ENDED: The trial has ended. Only a set number of ended trials will be kept (configured in the Orchestrator).")),(0,i.kt)("p",null,"For further information on trial lifetime, check the ",(0,i.kt)("a",{parentName:"p",href:"/docs/guide/development-guide#trial-lifetime"},"dedicated section"),"."),(0,i.kt)("h2",{id:"class-trialinfo"},"class TrialInfo"),(0,i.kt)("p",null,"Class enclosing the details of a trial."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trial_id"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - The trial ID to which the details pertain."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"properties"),": ",(0,i.kt)("em",{parentName:"p"},"dict{str:str}")," - User defined properties provided on trial start (see ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#trial-parameters"},"Trial Parameters"),")."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"state"),": ",(0,i.kt)("em",{parentName:"p"},"cogment.TrialState")," - The current state of the trial."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"env_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - The name of the environment running the trial."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"tick_id"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The time step that the information relates to. Only provided from a call to ",(0,i.kt)("inlineCode",{parentName:"p"},"get_trial_info"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"duration"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The time (in nanoseconds) that the trial has run. Only provided from a call to ",(0,i.kt)("inlineCode",{parentName:"p"},"get_trial_info"),"."),(0,i.kt)("h2",{id:"class-actorinfo"},"class ActorInfo"),(0,i.kt)("p",null,"Class enclosing the details of an actor."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"actor_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - The name of the actor."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"actor_class_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - The name of the actor's class (as defined in the spec file)."),(0,i.kt)("h2",{id:"class-recvevent"},"class RecvEvent"),(0,i.kt)("p",null,"Class representing a received event (for environments and actors). It can contain any combination of data according to the receiver needs, or even be empty, but it will always have a type."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"type"),": ",(0,i.kt)("em",{parentName:"p"},"Enum EventType")," - Type of event the enclosed data represents."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"observation"),": ",(0,i.kt)("em",{parentName:"p"},"RecvObservation instance")," - Observation data. This can only be received by actors. ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if not present."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"actions"),": ",(0,i.kt)("em",{parentName:"p"},"list","[RecvAction instance]")," - Action data from actors. This can only be received by the environment. The list is empty if not present."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"rewards"),": ",(0,i.kt)("em",{parentName:"p"},"list","[RecvReward instance]")," - Reward values and data. This can only be received by actors. The list is empty if not present."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"messages"),": ",(0,i.kt)("em",{parentName:"p"},"list","[RecvMessage instance]")," - Message data. The list is empty if not present."),(0,i.kt)("h3",{id:"class-cogmenteventtypeenumenum"},"class cogment.EventType(enum.Enum)"),(0,i.kt)("p",null,"Enum representing the type of an event."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"EventType.NONE"),": Empty event. This kind of event should never be received.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"EventType.ACTIVE"),": Normal event from an active trial. Most events will be of this type.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"EventType.ENDING"),": Events from a trial in the process of ending. Events of this type can contain the same data as ",(0,i.kt)("inlineCode",{parentName:"p"},"ACTIVE")," events. For the environment, the data received in ",(0,i.kt)("inlineCode",{parentName:"p"},"ENDING")," events are the last actions/messages, and the trial is awaiting a final observation. For the actors, the data received in ",(0,i.kt)("inlineCode",{parentName:"p"},"ENDING")," events are the final observations/rewards/messages, and no action can/need to be sent in response.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"EventType.FINAL"),": Final event for the trial. This does not contain data. The event loop will exit after this event is delivered. This event can be ignored if nothing needs to be done before exiting the loop."))),(0,i.kt)("p",null,"For further information on trial lifetime, check the ",(0,i.kt)("a",{parentName:"p",href:"/docs/guide/development-guide#trial-lifetime"},"dedicated section"),"."),(0,i.kt)("h2",{id:"class-recvobservation"},"class RecvObservation"),(0,i.kt)("p",null,"Class containing the details of an observation for an actor."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"tick_id"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The time step that the observation relates to."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"timestamp"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - Unix style Epoch timestamp in nanoseconds (time since 00:00:00 UTC Jan 1, 1970). Undefined if actor status is ",(0,i.kt)("inlineCode",{parentName:"p"},"ActorStatus.UNAVAILABLE"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"observation"),": ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - Observation received from the environment. The class of the observation is defined as observation space for the actor class. This is specified in section ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes:observation:space")," in the spec file for the appropriate/receiving actor class. Undefined if actor status is ",(0,i.kt)("inlineCode",{parentName:"p"},"ActorStatus.UNAVAILABLE"),"."),(0,i.kt)("h2",{id:"class-cogmentactorstatusenumenum"},"class cogment.ActorStatus(enum.Enum)"),(0,i.kt)("p",null,"Enum representing the status of actors."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"ActorStatus.UNKNOWN"),": This status should never be received.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"ActorStatus.ACTIVE"),": The actor is active and responding to observations normally.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"ActorStatus.UNAVAILABLE"),": The (optional) actor is unavailable (typically because of a time out).")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"ActorStatus.DEFAULT"),': The (optional) actor is acting by default (responding with the default action defined in the actor parameters). The environment will not see this kind of actor because a "default" actor looks active to the environment.'))),(0,i.kt)("h2",{id:"class-recvaction"},"class RecvAction"),(0,i.kt)("p",null,"Class containing the details of an action from an actor."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"tick_id"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The time step that the action relates to."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"actor_index"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - Index of the actor in the list of all trial actors (returned by ",(0,i.kt)("inlineCode",{parentName:"p"},"Session.get_active_actors"),")."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"status"),": ",(0,i.kt)("em",{parentName:"p"},"ActorStatus instance")," - Indicate the status of the actor."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"timestamp"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - Unix style Epoch timestamp in nanoseconds (time since 00:00:00 UTC Jan 1, 1970) for the action. Undefined if ",(0,i.kt)("inlineCode",{parentName:"p"},"status")," is not ",(0,i.kt)("inlineCode",{parentName:"p"},"ActorStatus.ACTIVE"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"action"),": ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - Action from the actor which has index ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_index")," in the trial. The class of the action is defined as action space for the specific actor in the section ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes:action:space")," in the spec file for the appropriate actor class. Undefined if ",(0,i.kt)("inlineCode",{parentName:"p"},"status")," is not ",(0,i.kt)("inlineCode",{parentName:"p"},"ActorStatus.ACTIVE"),"."),(0,i.kt)("h2",{id:"class-recvmessage"},"class RecvMessage"),(0,i.kt)("p",null,"Class containing a message."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"tick_id"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The time step that the message relates to."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"receiver_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the receiver for the message (the name of an actor, or wildcard string)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"sender_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the sender of the message (the name of an actor, or the environment)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"payload"),": ",(0,i.kt)("em",{parentName:"p"},"google.protobuf.Any instance")," - Data for a received message. The class enclosed in ",(0,i.kt)("inlineCode",{parentName:"p"},"google.protobuf.Any")," is of the type set by the sender; It is the responsibility of the receiver to manage the data received (i.e. determine the type and unpack the data)."),(0,i.kt)("h2",{id:"class-recvreward"},"class RecvReward"),(0,i.kt)("p",null,"Class containing the details of a received reward."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"tick_id"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The tick id (time step) for which the reward should be applied."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"receiver_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the receiver for the reward (the name of an actor, or wildcard string)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"value"),": ",(0,i.kt)("em",{parentName:"p"},"float")," - Value of the reward (aggregated from the sources)"),(0,i.kt)("h3",{id:"get_nb_sourcesself"},(0,i.kt)("inlineCode",{parentName:"h3"},"get_nb_sources(self)")),(0,i.kt)("p",null,"Return the number of source rewards this reward is based upon."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"int")," - Number of sources."),(0,i.kt)("h3",{id:"all_sourcesself"},(0,i.kt)("inlineCode",{parentName:"h3"},"all_sources(self)")),(0,i.kt)("p",null,"Generator method to iterate over all sources making up this reward."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(RecvRewardSource instance)")," - A generator for the sources in the reward (simple rewards that make up this final/aggregate reward)."),(0,i.kt)("h2",{id:"class-recvrewardsource"},"class RecvRewardSource"),(0,i.kt)("p",null,"Class containing the details of a received single source reward."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"value"),": ",(0,i.kt)("em",{parentName:"p"},"float")," - Value of the reward from the sender."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"confidence"),": ",(0,i.kt)("em",{parentName:"p"},"float")," - Confidence level of this reward value."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"sender_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the sender of this reward (the name of an actor, or the environment)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"user_data"),": ",(0,i.kt)("em",{parentName:"p"},"google.protobuf.Any instance")," - Data for a user-specific reward format. Can be ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if no specific data was provided. The class enclosed in ",(0,i.kt)("inlineCode",{parentName:"p"},"google.protobuf.Any")," is of the type set by the sender; it is the responsibility of the receiver to manage the data received (i.e. determine the type and unpack the data)."),(0,i.kt)("h2",{id:"class-cogmenttrialparameters"},"class cogment.TrialParameters"),(0,i.kt)("p",null,"Class containing the parameters of the trial (see ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#trial-parameters"},"Trial Parameters"),")."),(0,i.kt)("p",null,"Any attribute can be set to ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," to reset it to its default.\nSome attributes (",(0,i.kt)("inlineCode",{parentName:"p"},"config")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"environment_config"),") are immutable: changes to the instance received will not be reflected in ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialParameters"),", the attribute must be set with a new instance to make changes. These attributes can also return ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if not set."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"config"),": ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - The type is specified in the spec file under the section ",(0,i.kt)("inlineCode",{parentName:"p"},"trial:config_type"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"config_serialized"),": ",(0,i.kt)("em",{parentName:"p"},"bytes")," - Config in serialized (class independent) form. This can be accessed even without specs (see ",(0,i.kt)("inlineCode",{parentName:"p"},"has_specs()"),")."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"properties"),": ",(0,i.kt)("em",{parentName:"p"},"dict{str:str}")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"max_steps"),": ",(0,i.kt)("em",{parentName:"p"},"int")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"max_inactivity"),": ",(0,i.kt)("em",{parentName:"p"},"int")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"nb_buffered_ticks"),": ",(0,i.kt)("em",{parentName:"p"},"int")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"datalog_endpoint"),": ",(0,i.kt)("em",{parentName:"p"},"str")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"datalog_exclude_fields"),": ",(0,i.kt)("em",{parentName:"p"},"tuple(str)")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"environment_config"),": ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - The type is specified in the spec file under the section ",(0,i.kt)("inlineCode",{parentName:"p"},"environment:config_type"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"environment_serialized"),": ",(0,i.kt)("em",{parentName:"p"},"bytes")," - Config in serialized (class independent) form. This can be accessed even without specs (see ",(0,i.kt)("inlineCode",{parentName:"p"},"has_specs()"),")."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"environment_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"environment_endpoint"),": ",(0,i.kt)("em",{parentName:"p"},"str")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"environment_implementation"),": ",(0,i.kt)("em",{parentName:"p"},"str")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"actors"),": ",(0,i.kt)("em",{parentName:"p"},"list(cogment.ActorParameters)")," - The parameters for the actors. This is a list style object that implements the basic Python ",(0,i.kt)("inlineCode",{parentName:"p"},"list"),' functionality. If the actors\' data is not being edited (e.g. read only parameters), the "index" of this list can be the name of an actor.'),(0,i.kt)("h3",{id:"__init__self-cog_settings-kwargs"},(0,i.kt)("inlineCode",{parentName:"h3"},"__init__(self, cog_settings, **kwargs)")),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"cog_settings"),": ",(0,i.kt)("em",{parentName:"li"},"module")," - Specs module associated with trials that relate to these parameters (see ",(0,i.kt)("a",{parentName:"li",href:"#compiling-the-spec-file-into-cog_settingspy"},"cog_settings generation"),")."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"**kwargs"),": Accepts any of the attributes as keyword to set their value on construction. E.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'TrialParameters(settings, max_steps=1000, environment_name="level")'))),(0,i.kt)("h3",{id:"has_specsself-4"},(0,i.kt)("inlineCode",{parentName:"h3"},"has_specs(self)")),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the specs are known by this instance. False otherwise. Specs will be known if the top level Cogment Context has specs or if a non ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," argument ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings")," was provided."),(0,i.kt)("h3",{id:"get_serialization_typeself"},(0,i.kt)("inlineCode",{parentName:"h3"},"get_serialization_type(self)")),(0,i.kt)("p",null,"Return the type of serial data produced by ",(0,i.kt)("inlineCode",{parentName:"p"},"serialize")," and accepted by ",(0,i.kt)("inlineCode",{parentName:"p"},"deserialize"),". The type represents an ID dependent on ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/grpc#trialparams"},"TrialParams")," defined in the low level gRPC API."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"int")," - The type of the serialization string data. This is the type of string that is returned by ",(0,i.kt)("inlineCode",{parentName:"p"},"serialize"),", and the only type accepted by ",(0,i.kt)("inlineCode",{parentName:"p"},"deserialize"),"; it is undefined behavior to try to deserialize the wrong type of data. This value is strictly larger than 1."),(0,i.kt)("h3",{id:"serializeself"},(0,i.kt)("inlineCode",{parentName:"h3"},"serialize(self)")),(0,i.kt)("p",null,"Return a binary string equivalent of the parameters."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"str")," - Serialized parameters."),(0,i.kt)("h3",{id:"deserializeself-raw_string-typenone"},(0,i.kt)("inlineCode",{parentName:"h3"},"deserialize(self, raw_string, type=None)")),(0,i.kt)("p",null,"Takes a serialized parameter string and sets the ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialParameters")," instance."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"raw_string"),": ",(0,i.kt)("em",{parentName:"li"},"bytes")," - Binary string representing a serialized ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialParameters")," of type ",(0,i.kt)("inlineCode",{parentName:"li"},"type"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"type"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - Type of serial data in ",(0,i.kt)("inlineCode",{parentName:"li"},"raw_string")," (from ",(0,i.kt)("inlineCode",{parentName:"li"},"get_serialization")," of the source). If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", the current type is assumed (i.e. this instance type matches the source type).")),(0,i.kt)("h2",{id:"class-cogmentactorparameters"},"class cogment.ActorParameters"),(0,i.kt)("p",null,"Class containing the parameters for a particular actor (see ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#trial-parameters"},"Trial Parameters"),")."),(0,i.kt)("p",null,"Any attribute can be set to ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," to reset it to its default.\nSome attributes (",(0,i.kt)("inlineCode",{parentName:"p"},"config"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"default_action"),") are immutable: changes to the instance received will not be reflected in ",(0,i.kt)("inlineCode",{parentName:"p"},"ActorParameters"),", the attribute must be set with a new instance to make changes. These attributes can also return ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if not set."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"config"),": ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - The type is specified in the spec file under the section ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes:config_type")," for the specific actor class of the actor."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"config_serialized"),": ",(0,i.kt)("em",{parentName:"p"},"bytes")," - Config in serialized (class independent) form. This can be accessed even without specs (see ",(0,i.kt)("inlineCode",{parentName:"p"},"has_specs()"),")."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"class_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - This cannot be changed (it is a parameter of the constructor)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"name"),": ",(0,i.kt)("em",{parentName:"p"},"str")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"endpoint"),": ",(0,i.kt)("em",{parentName:"p"},"str")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"implementation"),": ",(0,i.kt)("em",{parentName:"p"},"str")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"initial_connection_timeout"),": ",(0,i.kt)("em",{parentName:"p"},"float")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"response_timeout"),": ",(0,i.kt)("em",{parentName:"p"},"float")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"optional"),": ",(0,i.kt)("em",{parentName:"p"},"bool")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"default_action"),": ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - The type is specified in the spec file under the section ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes:action:space")," for the specific class of the actor."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"default_action_serialized"),": ",(0,i.kt)("em",{parentName:"p"},"bytes")," - Action in serialized (class independent) form. This can be accessed even without specs (see ",(0,i.kt)("inlineCode",{parentName:"p"},"has_specs()"),")."),(0,i.kt)("h3",{id:"__init__self-cog_settings-class_name-kwargs"},(0,i.kt)("inlineCode",{parentName:"h3"},"__init__(self, cog_settings, class_name, **kwargs)")),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"cog_settings"),": ",(0,i.kt)("em",{parentName:"li"},"module")," - Specs module associated with trials that relate to these parameters (see ",(0,i.kt)("a",{parentName:"li",href:"#compiling-the-spec-file-into-cog_settingspy"},"cog_settings generation"),")."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"class_name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The name of the actor class for the actor. This is specific to a type of trial and must match values in the spec file under section ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes:name"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"**kwargs"),": Accepts any of the attributes (except ",(0,i.kt)("inlineCode",{parentName:"li"},"class_name"),") as keyword to set their value on construction. E.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'ActorParameters(settings, class_name="some_class", name="act_name")'))),(0,i.kt)("h3",{id:"has_specsself-5"},(0,i.kt)("inlineCode",{parentName:"h3"},"has_specs(self)")),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the specs are known by this instance. False otherwise. Specs will be known if the top level Cogment Context has specs or if a non ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," argument ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings")," was provided."),(0,i.kt)("h2",{id:"class-cogmentlogsample"},"class cogment.LogSample"),(0,i.kt)("p",null,"Class containing a datalog sample.\nA sample starts and ends with the arrival of new observations from the environment. The last sample will end after all components have acknowledged the end of the trial (the state of that sample will then be ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialState.ENDED"),")."),(0,i.kt)("p",null,"Note that some of the data may not be available (",(0,i.kt)("inlineCode",{parentName:"p"},"None"),") if it was excluded from the sample (see datalog parameters ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialParameters.datalog_exclude_fields"),")."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"out_of_sync"),": ",(0,i.kt)("em",{parentName:"p"},"bool")," - False if it is a normal/full sample. True if it is an out-of-sync/partial sample. Out-of-sync samples do not follow the normal time step progression of the trial, they represent isolated data (typically a reward) for steps that have already past. Out-of-sync samples will be produced according to the trial parameter ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#nb_buffered_ticks"},"nb_buffered_ticks"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"tick_id"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The time step that the sample data relates to."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"state"),": ",(0,i.kt)("em",{parentName:"p"},"cogment.TrialState")," - The state of the trial at the end of the sample period. Undefined for out-of-sync samples."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"timestamp"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - Unix style Epoch timestamp in nanoseconds (time since 00:00:00 UTC Jan 1, 1970) at the beginning of the sample period. For out-of-sync samples, this is the time the data in the sample was received."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"events"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Description of special events that happened during the time frame of the sample. For out-of-sync samples, it may contain an explanation of the data."),(0,i.kt)("h3",{id:"__init__self-params"},(0,i.kt)("inlineCode",{parentName:"h3"},"__init__(self, params)")),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"params"),": ",(0,i.kt)("em",{parentName:"li"},"LogParams instance")," - The parameters of the trial.")),(0,i.kt)("h3",{id:"get_serialization_typeself-1"},(0,i.kt)("inlineCode",{parentName:"h3"},"get_serialization_type(self)")),(0,i.kt)("p",null,"Returns the type of serial data produced by ",(0,i.kt)("inlineCode",{parentName:"p"},"serialize")," and accepted by ",(0,i.kt)("inlineCode",{parentName:"p"},"deserialize"),". The type represents an ID dependent on ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/grpc#logexportersamplerequest"},"DatalogSample")," defined in the low level gRPC API."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"int")," - The type of the serialization string data. This is the type of string that is returned by ",(0,i.kt)("inlineCode",{parentName:"p"},"serialize"),", and the only type accepted by ",(0,i.kt)("inlineCode",{parentName:"p"},"deserialize"),"; it is undefined behavior to try to deserialize the wrong type of data. This value is strictly larger than 1."),(0,i.kt)("h3",{id:"serializeself-1"},(0,i.kt)("inlineCode",{parentName:"h3"},"serialize(self)")),(0,i.kt)("p",null,"Returns a binary string equivalent of the sample."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"str")," - Serialized sample."),(0,i.kt)("h3",{id:"deserializeself-raw_string"},(0,i.kt)("inlineCode",{parentName:"h3"},"deserialize(self, raw_string)")),(0,i.kt)("p",null,"Takes a serialized sample string and sets the LogSample instance."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"raw_string"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Binary string representing a serialized LogSample of the same type.")),(0,i.kt)("h3",{id:"all_actor_namesself"},(0,i.kt)("inlineCode",{parentName:"h3"},"all_actor_names(self)")),(0,i.kt)("p",null,"Generator method to iterate over all actors in the trial. This information can also be retrieved from the parameters of the trial."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(str)")," - A generator for the names of the actors in the trial."),(0,i.kt)("h3",{id:"get_actionself-actor"},(0,i.kt)("inlineCode",{parentName:"h3"},"get_action(self, actor)")),(0,i.kt)("p",null,"Retrieves the action from the actor in the sample."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor"),": ",(0,i.kt)("em",{parentName:"li"},"str")," or ",(0,i.kt)("em",{parentName:"li"},"int")," - The name or index of the actor for which to retrieve the action. The number, index and name of actors can be retrieved from the parameters of the trial.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"RecvAction instance")," - The action of the actor in the sample."),(0,i.kt)("h3",{id:"get_observationself-actor"},(0,i.kt)("inlineCode",{parentName:"h3"},"get_observation(self, actor)")),(0,i.kt)("p",null,"Retrieve the observation destined for the actor in the sample. Can be ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," (specifically for out-of-sync samples)."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor"),": ",(0,i.kt)("em",{parentName:"li"},"str")," or ",(0,i.kt)("em",{parentName:"li"},"int")," - The name or index of the actor for which to retrieve the observation. The number, index and name of actors can be retrieved from the parameters of the trial.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"RecvObservation instance")," - The observation of the actor in the sample. Can be ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," (specifically for out-of-sync samples)."),(0,i.kt)("h3",{id:"all_rewardsself"},(0,i.kt)("inlineCode",{parentName:"h3"},"all_rewards(self)")),(0,i.kt)("p",null,"Generator method to iterate over all the rewards in the sample."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(RecvReward instance)")," - A generator for the rewards in the sample."),(0,i.kt)("h3",{id:"all_messagesself"},(0,i.kt)("inlineCode",{parentName:"h3"},"all_messages(self)")),(0,i.kt)("p",null,"Generator method to iterate over all the messages in the sample."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(RecvMessage instance)")," - A generator for the messages in the sample."),(0,i.kt)("h2",{id:"class-modelinfo"},"class ModelInfo"),(0,i.kt)("p",null,"Class containing information about a model name stored in the ModelRegistry."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - The model name."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"properties"),": ",(0,i.kt)("em",{parentName:"p"},"dict{str:str}")," - Custom information associated with the model name (not specific to any iteration)."),(0,i.kt)("h2",{id:"class-modeliterationinfo"},"class ModelIterationInfo"),(0,i.kt)("p",null,"Class containing information specific to a model iteration stored in the Model Registry."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"model_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - The name of the model."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"iteration"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The iteration number."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"timestamp"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - When the iteration was stored in the Model Registry. Unix epoch time in nanoseconds."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"hash"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - SHA 256 hash (encoded in base64 with standard 64 characters with padding) of the iteration's data."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"size"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - Size (in bytes) of the iteration's data."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"stored"),": ",(0,i.kt)("em",{parentName:"p"},"bool")," - Whether the model is stored, as opposed to just being published (and therefore transient)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"properties"),": ",(0,i.kt)("em",{parentName:"p"},"dict{str:str}")," - Custom information associated with the iteration."),(0,i.kt)("h2",{id:"class-latestmodel"},"class LatestModel"),(0,i.kt)("p",null,"Class making the latest model iteration, from the Model Registry, available on-demand."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - The name of the model."),(0,i.kt)("h3",{id:"async-getself"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get(self)")),(0,i.kt)("p",null,"Method to return the latest iteration that has been downloaded in the background. This method may wait for the first iteration to be available. Once an iteration is available, this method will not be blocking."),(0,i.kt)("p",null,"Subsequent calls to this method may return different results according to the availability of new data."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"tuple(data, ModelIterationInfo instance)")," - The data can either be a ",(0,i.kt)("inlineCode",{parentName:"p"},"bytes")," string or a user object depending on ",(0,i.kt)("inlineCode",{parentName:"p"},"is_deserialized()"),". The second tuple item is a ",(0,i.kt)("inlineCode",{parentName:"p"},"ModelIterationInfo")," instance containing the information of the iteration represented by the data."),(0,i.kt)("h3",{id:"is_deserializedself"},(0,i.kt)("inlineCode",{parentName:"h3"},"is_deserialized(self)")),(0,i.kt)("p",null,"Method to check if the model iteration is deserialized automatically."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the model is deserialized automatically in the background, in which case the data (returned by ",(0,i.kt)("inlineCode",{parentName:"p"},"get"),") is a user object. This user object is derived by calling ",(0,i.kt)("inlineCode",{parentName:"p"},"deserialize_func")," (parameter of ",(0,i.kt)("inlineCode",{parentName:"p"},"ModelRegistry.track_latest_model"),") with the raw bytes from the Model Registry. False if the data (returned by ",(0,i.kt)("inlineCode",{parentName:"p"},"get"),") is the raw bytes retrieved from the Model Registry."),(0,i.kt)("h3",{id:"is_availableself"},(0,i.kt)("inlineCode",{parentName:"h3"},"is_available(self)")),(0,i.kt)("p",null,"Method to check if an iteration is available."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Returns: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if an iteration is available, an thus ",(0,i.kt)("inlineCode",{parentName:"p"},"get")," will not block. False otherwise."),(0,i.kt)("h3",{id:"async-wait_for_availableself"},(0,i.kt)("inlineCode",{parentName:"h3"},"async wait_for_available(self)")),(0,i.kt)("p",null,"Method to wait for an iteration to be available."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Returns: None"),(0,i.kt)("h3",{id:"async-wait_for_newerself-iteration"},(0,i.kt)("inlineCode",{parentName:"h3"},"async wait_for_newer(self, iteration)")),(0,i.kt)("p",null,"Method to wait for a newer iteration to be available.\nOnce this method returns, the newer iteration can be retrieved with ",(0,i.kt)("inlineCode",{parentName:"p"},"get"),"."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"iteration"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - Strict lower bound for awaited model iteration. I.e. the method will wait for a model iteration that is newer, and not equal, to this.")),(0,i.kt)("p",null,"Returns: None"),(0,i.kt)("h2",{id:"class-cogmentdatastorefieldsenumenum"},"class cogment.DatastoreFields(enum.Enum)"),(0,i.kt)("p",null,"Enum representing the various data in a ",(0,i.kt)("inlineCode",{parentName:"p"},"DatastoreActorData")," instance"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"UNKNOWN: Should not be used."),(0,i.kt)("li",{parentName:"ul"},"OBSERVATION: The observation."),(0,i.kt)("li",{parentName:"ul"},"ACTION: The action."),(0,i.kt)("li",{parentName:"ul"},"REWARD: The aggregated reward."),(0,i.kt)("li",{parentName:"ul"},"RECEIVED_REWARDS: All the individual rewards received by the actor (",(0,i.kt)("inlineCode",{parentName:"li"},"all_received_rewards")," method)"),(0,i.kt)("li",{parentName:"ul"},"SENT_REWARDS: All the individual rewards sent by the actor (",(0,i.kt)("inlineCode",{parentName:"li"},"all_sent_rewards")," method)"),(0,i.kt)("li",{parentName:"ul"},"RECEIVED_MESSAGES: All the messages received by the actor (",(0,i.kt)("inlineCode",{parentName:"li"},"all_received_messages")," method)"),(0,i.kt)("li",{parentName:"ul"},"SENT_MESSAGES: All the messages sent by the actor (",(0,i.kt)("inlineCode",{parentName:"li"},"all_received_messages")," method)")),(0,i.kt)("h2",{id:"class-datastoretrialinfo"},"class DatastoreTrialInfo"),(0,i.kt)("p",null,"Class containing the information of a trial stored in the Datastore."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trial_id"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - The trial id for this trial."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"user_id"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - The user ID for the trial (provided on trial start)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trial_state"),": ",(0,i.kt)("em",{parentName:"p"},"cogment.TrialState instance")," - The last (or current) state of the trial. This will change over time if not ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialState.ENDED"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"sample_count"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The number of samples currently stored for this trial. This will change over time if the trial state is not ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialState.ENDED"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"parameters"),": ",(0,i.kt)("em",{parentName:"p"},"cogment.TrialParameters instance")," - The parameters for the trial."),(0,i.kt)("h3",{id:"has_specsself-6"},(0,i.kt)("inlineCode",{parentName:"h3"},"has_specs(self)")),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the specs are known by this instance. False otherwise. Specs will be known if the top level Cogment Context has specs."),(0,i.kt)("h2",{id:"class-datastoresample"},"class DatastoreSample"),(0,i.kt)("p",null,"Class containing the data of a trial sample (typically representing all the data during a trial tick)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trial_id"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - The id of the trial the data in the sample relates to."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trial_state"),": ",(0,i.kt)("em",{parentName:"p"},"cogment.TrialState instance")," - The state of the trial at the end of the sample period. Note that the last sample (when ",(0,i.kt)("inlineCode",{parentName:"p"},"trial_state")," is ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialState.ENDED"),") may have ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," data (e.g. observation, action, etc) if the trial ended on an error or was hard terminated."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"tick_id"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The step/tick at which the data in the sample was obtained."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"timestamp"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - Unix style Epoch timestamp of the start of the step/tick (in nanoseconds since 00:00:00 UTC Jan 1, 1970)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"actors_data"),": ",(0,i.kt)("em",{parentName:"p"},"dict{str:DatastoreActorData instance}")," - Dictionary of all actors data included in the sample, indexed by actor name."),(0,i.kt)("h3",{id:"has_specsself-7"},(0,i.kt)("inlineCode",{parentName:"h3"},"has_specs(self)")),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the specs are known by this instance. False otherwise. Specs will be known if the top level Cogment Context has specs."),(0,i.kt)("h2",{id:"class-datastoreactordata"},"class DatastoreActorData"),(0,i.kt)("p",null,"Class containing the data related to an actor in a sample."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the actor."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"observation"),": ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - Observation received by the actor. The class of the observation is defined as observation space for the actor class. This is specified in section ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes:observation:space")," in the spec file for the appropriate actor class. Can be ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if there is no data."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"observation_serialized"),": ",(0,i.kt)("em",{parentName:"p"},"bytes")," - Observation received by the actor in serialized (class independent) form. This can be retrieved even without specs (see ",(0,i.kt)("inlineCode",{parentName:"p"},"has_specs()"),"). Can be ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if there is no data."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"action"),": ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - Action from the actor. The class of the action is defined as action space for the specific actor in the section ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes:action:space")," in the spec file for the appropriate actor class. Can be ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if there is no data."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"action_serialized"),": ",(0,i.kt)("em",{parentName:"p"},"bytes")," - Action from the actor in serialized (class independent) form. This can be retrieved even without specs (see ",(0,i.kt)("inlineCode",{parentName:"p"},"has_specs()"),"). Can be ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if there is no data."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"reward"),": ",(0,i.kt)("em",{parentName:"p"},"float")," - The aggregated reward received by the actor in the sample."),(0,i.kt)("h3",{id:"has_specsself-8"},(0,i.kt)("inlineCode",{parentName:"h3"},"has_specs(self)")),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the specs are known by this instance. False otherwise. Specs will be known if the top level Cogment Context has specs."),(0,i.kt)("h3",{id:"all_received_rewardsself"},(0,i.kt)("inlineCode",{parentName:"h3"},"all_received_rewards(self)")),(0,i.kt)("p",null,"Generator method to iterate over all the individual rewards received by the actor in the sample.\nThe aggregated reward is calculated from these."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(DatastoreReward instance)")," - A generator for the individual actor rewards received."),(0,i.kt)("h3",{id:"all_sent_rewardsself"},(0,i.kt)("inlineCode",{parentName:"h3"},"all_sent_rewards(self)")),(0,i.kt)("p",null,"Generator method to iterate over all the individual rewards sent by the actor in the sample."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(DatastoreReward instance)")," - A generator for the individual actor rewards sent."),(0,i.kt)("h3",{id:"all_received_messagesself"},(0,i.kt)("inlineCode",{parentName:"h3"},"all_received_messages(self)")),(0,i.kt)("p",null,"Generator method to iterate over all the messages received by the actor in the sample."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(DatastoreMessage instance)")," - A generator for the messages received."),(0,i.kt)("h3",{id:"all_sent_messagesself"},(0,i.kt)("inlineCode",{parentName:"h3"},"all_sent_messages(self)")),(0,i.kt)("p",null,"Generator method to iterate over all the messages sent by the actor in the sample."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(DatastoreMessage instance)")," - A generator for the messages sent."),(0,i.kt)("h2",{id:"class-datastorereward"},"class DatastoreReward"),(0,i.kt)("p",null,"Class containing the data for an individual reward in the Datastore."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"value"),": ",(0,i.kt)("em",{parentName:"p"},"float")," - Value of the reward."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"confidence"),": ",(0,i.kt)("em",{parentName:"p"},"float")," - Confidence level of the reward value."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"sender"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the sender of the reward."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"receiver"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the receiver of the reward. The string could contain wildcard characters to represent multiple receivers intended by the sender."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"user_data"),": ",(0,i.kt)("em",{parentName:"p"},"google.protobuf.Any instance")," - Data for a user-specific reward format. Can be ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if no specific data was provided. The class enclosed in ",(0,i.kt)("inlineCode",{parentName:"p"},"google.protobuf.Any")," is of the type set by the sender; it is the responsibility of the receiver to manage the data received (i.e. determine the type and unpack the data)."),(0,i.kt)("h2",{id:"class-datastoremessage"},"class DatastoreMessage"),(0,i.kt)("p",null,"Class containing the data of a message in the Datastore."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"sender"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the sender of the message."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"receiver"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the receiver of the message. The string could contain wildcard characters to represent multiple receivers intended by the sender."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"payload"),": ",(0,i.kt)("em",{parentName:"p"},"google.protobuf.Any instance")," - Data for a received message. The class enclosed in ",(0,i.kt)("inlineCode",{parentName:"p"},"google.protobuf.Any")," is of the type set by the sender; It is the responsibility of the receiver to manage the data received (i.e. determine the type and unpack the data). Can be ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if there is no data."))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/2d986b69.a602b553.js b/assets/js/2d986b69.a602b553.js new file mode 100644 index 0000000..50c87e1 --- /dev/null +++ b/assets/js/2d986b69.a602b553.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[8769],{3905:(e,t,a)=>{a.d(t,{Zo:()=>d,kt:()=>k});var n=a(7294);function i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function r(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?l(Object(a),!0).forEach((function(t){i(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function o(e,t){if(null==e)return{};var a,n,i=function(e,t){if(null==e)return{};var a,n,i={},l=Object.keys(e);for(n=0;n<l.length;n++)a=l[n],t.indexOf(a)>=0||(i[a]=e[a]);return i}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)a=l[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var s=n.createContext({}),p=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):r(r({},t),e)),a},d=function(e){var t=p(e.components);return n.createElement(s.Provider,{value:t},e.children)},m="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},h=n.forwardRef((function(e,t){var a=e.components,i=e.mdxType,l=e.originalType,s=e.parentName,d=o(e,["components","mdxType","originalType","parentName"]),m=p(a),h=i,k=m["".concat(s,".").concat(h)]||m[h]||c[h]||l;return a?n.createElement(k,r(r({ref:t},d),{},{components:a})):n.createElement(k,r({ref:t},d))}));function k(e,t){var a=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var l=a.length,r=new Array(l);r[0]=h;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[m]="string"==typeof e?e:i,r[1]=o;for(var p=2;p<l;p++)r[p]=a[p];return n.createElement.apply(null,r)}return n.createElement.apply(null,a)}h.displayName="MDXCreateElement"},5161:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>r,default:()=>c,frontMatter:()=>l,metadata:()=>o,toc:()=>p});var n=a(7462),i=(a(7294),a(3905));const l={sidebar_position:4,toc_min_heading_level:2,toc_max_heading_level:2},r="Python SDK",o={unversionedId:"reference/python",id:"reference/python",title:"Python SDK",description:"Repository Latest release",source:"@site/docs/reference/python.md",sourceDirName:"reference",slug:"/reference/python",permalink:"/docs/reference/python",draft:!1,tags:[],version:"current",lastUpdatedAt:1697829025,formattedLastUpdatedAt:"Oct 20, 2023",sidebarPosition:4,frontMatter:{sidebar_position:4,toc_min_heading_level:2,toc_max_heading_level:2},sidebar:"docSidebar",previous:{title:"Status",permalink:"/docs/reference/cli/status"},next:{title:"Web Proxy API",permalink:"/docs/reference/web-proxy-api"}},s={},p=[{value:"Installation",id:"installation",level:2},{value:"General usage",id:"general-usage",level:2},{value:"<code>asyncio</code>",id:"asyncio",level:3},{value:"Logging",id:"logging",level:3},{value:"Trial Specifications",id:"trial-specifications",level:3},{value:"Trial Parameters",id:"trial-parameters",level:3},{value:"Compiling the spec file into cog_settings.py",id:"compiling-the-spec-file-into-cog_settingspy",level:3},{value:"Top-level import",id:"top-level-import",level:3},{value:"class cogment.Context",id:"class-cogmentcontext",level:2},{value:"<code>__init__(self, user_id, cog_settings, asyncio_loop=None, prometheus_registry=prometheus_client.core.REGISTRY, directory_endpoint=None, directory_auth_token=None)</code>",id:"__init__self-user_id-cog_settings-asyncio_loopnone-prometheus_registryprometheus_clientcoreregistry-directory_endpointnone-directory_auth_tokennone",level:3},{value:"<code>has_specs(self)</code>",id:"has_specsself",level:3},{value:"<code>async serve_all_registered(self, served_endpoint=ServedEndpoint(), prometheus_port=None, directory_registration_host=None)</code>",id:"async-serve_all_registeredself-served_endpointservedendpoint-prometheus_portnone-directory_registration_hostnone",level:3},{value:"<code>async get_controller(self, endpoint=Endpoint())</code>",id:"async-get_controllerself-endpointendpoint",level:3},{value:"<code>async get_datastore(self, endpoint=Endpoint())</code>",id:"async-get_datastoreself-endpointendpoint",level:3},{value:"<code>async get_model_registry_v2(self, endpoint=Endpoint())</code>",id:"async-get_model_registry_v2self-endpointendpoint",level:3},{value:"<code>async join_trial(self, trial_id, endpoint=Endpoint(), impl_name=None, actor_name=None, actor_class=None)</code>",id:"async-join_trialself-trial_id-endpointendpoint-impl_namenone-actor_namenone-actor_classnone",level:3},{value:"<code>register_environment(self, impl, impl_name, properties={})</code>",id:"register_environmentself-impl-impl_name-properties",level:3},{value:"<code>register_actor(self, impl, impl_name, actor_classes=[], properties={})</code>",id:"register_actorself-impl-impl_name-actor_classes-properties",level:3},{value:"<code>register_pre_trial_hook(self, impl, properties={})</code>",id:"register_pre_trial_hookself-impl-properties",level:3},{value:"<code>register_datalog(self, impl, properties={})</code>",id:"register_datalogself-impl-properties",level:3},{value:"class Controller",id:"class-controller",level:2},{value:"<code>has_specs(self)</code>",id:"has_specsself-1",level:3},{value:"<code>async start_trial(self, trial_config=None, trial_id_requested=None, trial_params=None)</code>",id:"async-start_trialself-trial_confignone-trial_id_requestednone-trial_paramsnone",level:3},{value:"<code>async terminate_trial(self, trial_ids, hard=False)</code>",id:"async-terminate_trialself-trial_ids-hardfalse",level:3},{value:"<code>async get_trial_info(self, trial_ids)</code>",id:"async-get_trial_infoself-trial_ids",level:3},{value:"<code>async watch_trials(self, trial_state_filters=[], full_info=False)</code>",id:"async-watch_trialsself-trial_state_filters-full_infofalse",level:3},{value:"<code>async get_actors(self, trial_id)</code>",id:"async-get_actorsself-trial_id",level:3},{value:"<code>async get_remote_versions(self)</code>",id:"async-get_remote_versionsself",level:3},{value:"class Datastore",id:"class-datastore",level:2},{value:"<code>has_specs(self)</code>",id:"has_specsself-2",level:3},{value:"<code>async get_trials(self, ids=[], properties={})</code>",id:"async-get_trialsself-ids-properties",level:3},{value:"<code>async all_trials(self, bundle_size=1, wait_for_trials=0, properties={}, ids=[])</code>",id:"async-all_trialsself-bundle_size1-wait_for_trials0-properties-ids",level:3},{value:"<code>async delete_trials(self, ids)</code>",id:"async-delete_trialsself-ids",level:3},{value:"<code>async all_samples(self, trial_infos, actor_names=[], actor_classes=[], actor_implementations=[], fields=[])</code>",id:"async-all_samplesself-trial_infos-actor_names-actor_classes-actor_implementations-fields",level:3},{value:"class ModelRegistry",id:"class-modelregistry",level:2},{value:"<code>has_specs(self)</code>",id:"has_specsself-3",level:3},{value:"<code>async store_model(self, name, model, iteration_properties=None)</code>",id:"async-store_modelself-name-model-iteration_propertiesnone",level:3},{value:"<code>async publish_model(self, name, model, iteration_properties=None)</code>",id:"async-publish_modelself-name-model-iteration_propertiesnone",level:3},{value:"<code>async retrieve_model(self, name, iteration=-1)</code>",id:"async-retrieve_modelself-name-iteration-1",level:3},{value:"<code>async remove_model(self, name)</code>",id:"async-remove_modelself-name",level:3},{value:"<code>async list_models(self)</code>",id:"async-list_modelsself",level:3},{value:"<code>async list_iterations(self, model_name)</code>",id:"async-list_iterationsself-model_name",level:3},{value:"<code>async get_iteration_info(self, name, iteration)</code>",id:"async-get_iteration_infoself-name-iteration",level:3},{value:"<code>async update_model_info(self, name, properties)</code>",id:"async-update_model_infoself-name-properties",level:3},{value:"<code>async get_model_info(self, name)</code>",id:"async-get_model_infoself-name",level:3},{value:"<code>async iteration_updates(self, model_name)</code>",id:"async-iteration_updatesself-model_name",level:3},{value:"<code>async track_latest_model(self, name, deserialize_func=None, initial_wait=0)</code>",id:"async-track_latest_modelself-name-deserialize_funcnone-initial_wait0",level:3},{value:"class Session",id:"class-session",level:2},{value:"<code>get_trial_id(self)</code>",id:"get_trial_idself",level:3},{value:"<code>get_tick_id(self)</code>",id:"get_tick_idself",level:3},{value:"<code>is_trial_over(self)</code>",id:"is_trial_overself",level:3},{value:"<code>sending_done(self)</code>",id:"sending_doneself",level:3},{value:"<code>add_reward(self, value, confidence, to, tick_id=-1, user_data=None)</code>",id:"add_rewardself-value-confidence-to-tick_id-1-user_datanone",level:3},{value:"class EnvironmentSession(Session)",id:"class-environmentsessionsession",level:2},{value:"<code>start(self, observations = None, auto_done_sending=True)</code>",id:"startself-observations--none-auto_done_sendingtrue",level:3},{value:"<code>async all_events(self)</code>",id:"async-all_eventsself",level:3},{value:"<code>produce_observations(self, observations)</code>",id:"produce_observationsself-observations",level:3},{value:"<code>end(self, final_observations)</code>",id:"endself-final_observations",level:3},{value:"<code>get_active_actors(self)</code>",id:"get_active_actorsself",level:3},{value:"<code>send_message(self, payload, to)</code>",id:"send_messageself-payload-to",level:3},{value:"class ActorSession(Session)",id:"class-actorsessionsession",level:2},{value:"<code>start(self, auto_done_sending=True)</code>",id:"startself-auto_done_sendingtrue",level:3},{value:"<code>async all_events(self)</code>",id:"async-all_eventsself-1",level:3},{value:"<code>do_action(self, action)</code>",id:"do_actionself-action",level:3},{value:"<code>send_message(self, payload, to)</code>",id:"send_messageself-payload-to-1",level:3},{value:"class PrehookSession",id:"class-prehooksession",level:2},{value:"<code>get_trial_id(self)</code>",id:"get_trial_idself-1",level:3},{value:"<code>get_user_id(self)</code>",id:"get_user_idself",level:3},{value:"class DatalogSession",id:"class-datalogsession",level:2},{value:"<code>start(self)</code>",id:"startself",level:3},{value:"<code>all_samples(self)</code>",id:"all_samplesself",level:3},{value:"class cogment.Endpoint",id:"class-cogmentendpoint",level:2},{value:"<code>__init__(self, url="cogment://discover")</code>",id:"__init__self-urlcogmentdiscover",level:3},{value:"class cogment.ServedEndpoint",id:"class-cogmentservedendpoint",level:2},{value:"<code>__init__(self, port=0)</code>",id:"__init__self-port0",level:3},{value:"class cogment.TrialState(enum.Enum)",id:"class-cogmenttrialstateenumenum",level:2},{value:"class TrialInfo",id:"class-trialinfo",level:2},{value:"class ActorInfo",id:"class-actorinfo",level:2},{value:"class RecvEvent",id:"class-recvevent",level:2},{value:"class cogment.EventType(enum.Enum)",id:"class-cogmenteventtypeenumenum",level:3},{value:"class RecvObservation",id:"class-recvobservation",level:2},{value:"class cogment.ActorStatus(enum.Enum)",id:"class-cogmentactorstatusenumenum",level:2},{value:"class RecvAction",id:"class-recvaction",level:2},{value:"class RecvMessage",id:"class-recvmessage",level:2},{value:"class RecvReward",id:"class-recvreward",level:2},{value:"<code>get_nb_sources(self)</code>",id:"get_nb_sourcesself",level:3},{value:"<code>all_sources(self)</code>",id:"all_sourcesself",level:3},{value:"class RecvRewardSource",id:"class-recvrewardsource",level:2},{value:"class cogment.TrialParameters",id:"class-cogmenttrialparameters",level:2},{value:"<code>__init__(self, cog_settings, **kwargs)</code>",id:"__init__self-cog_settings-kwargs",level:3},{value:"<code>has_specs(self)</code>",id:"has_specsself-4",level:3},{value:"<code>get_serialization_type(self)</code>",id:"get_serialization_typeself",level:3},{value:"<code>serialize(self)</code>",id:"serializeself",level:3},{value:"<code>deserialize(self, raw_string, type=None)</code>",id:"deserializeself-raw_string-typenone",level:3},{value:"class cogment.ActorParameters",id:"class-cogmentactorparameters",level:2},{value:"<code>__init__(self, cog_settings, class_name, **kwargs)</code>",id:"__init__self-cog_settings-class_name-kwargs",level:3},{value:"<code>has_specs(self)</code>",id:"has_specsself-5",level:3},{value:"class cogment.LogSample",id:"class-cogmentlogsample",level:2},{value:"<code>__init__(self, params)</code>",id:"__init__self-params",level:3},{value:"<code>get_serialization_type(self)</code>",id:"get_serialization_typeself-1",level:3},{value:"<code>serialize(self)</code>",id:"serializeself-1",level:3},{value:"<code>deserialize(self, raw_string)</code>",id:"deserializeself-raw_string",level:3},{value:"<code>all_actor_names(self)</code>",id:"all_actor_namesself",level:3},{value:"<code>get_action(self, actor)</code>",id:"get_actionself-actor",level:3},{value:"<code>get_observation(self, actor)</code>",id:"get_observationself-actor",level:3},{value:"<code>all_rewards(self)</code>",id:"all_rewardsself",level:3},{value:"<code>all_messages(self)</code>",id:"all_messagesself",level:3},{value:"class ModelInfo",id:"class-modelinfo",level:2},{value:"class ModelIterationInfo",id:"class-modeliterationinfo",level:2},{value:"class LatestModel",id:"class-latestmodel",level:2},{value:"<code>async get(self)</code>",id:"async-getself",level:3},{value:"<code>is_deserialized(self)</code>",id:"is_deserializedself",level:3},{value:"<code>is_available(self)</code>",id:"is_availableself",level:3},{value:"<code>async wait_for_available(self)</code>",id:"async-wait_for_availableself",level:3},{value:"<code>async wait_for_newer(self, iteration)</code>",id:"async-wait_for_newerself-iteration",level:3},{value:"class cogment.DatastoreFields(enum.Enum)",id:"class-cogmentdatastorefieldsenumenum",level:2},{value:"class DatastoreTrialInfo",id:"class-datastoretrialinfo",level:2},{value:"<code>has_specs(self)</code>",id:"has_specsself-6",level:3},{value:"class DatastoreSample",id:"class-datastoresample",level:2},{value:"<code>has_specs(self)</code>",id:"has_specsself-7",level:3},{value:"class DatastoreActorData",id:"class-datastoreactordata",level:2},{value:"<code>has_specs(self)</code>",id:"has_specsself-8",level:3},{value:"<code>all_received_rewards(self)</code>",id:"all_received_rewardsself",level:3},{value:"<code>all_sent_rewards(self)</code>",id:"all_sent_rewardsself",level:3},{value:"<code>all_received_messages(self)</code>",id:"all_received_messagesself",level:3},{value:"<code>all_sent_messages(self)</code>",id:"all_sent_messagesself",level:3},{value:"class DatastoreReward",id:"class-datastorereward",level:2},{value:"class DatastoreMessage",id:"class-datastoremessage",level:2}],d={toc:p},m="wrapper";function c(e){let{components:t,...a}=e;return(0,i.kt)(m,(0,n.Z)({},d,a,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"python-sdk"},"Python SDK"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-py-sdk"},(0,i.kt)("img",{parentName:"a",src:"https://img.shields.io/badge/repository-cogment%2Fcogment--py--sdk-%235217b8?style=for-the-badge&logo=github",alt:"Repository"}))," ",(0,i.kt)("a",{parentName:"p",href:"https://pypi.org/project/cogment/"},(0,i.kt)("img",{parentName:"a",src:"https://img.shields.io/pypi/v/cogment?style=for-the-badge",alt:"Latest release"}))),(0,i.kt)("h2",{id:"installation"},"Installation"),(0,i.kt)("p",null,"The simplest way to install the python SDK is to just install it using pip: ",(0,i.kt)("inlineCode",{parentName:"p"},"pip install cogment"),"."),(0,i.kt)("p",null,"To install the generator (for ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings.py"),") it is done similarly with pip: ",(0,i.kt)("inlineCode",{parentName:"p"},"pip install cogment[generate]"),". If both are needed, installing the generator will install the Python SDK."),(0,i.kt)("p",null,"The basic requirement is Python 3.7."),(0,i.kt)("h2",{id:"general-usage"},"General usage"),(0,i.kt)("h3",{id:"asyncio"},(0,i.kt)("inlineCode",{parentName:"h3"},"asyncio")),(0,i.kt)("p",null,"The Python SDK is designed to run concurrently and asynchronously using the Python ",(0,i.kt)("inlineCode",{parentName:"p"},"asyncio")," library. As such, it should be run in an ",(0,i.kt)("inlineCode",{parentName:"p"},"asyncio.Task"),"."),(0,i.kt)("p",null,"E.g."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"asyncio.run(MyMainFunction())\n")),(0,i.kt)("h3",{id:"logging"},"Logging"),(0,i.kt)("p",null,"The Python SDK uses the ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.sdk")," logger, and the default log level is ",(0,i.kt)("inlineCode",{parentName:"p"},"INFO"),". E.g. to change the log level to ",(0,i.kt)("inlineCode",{parentName:"p"},"WARNING"),":"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'import cogment\nimport logging\n\nlogging.getLogger("cogment.sdk").setLevel(logging.WARNING)\n')),(0,i.kt)("p",null,"Or set the environment variable ",(0,i.kt)("inlineCode",{parentName:"p"},"COGMENT_LOG_LEVEL")," to one of the values: ",(0,i.kt)("inlineCode",{parentName:"p"},"off"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"error"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"warning"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"info"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"debug"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"trace")," (which match the respective Python levels ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.CRITICAL"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.ERROR"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.WARNING"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.INFO"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.DEBUG"),").\nSince the Cogment Python SDK does not output any critical logs, the ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.CRITICAL")," level effectively turns logging off.\nThe ",(0,i.kt)("inlineCode",{parentName:"p"},"trace")," level does not match a standard Python logging level and is mostly for internal use with a level lower than ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.DEBUG"),"."),(0,i.kt)("p",null,"The Cogment logger does not define a handler, and the handler management is left to the application (as is standard for a library in Python).\nThus the Python ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.lastResort")," handler will be used if no explicit handler is defined by the application (i.e. only warnings and errors will be output to stderr, with no formatting).\nThe application should enable a handler as required.\nE.g. for a default logging setup (including a stream handler):"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"import cogment\nimport logging\n\nlogging.basicConfig()\n")),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"Calling any of the module level functions ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.log"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.debug"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.info"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.warning"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.error"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.critical")," or ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.exception"),", will implicitly call ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.basicConfig"),".\nAnd calling ",(0,i.kt)("inlineCode",{parentName:"p"},"logging.basicConfig")," does nothing if there is a root handler already defined.\nSee Python documentation for ",(0,i.kt)("a",{parentName:"p",href:"https://docs.python.org/3/library/logging.html#logging.basicConfig"},"logging.basicConfig"))),(0,i.kt)("h3",{id:"trial-specifications"},"Trial Specifications"),(0,i.kt)("p",null,"The specifications (specs) of a trial type are contained in a ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cogment-yaml"},"spec file")," and the imported files defined in the spec file. This file is typically named ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.yaml"),"."),(0,i.kt)("p",null,"For example, an ",(0,i.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#actors"},"actor")," class is defined by its required observation space and action space."),(0,i.kt)("p",null,'These "spaces" are defined by using protobuf message types (from the imported files). ',(0,i.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#observations--actions"},"Observations and actions")," will simply be instances of the appropriate type."),(0,i.kt)("p",null,"Messages and feedback user data don't have a set type, they can be any type of protobuf message as long as the receiver can manage that type (i.e. the object received is an instance of ",(0,i.kt)("inlineCode",{parentName:"p"},"google.protobuf.Any")," and the contained type should be checked against known types before handling). The type is determined by the provided message from the originator."),(0,i.kt)("h3",{id:"trial-parameters"},"Trial Parameters"),(0,i.kt)("p",null,"The trial ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters"},"parameters")," can come from the Controller ",(0,i.kt)("inlineCode",{parentName:"p"},"start_trial")," command, from the default parameters provided to the Orchestrator on startup, or from the pre-trial hooks (themselves provided to the Orchestrator on startup)."),(0,i.kt)("p",null,"The parameters are mostly independent of the spec file (cogment.yaml), except that the active actors listed in the parameters must have their actor class match an actor class defined in the spec file."),(0,i.kt)("p",null,"Below, when we refer to the trial parameters, we mean the final parameters after any pre-trial hooks."),(0,i.kt)("h3",{id:"compiling-the-spec-file-into-cog_settingspy"},"Compiling the spec file into cog_settings.py"),(0,i.kt)("p",null,"In order to use the specifications within python scripts, the ",(0,i.kt)("a",{parentName:"p",href:"#trial-specifications"},"spec file")," needs to be compiled into python modules. This is done by the Python SDK generator (see ","[#installation]",")."),(0,i.kt)("p",null,"The generator is used this way:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"$ python3 -m cogment.generate --spec cogment.yaml --output ./cog_settings.py\n")),(0,i.kt)("p",null,"This will create a ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings.py")," specs module in the current directory (",(0,i.kt)("inlineCode",{parentName:"p"},"--output ./"),"). The generator will also compile the imported ",(0,i.kt)("inlineCode",{parentName:"p"},"*.proto")," files into python modules that will be saved in the same location as the specified output file (",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings.py"),") and they will be named according to their proto names: ",(0,i.kt)("inlineCode",{parentName:"p"},"<name>.proto")," is compiled to ",(0,i.kt)("inlineCode",{parentName:"p"},"<name>_pb2.py"),"."),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings.py")," Python module is required by all API entry points."),(0,i.kt)("h3",{id:"top-level-import"},"Top-level import"),(0,i.kt)("p",null,"The main module of the Cogment SDK is ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment"),". But all cogment scripts need to start with a ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.Context"),", which also requires the generated module ",(0,i.kt)("a",{parentName:"p",href:"#compiling-the-spec-file-into-cog_settingspy"},"cog_settings")," (project specific definitions created from the spec file)."),(0,i.kt)("p",null,"If one needs to create a ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.TrialParameters")," or ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.ActorParameters")," from scratch, the ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings")," module is also required."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"import cog_settings\nimport cogment\n")),(0,i.kt)("h2",{id:"class-cogmentcontext"},"class cogment.Context"),(0,i.kt)("p",null,"Class to setup and run all the different aspects of Cogment trials."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"served_port"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The port on which ",(0,i.kt)("inlineCode",{parentName:"p"},"serve_all_registered")," is offering the various registered services. The port is 0 if no services are offered (e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"serve_all_registered")," was not called yet).\n",(0,i.kt)("inlineCode",{parentName:"p"},"asyncio_loop"),": ",(0,i.kt)("em",{parentName:"p"},"asyncio.EventLoop instance")," - The Python asyncio loop used by the context (note that the actual type is specific to the platform)."),(0,i.kt)("h3",{id:"__init__self-user_id-cog_settings-asyncio_loopnone-prometheus_registryprometheus_clientcoreregistry-directory_endpointnone-directory_auth_tokennone"},(0,i.kt)("inlineCode",{parentName:"h3"},"__init__(self, user_id, cog_settings, asyncio_loop=None, prometheus_registry=prometheus_client.core.REGISTRY, directory_endpoint=None, directory_auth_token=None)")),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"user_id"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Identifier for the user of this context."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"cog_settings"),": ",(0,i.kt)("em",{parentName:"li"},"module")," - Specs module associated with trials that will be run, observed or inquired (see ",(0,i.kt)("a",{parentName:"li",href:"#compiling-the-spec-file-into-cog_settingspy"},"cog_settings generation"),"). This can be None in some circumstances."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"asyncio_loop"),": ",(0,i.kt)("em",{parentName:"li"},"asyncio.EventLoop instance")," - The Python asyncio loop into which the Context should operate. If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", the current loop will be used."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"prometheus_registry"),": ",(0,i.kt)("em",{parentName:"li"},"prometheus_client.core.CollectorRegistry instance")," - Prometheus registry that'll be used by the Cogment metrics in this context. Can be set to ",(0,i.kt)("inlineCode",{parentName:"li"},"None")," to completely deactivate them. The default value is Prometheus' default global registry."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"directory_endpoint"),": ",(0,i.kt)("em",{parentName:"li"},"Endpoint instance"),' - Grpc endpoint (i.e. starting with "grpc://") to access the directory. The directory will be used to inquire discovery endpoints, and to register the services for discovery. If no endpoint is provided, a check for the environment variable ',(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_ENDPOINT")," will be made and if it exists, it will be used as the URL of a basic endpoint."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"directory_auth_token"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Authentication token for access to the directory. This token will be registered with the services, and must match registered tokens when inquiring the directory. If no token is provided, a check for the environment variable ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_AUTHENTICATION_TOKEN")," will be made and if it exists, it will be used as the token.")),(0,i.kt)("h3",{id:"has_specsself"},(0,i.kt)("inlineCode",{parentName:"h3"},"has_specs(self)")),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the specs are known. False otherwise. The specs are known if the ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings")," argument was provided and not ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),". A context instantiated without specs has limited functionality and will produce objects without specs (thus also having limited functionality)."),(0,i.kt)("h3",{id:"async-serve_all_registeredself-served_endpointservedendpoint-prometheus_portnone-directory_registration_hostnone"},(0,i.kt)("inlineCode",{parentName:"h3"},"async serve_all_registered(self, served_endpoint=ServedEndpoint(), prometheus_port=None, directory_registration_host=None)")),(0,i.kt)("p",null,"Method to start and run the communication server for the registered components (environment, actor, prehook, datalog). This coroutine will end when all activity has stopped. If a directory is defined in the Context, then this method will also register the services in the defined directory."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"served_endpoint"),": ",(0,i.kt)("em",{parentName:"li"},"ServedEndpoint instance")," - Details of the connection for the served components. If ",(0,i.kt)("inlineCode",{parentName:"li"},"served_endpoint.port")," is zero (0), then the system will choose a free port; in which case the port chosen is found in the ",(0,i.kt)("inlineCode",{parentName:"li"},"served_port")," attribute of the Context."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"prometheus_port"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - TCP/IP port number for Prometheus. Set to None to disable the Prometheus metrics server."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"directory_registration_host"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Hostname (or IP address) of the host to register to the directory (the port is taken from the ",(0,i.kt)("inlineCode",{parentName:"li"},"served_endpoint"),") for the services registered. If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", the SDK will determine the current host IP address automatically. In some circumstances, the IP address determined by the SDK may be wrong (e.g. multiple interfaces, load balancing, firewall), thus a host must be explicitly provided.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"async-get_controllerself-endpointendpoint"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_controller(self, endpoint=Endpoint())")),(0,i.kt)("p",null,"Method to get a controller instance to manage trials (start, stop, inquire, etc)."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"endpoint"),": ",(0,i.kt)("em",{parentName:"li"},(0,i.kt)("a",{parentName:"em",href:"#class-cogmentendpoint"},"Endpoint")," instance")," - Details of the connection to the Orchestrator.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"Controller instance")," - An instance of the ",(0,i.kt)("inlineCode",{parentName:"p"},"Controller")," class used to manage trials."),(0,i.kt)("h3",{id:"async-get_datastoreself-endpointendpoint"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_datastore(self, endpoint=Endpoint())")),(0,i.kt)("p",null,"Method to get a class instance to retrieve and manage data in a Datastore."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"endpoint"),": ",(0,i.kt)("em",{parentName:"li"},(0,i.kt)("a",{parentName:"em",href:"#class-cogmentendpoint"},"Endpoint")," instance")," - Details of the connection to the Datastore.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"Datastore instance")," - An instance of the ",(0,i.kt)("inlineCode",{parentName:"p"},"Datastore")," class."),(0,i.kt)("h3",{id:"async-get_model_registry_v2self-endpointendpoint"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_model_registry_v2(self, endpoint=Endpoint())")),(0,i.kt)("p",null,"Method to get a class instance to store and retrieve models in a Model Registry"),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"endpoint"),": ",(0,i.kt)("em",{parentName:"li"},(0,i.kt)("a",{parentName:"em",href:"#class-cogmentendpoint"},"Endpoint")," instance")," - Details of the connection to the Model Registry.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"ModelRegistry instance")," - An instance of the ",(0,i.kt)("inlineCode",{parentName:"p"},"ModelRegistry")," class."),(0,i.kt)("h3",{id:"async-join_trialself-trial_id-endpointendpoint-impl_namenone-actor_namenone-actor_classnone"},(0,i.kt)("inlineCode",{parentName:"h3"},"async join_trial(self, trial_id, endpoint=Endpoint(), impl_name=None, actor_name=None, actor_class=None)")),(0,i.kt)("p",null,"Method for an actor to asynchronously join an existing trial. This task will normally end after the user implementation has exited."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_id"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The UUID of the trial to join."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"endpoint"),": ",(0,i.kt)("em",{parentName:"li"},(0,i.kt)("a",{parentName:"em",href:"#class-cogmentendpoint"},"Endpoint")," instance")," - Details of the connection to the Orchestrator."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"impl_name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - ",(0,i.kt)("strong",{parentName:"li"},"deprecated")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Name of the actor joining the trial. If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_class")," will be used to find the actor to join. The name must match an active actor in the trial as found in the trial parameters in the sections ",(0,i.kt)("inlineCode",{parentName:"li"},"trial_params:actors:name")," with ",(0,i.kt)("inlineCode",{parentName:"li"},"trial_params:actors:endpoint"),' set to "cogment://client".'),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_class"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The class of actor to join the trial. If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_name")," will be used to find the actor to join. The class must match an active actor in the trial as found in the trial parameters in the sections ",(0,i.kt)("inlineCode",{parentName:"li"},"trial_params:actors:actor_class")," with ",(0,i.kt)("inlineCode",{parentName:"li"},"trial_params:actors:endpoint"),' set to "cogment://client".')),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"register_environmentself-impl-impl_name-properties"},(0,i.kt)("inlineCode",{parentName:"h3"},"register_environment(self, impl, impl_name, properties={})")),(0,i.kt)("p",null,"Method to register the asynchronous callback function that will run an environment for a trial."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"impl"),": ",(0,i.kt)("em",{parentName:"li"},"async function(EnvironmentSession instance)")," - Callback function to be registered."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"impl_name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Name for the environment being run by the given callback function."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"properties"),": ",(0,i.kt)("em",{parentName:"li"},"dict{str:str}")," : Properties associated with the environment to be registered in the directory. These properties may be used for inquiries into the directory to find this environment.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"register_actorself-impl-impl_name-actor_classes-properties"},(0,i.kt)("inlineCode",{parentName:"h3"},"register_actor(self, impl, impl_name, actor_classes=[], properties={})")),(0,i.kt)("p",null,"Method to register the asynchronous callback function that will run an actor for a trial."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"impl"),": ",(0,i.kt)("em",{parentName:"li"},"async func(ActorSession instance)")," - Callback function to be registered."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"impl_name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Name for the actor implementation being run by the given callback function."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes"),": ",(0,i.kt)("em",{parentName:"li"},"list","[str]")," - The actor class name(s) that can be run by the given callback function. The possible names are specified in the spec file under section ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes:name"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"properties"),": ",(0,i.kt)("em",{parentName:"li"},"dict{str:str}")," : Properties associated with the actor to be registered in the directory. These properties may be used for inquiries into the directory to find this actor.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"register_pre_trial_hookself-impl-properties"},(0,i.kt)("inlineCode",{parentName:"h3"},"register_pre_trial_hook(self, impl, properties={})")),(0,i.kt)("p",null,"Method to register an asynchronous callback function that will be called before a trial is started. Only one such function can be registered. But there may be multiple hook services for an Orchestrator. They are provided to the Orchestrator at startup. All hooks registered with the Orchestrator will be called in a pipeline fashion before each new trial."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"impl"),": ",(0,i.kt)("em",{parentName:"li"},"async func(PrehookSession instance)")," - Callback function to be registered. The ",(0,i.kt)("inlineCode",{parentName:"li"},"PrehookSession")," instance member data should be changed as needed for the new trial before returning from this function."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"properties"),": ",(0,i.kt)("em",{parentName:"li"},"dict{str:str}")," : Properties associated with the hook to be registered in the directory. These properties may be used for inquiries into the directory to find this hook.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"register_datalogself-impl-properties"},(0,i.kt)("inlineCode",{parentName:"h3"},"register_datalog(self, impl, properties={})")),(0,i.kt)("p",null,"Method to register an asynchronous callback function that will be called for each trial to serve log requests. Only one such function can be registered. This service is addressed in the trial parameters in the ",(0,i.kt)("inlineCode",{parentName:"p"},"datalog")," section."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"impl"),": ",(0,i.kt)("em",{parentName:"li"},"async func(DatalogSession instance)")," - Callback function to be registered"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"properties"),": ",(0,i.kt)("em",{parentName:"li"},"dict{str:str}")," : Properties associated with the datalog to be registered in the directory. These properties may be used for inquiries into the directory to find this datalog.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h2",{id:"class-controller"},"class Controller"),(0,i.kt)("p",null,"Class containing data and methods to control and manage trials."),(0,i.kt)("h3",{id:"has_specsself-1"},(0,i.kt)("inlineCode",{parentName:"h3"},"has_specs(self)")),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - Always True since the Controller does not rely on trial specs."),(0,i.kt)("h3",{id:"async-start_trialself-trial_confignone-trial_id_requestednone-trial_paramsnone"},(0,i.kt)("inlineCode",{parentName:"h3"},"async start_trial(self, trial_config=None, trial_id_requested=None, trial_params=None)")),(0,i.kt)("p",null,"Method to start a new trial.\nThe config and parameter options are mutually exclusive."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_config"),": ",(0,i.kt)("em",{parentName:"li"},"protobuf class instance")," - Configuration for the trial. The type is specified in the spec file under the section ",(0,i.kt)("inlineCode",{parentName:"li"},"trial:config_type"),". The config will be added to the default parameters (in the Orchestrator) and sent to the pre-trial hooks (if any). The pre-trial hooks will set the trial parameters according to the config. If there is no pre-trial hooks, the config is ignored and the default parameters are used. This cannot be provided with the ",(0,i.kt)("inlineCode",{parentName:"li"},"trial_params"),". \x3c!--- If this is a bytes string, it will be passed raw to the orchestrator. ---\x3e"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_id_requested"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The trial identifier requested for the new trial. It must be unique among all active trials and a limited set of the latest ended trials (this list of trials can be retrieved with ",(0,i.kt)("inlineCode",{parentName:"li"},"get_trial_info")," or ",(0,i.kt)("inlineCode",{parentName:"li"},"watch_trial"),"). If provided, the Orchestrator will try to use this trial_id, otherwise, a UUID will be created."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_params"),": ",(0,i.kt)("em",{parentName:"li"},"TrialParameters instance")," - Fully defined parameters to start the new trial. This will be used as the trial parameters (I.e. the default parameters and pre-trial hooks are ignored). This cannot be provided with the ",(0,i.kt)("inlineCode",{parentName:"li"},"trial_config"),".")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"str")," - The newly started trial ID. An empty string if the trial was not started due to a non-unique requested ID."),(0,i.kt)("h3",{id:"async-terminate_trialself-trial_ids-hardfalse"},(0,i.kt)("inlineCode",{parentName:"h3"},"async terminate_trial(self, trial_ids, hard=False)")),(0,i.kt)("p",null,"Method to request the end of a trial."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_ids"),": ",(0,i.kt)("em",{parentName:"li"},"list","[str]")," - The trial ID(s) to request to terminate. There must be at least one ID."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"hard"),": ",(0,i.kt)("em",{parentName:"li"},"bool")," - If ",(0,i.kt)("inlineCode",{parentName:"li"},"True"),", the termination will be forced and immediate, it will not wait for any action or observation. If ",(0,i.kt)("inlineCode",{parentName:"li"},"False"),", the trial will wait for the end of the next step, to end gracefully (i.e. wait for the next full set of actions and response observations), and the environment will have a chance to respond to an end request (an event of type ENDING).")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"async-get_trial_infoself-trial_ids"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_trial_info(self, trial_ids)")),(0,i.kt)("p",null,"Method to get information about a trial."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_ids"),": ",(0,i.kt)("em",{parentName:"li"},"list","[str]")," - The trial ID(s) from which to request information. If no ID is provided, returns information about all trials. Note that ended trials may only appear for a short time in this list after they have ended.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"list","[TrialInfo instance]")," - List of trial information, one per trial. Can be empty if no trial matches."),(0,i.kt)("h3",{id:"async-watch_trialsself-trial_state_filters-full_infofalse"},(0,i.kt)("inlineCode",{parentName:"h3"},"async watch_trials(self, trial_state_filters=[], full_info=False)")),(0,i.kt)("p",null,"Generator method to iterate, in real-time, through all trials with state matching the filters. When called, it will first iterate over the trials with current state matching the filters. Afterwards, it will wait, and yield in real-time, as trial states change and match the filters."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_state_filters"),": ",(0,i.kt)("em",{parentName:"li"},"list","[cogment.TrialState]")," - List of enum values from ",(0,i.kt)("inlineCode",{parentName:"li"},"cogment.TrialState")," for which we are interested in receiving state changes."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"full_info"),": ",(0,i.kt)("em",{parentName:"li"},"bool")," - If True, all the fields of the returned ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialInfo")," will be set. Otherwise only the trial ID and state will be set.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(TrialInfo instance)")," - A generator for the relevant trial info."),(0,i.kt)("h3",{id:"async-get_actorsself-trial_id"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_actors(self, trial_id)")),(0,i.kt)("p",null,"Method to get the list of configured actors in a trial."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_id"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The trial ID from which to request the list of actors.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"list","[ActorInfo instance]")," - List of actors configured in this trial."),(0,i.kt)("h3",{id:"async-get_remote_versionsself"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_remote_versions(self)")),(0,i.kt)("p",null,"Method to get the versions from the remote Orchestrator."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"dict")," - The key of the dictionary is the name of the component (",(0,i.kt)("em",{parentName:"p"},"str"),"), and the value is the version (",(0,i.kt)("em",{parentName:"p"},"str"),")."),(0,i.kt)("h2",{id:"class-datastore"},"class Datastore"),(0,i.kt)("p",null,"Class containing data and methods to retrieve historical (or real-time) trial samples from a Datastore.\nThis class can also be used to delete trials from a Datastore."),(0,i.kt)("h3",{id:"has_specsself-2"},(0,i.kt)("inlineCode",{parentName:"h3"},"has_specs(self)")),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the specs are known by this instance. False otherwise. Specs will be known if the top level Cogment Context has specs."),(0,i.kt)("h3",{id:"async-get_trialsself-ids-properties"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_trials(self, ids=[], properties={})")),(0,i.kt)("p",null,"Method to get information about historical (or ongoing) trials in the Datastore.\nThis method is more efficient than ",(0,i.kt)("inlineCode",{parentName:"p"},"all_trials()"),", but can be problematic if too many trials are to be returned."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"ids"),": ",(0,i.kt)("em",{parentName:"p"},"list","[str]")," - The trial IDs for which to request information. If no ID is provided (empty list), returns information about all trials in the Datastore.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"properties"),": ",(0,i.kt)("em",{parentName:"p"},"dict{str:str}")," - Properties that must match the trial properties (see ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters"},"trial parameters"),")."))),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"list","[DatastoreTrialInfo instance]")," - List of trial information, one per trial. Can be empty if no trial matches any of the provided trial IDs and properties."),(0,i.kt)("h3",{id:"async-all_trialsself-bundle_size1-wait_for_trials0-properties-ids"},(0,i.kt)("inlineCode",{parentName:"h3"},"async all_trials(self, bundle_size=1, wait_for_trials=0, properties={}, ids=[])")),(0,i.kt)("p",null,"Generator method to iterate through the trials in the Datastore that match the given properties."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"bundle_size"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - Number of trials to retrieve at a time from the Datastore. This may be increased to more efficiently inquire the Datastore at the price of increased memory use.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"wait_for_trials"),": ",(0,i.kt)("em",{parentName:"p"},"float")," - Number of seconds to wait for new trials (to reach bundle size). If 0, only the trials currently in the datastore will be returned. If the bundle size is not reached within that time limit, whatever trials were found are returned, and if no trials were found, the iterator exits.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"properties"),": ",(0,i.kt)("em",{parentName:"p"},"dict{str:str}")," - Properties that must match the trial properties (see ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters"},"trial parameters"),"). If empty, all trials match.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"ids"),": ",(0,i.kt)("em",{parentName:"p"},"list","[str]")," - The trial IDs that are considered for retrieval. If no ID is provided (empty list), all trials are considered."))),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(DatastoreTrialInfo instance)")," - A generator for the trials in the Datastore."),(0,i.kt)("h3",{id:"async-delete_trialsself-ids"},(0,i.kt)("inlineCode",{parentName:"h3"},"async delete_trials(self, ids)")),(0,i.kt)("p",null,"Method to delete historical trials recorded in the Datastore."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"ids"),": ",(0,i.kt)("em",{parentName:"li"},"list","[str]")," - The trial IDs to remove from the Datastore.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"async-all_samplesself-trial_infos-actor_names-actor_classes-actor_implementations-fields"},(0,i.kt)("inlineCode",{parentName:"h3"},"async all_samples(self, trial_infos, actor_names=[], actor_classes=[], actor_implementations=[], fields=[])")),(0,i.kt)("p",null,"Generator method to iterate through the samples from trials in the Datastore.\nThe samples can be historical (if the trial has ended) or real-time (if a trial is ongoing)."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"trial_infos"),": ",(0,i.kt)("em",{parentName:"p"},"list","[DatastoreTrialInfo]")," - Trials to request samples from. These should be the info instances received from ",(0,i.kt)("inlineCode",{parentName:"p"},"get_trials"),".")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"actor_names"),": ",(0,i.kt)("em",{parentName:"p"},"list","[str]")," - Names of actors to consider including in the samples. If empty, all actors will be considered.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes"),": ",(0,i.kt)("em",{parentName:"p"},"list","[str]")," - Actor classes to match for an actor to be included in the samples. If empty, actors in any class will be considered.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"actor_implementations"),": ",(0,i.kt)("em",{parentName:"p"},"list","[str]")," - Actor implementations to match for an actor to be included in the samples. If empty, actors with any implementation will be considered.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"fields"),": ",(0,i.kt)("em",{parentName:"p"},"list","[cogment.DatastoreFields]")," - Data fields to be filled in ",(0,i.kt)("inlineCode",{parentName:"p"},"DatastoreActorData")," (otherwise left empty). If the list is empty, all data will be filled in."))),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(DatastoreSample instance)")," - A generator for the samples from the Datastore."),(0,i.kt)("h2",{id:"class-modelregistry"},"class ModelRegistry"),(0,i.kt)("p",null,"Class containing data and methods to store and retrieve models from a ModelRegistry."),(0,i.kt)("h3",{id:"has_specsself-3"},(0,i.kt)("inlineCode",{parentName:"h3"},"has_specs(self)")),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - Always True since the ModelRegistry does not rely on trial specs."),(0,i.kt)("h3",{id:"async-store_modelself-name-model-iteration_propertiesnone"},(0,i.kt)("inlineCode",{parentName:"h3"},"async store_model(self, name, model, iteration_properties=None)")),(0,i.kt)("p",null,"Method to publish and save the model to storage in the Model Registry.\nWhen stored, a model name will be available until explicitly deleted."),(0,i.kt)("p",null,"If the model name already exists, the model will be saved as a new iteration of the existing model name.\nIteration numbers start at 1 (the first model sent to the Model Registry) and increase by 1 for every new iteration.\nBut not all iterations may be in storage (see ",(0,i.kt)("a",{parentName:"p",href:"#async-publish_modelself-name-model-iteration_propertiesnone"},"publish_model"),")."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The model name to be stored."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model"),": ",(0,i.kt)("em",{parentName:"li"},"bytes")," - The data representing the model."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"iteration_properties"),": ",(0,i.kt)("em",{parentName:"li"},"dict{str:str}")," - Custom information that is specific to this iteration and will be stored with it.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"ModelIterationInfo instance")," - The information about the newly stored model iteration."),(0,i.kt)("h3",{id:"async-publish_modelself-name-model-iteration_propertiesnone"},(0,i.kt)("inlineCode",{parentName:"h3"},"async publish_model(self, name, model, iteration_properties=None)")),(0,i.kt)("p",null,"Method to send a model to the Model Registry for the sole purpose of being published to other services.\nThis model will be transient and not saved in storage.\nIt will stay available in the Model Registry for a time, dependent on the Model Registry ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cli/model-registry#cache_max_items"},"max_cache_item")," option, then be deleted automatically."),(0,i.kt)("p",null,"If the model name already exists, the model will be seen as a new iteration of the existing model name.\nIteration numbers start at 1 (the first model sent to the Model Registry) and increase by 1 for every new iteration."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The model name to be published."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model"),": ",(0,i.kt)("em",{parentName:"li"},"bytes")," - The data representing the model."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"iteration_properties"),": ",(0,i.kt)("em",{parentName:"li"},"dict{str:str}")," - Custom information that is specific to this iteration.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"ModelIterationInfo instance")," - The information about the newly published model iteration."),(0,i.kt)("h3",{id:"async-retrieve_modelself-name-iteration-1"},(0,i.kt)("inlineCode",{parentName:"h3"},"async retrieve_model(self, name, iteration=-1)")),(0,i.kt)("p",null,"Method to retrieve the data of a specific model iteration from the ModelRegistry.\nTransient iterations may become unavailable at any time."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The model name to be retrieved."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"iteration"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - The number of the model iteration to be retrieved. If -1, then the latest (most recent) iteration will be retrieved.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bytes")," - The model data representing the specific iteration requested. ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if the iteration is not available (if ",(0,i.kt)("inlineCode",{parentName:"p"},"iteration")," = -1, it means the model has no iteration available)."),(0,i.kt)("h3",{id:"async-remove_modelself-name"},(0,i.kt)("inlineCode",{parentName:"h3"},"async remove_model(self, name)")),(0,i.kt)("p",null,"Method to delete a model (and all its stored and transient iterations) from the Model Registry."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The model name to be removed from the Model Registry.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"async-list_modelsself"},(0,i.kt)("inlineCode",{parentName:"h3"},"async list_models(self)")),(0,i.kt)("p",null,"Method to retrieve the list of all models stored in the Model Registry."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"list","[ModelInfo instance]")," - List of model info for all models stored in the Model Registry."),(0,i.kt)("h3",{id:"async-list_iterationsself-model_name"},(0,i.kt)("inlineCode",{parentName:"h3"},"async list_iterations(self, model_name)")),(0,i.kt)("p",null,"Method to retrieve the list of all available iterations for a model in the Model Registry."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The model name.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"list","[ModelIterationInfo instance]")," - List of iteration info for all available iterations of the model. This includes all stored iterations and all currently available transient iterations."),(0,i.kt)("h3",{id:"async-get_iteration_infoself-name-iteration"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_iteration_info(self, name, iteration)")),(0,i.kt)("p",null,"Method to retrieve information about a specific model iteration."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The model name."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"iteration"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - The iteration number. If -1, then information about the latest (most recent) iteration will be retrieved.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"ModelIterationInfo instance")," - The information about the model iteration. ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if the iteration is not available (if ",(0,i.kt)("inlineCode",{parentName:"p"},"iteration")," = -1, it means the model has no iteration available)."),(0,i.kt)("h3",{id:"async-update_model_infoself-name-properties"},(0,i.kt)("inlineCode",{parentName:"h3"},"async update_model_info(self, name, properties)")),(0,i.kt)("p",null,"Method to store or update properties associated with the model name (not specific to any iteration)."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The model name."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"properties"),": ",(0,i.kt)("em",{parentName:"li"},"dict{str:str}")," - Custom information that will be stored with the model name, independently of any iteration. If the model name already has properties, they will be overwritten.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"async-get_model_infoself-name"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_model_info(self, name)")),(0,i.kt)("p",null,"Method to retrieve information associated with the model name (not specific to any iteration)."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The model name.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"ModelInfo instance")," - Info associated with the model name, independent of any iteration. ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if the model is not found in the Model Registry."),(0,i.kt)("h3",{id:"async-iteration_updatesself-model_name"},(0,i.kt)("inlineCode",{parentName:"h3"},"async iteration_updates(self, model_name)")),(0,i.kt)("p",null,"Generator method to receive the information about the model iterations as they are stored or published."),(0,i.kt)("p",null,"Information about the latest iteration will be returned immediately, then the function will wait for new iterations to be stored or published to the Model Registry and return their information when they are made available."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The model name for which to receive iteration information.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(ModelIterationInfo instance)")," - A generator for the model iteration information."),(0,i.kt)("h3",{id:"async-track_latest_modelself-name-deserialize_funcnone-initial_wait0"},(0,i.kt)("inlineCode",{parentName:"h3"},"async track_latest_model(self, name, deserialize_func=None, initial_wait=0)")),(0,i.kt)("p",null,"Method to start automatically tracking a specific model and make the latest iteration available seamlessly."),(0,i.kt)("p",null,"A background task will be started (running ",(0,i.kt)("inlineCode",{parentName:"p"},"iteration_updates"),") to track the latest model iteration and retrieve it automatically.\nMultiple calls for the same model will not duplicate the background task and will point to the same underlying model.\nThus if the model is changed by a caller, all callers will see the changes (unless and until a new model is retrieved from the Model Registry)."),(0,i.kt)("p",null,"Due to background processing and caching, this method is not thread safe.\nIt is best used for simple cases.\nMore complicated use-cases should explicitly use ",(0,i.kt)("inlineCode",{parentName:"p"},"iteration_updates"),"."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The model name to track."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"deserialize_func"),": ",(0,i.kt)("em",{parentName:"li"},"func(bytes)")," - Callback function to deserialize the model iteration from a ",(0,i.kt)("inlineCode",{parentName:"li"},"bytes")," string to a user defined object instance. This is called asynchronously in the background to deserialize the raw bytes from the Model Registry, and the user object is made available in ",(0,i.kt)("inlineCode",{parentName:"li"},"LatestModel"),". If not provided, the raw ",(0,i.kt)("inlineCode",{parentName:"li"},"bytes")," string from the Model Registry is made available in ",(0,i.kt)("inlineCode",{parentName:"li"},"LatestModel")," instead of a user object."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"initial_wait"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - Number of seconds to wait for the model name to be available in the Model Registry. The method will return once the model name is available, or raise an exception if the model name was not available within the given time. The model name being available only means that it is registered in the Model Registry, not necessarily that it has iterations; i.e. the background task may wait more for iterations to be available.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"LatestModel instance")," - An instance of the ",(0,i.kt)("inlineCode",{parentName:"p"},"LatestModel")," class."),(0,i.kt)("h2",{id:"class-session"},"class Session"),(0,i.kt)("p",null,"Abstract class that manages aspects of a trial. Contains data and methods common to all sessions ."),(0,i.kt)("h3",{id:"get_trial_idself"},(0,i.kt)("inlineCode",{parentName:"h3"},"get_trial_id(self)")),(0,i.kt)("p",null,"Method to get the UUID of the trial managed by this session."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"str")," - UUID of the trial."),(0,i.kt)("h3",{id:"get_tick_idself"},(0,i.kt)("inlineCode",{parentName:"h3"},"get_tick_id(self)")),(0,i.kt)("p",null,"Method to get the current tick id of the trial (i.e. time step)."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"int")," - The current tick id."),(0,i.kt)("h3",{id:"is_trial_overself"},(0,i.kt)("inlineCode",{parentName:"h3"},"is_trial_over(self)")),(0,i.kt)("p",null,"Method to inquire if the current trial has ended."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the trial has ended, false otherwise."),(0,i.kt)("h3",{id:"sending_doneself"},(0,i.kt)("inlineCode",{parentName:"h3"},"sending_done(self)")),(0,i.kt)("p",null,"Method to notify the Orchestrator that all data for the trial, from this session, has been sent. This can be called only when the session is ending. When starting the session (see ",(0,i.kt)("inlineCode",{parentName:"p"},"EnvironmentSession")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"ActorSession"),"), if the ",(0,i.kt)("inlineCode",{parentName:"p"},"auto_done_sending")," parameter is True, this method should not be called, and if the parameter is False, it MUST be called to end the trial properly."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"add_rewardself-value-confidence-to-tick_id-1-user_datanone"},(0,i.kt)("inlineCode",{parentName:"h3"},"add_reward(self, value, confidence, to, tick_id=-1, user_data=None)")),(0,i.kt)("p",null,"Method to send a reward to one or more actors."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"value"),": ",(0,i.kt)("em",{parentName:"li"},"float")," - Value of the reward. This will be aggregated with other rewards for the same target actor."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"confidence"),": ",(0,i.kt)("em",{parentName:"li"},"float")," - Weight of this reward value in determining the final aggregated reward. Should be > 0."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"to"),": ",(0,i.kt)("em",{parentName:"li"},"list","[str]"),' - Target(s) of reward. A list value could be the name of an actor in the trial. Or it could represent a set of actors; A set of actors can be represented with the wildcard character "',(0,i.kt)("inlineCode",{parentName:"li"},"*"),'" for all actors (of all classes), or "',(0,i.kt)("inlineCode",{parentName:"li"},"actor_class.*"),'" for all actors of a specific class (the ',(0,i.kt)("inlineCode",{parentName:"li"},"actor_class")," is the name of the class as specified in the spec file)."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"tick_id"),": ",(0,i.kt)("em",{parentName:"li"},"int"),' - The tick id (time step) for which the reward should be applied. If "-1", then the reward applies to the current time step.'),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"user_data"),": ",(0,i.kt)("em",{parentName:"li"},"protobuf class instance")," - Extra user data to be sent with the reward. The class can be any protobuf class. It is the responsibility of the receiving actor to manage the class received (packed in a ",(0,i.kt)("inlineCode",{parentName:"li"},"google.protobuf.Any"),").")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h2",{id:"class-environmentsessionsession"},"class EnvironmentSession(Session)"),(0,i.kt)("p",null,"Class based on ",(0,i.kt)("inlineCode",{parentName:"p"},"Session"),", containing session data and methods necessary to run an environment for a trial. An instance of this class is passed as an argument to the environment callback function registered with ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.Context.register_environment"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"impl_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the implementation running this environment."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"config"),": ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - User configuration received for this environment instance. Can be ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if no configuration was provided. The type of the protobuf class is specified in the spec file in the section ",(0,i.kt)("inlineCode",{parentName:"p"},"environment:config_type"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the environment this instance represents."),(0,i.kt)("h3",{id:"startself-observations--none-auto_done_sendingtrue"},(0,i.kt)("inlineCode",{parentName:"h3"},"start(self, observations = None, auto_done_sending=True)")),(0,i.kt)("p",null,"Method to report that the environment is starting to run the trial. The method should be called before any other method in the session."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"observations"),": ",(0,i.kt)("em",{parentName:"p"},"list","[tuple(str, protobuf class instance)]")," - The initial observations from which the environment is starting the trial. This is the same as the parameter for ",(0,i.kt)("inlineCode",{parentName:"p"},"self.produce_observations"),". If not provided, then the first observation sent with ",(0,i.kt)("inlineCode",{parentName:"p"},"produce_observation")," will be used to initiate the trial (note that no actions will be received until the first observation is sent).")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"auto_done_sending"),": ",(0,i.kt)("em",{parentName:"p"},"bool")," - Controls when to notify the Orchestrator that all data has been sent. If True, the session will automatically send the notification after ",(0,i.kt)("inlineCode",{parentName:"p"},"end")," is called. If False, the user MUST call ",(0,i.kt)("inlineCode",{parentName:"p"},"sending_done")," (after ",(0,i.kt)("inlineCode",{parentName:"p"},"end"),") to end the trial properly."))),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"async-all_eventsself"},(0,i.kt)("inlineCode",{parentName:"h3"},"async all_events(self)")),(0,i.kt)("p",null,"Generator method to iterate over all events (actions, messages) as they are received. This will block and wait for an event.\nWhen this generator exits, the callback function (registered with ",(0,i.kt)("inlineCode",{parentName:"p"},"register_environment"),') should return to end the trial cleanly.\nThe generator will exit for various reasons indicating the termination of the trial, a loss of communication with the orchestrator, or if the generator is sent "False" (in which case the callback function does not necessarily need to exit).'),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(RecvEvent instance)")," - A generator for the events that arrive. The ",(0,i.kt)("inlineCode",{parentName:"p"},"RecvEvent")," instances received from this generator will only contain actions or messages; no observations nor rewards. When receiving actions in the event, the ",(0,i.kt)("inlineCode",{parentName:"p"},"self.produce_observation"),' method is normally used to "reply" (or ',(0,i.kt)("inlineCode",{parentName:"p"},"self.end")," to end the trial)."),(0,i.kt)("h3",{id:"produce_observationsself-observations"},(0,i.kt)("inlineCode",{parentName:"h3"},"produce_observations(self, observations)")),(0,i.kt)("p",null,"Method to send observations to actors. If called after receiving an event of type ",(0,i.kt)("inlineCode",{parentName:"p"},"EventType.ENDING"),", the observation will be considered the final observation (equivalent to calling ",(0,i.kt)("inlineCode",{parentName:"p"},"end()"),")."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"observations"),": ",(0,i.kt)("em",{parentName:"li"},"list","[tuple(str, protobuf class instance)]"),' - The observations to send to actors. The string in the tuple is the name of the destination actor (or "',"*",'" for all actors). The name of the actors can be found in trial parameters under ',(0,i.kt)("inlineCode",{parentName:"li"},"trial_params:actors:name"),". The protobuf class is the Observation Space for that actor, found in the spec file in the corresponding section ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes:observation:space"),".")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"endself-final_observations"},(0,i.kt)("inlineCode",{parentName:"h3"},"end(self, final_observations)")),(0,i.kt)("p",null,"Method to report the end of the environment. This will effectively end the trial. Message events can still arrive after this call."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"final_observations"),": ",(0,i.kt)("em",{parentName:"li"},"list","[tuple(str, protobuf class instance)]")," - The final observations to send to the actors. This is the same as the parameter for ",(0,i.kt)("inlineCode",{parentName:"li"},"self.produce_observations"),".")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"get_active_actorsself"},(0,i.kt)("inlineCode",{parentName:"h3"},"get_active_actors(self)")),(0,i.kt)("p",null,"Method to get the list of active actors in the trial."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"list","[ActorInfo instance]")," - List of active actors and classes involved in this trial."),(0,i.kt)("h3",{id:"send_messageself-payload-to"},(0,i.kt)("inlineCode",{parentName:"h3"},"send_message(self, payload, to)")),(0,i.kt)("p",null,"Method to send a message related to the current time step (tick id)."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"payload"),": ",(0,i.kt)("em",{parentName:"li"},"protobuf class instance")," - The message data to be sent. The class can be any protobuf class. It is the responsibility of the receiving environment to manage the class received (packed in a ",(0,i.kt)("inlineCode",{parentName:"li"},"google.protobuf.Any"),")."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"to"),": ",(0,i.kt)("em",{parentName:"li"},"list","[str]"),' - Targets of feedback. Each value could be the name of an actor in the trial. Or it could represent a set of actors (with wildcards); A set of actors can be represented with the wildcard character "',(0,i.kt)("inlineCode",{parentName:"li"},"*"),'" for all actors (of all classes), or "',(0,i.kt)("inlineCode",{parentName:"li"},"actor_class.*"),'" for all actors of a specific class (the ',(0,i.kt)("inlineCode",{parentName:"li"},"actor_class")," must match one of the classes listed in the trial parameters). Note that the wildcard does not include the environment.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h2",{id:"class-actorsessionsession"},"class ActorSession(Session)"),(0,i.kt)("p",null,"Class based on ",(0,i.kt)("inlineCode",{parentName:"p"},"Session"),", containing session/trial data and methods necessary to run an actor for a trial. An instance of this class is passed as argument to the actor callback function registered with ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.Context.register_actor"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"actor_class"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the class of actor this instance represents. Specified in the spec file as ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes:name"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"impl_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the implementation of the actor represented by this instance."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"config"),": ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - User configuration received for this actor instance. Can be ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," is no configuration was provided. The type of the protobuf class is specified in the spec file in the section ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes:config_type"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the actor this instance represents."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"env_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the environment running the trial this actor is participating in (used to send messages to the environment)."),(0,i.kt)("h3",{id:"startself-auto_done_sendingtrue"},(0,i.kt)("inlineCode",{parentName:"h3"},"start(self, auto_done_sending=True)")),(0,i.kt)("p",null,"Method to start the actor. This method should be called before any other method in the session."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"auto_done_sending"),": ",(0,i.kt)("em",{parentName:"li"},"bool")," - Controls when to notify the Orchestrator that all data has been sent. If True, the session will automatically send the notification after receiving the last observation. If False, the user MUST call ",(0,i.kt)("inlineCode",{parentName:"li"},"sending_done")," to end the trial properly.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"async-all_eventsself-1"},(0,i.kt)("inlineCode",{parentName:"h3"},"async all_events(self)")),(0,i.kt)("p",null,"Generator method to iterate over all events (observations, rewards, messages) as they are received. This will block and wait for an event.\nWhen this generator exits, the callback function (registered with ",(0,i.kt)("inlineCode",{parentName:"p"},"register_actor"),') should return to end the trial cleanly.\nThe generator will exit for various reasons indicating the end of the trial, a loss of communication with the orchestrator, or if the generator is sent "False".'),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(RecvEvent instance)")," - A generator for the events that arrive. The ",(0,i.kt)("inlineCode",{parentName:"p"},"RecvEvent")," instances received from this generator will not contain actions. When receiving an observation in the event, the ",(0,i.kt)("inlineCode",{parentName:"p"},"self.do_action"),' method is normally used to "reply" (if the event type is ',(0,i.kt)("inlineCode",{parentName:"p"},"EventType.ACTIVE"),")."),(0,i.kt)("h3",{id:"do_actionself-action"},(0,i.kt)("inlineCode",{parentName:"h3"},"do_action(self, action)")),(0,i.kt)("p",null,"Method to send actions to the environment."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"action"),": ",(0,i.kt)("em",{parentName:"li"},"protobuf class instance")," - An instance of the action space class specified in the corresponding section ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes:action:space")," of the spec file. If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", then no action space is sent (empty content) and the environment will receive a default initialized action space of the appropriate type.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"send_messageself-payload-to-1"},(0,i.kt)("inlineCode",{parentName:"h3"},"send_message(self, payload, to)")),(0,i.kt)("p",null,"Method to send a message related to the current time step (tick id)."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"payload"),": ",(0,i.kt)("em",{parentName:"li"},"protobuf class instance")," - The message data to be sent. The class can be any protobuf class. It is the responsibility of the receiving actor to manage the class received (packed in a ",(0,i.kt)("inlineCode",{parentName:"li"},"google.protobuf.Any"),")."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"to"),": ",(0,i.kt)("em",{parentName:"li"},"list","[str]")," - Targets of feedback. Each value could be the name of an actor in the trial, or the name of the environment (from ",(0,i.kt)("inlineCode",{parentName:"li"},"self.env_name"),'). Or it could represent a set of actors (with wildcards); A set of actors can be represented with the wildcard character "',(0,i.kt)("inlineCode",{parentName:"li"},"*"),'" for all actors (of all classes), or "',(0,i.kt)("inlineCode",{parentName:"li"},"actor_class.*"),'" for all actors of a specific class (the ',(0,i.kt)("inlineCode",{parentName:"li"},"actor_class")," must match one of the classes listed in the trial parameters). Note that the wildcard does not include the environment.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h2",{id:"class-prehooksession"},"class PrehookSession"),(0,i.kt)("p",null,"Class containing trial parameters to define the specifics of a trial. An instance of this class is passed as argument to the pre-trial hook callback function registered with ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.Context.register_pre_trial_hook"),". The first pre-trial hook to be called will receive the default parameters set in the Orchestrator, the following hooks will receive the parameters set by the preceding hooks."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trial_parameters"),": ",(0,i.kt)("em",{parentName:"p"},"TrialParameters instance")," - Parameters for the trial. Initially received with parameters from the previous hook, or default parameters from the Orchestrator if it is the first hook. Changes to this instance will be forwarded to the next hook, or to the Orchestrator if it is the last hook."),(0,i.kt)("h3",{id:"get_trial_idself-1"},(0,i.kt)("inlineCode",{parentName:"h3"},"get_trial_id(self)")),(0,i.kt)("p",null,"Method to retrieve the ID of the trial."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"str")," - ID of the trial."),(0,i.kt)("h3",{id:"get_user_idself"},(0,i.kt)("inlineCode",{parentName:"h3"},"get_user_id(self)")),(0,i.kt)("p",null,"Method to retrieve the identifier of the user that started the trial."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"str")," - Identifier of the user that started the trial."),(0,i.kt)("h2",{id:"class-datalogsession"},"class DatalogSession"),(0,i.kt)("p",null,"Class containing session data and methods necessary to manage the logging of trial run data. An instance of this class is passed as an argument to the datalog callback function registered with ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.Context.register_datalog"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trial_id"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - UUID of the trial managed by this instance."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"user_id"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Identifier of the user that started the trial."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trial_parameters"),": ",(0,i.kt)("em",{parentName:"p"},"cogment.TrialParameters instance")," - Parameters of the trial."),(0,i.kt)("h3",{id:"startself"},(0,i.kt)("inlineCode",{parentName:"h3"},"start(self)")),(0,i.kt)("p",null,"Method to start receiving samples."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"all_samplesself"},(0,i.kt)("inlineCode",{parentName:"h3"},"all_samples(self)")),(0,i.kt)("p",null,"Generator method to iterate over all samples as they are received (waiting for each in turn)."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(cogment.LogSample instance)")," - A generator for the samples received."),(0,i.kt)("h2",{id:"class-cogmentendpoint"},"class cogment.Endpoint"),(0,i.kt)("p",null,"Class enclosing the details for connecting to an Orchestrator."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"url"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - The URL where to connect to the Orchestrator."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"private_key"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - To use TLS for the connection, this must be set to the PEM-encoded private key."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"root_certificates"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - If using TLS for the connection (i.e. the ",(0,i.kt)("inlineCode",{parentName:"p"},"private_key")," is not ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),"), this can be set to the PEM-encoded root certificates. If not set and using TLS for the connection, the root certificates will be fetched from the system default location."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"certificate_chain"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - If using TLS for the connection, this can be set to the PEM-encoded certificate chain."),(0,i.kt)("h3",{id:"__init__self-urlcogmentdiscover"},(0,i.kt)("inlineCode",{parentName:"h3"},'__init__(self, url="cogment://discover")')),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"url"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The URL where to connect to the Orchestrator. By default this is a discovery URL that uses the Directory to find the corresponding endpoint.")),(0,i.kt)("h2",{id:"class-cogmentservedendpoint"},"class cogment.ServedEndpoint"),(0,i.kt)("p",null,"Class enclosing the details for connection from an Orchestrator."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"port"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The TCP/IP port where the service will be awaiting the Orchestrator connection."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"private_key_certificate_chain_pairs"),": ",(0,i.kt)("em",{parentName:"p"},"list","[tuple(str, str)]")," - To use TLS for incoming connections, this must be set to a list of tuples of the form (PEM-encoded private key, PEM-encoded certificate chain)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"root_certificates"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - If using TLS for the connection (i.e. ",(0,i.kt)("inlineCode",{parentName:"p"},"private_key_certificate_chain_pairs")," is not ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),"), this should be set to PEM-encoded Orchestrator root certificates that the server will use to verify Orchestrator authentication."),(0,i.kt)("h3",{id:"__init__self-port0"},(0,i.kt)("inlineCode",{parentName:"h3"},"__init__(self, port=0)")),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"port"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - The TCP/IP port where the service will be awaiting the Orchestrator connection. If 0, the system will choose a free port.")),(0,i.kt)("h2",{id:"class-cogmenttrialstateenumenum"},"class cogment.TrialState(enum.Enum)"),(0,i.kt)("p",null,"Enum representing the various states of trials."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"UNKNOWN: Should not be used."),(0,i.kt)("li",{parentName:"ul"},"INITIALIZING: The trial is in the process of starting."),(0,i.kt)("li",{parentName:"ul"},"PENDING: The trial is waiting for its final parameters, all the components to be ready, and the first observation."),(0,i.kt)("li",{parentName:"ul"},"RUNNING: The trial is running."),(0,i.kt)("li",{parentName:"ul"},"TERMINATING: The trial is in the process of ending (either a request to end has been received or the last observation has been received)."),(0,i.kt)("li",{parentName:"ul"},"ENDED: The trial has ended. Only a set number of ended trials will be kept (configured in the Orchestrator).")),(0,i.kt)("p",null,"For further information on trial lifetime, check the ",(0,i.kt)("a",{parentName:"p",href:"/docs/guide/development-guide#trial-lifetime"},"dedicated section"),"."),(0,i.kt)("h2",{id:"class-trialinfo"},"class TrialInfo"),(0,i.kt)("p",null,"Class enclosing the details of a trial."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trial_id"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - The trial ID to which the details pertain."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"properties"),": ",(0,i.kt)("em",{parentName:"p"},"dict{str:str}")," - User defined properties provided on trial start (see ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#trial-parameters"},"Trial Parameters"),")."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"state"),": ",(0,i.kt)("em",{parentName:"p"},"cogment.TrialState")," - The current state of the trial."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"env_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - The name of the environment running the trial."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"tick_id"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The time step that the information relates to. Only provided from a call to ",(0,i.kt)("inlineCode",{parentName:"p"},"get_trial_info"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"duration"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The time (in nanoseconds) that the trial has run. Only provided from a call to ",(0,i.kt)("inlineCode",{parentName:"p"},"get_trial_info"),"."),(0,i.kt)("h2",{id:"class-actorinfo"},"class ActorInfo"),(0,i.kt)("p",null,"Class enclosing the details of an actor."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"actor_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - The name of the actor."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"actor_class_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - The name of the actor's class (as defined in the spec file)."),(0,i.kt)("h2",{id:"class-recvevent"},"class RecvEvent"),(0,i.kt)("p",null,"Class representing a received event (for environments and actors). It can contain any combination of data according to the receiver needs, or even be empty, but it will always have a type."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"type"),": ",(0,i.kt)("em",{parentName:"p"},"Enum EventType")," - Type of event the enclosed data represents."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"observation"),": ",(0,i.kt)("em",{parentName:"p"},"RecvObservation instance")," - Observation data. This can only be received by actors. ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if not present."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"actions"),": ",(0,i.kt)("em",{parentName:"p"},"list","[RecvAction instance]")," - Action data from actors. This can only be received by the environment. The list is empty if not present."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"rewards"),": ",(0,i.kt)("em",{parentName:"p"},"list","[RecvReward instance]")," - Reward values and data. This can only be received by actors. The list is empty if not present."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"messages"),": ",(0,i.kt)("em",{parentName:"p"},"list","[RecvMessage instance]")," - Message data. The list is empty if not present."),(0,i.kt)("h3",{id:"class-cogmenteventtypeenumenum"},"class cogment.EventType(enum.Enum)"),(0,i.kt)("p",null,"Enum representing the type of an event."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"EventType.NONE"),": Empty event. This kind of event should never be received.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"EventType.ACTIVE"),": Normal event from an active trial. Most events will be of this type.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"EventType.ENDING"),": Events from a trial in the process of ending. Events of this type can contain the same data as ",(0,i.kt)("inlineCode",{parentName:"p"},"ACTIVE")," events. For the environment, the data received in ",(0,i.kt)("inlineCode",{parentName:"p"},"ENDING")," events are the last actions/messages, and the trial is awaiting a final observation. For the actors, the data received in ",(0,i.kt)("inlineCode",{parentName:"p"},"ENDING")," events are the final observations/rewards/messages, and no action can/need to be sent in response.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"EventType.FINAL"),": Final event for the trial. This does not contain data. The event loop will exit after this event is delivered. This event can be ignored if nothing needs to be done before exiting the loop."))),(0,i.kt)("p",null,"For further information on trial lifetime, check the ",(0,i.kt)("a",{parentName:"p",href:"/docs/guide/development-guide#trial-lifetime"},"dedicated section"),"."),(0,i.kt)("h2",{id:"class-recvobservation"},"class RecvObservation"),(0,i.kt)("p",null,"Class containing the details of an observation for an actor."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"tick_id"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The time step that the observation relates to."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"timestamp"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - Unix style Epoch timestamp in nanoseconds (time since 00:00:00 UTC Jan 1, 1970). Undefined if actor status is ",(0,i.kt)("inlineCode",{parentName:"p"},"ActorStatus.UNAVAILABLE"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"observation"),": ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - Observation received from the environment. The class of the observation is defined as observation space for the actor class. This is specified in section ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes:observation:space")," in the spec file for the appropriate/receiving actor class. Undefined if actor status is ",(0,i.kt)("inlineCode",{parentName:"p"},"ActorStatus.UNAVAILABLE"),"."),(0,i.kt)("h2",{id:"class-cogmentactorstatusenumenum"},"class cogment.ActorStatus(enum.Enum)"),(0,i.kt)("p",null,"Enum representing the status of actors."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"ActorStatus.UNKNOWN"),": This status should never be received.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"ActorStatus.ACTIVE"),": The actor is active and responding to observations normally.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"ActorStatus.UNAVAILABLE"),": The (optional) actor is unavailable (typically because of a time out).")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"ActorStatus.DEFAULT"),': The (optional) actor is acting by default (responding with the default action defined in the actor parameters). The environment will not see this kind of actor because a "default" actor looks active to the environment.'))),(0,i.kt)("h2",{id:"class-recvaction"},"class RecvAction"),(0,i.kt)("p",null,"Class containing the details of an action from an actor."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"tick_id"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The time step that the action relates to."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"actor_index"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - Index of the actor in the list of all trial actors (returned by ",(0,i.kt)("inlineCode",{parentName:"p"},"Session.get_active_actors"),")."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"status"),": ",(0,i.kt)("em",{parentName:"p"},"ActorStatus instance")," - Indicate the status of the actor."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"timestamp"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - Unix style Epoch timestamp in nanoseconds (time since 00:00:00 UTC Jan 1, 1970) for the action. Undefined if ",(0,i.kt)("inlineCode",{parentName:"p"},"status")," is not ",(0,i.kt)("inlineCode",{parentName:"p"},"ActorStatus.ACTIVE"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"action"),": ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - Action from the actor which has index ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_index")," in the trial. The class of the action is defined as action space for the specific actor in the section ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes:action:space")," in the spec file for the appropriate actor class. Undefined if ",(0,i.kt)("inlineCode",{parentName:"p"},"status")," is not ",(0,i.kt)("inlineCode",{parentName:"p"},"ActorStatus.ACTIVE"),"."),(0,i.kt)("h2",{id:"class-recvmessage"},"class RecvMessage"),(0,i.kt)("p",null,"Class containing a message."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"tick_id"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The time step that the message relates to."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"receiver_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the receiver for the message (the name of an actor, or wildcard string)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"sender_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the sender of the message (the name of an actor, or the environment)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"payload"),": ",(0,i.kt)("em",{parentName:"p"},"google.protobuf.Any instance")," - Data for a received message. The class enclosed in ",(0,i.kt)("inlineCode",{parentName:"p"},"google.protobuf.Any")," is of the type set by the sender; It is the responsibility of the receiver to manage the data received (i.e. determine the type and unpack the data)."),(0,i.kt)("h2",{id:"class-recvreward"},"class RecvReward"),(0,i.kt)("p",null,"Class containing the details of a received reward."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"tick_id"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The tick id (time step) for which the reward should be applied."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"receiver_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the receiver for the reward (the name of an actor, or wildcard string)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"value"),": ",(0,i.kt)("em",{parentName:"p"},"float")," - Value of the reward (aggregated from the sources)"),(0,i.kt)("h3",{id:"get_nb_sourcesself"},(0,i.kt)("inlineCode",{parentName:"h3"},"get_nb_sources(self)")),(0,i.kt)("p",null,"Return the number of source rewards this reward is based upon."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"int")," - Number of sources."),(0,i.kt)("h3",{id:"all_sourcesself"},(0,i.kt)("inlineCode",{parentName:"h3"},"all_sources(self)")),(0,i.kt)("p",null,"Generator method to iterate over all sources making up this reward."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(RecvRewardSource instance)")," - A generator for the sources in the reward (simple rewards that make up this final/aggregate reward)."),(0,i.kt)("h2",{id:"class-recvrewardsource"},"class RecvRewardSource"),(0,i.kt)("p",null,"Class containing the details of a received single source reward."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"value"),": ",(0,i.kt)("em",{parentName:"p"},"float")," - Value of the reward from the sender."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"confidence"),": ",(0,i.kt)("em",{parentName:"p"},"float")," - Confidence level of this reward value."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"sender_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the sender of this reward (the name of an actor, or the environment)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"user_data"),": ",(0,i.kt)("em",{parentName:"p"},"google.protobuf.Any instance")," - Data for a user-specific reward format. Can be ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if no specific data was provided. The class enclosed in ",(0,i.kt)("inlineCode",{parentName:"p"},"google.protobuf.Any")," is of the type set by the sender; it is the responsibility of the receiver to manage the data received (i.e. determine the type and unpack the data)."),(0,i.kt)("h2",{id:"class-cogmenttrialparameters"},"class cogment.TrialParameters"),(0,i.kt)("p",null,"Class containing the parameters of the trial (see ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#trial-parameters"},"Trial Parameters"),")."),(0,i.kt)("p",null,"Any attribute can be set to ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," to reset it to its default.\nSome attributes (",(0,i.kt)("inlineCode",{parentName:"p"},"config")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"environment_config"),") are immutable: changes to the instance received will not be reflected in ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialParameters"),", the attribute must be set with a new instance to make changes. These attributes can also return ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if not set."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"config"),": ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - The type is specified in the spec file under the section ",(0,i.kt)("inlineCode",{parentName:"p"},"trial:config_type"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"config_serialized"),": ",(0,i.kt)("em",{parentName:"p"},"bytes")," - Config in serialized (class independent) form. This can be accessed even without specs (see ",(0,i.kt)("inlineCode",{parentName:"p"},"has_specs()"),")."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"properties"),": ",(0,i.kt)("em",{parentName:"p"},"dict{str:str}")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"max_steps"),": ",(0,i.kt)("em",{parentName:"p"},"int")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"max_inactivity"),": ",(0,i.kt)("em",{parentName:"p"},"int")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"nb_buffered_ticks"),": ",(0,i.kt)("em",{parentName:"p"},"int")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"datalog_endpoint"),": ",(0,i.kt)("em",{parentName:"p"},"str")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"datalog_exclude_fields"),": ",(0,i.kt)("em",{parentName:"p"},"tuple(str)")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"environment_config"),": ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - The type is specified in the spec file under the section ",(0,i.kt)("inlineCode",{parentName:"p"},"environment:config_type"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"environment_serialized"),": ",(0,i.kt)("em",{parentName:"p"},"bytes")," - Config in serialized (class independent) form. This can be accessed even without specs (see ",(0,i.kt)("inlineCode",{parentName:"p"},"has_specs()"),")."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"environment_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"environment_endpoint"),": ",(0,i.kt)("em",{parentName:"p"},"str")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"environment_implementation"),": ",(0,i.kt)("em",{parentName:"p"},"str")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"actors"),": ",(0,i.kt)("em",{parentName:"p"},"list(cogment.ActorParameters)")," - The parameters for the actors. This is a list style object that implements the basic Python ",(0,i.kt)("inlineCode",{parentName:"p"},"list"),' functionality. If the actors\' data is not being edited (e.g. read only parameters), the "index" of this list can be the name of an actor.'),(0,i.kt)("h3",{id:"__init__self-cog_settings-kwargs"},(0,i.kt)("inlineCode",{parentName:"h3"},"__init__(self, cog_settings, **kwargs)")),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"cog_settings"),": ",(0,i.kt)("em",{parentName:"li"},"module")," - Specs module associated with trials that relate to these parameters (see ",(0,i.kt)("a",{parentName:"li",href:"#compiling-the-spec-file-into-cog_settingspy"},"cog_settings generation"),")."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"**kwargs"),": Accepts any of the attributes as keyword to set their value on construction. E.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'TrialParameters(settings, max_steps=1000, environment_name="level")'))),(0,i.kt)("h3",{id:"has_specsself-4"},(0,i.kt)("inlineCode",{parentName:"h3"},"has_specs(self)")),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the specs are known by this instance. False otherwise. Specs will be known if the top level Cogment Context has specs or if a non ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," argument ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings")," was provided."),(0,i.kt)("h3",{id:"get_serialization_typeself"},(0,i.kt)("inlineCode",{parentName:"h3"},"get_serialization_type(self)")),(0,i.kt)("p",null,"Return the type of serial data produced by ",(0,i.kt)("inlineCode",{parentName:"p"},"serialize")," and accepted by ",(0,i.kt)("inlineCode",{parentName:"p"},"deserialize"),". The type represents an ID dependent on ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/grpc#trialparams"},"TrialParams")," defined in the low level gRPC API."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"int")," - The type of the serialization string data. This is the type of string that is returned by ",(0,i.kt)("inlineCode",{parentName:"p"},"serialize"),", and the only type accepted by ",(0,i.kt)("inlineCode",{parentName:"p"},"deserialize"),"; it is undefined behavior to try to deserialize the wrong type of data. This value is strictly larger than 1."),(0,i.kt)("h3",{id:"serializeself"},(0,i.kt)("inlineCode",{parentName:"h3"},"serialize(self)")),(0,i.kt)("p",null,"Return a binary string equivalent of the parameters."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"str")," - Serialized parameters."),(0,i.kt)("h3",{id:"deserializeself-raw_string-typenone"},(0,i.kt)("inlineCode",{parentName:"h3"},"deserialize(self, raw_string, type=None)")),(0,i.kt)("p",null,"Takes a serialized parameter string and sets the ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialParameters")," instance."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"raw_string"),": ",(0,i.kt)("em",{parentName:"li"},"bytes")," - Binary string representing a serialized ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialParameters")," of type ",(0,i.kt)("inlineCode",{parentName:"li"},"type"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"type"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - Type of serial data in ",(0,i.kt)("inlineCode",{parentName:"li"},"raw_string")," (from ",(0,i.kt)("inlineCode",{parentName:"li"},"get_serialization")," of the source). If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", the current type is assumed (i.e. this instance type matches the source type).")),(0,i.kt)("h2",{id:"class-cogmentactorparameters"},"class cogment.ActorParameters"),(0,i.kt)("p",null,"Class containing the parameters for a particular actor (see ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#trial-parameters"},"Trial Parameters"),")."),(0,i.kt)("p",null,"Any attribute can be set to ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," to reset it to its default.\nSome attributes (",(0,i.kt)("inlineCode",{parentName:"p"},"config"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"default_action"),") are immutable: changes to the instance received will not be reflected in ",(0,i.kt)("inlineCode",{parentName:"p"},"ActorParameters"),", the attribute must be set with a new instance to make changes. These attributes can also return ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if not set."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"config"),": ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - The type is specified in the spec file under the section ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes:config_type")," for the specific actor class of the actor."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"config_serialized"),": ",(0,i.kt)("em",{parentName:"p"},"bytes")," - Config in serialized (class independent) form. This can be accessed even without specs (see ",(0,i.kt)("inlineCode",{parentName:"p"},"has_specs()"),")."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"class_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - This cannot be changed (it is a parameter of the constructor)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"name"),": ",(0,i.kt)("em",{parentName:"p"},"str")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"endpoint"),": ",(0,i.kt)("em",{parentName:"p"},"str")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"implementation"),": ",(0,i.kt)("em",{parentName:"p"},"str")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"initial_connection_timeout"),": ",(0,i.kt)("em",{parentName:"p"},"float")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"response_timeout"),": ",(0,i.kt)("em",{parentName:"p"},"float")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"optional"),": ",(0,i.kt)("em",{parentName:"p"},"bool")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"default_action"),": ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - The type is specified in the spec file under the section ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes:action:space")," for the specific class of the actor."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"default_action_serialized"),": ",(0,i.kt)("em",{parentName:"p"},"bytes")," - Action in serialized (class independent) form. This can be accessed even without specs (see ",(0,i.kt)("inlineCode",{parentName:"p"},"has_specs()"),")."),(0,i.kt)("h3",{id:"__init__self-cog_settings-class_name-kwargs"},(0,i.kt)("inlineCode",{parentName:"h3"},"__init__(self, cog_settings, class_name, **kwargs)")),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"cog_settings"),": ",(0,i.kt)("em",{parentName:"li"},"module")," - Specs module associated with trials that relate to these parameters (see ",(0,i.kt)("a",{parentName:"li",href:"#compiling-the-spec-file-into-cog_settingspy"},"cog_settings generation"),")."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"class_name"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - The name of the actor class for the actor. This is specific to a type of trial and must match values in the spec file under section ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes:name"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"**kwargs"),": Accepts any of the attributes (except ",(0,i.kt)("inlineCode",{parentName:"li"},"class_name"),") as keyword to set their value on construction. E.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'ActorParameters(settings, class_name="some_class", name="act_name")'))),(0,i.kt)("h3",{id:"has_specsself-5"},(0,i.kt)("inlineCode",{parentName:"h3"},"has_specs(self)")),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the specs are known by this instance. False otherwise. Specs will be known if the top level Cogment Context has specs or if a non ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," argument ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings")," was provided."),(0,i.kt)("h2",{id:"class-cogmentlogsample"},"class cogment.LogSample"),(0,i.kt)("p",null,"Class containing a datalog sample.\nA sample starts and ends with the arrival of new observations from the environment. The last sample will end after all components have acknowledged the end of the trial (the state of that sample will then be ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialState.ENDED"),")."),(0,i.kt)("p",null,"Note that some of the data may not be available (",(0,i.kt)("inlineCode",{parentName:"p"},"None"),") if it was excluded from the sample (see datalog parameters ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialParameters.datalog_exclude_fields"),")."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"out_of_sync"),": ",(0,i.kt)("em",{parentName:"p"},"bool")," - False if it is a normal/full sample. True if it is an out-of-sync/partial sample. Out-of-sync samples do not follow the normal time step progression of the trial, they represent isolated data (typically a reward) for steps that have already past. Out-of-sync samples will be produced according to the trial parameter ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#nb_buffered_ticks"},"nb_buffered_ticks"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"tick_id"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The time step that the sample data relates to."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"state"),": ",(0,i.kt)("em",{parentName:"p"},"cogment.TrialState")," - The state of the trial at the end of the sample period. Undefined for out-of-sync samples."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"timestamp"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - Unix style Epoch timestamp in nanoseconds (time since 00:00:00 UTC Jan 1, 1970) at the beginning of the sample period. For out-of-sync samples, this is the time the data in the sample was received."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"events"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Description of special events that happened during the time frame of the sample. For out-of-sync samples, it may contain an explanation of the data."),(0,i.kt)("h3",{id:"__init__self-params"},(0,i.kt)("inlineCode",{parentName:"h3"},"__init__(self, params)")),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"params"),": ",(0,i.kt)("em",{parentName:"li"},"LogParams instance")," - The parameters of the trial.")),(0,i.kt)("h3",{id:"get_serialization_typeself-1"},(0,i.kt)("inlineCode",{parentName:"h3"},"get_serialization_type(self)")),(0,i.kt)("p",null,"Returns the type of serial data produced by ",(0,i.kt)("inlineCode",{parentName:"p"},"serialize")," and accepted by ",(0,i.kt)("inlineCode",{parentName:"p"},"deserialize"),". The type represents an ID dependent on ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/grpc#logexportersamplerequest"},"DatalogSample")," defined in the low level gRPC API."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"int")," - The type of the serialization string data. This is the type of string that is returned by ",(0,i.kt)("inlineCode",{parentName:"p"},"serialize"),", and the only type accepted by ",(0,i.kt)("inlineCode",{parentName:"p"},"deserialize"),"; it is undefined behavior to try to deserialize the wrong type of data. This value is strictly larger than 1."),(0,i.kt)("h3",{id:"serializeself-1"},(0,i.kt)("inlineCode",{parentName:"h3"},"serialize(self)")),(0,i.kt)("p",null,"Returns a binary string equivalent of the sample."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"str")," - Serialized sample."),(0,i.kt)("h3",{id:"deserializeself-raw_string"},(0,i.kt)("inlineCode",{parentName:"h3"},"deserialize(self, raw_string)")),(0,i.kt)("p",null,"Takes a serialized sample string and sets the LogSample instance."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"raw_string"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Binary string representing a serialized LogSample of the same type.")),(0,i.kt)("h3",{id:"all_actor_namesself"},(0,i.kt)("inlineCode",{parentName:"h3"},"all_actor_names(self)")),(0,i.kt)("p",null,"Generator method to iterate over all actors in the trial. This information can also be retrieved from the parameters of the trial."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(str)")," - A generator for the names of the actors in the trial."),(0,i.kt)("h3",{id:"get_actionself-actor"},(0,i.kt)("inlineCode",{parentName:"h3"},"get_action(self, actor)")),(0,i.kt)("p",null,"Retrieves the action from the actor in the sample."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor"),": ",(0,i.kt)("em",{parentName:"li"},"str")," or ",(0,i.kt)("em",{parentName:"li"},"int")," - The name or index of the actor for which to retrieve the action. The number, index and name of actors can be retrieved from the parameters of the trial.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"RecvAction instance")," - The action of the actor in the sample."),(0,i.kt)("h3",{id:"get_observationself-actor"},(0,i.kt)("inlineCode",{parentName:"h3"},"get_observation(self, actor)")),(0,i.kt)("p",null,"Retrieve the observation destined for the actor in the sample. Can be ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," (specifically for out-of-sync samples)."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor"),": ",(0,i.kt)("em",{parentName:"li"},"str")," or ",(0,i.kt)("em",{parentName:"li"},"int")," - The name or index of the actor for which to retrieve the observation. The number, index and name of actors can be retrieved from the parameters of the trial.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"RecvObservation instance")," - The observation of the actor in the sample. Can be ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," (specifically for out-of-sync samples)."),(0,i.kt)("h3",{id:"all_rewardsself"},(0,i.kt)("inlineCode",{parentName:"h3"},"all_rewards(self)")),(0,i.kt)("p",null,"Generator method to iterate over all the rewards in the sample."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(RecvReward instance)")," - A generator for the rewards in the sample."),(0,i.kt)("h3",{id:"all_messagesself"},(0,i.kt)("inlineCode",{parentName:"h3"},"all_messages(self)")),(0,i.kt)("p",null,"Generator method to iterate over all the messages in the sample."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(RecvMessage instance)")," - A generator for the messages in the sample."),(0,i.kt)("h2",{id:"class-modelinfo"},"class ModelInfo"),(0,i.kt)("p",null,"Class containing information about a model name stored in the ModelRegistry."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - The model name."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"properties"),": ",(0,i.kt)("em",{parentName:"p"},"dict{str:str}")," - Custom information associated with the model name (not specific to any iteration)."),(0,i.kt)("h2",{id:"class-modeliterationinfo"},"class ModelIterationInfo"),(0,i.kt)("p",null,"Class containing information specific to a model iteration stored in the Model Registry."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"model_name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - The name of the model."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"iteration"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The iteration number."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"timestamp"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - When the iteration was stored in the Model Registry. Unix epoch time in nanoseconds."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"hash"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - SHA 256 hash (encoded in base64 with standard 64 characters with padding) of the iteration's data."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"size"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - Size (in bytes) of the iteration's data."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"stored"),": ",(0,i.kt)("em",{parentName:"p"},"bool")," - Whether the model is stored, as opposed to just being published (and therefore transient)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"properties"),": ",(0,i.kt)("em",{parentName:"p"},"dict{str:str}")," - Custom information associated with the iteration."),(0,i.kt)("h2",{id:"class-latestmodel"},"class LatestModel"),(0,i.kt)("p",null,"Class making the latest model iteration, from the Model Registry, available on-demand."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - The name of the model."),(0,i.kt)("h3",{id:"async-getself"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get(self)")),(0,i.kt)("p",null,"Method to return the latest iteration that has been downloaded in the background. This method may wait for the first iteration to be available. Once an iteration is available, this method will not be blocking."),(0,i.kt)("p",null,"Subsequent calls to this method may return different results according to the availability of new data."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"tuple(data, ModelIterationInfo instance)")," - The data can either be a ",(0,i.kt)("inlineCode",{parentName:"p"},"bytes")," string or a user object depending on ",(0,i.kt)("inlineCode",{parentName:"p"},"is_deserialized()"),". The second tuple item is a ",(0,i.kt)("inlineCode",{parentName:"p"},"ModelIterationInfo")," instance containing the information of the iteration represented by the data."),(0,i.kt)("h3",{id:"is_deserializedself"},(0,i.kt)("inlineCode",{parentName:"h3"},"is_deserialized(self)")),(0,i.kt)("p",null,"Method to check if the model iteration is deserialized automatically."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the model is deserialized automatically in the background, in which case the data (returned by ",(0,i.kt)("inlineCode",{parentName:"p"},"get"),") is a user object. This user object is derived by calling ",(0,i.kt)("inlineCode",{parentName:"p"},"deserialize_func")," (parameter of ",(0,i.kt)("inlineCode",{parentName:"p"},"ModelRegistry.track_latest_model"),") with the raw bytes from the Model Registry. False if the data (returned by ",(0,i.kt)("inlineCode",{parentName:"p"},"get"),") is the raw bytes retrieved from the Model Registry."),(0,i.kt)("h3",{id:"is_availableself"},(0,i.kt)("inlineCode",{parentName:"h3"},"is_available(self)")),(0,i.kt)("p",null,"Method to check if an iteration is available."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Returns: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if an iteration is available, an thus ",(0,i.kt)("inlineCode",{parentName:"p"},"get")," will not block. False otherwise."),(0,i.kt)("h3",{id:"async-wait_for_availableself"},(0,i.kt)("inlineCode",{parentName:"h3"},"async wait_for_available(self)")),(0,i.kt)("p",null,"Method to wait for an iteration to be available."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Returns: None"),(0,i.kt)("h3",{id:"async-wait_for_newerself-iteration"},(0,i.kt)("inlineCode",{parentName:"h3"},"async wait_for_newer(self, iteration)")),(0,i.kt)("p",null,"Method to wait for a newer iteration to be available.\nOnce this method returns, the newer iteration can be retrieved with ",(0,i.kt)("inlineCode",{parentName:"p"},"get"),"."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"iteration"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - Strict lower bound for awaited model iteration. I.e. the method will wait for a model iteration that is newer, and not equal, to this.")),(0,i.kt)("p",null,"Returns: None"),(0,i.kt)("h2",{id:"class-cogmentdatastorefieldsenumenum"},"class cogment.DatastoreFields(enum.Enum)"),(0,i.kt)("p",null,"Enum representing the various data in a ",(0,i.kt)("inlineCode",{parentName:"p"},"DatastoreActorData")," instance"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"UNKNOWN: Should not be used."),(0,i.kt)("li",{parentName:"ul"},"OBSERVATION: The observation."),(0,i.kt)("li",{parentName:"ul"},"ACTION: The action."),(0,i.kt)("li",{parentName:"ul"},"REWARD: The aggregated reward."),(0,i.kt)("li",{parentName:"ul"},"RECEIVED_REWARDS: All the individual rewards received by the actor (",(0,i.kt)("inlineCode",{parentName:"li"},"all_received_rewards")," method)"),(0,i.kt)("li",{parentName:"ul"},"SENT_REWARDS: All the individual rewards sent by the actor (",(0,i.kt)("inlineCode",{parentName:"li"},"all_sent_rewards")," method)"),(0,i.kt)("li",{parentName:"ul"},"RECEIVED_MESSAGES: All the messages received by the actor (",(0,i.kt)("inlineCode",{parentName:"li"},"all_received_messages")," method)"),(0,i.kt)("li",{parentName:"ul"},"SENT_MESSAGES: All the messages sent by the actor (",(0,i.kt)("inlineCode",{parentName:"li"},"all_received_messages")," method)")),(0,i.kt)("h2",{id:"class-datastoretrialinfo"},"class DatastoreTrialInfo"),(0,i.kt)("p",null,"Class containing the information of a trial stored in the Datastore."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trial_id"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - The trial id for this trial."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"user_id"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - The user ID for the trial (provided on trial start)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trial_state"),": ",(0,i.kt)("em",{parentName:"p"},"cogment.TrialState instance")," - The last (or current) state of the trial. This will change over time if not ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialState.ENDED"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"sample_count"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The number of samples currently stored for this trial. This will change over time if the trial state is not ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialState.ENDED"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"parameters"),": ",(0,i.kt)("em",{parentName:"p"},"cogment.TrialParameters instance")," - The parameters for the trial."),(0,i.kt)("h3",{id:"has_specsself-6"},(0,i.kt)("inlineCode",{parentName:"h3"},"has_specs(self)")),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the specs are known by this instance. False otherwise. Specs will be known if the top level Cogment Context has specs."),(0,i.kt)("h2",{id:"class-datastoresample"},"class DatastoreSample"),(0,i.kt)("p",null,"Class containing the data of a trial sample (typically representing all the data during a trial tick)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trial_id"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - The id of the trial the data in the sample relates to."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trial_state"),": ",(0,i.kt)("em",{parentName:"p"},"cogment.TrialState instance")," - The state of the trial at the end of the sample period. Note that the last sample (when ",(0,i.kt)("inlineCode",{parentName:"p"},"trial_state")," is ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialState.ENDED"),") may have ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," data (e.g. observation, action, etc) if the trial ended on an error or was hard terminated."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"tick_id"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The step/tick at which the data in the sample was obtained."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"timestamp"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - Unix style Epoch timestamp of the start of the step/tick (in nanoseconds since 00:00:00 UTC Jan 1, 1970)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"actors_data"),": ",(0,i.kt)("em",{parentName:"p"},"dict{str:DatastoreActorData instance}")," - Dictionary of all actors data included in the sample, indexed by actor name."),(0,i.kt)("h3",{id:"has_specsself-7"},(0,i.kt)("inlineCode",{parentName:"h3"},"has_specs(self)")),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the specs are known by this instance. False otherwise. Specs will be known if the top level Cogment Context has specs."),(0,i.kt)("h2",{id:"class-datastoreactordata"},"class DatastoreActorData"),(0,i.kt)("p",null,"Class containing the data related to an actor in a sample."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"name"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the actor."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"observation"),": ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - Observation received by the actor. The class of the observation is defined as observation space for the actor class. This is specified in section ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes:observation:space")," in the spec file for the appropriate actor class. Can be ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if there is no data."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"observation_serialized"),": ",(0,i.kt)("em",{parentName:"p"},"bytes")," - Observation received by the actor in serialized (class independent) form. This can be retrieved even without specs (see ",(0,i.kt)("inlineCode",{parentName:"p"},"has_specs()"),"). Can be ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if there is no data."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"action"),": ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - Action from the actor. The class of the action is defined as action space for the specific actor in the section ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes:action:space")," in the spec file for the appropriate actor class. Can be ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if there is no data."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"action_serialized"),": ",(0,i.kt)("em",{parentName:"p"},"bytes")," - Action from the actor in serialized (class independent) form. This can be retrieved even without specs (see ",(0,i.kt)("inlineCode",{parentName:"p"},"has_specs()"),"). Can be ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if there is no data."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"reward"),": ",(0,i.kt)("em",{parentName:"p"},"float")," - The aggregated reward received by the actor in the sample."),(0,i.kt)("h3",{id:"has_specsself-8"},(0,i.kt)("inlineCode",{parentName:"h3"},"has_specs(self)")),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the specs are known by this instance. False otherwise. Specs will be known if the top level Cogment Context has specs."),(0,i.kt)("h3",{id:"all_received_rewardsself"},(0,i.kt)("inlineCode",{parentName:"h3"},"all_received_rewards(self)")),(0,i.kt)("p",null,"Generator method to iterate over all the individual rewards received by the actor in the sample.\nThe aggregated reward is calculated from these."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(DatastoreReward instance)")," - A generator for the individual actor rewards received."),(0,i.kt)("h3",{id:"all_sent_rewardsself"},(0,i.kt)("inlineCode",{parentName:"h3"},"all_sent_rewards(self)")),(0,i.kt)("p",null,"Generator method to iterate over all the individual rewards sent by the actor in the sample."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(DatastoreReward instance)")," - A generator for the individual actor rewards sent."),(0,i.kt)("h3",{id:"all_received_messagesself"},(0,i.kt)("inlineCode",{parentName:"h3"},"all_received_messages(self)")),(0,i.kt)("p",null,"Generator method to iterate over all the messages received by the actor in the sample."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(DatastoreMessage instance)")," - A generator for the messages received."),(0,i.kt)("h3",{id:"all_sent_messagesself"},(0,i.kt)("inlineCode",{parentName:"h3"},"all_sent_messages(self)")),(0,i.kt)("p",null,"Generator method to iterate over all the messages sent by the actor in the sample."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(DatastoreMessage instance)")," - A generator for the messages sent."),(0,i.kt)("h2",{id:"class-datastorereward"},"class DatastoreReward"),(0,i.kt)("p",null,"Class containing the data for an individual reward in the Datastore."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"value"),": ",(0,i.kt)("em",{parentName:"p"},"float")," - Value of the reward."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"confidence"),": ",(0,i.kt)("em",{parentName:"p"},"float")," - Confidence level of the reward value."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"sender"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the sender of the reward."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"receiver"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the receiver of the reward. The string could contain wildcard characters to represent multiple receivers intended by the sender."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"user_data"),": ",(0,i.kt)("em",{parentName:"p"},"google.protobuf.Any instance")," - Data for a user-specific reward format. Can be ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if no specific data was provided. The class enclosed in ",(0,i.kt)("inlineCode",{parentName:"p"},"google.protobuf.Any")," is of the type set by the sender; it is the responsibility of the receiver to manage the data received (i.e. determine the type and unpack the data)."),(0,i.kt)("h2",{id:"class-datastoremessage"},"class DatastoreMessage"),(0,i.kt)("p",null,"Class containing the data of a message in the Datastore."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"sender"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the sender of the message."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"receiver"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - Name of the receiver of the message. The string could contain wildcard characters to represent multiple receivers intended by the sender."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"payload"),": ",(0,i.kt)("em",{parentName:"p"},"google.protobuf.Any instance")," - Data for a received message. The class enclosed in ",(0,i.kt)("inlineCode",{parentName:"p"},"google.protobuf.Any")," is of the type set by the sender; It is the responsibility of the receiver to manage the data received (i.e. determine the type and unpack the data). Can be ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if there is no data."))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/354f5e12.28413fb0.js b/assets/js/354f5e12.28413fb0.js deleted file mode 100644 index dc988c8..0000000 --- a/assets/js/354f5e12.28413fb0.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[9071],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>h});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=a.createContext({}),c=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=c(e.components);return a.createElement(l.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,l=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),m=c(n),h=r,u=m["".concat(l,".").concat(h)]||m[h]||d[h]||o;return n?a.createElement(u,i(i({ref:t},p),{},{components:n})):a.createElement(u,i({ref:t},p))}));function h(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,i=new Array(o);i[0]=m;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s.mdxType="string"==typeof e?e:r,i[1]=s;for(var c=2;c<o;c++)i[c]=n[c];return a.createElement.apply(null,i)}return a.createElement.apply(null,n)}m.displayName="MDXCreateElement"},3056:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>S,contentTitle:()=>x,default:()=>P,frontMatter:()=>I,metadata:()=>E,toc:()=>A});var a=n(7462),r=n(7294),o=n(3905),i=n(6010),s=n(2466),l=n(6775),c=n(1980),p=n(7392),d=n(12);function m(e){return function(e){var t;return(null==(t=r.Children.map(e,(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad <Tabs> child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`)})))?void 0:t.filter(Boolean))??[]}(e).map((e=>{let{props:{value:t,label:n,attributes:a,default:r}}=e;return{value:t,label:n,attributes:a,default:r}}))}function h(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??m(n);return function(e){const t=(0,p.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e}),[t,n])}function u(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function f(e){let{queryString:t=!1,groupId:n}=e;const a=(0,l.k6)(),o=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,c._X)(o),(0,r.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(a.location.search);t.set(o,e),a.replace({...a.location,search:t.toString()})}),[o,a])]}function v(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,o=h(e),[i,s]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(t){if(!u({value:t,tabValues:n}))throw new Error(`Docusaurus error: The <Tabs> has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const a=n.find((e=>e.default))??n[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:t,tabValues:o}))),[l,c]=f({queryString:n,groupId:a}),[p,m]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,o]=(0,d.Nk)(n);return[a,(0,r.useCallback)((e=>{n&&o.set(e)}),[n,o])]}({groupId:a}),v=(()=>{const e=l??p;return u({value:e,tabValues:o})?e:null})();(0,r.useLayoutEffect)((()=>{v&&s(v)}),[v]);return{selectedValue:i,selectValue:(0,r.useCallback)((e=>{if(!u({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);s(e),c(e),m(e)}),[c,m,o]),tabValues:o}}var g=n(2389);const k="tabList__CuJ",b="tabItem_LNqP";function y(e){let{className:t,block:n,selectedValue:o,selectValue:l,tabValues:c}=e;const p=[],{blockElementScrollPositionUntilNextRender:d}=(0,s.o5)(),m=e=>{const t=e.currentTarget,n=p.indexOf(t),a=c[n].value;a!==o&&(d(t),l(a))},h=e=>{var t;let n=null;switch(e.key){case"Enter":m(e);break;case"ArrowRight":{const t=p.indexOf(e.currentTarget)+1;n=p[t]??p[0];break}case"ArrowLeft":{const t=p.indexOf(e.currentTarget)-1;n=p[t]??p[p.length-1];break}}null==(t=n)||t.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.Z)("tabs",{"tabs--block":n},t)},c.map((e=>{let{value:t,label:n,attributes:s}=e;return r.createElement("li",(0,a.Z)({role:"tab",tabIndex:o===t?0:-1,"aria-selected":o===t,key:t,ref:e=>p.push(e),onKeyDown:h,onClick:m},s,{className:(0,i.Z)("tabs__item",b,null==s?void 0:s.className,{"tabs__item--active":o===t})}),n??t)})))}function N(e){let{lazy:t,children:n,selectedValue:a}=e;const o=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},o.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a}))))}function w(e){const t=v(e);return r.createElement("div",{className:(0,i.Z)("tabs-container",k)},r.createElement(y,(0,a.Z)({},e,t)),r.createElement(N,(0,a.Z)({},e,t)))}function _(e){const t=(0,g.Z)();return r.createElement(w,(0,a.Z)({key:String(t)},e))}const T="tabItem_Ymn6";function C(e){let{children:t,hidden:n,className:a}=e;return r.createElement("div",{role:"tabpanel",className:(0,i.Z)(T,a),hidden:n},t)}const I={sidebar_position:2},x="Development guide",E={unversionedId:"guide/development-guide",id:"guide/development-guide",title:"Development guide",description:"This document gives a high level view of what it is to develop a Cogment based application using Cogment SDKs. It assumes the reader is familiar with the Cogment core concepts.",source:"@site/docs/guide/development-guide.mdx",sourceDirName:"guide",slug:"/guide/development-guide",permalink:"/docs/guide/development-guide",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"docSidebar",previous:{title:"Core Concepts",permalink:"/docs/guide/core-concepts"},next:{title:"Implementation Recipes",permalink:"/docs/guide/implementation-recipes/"}},S={},A=[{value:"The spec file",id:"the-spec-file",level:2},{value:"Compiling the spec file",id:"compiling-the-spec-file",level:3},{value:"Environment",id:"environment",level:2},{value:"Sending observations",id:"sending-observations",level:3},{value:"Actor",id:"actor",level:2},{value:"Service actor / Client actor",id:"service-actor--client-actor",level:3},{value:"Actor Availability",id:"actor-availability",level:3},{value:"Controller",id:"controller",level:2},{value:"Start and terminate trials",id:"start-and-terminate-trials",level:3},{value:"Start trial from trial parameters",id:"start-trial-from-trial-parameters",level:4},{value:"Watch trials",id:"watch-trials",level:3},{value:"Rewards",id:"rewards",level:2},{value:"Creating",id:"creating",level:3},{value:"Consuming",id:"consuming",level:3},{value:"Messages",id:"messages",level:2},{value:"Creating",id:"creating-1",level:3},{value:"Consuming",id:"consuming-1",level:3},{value:"Pre-trial hook",id:"pre-trial-hook",level:2},{value:"Trial lifetime",id:"trial-lifetime",level:2},{value:"Trial start",id:"trial-start",level:3},{value:"Trial run",id:"trial-run",level:3},{value:"Trial end",id:"trial-end",level:3},{value:"Trial ended by the environment",id:"trial-ended-by-the-environment",level:4},{value:"Soft termination",id:"soft-termination",level:4},{value:"Hard termination",id:"hard-termination",level:4}],O={toc:A};function P(e){let{components:t,...n}=e;return(0,o.kt)("wrapper",(0,a.Z)({},O,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"development-guide"},"Development guide"),(0,o.kt)("p",null,"This document gives a high level view of what it is to develop a Cogment based application using Cogment SDKs. It assumes the reader is familiar with the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts"},"Cogment core concepts"),"."),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"Some features aren't available in Javascript, if there's only Python examples under a certain section, that feature is python only.")),(0,o.kt)("p",null,"The High-level Cogment API expects users to use ",(0,o.kt)("a",{parentName:"p",href:"https://developers.google.com/protocol-buffers/"},"protocol buffers")," to declare a project's data structures. The intricacies of protobufs are beyond the scope of this document. Basic knowledge of the technology and its usage is assumed."),(0,o.kt)("h2",{id:"the-spec-file"},"The spec file"),(0,o.kt)("p",null,"The spec file, usually named ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml"),", defines the specifics of a type of trials for a Cogment app: actor classes as well as environment & trial configuration types. It is the starting point for a project."),(0,o.kt)("p",null,"An actor class is primarily defined by its observation space and action space."),(0,o.kt)("p",null,"The data structures describing these spaces are declared by using a protocol buffer message type. ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#observations--actions"},"Observations and actions")," will simply be instances of the matching type."),(0,o.kt)("p",null,"For example, in the following, ",(0,o.kt)("inlineCode",{parentName:"p"},"driver")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"pedestrian")," share a common view of the environment, hence use the same observation space, but have different actions available to them."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-yaml"},"import:\n proto:\n - city.proto\n\nactors:\n driver:\n observation:\n space: city.Observation\n\n action:\n space: city.DriverAction\n\n pedestrian:\n observation:\n space: city.Observation\n\n action:\n space: city.PedestrianAction\n")),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"This shows only the relevant part of the full spec file, you can find the full list of configurable options ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/cogment-yaml"},"in the reference page"),".")),(0,o.kt)("h3",{id:"compiling-the-spec-file"},"Compiling the spec file"),(0,o.kt)("p",null,"In order to use the spec file within the various supported languages, it needs to be compiled. This is done by the code generation modules of the specific language's SDK you are using."),(0,o.kt)(_,{mdxType:"Tabs"},(0,o.kt)(C,{value:"python",label:"Python",default:!0,mdxType:"TabItem"},(0,o.kt)("p",null,"For the python SDK, the generation step requires an ",(0,o.kt)("a",{parentName:"p",href:"https://peps.python.org/pep-0508/#extras"},"extra")," from the ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment")," package. Using pip you can install the SDK with its extra using:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"pip install cogment[generate]\n")),(0,o.kt)("p",null,"The generation can then be executed using:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"python -m cogment.generate cogment.yaml\n")),(0,o.kt)("p",null,"This will create a ",(0,o.kt)("inlineCode",{parentName:"p"},"cog_settings.py")," file as well as multiple ",(0,o.kt)("inlineCode",{parentName:"p"},"*_pb.py")," files.")),(0,o.kt)(C,{value:"javascript",label:"Javascript",mdxType:"TabItem"},(0,o.kt)("p",null,"For the Javascript SDK, the generation requires the SDK to be installed:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"npm install @cogment/cogment-js-sdk\n")),(0,o.kt)("p",null,"The generation can then be executed using:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"npx cogment-js-sdk-generate cogment.yaml\n")),(0,o.kt)("p",null,"This will create several files in the ",(0,o.kt)("inlineCode",{parentName:"p"},"src")," folder: ",(0,o.kt)("inlineCode",{parentName:"p"},"CogSettings.js"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"CogSettings.d.ts"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"CogSettings.d.ts.map")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"CogTypes.d.ts")," as well multiple ",(0,o.kt)("inlineCode",{parentName:"p"},"*_pb.js")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"*_pb.d.ts")," files."))),(0,o.kt)("h2",{id:"environment"},"Environment"),(0,o.kt)("p",null,(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#environment"},"Environments")," are implemented by functions that take a ",(0,o.kt)("em",{parentName:"p"},"environment session")," instance."),(0,o.kt)("p",null,"This function will be called once for each ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#trial"},"trial"),". This function usually consists of three sections."),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"The environment's ",(0,o.kt)("strong",{parentName:"li"},"initialization"),", where its internal state can be initialized and processes started. It ends with the sending of the initial observations to the actors participating in the trial."),(0,o.kt)("li",{parentName:"ul"},"Its ",(0,o.kt)("strong",{parentName:"li"},"event loop"),", where the environment iterates through the events occurring during the trial and produces ",(0,o.kt)("a",{parentName:"li",href:"/docs/guide/core-concepts#observations--actions"},"observations")," as well as receives messages. In this loop the environment can end the trial on its own or the end can be requested, see the ",(0,o.kt)("a",{parentName:"li",href:"#trial-lifetime"},"Trial lifetime")," section for further information."),(0,o.kt)("li",{parentName:"ul"},"Its ",(0,o.kt)("strong",{parentName:"li"},"termination"),", where cleanup occurs.")),(0,o.kt)("p",null,"In the common case where all actors within a trial share the same observation, a bare-minimum environment service would look like this:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'async def environment(environment_session):\n # -- Initialization --\n\n # Retrieve the actors participating in the trial\n actors = environment_session.get_active_actors()\n\n # Start the trial and send a starting observation to all actors\n environment_session.start([("*", Observation())])\n\n # -- Event loop --\n async for event in environment_session.all_events():\n if event.actions:\n # `event.actions` is a list of the actions done by the actors\n actions = event.actions\n if event.type == cogment.EventType.ACTIVE:\n # The trial is active, produce an observation in response to the actions\n environment_session.produce_observations([("*", Observation())])\n # Alternatively the environment can decide to **end** the trial with the following\n # environment_session.end([("*", Observation())])\n else:\n # The trial termination has been requested\n # Produce a final observation\n environment_session.end([("*", Observation())])\n\n for message in event.messages:\n # `event.messages` is a list of all the messages received by the environment (it can be empty)\n\n # Handle each message here.\n\n # -- Termination --\n print(f"Trial [{environment_session.get_trial_id()}] terminated")\n')),(0,o.kt)("p",null,"For further details, take a look at the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-environmentsessionsession"},(0,o.kt)("inlineCode",{parentName:"a"},"cogment.EnvironmentSession"))," class reference."),(0,o.kt)("p",null,"This environment implementation needs to be registered and served so that the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#orchestrator"},"Orchestrator")," can reach it. This can be done through a ",(0,o.kt)("inlineCode",{parentName:"p"},"Context")," instance."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'context = cogment.Context(user_id="my_user_id", cog_settings=cog_settings)\n\ncontext.register_environment(impl=environment, impl_name="my_environment")\n\nawait context.serve_all_registered(cogment.ServedEndpoint(port=9000))\n')),(0,o.kt)("p",null,"For further details, take a look at the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-cogmentcontext"},(0,o.kt)("inlineCode",{parentName:"a"},"cogment.Context"))," class reference."),(0,o.kt)("h3",{id:"sending-observations"},"Sending observations"),(0,o.kt)("p",null,"The environment session has 3 different methods able to send observations: ",(0,o.kt)("inlineCode",{parentName:"p"},"start"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"produce_observations")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"end"),". Each of those methods takes a list of 2-tuples destination / observation."),(0,o.kt)("p",null,"As demonstrated above, sending the same observation to all actors is done using ",(0,o.kt)("inlineCode",{parentName:"p"},'"*"')," as the destination."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'environment_session.produce_observations([("*", Observation(...))])\n')),(0,o.kt)("p",null,"It is also possible to send different observations to different actors. This can be useful to send observations of the ",(0,o.kt)("em",{parentName:"p"},"world")," from the point of view of the actor or to send partial observations."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'environment_session.produce_observations([\n ("my_first_actor_name", Observation(...)),\n ("my_second_actor_name", Observation(...))\n])\n')),(0,o.kt)("p",null,"Please note that the environment should always send observations such as each actor in the trial receives one."),(0,o.kt)("h2",{id:"actor"},"Actor"),(0,o.kt)("p",null,(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#actor"},"Actors")," implementations look a lot like the ",(0,o.kt)("a",{parentName:"p",href:"#environment"},"environment's"),". They take ",(0,o.kt)("em",{parentName:"p"},"actor session")," instance and have the same three sections: ",(0,o.kt)("strong",{parentName:"p"},"initialization"),", ",(0,o.kt)("strong",{parentName:"p"},"event loop")," and ",(0,o.kt)("strong",{parentName:"p"},"termination"),"."),(0,o.kt)("p",null,"The event loops in Actors' implementations handle three basic types of events:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"observation")," produced by the environment and should lead to an action being done."),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"rewards")," sent by other actors or the environment, we'll talk about them in more details ",(0,o.kt)("a",{parentName:"li",href:"#reward"},"below"),"."),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"messages")," sent by other actors or the environment, we'll talk about them in more details ",(0,o.kt)("a",{parentName:"li",href:"#messages"},"below"),".")),(0,o.kt)("p",null,"A typical actor implementation would look like this:"),(0,o.kt)(_,{mdxType:"Tabs"},(0,o.kt)(C,{value:"python",label:"Python",default:!0,mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'async def driver_actor(actor_session):\n # -- Initialization --\n\n # Notify that the actor is ready for the trial to start.\n actor_session.start()\n\n async for event in actor_session.all_events():\n if event.observation:\n # `event.observation` is an instance of the Observation produced by the environment\n observation = event.observation\n if event.type == cogment.EventType.ACTIVE:\n # The trial is active, it is expecting the agent to do an action\n actor_session.do_action(DriverAction(...))\n\n for reward in event.rewards:\n # `event.rewards` is a list of all the rewards received by the actor (it can be empty)\n\n # Handle each reward here.\n\n for message in event.messages:\n # `event.messages` is a list of all the messages received by the actor (it can be empty)\n\n # Handle each message here.\n\n # -- Termination --\n print(f"Trial [{actor_session.get_trial_id()}] terminated")\n')),(0,o.kt)("p",null,"For further details, take a look at the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-actorsessionsession"},(0,o.kt)("inlineCode",{parentName:"a"},"cogment.ActorSession"))," class reference.")),(0,o.kt)(C,{value:"javascript",label:"Javascript",mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-javascript"},"const driverActor = async (actorSession) => {\n // -- Initialization --\n\n // Notify that the actor is ready for the trial to start.\n actorSession.start();\n\n for await (const event of actorSession.eventLoop()) {\n if (event.observation) {\n // `event.observation` is an instance of the Observation produced by the environment\n observation = event.observation;\n if (event.type === cogment.EventType.ACTIVE) {\n // The trial is active, it is expecting the agent to do an action\n actorSession.sendAction(new DriverAction());\n }\n }\n for (const reward of event.rewards) {\n // `event.rewards` is a list of all the rewards received by the actor (it can be empty)\n // Handle each reward here.\n }\n for (const message of event.messages) {\n // `event.messages` is a list of all the messages received by the actor (it can be empty)\n // Handle each message here.\n }\n }\n\n // -- Termination --\n console.log(`Trial [${actorSession.getTrialId()}] terminated`);\n};\n")),(0,o.kt)("p",null,"For further details, take a look at the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/javascript#class-actorsession-extends-session"},(0,o.kt)("inlineCode",{parentName:"a"},"ActorSession"))," class reference."))),(0,o.kt)("h3",{id:"service-actor--client-actor"},"Service actor / Client actor"),(0,o.kt)("p",null,"A Cogment app can use two types of actors, they are identical in terms of implementation but differ in how they interact with the app's ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#orchestrator"},"Orchestrator"),"."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"Service actors")," are accessible in the same way the environment is, through a ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-cogmentcontext"},(0,o.kt)("inlineCode",{parentName:"a"},"Context"))," instance."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'context = cogment.Context(cog_settings=cog_settings, user_id="my_user_id")\ncontext.register_actor(impl=actor, impl_name="driver_actor", actor_classes=["driver"])\ncontext.register_actor(impl=actor_slow, impl_name="driver_actor_slow", actor_classes=["driver"])\n\nawait context.serve_all_registered(cogment.ServedEndpoint(port=9000))\n')),(0,o.kt)("p",null,"Note that it is also through this registrating that the implementation is associated with one or more actor classes it implements."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"Client actors"),", contrary to Service actors, are not served to the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#orchestrator"},"Orchestrator"),". They connect as clients of the Orchestrator and join a ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#trial"},"trial")," that has started."),(0,o.kt)(_,{mdxType:"Tabs"},(0,o.kt)(C,{value:"python",label:"Python",default:!0,mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'context = cogment.Context(cog_settings=cog_settings, user_id="my_user_id")\ncontext.register_actor(\n impl=actor,\n impl_name="human_pedestrian",\n actor_classes=["pedestrian"]\n)\n\nawait context.join_trial(\n trial_id=trial_id,\n cogment.Endpoint(url="grpc://orchestrator:9000"),\n actor_name="Alice"\n)\n'))),(0,o.kt)(C,{value:"javascript",label:"Javascript",mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-javascript"},'const context = new Context(cogSettings, "my_user_id");\n\ncontext.registerActor(actorImpl, "human_pedestrian", "pedestrian");\n\nawait context.joinTrial(trialId, "grpc://orchestrator:9000", "Alice");\n')))),(0,o.kt)("p",null,"Note that a trial including one or more client actors will wait for all of them to join before any actor can start processing events."),(0,o.kt)("p",null,"Due to the different network requirements, client actors are a good fit when implementing a frontend for human actors."),(0,o.kt)("h3",{id:"actor-availability"},"Actor Availability"),(0,o.kt)("p",null,"There are four actor parameters (see ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/parameters#parameters-reference"},"Trial Parameters"),") to manage actor responses for a trial: ",(0,o.kt)("inlineCode",{parentName:"p"},"initial_connection_timeout"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"response_timeout"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"optional")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"default_action"),".\nThe timeouts control when an actor becomes unavailable, and the other two control what happens when it becomes unavailable."),(0,o.kt)("p",null,"The trial will be ",(0,o.kt)("a",{parentName:"p",href:"#hard-termination"},(0,o.kt)("em",{parentName:"a"},"hard")," terminated")," by the Orchestrator if a required (non-optional) actor becomes unavailable, whereas it can continue if an optional actor becomes unavailable."),(0,o.kt)("p",null,"The ",(0,o.kt)("inlineCode",{parentName:"p"},"default_action")," is for optional actors; when the actor is unavailable, the default action will be sent to the environment. If there is no default action defined, the environment is informed that the actor is unavailable, but no action is provided."),(0,o.kt)("p",null,"E.g. If a required actor (with ",(0,o.kt)("inlineCode",{parentName:"p"},"optional")," set to False) has a ",(0,o.kt)("inlineCode",{parentName:"p"},"response_timeout")," set to 5.0 seconds, but takes more than 5 seconds to respond to a new observation (e.g. due to excessive computation, or a crash), then the trial will be terminated."),(0,o.kt)("h2",{id:"controller"},"Controller"),(0,o.kt)("p",null,(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#trial"},"Trials")," are started by clients of the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#orchestrator"},"Orchestrator")," using a Controller. Instances of a controller are built from the context instance and connect to an Orchestrator endpoint."),(0,o.kt)(_,{mdxType:"Tabs"},(0,o.kt)(C,{value:"python",label:"Python",default:!0,mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'controller = context.get_controller(\n endpoint=cogment.Endpoint(url="grpc://orchestrator:9000")\n)\n')),(0,o.kt)("p",null,"For further details, take a look at the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-controller"},(0,o.kt)("inlineCode",{parentName:"a"},"Controller"))," class reference.")),(0,o.kt)(C,{value:"javascript",label:"Javascript",mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-javascript"},'const controller = context.getController("grpc://orchestrator:9000");\n')),(0,o.kt)("p",null,"For further details, take a look at the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/javascript#class-controller"},(0,o.kt)("inlineCode",{parentName:"a"},"Controller"))," class reference."))),(0,o.kt)("h3",{id:"start-and-terminate-trials"},"Start and terminate trials"),(0,o.kt)("p",null,"The controller can then be used to create trials and request their termination."),(0,o.kt)(_,{mdxType:"Tabs"},(0,o.kt)(C,{value:"python",label:"Python",default:!0,mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"trial_id = await controller.start_trial(trial_config=TrialConfig())\n\n# ...\n\nawait controller.terminate_trial([trial_id])\n"))),(0,o.kt)(C,{value:"javascript",label:"Javascript",mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-javascript"},"const trialId = await controller.startTrial(new TrialConfig());\n\n// ...\n\nawait controller.terminateTrial([trialId]);\n")))),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"The default behavior of the Controller's ",(0,o.kt)("em",{parentName:"p"},"terminate trial")," function is to trigger a ",(0,o.kt)("a",{parentName:"p",href:"#soft-termination"},"soft termination"),", an optional ",(0,o.kt)("inlineCode",{parentName:"p"},"hard")," parameters can be set to ",(0,o.kt)("inlineCode",{parentName:"p"},"True")," to trigger a ",(0,o.kt)("a",{parentName:"p",href:"#hard-termination"},"hard termination"),".")),(0,o.kt)("h4",{id:"start-trial-from-trial-parameters"},"Start trial from trial parameters"),(0,o.kt)("p",null,"The above example uses an instance of the user-defined trial configuration to start the trial. This instance is then provided to a ",(0,o.kt)("a",{parentName:"p",href:"#pre-trial-hook"},"pre-trial hook")," to fully define the trial parameters. It is also possible to fully provide the trial parameters when starting the trial."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'actor_1_params = cogment.ActorParameters(\n cog_settings,\n name="Alice",\n class_name="pedestrian",\n endpoint="cogment://client"\n)\nactor_2_params = cogment.ActorParameters(\n cog_settings,\n name="ai_driver",\n class_name="driver",\n endpoint="grpc://driver_actors:9000",\n implementation="driver_actor_slow"\n)\n\nenvironment_config=EnvironmentConfig(\n # ...\n)\n\ntrial_params=cogment.TrialParameters(\n cog_settings,\n environment_name="environment",\n environment_implementation="my_environment"\n environment_endpoint="grpc://environment:9000",\n environment_config=environment_config,\n actors=[\n actor_1_params,\n actor_2_params,\n ]\n)\n')),(0,o.kt)("p",null,"For further details, take a look at the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-cogmenttrialparameters"},(0,o.kt)("inlineCode",{parentName:"a"},"cogment.TrialParameters"))," class reference."),(0,o.kt)("h3",{id:"watch-trials"},"Watch trials"),(0,o.kt)("p",null,"The controller can also be used to subscribe to events occuring in the trials run by the Orchestrator it connects to. For example, this can be used to wait for a trial's end:"),(0,o.kt)(_,{mdxType:"Tabs"},(0,o.kt)(C,{value:"python",label:"Python",default:!0,mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'async for trial_info in controller.watch_trials(trial_state_filters=[\n cogment.TrialState.ENDED\n]):\n print(f"The trial having id [{trial_info.trial_id}] ended")\n'))),(0,o.kt)(C,{value:"javascript",label:"Javascript",mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-javascript"},"for await (const trialListEntry of controller.watchTrials([\n cogment.TrialState.ENDED,\n])) {\n console.log(`The trial having id ${trialListEntry.getTrialId()} ended.`);\n}\n")))),(0,o.kt)("h2",{id:"rewards"},"Rewards"),(0,o.kt)("h3",{id:"creating"},"Creating"),(0,o.kt)("p",null,"Rewards are sent to ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#actor"},"Actors")," from another actor or the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#environment"},"Environment"),". The ",(0,o.kt)("inlineCode",{parentName:"p"},"session")," instance passed to their implementation can be used for this purpose."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"session.add_reward(value=-1, confidence=1, tick_id=-1, to=['an_actor_name'])\n")),(0,o.kt)("p",null,"Rewards consist of an arbitrary numerical ",(0,o.kt)("strong",{parentName:"p"},"value"),' describing how the reward "sender" ',(0,o.kt)("em",{parentName:"p"},"believes")," the actor performed.\nIt is ",(0,o.kt)("em",{parentName:"p"},"weighted")," by a value between 0 and 1 qualifying the ",(0,o.kt)("strong",{parentName:"p"},"confidence"),' of the "sender" in its reward, from a very low confidence just above 0 to a very high confidence approaching 1.\nThe confidence value is used to collate all the rewards sent to an actor at the same time.\nOptionally, a reward can be provided with arbitrary user data.'),(0,o.kt)("p",null,"Each reward applies to a list of recipients (either all the actors, all the actors of a given class or a specific actor) at a specific point in time, during the trial, defined as a ",(0,o.kt)("strong",{parentName:"p"},"tick"),'.\nThe tick ID can represent a past action if the value is smaller than the current tick ID ("future" actions are not allowed).\nPast actions, like sending a reward related to a past tick ID, are handled in accordance with the ',(0,o.kt)("a",{parentName:"p",href:"/docs/reference/parameters#nb_buffered_ticks"},"nb_buffered_ticks")," trial parameter."),(0,o.kt)("p",null,"The full documentation for ",(0,o.kt)("inlineCode",{parentName:"p"},"session.add_reward")," can be found ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#add_rewardself-value-confidence-to-tick_id-1-user_datanone"},"here"),"."),(0,o.kt)("h3",{id:"consuming"},"Consuming"),(0,o.kt)("p",null,"All the Rewards that are sent and destined to each specific ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#actor"},"actor")," for a given point in time are collated together by the framework."),(0,o.kt)("p",null,"The ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#actor"},"actor")," can take into account the reward directly as the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#trial"},"trial")," is running by consuming the ",(0,o.kt)("inlineCode",{parentName:"p"},'"reward"')," event in their event loop."),(0,o.kt)(_,{mdxType:"Tabs"},(0,o.kt)(C,{value:"python",label:"Python",default:!0,mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"async for event in actor_session.all_events():\n # [...]\n for reward in event.rewards:\n # `reward.tick_id` is the id of the tick this reward concerns.\n tick_id = reward.tick_id\n # `reward.value` is the aggregated value of the reward.\n value = reward.value\n for source_reward in reward.all_sources():\n # Iterate over individual source rewards.\n reward_value = source_reward.value\n reward_confidence = source_reward.confidence\n reward_sender = source_reward.sender\n reward_user_data = source_reward.user_data\n"))),(0,o.kt)(C,{value:"javascript",label:"Javascript",mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-javascript"},"for await (const event of actorSession.eventLoop()) {\n // [...]\n for (const reward of event.rewards) {\n // `reward.tickId` is the id of the tick this reward concerns.\n const tickId = reward.tickId;\n // `reward.value` is the aggregated value of the reward.\n const value = reward.value;\n for (sourceReward of reward.sourcesList) {\n // Iterate over individual source rewards.\n const rewardValue = sourceReward.value;\n const rewardConfidence = sourceReward.confidence;\n const rewardSender = sourceReward.senderName;\n const rewardUserData = sourceReward.userData;\n }\n }\n}\n")))),(0,o.kt)("h2",{id:"messages"},"Messages"),(0,o.kt)("h3",{id:"creating-1"},"Creating"),(0,o.kt)("p",null,"Messages can be created and sent between ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#actor"},"actors")," or the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#environment"},"environment")," within a trial using their ",(0,o.kt)("inlineCode",{parentName:"p"},"session")," instance."),(0,o.kt)(_,{mdxType:"Tabs"},(0,o.kt)(C,{value:"python",label:"Python",default:!0,mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"session.send_message(\n user_data=MyProtobufDataStructure(...), # any protobuf data structure can be used here.\n to=['pedestrian:*'], # send the message to all the actors of the \"pedestrian\" class\n)\n")),(0,o.kt)("p",null,"The full documentation for ",(0,o.kt)("inlineCode",{parentName:"p"},"session.send_message")," can be found ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#send_messageself-payload-to-to_environmentfalse"},"here"),".")),(0,o.kt)(C,{value:"javascript",label:"Javascript",mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-javascript"},'const message = new Message();\nmessage.setRequest("hello");\n\n// Now we serialize into an Any protobuf message.\nconst anyPb = new MyProtobufDataStructure();\nanyPb.pack(message.serializeBinary(), "cogment_app.Message");\n\nactorSession.sendMessage({\n from: actorName,\n payload: anyPb,\n to: "otherActorName",\n trialId,\n});\n')),(0,o.kt)("p",null,"The full documentation for ",(0,o.kt)("inlineCode",{parentName:"p"},"actorSession.sendMessage")," can be found ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/javascript#sendmessagepayload-to"},"here"),"."))),(0,o.kt)("p",null,"Messages consist of an arbitrary payload, their ",(0,o.kt)("inlineCode",{parentName:"p"},"user_data/payload"),", defined as an instance of any protobuf data structure."),(0,o.kt)("p",null,"A message can be sent to one, many or all actors in a trial and / or to the environment."),(0,o.kt)("h3",{id:"consuming-1"},"Consuming"),(0,o.kt)("p",null,"All the messages that are sent and intended for each specific actor or environment will be received by the target actor or environment."),(0,o.kt)("p",null,"Actors or the environment can use the message directly, live, as the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#trial"},"trial")," is running, by consuming message event in their event loop."),(0,o.kt)(_,{mdxType:"Tabs"},(0,o.kt)(C,{value:"python",label:"Python",default:!0,mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"async for event in actor_session.all_events():\n # [...]\n for message in event.messages:\n # `message.sender_name` is the name of the actor who sent a message\n sender_name = message.sender_name\n # `message.payload` is the content of the message, it needs to be unpacked\n payload = message.payload\n"))),(0,o.kt)(C,{value:"javascript",label:"Javascript",mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-javascript"},'for await (const event of actorSession.eventLoop()) {\n // [...]\n for (const message of event.messages) {\n // `message.sender_name` is the name of the actor who sent a message\n const sender = message.sender;\n // `message.data` is the content of the message, it needs to be unpacked\n const data = message.data;\n\n const newMessage = data.unpack(\n (x: Uint8Array) => Message.deserializeBinary(x),\n "cogment_app.Message"\n );\n }\n}\n')))),(0,o.kt)("h2",{id:"pre-trial-hook"},"Pre-trial hook"),(0,o.kt)("p",null,"When starting a trial from a controller, an instance of the message type defined in ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/cogment-yaml#trial"},(0,o.kt)("inlineCode",{parentName:"a"},"trial:config_type"))," can be provided. This instance is then passed to the registered ",(0,o.kt)("strong",{parentName:"p"},"Pre trial hooks")," when the Orcehstrator was started. The role of these hooks is to fully parametrize the trial based on the provided config. To achieve that, they can modify the default trial params defined in the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/parameters"},"parameters")," to specify the environment (i.e. its endpoint, implementation name & configuration), the number and parameters of the participant actors (i.e. their name, class, endpoint, implementation name & configuration) as well as additional parameters for the trial. The pre-trial hook can therefore be used to dynamically configure trials, to act as a service endpoint registry, or a load balancer."),(0,o.kt)("p",null,"Pre-trial hook implementations are registered in the same way the environment or actor implementation are and follow the same ",(0,o.kt)("em",{parentName:"p"},"session")," pattern."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'async def my_pre_trial_hook(pre_hook_session):\n # The trial config provided by the controller can be retrieved like that\n trial_config = pre_hook_session.trial_config\n # The trial params can be edited directly\n pre_hook_session.environment_config = # [...]\n pre_hook_session.environment_endpoint = "grpc://my_environment:9000"\n pre_hook_session.actors = [\n {\n "name": "my_first_actor_name",\n "actor_class": "driver",\n "endpoint": "grpc://driver:9000",\n "implementation": "driver_actor",\n "config": # [...],\n },\n {\n "name": "my_second_actor_name",\n "actor_class": "predestrian",\n "endpoint": "cogment://client",\n "config": # [...],\n },\n ]\n # And finally should be validated\n pre_hook_session.validate()\n\ncontext.register_pre_trial_hook(impl=my_pre_trial_hook)\n')),(0,o.kt)("h2",{id:"trial-lifetime"},"Trial lifetime"),(0,o.kt)("p",null,"Over their lifetime trials can be in different states managed by the Orchestrator. The current state of the trial can be accessed by a ",(0,o.kt)("a",{parentName:"p",href:"#controler"},"Controler"),"."),(0,o.kt)("p",null,"Possible Trial States are defined as:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/docs/reference/python#class-cogmenttrialstateenumenum"},(0,o.kt)("inlineCode",{parentName:"a"},"cogment.TrialState"))," in the Python SDK."),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/docs/reference/javascript#enum-cogmenttrialstate"},(0,o.kt)("inlineCode",{parentName:"a"},"cogment.TrialState"))," in the Javascript SDK."),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/docs/reference/grpc#trialstate"},(0,o.kt)("inlineCode",{parentName:"a"},"cogmentAPI.TrialState"))," in the gRPC API.")),(0,o.kt)("h3",{id:"trial-start"},"Trial start"),(0,o.kt)("p",null,"The trial starts with a request from a ",(0,o.kt)("a",{parentName:"p",href:"#controller"},(0,o.kt)("strong",{parentName:"a"},"Controller"))," to the Orchestrator. At creation the trial is in the ",(0,o.kt)("inlineCode",{parentName:"p"},"INITIALIZING")," state."),(0,o.kt)("p",null,"If no trial params are provided at this stage, registered ",(0,o.kt)("a",{parentName:"p",href:"#pre-trial-hook"},(0,o.kt)("strong",{parentName:"a"},"Pre-trial hooks"))," are called in sequence. The trial is now fully initialized and becomes ",(0,o.kt)("inlineCode",{parentName:"p"},"PENDING")," as it wait for all the components, actors and environment to be available."),(0,o.kt)("p",null,"Once all the non-optional actors are available and the environment sends the initial observation set, the trial becomes ",(0,o.kt)("inlineCode",{parentName:"p"},"RUNNING"),". If at least one non-optional actor is unavailable, it terminates right away and becomes ",(0,o.kt)("inlineCode",{parentName:"p"},"ENDED"),"."),(0,o.kt)("h3",{id:"trial-run"},"Trial run"),(0,o.kt)("p",null,"As long as the trial is ",(0,o.kt)("inlineCode",{parentName:"p"},"RUNNING"),", the Orchestrator executes ",(0,o.kt)("strong",{parentName:"p"},"steps"),":"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"To each ",(0,o.kt)("a",{parentName:"li",href:"#actor"},"actor"),", the Orchestrator sends an event, having the ",(0,o.kt)("inlineCode",{parentName:"li"},"ACTIVE")," type, containing its observation,"),(0,o.kt)("li",{parentName:"ul"},"The Orchestrator then waits to receive one action per actor,"),(0,o.kt)("li",{parentName:"ul"},"To the ",(0,o.kt)("a",{parentName:"li",href:"#environment"},"environment"),", the Orchestrator sends an event, having the ",(0,o.kt)("inlineCode",{parentName:"li"},"ACTIVE")," type, containing the set of actions,"),(0,o.kt)("li",{parentName:"ul"},"The Orchestrator then waits to receive the set of observations from the environment.")),(0,o.kt)("h3",{id:"trial-end"},"Trial end"),(0,o.kt)("h4",{id:"trial-ended-by-the-environment"},"Trial ended by the environment"),(0,o.kt)("p",null,"This is the normal way for a trial to end."),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},"The ",(0,o.kt)("a",{parentName:"li",href:"#environment"},"environment")," sends the final observation set, using the ",(0,o.kt)("a",{parentName:"li",href:"/docs/reference/python#endself-final_observations"},"session's ",(0,o.kt)("inlineCode",{parentName:"a"},"end")," method"),"."),(0,o.kt)("li",{parentName:"ol"},"The trial state is set to ",(0,o.kt)("inlineCode",{parentName:"li"},"TERMINATING"),"."),(0,o.kt)("li",{parentName:"ol"},"Observations are sent to the ",(0,o.kt)("a",{parentName:"li",href:"#actor"},"actors")," with the event type ",(0,o.kt)("inlineCode",{parentName:"li"},"ENDING"),". ",(0,o.kt)("a",{parentName:"li",href:"#rewards"},"Rewards")," and ",(0,o.kt)("a",{parentName:"li",href:"#messages"},"messages")," sent before that point will sent to their destination; later ones will not."),(0,o.kt)("li",{parentName:"ol"},"Once all the last events are received, the Orchestrator sends a event of type ",(0,o.kt)("inlineCode",{parentName:"li"},"FINAL")," to all the components."),(0,o.kt)("li",{parentName:"ol"},"The trial becomes ",(0,o.kt)("inlineCode",{parentName:"li"},"ENDED"),".")),(0,o.kt)("h4",{id:"soft-termination"},"Soft termination"),(0,o.kt)("p",null,"Soft termination can be triggered either ",(0,o.kt)("strong",{parentName:"p"},"by the user"),", using the ",(0,o.kt)("a",{parentName:"p",href:"#start-and-terminate-trials"},"Controller")," or ",(0,o.kt)("strong",{parentName:"p"},"after a maximum number of steps"),", if the trial Parameter ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/parameters#parameters-reference"},(0,o.kt)("inlineCode",{parentName:"a"},"max_steps"))," is set."),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},"The Orchestrator waits until it receives the next action set from the ",(0,o.kt)("a",{parentName:"li",href:"#actor"},"actors"),"."),(0,o.kt)("li",{parentName:"ol"},"The trial state is set to ",(0,o.kt)("inlineCode",{parentName:"li"},"TERMINATING"),"."),(0,o.kt)("li",{parentName:"ol"},"Actions are sent to the ",(0,o.kt)("a",{parentName:"li",href:"#environment"},"environment")," with the event type ",(0,o.kt)("inlineCode",{parentName:"li"},"ENDING"),"."),(0,o.kt)("li",{parentName:"ol"},"From this point on the flow is the same as when the trial is ",(0,o.kt)("a",{parentName:"li",href:"#trial-ended-by-the-environment"},"ended by the environment"),".")),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"After a soft termination is initiated (i.e. after receiving an event of type ",(0,o.kt)("inlineCode",{parentName:"p"},"ENDING"),"), the next set of observations sent by the environment will always be the last one (i.e. using ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#endself-final_observations"},(0,o.kt)("inlineCode",{parentName:"a"},"end"))," or ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#produce_observationsself-observations"},(0,o.kt)("inlineCode",{parentName:"a"},"produce_observation"))," will have the same behavior).")),(0,o.kt)("h4",{id:"hard-termination"},"Hard termination"),(0,o.kt)("p",null,"Hard termination can be triggered in multiple ways:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},"By the user"),", using the ",(0,o.kt)("a",{parentName:"li",href:"#start-and-terminate-trials"},"Controller"),"."),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},"Because of unavailable actors"),". If a required (non-optional) actor becomes unavailable (for any reason), the trial will be terminated (see ",(0,o.kt)("a",{parentName:"li",href:"#actor-availability"},"Actor Availability"),")."),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},"Because of inactivity"),". If a component (actor, environment, pre-trial hook, etc) does not respond, the trial will be waiting and be inactive. If the trial is inactive for too long (see ",(0,o.kt)("a",{parentName:"li",href:"/docs/reference/parameters#parameters-reference"},"Parameter ",(0,o.kt)("inlineCode",{parentName:"a"},"max_inactivity")),"), it will be terminated. With actor components this may happen when the timeout is too long (or indefinite) then the actor never becomes unavailable (see ",(0,o.kt)("a",{parentName:"li",href:"#actor-availability"},"Actor Availability"),") and the trial will keep waiting for it."),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},"Because of a critical error"),".")),(0,o.kt)("p",null,"In all this cases:"),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},"The trial becomes ",(0,o.kt)("inlineCode",{parentName:"li"},"TERMINATING"),"."),(0,o.kt)("li",{parentName:"ol"},"The Orchestrator sends a event of type ",(0,o.kt)("inlineCode",{parentName:"li"},"FINAL")," to all the components."),(0,o.kt)("li",{parentName:"ol"},"The trial becomes ",(0,o.kt)("inlineCode",{parentName:"li"},"ENDED"),".")))}P.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/354f5e12.51aa68f8.js b/assets/js/354f5e12.51aa68f8.js new file mode 100644 index 0000000..d4f5f05 --- /dev/null +++ b/assets/js/354f5e12.51aa68f8.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[9071],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>u});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=a.createContext({}),c=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=c(e.components);return a.createElement(l.Provider,{value:t},e.children)},d="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},h=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,l=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),d=c(n),h=r,u=d["".concat(l,".").concat(h)]||d[h]||m[h]||o;return n?a.createElement(u,i(i({ref:t},p),{},{components:n})):a.createElement(u,i({ref:t},p))}));function u(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,i=new Array(o);i[0]=h;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[d]="string"==typeof e?e:r,i[1]=s;for(var c=2;c<o;c++)i[c]=n[c];return a.createElement.apply(null,i)}return a.createElement.apply(null,n)}h.displayName="MDXCreateElement"},3056:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>E,contentTitle:()=>I,default:()=>P,frontMatter:()=>C,metadata:()=>x,toc:()=>S});var a=n(7462),r=n(7294),o=n(3905),i=n(6010),s=n(2466),l=n(6550),c=n(1980),p=n(7392),d=n(12);function m(e){return function(e){return r.Children.map(e,(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad <Tabs> child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:n,attributes:a,default:r}}=e;return{value:t,label:n,attributes:a,default:r}}))}function h(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??m(n);return function(e){const t=(0,p.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e}),[t,n])}function u(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function f(e){let{queryString:t=!1,groupId:n}=e;const a=(0,l.k6)(),o=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,c._X)(o),(0,r.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(a.location.search);t.set(o,e),a.replace({...a.location,search:t.toString()})}),[o,a])]}function v(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,o=h(e),[i,s]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(t){if(!u({value:t,tabValues:n}))throw new Error(`Docusaurus error: The <Tabs> has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const a=n.find((e=>e.default))??n[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:t,tabValues:o}))),[l,c]=f({queryString:n,groupId:a}),[p,m]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,o]=(0,d.Nk)(n);return[a,(0,r.useCallback)((e=>{n&&o.set(e)}),[n,o])]}({groupId:a}),v=(()=>{const e=l??p;return u({value:e,tabValues:o})?e:null})();(0,r.useLayoutEffect)((()=>{v&&s(v)}),[v]);return{selectedValue:i,selectValue:(0,r.useCallback)((e=>{if(!u({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);s(e),c(e),m(e)}),[c,m,o]),tabValues:o}}var g=n(2389);const k={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function b(e){let{className:t,block:n,selectedValue:o,selectValue:l,tabValues:c}=e;const p=[],{blockElementScrollPositionUntilNextRender:d}=(0,s.o5)(),m=e=>{const t=e.currentTarget,n=p.indexOf(t),a=c[n].value;a!==o&&(d(t),l(a))},h=e=>{let t=null;switch(e.key){case"Enter":m(e);break;case"ArrowRight":{const n=p.indexOf(e.currentTarget)+1;t=p[n]??p[0];break}case"ArrowLeft":{const n=p.indexOf(e.currentTarget)-1;t=p[n]??p[p.length-1];break}}t?.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.Z)("tabs",{"tabs--block":n},t)},c.map((e=>{let{value:t,label:n,attributes:s}=e;return r.createElement("li",(0,a.Z)({role:"tab",tabIndex:o===t?0:-1,"aria-selected":o===t,key:t,ref:e=>p.push(e),onKeyDown:h,onClick:m},s,{className:(0,i.Z)("tabs__item",k.tabItem,s?.className,{"tabs__item--active":o===t})}),n??t)})))}function y(e){let{lazy:t,children:n,selectedValue:a}=e;const o=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},o.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a}))))}function N(e){const t=v(e);return r.createElement("div",{className:(0,i.Z)("tabs-container",k.tabList)},r.createElement(b,(0,a.Z)({},e,t)),r.createElement(y,(0,a.Z)({},e,t)))}function w(e){const t=(0,g.Z)();return r.createElement(N,(0,a.Z)({key:String(t)},e))}const _={tabItem:"tabItem_Ymn6"};function T(e){let{children:t,hidden:n,className:a}=e;return r.createElement("div",{role:"tabpanel",className:(0,i.Z)(_.tabItem,a),hidden:n},t)}const C={sidebar_position:2},I="Development guide",x={unversionedId:"guide/development-guide",id:"guide/development-guide",title:"Development guide",description:"This document gives a high level view of what it is to develop a Cogment based application using Cogment SDKs. It assumes the reader is familiar with the Cogment core concepts.",source:"@site/docs/guide/development-guide.mdx",sourceDirName:"guide",slug:"/guide/development-guide",permalink:"/docs/guide/development-guide",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"docSidebar",previous:{title:"Core Concepts",permalink:"/docs/guide/core-concepts"},next:{title:"Implementation Recipes",permalink:"/docs/guide/implementation-recipes/"}},E={},S=[{value:"The spec file",id:"the-spec-file",level:2},{value:"Compiling the spec file",id:"compiling-the-spec-file",level:3},{value:"Environment",id:"environment",level:2},{value:"Sending observations",id:"sending-observations",level:3},{value:"Actor",id:"actor",level:2},{value:"Service actor / Client actor",id:"service-actor--client-actor",level:3},{value:"Actor Availability",id:"actor-availability",level:3},{value:"Controller",id:"controller",level:2},{value:"Start and terminate trials",id:"start-and-terminate-trials",level:3},{value:"Start trial from trial parameters",id:"start-trial-from-trial-parameters",level:4},{value:"Watch trials",id:"watch-trials",level:3},{value:"Rewards",id:"rewards",level:2},{value:"Creating",id:"creating",level:3},{value:"Consuming",id:"consuming",level:3},{value:"Messages",id:"messages",level:2},{value:"Creating",id:"creating-1",level:3},{value:"Consuming",id:"consuming-1",level:3},{value:"Pre-trial hook",id:"pre-trial-hook",level:2},{value:"Trial lifetime",id:"trial-lifetime",level:2},{value:"Trial start",id:"trial-start",level:3},{value:"Trial run",id:"trial-run",level:3},{value:"Trial end",id:"trial-end",level:3},{value:"Trial ended by the environment",id:"trial-ended-by-the-environment",level:4},{value:"Soft termination",id:"soft-termination",level:4},{value:"Hard termination",id:"hard-termination",level:4}],A={toc:S},O="wrapper";function P(e){let{components:t,...n}=e;return(0,o.kt)(O,(0,a.Z)({},A,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"development-guide"},"Development guide"),(0,o.kt)("p",null,"This document gives a high level view of what it is to develop a Cogment based application using Cogment SDKs. It assumes the reader is familiar with the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts"},"Cogment core concepts"),"."),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"Some features aren't available in Javascript, if there's only Python examples under a certain section, that feature is python only.")),(0,o.kt)("p",null,"The High-level Cogment API expects users to use ",(0,o.kt)("a",{parentName:"p",href:"https://developers.google.com/protocol-buffers/"},"protocol buffers")," to declare a project's data structures. The intricacies of protobufs are beyond the scope of this document. Basic knowledge of the technology and its usage is assumed."),(0,o.kt)("h2",{id:"the-spec-file"},"The spec file"),(0,o.kt)("p",null,"The spec file, usually named ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml"),", defines the specifics of a type of trials for a Cogment app: actor classes as well as environment & trial configuration types. It is the starting point for a project."),(0,o.kt)("p",null,"An actor class is primarily defined by its observation space and action space."),(0,o.kt)("p",null,"The data structures describing these spaces are declared by using a protocol buffer message type. ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#observations--actions"},"Observations and actions")," will simply be instances of the matching type."),(0,o.kt)("p",null,"For example, in the following, ",(0,o.kt)("inlineCode",{parentName:"p"},"driver")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"pedestrian")," share a common view of the environment, hence use the same observation space, but have different actions available to them."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-yaml"},"import:\n proto:\n - city.proto\n\nactors:\n driver:\n observation:\n space: city.Observation\n\n action:\n space: city.DriverAction\n\n pedestrian:\n observation:\n space: city.Observation\n\n action:\n space: city.PedestrianAction\n")),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"This shows only the relevant part of the full spec file, you can find the full list of configurable options ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/cogment-yaml"},"in the reference page"),".")),(0,o.kt)("h3",{id:"compiling-the-spec-file"},"Compiling the spec file"),(0,o.kt)("p",null,"In order to use the spec file within the various supported languages, it needs to be compiled. This is done by the code generation modules of the specific language's SDK you are using."),(0,o.kt)(w,{mdxType:"Tabs"},(0,o.kt)(T,{value:"python",label:"Python",default:!0,mdxType:"TabItem"},(0,o.kt)("p",null,"For the python SDK, the generation step requires an ",(0,o.kt)("a",{parentName:"p",href:"https://peps.python.org/pep-0508/#extras"},"extra")," from the ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment")," package. Using pip you can install the SDK with its extra using:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"pip install cogment[generate]\n")),(0,o.kt)("p",null,"The generation can then be executed using:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"python -m cogment.generate cogment.yaml\n")),(0,o.kt)("p",null,"This will create a ",(0,o.kt)("inlineCode",{parentName:"p"},"cog_settings.py")," file as well as multiple ",(0,o.kt)("inlineCode",{parentName:"p"},"*_pb.py")," files.")),(0,o.kt)(T,{value:"javascript",label:"Javascript",mdxType:"TabItem"},(0,o.kt)("p",null,"For the Javascript SDK, the generation requires the SDK to be installed:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"npm install @cogment/cogment-js-sdk\n")),(0,o.kt)("p",null,"The generation can then be executed using:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"npx cogment-js-sdk-generate cogment.yaml\n")),(0,o.kt)("p",null,"This will create several files in the ",(0,o.kt)("inlineCode",{parentName:"p"},"src")," folder: ",(0,o.kt)("inlineCode",{parentName:"p"},"CogSettings.js"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"CogSettings.d.ts"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"CogSettings.d.ts.map")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"CogTypes.d.ts")," as well multiple ",(0,o.kt)("inlineCode",{parentName:"p"},"*_pb.js")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"*_pb.d.ts")," files."))),(0,o.kt)("h2",{id:"environment"},"Environment"),(0,o.kt)("p",null,(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#environment"},"Environments")," are implemented by functions that take a ",(0,o.kt)("em",{parentName:"p"},"environment session")," instance."),(0,o.kt)("p",null,"This function will be called once for each ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#trial"},"trial"),". This function usually consists of three sections."),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"The environment's ",(0,o.kt)("strong",{parentName:"li"},"initialization"),", where its internal state can be initialized and processes started. It ends with the sending of the initial observations to the actors participating in the trial."),(0,o.kt)("li",{parentName:"ul"},"Its ",(0,o.kt)("strong",{parentName:"li"},"event loop"),", where the environment iterates through the events occurring during the trial and produces ",(0,o.kt)("a",{parentName:"li",href:"/docs/guide/core-concepts#observations--actions"},"observations")," as well as receives messages. In this loop the environment can end the trial on its own or the end can be requested, see the ",(0,o.kt)("a",{parentName:"li",href:"#trial-lifetime"},"Trial lifetime")," section for further information."),(0,o.kt)("li",{parentName:"ul"},"Its ",(0,o.kt)("strong",{parentName:"li"},"termination"),", where cleanup occurs.")),(0,o.kt)("p",null,"In the common case where all actors within a trial share the same observation, a bare-minimum environment service would look like this:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'async def environment(environment_session):\n # -- Initialization --\n\n # Retrieve the actors participating in the trial\n actors = environment_session.get_active_actors()\n\n # Start the trial and send a starting observation to all actors\n environment_session.start([("*", Observation())])\n\n # -- Event loop --\n async for event in environment_session.all_events():\n if event.actions:\n # `event.actions` is a list of the actions done by the actors\n actions = event.actions\n if event.type == cogment.EventType.ACTIVE:\n # The trial is active, produce an observation in response to the actions\n environment_session.produce_observations([("*", Observation())])\n # Alternatively the environment can decide to **end** the trial with the following\n # environment_session.end([("*", Observation())])\n else:\n # The trial termination has been requested\n # Produce a final observation\n environment_session.end([("*", Observation())])\n\n for message in event.messages:\n # `event.messages` is a list of all the messages received by the environment (it can be empty)\n\n # Handle each message here.\n\n # -- Termination --\n print(f"Trial [{environment_session.get_trial_id()}] terminated")\n')),(0,o.kt)("p",null,"For further details, take a look at the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-environmentsessionsession"},(0,o.kt)("inlineCode",{parentName:"a"},"cogment.EnvironmentSession"))," class reference."),(0,o.kt)("p",null,"This environment implementation needs to be registered and served so that the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#orchestrator"},"Orchestrator")," can reach it. This can be done through a ",(0,o.kt)("inlineCode",{parentName:"p"},"Context")," instance."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'context = cogment.Context(user_id="my_user_id", cog_settings=cog_settings)\n\ncontext.register_environment(impl=environment, impl_name="my_environment")\n\nawait context.serve_all_registered(cogment.ServedEndpoint(port=9000))\n')),(0,o.kt)("p",null,"For further details, take a look at the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-cogmentcontext"},(0,o.kt)("inlineCode",{parentName:"a"},"cogment.Context"))," class reference."),(0,o.kt)("h3",{id:"sending-observations"},"Sending observations"),(0,o.kt)("p",null,"The environment session has 3 different methods able to send observations: ",(0,o.kt)("inlineCode",{parentName:"p"},"start"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"produce_observations")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"end"),". Each of those methods takes a list of 2-tuples destination / observation."),(0,o.kt)("p",null,"As demonstrated above, sending the same observation to all actors is done using ",(0,o.kt)("inlineCode",{parentName:"p"},'"*"')," as the destination."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'environment_session.produce_observations([("*", Observation(...))])\n')),(0,o.kt)("p",null,"It is also possible to send different observations to different actors. This can be useful to send observations of the ",(0,o.kt)("em",{parentName:"p"},"world")," from the point of view of the actor or to send partial observations."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'environment_session.produce_observations([\n ("my_first_actor_name", Observation(...)),\n ("my_second_actor_name", Observation(...))\n])\n')),(0,o.kt)("p",null,"Please note that the environment should always send observations such as each actor in the trial receives one."),(0,o.kt)("h2",{id:"actor"},"Actor"),(0,o.kt)("p",null,(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#actor"},"Actors")," implementations look a lot like the ",(0,o.kt)("a",{parentName:"p",href:"#environment"},"environment's"),". They take ",(0,o.kt)("em",{parentName:"p"},"actor session")," instance and have the same three sections: ",(0,o.kt)("strong",{parentName:"p"},"initialization"),", ",(0,o.kt)("strong",{parentName:"p"},"event loop")," and ",(0,o.kt)("strong",{parentName:"p"},"termination"),"."),(0,o.kt)("p",null,"The event loops in Actors' implementations handle three basic types of events:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"observation")," produced by the environment and should lead to an action being done."),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"rewards")," sent by other actors or the environment, we'll talk about them in more details ",(0,o.kt)("a",{parentName:"li",href:"#reward"},"below"),"."),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"messages")," sent by other actors or the environment, we'll talk about them in more details ",(0,o.kt)("a",{parentName:"li",href:"#messages"},"below"),".")),(0,o.kt)("p",null,"A typical actor implementation would look like this:"),(0,o.kt)(w,{mdxType:"Tabs"},(0,o.kt)(T,{value:"python",label:"Python",default:!0,mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'async def driver_actor(actor_session):\n # -- Initialization --\n\n # Notify that the actor is ready for the trial to start.\n actor_session.start()\n\n async for event in actor_session.all_events():\n if event.observation:\n # `event.observation` is an instance of the Observation produced by the environment\n observation = event.observation\n if event.type == cogment.EventType.ACTIVE:\n # The trial is active, it is expecting the agent to do an action\n actor_session.do_action(DriverAction(...))\n\n for reward in event.rewards:\n # `event.rewards` is a list of all the rewards received by the actor (it can be empty)\n\n # Handle each reward here.\n\n for message in event.messages:\n # `event.messages` is a list of all the messages received by the actor (it can be empty)\n\n # Handle each message here.\n\n # -- Termination --\n print(f"Trial [{actor_session.get_trial_id()}] terminated")\n')),(0,o.kt)("p",null,"For further details, take a look at the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-actorsessionsession"},(0,o.kt)("inlineCode",{parentName:"a"},"cogment.ActorSession"))," class reference.")),(0,o.kt)(T,{value:"javascript",label:"Javascript",mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-javascript"},"const driverActor = async (actorSession) => {\n // -- Initialization --\n\n // Notify that the actor is ready for the trial to start.\n actorSession.start();\n\n for await (const event of actorSession.eventLoop()) {\n if (event.observation) {\n // `event.observation` is an instance of the Observation produced by the environment\n observation = event.observation;\n if (event.type === cogment.EventType.ACTIVE) {\n // The trial is active, it is expecting the agent to do an action\n actorSession.sendAction(new DriverAction());\n }\n }\n for (const reward of event.rewards) {\n // `event.rewards` is a list of all the rewards received by the actor (it can be empty)\n // Handle each reward here.\n }\n for (const message of event.messages) {\n // `event.messages` is a list of all the messages received by the actor (it can be empty)\n // Handle each message here.\n }\n }\n\n // -- Termination --\n console.log(`Trial [${actorSession.getTrialId()}] terminated`);\n};\n")),(0,o.kt)("p",null,"For further details, take a look at the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/javascript#class-actorsession-extends-session"},(0,o.kt)("inlineCode",{parentName:"a"},"ActorSession"))," class reference."))),(0,o.kt)("h3",{id:"service-actor--client-actor"},"Service actor / Client actor"),(0,o.kt)("p",null,"A Cogment app can use two types of actors, they are identical in terms of implementation but differ in how they interact with the app's ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#orchestrator"},"Orchestrator"),"."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"Service actors")," are accessible in the same way the environment is, through a ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-cogmentcontext"},(0,o.kt)("inlineCode",{parentName:"a"},"Context"))," instance."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'context = cogment.Context(cog_settings=cog_settings, user_id="my_user_id")\ncontext.register_actor(impl=actor, impl_name="driver_actor", actor_classes=["driver"])\ncontext.register_actor(impl=actor_slow, impl_name="driver_actor_slow", actor_classes=["driver"])\n\nawait context.serve_all_registered(cogment.ServedEndpoint(port=9000))\n')),(0,o.kt)("p",null,"Note that it is also through this registrating that the implementation is associated with one or more actor classes it implements."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"Client actors"),", contrary to Service actors, are not served to the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#orchestrator"},"Orchestrator"),". They connect as clients of the Orchestrator and join a ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#trial"},"trial")," that has started."),(0,o.kt)(w,{mdxType:"Tabs"},(0,o.kt)(T,{value:"python",label:"Python",default:!0,mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'context = cogment.Context(cog_settings=cog_settings, user_id="my_user_id")\ncontext.register_actor(\n impl=actor,\n impl_name="human_pedestrian",\n actor_classes=["pedestrian"]\n)\n\nawait context.join_trial(\n trial_id=trial_id,\n cogment.Endpoint(url="grpc://orchestrator:9000"),\n actor_name="Alice"\n)\n'))),(0,o.kt)(T,{value:"javascript",label:"Javascript",mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-javascript"},'const context = new Context(cogSettings, "my_user_id");\n\ncontext.registerActor(actorImpl, "human_pedestrian", "pedestrian");\n\nawait context.joinTrial(trialId, "grpc://orchestrator:9000", "Alice");\n')))),(0,o.kt)("p",null,"Note that a trial including one or more client actors will wait for all of them to join before any actor can start processing events."),(0,o.kt)("p",null,"Due to the different network requirements, client actors are a good fit when implementing a frontend for human actors."),(0,o.kt)("h3",{id:"actor-availability"},"Actor Availability"),(0,o.kt)("p",null,"There are four actor parameters (see ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/parameters#parameters-reference"},"Trial Parameters"),") to manage actor responses for a trial: ",(0,o.kt)("inlineCode",{parentName:"p"},"initial_connection_timeout"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"response_timeout"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"optional")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"default_action"),".\nThe timeouts control when an actor becomes unavailable, and the other two control what happens when it becomes unavailable."),(0,o.kt)("p",null,"The trial will be ",(0,o.kt)("a",{parentName:"p",href:"#hard-termination"},(0,o.kt)("em",{parentName:"a"},"hard")," terminated")," by the Orchestrator if a required (non-optional) actor becomes unavailable, whereas it can continue if an optional actor becomes unavailable."),(0,o.kt)("p",null,"The ",(0,o.kt)("inlineCode",{parentName:"p"},"default_action")," is for optional actors; when the actor is unavailable, the default action will be sent to the environment. If there is no default action defined, the environment is informed that the actor is unavailable, but no action is provided."),(0,o.kt)("p",null,"E.g. If a required actor (with ",(0,o.kt)("inlineCode",{parentName:"p"},"optional")," set to False) has a ",(0,o.kt)("inlineCode",{parentName:"p"},"response_timeout")," set to 5.0 seconds, but takes more than 5 seconds to respond to a new observation (e.g. due to excessive computation, or a crash), then the trial will be terminated."),(0,o.kt)("h2",{id:"controller"},"Controller"),(0,o.kt)("p",null,(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#trial"},"Trials")," are started by clients of the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#orchestrator"},"Orchestrator")," using a Controller. Instances of a controller are built from the context instance and connect to an Orchestrator endpoint."),(0,o.kt)(w,{mdxType:"Tabs"},(0,o.kt)(T,{value:"python",label:"Python",default:!0,mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'controller = context.get_controller(\n endpoint=cogment.Endpoint(url="grpc://orchestrator:9000")\n)\n')),(0,o.kt)("p",null,"For further details, take a look at the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-controller"},(0,o.kt)("inlineCode",{parentName:"a"},"Controller"))," class reference.")),(0,o.kt)(T,{value:"javascript",label:"Javascript",mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-javascript"},'const controller = context.getController("grpc://orchestrator:9000");\n')),(0,o.kt)("p",null,"For further details, take a look at the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/javascript#class-controller"},(0,o.kt)("inlineCode",{parentName:"a"},"Controller"))," class reference."))),(0,o.kt)("h3",{id:"start-and-terminate-trials"},"Start and terminate trials"),(0,o.kt)("p",null,"The controller can then be used to create trials and request their termination."),(0,o.kt)(w,{mdxType:"Tabs"},(0,o.kt)(T,{value:"python",label:"Python",default:!0,mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"trial_id = await controller.start_trial(trial_config=TrialConfig())\n\n# ...\n\nawait controller.terminate_trial([trial_id])\n"))),(0,o.kt)(T,{value:"javascript",label:"Javascript",mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-javascript"},"const trialId = await controller.startTrial(new TrialConfig());\n\n// ...\n\nawait controller.terminateTrial([trialId]);\n")))),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"The default behavior of the Controller's ",(0,o.kt)("em",{parentName:"p"},"terminate trial")," function is to trigger a ",(0,o.kt)("a",{parentName:"p",href:"#soft-termination"},"soft termination"),", an optional ",(0,o.kt)("inlineCode",{parentName:"p"},"hard")," parameters can be set to ",(0,o.kt)("inlineCode",{parentName:"p"},"True")," to trigger a ",(0,o.kt)("a",{parentName:"p",href:"#hard-termination"},"hard termination"),".")),(0,o.kt)("h4",{id:"start-trial-from-trial-parameters"},"Start trial from trial parameters"),(0,o.kt)("p",null,"The above example uses an instance of the user-defined trial configuration to start the trial. This instance is then provided to a ",(0,o.kt)("a",{parentName:"p",href:"#pre-trial-hook"},"pre-trial hook")," to fully define the trial parameters. It is also possible to fully provide the trial parameters when starting the trial."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'actor_1_params = cogment.ActorParameters(\n cog_settings,\n name="Alice",\n class_name="pedestrian",\n endpoint="cogment://client"\n)\nactor_2_params = cogment.ActorParameters(\n cog_settings,\n name="ai_driver",\n class_name="driver",\n endpoint="grpc://driver_actors:9000",\n implementation="driver_actor_slow"\n)\n\nenvironment_config=EnvironmentConfig(\n # ...\n)\n\ntrial_params=cogment.TrialParameters(\n cog_settings,\n environment_name="environment",\n environment_implementation="my_environment"\n environment_endpoint="grpc://environment:9000",\n environment_config=environment_config,\n actors=[\n actor_1_params,\n actor_2_params,\n ]\n)\n')),(0,o.kt)("p",null,"For further details, take a look at the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-cogmenttrialparameters"},(0,o.kt)("inlineCode",{parentName:"a"},"cogment.TrialParameters"))," class reference."),(0,o.kt)("h3",{id:"watch-trials"},"Watch trials"),(0,o.kt)("p",null,"The controller can also be used to subscribe to events occuring in the trials run by the Orchestrator it connects to. For example, this can be used to wait for a trial's end:"),(0,o.kt)(w,{mdxType:"Tabs"},(0,o.kt)(T,{value:"python",label:"Python",default:!0,mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'async for trial_info in controller.watch_trials(trial_state_filters=[\n cogment.TrialState.ENDED\n]):\n print(f"The trial having id [{trial_info.trial_id}] ended")\n'))),(0,o.kt)(T,{value:"javascript",label:"Javascript",mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-javascript"},"for await (const trialListEntry of controller.watchTrials([\n cogment.TrialState.ENDED,\n])) {\n console.log(`The trial having id ${trialListEntry.getTrialId()} ended.`);\n}\n")))),(0,o.kt)("h2",{id:"rewards"},"Rewards"),(0,o.kt)("h3",{id:"creating"},"Creating"),(0,o.kt)("p",null,"Rewards are sent to ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#actor"},"Actors")," from another actor or the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#environment"},"Environment"),". The ",(0,o.kt)("inlineCode",{parentName:"p"},"session")," instance passed to their implementation can be used for this purpose."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"session.add_reward(value=-1, confidence=1, tick_id=-1, to=['an_actor_name'])\n")),(0,o.kt)("p",null,"Rewards consist of an arbitrary numerical ",(0,o.kt)("strong",{parentName:"p"},"value"),' describing how the reward "sender" ',(0,o.kt)("em",{parentName:"p"},"believes")," the actor performed.\nIt is ",(0,o.kt)("em",{parentName:"p"},"weighted")," by a value between 0 and 1 qualifying the ",(0,o.kt)("strong",{parentName:"p"},"confidence"),' of the "sender" in its reward, from a very low confidence just above 0 to a very high confidence approaching 1.\nThe confidence value is used to collate all the rewards sent to an actor at the same time.\nOptionally, a reward can be provided with arbitrary user data.'),(0,o.kt)("p",null,"Each reward applies to a list of recipients (either all the actors, all the actors of a given class or a specific actor) at a specific point in time, during the trial, defined as a ",(0,o.kt)("strong",{parentName:"p"},"tick"),'.\nThe tick ID can represent a past action if the value is smaller than the current tick ID ("future" actions are not allowed).\nPast actions, like sending a reward related to a past tick ID, are handled in accordance with the ',(0,o.kt)("a",{parentName:"p",href:"/docs/reference/parameters#nb_buffered_ticks"},"nb_buffered_ticks")," trial parameter."),(0,o.kt)("p",null,"The full documentation for ",(0,o.kt)("inlineCode",{parentName:"p"},"session.add_reward")," can be found ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#add_rewardself-value-confidence-to-tick_id-1-user_datanone"},"here"),"."),(0,o.kt)("h3",{id:"consuming"},"Consuming"),(0,o.kt)("p",null,"All the Rewards that are sent and destined to each specific ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#actor"},"actor")," for a given point in time are collated together by the framework."),(0,o.kt)("p",null,"The ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#actor"},"actor")," can take into account the reward directly as the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#trial"},"trial")," is running by consuming the ",(0,o.kt)("inlineCode",{parentName:"p"},'"reward"')," event in their event loop."),(0,o.kt)(w,{mdxType:"Tabs"},(0,o.kt)(T,{value:"python",label:"Python",default:!0,mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"async for event in actor_session.all_events():\n # [...]\n for reward in event.rewards:\n # `reward.tick_id` is the id of the tick this reward concerns.\n tick_id = reward.tick_id\n # `reward.value` is the aggregated value of the reward.\n value = reward.value\n for source_reward in reward.all_sources():\n # Iterate over individual source rewards.\n reward_value = source_reward.value\n reward_confidence = source_reward.confidence\n reward_sender = source_reward.sender\n reward_user_data = source_reward.user_data\n"))),(0,o.kt)(T,{value:"javascript",label:"Javascript",mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-javascript"},"for await (const event of actorSession.eventLoop()) {\n // [...]\n for (const reward of event.rewards) {\n // `reward.tickId` is the id of the tick this reward concerns.\n const tickId = reward.tickId;\n // `reward.value` is the aggregated value of the reward.\n const value = reward.value;\n for (sourceReward of reward.sourcesList) {\n // Iterate over individual source rewards.\n const rewardValue = sourceReward.value;\n const rewardConfidence = sourceReward.confidence;\n const rewardSender = sourceReward.senderName;\n const rewardUserData = sourceReward.userData;\n }\n }\n}\n")))),(0,o.kt)("h2",{id:"messages"},"Messages"),(0,o.kt)("h3",{id:"creating-1"},"Creating"),(0,o.kt)("p",null,"Messages can be created and sent between ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#actor"},"actors")," or the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#environment"},"environment")," within a trial using their ",(0,o.kt)("inlineCode",{parentName:"p"},"session")," instance."),(0,o.kt)(w,{mdxType:"Tabs"},(0,o.kt)(T,{value:"python",label:"Python",default:!0,mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"session.send_message(\n user_data=MyProtobufDataStructure(...), # any protobuf data structure can be used here.\n to=['pedestrian:*'], # send the message to all the actors of the \"pedestrian\" class\n)\n")),(0,o.kt)("p",null,"The full documentation for ",(0,o.kt)("inlineCode",{parentName:"p"},"session.send_message")," can be found ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#send_messageself-payload-to-to_environmentfalse"},"here"),".")),(0,o.kt)(T,{value:"javascript",label:"Javascript",mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-javascript"},'const message = new Message();\nmessage.setRequest("hello");\n\n// Now we serialize into an Any protobuf message.\nconst anyPb = new MyProtobufDataStructure();\nanyPb.pack(message.serializeBinary(), "cogment_app.Message");\n\nactorSession.sendMessage({\n from: actorName,\n payload: anyPb,\n to: "otherActorName",\n trialId,\n});\n')),(0,o.kt)("p",null,"The full documentation for ",(0,o.kt)("inlineCode",{parentName:"p"},"actorSession.sendMessage")," can be found ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/javascript#sendmessagepayload-to"},"here"),"."))),(0,o.kt)("p",null,"Messages consist of an arbitrary payload, their ",(0,o.kt)("inlineCode",{parentName:"p"},"user_data/payload"),", defined as an instance of any protobuf data structure."),(0,o.kt)("p",null,"A message can be sent to one, many or all actors in a trial and / or to the environment."),(0,o.kt)("h3",{id:"consuming-1"},"Consuming"),(0,o.kt)("p",null,"All the messages that are sent and intended for each specific actor or environment will be received by the target actor or environment."),(0,o.kt)("p",null,"Actors or the environment can use the message directly, live, as the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#trial"},"trial")," is running, by consuming message event in their event loop."),(0,o.kt)(w,{mdxType:"Tabs"},(0,o.kt)(T,{value:"python",label:"Python",default:!0,mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"async for event in actor_session.all_events():\n # [...]\n for message in event.messages:\n # `message.sender_name` is the name of the actor who sent a message\n sender_name = message.sender_name\n # `message.payload` is the content of the message, it needs to be unpacked\n payload = message.payload\n"))),(0,o.kt)(T,{value:"javascript",label:"Javascript",mdxType:"TabItem"},(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-javascript"},'for await (const event of actorSession.eventLoop()) {\n // [...]\n for (const message of event.messages) {\n // `message.sender_name` is the name of the actor who sent a message\n const sender = message.sender;\n // `message.data` is the content of the message, it needs to be unpacked\n const data = message.data;\n\n const newMessage = data.unpack(\n (x: Uint8Array) => Message.deserializeBinary(x),\n "cogment_app.Message"\n );\n }\n}\n')))),(0,o.kt)("h2",{id:"pre-trial-hook"},"Pre-trial hook"),(0,o.kt)("p",null,"When starting a trial from a controller, an instance of the message type defined in ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/cogment-yaml#trial"},(0,o.kt)("inlineCode",{parentName:"a"},"trial:config_type"))," can be provided. This instance is then passed to the registered ",(0,o.kt)("strong",{parentName:"p"},"Pre trial hooks")," when the Orcehstrator was started. The role of these hooks is to fully parametrize the trial based on the provided config. To achieve that, they can modify the default trial params defined in the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/parameters"},"parameters")," to specify the environment (i.e. its endpoint, implementation name & configuration), the number and parameters of the participant actors (i.e. their name, class, endpoint, implementation name & configuration) as well as additional parameters for the trial. The pre-trial hook can therefore be used to dynamically configure trials, to act as a service endpoint registry, or a load balancer."),(0,o.kt)("p",null,"Pre-trial hook implementations are registered in the same way the environment or actor implementation are and follow the same ",(0,o.kt)("em",{parentName:"p"},"session")," pattern."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'async def my_pre_trial_hook(pre_hook_session):\n # The trial config provided by the controller can be retrieved like that\n trial_config = pre_hook_session.trial_config\n # The trial params can be edited directly\n pre_hook_session.environment_config = # [...]\n pre_hook_session.environment_endpoint = "grpc://my_environment:9000"\n pre_hook_session.actors = [\n {\n "name": "my_first_actor_name",\n "actor_class": "driver",\n "endpoint": "grpc://driver:9000",\n "implementation": "driver_actor",\n "config": # [...],\n },\n {\n "name": "my_second_actor_name",\n "actor_class": "predestrian",\n "endpoint": "cogment://client",\n "config": # [...],\n },\n ]\n # And finally should be validated\n pre_hook_session.validate()\n\ncontext.register_pre_trial_hook(impl=my_pre_trial_hook)\n')),(0,o.kt)("h2",{id:"trial-lifetime"},"Trial lifetime"),(0,o.kt)("p",null,"Over their lifetime trials can be in different states managed by the Orchestrator. The current state of the trial can be accessed by a ",(0,o.kt)("a",{parentName:"p",href:"#controler"},"Controler"),"."),(0,o.kt)("p",null,"Possible Trial States are defined as:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/docs/reference/python#class-cogmenttrialstateenumenum"},(0,o.kt)("inlineCode",{parentName:"a"},"cogment.TrialState"))," in the Python SDK."),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/docs/reference/javascript#enum-cogmenttrialstate"},(0,o.kt)("inlineCode",{parentName:"a"},"cogment.TrialState"))," in the Javascript SDK."),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/docs/reference/grpc#trialstate"},(0,o.kt)("inlineCode",{parentName:"a"},"cogmentAPI.TrialState"))," in the gRPC API.")),(0,o.kt)("h3",{id:"trial-start"},"Trial start"),(0,o.kt)("p",null,"The trial starts with a request from a ",(0,o.kt)("a",{parentName:"p",href:"#controller"},(0,o.kt)("strong",{parentName:"a"},"Controller"))," to the Orchestrator. At creation the trial is in the ",(0,o.kt)("inlineCode",{parentName:"p"},"INITIALIZING")," state."),(0,o.kt)("p",null,"If no trial params are provided at this stage, registered ",(0,o.kt)("a",{parentName:"p",href:"#pre-trial-hook"},(0,o.kt)("strong",{parentName:"a"},"Pre-trial hooks"))," are called in sequence. The trial is now fully initialized and becomes ",(0,o.kt)("inlineCode",{parentName:"p"},"PENDING")," as it wait for all the components, actors and environment to be available."),(0,o.kt)("p",null,"Once all the non-optional actors are available and the environment sends the initial observation set, the trial becomes ",(0,o.kt)("inlineCode",{parentName:"p"},"RUNNING"),". If at least one non-optional actor is unavailable, it terminates right away and becomes ",(0,o.kt)("inlineCode",{parentName:"p"},"ENDED"),"."),(0,o.kt)("h3",{id:"trial-run"},"Trial run"),(0,o.kt)("p",null,"As long as the trial is ",(0,o.kt)("inlineCode",{parentName:"p"},"RUNNING"),", the Orchestrator executes ",(0,o.kt)("strong",{parentName:"p"},"steps"),":"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"To each ",(0,o.kt)("a",{parentName:"li",href:"#actor"},"actor"),", the Orchestrator sends an event, having the ",(0,o.kt)("inlineCode",{parentName:"li"},"ACTIVE")," type, containing its observation,"),(0,o.kt)("li",{parentName:"ul"},"The Orchestrator then waits to receive one action per actor,"),(0,o.kt)("li",{parentName:"ul"},"To the ",(0,o.kt)("a",{parentName:"li",href:"#environment"},"environment"),", the Orchestrator sends an event, having the ",(0,o.kt)("inlineCode",{parentName:"li"},"ACTIVE")," type, containing the set of actions,"),(0,o.kt)("li",{parentName:"ul"},"The Orchestrator then waits to receive the set of observations from the environment.")),(0,o.kt)("h3",{id:"trial-end"},"Trial end"),(0,o.kt)("h4",{id:"trial-ended-by-the-environment"},"Trial ended by the environment"),(0,o.kt)("p",null,"This is the normal way for a trial to end."),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},"The ",(0,o.kt)("a",{parentName:"li",href:"#environment"},"environment")," sends the final observation set, using the ",(0,o.kt)("a",{parentName:"li",href:"/docs/reference/python#endself-final_observations"},"session's ",(0,o.kt)("inlineCode",{parentName:"a"},"end")," method"),"."),(0,o.kt)("li",{parentName:"ol"},"The trial state is set to ",(0,o.kt)("inlineCode",{parentName:"li"},"TERMINATING"),"."),(0,o.kt)("li",{parentName:"ol"},"Observations are sent to the ",(0,o.kt)("a",{parentName:"li",href:"#actor"},"actors")," with the event type ",(0,o.kt)("inlineCode",{parentName:"li"},"ENDING"),". ",(0,o.kt)("a",{parentName:"li",href:"#rewards"},"Rewards")," and ",(0,o.kt)("a",{parentName:"li",href:"#messages"},"messages")," sent before that point will sent to their destination; later ones will not."),(0,o.kt)("li",{parentName:"ol"},"Once all the last events are received, the Orchestrator sends a event of type ",(0,o.kt)("inlineCode",{parentName:"li"},"FINAL")," to all the components."),(0,o.kt)("li",{parentName:"ol"},"The trial becomes ",(0,o.kt)("inlineCode",{parentName:"li"},"ENDED"),".")),(0,o.kt)("h4",{id:"soft-termination"},"Soft termination"),(0,o.kt)("p",null,"Soft termination can be triggered either ",(0,o.kt)("strong",{parentName:"p"},"by the user"),", using the ",(0,o.kt)("a",{parentName:"p",href:"#start-and-terminate-trials"},"Controller")," or ",(0,o.kt)("strong",{parentName:"p"},"after a maximum number of steps"),", if the trial Parameter ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/parameters#parameters-reference"},(0,o.kt)("inlineCode",{parentName:"a"},"max_steps"))," is set."),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},"The Orchestrator waits until it receives the next action set from the ",(0,o.kt)("a",{parentName:"li",href:"#actor"},"actors"),"."),(0,o.kt)("li",{parentName:"ol"},"The trial state is set to ",(0,o.kt)("inlineCode",{parentName:"li"},"TERMINATING"),"."),(0,o.kt)("li",{parentName:"ol"},"Actions are sent to the ",(0,o.kt)("a",{parentName:"li",href:"#environment"},"environment")," with the event type ",(0,o.kt)("inlineCode",{parentName:"li"},"ENDING"),"."),(0,o.kt)("li",{parentName:"ol"},"From this point on the flow is the same as when the trial is ",(0,o.kt)("a",{parentName:"li",href:"#trial-ended-by-the-environment"},"ended by the environment"),".")),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"After a soft termination is initiated (i.e. after receiving an event of type ",(0,o.kt)("inlineCode",{parentName:"p"},"ENDING"),"), the next set of observations sent by the environment will always be the last one (i.e. using ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#endself-final_observations"},(0,o.kt)("inlineCode",{parentName:"a"},"end"))," or ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#produce_observationsself-observations"},(0,o.kt)("inlineCode",{parentName:"a"},"produce_observation"))," will have the same behavior).")),(0,o.kt)("h4",{id:"hard-termination"},"Hard termination"),(0,o.kt)("p",null,"Hard termination can be triggered in multiple ways:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},"By the user"),", using the ",(0,o.kt)("a",{parentName:"li",href:"#start-and-terminate-trials"},"Controller"),"."),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},"Because of unavailable actors"),". If a required (non-optional) actor becomes unavailable (for any reason), the trial will be terminated (see ",(0,o.kt)("a",{parentName:"li",href:"#actor-availability"},"Actor Availability"),")."),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},"Because of inactivity"),". If a component (actor, environment, pre-trial hook, etc) does not respond, the trial will be waiting and be inactive. If the trial is inactive for too long (see ",(0,o.kt)("a",{parentName:"li",href:"/docs/reference/parameters#parameters-reference"},"Parameter ",(0,o.kt)("inlineCode",{parentName:"a"},"max_inactivity")),"), it will be terminated. With actor components this may happen when the timeout is too long (or indefinite) then the actor never becomes unavailable (see ",(0,o.kt)("a",{parentName:"li",href:"#actor-availability"},"Actor Availability"),") and the trial will keep waiting for it."),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},"Because of a critical error"),".")),(0,o.kt)("p",null,"In all this cases:"),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},"The trial becomes ",(0,o.kt)("inlineCode",{parentName:"li"},"TERMINATING"),"."),(0,o.kt)("li",{parentName:"ol"},"The Orchestrator sends a event of type ",(0,o.kt)("inlineCode",{parentName:"li"},"FINAL")," to all the components."),(0,o.kt)("li",{parentName:"ol"},"The trial becomes ",(0,o.kt)("inlineCode",{parentName:"li"},"ENDED"),".")))}P.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/3f8274eb.2403290b.js b/assets/js/3f8274eb.2403290b.js new file mode 100644 index 0000000..c07f52f --- /dev/null +++ b/assets/js/3f8274eb.2403290b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[9690],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>h});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=r.createContext({}),c=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},p=function(e){var t=c(e.components);return r.createElement(s.Provider,{value:t},e.children)},d="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),d=c(n),m=i,h=d["".concat(s,".").concat(m)]||d[m]||u[m]||a;return n?r.createElement(h,o(o({ref:t},p),{},{components:n})):r.createElement(h,o({ref:t},p))}));function h(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,o=new Array(a);o[0]=m;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[d]="string"==typeof e?e:i,o[1]=l;for(var c=2;c<a;c++)o[c]=n[c];return r.createElement.apply(null,o)}return r.createElement.apply(null,n)}m.displayName="MDXCreateElement"},555:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>u,frontMatter:()=>a,metadata:()=>l,toc:()=>c});var r=n(7462),i=(n(7294),n(3905));const a={sidebar_position:6},o="Status",l={unversionedId:"reference/cli/status",id:"reference/cli/status",title:"Status",description:"Status is a utility command to request the status of Cogment services. It can also inquire the directory to find services to request status.",source:"@site/docs/reference/cli/status.md",sourceDirName:"reference/cli",slug:"/reference/cli/status",permalink:"/docs/reference/cli/status",draft:!1,tags:[],version:"current",lastUpdatedAt:1696968834,formattedLastUpdatedAt:"Oct 10, 2023",sidebarPosition:6,frontMatter:{sidebar_position:6},sidebar:"docSidebar",previous:{title:"Launch",permalink:"/docs/reference/cli/launch"},next:{title:"Python SDK",permalink:"/docs/reference/python"}},s={},c=[{value:"Common",id:"common",level:2},{value:"<code>directory_endpoint</code>",id:"directory_endpoint",level:3},{value:"<code>directory_authentication_token</code>",id:"directory_authentication_token",level:3},{value:"<code>verbose</code>",id:"verbose",level:3},{value:"<code>endpoint</code>",id:"endpoint",level:3},{value:"<code>type</code>",id:"type",level:3},{value:"Statuses",id:"statuses",level:3}],p={toc:c},d="wrapper";function u(e){let{components:t,...n}=e;return(0,i.kt)(d,(0,r.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"status"},"Status"),(0,i.kt)("p",null,"Status is a utility command to request the status of Cogment services. It can also inquire the directory to find services to request status."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"cogment status [options] [statuses...]")),(0,i.kt)("h2",{id:"common"},"Common"),(0,i.kt)("h3",{id:"directory_endpoint"},(0,i.kt)("inlineCode",{parentName:"h3"},"directory_endpoint")),(0,i.kt)("p",null,"Cogment endpoint of the directory service. It must be a ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#grpc-scheme"},"gRPC endpoint"),". The directory will be used to discover the services from which to request status."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--directory_endpoint=grpc://foo:9005"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005"),","),(0,i.kt)("li",{parentName:"ul"},'its default value is "grpc://localhost:9005" (which is the default when running ',(0,i.kt)("inlineCode",{parentName:"li"},"cogment services directory")," locally).")),(0,i.kt)("h3",{id:"directory_authentication_token"},(0,i.kt)("inlineCode",{parentName:"h3"},"directory_authentication_token")),(0,i.kt)("p",null,"Authentication token for services registered in the Directory. An empty token is the same as no token. Only services with the matching authentication token will be found in the directory."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--directory_authentication_token=GH670ploT"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT"),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")),(0,i.kt)("h3",{id:"verbose"},(0,i.kt)("inlineCode",{parentName:"h3"},"verbose")),(0,i.kt)("p",null,'Controls how much of the service information (received from the directory) is printed. The default only prints the directory ID of the service. To increase the amount of information, more "v" can be added, up to ',(0,i.kt)("inlineCode",{parentName:"p"},"-vvvv")," to print all service information (similar to the ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cli/directory/directory-client"},"Cogment Directory Client"),' "inquire" command).'),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--verbose"),", ",(0,i.kt)("inlineCode",{parentName:"li"},"-v"),", ",(0,i.kt)("inlineCode",{parentName:"li"},"-vv"),", ",(0,i.kt)("inlineCode",{parentName:"li"},"-vvv"),", ",(0,i.kt)("inlineCode",{parentName:"li"},"-vvvv")),(0,i.kt)("li",{parentName:"ul"},"it has no default value (i.e. minimal verbosity)")),(0,i.kt)("h3",{id:"endpoint"},(0,i.kt)("inlineCode",{parentName:"h3"},"endpoint")),(0,i.kt)("p",null,"Cogment endpoint to the service from which to request statuses."),(0,i.kt)("p",null,"If this is a ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#discover-host"},"discovery endpoint")," then a ",(0,i.kt)("a",{parentName:"p",href:"#directory_endpoint"},"directory")," must be provided.\nIf it is a ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#grpc-scheme"},"grpc endpoint")," and a ",(0,i.kt)("a",{parentName:"p",href:"#type"},"type")," option is provided, the service must match the type provided or the status request will fail."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--endpoint=grpc://172.2.17.23:45367"),","),(0,i.kt)("li",{parentName:"ul"},'its default value is "cogment://discover" (which will inquire the directory for all healthy services).')),(0,i.kt)("h3",{id:"type"},(0,i.kt)("inlineCode",{parentName:"h3"},"type")),(0,i.kt)("p",null,"The type of service from which to request statuses.\nThis is relevant only if the ",(0,i.kt)("a",{parentName:"p",href:"#endpoint"},"endpoint")," is a grpc endpoint (because directory entries include the type data).\nIf this type is not provided, all types will be tried to determine if one works (if there are multiple services at the endpoint, only one will be reported)."),(0,i.kt)("p",null,"Possible values are: ",(0,i.kt)("inlineCode",{parentName:"p"},"actor"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"environment"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"prehook"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"datalog"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"lifecycle"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"actservice"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"datastore"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"modelregistry")," or ",(0,i.kt)("inlineCode",{parentName:"p"},"other"),".\nThese are the same keywords used as ",(0,i.kt)("inlineCode",{parentName:"p"},"paths")," in Cogment ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#discovery-path"},"discovery endpoints"),"."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--type=actor"),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")),(0,i.kt)("h3",{id:"statuses"},"Statuses"),(0,i.kt)("p",null,"The names of the statuses to request."),(0,i.kt)("p",null,"If none is provided, a request will still be made for no statuses; This can serve as a health/communication test."),(0,i.kt)("p",null,"The star (",(0,i.kt)("inlineCode",{parentName:"p"},"*"),') status can be used to request all "standard" statuses (note that at the command line, the star may need to be enclosed in quotation marks to prevent it from being interpreted by the command shell).\nWhat defines a "standard" status depends on the service, it often excludes debug statuses and statuses that require extra computation.\nNon-standard statuses must be requested explicitly by name.\nExplicit (named) statuses can precede the star (',(0,i.kt)("inlineCode",{parentName:"p"},"*"),") in the list of statuses to request, but all names following the star status will be ignored."),(0,i.kt)("p",null,"E.g.:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-console"},"$ cogment status '*'\n$ cogment status overall_load nb_sessions\n$ cogment status nb_samples_processed '*'\n")))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/3f8274eb.7b2c5f8f.js b/assets/js/3f8274eb.7b2c5f8f.js deleted file mode 100644 index a7af8c0..0000000 --- a/assets/js/3f8274eb.7b2c5f8f.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[9690],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>m});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=r.createContext({}),c=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},p=function(e){var t=c(e.components);return r.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},u=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=c(n),m=i,h=u["".concat(s,".").concat(m)]||u[m]||d[m]||a;return n?r.createElement(h,o(o({ref:t},p),{},{components:n})):r.createElement(h,o({ref:t},p))}));function m(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,o=new Array(a);o[0]=u;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l.mdxType="string"==typeof e?e:i,o[1]=l;for(var c=2;c<a;c++)o[c]=n[c];return r.createElement.apply(null,o)}return r.createElement.apply(null,n)}u.displayName="MDXCreateElement"},555:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>d,frontMatter:()=>a,metadata:()=>l,toc:()=>c});var r=n(7462),i=(n(7294),n(3905));const a={sidebar_position:6},o="Status",l={unversionedId:"reference/cli/status",id:"reference/cli/status",title:"Status",description:"Status is a utility command to request the status of Cogment services. It can also inquire the directory to find services to request status.",source:"@site/docs/reference/cli/status.md",sourceDirName:"reference/cli",slug:"/reference/cli/status",permalink:"/docs/reference/cli/status",draft:!1,tags:[],version:"current",lastUpdatedAt:1696968834,formattedLastUpdatedAt:"Oct 10, 2023",sidebarPosition:6,frontMatter:{sidebar_position:6},sidebar:"docSidebar",previous:{title:"Launch",permalink:"/docs/reference/cli/launch"},next:{title:"Python SDK",permalink:"/docs/reference/python"}},s={},c=[{value:"Common",id:"common",level:2},{value:"<code>directory_endpoint</code>",id:"directory_endpoint",level:3},{value:"<code>directory_authentication_token</code>",id:"directory_authentication_token",level:3},{value:"<code>verbose</code>",id:"verbose",level:3},{value:"<code>endpoint</code>",id:"endpoint",level:3},{value:"<code>type</code>",id:"type",level:3},{value:"Statuses",id:"statuses",level:3}],p={toc:c};function d(e){let{components:t,...n}=e;return(0,i.kt)("wrapper",(0,r.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"status"},"Status"),(0,i.kt)("p",null,"Status is a utility command to request the status of Cogment services. It can also inquire the directory to find services to request status."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"cogment status [options] [statuses...]")),(0,i.kt)("h2",{id:"common"},"Common"),(0,i.kt)("h3",{id:"directory_endpoint"},(0,i.kt)("inlineCode",{parentName:"h3"},"directory_endpoint")),(0,i.kt)("p",null,"Cogment endpoint of the directory service. It must be a ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#grpc-scheme"},"gRPC endpoint"),". The directory will be used to discover the services from which to request status."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--directory_endpoint=grpc://foo:9005"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005"),","),(0,i.kt)("li",{parentName:"ul"},'its default value is "grpc://localhost:9005" (which is the default when running ',(0,i.kt)("inlineCode",{parentName:"li"},"cogment services directory")," locally).")),(0,i.kt)("h3",{id:"directory_authentication_token"},(0,i.kt)("inlineCode",{parentName:"h3"},"directory_authentication_token")),(0,i.kt)("p",null,"Authentication token for services registered in the Directory. An empty token is the same as no token. Only services with the matching authentication token will be found in the directory."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--directory_authentication_token=GH670ploT"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT"),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")),(0,i.kt)("h3",{id:"verbose"},(0,i.kt)("inlineCode",{parentName:"h3"},"verbose")),(0,i.kt)("p",null,'Controls how much of the service information (received from the directory) is printed. The default only prints the directory ID of the service. To increase the amount of information, more "v" can be added, up to ',(0,i.kt)("inlineCode",{parentName:"p"},"-vvvv")," to print all service information (similar to the ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cli/directory/directory-client"},"Cogment Directory Client"),' "inquire" command).'),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--verbose"),", ",(0,i.kt)("inlineCode",{parentName:"li"},"-v"),", ",(0,i.kt)("inlineCode",{parentName:"li"},"-vv"),", ",(0,i.kt)("inlineCode",{parentName:"li"},"-vvv"),", ",(0,i.kt)("inlineCode",{parentName:"li"},"-vvvv")),(0,i.kt)("li",{parentName:"ul"},"it has no default value (i.e. minimal verbosity)")),(0,i.kt)("h3",{id:"endpoint"},(0,i.kt)("inlineCode",{parentName:"h3"},"endpoint")),(0,i.kt)("p",null,"Cogment endpoint to the service from which to request statuses."),(0,i.kt)("p",null,"If this is a ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#discover-host"},"discovery endpoint")," then a ",(0,i.kt)("a",{parentName:"p",href:"#directory_endpoint"},"directory")," must be provided.\nIf it is a ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#grpc-scheme"},"grpc endpoint")," and a ",(0,i.kt)("a",{parentName:"p",href:"#type"},"type")," option is provided, the service must match the type provided or the status request will fail."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--endpoint=grpc://172.2.17.23:45367"),","),(0,i.kt)("li",{parentName:"ul"},'its default value is "cogment://discover" (which will inquire the directory for all healthy services).')),(0,i.kt)("h3",{id:"type"},(0,i.kt)("inlineCode",{parentName:"h3"},"type")),(0,i.kt)("p",null,"The type of service from which to request statuses.\nThis is relevant only if the ",(0,i.kt)("a",{parentName:"p",href:"#endpoint"},"endpoint")," is a grpc endpoint (because directory entries include the type data).\nIf this type is not provided, all types will be tried to determine if one works (if there are multiple services at the endpoint, only one will be reported)."),(0,i.kt)("p",null,"Possible values are: ",(0,i.kt)("inlineCode",{parentName:"p"},"actor"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"environment"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"prehook"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"datalog"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"lifecycle"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"actservice"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"datastore"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"modelregistry")," or ",(0,i.kt)("inlineCode",{parentName:"p"},"other"),".\nThese are the same keywords used as ",(0,i.kt)("inlineCode",{parentName:"p"},"paths")," in Cogment ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#discovery-path"},"discovery endpoints"),"."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--type=actor"),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")),(0,i.kt)("h3",{id:"statuses"},"Statuses"),(0,i.kt)("p",null,"The names of the statuses to request."),(0,i.kt)("p",null,"If none is provided, a request will still be made for no statuses; This can serve as a health/communication test."),(0,i.kt)("p",null,"The star (",(0,i.kt)("inlineCode",{parentName:"p"},"*"),') status can be used to request all "standard" statuses (note that at the command line, the star may need to be enclosed in quotation marks to prevent it from being interpreted by the command shell).\nWhat defines a "standard" status depends on the service, it often excludes debug statuses and statuses that require extra computation.\nNon-standard statuses must be requested explicitly by name.\nExplicit (named) statuses can precede the star (',(0,i.kt)("inlineCode",{parentName:"p"},"*"),") in the list of statuses to request, but all names following the star status will be ignored."),(0,i.kt)("p",null,"E.g.:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-console"},"$ cogment status '*'\n$ cogment status overall_load nb_sessions\n$ cogment status nb_samples_processed '*'\n")))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/4698.8c4037a9.js b/assets/js/4698.8c4037a9.js deleted file mode 100644 index 92e64bf..0000000 --- a/assets/js/4698.8c4037a9.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see 4698.8c4037a9.js.LICENSE.txt */ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[4698],{8947:(n,t,e)=>{function a(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),e.push.apply(e,a)}return e}function r(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?a(Object(e),!0).forEach((function(t){c(n,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):a(Object(e)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}))}return n}function i(n){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},i(n)}function o(n,t){for(var e=0;e<t.length;e++){var a=t[e];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(n,a.key,a)}}function c(n,t,e){return t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function s(n,t){return function(n){if(Array.isArray(n))return n}(n)||function(n,t){var e=n&&("undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"]);if(null==e)return;var a,r,i=[],o=!0,c=!1;try{for(e=e.call(n);!(o=(a=e.next()).done)&&(i.push(a.value),!t||i.length!==t);o=!0);}catch(s){c=!0,r=s}finally{try{o||null==e.return||e.return()}finally{if(c)throw r}}return i}(n,t)||l(n,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(n){return function(n){if(Array.isArray(n))return u(n)}(n)||function(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||l(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(n,t){if(n){if("string"==typeof n)return u(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);return"Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e?Array.from(n):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?u(n,t):void 0}}function u(n,t){(null==t||t>n.length)&&(t=n.length);for(var e=0,a=new Array(t);e<t;e++)a[e]=n[e];return a}e.d(t,{Qc:()=>ne,qv:()=>te,vc:()=>Jt});var m=function(){},d={},p={},v=null,b={mark:m,measure:m};try{"undefined"!=typeof window&&(d=window),"undefined"!=typeof document&&(p=document),"undefined"!=typeof MutationObserver&&(v=MutationObserver),"undefined"!=typeof performance&&(b=performance)}catch(ee){}var g=(d.navigator||{}).userAgent,y=void 0===g?"":g,h=d,w=p,x=v,k=b,O=(h.document,!!w.documentElement&&!!w.head&&"function"==typeof w.addEventListener&&"function"==typeof w.createElement),A=~y.indexOf("MSIE")||~y.indexOf("Trident/"),N="svg-inline--fa",j="data-fa-i2svg",E="data-fa-pseudo-element",S="data-prefix",P="data-icon",C="fontawesome-i2svg",z=["HTML","HEAD","STYLE","SCRIPT"],M=function(){try{return!0}catch(ee){return!1}}(),_={fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands",fak:"kit","fa-kit":"kit",fa:"solid"},T={solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab",kit:"fak"},I={fab:"fa-brands",fad:"fa-duotone",fak:"fa-kit",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},L=Object.fromEntries(Object.entries(I).map((function(n){return[n[1],n[0]]}))),R=/fa[srltdbk\-\ ]/,D="fa-layers-text",F=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Kit)?.*/i,W={900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},H=[1,2,3,4,5,6,7,8,9,10],U=H.concat([11,12,13,14,15,16,17,18,19,20]),q=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],X="duotone-group",Y="swap-opacity",B="primary",V="secondary",Q=[].concat(f(Object.keys(T)),["2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",X,Y,B,V]).concat(H.map((function(n){return"".concat(n,"x")}))).concat(U.map((function(n){return"w-".concat(n)}))),G=h.FontAwesomeConfig||{};if(w&&"function"==typeof w.querySelector){[["data-family-prefix","familyPrefix"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach((function(n){var t=s(n,2),e=t[0],a=t[1],r=function(n){return""===n||"false"!==n&&("true"===n||n)}(function(n){var t=w.querySelector("script["+n+"]");if(t)return t.getAttribute(n)}(e));null!=r&&(G[a]=r)}))}var K=r(r({},{familyPrefix:"fa",styleDefault:"solid",replacementClass:N,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0}),G);K.autoReplaceSvg||(K.observeMutations=!1);var Z={};Object.keys(K).forEach((function(n){Object.defineProperty(Z,n,{enumerable:!0,set:function(t){K[n]=t,$.forEach((function(n){return n(Z)}))},get:function(){return K[n]}})})),h.FontAwesomeConfig=Z;var $=[];var J=16,nn={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function tn(){for(var n=12,t="";n-- >0;)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[62*Math.random()|0];return t}function en(n){for(var t=[],e=(n||[]).length>>>0;e--;)t[e]=n[e];return t}function an(n){return n.classList?en(n.classList):(n.getAttribute("class")||"").split(" ").filter((function(n){return n}))}function rn(n){return"".concat(n).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function on(n){return Object.keys(n||{}).reduce((function(t,e){return t+"".concat(e,": ").concat(n[e].trim(),";")}),"")}function cn(n){return n.size!==nn.size||n.x!==nn.x||n.y!==nn.y||n.rotate!==nn.rotate||n.flipX||n.flipY}function sn(){var n="fa",t=N,e=Z.familyPrefix,a=Z.replacementClass,r=':root, :host {\n --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Solid";\n --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Regular";\n --fa-font-light: normal 300 1em/1 "Font Awesome 6 Light";\n --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Thin";\n --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone";\n --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands";\n}\n\nsvg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {\n overflow: visible;\n -webkit-box-sizing: content-box;\n box-sizing: content-box;\n}\n\n.svg-inline--fa {\n display: var(--fa-display, inline-block);\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-2xs {\n vertical-align: 0.1em;\n}\n.svg-inline--fa.fa-xs {\n vertical-align: 0em;\n}\n.svg-inline--fa.fa-sm {\n vertical-align: -0.0714285705em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.2em;\n}\n.svg-inline--fa.fa-xl {\n vertical-align: -0.25em;\n}\n.svg-inline--fa.fa-2xl {\n vertical-align: -0.3125em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-li {\n width: var(--fa-li-width, 2em);\n top: 0.25em;\n}\n.svg-inline--fa.fa-fw {\n width: var(--fa-fw-width, 1.25em);\n}\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter {\n background-color: var(--fa-counter-background-color, #ff253a);\n border-radius: var(--fa-counter-border-radius, 1em);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n color: var(--fa-inverse, #fff);\n line-height: var(--fa-counter-line-height, 1);\n max-width: var(--fa-counter-max-width, 5em);\n min-width: var(--fa-counter-min-width, 1.5em);\n overflow: hidden;\n padding: var(--fa-counter-padding, 0.25em 0.5em);\n right: var(--fa-right, 0);\n text-overflow: ellipsis;\n top: var(--fa-top, 0);\n -webkit-transform: scale(var(--fa-counter-scale, 0.25));\n transform: scale(var(--fa-counter-scale, 0.25));\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n bottom: var(--fa-bottom, 0);\n right: var(--fa-right, 0);\n top: auto;\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: bottom right;\n transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n bottom: var(--fa-bottom, 0);\n left: var(--fa-left, 0);\n right: auto;\n top: auto;\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: bottom left;\n transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n top: var(--fa-top, 0);\n right: var(--fa-right, 0);\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-top-left {\n left: var(--fa-left, 0);\n right: auto;\n top: var(--fa-top, 0);\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: top left;\n transform-origin: top left;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-2xs {\n font-size: 0.625em;\n line-height: 0.1em;\n vertical-align: 0.225em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n line-height: 0.0833333337em;\n vertical-align: 0.125em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n line-height: 0.0714285718em;\n vertical-align: 0.0535714295em;\n}\n\n.fa-lg {\n font-size: 1.25em;\n line-height: 0.05em;\n vertical-align: -0.075em;\n}\n\n.fa-xl {\n font-size: 1.5em;\n line-height: 0.0416666682em;\n vertical-align: -0.125em;\n}\n\n.fa-2xl {\n font-size: 2em;\n line-height: 0.03125em;\n vertical-align: -0.1875em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: var(--fa-li-margin, 2.5em);\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: calc(var(--fa-li-width, 2em) * -1);\n position: absolute;\n text-align: center;\n width: var(--fa-li-width, 2em);\n line-height: inherit;\n}\n\n.fa-border {\n border-color: var(--fa-border-color, #eee);\n border-radius: var(--fa-border-radius, 0.1em);\n border-style: var(--fa-border-style, solid);\n border-width: var(--fa-border-width, 0.08em);\n padding: var(--fa-border-padding, 0.2em 0.25em 0.15em);\n}\n\n.fa-pull-left {\n float: left;\n margin-right: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-pull-right {\n float: right;\n margin-left: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-beat {\n -webkit-animation-name: fa-beat;\n animation-name: fa-beat;\n -webkit-animation-delay: var(--fa-animation-delay, 0);\n animation-delay: var(--fa-animation-delay, 0);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-fade {\n -webkit-animation-name: fa-fade;\n animation-name: fa-fade;\n -webkit-animation-delay: var(--fa-animation-delay, 0);\n animation-delay: var(--fa-animation-delay, 0);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-beat-fade {\n -webkit-animation-name: fa-beat-fade;\n animation-name: fa-beat-fade;\n -webkit-animation-delay: var(--fa-animation-delay, 0);\n animation-delay: var(--fa-animation-delay, 0);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-flip {\n -webkit-animation-name: fa-flip;\n animation-name: fa-flip;\n -webkit-animation-delay: var(--fa-animation-delay, 0);\n animation-delay: var(--fa-animation-delay, 0);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-spin {\n -webkit-animation-name: fa-spin;\n animation-name: fa-spin;\n -webkit-animation-delay: var(--fa-animation-delay, 0);\n animation-delay: var(--fa-animation-delay, 0);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 2s);\n animation-duration: var(--fa-animation-duration, 2s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, linear);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin-reverse {\n --fa-animation-direction: reverse;\n}\n\n.fa-pulse,\n.fa-spin-pulse {\n -webkit-animation-name: fa-spin;\n animation-name: fa-spin;\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, steps(8));\n animation-timing-function: var(--fa-animation-timing, steps(8));\n}\n\n@media (prefers-reduced-motion: reduce) {\n .fa-beat,\n.fa-fade,\n.fa-beat-fade,\n.fa-flip,\n.fa-pulse,\n.fa-spin,\n.fa-spin-pulse {\n -webkit-animation-delay: -1ms;\n animation-delay: -1ms;\n -webkit-animation-duration: 1ms;\n animation-duration: 1ms;\n -webkit-animation-iteration-count: 1;\n animation-iteration-count: 1;\n -webkit-transition-delay: 0s;\n transition-delay: 0s;\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n }\n}\n@-webkit-keyframes fa-beat {\n 0%, 90% {\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 45% {\n -webkit-transform: scale(var(--fa-beat-scale, 1.25));\n transform: scale(var(--fa-beat-scale, 1.25));\n }\n}\n@keyframes fa-beat {\n 0%, 90% {\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 45% {\n -webkit-transform: scale(var(--fa-beat-scale, 1.25));\n transform: scale(var(--fa-beat-scale, 1.25));\n }\n}\n@-webkit-keyframes fa-fade {\n 50% {\n opacity: var(--fa-fade-opacity, 0.4);\n }\n}\n@keyframes fa-fade {\n 50% {\n opacity: var(--fa-fade-opacity, 0.4);\n }\n}\n@-webkit-keyframes fa-beat-fade {\n 0%, 100% {\n opacity: var(--fa-beat-fade-opacity, 0.4);\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 50% {\n opacity: 1;\n -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125));\n transform: scale(var(--fa-beat-fade-scale, 1.125));\n }\n}\n@keyframes fa-beat-fade {\n 0%, 100% {\n opacity: var(--fa-beat-fade-opacity, 0.4);\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 50% {\n opacity: 1;\n -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125));\n transform: scale(var(--fa-beat-fade-scale, 1.125));\n }\n}\n@-webkit-keyframes fa-flip {\n 50% {\n -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n }\n}\n@keyframes fa-flip {\n 50% {\n -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n }\n}\n@-webkit-keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n@keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n -webkit-transform: scale(1, -1);\n transform: scale(1, -1);\n}\n\n.fa-flip-both,\n.fa-flip-horizontal.fa-flip-vertical {\n -webkit-transform: scale(-1, -1);\n transform: scale(-1, -1);\n}\n\n.fa-rotate-by {\n -webkit-transform: rotate(var(--fa-rotate-angle, none));\n transform: rotate(var(--fa-rotate-angle, none));\n}\n\n.fa-stack {\n display: inline-block;\n vertical-align: middle;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: var(--fa-stack-z-index, auto);\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: var(--fa-inverse, #fff);\n}\n\n.sr-only,\n.fa-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.sr-only-focusable:not(:focus),\n.fa-sr-only-focusable:not(:focus) {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.svg-inline--fa .fa-primary {\n fill: var(--fa-primary-color, currentColor);\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n fill: var(--fa-secondary-color, currentColor);\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n fill: black;\n}\n\n.fad.fa-inverse,\n.fa-duotone.fa-inverse {\n color: var(--fa-inverse, #fff);\n}';if(e!==n||a!==t){var i=new RegExp("\\.".concat(n,"\\-"),"g"),o=new RegExp("\\--".concat(n,"\\-"),"g"),c=new RegExp("\\.".concat(t),"g");r=r.replace(i,".".concat(e,"-")).replace(o,"--".concat(e,"-")).replace(c,".".concat(a))}return r}var fn=!1;function ln(){Z.autoAddCss&&!fn&&(!function(n){if(n&&O){var t=w.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=n;for(var e=w.head.childNodes,a=null,r=e.length-1;r>-1;r--){var i=e[r],o=(i.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(o)>-1&&(a=i)}w.head.insertBefore(t,a)}}(sn()),fn=!0)}var un={mixout:function(){return{dom:{css:sn,insertCss:ln}}},hooks:function(){return{beforeDOMElementCreation:function(){ln()},beforeI2svg:function(){ln()}}}},mn=h||{};mn.___FONT_AWESOME___||(mn.___FONT_AWESOME___={}),mn.___FONT_AWESOME___.styles||(mn.___FONT_AWESOME___.styles={}),mn.___FONT_AWESOME___.hooks||(mn.___FONT_AWESOME___.hooks={}),mn.___FONT_AWESOME___.shims||(mn.___FONT_AWESOME___.shims=[]);var dn=mn.___FONT_AWESOME___,pn=[],vn=!1;function bn(n){O&&(vn?setTimeout(n,0):pn.push(n))}function gn(n){var t=n.tag,e=n.attributes,a=void 0===e?{}:e,r=n.children,i=void 0===r?[]:r;return"string"==typeof n?rn(n):"<".concat(t," ").concat(function(n){return Object.keys(n||{}).reduce((function(t,e){return t+"".concat(e,'="').concat(rn(n[e]),'" ')}),"").trim()}(a),">").concat(i.map(gn).join(""),"</").concat(t,">")}function yn(n,t,e){if(n&&n[t]&&n[t][e])return{prefix:t,iconName:e,icon:n[t][e]}}O&&((vn=(w.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(w.readyState))||w.addEventListener("DOMContentLoaded",(function n(){w.removeEventListener("DOMContentLoaded",n),vn=1,pn.map((function(n){return n()}))})));var hn=function(n,t,e,a){var r,i,o,c=Object.keys(n),s=c.length,f=void 0!==a?function(n,t){return function(e,a,r,i){return n.call(t,e,a,r,i)}}(t,a):t;for(void 0===e?(r=1,o=n[c[0]]):(r=0,o=e);r<s;r++)o=f(o,n[i=c[r]],i,n);return o};function wn(n){var t=function(n){for(var t=[],e=0,a=n.length;e<a;){var r=n.charCodeAt(e++);if(r>=55296&&r<=56319&&e<a){var i=n.charCodeAt(e++);56320==(64512&i)?t.push(((1023&r)<<10)+(1023&i)+65536):(t.push(r),e--)}else t.push(r)}return t}(n);return 1===t.length?t[0].toString(16):null}function xn(n){return Object.keys(n).reduce((function(t,e){var a=n[e];return!!a.icon?t[a.iconName]=a.icon:t[e]=a,t}),{})}function kn(n,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=e.skipHooks,i=void 0!==a&&a,o=xn(t);"function"!=typeof dn.hooks.addPack||i?dn.styles[n]=r(r({},dn.styles[n]||{}),o):dn.hooks.addPack(n,xn(t)),"fas"===n&&kn("fa",t)}var On=dn.styles,An=dn.shims,Nn=Object.values(I),jn=null,En={},Sn={},Pn={},Cn={},zn={},Mn=Object.keys(_);function _n(n,t){var e,a=t.split("-"),r=a[0],i=a.slice(1).join("-");return r!==n||""===i||(e=i,~Q.indexOf(e))?null:i}var Tn,In=function(){var n=function(n){return hn(On,(function(t,e,a){return t[a]=hn(e,n,{}),t}),{})};En=n((function(n,t,e){(t[3]&&(n[t[3]]=e),t[2])&&t[2].filter((function(n){return"number"==typeof n})).forEach((function(t){n[t.toString(16)]=e}));return n})),Sn=n((function(n,t,e){(n[e]=e,t[2])&&t[2].filter((function(n){return"string"==typeof n})).forEach((function(t){n[t]=e}));return n})),zn=n((function(n,t,e){var a=t[2];return n[e]=e,a.forEach((function(t){n[t]=e})),n}));var t="far"in On||Z.autoFetchSvg,e=hn(An,(function(n,e){var a=e[0],r=e[1],i=e[2];return"far"!==r||t||(r="fas"),"string"==typeof a&&(n.names[a]={prefix:r,iconName:i}),"number"==typeof a&&(n.unicodes[a.toString(16)]={prefix:r,iconName:i}),n}),{names:{},unicodes:{}});Pn=e.names,Cn=e.unicodes,jn=Wn(Z.styleDefault)};function Ln(n,t){return(En[n]||{})[t]}function Rn(n,t){return(zn[n]||{})[t]}function Dn(n){return Pn[n]||{prefix:null,iconName:null}}function Fn(){return jn}Tn=function(n){jn=Wn(n.styleDefault)},$.push(Tn),In();function Wn(n){var t=T[n]||T[_[n]],e=n in dn.styles?n:null;return t||e||null}function Hn(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=t.skipLookups,a=void 0!==e&&e,r=null,i=n.reduce((function(n,t){var e=_n(Z.familyPrefix,t);if(On[t]?(t=Nn.includes(t)?L[t]:t,r=t,n.prefix=t):Mn.indexOf(t)>-1?(r=t,n.prefix=Wn(t)):e?n.iconName=e:t!==Z.replacementClass&&n.rest.push(t),!a&&n.prefix&&n.iconName){var i="fa"===r?Dn(n.iconName):{},o=Rn(n.prefix,n.iconName);i.prefix&&(r=null),n.iconName=i.iconName||o||n.iconName,n.prefix=i.prefix||n.prefix,"far"!==n.prefix||On.far||!On.fas||Z.autoFetchSvg||(n.prefix="fas")}return n}),{prefix:null,iconName:null,rest:[]});return"fa"!==i.prefix&&"fa"!==r||(i.prefix=Fn()||"fas"),i}var Un=function(){function n(){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),this.definitions={}}var t,e,a;return t=n,e=[{key:"add",value:function(){for(var n=this,t=arguments.length,e=new Array(t),a=0;a<t;a++)e[a]=arguments[a];var i=e.reduce(this._pullDefinitions,{});Object.keys(i).forEach((function(t){n.definitions[t]=r(r({},n.definitions[t]||{}),i[t]),kn(t,i[t]);var e=I[t];e&&kn(e,i[t]),In()}))}},{key:"reset",value:function(){this.definitions={}}},{key:"_pullDefinitions",value:function(n,t){var e=t.prefix&&t.iconName&&t.icon?{0:t}:t;return Object.keys(e).map((function(t){var a=e[t],r=a.prefix,i=a.iconName,o=a.icon,c=o[2];n[r]||(n[r]={}),c.length>0&&c.forEach((function(t){"string"==typeof t&&(n[r][t]=o)})),n[r][i]=o})),n}}],e&&o(t.prototype,e),a&&o(t,a),n}(),qn=[],Xn={},Yn={},Bn=Object.keys(Yn);function Vn(n,t){for(var e=arguments.length,a=new Array(e>2?e-2:0),r=2;r<e;r++)a[r-2]=arguments[r];var i=Xn[n]||[];return i.forEach((function(n){t=n.apply(null,[t].concat(a))})),t}function Qn(n){for(var t=arguments.length,e=new Array(t>1?t-1:0),a=1;a<t;a++)e[a-1]=arguments[a];var r=Xn[n]||[];r.forEach((function(n){n.apply(null,e)}))}function Gn(){var n=arguments[0],t=Array.prototype.slice.call(arguments,1);return Yn[n]?Yn[n].apply(null,t):void 0}function Kn(n){"fa"===n.prefix&&(n.prefix="fas");var t=n.iconName,e=n.prefix||Fn();if(t)return t=Rn(e,t)||t,yn(Zn.definitions,e,t)||yn(dn.styles,e,t)}var Zn=new Un,$n={i2svg:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return O?(Qn("beforeI2svg",n),Gn("pseudoElements2svg",n),Gn("i2svg",n)):Promise.reject("Operation requires a DOM of some kind.")},watch:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.autoReplaceSvgRoot;!1===Z.autoReplaceSvg&&(Z.autoReplaceSvg=!0),Z.observeMutations=!0,bn((function(){nt({autoReplaceSvgRoot:t}),Qn("watch",n)}))}},Jn={noAuto:function(){Z.autoReplaceSvg=!1,Z.observeMutations=!1,Qn("noAuto")},config:Z,dom:$n,parse:{icon:function(n){if(null===n)return null;if("object"===i(n)&&n.prefix&&n.iconName)return{prefix:n.prefix,iconName:Rn(n.prefix,n.iconName)||n.iconName};if(Array.isArray(n)&&2===n.length){var t=0===n[1].indexOf("fa-")?n[1].slice(3):n[1],e=Wn(n[0]);return{prefix:e,iconName:Rn(e,t)||t}}if("string"==typeof n&&(n.indexOf("".concat(Z.familyPrefix,"-"))>-1||n.match(R))){var a=Hn(n.split(" "),{skipLookups:!0});return{prefix:a.prefix||Fn(),iconName:Rn(a.prefix,a.iconName)||a.iconName}}if("string"==typeof n){var r=Fn();return{prefix:r,iconName:Rn(r,n)||n}}}},library:Zn,findIconDefinition:Kn,toHtml:gn},nt=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.autoReplaceSvgRoot,e=void 0===t?w:t;(Object.keys(dn.styles).length>0||Z.autoFetchSvg)&&O&&Z.autoReplaceSvg&&Jn.dom.i2svg({node:e})};function tt(n,t){return Object.defineProperty(n,"abstract",{get:t}),Object.defineProperty(n,"html",{get:function(){return n.abstract.map((function(n){return gn(n)}))}}),Object.defineProperty(n,"node",{get:function(){if(O){var t=w.createElement("div");return t.innerHTML=n.html,t.children}}}),n}function et(n){var t=n.icons,e=t.main,a=t.mask,i=n.prefix,o=n.iconName,c=n.transform,s=n.symbol,f=n.title,l=n.maskId,u=n.titleId,m=n.extra,d=n.watchable,p=void 0!==d&&d,v=a.found?a:e,b=v.width,g=v.height,y="fak"===i,h=[Z.replacementClass,o?"".concat(Z.familyPrefix,"-").concat(o):""].filter((function(n){return-1===m.classes.indexOf(n)})).filter((function(n){return""!==n||!!n})).concat(m.classes).join(" "),w={children:[],attributes:r(r({},m.attributes),{},{"data-prefix":i,"data-icon":o,class:h,role:m.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(b," ").concat(g)})},x=y&&!~m.classes.indexOf("fa-fw")?{width:"".concat(b/g*16*.0625,"em")}:{};p&&(w.attributes[j]=""),f&&(w.children.push({tag:"title",attributes:{id:w.attributes["aria-labelledby"]||"title-".concat(u||tn())},children:[f]}),delete w.attributes.title);var k=r(r({},w),{},{prefix:i,iconName:o,main:e,mask:a,maskId:l,transform:c,symbol:s,styles:r(r({},x),m.styles)}),O=a.found&&e.found?Gn("generateAbstractMask",k)||{children:[],attributes:{}}:Gn("generateAbstractIcon",k)||{children:[],attributes:{}},A=O.children,N=O.attributes;return k.children=A,k.attributes=N,s?function(n){var t=n.prefix,e=n.iconName,a=n.children,i=n.attributes,o=n.symbol,c=!0===o?"".concat(t,"-").concat(Z.familyPrefix,"-").concat(e):o;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:r(r({},i),{},{id:c}),children:a}]}]}(k):function(n){var t=n.children,e=n.main,a=n.mask,i=n.attributes,o=n.styles,c=n.transform;if(cn(c)&&e.found&&!a.found){var s={x:e.width/e.height/2,y:.5};i.style=on(r(r({},o),{},{"transform-origin":"".concat(s.x+c.x/16,"em ").concat(s.y+c.y/16,"em")}))}return[{tag:"svg",attributes:i,children:t}]}(k)}function at(n){var t=n.content,e=n.width,a=n.height,i=n.transform,o=n.title,c=n.extra,s=n.watchable,f=void 0!==s&&s,l=r(r(r({},c.attributes),o?{title:o}:{}),{},{class:c.classes.join(" ")});f&&(l[j]="");var u=r({},c.styles);cn(i)&&(u.transform=function(n){var t=n.transform,e=n.width,a=void 0===e?16:e,r=n.height,i=void 0===r?16:r,o=n.startCentered,c=void 0!==o&&o,s="";return s+=c&&A?"translate(".concat(t.x/J-a/2,"em, ").concat(t.y/J-i/2,"em) "):c?"translate(calc(-50% + ".concat(t.x/J,"em), calc(-50% + ").concat(t.y/J,"em)) "):"translate(".concat(t.x/J,"em, ").concat(t.y/J,"em) "),s+="scale(".concat(t.size/J*(t.flipX?-1:1),", ").concat(t.size/J*(t.flipY?-1:1),") "),s+"rotate(".concat(t.rotate,"deg) ")}({transform:i,startCentered:!0,width:e,height:a}),u["-webkit-transform"]=u.transform);var m=on(u);m.length>0&&(l.style=m);var d=[];return d.push({tag:"span",attributes:l,children:[t]}),o&&d.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),d}function rt(n){var t=n.content,e=n.title,a=n.extra,i=r(r(r({},a.attributes),e?{title:e}:{}),{},{class:a.classes.join(" ")}),o=on(a.styles);o.length>0&&(i.style=o);var c=[];return c.push({tag:"span",attributes:i,children:[t]}),e&&c.push({tag:"span",attributes:{class:"sr-only"},children:[e]}),c}var it=dn.styles;function ot(n){var t=n[0],e=n[1],a=s(n.slice(4),1)[0];return{found:!0,width:t,height:e,icon:Array.isArray(a)?{tag:"g",attributes:{class:"".concat(Z.familyPrefix,"-").concat(X)},children:[{tag:"path",attributes:{class:"".concat(Z.familyPrefix,"-").concat(V),fill:"currentColor",d:a[0]}},{tag:"path",attributes:{class:"".concat(Z.familyPrefix,"-").concat(B),fill:"currentColor",d:a[1]}}]}:{tag:"path",attributes:{fill:"currentColor",d:a}}}}var ct={found:!1,width:512,height:512};function st(n,t){var e=t;return"fa"===t&&null!==Z.styleDefault&&(t=Fn()),new Promise((function(a,i){Gn("missingIconAbstract");if("fa"===e){var o=Dn(n)||{};n=o.iconName||n,t=o.prefix||t}if(n&&t&&it[t]&&it[t][n])return a(ot(it[t][n]));!function(n,t){M||Z.showMissingIcons||!n||console.error('Icon with name "'.concat(n,'" and prefix "').concat(t,'" is missing.'))}(n,t),a(r(r({},ct),{},{icon:Z.showMissingIcons&&n&&Gn("missingIconAbstract")||{}}))}))}var ft=function(){},lt=Z.measurePerformance&&k&&k.mark&&k.measure?k:{mark:ft,measure:ft},ut='FA "6.0.0-beta3"',mt=function(n){lt.mark("".concat(ut," ").concat(n," ends")),lt.measure("".concat(ut," ").concat(n),"".concat(ut," ").concat(n," begins"),"".concat(ut," ").concat(n," ends"))},dt=function(n){return lt.mark("".concat(ut," ").concat(n," begins")),function(){return mt(n)}},pt=function(){};function vt(n){return"string"==typeof(n.getAttribute?n.getAttribute(j):null)}function bt(n){return w.createElementNS("http://www.w3.org/2000/svg",n)}function gt(n){return w.createElement(n)}function yt(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=t.ceFn,a=void 0===e?"svg"===n.tag?bt:gt:e;if("string"==typeof n)return w.createTextNode(n);var r=a(n.tag);Object.keys(n.attributes||[]).forEach((function(t){r.setAttribute(t,n.attributes[t])}));var i=n.children||[];return i.forEach((function(n){r.appendChild(yt(n,{ceFn:a}))})),r}var ht={replace:function(n){var t=n[0];if(t.parentNode)if(n[1].forEach((function(n){t.parentNode.insertBefore(yt(n),t)})),null===t.getAttribute(j)&&Z.keepOriginalSource){var e=w.createComment(function(n){var t=" ".concat(n.outerHTML," ");return"".concat(t,"Font Awesome fontawesome.com ")}(t));t.parentNode.replaceChild(e,t)}else t.remove()},nest:function(n){var t=n[0],e=n[1];if(~an(t).indexOf(Z.replacementClass))return ht.replace(n);var a=new RegExp("".concat(Z.familyPrefix,"-.*"));if(delete e[0].attributes.id,e[0].attributes.class){var r=e[0].attributes.class.split(" ").reduce((function(n,t){return t===Z.replacementClass||t.match(a)?n.toSvg.push(t):n.toNode.push(t),n}),{toNode:[],toSvg:[]});e[0].attributes.class=r.toSvg.join(" "),0===r.toNode.length?t.removeAttribute("class"):t.setAttribute("class",r.toNode.join(" "))}var i=e.map((function(n){return gn(n)})).join("\n");t.setAttribute(j,""),t.innerHTML=i}};function wt(n){n()}function xt(n,t){var e="function"==typeof t?t:pt;if(0===n.length)e();else{var a=wt;"async"===Z.mutateApproach&&(a=h.requestAnimationFrame||wt),a((function(){var t=!0===Z.autoReplaceSvg?ht.replace:ht[Z.autoReplaceSvg]||ht.replace,a=dt("mutate");n.map(t),a(),e()}))}}var kt=!1;function Ot(){kt=!0}function At(){kt=!1}var Nt=null;function jt(n){if(x&&Z.observeMutations){var t=n.treeCallback,e=void 0===t?pt:t,a=n.nodeCallback,r=void 0===a?pt:a,i=n.pseudoElementsCallback,o=void 0===i?pt:i,c=n.observeMutationsRoot,s=void 0===c?w:c;Nt=new x((function(n){if(!kt){var t=Fn();en(n).forEach((function(n){if("childList"===n.type&&n.addedNodes.length>0&&!vt(n.addedNodes[0])&&(Z.searchPseudoElements&&o(n.target),e(n.target)),"attributes"===n.type&&n.target.parentNode&&Z.searchPseudoElements&&o(n.target.parentNode),"attributes"===n.type&&vt(n.target)&&~q.indexOf(n.attributeName))if("class"===n.attributeName&&function(n){var t=n.getAttribute?n.getAttribute(S):null,e=n.getAttribute?n.getAttribute(P):null;return t&&e}(n.target)){var a=Hn(an(n.target)),i=a.prefix,c=a.iconName;n.target.setAttribute(S,i||t),c&&n.target.setAttribute(P,c)}else(s=n.target)&&s.classList&&s.classList.contains&&s.classList.contains(Z.replacementClass)&&r(n.target);var s}))}})),O&&Nt.observe(s,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function Et(n){var t=n.getAttribute("style"),e=[];return t&&(e=t.split(";").reduce((function(n,t){var e=t.split(":"),a=e[0],r=e.slice(1);return a&&r.length>0&&(n[a]=r.join(":").trim()),n}),{})),e}function St(n){var t,e,a=n.getAttribute("data-prefix"),r=n.getAttribute("data-icon"),i=void 0!==n.innerText?n.innerText.trim():"",o=Hn(an(n));return o.prefix||(o.prefix=Fn()),a&&r&&(o.prefix=a,o.iconName=r),o.iconName&&o.prefix||o.prefix&&i.length>0&&(o.iconName=(t=o.prefix,e=n.innerText,(Sn[t]||{})[e]||Ln(o.prefix,wn(n.innerText)))),o}function Pt(n){var t=en(n.attributes).reduce((function(n,t){return"class"!==n.name&&"style"!==n.name&&(n[t.name]=t.value),n}),{}),e=n.getAttribute("title"),a=n.getAttribute("data-fa-title-id");return Z.autoA11y&&(e?t["aria-labelledby"]="".concat(Z.replacementClass,"-title-").concat(a||tn()):(t["aria-hidden"]="true",t.focusable="false")),t}function Ct(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{styleParser:!0},e=St(n),a=e.iconName,i=e.prefix,o=e.rest,c=Pt(n),s=Vn("parseNodeAttributes",{},n),f=t.styleParser?Et(n):[];return r({iconName:a,title:n.getAttribute("title"),titleId:n.getAttribute("data-fa-title-id"),prefix:i,transform:nn,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:o,styles:f,attributes:c}},s)}var zt=dn.styles;function Mt(n){var t="nest"===Z.autoReplaceSvg?Ct(n,{styleParser:!1}):Ct(n);return~t.extra.classes.indexOf(D)?Gn("generateLayersText",n,t):Gn("generateSvgReplacementMutation",n,t)}function _t(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!O)return Promise.resolve();var e=w.documentElement.classList,a=function(n){return e.add("".concat(C,"-").concat(n))},r=function(n){return e.remove("".concat(C,"-").concat(n))},i=Z.autoFetchSvg?Object.keys(_):Object.keys(zt),o=[".".concat(D,":not([").concat(j,"])")].concat(i.map((function(n){return".".concat(n,":not([").concat(j,"])")}))).join(", ");if(0===o.length)return Promise.resolve();var c=[];try{c=en(n.querySelectorAll(o))}catch(ee){}if(!(c.length>0))return Promise.resolve();a("pending"),r("complete");var s=dt("onTree"),f=c.reduce((function(n,t){try{var e=Mt(t);e&&n.push(e)}catch(ee){M||"MissingIcon"===ee.name&&console.error(ee)}return n}),[]);return new Promise((function(n,e){Promise.all(f).then((function(e){xt(e,(function(){a("active"),a("complete"),r("pending"),"function"==typeof t&&t(),s(),n()}))})).catch((function(n){s(),e(n)}))}))}function Tt(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;Mt(n).then((function(n){n&&xt([n],t)}))}var It=function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=t.transform,a=void 0===e?nn:e,i=t.symbol,o=void 0!==i&&i,c=t.mask,s=void 0===c?null:c,f=t.maskId,l=void 0===f?null:f,u=t.title,m=void 0===u?null:u,d=t.titleId,p=void 0===d?null:d,v=t.classes,b=void 0===v?[]:v,g=t.attributes,y=void 0===g?{}:g,h=t.styles,w=void 0===h?{}:h;if(n){var x=n.prefix,k=n.iconName,O=n.icon;return tt(r({type:"icon"},n),(function(){return Qn("beforeDOMElementCreation",{iconDefinition:n,params:t}),Z.autoA11y&&(m?y["aria-labelledby"]="".concat(Z.replacementClass,"-title-").concat(p||tn()):(y["aria-hidden"]="true",y.focusable="false")),et({icons:{main:ot(O),mask:s?ot(s.icon):{found:!1,width:null,height:null,icon:{}}},prefix:x,iconName:k,transform:r(r({},nn),a),symbol:o,title:m,maskId:l,titleId:p,extra:{attributes:y,styles:w,classes:b}})}))}},Lt={mixout:function(){return{icon:(n=It,function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=(t||{}).icon?t:Kn(t||{}),i=e.mask;return i&&(i=(i||{}).icon?i:Kn(i||{})),n(a,r(r({},e),{},{mask:i}))})};var n},hooks:function(){return{mutationObserverCallbacks:function(n){return n.treeCallback=_t,n.nodeCallback=Tt,n}}},provides:function(n){n.i2svg=function(n){var t=n.node,e=void 0===t?w:t,a=n.callback;return _t(e,void 0===a?function(){}:a)},n.generateSvgReplacementMutation=function(n,t){var e=t.iconName,a=t.title,r=t.titleId,i=t.prefix,o=t.transform,c=t.symbol,f=t.mask,l=t.maskId,u=t.extra;return new Promise((function(t,m){Promise.all([st(e,i),f.iconName?st(f.iconName,f.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then((function(f){var m=s(f,2),d=m[0],p=m[1];t([n,et({icons:{main:d,mask:p},prefix:i,iconName:e,transform:o,symbol:c,maskId:l,title:a,titleId:r,extra:u,watchable:!0})])})).catch(m)}))},n.generateAbstractIcon=function(n){var t,e=n.children,a=n.attributes,r=n.main,i=n.transform,o=on(n.styles);return o.length>0&&(a.style=o),cn(i)&&(t=Gn("generateAbstractTransformGrouping",{main:r,transform:i,containerWidth:r.width,iconWidth:r.width})),e.push(t||r.icon),{children:e,attributes:a}}}},Rt={mixout:function(){return{layer:function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=t.classes,a=void 0===e?[]:e;return tt({type:"layer"},(function(){Qn("beforeDOMElementCreation",{assembler:n,params:t});var e=[];return n((function(n){Array.isArray(n)?n.map((function(n){e=e.concat(n.abstract)})):e=e.concat(n.abstract)})),[{tag:"span",attributes:{class:["".concat(Z.familyPrefix,"-layers")].concat(f(a)).join(" ")},children:e}]}))}}}},Dt={mixout:function(){return{counter:function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=t.title,a=void 0===e?null:e,r=t.classes,i=void 0===r?[]:r,o=t.attributes,c=void 0===o?{}:o,s=t.styles,l=void 0===s?{}:s;return tt({type:"counter",content:n},(function(){return Qn("beforeDOMElementCreation",{content:n,params:t}),rt({content:n.toString(),title:a,extra:{attributes:c,styles:l,classes:["".concat(Z.familyPrefix,"-layers-counter")].concat(f(i))}})}))}}}},Ft={mixout:function(){return{text:function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=t.transform,a=void 0===e?nn:e,i=t.title,o=void 0===i?null:i,c=t.classes,s=void 0===c?[]:c,l=t.attributes,u=void 0===l?{}:l,m=t.styles,d=void 0===m?{}:m;return tt({type:"text",content:n},(function(){return Qn("beforeDOMElementCreation",{content:n,params:t}),at({content:n,transform:r(r({},nn),a),title:o,extra:{attributes:u,styles:d,classes:["".concat(Z.familyPrefix,"-layers-text")].concat(f(s))}})}))}}},provides:function(n){n.generateLayersText=function(n,t){var e=t.title,a=t.transform,r=t.extra,i=null,o=null;if(A){var c=parseInt(getComputedStyle(n).fontSize,10),s=n.getBoundingClientRect();i=s.width/c,o=s.height/c}return Z.autoA11y&&!e&&(r.attributes["aria-hidden"]="true"),Promise.resolve([n,at({content:n.innerHTML,width:i,height:o,transform:a,title:e,extra:r,watchable:!0})])}}},Wt=new RegExp('"',"ug"),Ht=[1105920,1112319];function Ut(n,t){var e="".concat("data-fa-pseudo-element-pending").concat(t.replace(":","-"));return new Promise((function(a,i){if(null!==n.getAttribute(e))return a();var o,c,s,f=en(n.children).filter((function(n){return n.getAttribute(E)===t}))[0],l=h.getComputedStyle(n,t),u=l.getPropertyValue("font-family").match(F),m=l.getPropertyValue("font-weight"),d=l.getPropertyValue("content");if(f&&!u)return n.removeChild(f),a();if(u&&"none"!==d&&""!==d){var p=l.getPropertyValue("content"),v=~["Solid","Regular","Light","Thin","Duotone","Brands","Kit"].indexOf(u[2])?T[u[2].toLowerCase()]:W[m],b=function(n){var t,e,a,r,i,o=n.replace(Wt,""),c=(e=0,r=(t=o).length,(i=t.charCodeAt(e))>=55296&&i<=56319&&r>e+1&&(a=t.charCodeAt(e+1))>=56320&&a<=57343?1024*(i-55296)+a-56320+65536:i),s=c>=Ht[0]&&c<=Ht[1],f=2===o.length&&o[0]===o[1];return{value:wn(f?o[0]:o),isSecondary:s||f}}(p),g=b.value,y=b.isSecondary,x=u[0].startsWith("FontAwesome"),k=Ln(v,g),O=k;if(x){var A=(c=Cn[o=g],s=Ln("fas",o),c||(s?{prefix:"fas",iconName:s}:null)||{prefix:null,iconName:null});A.iconName&&A.prefix&&(k=A.iconName,v=A.prefix)}if(!k||y||f&&f.getAttribute(S)===v&&f.getAttribute(P)===O)a();else{n.setAttribute(e,O),f&&n.removeChild(f);var N={iconName:null,title:null,titleId:null,prefix:null,transform:nn,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}},j=N.extra;j.attributes[E]=t,st(k,v).then((function(i){var o=et(r(r({},N),{},{icons:{main:i,mask:{prefix:null,iconName:null,rest:[]}},prefix:v,iconName:O,extra:j,watchable:!0})),c=w.createElement("svg");"::before"===t?n.insertBefore(c,n.firstChild):n.appendChild(c),c.outerHTML=o.map((function(n){return gn(n)})).join("\n"),n.removeAttribute(e),a()})).catch(i)}}else a()}))}function qt(n){return Promise.all([Ut(n,"::before"),Ut(n,"::after")])}function Xt(n){return!(n.parentNode===document.head||~z.indexOf(n.tagName.toUpperCase())||n.getAttribute(E)||n.parentNode&&"svg"===n.parentNode.tagName)}function Yt(n){if(O)return new Promise((function(t,e){var a=en(n.querySelectorAll("*")).filter(Xt).map(qt),r=dt("searchPseudoElements");Ot(),Promise.all(a).then((function(){r(),At(),t()})).catch((function(){r(),At(),e()}))}))}var Bt=!1,Vt=function(n){return n.toLowerCase().split(" ").reduce((function(n,t){var e=t.toLowerCase().split("-"),a=e[0],r=e.slice(1).join("-");if(a&&"h"===r)return n.flipX=!0,n;if(a&&"v"===r)return n.flipY=!0,n;if(r=parseFloat(r),isNaN(r))return n;switch(a){case"grow":n.size=n.size+r;break;case"shrink":n.size=n.size-r;break;case"left":n.x=n.x-r;break;case"right":n.x=n.x+r;break;case"up":n.y=n.y-r;break;case"down":n.y=n.y+r;break;case"rotate":n.rotate=n.rotate+r}return n}),{size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0})},Qt={mixout:function(){return{parse:{transform:function(n){return Vt(n)}}}},hooks:function(){return{parseNodeAttributes:function(n,t){var e=t.getAttribute("data-fa-transform");return e&&(n.transform=Vt(e)),n}}},provides:function(n){n.generateAbstractTransformGrouping=function(n){var t=n.main,e=n.transform,a=n.containerWidth,i=n.iconWidth,o={transform:"translate(".concat(a/2," 256)")},c="translate(".concat(32*e.x,", ").concat(32*e.y,") "),s="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),f="rotate(".concat(e.rotate," 0 0)"),l={outer:o,inner:{transform:"".concat(c," ").concat(s," ").concat(f)},path:{transform:"translate(".concat(i/2*-1," -256)")}};return{tag:"g",attributes:r({},l.outer),children:[{tag:"g",attributes:r({},l.inner),children:[{tag:t.icon.tag,children:t.icon.children,attributes:r(r({},t.icon.attributes),l.path)}]}]}}}},Gt={x:0,y:0,width:"100%",height:"100%"};function Kt(n){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n.attributes&&(n.attributes.fill||t)&&(n.attributes.fill="black"),n}var Zt={hooks:function(){return{parseNodeAttributes:function(n,t){var e=t.getAttribute("data-fa-mask"),a=e?Hn(e.split(" ").map((function(n){return n.trim()}))):{prefix:null,iconName:null,rest:[]};return a.prefix||(a.prefix=Fn()),n.mask=a,n.maskId=t.getAttribute("data-fa-mask-id"),n}}},provides:function(n){n.generateAbstractMask=function(n){var t,e=n.children,a=n.attributes,i=n.main,o=n.mask,c=n.maskId,s=n.transform,f=i.width,l=i.icon,u=o.width,m=o.icon,d=function(n){var t=n.transform,e=n.containerWidth,a=n.iconWidth,r={transform:"translate(".concat(e/2," 256)")},i="translate(".concat(32*t.x,", ").concat(32*t.y,") "),o="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),c="rotate(".concat(t.rotate," 0 0)");return{outer:r,inner:{transform:"".concat(i," ").concat(o," ").concat(c)},path:{transform:"translate(".concat(a/2*-1," -256)")}}}({transform:s,containerWidth:u,iconWidth:f}),p={tag:"rect",attributes:r(r({},Gt),{},{fill:"white"})},v=l.children?{children:l.children.map(Kt)}:{},b={tag:"g",attributes:r({},d.inner),children:[Kt(r({tag:l.tag,attributes:r(r({},l.attributes),d.path)},v))]},g={tag:"g",attributes:r({},d.outer),children:[b]},y="mask-".concat(c||tn()),h="clip-".concat(c||tn()),w={tag:"mask",attributes:r(r({},Gt),{},{id:y,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[p,g]},x={tag:"defs",children:[{tag:"clipPath",attributes:{id:h},children:(t=m,"g"===t.tag?t.children:[t])},w]};return e.push(x,{tag:"rect",attributes:r({fill:"currentColor","clip-path":"url(#".concat(h,")"),mask:"url(#".concat(y,")")},Gt)}),{children:e,attributes:a}}}},$t={provides:function(n){var t=!1;h.matchMedia&&(t=h.matchMedia("(prefers-reduced-motion: reduce)").matches),n.missingIconAbstract=function(){var n=[],e={fill:"currentColor"},a={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};n.push({tag:"path",attributes:r(r({},e),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});var i=r(r({},a),{},{attributeName:"opacity"}),o={tag:"circle",attributes:r(r({},e),{},{cx:"256",cy:"364",r:"28"}),children:[]};return t||o.children.push({tag:"animate",attributes:r(r({},a),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:r(r({},i),{},{values:"1;0;1;1;0;1;"})}),n.push(o),n.push({tag:"path",attributes:r(r({},e),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:t?[]:[{tag:"animate",attributes:r(r({},i),{},{values:"1;0;0;0;0;1;"})}]}),t||n.push({tag:"path",attributes:r(r({},e),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:r(r({},i),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:n}}}};!function(n,t){var e=t.mixoutsTo;qn=n,Xn={},Object.keys(Yn).forEach((function(n){-1===Bn.indexOf(n)&&delete Yn[n]})),qn.forEach((function(n){var t=n.mixout?n.mixout():{};if(Object.keys(t).forEach((function(n){"function"==typeof t[n]&&(e[n]=t[n]),"object"===i(t[n])&&Object.keys(t[n]).forEach((function(a){e[n]||(e[n]={}),e[n][a]=t[n][a]}))})),n.hooks){var a=n.hooks();Object.keys(a).forEach((function(n){Xn[n]||(Xn[n]=[]),Xn[n].push(a[n])}))}n.provides&&n.provides(Yn)}))}([un,Lt,Rt,Dt,Ft,{hooks:function(){return{mutationObserverCallbacks:function(n){return n.pseudoElementsCallback=Yt,n}}},provides:function(n){n.pseudoElements2svg=function(n){var t=n.node,e=void 0===t?w:t;Z.searchPseudoElements&&Yt(e)}}},{mixout:function(){return{dom:{unwatch:function(){Ot(),Bt=!0}}}},hooks:function(){return{bootstrap:function(){jt(Vn("mutationObserverCallbacks",{}))},noAuto:function(){Nt&&Nt.disconnect()},watch:function(n){var t=n.observeMutationsRoot;Bt?At():jt(Vn("mutationObserverCallbacks",{observeMutationsRoot:t}))}}}},Qt,Zt,$t,{hooks:function(){return{parseNodeAttributes:function(n,t){var e=t.getAttribute("data-fa-symbol"),a=null!==e&&(""===e||e);return n.symbol=a,n}}}}],{mixoutsTo:Jn});var Jt=Jn.config,ne=Jn.parse,te=Jn.icon},1417:(n,t,e)=>{e.d(t,{omb:()=>a,zhw:()=>r});var a={prefix:"fab",iconName:"discord",icon:[640,512,[],"f392","M524.5 69.84a1.5 1.5 0 0 0 -.764-.7A485.1 485.1 0 0 0 404.1 32.03a1.816 1.816 0 0 0 -1.923 .91 337.5 337.5 0 0 0 -14.9 30.6 447.8 447.8 0 0 0 -134.4 0 309.5 309.5 0 0 0 -15.14-30.6 1.89 1.89 0 0 0 -1.924-.91A483.7 483.7 0 0 0 116.1 69.14a1.712 1.712 0 0 0 -.788 .676C39.07 183.7 18.19 294.7 28.43 404.4a2.016 2.016 0 0 0 .765 1.375A487.7 487.7 0 0 0 176 479.9a1.9 1.9 0 0 0 2.063-.676A348.2 348.2 0 0 0 208.1 430.4a1.86 1.86 0 0 0 -1.019-2.588 321.2 321.2 0 0 1 -45.87-21.85 1.885 1.885 0 0 1 -.185-3.126c3.082-2.309 6.166-4.711 9.109-7.137a1.819 1.819 0 0 1 1.9-.256c96.23 43.92 200.4 43.92 295.5 0a1.812 1.812 0 0 1 1.924 .233c2.944 2.426 6.027 4.851 9.132 7.16a1.884 1.884 0 0 1 -.162 3.126 301.4 301.4 0 0 1 -45.89 21.83 1.875 1.875 0 0 0 -1 2.611 391.1 391.1 0 0 0 30.01 48.81 1.864 1.864 0 0 0 2.063 .7A486 486 0 0 0 610.7 405.7a1.882 1.882 0 0 0 .765-1.352C623.7 277.6 590.9 167.5 524.5 69.84zM222.5 337.6c-28.97 0-52.84-26.59-52.84-59.24S193.1 219.1 222.5 219.1c29.67 0 53.31 26.82 52.84 59.24C275.3 310.1 251.9 337.6 222.5 337.6zm195.4 0c-28.97 0-52.84-26.59-52.84-59.24S388.4 219.1 417.9 219.1c29.67 0 53.31 26.82 52.84 59.24C470.7 310.1 447.5 337.6 417.9 337.6z"]},r={prefix:"fab",iconName:"github",icon:[496,512,[],"f09b","M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3 .3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5 .3-6.2 2.3zm44.2-1.7c-2.9 .7-4.9 2.6-4.6 4.9 .3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3 .7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3 .3 2.9 2.3 3.9 1.6 1 3.6 .7 4.3-.7 .7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3 .7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3 .7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"]}},7814:(n,t,e)=>{e.d(t,{G:()=>x});var a=e(8947),r=e(5697),i=e.n(r),o=e(7294);function c(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),e.push.apply(e,a)}return e}function s(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?c(Object(e),!0).forEach((function(t){l(n,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):c(Object(e)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}))}return n}function f(n){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},f(n)}function l(n,t,e){return t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function u(n,t){if(null==n)return{};var e,a,r=function(n,t){if(null==n)return{};var e,a,r={},i=Object.keys(n);for(a=0;a<i.length;a++)e=i[a],t.indexOf(e)>=0||(r[e]=n[e]);return r}(n,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);for(a=0;a<i.length;a++)e=i[a],t.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(n,e)&&(r[e]=n[e])}return r}function m(n){return function(n){if(Array.isArray(n))return d(n)}(n)||function(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||function(n,t){if(!n)return;if("string"==typeof n)return d(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);"Object"===e&&n.constructor&&(e=n.constructor.name);if("Map"===e||"Set"===e)return Array.from(n);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return d(n,t)}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(n,t){(null==t||t>n.length)&&(t=n.length);for(var e=0,a=new Array(t);e<t;e++)a[e]=n[e];return a}function p(n){return t=n,(t-=0)==t?n:(n=n.replace(/[\-_\s]+(.)?/g,(function(n,t){return t?t.toUpperCase():""}))).substr(0,1).toLowerCase()+n.substr(1);var t}var v=["style"];function b(n){return n.split(";").map((function(n){return n.trim()})).filter((function(n){return n})).reduce((function(n,t){var e,a=t.indexOf(":"),r=p(t.slice(0,a)),i=t.slice(a+1).trim();return r.startsWith("webkit")?n[(e=r,e.charAt(0).toUpperCase()+e.slice(1))]=i:n[r]=i,n}),{})}var g=!1;try{g=!0}catch(O){}function y(n){return n&&"object"===f(n)&&n.prefix&&n.iconName&&n.icon?n:a.Qc.icon?a.Qc.icon(n):null===n?null:n&&"object"===f(n)&&n.prefix&&n.iconName?n:Array.isArray(n)&&2===n.length?{prefix:n[0],iconName:n[1]}:"string"==typeof n?{prefix:"fas",iconName:n}:void 0}function h(n,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?l({},n,t):{}}var w=["forwardedRef"];function x(n){var t=n.forwardedRef,e=u(n,w),r=e.icon,i=e.mask,o=e.symbol,c=e.className,f=e.title,d=e.titleId,p=y(r),v=h("classes",[].concat(m(function(n){var t,e=n.beat,a=n.fade,r=n.flash,i=n.spin,o=n.spinPulse,c=n.spinReverse,s=n.pulse,f=n.fixedWidth,u=n.inverse,m=n.border,d=n.listItem,p=n.flip,v=n.size,b=n.rotation,g=n.pull,y=(l(t={"fa-beat":e,"fa-fade":a,"fa-flash":r,"fa-spin":i,"fa-spin-reverse":c,"fa-spin-pulse":o,"fa-pulse":s,"fa-fw":f,"fa-inverse":u,"fa-border":m,"fa-li":d,"fa-flip-horizontal":"horizontal"===p||"both"===p,"fa-flip-vertical":"vertical"===p||"both"===p},"fa-".concat(v),null!=v),l(t,"fa-rotate-".concat(b),null!=b&&0!==b),l(t,"fa-pull-".concat(g),null!=g),l(t,"fa-swap-opacity",n.swapOpacity),t);return Object.keys(y).map((function(n){return y[n]?n:null})).filter((function(n){return n}))}(e)),m(c.split(" ")))),b=h("transform","string"==typeof e.transform?a.Qc.transform(e.transform):e.transform),O=h("mask",y(i)),A=(0,a.qv)(p,s(s(s(s({},v),b),O),{},{symbol:o,title:f,titleId:d}));if(!A)return function(){var n;!g&&console&&"function"==typeof console.error&&(n=console).error.apply(n,arguments)}("Could not find icon",p),null;var N=A.abstract,j={ref:t};return Object.keys(e).forEach((function(n){x.defaultProps.hasOwnProperty(n)||(j[n]=e[n])})),k(N[0],j)}x.displayName="FontAwesomeIcon",x.propTypes={beat:i().bool,border:i().bool,className:i().string,fade:i().bool,flash:i().bool,mask:i().oneOfType([i().object,i().array,i().string]),fixedWidth:i().bool,inverse:i().bool,flip:i().oneOf(["horizontal","vertical","both"]),icon:i().oneOfType([i().object,i().array,i().string]),listItem:i().bool,pull:i().oneOf(["right","left"]),pulse:i().bool,rotation:i().oneOf([0,90,180,270]),size:i().oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:i().bool,spinPulse:i().bool,spinReverse:i().bool,symbol:i().oneOfType([i().bool,i().string]),title:i().string,transform:i().oneOfType([i().string,i().object]),swapOpacity:i().bool},x.defaultProps={border:!1,className:"",mask:null,fixedWidth:!1,inverse:!1,flip:null,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,symbol:!1,title:"",transform:null,swapOpacity:!1};var k=function n(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof e)return e;var r=(e.children||[]).map((function(e){return n(t,e)})),i=Object.keys(e.attributes||{}).reduce((function(n,t){var a=e.attributes[t];switch(t){case"class":n.attrs.className=a,delete e.attributes.class;break;case"style":n.attrs.style=b(a);break;default:0===t.indexOf("aria-")||0===t.indexOf("data-")?n.attrs[t.toLowerCase()]=a:n.attrs[p(t)]=a}return n}),{attrs:{}}),o=a.style,c=void 0===o?{}:o,f=u(a,v);return i.attrs.style=s(s({},i.attrs.style),c),t.apply(void 0,[e.tag,s(s({},i.attrs),f)].concat(m(r)))}.bind(null,o.createElement)},3905:(n,t,e)=>{e.d(t,{Zo:()=>l,kt:()=>d});var a=e(7294);function r(n,t,e){return t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function i(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),e.push.apply(e,a)}return e}function o(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?i(Object(e),!0).forEach((function(t){r(n,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):i(Object(e)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}))}return n}function c(n,t){if(null==n)return{};var e,a,r=function(n,t){if(null==n)return{};var e,a,r={},i=Object.keys(n);for(a=0;a<i.length;a++)e=i[a],t.indexOf(e)>=0||(r[e]=n[e]);return r}(n,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);for(a=0;a<i.length;a++)e=i[a],t.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(n,e)&&(r[e]=n[e])}return r}var s=a.createContext({}),f=function(n){var t=a.useContext(s),e=t;return n&&(e="function"==typeof n?n(t):o(o({},t),n)),e},l=function(n){var t=f(n.components);return a.createElement(s.Provider,{value:t},n.children)},u={inlineCode:"code",wrapper:function(n){var t=n.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(n,t){var e=n.components,r=n.mdxType,i=n.originalType,s=n.parentName,l=c(n,["components","mdxType","originalType","parentName"]),m=f(e),d=r,p=m["".concat(s,".").concat(d)]||m[d]||u[d]||i;return e?a.createElement(p,o(o({ref:t},l),{},{components:e})):a.createElement(p,o({ref:t},l))}));function d(n,t){var e=arguments,r=t&&t.mdxType;if("string"==typeof n||r){var i=e.length,o=new Array(i);o[0]=m;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=n,c.mdxType="string"==typeof n?n:r,o[1]=c;for(var f=2;f<i;f++)o[f]=e[f];return a.createElement.apply(null,o)}return a.createElement.apply(null,e)}m.displayName="MDXCreateElement"}}]); \ No newline at end of file diff --git a/assets/js/4698.8c4037a9.js.LICENSE.txt b/assets/js/4698.8c4037a9.js.LICENSE.txt deleted file mode 100644 index f4c500d..0000000 --- a/assets/js/4698.8c4037a9.js.LICENSE.txt +++ /dev/null @@ -1,5 +0,0 @@ -/*! - * Font Awesome Free 6.0.0-beta3 by @fontawesome - https://fontawesome.com - * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) - * Copyright 2021 Fonticons, Inc. - */ diff --git a/assets/js/4f085710.4ae361d8.js b/assets/js/4f085710.4ae361d8.js new file mode 100644 index 0000000..168fbc0 --- /dev/null +++ b/assets/js/4f085710.4ae361d8.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[9921],{3905:(e,t,o)=>{o.d(t,{Zo:()=>p,kt:()=>m});var a=o(7294);function r(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function n(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function i(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?n(Object(o),!0).forEach((function(t){r(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function s(e,t){if(null==e)return{};var o,a,r=function(e,t){if(null==e)return{};var o,a,r={},n=Object.keys(e);for(a=0;a<n.length;a++)o=n[a],t.indexOf(o)>=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a<n.length;a++)o=n[a],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}var c=a.createContext({}),l=function(e){var t=a.useContext(c),o=t;return e&&(o="function"==typeof e?e(t):i(i({},t),e)),o},p=function(e){var t=l(e.components);return a.createElement(c.Provider,{value:t},e.children)},h="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},u=a.forwardRef((function(e,t){var o=e.components,r=e.mdxType,n=e.originalType,c=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),h=l(o),u=r,m=h["".concat(c,".").concat(u)]||h[u]||d[u]||n;return o?a.createElement(m,i(i({ref:t},p),{},{components:o})):a.createElement(m,i({ref:t},p))}));function m(e,t){var o=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var n=o.length,i=new Array(n);i[0]=u;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s[h]="string"==typeof e?e:r,i[1]=s;for(var l=2;l<n;l++)i[l]=o[l];return a.createElement.apply(null,i)}return a.createElement.apply(null,o)}u.displayName="MDXCreateElement"},9967:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>d,frontMatter:()=>n,metadata:()=>s,toc:()=>l});var a=o(7462),r=(o(7294),o(3905));const n={title:"Tutorial"},i=void 0,s={unversionedId:"guide/tutorial/index",id:"guide/tutorial/index",title:"Tutorial",description:"Here we will learn about the different elements of Cogment and how they fit together by creating a simulated game of Rock-Paper-Scissors. To run this tutorial locally, you will need to download or clone the source code from our github repository.",source:"@site/docs/guide/tutorial/index.md",sourceDirName:"guide/tutorial",slug:"/guide/tutorial/",permalink:"/docs/guide/tutorial/",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",frontMatter:{title:"Tutorial"},sidebar:"docSidebar",previous:{title:"Migrate from Cogment v1 to v2",permalink:"/docs/guide/implementation-recipes/v2-migration-guide"},next:{title:"Step 1 - An Empty Cogment Application",permalink:"/docs/guide/tutorial/setup"}},c={},l=[{value:"Prerequisites",id:"prerequisites",level:3},{value:"Why Rock-Paper-Scissors (RPS)?",id:"why-rock-paper-scissors-rps",level:2},{value:"Formalizing RPS",id:"formalizing-rps",level:2},{value:"How does Cogment think of these pieces?",id:"how-does-cogment-think-of-these-pieces",level:3},{value:"Tutorial Roadmap",id:"tutorial-roadmap",level:2}],p={toc:l},h="wrapper";function d(e){let{components:t,...n}=e;return(0,r.kt)(h,(0,a.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"Here we will learn about the different elements of ",(0,r.kt)("a",{parentName:"p",href:"/docs/"},"Cogment")," and how they fit together by creating a simulated game of ",(0,r.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/Rock_paper_scissors"},"Rock-Paper-Scissors"),". To run this tutorial locally, you will need to download or clone the source code from our ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-tutorial-rps"},"github repository"),"."),(0,r.kt)("h3",{id:"prerequisites"},"Prerequisites"),(0,r.kt)("p",null,"This tutorial assumes a strong working knowledge of Python, as well as some basic familiarity with the following:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Reinforcement Learning (RL) - some fundamental ideas of RL are covered on the ",(0,r.kt)("a",{parentName:"li",href:"/docs/guide/core-concepts"},"Cogment Core Concepts")," page"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://grpc.io/"},"gRPC")," & ",(0,r.kt)("a",{parentName:"li",href:"https://protobuf.dev/"},"Protocol Buffers")),(0,r.kt)("li",{parentName:"ul"},"Python's ",(0,r.kt)("a",{parentName:"li",href:"https://docs.python.org/3/library/asyncio-task.html"},"asynchronous features"),", as the ",(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python"},"Python SDK")," leverages this functionality")),(0,r.kt)("h2",{id:"why-rock-paper-scissors-rps"},"Why Rock-Paper-Scissors (RPS)?"),(0,r.kt)("p",null,"RPS is a hand game, usually played between two players, in which each player selects one of three possible hand-signs indicating rock, paper, or scissors."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Schematic of rock-paper-scissors from Wikipedia",src:o(6561).Z,width:"1144",height:"1122"})),(0,r.kt)("p",null,"RPS is a simultaneous, zero-sum game which has only two possible outcomes:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"One player's action beats the other (i.e. they win and their opponent loses), or"),(0,r.kt)("li",{parentName:"ul"},"Both players choose the same action and the game is a draw.")),(0,r.kt)("p",null,'RPS is a very simple game with straightforward rules. As long as we forbid pure random moves, which are very difficult to beat, it is an interesting testbed to develop AIs that compete with Humans. Unlike "deep" games such as chess or go, the power is not really in the brute force exploration of possible outcomes, but rather in getting some level of understanding of how the opponent plays to be able to anticipate their moves. A good read on the subject of AI and RPS is this article by Benjamin Peterson: ',(0,r.kt)("a",{parentName:"p",href:"https://towardsai.net/p/artificial-intelligence/towards-an-ai-for-rock-paper-scissors-3fb05780271f"},"Towards an AI for Rock, Paper, Scissors"),". This means as a tutorial to get acquainted with Cogment, RPS is simple enough to be easily implemented, and interesting enough to be a good example to showcase the different kinds of things Cogment is capable of doing."),(0,r.kt)("h2",{id:"formalizing-rps"},"Formalizing RPS"),(0,r.kt)("p",null,"Cogment is designed with the abstraction of reinforcement Learning in mind: tasks are broken down into sequential interactions between ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#actors"},"Actor(s)")," and the ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#environment"},"Environment"),'. The Actors are the players of RPS, and the Environment is the world the players operate in: which types of actions are allowed, the rules that specify the consequences of actions (eg. "scissors beats paper").'),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Abstraction of Interactions",src:o(4207).Z,width:"2582",height:"932"})),(0,r.kt)("p",null,'Actors usually need to know some information about the state of the world in order to make a choice about which action to select -- this kind of information is called an "',(0,r.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#state-and-observation-spaces"},"Observation"),'".'),(0,r.kt)("p",null,"The Environment receives these actions and produces consequences -- updated Observations on the state of the world, and sometimes a reward signal, such as a win or loss. Reward signals are a useful way of quantifying goals, and are used in RL for training AI-based actors to improve their behaviour in pursuit of maximizing the rewards."),(0,r.kt)("p",null,"The repeated sequential interactions between players and the RPS game environment are handled by running ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#trials"},"Trials")," which coordinate the exchange of information between Actors and the Environment until a terminal condition is met."),(0,r.kt)("h3",{id:"how-does-cogment-think-of-these-pieces"},"How does Cogment think of these pieces?"),(0,r.kt)("p",null,"Cogment runs as a ",(0,r.kt)("a",{parentName:"p",href:"https://www.atlassian.com/microservices/microservices-architecture/distributed-architecture#:~:text=A%20microservices%20architecture%20is%20one,users%2C%20products%2C%20etc."},"distributed microservices architecture"),", meaning that the RPS Environment, each of the Actors, and the Cogment machinery that supports their interactions are all set up as separate services whose processes can be run on separate computation nodes. The operations carried out on each of these services are coordinated by the ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/cli/orchestrator"},"Orchestrator"),", a key component of Cogment that ties all services together in order to execute the ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#trials"},"Trials"),"."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Cogment components used in RPS",src:o(775).Z,width:"2366",height:"1254"})),(0,r.kt)("h2",{id:"tutorial-roadmap"},"Tutorial Roadmap"),(0,r.kt)("p",null,"By the end of this basic tutorial you should understand the key elements of Cogment and how they work together. In particular, these steps cover how Cogment handles Actors and Environments and how the interactions between them are orchestrated to run trials. We start with a basic skeleton of each of these pieces, and add more detail as we go through the tutorial."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"tutorial roadmap",src:o(9317).Z,width:"2756",height:"924"})),(0,r.kt)("p",null,"The ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/setup"},"first step")," of the tutorial is to get the code set up and make sure it functions properly. The basic code doesn't do anything interesting, but we will walk through what components are included so that it's clear how the different pieces fit together."),(0,r.kt)("p",null,"In ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/actors-in-cogment"},"step 2"),", we will look at how Cogment represents Actors, what information they operate with, and how they communicate with the other components of the application"),(0,r.kt)("p",null,"In ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/environment-in-cogment"},"step 3"),", we will flesh out the details of the Environment. This involves specifying what types of actions are allowed in the game and the rules for what happens when actions are taken, as well as configuring the conditions for when a game has been won."),(0,r.kt)("p",null,"In ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/decision-making"},"step 4"),", we will add feedback from the Environment and enable one of the Actors to reason about action selection given information in the Observation it receives. We'll look at how two Actors using different implementations perform in a game of RPS."),(0,r.kt)("p",null,"Once you understand the basic components of Cogment and how they work together, you may be interested in ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/advanced-tutorials/"},"more advanced tutorials"),' on how to implement more complex things with Cogment. We treat the more advanced tutorials as a "choose your own adventure" style of guide: ',(0,r.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/advanced-tutorials/human-player"},"play with a human in the loop"),", ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/advanced-tutorials/web-client"},"connect a web client for a better human user interface"),", or ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/advanced-tutorials/directory"},"improve operational efficiency by using some more advanced Cogment tooling"),"."))}d.isMDXComponent=!0},6561:(e,t,o)=>{o.d(t,{Z:()=>a});const a=o.p+"assets/images/Rock-paper-scissors-f65f74cd8d8ff583b8216b633dfb813e.png"},4207:(e,t,o)=>{o.d(t,{Z:()=>a});const a=o.p+"assets/images/actor-env-interaction-simple-242d91b0489b900be23e50b63616ffe3.png"},775:(e,t,o)=>{o.d(t,{Z:()=>a});const a=o.p+"assets/images/cogment_components_RPS-00b1c8172e619e23af6e1ecdcd7cbcac.png"},9317:(e,t,o)=>{o.d(t,{Z:()=>a});const a=o.p+"assets/images/tutorial_roadmap-ad93f2919b3dff4426f08cedda097a93.png"}}]); \ No newline at end of file diff --git a/assets/js/4f085710.99943333.js b/assets/js/4f085710.99943333.js deleted file mode 100644 index b825f3f..0000000 --- a/assets/js/4f085710.99943333.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[9921],{3905:(e,t,o)=>{o.d(t,{Zo:()=>p,kt:()=>u});var a=o(7294);function r(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function n(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function i(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?n(Object(o),!0).forEach((function(t){r(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function s(e,t){if(null==e)return{};var o,a,r=function(e,t){if(null==e)return{};var o,a,r={},n=Object.keys(e);for(a=0;a<n.length;a++)o=n[a],t.indexOf(o)>=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a<n.length;a++)o=n[a],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}var c=a.createContext({}),l=function(e){var t=a.useContext(c),o=t;return e&&(o="function"==typeof e?e(t):i(i({},t),e)),o},p=function(e){var t=l(e.components);return a.createElement(c.Provider,{value:t},e.children)},h={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var o=e.components,r=e.mdxType,n=e.originalType,c=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),d=l(o),u=r,m=d["".concat(c,".").concat(u)]||d[u]||h[u]||n;return o?a.createElement(m,i(i({ref:t},p),{},{components:o})):a.createElement(m,i({ref:t},p))}));function u(e,t){var o=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var n=o.length,i=new Array(n);i[0]=d;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s.mdxType="string"==typeof e?e:r,i[1]=s;for(var l=2;l<n;l++)i[l]=o[l];return a.createElement.apply(null,i)}return a.createElement.apply(null,o)}d.displayName="MDXCreateElement"},9967:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>h,frontMatter:()=>n,metadata:()=>s,toc:()=>l});var a=o(7462),r=(o(7294),o(3905));const n={title:"Tutorial"},i=void 0,s={unversionedId:"guide/tutorial/index",id:"guide/tutorial/index",title:"Tutorial",description:"Here we will learn about the different elements of Cogment and how they fit together by creating a simulated game of Rock-Paper-Scissors. To run this tutorial locally, you will need to download or clone the source code from our github repository.",source:"@site/docs/guide/tutorial/index.md",sourceDirName:"guide/tutorial",slug:"/guide/tutorial/",permalink:"/docs/guide/tutorial/",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",frontMatter:{title:"Tutorial"},sidebar:"docSidebar",previous:{title:"Migrate from Cogment v1 to v2",permalink:"/docs/guide/implementation-recipes/v2-migration-guide"},next:{title:"Step 1 - An Empty Cogment Application",permalink:"/docs/guide/tutorial/setup"}},c={},l=[{value:"Prerequisites",id:"prerequisites",level:3},{value:"Why Rock-Paper-Scissors (RPS)?",id:"why-rock-paper-scissors-rps",level:2},{value:"Formalizing RPS",id:"formalizing-rps",level:2},{value:"How does Cogment think of these pieces?",id:"how-does-cogment-think-of-these-pieces",level:3},{value:"Tutorial Roadmap",id:"tutorial-roadmap",level:2}],p={toc:l};function h(e){let{components:t,...n}=e;return(0,r.kt)("wrapper",(0,a.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"Here we will learn about the different elements of ",(0,r.kt)("a",{parentName:"p",href:"/docs/"},"Cogment")," and how they fit together by creating a simulated game of ",(0,r.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/Rock_paper_scissors"},"Rock-Paper-Scissors"),". To run this tutorial locally, you will need to download or clone the source code from our ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-tutorial-rps"},"github repository"),"."),(0,r.kt)("h3",{id:"prerequisites"},"Prerequisites"),(0,r.kt)("p",null,"This tutorial assumes a strong working knowledge of Python, as well as some basic familiarity with the following:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Reinforcement Learning (RL) - some fundamental ideas of RL are covered on the ",(0,r.kt)("a",{parentName:"li",href:"/docs/guide/core-concepts"},"Cogment Core Concepts")," page"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://grpc.io/"},"gRPC")," & ",(0,r.kt)("a",{parentName:"li",href:"https://protobuf.dev/"},"Protocol Buffers")),(0,r.kt)("li",{parentName:"ul"},"Python's ",(0,r.kt)("a",{parentName:"li",href:"https://docs.python.org/3/library/asyncio-task.html"},"asynchronous features"),", as the ",(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python"},"Python SDK")," leverages this functionality")),(0,r.kt)("h2",{id:"why-rock-paper-scissors-rps"},"Why Rock-Paper-Scissors (RPS)?"),(0,r.kt)("p",null,"RPS is a hand game, usually played between two players, in which each player selects one of three possible hand-signs indicating rock, paper, or scissors."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Schematic of rock-paper-scissors from Wikipedia",src:o(6561).Z,width:"1144",height:"1122"})),(0,r.kt)("p",null,"RPS is a simultaneous, zero-sum game which has only two possible outcomes:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"One player's action beats the other (i.e. they win and their opponent loses), or"),(0,r.kt)("li",{parentName:"ul"},"Both players choose the same action and the game is a draw.")),(0,r.kt)("p",null,'RPS is a very simple game with straightforward rules. As long as we forbid pure random moves, which are very difficult to beat, it is an interesting testbed to develop AIs that compete with Humans. Unlike "deep" games such as chess or go, the power is not really in the brute force exploration of possible outcomes, but rather in getting some level of understanding of how the opponent plays to be able to anticipate their moves. A good read on the subject of AI and RPS is this article by Benjamin Peterson: ',(0,r.kt)("a",{parentName:"p",href:"https://towardsai.net/p/artificial-intelligence/towards-an-ai-for-rock-paper-scissors-3fb05780271f"},"Towards an AI for Rock, Paper, Scissors"),". This means as a tutorial to get acquainted with Cogment, RPS is simple enough to be easily implemented, and interesting enough to be a good example to showcase the different kinds of things Cogment is capable of doing."),(0,r.kt)("h2",{id:"formalizing-rps"},"Formalizing RPS"),(0,r.kt)("p",null,"Cogment is designed with the abstraction of reinforcement Learning in mind: tasks are broken down into sequential interactions between ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#actors"},"Actor(s)")," and the ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#environment"},"Environment"),'. The Actors are the players of RPS, and the Environment is the world the players operate in: which types of actions are allowed, the rules that specify the consequences of actions (eg. "scissors beats paper").'),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Abstraction of Interactions",src:o(4207).Z,width:"2582",height:"932"})),(0,r.kt)("p",null,'Actors usually need to know some information about the state of the world in order to make a choice about which action to select -- this kind of information is called an "',(0,r.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#state-and-observation-spaces"},"Observation"),'".'),(0,r.kt)("p",null,"The Environment receives these actions and produces consequences -- updated Observations on the state of the world, and sometimes a reward signal, such as a win or loss. Reward signals are a useful way of quantifying goals, and are used in RL for training AI-based actors to improve their behaviour in pursuit of maximizing the rewards."),(0,r.kt)("p",null,"The repeated sequential interactions between players and the RPS game environment are handled by running ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#trials"},"Trials")," which coordinate the exchange of information between Actors and the Environment until a terminal condition is met."),(0,r.kt)("h3",{id:"how-does-cogment-think-of-these-pieces"},"How does Cogment think of these pieces?"),(0,r.kt)("p",null,"Cogment runs as a ",(0,r.kt)("a",{parentName:"p",href:"https://www.atlassian.com/microservices/microservices-architecture/distributed-architecture#:~:text=A%20microservices%20architecture%20is%20one,users%2C%20products%2C%20etc."},"distributed microservices architecture"),", meaning that the RPS Environment, each of the Actors, and the Cogment machinery that supports their interactions are all set up as separate services whose processes can be run on separate computation nodes. The operations carried out on each of these services are coordinated by the ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/cli/orchestrator"},"Orchestrator"),", a key component of Cogment that ties all services together in order to execute the ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#trials"},"Trials"),"."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Cogment components used in RPS",src:o(775).Z,width:"2366",height:"1254"})),(0,r.kt)("h2",{id:"tutorial-roadmap"},"Tutorial Roadmap"),(0,r.kt)("p",null,"By the end of this basic tutorial you should understand the key elements of Cogment and how they work together. In particular, these steps cover how Cogment handles Actors and Environments and how the interactions between them are orchestrated to run trials. We start with a basic skeleton of each of these pieces, and add more detail as we go through the tutorial."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"tutorial roadmap",src:o(9317).Z,width:"2756",height:"924"})),(0,r.kt)("p",null,"The ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/setup"},"first step")," of the tutorial is to get the code set up and make sure it functions properly. The basic code doesn't do anything interesting, but we will walk through what components are included so that it's clear how the different pieces fit together."),(0,r.kt)("p",null,"In ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/actors-in-cogment"},"step 2"),", we will look at how Cogment represents Actors, what information they operate with, and how they communicate with the other components of the application"),(0,r.kt)("p",null,"In ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/environment-in-cogment"},"step 3"),", we will flesh out the details of the Environment. This involves specifying what types of actions are allowed in the game and the rules for what happens when actions are taken, as well as configuring the conditions for when a game has been won."),(0,r.kt)("p",null,"In ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/decision-making"},"step 4"),", we will add feedback from the Environment and enable one of the Actors to reason about action selection given information in the Observation it receives. We'll look at how two Actors using different implementations perform in a game of RPS."),(0,r.kt)("p",null,"Once you understand the basic components of Cogment and how they work together, you may be interested in ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/advanced-tutorials/"},"more advanced tutorials"),' on how to implement more complex things with Cogment. We treat the more advanced tutorials as a "choose your own adventure" style of guide: ',(0,r.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/advanced-tutorials/human-player"},"play with a human in the loop"),", ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/advanced-tutorials/web-client"},"connect a web client for a better human user interface"),", or ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/advanced-tutorials/directory"},"improve operational efficiency by using some more advanced Cogment tooling"),"."))}h.isMDXComponent=!0},6561:(e,t,o)=>{o.d(t,{Z:()=>a});const a=o.p+"assets/images/Rock-paper-scissors-f65f74cd8d8ff583b8216b633dfb813e.png"},4207:(e,t,o)=>{o.d(t,{Z:()=>a});const a=o.p+"assets/images/actor-env-interaction-simple-242d91b0489b900be23e50b63616ffe3.png"},775:(e,t,o)=>{o.d(t,{Z:()=>a});const a=o.p+"assets/images/cogment_components_RPS-00b1c8172e619e23af6e1ecdcd7cbcac.png"},9317:(e,t,o)=>{o.d(t,{Z:()=>a});const a=o.p+"assets/images/tutorial_roadmap-ad93f2919b3dff4426f08cedda097a93.png"}}]); \ No newline at end of file diff --git a/assets/js/50751b0a.5ac1ed00.js b/assets/js/50751b0a.5ac1ed00.js deleted file mode 100644 index 4384d8f..0000000 --- a/assets/js/50751b0a.5ac1ed00.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[8687],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>m});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=r.createContext({}),c=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=c(e.components);return r.createElement(s.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},h=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,s=e.parentName,d=l(e,["components","mdxType","originalType","parentName"]),h=c(n),m=i,u=h["".concat(s,".").concat(m)]||h[m]||p[m]||a;return n?r.createElement(u,o(o({ref:t},d),{},{components:n})):r.createElement(u,o({ref:t},d))}));function m(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,o=new Array(a);o[0]=h;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l.mdxType="string"==typeof e?e:i,o[1]=l;for(var c=2;c<a;c++)o[c]=n[c];return r.createElement.apply(null,o)}return r.createElement.apply(null,n)}h.displayName="MDXCreateElement"},9772:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>p,frontMatter:()=>a,metadata:()=>l,toc:()=>c});var r=n(7462),i=(n(7294),n(3905));const a={title:"Server",sidebar_position:1},o="Directory Server",l={unversionedId:"reference/cli/directory/directory-server",id:"reference/cli/directory/directory-server",title:"Server",description:"The Directory is an implementation of the directory gRPC service. It is the service to find other services. Typically, every other Cogment service only needs to know the address of the Directory to access anything in Cogment.",source:"@site/docs/reference/cli/directory/directory-server.md",sourceDirName:"reference/cli/directory",slug:"/reference/cli/directory/directory-server",permalink:"/docs/reference/cli/directory/directory-server",draft:!1,tags:[],version:"current",lastUpdatedAt:1700230418,formattedLastUpdatedAt:"Nov 17, 2023",sidebarPosition:1,frontMatter:{title:"Server",sidebar_position:1},sidebar:"docSidebar",previous:{title:"Orchestrator",permalink:"/docs/reference/cli/orchestrator"},next:{title:"Client",permalink:"/docs/reference/cli/directory/directory-client"}},s={},c=[{value:"Command line",id:"command-line",level:2},{value:"Options",id:"options",level:2},{value:"<code>port</code>",id:"port",level:3},{value:"<code>grpc_reflection</code>",id:"grpc_reflection",level:3},{value:"<code>log_level</code>",id:"log_level",level:3},{value:"<code>log_file</code>",id:"log_file",level:3},{value:"<code>registration_lag</code>",id:"registration_lag",level:3},{value:"<code>persistence_file</code>",id:"persistence_file",level:3},{value:"<code>load_balancing</code>",id:"load_balancing",level:3},{value:"<code>check_on_inquire</code>",id:"check_on_inquire",level:3},{value:"<code>force_permanent</code>",id:"force_permanent",level:3},{value:"Operation",id:"operation",level:2},{value:"Health Checking",id:"health-checking",level:3},{value:"Load Balancing",id:"load-balancing",level:3},{value:"Data",id:"data",level:3}],d={toc:c};function p(e){let{components:t,...n}=e;return(0,i.kt)("wrapper",(0,r.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"directory-server"},"Directory Server"),(0,i.kt)("p",null,"The Directory is an implementation of the ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/grpc#directory-api"},"directory gRPC service"),". It is the service to find other services. Typically, every other Cogment service only needs to know the address of the Directory to access anything in Cogment."),(0,i.kt)("p",null,"A regular health check is done on non-permanent network services to make sure they remain available (i.e. network reachable).\nIf a service fails the health check, it is automatically removed from the Directory."),(0,i.kt)("p",null,"The Directory works in tandem with the Cogment ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#cogment-endpoints"},"endpoints"),", in particular the ones with a ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#discover-host"},"discover host")," (referred as ",(0,i.kt)("strong",{parentName:"p"},"discovery endpoints"),")."),(0,i.kt)("p",null,"A ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cli/directory/directory-client"},"Directory Client")," is also part of the Cogment CLI to access the Directory from the command line."),(0,i.kt)("h2",{id:"command-line"},"Command line"),(0,i.kt)("p",null,"The Directory is a Cogment CLI service:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"$ cogment services directory --port=9005\n")),(0,i.kt)("h2",{id:"options"},"Options"),(0,i.kt)("h3",{id:"port"},(0,i.kt)("inlineCode",{parentName:"h3"},"port")),(0,i.kt)("p",null,"The TCP port where to serve the ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/grpc#directory-api"},"directory gRPC service"),". This is where the users of the Directory connect to."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--port"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_PORT"),","),(0,i.kt)("li",{parentName:"ul"},"default value is 9005.")),(0,i.kt)("h3",{id:"grpc_reflection"},(0,i.kt)("inlineCode",{parentName:"h3"},"grpc_reflection")),(0,i.kt)("p",null,"Whether or not to enable ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/grpc/grpc/blob/master/doc/server-reflection.md"},"gRPC reflection")," on the served directory endpoint."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--grpc_reflection"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_GRPC_REFLECTION=1"),","),(0,i.kt)("li",{parentName:"ul"},"by default, it is disabled.")),(0,i.kt)("h3",{id:"log_level"},(0,i.kt)("inlineCode",{parentName:"h3"},"log_level")),(0,i.kt)("p",null,"Set to define the minimum level for logging. Possible values are: ",(0,i.kt)("inlineCode",{parentName:"p"},"off"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"error"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"warning"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"info"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"debug"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"trace"),"."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--log_level=debug"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_LOG_LEVEL=info"),","),(0,i.kt)("li",{parentName:"ul"},"default value is info.")),(0,i.kt)("h3",{id:"log_file"},(0,i.kt)("inlineCode",{parentName:"h3"},"log_file")),(0,i.kt)("p",null,"Base file name for daily log output. The name will be suffixed with the date and a new file will be made every day. If not provided, the logs go to stdout."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--log_file=./path/to/cogment.log"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_LOG_FILE=./path/to/cogment.log"),","),(0,i.kt)("li",{parentName:"ul"},"default value is info.")),(0,i.kt)("h3",{id:"registration_lag"},(0,i.kt)("inlineCode",{parentName:"h3"},"registration_lag")),(0,i.kt)("p",null,"The maximum number of seconds to wait before responding with no result (either due to a service not registered, or that has failed a health check).\nThis can be used when components may start at slightly different time, and some components may inquire about a component that did not have time to register yet.\nIt may also help when services sometimes go temporarily offline."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--registration_lag"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_REGISTRATION_LAG"),","),(0,i.kt)("li",{parentName:"ul"},"default value is 0.")),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},(0,i.kt)("a",{parentName:"p",href:"#load-balancing"},"Unserviceable"),' services are not considered for this lag.\nI.e. the directory will not wait for a service to become "serviceable".')),(0,i.kt)("h3",{id:"persistence_file"},(0,i.kt)("inlineCode",{parentName:"h3"},"persistence_file")),(0,i.kt)("p",null,"The file name where persistence data will be read from on start-up and stored afterward.\nThe file will be created if it does not already exist.\nIf set to an empty string, persistence will be disabled."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--persistence_file"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_PERSISTENCE_FILE"),","),(0,i.kt)("li",{parentName:"ul"},'default value is ".cogment-directory-data".')),(0,i.kt)("h3",{id:"load_balancing"},(0,i.kt)("inlineCode",{parentName:"h3"},"load_balancing")),(0,i.kt)("p",null,"Whether or not to enable ",(0,i.kt)("a",{parentName:"p",href:"#load-balancing"},"load balancing")," when services are inquired."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--load_balancing"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_LOAD_BALANCING=1"),","),(0,i.kt)("li",{parentName:"ul"},"by default, it is disabled.")),(0,i.kt)("h3",{id:"check_on_inquire"},(0,i.kt)("inlineCode",{parentName:"h3"},"check_on_inquire")),(0,i.kt)("p",null,"Whether or not to enable ",(0,i.kt)("a",{parentName:"p",href:"#health-checking"},"health checking")," when a service is matched by an inquiry (in addition to being checked periodically).\nThis can prevent unavailable services from being returned (before the periodic health check has time to run).\nIt can also allow load balancing to use more recent/dynamic values.\nBut it can significantly slow down directory inquiries, especially when a health check fails."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--check_on_inquire"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_CHECK_ON_INQUIRE=1"),","),(0,i.kt)("li",{parentName:"ul"},"by default, it is disabled.")),(0,i.kt)("h3",{id:"force_permanent"},(0,i.kt)("inlineCode",{parentName:"h3"},"force_permanent")),(0,i.kt)("p",null,"Forces all registration of services to be a ",(0,i.kt)("a",{parentName:"p",href:"#data"},"permanent")," entry."),(0,i.kt)("p",null,"Services can normally be tagged permanent on an individual basis.\nThis ",(0,i.kt)("inlineCode",{parentName:"p"},"force_permanent")," option is for special circumstances where ",(0,i.kt)("strong",{parentName:"p"},"all")," entries should be permanent and it is not appropriate, or too complicated, to set each individual entry to be permanent."),(0,i.kt)("p",null,"Permanent entries are not health checked, and thus are not implicitly removed from the Directory if they fail.\nThey are also not duplicated; they are updated instead of being duplicated or replaced."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--force_permanent"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_FORCE_PERMANENT=1"),","),(0,i.kt)("li",{parentName:"ul"},"by default, it is disabled.")),(0,i.kt)("h2",{id:"operation"},"Operation"),(0,i.kt)("p",null,"At its most basic, the Directory contains services searchable by type and property, and returns endpoints where to reach the matched services."),(0,i.kt)("p",null,'Every registered service has a unique ID (it is unique among currently registered services). When registering a service, the ID of the new service is provided with a "secret" key (a string).\nThis "secret" (in combination with the ID) is required to deregister the service.\nIf a new service matches an existing one (i.e. an inquiry would match them), it is considered a duplicate.\nDuplicates are acceptable for non-permanent services.\nFor permanent services (both the old and new services must be permanent), duplicates are not allowed; instead, an update of the old service is performed (i.e. the ID and secret are kept the same).'),(0,i.kt)("p",null,"Every service is also associated with an authentication token.\nThis token is provided by users when registering a new service, and it must be provided to inquire or deregister that service.\nFor example, any inquiry can only find services that have the same authentication token as the one provided to the inquiry.\nSimilarly for deregistering: a service cannot be deregistered without the appropriate authentication token.\nIn closed environments, the authentication token can be left empty to facilitate directory management."),(0,i.kt)("h3",{id:"health-checking"},"Health Checking"),(0,i.kt)("p",null,"Each entry is normally checked for connectivity on a regular basis (every 60 seconds), but can also be checked when an entry matches an inquiry (see ",(0,i.kt)("a",{parentName:"p",href:"#check_on_inquire"},"check_on_inquire"),")."),(0,i.kt)("p",null,"The type of the entry determines the extent of the health check.\nFor Cogment services, the ",(0,i.kt)("inlineCode",{parentName:"p"},"Status")," procedure will be called and a response expected.\nFor non-Cogment services, a simple tcp connection will be attempted, and if successful, the service will be considered healthy."),(0,i.kt)("p",null,"If a service fails the health check multiple times, it will be removed from the directory.\nBut after the first failure, the service will not be reported on inquiries until and unless it succeeds a health check."),(0,i.kt)("p",null,"When services are recovered from a persistence file, they will immediately be subjected to a health check."),(0,i.kt)("h3",{id:"load-balancing"},"Load Balancing"),(0,i.kt)("p",null,"By default load balancing is disabled, and thus when inquiring, the services returned are in increasing order of age (since registration).\nSo the first is always the most recently registered service."),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"Permanent services do not change their registration timestamp when updated.")),(0,i.kt)("p",null,"When load balancing is enabled, and an inquiry is made, the order of services returned is different:"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},'For each service that match the inquiry, the last read "overall_load" ',(0,i.kt)("inlineCode",{parentName:"li"},"Status")," (see below) is used. If ",(0,i.kt)("a",{parentName:"li",href:"#check_on_inquire"},"check_on_inquire"),' is enabled, then the service\'s current "overall_load" is read at this point.'),(0,i.kt)("li",{parentName:"ol"},"Services with a load of 255 are considered unserviceable and removed from the list of potential candidates."),(0,i.kt)("li",{parentName:"ol"},"The service with the lowest load is found. That service, and services with a load close to that one, are retained."),(0,i.kt)("li",{parentName:"ol"},"The retained services are shuffled randomly, and returned as a reply to the inquiry.")),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"Non-Cogment services (with no ",(0,i.kt)("inlineCode",{parentName:"p"},"Status")," gRPC procedure) are always considered fully available (with a load of 0).\nAnd thus will always be returned, but in random order, when load balancing is enabled.")),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"Status"),' gRPC procedure\'s "overall_load" status is expected to be a string representation of an integer from 0 to 255 (8 bit unsigned integer).\nIf the string cannot be converted to such an integer, a load of 0 is assumed (e.g. "256" will result in a load of 0).\nA normal value is between 0 and 100, representing the load on the machine where the service is running.\nA value of 0 means that there is no load, and a value of 100 means that the machine is very loaded (and may not be able to do processing in a timely manner).\nThe exact meaning of the value is dependent on the service reporting.\nA value of 255 indicates that the machine is not fit to run any new service (and thus it is "unserviceable").'),(0,i.kt)("h3",{id:"data"},"Data"),(0,i.kt)("p",null,"The Directory maintains the following data for each service:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"service ID"),": This is a numerical (64 bits unsigned integer) value generated by the Directory and assigned to the service on registration. It is unique to that service as long as it is in the Directory. Although very unlikely, it is possible for this ID to be re-used after the service is deregistered. Zero (0) is not a valid ID."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"endpoint"),": It consists of four distinct information:",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"protocol: The protocol (URL scheme) for the endpoint (",(0,i.kt)("inlineCode",{parentName:"li"},"grpc")," or ",(0,i.kt)("inlineCode",{parentName:"li"},"cogment"),"). The ",(0,i.kt)("inlineCode",{parentName:"li"},"cogment"),' protocol is not considered a "network" protocol and thus will not be checked for health (network connectivity).'),(0,i.kt)("li",{parentName:"ul"},"host: The host for the endpoint (e.g. somewhere.com). For the ",(0,i.kt)("inlineCode",{parentName:"li"},"grpc")," protocol this represents a TCP/IP network resource; it can be a network hostname or an IP address. For the ",(0,i.kt)("inlineCode",{parentName:"li"},"cogment")," protocol it must be a registered name (see ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/parameters#cogment-endpoints"},"cogment endpoints"),") and typically does not represent a network resource."),(0,i.kt)("li",{parentName:"ul"},"port: The TCP port where the registered service is providing its services. This is required for ",(0,i.kt)("inlineCode",{parentName:"li"},"grpc")," protocol hosts."),(0,i.kt)("li",{parentName:"ul"},"ssl requirement: Whether the service requires an encrypted SSL connection."))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"type"),": The type of service. This also determines how health checks are performed on the service (i.e. which gRPC service should be used to check the health of the service).",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"client actor connection: Provides ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/grpc#service-clientactorsp"},"client actor")," gRPC API service"),(0,i.kt)("li",{parentName:"ul"},"trial lifecycle management: Provides ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/grpc#service-triallifecyclesp"},"lifecycle")," gRPC API service"),(0,i.kt)("li",{parentName:"ul"},"actor: Provides ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/grpc#service-actor-api"},"actor")," gRPC API service"),(0,i.kt)("li",{parentName:"ul"},"environment: Provides ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/grpc#service-environmentsp"},"environment")," gRPC API service"),(0,i.kt)("li",{parentName:"ul"},"pre-hook: Provides ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/grpc#service-trialhookssp"},"pre-hook")," gRPC API service"),(0,i.kt)("li",{parentName:"ul"},"datalog: Provides ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/grpc#service-logexportersp"},"datalog")," gRPC API service"),(0,i.kt)("li",{parentName:"ul"},"datastore: Provides ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/grpc#service-trialdatastoresp"},"datastore")," gRPC API service"),(0,i.kt)("li",{parentName:"ul"},"model registry: Provides ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/grpc#service-modelregistrysp"},"model registry")," gRPC API service"),(0,i.kt)("li",{parentName:"ul"},"other: This type of service does not provide a gRPC API service or it is not a type of service known to Cogment. Only the ability to perform a tcp connection will be tested for health checking."))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"permanent"),": This determines if the service should be kept in the directory regardless of health (network connectivity). It also prevents duplication of the service in the directory (i.e. if a duplicate is registered, the service will just be updated with the new information, and keep the same ID and secret)."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"properties"),": This is a free form mapping of name and value strings. But Cogment may require properties of specific names for its operation, in particular for endpoint ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/parameters#cogment-endpoints"},"discovery"),". These special property names are prefixed with a double underscore (","_","_","), e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"__implementation"),". Also, for proper use in Cogment, property names and values should be restricted to a limited character set (see ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/parameters#discovery-query"},"endpoint query"),")."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"secret"),": This is a secret string that is generated by the Directory on registering a new service. It must be provided to deregister a service. There is no way to recover this value, so it must be recorded after registration."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"authentication token"),": A string to authenticate users of the registered service. It is provided by the user for registration of a new service, and the same token must be provided to access (deregister or inquire) that service.")))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/50751b0a.e8e54558.js b/assets/js/50751b0a.e8e54558.js new file mode 100644 index 0000000..e59f0b9 --- /dev/null +++ b/assets/js/50751b0a.e8e54558.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[8687],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>u});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=r.createContext({}),c=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=c(e.components);return r.createElement(s.Provider,{value:t},e.children)},p="mdxType",h={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,s=e.parentName,d=l(e,["components","mdxType","originalType","parentName"]),p=c(n),m=i,u=p["".concat(s,".").concat(m)]||p[m]||h[m]||a;return n?r.createElement(u,o(o({ref:t},d),{},{components:n})):r.createElement(u,o({ref:t},d))}));function u(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,o=new Array(a);o[0]=m;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[p]="string"==typeof e?e:i,o[1]=l;for(var c=2;c<a;c++)o[c]=n[c];return r.createElement.apply(null,o)}return r.createElement.apply(null,n)}m.displayName="MDXCreateElement"},9772:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>h,frontMatter:()=>a,metadata:()=>l,toc:()=>c});var r=n(7462),i=(n(7294),n(3905));const a={title:"Server",sidebar_position:1},o="Directory Server",l={unversionedId:"reference/cli/directory/directory-server",id:"reference/cli/directory/directory-server",title:"Server",description:"The Directory is an implementation of the directory gRPC service. It is the service to find other services. Typically, every other Cogment service only needs to know the address of the Directory to access anything in Cogment.",source:"@site/docs/reference/cli/directory/directory-server.md",sourceDirName:"reference/cli/directory",slug:"/reference/cli/directory/directory-server",permalink:"/docs/reference/cli/directory/directory-server",draft:!1,tags:[],version:"current",lastUpdatedAt:1700230418,formattedLastUpdatedAt:"Nov 17, 2023",sidebarPosition:1,frontMatter:{title:"Server",sidebar_position:1},sidebar:"docSidebar",previous:{title:"Orchestrator",permalink:"/docs/reference/cli/orchestrator"},next:{title:"Client",permalink:"/docs/reference/cli/directory/directory-client"}},s={},c=[{value:"Command line",id:"command-line",level:2},{value:"Options",id:"options",level:2},{value:"<code>port</code>",id:"port",level:3},{value:"<code>grpc_reflection</code>",id:"grpc_reflection",level:3},{value:"<code>log_level</code>",id:"log_level",level:3},{value:"<code>log_file</code>",id:"log_file",level:3},{value:"<code>registration_lag</code>",id:"registration_lag",level:3},{value:"<code>persistence_file</code>",id:"persistence_file",level:3},{value:"<code>load_balancing</code>",id:"load_balancing",level:3},{value:"<code>check_on_inquire</code>",id:"check_on_inquire",level:3},{value:"<code>force_permanent</code>",id:"force_permanent",level:3},{value:"Operation",id:"operation",level:2},{value:"Health Checking",id:"health-checking",level:3},{value:"Load Balancing",id:"load-balancing",level:3},{value:"Data",id:"data",level:3}],d={toc:c},p="wrapper";function h(e){let{components:t,...n}=e;return(0,i.kt)(p,(0,r.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"directory-server"},"Directory Server"),(0,i.kt)("p",null,"The Directory is an implementation of the ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/grpc#directory-api"},"directory gRPC service"),". It is the service to find other services. Typically, every other Cogment service only needs to know the address of the Directory to access anything in Cogment."),(0,i.kt)("p",null,"A regular health check is done on non-permanent network services to make sure they remain available (i.e. network reachable).\nIf a service fails the health check, it is automatically removed from the Directory."),(0,i.kt)("p",null,"The Directory works in tandem with the Cogment ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#cogment-endpoints"},"endpoints"),", in particular the ones with a ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#discover-host"},"discover host")," (referred as ",(0,i.kt)("strong",{parentName:"p"},"discovery endpoints"),")."),(0,i.kt)("p",null,"A ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cli/directory/directory-client"},"Directory Client")," is also part of the Cogment CLI to access the Directory from the command line."),(0,i.kt)("h2",{id:"command-line"},"Command line"),(0,i.kt)("p",null,"The Directory is a Cogment CLI service:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"$ cogment services directory --port=9005\n")),(0,i.kt)("h2",{id:"options"},"Options"),(0,i.kt)("h3",{id:"port"},(0,i.kt)("inlineCode",{parentName:"h3"},"port")),(0,i.kt)("p",null,"The TCP port where to serve the ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/grpc#directory-api"},"directory gRPC service"),". This is where the users of the Directory connect to."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--port"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_PORT"),","),(0,i.kt)("li",{parentName:"ul"},"default value is 9005.")),(0,i.kt)("h3",{id:"grpc_reflection"},(0,i.kt)("inlineCode",{parentName:"h3"},"grpc_reflection")),(0,i.kt)("p",null,"Whether or not to enable ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/grpc/grpc/blob/master/doc/server-reflection.md"},"gRPC reflection")," on the served directory endpoint."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--grpc_reflection"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_GRPC_REFLECTION=1"),","),(0,i.kt)("li",{parentName:"ul"},"by default, it is disabled.")),(0,i.kt)("h3",{id:"log_level"},(0,i.kt)("inlineCode",{parentName:"h3"},"log_level")),(0,i.kt)("p",null,"Set to define the minimum level for logging. Possible values are: ",(0,i.kt)("inlineCode",{parentName:"p"},"off"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"error"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"warning"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"info"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"debug"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"trace"),"."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--log_level=debug"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_LOG_LEVEL=info"),","),(0,i.kt)("li",{parentName:"ul"},"default value is info.")),(0,i.kt)("h3",{id:"log_file"},(0,i.kt)("inlineCode",{parentName:"h3"},"log_file")),(0,i.kt)("p",null,"Base file name for daily log output. The name will be suffixed with the date and a new file will be made every day. If not provided, the logs go to stdout."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--log_file=./path/to/cogment.log"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_LOG_FILE=./path/to/cogment.log"),","),(0,i.kt)("li",{parentName:"ul"},"default value is info.")),(0,i.kt)("h3",{id:"registration_lag"},(0,i.kt)("inlineCode",{parentName:"h3"},"registration_lag")),(0,i.kt)("p",null,"The maximum number of seconds to wait before responding with no result (either due to a service not registered, or that has failed a health check).\nThis can be used when components may start at slightly different time, and some components may inquire about a component that did not have time to register yet.\nIt may also help when services sometimes go temporarily offline."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--registration_lag"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_REGISTRATION_LAG"),","),(0,i.kt)("li",{parentName:"ul"},"default value is 0.")),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},(0,i.kt)("a",{parentName:"p",href:"#load-balancing"},"Unserviceable"),' services are not considered for this lag.\nI.e. the directory will not wait for a service to become "serviceable".')),(0,i.kt)("h3",{id:"persistence_file"},(0,i.kt)("inlineCode",{parentName:"h3"},"persistence_file")),(0,i.kt)("p",null,"The file name where persistence data will be read from on start-up and stored afterward.\nThe file will be created if it does not already exist.\nIf set to an empty string, persistence will be disabled."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--persistence_file"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_PERSISTENCE_FILE"),","),(0,i.kt)("li",{parentName:"ul"},'default value is ".cogment-directory-data".')),(0,i.kt)("h3",{id:"load_balancing"},(0,i.kt)("inlineCode",{parentName:"h3"},"load_balancing")),(0,i.kt)("p",null,"Whether or not to enable ",(0,i.kt)("a",{parentName:"p",href:"#load-balancing"},"load balancing")," when services are inquired."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--load_balancing"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_LOAD_BALANCING=1"),","),(0,i.kt)("li",{parentName:"ul"},"by default, it is disabled.")),(0,i.kt)("h3",{id:"check_on_inquire"},(0,i.kt)("inlineCode",{parentName:"h3"},"check_on_inquire")),(0,i.kt)("p",null,"Whether or not to enable ",(0,i.kt)("a",{parentName:"p",href:"#health-checking"},"health checking")," when a service is matched by an inquiry (in addition to being checked periodically).\nThis can prevent unavailable services from being returned (before the periodic health check has time to run).\nIt can also allow load balancing to use more recent/dynamic values.\nBut it can significantly slow down directory inquiries, especially when a health check fails."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--check_on_inquire"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_CHECK_ON_INQUIRE=1"),","),(0,i.kt)("li",{parentName:"ul"},"by default, it is disabled.")),(0,i.kt)("h3",{id:"force_permanent"},(0,i.kt)("inlineCode",{parentName:"h3"},"force_permanent")),(0,i.kt)("p",null,"Forces all registration of services to be a ",(0,i.kt)("a",{parentName:"p",href:"#data"},"permanent")," entry."),(0,i.kt)("p",null,"Services can normally be tagged permanent on an individual basis.\nThis ",(0,i.kt)("inlineCode",{parentName:"p"},"force_permanent")," option is for special circumstances where ",(0,i.kt)("strong",{parentName:"p"},"all")," entries should be permanent and it is not appropriate, or too complicated, to set each individual entry to be permanent."),(0,i.kt)("p",null,"Permanent entries are not health checked, and thus are not implicitly removed from the Directory if they fail.\nThey are also not duplicated; they are updated instead of being duplicated or replaced."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--force_permanent"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_FORCE_PERMANENT=1"),","),(0,i.kt)("li",{parentName:"ul"},"by default, it is disabled.")),(0,i.kt)("h2",{id:"operation"},"Operation"),(0,i.kt)("p",null,"At its most basic, the Directory contains services searchable by type and property, and returns endpoints where to reach the matched services."),(0,i.kt)("p",null,'Every registered service has a unique ID (it is unique among currently registered services). When registering a service, the ID of the new service is provided with a "secret" key (a string).\nThis "secret" (in combination with the ID) is required to deregister the service.\nIf a new service matches an existing one (i.e. an inquiry would match them), it is considered a duplicate.\nDuplicates are acceptable for non-permanent services.\nFor permanent services (both the old and new services must be permanent), duplicates are not allowed; instead, an update of the old service is performed (i.e. the ID and secret are kept the same).'),(0,i.kt)("p",null,"Every service is also associated with an authentication token.\nThis token is provided by users when registering a new service, and it must be provided to inquire or deregister that service.\nFor example, any inquiry can only find services that have the same authentication token as the one provided to the inquiry.\nSimilarly for deregistering: a service cannot be deregistered without the appropriate authentication token.\nIn closed environments, the authentication token can be left empty to facilitate directory management."),(0,i.kt)("h3",{id:"health-checking"},"Health Checking"),(0,i.kt)("p",null,"Each entry is normally checked for connectivity on a regular basis (every 60 seconds), but can also be checked when an entry matches an inquiry (see ",(0,i.kt)("a",{parentName:"p",href:"#check_on_inquire"},"check_on_inquire"),")."),(0,i.kt)("p",null,"The type of the entry determines the extent of the health check.\nFor Cogment services, the ",(0,i.kt)("inlineCode",{parentName:"p"},"Status")," procedure will be called and a response expected.\nFor non-Cogment services, a simple tcp connection will be attempted, and if successful, the service will be considered healthy."),(0,i.kt)("p",null,"If a service fails the health check multiple times, it will be removed from the directory.\nBut after the first failure, the service will not be reported on inquiries until and unless it succeeds a health check."),(0,i.kt)("p",null,"When services are recovered from a persistence file, they will immediately be subjected to a health check."),(0,i.kt)("h3",{id:"load-balancing"},"Load Balancing"),(0,i.kt)("p",null,"By default load balancing is disabled, and thus when inquiring, the services returned are in increasing order of age (since registration).\nSo the first is always the most recently registered service."),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"Permanent services do not change their registration timestamp when updated.")),(0,i.kt)("p",null,"When load balancing is enabled, and an inquiry is made, the order of services returned is different:"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},'For each service that match the inquiry, the last read "overall_load" ',(0,i.kt)("inlineCode",{parentName:"li"},"Status")," (see below) is used. If ",(0,i.kt)("a",{parentName:"li",href:"#check_on_inquire"},"check_on_inquire"),' is enabled, then the service\'s current "overall_load" is read at this point.'),(0,i.kt)("li",{parentName:"ol"},"Services with a load of 255 are considered unserviceable and removed from the list of potential candidates."),(0,i.kt)("li",{parentName:"ol"},"The service with the lowest load is found. That service, and services with a load close to that one, are retained."),(0,i.kt)("li",{parentName:"ol"},"The retained services are shuffled randomly, and returned as a reply to the inquiry.")),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"Non-Cogment services (with no ",(0,i.kt)("inlineCode",{parentName:"p"},"Status")," gRPC procedure) are always considered fully available (with a load of 0).\nAnd thus will always be returned, but in random order, when load balancing is enabled.")),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"Status"),' gRPC procedure\'s "overall_load" status is expected to be a string representation of an integer from 0 to 255 (8 bit unsigned integer).\nIf the string cannot be converted to such an integer, a load of 0 is assumed (e.g. "256" will result in a load of 0).\nA normal value is between 0 and 100, representing the load on the machine where the service is running.\nA value of 0 means that there is no load, and a value of 100 means that the machine is very loaded (and may not be able to do processing in a timely manner).\nThe exact meaning of the value is dependent on the service reporting.\nA value of 255 indicates that the machine is not fit to run any new service (and thus it is "unserviceable").'),(0,i.kt)("h3",{id:"data"},"Data"),(0,i.kt)("p",null,"The Directory maintains the following data for each service:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"service ID"),": This is a numerical (64 bits unsigned integer) value generated by the Directory and assigned to the service on registration. It is unique to that service as long as it is in the Directory. Although very unlikely, it is possible for this ID to be re-used after the service is deregistered. Zero (0) is not a valid ID."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"endpoint"),": It consists of four distinct information:",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"protocol: The protocol (URL scheme) for the endpoint (",(0,i.kt)("inlineCode",{parentName:"li"},"grpc")," or ",(0,i.kt)("inlineCode",{parentName:"li"},"cogment"),"). The ",(0,i.kt)("inlineCode",{parentName:"li"},"cogment"),' protocol is not considered a "network" protocol and thus will not be checked for health (network connectivity).'),(0,i.kt)("li",{parentName:"ul"},"host: The host for the endpoint (e.g. somewhere.com). For the ",(0,i.kt)("inlineCode",{parentName:"li"},"grpc")," protocol this represents a TCP/IP network resource; it can be a network hostname or an IP address. For the ",(0,i.kt)("inlineCode",{parentName:"li"},"cogment")," protocol it must be a registered name (see ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/parameters#cogment-endpoints"},"cogment endpoints"),") and typically does not represent a network resource."),(0,i.kt)("li",{parentName:"ul"},"port: The TCP port where the registered service is providing its services. This is required for ",(0,i.kt)("inlineCode",{parentName:"li"},"grpc")," protocol hosts."),(0,i.kt)("li",{parentName:"ul"},"ssl requirement: Whether the service requires an encrypted SSL connection."))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"type"),": The type of service. This also determines how health checks are performed on the service (i.e. which gRPC service should be used to check the health of the service).",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"client actor connection: Provides ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/grpc#service-clientactorsp"},"client actor")," gRPC API service"),(0,i.kt)("li",{parentName:"ul"},"trial lifecycle management: Provides ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/grpc#service-triallifecyclesp"},"lifecycle")," gRPC API service"),(0,i.kt)("li",{parentName:"ul"},"actor: Provides ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/grpc#service-actor-api"},"actor")," gRPC API service"),(0,i.kt)("li",{parentName:"ul"},"environment: Provides ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/grpc#service-environmentsp"},"environment")," gRPC API service"),(0,i.kt)("li",{parentName:"ul"},"pre-hook: Provides ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/grpc#service-trialhookssp"},"pre-hook")," gRPC API service"),(0,i.kt)("li",{parentName:"ul"},"datalog: Provides ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/grpc#service-logexportersp"},"datalog")," gRPC API service"),(0,i.kt)("li",{parentName:"ul"},"datastore: Provides ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/grpc#service-trialdatastoresp"},"datastore")," gRPC API service"),(0,i.kt)("li",{parentName:"ul"},"model registry: Provides ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/grpc#service-modelregistrysp"},"model registry")," gRPC API service"),(0,i.kt)("li",{parentName:"ul"},"other: This type of service does not provide a gRPC API service or it is not a type of service known to Cogment. Only the ability to perform a tcp connection will be tested for health checking."))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"permanent"),": This determines if the service should be kept in the directory regardless of health (network connectivity). It also prevents duplication of the service in the directory (i.e. if a duplicate is registered, the service will just be updated with the new information, and keep the same ID and secret)."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"properties"),": This is a free form mapping of name and value strings. But Cogment may require properties of specific names for its operation, in particular for endpoint ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/parameters#cogment-endpoints"},"discovery"),". These special property names are prefixed with a double underscore (","_","_","), e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"__implementation"),". Also, for proper use in Cogment, property names and values should be restricted to a limited character set (see ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/parameters#discovery-query"},"endpoint query"),")."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"secret"),": This is a secret string that is generated by the Directory on registering a new service. It must be provided to deregister a service. There is no way to recover this value, so it must be recorded after registration."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"authentication token"),": A string to authenticate users of the registered service. It is provided by the user for registration of a new service, and the same token must be provided to access (deregister or inquire) that service.")))}h.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/61fcde8c.4dd88737.js b/assets/js/61fcde8c.4dd88737.js deleted file mode 100644 index f06f181..0000000 --- a/assets/js/61fcde8c.4dd88737.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[5171],{3905:(e,t,a)=>{a.d(t,{Zo:()=>c,kt:()=>h});var n=a(7294);function i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function r(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function l(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?r(Object(a),!0).forEach((function(t){i(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):r(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function o(e,t){if(null==e)return{};var a,n,i=function(e,t){if(null==e)return{};var a,n,i={},r=Object.keys(e);for(n=0;n<r.length;n++)a=r[n],t.indexOf(a)>=0||(i[a]=e[a]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var s=n.createContext({}),p=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},c=function(e){var t=p(e.components);return n.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var a=e.components,i=e.mdxType,r=e.originalType,s=e.parentName,c=o(e,["components","mdxType","originalType","parentName"]),m=p(a),h=i,u=m["".concat(s,".").concat(h)]||m[h]||d[h]||r;return a?n.createElement(u,l(l({ref:t},c),{},{components:a})):n.createElement(u,l({ref:t},c))}));function h(e,t){var a=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var r=a.length,l=new Array(r);l[0]=m;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o.mdxType="string"==typeof e?e:i,l[1]=o;for(var p=2;p<r;p++)l[p]=a[p];return n.createElement.apply(null,l)}return n.createElement.apply(null,a)}m.displayName="MDXCreateElement"},1975:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>d,frontMatter:()=>r,metadata:()=>o,toc:()=>p});var n=a(7462),i=(a(7294),a(3905));const r={sidebar_position:2},l="Runner",o={unversionedId:"reference/python-enterprise/runner",id:"reference/python-enterprise/runner",title:"Runner",description:"This is part of the Cogment Enterprise, AI Redefined's commercial offering.",source:"@site/docs/reference/python-enterprise/runner.md",sourceDirName:"reference/python-enterprise",slug:"/reference/python-enterprise/runner",permalink:"/docs/reference/python-enterprise/runner",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"docSidebar",previous:{title:"Installation",permalink:"/docs/reference/python-enterprise/installation"},next:{title:"gRPC API",permalink:"/docs/reference/grpc"}},s={},p=[{value:"General usage",id:"general-usage",level:2},{value:"<code>asyncio</code>",id:"asyncio",level:3},{value:"Logging",id:"logging",level:3},{value:"Trial Specifications",id:"trial-specifications",level:3},{value:"Top-level import",id:"top-level-import",level:3},{value:"Utilities and Constants",id:"utilities-and-constants",level:2},{value:"<code>cogment_enterprise.runner.BATCH_ID_PROPERTY</code>",id:"cogment_enterpriserunnerbatch_id_property",level:3},{value:"<code>cogment_enterprise.runner.BATCH_TRIAL_INDEX_PROPERTY</code>",id:"cogment_enterpriserunnerbatch_trial_index_property",level:3},{value:"<code>cogment_enterprise.runner.BATCH_LAST_TRIAL_PROPERTY</code>",id:"cogment_enterpriserunnerbatch_last_trial_property",level:3},{value:"<code>cogment_enterprise.runner.deserialize_action(serialized_data, actor_class, cog_settings)</code>",id:"cogment_enterpriserunnerdeserialize_actionserialized_data-actor_class-cog_settings",level:3},{value:"<code>cogment_enterprise.runner.deserialize_actor_observation(serialized_data, actor_class, cog_settings)</code>",id:"cogment_enterpriserunnerdeserialize_actor_observationserialized_data-actor_class-cog_settings",level:3},{value:"<code>cogment_enterprise.runner.deserialize_actor_config(serialized_data, actor_class, cog_settings)</code>",id:"cogment_enterpriserunnerdeserialize_actor_configserialized_data-actor_class-cog_settings",level:3},{value:"<code>cogment_enterprise.runner.deserialize_environment_config(serialized_data, cog_settings)</code>",id:"cogment_enterpriserunnerdeserialize_environment_configserialized_data-cog_settings",level:3},{value:"<code>cogment_enterprise.runner.deserialize_trial_config(serialized_data, cog_settings)</code>",id:"cogment_enterpriserunnerdeserialize_trial_configserialized_data-cog_settings",level:3},{value:"class cogment_enterprise.runner.TrialRunner",id:"class-cogment_enterpriserunnertrialrunner",level:2},{value:"<code>__init__(self, user_id, cog_settings=None, asyncio_loop=None, directory_endpoint=None, directory_auth_token=None, orchestrator_endpoint=None, datastore_endpoint=None, model_registry=None)</code>",id:"__init__self-user_id-cog_settingsnone-asyncio_loopnone-directory_endpointnone-directory_auth_tokennone-orchestrator_endpointnone-datastore_endpointnone-model_registrynone",level:3},{value:"<code>async get_controller(self)</code>",id:"async-get_controllerself",level:3},{value:"<code>async get_datastore(self)</code>",id:"async-get_datastoreself",level:3},{value:"<code>async get_model_registry(self)</code>",id:"async-get_model_registryself",level:3},{value:"<code>async run_simple_batch(self, nb_trials, nb_parallel_trials=1, id=None, pre_trial_callback=None, post_trial_callback=None)</code>",id:"async-run_simple_batchself-nb_trials-nb_parallel_trials1-idnone-pre_trial_callbacknone-post_trial_callbacknone",level:3},{value:"<code>async run_simple_training(self, batch, sampler_callback, actor_names=None, max_trial_wait=None)</code>",id:"async-run_simple_trainingself-batch-sampler_callback-actor_namesnone-max_trial_waitnone",level:3},{value:"<code>async run_simple_trial_training(self, batch, trial_callback, actor_names=None, max_trial_wait=None)</code>",id:"async-run_simple_trial_trainingself-batch-trial_callback-actor_namesnone-max_trial_waitnone",level:3},{value:"class TrialBatch",id:"class-trialbatch",level:2},{value:"<strong>init</strong>(self, id, controller, nb_trials, pre_trial_callback, post_trial_callback, datalog_endpoint)",id:"initself-id-controller-nb_trials-pre_trial_callback-post_trial_callback-datalog_endpoint",level:3},{value:"<code>start_trials(self, nb_trials)</code>",id:"start_trialsself-nb_trials",level:3},{value:"<code>pause(self)</code>",id:"pauseself",level:3},{value:"<code>resume(self)</code>",id:"resumeself",level:3},{value:"<code>stop(self)</code>",id:"stopself",level:3},{value:"<code>terminate(self, hard=False)</code>",id:"terminateself-hardfalse",level:3},{value:"<code>is_running(self)</code>",id:"is_runningself",level:3},{value:"<code>nb_trials_run(self)</code>",id:"nb_trials_runself",level:3},{value:"<code>async wait(self, timeout)</code>",id:"async-waitself-timeout",level:3},{value:"class BatchTrainer",id:"class-batchtrainer",level:2},{value:"<code>__init__(self, batch_spec, datastore, model_registry, trial_callback, max_trial_wait)</code>",id:"__init__self-batch_spec-datastore-model_registry-trial_callback-max_trial_wait",level:3},{value:"<code>start(self, actor_names=[], actor_classes=[], actor_implementations=[], fields=[])</code>",id:"startself-actor_names-actor_classes-actor_implementations-fields",level:3},{value:"<code>terminate(self)</code>",id:"terminateself",level:3},{value:"<code>async stop(self)</code>",id:"async-stopself",level:3},{value:"<code>is_running(self)</code>",id:"is_runningself-1",level:3},{value:"<code>async wait(self, timeout)</code>",id:"async-waitself-timeout-1",level:3},{value:"<code>set_nb_parallel_trials(self, nb_trials)</code>",id:"set_nb_parallel_trialsself-nb_trials",level:3},{value:"class BatchTrialInfo",id:"class-batchtrialinfo",level:2},{value:"class TrainerTrialSession",id:"class-trainertrialsession",level:2},{value:"<code>async all_samples(self)</code>",id:"async-all_samplesself",level:3},{value:"Callbacks",id:"callbacks",level:2},{value:"Use",id:"use",level:3},{value:"Pre-Trial Callback",id:"pre-trial-callback",level:3},{value:"Post-Trial Callback",id:"post-trial-callback",level:3},{value:"Sampler Callback",id:"sampler-callback",level:3},{value:"Trial Callback",id:"trial-callback",level:3}],c={toc:p};function d(e){let{components:t,...a}=e;return(0,i.kt)("wrapper",(0,n.Z)({},c,a,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"runner"},"Runner"),(0,i.kt)("admonition",{title:"Cogment Enterprise",type:"note"},(0,i.kt)("p",{parentName:"admonition"},"This is part of the ",(0,i.kt)("strong",{parentName:"p"},"Cogment Enterprise"),", ",(0,i.kt)("a",{parentName:"p",href:"https://ai-r.com/"},"AI Redefined's")," commercial offering.")),(0,i.kt)("h2",{id:"general-usage"},"General usage"),(0,i.kt)("h3",{id:"asyncio"},(0,i.kt)("inlineCode",{parentName:"h3"},"asyncio")),(0,i.kt)("p",null,"The use of this module requires ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/python"},"Cogment Python SDK")," >= 2.8.0. It uses Python's ",(0,i.kt)("inlineCode",{parentName:"p"},"asyncio")," library and as such should be run in an ",(0,i.kt)("inlineCode",{parentName:"p"},"asyncio.Task"),".\nThis documentation assumes some familiarity with the ",(0,i.kt)("inlineCode",{parentName:"p"},"asyncio")," library of Python (see ",(0,i.kt)("a",{parentName:"p",href:"https://docs.python.org/3/library/asyncio.html"},"Python documentation"),")."),(0,i.kt)("p",null,"E.g."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"import asyncio\n\nasyncio.run(MyMainFunction())\n")),(0,i.kt)("h3",{id:"logging"},"Logging"),(0,i.kt)("p",null,"This module uses the ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.enterprise")," logger, and the default log level is ",(0,i.kt)("inlineCode",{parentName:"p"},"INFO"),". E.g. to change the log level to ",(0,i.kt)("inlineCode",{parentName:"p"},"WARNING"),":"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'import cogment_enterprise\nimport logging\n\nlogging.getLogger("cogment.enterprise").setLevel(logging.WARNING)\n')),(0,i.kt)("p",null,"Or set the environment variable ",(0,i.kt)("inlineCode",{parentName:"p"},"COGMENT_ENTERPRISE_LOG_LEVEL")," to one of the values: ",(0,i.kt)("inlineCode",{parentName:"p"},"off"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"error"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"warning"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"info"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"debug"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"trace"),".\nThe logging works the same as Cogment Python SDK logging (see Cogment Python SDK documentation)."),(0,i.kt)("h3",{id:"trial-specifications"},"Trial Specifications"),(0,i.kt)("p",null,"This module is designed to work without any trial specifications (i.e. ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings"),"), but is easier to use if the specification are available."),(0,i.kt)("p",null,"If the specifications are not provided, some internal object deserializations will not happen (e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"sample.observation"),"), and special serialized versions will have to be used (e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"sample.observation_serialized"),").\nHelper functions are provided for deserializing the various defined objects in the specifications (see below)."),(0,i.kt)("p",null,"Objects normally received as ",(0,i.kt)("inlineCode",{parentName:"p"},"google.protobuf.Any")," will still be deserialized to such an object as it does not depend on the specification of the trial."),(0,i.kt)("h3",{id:"top-level-import"},"Top-level import"),(0,i.kt)("p",null,"The main module of the Runner SDK is ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment_enterprise.runner"),", and most enterprise scripts will start with a ",(0,i.kt)("a",{parentName:"p",href:"#class-cogment_enterpriserunnertrialrunner"},"cogment_enterprise.runner.TrialRunner"),"."),(0,i.kt)("h2",{id:"utilities-and-constants"},"Utilities and Constants"),(0,i.kt)("h3",{id:"cogment_enterpriserunnerbatch_id_property"},(0,i.kt)("inlineCode",{parentName:"h3"},"cogment_enterprise.runner.BATCH_ID_PROPERTY")),(0,i.kt)("p",null,"This is the name of the trial property where the batch ID is stored.\nEach trial started by a batch will have this property."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"batch_id = trial_parameters.properties[cogment_enterprise.runner.BATCH_ID_PROPERTY]\n")),(0,i.kt)("h3",{id:"cogment_enterpriserunnerbatch_trial_index_property"},(0,i.kt)("inlineCode",{parentName:"h3"},"cogment_enterprise.runner.BATCH_TRIAL_INDEX_PROPERTY")),(0,i.kt)("p",null,"This is the name of the trial property where the index of the trial in the batch is stored.\nEach trial started by a batch will have this property."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"trial_index_in_batch = trial_parameters.properties[cogment_enterprise.runner.BATCH_TRIAL_INDEX_PROPERTY]\n")),(0,i.kt)("h3",{id:"cogment_enterpriserunnerbatch_last_trial_property"},(0,i.kt)("inlineCode",{parentName:"h3"},"cogment_enterprise.runner.BATCH_LAST_TRIAL_PROPERTY")),(0,i.kt)("p",null,"This is the name of the trial property that will be set on the last trial of the batch.\nThe property value is empty, it's presence indicates that this is the last trial of the batch.\nOnly one trial in a batch may have this property."),(0,i.kt)("p",null,"Note that there may not be a trial with this property if the batch was stopped prematurely."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"last_trial = cogment_enterprise.runner.BATCH_LAST_TRIAL_PROPERTY in trial_parameters.properties\n")),(0,i.kt)("h3",{id:"cogment_enterpriserunnerdeserialize_actionserialized_data-actor_class-cog_settings"},(0,i.kt)("inlineCode",{parentName:"h3"},"cogment_enterprise.runner.deserialize_action(serialized_data, actor_class, cog_settings)")),(0,i.kt)("p",null,"Function to deserialize raw data into a Python class instance."),(0,i.kt)("p",null,"The data can only be deserialized by knowing the protobuf message it represents.\nIt can be done manually if one knows the protobuf message represented.\nThis function simplifies deserialization of messages related to a Cogment project with the trial spec module ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings"),"."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"serialized_data"),": ",(0,i.kt)("em",{parentName:"li"},"bytes")," - Raw data received."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_class"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Name of the class of the actor to which this data relates. This information is necessary to find the proper message type in the spec."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"cog_settings"),": ",(0,i.kt)("em",{parentName:"li"},"module")," - Specification module associated with the trial from which the data relates.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - Action from an actor of type ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_class"),". The class of the action is defined as action space for the specific actor class in the section ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes:action:space")," in the spec file (e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings"),"). ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if ",(0,i.kt)("inlineCode",{parentName:"p"},"serialized_data")," is ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),"."),(0,i.kt)("h3",{id:"cogment_enterpriserunnerdeserialize_actor_observationserialized_data-actor_class-cog_settings"},(0,i.kt)("inlineCode",{parentName:"h3"},"cogment_enterprise.runner.deserialize_actor_observation(serialized_data, actor_class, cog_settings)")),(0,i.kt)("p",null,"Function to deserialize raw data into a Python class instance."),(0,i.kt)("p",null,"The data can only be deserialized by knowing the protobuf message it represents.\nIt can be done manually if one knows the protobuf message represented.\nThis function simplifies deserialization of messages related to a Cogment project with the trial spec module ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings"),"."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"serialized_data"),": ",(0,i.kt)("em",{parentName:"li"},"bytes")," - Raw data received."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_class"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Name of the class of the actor to which this data relates. This information is necessary to find the proper message type in the spec."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"cog_settings"),": ",(0,i.kt)("em",{parentName:"li"},"module")," - Specification module associated with the trial from which the data relates.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - Observation for an actor of type ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_class"),". The class of the observation is defined as observation space for the specific actor class in the section ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes:observation:space")," in the spec file (e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings"),"). ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if ",(0,i.kt)("inlineCode",{parentName:"p"},"serialized_data")," is ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),"."),(0,i.kt)("h3",{id:"cogment_enterpriserunnerdeserialize_actor_configserialized_data-actor_class-cog_settings"},(0,i.kt)("inlineCode",{parentName:"h3"},"cogment_enterprise.runner.deserialize_actor_config(serialized_data, actor_class, cog_settings)")),(0,i.kt)("p",null,"Function to deserialize raw data into a Python class instance."),(0,i.kt)("p",null,"The data can only be deserialized by knowing the protobuf message it represents.\nIt can be done manually if one knows the protobuf message represented.\nThis function simplifies deserialization of messages related to a Cogment project with the trial spec module ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings"),"."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"serialized_data"),": ",(0,i.kt)("em",{parentName:"li"},"bytes")," - Raw data received."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_class"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Name of the class of the actor to which this data relates. This information is necessary to find the proper message type in the spec."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"cog_settings"),": ",(0,i.kt)("em",{parentName:"li"},"module")," - Specification module associated with the trial from which the data relates.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - Config for an actor of type ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_class"),". The class of the config is defined as config type for the specific actor class in the section ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes:config_type")," in the spec file (e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings"),"). ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if ",(0,i.kt)("inlineCode",{parentName:"p"},"serialized_data")," is ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),"."),(0,i.kt)("h3",{id:"cogment_enterpriserunnerdeserialize_environment_configserialized_data-cog_settings"},(0,i.kt)("inlineCode",{parentName:"h3"},"cogment_enterprise.runner.deserialize_environment_config(serialized_data, cog_settings)")),(0,i.kt)("p",null,"Function to deserialize raw data into a Python class instance."),(0,i.kt)("p",null,"The data can only be deserialized by knowing the protobuf message it represents.\nIt can be done manually if one knows the protobuf message represented.\nThis function simplifies deserialization of messages related to a Cogment project with the trial spec module ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings"),"."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"serialized_data"),": ",(0,i.kt)("em",{parentName:"li"},"bytes")," - Raw data received."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"cog_settings"),": ",(0,i.kt)("em",{parentName:"li"},"module")," - Specification module associated with the trial from which the data relates.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - Config for the environment. The class of the config is defined as config type in the section ",(0,i.kt)("inlineCode",{parentName:"p"},"environment:config_type")," in the spec file (e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings"),"). ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if ",(0,i.kt)("inlineCode",{parentName:"p"},"serialized_data")," is ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),"."),(0,i.kt)("h3",{id:"cogment_enterpriserunnerdeserialize_trial_configserialized_data-cog_settings"},(0,i.kt)("inlineCode",{parentName:"h3"},"cogment_enterprise.runner.deserialize_trial_config(serialized_data, cog_settings)")),(0,i.kt)("p",null,"Function to deserialize raw data into a Python class instance."),(0,i.kt)("p",null,"The data can only be deserialized by knowing the protobuf message it represents.\nIt can be done manually if one knows the protobuf message represented.\nThis function simplifies deserialization of messages related to a Cogment project with the trial spec module ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings"),"."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"serialized_data"),": ",(0,i.kt)("em",{parentName:"li"},"bytes")," - Raw data received."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"cog_settings"),": ",(0,i.kt)("em",{parentName:"li"},"module")," - Specification module associated with the trial from which the data relates.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - Config for the trial. The class of the config is defined as config type in the section ",(0,i.kt)("inlineCode",{parentName:"p"},"trial:config_type")," in the spec file (e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings"),"). ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if ",(0,i.kt)("inlineCode",{parentName:"p"},"serialized_data")," is ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),"."),(0,i.kt)("h2",{id:"class-cogment_enterpriserunnertrialrunner"},"class cogment_enterprise.runner.TrialRunner"),(0,i.kt)("h3",{id:"__init__self-user_id-cog_settingsnone-asyncio_loopnone-directory_endpointnone-directory_auth_tokennone-orchestrator_endpointnone-datastore_endpointnone-model_registrynone"},(0,i.kt)("inlineCode",{parentName:"h3"},"__init__(self, user_id, cog_settings=None, asyncio_loop=None, directory_endpoint=None, directory_auth_token=None, orchestrator_endpoint=None, datastore_endpoint=None, model_registry=None)")),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"user_id"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Identifier for the user of this context."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"cog_settings"),": ",(0,i.kt)("em",{parentName:"li"},"module")," - Settings module associated with trials that will be run (",(0,i.kt)("a",{parentName:"li",href:"#cog_settings.py"},"cog_settings")," namespace)."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"asyncio_loop"),": ",(0,i.kt)("em",{parentName:"li"},"asyncio.Loop")," - For special purpose implementations."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"directory_endpoint"),": ",(0,i.kt)("em",{parentName:"li"},"Endpoint instance"),' - Grpc endpoint (i.e. starting with "grpc://") to access the directory. The directory will be used to inquire discovery endpoints, and to register the services for discovery. If no endpoint is provided, a check for the environment variable ',(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_ENDPOINT")," will be made and if it exists, it will be used as the URL of a basic endpoint."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"directory_auth_token"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Authentication token for access to the directory. This token will be registered with the services, and must match registered tokens when inquiring the directory. If no token is provided, a check for the environment variable ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_AUTHENTICATION_TOKEN")," will be made and if it exists, it will be used as the token."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"orchestrator_endpoint"),": ",(0,i.kt)("em",{parentName:"li"},"Endpoint instance")," - Details of the connection to the Orchestrator. If not provided, the directory will be inquired. Only needed for running batches, not for training."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"datastore_endpoint"),": ",(0,i.kt)("em",{parentName:"li"},"Endpoint instance")," - Details of the connection to the Datastore. If not provided, the directory will be inquired if necessary. This will be used as the datalog endpoint of the trials started by the batch. And it will be used as the source of samples for training."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_registry_endpoint"),": ",(0,i.kt)("em",{parentName:"li"},"Endpoint instance")," - Details of the connection to the Model Registry. If not provided, the directory will be inquired if necessary. Only needed for training, not running batches.")),(0,i.kt)("h3",{id:"async-get_controllerself"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_controller(self)")),(0,i.kt)("p",null,"Returns the Controller used by the TrialRunner."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"cogment.Controller instance")," - An instance of ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.Controller")," class used to manage trials."),(0,i.kt)("h3",{id:"async-get_datastoreself"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_datastore(self)")),(0,i.kt)("p",null,"Returns the Datastore used by the TrialRunner."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"cogment.Datastore instance")," - Datastore."),(0,i.kt)("h3",{id:"async-get_model_registryself"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_model_registry(self)")),(0,i.kt)("p",null,"Returns the Model Registry used by the TrialRunner."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"cogment.ModelRegistry instance")," - Model Registry."),(0,i.kt)("h3",{id:"async-run_simple_batchself-nb_trials-nb_parallel_trials1-idnone-pre_trial_callbacknone-post_trial_callbacknone"},(0,i.kt)("inlineCode",{parentName:"h3"},"async run_simple_batch(self, nb_trials, nb_parallel_trials=1, id=None, pre_trial_callback=None, post_trial_callback=None)")),(0,i.kt)("p",null,"Method to start a batch of trials."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"nb_trials"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - The number of trials to run."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"nb_parallel_trials"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - The number of trials to run in parallel. Must be <= ",(0,i.kt)("inlineCode",{parentName:"li"},"nb_trials"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"id"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - ID of the batch. This will be added to the properties of the trials that are started by the batch. This should be unique in the Datastore, otherwise there could be a clash of trial IDs (a mix of trials from different batches could also be used by the ",(0,i.kt)("inlineCode",{parentName:"li"},"BatchTrainer"),"). If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", an ID will be chosen by the system."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"pre_trial_callback"),": ",(0,i.kt)("em",{parentName:"li"},"async func(BatchTrialInfo instance) -> cogment.TrialParameters")," - This ",(0,i.kt)("a",{parentName:"li",href:"#callbacks"},"Callbacks")," function will be called before any new trial is started."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"post_trial_callback"),": ",(0,i.kt)("em",{parentName:"li"},"async func(sample, trial_parameters, model_registry)")," - This ",(0,i.kt)("a",{parentName:"li",href:"#callbacks"},"Callbacks")," function will be called after the end of a trial.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"TrialBatch instance")," - An instance of the ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialBatch")," class."),(0,i.kt)("h3",{id:"async-run_simple_trainingself-batch-sampler_callback-actor_namesnone-max_trial_waitnone"},(0,i.kt)("inlineCode",{parentName:"h3"},"async run_simple_training(self, batch, sampler_callback, actor_names=None, max_trial_wait=None)")),(0,i.kt)("p",null,"Method to start training on a batch of trials with a per-sample callback."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"batch"),": ",(0,i.kt)("em",{parentName:"li"},"TrialBatch instance")," - The batch to train on. This will be used to identify the trials that are part of the batch and retrieve only the samples from these trials."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"sampler_callback"),": ",(0,i.kt)("em",{parentName:"li"},"async func(cogment.DatastoreSample, cogment.TrialParameters, cogment.ModelRegistry) -> bool")," - This ",(0,i.kt)("a",{parentName:"li",href:"#callbacks"},"Callbacks")," function will be called for every sample in the batch."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_names"),": ",(0,i.kt)("em",{parentName:"li"},"list","[str]")," - Names of actors to include in the samples. If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", all actors will be included."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"max_trial_wait"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - Maximum number of seconds to wait for new trials to be started by the batch. Since this depends on the running time of trials, this should be longer than the expected max trial duration. If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", then 86400 seconds (24 hours) will be used.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"BatchTrainer instance")," - An instance of the ",(0,i.kt)("inlineCode",{parentName:"p"},"BatchTrainer")," class."),(0,i.kt)("h3",{id:"async-run_simple_trial_trainingself-batch-trial_callback-actor_namesnone-max_trial_waitnone"},(0,i.kt)("inlineCode",{parentName:"h3"},"async run_simple_trial_training(self, batch, trial_callback, actor_names=None, max_trial_wait=None)")),(0,i.kt)("p",null,"Method to start training on a batch of trials."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"batch"),": ",(0,i.kt)("em",{parentName:"li"},"TrialBatch instance")," - The batch to train on. This will be used to identify the trials that are part of the batch and retrieve only the samples from these trials."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_callback"),": ",(0,i.kt)("em",{parentName:"li"},"async func(cogment.DatastoreSample, cogment.TrialParameters, cogment.ModelRegistry) -> bool")," - This ",(0,i.kt)("a",{parentName:"li",href:"#callbacks"},"Callbacks")," function will be called for every trial in the batch."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_names"),": ",(0,i.kt)("em",{parentName:"li"},"list","[str]")," - Names of actors to include in the samples. If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", all actors will be included."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"max_trial_wait"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - Maximum number of seconds to wait for new trials to be started by the batch. Since this depends on the running time of trials, this should be longer than the expected max trial duration. If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", then 86400 seconds (24 hours) will be used.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"BatchTrainer instance")," - An instance of the ",(0,i.kt)("inlineCode",{parentName:"p"},"BatchTrainer")," class."),(0,i.kt)("h2",{id:"class-trialbatch"},"class TrialBatch"),(0,i.kt)("p",null,"Class to run a batch of related trials."),(0,i.kt)("h3",{id:"initself-id-controller-nb_trials-pre_trial_callback-post_trial_callback-datalog_endpoint"},(0,i.kt)("strong",{parentName:"h3"},"init"),"(self, id, controller, nb_trials, pre_trial_callback, post_trial_callback, datalog_endpoint)"),(0,i.kt)("p",null,"The parameters are the same as provided to ",(0,i.kt)("a",{parentName:"p",href:"#class-cogment_enterpriserunnertrialrunner"},(0,i.kt)("inlineCode",{parentName:"a"},"run_simple_batch")),"."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"id"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - ID of the batch. This will be added to the properties of the trials that are started by the batch. This should be unique in the Datastore, otherwise there could be a clash of trial IDs (a mix of trials from different batches could also be used by the ",(0,i.kt)("inlineCode",{parentName:"li"},"BatchTrainer"),"). If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", an ID will be chosen by the system."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"controller"),": ",(0,i.kt)("em",{parentName:"li"},"cogment.Controller instance")," - Controller used to start trials."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"nb_trials"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - Number of trials to run."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"pre_trial_callback"),": ",(0,i.kt)("em",{parentName:"li"},"async func(BatchTrialInfo instance) -> cogment.TrialParameters")," - This ",(0,i.kt)("a",{parentName:"li",href:"#callbacks"},"Callbacks")," function will be called before any new trial is started. If None, then the parameters for the trials will come from the Orchestrator defaults and pre-trial hooks (see Cogment Orchestrator documentation). In which case the ",(0,i.kt)("inlineCode",{parentName:"li"},"BatchTrainer")," cannot work with this batch (because the necessary trial properties cannot be set)."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"post_trial_callback"),": ",(0,i.kt)("em",{parentName:"li"},"async func(sample, trial_parameters, model_registry)")," - This ",(0,i.kt)("a",{parentName:"li",href:"#callbacks"},"Callbacks")," function will be called after the end of a trial. If None, then no call will happen at the end of trials."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"datalog_endpoint"),": ",(0,i.kt)("em",{parentName:"li"},"cogment.Endpoint instance")," - Details of the connection to the Datalog that will be set for the trials.")),(0,i.kt)("h3",{id:"start_trialsself-nb_trials"},(0,i.kt)("inlineCode",{parentName:"h3"},"start_trials(self, nb_trials)")),(0,i.kt)("p",null,"Method to start the batch. At least one trial must be started for the batch to run."),(0,i.kt)("p",null,"This will start the trials in parallel. The batch will maintain active the number of trials started by this method by starting a new trial when one ends."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"nb_trials"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - Number of trials to start that will be running in parallel. Any new calls of this method on a running batch will just add to the number of trials running in parallel.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"pauseself"},(0,i.kt)("inlineCode",{parentName:"h3"},"pause(self)")),(0,i.kt)("p",null,"Method to pause the running of the batch. It stops any new trial from starting, but does not stop currently running trials. Even if all running trials end, the batch is not considered done until it is resumed, stopped or terminated."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"resumeself"},(0,i.kt)("inlineCode",{parentName:"h3"},"resume(self)")),(0,i.kt)("p",null,"Method to restart a batch that was ",(0,i.kt)("a",{parentName:"p",href:"#pauseself"},"paused"),". It resumes the starting of new trials in the batch."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"stopself"},(0,i.kt)("inlineCode",{parentName:"h3"},"stop(self)")),(0,i.kt)("p",null,"Method to stop the batch. It stops new trials from starting, and currently running trials continue to their normal end. Once all trials have ended, the batch is done."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"terminateself-hardfalse"},(0,i.kt)("inlineCode",{parentName:"h3"},"terminate(self, hard=False)")),(0,i.kt)("p",null,"Method to terminate the batch. It stops new trials from starting, and currently running trials are terminated. The batch is then considered done."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"hard"),": ",(0,i.kt)("em",{parentName:"li"},"bool"),' - If True the trials are sent a "hard" terminate, otherwise they are sent a "soft" terminate (see Python Documentation "Controller.terminate_trial").')),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"is_runningself"},(0,i.kt)("inlineCode",{parentName:"h3"},"is_running(self)")),(0,i.kt)("p",null,"Method to inquire whether the batch is done or not."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the batch is still running. I.e. there are still trials running or it is paused. False otherwise."),(0,i.kt)("h3",{id:"nb_trials_runself"},(0,i.kt)("inlineCode",{parentName:"h3"},"nb_trials_run(self)")),(0,i.kt)("p",null,"Method to inquire the number of trials run so far."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"int")," - Number of trials that were run (and ended) so far in the batch."),(0,i.kt)("h3",{id:"async-waitself-timeout"},(0,i.kt)("inlineCode",{parentName:"h3"},"async wait(self, timeout)")),(0,i.kt)("p",null,"Method to wait for the batch to be done. The batch will end normally when all trials have run and ended. The batch can also be stopped, terminated, or encounter an error to become done."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"timeout"),": ",(0,i.kt)("em",{parentName:"li"},"float")," - Maximum time to wait in seconds.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the batch ended normally with the last trial tagged as such. False otherwise. ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if timed out."),(0,i.kt)("h2",{id:"class-batchtrainer"},"class BatchTrainer"),(0,i.kt)("p",null,"Class to help train a model on a specific batch of trials."),(0,i.kt)("h3",{id:"__init__self-batch_spec-datastore-model_registry-trial_callback-max_trial_wait"},(0,i.kt)("inlineCode",{parentName:"h3"},"__init__(self, batch_spec, datastore, model_registry, trial_callback, max_trial_wait)")),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"batch_spec"),": ",(0,i.kt)("em",{parentName:"li"},"str")," or ",(0,i.kt)("em",{parentName:"li"},"dict{str:str}")," or ",(0,i.kt)("em",{parentName:"li"},"list","[str]")," or ",(0,i.kt)("em",{parentName:"li"},"TrialBatch instance")," - If a string, it represents a batch ID of the trials to use for training. If a dictionary, it represents the properties of the trials to use for training. If a list, it represents the list of trial IDs to use for training. If an instance of ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialBatch"),", then the trials started by that batch will be used for training. For anything other than a ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialBatch")," instance, there is no reliable way to know if an ongoing batch has ended, therefore the trainer will have to manually be stopped or use ",(0,i.kt)("inlineCode",{parentName:"li"},"max_trial_wait")," to stop automatically."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"datastore"),": ",(0,i.kt)("em",{parentName:"li"},"cogment.Datastore instance")," - The datastore used to retrieve the samples."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_registry"),": ",(0,i.kt)("em",{parentName:"li"},"cogment.ModelRegistry instance")," - The registry that will be passed to the callbacks."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_callback"),": same parameter as provided to ",(0,i.kt)("a",{parentName:"li",href:"#async-run_simple_trainingself-batch-trial_callback-actor_names"},(0,i.kt)("inlineCode",{parentName:"a"},"run_simple_training")),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"max_trial_wait"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - Maximum number of seconds to wait for a new trial. If ",(0,i.kt)("inlineCode",{parentName:"li"},"batch_spec")," is an instance of ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialBatch")," then this wait is for new trials to be started by the batch. Otherwise, this wait if for trials that match ",(0,i.kt)("inlineCode",{parentName:"li"},"batch_spec")," to appear in the datastore (If set to 0, then only trials already in the datastore will be used).")),(0,i.kt)("h3",{id:"startself-actor_names-actor_classes-actor_implementations-fields"},(0,i.kt)("inlineCode",{parentName:"h3"},"start(self, actor_names=[], actor_classes=[], actor_implementations=[], fields=[])")),(0,i.kt)("p",null,"Method to start training."),(0,i.kt)("p",null,"Parameters: Same as ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.Datastore.all_samples")," of the same name. These parameters will be passed as-is to the datastore ",(0,i.kt)("inlineCode",{parentName:"p"},"all_sample")," method."),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"terminateself"},(0,i.kt)("inlineCode",{parentName:"h3"},"terminate(self)")),(0,i.kt)("p",null,"Method to terminate training.\nThe callback tasks will be cancelled."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"async-stopself"},(0,i.kt)("inlineCode",{parentName:"h3"},"async stop(self)")),(0,i.kt)("p",null,"Method to stop training.\nStops retrieving trials from the Datastore.\nAll trials already started will continue training."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"is_runningself-1"},(0,i.kt)("inlineCode",{parentName:"h3"},"is_running(self)")),(0,i.kt)("p",null,"Method to inquire whether the training is done or not."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the training is still running. The training has stopped running when no more samples are being retrieved and all callbacks have returned."),(0,i.kt)("h3",{id:"async-waitself-timeout-1"},(0,i.kt)("inlineCode",{parentName:"h3"},"async wait(self, timeout)")),(0,i.kt)("p",null,"Method to wait for the training to be done.\nThe training will end normally when all trials of the batch have started processing and all callbacks have returned.\nThe training can also be stopped, or encounter an error to become done."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"timeout"),": ",(0,i.kt)("em",{parentName:"li"},"float")," - Maximum time to wait in seconds.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - False if timed out, True otherwise. If True, then ",(0,i.kt)("inlineCode",{parentName:"p"},"is_running")," will also return True."),(0,i.kt)("h3",{id:"set_nb_parallel_trialsself-nb_trials"},(0,i.kt)("inlineCode",{parentName:"h3"},"set_nb_parallel_trials(self, nb_trials)")),(0,i.kt)("p",null,"Method to set the number of trials to train in parallel."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"nb_trials"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - Number of trials to train in parallel (>0). If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", no limit will be enforced and all batch trial data will be processed as it becomes available. Default is 1 (i.e. no parallelism, only one trial at a time).")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h2",{id:"class-batchtrialinfo"},"class BatchTrialInfo"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"batch_id"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - ID of the batch"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trial_index"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The index of the trial in the batch. Generally the order the trials were started, and unique in the batch (",(0,i.kt)("inlineCode",{parentName:"p"},"[0, nb_trials["),")."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trial_info"),": ",(0,i.kt)("em",{parentName:"p"},"cogment.DatastoreTrialInfo")," - The running trial information. May not always be present."),(0,i.kt)("h2",{id:"class-trainertrialsession"},"class TrainerTrialSession"),(0,i.kt)("p",null,"Class to help train a model on a specific batch of trials."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trial_id"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - ID of the trial."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"parameters"),": ",(0,i.kt)("em",{parentName:"p"},"cogment.TrialParameters instance")," - Parameters of the trial."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"model_registry"),": ",(0,i.kt)("em",{parentName:"p"},"cogment.ModelRegistry instance")," - Common model registry for the whole batch being trained. The TrialRunner argument ",(0,i.kt)("inlineCode",{parentName:"p"},"model_registry_endpoint")," is used to retrieve this model registry."),(0,i.kt)("h3",{id:"async-all_samplesself"},(0,i.kt)("inlineCode",{parentName:"h3"},"async all_samples(self)")),(0,i.kt)("p",null,"Method to retrieve all samples from the trial."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(cogment.DatastoreSample instance)")," - A generator for the trial samples that arrive."),(0,i.kt)("h2",{id:"callbacks"},"Callbacks"),(0,i.kt)("h3",{id:"use"},"Use"),(0,i.kt)("p",null,"These functions are passed to the ",(0,i.kt)("a",{parentName:"p",href:"#class-cogment_enterpriserunnertrialrunner"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialRunner.run_simple_batch"))," or ",(0,i.kt)("a",{parentName:"p",href:"#async-run_simple_trainingself-batch-sampler_callback-actor_names"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialRunner.run_simple_training"))," methods and will be called at specific times to request information to the user or provide information to the user.\nThey can be defined and used in a number of ways."),(0,i.kt)("p",null,"Here we take the ",(0,i.kt)("inlineCode",{parentName:"p"},"pre_trial_callback")," as an example, but the other callbacks are similar, except for parameters and return values:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"async def my_pre_trial_callback(info: BatchTrialInfo):\n trial_params = cogment.TrialParameters()\n # ... Fill in the parameters here\n return trial_params\n\nrunner = TrialRunner(1, 1, None, my_pre_trial_callback)\n")),(0,i.kt)("p",null,"Sometimes it is more convenient for the callback to be a method of a class in order to re-use data between calls, or share data with other parts of the program (or other callbacks), in this case it could look like this:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"class MyBatchData:\n async def my_pre_trial_callback(self, info: BatchTrialInfo):\n trial_params = cogment.TrialParameters()\n # ... Fill in the parameters here\n return trial_params\n\nmy_data = MyBatchData()\nrunner = TrialRunner(1, 1, None, my_data.my_pre_trial_callback)\n")),(0,i.kt)("p",null,"Although rare, it may be inconvenient sometimes to use a class for sharing data, in which case the Python ",(0,i.kt)("inlineCode",{parentName:"p"},"functools")," module can be used:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"import functools\n\nasync def my_function(my_data, info: BatchTrialInfo):\n trial_params = cogment.TrialParameters()\n # ... Fill in the parameters here\n return trial_params\n\nshared_data = #...\nactual_callback = functools.partial(my_function, shared_data)\nrunner = TrialRunner(1, 1, None, actual_callback)\n")),(0,i.kt)("h3",{id:"pre-trial-callback"},"Pre-Trial Callback"),(0,i.kt)("p",null,"This function is passed to the ",(0,i.kt)("a",{parentName:"p",href:"#class-cogment_enterpriserunnertrialrunner"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialRunner.run_simple_batch"))," method and will be called before any trial is started to define the trial parameters.\nIt is an ",(0,i.kt)("inlineCode",{parentName:"p"},"asyncio")," coroutine."),(0,i.kt)("p",null,"e.g.:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"async def my_pre_trial_callback(info: BatchTrialInfo) -> cogment.TrialParameters:\n trial_params = cogment.TrialParameters()\n # ... Fill in the parameters here\n return trial_params\n")),(0,i.kt)("p",null,"Parameters Received:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"info"),": ",(0,i.kt)("em",{parentName:"li"},"BatchTrialInfo instance")," - Partially filled info of the trial to start; it does not contain ",(0,i.kt)("inlineCode",{parentName:"li"},"trial_info"),".")),(0,i.kt)("p",null,"Expected Return: ",(0,i.kt)("em",{parentName:"p"},"None or tuple(str, cogment.TrialParameters instance)")," - The first item of the tuple is the requested trial ID. If the trial ID is ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),", it will be automatically created using the batch ID and the trial index. The second item of the tuple is the trial parameters that must be fully populated to start the new trial. If the return value is ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," (instead of a tuple), the trial will not start and the batch will stop (i.e. not start any new trial, but ongoing trials will continue)."),(0,i.kt)("p",null,"In case of exceptions: Exceptions raised by the callback will do the same as if ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," was returned."),(0,i.kt)("p",null,"Once the parameters are received by the ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialBatch"),", some data will be added, and some will be overwritten before starting the trial.\nThese are the ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialParameters")," attributes changed:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"properties"),": Some properties will be added to the existing properties (see ",(0,i.kt)("a",{parentName:"li",href:"#module-attributes"},"Module Attributes"),"). If the property names clash, the user properties will be overwritten. In general, do not start property names with an underscore to prevent such clashes."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"datalog_endpoint"),": This attribute of the trial parameters will be overwritten. If the ",(0,i.kt)("inlineCode",{parentName:"li"},"datastore_endpoint")," argument of ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialRunner")," is provided, it will be used. If ",(0,i.kt)("inlineCode",{parentName:"li"},"datastore_endpoint")," was not provided, or it was ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", then the directory will be used to find an appropriate datalog/datastore. The same datastore must be used by both the ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialBatch")," (as a datalog) and ",(0,i.kt)("inlineCode",{parentName:"li"},"BatchTrainer")," (as a datastore), so the endpoint should resolve to the same datastore locally and at the Orchestrator (i.e. ideally use the same directory)."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"datalog_exclude_fields"),": This attribute will be reset (i.e. not excluding any fields from the datalog).")),(0,i.kt)("h3",{id:"post-trial-callback"},"Post-Trial Callback"),(0,i.kt)("p",null,"This function is passed to the ",(0,i.kt)("a",{parentName:"p",href:"#class-cogment_enterpriserunnertrialrunner"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialRunner.run_simple_batch"))," method and will be called after a trial has ended normally (i.e. was not terminated).\nIt is an ",(0,i.kt)("inlineCode",{parentName:"p"},"asyncio")," coroutine."),(0,i.kt)("p",null,"e.g.:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"async def my_post_trial_callback(info):\n # ... Do cleanup, tracking, etc\n")),(0,i.kt)("p",null,"Parameters Received:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"info"),": ",(0,i.kt)("em",{parentName:"li"},"BatchTrialInfo instance")," - The full info of the trial that ended.")),(0,i.kt)("p",null,"Expected Return: None"),(0,i.kt)("p",null,"In case of exceptions: All exceptions raised by the callback will be ignored."),(0,i.kt)("h3",{id:"sampler-callback"},"Sampler Callback"),(0,i.kt)("p",null,"This function is passed to the ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialRunner.run_simple_trainer")," method and will be called for each sample of the trials being run in the batch.\nThis is asynchronous with the actual running of the trials and uses the Cogment Datastore to retrieve the samples.\nIt is an ",(0,i.kt)("inlineCode",{parentName:"p"},"asyncio")," coroutine."),(0,i.kt)("p",null,"e.g.:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"async def my_sampler_callback(sample, trial_parameters, model_registry):\n # ... Train model\n")),(0,i.kt)("p",null,"Parameters Received:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"sample"),": ",(0,i.kt)("em",{parentName:"li"},"cogment.DatastoreSample instance")," - Trial sample received."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_parameters"),": ",(0,i.kt)("em",{parentName:"li"},"cogment.TrialParameters instance")," - Parameters of the trial from which the sample came from."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_registry"),": ",(0,i.kt)("em",{parentName:"li"},"cogment.ModelRegistry instance")," - Common model registry for the whole batch being trained. The TrialRunner argument ",(0,i.kt)("inlineCode",{parentName:"li"},"model_registry_endpoint")," is used to retrieve this model registry.")),(0,i.kt)("p",null,"Expected Return: ",(0,i.kt)("em",{parentName:"p"},"None or bool")," - If ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," or True, the training will continue normally. If a bool and False, the sampler callback will stop being called, and the ",(0,i.kt)("inlineCode",{parentName:"p"},"BatchTrainer")," will stop."),(0,i.kt)("p",null,"In case of exceptions: If the callback raises an exception, the ",(0,i.kt)("inlineCode",{parentName:"p"},"BatchTrainer")," will stop at the next sample."),(0,i.kt)("h3",{id:"trial-callback"},"Trial Callback"),(0,i.kt)("p",null,"This function is passed to the ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialRunner.run_simple_trial_trainer")," method and will be called for each trial of the batch.\nThis is asynchronous with the actual running of the trials and uses the Cogment Datastore to retrieve the trial data and samples.\nIt is an ",(0,i.kt)("inlineCode",{parentName:"p"},"asyncio")," coroutine."),(0,i.kt)("p",null,"e.g.:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"async def my_trial_callback(session):\n async for sample in session.all_samples():\n # ... process sample\n")),(0,i.kt)("p",null,"Parameters Received:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"session"),": ",(0,i.kt)("em",{parentName:"li"},"TrainerTrialSession instance")," - The session for the trial.")),(0,i.kt)("p",null,"Expected Return: ",(0,i.kt)("em",{parentName:"p"},"None or bool")," - If ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," or True, continue processing the batch. If a bool and False, stop the ",(0,i.kt)("inlineCode",{parentName:"p"},"BatchTrainer"),"."),(0,i.kt)("p",null,"In case of exceptions: If the callback raises an exception, the ",(0,i.kt)("inlineCode",{parentName:"p"},"BatchTrainer")," will stop immediately."))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/61fcde8c.6d225a73.js b/assets/js/61fcde8c.6d225a73.js new file mode 100644 index 0000000..a9d7b59 --- /dev/null +++ b/assets/js/61fcde8c.6d225a73.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[5171],{3905:(e,t,a)=>{a.d(t,{Zo:()=>c,kt:()=>u});var n=a(7294);function i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function r(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function l(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?r(Object(a),!0).forEach((function(t){i(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):r(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function o(e,t){if(null==e)return{};var a,n,i=function(e,t){if(null==e)return{};var a,n,i={},r=Object.keys(e);for(n=0;n<r.length;n++)a=r[n],t.indexOf(a)>=0||(i[a]=e[a]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var s=n.createContext({}),p=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},c=function(e){var t=p(e.components);return n.createElement(s.Provider,{value:t},e.children)},d="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},h=n.forwardRef((function(e,t){var a=e.components,i=e.mdxType,r=e.originalType,s=e.parentName,c=o(e,["components","mdxType","originalType","parentName"]),d=p(a),h=i,u=d["".concat(s,".").concat(h)]||d[h]||m[h]||r;return a?n.createElement(u,l(l({ref:t},c),{},{components:a})):n.createElement(u,l({ref:t},c))}));function u(e,t){var a=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var r=a.length,l=new Array(r);l[0]=h;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[d]="string"==typeof e?e:i,l[1]=o;for(var p=2;p<r;p++)l[p]=a[p];return n.createElement.apply(null,l)}return n.createElement.apply(null,a)}h.displayName="MDXCreateElement"},1975:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>m,frontMatter:()=>r,metadata:()=>o,toc:()=>p});var n=a(7462),i=(a(7294),a(3905));const r={sidebar_position:2},l="Runner",o={unversionedId:"reference/python-enterprise/runner",id:"reference/python-enterprise/runner",title:"Runner",description:"This is part of the Cogment Enterprise, AI Redefined's commercial offering.",source:"@site/docs/reference/python-enterprise/runner.md",sourceDirName:"reference/python-enterprise",slug:"/reference/python-enterprise/runner",permalink:"/docs/reference/python-enterprise/runner",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"docSidebar",previous:{title:"Installation",permalink:"/docs/reference/python-enterprise/installation"},next:{title:"gRPC API",permalink:"/docs/reference/grpc"}},s={},p=[{value:"General usage",id:"general-usage",level:2},{value:"<code>asyncio</code>",id:"asyncio",level:3},{value:"Logging",id:"logging",level:3},{value:"Trial Specifications",id:"trial-specifications",level:3},{value:"Top-level import",id:"top-level-import",level:3},{value:"Utilities and Constants",id:"utilities-and-constants",level:2},{value:"<code>cogment_enterprise.runner.BATCH_ID_PROPERTY</code>",id:"cogment_enterpriserunnerbatch_id_property",level:3},{value:"<code>cogment_enterprise.runner.BATCH_TRIAL_INDEX_PROPERTY</code>",id:"cogment_enterpriserunnerbatch_trial_index_property",level:3},{value:"<code>cogment_enterprise.runner.BATCH_LAST_TRIAL_PROPERTY</code>",id:"cogment_enterpriserunnerbatch_last_trial_property",level:3},{value:"<code>cogment_enterprise.runner.deserialize_action(serialized_data, actor_class, cog_settings)</code>",id:"cogment_enterpriserunnerdeserialize_actionserialized_data-actor_class-cog_settings",level:3},{value:"<code>cogment_enterprise.runner.deserialize_actor_observation(serialized_data, actor_class, cog_settings)</code>",id:"cogment_enterpriserunnerdeserialize_actor_observationserialized_data-actor_class-cog_settings",level:3},{value:"<code>cogment_enterprise.runner.deserialize_actor_config(serialized_data, actor_class, cog_settings)</code>",id:"cogment_enterpriserunnerdeserialize_actor_configserialized_data-actor_class-cog_settings",level:3},{value:"<code>cogment_enterprise.runner.deserialize_environment_config(serialized_data, cog_settings)</code>",id:"cogment_enterpriserunnerdeserialize_environment_configserialized_data-cog_settings",level:3},{value:"<code>cogment_enterprise.runner.deserialize_trial_config(serialized_data, cog_settings)</code>",id:"cogment_enterpriserunnerdeserialize_trial_configserialized_data-cog_settings",level:3},{value:"class cogment_enterprise.runner.TrialRunner",id:"class-cogment_enterpriserunnertrialrunner",level:2},{value:"<code>__init__(self, user_id, cog_settings=None, asyncio_loop=None, directory_endpoint=None, directory_auth_token=None, orchestrator_endpoint=None, datastore_endpoint=None, model_registry=None)</code>",id:"__init__self-user_id-cog_settingsnone-asyncio_loopnone-directory_endpointnone-directory_auth_tokennone-orchestrator_endpointnone-datastore_endpointnone-model_registrynone",level:3},{value:"<code>async get_controller(self)</code>",id:"async-get_controllerself",level:3},{value:"<code>async get_datastore(self)</code>",id:"async-get_datastoreself",level:3},{value:"<code>async get_model_registry(self)</code>",id:"async-get_model_registryself",level:3},{value:"<code>async run_simple_batch(self, nb_trials, nb_parallel_trials=1, id=None, pre_trial_callback=None, post_trial_callback=None)</code>",id:"async-run_simple_batchself-nb_trials-nb_parallel_trials1-idnone-pre_trial_callbacknone-post_trial_callbacknone",level:3},{value:"<code>async run_simple_training(self, batch, sampler_callback, actor_names=None, max_trial_wait=None)</code>",id:"async-run_simple_trainingself-batch-sampler_callback-actor_namesnone-max_trial_waitnone",level:3},{value:"<code>async run_simple_trial_training(self, batch, trial_callback, actor_names=None, max_trial_wait=None)</code>",id:"async-run_simple_trial_trainingself-batch-trial_callback-actor_namesnone-max_trial_waitnone",level:3},{value:"class TrialBatch",id:"class-trialbatch",level:2},{value:"<strong>init</strong>(self, id, controller, nb_trials, pre_trial_callback, post_trial_callback, datalog_endpoint)",id:"initself-id-controller-nb_trials-pre_trial_callback-post_trial_callback-datalog_endpoint",level:3},{value:"<code>start_trials(self, nb_trials)</code>",id:"start_trialsself-nb_trials",level:3},{value:"<code>pause(self)</code>",id:"pauseself",level:3},{value:"<code>resume(self)</code>",id:"resumeself",level:3},{value:"<code>stop(self)</code>",id:"stopself",level:3},{value:"<code>terminate(self, hard=False)</code>",id:"terminateself-hardfalse",level:3},{value:"<code>is_running(self)</code>",id:"is_runningself",level:3},{value:"<code>nb_trials_run(self)</code>",id:"nb_trials_runself",level:3},{value:"<code>async wait(self, timeout)</code>",id:"async-waitself-timeout",level:3},{value:"class BatchTrainer",id:"class-batchtrainer",level:2},{value:"<code>__init__(self, batch_spec, datastore, model_registry, trial_callback, max_trial_wait)</code>",id:"__init__self-batch_spec-datastore-model_registry-trial_callback-max_trial_wait",level:3},{value:"<code>start(self, actor_names=[], actor_classes=[], actor_implementations=[], fields=[])</code>",id:"startself-actor_names-actor_classes-actor_implementations-fields",level:3},{value:"<code>terminate(self)</code>",id:"terminateself",level:3},{value:"<code>async stop(self)</code>",id:"async-stopself",level:3},{value:"<code>is_running(self)</code>",id:"is_runningself-1",level:3},{value:"<code>async wait(self, timeout)</code>",id:"async-waitself-timeout-1",level:3},{value:"<code>set_nb_parallel_trials(self, nb_trials)</code>",id:"set_nb_parallel_trialsself-nb_trials",level:3},{value:"class BatchTrialInfo",id:"class-batchtrialinfo",level:2},{value:"class TrainerTrialSession",id:"class-trainertrialsession",level:2},{value:"<code>async all_samples(self)</code>",id:"async-all_samplesself",level:3},{value:"Callbacks",id:"callbacks",level:2},{value:"Use",id:"use",level:3},{value:"Pre-Trial Callback",id:"pre-trial-callback",level:3},{value:"Post-Trial Callback",id:"post-trial-callback",level:3},{value:"Sampler Callback",id:"sampler-callback",level:3},{value:"Trial Callback",id:"trial-callback",level:3}],c={toc:p},d="wrapper";function m(e){let{components:t,...a}=e;return(0,i.kt)(d,(0,n.Z)({},c,a,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"runner"},"Runner"),(0,i.kt)("admonition",{title:"Cogment Enterprise",type:"note"},(0,i.kt)("p",{parentName:"admonition"},"This is part of the ",(0,i.kt)("strong",{parentName:"p"},"Cogment Enterprise"),", ",(0,i.kt)("a",{parentName:"p",href:"https://ai-r.com/"},"AI Redefined's")," commercial offering.")),(0,i.kt)("h2",{id:"general-usage"},"General usage"),(0,i.kt)("h3",{id:"asyncio"},(0,i.kt)("inlineCode",{parentName:"h3"},"asyncio")),(0,i.kt)("p",null,"The use of this module requires ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/python"},"Cogment Python SDK")," >= 2.8.0. It uses Python's ",(0,i.kt)("inlineCode",{parentName:"p"},"asyncio")," library and as such should be run in an ",(0,i.kt)("inlineCode",{parentName:"p"},"asyncio.Task"),".\nThis documentation assumes some familiarity with the ",(0,i.kt)("inlineCode",{parentName:"p"},"asyncio")," library of Python (see ",(0,i.kt)("a",{parentName:"p",href:"https://docs.python.org/3/library/asyncio.html"},"Python documentation"),")."),(0,i.kt)("p",null,"E.g."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"import asyncio\n\nasyncio.run(MyMainFunction())\n")),(0,i.kt)("h3",{id:"logging"},"Logging"),(0,i.kt)("p",null,"This module uses the ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.enterprise")," logger, and the default log level is ",(0,i.kt)("inlineCode",{parentName:"p"},"INFO"),". E.g. to change the log level to ",(0,i.kt)("inlineCode",{parentName:"p"},"WARNING"),":"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'import cogment_enterprise\nimport logging\n\nlogging.getLogger("cogment.enterprise").setLevel(logging.WARNING)\n')),(0,i.kt)("p",null,"Or set the environment variable ",(0,i.kt)("inlineCode",{parentName:"p"},"COGMENT_ENTERPRISE_LOG_LEVEL")," to one of the values: ",(0,i.kt)("inlineCode",{parentName:"p"},"off"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"error"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"warning"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"info"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"debug"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"trace"),".\nThe logging works the same as Cogment Python SDK logging (see Cogment Python SDK documentation)."),(0,i.kt)("h3",{id:"trial-specifications"},"Trial Specifications"),(0,i.kt)("p",null,"This module is designed to work without any trial specifications (i.e. ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings"),"), but is easier to use if the specification are available."),(0,i.kt)("p",null,"If the specifications are not provided, some internal object deserializations will not happen (e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"sample.observation"),"), and special serialized versions will have to be used (e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"sample.observation_serialized"),").\nHelper functions are provided for deserializing the various defined objects in the specifications (see below)."),(0,i.kt)("p",null,"Objects normally received as ",(0,i.kt)("inlineCode",{parentName:"p"},"google.protobuf.Any")," will still be deserialized to such an object as it does not depend on the specification of the trial."),(0,i.kt)("h3",{id:"top-level-import"},"Top-level import"),(0,i.kt)("p",null,"The main module of the Runner SDK is ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment_enterprise.runner"),", and most enterprise scripts will start with a ",(0,i.kt)("a",{parentName:"p",href:"#class-cogment_enterpriserunnertrialrunner"},"cogment_enterprise.runner.TrialRunner"),"."),(0,i.kt)("h2",{id:"utilities-and-constants"},"Utilities and Constants"),(0,i.kt)("h3",{id:"cogment_enterpriserunnerbatch_id_property"},(0,i.kt)("inlineCode",{parentName:"h3"},"cogment_enterprise.runner.BATCH_ID_PROPERTY")),(0,i.kt)("p",null,"This is the name of the trial property where the batch ID is stored.\nEach trial started by a batch will have this property."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"batch_id = trial_parameters.properties[cogment_enterprise.runner.BATCH_ID_PROPERTY]\n")),(0,i.kt)("h3",{id:"cogment_enterpriserunnerbatch_trial_index_property"},(0,i.kt)("inlineCode",{parentName:"h3"},"cogment_enterprise.runner.BATCH_TRIAL_INDEX_PROPERTY")),(0,i.kt)("p",null,"This is the name of the trial property where the index of the trial in the batch is stored.\nEach trial started by a batch will have this property."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"trial_index_in_batch = trial_parameters.properties[cogment_enterprise.runner.BATCH_TRIAL_INDEX_PROPERTY]\n")),(0,i.kt)("h3",{id:"cogment_enterpriserunnerbatch_last_trial_property"},(0,i.kt)("inlineCode",{parentName:"h3"},"cogment_enterprise.runner.BATCH_LAST_TRIAL_PROPERTY")),(0,i.kt)("p",null,"This is the name of the trial property that will be set on the last trial of the batch.\nThe property value is empty, it's presence indicates that this is the last trial of the batch.\nOnly one trial in a batch may have this property."),(0,i.kt)("p",null,"Note that there may not be a trial with this property if the batch was stopped prematurely."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"last_trial = cogment_enterprise.runner.BATCH_LAST_TRIAL_PROPERTY in trial_parameters.properties\n")),(0,i.kt)("h3",{id:"cogment_enterpriserunnerdeserialize_actionserialized_data-actor_class-cog_settings"},(0,i.kt)("inlineCode",{parentName:"h3"},"cogment_enterprise.runner.deserialize_action(serialized_data, actor_class, cog_settings)")),(0,i.kt)("p",null,"Function to deserialize raw data into a Python class instance."),(0,i.kt)("p",null,"The data can only be deserialized by knowing the protobuf message it represents.\nIt can be done manually if one knows the protobuf message represented.\nThis function simplifies deserialization of messages related to a Cogment project with the trial spec module ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings"),"."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"serialized_data"),": ",(0,i.kt)("em",{parentName:"li"},"bytes")," - Raw data received."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_class"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Name of the class of the actor to which this data relates. This information is necessary to find the proper message type in the spec."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"cog_settings"),": ",(0,i.kt)("em",{parentName:"li"},"module")," - Specification module associated with the trial from which the data relates.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - Action from an actor of type ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_class"),". The class of the action is defined as action space for the specific actor class in the section ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes:action:space")," in the spec file (e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings"),"). ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if ",(0,i.kt)("inlineCode",{parentName:"p"},"serialized_data")," is ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),"."),(0,i.kt)("h3",{id:"cogment_enterpriserunnerdeserialize_actor_observationserialized_data-actor_class-cog_settings"},(0,i.kt)("inlineCode",{parentName:"h3"},"cogment_enterprise.runner.deserialize_actor_observation(serialized_data, actor_class, cog_settings)")),(0,i.kt)("p",null,"Function to deserialize raw data into a Python class instance."),(0,i.kt)("p",null,"The data can only be deserialized by knowing the protobuf message it represents.\nIt can be done manually if one knows the protobuf message represented.\nThis function simplifies deserialization of messages related to a Cogment project with the trial spec module ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings"),"."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"serialized_data"),": ",(0,i.kt)("em",{parentName:"li"},"bytes")," - Raw data received."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_class"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Name of the class of the actor to which this data relates. This information is necessary to find the proper message type in the spec."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"cog_settings"),": ",(0,i.kt)("em",{parentName:"li"},"module")," - Specification module associated with the trial from which the data relates.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - Observation for an actor of type ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_class"),". The class of the observation is defined as observation space for the specific actor class in the section ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes:observation:space")," in the spec file (e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings"),"). ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if ",(0,i.kt)("inlineCode",{parentName:"p"},"serialized_data")," is ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),"."),(0,i.kt)("h3",{id:"cogment_enterpriserunnerdeserialize_actor_configserialized_data-actor_class-cog_settings"},(0,i.kt)("inlineCode",{parentName:"h3"},"cogment_enterprise.runner.deserialize_actor_config(serialized_data, actor_class, cog_settings)")),(0,i.kt)("p",null,"Function to deserialize raw data into a Python class instance."),(0,i.kt)("p",null,"The data can only be deserialized by knowing the protobuf message it represents.\nIt can be done manually if one knows the protobuf message represented.\nThis function simplifies deserialization of messages related to a Cogment project with the trial spec module ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings"),"."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"serialized_data"),": ",(0,i.kt)("em",{parentName:"li"},"bytes")," - Raw data received."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_class"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Name of the class of the actor to which this data relates. This information is necessary to find the proper message type in the spec."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"cog_settings"),": ",(0,i.kt)("em",{parentName:"li"},"module")," - Specification module associated with the trial from which the data relates.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - Config for an actor of type ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_class"),". The class of the config is defined as config type for the specific actor class in the section ",(0,i.kt)("inlineCode",{parentName:"p"},"actor_classes:config_type")," in the spec file (e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings"),"). ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if ",(0,i.kt)("inlineCode",{parentName:"p"},"serialized_data")," is ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),"."),(0,i.kt)("h3",{id:"cogment_enterpriserunnerdeserialize_environment_configserialized_data-cog_settings"},(0,i.kt)("inlineCode",{parentName:"h3"},"cogment_enterprise.runner.deserialize_environment_config(serialized_data, cog_settings)")),(0,i.kt)("p",null,"Function to deserialize raw data into a Python class instance."),(0,i.kt)("p",null,"The data can only be deserialized by knowing the protobuf message it represents.\nIt can be done manually if one knows the protobuf message represented.\nThis function simplifies deserialization of messages related to a Cogment project with the trial spec module ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings"),"."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"serialized_data"),": ",(0,i.kt)("em",{parentName:"li"},"bytes")," - Raw data received."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"cog_settings"),": ",(0,i.kt)("em",{parentName:"li"},"module")," - Specification module associated with the trial from which the data relates.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - Config for the environment. The class of the config is defined as config type in the section ",(0,i.kt)("inlineCode",{parentName:"p"},"environment:config_type")," in the spec file (e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings"),"). ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if ",(0,i.kt)("inlineCode",{parentName:"p"},"serialized_data")," is ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),"."),(0,i.kt)("h3",{id:"cogment_enterpriserunnerdeserialize_trial_configserialized_data-cog_settings"},(0,i.kt)("inlineCode",{parentName:"h3"},"cogment_enterprise.runner.deserialize_trial_config(serialized_data, cog_settings)")),(0,i.kt)("p",null,"Function to deserialize raw data into a Python class instance."),(0,i.kt)("p",null,"The data can only be deserialized by knowing the protobuf message it represents.\nIt can be done manually if one knows the protobuf message represented.\nThis function simplifies deserialization of messages related to a Cogment project with the trial spec module ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings"),"."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"serialized_data"),": ",(0,i.kt)("em",{parentName:"li"},"bytes")," - Raw data received."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"cog_settings"),": ",(0,i.kt)("em",{parentName:"li"},"module")," - Specification module associated with the trial from which the data relates.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"protobuf class instance")," - Config for the trial. The class of the config is defined as config type in the section ",(0,i.kt)("inlineCode",{parentName:"p"},"trial:config_type")," in the spec file (e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"cog_settings"),"). ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if ",(0,i.kt)("inlineCode",{parentName:"p"},"serialized_data")," is ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),"."),(0,i.kt)("h2",{id:"class-cogment_enterpriserunnertrialrunner"},"class cogment_enterprise.runner.TrialRunner"),(0,i.kt)("h3",{id:"__init__self-user_id-cog_settingsnone-asyncio_loopnone-directory_endpointnone-directory_auth_tokennone-orchestrator_endpointnone-datastore_endpointnone-model_registrynone"},(0,i.kt)("inlineCode",{parentName:"h3"},"__init__(self, user_id, cog_settings=None, asyncio_loop=None, directory_endpoint=None, directory_auth_token=None, orchestrator_endpoint=None, datastore_endpoint=None, model_registry=None)")),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"user_id"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Identifier for the user of this context."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"cog_settings"),": ",(0,i.kt)("em",{parentName:"li"},"module")," - Settings module associated with trials that will be run (",(0,i.kt)("a",{parentName:"li",href:"#cog_settings.py"},"cog_settings")," namespace)."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"asyncio_loop"),": ",(0,i.kt)("em",{parentName:"li"},"asyncio.Loop")," - For special purpose implementations."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"directory_endpoint"),": ",(0,i.kt)("em",{parentName:"li"},"Endpoint instance"),' - Grpc endpoint (i.e. starting with "grpc://") to access the directory. The directory will be used to inquire discovery endpoints, and to register the services for discovery. If no endpoint is provided, a check for the environment variable ',(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_ENDPOINT")," will be made and if it exists, it will be used as the URL of a basic endpoint."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"directory_auth_token"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - Authentication token for access to the directory. This token will be registered with the services, and must match registered tokens when inquiring the directory. If no token is provided, a check for the environment variable ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_AUTHENTICATION_TOKEN")," will be made and if it exists, it will be used as the token."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"orchestrator_endpoint"),": ",(0,i.kt)("em",{parentName:"li"},"Endpoint instance")," - Details of the connection to the Orchestrator. If not provided, the directory will be inquired. Only needed for running batches, not for training."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"datastore_endpoint"),": ",(0,i.kt)("em",{parentName:"li"},"Endpoint instance")," - Details of the connection to the Datastore. If not provided, the directory will be inquired if necessary. This will be used as the datalog endpoint of the trials started by the batch. And it will be used as the source of samples for training."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_registry_endpoint"),": ",(0,i.kt)("em",{parentName:"li"},"Endpoint instance")," - Details of the connection to the Model Registry. If not provided, the directory will be inquired if necessary. Only needed for training, not running batches.")),(0,i.kt)("h3",{id:"async-get_controllerself"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_controller(self)")),(0,i.kt)("p",null,"Returns the Controller used by the TrialRunner."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"cogment.Controller instance")," - An instance of ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.Controller")," class used to manage trials."),(0,i.kt)("h3",{id:"async-get_datastoreself"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_datastore(self)")),(0,i.kt)("p",null,"Returns the Datastore used by the TrialRunner."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"cogment.Datastore instance")," - Datastore."),(0,i.kt)("h3",{id:"async-get_model_registryself"},(0,i.kt)("inlineCode",{parentName:"h3"},"async get_model_registry(self)")),(0,i.kt)("p",null,"Returns the Model Registry used by the TrialRunner."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"cogment.ModelRegistry instance")," - Model Registry."),(0,i.kt)("h3",{id:"async-run_simple_batchself-nb_trials-nb_parallel_trials1-idnone-pre_trial_callbacknone-post_trial_callbacknone"},(0,i.kt)("inlineCode",{parentName:"h3"},"async run_simple_batch(self, nb_trials, nb_parallel_trials=1, id=None, pre_trial_callback=None, post_trial_callback=None)")),(0,i.kt)("p",null,"Method to start a batch of trials."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"nb_trials"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - The number of trials to run."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"nb_parallel_trials"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - The number of trials to run in parallel. Must be <= ",(0,i.kt)("inlineCode",{parentName:"li"},"nb_trials"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"id"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - ID of the batch. This will be added to the properties of the trials that are started by the batch. This should be unique in the Datastore, otherwise there could be a clash of trial IDs (a mix of trials from different batches could also be used by the ",(0,i.kt)("inlineCode",{parentName:"li"},"BatchTrainer"),"). If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", an ID will be chosen by the system."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"pre_trial_callback"),": ",(0,i.kt)("em",{parentName:"li"},"async func(BatchTrialInfo instance) -> cogment.TrialParameters")," - This ",(0,i.kt)("a",{parentName:"li",href:"#callbacks"},"Callbacks")," function will be called before any new trial is started."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"post_trial_callback"),": ",(0,i.kt)("em",{parentName:"li"},"async func(sample, trial_parameters, model_registry)")," - This ",(0,i.kt)("a",{parentName:"li",href:"#callbacks"},"Callbacks")," function will be called after the end of a trial.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"TrialBatch instance")," - An instance of the ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialBatch")," class."),(0,i.kt)("h3",{id:"async-run_simple_trainingself-batch-sampler_callback-actor_namesnone-max_trial_waitnone"},(0,i.kt)("inlineCode",{parentName:"h3"},"async run_simple_training(self, batch, sampler_callback, actor_names=None, max_trial_wait=None)")),(0,i.kt)("p",null,"Method to start training on a batch of trials with a per-sample callback."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"batch"),": ",(0,i.kt)("em",{parentName:"li"},"TrialBatch instance")," - The batch to train on. This will be used to identify the trials that are part of the batch and retrieve only the samples from these trials."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"sampler_callback"),": ",(0,i.kt)("em",{parentName:"li"},"async func(cogment.DatastoreSample, cogment.TrialParameters, cogment.ModelRegistry) -> bool")," - This ",(0,i.kt)("a",{parentName:"li",href:"#callbacks"},"Callbacks")," function will be called for every sample in the batch."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_names"),": ",(0,i.kt)("em",{parentName:"li"},"list","[str]")," - Names of actors to include in the samples. If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", all actors will be included."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"max_trial_wait"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - Maximum number of seconds to wait for new trials to be started by the batch. Since this depends on the running time of trials, this should be longer than the expected max trial duration. If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", then 86400 seconds (24 hours) will be used.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"BatchTrainer instance")," - An instance of the ",(0,i.kt)("inlineCode",{parentName:"p"},"BatchTrainer")," class."),(0,i.kt)("h3",{id:"async-run_simple_trial_trainingself-batch-trial_callback-actor_namesnone-max_trial_waitnone"},(0,i.kt)("inlineCode",{parentName:"h3"},"async run_simple_trial_training(self, batch, trial_callback, actor_names=None, max_trial_wait=None)")),(0,i.kt)("p",null,"Method to start training on a batch of trials."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"batch"),": ",(0,i.kt)("em",{parentName:"li"},"TrialBatch instance")," - The batch to train on. This will be used to identify the trials that are part of the batch and retrieve only the samples from these trials."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_callback"),": ",(0,i.kt)("em",{parentName:"li"},"async func(cogment.DatastoreSample, cogment.TrialParameters, cogment.ModelRegistry) -> bool")," - This ",(0,i.kt)("a",{parentName:"li",href:"#callbacks"},"Callbacks")," function will be called for every trial in the batch."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_names"),": ",(0,i.kt)("em",{parentName:"li"},"list","[str]")," - Names of actors to include in the samples. If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", all actors will be included."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"max_trial_wait"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - Maximum number of seconds to wait for new trials to be started by the batch. Since this depends on the running time of trials, this should be longer than the expected max trial duration. If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", then 86400 seconds (24 hours) will be used.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"BatchTrainer instance")," - An instance of the ",(0,i.kt)("inlineCode",{parentName:"p"},"BatchTrainer")," class."),(0,i.kt)("h2",{id:"class-trialbatch"},"class TrialBatch"),(0,i.kt)("p",null,"Class to run a batch of related trials."),(0,i.kt)("h3",{id:"initself-id-controller-nb_trials-pre_trial_callback-post_trial_callback-datalog_endpoint"},(0,i.kt)("strong",{parentName:"h3"},"init"),"(self, id, controller, nb_trials, pre_trial_callback, post_trial_callback, datalog_endpoint)"),(0,i.kt)("p",null,"The parameters are the same as provided to ",(0,i.kt)("a",{parentName:"p",href:"#class-cogment_enterpriserunnertrialrunner"},(0,i.kt)("inlineCode",{parentName:"a"},"run_simple_batch")),"."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"id"),": ",(0,i.kt)("em",{parentName:"li"},"str")," - ID of the batch. This will be added to the properties of the trials that are started by the batch. This should be unique in the Datastore, otherwise there could be a clash of trial IDs (a mix of trials from different batches could also be used by the ",(0,i.kt)("inlineCode",{parentName:"li"},"BatchTrainer"),"). If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", an ID will be chosen by the system."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"controller"),": ",(0,i.kt)("em",{parentName:"li"},"cogment.Controller instance")," - Controller used to start trials."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"nb_trials"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - Number of trials to run."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"pre_trial_callback"),": ",(0,i.kt)("em",{parentName:"li"},"async func(BatchTrialInfo instance) -> cogment.TrialParameters")," - This ",(0,i.kt)("a",{parentName:"li",href:"#callbacks"},"Callbacks")," function will be called before any new trial is started. If None, then the parameters for the trials will come from the Orchestrator defaults and pre-trial hooks (see Cogment Orchestrator documentation). In which case the ",(0,i.kt)("inlineCode",{parentName:"li"},"BatchTrainer")," cannot work with this batch (because the necessary trial properties cannot be set)."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"post_trial_callback"),": ",(0,i.kt)("em",{parentName:"li"},"async func(sample, trial_parameters, model_registry)")," - This ",(0,i.kt)("a",{parentName:"li",href:"#callbacks"},"Callbacks")," function will be called after the end of a trial. If None, then no call will happen at the end of trials."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"datalog_endpoint"),": ",(0,i.kt)("em",{parentName:"li"},"cogment.Endpoint instance")," - Details of the connection to the Datalog that will be set for the trials.")),(0,i.kt)("h3",{id:"start_trialsself-nb_trials"},(0,i.kt)("inlineCode",{parentName:"h3"},"start_trials(self, nb_trials)")),(0,i.kt)("p",null,"Method to start the batch. At least one trial must be started for the batch to run."),(0,i.kt)("p",null,"This will start the trials in parallel. The batch will maintain active the number of trials started by this method by starting a new trial when one ends."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"nb_trials"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - Number of trials to start that will be running in parallel. Any new calls of this method on a running batch will just add to the number of trials running in parallel.")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"pauseself"},(0,i.kt)("inlineCode",{parentName:"h3"},"pause(self)")),(0,i.kt)("p",null,"Method to pause the running of the batch. It stops any new trial from starting, but does not stop currently running trials. Even if all running trials end, the batch is not considered done until it is resumed, stopped or terminated."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"resumeself"},(0,i.kt)("inlineCode",{parentName:"h3"},"resume(self)")),(0,i.kt)("p",null,"Method to restart a batch that was ",(0,i.kt)("a",{parentName:"p",href:"#pauseself"},"paused"),". It resumes the starting of new trials in the batch."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"stopself"},(0,i.kt)("inlineCode",{parentName:"h3"},"stop(self)")),(0,i.kt)("p",null,"Method to stop the batch. It stops new trials from starting, and currently running trials continue to their normal end. Once all trials have ended, the batch is done."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"terminateself-hardfalse"},(0,i.kt)("inlineCode",{parentName:"h3"},"terminate(self, hard=False)")),(0,i.kt)("p",null,"Method to terminate the batch. It stops new trials from starting, and currently running trials are terminated. The batch is then considered done."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"hard"),": ",(0,i.kt)("em",{parentName:"li"},"bool"),' - If True the trials are sent a "hard" terminate, otherwise they are sent a "soft" terminate (see Python Documentation "Controller.terminate_trial").')),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"is_runningself"},(0,i.kt)("inlineCode",{parentName:"h3"},"is_running(self)")),(0,i.kt)("p",null,"Method to inquire whether the batch is done or not."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the batch is still running. I.e. there are still trials running or it is paused. False otherwise."),(0,i.kt)("h3",{id:"nb_trials_runself"},(0,i.kt)("inlineCode",{parentName:"h3"},"nb_trials_run(self)")),(0,i.kt)("p",null,"Method to inquire the number of trials run so far."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"int")," - Number of trials that were run (and ended) so far in the batch."),(0,i.kt)("h3",{id:"async-waitself-timeout"},(0,i.kt)("inlineCode",{parentName:"h3"},"async wait(self, timeout)")),(0,i.kt)("p",null,"Method to wait for the batch to be done. The batch will end normally when all trials have run and ended. The batch can also be stopped, terminated, or encounter an error to become done."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"timeout"),": ",(0,i.kt)("em",{parentName:"li"},"float")," - Maximum time to wait in seconds.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the batch ended normally with the last trial tagged as such. False otherwise. ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," if timed out."),(0,i.kt)("h2",{id:"class-batchtrainer"},"class BatchTrainer"),(0,i.kt)("p",null,"Class to help train a model on a specific batch of trials."),(0,i.kt)("h3",{id:"__init__self-batch_spec-datastore-model_registry-trial_callback-max_trial_wait"},(0,i.kt)("inlineCode",{parentName:"h3"},"__init__(self, batch_spec, datastore, model_registry, trial_callback, max_trial_wait)")),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"batch_spec"),": ",(0,i.kt)("em",{parentName:"li"},"str")," or ",(0,i.kt)("em",{parentName:"li"},"dict{str:str}")," or ",(0,i.kt)("em",{parentName:"li"},"list","[str]")," or ",(0,i.kt)("em",{parentName:"li"},"TrialBatch instance")," - If a string, it represents a batch ID of the trials to use for training. If a dictionary, it represents the properties of the trials to use for training. If a list, it represents the list of trial IDs to use for training. If an instance of ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialBatch"),", then the trials started by that batch will be used for training. For anything other than a ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialBatch")," instance, there is no reliable way to know if an ongoing batch has ended, therefore the trainer will have to manually be stopped or use ",(0,i.kt)("inlineCode",{parentName:"li"},"max_trial_wait")," to stop automatically."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"datastore"),": ",(0,i.kt)("em",{parentName:"li"},"cogment.Datastore instance")," - The datastore used to retrieve the samples."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_registry"),": ",(0,i.kt)("em",{parentName:"li"},"cogment.ModelRegistry instance")," - The registry that will be passed to the callbacks."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_callback"),": same parameter as provided to ",(0,i.kt)("a",{parentName:"li",href:"#async-run_simple_trainingself-batch-trial_callback-actor_names"},(0,i.kt)("inlineCode",{parentName:"a"},"run_simple_training")),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"max_trial_wait"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - Maximum number of seconds to wait for a new trial. If ",(0,i.kt)("inlineCode",{parentName:"li"},"batch_spec")," is an instance of ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialBatch")," then this wait is for new trials to be started by the batch. Otherwise, this wait if for trials that match ",(0,i.kt)("inlineCode",{parentName:"li"},"batch_spec")," to appear in the datastore (If set to 0, then only trials already in the datastore will be used).")),(0,i.kt)("h3",{id:"startself-actor_names-actor_classes-actor_implementations-fields"},(0,i.kt)("inlineCode",{parentName:"h3"},"start(self, actor_names=[], actor_classes=[], actor_implementations=[], fields=[])")),(0,i.kt)("p",null,"Method to start training."),(0,i.kt)("p",null,"Parameters: Same as ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.Datastore.all_samples")," of the same name. These parameters will be passed as-is to the datastore ",(0,i.kt)("inlineCode",{parentName:"p"},"all_sample")," method."),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"terminateself"},(0,i.kt)("inlineCode",{parentName:"h3"},"terminate(self)")),(0,i.kt)("p",null,"Method to terminate training.\nThe callback tasks will be cancelled."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"async-stopself"},(0,i.kt)("inlineCode",{parentName:"h3"},"async stop(self)")),(0,i.kt)("p",null,"Method to stop training.\nStops retrieving trials from the Datastore.\nAll trials already started will continue training."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h3",{id:"is_runningself-1"},(0,i.kt)("inlineCode",{parentName:"h3"},"is_running(self)")),(0,i.kt)("p",null,"Method to inquire whether the training is done or not."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - True if the training is still running. The training has stopped running when no more samples are being retrieved and all callbacks have returned."),(0,i.kt)("h3",{id:"async-waitself-timeout-1"},(0,i.kt)("inlineCode",{parentName:"h3"},"async wait(self, timeout)")),(0,i.kt)("p",null,"Method to wait for the training to be done.\nThe training will end normally when all trials of the batch have started processing and all callbacks have returned.\nThe training can also be stopped, or encounter an error to become done."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"timeout"),": ",(0,i.kt)("em",{parentName:"li"},"float")," - Maximum time to wait in seconds.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"bool")," - False if timed out, True otherwise. If True, then ",(0,i.kt)("inlineCode",{parentName:"p"},"is_running")," will also return True."),(0,i.kt)("h3",{id:"set_nb_parallel_trialsself-nb_trials"},(0,i.kt)("inlineCode",{parentName:"h3"},"set_nb_parallel_trials(self, nb_trials)")),(0,i.kt)("p",null,"Method to set the number of trials to train in parallel."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"nb_trials"),": ",(0,i.kt)("em",{parentName:"li"},"int")," - Number of trials to train in parallel (>0). If ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", no limit will be enforced and all batch trial data will be processed as it becomes available. Default is 1 (i.e. no parallelism, only one trial at a time).")),(0,i.kt)("p",null,"Return: None"),(0,i.kt)("h2",{id:"class-batchtrialinfo"},"class BatchTrialInfo"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"batch_id"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - ID of the batch"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trial_index"),": ",(0,i.kt)("em",{parentName:"p"},"int")," - The index of the trial in the batch. Generally the order the trials were started, and unique in the batch (",(0,i.kt)("inlineCode",{parentName:"p"},"[0, nb_trials["),")."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trial_info"),": ",(0,i.kt)("em",{parentName:"p"},"cogment.DatastoreTrialInfo")," - The running trial information. May not always be present."),(0,i.kt)("h2",{id:"class-trainertrialsession"},"class TrainerTrialSession"),(0,i.kt)("p",null,"Class to help train a model on a specific batch of trials."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trial_id"),": ",(0,i.kt)("em",{parentName:"p"},"str")," - ID of the trial."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"parameters"),": ",(0,i.kt)("em",{parentName:"p"},"cogment.TrialParameters instance")," - Parameters of the trial."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"model_registry"),": ",(0,i.kt)("em",{parentName:"p"},"cogment.ModelRegistry instance")," - Common model registry for the whole batch being trained. The TrialRunner argument ",(0,i.kt)("inlineCode",{parentName:"p"},"model_registry_endpoint")," is used to retrieve this model registry."),(0,i.kt)("h3",{id:"async-all_samplesself"},(0,i.kt)("inlineCode",{parentName:"h3"},"async all_samples(self)")),(0,i.kt)("p",null,"Method to retrieve all samples from the trial."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(cogment.DatastoreSample instance)")," - A generator for the trial samples that arrive."),(0,i.kt)("h2",{id:"callbacks"},"Callbacks"),(0,i.kt)("h3",{id:"use"},"Use"),(0,i.kt)("p",null,"These functions are passed to the ",(0,i.kt)("a",{parentName:"p",href:"#class-cogment_enterpriserunnertrialrunner"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialRunner.run_simple_batch"))," or ",(0,i.kt)("a",{parentName:"p",href:"#async-run_simple_trainingself-batch-sampler_callback-actor_names"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialRunner.run_simple_training"))," methods and will be called at specific times to request information to the user or provide information to the user.\nThey can be defined and used in a number of ways."),(0,i.kt)("p",null,"Here we take the ",(0,i.kt)("inlineCode",{parentName:"p"},"pre_trial_callback")," as an example, but the other callbacks are similar, except for parameters and return values:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"async def my_pre_trial_callback(info: BatchTrialInfo):\n trial_params = cogment.TrialParameters()\n # ... Fill in the parameters here\n return trial_params\n\nrunner = TrialRunner(1, 1, None, my_pre_trial_callback)\n")),(0,i.kt)("p",null,"Sometimes it is more convenient for the callback to be a method of a class in order to re-use data between calls, or share data with other parts of the program (or other callbacks), in this case it could look like this:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"class MyBatchData:\n async def my_pre_trial_callback(self, info: BatchTrialInfo):\n trial_params = cogment.TrialParameters()\n # ... Fill in the parameters here\n return trial_params\n\nmy_data = MyBatchData()\nrunner = TrialRunner(1, 1, None, my_data.my_pre_trial_callback)\n")),(0,i.kt)("p",null,"Although rare, it may be inconvenient sometimes to use a class for sharing data, in which case the Python ",(0,i.kt)("inlineCode",{parentName:"p"},"functools")," module can be used:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"import functools\n\nasync def my_function(my_data, info: BatchTrialInfo):\n trial_params = cogment.TrialParameters()\n # ... Fill in the parameters here\n return trial_params\n\nshared_data = #...\nactual_callback = functools.partial(my_function, shared_data)\nrunner = TrialRunner(1, 1, None, actual_callback)\n")),(0,i.kt)("h3",{id:"pre-trial-callback"},"Pre-Trial Callback"),(0,i.kt)("p",null,"This function is passed to the ",(0,i.kt)("a",{parentName:"p",href:"#class-cogment_enterpriserunnertrialrunner"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialRunner.run_simple_batch"))," method and will be called before any trial is started to define the trial parameters.\nIt is an ",(0,i.kt)("inlineCode",{parentName:"p"},"asyncio")," coroutine."),(0,i.kt)("p",null,"e.g.:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"async def my_pre_trial_callback(info: BatchTrialInfo) -> cogment.TrialParameters:\n trial_params = cogment.TrialParameters()\n # ... Fill in the parameters here\n return trial_params\n")),(0,i.kt)("p",null,"Parameters Received:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"info"),": ",(0,i.kt)("em",{parentName:"li"},"BatchTrialInfo instance")," - Partially filled info of the trial to start; it does not contain ",(0,i.kt)("inlineCode",{parentName:"li"},"trial_info"),".")),(0,i.kt)("p",null,"Expected Return: ",(0,i.kt)("em",{parentName:"p"},"None or tuple(str, cogment.TrialParameters instance)")," - The first item of the tuple is the requested trial ID. If the trial ID is ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),", it will be automatically created using the batch ID and the trial index. The second item of the tuple is the trial parameters that must be fully populated to start the new trial. If the return value is ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," (instead of a tuple), the trial will not start and the batch will stop (i.e. not start any new trial, but ongoing trials will continue)."),(0,i.kt)("p",null,"In case of exceptions: Exceptions raised by the callback will do the same as if ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," was returned."),(0,i.kt)("p",null,"Once the parameters are received by the ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialBatch"),", some data will be added, and some will be overwritten before starting the trial.\nThese are the ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialParameters")," attributes changed:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"properties"),": Some properties will be added to the existing properties (see ",(0,i.kt)("a",{parentName:"li",href:"#module-attributes"},"Module Attributes"),"). If the property names clash, the user properties will be overwritten. In general, do not start property names with an underscore to prevent such clashes."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"datalog_endpoint"),": This attribute of the trial parameters will be overwritten. If the ",(0,i.kt)("inlineCode",{parentName:"li"},"datastore_endpoint")," argument of ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialRunner")," is provided, it will be used. If ",(0,i.kt)("inlineCode",{parentName:"li"},"datastore_endpoint")," was not provided, or it was ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", then the directory will be used to find an appropriate datalog/datastore. The same datastore must be used by both the ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialBatch")," (as a datalog) and ",(0,i.kt)("inlineCode",{parentName:"li"},"BatchTrainer")," (as a datastore), so the endpoint should resolve to the same datastore locally and at the Orchestrator (i.e. ideally use the same directory)."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"datalog_exclude_fields"),": This attribute will be reset (i.e. not excluding any fields from the datalog).")),(0,i.kt)("h3",{id:"post-trial-callback"},"Post-Trial Callback"),(0,i.kt)("p",null,"This function is passed to the ",(0,i.kt)("a",{parentName:"p",href:"#class-cogment_enterpriserunnertrialrunner"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialRunner.run_simple_batch"))," method and will be called after a trial has ended normally (i.e. was not terminated).\nIt is an ",(0,i.kt)("inlineCode",{parentName:"p"},"asyncio")," coroutine."),(0,i.kt)("p",null,"e.g.:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"async def my_post_trial_callback(info):\n # ... Do cleanup, tracking, etc\n")),(0,i.kt)("p",null,"Parameters Received:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"info"),": ",(0,i.kt)("em",{parentName:"li"},"BatchTrialInfo instance")," - The full info of the trial that ended.")),(0,i.kt)("p",null,"Expected Return: None"),(0,i.kt)("p",null,"In case of exceptions: All exceptions raised by the callback will be ignored."),(0,i.kt)("h3",{id:"sampler-callback"},"Sampler Callback"),(0,i.kt)("p",null,"This function is passed to the ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialRunner.run_simple_trainer")," method and will be called for each sample of the trials being run in the batch.\nThis is asynchronous with the actual running of the trials and uses the Cogment Datastore to retrieve the samples.\nIt is an ",(0,i.kt)("inlineCode",{parentName:"p"},"asyncio")," coroutine."),(0,i.kt)("p",null,"e.g.:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"async def my_sampler_callback(sample, trial_parameters, model_registry):\n # ... Train model\n")),(0,i.kt)("p",null,"Parameters Received:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"sample"),": ",(0,i.kt)("em",{parentName:"li"},"cogment.DatastoreSample instance")," - Trial sample received."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_parameters"),": ",(0,i.kt)("em",{parentName:"li"},"cogment.TrialParameters instance")," - Parameters of the trial from which the sample came from."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_registry"),": ",(0,i.kt)("em",{parentName:"li"},"cogment.ModelRegistry instance")," - Common model registry for the whole batch being trained. The TrialRunner argument ",(0,i.kt)("inlineCode",{parentName:"li"},"model_registry_endpoint")," is used to retrieve this model registry.")),(0,i.kt)("p",null,"Expected Return: ",(0,i.kt)("em",{parentName:"p"},"None or bool")," - If ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," or True, the training will continue normally. If a bool and False, the sampler callback will stop being called, and the ",(0,i.kt)("inlineCode",{parentName:"p"},"BatchTrainer")," will stop."),(0,i.kt)("p",null,"In case of exceptions: If the callback raises an exception, the ",(0,i.kt)("inlineCode",{parentName:"p"},"BatchTrainer")," will stop at the next sample."),(0,i.kt)("h3",{id:"trial-callback"},"Trial Callback"),(0,i.kt)("p",null,"This function is passed to the ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialRunner.run_simple_trial_trainer")," method and will be called for each trial of the batch.\nThis is asynchronous with the actual running of the trials and uses the Cogment Datastore to retrieve the trial data and samples.\nIt is an ",(0,i.kt)("inlineCode",{parentName:"p"},"asyncio")," coroutine."),(0,i.kt)("p",null,"e.g.:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"async def my_trial_callback(session):\n async for sample in session.all_samples():\n # ... process sample\n")),(0,i.kt)("p",null,"Parameters Received:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"session"),": ",(0,i.kt)("em",{parentName:"li"},"TrainerTrialSession instance")," - The session for the trial.")),(0,i.kt)("p",null,"Expected Return: ",(0,i.kt)("em",{parentName:"p"},"None or bool")," - If ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," or True, continue processing the batch. If a bool and False, stop the ",(0,i.kt)("inlineCode",{parentName:"p"},"BatchTrainer"),"."),(0,i.kt)("p",null,"In case of exceptions: If the callback raises an exception, the ",(0,i.kt)("inlineCode",{parentName:"p"},"BatchTrainer")," will stop immediately."))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/6780.2e464230.js b/assets/js/6780.2e464230.js deleted file mode 100644 index c7bc693..0000000 --- a/assets/js/6780.2e464230.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[6780],{6780:(e,t,r)=>{function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t,r){var a,c=t.initialState;return{getState:function(){return c},dispatch:function(a,i){var l=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},c);c=e(c,{type:a,props:t,payload:i}),r({state:c,prevState:l})},pendingRequests:(a=[],{add:function(e){return a.push(e),e.finally((function(){a=a.filter((function(t){return t!==e}))}))},cancelAll:function(){a.forEach((function(e){return e.cancel()}))},isEmpty:function(){return 0===a.length}})}}function c(e){return e.reduce((function(e,t){return e.concat(t)}),[])}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e){return 0===e.collections.length?0:e.collections.reduce((function(e,t){return e+t.items.length}),0)}r.r(t),r.d(t,{DocSearchModal:()=>Dr});var f=0;var m=function(){};function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h(e,t){var r=[];return Promise.resolve(e(t)).then((function(e){return Array.isArray(e),Promise.all(e.filter((function(e){return Boolean(e)})).map((function(e){if(e.sourceId,r.includes(e.sourceId))throw new Error("[Autocomplete] The `sourceId` ".concat(JSON.stringify(e.sourceId)," is not unique."));r.push(e.sourceId);var t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({getItemInputValue:function(e){return e.state.query},getItemUrl:function(){},onSelect:function(e){(0,e.setIsOpen)(!1)},onActive:m},e);return Promise.resolve(t)})))}))}function v(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return y(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){O(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function O(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach((function(t){j(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function j(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function P(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){I(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function I(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D(e){return function(e){if(Array.isArray(e))return C(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return C(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return C(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function x(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function N(e){return Boolean(e.execute)}function R(e,t){return r=e,Boolean(null==r?void 0:r.execute)?A(A({},e),{},{requests:e.queries.map((function(r){return{query:r,sourceId:t,transformResponse:e.transformResponse}}))}):{items:e,sourceId:t};var r}function _(e){var t=e.reduce((function(e,t){if(!N(t))return e.push(t),e;var r=t.searchClient,n=t.execute,o=t.requesterId,a=t.requests,c=e.find((function(e){return N(t)&&N(e)&&e.searchClient===r&&Boolean(o)&&e.requesterId===o}));if(c){var i;(i=c.items).push.apply(i,D(a))}else{var l={execute:n,requesterId:o,items:a,searchClient:r};e.push(l)}return e}),[]).map((function(e){if(!N(e))return Promise.resolve(e);var t=e,r=t.execute,n=t.items;return r({searchClient:t.searchClient,requests:n})}));return Promise.all(t).then((function(e){return c(e)}))}function q(e,t){return t.map((function(t){var r=e.filter((function(e){return e.sourceId===t.sourceId})),n=r.map((function(e){return e.items})),o=r[0].transformResponse,a=o?o(function(e){var t=e.map((function(e){var t;return P(P({},e),{},{hits:null===(t=e.hits)||void 0===t?void 0:t.map((function(t){return P(P({},t),{},{__autocomplete_indexName:e.index,__autocomplete_queryID:e.queryID})}))})}));return{results:t,hits:t.map((function(e){return e.hits})).filter(Boolean),facetHits:t.map((function(e){var t;return null===(t=e.facetHits)||void 0===t?void 0:t.map((function(e){return{label:e.value,count:e.count,_highlightResult:{label:{value:e.highlighted}}}}))})).filter(Boolean)}}(n)):n;return Array.isArray(a),a.every(Boolean),'The `getItems` function from source "'.concat(t.sourceId,'" must return an array of items but returned ').concat(JSON.stringify(void 0),".\n\nDid you forget to return items?\n\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems"),{source:t,items:a}}))}function T(e,t){var r=t;return{then:function(t,n){return T(e.then(H(t,r,e),H(n,r,e)),r)},catch:function(t){return T(e.catch(H(t,r,e)),r)},finally:function(t){return t&&r.onCancelList.push(t),T(e.finally(H(t&&function(){return r.onCancelList=[],t()},r,e)),r)},cancel:function(){r.isCanceled=!0;var e=r.onCancelList;r.onCancelList=[],e.forEach((function(e){e()}))},isCanceled:function(){return!0===r.isCanceled}}}function L(e){return T(new Promise((function(t,r){return e(t,r)})),{isCanceled:!1,onCancelList:[]})}function M(e){return T(e,{isCanceled:!1,onCancelList:[]})}function H(e,t,r){return e?function(r){return t.isCanceled?r:e(r)}:r}function F(e){var t=function(e){var t=e.collections.map((function(e){return e.items.length})).reduce((function(e,t,r){var n=(e[r-1]||0)+t;return e.push(n),e}),[]).reduce((function(t,r){return r<=e.activeItemId?t+1:t}),0);return e.collections[t]}(e);if(!t)return null;var r=t.items[function(e){for(var t=e.state,r=e.collection,n=!1,o=0,a=0;!1===n;){var c=t.collections[o];if(c===r){n=!0;break}a+=c.items.length,o++}return t.activeItemId-a}({state:e,collection:t})],n=t.source;return{item:r,itemInputValue:n.getItemInputValue({item:r,state:e}),itemUrl:n.getItemUrl({item:r,state:e}),source:n}}L.resolve=function(e){return M(Promise.resolve(e))},L.reject=function(e){return M(Promise.reject(e))};var U=["event","nextState","props","query","refresh","store"];function B(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function V(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?B(Object(r),!0).forEach((function(t){K(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function K(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function J(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var $,z,W,Q=null,Z=($=-1,z=-1,W=void 0,function(e){var t=++$;return Promise.resolve(e).then((function(e){return W&&t<z?W:(z=t,W=e,e)}))});function Y(e){var t=e.event,r=e.nextState,n=void 0===r?{}:r,o=e.props,a=e.query,i=e.refresh,l=e.store,s=J(e,U);Q&&o.environment.clearTimeout(Q);var u=s.setCollections,f=s.setIsOpen,m=s.setQuery,p=s.setActiveItemId,d=s.setStatus;if(m(a),p(o.defaultActiveItemId),!a&&!1===o.openOnFocus){var h,v=l.getState().collections.map((function(e){return V(V({},e),{},{items:[]})}));d("idle"),u(v),f(null!==(h=n.isOpen)&&void 0!==h?h:o.shouldPanelOpen({state:l.getState()}));var y=M(Z(v).then((function(){return Promise.resolve()})));return l.pendingRequests.add(y)}d("loading"),Q=o.environment.setTimeout((function(){d("stalled")}),o.stallThreshold);var g=M(Z(o.getSources(V({query:a,refresh:i,state:l.getState()},s)).then((function(e){return Promise.all(e.map((function(e){return Promise.resolve(e.getItems(V({query:a,refresh:i,state:l.getState()},s))).then((function(t){return R(t,e.sourceId)}))}))).then(_).then((function(t){return q(t,e)})).then((function(e){return function(e){var t=e.collections,r=e.props,n=e.state,o=t.reduce((function(e,t){return E(E({},e),{},j({},t.source.sourceId,E(E({},t.source),{},{getItems:function(){return c(t.items)}})))}),{});return c(r.reshape({sources:Object.values(o),sourcesBySourceId:o,state:n})).filter(Boolean).map((function(e){return{source:e,items:e.getItems()}}))}({collections:e,props:o,state:l.getState()})}))})))).then((function(e){var r;d("idle"),u(e);var c=o.shouldPanelOpen({state:l.getState()});f(null!==(r=n.isOpen)&&void 0!==r?r:o.openOnFocus&&!a&&c||c);var m=F(l.getState());if(null!==l.getState().activeItemId&&m){var p=m.item,h=m.itemInputValue,v=m.itemUrl,y=m.source;y.onActive(V({event:t,item:p,itemInputValue:h,itemUrl:v,refresh:i,source:y,state:l.getState()},s))}})).finally((function(){d("idle"),Q&&o.environment.clearTimeout(Q)}));return l.pendingRequests.add(g)}var G=["event","props","refresh","store"];function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ee(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?X(Object(r),!0).forEach((function(t){te(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function te(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function re(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var ne=/((gt|sm)-|galaxy nexus)|samsung[- ]/i;var oe=["props","refresh","store"],ae=["inputElement","formElement","panelElement"],ce=["inputElement"],ie=["inputElement","maxLength"],le=["item","source"];function se(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?se(Object(r),!0).forEach((function(t){fe(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):se(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function fe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function me(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function pe(e){var t=e.props,r=e.refresh,n=e.store,o=me(e,oe);return{getEnvironmentProps:function(e){var r=e.inputElement,o=e.formElement,a=e.panelElement;function c(e){!n.getState().isOpen&&n.pendingRequests.isEmpty()||e.target===r||!1===[o,a].some((function(t){return r=t,n=e.target,r===n||r.contains(n);var r,n}))&&(n.dispatch("blur",null),t.debug||n.pendingRequests.cancelAll())}return ue({onTouchStart:c,onMouseDown:c,onTouchMove:function(e){!1!==n.getState().isOpen&&r===t.environment.document.activeElement&&e.target!==r&&r.blur()}},me(e,ae))},getRootProps:function(e){return ue({role:"combobox","aria-expanded":n.getState().isOpen,"aria-haspopup":"listbox","aria-owns":n.getState().isOpen?"".concat(t.id,"-list"):void 0,"aria-labelledby":"".concat(t.id,"-label")},e)},getFormProps:function(e){e.inputElement;return ue({action:"",noValidate:!0,role:"search",onSubmit:function(a){var c;a.preventDefault(),t.onSubmit(ue({event:a,refresh:r,state:n.getState()},o)),n.dispatch("submit",null),null===(c=e.inputElement)||void 0===c||c.blur()},onReset:function(a){var c;a.preventDefault(),t.onReset(ue({event:a,refresh:r,state:n.getState()},o)),n.dispatch("reset",null),null===(c=e.inputElement)||void 0===c||c.focus()}},me(e,ce))},getLabelProps:function(e){return ue({htmlFor:"".concat(t.id,"-input"),id:"".concat(t.id,"-label")},e)},getInputProps:function(e){var a;function c(e){(t.openOnFocus||Boolean(n.getState().query))&&Y(ue({event:e,props:t,query:n.getState().completion||n.getState().query,refresh:r,store:n},o)),n.dispatch("focus",null)}var i=e||{},l=(i.inputElement,i.maxLength),s=void 0===l?512:l,u=me(i,ie),f=F(n.getState()),p=function(e){return Boolean(e&&e.match(ne))}((null===(a=t.environment.navigator)||void 0===a?void 0:a.userAgent)||""),d=null!=f&&f.itemUrl&&!p?"go":"search";return ue({"aria-autocomplete":"both","aria-activedescendant":n.getState().isOpen&&null!==n.getState().activeItemId?"".concat(t.id,"-item-").concat(n.getState().activeItemId):void 0,"aria-controls":n.getState().isOpen?"".concat(t.id,"-list"):void 0,"aria-labelledby":"".concat(t.id,"-label"),value:n.getState().completion||n.getState().query,id:"".concat(t.id,"-input"),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",enterKeyHint:d,spellCheck:"false",autoFocus:t.autoFocus,placeholder:t.placeholder,maxLength:s,type:"search",onChange:function(e){Y(ue({event:e,props:t,query:e.currentTarget.value.slice(0,s),refresh:r,store:n},o))},onKeyDown:function(e){!function(e){var t=e.event,r=e.props,n=e.refresh,o=e.store,a=re(e,G);if("ArrowUp"===t.key||"ArrowDown"===t.key){var c=function(){var e=r.environment.document.getElementById("".concat(r.id,"-item-").concat(o.getState().activeItemId));e&&(e.scrollIntoViewIfNeeded?e.scrollIntoViewIfNeeded(!1):e.scrollIntoView(!1))},i=function(){var e=F(o.getState());if(null!==o.getState().activeItemId&&e){var r=e.item,c=e.itemInputValue,i=e.itemUrl,l=e.source;l.onActive(ee({event:t,item:r,itemInputValue:c,itemUrl:i,refresh:n,source:l,state:o.getState()},a))}};t.preventDefault(),!1===o.getState().isOpen&&(r.openOnFocus||Boolean(o.getState().query))?Y(ee({event:t,props:r,query:o.getState().query,refresh:n,store:o},a)).then((function(){o.dispatch(t.key,{nextActiveItemId:r.defaultActiveItemId}),i(),setTimeout(c,0)})):(o.dispatch(t.key,{}),i(),c())}else if("Escape"===t.key)t.preventDefault(),o.dispatch(t.key,null),o.pendingRequests.cancelAll();else if("Tab"===t.key)o.dispatch("blur",null),o.pendingRequests.cancelAll();else if("Enter"===t.key){if(null===o.getState().activeItemId||o.getState().collections.every((function(e){return 0===e.items.length})))return void(r.debug||o.pendingRequests.cancelAll());t.preventDefault();var l=F(o.getState()),s=l.item,u=l.itemInputValue,f=l.itemUrl,m=l.source;if(t.metaKey||t.ctrlKey)void 0!==f&&(m.onSelect(ee({event:t,item:s,itemInputValue:u,itemUrl:f,refresh:n,source:m,state:o.getState()},a)),r.navigator.navigateNewTab({itemUrl:f,item:s,state:o.getState()}));else if(t.shiftKey)void 0!==f&&(m.onSelect(ee({event:t,item:s,itemInputValue:u,itemUrl:f,refresh:n,source:m,state:o.getState()},a)),r.navigator.navigateNewWindow({itemUrl:f,item:s,state:o.getState()}));else if(t.altKey);else{if(void 0!==f)return m.onSelect(ee({event:t,item:s,itemInputValue:u,itemUrl:f,refresh:n,source:m,state:o.getState()},a)),void r.navigator.navigate({itemUrl:f,item:s,state:o.getState()});Y(ee({event:t,nextState:{isOpen:!1},props:r,query:u,refresh:n,store:o},a)).then((function(){m.onSelect(ee({event:t,item:s,itemInputValue:u,itemUrl:f,refresh:n,source:m,state:o.getState()},a))}))}}}(ue({event:e,props:t,refresh:r,store:n},o))},onFocus:c,onBlur:m,onClick:function(r){e.inputElement!==t.environment.document.activeElement||n.getState().isOpen||c(r)}},u)},getPanelProps:function(e){return ue({onMouseDown:function(e){e.preventDefault()},onMouseLeave:function(){n.dispatch("mouseleave",null)}},e)},getListProps:function(e){return ue({role:"listbox","aria-labelledby":"".concat(t.id,"-label"),id:"".concat(t.id,"-list")},e)},getItemProps:function(e){var a=e.item,c=e.source,i=me(e,le);return ue({id:"".concat(t.id,"-item-").concat(a.__autocomplete_id),role:"option","aria-selected":n.getState().activeItemId===a.__autocomplete_id,onMouseMove:function(e){if(a.__autocomplete_id!==n.getState().activeItemId){n.dispatch("mousemove",a.__autocomplete_id);var t=F(n.getState());if(null!==n.getState().activeItemId&&t){var c=t.item,i=t.itemInputValue,l=t.itemUrl,s=t.source;s.onActive(ue({event:e,item:c,itemInputValue:i,itemUrl:l,refresh:r,source:s,state:n.getState()},o))}}},onMouseDown:function(e){e.preventDefault()},onClick:function(e){var i=c.getItemInputValue({item:a,state:n.getState()}),l=c.getItemUrl({item:a,state:n.getState()});(l?Promise.resolve():Y(ue({event:e,nextState:{isOpen:!1},props:t,query:i,refresh:r,store:n},o))).then((function(){c.onSelect(ue({event:e,item:a,itemInputValue:i,itemUrl:l,refresh:r,source:c,state:n.getState()},o))}))}},i)}}}var de=[{segment:"autocomplete-core",version:"1.7.4"}];function he(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ve(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?he(Object(r),!0).forEach((function(t){ye(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):he(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ye(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ge(e){var t,r,n,o,a=e.plugins,c=e.options,i=null===(t=((null===(r=c.__autocomplete_metadata)||void 0===r?void 0:r.userAgents)||[])[0])||void 0===t?void 0:t.segment,l=i?ye({},i,Object.keys((null===(n=c.__autocomplete_metadata)||void 0===n?void 0:n.options)||{})):{};return{plugins:a.map((function(e){return{name:e.name,options:Object.keys(e.__autocomplete_pluginOptions||[])}})),options:ve({"autocomplete-core":Object.keys(c)},l),ua:de.concat((null===(o=c.__autocomplete_metadata)||void 0===o?void 0:o.userAgents)||[])}}function be(e){var t,r=e.state;return!1===r.isOpen||null===r.activeItemId?null:(null===(t=F(r))||void 0===t?void 0:t.itemInputValue)||null}function Oe(e,t,r,n){if(!r)return null;if(e<0&&(null===t||null!==n&&0===t))return r+e;var o=(null===t?-1:t)+e;return o<=-1||o>=r?null===n?null:0:o}function Se(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ee(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Se(Object(r),!0).forEach((function(t){je(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Se(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function je(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var we=function(e,t){switch(t.type){case"setActiveItemId":case"mousemove":return Ee(Ee({},e),{},{activeItemId:t.payload});case"setQuery":return Ee(Ee({},e),{},{query:t.payload,completion:null});case"setCollections":return Ee(Ee({},e),{},{collections:t.payload});case"setIsOpen":return Ee(Ee({},e),{},{isOpen:t.payload});case"setStatus":return Ee(Ee({},e),{},{status:t.payload});case"setContext":return Ee(Ee({},e),{},{context:Ee(Ee({},e.context),t.payload)});case"ArrowDown":var r=Ee(Ee({},e),{},{activeItemId:t.payload.hasOwnProperty("nextActiveItemId")?t.payload.nextActiveItemId:Oe(1,e.activeItemId,u(e),t.props.defaultActiveItemId)});return Ee(Ee({},r),{},{completion:be({state:r})});case"ArrowUp":var n=Ee(Ee({},e),{},{activeItemId:Oe(-1,e.activeItemId,u(e),t.props.defaultActiveItemId)});return Ee(Ee({},n),{},{completion:be({state:n})});case"Escape":return e.isOpen?Ee(Ee({},e),{},{activeItemId:null,isOpen:!1,completion:null}):Ee(Ee({},e),{},{activeItemId:null,query:"",status:"idle",collections:[]});case"submit":return Ee(Ee({},e),{},{activeItemId:null,isOpen:!1,status:"idle"});case"reset":return Ee(Ee({},e),{},{activeItemId:!0===t.props.openOnFocus?t.props.defaultActiveItemId:null,status:"idle",query:""});case"focus":return Ee(Ee({},e),{},{activeItemId:t.props.defaultActiveItemId,isOpen:(t.props.openOnFocus||Boolean(e.query))&&t.props.shouldPanelOpen({state:e})});case"blur":return t.props.debug?e:Ee(Ee({},e),{},{isOpen:!1,activeItemId:null});case"mouseleave":return Ee(Ee({},e),{},{activeItemId:t.props.defaultActiveItemId});default:return"The reducer action ".concat(JSON.stringify(t.type)," is not supported."),e}};function Pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ie(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(r),!0).forEach((function(t){De(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function De(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ce(e){var t=[],r=function(e,t){var r,n="undefined"!=typeof window?window:{},o=e.plugins||[];return b(b({debug:!1,openOnFocus:!1,placeholder:"",autoFocus:!1,defaultActiveItemId:null,stallThreshold:300,environment:n,shouldPanelOpen:function(e){return u(e.state)>0},reshape:function(e){return e.sources}},e),{},{id:null!==(r=e.id)&&void 0!==r?r:"autocomplete-".concat(f++),plugins:o,initialState:b({activeItemId:null,query:"",completion:null,collections:[],isOpen:!1,status:"idle",context:{}},e.initialState),onStateChange:function(t){var r;null===(r=e.onStateChange)||void 0===r||r.call(e,t),o.forEach((function(e){var r;return null===(r=e.onStateChange)||void 0===r?void 0:r.call(e,t)}))},onSubmit:function(t){var r;null===(r=e.onSubmit)||void 0===r||r.call(e,t),o.forEach((function(e){var r;return null===(r=e.onSubmit)||void 0===r?void 0:r.call(e,t)}))},onReset:function(t){var r;null===(r=e.onReset)||void 0===r||r.call(e,t),o.forEach((function(e){var r;return null===(r=e.onReset)||void 0===r?void 0:r.call(e,t)}))},getSources:function(r){return Promise.all([].concat(v(o.map((function(e){return e.getSources}))),[e.getSources]).filter(Boolean).map((function(e){return h(e,r)}))).then((function(e){return c(e)})).then((function(e){return e.map((function(e){return b(b({},e),{},{onSelect:function(r){e.onSelect(r),t.forEach((function(e){var t;return null===(t=e.onSelect)||void 0===t?void 0:t.call(e,r)}))},onActive:function(r){e.onActive(r),t.forEach((function(e){var t;return null===(t=e.onActive)||void 0===t?void 0:t.call(e,r)}))}})}))}))},navigator:b({navigate:function(e){var t=e.itemUrl;n.location.assign(t)},navigateNewTab:function(e){var t=e.itemUrl,r=n.open(t,"_blank","noopener");null==r||r.focus()},navigateNewWindow:function(e){var t=e.itemUrl;n.open(t,"_blank","noopener")}},e.navigator)})}(e,t),n=a(we,r,(function(e){var t=e.prevState,n=e.state;r.onStateChange(Ie({prevState:t,state:n,refresh:s},o))})),o=function(e){var t=e.store;return{setActiveItemId:function(e){t.dispatch("setActiveItemId",e)},setQuery:function(e){t.dispatch("setQuery",e)},setCollections:function(e){var r=0,n=e.map((function(e){return l(l({},e),{},{items:c(e.items).map((function(e){return l(l({},e),{},{__autocomplete_id:r++})}))})}));t.dispatch("setCollections",n)},setIsOpen:function(e){t.dispatch("setIsOpen",e)},setStatus:function(e){t.dispatch("setStatus",e)},setContext:function(e){t.dispatch("setContext",e)}}}({store:n}),i=pe(Ie({props:r,refresh:s,store:n},o));function s(){return Y(Ie({event:new Event("input"),nextState:{isOpen:n.getState().isOpen},props:r,query:n.getState().query,refresh:s,store:n},o))}return r.plugins.forEach((function(e){var r;return null===(r=e.subscribe)||void 0===r?void 0:r.call(e,Ie(Ie({},o),{},{refresh:s,onSelect:function(e){t.push({onSelect:e})},onActive:function(e){t.push({onActive:e})}}))})),function(e){var t,r,n=e.metadata,o=e.environment;if(null===(t=o.navigator)||void 0===t||null===(r=t.userAgent)||void 0===r?void 0:r.includes("Algolia Crawler")){var a=o.document.createElement("meta"),c=o.document.querySelector("head");a.name="algolia:metadata",setTimeout((function(){a.content=JSON.stringify(n),c.appendChild(a)}),0)}}({metadata:ge({plugins:r.plugins,options:e}),environment:r.environment}),Ie(Ie({refresh:s},i),o)}var ke=r(7294);function Ae(e){var t=e.translations,r=(void 0===t?{}:t).searchByText,n=void 0===r?"Search by":r;return ke.createElement("a",{href:"https://www.algolia.com/ref/docsearch/?utm_source=".concat(window.location.hostname,"&utm_medium=referral&utm_content=powered_by&utm_campaign=docsearch"),target:"_blank",rel:"noopener noreferrer"},ke.createElement("span",{className:"DocSearch-Label"},n),ke.createElement("svg",{width:"77",height:"19","aria-label":"Algolia",role:"img",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2196.2 500"},ke.createElement("defs",null,ke.createElement("style",null,".cls-1,.cls-2{fill:#003dff;}.cls-2{fill-rule:evenodd;}")),ke.createElement("path",{className:"cls-2",d:"M1070.38,275.3V5.91c0-3.63-3.24-6.39-6.82-5.83l-50.46,7.94c-2.87,.45-4.99,2.93-4.99,5.84l.17,273.22c0,12.92,0,92.7,95.97,95.49,3.33,.1,6.09-2.58,6.09-5.91v-40.78c0-2.96-2.19-5.51-5.12-5.84-34.85-4.01-34.85-47.57-34.85-54.72Z"}),ke.createElement("rect",{className:"cls-1",x:"1845.88",y:"104.73",width:"62.58",height:"277.9",rx:"5.9",ry:"5.9"}),ke.createElement("path",{className:"cls-2",d:"M1851.78,71.38h50.77c3.26,0,5.9-2.64,5.9-5.9V5.9c0-3.62-3.24-6.39-6.82-5.83l-50.77,7.95c-2.87,.45-4.99,2.92-4.99,5.83v51.62c0,3.26,2.64,5.9,5.9,5.9Z"}),ke.createElement("path",{className:"cls-2",d:"M1764.03,275.3V5.91c0-3.63-3.24-6.39-6.82-5.83l-50.46,7.94c-2.87,.45-4.99,2.93-4.99,5.84l.17,273.22c0,12.92,0,92.7,95.97,95.49,3.33,.1,6.09-2.58,6.09-5.91v-40.78c0-2.96-2.19-5.51-5.12-5.84-34.85-4.01-34.85-47.57-34.85-54.72Z"}),ke.createElement("path",{className:"cls-2",d:"M1631.95,142.72c-11.14-12.25-24.83-21.65-40.78-28.31-15.92-6.53-33.26-9.85-52.07-9.85-18.78,0-36.15,3.17-51.92,9.85-15.59,6.66-29.29,16.05-40.76,28.31-11.47,12.23-20.38,26.87-26.76,44.03-6.38,17.17-9.24,37.37-9.24,58.36,0,20.99,3.19,36.87,9.55,54.21,6.38,17.32,15.14,32.11,26.45,44.36,11.29,12.23,24.83,21.62,40.6,28.46,15.77,6.83,40.12,10.33,52.4,10.48,12.25,0,36.78-3.82,52.7-10.48,15.92-6.68,29.46-16.23,40.78-28.46,11.29-12.25,20.05-27.04,26.25-44.36,6.22-17.34,9.24-33.22,9.24-54.21,0-20.99-3.34-41.19-10.03-58.36-6.38-17.17-15.14-31.8-26.43-44.03Zm-44.43,163.75c-11.47,15.75-27.56,23.7-48.09,23.7-20.55,0-36.63-7.8-48.1-23.7-11.47-15.75-17.21-34.01-17.21-61.2,0-26.89,5.59-49.14,17.06-64.87,11.45-15.75,27.54-23.52,48.07-23.52,20.55,0,36.63,7.78,48.09,23.52,11.47,15.57,17.36,37.98,17.36,64.87,0,27.19-5.72,45.3-17.19,61.2Z"}),ke.createElement("path",{className:"cls-2",d:"M894.42,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-14.52,22.58-22.99,49.63-22.99,78.73,0,44.89,20.13,84.92,51.59,111.1,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47,1.23,0,2.46-.03,3.68-.09,.36-.02,.71-.05,1.07-.07,.87-.05,1.75-.11,2.62-.2,.34-.03,.68-.08,1.02-.12,.91-.1,1.82-.21,2.73-.34,.21-.03,.42-.07,.63-.1,32.89-5.07,61.56-30.82,70.9-62.81v57.83c0,3.26,2.64,5.9,5.9,5.9h50.42c3.26,0,5.9-2.64,5.9-5.9V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,206.92c-12.2,10.16-27.97,13.98-44.84,15.12-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-42.24,0-77.12-35.89-77.12-79.37,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33v142.83Z"}),ke.createElement("path",{className:"cls-2",d:"M2133.97,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-14.52,22.58-22.99,49.63-22.99,78.73,0,44.89,20.13,84.92,51.59,111.1,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47,1.23,0,2.46-.03,3.68-.09,.36-.02,.71-.05,1.07-.07,.87-.05,1.75-.11,2.62-.2,.34-.03,.68-.08,1.02-.12,.91-.1,1.82-.21,2.73-.34,.21-.03,.42-.07,.63-.1,32.89-5.07,61.56-30.82,70.9-62.81v57.83c0,3.26,2.64,5.9,5.9,5.9h50.42c3.26,0,5.9-2.64,5.9-5.9V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,206.92c-12.2,10.16-27.97,13.98-44.84,15.12-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-42.24,0-77.12-35.89-77.12-79.37,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33v142.83Z"}),ke.createElement("path",{className:"cls-2",d:"M1314.05,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-11.79,18.34-19.6,39.64-22.11,62.59-.58,5.3-.88,10.68-.88,16.14s.31,11.15,.93,16.59c4.28,38.09,23.14,71.61,50.66,94.52,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47h0c17.99,0,34.61-5.93,48.16-15.97,16.29-11.58,28.88-28.54,34.48-47.75v50.26h-.11v11.08c0,21.84-5.71,38.27-17.34,49.36-11.61,11.08-31.04,16.63-58.25,16.63-11.12,0-28.79-.59-46.6-2.41-2.83-.29-5.46,1.5-6.27,4.22l-12.78,43.11c-1.02,3.46,1.27,7.02,4.83,7.53,21.52,3.08,42.52,4.68,54.65,4.68,48.91,0,85.16-10.75,108.89-32.21,21.48-19.41,33.15-48.89,35.2-88.52V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,64.1s.65,139.13,0,143.36c-12.08,9.77-27.11,13.59-43.49,14.7-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-1.32,0-2.63-.03-3.94-.1-40.41-2.11-74.52-37.26-74.52-79.38,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33Z"}),ke.createElement("path",{className:"cls-1",d:"M249.83,0C113.3,0,2,110.09,.03,246.16c-2,138.19,110.12,252.7,248.33,253.5,42.68,.25,83.79-10.19,120.3-30.03,3.56-1.93,4.11-6.83,1.08-9.51l-23.38-20.72c-4.75-4.21-11.51-5.4-17.36-2.92-25.48,10.84-53.17,16.38-81.71,16.03-111.68-1.37-201.91-94.29-200.13-205.96,1.76-110.26,92-199.41,202.67-199.41h202.69V407.41l-115-102.18c-3.72-3.31-9.42-2.66-12.42,1.31-18.46,24.44-48.53,39.64-81.93,37.34-46.33-3.2-83.87-40.5-87.34-86.81-4.15-55.24,39.63-101.52,94-101.52,49.18,0,89.68,37.85,93.91,85.95,.38,4.28,2.31,8.27,5.52,11.12l29.95,26.55c3.4,3.01,8.79,1.17,9.63-3.3,2.16-11.55,2.92-23.58,2.07-35.92-4.82-70.34-61.8-126.93-132.17-131.26-80.68-4.97-148.13,58.14-150.27,137.25-2.09,77.1,61.08,143.56,138.19,145.26,32.19,.71,62.03-9.41,86.14-26.95l150.26,133.2c6.44,5.71,16.61,1.14,16.61-7.47V9.48C499.66,4.25,495.42,0,490.18,0H249.83Z"})))}function xe(e){return ke.createElement("svg",{width:"15",height:"15","aria-label":e.ariaLabel,role:"img"},ke.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"},e.children))}function Ne(e){var t=e.translations,r=void 0===t?{}:t,n=r.selectText,o=void 0===n?"to select":n,a=r.selectKeyAriaLabel,c=void 0===a?"Enter key":a,i=r.navigateText,l=void 0===i?"to navigate":i,s=r.navigateUpKeyAriaLabel,u=void 0===s?"Arrow up":s,f=r.navigateDownKeyAriaLabel,m=void 0===f?"Arrow down":f,p=r.closeText,d=void 0===p?"to close":p,h=r.closeKeyAriaLabel,v=void 0===h?"Escape key":h,y=r.searchByText,g=void 0===y?"Search by":y;return ke.createElement(ke.Fragment,null,ke.createElement("div",{className:"DocSearch-Logo"},ke.createElement(Ae,{translations:{searchByText:g}})),ke.createElement("ul",{className:"DocSearch-Commands"},ke.createElement("li",null,ke.createElement("kbd",{className:"DocSearch-Commands-Key"},ke.createElement(xe,{ariaLabel:c},ke.createElement("path",{d:"M12 3.53088v3c0 1-1 2-2 2H4M7 11.53088l-3-3 3-3"}))),ke.createElement("span",{className:"DocSearch-Label"},o)),ke.createElement("li",null,ke.createElement("kbd",{className:"DocSearch-Commands-Key"},ke.createElement(xe,{ariaLabel:m},ke.createElement("path",{d:"M7.5 3.5v8M10.5 8.5l-3 3-3-3"}))),ke.createElement("kbd",{className:"DocSearch-Commands-Key"},ke.createElement(xe,{ariaLabel:u},ke.createElement("path",{d:"M7.5 11.5v-8M10.5 6.5l-3-3-3 3"}))),ke.createElement("span",{className:"DocSearch-Label"},l)),ke.createElement("li",null,ke.createElement("kbd",{className:"DocSearch-Commands-Key"},ke.createElement(xe,{ariaLabel:v},ke.createElement("path",{d:"M13.6167 8.936c-.1065.3583-.6883.962-1.4875.962-.7993 0-1.653-.9165-1.653-2.1258v-.5678c0-1.2548.7896-2.1016 1.653-2.1016.8634 0 1.3601.4778 1.4875 1.0724M9 6c-.1352-.4735-.7506-.9219-1.46-.8972-.7092.0246-1.344.57-1.344 1.2166s.4198.8812 1.3445.9805C8.465 7.3992 8.968 7.9337 9 8.5c.032.5663-.454 1.398-1.4595 1.398C6.6593 9.898 6 9 5.963 8.4851m-1.4748.5368c-.2635.5941-.8099.876-1.5443.876s-1.7073-.6248-1.7073-2.204v-.4603c0-1.0416.721-2.131 1.7073-2.131.9864 0 1.6425 1.031 1.5443 2.2492h-2.956"}))),ke.createElement("span",{className:"DocSearch-Label"},d))))}function Re(e){var t=e.hit,r=e.children;return ke.createElement("a",{href:t.url},r)}function _e(){return ke.createElement("svg",{width:"40",height:"40",viewBox:"0 0 20 20",fill:"none",fillRule:"evenodd",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},ke.createElement("path",{d:"M19 4.8a16 16 0 00-2-1.2m-3.3-1.2A16 16 0 001.1 4.7M16.7 8a12 12 0 00-2.8-1.4M10 6a12 12 0 00-6.7 2M12.3 14.7a4 4 0 00-4.5 0M14.5 11.4A8 8 0 0010 10M3 16L18 2M10 18h0"}))}function qe(e){var t=e.translations,r=void 0===t?{}:t,n=r.titleText,o=void 0===n?"Unable to fetch results":n,a=r.helpText,c=void 0===a?"You might want to check your network connection.":a;return ke.createElement("div",{className:"DocSearch-ErrorScreen"},ke.createElement("div",{className:"DocSearch-Screen-Icon"},ke.createElement(_e,null)),ke.createElement("p",{className:"DocSearch-Title"},o),ke.createElement("p",{className:"DocSearch-Help"},c))}function Te(){return ke.createElement("svg",{width:"40",height:"40",viewBox:"0 0 20 20",fill:"none",fillRule:"evenodd",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},ke.createElement("path",{d:"M15.5 4.8c2 3 1.7 7-1 9.7h0l4.3 4.3-4.3-4.3a7.8 7.8 0 01-9.8 1m-2.2-2.2A7.8 7.8 0 0113.2 2.4M2 18L18 2"}))}var Le=["translations"];function Me(e){return function(e){if(Array.isArray(e))return He(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return He(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return He(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function He(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Fe(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Ue(e){var t=e.translations,r=void 0===t?{}:t,n=Fe(e,Le),o=r.noResultsText,a=void 0===o?"No results for":o,c=r.suggestedQueryText,i=void 0===c?"Try searching for":c,l=r.reportMissingResultsText,s=void 0===l?"Believe this query should return results?":l,u=r.reportMissingResultsLinkText,f=void 0===u?"Let us know.":u,m=n.state.context.searchSuggestions;return ke.createElement("div",{className:"DocSearch-NoResults"},ke.createElement("div",{className:"DocSearch-Screen-Icon"},ke.createElement(Te,null)),ke.createElement("p",{className:"DocSearch-Title"},a,' "',ke.createElement("strong",null,n.state.query),'"'),m&&m.length>0&&ke.createElement("div",{className:"DocSearch-NoResults-Prefill-List"},ke.createElement("p",{className:"DocSearch-Help"},i,":"),ke.createElement("ul",null,m.slice(0,3).reduce((function(e,t){return[].concat(Me(e),[ke.createElement("li",{key:t},ke.createElement("button",{className:"DocSearch-Prefill",key:t,type:"button",onClick:function(){n.setQuery(t.toLowerCase()+" "),n.refresh(),n.inputRef.current.focus()}},t))])}),[]))),n.getMissingResultsUrl&&ke.createElement("p",{className:"DocSearch-Help"},"".concat(s," "),ke.createElement("a",{href:n.getMissingResultsUrl({query:n.state.query}),target:"_blank",rel:"noopener noreferrer"},f)))}var Be=function(){return ke.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},ke.createElement("path",{d:"M17 6v12c0 .52-.2 1-1 1H4c-.7 0-1-.33-1-1V2c0-.55.42-1 1-1h8l5 5zM14 8h-3.13c-.51 0-.87-.34-.87-.87V4",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))};function Ve(e){switch(e.type){case"lvl1":return ke.createElement(Be,null);case"content":return ke.createElement(Je,null);default:return ke.createElement(Ke,null)}}function Ke(){return ke.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},ke.createElement("path",{d:"M13 13h4-4V8H7v5h6v4-4H7V8H3h4V3v5h6V3v5h4-4v5zm-6 0v4-4H3h4z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}function Je(){return ke.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},ke.createElement("path",{d:"M17 5H3h14zm0 5H3h14zm0 5H3h14z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function $e(){return ke.createElement("svg",{className:"DocSearch-Hit-Select-Icon",width:"20",height:"20",viewBox:"0 0 20 20"},ke.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},ke.createElement("path",{d:"M18 3v4c0 2-2 4-4 4H2"}),ke.createElement("path",{d:"M8 17l-6-6 6-6"})))}var ze=["hit","attribute","tagName"];function We(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?We(Object(r),!0).forEach((function(t){Ze(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):We(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ze(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ye(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Ge(e,t){return t.split(".").reduce((function(e,t){return null!=e&&e[t]?e[t]:null}),e)}function Xe(e){var t=e.hit,r=e.attribute,n=e.tagName,o=void 0===n?"span":n,a=Ye(e,ze);return(0,ke.createElement)(o,Qe(Qe({},a),{},{dangerouslySetInnerHTML:{__html:Ge(t,"_snippetResult.".concat(r,".value"))||Ge(t,r)}}))}function et(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,a=[],c=!0,i=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);c=!0);}catch(l){i=!0,o=l}finally{try{c||null==r.return||r.return()}finally{if(i)throw o}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return tt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function rt(){return rt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rt.apply(this,arguments)}function nt(e){return e.collection&&0!==e.collection.items.length?ke.createElement("section",{className:"DocSearch-Hits"},ke.createElement("div",{className:"DocSearch-Hit-source"},e.title),ke.createElement("ul",e.getListProps(),e.collection.items.map((function(t,r){return ke.createElement(ot,rt({key:[e.title,t.objectID].join(":"),item:t,index:r},e))})))):null}function ot(e){var t=e.item,r=e.index,n=e.renderIcon,o=e.renderAction,a=e.getItemProps,c=e.onItemClick,i=e.collection,l=e.hitComponent,s=et(ke.useState(!1),2),u=s[0],f=s[1],m=et(ke.useState(!1),2),p=m[0],d=m[1],h=ke.useRef(null),v=l;return ke.createElement("li",rt({className:["DocSearch-Hit",t.__docsearch_parent&&"DocSearch-Hit--Child",u&&"DocSearch-Hit--deleting",p&&"DocSearch-Hit--favoriting"].filter(Boolean).join(" "),onTransitionEnd:function(){h.current&&h.current()}},a({item:t,source:i.source,onClick:function(){c(t)}})),ke.createElement(v,{hit:t},ke.createElement("div",{className:"DocSearch-Hit-Container"},n({item:t,index:r}),t.hierarchy[t.type]&&"lvl1"===t.type&&ke.createElement("div",{className:"DocSearch-Hit-content-wrapper"},ke.createElement(Xe,{className:"DocSearch-Hit-title",hit:t,attribute:"hierarchy.lvl1"}),t.content&&ke.createElement(Xe,{className:"DocSearch-Hit-path",hit:t,attribute:"content"})),t.hierarchy[t.type]&&("lvl2"===t.type||"lvl3"===t.type||"lvl4"===t.type||"lvl5"===t.type||"lvl6"===t.type)&&ke.createElement("div",{className:"DocSearch-Hit-content-wrapper"},ke.createElement(Xe,{className:"DocSearch-Hit-title",hit:t,attribute:"hierarchy.".concat(t.type)}),ke.createElement(Xe,{className:"DocSearch-Hit-path",hit:t,attribute:"hierarchy.lvl1"})),"content"===t.type&&ke.createElement("div",{className:"DocSearch-Hit-content-wrapper"},ke.createElement(Xe,{className:"DocSearch-Hit-title",hit:t,attribute:"content"}),ke.createElement(Xe,{className:"DocSearch-Hit-path",hit:t,attribute:"hierarchy.lvl1"})),o({item:t,runDeleteTransition:function(e){f(!0),h.current=e},runFavoriteTransition:function(e){d(!0),h.current=e}}))))}var at=/(<mark>|<\/mark>)/g,ct=RegExp(at.source);function it(e){var t,r,n,o,a,c=e;if(!c.__docsearch_parent&&!e._highlightResult)return e.hierarchy.lvl0;var i=((c.__docsearch_parent?null===(t=c.__docsearch_parent)||void 0===t||null===(r=t._highlightResult)||void 0===r||null===(n=r.hierarchy)||void 0===n?void 0:n.lvl0:null===(o=e._highlightResult)||void 0===o||null===(a=o.hierarchy)||void 0===a?void 0:a.lvl0)||{}).value;return i&&ct.test(i)?i.replace(at,""):i}function lt(){return lt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lt.apply(this,arguments)}function st(e){return ke.createElement("div",{className:"DocSearch-Dropdown-Container"},e.state.collections.map((function(t){if(0===t.items.length)return null;var r=it(t.items[0]);return ke.createElement(nt,lt({},e,{key:t.source.sourceId,title:r,collection:t,renderIcon:function(e){var r,n=e.item,o=e.index;return ke.createElement(ke.Fragment,null,n.__docsearch_parent&&ke.createElement("svg",{className:"DocSearch-Hit-Tree",viewBox:"0 0 24 54"},ke.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},n.__docsearch_parent!==(null===(r=t.items[o+1])||void 0===r?void 0:r.__docsearch_parent)?ke.createElement("path",{d:"M8 6v21M20 27H8.3"}):ke.createElement("path",{d:"M8 6v42M20 27H8.3"}))),ke.createElement("div",{className:"DocSearch-Hit-icon"},ke.createElement(Ve,{type:n.type})))},renderAction:function(){return ke.createElement("div",{className:"DocSearch-Hit-action"},ke.createElement($e,null))}}))})),e.resultsFooterComponent&&ke.createElement("section",{className:"DocSearch-HitsFooter"},ke.createElement(e.resultsFooterComponent,{state:e.state})))}function ut(){return ke.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},ke.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},ke.createElement("path",{d:"M3.18 6.6a8.23 8.23 0 1112.93 9.94h0a8.23 8.23 0 01-11.63 0"}),ke.createElement("path",{d:"M6.44 7.25H2.55V3.36M10.45 6v5.6M10.45 11.6L13 13"})))}function ft(){return ke.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},ke.createElement("path",{d:"M10 14.2L5 17l1-5.6-4-4 5.5-.7 2.5-5 2.5 5 5.6.8-4 4 .9 5.5z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function mt(){return ke.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},ke.createElement("path",{d:"M10 10l5.09-5.09L10 10l5.09 5.09L10 10zm0 0L4.91 4.91 10 10l-5.09 5.09L10 10z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}var pt=["translations"];function dt(){return dt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dt.apply(this,arguments)}function ht(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function vt(e){var t=e.translations,r=void 0===t?{}:t,n=ht(e,pt),o=r.recentSearchesTitle,a=void 0===o?"Recent":o,c=r.noRecentSearchesText,i=void 0===c?"No recent searches":c,l=r.saveRecentSearchButtonTitle,s=void 0===l?"Save this search":l,u=r.removeRecentSearchButtonTitle,f=void 0===u?"Remove this search from history":u,m=r.favoriteSearchesTitle,p=void 0===m?"Favorite":m,d=r.removeFavoriteSearchButtonTitle,h=void 0===d?"Remove this search from favorites":d;return"idle"===n.state.status&&!1===n.hasCollections?n.disableUserPersonalization?null:ke.createElement("div",{className:"DocSearch-StartScreen"},ke.createElement("p",{className:"DocSearch-Help"},i)):!1===n.hasCollections?null:ke.createElement("div",{className:"DocSearch-Dropdown-Container"},ke.createElement(nt,dt({},n,{title:a,collection:n.state.collections[0],renderIcon:function(){return ke.createElement("div",{className:"DocSearch-Hit-icon"},ke.createElement(ut,null))},renderAction:function(e){var t=e.item,r=e.runFavoriteTransition,o=e.runDeleteTransition;return ke.createElement(ke.Fragment,null,ke.createElement("div",{className:"DocSearch-Hit-action"},ke.createElement("button",{className:"DocSearch-Hit-action-button",title:s,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),r((function(){n.favoriteSearches.add(t),n.recentSearches.remove(t),n.refresh()}))}},ke.createElement(ft,null))),ke.createElement("div",{className:"DocSearch-Hit-action"},ke.createElement("button",{className:"DocSearch-Hit-action-button",title:f,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),o((function(){n.recentSearches.remove(t),n.refresh()}))}},ke.createElement(mt,null))))}})),ke.createElement(nt,dt({},n,{title:p,collection:n.state.collections[1],renderIcon:function(){return ke.createElement("div",{className:"DocSearch-Hit-icon"},ke.createElement(ft,null))},renderAction:function(e){var t=e.item,r=e.runDeleteTransition;return ke.createElement("div",{className:"DocSearch-Hit-action"},ke.createElement("button",{className:"DocSearch-Hit-action-button",title:h,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),r((function(){n.favoriteSearches.remove(t),n.refresh()}))}},ke.createElement(mt,null)))}})))}var yt=["translations"];function gt(){return gt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gt.apply(this,arguments)}function bt(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var Ot=ke.memo((function(e){var t=e.translations,r=void 0===t?{}:t,n=bt(e,yt);if("error"===n.state.status)return ke.createElement(qe,{translations:null==r?void 0:r.errorScreen});var o=n.state.collections.some((function(e){return e.items.length>0}));return n.state.query?!1===o?ke.createElement(Ue,gt({},n,{translations:null==r?void 0:r.noResultsScreen})):ke.createElement(st,n):ke.createElement(vt,gt({},n,{hasCollections:o,translations:null==r?void 0:r.startScreen}))}),(function(e,t){return"loading"===t.state.status||"stalled"===t.state.status}));function St(){return ke.createElement("svg",{viewBox:"0 0 38 38",stroke:"currentColor",strokeOpacity:".5"},ke.createElement("g",{fill:"none",fillRule:"evenodd"},ke.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},ke.createElement("circle",{strokeOpacity:".3",cx:"18",cy:"18",r:"18"}),ke.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18"},ke.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})))))}var Et=r(830),jt=["translations"];function wt(){return wt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wt.apply(this,arguments)}function Pt(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function It(e){var t=e.translations,r=void 0===t?{}:t,n=Pt(e,jt),o=r.resetButtonTitle,a=void 0===o?"Clear the query":o,c=r.resetButtonAriaLabel,i=void 0===c?"Clear the query":c,l=r.cancelButtonText,s=void 0===l?"Cancel":l,u=r.cancelButtonAriaLabel,f=void 0===u?"Cancel":u,m=n.getFormProps({inputElement:n.inputRef.current}).onReset;return ke.useEffect((function(){n.autoFocus&&n.inputRef.current&&n.inputRef.current.focus()}),[n.autoFocus,n.inputRef]),ke.useEffect((function(){n.isFromSelection&&n.inputRef.current&&n.inputRef.current.select()}),[n.isFromSelection,n.inputRef]),ke.createElement(ke.Fragment,null,ke.createElement("form",{className:"DocSearch-Form",onSubmit:function(e){e.preventDefault()},onReset:m},ke.createElement("label",wt({className:"DocSearch-MagnifierLabel"},n.getLabelProps()),ke.createElement(Et.W,null)),ke.createElement("div",{className:"DocSearch-LoadingIndicator"},ke.createElement(St,null)),ke.createElement("input",wt({className:"DocSearch-Input",ref:n.inputRef},n.getInputProps({inputElement:n.inputRef.current,autoFocus:n.autoFocus,maxLength:64}))),ke.createElement("button",{type:"reset",title:a,className:"DocSearch-Reset","aria-label":i,hidden:!n.state.query},ke.createElement(mt,null))),ke.createElement("button",{className:"DocSearch-Cancel",type:"reset","aria-label":f,onClick:n.onClose},s))}var Dt=["_highlightResult","_snippetResult"];function Ct(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function kt(e){return!1===function(){var e="__TEST_KEY__";try{return localStorage.setItem(e,""),localStorage.removeItem(e),!0}catch(t){return!1}}()?{setItem:function(){},getItem:function(){return[]}}:{setItem:function(t){return window.localStorage.setItem(e,JSON.stringify(t))},getItem:function(){var t=window.localStorage.getItem(e);return t?JSON.parse(t):[]}}}function At(e){var t=e.key,r=e.limit,n=void 0===r?5:r,o=kt(t),a=o.getItem().slice(0,n);return{add:function(e){var t=e,r=(t._highlightResult,t._snippetResult,Ct(t,Dt)),c=a.findIndex((function(e){return e.objectID===r.objectID}));c>-1&&a.splice(c,1),a.unshift(r),a=a.slice(0,n),o.setItem(a)},remove:function(e){a=a.filter((function(t){return t.objectID!==e.objectID})),o.setItem(a)},getAll:function(){return a}}}function xt(e){const t=`algoliasearch-client-js-${e.key}`;let r;const n=()=>(void 0===r&&(r=e.localStorage||window.localStorage),r),o=()=>JSON.parse(n().getItem(t)||"{}");return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const r=JSON.stringify(e),n=o()[r];return Promise.all([n||t(),void 0!==n])})).then((([e,t])=>Promise.all([e,t||r.miss(e)]))).then((([e])=>e)),set:(e,r)=>Promise.resolve().then((()=>{const a=o();return a[JSON.stringify(e)]=r,n().setItem(t,JSON.stringify(a)),r})),delete:e=>Promise.resolve().then((()=>{const r=o();delete r[JSON.stringify(e)],n().setItem(t,JSON.stringify(r))})),clear:()=>Promise.resolve().then((()=>{n().removeItem(t)}))}}function Nt(e){const t=[...e.caches],r=t.shift();return void 0===r?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,n,o={miss:()=>Promise.resolve()})=>r.get(e,n,o).catch((()=>Nt({caches:t}).get(e,n,o))),set:(e,n)=>r.set(e,n).catch((()=>Nt({caches:t}).set(e,n))),delete:e=>r.delete(e).catch((()=>Nt({caches:t}).delete(e))),clear:()=>r.clear().catch((()=>Nt({caches:t}).clear()))}}function Rt(e={serializable:!0}){let t={};return{get(r,n,o={miss:()=>Promise.resolve()}){const a=JSON.stringify(r);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);const c=n(),i=o&&o.miss||(()=>Promise.resolve());return c.then((e=>i(e))).then((()=>c))},set:(r,n)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}function _t(e){let t=e.length-1;for(;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function qt(e,t){return t?(Object.keys(t).forEach((r=>{e[r]=t[r](e)})),e):e}function Tt(e,...t){let r=0;return e.replace(/%s/g,(()=>encodeURIComponent(t[r++])))}const Lt="4.17.0",Mt={WithinQueryParameters:0,WithinHeaders:1};function Ht(e,t){const r=e||{},n=r.data||{};return Object.keys(r).forEach((e=>{-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(n[e]=r[e])})),{data:Object.entries(n).length>0?n:void 0,timeout:r.timeout||t,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}const Ft={Read:1,Write:2,Any:3},Ut=1,Bt=2,Vt=3,Kt=12e4;function Jt(e,t=Ut){return{...e,status:t,lastUpdate:Date.now()}}function $t(e){return"string"==typeof e?{protocol:"https",url:e,accept:Ft.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||Ft.Any}}const zt="GET",Wt="POST";function Qt(e,t){return Promise.all(t.map((t=>e.get(t,(()=>Promise.resolve(Jt(t))))))).then((e=>{const r=e.filter((e=>function(e){return e.status===Ut||Date.now()-e.lastUpdate>Kt}(e))),n=e.filter((e=>function(e){return e.status===Vt&&Date.now()-e.lastUpdate<=Kt}(e))),o=[...r,...n];return{getTimeout:(e,t)=>(0===n.length&&0===e?1:n.length+3+e)*t,statelessHosts:o.length>0?o.map((e=>$t(e))):t}}))}function Zt(e,t,r,n){const o=[],a=function(e,t){if(e.method===zt||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(r,n),c=function(e,t){const r={...e.headers,...t.headers},n={};return Object.keys(r).forEach((e=>{const t=r[e];n[e.toLowerCase()]=t})),n}(e,n),i=r.method,l=r.method!==zt?{}:{...r.data,...n.data},s={"x-algolia-agent":e.userAgent.value,...e.queryParameters,...l,...n.queryParameters};let u=0;const f=(t,l)=>{const m=t.pop();if(void 0===m)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:er(o)};const p={data:a,headers:c,method:i,url:Gt(m,r.path,s),connectTimeout:l(u,e.timeouts.connect),responseTimeout:l(u,n.timeout)},d=e=>{const r={request:p,response:e,host:m,triesLeft:t.length};return o.push(r),r},h={onSuccess:e=>function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e),onRetry(r){const n=d(r);return r.isTimedOut&&u++,Promise.all([e.logger.info("Retryable failure",tr(n)),e.hostsCache.set(m,Jt(m,r.isTimedOut?Vt:Bt))]).then((()=>f(t,l)))},onFail(e){throw d(e),function({content:e,status:t},r){let n=e;try{n=JSON.parse(e).message}catch(o){}return function(e,t,r){return{name:"ApiError",message:e,status:t,transporterStackTrace:r}}(n,t,r)}(e,er(o))}};return e.requester.send(p).then((e=>((e,t)=>(e=>{const t=e.status;return e.isTimedOut||(({isTimedOut:e,status:t})=>!e&&0==~~t)(e)||2!=~~(t/100)&&4!=~~(t/100)})(e)?t.onRetry(e):(({status:e})=>2==~~(e/100))(e)?t.onSuccess(e):t.onFail(e))(e,h)))};return Qt(e.hostsCache,t).then((e=>f([...e.statelessHosts].reverse(),e.getTimeout)))}function Yt(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}function Gt(e,t,r){const n=Xt(r);let o=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return n.length&&(o+=`?${n}`),o}function Xt(e){return Object.keys(e).map((t=>{return Tt("%s=%s",t,(r=e[t],"[object Object]"===Object.prototype.toString.call(r)||"[object Array]"===Object.prototype.toString.call(r)?JSON.stringify(e[t]):e[t]));var r})).join("&")}function er(e){return e.map((e=>tr(e)))}function tr(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}const rr=e=>{const t=e.appId,r=function(e,t,r){const n={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers:()=>e===Mt.WithinHeaders?n:{},queryParameters:()=>e===Mt.WithinQueryParameters?n:{}}}(void 0!==e.authMode?e.authMode:Mt.WithinHeaders,t,e.apiKey),n=function(e){const{hostsCache:t,logger:r,requester:n,requestsCache:o,responsesCache:a,timeouts:c,userAgent:i,hosts:l,queryParameters:s,headers:u}=e,f={hostsCache:t,logger:r,requester:n,requestsCache:o,responsesCache:a,timeouts:c,userAgent:i,headers:u,queryParameters:s,hosts:l.map((e=>$t(e))),read(e,t){const r=Ht(t,f.timeouts.read),n=()=>Zt(f,f.hosts.filter((e=>0!=(e.accept&Ft.Read))),e,r);if(!0!==(void 0!==r.cacheable?r.cacheable:e.cacheable))return n();const o={request:e,mappedRequestOptions:r,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(o,(()=>f.requestsCache.get(o,(()=>f.requestsCache.set(o,n()).then((e=>Promise.all([f.requestsCache.delete(o),e])),(e=>Promise.all([f.requestsCache.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>f.responsesCache.set(o,e)})},write:(e,t)=>Zt(f,f.hosts.filter((e=>0!=(e.accept&Ft.Write))),e,Ht(t,f.timeouts.write))};return f}({hosts:[{url:`${t}-dsn.algolia.net`,accept:Ft.Read},{url:`${t}.algolia.net`,accept:Ft.Write}].concat(_t([{url:`${t}-1.algolianet.com`},{url:`${t}-2.algolianet.com`},{url:`${t}-3.algolianet.com`}])),...e,headers:{...r.headers(),"content-type":"application/x-www-form-urlencoded",...e.headers},queryParameters:{...r.queryParameters(),...e.queryParameters}}),o={transporter:n,appId:t,addAlgoliaAgent(e,t){n.userAgent.add({segment:e,version:t})},clearCache:()=>Promise.all([n.requestsCache.clear(),n.responsesCache.clear()]).then((()=>{}))};return qt(o,e.methods)},nr=e=>(t,r)=>t.method===zt?e.transporter.read(t,r):e.transporter.write(t,r),or=e=>(t,r={})=>qt({transporter:e.transporter,appId:e.appId,indexName:t},r.methods),ar=e=>(t,r)=>{const n=t.map((e=>({...e,params:Xt(e.params||{})})));return e.transporter.read({method:Wt,path:"1/indexes/*/queries",data:{requests:n},cacheable:!0},r)},cr=e=>(t,r)=>Promise.all(t.map((t=>{const{facetName:n,facetQuery:o,...a}=t.params;return or(e)(t.indexName,{methods:{searchForFacetValues:sr}}).searchForFacetValues(n,o,{...r,...a})}))),ir=e=>(t,r,n)=>e.transporter.read({method:Wt,path:Tt("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:r},cacheable:!0},n),lr=e=>(t,r)=>e.transporter.read({method:Wt,path:Tt("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},r),sr=e=>(t,r,n)=>e.transporter.read({method:Wt,path:Tt("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:r},cacheable:!0},n),ur=1,fr=2,mr=3;function pr(e,t,r){const n={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:e=>new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const n=(e,n)=>setTimeout((()=>{r.abort(),t({status:0,content:n,isTimedOut:!0})}),1e3*e),o=n(e.connectTimeout,"Connection timeout");let a;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===a&&(clearTimeout(o),a=n(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(o),clearTimeout(a),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(o),clearTimeout(a),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))},logger:(o=mr,{debug:(e,t)=>(ur>=o&&console.debug(e,t),Promise.resolve()),info:(e,t)=>(fr>=o&&console.info(e,t),Promise.resolve()),error:(e,t)=>(console.error(e,t),Promise.resolve())}),responsesCache:Rt(),requestsCache:Rt({serializable:!1}),hostsCache:Nt({caches:[xt({key:`4.17.0-${e}`}),Rt()]}),userAgent:Yt(Lt).add({segment:"Browser",version:"lite"}),authMode:Mt.WithinQueryParameters};var o;return rr({...n,...r,methods:{search:ar,searchForFacetValues:cr,multipleQueries:ar,multipleSearchForFacetValues:cr,customRequest:nr,initIndex:e=>t=>or(e)(t,{methods:{search:lr,searchForFacetValues:sr,findAnswers:ir}})}})}pr.version=Lt;const dr=pr;var hr="3.3.3";function vr(){}function yr(e){return e}function gr(e,t){return e.reduce((function(e,r){var n=t(r);return e.hasOwnProperty(n)||(e[n]=[]),e[n].length<5&&e[n].push(r),e}),{})}var br=["footer","searchBox"];function Or(){return Or=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Or.apply(this,arguments)}function Sr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Er(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Sr(Object(r),!0).forEach((function(t){jr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function jr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,a=[],c=!0,i=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);c=!0);}catch(l){i=!0,o=l}finally{try{c||null==r.return||r.return()}finally{if(i)throw o}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Pr(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ir(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Dr(e){var t=e.appId,r=e.apiKey,n=e.indexName,o=e.placeholder,a=void 0===o?"Search docs":o,c=e.searchParameters,i=e.onClose,l=void 0===i?vr:i,s=e.transformItems,u=void 0===s?yr:s,f=e.hitComponent,m=void 0===f?Re:f,p=e.resultsFooterComponent,d=void 0===p?function(){return null}:p,h=e.navigator,v=e.initialScrollY,y=void 0===v?0:v,g=e.transformSearchClient,b=void 0===g?yr:g,O=e.disableUserPersonalization,S=void 0!==O&&O,E=e.initialQuery,j=void 0===E?"":E,w=e.translations,P=void 0===w?{}:w,I=e.getMissingResultsUrl,D=P.footer,C=P.searchBox,k=Ir(P,br),A=wr(ke.useState({query:"",collections:[],completion:null,context:{},isOpen:!1,activeItemId:null,status:"idle"}),2),x=A[0],N=A[1],R=ke.useRef(null),_=ke.useRef(null),q=ke.useRef(null),T=ke.useRef(null),L=ke.useRef(null),M=ke.useRef(10),H=ke.useRef("undefined"!=typeof window?window.getSelection().toString().slice(0,64):"").current,F=ke.useRef(j||H).current,U=function(e,t,r){return ke.useMemo((function(){var n=dr(e,t);return n.addAlgoliaAgent("docsearch",hr),!1===/docsearch.js \(.*\)/.test(n.transporter.userAgent.value)&&n.addAlgoliaAgent("docsearch-react",hr),r(n)}),[e,t,r])}(t,r,b),B=ke.useRef(At({key:"__DOCSEARCH_FAVORITE_SEARCHES__".concat(n),limit:10})).current,V=ke.useRef(At({key:"__DOCSEARCH_RECENT_SEARCHES__".concat(n),limit:0===B.getAll().length?7:4})).current,K=ke.useCallback((function(e){if(!S){var t="content"===e.type?e.__docsearch_parent:e;t&&-1===B.getAll().findIndex((function(e){return e.objectID===t.objectID}))&&V.add(t)}}),[B,V,S]),J=ke.useMemo((function(){return Ce({id:"docsearch",defaultActiveItemId:0,placeholder:a,openOnFocus:!0,initialState:{query:F,context:{searchSuggestions:[]}},navigator:h,onStateChange:function(e){N(e.state)},getSources:function(e){var t=e.query,r=e.state,o=e.setContext,a=e.setStatus;return t?U.search([{query:t,indexName:n,params:Er({attributesToRetrieve:["hierarchy.lvl0","hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content","type","url"],attributesToSnippet:["hierarchy.lvl1:".concat(M.current),"hierarchy.lvl2:".concat(M.current),"hierarchy.lvl3:".concat(M.current),"hierarchy.lvl4:".concat(M.current),"hierarchy.lvl5:".concat(M.current),"hierarchy.lvl6:".concat(M.current),"content:".concat(M.current)],snippetEllipsisText:"\u2026",highlightPreTag:"<mark>",highlightPostTag:"</mark>",hitsPerPage:20},c)}]).catch((function(e){throw"RetryError"===e.name&&a("error"),e})).then((function(e){var t=e.results[0],n=t.hits,a=t.nbHits,c=gr(n,(function(e){return it(e)}));return r.context.searchSuggestions.length<Object.keys(c).length&&o({searchSuggestions:Object.keys(c)}),o({nbHits:a}),Object.values(c).map((function(e,t){return{sourceId:"hits".concat(t),onSelect:function(e){var t=e.item,r=e.event;K(t),r.shiftKey||r.ctrlKey||r.metaKey||l()},getItemUrl:function(e){return e.item.url},getItems:function(){return Object.values(gr(e,(function(e){return e.hierarchy.lvl1}))).map(u).map((function(e){return e.map((function(t){return Er(Er({},t),{},{__docsearch_parent:"lvl1"!==t.type&&e.find((function(e){return"lvl1"===e.type&&e.hierarchy.lvl1===t.hierarchy.lvl1}))})}))})).flat()}}}))})):S?[]:[{sourceId:"recentSearches",onSelect:function(e){var t=e.item,r=e.event;K(t),r.shiftKey||r.ctrlKey||r.metaKey||l()},getItemUrl:function(e){return e.item.url},getItems:function(){return V.getAll()}},{sourceId:"favoriteSearches",onSelect:function(e){var t=e.item,r=e.event;K(t),r.shiftKey||r.ctrlKey||r.metaKey||l()},getItemUrl:function(e){return e.item.url},getItems:function(){return B.getAll()}}]}})}),[n,c,U,l,V,B,K,F,a,h,u,S]),$=J.getEnvironmentProps,z=J.getRootProps,W=J.refresh;return function(e){var t=e.getEnvironmentProps,r=e.panelElement,n=e.formElement,o=e.inputElement;ke.useEffect((function(){if(r&&n&&o){var e=t({panelElement:r,formElement:n,inputElement:o}),a=e.onTouchStart,c=e.onTouchMove;return window.addEventListener("touchstart",a),window.addEventListener("touchmove",c),function(){window.removeEventListener("touchstart",a),window.removeEventListener("touchmove",c)}}}),[t,r,n,o])}({getEnvironmentProps:$,panelElement:T.current,formElement:q.current,inputElement:L.current}),function(e){var t=e.container;ke.useEffect((function(){if(t){var e=t.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), input:not([disabled])"),r=e[0],n=e[e.length-1];return t.addEventListener("keydown",o),function(){t.removeEventListener("keydown",o)}}function o(e){"Tab"===e.key&&(e.shiftKey?document.activeElement===r&&(e.preventDefault(),n.focus()):document.activeElement===n&&(e.preventDefault(),r.focus()))}}),[t])}({container:R.current}),ke.useEffect((function(){return document.body.classList.add("DocSearch--active"),function(){var e,t;document.body.classList.remove("DocSearch--active"),null===(e=(t=window).scrollTo)||void 0===e||e.call(t,0,y)}}),[]),ke.useEffect((function(){window.matchMedia("(max-width: 768px)").matches&&(M.current=5)}),[]),ke.useEffect((function(){T.current&&(T.current.scrollTop=0)}),[x.query]),ke.useEffect((function(){F.length>0&&(W(),L.current&&L.current.focus())}),[F,W]),ke.useEffect((function(){function e(){if(_.current){var e=.01*window.innerHeight;_.current.style.setProperty("--docsearch-vh","".concat(e,"px"))}}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]),ke.createElement("div",Or({ref:R},z({"aria-expanded":!0}),{className:["DocSearch","DocSearch-Container","stalled"===x.status&&"DocSearch-Container--Stalled","error"===x.status&&"DocSearch-Container--Errored"].filter(Boolean).join(" "),role:"button",tabIndex:0,onMouseDown:function(e){e.target===e.currentTarget&&l()}}),ke.createElement("div",{className:"DocSearch-Modal",ref:_},ke.createElement("header",{className:"DocSearch-SearchBar",ref:q},ke.createElement(It,Or({},J,{state:x,autoFocus:0===F.length,inputRef:L,isFromSelection:Boolean(F)&&F===H,translations:C,onClose:l}))),ke.createElement("div",{className:"DocSearch-Dropdown",ref:T},ke.createElement(Ot,Or({},J,{indexName:n,state:x,hitComponent:m,resultsFooterComponent:d,disableUserPersonalization:S,recentSearches:V,favoriteSearches:B,inputRef:L,translations:k,getMissingResultsUrl:I,onItemClick:function(e){K(e),l()}}))),ke.createElement("footer",{className:"DocSearch-Footer"},ke.createElement(Ne,{translations:D}))))}}}]); \ No newline at end of file diff --git a/assets/js/696a412b.30d5fb90.js b/assets/js/696a412b.30d5fb90.js deleted file mode 100644 index 86cadc9..0000000 --- a/assets/js/696a412b.30d5fb90.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[928],{3905:(e,t,a)=>{a.d(t,{Zo:()=>p,kt:()=>u});var r=a(7294);function i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function n(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function l(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?n(Object(a),!0).forEach((function(t){i(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):n(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function o(e,t){if(null==e)return{};var a,r,i=function(e,t){if(null==e)return{};var a,r,i={},n=Object.keys(e);for(r=0;r<n.length;r++)a=n[r],t.indexOf(a)>=0||(i[a]=e[a]);return i}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)a=n[r],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var s=r.createContext({}),d=function(e){var t=r.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},p=function(e){var t=d(e.components);return r.createElement(s.Provider,{value:t},e.children)},c={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var a=e.components,i=e.mdxType,n=e.originalType,s=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),m=d(a),u=i,h=m["".concat(s,".").concat(u)]||m[u]||c[u]||n;return a?r.createElement(h,l(l({ref:t},p),{},{components:a})):r.createElement(h,l({ref:t},p))}));function u(e,t){var a=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var n=a.length,l=new Array(n);l[0]=m;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o.mdxType="string"==typeof e?e:i,l[1]=o;for(var d=2;d<n;d++)l[d]=a[d];return r.createElement.apply(null,l)}return r.createElement.apply(null,a)}m.displayName="MDXCreateElement"},7113:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>c,frontMatter:()=>n,metadata:()=>o,toc:()=>d});var r=a(7462),i=(a(7294),a(3905));const n={title:"Server",sidebar_position:1},l="Trial Datastore Server",o={unversionedId:"reference/cli/trial-datastore/trial-datastore-server",id:"reference/cli/trial-datastore/trial-datastore-server",title:"Server",description:"Cogment Trial Datastore implements the datalog API. It is designed to store the trajectory samples generated by the trials for online and offline usage.",source:"@site/docs/reference/cli/trial-datastore/trial-datastore-server.md",sourceDirName:"reference/cli/trial-datastore",slug:"/reference/cli/trial-datastore/trial-datastore-server",permalink:"/docs/reference/cli/trial-datastore/trial-datastore-server",draft:!1,tags:[],version:"current",lastUpdatedAt:1691703005,formattedLastUpdatedAt:"Aug 10, 2023",sidebarPosition:1,frontMatter:{title:"Server",sidebar_position:1},sidebar:"docSidebar",previous:{title:"Client",permalink:"/docs/reference/cli/directory/directory-client"},next:{title:"Client",permalink:"/docs/reference/cli/trial-datastore/trial-datastore-client"}},s={},d=[{value:"Configuration",id:"configuration",level:2},{value:"<code>port</code>",id:"port",level:3},{value:"<code>grpc_reflection</code>",id:"grpc_reflection",level:3},{value:"<code>memory_storage_max_samples_size</code>",id:"memory_storage_max_samples_size",level:3},{value:"<code>file_storage</code>",id:"file_storage",level:3},{value:"<code>log_level</code>",id:"log_level",level:3},{value:"<code>log_file</code>",id:"log_file",level:3},{value:"<code>directory_endpoint</code>",id:"directory_endpoint",level:3},{value:"<code>directory_authentication_token</code>",id:"directory_authentication_token",level:3},{value:"<code>directory_registration_host</code>",id:"directory_registration_host",level:3},{value:"<code>directory_registration_properties</code>",id:"directory_registration_properties",level:3}],p={toc:d};function c(e){let{components:t,...a}=e;return(0,i.kt)("wrapper",(0,r.Z)({},p,a,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"trial-datastore-server"},"Trial Datastore Server"),(0,i.kt)("p",null,"Cogment Trial Datastore implements the ",(0,i.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#additional-components"},"datalog API"),". It is designed to store the trajectory samples generated by the trials for online and offline usage."),(0,i.kt)("p",null,"The Cogment CLI also includes an implementation of a ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cli/trial-datastore/trial-datastore-client"},"client"),"."),(0,i.kt)("p",null,"The Trial Datastore service included in the Cogment CLI can work in two modes:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Memory storage"),", which is the default mode, stores the data in memory up to a maximum size and then evicts the least recently used samples."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"File storage")," stores the data on disk in a file. The storage engine relies on ",(0,i.kt)("a",{parentName:"li",href:"https://github.com/etcd-io/bbolt"},"bbolt"),".")),(0,i.kt)("p",null,"The Trial Datastore service is simply called this way"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"$ cogment services trial_datastore --port=9000 --file_storage=./database.db\n")),(0,i.kt)("h2",{id:"configuration"},"Configuration"),(0,i.kt)("p",null,"The Trial Datastore configuration can be specified either through the command line or environment variables."),(0,i.kt)("h3",{id:"port"},(0,i.kt)("inlineCode",{parentName:"h3"},"port")),(0,i.kt)("p",null,"The TCP port where to offer gRPC services.\nThe Trial Datastore offers two services at the same TCP port: the ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/grpc#datalog-api"},"Datalog API")," and the ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/grpc#trial-datastore-api"},"Trial Datastore API"),".\nThe Datalog API is where the Datastore receives the raw trial data from the Orchestrator.\nThe Trial Datastore API is is where the Datastore delivers online or offline stored data (typically to actors for training)."),(0,i.kt)("p",null,"If set to 0, then the system will automatically choose a free port.\nThis is normally used in combination with a ",(0,i.kt)("a",{parentName:"p",href:"#directory_endpoint"},"Directory"),"."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--port=12000"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_TRIAL_DATASTORE_PORT=12000"),","),(0,i.kt)("li",{parentName:"ul"},"its default value is 9003.")),(0,i.kt)("h3",{id:"grpc_reflection"},(0,i.kt)("inlineCode",{parentName:"h3"},"grpc_reflection")),(0,i.kt)("p",null,"Whether or not to enable ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/grpc/grpc/blob/master/doc/server-reflection.md"},"gRPC reflection")," on the served endpoints."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line flag, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--grpc_reflection"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_TRIAL_DATASTORE_GRPC_REFLECTION=1"),","),(0,i.kt)("li",{parentName:"ul"},"by default, it is disabled.")),(0,i.kt)("h3",{id:"memory_storage_max_samples_size"},(0,i.kt)("inlineCode",{parentName:"h3"},"memory_storage_max_samples_size")),(0,i.kt)("p",null,"This defines the maximum cumulated size of samples the memory storage holds before evicting least recently used trials samples. It is defined in bytes."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--memory_storage_max_samples_size=100000000"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_TRIAL_DATASTORE_MEMORY_STORAGE_MAX_SAMPLE_SIZE=100000000"),","),(0,i.kt)("li",{parentName:"ul"},"its default value is 1073741824 Bytes, i.e. 1GB.")),(0,i.kt)("h3",{id:"file_storage"},(0,i.kt)("inlineCode",{parentName:"h3"},"file_storage")),(0,i.kt)("p",null,"Path to the database file used by the file storage. If provided, the trial datastore will use the file storage."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line flag, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--file_storage"),", to use the default value ",(0,i.kt)("inlineCode",{parentName:"li"},".cogment/trial_datastore.db"),","),(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--file_storage=./path/to/trial_datastore.db"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_TRIAL_DATASTORE_FILE_STORAGE_PATH=./path/to/trial_datastore.db"),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")),(0,i.kt)("h3",{id:"log_level"},(0,i.kt)("inlineCode",{parentName:"h3"},"log_level")),(0,i.kt)("p",null,"Set to define the minimum level for logging. Possible values are: ",(0,i.kt)("inlineCode",{parentName:"p"},"off"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"error"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"warning"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"info"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"debug"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"trace"),". Note however that all trace and most debug level logs will only output if running the debug compiled version of the Orchestrator."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--log_level=debug"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_LOG_LEVEL=5"),","),(0,i.kt)("li",{parentName:"ul"},"default value is info.")),(0,i.kt)("h3",{id:"log_file"},(0,i.kt)("inlineCode",{parentName:"h3"},"log_file")),(0,i.kt)("p",null,"Base file name for daily log output. The name will be suffixed with the date and a new file will be made every day. If not provided the logs go to stdout."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--log_file=./path/to/cogment.log"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_LOG_FILE=./path/to/cogment.log"),","),(0,i.kt)("li",{parentName:"ul"},"default value is info.")),(0,i.kt)("h3",{id:"directory_endpoint"},(0,i.kt)("inlineCode",{parentName:"h3"},"directory_endpoint")),(0,i.kt)("p",null,"Cogment endpoint of the directory service. It must be a ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#grpc-scheme"},"gRPC endpoint"),". The directory will be used to register the trial datastore services for discovery by other services. If not provided, the trial datastore will not auto register, in which case manual registration to the directory must be done, or an explicit address must be provided to access the services of the trial datastore."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--directory_endpoint=grpc://foo:9005"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005"),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")),(0,i.kt)("h3",{id:"directory_authentication_token"},(0,i.kt)("inlineCode",{parentName:"h3"},"directory_authentication_token")),(0,i.kt)("p",null,"Authentication token for services registered in the Directory. It is recorded in the Directory when registering a service. And a matching token must be provided to inquire for the service. An empty token is the same as no token."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--directory_authentication_token=GH670ploT"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT"),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")),(0,i.kt)("h3",{id:"directory_registration_host"},(0,i.kt)("inlineCode",{parentName:"h3"},"directory_registration_host")),(0,i.kt)("p",null,"This is the host that will be registered to the Directory for the Trial Datastore services. If not provided, the Trial Datastore will determine its own IP address and use that as the registration host."),(0,i.kt)("p",null,"In some circumstances, the IP address determined by Cogment may be wrong (e.g. multiple interfaces, load balancing, firewall), thus a host (hostname or IP address) must be explicitly provided."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--directory_registration_host=foo.bar"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_TRIAL_DATASTORE_DIRECTORY_REGISTRATION_HOST=foo.bar"),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value (i.e. self determined IP address is used).")),(0,i.kt)("h3",{id:"directory_registration_properties"},(0,i.kt)("inlineCode",{parentName:"h3"},"directory_registration_properties")),(0,i.kt)("p",null,'These are the properties that will be registered to the Directory for the Trial Datastore services. When inquiring the Directory, the properties inquired must match the properties registered. This is a string representing multiple properties in the form "name=value,name=value,name=value" where the values are optional.'),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'--directory_registration_properties="Sim=20,hpp,mem=HIGH"'),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'COGMENT_TRIAL_DATASTORE_DIRECTORY_REGISTRATION_PROPERTIES="Sim=20,hpp,mem=HIGH"'),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/696a412b.d894ab23.js b/assets/js/696a412b.d894ab23.js new file mode 100644 index 0000000..a2c83d4 --- /dev/null +++ b/assets/js/696a412b.d894ab23.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[928],{3905:(e,t,a)=>{a.d(t,{Zo:()=>p,kt:()=>h});var r=a(7294);function i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function n(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function l(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?n(Object(a),!0).forEach((function(t){i(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):n(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function o(e,t){if(null==e)return{};var a,r,i=function(e,t){if(null==e)return{};var a,r,i={},n=Object.keys(e);for(r=0;r<n.length;r++)a=n[r],t.indexOf(a)>=0||(i[a]=e[a]);return i}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)a=n[r],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var s=r.createContext({}),d=function(e){var t=r.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},p=function(e){var t=d(e.components);return r.createElement(s.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},u=r.forwardRef((function(e,t){var a=e.components,i=e.mdxType,n=e.originalType,s=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),c=d(a),u=i,h=c["".concat(s,".").concat(u)]||c[u]||m[u]||n;return a?r.createElement(h,l(l({ref:t},p),{},{components:a})):r.createElement(h,l({ref:t},p))}));function h(e,t){var a=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var n=a.length,l=new Array(n);l[0]=u;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[c]="string"==typeof e?e:i,l[1]=o;for(var d=2;d<n;d++)l[d]=a[d];return r.createElement.apply(null,l)}return r.createElement.apply(null,a)}u.displayName="MDXCreateElement"},7113:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>m,frontMatter:()=>n,metadata:()=>o,toc:()=>d});var r=a(7462),i=(a(7294),a(3905));const n={title:"Server",sidebar_position:1},l="Trial Datastore Server",o={unversionedId:"reference/cli/trial-datastore/trial-datastore-server",id:"reference/cli/trial-datastore/trial-datastore-server",title:"Server",description:"Cogment Trial Datastore implements the datalog API. It is designed to store the trajectory samples generated by the trials for online and offline usage.",source:"@site/docs/reference/cli/trial-datastore/trial-datastore-server.md",sourceDirName:"reference/cli/trial-datastore",slug:"/reference/cli/trial-datastore/trial-datastore-server",permalink:"/docs/reference/cli/trial-datastore/trial-datastore-server",draft:!1,tags:[],version:"current",lastUpdatedAt:1691703005,formattedLastUpdatedAt:"Aug 10, 2023",sidebarPosition:1,frontMatter:{title:"Server",sidebar_position:1},sidebar:"docSidebar",previous:{title:"Client",permalink:"/docs/reference/cli/directory/directory-client"},next:{title:"Client",permalink:"/docs/reference/cli/trial-datastore/trial-datastore-client"}},s={},d=[{value:"Configuration",id:"configuration",level:2},{value:"<code>port</code>",id:"port",level:3},{value:"<code>grpc_reflection</code>",id:"grpc_reflection",level:3},{value:"<code>memory_storage_max_samples_size</code>",id:"memory_storage_max_samples_size",level:3},{value:"<code>file_storage</code>",id:"file_storage",level:3},{value:"<code>log_level</code>",id:"log_level",level:3},{value:"<code>log_file</code>",id:"log_file",level:3},{value:"<code>directory_endpoint</code>",id:"directory_endpoint",level:3},{value:"<code>directory_authentication_token</code>",id:"directory_authentication_token",level:3},{value:"<code>directory_registration_host</code>",id:"directory_registration_host",level:3},{value:"<code>directory_registration_properties</code>",id:"directory_registration_properties",level:3}],p={toc:d},c="wrapper";function m(e){let{components:t,...a}=e;return(0,i.kt)(c,(0,r.Z)({},p,a,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"trial-datastore-server"},"Trial Datastore Server"),(0,i.kt)("p",null,"Cogment Trial Datastore implements the ",(0,i.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#additional-components"},"datalog API"),". It is designed to store the trajectory samples generated by the trials for online and offline usage."),(0,i.kt)("p",null,"The Cogment CLI also includes an implementation of a ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cli/trial-datastore/trial-datastore-client"},"client"),"."),(0,i.kt)("p",null,"The Trial Datastore service included in the Cogment CLI can work in two modes:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Memory storage"),", which is the default mode, stores the data in memory up to a maximum size and then evicts the least recently used samples."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"File storage")," stores the data on disk in a file. The storage engine relies on ",(0,i.kt)("a",{parentName:"li",href:"https://github.com/etcd-io/bbolt"},"bbolt"),".")),(0,i.kt)("p",null,"The Trial Datastore service is simply called this way"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"$ cogment services trial_datastore --port=9000 --file_storage=./database.db\n")),(0,i.kt)("h2",{id:"configuration"},"Configuration"),(0,i.kt)("p",null,"The Trial Datastore configuration can be specified either through the command line or environment variables."),(0,i.kt)("h3",{id:"port"},(0,i.kt)("inlineCode",{parentName:"h3"},"port")),(0,i.kt)("p",null,"The TCP port where to offer gRPC services.\nThe Trial Datastore offers two services at the same TCP port: the ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/grpc#datalog-api"},"Datalog API")," and the ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/grpc#trial-datastore-api"},"Trial Datastore API"),".\nThe Datalog API is where the Datastore receives the raw trial data from the Orchestrator.\nThe Trial Datastore API is is where the Datastore delivers online or offline stored data (typically to actors for training)."),(0,i.kt)("p",null,"If set to 0, then the system will automatically choose a free port.\nThis is normally used in combination with a ",(0,i.kt)("a",{parentName:"p",href:"#directory_endpoint"},"Directory"),"."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--port=12000"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_TRIAL_DATASTORE_PORT=12000"),","),(0,i.kt)("li",{parentName:"ul"},"its default value is 9003.")),(0,i.kt)("h3",{id:"grpc_reflection"},(0,i.kt)("inlineCode",{parentName:"h3"},"grpc_reflection")),(0,i.kt)("p",null,"Whether or not to enable ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/grpc/grpc/blob/master/doc/server-reflection.md"},"gRPC reflection")," on the served endpoints."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line flag, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--grpc_reflection"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_TRIAL_DATASTORE_GRPC_REFLECTION=1"),","),(0,i.kt)("li",{parentName:"ul"},"by default, it is disabled.")),(0,i.kt)("h3",{id:"memory_storage_max_samples_size"},(0,i.kt)("inlineCode",{parentName:"h3"},"memory_storage_max_samples_size")),(0,i.kt)("p",null,"This defines the maximum cumulated size of samples the memory storage holds before evicting least recently used trials samples. It is defined in bytes."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--memory_storage_max_samples_size=100000000"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_TRIAL_DATASTORE_MEMORY_STORAGE_MAX_SAMPLE_SIZE=100000000"),","),(0,i.kt)("li",{parentName:"ul"},"its default value is 1073741824 Bytes, i.e. 1GB.")),(0,i.kt)("h3",{id:"file_storage"},(0,i.kt)("inlineCode",{parentName:"h3"},"file_storage")),(0,i.kt)("p",null,"Path to the database file used by the file storage. If provided, the trial datastore will use the file storage."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line flag, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--file_storage"),", to use the default value ",(0,i.kt)("inlineCode",{parentName:"li"},".cogment/trial_datastore.db"),","),(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--file_storage=./path/to/trial_datastore.db"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_TRIAL_DATASTORE_FILE_STORAGE_PATH=./path/to/trial_datastore.db"),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")),(0,i.kt)("h3",{id:"log_level"},(0,i.kt)("inlineCode",{parentName:"h3"},"log_level")),(0,i.kt)("p",null,"Set to define the minimum level for logging. Possible values are: ",(0,i.kt)("inlineCode",{parentName:"p"},"off"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"error"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"warning"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"info"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"debug"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"trace"),". Note however that all trace and most debug level logs will only output if running the debug compiled version of the Orchestrator."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--log_level=debug"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_LOG_LEVEL=5"),","),(0,i.kt)("li",{parentName:"ul"},"default value is info.")),(0,i.kt)("h3",{id:"log_file"},(0,i.kt)("inlineCode",{parentName:"h3"},"log_file")),(0,i.kt)("p",null,"Base file name for daily log output. The name will be suffixed with the date and a new file will be made every day. If not provided the logs go to stdout."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--log_file=./path/to/cogment.log"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_LOG_FILE=./path/to/cogment.log"),","),(0,i.kt)("li",{parentName:"ul"},"default value is info.")),(0,i.kt)("h3",{id:"directory_endpoint"},(0,i.kt)("inlineCode",{parentName:"h3"},"directory_endpoint")),(0,i.kt)("p",null,"Cogment endpoint of the directory service. It must be a ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#grpc-scheme"},"gRPC endpoint"),". The directory will be used to register the trial datastore services for discovery by other services. If not provided, the trial datastore will not auto register, in which case manual registration to the directory must be done, or an explicit address must be provided to access the services of the trial datastore."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--directory_endpoint=grpc://foo:9005"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005"),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")),(0,i.kt)("h3",{id:"directory_authentication_token"},(0,i.kt)("inlineCode",{parentName:"h3"},"directory_authentication_token")),(0,i.kt)("p",null,"Authentication token for services registered in the Directory. It is recorded in the Directory when registering a service. And a matching token must be provided to inquire for the service. An empty token is the same as no token."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--directory_authentication_token=GH670ploT"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT"),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")),(0,i.kt)("h3",{id:"directory_registration_host"},(0,i.kt)("inlineCode",{parentName:"h3"},"directory_registration_host")),(0,i.kt)("p",null,"This is the host that will be registered to the Directory for the Trial Datastore services. If not provided, the Trial Datastore will determine its own IP address and use that as the registration host."),(0,i.kt)("p",null,"In some circumstances, the IP address determined by Cogment may be wrong (e.g. multiple interfaces, load balancing, firewall), thus a host (hostname or IP address) must be explicitly provided."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--directory_registration_host=foo.bar"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_TRIAL_DATASTORE_DIRECTORY_REGISTRATION_HOST=foo.bar"),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value (i.e. self determined IP address is used).")),(0,i.kt)("h3",{id:"directory_registration_properties"},(0,i.kt)("inlineCode",{parentName:"h3"},"directory_registration_properties")),(0,i.kt)("p",null,'These are the properties that will be registered to the Directory for the Trial Datastore services. When inquiring the Directory, the properties inquired must match the properties registered. This is a string representing multiple properties in the form "name=value,name=value,name=value" where the values are optional.'),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'--directory_registration_properties="Sim=20,hpp,mem=HIGH"'),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'COGMENT_TRIAL_DATASTORE_DIRECTORY_REGISTRATION_PROPERTIES="Sim=20,hpp,mem=HIGH"'),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/6c6cf206.4874a857.js b/assets/js/6c6cf206.4874a857.js deleted file mode 100644 index 43dd8b1..0000000 --- a/assets/js/6c6cf206.4874a857.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[966],{3905:(e,t,n)=>{n.d(t,{Zo:()=>s,kt:()=>d});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var l=r.createContext({}),p=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},s=function(e){var t=p(e.components);return r.createElement(l.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,o=e.originalType,l=e.parentName,s=c(e,["components","mdxType","originalType","parentName"]),m=p(n),d=i,f=m["".concat(l,".").concat(d)]||m[d]||u[d]||o;return n?r.createElement(f,a(a({ref:t},s),{},{components:n})):r.createElement(f,a({ref:t},s))}));function d(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var o=n.length,a=new Array(o);a[0]=m;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:i,a[1]=c;for(var p=2;p<o;p++)a[p]=n[p];return r.createElement.apply(null,a)}return r.createElement.apply(null,n)}m.displayName="MDXCreateElement"},1291:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>u,frontMatter:()=>o,metadata:()=>c,toc:()=>p});var r=n(7462),i=(n(7294),n(3905));const o={title:"Implementation Recipes"},a="Implementation recipes",c={unversionedId:"guide/implementation-recipes/index",id:"guide/implementation-recipes/index",title:"Implementation Recipes",description:"This section gathers implementation guides, or recipes, concerning specific topics not covered elsewhere. Beginners should start learning about using Cogment through the tutorial and general information are located in the api guide.",source:"@site/docs/guide/implementation-recipes/index.md",sourceDirName:"guide/implementation-recipes",slug:"/guide/implementation-recipes/",permalink:"/docs/guide/implementation-recipes/",draft:!1,tags:[],version:"current",lastUpdatedAt:1665763478,formattedLastUpdatedAt:"Oct 14, 2022",frontMatter:{title:"Implementation Recipes"},sidebar:"docSidebar",previous:{title:"Development guide",permalink:"/docs/guide/development-guide"},next:{title:"Configure Trial from Controller",permalink:"/docs/guide/implementation-recipes/configure-trial-from-controller"}},l={},p=[],s={toc:p};function u(e){let{components:t,...n}=e;return(0,i.kt)("wrapper",(0,r.Z)({},s,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"implementation-recipes"},"Implementation recipes"),(0,i.kt)("p",null,"This section gathers implementation guides, or recipes, concerning specific topics not covered elsewhere. Beginners should start learning about using Cogment through the ",(0,i.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/"},"tutorial")," and general information are located in the ",(0,i.kt)("a",{parentName:"p",href:"/docs/guide/development-guide"},"api guide"),"."),(0,i.kt)("h1",{id:"recipes"},"Recipes"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/docs/guide/implementation-recipes/v2-migration-guide"},"Migrate from Cogment v1 to Cogment v2")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/docs/guide/implementation-recipes/configure-trial-from-controller"},"Fully configure a trial from a controller"))),(0,i.kt)("p",null,"If you feel a specific topic is not addressed, please ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-doc/issues/new/choose"},"fill an issue")," or ",(0,i.kt)("a",{parentName:"p",href:"/docs/community-channels"},"get in touch"),"."))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/6c6cf206.5b4ed37f.js b/assets/js/6c6cf206.5b4ed37f.js new file mode 100644 index 0000000..463d614 --- /dev/null +++ b/assets/js/6c6cf206.5b4ed37f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[966],{3905:(e,t,n)=>{n.d(t,{Zo:()=>s,kt:()=>f});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var l=r.createContext({}),p=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},s=function(e){var t=p(e.components);return r.createElement(l.Provider,{value:t},e.children)},u="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,o=e.originalType,l=e.parentName,s=c(e,["components","mdxType","originalType","parentName"]),u=p(n),d=i,f=u["".concat(l,".").concat(d)]||u[d]||m[d]||o;return n?r.createElement(f,a(a({ref:t},s),{},{components:n})):r.createElement(f,a({ref:t},s))}));function f(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var o=n.length,a=new Array(o);a[0]=d;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c[u]="string"==typeof e?e:i,a[1]=c;for(var p=2;p<o;p++)a[p]=n[p];return r.createElement.apply(null,a)}return r.createElement.apply(null,n)}d.displayName="MDXCreateElement"},1291:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>m,frontMatter:()=>o,metadata:()=>c,toc:()=>p});var r=n(7462),i=(n(7294),n(3905));const o={title:"Implementation Recipes"},a="Implementation recipes",c={unversionedId:"guide/implementation-recipes/index",id:"guide/implementation-recipes/index",title:"Implementation Recipes",description:"This section gathers implementation guides, or recipes, concerning specific topics not covered elsewhere. Beginners should start learning about using Cogment through the tutorial and general information are located in the api guide.",source:"@site/docs/guide/implementation-recipes/index.md",sourceDirName:"guide/implementation-recipes",slug:"/guide/implementation-recipes/",permalink:"/docs/guide/implementation-recipes/",draft:!1,tags:[],version:"current",lastUpdatedAt:1665763478,formattedLastUpdatedAt:"Oct 14, 2022",frontMatter:{title:"Implementation Recipes"},sidebar:"docSidebar",previous:{title:"Development guide",permalink:"/docs/guide/development-guide"},next:{title:"Configure Trial from Controller",permalink:"/docs/guide/implementation-recipes/configure-trial-from-controller"}},l={},p=[],s={toc:p},u="wrapper";function m(e){let{components:t,...n}=e;return(0,i.kt)(u,(0,r.Z)({},s,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"implementation-recipes"},"Implementation recipes"),(0,i.kt)("p",null,"This section gathers implementation guides, or recipes, concerning specific topics not covered elsewhere. Beginners should start learning about using Cogment through the ",(0,i.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/"},"tutorial")," and general information are located in the ",(0,i.kt)("a",{parentName:"p",href:"/docs/guide/development-guide"},"api guide"),"."),(0,i.kt)("h1",{id:"recipes"},"Recipes"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/docs/guide/implementation-recipes/v2-migration-guide"},"Migrate from Cogment v1 to Cogment v2")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/docs/guide/implementation-recipes/configure-trial-from-controller"},"Fully configure a trial from a controller"))),(0,i.kt)("p",null,"If you feel a specific topic is not addressed, please ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-doc/issues/new/choose"},"fill an issue")," or ",(0,i.kt)("a",{parentName:"p",href:"/docs/community-channels"},"get in touch"),"."))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/6f2832ad.a9a521bd.js b/assets/js/6f2832ad.a9a521bd.js new file mode 100644 index 0000000..2ad0d3d --- /dev/null +++ b/assets/js/6f2832ad.a9a521bd.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[5307],{3905:(e,t,r)=>{r.d(t,{Zo:()=>s,kt:()=>m});var o=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t){if(null==e)return{};var r,o,a=function(e,t){if(null==e)return{};var r,o,a={},n=Object.keys(e);for(o=0;o<n.length;o++)r=n[o],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(o=0;o<n.length;o++)r=n[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var u=o.createContext({}),c=function(e){var t=o.useContext(u),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},s=function(e){var t=c(e.components);return o.createElement(u.Provider,{value:t},e.children)},d="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},f=o.forwardRef((function(e,t){var r=e.components,a=e.mdxType,n=e.originalType,u=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),d=c(r),f=a,m=d["".concat(u,".").concat(f)]||d[f]||p[f]||n;return r?o.createElement(m,i(i({ref:t},s),{},{components:r})):o.createElement(m,i({ref:t},s))}));function m(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var n=r.length,i=new Array(n);i[0]=f;var l={};for(var u in t)hasOwnProperty.call(t,u)&&(l[u]=t[u]);l.originalType=e,l[d]="string"==typeof e?e:a,i[1]=l;for(var c=2;c<n;c++)i[c]=r[c];return o.createElement.apply(null,i)}return o.createElement.apply(null,r)}f.displayName="MDXCreateElement"},6421:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>u,contentTitle:()=>i,default:()=>p,frontMatter:()=>n,metadata:()=>l,toc:()=>c});var o=r(7462),a=(r(7294),r(3905));const n={title:"Advanced Tutorial Steps"},i=void 0,l={unversionedId:"guide/tutorial/advanced-tutorials/index",id:"guide/tutorial/advanced-tutorials/index",title:"Advanced Tutorial Steps",description:"This section offers an interested reader a set of advanced tutorials to learn how about how to do more complex things with Cogment. These tutorials build off of the RPS basics tutorial, so it may be useful to follow these.",source:"@site/docs/guide/tutorial/advanced-tutorials/index.md",sourceDirName:"guide/tutorial/advanced-tutorials",slug:"/guide/tutorial/advanced-tutorials/",permalink:"/docs/guide/tutorial/advanced-tutorials/",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",frontMatter:{title:"Advanced Tutorial Steps"},sidebar:"docSidebar",previous:{title:"Step 4 - Making Decisions with Feedback",permalink:"/docs/guide/tutorial/decision-making"},next:{title:"Add a Human Player in the Loop",permalink:"/docs/guide/tutorial/advanced-tutorials/human-player"}},u={},c=[],s={toc:c},d="wrapper";function p(e){let{components:t,...r}=e;return(0,a.kt)(d,(0,o.Z)({},s,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"This section offers an interested reader a set of advanced tutorials to learn how about how to do more complex things with Cogment. These tutorials build off of the RPS basics tutorial, so it may be useful to follow these."),(0,a.kt)("p",null,'You can use the more advanced tutorials in a "choose your own adventure" style:'),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/guide/tutorial/advanced-tutorials/human-player"},"Have a human player in the loop")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/guide/tutorial/advanced-tutorials/web-client"},"Build a web interface for a human player to access your Cogment app")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/guide/tutorial/advanced-tutorials/directory"},"Improve operational efficiency by using more advanced Cogment tooling for service discovery"))),(0,a.kt)("p",null,"The steps above are in order of increasing complexity, but you need not necessarily complete all of them. You can get a working starting point by following the ",(0,a.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/setup"},"installation instructions")," and copying the code for the desired step of the tutorial you'd like to explore."))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/6f2832ad.e5b5393c.js b/assets/js/6f2832ad.e5b5393c.js deleted file mode 100644 index 46586db..0000000 --- a/assets/js/6f2832ad.e5b5393c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[5307],{3905:(e,t,r)=>{r.d(t,{Zo:()=>s,kt:()=>f});var o=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t){if(null==e)return{};var r,o,a=function(e,t){if(null==e)return{};var r,o,a={},n=Object.keys(e);for(o=0;o<n.length;o++)r=n[o],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(o=0;o<n.length;o++)r=n[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var u=o.createContext({}),c=function(e){var t=o.useContext(u),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},s=function(e){var t=c(e.components);return o.createElement(u.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},p=o.forwardRef((function(e,t){var r=e.components,a=e.mdxType,n=e.originalType,u=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),p=c(r),f=a,m=p["".concat(u,".").concat(f)]||p[f]||d[f]||n;return r?o.createElement(m,i(i({ref:t},s),{},{components:r})):o.createElement(m,i({ref:t},s))}));function f(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var n=r.length,i=new Array(n);i[0]=p;var l={};for(var u in t)hasOwnProperty.call(t,u)&&(l[u]=t[u]);l.originalType=e,l.mdxType="string"==typeof e?e:a,i[1]=l;for(var c=2;c<n;c++)i[c]=r[c];return o.createElement.apply(null,i)}return o.createElement.apply(null,r)}p.displayName="MDXCreateElement"},6421:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>u,contentTitle:()=>i,default:()=>d,frontMatter:()=>n,metadata:()=>l,toc:()=>c});var o=r(7462),a=(r(7294),r(3905));const n={title:"Advanced Tutorial Steps"},i=void 0,l={unversionedId:"guide/tutorial/advanced-tutorials/index",id:"guide/tutorial/advanced-tutorials/index",title:"Advanced Tutorial Steps",description:"This section offers an interested reader a set of advanced tutorials to learn how about how to do more complex things with Cogment. These tutorials build off of the RPS basics tutorial, so it may be useful to follow these.",source:"@site/docs/guide/tutorial/advanced-tutorials/index.md",sourceDirName:"guide/tutorial/advanced-tutorials",slug:"/guide/tutorial/advanced-tutorials/",permalink:"/docs/guide/tutorial/advanced-tutorials/",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",frontMatter:{title:"Advanced Tutorial Steps"},sidebar:"docSidebar",previous:{title:"Step 4 - Making Decisions with Feedback",permalink:"/docs/guide/tutorial/decision-making"},next:{title:"Add a Human Player in the Loop",permalink:"/docs/guide/tutorial/advanced-tutorials/human-player"}},u={},c=[],s={toc:c};function d(e){let{components:t,...r}=e;return(0,a.kt)("wrapper",(0,o.Z)({},s,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"This section offers an interested reader a set of advanced tutorials to learn how about how to do more complex things with Cogment. These tutorials build off of the RPS basics tutorial, so it may be useful to follow these."),(0,a.kt)("p",null,'You can use the more advanced tutorials in a "choose your own adventure" style:'),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/guide/tutorial/advanced-tutorials/human-player"},"Have a human player in the loop")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/guide/tutorial/advanced-tutorials/web-client"},"Build a web interface for a human player to access your Cogment app")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/guide/tutorial/advanced-tutorials/directory"},"Improve operational efficiency by using more advanced Cogment tooling for service discovery"))),(0,a.kt)("p",null,"The steps above are in order of increasing complexity, but you need not necessarily complete all of them. You can get a working starting point by following the ",(0,a.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/setup"},"installation instructions")," and copying the code for the desired step of the tutorial you'd like to explore."))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/710eddd2.0d5614ca.js b/assets/js/710eddd2.0d5614ca.js new file mode 100644 index 0000000..77b736c --- /dev/null +++ b/assets/js/710eddd2.0d5614ca.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[7221],{3905:(e,t,r)=>{r.d(t,{Zo:()=>p,kt:()=>h});var i=r(7294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t){if(null==e)return{};var r,i,n=function(e,t){if(null==e)return{};var r,i,n={},o=Object.keys(e);for(i=0;i<o.length;i++)r=o[i],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var c=i.createContext({}),d=function(e){var t=i.useContext(c),r=t;return e&&(r="function"==typeof e?e(t):a(a({},t),e)),r},p=function(e){var t=d(e.components);return i.createElement(c.Provider,{value:t},e.children)},s="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return i.createElement(i.Fragment,{},t)}},m=i.forwardRef((function(e,t){var r=e.components,n=e.mdxType,o=e.originalType,c=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),s=d(r),m=n,h=s["".concat(c,".").concat(m)]||s[m]||u[m]||o;return r?i.createElement(h,a(a({ref:t},p),{},{components:r})):i.createElement(h,a({ref:t},p))}));function h(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=r.length,a=new Array(o);a[0]=m;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l[s]="string"==typeof e?e:n,a[1]=l;for(var d=2;d<o;d++)a[d]=r[d];return i.createElement.apply(null,a)}return i.createElement.apply(null,r)}m.displayName="MDXCreateElement"},1167:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>c,contentTitle:()=>a,default:()=>u,frontMatter:()=>o,metadata:()=>l,toc:()=>d});var i=r(7462),n=(r(7294),r(3905));const o={title:"Client",sidebar_position:2},a="Directory Client",l={unversionedId:"reference/cli/directory/directory-client",id:"reference/cli/directory/directory-client",title:"Client",description:"The Directory Client is a utility to manually access (through the command line interface) the Directory service. It can be used to register, deregister (remove) and inquire services.",source:"@site/docs/reference/cli/directory/directory-client.md",sourceDirName:"reference/cli/directory",slug:"/reference/cli/directory/directory-client",permalink:"/docs/reference/cli/directory/directory-client",draft:!1,tags:[],version:"current",lastUpdatedAt:1697135297,formattedLastUpdatedAt:"Oct 12, 2023",sidebarPosition:2,frontMatter:{title:"Client",sidebar_position:2},sidebar:"docSidebar",previous:{title:"Server",permalink:"/docs/reference/cli/directory/directory-server"},next:{title:"Server",permalink:"/docs/reference/cli/trial-datastore/trial-datastore-server"}},c={},d=[{value:"Common Options",id:"common-options",level:2},{value:"<code>timeout</code>",id:"timeout",level:3},{value:"<code>directory_endpoint</code>",id:"directory_endpoint",level:3},{value:"<code>directory_authentication_token</code>",id:"directory_authentication_token",level:3},{value:"Directory Client Register",id:"directory-client-register",level:2},{value:"Output",id:"output",level:3},{value:"Command line",id:"command-line",level:3},{value:"<code>protocol</code>",id:"protocol",level:4},{value:"<code>host</code>",id:"host",level:4},{value:"<code>port</code>",id:"port",level:4},{value:"<code>ssl_required</code>",id:"ssl_required",level:4},{value:"<code>type</code>",id:"type",level:4},{value:"<code>permanent</code>",id:"permanent",level:4},{value:"<code>properties</code>",id:"properties",level:4},{value:"Directory Client Deregister",id:"directory-client-deregister",level:2},{value:"Output",id:"output-1",level:3},{value:"Command line",id:"command-line-1",level:3},{value:"<code>service_id</code>",id:"service_id",level:4},{value:"<code>secret</code>",id:"secret",level:4},{value:"Directory Client Inquire",id:"directory-client-inquire",level:2},{value:"Output",id:"output-2",level:3},{value:"Command line",id:"command-line-2",level:3},{value:"<code>service_id</code>",id:"service_id-1",level:4},{value:"<code>type</code>",id:"type-1",level:4},{value:"<code>properties</code>",id:"properties-1",level:4},{value:"Directory Client WaitForReady",id:"directory-client-waitforready",level:2}],p={toc:d},s="wrapper";function u(e){let{components:t,...r}=e;return(0,n.kt)(s,(0,i.Z)({},p,r,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("h1",{id:"directory-client"},"Directory Client"),(0,n.kt)("p",null,"The Directory Client is a utility to manually access (through the command line interface) the ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/cli/directory/directory-server"},"Directory service"),". It can be used to register, deregister (remove) and inquire services."),(0,n.kt)("h2",{id:"common-options"},"Common Options"),(0,n.kt)("p",null,"All directory clients have these options in common."),(0,n.kt)("h3",{id:"timeout"},(0,n.kt)("inlineCode",{parentName:"h3"},"timeout")),(0,n.kt)("p",null,'The maximum duration for the execution of the request. The duration should be specified as a sequence of numbers followed by a unit suffix: "300ms", "1.5h" or "2h45m" are valid timeouts. Valid time units are "ns", "us" (or "\xb5s"), "ms", "s", "m", "h".'),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--timeout=1m"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_CLIENT_TIMEOUT=90s"),","),(0,n.kt)("li",{parentName:"ul"},"its default value is 30 seconds.")),(0,n.kt)("h3",{id:"directory_endpoint"},(0,n.kt)("inlineCode",{parentName:"h3"},"directory_endpoint")),(0,n.kt)("p",null,"Cogment endpoint of the directory service. It must be a ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/parameters#grpc-scheme"},"gRPC endpoint"),"."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--directory_endpoint=grpc://foo:9005"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005"),","),(0,n.kt)("li",{parentName:"ul"},'its default value is "grpc://localhost:9005" (which is the default when running ',(0,n.kt)("inlineCode",{parentName:"li"},"cogment services directory")," locally).")),(0,n.kt)("h3",{id:"directory_authentication_token"},(0,n.kt)("inlineCode",{parentName:"h3"},"directory_authentication_token")),(0,n.kt)("p",null,"Authentication token for services registered in the Directory. It is recorded in the Directory when registering a service. And a matching token must be provided to inquire for the service. An empty token is the same as no token."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--directory_authentication_token=GH670ploT"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT"),","),(0,n.kt)("li",{parentName:"ul"},"it has no default value.")),(0,n.kt)("h2",{id:"directory-client-register"},"Directory Client Register"),(0,n.kt)("p",null,"This command is used to register (add) a service to the Directory."),(0,n.kt)("p",null,"E.g.:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},'$ cogment client directory register --directory_endpoint="grpc://dir:9005" --host="act" --port=9030 --type="actor" --properties="__actor_class=reporter,intensity=5,high_profile"\n\nService ID [7722934920723] Secret [ZGi6GLe]\n')),(0,n.kt)("h3",{id:"output"},"Output"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre"},"If successful, the output is the service ID of the newly registered service, and its secret string. The secret string is necessary to deregister the service.\n")),(0,n.kt)("h3",{id:"command-line"},"Command line"),(0,n.kt)("h4",{id:"protocol"},(0,n.kt)("inlineCode",{parentName:"h4"},"protocol")),(0,n.kt)("p",null,"The protocol (URL scheme) for the service endpoint. Can only be ",(0,n.kt)("inlineCode",{parentName:"p"},"grpc")," or ",(0,n.kt)("inlineCode",{parentName:"p"},"cogment"),". Default: ",(0,n.kt)("inlineCode",{parentName:"p"},"grpc"),"."),(0,n.kt)("h4",{id:"host"},(0,n.kt)("inlineCode",{parentName:"h4"},"host")),(0,n.kt)("p",null,"The host for the service endpoint."),(0,n.kt)("h4",{id:"port"},(0,n.kt)("inlineCode",{parentName:"h4"},"port")),(0,n.kt)("p",null,"The TCP port for the service endpoint."),(0,n.kt)("h4",{id:"ssl_required"},(0,n.kt)("inlineCode",{parentName:"h4"},"ssl_required")),(0,n.kt)("p",null,"A boolean value (",(0,n.kt)("inlineCode",{parentName:"p"},"true"),"/",(0,n.kt)("inlineCode",{parentName:"p"},"false"),") to indicate if SSL (encryption) is required to access the service. Default: ",(0,n.kt)("inlineCode",{parentName:"p"},"false"),"."),(0,n.kt)("h4",{id:"type"},(0,n.kt)("inlineCode",{parentName:"h4"},"type")),(0,n.kt)("p",null,"The service type. Can be ",(0,n.kt)("inlineCode",{parentName:"p"},"actor"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"environment"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"prehook"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"datalog"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"lifecycle"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"actservice"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"datastore"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"modelregistry")," or ",(0,n.kt)("inlineCode",{parentName:"p"},"other"),".\nThese are the same keywords used as ",(0,n.kt)("inlineCode",{parentName:"p"},"paths")," in Cogment ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/parameters#discovery-path"},"discovery endpoints"),"."),(0,n.kt)("h4",{id:"permanent"},(0,n.kt)("inlineCode",{parentName:"h4"},"permanent")),(0,n.kt)("p",null,"A boolean value (",(0,n.kt)("inlineCode",{parentName:"p"},"true"),"/",(0,n.kt)("inlineCode",{parentName:"p"},"false"),") to indicate if the service is to stay permanently in the directory (until explicitly deregistered). Permanent services are not checked for health or lifetime limits. Permanent services also get updated instead of being duplicated. Default: ",(0,n.kt)("inlineCode",{parentName:"p"},"false"),"."),(0,n.kt)("h4",{id:"properties"},(0,n.kt)("inlineCode",{parentName:"h4"},"properties")),(0,n.kt)("p",null,'The properties to be associated with the service. In the form of "name=value,name=value" where the value is optional.\nThe names and values of properties are restricted to a limited character set (see ',(0,n.kt)("a",{parentName:"p",href:"/docs/reference/parameters#discovery-query"},"endpoint query"),")."),(0,n.kt)("p",null,"Also see ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/parameters#discover-host"},"special properties")," used by Cogment."),(0,n.kt)("h2",{id:"directory-client-deregister"},"Directory Client Deregister"),(0,n.kt)("p",null,"This command is used to deregister (remove/delete) a service from the Directory."),(0,n.kt)("p",null,"E.g.:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},'$ cogment client directory deregister --directory_endpoint="grpc://dir:9005" --service_id=7722934920723 --secret="ZGi6GLe"\n')),(0,n.kt)("h3",{id:"output-1"},"Output"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre"},"If successful, no output is produced.\n")),(0,n.kt)("h3",{id:"command-line-1"},"Command line"),(0,n.kt)("h4",{id:"service_id"},(0,n.kt)("inlineCode",{parentName:"h4"},"service_id")),(0,n.kt)("p",null,"The ID of the service to remove."),(0,n.kt)("h4",{id:"secret"},(0,n.kt)("inlineCode",{parentName:"h4"},"secret")),(0,n.kt)("p",null,"The secret string that was returned when the service was registered."),(0,n.kt)("h2",{id:"directory-client-inquire"},"Directory Client Inquire"),(0,n.kt)("p",null,'This command is used to inquire (find) services in the Directory. Note that if services are not found (or the authentication token does not match), an empty list is returned, but there is no "error".'),(0,n.kt)("p",null,"E.g.:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},'$ cogment client directory inquire --type="actor" --properties="intensity=5,high_profile"\n\n[11] Services found\nService ID [7722934920723]\n Endpoint [grpc://act:9030] SSL required [false]\n Type [actor]\n [__registration_source] = [Cogment-Command_Line]\n [high_profile] = []\n [intensity] = [5]\n [__actor_class] = [reporter]\n')),(0,n.kt)("h3",{id:"output-2"},"Output"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre"},"If successful, the number of services found and the details of each service is output.\n")),(0,n.kt)("h3",{id:"command-line-2"},"Command line"),(0,n.kt)("h4",{id:"service_id-1"},(0,n.kt)("inlineCode",{parentName:"h4"},"service_id")),(0,n.kt)("p",null,"The ID of the service to find. If this is provided, the ",(0,n.kt)("inlineCode",{parentName:"p"},"type")," and ",(0,n.kt)("inlineCode",{parentName:"p"},"properties")," options cannot be used."),(0,n.kt)("h4",{id:"type-1"},(0,n.kt)("inlineCode",{parentName:"h4"},"type")),(0,n.kt)("p",null,"The service type to find. Can be ",(0,n.kt)("inlineCode",{parentName:"p"},"actor"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"environment"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"prehook"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"datalog"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"lifecycle"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"actservice"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"datastore"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"modelregistry")," or ",(0,n.kt)("inlineCode",{parentName:"p"},"other"),".\nThese are the same keywords used as ",(0,n.kt)("inlineCode",{parentName:"p"},"paths")," in Cogment ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/parameters#discovery-path"},"discovery endpoints"),"."),(0,n.kt)("p",null,"If this is provided, the ",(0,n.kt)("inlineCode",{parentName:"p"},"service_id")," option cannot be used."),(0,n.kt)("h4",{id:"properties-1"},(0,n.kt)("inlineCode",{parentName:"h4"},"properties")),(0,n.kt)("p",null,'The properties associated with the service to find. In the form of "name=value,name=value" where the value is optional. All properties must match (in name and value) the properties of the service for a match to occur.'),(0,n.kt)("p",null,"If this is provided, the ",(0,n.kt)("inlineCode",{parentName:"p"},"service_id")," option cannot be used."),(0,n.kt)("h2",{id:"directory-client-waitforready"},"Directory Client WaitForReady"),(0,n.kt)("p",null,"The client will wait for a connection to the directory.\nIf a connection cannot be established within the ",(0,n.kt)("a",{parentName:"p",href:"#timeout"},"timeout")," period, it returns an error, otherwise it returns success."))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/710eddd2.97c3fcd9.js b/assets/js/710eddd2.97c3fcd9.js deleted file mode 100644 index 065498c..0000000 --- a/assets/js/710eddd2.97c3fcd9.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[7221],{3905:(e,t,r)=>{r.d(t,{Zo:()=>p,kt:()=>m});var i=r(7294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t){if(null==e)return{};var r,i,n=function(e,t){if(null==e)return{};var r,i,n={},o=Object.keys(e);for(i=0;i<o.length;i++)r=o[i],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var c=i.createContext({}),d=function(e){var t=i.useContext(c),r=t;return e&&(r="function"==typeof e?e(t):a(a({},t),e)),r},p=function(e){var t=d(e.components);return i.createElement(c.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return i.createElement(i.Fragment,{},t)}},u=i.forwardRef((function(e,t){var r=e.components,n=e.mdxType,o=e.originalType,c=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=d(r),m=n,h=u["".concat(c,".").concat(m)]||u[m]||s[m]||o;return r?i.createElement(h,a(a({ref:t},p),{},{components:r})):i.createElement(h,a({ref:t},p))}));function m(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=r.length,a=new Array(o);a[0]=u;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l.mdxType="string"==typeof e?e:n,a[1]=l;for(var d=2;d<o;d++)a[d]=r[d];return i.createElement.apply(null,a)}return i.createElement.apply(null,r)}u.displayName="MDXCreateElement"},1167:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>c,contentTitle:()=>a,default:()=>s,frontMatter:()=>o,metadata:()=>l,toc:()=>d});var i=r(7462),n=(r(7294),r(3905));const o={title:"Client",sidebar_position:2},a="Directory Client",l={unversionedId:"reference/cli/directory/directory-client",id:"reference/cli/directory/directory-client",title:"Client",description:"The Directory Client is a utility to manually access (through the command line interface) the Directory service. It can be used to register, deregister (remove) and inquire services.",source:"@site/docs/reference/cli/directory/directory-client.md",sourceDirName:"reference/cli/directory",slug:"/reference/cli/directory/directory-client",permalink:"/docs/reference/cli/directory/directory-client",draft:!1,tags:[],version:"current",lastUpdatedAt:1697135297,formattedLastUpdatedAt:"Oct 12, 2023",sidebarPosition:2,frontMatter:{title:"Client",sidebar_position:2},sidebar:"docSidebar",previous:{title:"Server",permalink:"/docs/reference/cli/directory/directory-server"},next:{title:"Server",permalink:"/docs/reference/cli/trial-datastore/trial-datastore-server"}},c={},d=[{value:"Common Options",id:"common-options",level:2},{value:"<code>timeout</code>",id:"timeout",level:3},{value:"<code>directory_endpoint</code>",id:"directory_endpoint",level:3},{value:"<code>directory_authentication_token</code>",id:"directory_authentication_token",level:3},{value:"Directory Client Register",id:"directory-client-register",level:2},{value:"Output",id:"output",level:3},{value:"Command line",id:"command-line",level:3},{value:"<code>protocol</code>",id:"protocol",level:4},{value:"<code>host</code>",id:"host",level:4},{value:"<code>port</code>",id:"port",level:4},{value:"<code>ssl_required</code>",id:"ssl_required",level:4},{value:"<code>type</code>",id:"type",level:4},{value:"<code>permanent</code>",id:"permanent",level:4},{value:"<code>properties</code>",id:"properties",level:4},{value:"Directory Client Deregister",id:"directory-client-deregister",level:2},{value:"Output",id:"output-1",level:3},{value:"Command line",id:"command-line-1",level:3},{value:"<code>service_id</code>",id:"service_id",level:4},{value:"<code>secret</code>",id:"secret",level:4},{value:"Directory Client Inquire",id:"directory-client-inquire",level:2},{value:"Output",id:"output-2",level:3},{value:"Command line",id:"command-line-2",level:3},{value:"<code>service_id</code>",id:"service_id-1",level:4},{value:"<code>type</code>",id:"type-1",level:4},{value:"<code>properties</code>",id:"properties-1",level:4},{value:"Directory Client WaitForReady",id:"directory-client-waitforready",level:2}],p={toc:d};function s(e){let{components:t,...r}=e;return(0,n.kt)("wrapper",(0,i.Z)({},p,r,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("h1",{id:"directory-client"},"Directory Client"),(0,n.kt)("p",null,"The Directory Client is a utility to manually access (through the command line interface) the ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/cli/directory/directory-server"},"Directory service"),". It can be used to register, deregister (remove) and inquire services."),(0,n.kt)("h2",{id:"common-options"},"Common Options"),(0,n.kt)("p",null,"All directory clients have these options in common."),(0,n.kt)("h3",{id:"timeout"},(0,n.kt)("inlineCode",{parentName:"h3"},"timeout")),(0,n.kt)("p",null,'The maximum duration for the execution of the request. The duration should be specified as a sequence of numbers followed by a unit suffix: "300ms", "1.5h" or "2h45m" are valid timeouts. Valid time units are "ns", "us" (or "\xb5s"), "ms", "s", "m", "h".'),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--timeout=1m"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_CLIENT_TIMEOUT=90s"),","),(0,n.kt)("li",{parentName:"ul"},"its default value is 30 seconds.")),(0,n.kt)("h3",{id:"directory_endpoint"},(0,n.kt)("inlineCode",{parentName:"h3"},"directory_endpoint")),(0,n.kt)("p",null,"Cogment endpoint of the directory service. It must be a ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/parameters#grpc-scheme"},"gRPC endpoint"),"."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--directory_endpoint=grpc://foo:9005"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005"),","),(0,n.kt)("li",{parentName:"ul"},'its default value is "grpc://localhost:9005" (which is the default when running ',(0,n.kt)("inlineCode",{parentName:"li"},"cogment services directory")," locally).")),(0,n.kt)("h3",{id:"directory_authentication_token"},(0,n.kt)("inlineCode",{parentName:"h3"},"directory_authentication_token")),(0,n.kt)("p",null,"Authentication token for services registered in the Directory. It is recorded in the Directory when registering a service. And a matching token must be provided to inquire for the service. An empty token is the same as no token."),(0,n.kt)("p",null,"Can be specified as:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"--directory_authentication_token=GH670ploT"),","),(0,n.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT"),","),(0,n.kt)("li",{parentName:"ul"},"it has no default value.")),(0,n.kt)("h2",{id:"directory-client-register"},"Directory Client Register"),(0,n.kt)("p",null,"This command is used to register (add) a service to the Directory."),(0,n.kt)("p",null,"E.g.:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},'$ cogment client directory register --directory_endpoint="grpc://dir:9005" --host="act" --port=9030 --type="actor" --properties="__actor_class=reporter,intensity=5,high_profile"\n\nService ID [7722934920723] Secret [ZGi6GLe]\n')),(0,n.kt)("h3",{id:"output"},"Output"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre"},"If successful, the output is the service ID of the newly registered service, and its secret string. The secret string is necessary to deregister the service.\n")),(0,n.kt)("h3",{id:"command-line"},"Command line"),(0,n.kt)("h4",{id:"protocol"},(0,n.kt)("inlineCode",{parentName:"h4"},"protocol")),(0,n.kt)("p",null,"The protocol (URL scheme) for the service endpoint. Can only be ",(0,n.kt)("inlineCode",{parentName:"p"},"grpc")," or ",(0,n.kt)("inlineCode",{parentName:"p"},"cogment"),". Default: ",(0,n.kt)("inlineCode",{parentName:"p"},"grpc"),"."),(0,n.kt)("h4",{id:"host"},(0,n.kt)("inlineCode",{parentName:"h4"},"host")),(0,n.kt)("p",null,"The host for the service endpoint."),(0,n.kt)("h4",{id:"port"},(0,n.kt)("inlineCode",{parentName:"h4"},"port")),(0,n.kt)("p",null,"The TCP port for the service endpoint."),(0,n.kt)("h4",{id:"ssl_required"},(0,n.kt)("inlineCode",{parentName:"h4"},"ssl_required")),(0,n.kt)("p",null,"A boolean value (",(0,n.kt)("inlineCode",{parentName:"p"},"true"),"/",(0,n.kt)("inlineCode",{parentName:"p"},"false"),") to indicate if SSL (encryption) is required to access the service. Default: ",(0,n.kt)("inlineCode",{parentName:"p"},"false"),"."),(0,n.kt)("h4",{id:"type"},(0,n.kt)("inlineCode",{parentName:"h4"},"type")),(0,n.kt)("p",null,"The service type. Can be ",(0,n.kt)("inlineCode",{parentName:"p"},"actor"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"environment"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"prehook"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"datalog"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"lifecycle"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"actservice"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"datastore"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"modelregistry")," or ",(0,n.kt)("inlineCode",{parentName:"p"},"other"),".\nThese are the same keywords used as ",(0,n.kt)("inlineCode",{parentName:"p"},"paths")," in Cogment ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/parameters#discovery-path"},"discovery endpoints"),"."),(0,n.kt)("h4",{id:"permanent"},(0,n.kt)("inlineCode",{parentName:"h4"},"permanent")),(0,n.kt)("p",null,"A boolean value (",(0,n.kt)("inlineCode",{parentName:"p"},"true"),"/",(0,n.kt)("inlineCode",{parentName:"p"},"false"),") to indicate if the service is to stay permanently in the directory (until explicitly deregistered). Permanent services are not checked for health or lifetime limits. Permanent services also get updated instead of being duplicated. Default: ",(0,n.kt)("inlineCode",{parentName:"p"},"false"),"."),(0,n.kt)("h4",{id:"properties"},(0,n.kt)("inlineCode",{parentName:"h4"},"properties")),(0,n.kt)("p",null,'The properties to be associated with the service. In the form of "name=value,name=value" where the value is optional.\nThe names and values of properties are restricted to a limited character set (see ',(0,n.kt)("a",{parentName:"p",href:"/docs/reference/parameters#discovery-query"},"endpoint query"),")."),(0,n.kt)("p",null,"Also see ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/parameters#discover-host"},"special properties")," used by Cogment."),(0,n.kt)("h2",{id:"directory-client-deregister"},"Directory Client Deregister"),(0,n.kt)("p",null,"This command is used to deregister (remove/delete) a service from the Directory."),(0,n.kt)("p",null,"E.g.:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},'$ cogment client directory deregister --directory_endpoint="grpc://dir:9005" --service_id=7722934920723 --secret="ZGi6GLe"\n')),(0,n.kt)("h3",{id:"output-1"},"Output"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre"},"If successful, no output is produced.\n")),(0,n.kt)("h3",{id:"command-line-1"},"Command line"),(0,n.kt)("h4",{id:"service_id"},(0,n.kt)("inlineCode",{parentName:"h4"},"service_id")),(0,n.kt)("p",null,"The ID of the service to remove."),(0,n.kt)("h4",{id:"secret"},(0,n.kt)("inlineCode",{parentName:"h4"},"secret")),(0,n.kt)("p",null,"The secret string that was returned when the service was registered."),(0,n.kt)("h2",{id:"directory-client-inquire"},"Directory Client Inquire"),(0,n.kt)("p",null,'This command is used to inquire (find) services in the Directory. Note that if services are not found (or the authentication token does not match), an empty list is returned, but there is no "error".'),(0,n.kt)("p",null,"E.g.:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},'$ cogment client directory inquire --type="actor" --properties="intensity=5,high_profile"\n\n[11] Services found\nService ID [7722934920723]\n Endpoint [grpc://act:9030] SSL required [false]\n Type [actor]\n [__registration_source] = [Cogment-Command_Line]\n [high_profile] = []\n [intensity] = [5]\n [__actor_class] = [reporter]\n')),(0,n.kt)("h3",{id:"output-2"},"Output"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre"},"If successful, the number of services found and the details of each service is output.\n")),(0,n.kt)("h3",{id:"command-line-2"},"Command line"),(0,n.kt)("h4",{id:"service_id-1"},(0,n.kt)("inlineCode",{parentName:"h4"},"service_id")),(0,n.kt)("p",null,"The ID of the service to find. If this is provided, the ",(0,n.kt)("inlineCode",{parentName:"p"},"type")," and ",(0,n.kt)("inlineCode",{parentName:"p"},"properties")," options cannot be used."),(0,n.kt)("h4",{id:"type-1"},(0,n.kt)("inlineCode",{parentName:"h4"},"type")),(0,n.kt)("p",null,"The service type to find. Can be ",(0,n.kt)("inlineCode",{parentName:"p"},"actor"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"environment"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"prehook"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"datalog"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"lifecycle"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"actservice"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"datastore"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"modelregistry")," or ",(0,n.kt)("inlineCode",{parentName:"p"},"other"),".\nThese are the same keywords used as ",(0,n.kt)("inlineCode",{parentName:"p"},"paths")," in Cogment ",(0,n.kt)("a",{parentName:"p",href:"/docs/reference/parameters#discovery-path"},"discovery endpoints"),"."),(0,n.kt)("p",null,"If this is provided, the ",(0,n.kt)("inlineCode",{parentName:"p"},"service_id")," option cannot be used."),(0,n.kt)("h4",{id:"properties-1"},(0,n.kt)("inlineCode",{parentName:"h4"},"properties")),(0,n.kt)("p",null,'The properties associated with the service to find. In the form of "name=value,name=value" where the value is optional. All properties must match (in name and value) the properties of the service for a match to occur.'),(0,n.kt)("p",null,"If this is provided, the ",(0,n.kt)("inlineCode",{parentName:"p"},"service_id")," option cannot be used."),(0,n.kt)("h2",{id:"directory-client-waitforready"},"Directory Client WaitForReady"),(0,n.kt)("p",null,"The client will wait for a connection to the directory.\nIf a connection cannot be established within the ",(0,n.kt)("a",{parentName:"p",href:"#timeout"},"timeout")," period, it returns an error, otherwise it returns success."))}s.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/76d0d1d8.322e3cf9.js b/assets/js/76d0d1d8.322e3cf9.js new file mode 100644 index 0000000..b6f08b5 --- /dev/null +++ b/assets/js/76d0d1d8.322e3cf9.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[1257],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>u});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var c=r.createContext({}),l=function(e){var t=r.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},d=function(e){var t=l(e.components);return r.createElement(c.Provider,{value:t},e.children)},p="mdxType",h={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,o=e.originalType,c=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),p=l(n),m=i,u=p["".concat(c,".").concat(m)]||p[m]||h[m]||o;return n?r.createElement(u,a(a({ref:t},d),{},{components:n})):r.createElement(u,a({ref:t},d))}));function u(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var o=n.length,a=new Array(o);a[0]=m;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s[p]="string"==typeof e?e:i,a[1]=s;for(var l=2;l<o;l++)a[l]=n[l];return r.createElement.apply(null,a)}return r.createElement.apply(null,n)}m.displayName="MDXCreateElement"},8113:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>a,default:()=>h,frontMatter:()=>o,metadata:()=>s,toc:()=>l});var r=n(7462),i=(n(7294),n(3905));const o={},a="Improve Operational Efficiency with a Cogment Directory for Service Discovery",s={unversionedId:"guide/tutorial/advanced-tutorials/directory",id:"guide/tutorial/advanced-tutorials/directory",title:"Improve Operational Efficiency with a Cogment Directory for Service Discovery",description:"It is not necessary to have gone through all the previous sections to understand this part, but the code changes refer to the code in the previous step. The code can be retrieved from the tutorial's repository.",source:"@site/docs/guide/tutorial/advanced-tutorials/8-directory.md",sourceDirName:"guide/tutorial/advanced-tutorials",slug:"/guide/tutorial/advanced-tutorials/directory",permalink:"/docs/guide/tutorial/advanced-tutorials/directory",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:8,frontMatter:{},sidebar:"docSidebar",previous:{title:"Add a Web Client for the Human Player",permalink:"/docs/guide/tutorial/advanced-tutorials/web-client"},next:{title:"Specifications File",permalink:"/docs/reference/cogment-yaml"}},c={},l=[{value:"Adding the Directory service",id:"adding-the-directory-service",level:2},{value:"Registering services to the Directory",id:"registering-services-to-the-directory",level:2},{value:"Discovering services from the Directory",id:"discovering-services-from-the-directory",level:2},{value:"Special case for Client Actors",id:"special-case-for-client-actors",level:2},{value:"Authentication Token",id:"authentication-token",level:2}],d={toc:l},p="wrapper";function h(e){let{components:t,...n}=e;return(0,i.kt)(p,(0,r.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"improve-operational-efficiency-with-a-cogment-directory-for-service-discovery"},"Improve Operational Efficiency with a Cogment Directory for Service Discovery"),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"It is not necessary to have gone through all the previous sections to understand this part, but the code changes refer to the code in the previous step. The code can be retrieved from the ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-tutorial-rps"},"tutorial's repository"),".")),(0,i.kt)("p",null,"In this step of the tutorial, we will add the Cogment ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cli/directory/directory-server"},"Directory")," to\nthe project. A directory is a register of services together with the network addresses where to connect to the services.\nThis will let components find the services they need instead of having to already know the network address.\nIt makes it easier to manage more complicated projects and complex deployments."),(0,i.kt)("h2",{id:"adding-the-directory-service"},"Adding the Directory service"),(0,i.kt)("p",null,"In the ",(0,i.kt)("inlineCode",{parentName:"p"},"./run.sh")," script we will add the command to start the Directory service."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"function directory_start() {\n cogment services directory --port=9005\n}\n")),(0,i.kt)("p",null,"Since the Directory is a service that all other services depend upon, it needs to be started first."),(0,i.kt)("p",null,"Here we have a few choices; we could decide to start it in a separate terminal before the other services, or we could\nstart it in the background with the same command as starting the services. It could also be kept running all the time."),(0,i.kt)("p",null,"For the purpose of demonstration and simplicity we will start it in the background, so in the ",(0,i.kt)("inlineCode",{parentName:"p"},"./run.sh")," script we will\nchange the ",(0,i.kt)("inlineCode",{parentName:"p"},"services_start")," command like this:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"function services_start() {\n directory_start &\n sleep 3\n _run_parallel orchestrator_start environment_start random_agent_start dqn_agent_start\n}\n")),(0,i.kt)("h2",{id:"registering-services-to-the-directory"},"Registering services to the Directory"),(0,i.kt)("p",null,'Now that we have a directory, we need to register the services so they can be "discovered" by components.\nThe Cogment SDK and CLI know how to use a directory and will register themselves if possible.\nTo make it possible, the components need to know the network address of the directory.\nThis can be provided on an individual basis at the code level, e.g.:'),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},' context = cogment.Context(cog_settings=cog_settings, user_id="rps", directory_endpoint="grpc://localhost:9005")\n')),(0,i.kt)("p",null,"For the CLI it can be provided on the command line, e.g.:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'$ cogment services orchestrator --directory_endpoint="grpc://localhost:9005"\n')),(0,i.kt)("p",null,"But the easiest way is to set the environment variable ",(0,i.kt)("inlineCode",{parentName:"p"},"COGMENT_DIRECTORY_ENDPOINT"),", which is what we will do here by\nadding it to the ",(0,i.kt)("inlineCode",{parentName:"p"},"./.env")," file. And while we are there, we will parametrize the directory port for better maintainability:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'DIRECTORY_PORT=9005\nCOGMENT_DIRECTORY_ENDPOINT="grpc://localhost:${DIRECTORY_PORT}"\n')),(0,i.kt)("p",null,"and in ",(0,i.kt)("inlineCode",{parentName:"p"},"./run.sh")," we update the directory start command like this:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'function directory_start() {\n _load_dot_env\n cogment services directory --port="${DIRECTORY_PORT}"\n}\n')),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"In special circumstances, which we don't need for this tutorial, components can be registered explicitly with the\n",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cli/directory/directory-client"},"Directory client CLI"),".")),(0,i.kt)("h2",{id:"discovering-services-from-the-directory"},"Discovering services from the Directory"),(0,i.kt)("p",null,'We have a directory, and the services are registered in that directory, but for it to be useful, we need to "discover"\nthese services. This is done by providing Cogment with ',(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#cogment-endpoints"},"discovery endpoints"),"\ninstead grpc endpoints (i.e. network addresses)."),(0,i.kt)("p",null,"Let's start with the Trial Runner (",(0,i.kt)("inlineCode",{parentName:"p"},"./trial_runner/main.py"),"), we'll change the endpoint variables to context discovery endpoints like this:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'ORCHESTRATOR_ENDPOINT = "cogment://discover"\nENVIRONMENT_ENDPOINT = "cogment://discover"\nRANDOM_AGENT_ENDPOINT = "cogment://discover"\nDQN_AGENT_ENDPOINT = "cogment://discover"\n')),(0,i.kt)("p",null,'How is Cogment differentiating and finding the right service? This is done by using the context where the endpoint is provided, thus the name "context" discovery endpoint. Endpoints can also be "explicit" discovery endpoints, in which case they don\'t use the context in which they are used; all the information is in the endpoint explicitly (since we consider the context information to be implicit).'),(0,i.kt)("p",null,"An example of context information can be seen here where the orchestrator endpoint is given:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'controller = await context.get_controller(endpoint=cogment.Endpoint("cogment://discover"))\n')),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment://discover")," string does not contain anything to say that this is for an orchestrator.\nBut because it is given to the ",(0,i.kt)("inlineCode",{parentName:"p"},"get_controller")," parameter which requires an orchestrator endpoint, Cogment has the context that this is an endpoint to communicate with an orchestrator, so it will use this fact (i.e. this must be an endpoint for an orchestrator) to inquire the directory. In other words, it matters where a context discovery endpoint is used."),(0,i.kt)("p",null,"We can also simplify the code even further because the method ",(0,i.kt)("inlineCode",{parentName:"p"},"get_controller")," has a default endpoint parameter, and the default value for a ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.Endpoint"),' is a pure context discovery endpoint (i.e. "cogment://discover"), so we can change it like this:'),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"controller = await context.get_controller()\n")),(0,i.kt)("p",null,"Which means that we don't need the ",(0,i.kt)("inlineCode",{parentName:"p"},"ORCHESTRATOR_ENDPOINT")," variable anymore, and we'll remove that from the Trial Runner file.\nThen we also don't need the ",(0,i.kt)("inlineCode",{parentName:"p"},"ORCHESTRATOR_HOST")," environment variable, and we'll remove that from the ",(0,i.kt)("inlineCode",{parentName:"p"},"./.env")," file. Note\nthat we still want to keep the ",(0,i.kt)("inlineCode",{parentName:"p"},"ORCHESTRATOR_PORT")," environment variable to centralize the port selection for our\ndifferent services, it just makes it easier to maintain our project."),(0,i.kt)("p",null,"Now we do the same (still in the Trial Runner file) for the environment; we remove the ",(0,i.kt)("inlineCode",{parentName:"p"},"ENVIRONMENT_ENDPOINT")," variable, and\nsince the environment also has a pure context discovery default endpoint, we can remove it:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'trial_params=cogment.TrialParameters(\n cog_settings,\n environment_name="env",\n environment_config=environment_config,\n actors=[\n actor_1_params,\n actor_2_params,\n ]\n )\n')),(0,i.kt)("p",null,"And we remove the ",(0,i.kt)("inlineCode",{parentName:"p"},"ENVIRONMENT_HOST")," environment variable from the ",(0,i.kt)("inlineCode",{parentName:"p"},"./.env")," file."),(0,i.kt)("p",null,'And finally for the actors... But wait a second, we have multiple actors, how is Cogment to differentiate them?\nIn this case, it is easy, the context for actors has three elements: that it is an "actor, its actor class, and its\nimplementation name (note that the environment also has an implementation name in its context, but here we only have one\nenvironment, so there is no confusion).\nSince all our actors have different implementation names, then the context is sufficient to uniquely identify our actors.\nSo we do the same here as we did for the environment, and again the default endpoint for actors is a context discovery\nendpoint, so we can remove it, getting:'),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'actor_1_params = cogment.ActorParameters(\n cog_settings,\n name="player_1",\n class_name="player",\n implementation="dqn_agent"\n )\n actor_2_params = cogment.ActorParameters(\n cog_settings,\n name="player_2",\n class_name="player",\n implementation="heuristic_agent"\n )\n')),(0,i.kt)("p",null,"and the final ",(0,i.kt)("inlineCode",{parentName:"p"},"./.env")," file looks like this:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'ORCHESTRATOR_PORT=9000\nENVIRONMENT_PORT=9001\nRANDOM_AGENT_PORT=9002\nDQN_AGENT_PORT=9003\nDIRECTORY_PORT=9005\nCOGMENT_DIRECTORY_ENDPOINT="grpc://localhost:${DIRECTORY_PORT}"\n')),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"In cases when the context would not be enough to differentiate between services, the directory allows properties to be\nadded to registered services (e.g. for actors, as parameters to the ",(0,i.kt)("inlineCode",{parentName:"p"},"Context.register_actor")," method), and these\nproperties can be added to a context discovery endpoint (e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment://discover?tag=red&zone=1"),").")),(0,i.kt)("h2",{id:"special-case-for-client-actors"},"Special case for Client Actors"),(0,i.kt)("p",null,"In step 5 and 6 of the tutorial we had a client actor. Client actors are effectively not services and thus don't register themselves in the directory. They could be explicitly registered using the CLI if it could simplify things, but for the purpose of this tutorial, it is not useful. On the other hand, the way a client actor joins a trial is simplified when there is a directory.\nInstead of something like this:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'await context.join_trial(trial_id=trial_id, endpoint=cogment.Endpoint(ORCHESTRATOR_ENDPOINT), actor_name="player_1")\n')),(0,i.kt)("p",null,"Because, again, the endpoint parameter has a default context discovery endpoint, this would suffice:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'await context.join_trial(trial_id=trial_id, actor_name="player_1")\n')),(0,i.kt)("h2",{id:"authentication-token"},"Authentication Token"),(0,i.kt)("p",null,"All directory communications require an Authentication Token. By default, this is empty, but it can be set to any string and used in many situations. One case that is useful is to isolate different running projects, when there is only a single directory that is always running. The easiest way to do this is to add this environment variable to the ",(0,i.kt)("inlineCode",{parentName:"p"},"./.env")," file:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'COGMENT_DIRECTORY_AUTHENTICATION_TOKEN="project-tutorial-8"\n')),(0,i.kt)("p",null,"Then all registrations will use this authentication token and all inquiries will require this authentication token\n(i.e. only services that were registered with this authentication token will be found)."),(0,i.kt)("h1",{id:"step-85-using-cogment-environment-variables"},"Step 8.5: Using Cogment environment variables"),(0,i.kt)("p",null,"In this step we'll use the Cogment environment variables to simplify management of the project.\nSo we will add these environment variables to the ",(0,i.kt)("inlineCode",{parentName:"p"},"./.env")," file:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"COGMENT_DIRECTORY_PORT=9005\nCOGMENT_LIFECYCLE_PORT=9000\nCOGMENT_ACTOR_PORT=9000\n")),(0,i.kt)("p",null,"and remove the tutorial specifc variables, which leaves us with a ",(0,i.kt)("inlineCode",{parentName:"p"},"./.env")," file that looks like this:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'# Local (tutorial specific) variables\nENVIRONMENT_PORT=9001\nRANDOM_AGENT_PORT=9002\nDQN_AGENT_PORT=9003\n\n# Cogment environment variables\nCOGMENT_LIFECYCLE_PORT=9000\nCOGMENT_ACTOR_PORT=9000\nCOGMENT_DIRECTORY_PORT=9005\nCOGMENT_DIRECTORY_ENDPOINT="grpc://localhost:${COGMENT_DIRECTORY_PORT}"\nCOGMENT_DIRECTORY_AUTHENTICATION_TOKEN="project-tutorial-8"\n')),(0,i.kt)("p",null,"With this, these two commands in the ",(0,i.kt)("inlineCode",{parentName:"p"},"./run.sh")," file are simplified to:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"function directory_start() {\n _load_dot_env\n cogment services directory\n}\n\nfunction orchestrator_start() {\n _load_dot_env\n cogment services orchestrator\n}\n")))}h.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/76d0d1d8.fef871bb.js b/assets/js/76d0d1d8.fef871bb.js deleted file mode 100644 index 1eab747..0000000 --- a/assets/js/76d0d1d8.fef871bb.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[1257],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>m});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var c=r.createContext({}),l=function(e){var t=r.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},d=function(e){var t=l(e.components);return r.createElement(c.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},h=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,o=e.originalType,c=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),h=l(n),m=i,u=h["".concat(c,".").concat(m)]||h[m]||p[m]||o;return n?r.createElement(u,a(a({ref:t},d),{},{components:n})):r.createElement(u,a({ref:t},d))}));function m(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var o=n.length,a=new Array(o);a[0]=h;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s.mdxType="string"==typeof e?e:i,a[1]=s;for(var l=2;l<o;l++)a[l]=n[l];return r.createElement.apply(null,a)}return r.createElement.apply(null,n)}h.displayName="MDXCreateElement"},8113:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>a,default:()=>p,frontMatter:()=>o,metadata:()=>s,toc:()=>l});var r=n(7462),i=(n(7294),n(3905));const o={},a="Improve Operational Efficiency with a Cogment Directory for Service Discovery",s={unversionedId:"guide/tutorial/advanced-tutorials/directory",id:"guide/tutorial/advanced-tutorials/directory",title:"Improve Operational Efficiency with a Cogment Directory for Service Discovery",description:"It is not necessary to have gone through all the previous sections to understand this part, but the code changes refer to the code in the previous step. The code can be retrieved from the tutorial's repository.",source:"@site/docs/guide/tutorial/advanced-tutorials/8-directory.md",sourceDirName:"guide/tutorial/advanced-tutorials",slug:"/guide/tutorial/advanced-tutorials/directory",permalink:"/docs/guide/tutorial/advanced-tutorials/directory",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:8,frontMatter:{},sidebar:"docSidebar",previous:{title:"Add a Web Client for the Human Player",permalink:"/docs/guide/tutorial/advanced-tutorials/web-client"},next:{title:"Specifications File",permalink:"/docs/reference/cogment-yaml"}},c={},l=[{value:"Adding the Directory service",id:"adding-the-directory-service",level:2},{value:"Registering services to the Directory",id:"registering-services-to-the-directory",level:2},{value:"Discovering services from the Directory",id:"discovering-services-from-the-directory",level:2},{value:"Special case for Client Actors",id:"special-case-for-client-actors",level:2},{value:"Authentication Token",id:"authentication-token",level:2}],d={toc:l};function p(e){let{components:t,...n}=e;return(0,i.kt)("wrapper",(0,r.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"improve-operational-efficiency-with-a-cogment-directory-for-service-discovery"},"Improve Operational Efficiency with a Cogment Directory for Service Discovery"),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"It is not necessary to have gone through all the previous sections to understand this part, but the code changes refer to the code in the previous step. The code can be retrieved from the ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-tutorial-rps"},"tutorial's repository"),".")),(0,i.kt)("p",null,"In this step of the tutorial, we will add the Cogment ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cli/directory/directory-server"},"Directory")," to\nthe project. A directory is a register of services together with the network addresses where to connect to the services.\nThis will let components find the services they need instead of having to already know the network address.\nIt makes it easier to manage more complicated projects and complex deployments."),(0,i.kt)("h2",{id:"adding-the-directory-service"},"Adding the Directory service"),(0,i.kt)("p",null,"In the ",(0,i.kt)("inlineCode",{parentName:"p"},"./run.sh")," script we will add the command to start the Directory service."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"function directory_start() {\n cogment services directory --port=9005\n}\n")),(0,i.kt)("p",null,"Since the Directory is a service that all other services depend upon, it needs to be started first."),(0,i.kt)("p",null,"Here we have a few choices; we could decide to start it in a separate terminal before the other services, or we could\nstart it in the background with the same command as starting the services. It could also be kept running all the time."),(0,i.kt)("p",null,"For the purpose of demonstration and simplicity we will start it in the background, so in the ",(0,i.kt)("inlineCode",{parentName:"p"},"./run.sh")," script we will\nchange the ",(0,i.kt)("inlineCode",{parentName:"p"},"services_start")," command like this:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"function services_start() {\n directory_start &\n sleep 3\n _run_parallel orchestrator_start environment_start random_agent_start dqn_agent_start\n}\n")),(0,i.kt)("h2",{id:"registering-services-to-the-directory"},"Registering services to the Directory"),(0,i.kt)("p",null,'Now that we have a directory, we need to register the services so they can be "discovered" by components.\nThe Cogment SDK and CLI know how to use a directory and will register themselves if possible.\nTo make it possible, the components need to know the network address of the directory.\nThis can be provided on an individual basis at the code level, e.g.:'),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},' context = cogment.Context(cog_settings=cog_settings, user_id="rps", directory_endpoint="grpc://localhost:9005")\n')),(0,i.kt)("p",null,"For the CLI it can be provided on the command line, e.g.:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'$ cogment services orchestrator --directory_endpoint="grpc://localhost:9005"\n')),(0,i.kt)("p",null,"But the easiest way is to set the environment variable ",(0,i.kt)("inlineCode",{parentName:"p"},"COGMENT_DIRECTORY_ENDPOINT"),", which is what we will do here by\nadding it to the ",(0,i.kt)("inlineCode",{parentName:"p"},"./.env")," file. And while we are there, we will parametrize the directory port for better maintainability:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'DIRECTORY_PORT=9005\nCOGMENT_DIRECTORY_ENDPOINT="grpc://localhost:${DIRECTORY_PORT}"\n')),(0,i.kt)("p",null,"and in ",(0,i.kt)("inlineCode",{parentName:"p"},"./run.sh")," we update the directory start command like this:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'function directory_start() {\n _load_dot_env\n cogment services directory --port="${DIRECTORY_PORT}"\n}\n')),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"In special circumstances, which we don't need for this tutorial, components can be registered explicitly with the\n",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cli/directory/directory-client"},"Directory client CLI"),".")),(0,i.kt)("h2",{id:"discovering-services-from-the-directory"},"Discovering services from the Directory"),(0,i.kt)("p",null,'We have a directory, and the services are registered in that directory, but for it to be useful, we need to "discover"\nthese services. This is done by providing Cogment with ',(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#cogment-endpoints"},"discovery endpoints"),"\ninstead grpc endpoints (i.e. network addresses)."),(0,i.kt)("p",null,"Let's start with the Trial Runner (",(0,i.kt)("inlineCode",{parentName:"p"},"./trial_runner/main.py"),"), we'll change the endpoint variables to context discovery endpoints like this:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'ORCHESTRATOR_ENDPOINT = "cogment://discover"\nENVIRONMENT_ENDPOINT = "cogment://discover"\nRANDOM_AGENT_ENDPOINT = "cogment://discover"\nDQN_AGENT_ENDPOINT = "cogment://discover"\n')),(0,i.kt)("p",null,'How is Cogment differentiating and finding the right service? This is done by using the context where the endpoint is provided, thus the name "context" discovery endpoint. Endpoints can also be "explicit" discovery endpoints, in which case they don\'t use the context in which they are used; all the information is in the endpoint explicitly (since we consider the context information to be implicit).'),(0,i.kt)("p",null,"An example of context information can be seen here where the orchestrator endpoint is given:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'controller = await context.get_controller(endpoint=cogment.Endpoint("cogment://discover"))\n')),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment://discover")," string does not contain anything to say that this is for an orchestrator.\nBut because it is given to the ",(0,i.kt)("inlineCode",{parentName:"p"},"get_controller")," parameter which requires an orchestrator endpoint, Cogment has the context that this is an endpoint to communicate with an orchestrator, so it will use this fact (i.e. this must be an endpoint for an orchestrator) to inquire the directory. In other words, it matters where a context discovery endpoint is used."),(0,i.kt)("p",null,"We can also simplify the code even further because the method ",(0,i.kt)("inlineCode",{parentName:"p"},"get_controller")," has a default endpoint parameter, and the default value for a ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.Endpoint"),' is a pure context discovery endpoint (i.e. "cogment://discover"), so we can change it like this:'),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"controller = await context.get_controller()\n")),(0,i.kt)("p",null,"Which means that we don't need the ",(0,i.kt)("inlineCode",{parentName:"p"},"ORCHESTRATOR_ENDPOINT")," variable anymore, and we'll remove that from the Trial Runner file.\nThen we also don't need the ",(0,i.kt)("inlineCode",{parentName:"p"},"ORCHESTRATOR_HOST")," environment variable, and we'll remove that from the ",(0,i.kt)("inlineCode",{parentName:"p"},"./.env")," file. Note\nthat we still want to keep the ",(0,i.kt)("inlineCode",{parentName:"p"},"ORCHESTRATOR_PORT")," environment variable to centralize the port selection for our\ndifferent services, it just makes it easier to maintain our project."),(0,i.kt)("p",null,"Now we do the same (still in the Trial Runner file) for the environment; we remove the ",(0,i.kt)("inlineCode",{parentName:"p"},"ENVIRONMENT_ENDPOINT")," variable, and\nsince the environment also has a pure context discovery default endpoint, we can remove it:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'trial_params=cogment.TrialParameters(\n cog_settings,\n environment_name="env",\n environment_config=environment_config,\n actors=[\n actor_1_params,\n actor_2_params,\n ]\n )\n')),(0,i.kt)("p",null,"And we remove the ",(0,i.kt)("inlineCode",{parentName:"p"},"ENVIRONMENT_HOST")," environment variable from the ",(0,i.kt)("inlineCode",{parentName:"p"},"./.env")," file."),(0,i.kt)("p",null,'And finally for the actors... But wait a second, we have multiple actors, how is Cogment to differentiate them?\nIn this case, it is easy, the context for actors has three elements: that it is an "actor, its actor class, and its\nimplementation name (note that the environment also has an implementation name in its context, but here we only have one\nenvironment, so there is no confusion).\nSince all our actors have different implementation names, then the context is sufficient to uniquely identify our actors.\nSo we do the same here as we did for the environment, and again the default endpoint for actors is a context discovery\nendpoint, so we can remove it, getting:'),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'actor_1_params = cogment.ActorParameters(\n cog_settings,\n name="player_1",\n class_name="player",\n implementation="dqn_agent"\n )\n actor_2_params = cogment.ActorParameters(\n cog_settings,\n name="player_2",\n class_name="player",\n implementation="heuristic_agent"\n )\n')),(0,i.kt)("p",null,"and the final ",(0,i.kt)("inlineCode",{parentName:"p"},"./.env")," file looks like this:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'ORCHESTRATOR_PORT=9000\nENVIRONMENT_PORT=9001\nRANDOM_AGENT_PORT=9002\nDQN_AGENT_PORT=9003\nDIRECTORY_PORT=9005\nCOGMENT_DIRECTORY_ENDPOINT="grpc://localhost:${DIRECTORY_PORT}"\n')),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"In cases when the context would not be enough to differentiate between services, the directory allows properties to be\nadded to registered services (e.g. for actors, as parameters to the ",(0,i.kt)("inlineCode",{parentName:"p"},"Context.register_actor")," method), and these\nproperties can be added to a context discovery endpoint (e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment://discover?tag=red&zone=1"),").")),(0,i.kt)("h2",{id:"special-case-for-client-actors"},"Special case for Client Actors"),(0,i.kt)("p",null,"In step 5 and 6 of the tutorial we had a client actor. Client actors are effectively not services and thus don't register themselves in the directory. They could be explicitly registered using the CLI if it could simplify things, but for the purpose of this tutorial, it is not useful. On the other hand, the way a client actor joins a trial is simplified when there is a directory.\nInstead of something like this:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'await context.join_trial(trial_id=trial_id, endpoint=cogment.Endpoint(ORCHESTRATOR_ENDPOINT), actor_name="player_1")\n')),(0,i.kt)("p",null,"Because, again, the endpoint parameter has a default context discovery endpoint, this would suffice:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'await context.join_trial(trial_id=trial_id, actor_name="player_1")\n')),(0,i.kt)("h2",{id:"authentication-token"},"Authentication Token"),(0,i.kt)("p",null,"All directory communications require an Authentication Token. By default, this is empty, but it can be set to any string and used in many situations. One case that is useful is to isolate different running projects, when there is only a single directory that is always running. The easiest way to do this is to add this environment variable to the ",(0,i.kt)("inlineCode",{parentName:"p"},"./.env")," file:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'COGMENT_DIRECTORY_AUTHENTICATION_TOKEN="project-tutorial-8"\n')),(0,i.kt)("p",null,"Then all registrations will use this authentication token and all inquiries will require this authentication token\n(i.e. only services that were registered with this authentication token will be found)."),(0,i.kt)("h1",{id:"step-85-using-cogment-environment-variables"},"Step 8.5: Using Cogment environment variables"),(0,i.kt)("p",null,"In this step we'll use the Cogment environment variables to simplify management of the project.\nSo we will add these environment variables to the ",(0,i.kt)("inlineCode",{parentName:"p"},"./.env")," file:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"COGMENT_DIRECTORY_PORT=9005\nCOGMENT_LIFECYCLE_PORT=9000\nCOGMENT_ACTOR_PORT=9000\n")),(0,i.kt)("p",null,"and remove the tutorial specifc variables, which leaves us with a ",(0,i.kt)("inlineCode",{parentName:"p"},"./.env")," file that looks like this:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'# Local (tutorial specific) variables\nENVIRONMENT_PORT=9001\nRANDOM_AGENT_PORT=9002\nDQN_AGENT_PORT=9003\n\n# Cogment environment variables\nCOGMENT_LIFECYCLE_PORT=9000\nCOGMENT_ACTOR_PORT=9000\nCOGMENT_DIRECTORY_PORT=9005\nCOGMENT_DIRECTORY_ENDPOINT="grpc://localhost:${COGMENT_DIRECTORY_PORT}"\nCOGMENT_DIRECTORY_AUTHENTICATION_TOKEN="project-tutorial-8"\n')),(0,i.kt)("p",null,"With this, these two commands in the ",(0,i.kt)("inlineCode",{parentName:"p"},"./run.sh")," file are simplified to:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"function directory_start() {\n _load_dot_env\n cogment services directory\n}\n\nfunction orchestrator_start() {\n _load_dot_env\n cogment services orchestrator\n}\n")))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/7a87d372.6b3c6bdb.js b/assets/js/7a87d372.6b3c6bdb.js new file mode 100644 index 0000000..1a4f415 --- /dev/null +++ b/assets/js/7a87d372.6b3c6bdb.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[3953],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>f});var a=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},r=Object.keys(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=a.createContext({}),c=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=c(e.components);return a.createElement(l.Provider,{value:t},e.children)},m="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,r=e.originalType,l=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),m=c(n),d=o,f=m["".concat(l,".").concat(d)]||m[d]||u[d]||r;return n?a.createElement(f,i(i({ref:t},p),{},{components:n})):a.createElement(f,i({ref:t},p))}));function f(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=n.length,i=new Array(r);i[0]=d;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[m]="string"==typeof e?e:o,i[1]=s;for(var c=2;c<r;c++)i[c]=n[c];return a.createElement.apply(null,i)}return a.createElement.apply(null,n)}d.displayName="MDXCreateElement"},3031:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>i,default:()=>u,frontMatter:()=>r,metadata:()=>s,toc:()=>c});var a=n(7462),o=(n(7294),n(3905));const r={sidebar_position:1},i="Specifications File",s={unversionedId:"reference/cogment-yaml",id:"reference/cogment-yaml",title:"Specifications File",description:"The specifications file (typically named cogment.yaml) is central to every Cogment project that use a Cogment SDK. This file is used to define the specifics of a type of trials. It can also contain data (the commands section) used by the Cogment CLI tool. A generator tool specific to each SDK takes this file as its main input to, among other things, configure the SDK.",source:"@site/docs/reference/cogment-yaml.md",sourceDirName:"reference",slug:"/reference/cogment-yaml",permalink:"/docs/reference/cogment-yaml",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"docSidebar",previous:{title:"Improve Operational Efficiency with a Cogment Directory for Service Discovery",permalink:"/docs/guide/tutorial/advanced-tutorials/directory"},next:{title:"Trial Parameters",permalink:"/docs/reference/parameters"}},l={},c=[{value:"Import",id:"import",level:2},{value:"Commands",id:"commands",level:2},{value:"Trial",id:"trial",level:2},{value:"Environment",id:"environment",level:2},{value:"Actor Classes",id:"actor-classes",level:2}],p={toc:c},m="wrapper";function u(e){let{components:t,...n}=e;return(0,o.kt)(m,(0,a.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"specifications-file"},"Specifications File"),(0,o.kt)("p",null,"The specifications file (typically named ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml"),") is central to every Cogment project that use a Cogment SDK. This file is used to define the specifics of a type of trials. It can also contain data (the ",(0,o.kt)("inlineCode",{parentName:"p"},"commands")," section) used by the Cogment CLI tool. A generator tool specific to each SDK takes this file as its main input to, among other things, configure the SDK."),(0,o.kt)("p",null,"The top level sections in the file are:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"#import"},"import"),": Used to import other proto files into the definition of the project"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"#commands"},"commands"),": Optional. Defines the commands that can be run by the Cogment CLI"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"#trial"},"trial"),": Define trial specific properties"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"#environment"},"environment"),": Define environment specific properties"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"#actor-classes"},"actor_classes"),": Define actor specific properties (for each actor class)")),(0,o.kt)("p",null,'In this document, "section" refers to YAML mappings.'),(0,o.kt)("h2",{id:"import"},"Import"),(0,o.kt)("p",null,"The import section is used to specify external data structures, and optionally code, that is referenced in other parts of the file. The referenced files must be in the same folder as the spec file. The import sections are:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"proto"),": List of protobuf definition files. Message types defined in these files are used to communicate between the various components")),(0,o.kt)("p",null,"All Cogment projects will need at least one ",(0,o.kt)("inlineCode",{parentName:"p"},"proto")," import to define the data structures exchanged between the various components."),(0,o.kt)("p",null,"E.g.:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-yaml"},"import:\n proto:\n - filename1.proto\n - filename2.proto\n")),(0,o.kt)("blockquote",null,(0,o.kt)("p",{parentName:"blockquote"},"\u26a0\ufe0f ",(0,o.kt)("strong",{parentName:"p"},"N.B.")," When using message types imported from a ",(0,o.kt)("inlineCode",{parentName:"p"},".proto")," file, types need to be referred through their ",(0,o.kt)("em",{parentName:"p"},"package")," namespace, not the filename containing them.")),(0,o.kt)("h2",{id:"commands"},"Commands"),(0,o.kt)("p",null,"This section is optional and defines commands that can then be executed using the Cogment CLI ",(0,o.kt)("inlineCode",{parentName:"p"},"run")," command. The commands will be executed by a sub-shell and thus can be any shell command. The commands can also recursively call Cogment, either built-in CLI commands, or other commands defined here. But care should be taken not to create infinite recursive calls."),(0,o.kt)("p",null,"E.g.:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-yaml"},"commands:\n generate: |\n cd client && python -m cogment.generate --spec cogment.yaml && cd ..\n cd environment && python -m cogment.generate --spec cogment.yaml && cd ..\n copy: cogment copy cogment.yaml *.proto params.yaml client environment\n start: docker-compose up orchestrator agent env\n play: cogment run start && docker-compose run launcher\n")),(0,o.kt)("p",null,"To run one of these commands, the Cogment CLI command ",(0,o.kt)("inlineCode",{parentName:"p"},"run")," must be used, e.g.: ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment run start"),". And as such there is no problem differentiating between ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment run copy")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment copy")," (the latter is the builtin CLI command, and the former is the command defined in the ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file)."),(0,o.kt)("p",null,"The cogment command section exists so that commands can be executed in a platform independant manner."),(0,o.kt)("h2",{id:"trial"},"Trial"),(0,o.kt)("p",null,"This section defines properties related to the trial and trial management. It has the properties:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"config_type"),": (optional) The protobuf message type (data structure) that will be passed on to the pre-trial hooks.")),(0,o.kt)("p",null,"E.g.:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-yaml"},"trial:\n config_type: namespace.DataType\n")),(0,o.kt)("h2",{id:"environment"},"Environment"),(0,o.kt)("p",null,"This section defines properties related to the environment. It has the properties:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"config_type"),": (optional) The protobuf message type used to configure the environment")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-yaml"},"environment:\n config_type: namespace.DataType\n")),(0,o.kt)("h2",{id:"actor-classes"},"Actor Classes"),(0,o.kt)("p",null,"Arguably the most important section of the spec file, the actor classes section describes the actor types that can be present in the project's trials."),(0,o.kt)("p",null,"The content of this section is a list of actor classes, each containing the necessary properties to define an actor class. These properties are:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"name"),": The name by which this actor class is known"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"action"),": Mapping of properties- ",(0,o.kt)("inlineCode",{parentName:"li"},"space"),": The protobuf message type that represents all the possible actions that this actor class can perform (its action space)"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"observation"),": Mapping of properties",(0,o.kt)("ul",{parentName:"li"},(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"space"),": The protobuf message type that represents a snapshot of the data that this actor class has access to (its observation space)"))),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"config_type"),": (optional) Defines the protobuf message type used to configure this actor class")),(0,o.kt)("p",null,"Each actor class should define both an observation and action space as protobuf message types."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-yaml"},"actor_classes:\n - name: BigPlayer\n action:\n space: namespace.PlayerAction\n observation:\n space: namespace.PlayerObservation\n config_type: namespace.PlayerConfig\n\n - name: SmallPlayer\n action:\n space: namespace.PlayerAction\n observation:\n space: namespace.PlayerObservation\n config_type: namespace.PlayerConfig\n\n - name: Referee\n action:\n space: namespace.RefereeAction\n observation:\n space: namespace.RefereeObservation\n config_type: namespace.RefereeConfig\n")))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/7a87d372.7e5409a8.js b/assets/js/7a87d372.7e5409a8.js deleted file mode 100644 index a790184..0000000 --- a/assets/js/7a87d372.7e5409a8.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[3953],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>d});var a=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},r=Object.keys(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=a.createContext({}),c=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=c(e.components);return a.createElement(l.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},u=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,r=e.originalType,l=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),u=c(n),d=o,f=u["".concat(l,".").concat(d)]||u[d]||m[d]||r;return n?a.createElement(f,i(i({ref:t},p),{},{components:n})):a.createElement(f,i({ref:t},p))}));function d(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=n.length,i=new Array(r);i[0]=u;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s.mdxType="string"==typeof e?e:o,i[1]=s;for(var c=2;c<r;c++)i[c]=n[c];return a.createElement.apply(null,i)}return a.createElement.apply(null,n)}u.displayName="MDXCreateElement"},3031:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>i,default:()=>m,frontMatter:()=>r,metadata:()=>s,toc:()=>c});var a=n(7462),o=(n(7294),n(3905));const r={sidebar_position:1},i="Specifications File",s={unversionedId:"reference/cogment-yaml",id:"reference/cogment-yaml",title:"Specifications File",description:"The specifications file (typically named cogment.yaml) is central to every Cogment project that use a Cogment SDK. This file is used to define the specifics of a type of trials. It can also contain data (the commands section) used by the Cogment CLI tool. A generator tool specific to each SDK takes this file as its main input to, among other things, configure the SDK.",source:"@site/docs/reference/cogment-yaml.md",sourceDirName:"reference",slug:"/reference/cogment-yaml",permalink:"/docs/reference/cogment-yaml",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"docSidebar",previous:{title:"Improve Operational Efficiency with a Cogment Directory for Service Discovery",permalink:"/docs/guide/tutorial/advanced-tutorials/directory"},next:{title:"Trial Parameters",permalink:"/docs/reference/parameters"}},l={},c=[{value:"Import",id:"import",level:2},{value:"Commands",id:"commands",level:2},{value:"Trial",id:"trial",level:2},{value:"Environment",id:"environment",level:2},{value:"Actor Classes",id:"actor-classes",level:2}],p={toc:c};function m(e){let{components:t,...n}=e;return(0,o.kt)("wrapper",(0,a.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"specifications-file"},"Specifications File"),(0,o.kt)("p",null,"The specifications file (typically named ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml"),") is central to every Cogment project that use a Cogment SDK. This file is used to define the specifics of a type of trials. It can also contain data (the ",(0,o.kt)("inlineCode",{parentName:"p"},"commands")," section) used by the Cogment CLI tool. A generator tool specific to each SDK takes this file as its main input to, among other things, configure the SDK."),(0,o.kt)("p",null,"The top level sections in the file are:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"#import"},"import"),": Used to import other proto files into the definition of the project"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"#commands"},"commands"),": Optional. Defines the commands that can be run by the Cogment CLI"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"#trial"},"trial"),": Define trial specific properties"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"#environment"},"environment"),": Define environment specific properties"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"#actor-classes"},"actor_classes"),": Define actor specific properties (for each actor class)")),(0,o.kt)("p",null,'In this document, "section" refers to YAML mappings.'),(0,o.kt)("h2",{id:"import"},"Import"),(0,o.kt)("p",null,"The import section is used to specify external data structures, and optionally code, that is referenced in other parts of the file. The referenced files must be in the same folder as the spec file. The import sections are:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"proto"),": List of protobuf definition files. Message types defined in these files are used to communicate between the various components")),(0,o.kt)("p",null,"All Cogment projects will need at least one ",(0,o.kt)("inlineCode",{parentName:"p"},"proto")," import to define the data structures exchanged between the various components."),(0,o.kt)("p",null,"E.g.:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-yaml"},"import:\n proto:\n - filename1.proto\n - filename2.proto\n")),(0,o.kt)("blockquote",null,(0,o.kt)("p",{parentName:"blockquote"},"\u26a0\ufe0f ",(0,o.kt)("strong",{parentName:"p"},"N.B.")," When using message types imported from a ",(0,o.kt)("inlineCode",{parentName:"p"},".proto")," file, types need to be referred through their ",(0,o.kt)("em",{parentName:"p"},"package")," namespace, not the filename containing them.")),(0,o.kt)("h2",{id:"commands"},"Commands"),(0,o.kt)("p",null,"This section is optional and defines commands that can then be executed using the Cogment CLI ",(0,o.kt)("inlineCode",{parentName:"p"},"run")," command. The commands will be executed by a sub-shell and thus can be any shell command. The commands can also recursively call Cogment, either built-in CLI commands, or other commands defined here. But care should be taken not to create infinite recursive calls."),(0,o.kt)("p",null,"E.g.:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-yaml"},"commands:\n generate: |\n cd client && python -m cogment.generate --spec cogment.yaml && cd ..\n cd environment && python -m cogment.generate --spec cogment.yaml && cd ..\n copy: cogment copy cogment.yaml *.proto params.yaml client environment\n start: docker-compose up orchestrator agent env\n play: cogment run start && docker-compose run launcher\n")),(0,o.kt)("p",null,"To run one of these commands, the Cogment CLI command ",(0,o.kt)("inlineCode",{parentName:"p"},"run")," must be used, e.g.: ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment run start"),". And as such there is no problem differentiating between ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment run copy")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment copy")," (the latter is the builtin CLI command, and the former is the command defined in the ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file)."),(0,o.kt)("p",null,"The cogment command section exists so that commands can be executed in a platform independant manner."),(0,o.kt)("h2",{id:"trial"},"Trial"),(0,o.kt)("p",null,"This section defines properties related to the trial and trial management. It has the properties:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"config_type"),": (optional) The protobuf message type (data structure) that will be passed on to the pre-trial hooks.")),(0,o.kt)("p",null,"E.g.:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-yaml"},"trial:\n config_type: namespace.DataType\n")),(0,o.kt)("h2",{id:"environment"},"Environment"),(0,o.kt)("p",null,"This section defines properties related to the environment. It has the properties:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"config_type"),": (optional) The protobuf message type used to configure the environment")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-yaml"},"environment:\n config_type: namespace.DataType\n")),(0,o.kt)("h2",{id:"actor-classes"},"Actor Classes"),(0,o.kt)("p",null,"Arguably the most important section of the spec file, the actor classes section describes the actor types that can be present in the project's trials."),(0,o.kt)("p",null,"The content of this section is a list of actor classes, each containing the necessary properties to define an actor class. These properties are:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"name"),": The name by which this actor class is known"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"action"),": Mapping of properties- ",(0,o.kt)("inlineCode",{parentName:"li"},"space"),": The protobuf message type that represents all the possible actions that this actor class can perform (its action space)"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"observation"),": Mapping of properties",(0,o.kt)("ul",{parentName:"li"},(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"space"),": The protobuf message type that represents a snapshot of the data that this actor class has access to (its observation space)"))),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"config_type"),": (optional) Defines the protobuf message type used to configure this actor class")),(0,o.kt)("p",null,"Each actor class should define both an observation and action space as protobuf message types."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-yaml"},"actor_classes:\n - name: BigPlayer\n action:\n space: namespace.PlayerAction\n observation:\n space: namespace.PlayerObservation\n config_type: namespace.PlayerConfig\n\n - name: SmallPlayer\n action:\n space: namespace.PlayerAction\n observation:\n space: namespace.PlayerObservation\n config_type: namespace.PlayerConfig\n\n - name: Referee\n action:\n space: namespace.RefereeAction\n observation:\n space: namespace.RefereeObservation\n config_type: namespace.RefereeConfig\n")))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/80b5be58.275e3f65.js b/assets/js/80b5be58.275e3f65.js new file mode 100644 index 0000000..d54f596 --- /dev/null +++ b/assets/js/80b5be58.275e3f65.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[1028],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>f});var a=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=a.createContext({}),p=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):r(r({},t),e)),n},c=function(e){var t=p(e.components);return a.createElement(l.Provider,{value:t},e.children)},h="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,l=e.parentName,c=s(e,["components","mdxType","originalType","parentName"]),h=p(n),d=o,f=h["".concat(l,".").concat(d)]||h[d]||m[d]||i;return n?a.createElement(f,r(r({ref:t},c),{},{components:n})):a.createElement(f,r({ref:t},c))}));function f(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,r=new Array(i);r[0]=d;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[h]="string"==typeof e?e:o,r[1]=s;for(var p=2;p<i;p++)r[p]=n[p];return a.createElement.apply(null,r)}return a.createElement.apply(null,n)}d.displayName="MDXCreateElement"},2383:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>r,default:()=>m,frontMatter:()=>i,metadata:()=>s,toc:()=>p});var a=n(7462),o=(n(7294),n(3905));const i={title:"Step 2 - Actors in Cogment"},r="Actors: Players of RPS",s={unversionedId:"guide/tutorial/actors-in-cogment",id:"guide/tutorial/actors-in-cogment",title:"Step 2 - Actors in Cogment",description:"Now that we have a working but empty Cogment app, let's look at how these pieces interact in the context of the RPS game. In this step of the tutorial, we will lay out how Actors are defined in Cogment. To build out our RPS application, we will add the ability for our Actors to select actions (rather than produce empty strings).",source:"@site/docs/guide/tutorial/2-actors-in-cogment.md",sourceDirName:"guide/tutorial",slug:"/guide/tutorial/actors-in-cogment",permalink:"/docs/guide/tutorial/actors-in-cogment",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:2,frontMatter:{title:"Step 2 - Actors in Cogment"},sidebar:"docSidebar",previous:{title:"Step 1 - An Empty Cogment Application",permalink:"/docs/guide/tutorial/setup"},next:{title:"Step 3 - The Environment in Cogment",permalink:"/docs/guide/tutorial/environment-in-cogment"}},l={},p=[{value:"What does Cogment need to know about an Actor?",id:"what-does-cogment-need-to-know-about-an-actor",level:2},{value:"Defining the Actor Service",id:"defining-the-actor-service",level:2},{value:"Defining the Actor Class",id:"defining-the-actor-class",level:2},{value:"Action Space",id:"action-space",level:3},{value:"Observation Space",id:"observation-space",level:3},{value:"Defining the Actor Implementation",id:"defining-the-actor-implementation",level:2},{value:"Completing the <code>random_agent</code> Actor Implementation",id:"completing-the-random_agent-actor-implementation",level:2},{value:"Specifying which Actors participate in the Trial",id:"specifying-which-actors-participate-in-the-trial",level:2}],c={toc:p},h="wrapper";function m(e){let{components:t,...i}=e;return(0,o.kt)(h,(0,a.Z)({},c,i,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"actors-players-of-rps"},"Actors: Players of RPS"),(0,o.kt)("p",null,"Now that we have a working but empty Cogment app, let's look at how these pieces interact in the context of the RPS game. In this step of the tutorial, we will lay out how Actors are defined in Cogment. To build out our RPS application, we will add the ability for our Actors to select actions (rather than produce empty strings)."),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Actors and Environment interaction in RPS",src:n(4207).Z,width:"2582",height:"932"})),(0,o.kt)("h2",{id:"what-does-cogment-need-to-know-about-an-actor"},"What does Cogment need to know about an Actor?"),(0,o.kt)("p",null,"In Cogment, the general concept of an ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#actors"},"Actor")," is a role that has agency. In RPS, this is a player of the game. At a high level, Cogment operates the same whether the Actor is human or machine-based. For now, we will just look at machine-based Actors. A more in-depth tutorial will guide you through implementing a ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#client-and-service-actors"},"client Actor")," which can be used by a human player to participate in the RPS game."),(0,o.kt)("p",null,"To fully specify Actors in Cogment, we need to define what they do (what observations they take and actions they produce), how they do it, and where they run those computations."),(0,o.kt)("p",null,"To better understand how Cogment represents Actors, the following terminology is important to highlight:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("strong",{parentName:"li"},"Actor Service")," is the designated computational node where Actor instances run. A service can manage multiple Actor instances concurrently. The Actor Service is ",(0,o.kt)("em",{parentName:"li"},"where")," the computations are run. The Actor Service is launched by ",(0,o.kt)("inlineCode",{parentName:"li"},"actors/main.py")," on the TCP port set by the ",(0,o.kt)("inlineCode",{parentName:"li"},"ACTORS_PORT")," variable in the ",(0,o.kt)("inlineCode",{parentName:"li"},".env")," file."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("strong",{parentName:"li"},"Actor Class")," is the specification of the attributes and behaviours that an Actor can have, for example what sort of inputs the Actor expects and what sort of outputs it will produce. If we want to have several different Actors that all behave similarly (take same type of inputs and produce same type of outputs) we can define an Actor class and different ",(0,o.kt)("em",{parentName:"li"},"instances")," of that class can use different implementations. The Actor Class defines ",(0,o.kt)("em",{parentName:"li"},"what")," the Actor does. The Actor Classes are defined in the ",(0,o.kt)("inlineCode",{parentName:"li"},"cogment.yaml")," file in the root directory (which is copied to each service directory as part of the ",(0,o.kt)("inlineCode",{parentName:"li"},"./run.sh install")," command)."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("strong",{parentName:"li"},"Actor Implementation")," is the logic of how the role operates. Specifically, the implementation refers to the function which controls how the Actor makes decisions about what action to output given some input information about the state of the world. The Actor implementation is ",(0,o.kt)("em",{parentName:"li"},"how")," the Actor chooses actions. The function we use for our first Actor implementation is defined in ",(0,o.kt)("inlineCode",{parentName:"li"},"actors/main.py"),".")),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"different concepts of actors",src:n(7358).Z,width:"1950",height:"888"}),"\nIn the above image, we showcase these different concepts: the ",(0,o.kt)("strong",{parentName:"p"},"Actor Class"),' "Player" lays out the skeleton for what components the Actor will need to manage. We can create an ',(0,o.kt)("strong",{parentName:"p"},"instance")," of this class (gray) with an ",(0,o.kt)("strong",{parentName:"p"},"Actor Implementation")," that does random action selection, which takes an Observation as input and produces an action as output. The computations made by the Player Actor instance are run on the ",(0,o.kt)("strong",{parentName:"p"},"Actor Service"),"."),(0,o.kt)("h2",{id:"defining-the-actor-service"},"Defining the Actor Service"),(0,o.kt)("p",null,"Let's look at ",(0,o.kt)("inlineCode",{parentName:"p"},"actors/main.py")," to see how Cogment handles the concepts of the Actor Service, Actor Class, and Actor Implementation in the RPS application. If we look at the ",(0,o.kt)("inlineCode",{parentName:"p"},"main()")," function that is invoked by running this file, we see:"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Main function for registering actors on actor service",src:n(8226).Z,width:"1842",height:"694"})),(0,o.kt)("p",null,"The ",(0,o.kt)("inlineCode",{parentName:"p"},"main()")," function first initializes a ",(0,o.kt)("a",{parentName:"p",href:"https://cogment.ai/docs/reference/python#class-cogmentcontext"},"context")," in which the Actors will be registered. When registering an Actor, we specify the class this Actor will be an instance of (from the options given in ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml"),"), and which implementation will be used. So far in our RPS application, we have only registered one type of Actor: an instance of the ",(0,o.kt)("inlineCode",{parentName:"p"},"player")," class using the ",(0,o.kt)("inlineCode",{parentName:"p"},"random_agent")," implementation."),(0,o.kt)("p",null,"After registering each of the different types of Actors that Cogment will be responsible for managing in the application, this function starts the Actor Service that will handle any Actor-associated computations on the appropriate port, and awaits the termination of the service."),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"Ports for running services are specified in the ",(0,o.kt)("inlineCode",{parentName:"p"},".env")," file, loaded by the ",(0,o.kt)("inlineCode",{parentName:"p"},".run.sh")," script, and retrieved by the ",(0,o.kt)("inlineCode",{parentName:"p"},"os")," package to make the variable available to Python. To change the port this service uses, update the",(0,o.kt)("inlineCode",{parentName:"p"},".env")," file in the root directory rather than changing ",(0,o.kt)("inlineCode",{parentName:"p"},"main.py"),".")),(0,o.kt)("h2",{id:"defining-the-actor-class"},"Defining the Actor Class"),(0,o.kt)("p",null,"The Actor Class is where we define the domain over which the Actor will operate, i.e. what inputs and outputs the Actor is expected to handle. We specify the Actor Class in the ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file, using the imported ",(0,o.kt)("a",{parentName:"p",href:"https://protobuf.dev/"},"Protocol Buffer")," (protobuf) messages from the associated ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto")," file."),(0,o.kt)("p",null,"The ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file lets Cogment know how to configure each of the components involved in running the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#trials"},"Trial"),", so we will return to it again later. The ",(0,o.kt)("inlineCode",{parentName:"p"},"actor_classes")," section describes what types of Actors exist in this game (here only ",(0,o.kt)("inlineCode",{parentName:"p"},"player")," Actors), and what the inputs and outputs of an instance of the ",(0,o.kt)("inlineCode",{parentName:"p"},"player")," class of Actor look like:"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Actor Class definitions",src:n(4527).Z,width:"1750",height:"290"})),(0,o.kt)("p",null,"This tells Cogment that an instance of the ",(0,o.kt)("inlineCode",{parentName:"p"},"player")," Actor class will expect ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#state-and-observation-spaces"},"observations")," specified by the ",(0,o.kt)("inlineCode",{parentName:"p"},"rps.Observation")," message, and will produce ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#the-action-space"},"actions")," of a form defined by the ",(0,o.kt)("inlineCode",{parentName:"p"},"rps.PlayerAction")," message. The Actor Class is fully specified here by its Observation space and Action Space."),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"Message types are referenced by ",(0,o.kt)("inlineCode",{parentName:"p"},"rps.SomeMessageName"),", since message types imported from a ",(0,o.kt)("inlineCode",{parentName:"p"},".proto")," are referred to through their ",(0,o.kt)("em",{parentName:"p"},"package")," namespace, which has been set to ",(0,o.kt)("inlineCode",{parentName:"p"},"rps")," in the ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto")," file. (For more information about the general use of the ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file, see the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/cogment-yaml"},"dedicated reference page"),".)")),(0,o.kt)("h3",{id:"action-space"},"Action Space"),(0,o.kt)("p",null,"The action space refers to the set of valid actions which can be taken by an Actor at each step of the game. The ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file tells Cogment that a member of the ",(0,o.kt)("inlineCode",{parentName:"p"},"player")," Actor class can take actions of type ",(0,o.kt)("inlineCode",{parentName:"p"},"PlayerAction")," as defined in the ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto")," file."),(0,o.kt)("p",null,"If we look at the ",(0,o.kt)("inlineCode",{parentName:"p"},"PlayerAction")," message in ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto"),", we see it is a message of type ",(0,o.kt)("inlineCode",{parentName:"p"},"Move"),", where a ",(0,o.kt)("inlineCode",{parentName:"p"},"Move")," is defined to be one of ",(0,o.kt)("inlineCode",{parentName:"p"},"ROCK"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"PAPER"),", or ",(0,o.kt)("inlineCode",{parentName:"p"},"SCISSORS"),", or an ",(0,o.kt)("inlineCode",{parentName:"p"},"UNKNOWN")," move:"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"defining the action space",src:n(8094).Z,width:"1842",height:"472"})),(0,o.kt)("p",null,"We also specify here that a ",(0,o.kt)("inlineCode",{parentName:"p"},"Move")," is an ",(0,o.kt)("inlineCode",{parentName:"p"},"enum")," type of Protobuf message, meaning that it can take only one of a predefined list of values. We include ",(0,o.kt)("inlineCode",{parentName:"p"},"UNKNOWN")," in this because the first argument of an ",(0,o.kt)("inlineCode",{parentName:"p"},"enum")," will be its ",(0,o.kt)("a",{parentName:"p",href:"https://protobuf.dev/programming-guides/proto3/#enum"},"default value"),", and we don't wish any of our actions to be a default behaviour. Together these specify the action space: a valid action for a ",(0,o.kt)("inlineCode",{parentName:"p"},"player")," type Actor is a single one of the list of possible moves."),(0,o.kt)("h3",{id:"observation-space"},"Observation Space"),(0,o.kt)("p",null,"The observation space refers to the set of possible inputs an Actor can receive at each step of the game. Observations are what Actors perceive from the Environment about what is the current state of their world, which they use to make decisions about what actions they should take."),(0,o.kt)("p",null,"In the context of RPS, the Environment is limited to the two players, the actions they took, and the consequence of both of their actions."),(0,o.kt)("p",null,"The ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file tells Cogment that a member of the ",(0,o.kt)("inlineCode",{parentName:"p"},"player")," Actor class receives observations of the form ",(0,o.kt)("inlineCode",{parentName:"p"},"Observation")," as defined in the ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto")," file."),(0,o.kt)("p",null,"The ",(0,o.kt)("inlineCode",{parentName:"p"},"Observation")," message type itself specifies that each player considers information about themselves and their opponent, and that these pieces of information are of the type ",(0,o.kt)("inlineCode",{parentName:"p"},"PlayerState"),":"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"defining the observation space",src:n(7076).Z,width:"1842",height:"418"})),(0,o.kt)("p",null,"Note that ",(0,o.kt)("inlineCode",{parentName:"p"},"last_move")," is optional because during the first round of the game, the players have not yet played any move. For all other steps of the game, each player is considering what was their last move, their opponents last move, and which of the two of them won or lost the match."),(0,o.kt)("h2",{id:"defining-the-actor-implementation"},"Defining the Actor Implementation"),(0,o.kt)("p",null,"While the Class defines how an Actor expects to receive observations and output actions, the Actor implementation specifies the details of ",(0,o.kt)("em",{parentName:"p"},"how")," the Actor makes decisions. This implementation function is a callback function, used once per actor and per trial and handles the full lifetime of the Actor."),(0,o.kt)("p",null,"Until now, we have used a partially completed ",(0,o.kt)("inlineCode",{parentName:"p"},"random_agent")," implementation defined in the ",(0,o.kt)("inlineCode",{parentName:"p"},"actors/main.py")," file. It is partially complete because the player's actions are currently empty. In this step, we will enable our Actor to select actions at random."),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"defining the random actor",src:n(4024).Z,width:"1842",height:"1030"})),(0,o.kt)("p",null,"An Actor implementation specifies:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"The actor's ",(0,o.kt)("strong",{parentName:"li"},"initialization"),", before the ",(0,o.kt)("inlineCode",{parentName:"li"},"async for"),". This is where, for example, the Actor's internal data can be defined before calling ",(0,o.kt)("inlineCode",{parentName:"li"},"actor_session.start()")," to notify that it is ready."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("strong",{parentName:"li"},"event loop"),", which specifies how the Actor makes decisions about what action to select in response to an observation in each step, and what kind of rewards it might receive from selecting its action. Here, you can see that by default the ",(0,o.kt)("inlineCode",{parentName:"li"},"action")," gets an empty ",(0,o.kt)("inlineCode",{parentName:"li"},"PlayerAction")," message (the data structure defined in ",(0,o.kt)("inlineCode",{parentName:"li"},"data.proto"),"), which has the expected format but contains no data."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("strong",{parentName:"li"},"termination")," block, i.e. what the Actor does after all the events.")),(0,o.kt)("p",null,"The argument passed to the Actor implementation is the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-actorsession--session-"},"Actor's session"),", which allows the Orchestrator to manage all the data associate with the Actor's operations in the trial."),(0,o.kt)("h2",{id:"completing-the-random_agent-actor-implementation"},"Completing the ",(0,o.kt)("inlineCode",{parentName:"h2"},"random_agent")," Actor Implementation"),(0,o.kt)("p",null,"We'll modify the ",(0,o.kt)("inlineCode",{parentName:"p"},"random_agent")," function defined in ",(0,o.kt)("inlineCode",{parentName:"p"},"actors/main.py")," to enable our Actor implementation to select random actions (rather than produce empty strings). First, we need to import the different options ",(0,o.kt)("inlineCode",{parentName:"p"},"Move")," can take, as defined in our data structures in ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto"),". We will also need to import the Python package ",(0,o.kt)("inlineCode",{parentName:"p"},"random"),", which will enable us to choose one of the ",(0,o.kt)("inlineCode",{parentName:"p"},"Move")," options at random."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},'In the "Imports" section at the top of the file, add the following:')),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"from data_pb2 import ROCK, PAPER, SCISSORS\nimport random\n")),(0,o.kt)("p",null,"We will store all of the possible options for the types of ",(0,o.kt)("inlineCode",{parentName:"p"},"MOVES")," we can take in a list. ",(0,o.kt)("strong",{parentName:"p"},'Add the following code to the "Settings" section:')),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"MOVES = [ROCK, PAPER, SCISSORS]\n")),(0,o.kt)("p",null,"Recall from above that the ",(0,o.kt)("inlineCode",{parentName:"p"},"PlayerAction")," message has one field: ",(0,o.kt)("inlineCode",{parentName:"p"},"move"),". This is the piece we need to pass to the formerly empty ",(0,o.kt)("inlineCode",{parentName:"p"},"PlayerAction")," message inside the ",(0,o.kt)("strong",{parentName:"p"},"event loop")," of the ",(0,o.kt)("inlineCode",{parentName:"p"},"random_agent")," instance definition. ",(0,o.kt)("strong",{parentName:"p"},"Replace the ",(0,o.kt)("inlineCode",{parentName:"strong"},"if event.observation:")," block in the event loop with the following:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"if event.observation:\n print(f\"'{actor_session.name}' received an observation: '{event.observation}'\")\n if event.type == cogment.EventType.ACTIVE:\n action = PlayerAction(move=random.choice(MOVES)) ## NEW IN STEP 2\n actor_session.do_action(action)\n")),(0,o.kt)("p",null,"The completed Actor implementation should look like this:"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"completed random actor implementation",src:n(4908).Z,width:"1842",height:"946"})),(0,o.kt)("p",null,"We now have an Actor that will randomly select actions. We showed earlier in this step of the tutorial where this implementation is used when registering instances of Actors with the service. Next, we will show how Cogment specifies which Actors and how many of them will participate in the Trial."),(0,o.kt)("h2",{id:"specifying-which-actors-participate-in-the-trial"},"Specifying which Actors participate in the Trial"),(0,o.kt)("p",null,"If we look at the ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_runner/main.py")," code, we will see the code that tells Cogment exactly which participants will be part of a trial."),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"basic trial runner",src:n(6940).Z,width:"1746",height:"1956"})),(0,o.kt)("p",null,"This code creates the context in which to run the trial, and a ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-controller"},"controller")," which will actually carry out the function of starting the trial, monitoring its state, and ending the trial."),(0,o.kt)("p",null,"This is also where we say specifically which Actors will be part of the trial. Here, we are going to create a trial with two Actors which use identical parameter settings, except for having different names. Each player uses an instance of the Actor type we registered on the Actor Service in ",(0,o.kt)("inlineCode",{parentName:"p"},"actors/main.py")," - if we call for a different implementation or class here, Cogment won't know what to do with that because no other Actor types have been registered with the Actor service."),(0,o.kt)("p",null,"We can change the player names to ",(0,o.kt)("inlineCode",{parentName:"p"},"Bob")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"Alice")," in ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_runner/main.py")," just to see how that impacts what gets reported as the services are running:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'actor_1_params = cogment.ActorParameters(\n cog_settings,\n name="Bob", # player_1\n class_name="player",\n endpoint=ACTORS_ENDPOINT,\n implementation="random_agent"\n )\n actor_2_params = cogment.ActorParameters(\n cog_settings,\n name="Alice", # player_2\n class_name="player",\n endpoint=ACTORS_ENDPOINT,\n implementation="random_agent"\n )\n')),(0,o.kt)("p",null,"To learn more about the parameters, check the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-cogmenttrialparameters"},(0,o.kt)("inlineCode",{parentName:"a"},"cogment.TrialParameters"))," class reference."),(0,o.kt)("p",null,"Then we specify the parameters of the trial -- including the specifications for our two players -- and pass these trial parameters to the controller to start a new trial. In this trial runner, our controller will terminate the trial after the players have played for 5 seconds."),(0,o.kt)("p",null,"Then the Trial Runner tells the controller to start a trial with the specified parameters. The ",(0,o.kt)("inlineCode",{parentName:"p"},"start_trial")," call will return a unique identifier for the trial. The Trial Runner uses this information to request the end of the trial with ",(0,o.kt)("inlineCode",{parentName:"p"},"terminate_trial"),". It is also possible to tell the controller the ID you want your trial to have, by passing your chosen ID to the ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_id_requested")," parameter of the ",(0,o.kt)("inlineCode",{parentName:"p"},"start_trial")," method. We will do this in the next step of the tutorial."),(0,o.kt)("p",null,"We can now ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/setup#building-and-running-the-app"},"run the application"),", and we will see the service terminal logs report that each player selects a valid action instead of an empty one."),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Bob and Alice pick actions",src:n(6927).Z,width:"1326",height:"908"})),(0,o.kt)("p",null,"We can also see that the services terminal prints out what the Actors were receiving from the Environment as Observations:"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Bob and Alice get empty observations",src:n(7508).Z,width:"1994",height:"342"})),(0,o.kt)("details",null,(0,o.kt)("summary",null,(0,o.kt)("b",null,(0,o.kt)("span",{style:{fontSize:"20px"}},"Quick Summary"))),(0,o.kt)("p",null,"We learned about how Cogment represents Actors and the different concepts of the Actor Service, Actor Class, and Actor Implementation."),(0,o.kt)("p",null,"We enabled the ",(0,o.kt)("inlineCode",{parentName:"p"},"random_agent")," Actor implementation to select actions by importing the ",(0,o.kt)("inlineCode",{parentName:"p"},"ROCK")," ",(0,o.kt)("inlineCode",{parentName:"p"},"PAPER")," ",(0,o.kt)("inlineCode",{parentName:"p"},"SCISSORS")," data structures defined in the ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto")," (via ",(0,o.kt)("inlineCode",{parentName:"p"},"data_pb2.py"),"), the ",(0,o.kt)("inlineCode",{parentName:"p"},"random")," package, and changing the event block to:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"async for event in actor_session.all_events():\n if event.observation:\n print(f\"'{actor_session.name}' received an observation: '{event.observation}'\")\n if event.type == cogment.EventType.ACTIVE:\n action = PlayerAction(move=random.choice(MOVES)) # new in step 2\n actor_session.do_action(action)\n for reward in event.rewards:\n print(f\"'{actor_session.name}' received a reward for tick #{reward.tick_id}: {reward.value}\")\n")),(0,o.kt)("p",null,"We also looked at how the Trial Runner calls upon Actors to participate in the trial. We modified the parameters for the Actors in the Trial Runner and gave each player a name:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'actor_1_params = cogment.ActorParameters(\n cog_settings,\n name="Bob",\n class_name="player",\n endpoint=ACTORS_ENDPOINT,\n implementation="random_agent"\n)\nactor_2_params = cogment.ActorParameters(\n cog_settings,\n name="Alice",\n class_name="player",\n endpoint=ACTORS_ENDPOINT,\n implementation="random_agent"\n)\n'))),(0,o.kt)("p",null,"In the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/environment-in-cogment"},"next step")," of the tutorial, we will go through how Cogment represents the Environment, and set up the Environment implementation to give ",(0,o.kt)("inlineCode",{parentName:"p"},"Bob")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"Alice")," observations about the state of the world that contain meaningful information."))}m.isMDXComponent=!0},4527:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/actor-classes-350dfc20b0f2a938dbf5846f9f63373a.png"},4207:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/actor-env-interaction-simple-242d91b0489b900be23e50b63616ffe3.png"},7508:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/actors-empty-observations-601ddd12606f3ea5d8cde74a533f7db6.png"},6927:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/actors-select-actions-34fbc67dad0064db849659f07b6067f0.png"},8226:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/actors_main-2de239dae9b147addea4dca9009d5a2f.png"},8094:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/data_proto_move_action-5ba7bdeb75408ddb8c52e7acd58de64e.png"},7076:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/data_proto_observation-bd4af5f2b2d84374a199afec3b09f0ab.png"},4908:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/random_actor_implementation-1890edbd54a3c02f9c3aae1d0eaa0bc5.png"},4024:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/random_actor_implementation_0-aab4cca67e13ca989a5d0453d6cc2bde.png"},7358:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/service-class-implementation-ae7404a04a32ce1229e5e35a006de5bc.png"},6940:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/trial_runner_0-f1d72ee7aeb3ebb5dedc37bc5058328e.png"}}]); \ No newline at end of file diff --git a/assets/js/80b5be58.7a80df6d.js b/assets/js/80b5be58.7a80df6d.js deleted file mode 100644 index c558f0c..0000000 --- a/assets/js/80b5be58.7a80df6d.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[1028],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>d});var a=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=a.createContext({}),p=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):r(r({},t),e)),n},c=function(e){var t=p(e.components);return a.createElement(l.Provider,{value:t},e.children)},h={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,l=e.parentName,c=s(e,["components","mdxType","originalType","parentName"]),m=p(n),d=o,f=m["".concat(l,".").concat(d)]||m[d]||h[d]||i;return n?a.createElement(f,r(r({ref:t},c),{},{components:n})):a.createElement(f,r({ref:t},c))}));function d(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,r=new Array(i);r[0]=m;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s.mdxType="string"==typeof e?e:o,r[1]=s;for(var p=2;p<i;p++)r[p]=n[p];return a.createElement.apply(null,r)}return a.createElement.apply(null,n)}m.displayName="MDXCreateElement"},2383:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>r,default:()=>h,frontMatter:()=>i,metadata:()=>s,toc:()=>p});var a=n(7462),o=(n(7294),n(3905));const i={title:"Step 2 - Actors in Cogment"},r="Actors: Players of RPS",s={unversionedId:"guide/tutorial/actors-in-cogment",id:"guide/tutorial/actors-in-cogment",title:"Step 2 - Actors in Cogment",description:"Now that we have a working but empty Cogment app, let's look at how these pieces interact in the context of the RPS game. In this step of the tutorial, we will lay out how Actors are defined in Cogment. To build out our RPS application, we will add the ability for our Actors to select actions (rather than produce empty strings).",source:"@site/docs/guide/tutorial/2-actors-in-cogment.md",sourceDirName:"guide/tutorial",slug:"/guide/tutorial/actors-in-cogment",permalink:"/docs/guide/tutorial/actors-in-cogment",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:2,frontMatter:{title:"Step 2 - Actors in Cogment"},sidebar:"docSidebar",previous:{title:"Step 1 - An Empty Cogment Application",permalink:"/docs/guide/tutorial/setup"},next:{title:"Step 3 - The Environment in Cogment",permalink:"/docs/guide/tutorial/environment-in-cogment"}},l={},p=[{value:"What does Cogment need to know about an Actor?",id:"what-does-cogment-need-to-know-about-an-actor",level:2},{value:"Defining the Actor Service",id:"defining-the-actor-service",level:2},{value:"Defining the Actor Class",id:"defining-the-actor-class",level:2},{value:"Action Space",id:"action-space",level:3},{value:"Observation Space",id:"observation-space",level:3},{value:"Defining the Actor Implementation",id:"defining-the-actor-implementation",level:2},{value:"Completing the <code>random_agent</code> Actor Implementation",id:"completing-the-random_agent-actor-implementation",level:2},{value:"Specifying which Actors participate in the Trial",id:"specifying-which-actors-participate-in-the-trial",level:2}],c={toc:p};function h(e){let{components:t,...i}=e;return(0,o.kt)("wrapper",(0,a.Z)({},c,i,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"actors-players-of-rps"},"Actors: Players of RPS"),(0,o.kt)("p",null,"Now that we have a working but empty Cogment app, let's look at how these pieces interact in the context of the RPS game. In this step of the tutorial, we will lay out how Actors are defined in Cogment. To build out our RPS application, we will add the ability for our Actors to select actions (rather than produce empty strings)."),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Actors and Environment interaction in RPS",src:n(4207).Z,width:"2582",height:"932"})),(0,o.kt)("h2",{id:"what-does-cogment-need-to-know-about-an-actor"},"What does Cogment need to know about an Actor?"),(0,o.kt)("p",null,"In Cogment, the general concept of an ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#actors"},"Actor")," is a role that has agency. In RPS, this is a player of the game. At a high level, Cogment operates the same whether the Actor is human or machine-based. For now, we will just look at machine-based Actors. A more in-depth tutorial will guide you through implementing a ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#client-and-service-actors"},"client Actor")," which can be used by a human player to participate in the RPS game."),(0,o.kt)("p",null,"To fully specify Actors in Cogment, we need to define what they do (what observations they take and actions they produce), how they do it, and where they run those computations."),(0,o.kt)("p",null,"To better understand how Cogment represents Actors, the following terminology is important to highlight:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("strong",{parentName:"li"},"Actor Service")," is the designated computational node where Actor instances run. A service can manage multiple Actor instances concurrently. The Actor Service is ",(0,o.kt)("em",{parentName:"li"},"where")," the computations are run. The Actor Service is launched by ",(0,o.kt)("inlineCode",{parentName:"li"},"actors/main.py")," on the TCP port set by the ",(0,o.kt)("inlineCode",{parentName:"li"},"ACTORS_PORT")," variable in the ",(0,o.kt)("inlineCode",{parentName:"li"},".env")," file."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("strong",{parentName:"li"},"Actor Class")," is the specification of the attributes and behaviours that an Actor can have, for example what sort of inputs the Actor expects and what sort of outputs it will produce. If we want to have several different Actors that all behave similarly (take same type of inputs and produce same type of outputs) we can define an Actor class and different ",(0,o.kt)("em",{parentName:"li"},"instances")," of that class can use different implementations. The Actor Class defines ",(0,o.kt)("em",{parentName:"li"},"what")," the Actor does. The Actor Classes are defined in the ",(0,o.kt)("inlineCode",{parentName:"li"},"cogment.yaml")," file in the root directory (which is copied to each service directory as part of the ",(0,o.kt)("inlineCode",{parentName:"li"},"./run.sh install")," command)."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("strong",{parentName:"li"},"Actor Implementation")," is the logic of how the role operates. Specifically, the implementation refers to the function which controls how the Actor makes decisions about what action to output given some input information about the state of the world. The Actor implementation is ",(0,o.kt)("em",{parentName:"li"},"how")," the Actor chooses actions. The function we use for our first Actor implementation is defined in ",(0,o.kt)("inlineCode",{parentName:"li"},"actors/main.py"),".")),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"different concepts of actors",src:n(7358).Z,width:"1950",height:"888"}),"\nIn the above image, we showcase these different concepts: the ",(0,o.kt)("strong",{parentName:"p"},"Actor Class"),' "Player" lays out the skeleton for what components the Actor will need to manage. We can create an ',(0,o.kt)("strong",{parentName:"p"},"instance")," of this class (gray) with an ",(0,o.kt)("strong",{parentName:"p"},"Actor Implementation")," that does random action selection, which takes an Observation as input and produces an action as output. The computations made by the Player Actor instance are run on the ",(0,o.kt)("strong",{parentName:"p"},"Actor Service"),"."),(0,o.kt)("h2",{id:"defining-the-actor-service"},"Defining the Actor Service"),(0,o.kt)("p",null,"Let's look at ",(0,o.kt)("inlineCode",{parentName:"p"},"actors/main.py")," to see how Cogment handles the concepts of the Actor Service, Actor Class, and Actor Implementation in the RPS application. If we look at the ",(0,o.kt)("inlineCode",{parentName:"p"},"main()")," function that is invoked by running this file, we see:"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Main function for registering actors on actor service",src:n(8226).Z,width:"1842",height:"694"})),(0,o.kt)("p",null,"The ",(0,o.kt)("inlineCode",{parentName:"p"},"main()")," function first initializes a ",(0,o.kt)("a",{parentName:"p",href:"https://cogment.ai/docs/reference/python#class-cogmentcontext"},"context")," in which the Actors will be registered. When registering an Actor, we specify the class this Actor will be an instance of (from the options given in ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml"),"), and which implementation will be used. So far in our RPS application, we have only registered one type of Actor: an instance of the ",(0,o.kt)("inlineCode",{parentName:"p"},"player")," class using the ",(0,o.kt)("inlineCode",{parentName:"p"},"random_agent")," implementation."),(0,o.kt)("p",null,"After registering each of the different types of Actors that Cogment will be responsible for managing in the application, this function starts the Actor Service that will handle any Actor-associated computations on the appropriate port, and awaits the termination of the service."),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"Ports for running services are specified in the ",(0,o.kt)("inlineCode",{parentName:"p"},".env")," file, loaded by the ",(0,o.kt)("inlineCode",{parentName:"p"},".run.sh")," script, and retrieved by the ",(0,o.kt)("inlineCode",{parentName:"p"},"os")," package to make the variable available to Python. To change the port this service uses, update the",(0,o.kt)("inlineCode",{parentName:"p"},".env")," file in the root directory rather than changing ",(0,o.kt)("inlineCode",{parentName:"p"},"main.py"),".")),(0,o.kt)("h2",{id:"defining-the-actor-class"},"Defining the Actor Class"),(0,o.kt)("p",null,"The Actor Class is where we define the domain over which the Actor will operate, i.e. what inputs and outputs the Actor is expected to handle. We specify the Actor Class in the ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file, using the imported ",(0,o.kt)("a",{parentName:"p",href:"https://protobuf.dev/"},"Protocol Buffer")," (protobuf) messages from the associated ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto")," file."),(0,o.kt)("p",null,"The ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file lets Cogment know how to configure each of the components involved in running the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#trials"},"Trial"),", so we will return to it again later. The ",(0,o.kt)("inlineCode",{parentName:"p"},"actor_classes")," section describes what types of Actors exist in this game (here only ",(0,o.kt)("inlineCode",{parentName:"p"},"player")," Actors), and what the inputs and outputs of an instance of the ",(0,o.kt)("inlineCode",{parentName:"p"},"player")," class of Actor look like:"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Actor Class definitions",src:n(4527).Z,width:"1750",height:"290"})),(0,o.kt)("p",null,"This tells Cogment that an instance of the ",(0,o.kt)("inlineCode",{parentName:"p"},"player")," Actor class will expect ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#state-and-observation-spaces"},"observations")," specified by the ",(0,o.kt)("inlineCode",{parentName:"p"},"rps.Observation")," message, and will produce ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#the-action-space"},"actions")," of a form defined by the ",(0,o.kt)("inlineCode",{parentName:"p"},"rps.PlayerAction")," message. The Actor Class is fully specified here by its Observation space and Action Space."),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"Message types are referenced by ",(0,o.kt)("inlineCode",{parentName:"p"},"rps.SomeMessageName"),", since message types imported from a ",(0,o.kt)("inlineCode",{parentName:"p"},".proto")," are referred to through their ",(0,o.kt)("em",{parentName:"p"},"package")," namespace, which has been set to ",(0,o.kt)("inlineCode",{parentName:"p"},"rps")," in the ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto")," file. (For more information about the general use of the ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file, see the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/cogment-yaml"},"dedicated reference page"),".)")),(0,o.kt)("h3",{id:"action-space"},"Action Space"),(0,o.kt)("p",null,"The action space refers to the set of valid actions which can be taken by an Actor at each step of the game. The ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file tells Cogment that a member of the ",(0,o.kt)("inlineCode",{parentName:"p"},"player")," Actor class can take actions of type ",(0,o.kt)("inlineCode",{parentName:"p"},"PlayerAction")," as defined in the ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto")," file."),(0,o.kt)("p",null,"If we look at the ",(0,o.kt)("inlineCode",{parentName:"p"},"PlayerAction")," message in ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto"),", we see it is a message of type ",(0,o.kt)("inlineCode",{parentName:"p"},"Move"),", where a ",(0,o.kt)("inlineCode",{parentName:"p"},"Move")," is defined to be one of ",(0,o.kt)("inlineCode",{parentName:"p"},"ROCK"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"PAPER"),", or ",(0,o.kt)("inlineCode",{parentName:"p"},"SCISSORS"),", or an ",(0,o.kt)("inlineCode",{parentName:"p"},"UNKNOWN")," move:"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"defining the action space",src:n(8094).Z,width:"1842",height:"472"})),(0,o.kt)("p",null,"We also specify here that a ",(0,o.kt)("inlineCode",{parentName:"p"},"Move")," is an ",(0,o.kt)("inlineCode",{parentName:"p"},"enum")," type of Protobuf message, meaning that it can take only one of a predefined list of values. We include ",(0,o.kt)("inlineCode",{parentName:"p"},"UNKNOWN")," in this because the first argument of an ",(0,o.kt)("inlineCode",{parentName:"p"},"enum")," will be its ",(0,o.kt)("a",{parentName:"p",href:"https://protobuf.dev/programming-guides/proto3/#enum"},"default value"),", and we don't wish any of our actions to be a default behaviour. Together these specify the action space: a valid action for a ",(0,o.kt)("inlineCode",{parentName:"p"},"player")," type Actor is a single one of the list of possible moves."),(0,o.kt)("h3",{id:"observation-space"},"Observation Space"),(0,o.kt)("p",null,"The observation space refers to the set of possible inputs an Actor can receive at each step of the game. Observations are what Actors perceive from the Environment about what is the current state of their world, which they use to make decisions about what actions they should take."),(0,o.kt)("p",null,"In the context of RPS, the Environment is limited to the two players, the actions they took, and the consequence of both of their actions."),(0,o.kt)("p",null,"The ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file tells Cogment that a member of the ",(0,o.kt)("inlineCode",{parentName:"p"},"player")," Actor class receives observations of the form ",(0,o.kt)("inlineCode",{parentName:"p"},"Observation")," as defined in the ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto")," file."),(0,o.kt)("p",null,"The ",(0,o.kt)("inlineCode",{parentName:"p"},"Observation")," message type itself specifies that each player considers information about themselves and their opponent, and that these pieces of information are of the type ",(0,o.kt)("inlineCode",{parentName:"p"},"PlayerState"),":"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"defining the observation space",src:n(7076).Z,width:"1842",height:"418"})),(0,o.kt)("p",null,"Note that ",(0,o.kt)("inlineCode",{parentName:"p"},"last_move")," is optional because during the first round of the game, the players have not yet played any move. For all other steps of the game, each player is considering what was their last move, their opponents last move, and which of the two of them won or lost the match."),(0,o.kt)("h2",{id:"defining-the-actor-implementation"},"Defining the Actor Implementation"),(0,o.kt)("p",null,"While the Class defines how an Actor expects to receive observations and output actions, the Actor implementation specifies the details of ",(0,o.kt)("em",{parentName:"p"},"how")," the Actor makes decisions. This implementation function is a callback function, used once per actor and per trial and handles the full lifetime of the Actor."),(0,o.kt)("p",null,"Until now, we have used a partially completed ",(0,o.kt)("inlineCode",{parentName:"p"},"random_agent")," implementation defined in the ",(0,o.kt)("inlineCode",{parentName:"p"},"actors/main.py")," file. It is partially complete because the player's actions are currently empty. In this step, we will enable our Actor to select actions at random."),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"defining the random actor",src:n(4024).Z,width:"1842",height:"1030"})),(0,o.kt)("p",null,"An Actor implementation specifies:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"The actor's ",(0,o.kt)("strong",{parentName:"li"},"initialization"),", before the ",(0,o.kt)("inlineCode",{parentName:"li"},"async for"),". This is where, for example, the Actor's internal data can be defined before calling ",(0,o.kt)("inlineCode",{parentName:"li"},"actor_session.start()")," to notify that it is ready."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("strong",{parentName:"li"},"event loop"),", which specifies how the Actor makes decisions about what action to select in response to an observation in each step, and what kind of rewards it might receive from selecting its action. Here, you can see that by default the ",(0,o.kt)("inlineCode",{parentName:"li"},"action")," gets an empty ",(0,o.kt)("inlineCode",{parentName:"li"},"PlayerAction")," message (the data structure defined in ",(0,o.kt)("inlineCode",{parentName:"li"},"data.proto"),"), which has the expected format but contains no data."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("strong",{parentName:"li"},"termination")," block, i.e. what the Actor does after all the events.")),(0,o.kt)("p",null,"The argument passed to the Actor implementation is the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-actorsession--session-"},"Actor's session"),", which allows the Orchestrator to manage all the data associate with the Actor's operations in the trial."),(0,o.kt)("h2",{id:"completing-the-random_agent-actor-implementation"},"Completing the ",(0,o.kt)("inlineCode",{parentName:"h2"},"random_agent")," Actor Implementation"),(0,o.kt)("p",null,"We'll modify the ",(0,o.kt)("inlineCode",{parentName:"p"},"random_agent")," function defined in ",(0,o.kt)("inlineCode",{parentName:"p"},"actors/main.py")," to enable our Actor implementation to select random actions (rather than produce empty strings). First, we need to import the different options ",(0,o.kt)("inlineCode",{parentName:"p"},"Move")," can take, as defined in our data structures in ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto"),". We will also need to import the Python package ",(0,o.kt)("inlineCode",{parentName:"p"},"random"),", which will enable us to choose one of the ",(0,o.kt)("inlineCode",{parentName:"p"},"Move")," options at random."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},'In the "Imports" section at the top of the file, add the following:')),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"from data_pb2 import ROCK, PAPER, SCISSORS\nimport random\n")),(0,o.kt)("p",null,"We will store all of the possible options for the types of ",(0,o.kt)("inlineCode",{parentName:"p"},"MOVES")," we can take in a list. ",(0,o.kt)("strong",{parentName:"p"},'Add the following code to the "Settings" section:')),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"MOVES = [ROCK, PAPER, SCISSORS]\n")),(0,o.kt)("p",null,"Recall from above that the ",(0,o.kt)("inlineCode",{parentName:"p"},"PlayerAction")," message has one field: ",(0,o.kt)("inlineCode",{parentName:"p"},"move"),". This is the piece we need to pass to the formerly empty ",(0,o.kt)("inlineCode",{parentName:"p"},"PlayerAction")," message inside the ",(0,o.kt)("strong",{parentName:"p"},"event loop")," of the ",(0,o.kt)("inlineCode",{parentName:"p"},"random_agent")," instance definition. ",(0,o.kt)("strong",{parentName:"p"},"Replace the ",(0,o.kt)("inlineCode",{parentName:"strong"},"if event.observation:")," block in the event loop with the following:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"if event.observation:\n print(f\"'{actor_session.name}' received an observation: '{event.observation}'\")\n if event.type == cogment.EventType.ACTIVE:\n action = PlayerAction(move=random.choice(MOVES)) ## NEW IN STEP 2\n actor_session.do_action(action)\n")),(0,o.kt)("p",null,"The completed Actor implementation should look like this:"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"completed random actor implementation",src:n(4908).Z,width:"1842",height:"946"})),(0,o.kt)("p",null,"We now have an Actor that will randomly select actions. We showed earlier in this step of the tutorial where this implementation is used when registering instances of Actors with the service. Next, we will show how Cogment specifies which Actors and how many of them will participate in the Trial."),(0,o.kt)("h2",{id:"specifying-which-actors-participate-in-the-trial"},"Specifying which Actors participate in the Trial"),(0,o.kt)("p",null,"If we look at the ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_runner/main.py")," code, we will see the code that tells Cogment exactly which participants will be part of a trial."),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"basic trial runner",src:n(6940).Z,width:"1746",height:"1956"})),(0,o.kt)("p",null,"This code creates the context in which to run the trial, and a ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-controller"},"controller")," which will actually carry out the function of starting the trial, monitoring its state, and ending the trial."),(0,o.kt)("p",null,"This is also where we say specifically which Actors will be part of the trial. Here, we are going to create a trial with two Actors which use identical parameter settings, except for having different names. Each player uses an instance of the Actor type we registered on the Actor Service in ",(0,o.kt)("inlineCode",{parentName:"p"},"actors/main.py")," - if we call for a different implementation or class here, Cogment won't know what to do with that because no other Actor types have been registered with the Actor service."),(0,o.kt)("p",null,"We can change the player names to ",(0,o.kt)("inlineCode",{parentName:"p"},"Bob")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"Alice")," in ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_runner/main.py")," just to see how that impacts what gets reported as the services are running:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'actor_1_params = cogment.ActorParameters(\n cog_settings,\n name="Bob", # player_1\n class_name="player",\n endpoint=ACTORS_ENDPOINT,\n implementation="random_agent"\n )\n actor_2_params = cogment.ActorParameters(\n cog_settings,\n name="Alice", # player_2\n class_name="player",\n endpoint=ACTORS_ENDPOINT,\n implementation="random_agent"\n )\n')),(0,o.kt)("p",null,"To learn more about the parameters, check the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-cogmenttrialparameters"},(0,o.kt)("inlineCode",{parentName:"a"},"cogment.TrialParameters"))," class reference."),(0,o.kt)("p",null,"Then we specify the parameters of the trial -- including the specifications for our two players -- and pass these trial parameters to the controller to start a new trial. In this trial runner, our controller will terminate the trial after the players have played for 5 seconds."),(0,o.kt)("p",null,"Then the Trial Runner tells the controller to start a trial with the specified parameters. The ",(0,o.kt)("inlineCode",{parentName:"p"},"start_trial")," call will return a unique identifier for the trial. The Trial Runner uses this information to request the end of the trial with ",(0,o.kt)("inlineCode",{parentName:"p"},"terminate_trial"),". It is also possible to tell the controller the ID you want your trial to have, by passing your chosen ID to the ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_id_requested")," parameter of the ",(0,o.kt)("inlineCode",{parentName:"p"},"start_trial")," method. We will do this in the next step of the tutorial."),(0,o.kt)("p",null,"We can now ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/setup#building-and-running-the-app"},"run the application"),", and we will see the service terminal logs report that each player selects a valid action instead of an empty one."),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Bob and Alice pick actions",src:n(6927).Z,width:"1326",height:"908"})),(0,o.kt)("p",null,"We can also see that the services terminal prints out what the Actors were receiving from the Environment as Observations:"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Bob and Alice get empty observations",src:n(7508).Z,width:"1994",height:"342"})),(0,o.kt)("details",null,(0,o.kt)("summary",null,(0,o.kt)("b",null,(0,o.kt)("span",{style:{fontSize:"20px"}},"Quick Summary"))),(0,o.kt)("p",null,"We learned about how Cogment represents Actors and the different concepts of the Actor Service, Actor Class, and Actor Implementation."),(0,o.kt)("p",null,"We enabled the ",(0,o.kt)("inlineCode",{parentName:"p"},"random_agent")," Actor implementation to select actions by importing the ",(0,o.kt)("inlineCode",{parentName:"p"},"ROCK")," ",(0,o.kt)("inlineCode",{parentName:"p"},"PAPER")," ",(0,o.kt)("inlineCode",{parentName:"p"},"SCISSORS")," data structures defined in the ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto")," (via ",(0,o.kt)("inlineCode",{parentName:"p"},"data_pb2.py"),"), the ",(0,o.kt)("inlineCode",{parentName:"p"},"random")," package, and changing the event block to:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"async for event in actor_session.all_events():\n if event.observation:\n print(f\"'{actor_session.name}' received an observation: '{event.observation}'\")\n if event.type == cogment.EventType.ACTIVE:\n action = PlayerAction(move=random.choice(MOVES)) # new in step 2\n actor_session.do_action(action)\n for reward in event.rewards:\n print(f\"'{actor_session.name}' received a reward for tick #{reward.tick_id}: {reward.value}\")\n")),(0,o.kt)("p",null,"We also looked at how the Trial Runner calls upon Actors to participate in the trial. We modified the parameters for the Actors in the Trial Runner and gave each player a name:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'actor_1_params = cogment.ActorParameters(\n cog_settings,\n name="Bob",\n class_name="player",\n endpoint=ACTORS_ENDPOINT,\n implementation="random_agent"\n)\nactor_2_params = cogment.ActorParameters(\n cog_settings,\n name="Alice",\n class_name="player",\n endpoint=ACTORS_ENDPOINT,\n implementation="random_agent"\n)\n'))),(0,o.kt)("p",null,"In the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/environment-in-cogment"},"next step")," of the tutorial, we will go through how Cogment represents the Environment, and set up the Environment implementation to give ",(0,o.kt)("inlineCode",{parentName:"p"},"Bob")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"Alice")," observations about the state of the world that contain meaningful information."))}h.isMDXComponent=!0},4527:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/actor-classes-350dfc20b0f2a938dbf5846f9f63373a.png"},4207:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/actor-env-interaction-simple-242d91b0489b900be23e50b63616ffe3.png"},7508:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/actors-empty-observations-601ddd12606f3ea5d8cde74a533f7db6.png"},6927:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/actors-select-actions-34fbc67dad0064db849659f07b6067f0.png"},8226:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/actors_main-2de239dae9b147addea4dca9009d5a2f.png"},8094:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/data_proto_move_action-5ba7bdeb75408ddb8c52e7acd58de64e.png"},7076:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/data_proto_observation-bd4af5f2b2d84374a199afec3b09f0ab.png"},4908:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/random_actor_implementation-1890edbd54a3c02f9c3aae1d0eaa0bc5.png"},4024:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/random_actor_implementation_0-aab4cca67e13ca989a5d0453d6cc2bde.png"},7358:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/service-class-implementation-ae7404a04a32ce1229e5e35a006de5bc.png"},6940:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/trial_runner_0-f1d72ee7aeb3ebb5dedc37bc5058328e.png"}}]); \ No newline at end of file diff --git a/assets/js/85f318fb.18658faf.js b/assets/js/85f318fb.18658faf.js deleted file mode 100644 index b3f1dd6..0000000 --- a/assets/js/85f318fb.18658faf.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[4896],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>d});var i=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,i,a=function(e,t){if(null==e)return{};var n,i,a={},r=Object.keys(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=i.createContext({}),p=function(e){var t=i.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},c=function(e){var t=p(e.components);return i.createElement(s.Provider,{value:t},e.children)},h={inlineCode:"code",wrapper:function(e){var t=e.children;return i.createElement(i.Fragment,{},t)}},u=i.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),u=p(n),d=a,m=u["".concat(s,".").concat(d)]||u[d]||h[d]||r;return n?i.createElement(m,o(o({ref:t},c),{},{components:n})):i.createElement(m,o({ref:t},c))}));function d(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,o=new Array(r);o[0]=u;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l.mdxType="string"==typeof e?e:a,o[1]=l;for(var p=2;p<r;p++)o[p]=n[p];return i.createElement.apply(null,o)}return i.createElement.apply(null,n)}u.displayName="MDXCreateElement"},2781:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>h,frontMatter:()=>r,metadata:()=>l,toc:()=>p});var i=n(7462),a=(n(7294),n(3905));const r={title:"Step 1 - An Empty Cogment Application"},o="Set Up the Code & Test a Trial",l={unversionedId:"guide/tutorial/setup",id:"guide/tutorial/setup",title:"Step 1 - An Empty Cogment Application",description:"In this step of the tutorial, we will get the RPS code set up properly and test run a single trial. This will establish the basic working code needed for all subsequent steps of the tutorial. We will go over the components of the repository at a very high level. If any terminology is unclear, it may be useful to refer to the Core Concepts.",source:"@site/docs/guide/tutorial/1-setup.md",sourceDirName:"guide/tutorial",slug:"/guide/tutorial/setup",permalink:"/docs/guide/tutorial/setup",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:1,frontMatter:{title:"Step 1 - An Empty Cogment Application"},sidebar:"docSidebar",previous:{title:"Tutorial",permalink:"/docs/guide/tutorial/"},next:{title:"Step 2 - Actors in Cogment",permalink:"/docs/guide/tutorial/actors-in-cogment"}},s={},p=[{value:"Getting Set Up",id:"getting-set-up",level:2},{value:"Cloning the RPS Source Code",id:"cloning-the-rps-source-code",level:3},{value:"Creating your development directory",id:"creating-your-development-directory",level:3},{value:"What's in this directory?",id:"whats-in-this-directory",level:2},{value:"Service Directories",id:"service-directories",level:3},{value:"Configuration & Execution Files",id:"configuration--execution-files",level:3},{value:".env",id:"env",level:4},{value:"data.proto",id:"dataproto",level:4},{value:"cogment.yaml",id:"cogmentyaml",level:4},{value:"run.sh",id:"runsh",level:4},{value:"requirements.txt",id:"requirementstxt",level:4},{value:"services.yaml",id:"servicesyaml",level:4},{value:"Building the Application",id:"building-the-application",level:2},{value:"What exactly is happening in the install?",id:"what-exactly-is-happening-in-the-install",level:3},{value:"Running the Application",id:"running-the-application",level:2}],c={toc:p};function h(e){let{components:t,...r}=e;return(0,a.kt)("wrapper",(0,i.Z)({},c,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"set-up-the-code--test-a-trial"},"Set Up the Code & Test a Trial"),(0,a.kt)("p",null,"In this step of the tutorial, we will get the RPS code set up properly and test run a single trial. This will establish the basic working code needed for all subsequent steps of the tutorial. We will go over the components of the repository at a very high level. If any terminology is unclear, it may be useful to refer to the ",(0,a.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts"},"Core Concepts"),"."),(0,a.kt)("admonition",{type:"note"},(0,a.kt)("p",{parentName:"admonition"},"These instructions are for unix-like environments such as Linux, macOS and WSL2 on Windows.")),(0,a.kt)("h2",{id:"getting-set-up"},"Getting Set Up"),(0,a.kt)("p",null,"To begin with, you'll need a working installation of Cogment. If you haven't done so already, follow our ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/cli/"},"installation instructions"),"."),(0,a.kt)("p",null,"Additionally, you'll need:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://www.python.org/"},"Python")," (Cogment currently supports versions 3.7-3.9)"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://virtualenv.pypa.io/en/latest/"},"virtualenv"))),(0,a.kt)("h3",{id:"cloning-the-rps-source-code"},"Cloning the RPS Source Code"),(0,a.kt)("p",null,"If you followed the test step of the installation instructions you have probably already downloaded the sources for the tutorial from the ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-tutorial-rps"},"github repository"),". If not, now is the time to do so."),(0,a.kt)("p",null,"This repository contains completed code for each step of the tutorial in separate folders. If at any point you make a mistake and can't get something working, you can copy the code from the folder corresponding to the last step you completed to get a fresh starting point."),(0,a.kt)("h3",{id:"creating-your-development-directory"},"Creating your development directory"),(0,a.kt)("p",null,"First, let's make a new directory called ",(0,a.kt)("inlineCode",{parentName:"p"},"rps"),", and set this as our working directory. Unless otherwise mentioned, all operations for the rest of the tutorial are done from the ",(0,a.kt)("inlineCode",{parentName:"p"},"rps")," directory. We will then copy the code from the folder for step 1 of the tutorial from the directory ",(0,a.kt)("inlineCode",{parentName:"p"},"1-setup/"),", which contains a blank slate Cogment application as a starting point."),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Execute the following commands in your terminal:")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-console"},"mkdir rps\ncp -r <relative path to cloned repository>/basic_tutorial_steps/1-setup/ rps/\ncd rps\n")),(0,a.kt)("p",null,"We now have a starting point for developing the RPS project. This code copied from ",(0,a.kt)("inlineCode",{parentName:"p"},"basic_tutorial_steps/1-setup")," will run an empty Cogment application with two Actors able to play RPS."),(0,a.kt)("h2",{id:"whats-in-this-directory"},"What's in this directory?"),(0,a.kt)("h3",{id:"service-directories"},"Service Directories"),(0,a.kt)("p",null,"If we look at the elements of ",(0,a.kt)("inlineCode",{parentName:"p"},"rps"),", we will see 3 directories. Each directory contains the code required for managing that service, for now contained completely in a ",(0,a.kt)("inlineCode",{parentName:"p"},"main.py")," file that does all the work for that service. These services are:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"environment/")," which specifies the dynamics of the game itself (what actions are allowed, what are the consequences of those actions),"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"actors/")," which specifies how the Actor(s) work -- what information they get from the environment, and how they use it for making a decision on what action to take next"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"trial_runner/")," which specifies how the Actors and Environment interact within Cogment, and launches the trials to run the games of RPS.")),(0,a.kt)("p",null,"At this stage, each module contains only the ",(0,a.kt)("inlineCode",{parentName:"p"},"main.py")," files. When we build the application, more files will be copied into each directory automatically."),(0,a.kt)("h3",{id:"configuration--execution-files"},"Configuration & Execution Files"),(0,a.kt)("p",null,"The root of the ",(0,a.kt)("inlineCode",{parentName:"p"},"rps")," directory also contains files which set the necessary configurations for running the application (",(0,a.kt)("inlineCode",{parentName:"p"},".env"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"data.proto"),", and ",(0,a.kt)("inlineCode",{parentName:"p"},"cogment.yaml"),"), as well as the ",(0,a.kt)("inlineCode",{parentName:"p"},"run.sh"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"requirements.txt")," and ",(0,a.kt)("inlineCode",{parentName:"p"},"services.yaml")," files, which contain all the functions necessary for installing dependencies and running the Cogment project."),(0,a.kt)("h4",{id:"env"},".env"),(0,a.kt)("p",null,'This file is used to set environment variables. (Note that "environment" in this context refers to the operating system environment, which is not related to the concept of the Environment in the RL or Cogment context.) The variables set in this file specify configurations that are known to all parts of the application while it is running. The ',(0,a.kt)("inlineCode",{parentName:"p"},".env")," file is used in this project to specify the TCP ports through which different Cogment services (such as Actors or the Environment) can be accessed."),(0,a.kt)("h4",{id:"dataproto"},"data.proto"),(0,a.kt)("p",null,"In Cogment, we use ",(0,a.kt)("a",{parentName:"p",href:"https://developers.google.com/protocol-buffers/"},"Protocol Buffers")," to serialize data for communication across different services. In this project, the structure of these protobuf messages are defined in the file ",(0,a.kt)("inlineCode",{parentName:"p"},"data.proto"),". This file does most of the heavy lifting in creating data structures in Python and setting variables to the relevant parameter values (more on this later). The application 'knows' to use the messages defined here by importing it in the ",(0,a.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," configuration file."),(0,a.kt)("h4",{id:"cogmentyaml"},"cogment.yaml"),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file specifies all of the details about how the trials will be implemented. In particular, this file defines what protobuf messages the Environment and Actor(s) participating in the trial will expect and use as inputs and outputs. More information about what kinds of information can/should be included in a Spec File such as ",(0,a.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," can be found on the ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/cogment-yaml"},"Spec File reference page"),"."),(0,a.kt)("h4",{id:"runsh"},"run.sh"),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"run.sh")," file acts as the main command menu for the Cogment project: it contains all of the functions necessary for building and running the code."),(0,a.kt)("h4",{id:"requirementstxt"},"requirements.txt"),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"requirements.txt")," file tells the Python package manager what packages need to be installed for this project to work. If we want any non-standard Python packages to run our application, we will specify them here and the package manager will install them in the virtual environment. For now, this file specifies we only need to install the most recent version of the Cogment Python SDK."),(0,a.kt)("h4",{id:"servicesyaml"},"services.yaml"),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"services.yaml")," file is passed to the Cogment CLI utility command ",(0,a.kt)("inlineCode",{parentName:"p"},"launch"),". For the purposes of this tutorial, it's sufficient to understand that the contents of the ",(0,a.kt)("inlineCode",{parentName:"p"},"services.yaml")," file describe a set of processes to be run in parallel - with the additional condition that once any of these processes terminate, the others will terminate as well. More information about the ",(0,a.kt)("inlineCode",{parentName:"p"},"launch")," process can be found on the ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/cli/launch"},"Launch reference page"),"."),(0,a.kt)("h2",{id:"building-the-application"},"Building the Application"),(0,a.kt)("p",null,"To get all this code to work together, we will need to run the ",(0,a.kt)("inlineCode",{parentName:"p"},"install")," process in the ",(0,a.kt)("inlineCode",{parentName:"p"},"run.sh")," file."),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"In your terminal run the ",(0,a.kt)("inlineCode",{parentName:"strong"},"install")," process with:")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-console"},"./run.sh install\n")),(0,a.kt)("h3",{id:"what-exactly-is-happening-in-the-install"},"What exactly is happening in the install?"),(0,a.kt)("p",null,"We can understand what the ",(0,a.kt)("inlineCode",{parentName:"p"},"install")," function does by taking a closer look at the ",(0,a.kt)("inlineCode",{parentName:"p"},"run.sh")," file. You'll see that this function does the following:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Creates a virtual environment and installs Cogment and any required Python packages there"),(0,a.kt)("li",{parentName:"ul"},"Runs the Cogment Python code generation tool to make the files ",(0,a.kt)("inlineCode",{parentName:"li"},"cog_settings.py")," and ",(0,a.kt)("inlineCode",{parentName:"li"},"data_pb2.py")," which are used by the Python SDK to know about the configurations and data structures which will be used in the application (more on this below).")),(0,a.kt)("p",null,"Now everything is set up to start the application."),(0,a.kt)("h2",{id:"running-the-application"},"Running the Application"),(0,a.kt)("p",null,"Now that we have built all the necessary components, we want to make sure the application can run."),(0,a.kt)("p",null,"We will need two terminals open:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"A terminal to run the services. Those services are the ",(0,a.kt)("inlineCode",{parentName:"li"},"environment"),", the ",(0,a.kt)("inlineCode",{parentName:"li"},"actors"),", and the ",(0,a.kt)("a",{parentName:"li",href:"/docs/reference/cli/orchestrator"},"Cogment Orchestrator"),", which is responsible for coordinating the services together."),(0,a.kt)("li",{parentName:"ul"},"A terminal to run the client that connects to the services in order to run the ",(0,a.kt)("a",{parentName:"li",href:"/docs/guide/core-concepts#trials"},"trial"),". This client is the ",(0,a.kt)("inlineCode",{parentName:"li"},"trial_runner"),".")),(0,a.kt)("p",null,"We need to have the services running already before the Trial Runner can connect. ",(0,a.kt)("strong",{parentName:"p"},"In the first terminal, start the Cogment app services with the command:")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-console"},"./run.sh services_start\n")),(0,a.kt)("p",null,"This command starts the services named in the ",(0,a.kt)("inlineCode",{parentName:"p"},"services.yaml")," file. You should see something like:"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"services_start",src:n(7388).Z,width:"2366",height:"368"})),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"In the second terminal, start the Trial Runner with the command:")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-console"},"./run.sh trial_runner_start\n")),(0,a.kt)("p",null,"At this stage, the Trial Runner starts the trial, lets it run for a few seconds, and then terminates the trial. In the second terminal, you will see something like:"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"trial runner_start",src:n(7860).Z,width:"2366",height:"128"})),(0,a.kt)("p",null,"In our application services terminal, this will also generate some logs reporting what happened. You should see something like this:"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"services running",src:n(6854).Z,width:"2366",height:"694"})),(0,a.kt)("p",null,"At this point, both the action strings received by the Environment and the Observations received by the Actors are empty. In the next steps of the tutorial, we will add them in."),(0,a.kt)("p",null,"You can now terminate the services using ",(0,a.kt)("inlineCode",{parentName:"p"},"ctrl+C"),". At this point we have a working but empty Cogment app."),(0,a.kt)("details",null,(0,a.kt)("summary",null,(0,a.kt)("b",null,(0,a.kt)("span",{style:{fontSize:"20px"}},"Quick Summary"))),(0,a.kt)("p",null,"We got the RPS code from the ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-tutorial-rps"},"github repository"),", and created a new directory ",(0,a.kt)("inlineCode",{parentName:"p"},"rps")," to work from."),(0,a.kt)("p",null,"We ran"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-console"},"./run.sh install\n")),(0,a.kt)("p",null,"to build the necessary elements to get the app up and running."),(0,a.kt)("p",null,"In one terminal, we started the ",(0,a.kt)("inlineCode",{parentName:"p"},"orchestrator"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"environment"),", and ",(0,a.kt)("inlineCode",{parentName:"p"},"actors")," services with:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-console"},"./run.sh services_start\n")),(0,a.kt)("p",null,"In a second terminal, we started the trial runner to begin a trial with:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-console"},"./run.sh client_start\n")),(0,a.kt)("p",null,"The client terminal printed the start and end of the trial, and the services trial reported some empty actions.")),(0,a.kt)("p",null,"In ",(0,a.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/actors-in-cogment"},"the next step"),", we will look a little more closely at how Cogment represents the Actors, and enable them to select ",(0,a.kt)("inlineCode",{parentName:"p"},"ROCK"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"PAPER"),", or ",(0,a.kt)("inlineCode",{parentName:"p"},"SCISSORS")," rather than empty actions."))}h.isMDXComponent=!0},6854:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/services_running_1-8e7a67370095d320c207bb562c27c249.png"},7388:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/services_start-882fdc24a1ae68c55e4f485123b89dfc.png"},7860:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/trial_runner_start-9224103aebfb4e25fd34b0225cc20fee.png"}}]); \ No newline at end of file diff --git a/assets/js/85f318fb.fb5b0e0a.js b/assets/js/85f318fb.fb5b0e0a.js new file mode 100644 index 0000000..967b728 --- /dev/null +++ b/assets/js/85f318fb.fb5b0e0a.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[4896],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>m});var i=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,i,a=function(e,t){if(null==e)return{};var n,i,a={},r=Object.keys(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=i.createContext({}),p=function(e){var t=i.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},c=function(e){var t=p(e.components);return i.createElement(s.Provider,{value:t},e.children)},h="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return i.createElement(i.Fragment,{},t)}},d=i.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),h=p(n),d=a,m=h["".concat(s,".").concat(d)]||h[d]||u[d]||r;return n?i.createElement(m,o(o({ref:t},c),{},{components:n})):i.createElement(m,o({ref:t},c))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,o=new Array(r);o[0]=d;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[h]="string"==typeof e?e:a,o[1]=l;for(var p=2;p<r;p++)o[p]=n[p];return i.createElement.apply(null,o)}return i.createElement.apply(null,n)}d.displayName="MDXCreateElement"},2781:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>u,frontMatter:()=>r,metadata:()=>l,toc:()=>p});var i=n(7462),a=(n(7294),n(3905));const r={title:"Step 1 - An Empty Cogment Application"},o="Set Up the Code & Test a Trial",l={unversionedId:"guide/tutorial/setup",id:"guide/tutorial/setup",title:"Step 1 - An Empty Cogment Application",description:"In this step of the tutorial, we will get the RPS code set up properly and test run a single trial. This will establish the basic working code needed for all subsequent steps of the tutorial. We will go over the components of the repository at a very high level. If any terminology is unclear, it may be useful to refer to the Core Concepts.",source:"@site/docs/guide/tutorial/1-setup.md",sourceDirName:"guide/tutorial",slug:"/guide/tutorial/setup",permalink:"/docs/guide/tutorial/setup",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:1,frontMatter:{title:"Step 1 - An Empty Cogment Application"},sidebar:"docSidebar",previous:{title:"Tutorial",permalink:"/docs/guide/tutorial/"},next:{title:"Step 2 - Actors in Cogment",permalink:"/docs/guide/tutorial/actors-in-cogment"}},s={},p=[{value:"Getting Set Up",id:"getting-set-up",level:2},{value:"Cloning the RPS Source Code",id:"cloning-the-rps-source-code",level:3},{value:"Creating your development directory",id:"creating-your-development-directory",level:3},{value:"What's in this directory?",id:"whats-in-this-directory",level:2},{value:"Service Directories",id:"service-directories",level:3},{value:"Configuration & Execution Files",id:"configuration--execution-files",level:3},{value:".env",id:"env",level:4},{value:"data.proto",id:"dataproto",level:4},{value:"cogment.yaml",id:"cogmentyaml",level:4},{value:"run.sh",id:"runsh",level:4},{value:"requirements.txt",id:"requirementstxt",level:4},{value:"services.yaml",id:"servicesyaml",level:4},{value:"Building the Application",id:"building-the-application",level:2},{value:"What exactly is happening in the install?",id:"what-exactly-is-happening-in-the-install",level:3},{value:"Running the Application",id:"running-the-application",level:2}],c={toc:p},h="wrapper";function u(e){let{components:t,...r}=e;return(0,a.kt)(h,(0,i.Z)({},c,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"set-up-the-code--test-a-trial"},"Set Up the Code & Test a Trial"),(0,a.kt)("p",null,"In this step of the tutorial, we will get the RPS code set up properly and test run a single trial. This will establish the basic working code needed for all subsequent steps of the tutorial. We will go over the components of the repository at a very high level. If any terminology is unclear, it may be useful to refer to the ",(0,a.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts"},"Core Concepts"),"."),(0,a.kt)("admonition",{type:"note"},(0,a.kt)("p",{parentName:"admonition"},"These instructions are for unix-like environments such as Linux, macOS and WSL2 on Windows.")),(0,a.kt)("h2",{id:"getting-set-up"},"Getting Set Up"),(0,a.kt)("p",null,"To begin with, you'll need a working installation of Cogment. If you haven't done so already, follow our ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/cli/"},"installation instructions"),"."),(0,a.kt)("p",null,"Additionally, you'll need:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://www.python.org/"},"Python")," (Cogment currently supports versions 3.7-3.9)"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://virtualenv.pypa.io/en/latest/"},"virtualenv"))),(0,a.kt)("h3",{id:"cloning-the-rps-source-code"},"Cloning the RPS Source Code"),(0,a.kt)("p",null,"If you followed the test step of the installation instructions you have probably already downloaded the sources for the tutorial from the ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-tutorial-rps"},"github repository"),". If not, now is the time to do so."),(0,a.kt)("p",null,"This repository contains completed code for each step of the tutorial in separate folders. If at any point you make a mistake and can't get something working, you can copy the code from the folder corresponding to the last step you completed to get a fresh starting point."),(0,a.kt)("h3",{id:"creating-your-development-directory"},"Creating your development directory"),(0,a.kt)("p",null,"First, let's make a new directory called ",(0,a.kt)("inlineCode",{parentName:"p"},"rps"),", and set this as our working directory. Unless otherwise mentioned, all operations for the rest of the tutorial are done from the ",(0,a.kt)("inlineCode",{parentName:"p"},"rps")," directory. We will then copy the code from the folder for step 1 of the tutorial from the directory ",(0,a.kt)("inlineCode",{parentName:"p"},"1-setup/"),", which contains a blank slate Cogment application as a starting point."),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Execute the following commands in your terminal:")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-console"},"mkdir rps\ncp -r <relative path to cloned repository>/basic_tutorial_steps/1-setup/ rps/\ncd rps\n")),(0,a.kt)("p",null,"We now have a starting point for developing the RPS project. This code copied from ",(0,a.kt)("inlineCode",{parentName:"p"},"basic_tutorial_steps/1-setup")," will run an empty Cogment application with two Actors able to play RPS."),(0,a.kt)("h2",{id:"whats-in-this-directory"},"What's in this directory?"),(0,a.kt)("h3",{id:"service-directories"},"Service Directories"),(0,a.kt)("p",null,"If we look at the elements of ",(0,a.kt)("inlineCode",{parentName:"p"},"rps"),", we will see 3 directories. Each directory contains the code required for managing that service, for now contained completely in a ",(0,a.kt)("inlineCode",{parentName:"p"},"main.py")," file that does all the work for that service. These services are:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"environment/")," which specifies the dynamics of the game itself (what actions are allowed, what are the consequences of those actions),"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"actors/")," which specifies how the Actor(s) work -- what information they get from the environment, and how they use it for making a decision on what action to take next"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"trial_runner/")," which specifies how the Actors and Environment interact within Cogment, and launches the trials to run the games of RPS.")),(0,a.kt)("p",null,"At this stage, each module contains only the ",(0,a.kt)("inlineCode",{parentName:"p"},"main.py")," files. When we build the application, more files will be copied into each directory automatically."),(0,a.kt)("h3",{id:"configuration--execution-files"},"Configuration & Execution Files"),(0,a.kt)("p",null,"The root of the ",(0,a.kt)("inlineCode",{parentName:"p"},"rps")," directory also contains files which set the necessary configurations for running the application (",(0,a.kt)("inlineCode",{parentName:"p"},".env"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"data.proto"),", and ",(0,a.kt)("inlineCode",{parentName:"p"},"cogment.yaml"),"), as well as the ",(0,a.kt)("inlineCode",{parentName:"p"},"run.sh"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"requirements.txt")," and ",(0,a.kt)("inlineCode",{parentName:"p"},"services.yaml")," files, which contain all the functions necessary for installing dependencies and running the Cogment project."),(0,a.kt)("h4",{id:"env"},".env"),(0,a.kt)("p",null,'This file is used to set environment variables. (Note that "environment" in this context refers to the operating system environment, which is not related to the concept of the Environment in the RL or Cogment context.) The variables set in this file specify configurations that are known to all parts of the application while it is running. The ',(0,a.kt)("inlineCode",{parentName:"p"},".env")," file is used in this project to specify the TCP ports through which different Cogment services (such as Actors or the Environment) can be accessed."),(0,a.kt)("h4",{id:"dataproto"},"data.proto"),(0,a.kt)("p",null,"In Cogment, we use ",(0,a.kt)("a",{parentName:"p",href:"https://developers.google.com/protocol-buffers/"},"Protocol Buffers")," to serialize data for communication across different services. In this project, the structure of these protobuf messages are defined in the file ",(0,a.kt)("inlineCode",{parentName:"p"},"data.proto"),". This file does most of the heavy lifting in creating data structures in Python and setting variables to the relevant parameter values (more on this later). The application 'knows' to use the messages defined here by importing it in the ",(0,a.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," configuration file."),(0,a.kt)("h4",{id:"cogmentyaml"},"cogment.yaml"),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file specifies all of the details about how the trials will be implemented. In particular, this file defines what protobuf messages the Environment and Actor(s) participating in the trial will expect and use as inputs and outputs. More information about what kinds of information can/should be included in a Spec File such as ",(0,a.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," can be found on the ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/cogment-yaml"},"Spec File reference page"),"."),(0,a.kt)("h4",{id:"runsh"},"run.sh"),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"run.sh")," file acts as the main command menu for the Cogment project: it contains all of the functions necessary for building and running the code."),(0,a.kt)("h4",{id:"requirementstxt"},"requirements.txt"),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"requirements.txt")," file tells the Python package manager what packages need to be installed for this project to work. If we want any non-standard Python packages to run our application, we will specify them here and the package manager will install them in the virtual environment. For now, this file specifies we only need to install the most recent version of the Cogment Python SDK."),(0,a.kt)("h4",{id:"servicesyaml"},"services.yaml"),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"services.yaml")," file is passed to the Cogment CLI utility command ",(0,a.kt)("inlineCode",{parentName:"p"},"launch"),". For the purposes of this tutorial, it's sufficient to understand that the contents of the ",(0,a.kt)("inlineCode",{parentName:"p"},"services.yaml")," file describe a set of processes to be run in parallel - with the additional condition that once any of these processes terminate, the others will terminate as well. More information about the ",(0,a.kt)("inlineCode",{parentName:"p"},"launch")," process can be found on the ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/cli/launch"},"Launch reference page"),"."),(0,a.kt)("h2",{id:"building-the-application"},"Building the Application"),(0,a.kt)("p",null,"To get all this code to work together, we will need to run the ",(0,a.kt)("inlineCode",{parentName:"p"},"install")," process in the ",(0,a.kt)("inlineCode",{parentName:"p"},"run.sh")," file."),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"In your terminal run the ",(0,a.kt)("inlineCode",{parentName:"strong"},"install")," process with:")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-console"},"./run.sh install\n")),(0,a.kt)("h3",{id:"what-exactly-is-happening-in-the-install"},"What exactly is happening in the install?"),(0,a.kt)("p",null,"We can understand what the ",(0,a.kt)("inlineCode",{parentName:"p"},"install")," function does by taking a closer look at the ",(0,a.kt)("inlineCode",{parentName:"p"},"run.sh")," file. You'll see that this function does the following:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Creates a virtual environment and installs Cogment and any required Python packages there"),(0,a.kt)("li",{parentName:"ul"},"Runs the Cogment Python code generation tool to make the files ",(0,a.kt)("inlineCode",{parentName:"li"},"cog_settings.py")," and ",(0,a.kt)("inlineCode",{parentName:"li"},"data_pb2.py")," which are used by the Python SDK to know about the configurations and data structures which will be used in the application (more on this below).")),(0,a.kt)("p",null,"Now everything is set up to start the application."),(0,a.kt)("h2",{id:"running-the-application"},"Running the Application"),(0,a.kt)("p",null,"Now that we have built all the necessary components, we want to make sure the application can run."),(0,a.kt)("p",null,"We will need two terminals open:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"A terminal to run the services. Those services are the ",(0,a.kt)("inlineCode",{parentName:"li"},"environment"),", the ",(0,a.kt)("inlineCode",{parentName:"li"},"actors"),", and the ",(0,a.kt)("a",{parentName:"li",href:"/docs/reference/cli/orchestrator"},"Cogment Orchestrator"),", which is responsible for coordinating the services together."),(0,a.kt)("li",{parentName:"ul"},"A terminal to run the client that connects to the services in order to run the ",(0,a.kt)("a",{parentName:"li",href:"/docs/guide/core-concepts#trials"},"trial"),". This client is the ",(0,a.kt)("inlineCode",{parentName:"li"},"trial_runner"),".")),(0,a.kt)("p",null,"We need to have the services running already before the Trial Runner can connect. ",(0,a.kt)("strong",{parentName:"p"},"In the first terminal, start the Cogment app services with the command:")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-console"},"./run.sh services_start\n")),(0,a.kt)("p",null,"This command starts the services named in the ",(0,a.kt)("inlineCode",{parentName:"p"},"services.yaml")," file. You should see something like:"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"services_start",src:n(7388).Z,width:"2366",height:"368"})),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"In the second terminal, start the Trial Runner with the command:")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-console"},"./run.sh trial_runner_start\n")),(0,a.kt)("p",null,"At this stage, the Trial Runner starts the trial, lets it run for a few seconds, and then terminates the trial. In the second terminal, you will see something like:"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"trial runner_start",src:n(7860).Z,width:"2366",height:"128"})),(0,a.kt)("p",null,"In our application services terminal, this will also generate some logs reporting what happened. You should see something like this:"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"services running",src:n(2247).Z,width:"2366",height:"694"})),(0,a.kt)("p",null,"At this point, both the action strings received by the Environment and the Observations received by the Actors are empty. In the next steps of the tutorial, we will add them in."),(0,a.kt)("p",null,"You can now terminate the services using ",(0,a.kt)("inlineCode",{parentName:"p"},"ctrl+C"),". At this point we have a working but empty Cogment app."),(0,a.kt)("details",null,(0,a.kt)("summary",null,(0,a.kt)("b",null,(0,a.kt)("span",{style:{fontSize:"20px"}},"Quick Summary"))),(0,a.kt)("p",null,"We got the RPS code from the ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-tutorial-rps"},"github repository"),", and created a new directory ",(0,a.kt)("inlineCode",{parentName:"p"},"rps")," to work from."),(0,a.kt)("p",null,"We ran"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-console"},"./run.sh install\n")),(0,a.kt)("p",null,"to build the necessary elements to get the app up and running."),(0,a.kt)("p",null,"In one terminal, we started the ",(0,a.kt)("inlineCode",{parentName:"p"},"orchestrator"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"environment"),", and ",(0,a.kt)("inlineCode",{parentName:"p"},"actors")," services with:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-console"},"./run.sh services_start\n")),(0,a.kt)("p",null,"In a second terminal, we started the trial runner to begin a trial with:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-console"},"./run.sh client_start\n")),(0,a.kt)("p",null,"The client terminal printed the start and end of the trial, and the services trial reported some empty actions.")),(0,a.kt)("p",null,"In ",(0,a.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/actors-in-cogment"},"the next step"),", we will look a little more closely at how Cogment represents the Actors, and enable them to select ",(0,a.kt)("inlineCode",{parentName:"p"},"ROCK"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"PAPER"),", or ",(0,a.kt)("inlineCode",{parentName:"p"},"SCISSORS")," rather than empty actions."))}u.isMDXComponent=!0},2247:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/services_running_1-8e7a67370095d320c207bb562c27c249.png"},7388:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/services_start-882fdc24a1ae68c55e4f485123b89dfc.png"},7860:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/trial_runner_start-9224103aebfb4e25fd34b0225cc20fee.png"}}]); \ No newline at end of file diff --git a/assets/js/8ba33b25.3073f947.js b/assets/js/8ba33b25.3073f947.js new file mode 100644 index 0000000..800f855 --- /dev/null +++ b/assets/js/8ba33b25.3073f947.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[9985],{5386:(e,t,a)=>{a.d(t,{Z:()=>o});var n,r,l=a(7294);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},i.apply(this,arguments)}const o=e=>{let{title:t,titleId:a,...o}=e;return l.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 253.19 53.76","aria-labelledby":a},o),t?l.createElement("title",{id:a},t):null,n||(n=l.createElement("g",{className:"main"},l.createElement("path",{d:"M179.82 40c7.19 0 12.93-3.25 14.78-8.58l-7.3-1.86a7.76 7.76 0 0 1-7.13 4.06c-4.23 0-7.19-2.73-7.89-6.9h23.31a18.22 18.22 0 0 0 .12-2.61c0-9.33-6.5-15.65-16-15.65s-16.3 6.27-16.3 15.54c0 9.57 6.79 16 16.41 16Zm-.29-25.17A7.34 7.34 0 0 1 187 21.4h-14.78c.7-3.95 3.43-6.56 7.31-6.56ZM209.57 36.15V22.38a6.29 6.29 0 0 1 6.26-6.49c3.48 0 5.56 2.55 5.56 6.2V33.7l8.61-1.78v-11c0-7.13-4.47-12.35-11.2-12.35-3.59 0-6.43 1.68-8.63 5.05h-.58V9.39H201v28.54ZM237.85 30.28l8.55-1.78V15.65h6.79V9.39h-6.79l.06-9.39h-6.72l-1.69 9.39h-4.4v6.26h4.17l.03 14.63zM95.8 13.16h-.58a11.72 11.72 0 0 0-9.68-4.64c-8.24 0-14 6.15-14 15.72 0 9.16 5.79 15.24 14 15.24A11.84 11.84 0 0 0 95 35.19h.58v3.31c0 4.87-3.07 8-7.83 8a7.53 7.53 0 0 1-7.54-5.22l-8.29 1.63c1.44 6.66 7.41 10.43 16.08 10.43 9.92 0 16.18-5.45 16.18-14.61V9.39H95.8ZM88 32.47c-4.58 0-7.88-3.48-7.88-8.23s3.3-8.41 7.88-8.41 7.83 3.54 7.83 8.41-3.22 8.23-7.83 8.23ZM119.23 22.15c0-3.83 2.2-6.32 5.56-6.32s5.34 2.49 5.34 6.32v16.93h8.64V22.15c0-3.71 2.32-6.32 5.68-6.32s5.55 2.72 5.55 6.32v16.93h8.59V20.7c0-7.19-4.7-12.18-11.25-12.18a10.21 10.21 0 0 0-9.34 5.57h-.58a10.11 10.11 0 0 0-9.1-5.62 9.63 9.63 0 0 0-8.58 5.33h-.58V9.39h-8.52v29.69h8.58ZM51.43 8.47C41.51 8.47 35 14.67 35 24.24S41.51 40 51.43 40 67.9 33.86 67.9 24.24 61.29 8.47 51.43 8.47Zm0 24.23c-4.64 0-7.89-3.54-7.89-8.46s3.25-8.41 7.89-8.41 7.83 3.48 7.83 8.41S56 32.7 51.43 32.7ZM16.18 32.93c-4.35 0-7.6-3.59-7.6-8.69s3.31-8.7 7.65-8.7a7.27 7.27 0 0 1 7.08 5.51l8-1.05c-1-7-7.13-11.53-15.19-11.53C6.55 8.47 0 14.79 0 24.24S6.67 40 16.12 40c7.94 0 14.15-4.53 15.25-11.54l-8.06-1a7.29 7.29 0 0 1-7.13 5.47Z"}))),r||(r=l.createElement("g",{className:"subscript",fill:"#231f20"},l.createElement("path",{d:"M110.75 43.65h2.67l2.12 7.45h.17l2.14-7.45h2.66l-3.05 9.77h-3.66ZM146.34 53.05a4.55 4.55 0 0 1-1.72-1.86 5.91 5.91 0 0 1-.62-2.74 5.59 5.59 0 0 1 .61-2.67 4.36 4.36 0 0 1 1.71-1.8 4.88 4.88 0 0 1 2.51-.64 4.65 4.65 0 0 1 2.45.65 4.37 4.37 0 0 1 1.66 1.82 5.77 5.77 0 0 1 .6 2.67v.46a3.9 3.9 0 0 1 0 .4h-6.9a3.28 3.28 0 0 0 .42 1.21 2.19 2.19 0 0 0 1.94 1.07 2.25 2.25 0 0 0 1.25-.36 2.35 2.35 0 0 0 .84-1l2.18.61a3.86 3.86 0 0 1-.92 1.5 4.17 4.17 0 0 1-1.52 1 5.33 5.33 0 0 1-1.93.34 4.7 4.7 0 0 1-2.56-.66Zm4.66-5.46a3.13 3.13 0 0 0-.4-1.11 2.11 2.11 0 0 0-.76-.78 2 2 0 0 0-1-.27 2 2 0 0 0-1 .26 2.08 2.08 0 0 0-.74.76 3 3 0 0 0-.4 1.14ZM179 43.65h2.48V45h.19a2.39 2.39 0 0 1 .88-1.1 2.14 2.14 0 0 1 1.27-.41 3.12 3.12 0 0 1 .54 0 1.47 1.47 0 0 1 .46.17v2.56a3.68 3.68 0 0 0-.77-.26 3 3 0 0 0-.67-.09 1.61 1.61 0 0 0-1.35.7 3 3 0 0 0-.52 1.83v5H179ZM212.83 53.32a3.23 3.23 0 0 1-1.45-1.24 3.62 3.62 0 0 1-.5-1.93h2.21a1.74 1.74 0 0 0 .58 1.26 2.11 2.11 0 0 0 1.46.48 1.94 1.94 0 0 0 1.16-.32 1 1 0 0 0 .43-.89.79.79 0 0 0-.23-.63 1.34 1.34 0 0 0-.58-.3 6.18 6.18 0 0 0-1-.18h-.49a8.3 8.3 0 0 1-1.72-.39 2.5 2.5 0 0 1-1.7-2.61 3.14 3.14 0 0 1 .49-1.75 3 3 0 0 1 1.36-1.13 5 5 0 0 1 2-.39 5.14 5.14 0 0 1 2.1.41 3.28 3.28 0 0 1 1.44 1.14 2.87 2.87 0 0 1 .5 1.74h-2.29a1.28 1.28 0 0 0-.49-1 1.9 1.9 0 0 0-1.26-.38 1.83 1.83 0 0 0-1.1.31 1 1 0 0 0-.44.83.73.73 0 0 0 .26.61 1.42 1.42 0 0 0 .64.31 9.54 9.54 0 0 0 1.11.17l.29.06h.12a6.94 6.94 0 0 1 1.72.37 2.93 2.93 0 0 1 1.24.9 2.61 2.61 0 0 1 .49 1.67 3 3 0 0 1-1.92 2.93 5.61 5.61 0 0 1-2.24.4 5.25 5.25 0 0 1-2.19-.45ZM245.75 53.05a4.62 4.62 0 0 1-1.75-1.86 5.91 5.91 0 0 1-.61-2.74 5.71 5.71 0 0 1 .6-2.67 4.45 4.45 0 0 1 1.72-1.8 4.85 4.85 0 0 1 2.5-.64 4.66 4.66 0 0 1 2.46.65 4.43 4.43 0 0 1 1.66 1.82 5.89 5.89 0 0 1 .59 2.67v.46a2.24 2.24 0 0 1 0 .4H246a3.28 3.28 0 0 0 .42 1.21 2.29 2.29 0 0 0 .82.79 2.18 2.18 0 0 0 1.11.28 2.22 2.22 0 0 0 1.24-.36 2.45 2.45 0 0 0 .85-1l2.17.61a3.84 3.84 0 0 1-.91 1.5 4.21 4.21 0 0 1-1.53 1 5.32 5.32 0 0 1-1.92.34 4.76 4.76 0 0 1-2.5-.66Zm4.63-5.46a3.12 3.12 0 0 0-.39-1.11 2.19 2.19 0 0 0-.76-.78 2.07 2.07 0 0 0-1-.27 2 2 0 0 0-1 .26 2.1 2.1 0 0 0-.75.76 3.2 3.2 0 0 0-.39 1.14Z"}))))}},3057:(e,t,a)=>{a.d(t,{ZP:()=>o});var n=a(7462),r=(a(7294),a(3905));const l={toc:[]},i="wrapper";function o(e){let{components:t,...a}=e;return(0,r.kt)(i,(0,n.Z)({},l,a,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"Cogment Verse is a SDK helping researchers and developers in the fields of human-in-the-loop learning (HILL) and multi-agent reinforcement learning (MARL) train and validate their agents at scale. Cogment Verse instantiates the open-source ",(0,r.kt)("a",{parentName:"p",href:"/"},"Cogment")," platform for environments following the OpenAI Gym mold, making it easy to get started."),(0,r.kt)("p",null,"Simply clone the ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-verse"},"repo")," and start training."))}o.isMDXComponent=!0},2058:(e,t,a)=>{a.d(t,{_:()=>o});var n=a(7462),r=a(7294),l=a(6010);const i={cta:"cta_i4Jo"};function o(e){let{children:t,className:a,...o}=e;return r.createElement("div",(0,n.Z)({className:(0,l.Z)(a,i.cta)},o),t)}},4388:(e,t,a)=>{a.d(t,{V:()=>o});var n=a(7462),r=a(7294),l=a(6010);const i={hero:"hero_uw3b"};function o(e){let{children:t,className:a,...o}=e;return r.createElement("div",(0,n.Z)({className:(0,l.Z)(a,"hero",i.hero)},o),t)}},5137:(e,t,a)=>{a.d(t,{W:()=>o});var n=a(7462),r=a(7294);const l={screenshots:"screenshots_x3pV"};var i=a(6010);function o(e){let{children:t,className:a,...o}=e;return r.createElement("div",(0,n.Z)({className:(0,i.Z)(l.screenshots,a)},o),t)}},936:(e,t,a)=>{a.d(t,{$:()=>o});var n=a(7462),r=a(7294),l=a(6010);const i={section:"section_ccoD"};function o(e){let{children:t,className:a,...o}=e;return r.createElement("div",(0,n.Z)({className:(0,l.Z)(a,i.section)},o),t)}},5673:(e,t,a)=>{a.d(t,{Z:()=>s});var n=a(7294);const r=a.p+"assets/images/atari_double_dunk-957d0719ded0c73d0d19c54205e9d89f.gif",l=a.p+"assets/images/classic_go-194543ef4e433ad1a827c74bb296b9f7.gif",i=a.p+"assets/images/atari_montezumas_revenge-1451d09162dd95c536af9e45af10d6b5.gif",o=a.p+"assets/images/lunar_lander-49afc13c99c3d30fd673b642cbbc2c9b.gif";const s=function(){return n.createElement(n.Fragment,null,n.createElement("img",{src:r,alt:"Atari Double Dunk - From Petting Zoo"}),n.createElement("img",{src:l,alt:"Go - From Petting Zoo"}),n.createElement("img",{src:i,alt:"Atari Montezuma's Revenge - From Open AI Gym"}),n.createElement("img",{src:o,alt:"Lunar Lander - From Open AI Gym"}))}},2900:(e,t,a)=>{a.r(t),a.d(t,{default:()=>T});var n=a(3636),r=a(3024),l=a(7814),i=a(6010),o=a(7294),s=a(7452),c=a(6627),m=a(9960);const d={videoContainer:"videoContainer_Inu3",cogment_verse_logo:"cogment_verse_logo_FnS0"};var p=a(5386),u=a(7462),g=a(3905);const h={toc:[{value:"Interactive Web Application",id:"interactive-web-application",level:4}]};function v(e){let{components:t,...a}=e;return(0,g.kt)("wrapper",(0,u.Z)({},h,a,{components:t,mdxType:"MDXLayout"}),(0,g.kt)("h4",{id:"interactive-web-application"},"Interactive Web Application"),(0,g.kt)("p",null,"A built-in interactive web application enables seamless human participation in episodes during the training and validation processes. Additional environments can be made interactive with very little web development required.."))}v.isMDXComponent=!0;const f={toc:[{value:"HILL and MARL Training",id:"hill-and-marl-training",level:4}]};function b(e){let{components:t,...a}=e;return(0,g.kt)("wrapper",(0,u.Z)({},f,a,{components:t,mdxType:"MDXLayout"}),(0,g.kt)("h4",{id:"hill-and-marl-training"},"HILL and MARL Training"),(0,g.kt)("p",null,"Our SDK includes base implementations for multiple RL algorithms such as DQN, TD3, A2C and PPO for both single- and multi-agent reinforcement learning (MARL). For human-in-the-loop learning, Cogment Verse includes different paradigms like learning from demonstrations (behavior cloning), learning from human interventions, and learning from explicit human feedback (RLHF). More importantly, the SDK makes it easy to implement any asynchronous centralized training / decentralized execution algorithm."))}b.isMDXComponent=!0;const E={toc:[{value:"Extensive Environment Library",id:"extensive-environment-library",level:4}]};function y(e){let{components:t,...a}=e;return(0,g.kt)("wrapper",(0,u.Z)({},E,a,{components:t,mdxType:"MDXLayout"}),(0,g.kt)("h4",{id:"extensive-environment-library"},"Extensive Environment Library"),(0,g.kt)("p",null,"The existing environment library includes the standard ",(0,g.kt)("a",{parentName:"p",href:"https://www.gymlibrary.dev"},"OpenAI Gym")," environments as well as board games, card games, and other multi-agent environments from ",(0,g.kt)("a",{parentName:"p",href:"https://pettingzoo.farama.org"},"Petting Zoo"),". Other environments are gradually being added, such as ",(0,g.kt)("a",{parentName:"p",href:"https://developer.nvidia.com/isaac-gym"},"Isaac Gym")," or ",(0,g.kt)("a",{parentName:"p",href:"https://github.com/HumanCompatibleAI/overcooked_ai"},"Overcooked-AI"),". Implementing your own interactive custom environments is also quite straightforward."))}y.isMDXComponent=!0;const N={toc:[{value:"Collaboration Patterns",id:"collaboration-patterns",level:4}]};function w(e){let{components:t,...a}=e;return(0,g.kt)("wrapper",(0,u.Z)({},N,a,{components:t,mdxType:"MDXLayout"}),(0,g.kt)("h4",{id:"collaboration-patterns"},"Collaboration Patterns"),(0,g.kt)("p",null,"Library of predefined roles for agents or humans facilitating the implementation of multiple collaboration patterns: co-players, teacher/student dual control, evaluators, etc."))}w.isMDXComponent=!0;const k={toc:[{value:"Experiments Management",id:"experiments-management",level:4}]};function Z(e){let{components:t,...a}=e;return(0,g.kt)("wrapper",(0,u.Z)({},k,a,{components:t,mdxType:"MDXLayout"}),(0,g.kt)("h4",{id:"experiments-management"},"Experiments Management"),(0,g.kt)("p",null,"Monitor and manage reproducible experiments, thanks to:"),(0,g.kt)("ul",null,(0,g.kt)("li",{parentName:"ul"},"A powerful configuration management system, including hyperparameters and seeds, built on ",(0,g.kt)("a",{parentName:"li",href:"https://hydra.cc"},"Hydra"),"."),(0,g.kt)("li",{parentName:"ul"},"Streamlined experiment tracking using ",(0,g.kt)("a",{parentName:"li",href:"https://mlflow.org"},"mlflow"),"."),(0,g.kt)("li",{parentName:"ul"},"Trained model versioning and storage via the ",(0,g.kt)("a",{parentName:"li",href:"../../../../docs/reference/cli/model-registry"},"Cogment Model Registry"),"."),(0,g.kt)("li",{parentName:"ul"},"Episode data management from the ",(0,g.kt)("a",{parentName:"li",href:"../../../../docs/reference/cli/trial-datastore/trial-datastore-server"},"Cogment Trial Datastore"),".")))}Z.isMDXComponent=!0;const M=[b,v,w,y,Z],L={toc:[]},C="wrapper";function _(e){let{components:t,...a}=e;return(0,g.kt)(C,(0,u.Z)({},L,a,{components:t,mdxType:"MDXLayout"}),(0,g.kt)("p",null,"If you use Cogment Verse in your research, please cite our demo paper appearing in ",(0,g.kt)("a",{parentName:"p",href:"https://aamas2023.soton.ac.uk"},"AAMAS 2023")," ",(0,g.kt)("a",{parentName:"p",href:"https://dl.acm.org/doi/abs/10.5555/3545946.3599174"},"proceedings"),":"),(0,g.kt)("pre",null,(0,g.kt)("code",{parentName:"pre",className:"language-bibtex"},"@inproceedings{cogment_verse_2023,\n title={Hiking up that HILL with Cogment-Verse: Train \\& Operate Multi-agent Systems Learning from Humans},\n author={Gottipati, Sai Krishna and Nguyen, Luong-Ha and Mars, Clod{\\'e}ric and Taylor, Matthew E},\n booktitle={Proceedings of the 2023 International Conference on Autonomous Agents and Multiagent Systems},\n pages={3065--3067},\n year={2023}\n}\n")))}_.isMDXComponent=!0;var A=a(3057),D=a(5137),x=a(5673),I=a(2058),V=a(4388),H=a(936);function T(){return o.createElement(s.Z,{title:"Cogment Verse",description:"Research platform for Human-in-the-loop learning (HILL) & Multi-Agent Reinforcement Learning (MARL)"},o.createElement(V.V,{className:"shadow--md"},o.createElement("div",{className:"container"},o.createElement("div",{className:(0,i.Z)("row")},o.createElement("div",{className:(0,i.Z)("col","col--5",c.Z.verticallyJustifiedCol)},o.createElement("div",{className:"padding--lg"},o.createElement(p.Z,{className:d.cogment_verse_logo}))),o.createElement("div",{className:(0,i.Z)("col","col--7")},o.createElement("h1",{className:"hero__title"},"Research platform for Human-in-the-loop learning & Multi-Agent Reinforcement Learning"),o.createElement("h2",{className:"hero__subtitle"},"Start building & training agents with HILL and MARL techniques within ",o.createElement(m.Z,{href:"https://www.gymlibrary.dev/"},"Gym"),","," ",o.createElement(m.Z,{href:"https://pettingzoo.farama.org/"},"Petting Zoo"),", and more..."))),o.createElement(I._,{className:"row"},o.createElement(m.Z,{href:"https://github.com/cogment/cogment-verse",className:"button button--lg button--secondary"},o.createElement(l.G,{icon:r.zhw})," Get started")))),o.createElement(H.$,{className:(0,i.Z)("margin-vert--lg","padding-vert--lg")},o.createElement("div",{className:"container"},o.createElement("div",{className:"row"},o.createElement("div",{className:"col"},o.createElement("h3",null,"Video Demo"))),o.createElement("div",{className:"row"},o.createElement("div",{className:"col"},o.createElement("div",{className:d.videoContainer},o.createElement("iframe",{src:"https://www.youtube.com/embed/v-K0DqIL9K0",title:"Hiking up that HILL with Cogment Verse",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",frameborder:"0",allowfullscreen:!0})))))),o.createElement(H.$,{className:(0,i.Z)("shadow--md","margin-vert--lg","padding-vert--lg")},o.createElement("div",{className:"container"},o.createElement("div",{className:"row"},o.createElement("div",{className:"col"},o.createElement("h3",null,"Key features"))),o.createElement("div",{className:"row"},o.createElement("div",{className:"col"},o.createElement(A.ZP,null))),o.createElement(D.W,{className:"row"},o.createElement(x.Z,null)),o.createElement("div",{className:"row"},o.createElement("div",{className:(0,i.Z)("col",c.Z.verticallyJustifiedCol)},M.filter(((e,t,a)=>t<a.length/2)).map((e=>o.createElement("div",null,o.createElement(e,null))))),o.createElement("div",{className:(0,i.Z)("col",c.Z.verticallyJustifiedCol)},M.filter(((e,t,a)=>t>=a.length/2)).map((e=>o.createElement("div",null,o.createElement(e,null)))))),o.createElement("div",{className:"row"},o.createElement("div",{className:"col"},o.createElement("h3",null,"Citation"))),o.createElement("div",{className:"row"},o.createElement("div",{className:"col"},o.createElement(_,null))),o.createElement(I._,{className:"row"},o.createElement(m.Z,{className:"button button--secondary button--lg",href:"https://discord.com/invite/QDxb9Fweqr"},o.createElement(l.G,{icon:r.omb})," Join the community on Discord")))))}n.vc.autoAddCss=!1},6627:(e,t,a)=>{a.d(t,{Z:()=>n});const n={verticallyJustifiedCol:"verticallyJustifiedCol__fFm"}}}]); \ No newline at end of file diff --git a/assets/js/8ba33b25.993fc35e.js b/assets/js/8ba33b25.993fc35e.js deleted file mode 100644 index 993be9d..0000000 --- a/assets/js/8ba33b25.993fc35e.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[9985],{5386:(e,t,a)=>{a.d(t,{Z:()=>o});var n,r,l=a(7294);function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},i.apply(this,arguments)}const o=e=>{let{title:t,titleId:a,...o}=e;return l.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 253.19 53.76","aria-labelledby":a},o),t?l.createElement("title",{id:a},t):null,n||(n=l.createElement("g",{className:"main"},l.createElement("path",{d:"M179.82 40c7.19 0 12.93-3.25 14.78-8.58l-7.3-1.86a7.76 7.76 0 0 1-7.13 4.06c-4.23 0-7.19-2.73-7.89-6.9h23.31a18.22 18.22 0 0 0 .12-2.61c0-9.33-6.5-15.65-16-15.65s-16.3 6.27-16.3 15.54c0 9.57 6.79 16 16.41 16Zm-.29-25.17A7.34 7.34 0 0 1 187 21.4h-14.78c.7-3.95 3.43-6.56 7.31-6.56ZM209.57 36.15V22.38a6.29 6.29 0 0 1 6.26-6.49c3.48 0 5.56 2.55 5.56 6.2V33.7l8.61-1.78v-11c0-7.13-4.47-12.35-11.2-12.35-3.59 0-6.43 1.68-8.63 5.05h-.58V9.39H201v28.54ZM237.85 30.28l8.55-1.78V15.65h6.79V9.39h-6.79l.06-9.39h-6.72l-1.69 9.39h-4.4v6.26h4.17l.03 14.63zM95.8 13.16h-.58a11.72 11.72 0 0 0-9.68-4.64c-8.24 0-14 6.15-14 15.72 0 9.16 5.79 15.24 14 15.24A11.84 11.84 0 0 0 95 35.19h.58v3.31c0 4.87-3.07 8-7.83 8a7.53 7.53 0 0 1-7.54-5.22l-8.29 1.63c1.44 6.66 7.41 10.43 16.08 10.43 9.92 0 16.18-5.45 16.18-14.61V9.39H95.8ZM88 32.47c-4.58 0-7.88-3.48-7.88-8.23s3.3-8.41 7.88-8.41 7.83 3.54 7.83 8.41-3.22 8.23-7.83 8.23ZM119.23 22.15c0-3.83 2.2-6.32 5.56-6.32s5.34 2.49 5.34 6.32v16.93h8.64V22.15c0-3.71 2.32-6.32 5.68-6.32s5.55 2.72 5.55 6.32v16.93h8.59V20.7c0-7.19-4.7-12.18-11.25-12.18a10.21 10.21 0 0 0-9.34 5.57h-.58a10.11 10.11 0 0 0-9.1-5.62 9.63 9.63 0 0 0-8.58 5.33h-.58V9.39h-8.52v29.69h8.58ZM51.43 8.47C41.51 8.47 35 14.67 35 24.24S41.51 40 51.43 40 67.9 33.86 67.9 24.24 61.29 8.47 51.43 8.47Zm0 24.23c-4.64 0-7.89-3.54-7.89-8.46s3.25-8.41 7.89-8.41 7.83 3.48 7.83 8.41S56 32.7 51.43 32.7ZM16.18 32.93c-4.35 0-7.6-3.59-7.6-8.69s3.31-8.7 7.65-8.7a7.27 7.27 0 0 1 7.08 5.51l8-1.05c-1-7-7.13-11.53-15.19-11.53C6.55 8.47 0 14.79 0 24.24S6.67 40 16.12 40c7.94 0 14.15-4.53 15.25-11.54l-8.06-1a7.29 7.29 0 0 1-7.13 5.47Z"}))),r||(r=l.createElement("g",{className:"subscript",fill:"#231f20"},l.createElement("path",{d:"M110.75 43.65h2.67l2.12 7.45h.17l2.14-7.45h2.66l-3.05 9.77h-3.66ZM146.34 53.05a4.55 4.55 0 0 1-1.72-1.86 5.91 5.91 0 0 1-.62-2.74 5.59 5.59 0 0 1 .61-2.67 4.36 4.36 0 0 1 1.71-1.8 4.88 4.88 0 0 1 2.51-.64 4.65 4.65 0 0 1 2.45.65 4.37 4.37 0 0 1 1.66 1.82 5.77 5.77 0 0 1 .6 2.67v.46a3.9 3.9 0 0 1 0 .4h-6.9a3.28 3.28 0 0 0 .42 1.21 2.19 2.19 0 0 0 1.94 1.07 2.25 2.25 0 0 0 1.25-.36 2.35 2.35 0 0 0 .84-1l2.18.61a3.86 3.86 0 0 1-.92 1.5 4.17 4.17 0 0 1-1.52 1 5.33 5.33 0 0 1-1.93.34 4.7 4.7 0 0 1-2.56-.66Zm4.66-5.46a3.13 3.13 0 0 0-.4-1.11 2.11 2.11 0 0 0-.76-.78 2 2 0 0 0-1-.27 2 2 0 0 0-1 .26 2.08 2.08 0 0 0-.74.76 3 3 0 0 0-.4 1.14ZM179 43.65h2.48V45h.19a2.39 2.39 0 0 1 .88-1.1 2.14 2.14 0 0 1 1.27-.41 3.12 3.12 0 0 1 .54 0 1.47 1.47 0 0 1 .46.17v2.56a3.68 3.68 0 0 0-.77-.26 3 3 0 0 0-.67-.09 1.61 1.61 0 0 0-1.35.7 3 3 0 0 0-.52 1.83v5H179ZM212.83 53.32a3.23 3.23 0 0 1-1.45-1.24 3.62 3.62 0 0 1-.5-1.93h2.21a1.74 1.74 0 0 0 .58 1.26 2.11 2.11 0 0 0 1.46.48 1.94 1.94 0 0 0 1.16-.32 1 1 0 0 0 .43-.89.79.79 0 0 0-.23-.63 1.34 1.34 0 0 0-.58-.3 6.18 6.18 0 0 0-1-.18h-.49a8.3 8.3 0 0 1-1.72-.39 2.5 2.5 0 0 1-1.7-2.61 3.14 3.14 0 0 1 .49-1.75 3 3 0 0 1 1.36-1.13 5 5 0 0 1 2-.39 5.14 5.14 0 0 1 2.1.41 3.28 3.28 0 0 1 1.44 1.14 2.87 2.87 0 0 1 .5 1.74h-2.29a1.28 1.28 0 0 0-.49-1 1.9 1.9 0 0 0-1.26-.38 1.83 1.83 0 0 0-1.1.31 1 1 0 0 0-.44.83.73.73 0 0 0 .26.61 1.42 1.42 0 0 0 .64.31 9.54 9.54 0 0 0 1.11.17l.29.06h.12a6.94 6.94 0 0 1 1.72.37 2.93 2.93 0 0 1 1.24.9 2.61 2.61 0 0 1 .49 1.67 3 3 0 0 1-1.92 2.93 5.61 5.61 0 0 1-2.24.4 5.25 5.25 0 0 1-2.19-.45ZM245.75 53.05a4.62 4.62 0 0 1-1.75-1.86 5.91 5.91 0 0 1-.61-2.74 5.71 5.71 0 0 1 .6-2.67 4.45 4.45 0 0 1 1.72-1.8 4.85 4.85 0 0 1 2.5-.64 4.66 4.66 0 0 1 2.46.65 4.43 4.43 0 0 1 1.66 1.82 5.89 5.89 0 0 1 .59 2.67v.46a2.24 2.24 0 0 1 0 .4H246a3.28 3.28 0 0 0 .42 1.21 2.29 2.29 0 0 0 .82.79 2.18 2.18 0 0 0 1.11.28 2.22 2.22 0 0 0 1.24-.36 2.45 2.45 0 0 0 .85-1l2.17.61a3.84 3.84 0 0 1-.91 1.5 4.21 4.21 0 0 1-1.53 1 5.32 5.32 0 0 1-1.92.34 4.76 4.76 0 0 1-2.5-.66Zm4.63-5.46a3.12 3.12 0 0 0-.39-1.11 2.19 2.19 0 0 0-.76-.78 2.07 2.07 0 0 0-1-.27 2 2 0 0 0-1 .26 2.1 2.1 0 0 0-.75.76 3.2 3.2 0 0 0-.39 1.14Z"}))))}},3057:(e,t,a)=>{a.d(t,{ZP:()=>i});var n=a(7462),r=(a(7294),a(3905));const l={toc:[]};function i(e){let{components:t,...a}=e;return(0,r.kt)("wrapper",(0,n.Z)({},l,a,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"Cogment Verse is a SDK helping researchers and developers in the fields of human-in-the-loop learning (HILL) and multi-agent reinforcement learning (MARL) train and validate their agents at scale. Cogment Verse instantiates the open-source ",(0,r.kt)("a",{parentName:"p",href:"/"},"Cogment")," platform for environments following the OpenAI Gym mold, making it easy to get started."),(0,r.kt)("p",null,"Simply clone the ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-verse"},"repo")," and start training."))}i.isMDXComponent=!0},2058:(e,t,a)=>{a.d(t,{_:()=>o});var n=a(7462),r=a(7294),l=a(6010);const i="cta_i4Jo";function o(e){let{children:t,className:a,...o}=e;return r.createElement("div",(0,n.Z)({className:(0,l.Z)(a,i)},o),t)}},4388:(e,t,a)=>{a.d(t,{V:()=>o});var n=a(7462),r=a(7294),l=a(6010);const i="hero_uw3b";function o(e){let{children:t,className:a,...o}=e;return r.createElement("div",(0,n.Z)({className:(0,l.Z)(a,"hero",i)},o),t)}},5137:(e,t,a)=>{a.d(t,{W:()=>o});var n=a(7462),r=a(7294);const l="screenshots_x3pV";var i=a(6010);function o(e){let{children:t,className:a,...o}=e;return r.createElement("div",(0,n.Z)({className:(0,i.Z)(l,a)},o),t)}},936:(e,t,a)=>{a.d(t,{$:()=>o});var n=a(7462),r=a(7294),l=a(6010);const i="section_ccoD";function o(e){let{children:t,className:a,...o}=e;return r.createElement("div",(0,n.Z)({className:(0,l.Z)(a,i)},o),t)}},5673:(e,t,a)=>{a.d(t,{Z:()=>s});var n=a(7294);const r=a.p+"assets/images/atari_double_dunk-957d0719ded0c73d0d19c54205e9d89f.gif",l=a.p+"assets/images/classic_go-194543ef4e433ad1a827c74bb296b9f7.gif",i=a.p+"assets/images/atari_montezumas_revenge-1451d09162dd95c536af9e45af10d6b5.gif",o=a.p+"assets/images/lunar_lander-49afc13c99c3d30fd673b642cbbc2c9b.gif";const s=function(){return n.createElement(n.Fragment,null,n.createElement("img",{src:r,alt:"Atari Double Dunk - From Petting Zoo"}),n.createElement("img",{src:l,alt:"Go - From Petting Zoo"}),n.createElement("img",{src:i,alt:"Atari Montezuma's Revenge - From Open AI Gym"}),n.createElement("img",{src:o,alt:"Lunar Lander - From Open AI Gym"}))}},2900:(e,t,a)=>{a.r(t),a.d(t,{default:()=>T});var n=a(8947),r=a(1417),l=a(7814),i=a(6010),o=a(7294),s=a(7452),c=a(6627),m=a(9960);const d="videoContainer_Inu3",p="cogment_verse_logo_FnS0";var u=a(5386),h=a(7462),g=a(3905);const v={toc:[{value:"Interactive Web Application",id:"interactive-web-application",level:4}]};function f(e){let{components:t,...a}=e;return(0,g.kt)("wrapper",(0,h.Z)({},v,a,{components:t,mdxType:"MDXLayout"}),(0,g.kt)("h4",{id:"interactive-web-application"},"Interactive Web Application"),(0,g.kt)("p",null,"A built-in interactive web application enables seamless human participation in episodes during the training and validation processes. Additional environments can be made interactive with very little web development required.."))}f.isMDXComponent=!0;const E={toc:[{value:"HILL and MARL Training",id:"hill-and-marl-training",level:4}]};function b(e){let{components:t,...a}=e;return(0,g.kt)("wrapper",(0,h.Z)({},E,a,{components:t,mdxType:"MDXLayout"}),(0,g.kt)("h4",{id:"hill-and-marl-training"},"HILL and MARL Training"),(0,g.kt)("p",null,"Our SDK includes base implementations for multiple RL algorithms such as DQN, TD3, A2C and PPO for both single- and multi-agent reinforcement learning (MARL). For human-in-the-loop learning, Cogment Verse includes different paradigms like learning from demonstrations (behavior cloning), learning from human interventions, and learning from explicit human feedback (RLHF). More importantly, the SDK makes it easy to implement any asynchronous centralized training / decentralized execution algorithm."))}b.isMDXComponent=!0;const y={toc:[{value:"Extensive Environment Library",id:"extensive-environment-library",level:4}]};function N(e){let{components:t,...a}=e;return(0,g.kt)("wrapper",(0,h.Z)({},y,a,{components:t,mdxType:"MDXLayout"}),(0,g.kt)("h4",{id:"extensive-environment-library"},"Extensive Environment Library"),(0,g.kt)("p",null,"The existing environment library includes the standard ",(0,g.kt)("a",{parentName:"p",href:"https://www.gymlibrary.dev"},"OpenAI Gym")," environments as well as board games, card games, and other multi-agent environments from ",(0,g.kt)("a",{parentName:"p",href:"https://pettingzoo.farama.org"},"Petting Zoo"),". Other environments are gradually being added, such as ",(0,g.kt)("a",{parentName:"p",href:"https://developer.nvidia.com/isaac-gym"},"Isaac Gym")," or ",(0,g.kt)("a",{parentName:"p",href:"https://github.com/HumanCompatibleAI/overcooked_ai"},"Overcooked-AI"),". Implementing your own interactive custom environments is also quite straightforward."))}N.isMDXComponent=!0;const w={toc:[{value:"Collaboration Patterns",id:"collaboration-patterns",level:4}]};function k(e){let{components:t,...a}=e;return(0,g.kt)("wrapper",(0,h.Z)({},w,a,{components:t,mdxType:"MDXLayout"}),(0,g.kt)("h4",{id:"collaboration-patterns"},"Collaboration Patterns"),(0,g.kt)("p",null,"Library of predefined roles for agents or humans facilitating the implementation of multiple collaboration patterns: co-players, teacher/student dual control, evaluators, etc."))}k.isMDXComponent=!0;const Z={toc:[{value:"Experiments Management",id:"experiments-management",level:4}]};function M(e){let{components:t,...a}=e;return(0,g.kt)("wrapper",(0,h.Z)({},Z,a,{components:t,mdxType:"MDXLayout"}),(0,g.kt)("h4",{id:"experiments-management"},"Experiments Management"),(0,g.kt)("p",null,"Monitor and manage reproducible experiments, thanks to:"),(0,g.kt)("ul",null,(0,g.kt)("li",{parentName:"ul"},"A powerful configuration management system, including hyperparameters and seeds, built on ",(0,g.kt)("a",{parentName:"li",href:"https://hydra.cc"},"Hydra"),"."),(0,g.kt)("li",{parentName:"ul"},"Streamlined experiment tracking using ",(0,g.kt)("a",{parentName:"li",href:"https://mlflow.org"},"mlflow"),"."),(0,g.kt)("li",{parentName:"ul"},"Trained model versioning and storage via the ",(0,g.kt)("a",{parentName:"li",href:"../../../../docs/reference/cli/model-registry"},"Cogment Model Registry"),"."),(0,g.kt)("li",{parentName:"ul"},"Episode data management from the ",(0,g.kt)("a",{parentName:"li",href:"../../../../docs/reference/cli/trial-datastore/trial-datastore-server"},"Cogment Trial Datastore"),".")))}M.isMDXComponent=!0;const L=[b,f,k,N,M],C={toc:[]};function A(e){let{components:t,...a}=e;return(0,g.kt)("wrapper",(0,h.Z)({},C,a,{components:t,mdxType:"MDXLayout"}),(0,g.kt)("p",null,"If you use Cogment Verse in your research, please cite our demo paper appearing in ",(0,g.kt)("a",{parentName:"p",href:"https://aamas2023.soton.ac.uk"},"AAMAS 2023")," ",(0,g.kt)("a",{parentName:"p",href:"https://dl.acm.org/doi/abs/10.5555/3545946.3599174"},"proceedings"),":"),(0,g.kt)("pre",null,(0,g.kt)("code",{parentName:"pre",className:"language-bibtex"},"@inproceedings{cogment_verse_2023,\n title={Hiking up that HILL with Cogment-Verse: Train \\& Operate Multi-agent Systems Learning from Humans},\n author={Gottipati, Sai Krishna and Nguyen, Luong-Ha and Mars, Clod{\\'e}ric and Taylor, Matthew E},\n booktitle={Proceedings of the 2023 International Conference on Autonomous Agents and Multiagent Systems},\n pages={3065--3067},\n year={2023}\n}\n")))}A.isMDXComponent=!0;var _=a(3057),D=a(5137),x=a(5673),I=a(2058),V=a(4388),H=a(936);function T(){return o.createElement(s.Z,{title:"Cogment Verse",description:"Research platform for Human-in-the-loop learning (HILL) & Multi-Agent Reinforcement Learning (MARL)"},o.createElement(V.V,{className:"shadow--md"},o.createElement("div",{className:"container"},o.createElement("div",{className:(0,i.Z)("row")},o.createElement("div",{className:(0,i.Z)("col","col--5",c.Z.verticallyJustifiedCol)},o.createElement("div",{className:"padding--lg"},o.createElement(u.Z,{className:p}))),o.createElement("div",{className:(0,i.Z)("col","col--7")},o.createElement("h1",{className:"hero__title"},"Research platform for Human-in-the-loop learning & Multi-Agent Reinforcement Learning"),o.createElement("h2",{className:"hero__subtitle"},"Start building & training agents with HILL and MARL techniques within ",o.createElement(m.Z,{href:"https://www.gymlibrary.dev/"},"Gym"),","," ",o.createElement(m.Z,{href:"https://pettingzoo.farama.org/"},"Petting Zoo"),", and more..."))),o.createElement(I._,{className:"row"},o.createElement(m.Z,{href:"https://github.com/cogment/cogment-verse",className:"button button--lg button--secondary"},o.createElement(l.G,{icon:r.zhw})," Get started")))),o.createElement(H.$,{className:(0,i.Z)("margin-vert--lg","padding-vert--lg")},o.createElement("div",{className:"container"},o.createElement("div",{className:"row"},o.createElement("div",{className:"col"},o.createElement("h3",null,"Video Demo"))),o.createElement("div",{className:"row"},o.createElement("div",{className:"col"},o.createElement("div",{className:d},o.createElement("iframe",{src:"https://www.youtube.com/embed/v-K0DqIL9K0",title:"Hiking up that HILL with Cogment Verse",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",frameborder:"0",allowfullscreen:!0})))))),o.createElement(H.$,{className:(0,i.Z)("shadow--md","margin-vert--lg","padding-vert--lg")},o.createElement("div",{className:"container"},o.createElement("div",{className:"row"},o.createElement("div",{className:"col"},o.createElement("h3",null,"Key features"))),o.createElement("div",{className:"row"},o.createElement("div",{className:"col"},o.createElement(_.ZP,null))),o.createElement(D.W,{className:"row"},o.createElement(x.Z,null)),o.createElement("div",{className:"row"},o.createElement("div",{className:(0,i.Z)("col",c.Z.verticallyJustifiedCol)},L.filter(((e,t,a)=>t<a.length/2)).map((e=>o.createElement("div",null,o.createElement(e,null))))),o.createElement("div",{className:(0,i.Z)("col",c.Z.verticallyJustifiedCol)},L.filter(((e,t,a)=>t>=a.length/2)).map((e=>o.createElement("div",null,o.createElement(e,null)))))),o.createElement("div",{className:"row"},o.createElement("div",{className:"col"},o.createElement("h3",null,"Citation"))),o.createElement("div",{className:"row"},o.createElement("div",{className:"col"},o.createElement(A,null))),o.createElement(I._,{className:"row"},o.createElement(m.Z,{className:"button button--secondary button--lg",href:"https://discord.com/invite/QDxb9Fweqr"},o.createElement(l.G,{icon:r.omb})," Join the community on Discord")))))}n.vc.autoAddCss=!1},6627:(e,t,a)=>{a.d(t,{Z:()=>n});const n={verticallyJustifiedCol:"verticallyJustifiedCol__fFm"}}}]); \ No newline at end of file diff --git a/assets/js/8f51b104.a7e302fa.js b/assets/js/8f51b104.a7e302fa.js deleted file mode 100644 index fe893ed..0000000 --- a/assets/js/8f51b104.a7e302fa.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[7330],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>h});var a=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t){if(null==e)return{};var n,a,i=function(e,t){if(null==e)return{};var n,a,i={},r=Object.keys(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=a.createContext({}),d=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},p=function(e){var t=d(e.components);return a.createElement(s.Provider,{value:t},e.children)},c={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,i=e.mdxType,r=e.originalType,s=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),m=d(n),h=i,u=m["".concat(s,".").concat(h)]||m[h]||c[h]||r;return n?a.createElement(u,l(l({ref:t},p),{},{components:n})):a.createElement(u,l({ref:t},p))}));function h(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var r=n.length,l=new Array(r);l[0]=m;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o.mdxType="string"==typeof e?e:i,l[1]=o;for(var d=2;d<r;d++)l[d]=n[d];return a.createElement.apply(null,l)}return a.createElement.apply(null,n)}m.displayName="MDXCreateElement"},8009:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>c,frontMatter:()=>r,metadata:()=>o,toc:()=>d});var a=n(7462),i=(n(7294),n(3905));const r={sidebar_position:5},l="Javascript SDK",o={unversionedId:"reference/javascript",id:"reference/javascript",title:"Javascript SDK",description:"Repository Latest release",source:"@site/docs/reference/javascript.md",sourceDirName:"reference",slug:"/reference/javascript",permalink:"/docs/reference/javascript",draft:!1,tags:[],version:"current",lastUpdatedAt:1665585711,formattedLastUpdatedAt:"Oct 12, 2022",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"docSidebar",previous:{title:"Python SDK",permalink:"/docs/reference/python"},next:{title:"Installation",permalink:"/docs/reference/python-enterprise/installation"}},s={},d=[{value:"Installation",id:"installation",level:2},{value:"General usage",id:"general-usage",level:2},{value:"The spec file",id:"the-spec-file",level:3},{value:"Trial Parameters",id:"trial-parameters",level:3},{value:"Compiling the spec file",id:"compiling-the-spec-file",level:4},{value:"CogSettings.js",id:"cogsettingsjs",level:3},{value:"Imports",id:"imports",level:3},{value:"class cogment.Context",id:"class-cogmentcontext",level:2},{value:"<code>constructor(userId, cogSettings)</code>",id:"constructoruserid-cogsettings",level:3},{value:"<code>getController(endpoint)</code>",id:"getcontrollerendpoint",level:3},{value:"<code>async joinTrial(trialId, endpoint, actorName)</code>",id:"async-jointrialtrialid-endpoint-actorname",level:3},{value:"<code>registerActor(impl, actorName, actorClass)</code>",id:"registeractorimpl-actorname-actorclass",level:3},{value:"class Controller",id:"class-controller",level:2},{value:"<code>async startTrial(trialConfig = undefined, trialIdRequested = undefined)</code>",id:"async-starttrialtrialconfig--undefined-trialidrequested--undefined",level:3},{value:"<code>terminateTrial(trialIds, hard = false)</code>",id:"terminatetrialtrialids-hard--false",level:3},{value:"<code>async getTrialInfo(trialIds)</code>",id:"async-gettrialinfotrialids",level:3},{value:"<code>async watchTrials(trialStateFilters=[])</code>",id:"async-watchtrialstrialstatefilters",level:3},{value:"<code>async getActors(trialId)</code>",id:"async-getactorstrialid",level:3},{value:"<code>async getRemoteVersions()</code>",id:"async-getremoteversions",level:3},{value:"class Session",id:"class-session",level:2},{value:"<code>getTrialId()</code>",id:"gettrialid",level:3},{value:"<code>getTickId()</code>",id:"gettickid",level:3},{value:"<code>isTrialOver()</code>",id:"istrialover",level:3},{value:"<code>sendingDone()</code>",id:"sendingdone",level:3},{value:"class ActorSession extends Session",id:"class-actorsession-extends-session",level:2},{value:"<code>start(autoDoneSending=True)</code>",id:"startautodonesendingtrue",level:3},{value:"<code>async *eventLoop()</code>",id:"async-eventloop",level:3},{value:"<code>doAction(action)</code>",id:"doactionaction",level:3},{value:"<code>sendMessage(payload, to)</code>",id:"sendmessagepayload-to",level:3},{value:"enum cogment.TrialState",id:"enum-cogmenttrialstate",level:2},{value:"class TrialInfo",id:"class-trialinfo",level:2},{value:"class RecvEvent",id:"class-recvevent",level:2},{value:"enum cogment.EventType",id:"enum-cogmenteventtype",level:3},{value:"type ObservationT",id:"type-observationt",level:2},{value:"type ActionT",id:"type-actiont",level:2},{value:"class MessageBase",id:"class-messagebase",level:2},{value:"type Reward",id:"type-reward",level:2},{value:"interface IRewardSource",id:"interface-irewardsource",level:2}],p={toc:d};function c(e){let{components:t,...n}=e;return(0,i.kt)("wrapper",(0,a.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"javascript-sdk"},"Javascript SDK"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-js-sdk"},(0,i.kt)("img",{parentName:"a",src:"https://img.shields.io/badge/repository-cogment%2Fcogment--js--sdk-%235217b8?style=for-the-badge&logo=github",alt:"Repository"}))," ",(0,i.kt)("a",{parentName:"p",href:"https://www.npmjs.com/package/@cogment/cogment-js-sdk"},(0,i.kt)("img",{parentName:"a",src:"https://img.shields.io/npm/v/@cogment/cogment-js-sdk?style=for-the-badge",alt:"Latest release"}))),(0,i.kt)("h2",{id:"installation"},"Installation"),(0,i.kt)("p",null,"The simplest way to install the Javascript SDK is to just install it using npm:\n",(0,i.kt)("inlineCode",{parentName:"p"},"npm install @cogment/cogment-js-sdk")),(0,i.kt)("h2",{id:"general-usage"},"General usage"),(0,i.kt)("h3",{id:"the-spec-file"},"The spec file"),(0,i.kt)("p",null,"The specifications of a trial type are contained in a ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cogment-yaml"},"spec file")," and the imported files defined in the spec. This file is typically named ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.yaml"),"."),(0,i.kt)("p",null,"For example, an ",(0,i.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#actors"},"actor")," class is defined by its required observation space and action space."),(0,i.kt)("p",null,'These "spaces" are defined by using protobuf message types (from the imported files). ',(0,i.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#observations--actions"},"Observations and actions")," will simply be instances of the appropriate type."),(0,i.kt)("p",null,"Messages and feedback user data don't have a set type, they can be any type as long as the receiver can manage that type. The type is determined by the provided message from the originator."),(0,i.kt)("p",null,"They will mostly arrive as an instance of ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.MessageBase")," and have fields according to their definition in your proto files."),(0,i.kt)("h3",{id:"trial-parameters"},"Trial Parameters"),(0,i.kt)("p",null,"The trial ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters"},"parameters")," can come from the default parameters provided to the Orchestrator on startup, or from the pre-trial hooks (themselves provided to the Orchestrator on startup)."),(0,i.kt)("p",null,"The parameters are mostly indepedent of the spec file (cogment.yaml), except that the active actors listed in the parameters must have their actor class match an actor class defined in the spec file."),(0,i.kt)("p",null,"Below, when we refer to the trial parameters, we mean the final parameters after any pre-trial hooks."),(0,i.kt)("h4",{id:"compiling-the-spec-file"},"Compiling the spec file"),(0,i.kt)("p",null,'In order to use the specification found in the spec file within Javascript scripts, it needs to be compiled into Javascript modules. This is done by a tool called "cogment-js-sdk-generate".'),(0,i.kt)("h3",{id:"cogsettingsjs"},"CogSettings.js"),(0,i.kt)("p",null,"All API entry points require a cogment specification object. This specification object can be determined\nfrom the content of a project's spec file. As such, it should be generated using the ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment-js-sdk-generate")," tool"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"npx cogment-js-sdk-generate config.yaml\n")),(0,i.kt)("p",null,"This will generate both a ",(0,i.kt)("inlineCode",{parentName:"p"},"CogSettings.js")," file, as well as any required compiled protocol buffer files."),(0,i.kt)("h3",{id:"imports"},"Imports"),(0,i.kt)("p",null,"Whether a script implements an actor or environment, it should import both the ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment")," module (generic Javascript SDK for Cogment) and the ",(0,i.kt)("inlineCode",{parentName:"p"},"cogSettings")," module (project specific definitions created from the spec file)."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-Javascript"},"import { cogSettings } from './CogSettings';\nimport * as cogment from '@cogment/cogment-js-sdk'\n")),(0,i.kt)("h2",{id:"class-cogmentcontext"},"class cogment.Context"),(0,i.kt)("p",null,"Class to setup and run all the different aspects of trials."),(0,i.kt)("h3",{id:"constructoruserid-cogsettings"},(0,i.kt)("inlineCode",{parentName:"h3"},"constructor(userId, cogSettings)")),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"userId"),": ",(0,i.kt)("em",{parentName:"li"},"string")," - Identifier for the user of this context."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"cogSettings"),": ",(0,i.kt)("em",{parentName:"li"},"cogment.CogSettings")," - Settings module associated with trials that will be run (",(0,i.kt)("a",{parentName:"li",href:"#cog_settings.py"},"cogSettings")," namespace).")),(0,i.kt)("h3",{id:"getcontrollerendpoint"},(0,i.kt)("inlineCode",{parentName:"h3"},"getController(endpoint)")),(0,i.kt)("p",null,"Method to get a controller instance to manage trials (start, stop, inquire, etc)."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"endpoint"),": ",(0,i.kt)("em",{parentName:"li"},"string")," - URL of the connection to the Orchestrator.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"Controller")," - An instance of the Controller class used to manage trials."),(0,i.kt)("h3",{id:"async-jointrialtrialid-endpoint-actorname"},(0,i.kt)("inlineCode",{parentName:"h3"},"async joinTrial(trialId, endpoint, actorName)")),(0,i.kt)("p",null,"Method for an actor to asynchronously join an existing trial. This task will normally end after the user implementation has exited."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trialId"),": ",(0,i.kt)("em",{parentName:"li"},"string")," - The UUID of the trial to join."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"endpoint"),": ",(0,i.kt)("em",{parentName:"li"},"string")," - URL of the connection to the Orchestrator."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actorName"),": ",(0,i.kt)("em",{parentName:"li"},"string")," - Name of the actor joining the trial.")),(0,i.kt)("p",null,"Return: void"),(0,i.kt)("h3",{id:"registeractorimpl-actorname-actorclass"},(0,i.kt)("inlineCode",{parentName:"h3"},"registerActor(impl, actorName, actorClass)")),(0,i.kt)("p",null,"Method to register the asynchronous callback function that will run an actor for a trial."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"impl"),": ",(0,i.kt)("em",{parentName:"li"},"async function(ActorSession instance)")," - Callback function to be registered."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actorName"),": ",(0,i.kt)("em",{parentName:"li"},"string")," - Name for the actor implementation being run by the given callback function."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actorClass"),": ",(0,i.kt)("em",{parentName:"li"},"string")," - The actor class name that can be run by the given callback function. The possible names are specified in spec file under section ",(0,i.kt)("inlineCode",{parentName:"li"},"actorClasses:name"),". If the list is empty, this implementation can run any actor class.")),(0,i.kt)("p",null,"Return: void"),(0,i.kt)("h2",{id:"class-controller"},"class Controller"),(0,i.kt)("p",null,"Class containing data and methods to control and manage trials."),(0,i.kt)("h3",{id:"async-starttrialtrialconfig--undefined-trialidrequested--undefined"},(0,i.kt)("inlineCode",{parentName:"h3"},"async startTrial(trialConfig = undefined, trialIdRequested = undefined)")),(0,i.kt)("p",null,"Method to start a new trial. The parameters of the trial will be set by the pre-trial hooks (registered in ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.Context"),"), and the hooks will receive the provided trial config."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trialConfig"),": ",(0,i.kt)("em",{parentName:"li"},"cogment.MessageBase")," - Configuration for the trial. The type is specified in the spec file under the section ",(0,i.kt)("inlineCode",{parentName:"li"},"trial:config_type"),". Can be ",(0,i.kt)("inlineCode",{parentName:"li"},"undefined")," if no configuration is provided. This is provided to the first pre-trial hook."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trialIdRequested"),": ",(0,i.kt)("em",{parentName:"li"},"string")," - The trial identifier requested for the new trial. It must be unique among all active trials and a limited set of the latest ended trials (this list of trials can be retrieved with ",(0,i.kt)("inlineCode",{parentName:"li"},"getTrialInfo")," or ",(0,i.kt)("inlineCode",{parentName:"li"},"watchTrial"),"). If provided, the Orchestrator will try to use this trialId, otherwise, a UUID will be created.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"string")," - The newly started trial ID."),(0,i.kt)("h3",{id:"terminatetrialtrialids-hard--false"},(0,i.kt)("inlineCode",{parentName:"h3"},"terminateTrial(trialIds, hard = false)")),(0,i.kt)("p",null,"Method to request the end of a trial."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trialIds"),": ",(0,i.kt)("em",{parentName:"li"},"string[]")," - The trial ID(s) to request to terminate. There must be at least one ID."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"hard"),": ",(0,i.kt)("em",{parentName:"li"},"boolean")," - If ",(0,i.kt)("inlineCode",{parentName:"li"},"true"),", the termination will be forced and not wait for any action or observation. If ",(0,i.kt)("inlineCode",{parentName:"li"},"false"),", the trial will wait for the next tick, to end gracefully (i.e. wait for the next full set of actions and response observations).")),(0,i.kt)("p",null,"Return: void"),(0,i.kt)("h3",{id:"async-gettrialinfotrialids"},(0,i.kt)("inlineCode",{parentName:"h3"},"async getTrialInfo(trialIds)")),(0,i.kt)("p",null,"Method to get information about a trial."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trialIds"),": ",(0,i.kt)("em",{parentName:"li"},"string[]")," - The trial ID(s) from which to request information. If no ID is provided, returns information about all trials. Note that ended trials may only appear for a short time in this list after they have ended.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"TrialInfo[]")," - List of trial information, one per trial. Can be empty if no trial matches."),(0,i.kt)("h3",{id:"async-watchtrialstrialstatefilters"},(0,i.kt)("inlineCode",{parentName:"h3"},"async watchTrials(trialStateFilters=[])")),(0,i.kt)("p",null,"Generator method to iterate, in real-time, through all trial states matching the filters. When called, it will first iterate over the current states matching the filters, for all trials. Afterwards, it will iterate in real-time over the matching states as they change."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trialStateFilters"),": ",(0,i.kt)("em",{parentName:"li"},"cogment.TrialState[]")," - List of enum values from ",(0,i.kt)("inlineCode",{parentName:"li"},"cogment.TrialState")," for which we are interested in receiving state changes.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(TrialInfo instance)")," - A generator for the state changes that arrive. The ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialInfo")," received here only contains the trial ID and the state."),(0,i.kt)("h3",{id:"async-getactorstrialid"},(0,i.kt)("inlineCode",{parentName:"h3"},"async getActors(trialId)")),(0,i.kt)("p",null,"Method to get the list of configured actors in a trial."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trialId"),": ",(0,i.kt)("em",{parentName:"li"},"string")," - The trial ID from which to request the list of actors.")),(0,i.kt)("p",null,"Return: ActorInfo[] - List of actors configured in this trial."),(0,i.kt)("h3",{id:"async-getremoteversions"},(0,i.kt)("inlineCode",{parentName:"h3"},"async getRemoteVersions()")),(0,i.kt)("p",null,"Method to get the versions from the remote Orchestrator."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"{","[key: string]",": string}")," - The key of the object is the name of the component (",(0,i.kt)("em",{parentName:"p"},"string"),"), and the value is the version (",(0,i.kt)("em",{parentName:"p"},"string"),")."),(0,i.kt)("h2",{id:"class-session"},"class Session"),(0,i.kt)("p",null,"Abstract class that manages aspects of a trial. Contains data and methods common to all sessions ."),(0,i.kt)("h3",{id:"gettrialid"},(0,i.kt)("inlineCode",{parentName:"h3"},"getTrialId()")),(0,i.kt)("p",null,"Method to get the UUID of the trial managed by this session."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"string")," - UUID of the trial."),(0,i.kt)("h3",{id:"gettickid"},(0,i.kt)("inlineCode",{parentName:"h3"},"getTickId()")),(0,i.kt)("p",null,"Method to get the current tick id of the trial (i.e. time step)."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"number")," - The current tick id."),(0,i.kt)("h3",{id:"istrialover"},(0,i.kt)("inlineCode",{parentName:"h3"},"isTrialOver()")),(0,i.kt)("p",null,"Method to inquire if the current trial has ended."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"boolean")," - True if the trial has ended, false otherwise."),(0,i.kt)("h3",{id:"sendingdone"},(0,i.kt)("inlineCode",{parentName:"h3"},"sendingDone()")),(0,i.kt)("p",null,"Method to notify the Orchestrator that all data for the trial, from this session, has been sent. This can be called only when the session is ending. When starting the session (see ",(0,i.kt)("inlineCode",{parentName:"p"},"ActorSession"),"), if the ",(0,i.kt)("inlineCode",{parentName:"p"},"autoDoneSending")," parameter is True, this method should not be called, and if the parameter is False, it MUST be called to end the trial properly."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: void"),(0,i.kt)("h2",{id:"class-actorsession-extends-session"},"class ActorSession extends Session"),(0,i.kt)("h3",{id:"startautodonesendingtrue"},(0,i.kt)("inlineCode",{parentName:"h3"},"start(autoDoneSending=True)")),(0,i.kt)("p",null,"Method to start the actor. This method should be called before any other method in the session."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"autoDoneSending"),": ",(0,i.kt)("em",{parentName:"li"},"boolean")," - Controls when to notify the Orchestrator that all data has been sent. If True, the session will automatically send the notification after receiving the last observation. If False, the user MUST call ",(0,i.kt)("inlineCode",{parentName:"li"},"sendingDone")," to end the trial properly.")),(0,i.kt)("p",null,"Return: void"),(0,i.kt)("h3",{id:"async-eventloop"},(0,i.kt)("inlineCode",{parentName:"h3"},"async *eventLoop()")),(0,i.kt)("p",null,"Generator method to iterate over all events (observations, rewards, messages) as they are received. This will block and wait for an event.\nWhen this generator exits, the callback function (registered with ",(0,i.kt)("inlineCode",{parentName:"p"},"registerActor"),') should return to end the trial cleanly.\nThe generator will exit for various reasons indicating the end of the trial, a loss of communication with the orchestrator, or if the generator is sent "False".'),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"AsyncGenerator<RecvEvent",">")," - A generator for the events that arrive. The ",(0,i.kt)("inlineCode",{parentName:"p"},"RecvEvent")," instances received from this generator will not contain actions. When receiving an observation in the event, the ",(0,i.kt)("inlineCode",{parentName:"p"},"this.doAction"),' method is normally used to "reply" (if the event type is ',(0,i.kt)("inlineCode",{parentName:"p"},"EventType.ACTIVE"),")."),(0,i.kt)("h3",{id:"doactionaction"},(0,i.kt)("inlineCode",{parentName:"h3"},"doAction(action)")),(0,i.kt)("p",null,"Method to send actions to the environment."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"action"),": ",(0,i.kt)("em",{parentName:"li"},"ActionT")," - An instance of the action space class specified in the corresponding section ",(0,i.kt)("inlineCode",{parentName:"li"},"actorClasses:action:space")," of the spec file. If ",(0,i.kt)("inlineCode",{parentName:"li"},"undefined"),", then no action space is sent (empty content) and the environment will receive a default initialized action space of the appropriate type.")),(0,i.kt)("p",null,"Return: void"),(0,i.kt)("h3",{id:"sendmessagepayload-to"},(0,i.kt)("inlineCode",{parentName:"h3"},"sendMessage(payload, to)")),(0,i.kt)("p",null,"Method to send a message related to the current time step (tick id)."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"payload"),": ",(0,i.kt)("em",{parentName:"li"},"cogment.MessageBase")," - The message data to be sent. The class can be any protobuf class. It is the responsibility of the receiving actor to manage the class received."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"to"),": ",(0,i.kt)("em",{parentName:"li"},"string[]")," - Targets of feedback. Each value could be the name of an actor in the trial, or the name of the environment (from ",(0,i.kt)("inlineCode",{parentName:"li"},"this.envName"),'). Or it could represent a set of actors (with wildcards); A set of actors can be represented with the wildcard character "',(0,i.kt)("inlineCode",{parentName:"li"},"*"),'" for all actors (of all classes), or "',(0,i.kt)("inlineCode",{parentName:"li"},"actorClass.*"),'" for all actors of a specific class (the ',(0,i.kt)("inlineCode",{parentName:"li"},"actorClass")," must match one of the classes listed in the trial parameters). Note that the wildcard does not include the environment.")),(0,i.kt)("p",null,"Return: void"),(0,i.kt)("h2",{id:"enum-cogmenttrialstate"},"enum cogment.TrialState"),(0,i.kt)("p",null,"Enum representing the various states of trials."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"UNKNOWN: Should not be used."),(0,i.kt)("li",{parentName:"ul"},"INITIALIZING: The trial is in the process of starting."),(0,i.kt)("li",{parentName:"ul"},"PENDING: The trial is waiting for its final parameters, before running."),(0,i.kt)("li",{parentName:"ul"},"RUNNING: The trial is running."),(0,i.kt)("li",{parentName:"ul"},"TERMINATING: The trial is in the process of terminating (either a request to terminate has been received or the last observation has been received)."),(0,i.kt)("li",{parentName:"ul"},"ENDED: The trial has ended. Only a set number of ended trials will be kept (configured in the Orchestrator).")),(0,i.kt)("p",null,"For further information on trial lifetime, check the ",(0,i.kt)("a",{parentName:"p",href:"/docs/guide/development-guide#trial-lifetime"},"dedicated section"),"."),(0,i.kt)("h2",{id:"class-trialinfo"},"class TrialInfo"),(0,i.kt)("p",null,"Class enclosing the details of a trial."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trialId"),": ",(0,i.kt)("em",{parentName:"p"},"string")," - The trial ID to which the details pertain."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"state"),": ",(0,i.kt)("em",{parentName:"p"},"cogment.TrialState")," - The current state of the trial."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"envName"),": ",(0,i.kt)("em",{parentName:"p"},"string")," - The name of the environment running the trial."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"tickId"),": ",(0,i.kt)("em",{parentName:"p"},"number")," - The time step that the information relates to. Only provided from a call to ",(0,i.kt)("inlineCode",{parentName:"p"},"getTrialInfo"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"duration"),": ",(0,i.kt)("em",{parentName:"p"},"number")," - The time (in nanoseconds) that the trial has run. Only provided from a call to ",(0,i.kt)("inlineCode",{parentName:"p"},"getTrialInfo"),"."),(0,i.kt)("h2",{id:"class-recvevent"},"class RecvEvent"),(0,i.kt)("p",null,"Class representing a received event (for environments and actors). It can contain any combination of data according to the receiver needs, or even be empty, but it will always have a type."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"type"),": ",(0,i.kt)("em",{parentName:"p"},"EventType")," - Type of event the enclosed data represents."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"observation"),": ",(0,i.kt)("em",{parentName:"p"},"ObservationT")," - Observation data. This can only be received by actors. ",(0,i.kt)("inlineCode",{parentName:"p"},"undefined")," if not present."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"actions"),": ",(0,i.kt)("em",{parentName:"p"},"ActionT")," - Action data from actors. This can only be received by the environment. The list is empty if not present."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"rewards"),": ",(0,i.kt)("em",{parentName:"p"},"Reward[]")," - Reward values and data. This can only be received by actors. The list is empty if not present."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"messages"),": ",(0,i.kt)("em",{parentName:"p"},"MessageBase[]")," - Message data. The list is empty if not present."),(0,i.kt)("h3",{id:"enum-cogmenteventtype"},"enum cogment.EventType"),(0,i.kt)("p",null,"Enum representing the type of an event."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"EventType.NONE"),": Empty event. This kind of event should never be received.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"EventType.ACTIVE"),": Normal event from an active trial. Most events will be of this type.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"EventType.ENDING"),": Events from a trial in the process of ending. For the environment, this means that these events contain the last actions from the actors, and the trial is awaiting a final observation. For the actors, this means that the trial is ending and no action can/need to be sent in response. Note that because of network timing, there may be ",(0,i.kt)("inlineCode",{parentName:"p"},"ACTIVE")," events (e.g. rewards or messages) arriving after some ",(0,i.kt)("inlineCode",{parentName:"p"},"ENDING")," events, but the trial is ending regardless.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"EventType.FINAL"),": Final event for the trial. This does not contain data. The event loop will exit after this event is delivered. This event can be ignored if nothing needs to be done before exiting the loop."))),(0,i.kt)("p",null,"For further information on trial lifetime, check the ",(0,i.kt)("a",{parentName:"p",href:"/docs/guide/development-guide#trial-lifetime"},"dedicated section"),"."),(0,i.kt)("h2",{id:"type-observationt"},"type ObservationT"),(0,i.kt)("p",null,"Type containing the details of an actor's observation. This will be different depending on what the ActionSpace defined in your spec file contains"),(0,i.kt)("h2",{id:"type-actiont"},"type ActionT"),(0,i.kt)("p",null,"Type containing the details of an action from an actor. This will be different depending on what the ActionSpace defined in your spec file contains"),(0,i.kt)("h2",{id:"class-messagebase"},"class MessageBase"),(0,i.kt)("p",null,"Base Class of all messages, this will contain different fields depending on what fields are in the specific message you are receiving (defined in proto files)"),(0,i.kt)("h2",{id:"type-reward"},"type Reward"),(0,i.kt)("p",null,"type containing the details of a received reward."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"tickId"),": ",(0,i.kt)("em",{parentName:"p"},"number")," - The tick id (time step) for which the reward should be applied."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"receiverName"),": ",(0,i.kt)("em",{parentName:"p"},"string")," - Name of the receiver for the reward (the name of an actor, or wildcard string)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"value"),": ",(0,i.kt)("em",{parentName:"p"},"float")," - Value of the reward (aggregated from the sources)"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"sources"),": ",(0,i.kt)("em",{parentName:"p"},"IRewardSource[]")," - List of sources that gave this reward"),(0,i.kt)("h2",{id:"interface-irewardsource"},"interface IRewardSource"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"senderName"),": ",(0,i.kt)("em",{parentName:"p"},"string")," - Name of the reward sender;"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"value"),": ",(0,i.kt)("em",{parentName:"p"},"number")," - Value of the reward;"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"confidence"),": ",(0,i.kt)("em",{parentName:"p"},"number")," - Confidence of this reward;"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"userData"),": ",(0,i.kt)("em",{parentName:"p"},"google.protobuf.IAny")," - Extra data;"))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/8f51b104.ad70d212.js b/assets/js/8f51b104.ad70d212.js new file mode 100644 index 0000000..31cdbcc --- /dev/null +++ b/assets/js/8f51b104.ad70d212.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[7330],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>u});var a=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t){if(null==e)return{};var n,a,i=function(e,t){if(null==e)return{};var n,a,i={},r=Object.keys(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=a.createContext({}),p=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},d=function(e){var t=p(e.components);return a.createElement(s.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},h=a.forwardRef((function(e,t){var n=e.components,i=e.mdxType,r=e.originalType,s=e.parentName,d=o(e,["components","mdxType","originalType","parentName"]),c=p(n),h=i,u=c["".concat(s,".").concat(h)]||c[h]||m[h]||r;return n?a.createElement(u,l(l({ref:t},d),{},{components:n})):a.createElement(u,l({ref:t},d))}));function u(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var r=n.length,l=new Array(r);l[0]=h;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[c]="string"==typeof e?e:i,l[1]=o;for(var p=2;p<r;p++)l[p]=n[p];return a.createElement.apply(null,l)}return a.createElement.apply(null,n)}h.displayName="MDXCreateElement"},8009:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>m,frontMatter:()=>r,metadata:()=>o,toc:()=>p});var a=n(7462),i=(n(7294),n(3905));const r={sidebar_position:6},l="Javascript SDK",o={unversionedId:"reference/javascript",id:"reference/javascript",title:"Javascript SDK",description:"Repository Latest release",source:"@site/docs/reference/javascript.md",sourceDirName:"reference",slug:"/reference/javascript",permalink:"/docs/reference/javascript",draft:!1,tags:[],version:"current",lastUpdatedAt:1701726431,formattedLastUpdatedAt:"Dec 4, 2023",sidebarPosition:6,frontMatter:{sidebar_position:6},sidebar:"docSidebar",previous:{title:"Web Proxy API",permalink:"/docs/reference/web-proxy-api"},next:{title:"Installation",permalink:"/docs/reference/python-enterprise/installation"}},s={},p=[{value:"Installation",id:"installation",level:2},{value:"General usage",id:"general-usage",level:2},{value:"The spec file",id:"the-spec-file",level:3},{value:"Trial Parameters",id:"trial-parameters",level:3},{value:"Compiling the spec file",id:"compiling-the-spec-file",level:4},{value:"CogSettings.js",id:"cogsettingsjs",level:3},{value:"Imports",id:"imports",level:3},{value:"class cogment.Context",id:"class-cogmentcontext",level:2},{value:"<code>constructor(userId, cogSettings)</code>",id:"constructoruserid-cogsettings",level:3},{value:"<code>getController(endpoint)</code>",id:"getcontrollerendpoint",level:3},{value:"<code>async joinTrial(trialId, endpoint, actorName)</code>",id:"async-jointrialtrialid-endpoint-actorname",level:3},{value:"<code>registerActor(impl, actorName, actorClass)</code>",id:"registeractorimpl-actorname-actorclass",level:3},{value:"class Controller",id:"class-controller",level:2},{value:"<code>async startTrial(trialConfig = undefined, trialIdRequested = undefined)</code>",id:"async-starttrialtrialconfig--undefined-trialidrequested--undefined",level:3},{value:"<code>terminateTrial(trialIds, hard = false)</code>",id:"terminatetrialtrialids-hard--false",level:3},{value:"<code>async getTrialInfo(trialIds)</code>",id:"async-gettrialinfotrialids",level:3},{value:"<code>async watchTrials(trialStateFilters=[])</code>",id:"async-watchtrialstrialstatefilters",level:3},{value:"<code>async getActors(trialId)</code>",id:"async-getactorstrialid",level:3},{value:"<code>async getRemoteVersions()</code>",id:"async-getremoteversions",level:3},{value:"class Session",id:"class-session",level:2},{value:"<code>getTrialId()</code>",id:"gettrialid",level:3},{value:"<code>getTickId()</code>",id:"gettickid",level:3},{value:"<code>isTrialOver()</code>",id:"istrialover",level:3},{value:"<code>sendingDone()</code>",id:"sendingdone",level:3},{value:"class ActorSession extends Session",id:"class-actorsession-extends-session",level:2},{value:"<code>start(autoDoneSending=True)</code>",id:"startautodonesendingtrue",level:3},{value:"<code>async *eventLoop()</code>",id:"async-eventloop",level:3},{value:"<code>doAction(action)</code>",id:"doactionaction",level:3},{value:"<code>sendMessage(payload, to)</code>",id:"sendmessagepayload-to",level:3},{value:"enum cogment.TrialState",id:"enum-cogmenttrialstate",level:2},{value:"class TrialInfo",id:"class-trialinfo",level:2},{value:"class RecvEvent",id:"class-recvevent",level:2},{value:"enum cogment.EventType",id:"enum-cogmenteventtype",level:3},{value:"type ObservationT",id:"type-observationt",level:2},{value:"type ActionT",id:"type-actiont",level:2},{value:"class MessageBase",id:"class-messagebase",level:2},{value:"type Reward",id:"type-reward",level:2},{value:"interface IRewardSource",id:"interface-irewardsource",level:2}],d={toc:p},c="wrapper";function m(e){let{components:t,...n}=e;return(0,i.kt)(c,(0,a.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"javascript-sdk"},"Javascript SDK"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-js-sdk"},(0,i.kt)("img",{parentName:"a",src:"https://img.shields.io/badge/repository-cogment%2Fcogment--js--sdk-%235217b8?style=for-the-badge&logo=github",alt:"Repository"}))," ",(0,i.kt)("a",{parentName:"p",href:"https://www.npmjs.com/package/@cogment/cogment-js-sdk"},(0,i.kt)("img",{parentName:"a",src:"https://img.shields.io/npm/v/@cogment/cogment-js-sdk?style=for-the-badge",alt:"Latest release"}))),(0,i.kt)("h2",{id:"installation"},"Installation"),(0,i.kt)("p",null,"The simplest way to install the Javascript SDK is to just install it using npm:\n",(0,i.kt)("inlineCode",{parentName:"p"},"npm install @cogment/cogment-js-sdk")),(0,i.kt)("h2",{id:"general-usage"},"General usage"),(0,i.kt)("h3",{id:"the-spec-file"},"The spec file"),(0,i.kt)("p",null,"The specifications of a trial type are contained in a ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cogment-yaml"},"spec file")," and the imported files defined in the spec. This file is typically named ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.yaml"),"."),(0,i.kt)("p",null,"For example, an ",(0,i.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#actors"},"actor")," class is defined by its required observation space and action space."),(0,i.kt)("p",null,'These "spaces" are defined by using protobuf message types (from the imported files). ',(0,i.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#observations--actions"},"Observations and actions")," will simply be instances of the appropriate type."),(0,i.kt)("p",null,"Messages and feedback user data don't have a set type, they can be any type as long as the receiver can manage that type. The type is determined by the provided message from the originator."),(0,i.kt)("p",null,"They will mostly arrive as an instance of ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.MessageBase")," and have fields according to their definition in your proto files."),(0,i.kt)("h3",{id:"trial-parameters"},"Trial Parameters"),(0,i.kt)("p",null,"The trial ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters"},"parameters")," can come from the default parameters provided to the Orchestrator on startup, or from the pre-trial hooks (themselves provided to the Orchestrator on startup)."),(0,i.kt)("p",null,"The parameters are mostly indepedent of the spec file (cogment.yaml), except that the active actors listed in the parameters must have their actor class match an actor class defined in the spec file."),(0,i.kt)("p",null,"Below, when we refer to the trial parameters, we mean the final parameters after any pre-trial hooks."),(0,i.kt)("h4",{id:"compiling-the-spec-file"},"Compiling the spec file"),(0,i.kt)("p",null,'In order to use the specification found in the spec file within Javascript scripts, it needs to be compiled into Javascript modules. This is done by a tool called "cogment-js-sdk-generate".'),(0,i.kt)("h3",{id:"cogsettingsjs"},"CogSettings.js"),(0,i.kt)("p",null,"All API entry points require a cogment specification object. This specification object can be determined\nfrom the content of a project's spec file. As such, it should be generated using the ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment-js-sdk-generate")," tool"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"npx cogment-js-sdk-generate config.yaml\n")),(0,i.kt)("p",null,"This will generate both a ",(0,i.kt)("inlineCode",{parentName:"p"},"CogSettings.js")," file, as well as any required compiled protocol buffer files."),(0,i.kt)("h3",{id:"imports"},"Imports"),(0,i.kt)("p",null,"Whether a script implements an actor or environment, it should import both the ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment")," module (generic Javascript SDK for Cogment) and the ",(0,i.kt)("inlineCode",{parentName:"p"},"cogSettings")," module (project specific definitions created from the spec file)."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-Javascript"},"import { cogSettings } from './CogSettings';\nimport * as cogment from '@cogment/cogment-js-sdk'\n")),(0,i.kt)("h2",{id:"class-cogmentcontext"},"class cogment.Context"),(0,i.kt)("p",null,"Class to setup and run all the different aspects of trials."),(0,i.kt)("h3",{id:"constructoruserid-cogsettings"},(0,i.kt)("inlineCode",{parentName:"h3"},"constructor(userId, cogSettings)")),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"userId"),": ",(0,i.kt)("em",{parentName:"li"},"string")," - Identifier for the user of this context."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"cogSettings"),": ",(0,i.kt)("em",{parentName:"li"},"cogment.CogSettings")," - Settings module associated with trials that will be run (",(0,i.kt)("a",{parentName:"li",href:"#cog_settings.py"},"cogSettings")," namespace).")),(0,i.kt)("h3",{id:"getcontrollerendpoint"},(0,i.kt)("inlineCode",{parentName:"h3"},"getController(endpoint)")),(0,i.kt)("p",null,"Method to get a controller instance to manage trials (start, stop, inquire, etc)."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"endpoint"),": ",(0,i.kt)("em",{parentName:"li"},"string")," - URL of the connection to the Orchestrator.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"Controller")," - An instance of the Controller class used to manage trials."),(0,i.kt)("h3",{id:"async-jointrialtrialid-endpoint-actorname"},(0,i.kt)("inlineCode",{parentName:"h3"},"async joinTrial(trialId, endpoint, actorName)")),(0,i.kt)("p",null,"Method for an actor to asynchronously join an existing trial. This task will normally end after the user implementation has exited."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trialId"),": ",(0,i.kt)("em",{parentName:"li"},"string")," - The UUID of the trial to join."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"endpoint"),": ",(0,i.kt)("em",{parentName:"li"},"string")," - URL of the connection to the Orchestrator."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actorName"),": ",(0,i.kt)("em",{parentName:"li"},"string")," - Name of the actor joining the trial.")),(0,i.kt)("p",null,"Return: void"),(0,i.kt)("h3",{id:"registeractorimpl-actorname-actorclass"},(0,i.kt)("inlineCode",{parentName:"h3"},"registerActor(impl, actorName, actorClass)")),(0,i.kt)("p",null,"Method to register the asynchronous callback function that will run an actor for a trial."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"impl"),": ",(0,i.kt)("em",{parentName:"li"},"async function(ActorSession instance)")," - Callback function to be registered."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actorName"),": ",(0,i.kt)("em",{parentName:"li"},"string")," - Name for the actor implementation being run by the given callback function."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actorClass"),": ",(0,i.kt)("em",{parentName:"li"},"string")," - The actor class name that can be run by the given callback function. The possible names are specified in spec file under section ",(0,i.kt)("inlineCode",{parentName:"li"},"actorClasses:name"),". If the list is empty, this implementation can run any actor class.")),(0,i.kt)("p",null,"Return: void"),(0,i.kt)("h2",{id:"class-controller"},"class Controller"),(0,i.kt)("p",null,"Class containing data and methods to control and manage trials."),(0,i.kt)("h3",{id:"async-starttrialtrialconfig--undefined-trialidrequested--undefined"},(0,i.kt)("inlineCode",{parentName:"h3"},"async startTrial(trialConfig = undefined, trialIdRequested = undefined)")),(0,i.kt)("p",null,"Method to start a new trial. The parameters of the trial will be set by the pre-trial hooks (registered in ",(0,i.kt)("inlineCode",{parentName:"p"},"cogment.Context"),"), and the hooks will receive the provided trial config."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trialConfig"),": ",(0,i.kt)("em",{parentName:"li"},"cogment.MessageBase")," - Configuration for the trial. The type is specified in the spec file under the section ",(0,i.kt)("inlineCode",{parentName:"li"},"trial:config_type"),". Can be ",(0,i.kt)("inlineCode",{parentName:"li"},"undefined")," if no configuration is provided. This is provided to the first pre-trial hook."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trialIdRequested"),": ",(0,i.kt)("em",{parentName:"li"},"string")," - The trial identifier requested for the new trial. It must be unique among all active trials and a limited set of the latest ended trials (this list of trials can be retrieved with ",(0,i.kt)("inlineCode",{parentName:"li"},"getTrialInfo")," or ",(0,i.kt)("inlineCode",{parentName:"li"},"watchTrial"),"). If provided, the Orchestrator will try to use this trialId, otherwise, a UUID will be created.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"string")," - The newly started trial ID."),(0,i.kt)("h3",{id:"terminatetrialtrialids-hard--false"},(0,i.kt)("inlineCode",{parentName:"h3"},"terminateTrial(trialIds, hard = false)")),(0,i.kt)("p",null,"Method to request the end of a trial."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trialIds"),": ",(0,i.kt)("em",{parentName:"li"},"string[]")," - The trial ID(s) to request to terminate. There must be at least one ID."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"hard"),": ",(0,i.kt)("em",{parentName:"li"},"boolean")," - If ",(0,i.kt)("inlineCode",{parentName:"li"},"true"),", the termination will be forced and not wait for any action or observation. If ",(0,i.kt)("inlineCode",{parentName:"li"},"false"),", the trial will wait for the next tick, to end gracefully (i.e. wait for the next full set of actions and response observations).")),(0,i.kt)("p",null,"Return: void"),(0,i.kt)("h3",{id:"async-gettrialinfotrialids"},(0,i.kt)("inlineCode",{parentName:"h3"},"async getTrialInfo(trialIds)")),(0,i.kt)("p",null,"Method to get information about a trial."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trialIds"),": ",(0,i.kt)("em",{parentName:"li"},"string[]")," - The trial ID(s) from which to request information. If no ID is provided, returns information about all trials. Note that ended trials may only appear for a short time in this list after they have ended.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"TrialInfo[]")," - List of trial information, one per trial. Can be empty if no trial matches."),(0,i.kt)("h3",{id:"async-watchtrialstrialstatefilters"},(0,i.kt)("inlineCode",{parentName:"h3"},"async watchTrials(trialStateFilters=[])")),(0,i.kt)("p",null,"Generator method to iterate, in real-time, through all trial states matching the filters. When called, it will first iterate over the current states matching the filters, for all trials. Afterwards, it will iterate in real-time over the matching states as they change."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trialStateFilters"),": ",(0,i.kt)("em",{parentName:"li"},"cogment.TrialState[]")," - List of enum values from ",(0,i.kt)("inlineCode",{parentName:"li"},"cogment.TrialState")," for which we are interested in receiving state changes.")),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"generator(TrialInfo instance)")," - A generator for the state changes that arrive. The ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialInfo")," received here only contains the trial ID and the state."),(0,i.kt)("h3",{id:"async-getactorstrialid"},(0,i.kt)("inlineCode",{parentName:"h3"},"async getActors(trialId)")),(0,i.kt)("p",null,"Method to get the list of configured actors in a trial."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trialId"),": ",(0,i.kt)("em",{parentName:"li"},"string")," - The trial ID from which to request the list of actors.")),(0,i.kt)("p",null,"Return: ActorInfo[] - List of actors configured in this trial."),(0,i.kt)("h3",{id:"async-getremoteversions"},(0,i.kt)("inlineCode",{parentName:"h3"},"async getRemoteVersions()")),(0,i.kt)("p",null,"Method to get the versions from the remote Orchestrator."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"{","[key: string]",": string}")," - The key of the object is the name of the component (",(0,i.kt)("em",{parentName:"p"},"string"),"), and the value is the version (",(0,i.kt)("em",{parentName:"p"},"string"),")."),(0,i.kt)("h2",{id:"class-session"},"class Session"),(0,i.kt)("p",null,"Abstract class that manages aspects of a trial. Contains data and methods common to all sessions ."),(0,i.kt)("h3",{id:"gettrialid"},(0,i.kt)("inlineCode",{parentName:"h3"},"getTrialId()")),(0,i.kt)("p",null,"Method to get the UUID of the trial managed by this session."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"string")," - UUID of the trial."),(0,i.kt)("h3",{id:"gettickid"},(0,i.kt)("inlineCode",{parentName:"h3"},"getTickId()")),(0,i.kt)("p",null,"Method to get the current tick id of the trial (i.e. time step)."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"number")," - The current tick id."),(0,i.kt)("h3",{id:"istrialover"},(0,i.kt)("inlineCode",{parentName:"h3"},"isTrialOver()")),(0,i.kt)("p",null,"Method to inquire if the current trial has ended."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"boolean")," - True if the trial has ended, false otherwise."),(0,i.kt)("h3",{id:"sendingdone"},(0,i.kt)("inlineCode",{parentName:"h3"},"sendingDone()")),(0,i.kt)("p",null,"Method to notify the Orchestrator that all data for the trial, from this session, has been sent. This can be called only when the session is ending. When starting the session (see ",(0,i.kt)("inlineCode",{parentName:"p"},"ActorSession"),"), if the ",(0,i.kt)("inlineCode",{parentName:"p"},"autoDoneSending")," parameter is True, this method should not be called, and if the parameter is False, it MUST be called to end the trial properly."),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: void"),(0,i.kt)("h2",{id:"class-actorsession-extends-session"},"class ActorSession extends Session"),(0,i.kt)("h3",{id:"startautodonesendingtrue"},(0,i.kt)("inlineCode",{parentName:"h3"},"start(autoDoneSending=True)")),(0,i.kt)("p",null,"Method to start the actor. This method should be called before any other method in the session."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"autoDoneSending"),": ",(0,i.kt)("em",{parentName:"li"},"boolean")," - Controls when to notify the Orchestrator that all data has been sent. If True, the session will automatically send the notification after receiving the last observation. If False, the user MUST call ",(0,i.kt)("inlineCode",{parentName:"li"},"sendingDone")," to end the trial properly.")),(0,i.kt)("p",null,"Return: void"),(0,i.kt)("h3",{id:"async-eventloop"},(0,i.kt)("inlineCode",{parentName:"h3"},"async *eventLoop()")),(0,i.kt)("p",null,"Generator method to iterate over all events (observations, rewards, messages) as they are received. This will block and wait for an event.\nWhen this generator exits, the callback function (registered with ",(0,i.kt)("inlineCode",{parentName:"p"},"registerActor"),') should return to end the trial cleanly.\nThe generator will exit for various reasons indicating the end of the trial, a loss of communication with the orchestrator, or if the generator is sent "False".'),(0,i.kt)("p",null,"Parameters: None"),(0,i.kt)("p",null,"Return: ",(0,i.kt)("em",{parentName:"p"},"AsyncGenerator<RecvEvent",">")," - A generator for the events that arrive. The ",(0,i.kt)("inlineCode",{parentName:"p"},"RecvEvent")," instances received from this generator will not contain actions. When receiving an observation in the event, the ",(0,i.kt)("inlineCode",{parentName:"p"},"this.doAction"),' method is normally used to "reply" (if the event type is ',(0,i.kt)("inlineCode",{parentName:"p"},"EventType.ACTIVE"),")."),(0,i.kt)("h3",{id:"doactionaction"},(0,i.kt)("inlineCode",{parentName:"h3"},"doAction(action)")),(0,i.kt)("p",null,"Method to send actions to the environment."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"action"),": ",(0,i.kt)("em",{parentName:"li"},"ActionT")," - An instance of the action space class specified in the corresponding section ",(0,i.kt)("inlineCode",{parentName:"li"},"actorClasses:action:space")," of the spec file. If ",(0,i.kt)("inlineCode",{parentName:"li"},"undefined"),", then no action space is sent (empty content) and the environment will receive a default initialized action space of the appropriate type.")),(0,i.kt)("p",null,"Return: void"),(0,i.kt)("h3",{id:"sendmessagepayload-to"},(0,i.kt)("inlineCode",{parentName:"h3"},"sendMessage(payload, to)")),(0,i.kt)("p",null,"Method to send a message related to the current time step (tick id)."),(0,i.kt)("p",null,"Parameters:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"payload"),": ",(0,i.kt)("em",{parentName:"li"},"cogment.MessageBase")," - The message data to be sent. The class can be any protobuf class. It is the responsibility of the receiving actor to manage the class received."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"to"),": ",(0,i.kt)("em",{parentName:"li"},"string[]")," - Targets of feedback. Each value could be the name of an actor in the trial, or the name of the environment (from ",(0,i.kt)("inlineCode",{parentName:"li"},"this.envName"),'). Or it could represent a set of actors (with wildcards); A set of actors can be represented with the wildcard character "',(0,i.kt)("inlineCode",{parentName:"li"},"*"),'" for all actors (of all classes), or "',(0,i.kt)("inlineCode",{parentName:"li"},"actorClass.*"),'" for all actors of a specific class (the ',(0,i.kt)("inlineCode",{parentName:"li"},"actorClass")," must match one of the classes listed in the trial parameters). Note that the wildcard does not include the environment.")),(0,i.kt)("p",null,"Return: void"),(0,i.kt)("h2",{id:"enum-cogmenttrialstate"},"enum cogment.TrialState"),(0,i.kt)("p",null,"Enum representing the various states of trials."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"UNKNOWN: Should not be used."),(0,i.kt)("li",{parentName:"ul"},"INITIALIZING: The trial is in the process of starting."),(0,i.kt)("li",{parentName:"ul"},"PENDING: The trial is waiting for its final parameters, before running."),(0,i.kt)("li",{parentName:"ul"},"RUNNING: The trial is running."),(0,i.kt)("li",{parentName:"ul"},"TERMINATING: The trial is in the process of terminating (either a request to terminate has been received or the last observation has been received)."),(0,i.kt)("li",{parentName:"ul"},"ENDED: The trial has ended. Only a set number of ended trials will be kept (configured in the Orchestrator).")),(0,i.kt)("p",null,"For further information on trial lifetime, check the ",(0,i.kt)("a",{parentName:"p",href:"/docs/guide/development-guide#trial-lifetime"},"dedicated section"),"."),(0,i.kt)("h2",{id:"class-trialinfo"},"class TrialInfo"),(0,i.kt)("p",null,"Class enclosing the details of a trial."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"trialId"),": ",(0,i.kt)("em",{parentName:"p"},"string")," - The trial ID to which the details pertain."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"state"),": ",(0,i.kt)("em",{parentName:"p"},"cogment.TrialState")," - The current state of the trial."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"envName"),": ",(0,i.kt)("em",{parentName:"p"},"string")," - The name of the environment running the trial."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"tickId"),": ",(0,i.kt)("em",{parentName:"p"},"number")," - The time step that the information relates to. Only provided from a call to ",(0,i.kt)("inlineCode",{parentName:"p"},"getTrialInfo"),"."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"duration"),": ",(0,i.kt)("em",{parentName:"p"},"number")," - The time (in nanoseconds) that the trial has run. Only provided from a call to ",(0,i.kt)("inlineCode",{parentName:"p"},"getTrialInfo"),"."),(0,i.kt)("h2",{id:"class-recvevent"},"class RecvEvent"),(0,i.kt)("p",null,"Class representing a received event (for environments and actors). It can contain any combination of data according to the receiver needs, or even be empty, but it will always have a type."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"type"),": ",(0,i.kt)("em",{parentName:"p"},"EventType")," - Type of event the enclosed data represents."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"observation"),": ",(0,i.kt)("em",{parentName:"p"},"ObservationT")," - Observation data. This can only be received by actors. ",(0,i.kt)("inlineCode",{parentName:"p"},"undefined")," if not present."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"actions"),": ",(0,i.kt)("em",{parentName:"p"},"ActionT")," - Action data from actors. This can only be received by the environment. The list is empty if not present."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"rewards"),": ",(0,i.kt)("em",{parentName:"p"},"Reward[]")," - Reward values and data. This can only be received by actors. The list is empty if not present."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"messages"),": ",(0,i.kt)("em",{parentName:"p"},"MessageBase[]")," - Message data. The list is empty if not present."),(0,i.kt)("h3",{id:"enum-cogmenteventtype"},"enum cogment.EventType"),(0,i.kt)("p",null,"Enum representing the type of an event."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"EventType.NONE"),": Empty event. This kind of event should never be received.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"EventType.ACTIVE"),": Normal event from an active trial. Most events will be of this type.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"EventType.ENDING"),": Events from a trial in the process of ending. For the environment, this means that these events contain the last actions from the actors, and the trial is awaiting a final observation. For the actors, this means that the trial is ending and no action can/need to be sent in response. Note that because of network timing, there may be ",(0,i.kt)("inlineCode",{parentName:"p"},"ACTIVE")," events (e.g. rewards or messages) arriving after some ",(0,i.kt)("inlineCode",{parentName:"p"},"ENDING")," events, but the trial is ending regardless.")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"EventType.FINAL"),": Final event for the trial. This does not contain data. The event loop will exit after this event is delivered. This event can be ignored if nothing needs to be done before exiting the loop."))),(0,i.kt)("p",null,"For further information on trial lifetime, check the ",(0,i.kt)("a",{parentName:"p",href:"/docs/guide/development-guide#trial-lifetime"},"dedicated section"),"."),(0,i.kt)("h2",{id:"type-observationt"},"type ObservationT"),(0,i.kt)("p",null,"Type containing the details of an actor's observation. This will be different depending on what the ActionSpace defined in your spec file contains"),(0,i.kt)("h2",{id:"type-actiont"},"type ActionT"),(0,i.kt)("p",null,"Type containing the details of an action from an actor. This will be different depending on what the ActionSpace defined in your spec file contains"),(0,i.kt)("h2",{id:"class-messagebase"},"class MessageBase"),(0,i.kt)("p",null,"Base Class of all messages, this will contain different fields depending on what fields are in the specific message you are receiving (defined in proto files)"),(0,i.kt)("h2",{id:"type-reward"},"type Reward"),(0,i.kt)("p",null,"type containing the details of a received reward."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"tickId"),": ",(0,i.kt)("em",{parentName:"p"},"number")," - The tick id (time step) for which the reward should be applied."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"receiverName"),": ",(0,i.kt)("em",{parentName:"p"},"string")," - Name of the receiver for the reward (the name of an actor, or wildcard string)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"value"),": ",(0,i.kt)("em",{parentName:"p"},"float")," - Value of the reward (aggregated from the sources)"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"sources"),": ",(0,i.kt)("em",{parentName:"p"},"IRewardSource[]")," - List of sources that gave this reward"),(0,i.kt)("h2",{id:"interface-irewardsource"},"interface IRewardSource"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"senderName"),": ",(0,i.kt)("em",{parentName:"p"},"string")," - Name of the reward sender;"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"value"),": ",(0,i.kt)("em",{parentName:"p"},"number")," - Value of the reward;"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"confidence"),": ",(0,i.kt)("em",{parentName:"p"},"number")," - Confidence of this reward;"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"userData"),": ",(0,i.kt)("em",{parentName:"p"},"google.protobuf.IAny")," - Extra data;"))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/8f68e2ce.68e819b0.js b/assets/js/8f68e2ce.68e819b0.js deleted file mode 100644 index d3b42a5..0000000 --- a/assets/js/8f68e2ce.68e819b0.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[5089],{3905:(e,n,t)=>{t.d(n,{Zo:()=>c,kt:()=>m});var a=t(7294);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function i(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?o(Object(t),!0).forEach((function(n){r(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function l(e,n){if(null==e)return{};var t,a,r=function(e,n){if(null==e)return{};var t,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)t=o[a],n.indexOf(t)>=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)t=o[a],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var s=a.createContext({}),p=function(e){var n=a.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):i(i({},n),e)),t},c=function(e){var n=p(e.components);return a.createElement(s.Provider,{value:n},e.children)},d={inlineCode:"code",wrapper:function(e){var n=e.children;return a.createElement(a.Fragment,{},n)}},u=a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,o=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),u=p(t),m=r,h=u["".concat(s,".").concat(m)]||u[m]||d[m]||o;return t?a.createElement(h,i(i({ref:n},c),{},{components:t})):a.createElement(h,i({ref:n},c))}));function m(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var o=t.length,i=new Array(o);i[0]=u;var l={};for(var s in n)hasOwnProperty.call(n,s)&&(l[s]=n[s]);l.originalType=e,l.mdxType="string"==typeof e?e:r,i[1]=l;for(var p=2;p<o;p++)i[p]=t[p];return a.createElement.apply(null,i)}return a.createElement.apply(null,t)}u.displayName="MDXCreateElement"},5432:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>i,default:()=>d,frontMatter:()=>o,metadata:()=>l,toc:()=>p});var a=t(7462),r=(t(7294),t(3905));const o={sidebar_position:6},i="Launch",l={unversionedId:"reference/cli/launch",id:"reference/cli/launch",title:"Launch",description:"Launch is a utility command meant to facilitate locally launching and shutting down an entire Cogment project at once.",source:"@site/docs/reference/cli/launch.md",sourceDirName:"reference/cli",slug:"/reference/cli/launch",permalink:"/docs/reference/cli/launch",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:6,frontMatter:{sidebar_position:6},sidebar:"docSidebar",previous:{title:"Web Proxy",permalink:"/docs/reference/cli/web-proxy"},next:{title:"Status",permalink:"/docs/reference/cli/status"}},s={},p=[{value:"Command line",id:"command-line",level:2},{value:"definition file",id:"definition-file",level:2},{value:"Nodes",id:"nodes",level:3},{value:"Scripts",id:"scripts",level:4},{value:"Environment Variables",id:"environment-variables",level:5},{value:"Working folder",id:"working-folder",level:5},{value:"Quiet",id:"quiet",level:5},{value:"Dependency <em>(Cogment >= 2.16)</em>",id:"dependency-cogment--216",level:5},{value:"Global <em>(Cogment >= 2.15)</em>",id:"global-cogment--215",level:4},{value:"Environment Variables",id:"environment-variables-1",level:5},{value:"Working folder",id:"working-folder-1",level:5},{value:"Variable substitution",id:"variable-substitution",level:3},{value:"Special Variables",id:"special-variables",level:4},{value:"Arguments <em>(Cogment >= 2.15)</em>",id:"arguments-cogment--215",level:5},{value:"All Arguments <em>(Cogment >= 2.17)</em>",id:"all-arguments-cogment--217",level:6},{value:"File Example",id:"file-example",level:3}],c={toc:p};function d(e){let{components:n,...t}=e;return(0,r.kt)("wrapper",(0,a.Z)({},c,t,{components:n,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"launch"},"Launch"),(0,r.kt)("p",null,"Launch is a utility command meant to facilitate locally launching and shutting down an entire Cogment project at once."),(0,r.kt)("p",null,"When launch is used, a set of processes will be launched to run in parallel, as described by a ",(0,r.kt)("a",{parentName:"p",href:"#definition-file"},"YAML definition file"),".\nOnce any of these processes terminates, all other ones will be terminated as well."),(0,r.kt)("p",null,"The order of of the script execution is undefined, which is to say that they may not start in the order they are defined, and may not always start in the same order.\nScript ",(0,r.kt)("a",{parentName:"p",href:"#dependency-cogment--216"},"dependency")," can be used if a certain order must be used."),(0,r.kt)("h2",{id:"command-line"},"Command line"),(0,r.kt)("p",null,(0,r.kt)("inlineCode",{parentName:"p"},"cogment launch [options] filename [args...]")),(0,r.kt)("p",null,(0,r.kt)("inlineCode",{parentName:"p"},"filename"),": Name (and path) of the YAML definition file describing the processes to launch."),(0,r.kt)("p",null,(0,r.kt)("inlineCode",{parentName:"p"},"options"),":"),(0,r.kt)("p",null,"[-q]",", ","[--quiet]",': Disable some of the output generated by the launcher. Process output is never disabled by this option. To increase the level, more "q" can be added, up to ',(0,r.kt)("inlineCode",{parentName:"p"},"-qqq")," disabling all launcher generated output except errors."),(0,r.kt)("p",null,(0,r.kt)("inlineCode",{parentName:"p"},"args"),": These are arguments that will be used in ",(0,r.kt)("a",{parentName:"p",href:"#variable-substitution"},"variable substitution")," in the definition file. If some arguments start with a dash (",(0,r.kt)("inlineCode",{parentName:"p"},"-"),") a double dash (",(0,r.kt)("inlineCode",{parentName:"p"},"--"),") must be used to separate these from the launch options."),(0,r.kt)("p",null,"E.g.:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-console"},"$ cogment launch --quiet ./launch.yaml 1000 8\n$ cogment launch -qq ./launch.yaml 1000 8\n$ cogment launch --quiet ./launch.yaml -- --file ./myfile --match_all\n")),(0,r.kt)("h2",{id:"definition-file"},"definition file"),(0,r.kt)("p",null,"The launch definition file is a ",(0,r.kt)("a",{parentName:"p",href:"https://yaml.org"},"YAML")," formatted file where the details of the parallel processes to run are defined.\nThe file consists of at least a ",(0,r.kt)("inlineCode",{parentName:"p"},"scripts")," top level node, and may also contain a ",(0,r.kt)("inlineCode",{parentName:"p"},"global")," top level node."),(0,r.kt)("h3",{id:"nodes"},"Nodes"),(0,r.kt)("h4",{id:"scripts"},"Scripts"),(0,r.kt)("p",null,"The ",(0,r.kt)("inlineCode",{parentName:"p"},"scripts")," node contains the details of the processes to run.\nEach node under ",(0,r.kt)("inlineCode",{parentName:"p"},"scripts")," represents a process to run.\nThe name of the node becomes the identity of the script/process and serves to identify the process output."),(0,r.kt)("p",null,"Each process will run the contents of the ",(0,r.kt)("inlineCode",{parentName:"p"},"commands")," list in sequence (i.e. the next command will start when the previous ends). Each command runs in an independent environment (e.g. environment variables set by one command will not be seen by the others)."),(0,r.kt)("p",null,"E.g.:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},'scripts:\n process_a: # The name of this process is "process_a"\n commands:\n - ["retrieve_db.sh"]\n - ["python3", "env/main.py"]\n\n process_b: # The name of this process is "process_b"\n commands:\n - ["cogment", "service", "orchestrator"]\n')),(0,r.kt)("p",null,"The output will then look something like this:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-output"},"2023-06-30T22:24:08Z [TRACE ] [process_a] Ready\n2023-06-30T22:24:08Z [TRACE ] [process_a:(1/2)] Launch [retrieve_db.sh]\n2023-06-30T22:24:08Z [TRACE ] [process_b] Ready\n2023-06-30T22:24:08Z [stdout] [process_a:(1/2)] Retrieving default database...\n2023-06-30T22:24:08Z [TRACE ] [process_b:(1/1)] Launch [cogment services orchestrator]\n2023-06-30T22:24:08Z [stderr] [process_b:(1/1)] 2023-06-30T22:24:08Z [INFO] [cmd] starting the orchestrator service [version:2.16.0]\n2023-06-30T22:24:09Z [stderr] [process_a:(1/2)] Record #2278 inconsistent\n2023-06-30T22:24:12Z [stdout] [process_a:(1/2)] Database retrieved in /app/sb/\n2023-06-30T22:24:12Z [TRACE ] [process_a:(1/2)] Completed\n2023-06-30T22:24:12Z [TRACE ] [process_a:(2/2)] Launch [python3 env/main.py]\n...\n")),(0,r.kt)("p",null,"Notes:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},'"',"[TRACE ]",'" is low level information from the launcher (it could also be "',"[INFO ]",'" for more important information).'),(0,r.kt)("li",{parentName:"ul"},'"',"[stdout]",'", and "',"[stderr]",'" are the output from the process.'),(0,r.kt)("li",{parentName:"ul"},'"process_a" and "process_b" are the names given to the processes in the definition file.'),(0,r.kt)("li",{parentName:"ul"},'"(1/2)" means that it is the first command out of two for that process.'),(0,r.kt)("li",{parentName:"ul"},"The times/dates are in RFC3339 format.")),(0,r.kt)("h5",{id:"environment-variables"},"Environment Variables"),(0,r.kt)("p",null,"You can set environment variables using the ",(0,r.kt)("inlineCode",{parentName:"p"},"environment")," node of the process.\nThese will be part of the environment of all commands in the process."),(0,r.kt)("p",null,"E.g:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},'scripts:\n orchestrator:\n environment:\n COGMENT_ORCHESTRATOR_ACTOR_PORT: 9000\n COGMENT_LIFECYCLE_PORT: 9000\n commands:\n - ["cogment", "services", "orchestrator"]\n')),(0,r.kt)("h5",{id:"working-folder"},"Working folder"),(0,r.kt)("p",null,"By default, the current working folder is set to the folder ",(0,r.kt)("strong",{parentName:"p"},"containing the launch definition file")," (not the folder where the Launch command is executed).\nYou can change the working folder with the ",(0,r.kt)("inlineCode",{parentName:"p"},"folder")," node for each process."),(0,r.kt)("p",null,"E.g.:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},'# Definition file is in "/home/user"\nscripts:\n actor_alpha:\n folder: ./actors/alpha # Working folder is "/home/user/actors/alpha"\n commands:\n - ["python3", "main.py"]\n')),(0,r.kt)("h5",{id:"quiet"},"Quiet"),(0,r.kt)("p",null,"You can control the process output by setting this value to ",(0,r.kt)("inlineCode",{parentName:"p"},"True")," or ",(0,r.kt)("inlineCode",{parentName:"p"},"False"),".\nBy default this is ",(0,r.kt)("inlineCode",{parentName:"p"},"False"),", in which case standard process output (stdout and stderr) are also output by the launcher.\nIf set to ",(0,r.kt)("inlineCode",{parentName:"p"},"True"),", standard process output is discarded and not output by the launcher."),(0,r.kt)("p",null,"E.g.:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},'scripts:\n setup:\n quiet: True\n commands:\n - ["python3", "setup.py"]\n')),(0,r.kt)("h5",{id:"dependency-cogment--216"},"Dependency ",(0,r.kt)("em",{parentName:"h5"},"(Cogment >= 2.16)")),(0,r.kt)("p",null,"Inter-process dependency can also be defined using the ",(0,r.kt)("inlineCode",{parentName:"p"},"depends_on")," and ",(0,r.kt)("inlineCode",{parentName:"p"},"ready_output")," nodes of the script."),(0,r.kt)("p",null,"The ",(0,r.kt)("inlineCode",{parentName:"p"},"depends_on"),' node is a list of process names that this script depends on.\nWhich means that all the listed processes must be "ready" before the current process is started.'),(0,r.kt)("p",null,"The ",(0,r.kt)("inlineCode",{parentName:"p"},"ready_output"),' node is a regex (regular expression) string to search for in the output of the process.\nWhen the regex matches the output, the process is considered to be "ready".\nIf no regex string is provided (or the regex string is empty), the process is considered "ready" as soon as it starts.'),(0,r.kt)("p",null,"E.g.:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},'scripts:\n process_a:\n quiet: True\n commands:\n - ["retrieve_db.sh"]\n - ["python3", "env/main.py"]\n ready_output: "^Database retrieved in"\n\n process_b:\n depends_on:\n - process_a\n commands:\n - ["cogment", "service", "orchestrator"]\n')),(0,r.kt)("p",null,"Notes:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"It is better to use single quotes to define the regex string to prevent YAML from interpreting control characters (e.g. backslash)."),(0,r.kt)("li",{parentName:"ul"},"Be aware that colors and other terminal controls (e.g. curses) in the process output can make matching difficult."),(0,r.kt)("li",{parentName:"ul"},"The version of regex currently used mostly follows ",(0,r.kt)("a",{parentName:"li",href:"https://github.com/google/re2/wiki/Syntax"},"Google's RE2"),"."),(0,r.kt)("li",{parentName:"ul"},"The matching of the process output is not affected by the ",(0,r.kt)("a",{parentName:"li",href:"#quiet"},"quiet")," script option.")),(0,r.kt)("h4",{id:"global-cogment--215"},"Global ",(0,r.kt)("em",{parentName:"h4"},"(Cogment >= 2.15)")),(0,r.kt)("p",null,"The ",(0,r.kt)("inlineCode",{parentName:"p"},"global")," node contains values that have a global scope (i.e. they affect all scripts defined in the file).\nSome of these values can be overridden by the individual scripts."),(0,r.kt)("h5",{id:"environment-variables-1"},"Environment Variables"),(0,r.kt)("p",null,"You can set global environment variables using the ",(0,r.kt)("inlineCode",{parentName:"p"},"environment")," node under the ",(0,r.kt)("inlineCode",{parentName:"p"},"global")," node.\nThese variables will be part of the environment of all scripts, unless overridden locally in the script's own ",(0,r.kt)("inlineCode",{parentName:"p"},"environment")," node."),(0,r.kt)("p",null,"E.g:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},"global:\n environment:\n COGMENT_LOG_LEVEL: info\n COGMENT_DIRECTORY_ENDPOINT: grpc://server:9010\n")),(0,r.kt)("h5",{id:"working-folder-1"},"Working folder"),(0,r.kt)("p",null,"By default, the current working folder is set to the folder ",(0,r.kt)("strong",{parentName:"p"},"containing the launch definition file")," (not the folder where the Launch command is executed).\nThis can be changed with the ",(0,r.kt)("inlineCode",{parentName:"p"},"folder")," node under the ",(0,r.kt)("inlineCode",{parentName:"p"},"global")," node.\nIt will then become the default folder for all scripts, unless locally changed by the script's own ",(0,r.kt)("inlineCode",{parentName:"p"},"folder")," node.\nEach level can also build on the previous one if the provided folder is a relative folder."),(0,r.kt)("p",null,"E.g.:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},'# Definition file is in "/home/user"\nglobal:\n folder: ./app # Default folder for all scripts is set to "/home/user/app"\nscripts:\n local:\n folder: ./inside # Working folder is then "/home/user/app/inside"\n somewhere:\n folder: /home/away # Working folder is then "/home/away"\n')),(0,r.kt)("h3",{id:"variable-substitution"},"Variable substitution"),(0,r.kt)("p",null,"You can substitute launch variables using ",(0,r.kt)("inlineCode",{parentName:"p"},"{{.VAR}}")," in strings anywhere in the ",(0,r.kt)("inlineCode",{parentName:"p"},"commands"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"environment")," or ",(0,r.kt)("inlineCode",{parentName:"p"},"ready_output")," nodes of the yaml definition file.\nAll environment variables when ",(0,r.kt)("inlineCode",{parentName:"p"},"launch")," is started are defined as launch variables.\nNew environment variables set in the definition file also define launch variables.\nAnd launch defines some ",(0,r.kt)("a",{parentName:"p",href:"#special-variables"},"special variables")," internally also."),(0,r.kt)("p",null,'In the concerned strings, the double open curly brackets ("',(0,r.kt)("inlineCode",{parentName:"p"},"{{"),'") delimit the start of a variable to be substituted, therefore to include a literal double open brackets in a string, you have to surround them with backticks inside substitution brackets: ',(0,r.kt)("inlineCode",{parentName:"p"},"{{`{{`}}"),"."),(0,r.kt)("p",null,"Undefined values will be replaced with ",(0,r.kt)("inlineCode",{parentName:"p"},"<no value>"),"."),(0,r.kt)("p",null,"E.g.:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-console"},"$ export OWNER=Elvis\n$ cogment launch ./launch.yaml\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},'scripts:\n say_hi:\n environment:\n Type: "How"\n Question: "{{.Type}} are you?"\n commands:\n - ["echo", "Hello, {{.OWNER}}. {{.Question}}"] # echo "Hello, Elvis. How are you?"\n - ["echo", "{{`{{`}} brackets }}"] # echo "{{ brackets }}"\n - ["echo", "no val: {{.MADE_UP_VARIABLE}}"] # echo "no val: <no value>"\n ready_output: "Hello, {{.OWNER}}.*"\n')),(0,r.kt)("h4",{id:"special-variables"},"Special Variables"),(0,r.kt)("p",null,"The launch program will also define variables that can be used in substitutions.\nThese internally defined variables start with a double underscore (",(0,r.kt)("inlineCode",{parentName:"p"},"__"),")."),(0,r.kt)("p",null,"Environment variables with conflicting names will be replaced by these internal launch variables.\nNote that this only affects variable substitution, not the environment of the command execution.\nAnd internal launch variables are not available as environment variables."),(0,r.kt)("h5",{id:"arguments-cogment--215"},"Arguments ",(0,r.kt)("em",{parentName:"h5"},"(Cogment >= 2.15)")),(0,r.kt)("p",null,"The arguments from the command line of launch define variables and can thus be substituted.\nE.g. ",(0,r.kt)("inlineCode",{parentName:"p"},"cogment launch ./launch.yaml arg1 arg2 arg3")," will define ",(0,r.kt)("inlineCode",{parentName:"p"},"__1"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"__2")," and ",(0,r.kt)("inlineCode",{parentName:"p"},"__3")," respectively corresponding to ",(0,r.kt)("inlineCode",{parentName:"p"},"arg1"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"arg2")," and ",(0,r.kt)("inlineCode",{parentName:"p"},"arg3"),".\nThey can then be substituted with ",(0,r.kt)("inlineCode",{parentName:"p"},"{{.__1}}"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"{{.__2}}"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"{{.__3}}"),"."),(0,r.kt)("p",null,(0,r.kt)("inlineCode",{parentName:"p"},"__1")," to ",(0,r.kt)("inlineCode",{parentName:"p"},"__9")," are always defined, but will be empty if no corresponding argument was given on the command line.\nArguments 10 (",(0,r.kt)("inlineCode",{parentName:"p"},"__10"),") and above will only be defined if they were provided on the command line."),(0,r.kt)("p",null,"E.g.:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-console"},"$ cogment launch -q ./launch.yaml 42 foo\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},'scripts:\n args_out:\n commands:\n - ["echo", "args:", "{{.__1}}", "{{.__2}}", "{{.__3}}"] # echo "args:" "42" "foo" ""\n - ["echo", "empty: >{{.__3}}< >{{.__6}}<"] # echo "empty: >< ><"\n - ["echo", "no args: {{.__10}} {{.__42}}"] # echo "no args: <no value> <no value>"\n ready_output: ".* {{.__2}} $"\n')),(0,r.kt)("h6",{id:"all-arguments-cogment--217"},"All Arguments ",(0,r.kt)("em",{parentName:"h6"},"(Cogment >= 2.17)")),(0,r.kt)("p",null,"The number of arguments on the command line of launch is defined in ",(0,r.kt)("inlineCode",{parentName:"p"},"__NB_ARGS"),".\nAnd all the launch arguments can be added to a script command with ",(0,r.kt)("inlineCode",{parentName:"p"},"__ALL_ARGS"),"."),(0,r.kt)("p",null,"The ",(0,r.kt)("inlineCode",{parentName:"p"},"__ALL_ARGS")," variable is special in terms of substitution; if the command argument string is exactly ",(0,r.kt)("inlineCode",{parentName:"p"},"{{.__ALL_ARGS}}"),", then all launch arguments will be added to this command. Otherwise if it is only ",(0,r.kt)("em",{parentName:"p"},"part")," of a string, it will substitute a string containing all launch arguments."),(0,r.kt)("p",null,'In other words, a command argument "{{.',(0,r.kt)("strong",{parentName:"p"},'ALL_ARGS}}" will expand to multiple arguments for the command, whereas something like "--{{.'),'ALL_ARGS}}" will stay as one argument (a string that contains all launch arguments preceded by "--").'),(0,r.kt)("p",null,"E.g.:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-console"},"$ cogment launch ./launch.yaml 42 foo extra\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},'scripts:\n args_out:\n commands:\n - ["echo", "nb of args: {{.__NB_ARGS}}]"] # echo "nb of args: 3"\n - ["echo", "all:", "{{.__ALL_ARGS}}", "and more"] # echo "all:" "42" "foo" "extra" "and more"\n - ["echo", "all:", "args: {{.__ALL_ARGS}}"] # echo "all:" "args: 42 foo extra"\n ready_output: "args:.*{{.__2}}"\n')),(0,r.kt)("h3",{id:"file-example"},"File Example"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},'global:\n environment:\n RUN_NAME: "COGRUN-{{.HOSTNAME}}-{{.__1}}"\n COGMENT_LOG_LEVEL: info\n DIR_PORT: 9010\n COGMENT_DIRECTORY_ENDPOINT: "grpc://server:{{.DIR_PORT}}"\n folder: /app\n\nscripts:\n prep:\n commands:\n - ["./importdata.sh"]\n - ["./cudasetup.sh"]\n - ["sleep", "infinity"] # To prevent process from ending\n ready_output: "^Done"\n directory:\n quiet: true\n folder: ./cogment\n environment:\n COGMENT_DIRECTORY_PORT: "{{.DIR_PORT}}"\n depends_on:\n - prep\n commands:\n - ["cogment", "services", "directory"]\n ready_output: \'Listening \\[port:[0-9]*\\]\' # To match "Listening [port:9010]"\n orchestrator:\n folder: ./cogment\n environment:\n COGMENT_ORCHESTRATOR_ACTOR_PORT: 0\n COGMENT_LIFECYCLE_PORT: 0\n depends_on:\n - directory\n commands:\n - ["cogment", "services", "orchestrator"]\n runner:\n folder: ./pycode\n depends_on:\n - directory\n - orchestrator\n commands:\n - [\n "python3",\n "runner.py",\n "-u {{.USER}}",\n "-n {{.RUN_NAME}}",\n "{{.__2}}",\n ]\n report:\n commands:\n - ["reporting_service"]\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/8f68e2ce.9a776507.js b/assets/js/8f68e2ce.9a776507.js new file mode 100644 index 0000000..933fea8 --- /dev/null +++ b/assets/js/8f68e2ce.9a776507.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[5089],{3905:(e,n,t)=>{t.d(n,{Zo:()=>c,kt:()=>h});var a=t(7294);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function i(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?o(Object(t),!0).forEach((function(n){r(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function l(e,n){if(null==e)return{};var t,a,r=function(e,n){if(null==e)return{};var t,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)t=o[a],n.indexOf(t)>=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)t=o[a],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var s=a.createContext({}),p=function(e){var n=a.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):i(i({},n),e)),t},c=function(e){var n=p(e.components);return a.createElement(s.Provider,{value:n},e.children)},d="mdxType",u={inlineCode:"code",wrapper:function(e){var n=e.children;return a.createElement(a.Fragment,{},n)}},m=a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,o=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),d=p(t),m=r,h=d["".concat(s,".").concat(m)]||d[m]||u[m]||o;return t?a.createElement(h,i(i({ref:n},c),{},{components:t})):a.createElement(h,i({ref:n},c))}));function h(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var o=t.length,i=new Array(o);i[0]=m;var l={};for(var s in n)hasOwnProperty.call(n,s)&&(l[s]=n[s]);l.originalType=e,l[d]="string"==typeof e?e:r,i[1]=l;for(var p=2;p<o;p++)i[p]=t[p];return a.createElement.apply(null,i)}return a.createElement.apply(null,t)}m.displayName="MDXCreateElement"},5432:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>i,default:()=>u,frontMatter:()=>o,metadata:()=>l,toc:()=>p});var a=t(7462),r=(t(7294),t(3905));const o={sidebar_position:6},i="Launch",l={unversionedId:"reference/cli/launch",id:"reference/cli/launch",title:"Launch",description:"Launch is a utility command meant to facilitate locally launching and shutting down an entire Cogment project at once.",source:"@site/docs/reference/cli/launch.md",sourceDirName:"reference/cli",slug:"/reference/cli/launch",permalink:"/docs/reference/cli/launch",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:6,frontMatter:{sidebar_position:6},sidebar:"docSidebar",previous:{title:"Web Proxy",permalink:"/docs/reference/cli/web-proxy"},next:{title:"Status",permalink:"/docs/reference/cli/status"}},s={},p=[{value:"Command line",id:"command-line",level:2},{value:"definition file",id:"definition-file",level:2},{value:"Nodes",id:"nodes",level:3},{value:"Scripts",id:"scripts",level:4},{value:"Environment Variables",id:"environment-variables",level:5},{value:"Working folder",id:"working-folder",level:5},{value:"Quiet",id:"quiet",level:5},{value:"Dependency <em>(Cogment >= 2.16)</em>",id:"dependency-cogment--216",level:5},{value:"Global <em>(Cogment >= 2.15)</em>",id:"global-cogment--215",level:4},{value:"Environment Variables",id:"environment-variables-1",level:5},{value:"Working folder",id:"working-folder-1",level:5},{value:"Variable substitution",id:"variable-substitution",level:3},{value:"Special Variables",id:"special-variables",level:4},{value:"Arguments <em>(Cogment >= 2.15)</em>",id:"arguments-cogment--215",level:5},{value:"All Arguments <em>(Cogment >= 2.17)</em>",id:"all-arguments-cogment--217",level:6},{value:"File Example",id:"file-example",level:3}],c={toc:p},d="wrapper";function u(e){let{components:n,...t}=e;return(0,r.kt)(d,(0,a.Z)({},c,t,{components:n,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"launch"},"Launch"),(0,r.kt)("p",null,"Launch is a utility command meant to facilitate locally launching and shutting down an entire Cogment project at once."),(0,r.kt)("p",null,"When launch is used, a set of processes will be launched to run in parallel, as described by a ",(0,r.kt)("a",{parentName:"p",href:"#definition-file"},"YAML definition file"),".\nOnce any of these processes terminates, all other ones will be terminated as well."),(0,r.kt)("p",null,"The order of of the script execution is undefined, which is to say that they may not start in the order they are defined, and may not always start in the same order.\nScript ",(0,r.kt)("a",{parentName:"p",href:"#dependency-cogment--216"},"dependency")," can be used if a certain order must be used."),(0,r.kt)("h2",{id:"command-line"},"Command line"),(0,r.kt)("p",null,(0,r.kt)("inlineCode",{parentName:"p"},"cogment launch [options] filename [args...]")),(0,r.kt)("p",null,(0,r.kt)("inlineCode",{parentName:"p"},"filename"),": Name (and path) of the YAML definition file describing the processes to launch."),(0,r.kt)("p",null,(0,r.kt)("inlineCode",{parentName:"p"},"options"),":"),(0,r.kt)("p",null,"[-q]",", ","[--quiet]",': Disable some of the output generated by the launcher. Process output is never disabled by this option. To increase the level, more "q" can be added, up to ',(0,r.kt)("inlineCode",{parentName:"p"},"-qqq")," disabling all launcher generated output except errors."),(0,r.kt)("p",null,(0,r.kt)("inlineCode",{parentName:"p"},"args"),": These are arguments that will be used in ",(0,r.kt)("a",{parentName:"p",href:"#variable-substitution"},"variable substitution")," in the definition file. If some arguments start with a dash (",(0,r.kt)("inlineCode",{parentName:"p"},"-"),") a double dash (",(0,r.kt)("inlineCode",{parentName:"p"},"--"),") must be used to separate these from the launch options."),(0,r.kt)("p",null,"E.g.:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-console"},"$ cogment launch --quiet ./launch.yaml 1000 8\n$ cogment launch -qq ./launch.yaml 1000 8\n$ cogment launch --quiet ./launch.yaml -- --file ./myfile --match_all\n")),(0,r.kt)("h2",{id:"definition-file"},"definition file"),(0,r.kt)("p",null,"The launch definition file is a ",(0,r.kt)("a",{parentName:"p",href:"https://yaml.org"},"YAML")," formatted file where the details of the parallel processes to run are defined.\nThe file consists of at least a ",(0,r.kt)("inlineCode",{parentName:"p"},"scripts")," top level node, and may also contain a ",(0,r.kt)("inlineCode",{parentName:"p"},"global")," top level node."),(0,r.kt)("h3",{id:"nodes"},"Nodes"),(0,r.kt)("h4",{id:"scripts"},"Scripts"),(0,r.kt)("p",null,"The ",(0,r.kt)("inlineCode",{parentName:"p"},"scripts")," node contains the details of the processes to run.\nEach node under ",(0,r.kt)("inlineCode",{parentName:"p"},"scripts")," represents a process to run.\nThe name of the node becomes the identity of the script/process and serves to identify the process output."),(0,r.kt)("p",null,"Each process will run the contents of the ",(0,r.kt)("inlineCode",{parentName:"p"},"commands")," list in sequence (i.e. the next command will start when the previous ends). Each command runs in an independent environment (e.g. environment variables set by one command will not be seen by the others)."),(0,r.kt)("p",null,"E.g.:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},'scripts:\n process_a: # The name of this process is "process_a"\n commands:\n - ["retrieve_db.sh"]\n - ["python3", "env/main.py"]\n\n process_b: # The name of this process is "process_b"\n commands:\n - ["cogment", "service", "orchestrator"]\n')),(0,r.kt)("p",null,"The output will then look something like this:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-output"},"2023-06-30T22:24:08Z [TRACE ] [process_a] Ready\n2023-06-30T22:24:08Z [TRACE ] [process_a:(1/2)] Launch [retrieve_db.sh]\n2023-06-30T22:24:08Z [TRACE ] [process_b] Ready\n2023-06-30T22:24:08Z [stdout] [process_a:(1/2)] Retrieving default database...\n2023-06-30T22:24:08Z [TRACE ] [process_b:(1/1)] Launch [cogment services orchestrator]\n2023-06-30T22:24:08Z [stderr] [process_b:(1/1)] 2023-06-30T22:24:08Z [INFO] [cmd] starting the orchestrator service [version:2.16.0]\n2023-06-30T22:24:09Z [stderr] [process_a:(1/2)] Record #2278 inconsistent\n2023-06-30T22:24:12Z [stdout] [process_a:(1/2)] Database retrieved in /app/sb/\n2023-06-30T22:24:12Z [TRACE ] [process_a:(1/2)] Completed\n2023-06-30T22:24:12Z [TRACE ] [process_a:(2/2)] Launch [python3 env/main.py]\n...\n")),(0,r.kt)("p",null,"Notes:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},'"',"[TRACE ]",'" is low level information from the launcher (it could also be "',"[INFO ]",'" for more important information).'),(0,r.kt)("li",{parentName:"ul"},'"',"[stdout]",'", and "',"[stderr]",'" are the output from the process.'),(0,r.kt)("li",{parentName:"ul"},'"process_a" and "process_b" are the names given to the processes in the definition file.'),(0,r.kt)("li",{parentName:"ul"},'"(1/2)" means that it is the first command out of two for that process.'),(0,r.kt)("li",{parentName:"ul"},"The times/dates are in RFC3339 format.")),(0,r.kt)("h5",{id:"environment-variables"},"Environment Variables"),(0,r.kt)("p",null,"You can set environment variables using the ",(0,r.kt)("inlineCode",{parentName:"p"},"environment")," node of the process.\nThese will be part of the environment of all commands in the process."),(0,r.kt)("p",null,"E.g:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},'scripts:\n orchestrator:\n environment:\n COGMENT_ORCHESTRATOR_ACTOR_PORT: 9000\n COGMENT_LIFECYCLE_PORT: 9000\n commands:\n - ["cogment", "services", "orchestrator"]\n')),(0,r.kt)("h5",{id:"working-folder"},"Working folder"),(0,r.kt)("p",null,"By default, the current working folder is set to the folder ",(0,r.kt)("strong",{parentName:"p"},"containing the launch definition file")," (not the folder where the Launch command is executed).\nYou can change the working folder with the ",(0,r.kt)("inlineCode",{parentName:"p"},"folder")," node for each process."),(0,r.kt)("p",null,"E.g.:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},'# Definition file is in "/home/user"\nscripts:\n actor_alpha:\n folder: ./actors/alpha # Working folder is "/home/user/actors/alpha"\n commands:\n - ["python3", "main.py"]\n')),(0,r.kt)("h5",{id:"quiet"},"Quiet"),(0,r.kt)("p",null,"You can control the process output by setting this value to ",(0,r.kt)("inlineCode",{parentName:"p"},"True")," or ",(0,r.kt)("inlineCode",{parentName:"p"},"False"),".\nBy default this is ",(0,r.kt)("inlineCode",{parentName:"p"},"False"),", in which case standard process output (stdout and stderr) are also output by the launcher.\nIf set to ",(0,r.kt)("inlineCode",{parentName:"p"},"True"),", standard process output is discarded and not output by the launcher."),(0,r.kt)("p",null,"E.g.:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},'scripts:\n setup:\n quiet: True\n commands:\n - ["python3", "setup.py"]\n')),(0,r.kt)("h5",{id:"dependency-cogment--216"},"Dependency ",(0,r.kt)("em",{parentName:"h5"},"(Cogment >= 2.16)")),(0,r.kt)("p",null,"Inter-process dependency can also be defined using the ",(0,r.kt)("inlineCode",{parentName:"p"},"depends_on")," and ",(0,r.kt)("inlineCode",{parentName:"p"},"ready_output")," nodes of the script."),(0,r.kt)("p",null,"The ",(0,r.kt)("inlineCode",{parentName:"p"},"depends_on"),' node is a list of process names that this script depends on.\nWhich means that all the listed processes must be "ready" before the current process is started.'),(0,r.kt)("p",null,"The ",(0,r.kt)("inlineCode",{parentName:"p"},"ready_output"),' node is a regex (regular expression) string to search for in the output of the process.\nWhen the regex matches the output, the process is considered to be "ready".\nIf no regex string is provided (or the regex string is empty), the process is considered "ready" as soon as it starts.'),(0,r.kt)("p",null,"E.g.:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},'scripts:\n process_a:\n quiet: True\n commands:\n - ["retrieve_db.sh"]\n - ["python3", "env/main.py"]\n ready_output: "^Database retrieved in"\n\n process_b:\n depends_on:\n - process_a\n commands:\n - ["cogment", "service", "orchestrator"]\n')),(0,r.kt)("p",null,"Notes:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"It is better to use single quotes to define the regex string to prevent YAML from interpreting control characters (e.g. backslash)."),(0,r.kt)("li",{parentName:"ul"},"Be aware that colors and other terminal controls (e.g. curses) in the process output can make matching difficult."),(0,r.kt)("li",{parentName:"ul"},"The version of regex currently used mostly follows ",(0,r.kt)("a",{parentName:"li",href:"https://github.com/google/re2/wiki/Syntax"},"Google's RE2"),"."),(0,r.kt)("li",{parentName:"ul"},"The matching of the process output is not affected by the ",(0,r.kt)("a",{parentName:"li",href:"#quiet"},"quiet")," script option.")),(0,r.kt)("h4",{id:"global-cogment--215"},"Global ",(0,r.kt)("em",{parentName:"h4"},"(Cogment >= 2.15)")),(0,r.kt)("p",null,"The ",(0,r.kt)("inlineCode",{parentName:"p"},"global")," node contains values that have a global scope (i.e. they affect all scripts defined in the file).\nSome of these values can be overridden by the individual scripts."),(0,r.kt)("h5",{id:"environment-variables-1"},"Environment Variables"),(0,r.kt)("p",null,"You can set global environment variables using the ",(0,r.kt)("inlineCode",{parentName:"p"},"environment")," node under the ",(0,r.kt)("inlineCode",{parentName:"p"},"global")," node.\nThese variables will be part of the environment of all scripts, unless overridden locally in the script's own ",(0,r.kt)("inlineCode",{parentName:"p"},"environment")," node."),(0,r.kt)("p",null,"E.g:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},"global:\n environment:\n COGMENT_LOG_LEVEL: info\n COGMENT_DIRECTORY_ENDPOINT: grpc://server:9010\n")),(0,r.kt)("h5",{id:"working-folder-1"},"Working folder"),(0,r.kt)("p",null,"By default, the current working folder is set to the folder ",(0,r.kt)("strong",{parentName:"p"},"containing the launch definition file")," (not the folder where the Launch command is executed).\nThis can be changed with the ",(0,r.kt)("inlineCode",{parentName:"p"},"folder")," node under the ",(0,r.kt)("inlineCode",{parentName:"p"},"global")," node.\nIt will then become the default folder for all scripts, unless locally changed by the script's own ",(0,r.kt)("inlineCode",{parentName:"p"},"folder")," node.\nEach level can also build on the previous one if the provided folder is a relative folder."),(0,r.kt)("p",null,"E.g.:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},'# Definition file is in "/home/user"\nglobal:\n folder: ./app # Default folder for all scripts is set to "/home/user/app"\nscripts:\n local:\n folder: ./inside # Working folder is then "/home/user/app/inside"\n somewhere:\n folder: /home/away # Working folder is then "/home/away"\n')),(0,r.kt)("h3",{id:"variable-substitution"},"Variable substitution"),(0,r.kt)("p",null,"You can substitute launch variables using ",(0,r.kt)("inlineCode",{parentName:"p"},"{{.VAR}}")," in strings anywhere in the ",(0,r.kt)("inlineCode",{parentName:"p"},"commands"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"environment")," or ",(0,r.kt)("inlineCode",{parentName:"p"},"ready_output")," nodes of the yaml definition file.\nAll environment variables when ",(0,r.kt)("inlineCode",{parentName:"p"},"launch")," is started are defined as launch variables.\nNew environment variables set in the definition file also define launch variables.\nAnd launch defines some ",(0,r.kt)("a",{parentName:"p",href:"#special-variables"},"special variables")," internally also."),(0,r.kt)("p",null,'In the concerned strings, the double open curly brackets ("',(0,r.kt)("inlineCode",{parentName:"p"},"{{"),'") delimit the start of a variable to be substituted, therefore to include a literal double open brackets in a string, you have to surround them with backticks inside substitution brackets: ',(0,r.kt)("inlineCode",{parentName:"p"},"{{`{{`}}"),"."),(0,r.kt)("p",null,"Undefined values will be replaced with ",(0,r.kt)("inlineCode",{parentName:"p"},"<no value>"),"."),(0,r.kt)("p",null,"E.g.:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-console"},"$ export OWNER=Elvis\n$ cogment launch ./launch.yaml\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},'scripts:\n say_hi:\n environment:\n Type: "How"\n Question: "{{.Type}} are you?"\n commands:\n - ["echo", "Hello, {{.OWNER}}. {{.Question}}"] # echo "Hello, Elvis. How are you?"\n - ["echo", "{{`{{`}} brackets }}"] # echo "{{ brackets }}"\n - ["echo", "no val: {{.MADE_UP_VARIABLE}}"] # echo "no val: <no value>"\n ready_output: "Hello, {{.OWNER}}.*"\n')),(0,r.kt)("h4",{id:"special-variables"},"Special Variables"),(0,r.kt)("p",null,"The launch program will also define variables that can be used in substitutions.\nThese internally defined variables start with a double underscore (",(0,r.kt)("inlineCode",{parentName:"p"},"__"),")."),(0,r.kt)("p",null,"Environment variables with conflicting names will be replaced by these internal launch variables.\nNote that this only affects variable substitution, not the environment of the command execution.\nAnd internal launch variables are not available as environment variables."),(0,r.kt)("h5",{id:"arguments-cogment--215"},"Arguments ",(0,r.kt)("em",{parentName:"h5"},"(Cogment >= 2.15)")),(0,r.kt)("p",null,"The arguments from the command line of launch define variables and can thus be substituted.\nE.g. ",(0,r.kt)("inlineCode",{parentName:"p"},"cogment launch ./launch.yaml arg1 arg2 arg3")," will define ",(0,r.kt)("inlineCode",{parentName:"p"},"__1"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"__2")," and ",(0,r.kt)("inlineCode",{parentName:"p"},"__3")," respectively corresponding to ",(0,r.kt)("inlineCode",{parentName:"p"},"arg1"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"arg2")," and ",(0,r.kt)("inlineCode",{parentName:"p"},"arg3"),".\nThey can then be substituted with ",(0,r.kt)("inlineCode",{parentName:"p"},"{{.__1}}"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"{{.__2}}"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"{{.__3}}"),"."),(0,r.kt)("p",null,(0,r.kt)("inlineCode",{parentName:"p"},"__1")," to ",(0,r.kt)("inlineCode",{parentName:"p"},"__9")," are always defined, but will be empty if no corresponding argument was given on the command line.\nArguments 10 (",(0,r.kt)("inlineCode",{parentName:"p"},"__10"),") and above will only be defined if they were provided on the command line."),(0,r.kt)("p",null,"E.g.:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-console"},"$ cogment launch -q ./launch.yaml 42 foo\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},'scripts:\n args_out:\n commands:\n - ["echo", "args:", "{{.__1}}", "{{.__2}}", "{{.__3}}"] # echo "args:" "42" "foo" ""\n - ["echo", "empty: >{{.__3}}< >{{.__6}}<"] # echo "empty: >< ><"\n - ["echo", "no args: {{.__10}} {{.__42}}"] # echo "no args: <no value> <no value>"\n ready_output: ".* {{.__2}} $"\n')),(0,r.kt)("h6",{id:"all-arguments-cogment--217"},"All Arguments ",(0,r.kt)("em",{parentName:"h6"},"(Cogment >= 2.17)")),(0,r.kt)("p",null,"The number of arguments on the command line of launch is defined in ",(0,r.kt)("inlineCode",{parentName:"p"},"__NB_ARGS"),".\nAnd all the launch arguments can be added to a script command with ",(0,r.kt)("inlineCode",{parentName:"p"},"__ALL_ARGS"),"."),(0,r.kt)("p",null,"The ",(0,r.kt)("inlineCode",{parentName:"p"},"__ALL_ARGS")," variable is special in terms of substitution; if the command argument string is exactly ",(0,r.kt)("inlineCode",{parentName:"p"},"{{.__ALL_ARGS}}"),", then all launch arguments will be added to this command. Otherwise if it is only ",(0,r.kt)("em",{parentName:"p"},"part")," of a string, it will substitute a string containing all launch arguments."),(0,r.kt)("p",null,'In other words, a command argument "{{.',(0,r.kt)("strong",{parentName:"p"},'ALL_ARGS}}" will expand to multiple arguments for the command, whereas something like "--{{.'),'ALL_ARGS}}" will stay as one argument (a string that contains all launch arguments preceded by "--").'),(0,r.kt)("p",null,"E.g.:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-console"},"$ cogment launch ./launch.yaml 42 foo extra\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},'scripts:\n args_out:\n commands:\n - ["echo", "nb of args: {{.__NB_ARGS}}]"] # echo "nb of args: 3"\n - ["echo", "all:", "{{.__ALL_ARGS}}", "and more"] # echo "all:" "42" "foo" "extra" "and more"\n - ["echo", "all:", "args: {{.__ALL_ARGS}}"] # echo "all:" "args: 42 foo extra"\n ready_output: "args:.*{{.__2}}"\n')),(0,r.kt)("h3",{id:"file-example"},"File Example"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},'global:\n environment:\n RUN_NAME: "COGRUN-{{.HOSTNAME}}-{{.__1}}"\n COGMENT_LOG_LEVEL: info\n DIR_PORT: 9010\n COGMENT_DIRECTORY_ENDPOINT: "grpc://server:{{.DIR_PORT}}"\n folder: /app\n\nscripts:\n prep:\n commands:\n - ["./importdata.sh"]\n - ["./cudasetup.sh"]\n - ["sleep", "infinity"] # To prevent process from ending\n ready_output: "^Done"\n directory:\n quiet: true\n folder: ./cogment\n environment:\n COGMENT_DIRECTORY_PORT: "{{.DIR_PORT}}"\n depends_on:\n - prep\n commands:\n - ["cogment", "services", "directory"]\n ready_output: \'Listening \\[port:[0-9]*\\]\' # To match "Listening [port:9010]"\n orchestrator:\n folder: ./cogment\n environment:\n COGMENT_ORCHESTRATOR_ACTOR_PORT: 0\n COGMENT_LIFECYCLE_PORT: 0\n depends_on:\n - directory\n commands:\n - ["cogment", "services", "orchestrator"]\n runner:\n folder: ./pycode\n depends_on:\n - directory\n - orchestrator\n commands:\n - [\n "python3",\n "runner.py",\n "-u {{.USER}}",\n "-n {{.RUN_NAME}}",\n "{{.__2}}",\n ]\n report:\n commands:\n - ["reporting_service"]\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/92a77eef.3834a1d4.js b/assets/js/92a77eef.3834a1d4.js deleted file mode 100644 index 7b8eb8d..0000000 --- a/assets/js/92a77eef.3834a1d4.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[5505],{3905:(e,t,a)=>{a.d(t,{Zo:()=>m,kt:()=>h});var n=a(7294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function o(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?i(Object(a),!0).forEach((function(t){r(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):i(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function l(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)a=i[n],t.indexOf(a)>=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var s=n.createContext({}),p=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):o(o({},t),e)),a},m=function(e){var t=p(e.components);return n.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},c=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,i=e.originalType,s=e.parentName,m=l(e,["components","mdxType","originalType","parentName"]),c=p(a),h=r,u=c["".concat(s,".").concat(h)]||c[h]||d[h]||i;return a?n.createElement(u,o(o({ref:t},m),{},{components:a})):n.createElement(u,o({ref:t},m))}));function h(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=a.length,o=new Array(i);o[0]=c;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l.mdxType="string"==typeof e?e:r,o[1]=l;for(var p=2;p<i;p++)o[p]=a[p];return n.createElement.apply(null,o)}return n.createElement.apply(null,a)}c.displayName="MDXCreateElement"},9214:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>d,frontMatter:()=>i,metadata:()=>l,toc:()=>p});var n=a(7462),r=(a(7294),a(3905));const i={sidebar_position:8},o="Cogment 2.0",l={unversionedId:"reference/cogment-v2-changes",id:"reference/cogment-v2-changes",title:"Cogment 2.0",description:"This document describes the full list of the changes for Cogment 2.O. A migration guide is available here.",source:"@site/docs/reference/cogment-v2-changes.md",sourceDirName:"reference",slug:"/reference/cogment-v2-changes",permalink:"/docs/reference/cogment-v2-changes",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:8,frontMatter:{sidebar_position:8},sidebar:"docSidebar",previous:{title:"gRPC API",permalink:"/docs/reference/grpc"},next:{title:"Apache License",permalink:"/docs/license"}},s={},p=[{value:"Breaking changes",id:"breaking-changes",level:2},{value:"Cogment.yaml",id:"cogmentyaml",level:3},{value:"Python SDK",id:"python-sdk",level:3},{value:"Javascript SDK",id:"javascript-sdk",level:3},{value:"Datalog sample",id:"datalog-sample",level:3},{value:"Orchestrator",id:"orchestrator",level:3},{value:"Deprecated Behaviors",id:"deprecated-behaviors",level:2},{value:"Cogment.yaml",id:"cogmentyaml-1",level:3},{value:"Orchestrator",id:"orchestrator-1",level:3},{value:"Python SDK",id:"python-sdk-1",level:3},{value:"New Functionalities",id:"new-functionalities",level:2},{value:"Parameters",id:"parameters",level:3},{value:"Python SDK",id:"python-sdk-2",level:3}],m={toc:p};function d(e){let{components:t,...a}=e;return(0,r.kt)("wrapper",(0,n.Z)({},m,a,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"cogment-20"},"Cogment 2.0"),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"This document describes the full list of the changes for Cogment 2.O. A migration guide is available ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/implementation-recipes/v2-migration-guide"},"here"),".")),(0,r.kt)("p",null,"Cogment 2.0 is a massive internal change to Cogment, starting with the underlying gRPC API that has seen a major refactoring. But there is a minimal amount of changes that affect the use of cogment. The changes that affect users are in three categories: breaking changes, deprecated behavior and new functionalities."),(0,r.kt)("h2",{id:"breaking-changes"},"Breaking changes"),(0,r.kt)("p",null,"These are changes that, if the related features were used, will prevent Cogment v1 projects from working with Cogment v2. They represent the minimum changes necessary to upgrade to v2."),(0,r.kt)("h3",{id:"cogmentyaml"},"Cogment.yaml"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Delta types of observations (and all related settings) are not supported anymore. This means that in cogment.yaml, these sections are now ignored:",(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"import::python")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"import::javascript")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"actor_classes::observation::delta")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"actor_classes::observation::delta_apply_fn")))),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"config")," (for trial, environment and actor) are not accepted in the parameters section anymore.")),(0,r.kt)("h3",{id:"python-sdk"},"Python SDK"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"Session.get_active_actors()")," method has been restricted to the environment only. This means that actors cannot call this method anymore (it will raise an exception). If actors need the full list of actors, there are a few possibilities:",(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},"Create a controller in the actor implementation and use the ",(0,r.kt)("inlineCode",{parentName:"li"},"Controller.get_actors()")," method."),(0,r.kt)("li",{parentName:"ul"},"Receive the actor list in the config from the pre-trial hooks; the pre-trial hooks have implicit knowledge of all actors (at least the last hook)."),(0,r.kt)("li",{parentName:"ul"},"Add the information in the actors observation space."),(0,r.kt)("li",{parentName:"ul"},"Send the information in a message."))),(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"EnvironmentSession.send_message()")," method will not accept a ",(0,r.kt)("inlineCode",{parentName:"li"},"to_environment")," parameter anymore (since it does not make sense anyway)."),(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"Controller.terminate_trial()")," method parameter ",(0,r.kt)("inlineCode",{parentName:"li"},"trial_id")," has been renamed ",(0,r.kt)("inlineCode",{parentName:"li"},"trial_ids"),"."),(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"Controller.get_trial_info()")," method parameter ",(0,r.kt)("inlineCode",{parentName:"li"},"trial_id")," has been renamed ",(0,r.kt)("inlineCode",{parentName:"li"},"trial_ids"),".")),(0,r.kt)("h3",{id:"javascript-sdk"},"Javascript SDK"),(0,r.kt)("p",null,"Except for the following, everything has been subject to breaking changes:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The shape of the observation object has remained the same"),(0,r.kt)("li",{parentName:"ul"},"You can keep the actor function that you have in your v1 project")),(0,r.kt)("p",null,"Please refer to the new ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/javascript"},"Javascript API Reference")),(0,r.kt)("h3",{id:"datalog-sample"},"Datalog sample"),(0,r.kt)("p",null,"Since the Datalog samples, unlike everything else in the SDK, used the raw API protobuf, it has implicitly changed. But in v2, there is now a wrapper for it, which replaces direct access to the protobuf content."),(0,r.kt)("p",null,"If people still have serialized v1 data stored (e.g. in a database), v1 versions of the sample protobuf messages (",(0,r.kt)("inlineCode",{parentName:"p"},"DatalogSample_v1"),") are provided in the API for convenience, so users can deserialize the data into v1 samples and extract the information."),(0,r.kt)("p",null,"For more info, visit the ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/grpc#LogExporterSampleRequest"},"gRPC api")," documentation"),(0,r.kt)("h3",{id:"orchestrator"},"Orchestrator"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The environment variables read by the Orchestrator on start have changed names to help prevent clashes.",(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"TRIAL_LIFECYCLE_PORT")," becomes ",(0,r.kt)("inlineCode",{parentName:"li"},"COGMENT_LIFECYCLE_PORT")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"TRIAL_ACTOR_PORT")," becomes ",(0,r.kt)("inlineCode",{parentName:"li"},"COGMENT_ACTOR_PORT")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"PROMETHEUS_PORT")," becomes ",(0,r.kt)("inlineCode",{parentName:"li"},"COGMENT_ORCHESTRATOR_PROMETHEUS_PORT")))),(0,r.kt)("li",{parentName:"ul"},"The Orchestrator does not search for the file named ",(0,r.kt)("inlineCode",{parentName:"li"},"cogment.yaml")," as the default spec file anymore. The spec file name must be explicit on the command line using ",(0,r.kt)("inlineCode",{parentName:"li"},"--config=cogment.yaml"),"."),(0,r.kt)("li",{parentName:"ul"},"For further information, refer to the ",(0,r.kt)("a",{parentName:"li",href:"/docs/reference/cli/orchestrator"},"Orchestrator documentation"),".")),(0,r.kt)("h2",{id:"deprecated-behaviors"},"Deprecated Behaviors"),(0,r.kt)("p",null,"These are changes that are optional to upgrade to Cogment v2, but will eventually be phased out and become breaking changes in a future version. If these features are used with Cogment v2, warnings will be issued."),(0,r.kt)("h3",{id:"cogmentyaml-1"},"Cogment.yaml"),(0,r.kt)("p",null,"The spec file is not used by the Orchestrator anymore, and when used by the other components, these sections of the file will be ignored:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"trial_params")," section is not needed anymore (since the Orchestrator has its own parameters file)"),(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"datalog")," section is deprecated (the details of the datalog have been moved to the Orchestrator parameters file)"),(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"trial:pre-hooks")," section is deprecated (these values are now passed to the Orchestrator on the command line)")),(0,r.kt)("p",null,"For more information, visit the ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/cogment-yaml"},"Cogment.yaml documentation"),"."),(0,r.kt)("h3",{id:"orchestrator-1"},"Orchestrator"),(0,r.kt)("p",null,"Providing a spec file (cogment.yaml) to the Orchestrator is deprecated. The new behavior is as follows:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Provide a YAML default parameters file (command line option ",(0,r.kt)("inlineCode",{parentName:"li"},"--params"),") with the top level section ",(0,r.kt)("inlineCode",{parentName:"li"},"trial_params"),"."),(0,r.kt)("li",{parentName:"ul"},"Add the datalog section to the parameters (if desired), without type (for type ",(0,r.kt)("inlineCode",{parentName:"li"},"none")," just omit the datalog section). I.e. Whereas the spec file was defining a single data logger for all trials, the new Orchestrator can have a different data logger for each trial, and thus a datalog section is now found in the trial default parameters. Example of the new parameters datalog section:")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},"trial_params:\n datalog:\n - endpoint: grpc://logger:9000\n - exclude_fields: [messages, actions]\n")),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The endpoint for a client actor in the parameters must now be ",(0,r.kt)("inlineCode",{parentName:"li"},"cogment://client")," instead of just ",(0,r.kt)("inlineCode",{parentName:"li"},"client"),". E.g.:")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},"trial_params:\n actors:\n - endpoint: cogment://client\n")),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Pre-trial hooks are defined on the command line (or environment variable) as opposed to being found in the spec file.")),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"The Cogment Orchestrator and the generate tools ignore the sections of the YAML files that are not relevant to them, therefore the content of the spec and parameters files can be combined in a single file safely.")),(0,r.kt)("p",null,"The Orchestrator needs a parameters file or pre-trial hooks (or both). Thus with pre-trial hooks and no parameters file (or a carefully defined parameters file) the Orchestrator is now independent of any trial specifications (spec file) and can run any type of trial. With a fully defined parameters file and no hooks, the Orchestrator can work as before for simple projects."),(0,r.kt)("h3",{id:"python-sdk-1"},"Python SDK"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#send_messageself-payload-to"},(0,r.kt)("inlineCode",{parentName:"a"},"ActorSession.send_message()"))," method should not use the ",(0,r.kt)("inlineCode",{parentName:"li"},"to_environment"),' parameter anymore. The environment is targeted using its name (defaulted to "env" if not given specifically, or ',(0,r.kt)("inlineCode",{parentName:"li"},"ActorSession.env_name"),")."),(0,r.kt)("li",{parentName:"ul"},"The joining of a trial by a client actor (",(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#async-join_trialself-trial_id-endpoint-impl_namenone-actor_namenone-actor_classnone"},(0,r.kt)("inlineCode",{parentName:"a"},"Context.join_trial()")),") should now be made by providing an actor name or class (unlike previously where an implementation name was provided). This is to allow the pre-trial hooks to decide on the details of the actor (including implementation) that should be used, the same way as for service actors."),(0,r.kt)("li",{parentName:"ul"},"In ",(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#class-recvobservation"},(0,r.kt)("inlineCode",{parentName:"a"},"RecvObservation")),", the ",(0,r.kt)("inlineCode",{parentName:"li"},"snapshot")," attribute is deprecated. A new attribute ",(0,r.kt)("inlineCode",{parentName:"li"},"observation")," takes its place."),(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#terminate_trialself-trial_ids-hardfalse"},(0,r.kt)("inlineCode",{parentName:"a"},"Controller.terminate_trial()"))," method parameter ",(0,r.kt)("inlineCode",{parentName:"li"},"trial_ids")," now takes a list of IDs (instead of a single string for one ID)."),(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#async-get_trial_infoself-trial_ids"},(0,r.kt)("inlineCode",{parentName:"a"},"Controller.get_trial_info()"))," method parameter ",(0,r.kt)("inlineCode",{parentName:"li"},"trial_ids")," now takes a list of IDs (instead of a single string for one ID or ",(0,r.kt)("inlineCode",{parentName:"li"},"None"),")."),(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"url")," attribute of ",(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#class-cogmentendpoint"},(0,r.kt)("inlineCode",{parentName:"a"},"cogment.Endpoint"))," must now be a gRPC type URL (i.e. start with ",(0,r.kt)("inlineCode",{parentName:"li"},"grpc://"),"). ",(0,r.kt)("inlineCode",{parentName:"li"},"Endpoint")," is used to join a trial and to get a Controller.")),(0,r.kt)("h2",{id:"new-functionalities"},"New Functionalities"),(0,r.kt)("p",null,"These are changes that are additional and transparent to a v1 project."),(0,r.kt)("h3",{id:"parameters"},"Parameters"),(0,r.kt)("p",null,"These are the parameters defined in the new file given to the Orchestrator, and that can be changed by pre-trial hooks."),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The environment can be given a ",(0,r.kt)("inlineCode",{parentName:"li"},"name"),', similarly to the actors. If not given, it defaults to "env".')),(0,r.kt)("h3",{id:"python-sdk-2"},"Python SDK"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"When starting a trial (",(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#async-start_trialself-trial_confignone-trial_id_requestednone"},(0,r.kt)("inlineCode",{parentName:"a"},"Controller.start_trial()")),"), a new ",(0,r.kt)("inlineCode",{parentName:"li"},"trial_id_requested"),' parameter requests the trial ID to be a specific string instead of an automatic UUID. It is a "request" because the trial will not start if the id conflicts with another active trial; an empty ID string will be returned if the trial is not started.'),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#terminate_trialself-trial_ids-hardfalse"},(0,r.kt)("inlineCode",{parentName:"a"},"Controller.terminate_trial()"))," method has a new parameter ",(0,r.kt)("inlineCode",{parentName:"li"},"hard"),'. This parameter forces a hard/immediate termination of the trial. As opposed to a "soft" termination which will wait for the next tick to terminate nicely.'),(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"ActorSession")," and ",(0,r.kt)("inlineCode",{parentName:"li"},"EnvironmentSession")," have a new method ",(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#sending_doneself"},(0,r.kt)("inlineCode",{parentName:"a"},"sending_done()"))," to indicate that they have finished sending data and will now only be listening until the end of the trial. This is required only if the new ",(0,r.kt)("inlineCode",{parentName:"li"},"auto_done_sending")," parameter of the ",(0,r.kt)("inlineCode",{parentName:"li"},"start()")," method is ",(0,r.kt)("inlineCode",{parentName:"li"},"False")," (It is ",(0,r.kt)("inlineCode",{parentName:"li"},"True")," by default for backward compatibility). This only needs to be manually done (i.e. ",(0,r.kt)("inlineCode",{parentName:"li"},"auto_done_sending=False"),") in special situations."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#get_user_idself"},(0,r.kt)("inlineCode",{parentName:"a"},"PrehookSession.get_user_id()"))," new method."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#class-prehooksession"},(0,r.kt)("inlineCode",{parentName:"a"},"PrehookSession.environment_name"))," new attribute."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#class-datalogsession"},(0,r.kt)("inlineCode",{parentName:"a"},"DatalogSession.user_id"))," new attribute (this info used to be available in the protobuf ",(0,r.kt)("inlineCode",{parentName:"li"},"DatalogSample"),")."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#class-recvaction"},(0,r.kt)("inlineCode",{parentName:"a"},"RecvAction.tick_id"))," new attribute.")))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/92a77eef.a4d602b3.js b/assets/js/92a77eef.a4d602b3.js new file mode 100644 index 0000000..c639c10 --- /dev/null +++ b/assets/js/92a77eef.a4d602b3.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[5505],{3905:(e,t,a)=>{a.d(t,{Zo:()=>p,kt:()=>u});var n=a(7294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function o(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?i(Object(a),!0).forEach((function(t){r(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):i(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function l(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)a=i[n],t.indexOf(a)>=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var s=n.createContext({}),m=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):o(o({},t),e)),a},p=function(e){var t=m(e.components);return n.createElement(s.Provider,{value:t},e.children)},d="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},h=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,i=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),d=m(a),h=r,u=d["".concat(s,".").concat(h)]||d[h]||c[h]||i;return a?n.createElement(u,o(o({ref:t},p),{},{components:a})):n.createElement(u,o({ref:t},p))}));function u(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=a.length,o=new Array(i);o[0]=h;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[d]="string"==typeof e?e:r,o[1]=l;for(var m=2;m<i;m++)o[m]=a[m];return n.createElement.apply(null,o)}return n.createElement.apply(null,a)}h.displayName="MDXCreateElement"},9214:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>c,frontMatter:()=>i,metadata:()=>l,toc:()=>m});var n=a(7462),r=(a(7294),a(3905));const i={sidebar_position:9},o="Cogment 2.0",l={unversionedId:"reference/cogment-v2-changes",id:"reference/cogment-v2-changes",title:"Cogment 2.0",description:"This document describes the full list of the changes for Cogment 2.O. A migration guide is available here.",source:"@site/docs/reference/cogment-v2-changes.md",sourceDirName:"reference",slug:"/reference/cogment-v2-changes",permalink:"/docs/reference/cogment-v2-changes",draft:!1,tags:[],version:"current",lastUpdatedAt:1701726431,formattedLastUpdatedAt:"Dec 4, 2023",sidebarPosition:9,frontMatter:{sidebar_position:9},sidebar:"docSidebar",previous:{title:"gRPC API",permalink:"/docs/reference/grpc"},next:{title:"Apache License",permalink:"/docs/license"}},s={},m=[{value:"Breaking changes",id:"breaking-changes",level:2},{value:"Cogment.yaml",id:"cogmentyaml",level:3},{value:"Python SDK",id:"python-sdk",level:3},{value:"Javascript SDK",id:"javascript-sdk",level:3},{value:"Datalog sample",id:"datalog-sample",level:3},{value:"Orchestrator",id:"orchestrator",level:3},{value:"Deprecated Behaviors",id:"deprecated-behaviors",level:2},{value:"Cogment.yaml",id:"cogmentyaml-1",level:3},{value:"Orchestrator",id:"orchestrator-1",level:3},{value:"Python SDK",id:"python-sdk-1",level:3},{value:"New Functionalities",id:"new-functionalities",level:2},{value:"Parameters",id:"parameters",level:3},{value:"Python SDK",id:"python-sdk-2",level:3}],p={toc:m},d="wrapper";function c(e){let{components:t,...a}=e;return(0,r.kt)(d,(0,n.Z)({},p,a,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"cogment-20"},"Cogment 2.0"),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"This document describes the full list of the changes for Cogment 2.O. A migration guide is available ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/implementation-recipes/v2-migration-guide"},"here"),".")),(0,r.kt)("p",null,"Cogment 2.0 is a massive internal change to Cogment, starting with the underlying gRPC API that has seen a major refactoring. But there is a minimal amount of changes that affect the use of cogment. The changes that affect users are in three categories: breaking changes, deprecated behavior and new functionalities."),(0,r.kt)("h2",{id:"breaking-changes"},"Breaking changes"),(0,r.kt)("p",null,"These are changes that, if the related features were used, will prevent Cogment v1 projects from working with Cogment v2. They represent the minimum changes necessary to upgrade to v2."),(0,r.kt)("h3",{id:"cogmentyaml"},"Cogment.yaml"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Delta types of observations (and all related settings) are not supported anymore. This means that in cogment.yaml, these sections are now ignored:",(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"import::python")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"import::javascript")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"actor_classes::observation::delta")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"actor_classes::observation::delta_apply_fn")))),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"config")," (for trial, environment and actor) are not accepted in the parameters section anymore.")),(0,r.kt)("h3",{id:"python-sdk"},"Python SDK"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"Session.get_active_actors()")," method has been restricted to the environment only. This means that actors cannot call this method anymore (it will raise an exception). If actors need the full list of actors, there are a few possibilities:",(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},"Create a controller in the actor implementation and use the ",(0,r.kt)("inlineCode",{parentName:"li"},"Controller.get_actors()")," method."),(0,r.kt)("li",{parentName:"ul"},"Receive the actor list in the config from the pre-trial hooks; the pre-trial hooks have implicit knowledge of all actors (at least the last hook)."),(0,r.kt)("li",{parentName:"ul"},"Add the information in the actors observation space."),(0,r.kt)("li",{parentName:"ul"},"Send the information in a message."))),(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"EnvironmentSession.send_message()")," method will not accept a ",(0,r.kt)("inlineCode",{parentName:"li"},"to_environment")," parameter anymore (since it does not make sense anyway)."),(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"Controller.terminate_trial()")," method parameter ",(0,r.kt)("inlineCode",{parentName:"li"},"trial_id")," has been renamed ",(0,r.kt)("inlineCode",{parentName:"li"},"trial_ids"),"."),(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"Controller.get_trial_info()")," method parameter ",(0,r.kt)("inlineCode",{parentName:"li"},"trial_id")," has been renamed ",(0,r.kt)("inlineCode",{parentName:"li"},"trial_ids"),".")),(0,r.kt)("h3",{id:"javascript-sdk"},"Javascript SDK"),(0,r.kt)("p",null,"Except for the following, everything has been subject to breaking changes:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The shape of the observation object has remained the same"),(0,r.kt)("li",{parentName:"ul"},"You can keep the actor function that you have in your v1 project")),(0,r.kt)("p",null,"Please refer to the new ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/javascript"},"Javascript API Reference")),(0,r.kt)("h3",{id:"datalog-sample"},"Datalog sample"),(0,r.kt)("p",null,"Since the Datalog samples, unlike everything else in the SDK, used the raw API protobuf, it has implicitly changed. But in v2, there is now a wrapper for it, which replaces direct access to the protobuf content."),(0,r.kt)("p",null,"If people still have serialized v1 data stored (e.g. in a database), v1 versions of the sample protobuf messages (",(0,r.kt)("inlineCode",{parentName:"p"},"DatalogSample_v1"),") are provided in the API for convenience, so users can deserialize the data into v1 samples and extract the information."),(0,r.kt)("p",null,"For more info, visit the ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/grpc#LogExporterSampleRequest"},"gRPC api")," documentation"),(0,r.kt)("h3",{id:"orchestrator"},"Orchestrator"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The environment variables read by the Orchestrator on start have changed names to help prevent clashes.",(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"TRIAL_LIFECYCLE_PORT")," becomes ",(0,r.kt)("inlineCode",{parentName:"li"},"COGMENT_LIFECYCLE_PORT")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"TRIAL_ACTOR_PORT")," becomes ",(0,r.kt)("inlineCode",{parentName:"li"},"COGMENT_ACTOR_PORT")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"PROMETHEUS_PORT")," becomes ",(0,r.kt)("inlineCode",{parentName:"li"},"COGMENT_ORCHESTRATOR_PROMETHEUS_PORT")))),(0,r.kt)("li",{parentName:"ul"},"The Orchestrator does not search for the file named ",(0,r.kt)("inlineCode",{parentName:"li"},"cogment.yaml")," as the default spec file anymore. The spec file name must be explicit on the command line using ",(0,r.kt)("inlineCode",{parentName:"li"},"--config=cogment.yaml"),"."),(0,r.kt)("li",{parentName:"ul"},"For further information, refer to the ",(0,r.kt)("a",{parentName:"li",href:"/docs/reference/cli/orchestrator"},"Orchestrator documentation"),".")),(0,r.kt)("h2",{id:"deprecated-behaviors"},"Deprecated Behaviors"),(0,r.kt)("p",null,"These are changes that are optional to upgrade to Cogment v2, but will eventually be phased out and become breaking changes in a future version. If these features are used with Cogment v2, warnings will be issued."),(0,r.kt)("h3",{id:"cogmentyaml-1"},"Cogment.yaml"),(0,r.kt)("p",null,"The spec file is not used by the Orchestrator anymore, and when used by the other components, these sections of the file will be ignored:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"trial_params")," section is not needed anymore (since the Orchestrator has its own parameters file)"),(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"datalog")," section is deprecated (the details of the datalog have been moved to the Orchestrator parameters file)"),(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"trial:pre-hooks")," section is deprecated (these values are now passed to the Orchestrator on the command line)")),(0,r.kt)("p",null,"For more information, visit the ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/cogment-yaml"},"Cogment.yaml documentation"),"."),(0,r.kt)("h3",{id:"orchestrator-1"},"Orchestrator"),(0,r.kt)("p",null,"Providing a spec file (cogment.yaml) to the Orchestrator is deprecated. The new behavior is as follows:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Provide a YAML default parameters file (command line option ",(0,r.kt)("inlineCode",{parentName:"li"},"--params"),") with the top level section ",(0,r.kt)("inlineCode",{parentName:"li"},"trial_params"),"."),(0,r.kt)("li",{parentName:"ul"},"Add the datalog section to the parameters (if desired), without type (for type ",(0,r.kt)("inlineCode",{parentName:"li"},"none")," just omit the datalog section). I.e. Whereas the spec file was defining a single data logger for all trials, the new Orchestrator can have a different data logger for each trial, and thus a datalog section is now found in the trial default parameters. Example of the new parameters datalog section:")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},"trial_params:\n datalog:\n - endpoint: grpc://logger:9000\n - exclude_fields: [messages, actions]\n")),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The endpoint for a client actor in the parameters must now be ",(0,r.kt)("inlineCode",{parentName:"li"},"cogment://client")," instead of just ",(0,r.kt)("inlineCode",{parentName:"li"},"client"),". E.g.:")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},"trial_params:\n actors:\n - endpoint: cogment://client\n")),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Pre-trial hooks are defined on the command line (or environment variable) as opposed to being found in the spec file.")),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"The Cogment Orchestrator and the generate tools ignore the sections of the YAML files that are not relevant to them, therefore the content of the spec and parameters files can be combined in a single file safely.")),(0,r.kt)("p",null,"The Orchestrator needs a parameters file or pre-trial hooks (or both). Thus with pre-trial hooks and no parameters file (or a carefully defined parameters file) the Orchestrator is now independent of any trial specifications (spec file) and can run any type of trial. With a fully defined parameters file and no hooks, the Orchestrator can work as before for simple projects."),(0,r.kt)("h3",{id:"python-sdk-1"},"Python SDK"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#send_messageself-payload-to"},(0,r.kt)("inlineCode",{parentName:"a"},"ActorSession.send_message()"))," method should not use the ",(0,r.kt)("inlineCode",{parentName:"li"},"to_environment"),' parameter anymore. The environment is targeted using its name (defaulted to "env" if not given specifically, or ',(0,r.kt)("inlineCode",{parentName:"li"},"ActorSession.env_name"),")."),(0,r.kt)("li",{parentName:"ul"},"The joining of a trial by a client actor (",(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#async-join_trialself-trial_id-endpoint-impl_namenone-actor_namenone-actor_classnone"},(0,r.kt)("inlineCode",{parentName:"a"},"Context.join_trial()")),") should now be made by providing an actor name or class (unlike previously where an implementation name was provided). This is to allow the pre-trial hooks to decide on the details of the actor (including implementation) that should be used, the same way as for service actors."),(0,r.kt)("li",{parentName:"ul"},"In ",(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#class-recvobservation"},(0,r.kt)("inlineCode",{parentName:"a"},"RecvObservation")),", the ",(0,r.kt)("inlineCode",{parentName:"li"},"snapshot")," attribute is deprecated. A new attribute ",(0,r.kt)("inlineCode",{parentName:"li"},"observation")," takes its place."),(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#terminate_trialself-trial_ids-hardfalse"},(0,r.kt)("inlineCode",{parentName:"a"},"Controller.terminate_trial()"))," method parameter ",(0,r.kt)("inlineCode",{parentName:"li"},"trial_ids")," now takes a list of IDs (instead of a single string for one ID)."),(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#async-get_trial_infoself-trial_ids"},(0,r.kt)("inlineCode",{parentName:"a"},"Controller.get_trial_info()"))," method parameter ",(0,r.kt)("inlineCode",{parentName:"li"},"trial_ids")," now takes a list of IDs (instead of a single string for one ID or ",(0,r.kt)("inlineCode",{parentName:"li"},"None"),")."),(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"url")," attribute of ",(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#class-cogmentendpoint"},(0,r.kt)("inlineCode",{parentName:"a"},"cogment.Endpoint"))," must now be a gRPC type URL (i.e. start with ",(0,r.kt)("inlineCode",{parentName:"li"},"grpc://"),"). ",(0,r.kt)("inlineCode",{parentName:"li"},"Endpoint")," is used to join a trial and to get a Controller.")),(0,r.kt)("h2",{id:"new-functionalities"},"New Functionalities"),(0,r.kt)("p",null,"These are changes that are additional and transparent to a v1 project."),(0,r.kt)("h3",{id:"parameters"},"Parameters"),(0,r.kt)("p",null,"These are the parameters defined in the new file given to the Orchestrator, and that can be changed by pre-trial hooks."),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The environment can be given a ",(0,r.kt)("inlineCode",{parentName:"li"},"name"),', similarly to the actors. If not given, it defaults to "env".')),(0,r.kt)("h3",{id:"python-sdk-2"},"Python SDK"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"When starting a trial (",(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#async-start_trialself-trial_confignone-trial_id_requestednone"},(0,r.kt)("inlineCode",{parentName:"a"},"Controller.start_trial()")),"), a new ",(0,r.kt)("inlineCode",{parentName:"li"},"trial_id_requested"),' parameter requests the trial ID to be a specific string instead of an automatic UUID. It is a "request" because the trial will not start if the id conflicts with another active trial; an empty ID string will be returned if the trial is not started.'),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#terminate_trialself-trial_ids-hardfalse"},(0,r.kt)("inlineCode",{parentName:"a"},"Controller.terminate_trial()"))," method has a new parameter ",(0,r.kt)("inlineCode",{parentName:"li"},"hard"),'. This parameter forces a hard/immediate termination of the trial. As opposed to a "soft" termination which will wait for the next tick to terminate nicely.'),(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"ActorSession")," and ",(0,r.kt)("inlineCode",{parentName:"li"},"EnvironmentSession")," have a new method ",(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#sending_doneself"},(0,r.kt)("inlineCode",{parentName:"a"},"sending_done()"))," to indicate that they have finished sending data and will now only be listening until the end of the trial. This is required only if the new ",(0,r.kt)("inlineCode",{parentName:"li"},"auto_done_sending")," parameter of the ",(0,r.kt)("inlineCode",{parentName:"li"},"start()")," method is ",(0,r.kt)("inlineCode",{parentName:"li"},"False")," (It is ",(0,r.kt)("inlineCode",{parentName:"li"},"True")," by default for backward compatibility). This only needs to be manually done (i.e. ",(0,r.kt)("inlineCode",{parentName:"li"},"auto_done_sending=False"),") in special situations."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#get_user_idself"},(0,r.kt)("inlineCode",{parentName:"a"},"PrehookSession.get_user_id()"))," new method."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#class-prehooksession"},(0,r.kt)("inlineCode",{parentName:"a"},"PrehookSession.environment_name"))," new attribute."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#class-datalogsession"},(0,r.kt)("inlineCode",{parentName:"a"},"DatalogSession.user_id"))," new attribute (this info used to be available in the protobuf ",(0,r.kt)("inlineCode",{parentName:"li"},"DatalogSample"),")."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/reference/python#class-recvaction"},(0,r.kt)("inlineCode",{parentName:"a"},"RecvAction.tick_id"))," new attribute.")))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/935f2afb.09e8e1d7.js b/assets/js/935f2afb.09e8e1d7.js new file mode 100644 index 0000000..5e686c9 --- /dev/null +++ b/assets/js/935f2afb.09e8e1d7.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[53],{1109:e=>{e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"docSidebar":[{"type":"link","label":"Overview","href":"/docs/","docId":"index"},{"type":"link","label":"Community","href":"/docs/community-channels","docId":"community-channels"},{"type":"category","label":"Guide","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Core Concepts","href":"/docs/guide/core-concepts","docId":"guide/core-concepts"},{"type":"link","label":"Development guide","href":"/docs/guide/development-guide","docId":"guide/development-guide"},{"type":"category","label":"Implementation Recipes","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Configure Trial from Controller","href":"/docs/guide/implementation-recipes/configure-trial-from-controller","docId":"guide/implementation-recipes/configure-trial-from-controller"},{"type":"link","label":"Migrate from Cogment v1 to v2","href":"/docs/guide/implementation-recipes/v2-migration-guide","docId":"guide/implementation-recipes/v2-migration-guide"}],"href":"/docs/guide/implementation-recipes/"},{"type":"category","label":"Tutorial","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Step 1 - An Empty Cogment Application","href":"/docs/guide/tutorial/setup","docId":"guide/tutorial/setup"},{"type":"link","label":"Step 2 - Actors in Cogment","href":"/docs/guide/tutorial/actors-in-cogment","docId":"guide/tutorial/actors-in-cogment"},{"type":"link","label":"Step 3 - The Environment in Cogment","href":"/docs/guide/tutorial/environment-in-cogment","docId":"guide/tutorial/environment-in-cogment"},{"type":"link","label":"Step 4 - Making Decisions with Feedback","href":"/docs/guide/tutorial/decision-making","docId":"guide/tutorial/decision-making"},{"type":"category","label":"Advanced Tutorials","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Add a Human Player in the Loop","href":"/docs/guide/tutorial/advanced-tutorials/human-player","docId":"guide/tutorial/advanced-tutorials/human-player"},{"type":"link","label":"Add a Web Client for the Human Player","href":"/docs/guide/tutorial/advanced-tutorials/web-client","docId":"guide/tutorial/advanced-tutorials/web-client"},{"type":"link","label":"Improve Operational Efficiency with a Cogment Directory for Service Discovery","href":"/docs/guide/tutorial/advanced-tutorials/directory","docId":"guide/tutorial/advanced-tutorials/directory"}],"href":"/docs/guide/tutorial/advanced-tutorials/"}],"href":"/docs/guide/tutorial/"}]},{"type":"category","label":"Reference","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Specifications File","href":"/docs/reference/cogment-yaml","docId":"reference/cogment-yaml"},{"type":"link","label":"Trial Parameters","href":"/docs/reference/parameters","docId":"reference/parameters"},{"type":"category","label":"CLI","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Orchestrator","href":"/docs/reference/cli/orchestrator","docId":"reference/cli/orchestrator"},{"type":"category","label":"Directory","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Server","href":"/docs/reference/cli/directory/directory-server","docId":"reference/cli/directory/directory-server"},{"type":"link","label":"Client","href":"/docs/reference/cli/directory/directory-client","docId":"reference/cli/directory/directory-client"}]},{"type":"category","label":"Trial Datastore","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Server","href":"/docs/reference/cli/trial-datastore/trial-datastore-server","docId":"reference/cli/trial-datastore/trial-datastore-server"},{"type":"link","label":"Client","href":"/docs/reference/cli/trial-datastore/trial-datastore-client","docId":"reference/cli/trial-datastore/trial-datastore-client"}]},{"type":"link","label":"Model Registry","href":"/docs/reference/cli/model-registry","docId":"reference/cli/model-registry"},{"type":"link","label":"Web Proxy","href":"/docs/reference/cli/web-proxy","docId":"reference/cli/web-proxy"},{"type":"link","label":"Launch","href":"/docs/reference/cli/launch","docId":"reference/cli/launch"},{"type":"link","label":"Status","href":"/docs/reference/cli/status","docId":"reference/cli/status"}],"href":"/docs/reference/cli/"},{"type":"link","label":"Python SDK","href":"/docs/reference/python","docId":"reference/python"},{"type":"link","label":"Web Proxy API","href":"/docs/reference/web-proxy-api","docId":"reference/web-proxy-api"},{"type":"link","label":"Javascript SDK","href":"/docs/reference/javascript","docId":"reference/javascript"},{"type":"category","label":"Enterprise Python SDK","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Installation","href":"/docs/reference/python-enterprise/installation","docId":"reference/python-enterprise/installation"},{"type":"link","label":"Runner","href":"/docs/reference/python-enterprise/runner","docId":"reference/python-enterprise/runner"}]},{"type":"link","label":"gRPC API","href":"/docs/reference/grpc","docId":"reference/grpc"},{"type":"link","label":"Cogment 2.0","href":"/docs/reference/cogment-v2-changes","docId":"reference/cogment-v2-changes"}]},{"type":"link","label":"Apache License","href":"/docs/license","docId":"license"}]},"docs":{"community-channels":{"id":"community-channels","title":"Community","description":"If you have questions about Cogment, a project you are working on or would like to start with Cogment, or would like to become more involved in the open-source development of Cogment, we invite you to join our Discord server. Here members of the Cogment community can come together to chat by voice or text, ask questions, and share solutions. We look forward to connecting with you!","sidebar":"docSidebar"},"guide/core-concepts":{"id":"guide/core-concepts","title":"Core Concepts","description":"Cogment is built around concepts adapted from multi-agent systems (actors, environment), Markov decision processes (action and observation space) and reinforcement learning (trials, rewards). This page aims to explain these concepts at a high level and give some idea of how they are used in Cogment.","sidebar":"docSidebar"},"guide/development-guide":{"id":"guide/development-guide","title":"Development guide","description":"This document gives a high level view of what it is to develop a Cogment based application using Cogment SDKs. It assumes the reader is familiar with the Cogment core concepts.","sidebar":"docSidebar"},"guide/implementation-recipes/configure-trial-from-controller":{"id":"guide/implementation-recipes/configure-trial-from-controller","title":"Configure Trial from Controller","description":"controller)","sidebar":"docSidebar"},"guide/implementation-recipes/index":{"id":"guide/implementation-recipes/index","title":"Implementation Recipes","description":"This section gathers implementation guides, or recipes, concerning specific topics not covered elsewhere. Beginners should start learning about using Cogment through the tutorial and general information are located in the api guide.","sidebar":"docSidebar"},"guide/implementation-recipes/v2-migration-guide":{"id":"guide/implementation-recipes/v2-migration-guide","title":"Migrate from Cogment v1 to v2","description":"This document is written as a guide to migrate from Cogment v1 to v2, a full list of the changes is also available here.","sidebar":"docSidebar"},"guide/tutorial/actors-in-cogment":{"id":"guide/tutorial/actors-in-cogment","title":"Step 2 - Actors in Cogment","description":"Now that we have a working but empty Cogment app, let\'s look at how these pieces interact in the context of the RPS game. In this step of the tutorial, we will lay out how Actors are defined in Cogment. To build out our RPS application, we will add the ability for our Actors to select actions (rather than produce empty strings).","sidebar":"docSidebar"},"guide/tutorial/advanced-tutorials/directory":{"id":"guide/tutorial/advanced-tutorials/directory","title":"Improve Operational Efficiency with a Cogment Directory for Service Discovery","description":"It is not necessary to have gone through all the previous sections to understand this part, but the code changes refer to the code in the previous step. The code can be retrieved from the tutorial\'s repository.","sidebar":"docSidebar"},"guide/tutorial/advanced-tutorials/human-player":{"id":"guide/tutorial/advanced-tutorials/human-player","title":"Add a Human Player in the Loop","description":"This part of the tutorial follows step 4, make sure you\'ve gone through it before starting this one. Alternatively the completed step 4 can be retrieved from the tutorial\'s repository.","sidebar":"docSidebar"},"guide/tutorial/advanced-tutorials/index":{"id":"guide/tutorial/advanced-tutorials/index","title":"Advanced Tutorial Steps","description":"This section offers an interested reader a set of advanced tutorials to learn how about how to do more complex things with Cogment. These tutorials build off of the RPS basics tutorial, so it may be useful to follow these.","sidebar":"docSidebar"},"guide/tutorial/advanced-tutorials/web-client":{"id":"guide/tutorial/advanced-tutorials/web-client","title":"Add a Web Client for the Human Player","description":"This part of the tutorial follows step 5, make sure you\'ve gone through it before starting this one. Alternatively the completed step 5 can be retrieved from the tutorial\'s repository.","sidebar":"docSidebar"},"guide/tutorial/decision-making":{"id":"guide/tutorial/decision-making","title":"Step 4 - Making Decisions with Feedback","description":"In this step of the tutorial, we will start thinking about rewards. Rewards are a way to evaluate how an Actor performs at a task. They can be used to evaluate or compare different implementations of an Actor, or, especially in the context of Reinforcement Learning, train a model. In Cogment, both the environment and other actors can evaluate an actor. Here, we will focus on sending rewards from the environment.","sidebar":"docSidebar"},"guide/tutorial/environment-in-cogment":{"id":"guide/tutorial/environment-in-cogment","title":"Step 3 - The Environment in Cogment","description":"In this step of the tutorial, we will look at what is needed to define the Environment in which Actors operate. Our goal in this section is to implement the rules for how the Environment responds to the actions at each step and produces new Observations for the Actors.","sidebar":"docSidebar"},"guide/tutorial/index":{"id":"guide/tutorial/index","title":"Tutorial","description":"Here we will learn about the different elements of Cogment and how they fit together by creating a simulated game of Rock-Paper-Scissors. To run this tutorial locally, you will need to download or clone the source code from our github repository.","sidebar":"docSidebar"},"guide/tutorial/setup":{"id":"guide/tutorial/setup","title":"Step 1 - An Empty Cogment Application","description":"In this step of the tutorial, we will get the RPS code set up properly and test run a single trial. This will establish the basic working code needed for all subsequent steps of the tutorial. We will go over the components of the repository at a very high level. If any terminology is unclear, it may be useful to refer to the Core Concepts.","sidebar":"docSidebar"},"index":{"id":"index","title":"Overview","description":"An introduction to Cogment","sidebar":"docSidebar"},"license":{"id":"license","title":"Apache License","description":"Version 2.0, January 2004","sidebar":"docSidebar"},"reference/cli/directory/directory-client":{"id":"reference/cli/directory/directory-client","title":"Client","description":"The Directory Client is a utility to manually access (through the command line interface) the Directory service. It can be used to register, deregister (remove) and inquire services.","sidebar":"docSidebar"},"reference/cli/directory/directory-server":{"id":"reference/cli/directory/directory-server","title":"Server","description":"The Directory is an implementation of the directory gRPC service. It is the service to find other services. Typically, every other Cogment service only needs to know the address of the Directory to access anything in Cogment.","sidebar":"docSidebar"},"reference/cli/index":{"id":"reference/cli/index","title":"CLI","description":"Repository Latest Release","sidebar":"docSidebar"},"reference/cli/launch":{"id":"reference/cli/launch","title":"Launch","description":"Launch is a utility command meant to facilitate locally launching and shutting down an entire Cogment project at once.","sidebar":"docSidebar"},"reference/cli/model-registry":{"id":"reference/cli/model-registry","title":"Model Registry","description":"Cogment Model Registry is designed to store and make available AI models to be used by Cogment actors.","sidebar":"docSidebar"},"reference/cli/orchestrator":{"id":"reference/cli/orchestrator","title":"Orchestrator","description":"The Orchestrator is the heart of Cogment. It ties all services together to execute trials.","sidebar":"docSidebar"},"reference/cli/status":{"id":"reference/cli/status","title":"Status","description":"Status is a utility command to request the status of Cogment services. It can also inquire the directory to find services to request status.","sidebar":"docSidebar"},"reference/cli/trial-datastore/trial-datastore-client":{"id":"reference/cli/trial-datastore/trial-datastore-client","title":"Client","description":"The Trial Datastore client provides command line access to some features of the Trial Datastore, and in general any service implementing the Trial Datastore API.","sidebar":"docSidebar"},"reference/cli/trial-datastore/trial-datastore-server":{"id":"reference/cli/trial-datastore/trial-datastore-server","title":"Server","description":"Cogment Trial Datastore implements the datalog API. It is designed to store the trajectory samples generated by the trials for online and offline usage.","sidebar":"docSidebar"},"reference/cli/web-proxy":{"id":"reference/cli/web-proxy","title":"Web Proxy","description":"This module is still in active development and should be considered a preview version.","sidebar":"docSidebar"},"reference/cogment-v2-changes":{"id":"reference/cogment-v2-changes","title":"Cogment 2.0","description":"This document describes the full list of the changes for Cogment 2.O. A migration guide is available here.","sidebar":"docSidebar"},"reference/cogment-yaml":{"id":"reference/cogment-yaml","title":"Specifications File","description":"The specifications file (typically named cogment.yaml) is central to every Cogment project that use a Cogment SDK. This file is used to define the specifics of a type of trials. It can also contain data (the commands section) used by the Cogment CLI tool. A generator tool specific to each SDK takes this file as its main input to, among other things, configure the SDK.","sidebar":"docSidebar"},"reference/grpc":{"id":"reference/grpc","title":"gRPC API","description":"The low-level cogment communication API is implemented using gRPC services.","sidebar":"docSidebar"},"reference/javascript":{"id":"reference/javascript","title":"Javascript SDK","description":"Repository Latest release","sidebar":"docSidebar"},"reference/parameters":{"id":"reference/parameters","title":"Trial Parameters","description":"The trial parameters are a set of parameters that define the details of a trial.","sidebar":"docSidebar"},"reference/python":{"id":"reference/python","title":"Python SDK","description":"Repository Latest release","sidebar":"docSidebar"},"reference/python-enterprise/installation":{"id":"reference/python-enterprise/installation","title":"Installation","description":"This page is a work in progress","sidebar":"docSidebar"},"reference/python-enterprise/runner":{"id":"reference/python-enterprise/runner","title":"Runner","description":"This is part of the Cogment Enterprise, AI Redefined\'s commercial offering.","sidebar":"docSidebar"},"reference/web-proxy-api":{"id":"reference/web-proxy-api","title":"Web Proxy API","description":"","sidebar":"docSidebar"}}}')}}]); \ No newline at end of file diff --git a/assets/js/935f2afb.eaa09a8c.js b/assets/js/935f2afb.eaa09a8c.js deleted file mode 100644 index f79bb6c..0000000 --- a/assets/js/935f2afb.eaa09a8c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[53],{1109:e=>{e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"docSidebar":[{"type":"link","label":"Overview","href":"/docs/","docId":"index"},{"type":"link","label":"Community","href":"/docs/community-channels","docId":"community-channels"},{"type":"category","label":"Guide","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Core Concepts","href":"/docs/guide/core-concepts","docId":"guide/core-concepts"},{"type":"link","label":"Development guide","href":"/docs/guide/development-guide","docId":"guide/development-guide"},{"type":"category","label":"Implementation Recipes","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Configure Trial from Controller","href":"/docs/guide/implementation-recipes/configure-trial-from-controller","docId":"guide/implementation-recipes/configure-trial-from-controller"},{"type":"link","label":"Migrate from Cogment v1 to v2","href":"/docs/guide/implementation-recipes/v2-migration-guide","docId":"guide/implementation-recipes/v2-migration-guide"}],"href":"/docs/guide/implementation-recipes/"},{"type":"category","label":"Tutorial","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Step 1 - An Empty Cogment Application","href":"/docs/guide/tutorial/setup","docId":"guide/tutorial/setup"},{"type":"link","label":"Step 2 - Actors in Cogment","href":"/docs/guide/tutorial/actors-in-cogment","docId":"guide/tutorial/actors-in-cogment"},{"type":"link","label":"Step 3 - The Environment in Cogment","href":"/docs/guide/tutorial/environment-in-cogment","docId":"guide/tutorial/environment-in-cogment"},{"type":"link","label":"Step 4 - Making Decisions with Feedback","href":"/docs/guide/tutorial/decision-making","docId":"guide/tutorial/decision-making"},{"type":"category","label":"Advanced Tutorials","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Add a Human Player in the Loop","href":"/docs/guide/tutorial/advanced-tutorials/human-player","docId":"guide/tutorial/advanced-tutorials/human-player"},{"type":"link","label":"Add a Web Client for the Human Player","href":"/docs/guide/tutorial/advanced-tutorials/web-client","docId":"guide/tutorial/advanced-tutorials/web-client"},{"type":"link","label":"Improve Operational Efficiency with a Cogment Directory for Service Discovery","href":"/docs/guide/tutorial/advanced-tutorials/directory","docId":"guide/tutorial/advanced-tutorials/directory"}],"href":"/docs/guide/tutorial/advanced-tutorials/"}],"href":"/docs/guide/tutorial/"}]},{"type":"category","label":"Reference","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Specifications File","href":"/docs/reference/cogment-yaml","docId":"reference/cogment-yaml"},{"type":"link","label":"Trial Parameters","href":"/docs/reference/parameters","docId":"reference/parameters"},{"type":"category","label":"CLI","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Orchestrator","href":"/docs/reference/cli/orchestrator","docId":"reference/cli/orchestrator"},{"type":"category","label":"Directory","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Server","href":"/docs/reference/cli/directory/directory-server","docId":"reference/cli/directory/directory-server"},{"type":"link","label":"Client","href":"/docs/reference/cli/directory/directory-client","docId":"reference/cli/directory/directory-client"}]},{"type":"category","label":"Trial Datastore","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Server","href":"/docs/reference/cli/trial-datastore/trial-datastore-server","docId":"reference/cli/trial-datastore/trial-datastore-server"},{"type":"link","label":"Client","href":"/docs/reference/cli/trial-datastore/trial-datastore-client","docId":"reference/cli/trial-datastore/trial-datastore-client"}]},{"type":"link","label":"Model Registry","href":"/docs/reference/cli/model-registry","docId":"reference/cli/model-registry"},{"type":"link","label":"Web Proxy","href":"/docs/reference/cli/web-proxy","docId":"reference/cli/web-proxy"},{"type":"link","label":"Launch","href":"/docs/reference/cli/launch","docId":"reference/cli/launch"},{"type":"link","label":"Status","href":"/docs/reference/cli/status","docId":"reference/cli/status"}],"href":"/docs/reference/cli/"},{"type":"link","label":"Python SDK","href":"/docs/reference/python","docId":"reference/python"},{"type":"link","label":"Javascript SDK","href":"/docs/reference/javascript","docId":"reference/javascript"},{"type":"category","label":"Enterprise Python SDK","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Installation","href":"/docs/reference/python-enterprise/installation","docId":"reference/python-enterprise/installation"},{"type":"link","label":"Runner","href":"/docs/reference/python-enterprise/runner","docId":"reference/python-enterprise/runner"}]},{"type":"link","label":"gRPC API","href":"/docs/reference/grpc","docId":"reference/grpc"},{"type":"link","label":"Cogment 2.0","href":"/docs/reference/cogment-v2-changes","docId":"reference/cogment-v2-changes"}]},{"type":"link","label":"Apache License","href":"/docs/license","docId":"license"}]},"docs":{"community-channels":{"id":"community-channels","title":"Community","description":"If you have questions about Cogment, a project you are working on or would like to start with Cogment, or would like to become more involved in the open-source development of Cogment, we invite you to join our Discord server. Here members of the Cogment community can come together to chat by voice or text, ask questions, and share solutions. We look forward to connecting with you!","sidebar":"docSidebar"},"guide/core-concepts":{"id":"guide/core-concepts","title":"Core Concepts","description":"Cogment is built around concepts adapted from multi-agent systems (actors, environment), Markov decision processes (action and observation space) and reinforcement learning (trials, rewards). This page aims to explain these concepts at a high level and give some idea of how they are used in Cogment.","sidebar":"docSidebar"},"guide/development-guide":{"id":"guide/development-guide","title":"Development guide","description":"This document gives a high level view of what it is to develop a Cogment based application using Cogment SDKs. It assumes the reader is familiar with the Cogment core concepts.","sidebar":"docSidebar"},"guide/implementation-recipes/configure-trial-from-controller":{"id":"guide/implementation-recipes/configure-trial-from-controller","title":"Configure Trial from Controller","description":"controller)","sidebar":"docSidebar"},"guide/implementation-recipes/index":{"id":"guide/implementation-recipes/index","title":"Implementation Recipes","description":"This section gathers implementation guides, or recipes, concerning specific topics not covered elsewhere. Beginners should start learning about using Cogment through the tutorial and general information are located in the api guide.","sidebar":"docSidebar"},"guide/implementation-recipes/v2-migration-guide":{"id":"guide/implementation-recipes/v2-migration-guide","title":"Migrate from Cogment v1 to v2","description":"This document is written as a guide to migrate from Cogment v1 to v2, a full list of the changes is also available here.","sidebar":"docSidebar"},"guide/tutorial/actors-in-cogment":{"id":"guide/tutorial/actors-in-cogment","title":"Step 2 - Actors in Cogment","description":"Now that we have a working but empty Cogment app, let\'s look at how these pieces interact in the context of the RPS game. In this step of the tutorial, we will lay out how Actors are defined in Cogment. To build out our RPS application, we will add the ability for our Actors to select actions (rather than produce empty strings).","sidebar":"docSidebar"},"guide/tutorial/advanced-tutorials/directory":{"id":"guide/tutorial/advanced-tutorials/directory","title":"Improve Operational Efficiency with a Cogment Directory for Service Discovery","description":"It is not necessary to have gone through all the previous sections to understand this part, but the code changes refer to the code in the previous step. The code can be retrieved from the tutorial\'s repository.","sidebar":"docSidebar"},"guide/tutorial/advanced-tutorials/human-player":{"id":"guide/tutorial/advanced-tutorials/human-player","title":"Add a Human Player in the Loop","description":"This part of the tutorial follows step 4, make sure you\'ve gone through it before starting this one. Alternatively the completed step 4 can be retrieved from the tutorial\'s repository.","sidebar":"docSidebar"},"guide/tutorial/advanced-tutorials/index":{"id":"guide/tutorial/advanced-tutorials/index","title":"Advanced Tutorial Steps","description":"This section offers an interested reader a set of advanced tutorials to learn how about how to do more complex things with Cogment. These tutorials build off of the RPS basics tutorial, so it may be useful to follow these.","sidebar":"docSidebar"},"guide/tutorial/advanced-tutorials/web-client":{"id":"guide/tutorial/advanced-tutorials/web-client","title":"Add a Web Client for the Human Player","description":"This part of the tutorial follows step 5, make sure you\'ve gone through it before starting this one. Alternatively the completed step 5 can be retrieved from the tutorial\'s repository.","sidebar":"docSidebar"},"guide/tutorial/decision-making":{"id":"guide/tutorial/decision-making","title":"Step 4 - Making Decisions with Feedback","description":"In this step of the tutorial, we will start thinking about rewards. Rewards are a way to evaluate how an Actor performs at a task. They can be used to evaluate or compare different implementations of an Actor, or, especially in the context of Reinforcement Learning, train a model. In Cogment, both the environment and other actors can evaluate an actor. Here, we will focus on sending rewards from the environment.","sidebar":"docSidebar"},"guide/tutorial/environment-in-cogment":{"id":"guide/tutorial/environment-in-cogment","title":"Step 3 - The Environment in Cogment","description":"In this step of the tutorial, we will look at what is needed to define the Environment in which Actors operate. Our goal in this section is to implement the rules for how the Environment responds to the actions at each step and produces new Observations for the Actors.","sidebar":"docSidebar"},"guide/tutorial/index":{"id":"guide/tutorial/index","title":"Tutorial","description":"Here we will learn about the different elements of Cogment and how they fit together by creating a simulated game of Rock-Paper-Scissors. To run this tutorial locally, you will need to download or clone the source code from our github repository.","sidebar":"docSidebar"},"guide/tutorial/setup":{"id":"guide/tutorial/setup","title":"Step 1 - An Empty Cogment Application","description":"In this step of the tutorial, we will get the RPS code set up properly and test run a single trial. This will establish the basic working code needed for all subsequent steps of the tutorial. We will go over the components of the repository at a very high level. If any terminology is unclear, it may be useful to refer to the Core Concepts.","sidebar":"docSidebar"},"index":{"id":"index","title":"Overview","description":"An introduction to Cogment","sidebar":"docSidebar"},"license":{"id":"license","title":"Apache License","description":"Version 2.0, January 2004","sidebar":"docSidebar"},"reference/cli/directory/directory-client":{"id":"reference/cli/directory/directory-client","title":"Client","description":"The Directory Client is a utility to manually access (through the command line interface) the Directory service. It can be used to register, deregister (remove) and inquire services.","sidebar":"docSidebar"},"reference/cli/directory/directory-server":{"id":"reference/cli/directory/directory-server","title":"Server","description":"The Directory is an implementation of the directory gRPC service. It is the service to find other services. Typically, every other Cogment service only needs to know the address of the Directory to access anything in Cogment.","sidebar":"docSidebar"},"reference/cli/index":{"id":"reference/cli/index","title":"CLI","description":"Repository Latest Release","sidebar":"docSidebar"},"reference/cli/launch":{"id":"reference/cli/launch","title":"Launch","description":"Launch is a utility command meant to facilitate locally launching and shutting down an entire Cogment project at once.","sidebar":"docSidebar"},"reference/cli/model-registry":{"id":"reference/cli/model-registry","title":"Model Registry","description":"Cogment Model Registry is designed to store and make available AI models to be used by Cogment actors.","sidebar":"docSidebar"},"reference/cli/orchestrator":{"id":"reference/cli/orchestrator","title":"Orchestrator","description":"The Orchestrator is the heart of Cogment. It ties all services together to execute trials.","sidebar":"docSidebar"},"reference/cli/status":{"id":"reference/cli/status","title":"Status","description":"Status is a utility command to request the status of Cogment services. It can also inquire the directory to find services to request status.","sidebar":"docSidebar"},"reference/cli/trial-datastore/trial-datastore-client":{"id":"reference/cli/trial-datastore/trial-datastore-client","title":"Client","description":"The Trial Datastore client provides command line access to some features of the Trial Datastore, and in general any service implementing the Trial Datastore API.","sidebar":"docSidebar"},"reference/cli/trial-datastore/trial-datastore-server":{"id":"reference/cli/trial-datastore/trial-datastore-server","title":"Server","description":"Cogment Trial Datastore implements the datalog API. It is designed to store the trajectory samples generated by the trials for online and offline usage.","sidebar":"docSidebar"},"reference/cli/web-proxy":{"id":"reference/cli/web-proxy","title":"Web Proxy","description":"This module is still in active development and should be considered a preview version.","sidebar":"docSidebar"},"reference/cogment-v2-changes":{"id":"reference/cogment-v2-changes","title":"Cogment 2.0","description":"This document describes the full list of the changes for Cogment 2.O. A migration guide is available here.","sidebar":"docSidebar"},"reference/cogment-yaml":{"id":"reference/cogment-yaml","title":"Specifications File","description":"The specifications file (typically named cogment.yaml) is central to every Cogment project that use a Cogment SDK. This file is used to define the specifics of a type of trials. It can also contain data (the commands section) used by the Cogment CLI tool. A generator tool specific to each SDK takes this file as its main input to, among other things, configure the SDK.","sidebar":"docSidebar"},"reference/grpc":{"id":"reference/grpc","title":"gRPC API","description":"The low-level cogment communication API is implemented using gRPC services.","sidebar":"docSidebar"},"reference/javascript":{"id":"reference/javascript","title":"Javascript SDK","description":"Repository Latest release","sidebar":"docSidebar"},"reference/parameters":{"id":"reference/parameters","title":"Trial Parameters","description":"The trial parameters are a set of parameters that define the details of a trial.","sidebar":"docSidebar"},"reference/python":{"id":"reference/python","title":"Python SDK","description":"Repository Latest release","sidebar":"docSidebar"},"reference/python-enterprise/installation":{"id":"reference/python-enterprise/installation","title":"Installation","description":"This page is a work in progress","sidebar":"docSidebar"},"reference/python-enterprise/runner":{"id":"reference/python-enterprise/runner","title":"Runner","description":"This is part of the Cogment Enterprise, AI Redefined\'s commercial offering.","sidebar":"docSidebar"}}}')}}]); \ No newline at end of file diff --git a/assets/js/9b35c4f5.4724485f.js b/assets/js/9b35c4f5.4724485f.js deleted file mode 100644 index 016fcf6..0000000 --- a/assets/js/9b35c4f5.4724485f.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[9255],{3905:(e,t,o)=>{o.d(t,{Zo:()=>m,kt:()=>h});var r=o(7294);function n(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function i(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function a(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?i(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):i(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function s(e,t){if(null==e)return{};var o,r,n=function(e,t){if(null==e)return{};var o,r,n={},i=Object.keys(e);for(r=0;r<i.length;r++)o=i[r],t.indexOf(o)>=0||(n[o]=e[o]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var u=r.createContext({}),c=function(e){var t=r.useContext(u),o=t;return e&&(o="function"==typeof e?e(t):a(a({},t),e)),o},m=function(e){var t=c(e.components);return r.createElement(u.Provider,{value:t},e.children)},l={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},p=r.forwardRef((function(e,t){var o=e.components,n=e.mdxType,i=e.originalType,u=e.parentName,m=s(e,["components","mdxType","originalType","parentName"]),p=c(o),h=n,d=p["".concat(u,".").concat(h)]||p[h]||l[h]||i;return o?r.createElement(d,a(a({ref:t},m),{},{components:o})):r.createElement(d,a({ref:t},m))}));function h(e,t){var o=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var i=o.length,a=new Array(i);a[0]=p;var s={};for(var u in t)hasOwnProperty.call(t,u)&&(s[u]=t[u]);s.originalType=e,s.mdxType="string"==typeof e?e:n,a[1]=s;for(var c=2;c<i;c++)a[c]=o[c];return r.createElement.apply(null,a)}return r.createElement.apply(null,o)}p.displayName="MDXCreateElement"},562:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>u,contentTitle:()=>a,default:()=>l,frontMatter:()=>i,metadata:()=>s,toc:()=>c});var r=o(7462),n=(o(7294),o(3905));const i={sidebar_position:2},a="Community",s={unversionedId:"community-channels",id:"community-channels",title:"Community",description:"If you have questions about Cogment, a project you are working on or would like to start with Cogment, or would like to become more involved in the open-source development of Cogment, we invite you to join our Discord server. Here members of the Cogment community can come together to chat by voice or text, ask questions, and share solutions. We look forward to connecting with you!",source:"@site/docs/community-channels.md",sourceDirName:".",slug:"/community-channels",permalink:"/docs/community-channels",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"docSidebar",previous:{title:"Overview",permalink:"/docs/"},next:{title:"Core Concepts",permalink:"/docs/guide/core-concepts"}},u={},c=[{value:"Interact with Us",id:"interact-with-us",level:2},{value:"Reporting Bugs",id:"reporting-bugs",level:3},{value:"Security Disclosures",id:"security-disclosures",level:3},{value:"Participate in Cogment Open Source",id:"participate-in-cogment-open-source",level:2}],m={toc:c};function l(e){let{components:t,...o}=e;return(0,n.kt)("wrapper",(0,r.Z)({},m,o,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("h1",{id:"community"},"Community"),(0,n.kt)("p",null,"If you have questions about Cogment, a project you are working on or would like to start with Cogment, or would like to become more involved in the open-source development of Cogment, we invite you to join our ",(0,n.kt)("a",{parentName:"p",href:"https://discord.com/invite/QDxb9Fweqr"},"Discord server"),". Here members of the Cogment community can come together to chat by voice or text, ask questions, and share solutions. We look forward to connecting with you!"),(0,n.kt)("h2",{id:"interact-with-us"},"Interact with Us"),(0,n.kt)("p",null,"We'd love to hear from you about any project you're working on with Cogment or\n",(0,n.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-verse"},"Cogment Verse"),". Reach out on the ",(0,n.kt)("a",{parentName:"p",href:"https://discord.com/invite/QDxb9Fweqr"},"Discord server")," to discuss your project, report any bugs you might find, or propose any fixes you think might improve our platform."),(0,n.kt)("h3",{id:"reporting-bugs"},"Reporting Bugs"),(0,n.kt)("p",null,"If you do need to report a bug, you can do so on the issues page for ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment/issues"},"Cogment")," or ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-verse/issues"},"Cogment Verse"),". It's useful to check this list first to see if your issue has been raised already before submitting a new one."),(0,n.kt)("p",null,"When filing an issue, make sure to answer these five questions:"),(0,n.kt)("ol",null,(0,n.kt)("li",{parentName:"ol"},"What version of cogment are you using (check using ",(0,n.kt)("inlineCode",{parentName:"li"},"cogment version"),")?"),(0,n.kt)("li",{parentName:"ol"},"What operating system and processor architecture are you using?"),(0,n.kt)("li",{parentName:"ol"},"What did you do?"),(0,n.kt)("li",{parentName:"ol"},"What did you expect to see?"),(0,n.kt)("li",{parentName:"ol"},"What did you see instead?")),(0,n.kt)("h3",{id:"security-disclosures"},"Security Disclosures"),(0,n.kt)("p",null,"If you find a security vulnerability, do NOT open an issue. Any security issues should be submitted directly to ",(0,n.kt)("a",{parentName:"p",href:"mailto:dev+security@ai-r.com"},"dev+security@ai-r.com"),". In order to determine whether you are dealing with a security issue, ask yourself these two questions:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"Can I access something that's not mine, or something I shouldn't have access to?"),(0,n.kt)("li",{parentName:"ul"},"Can I disable something for other people?")),(0,n.kt)("p",null,'If the answer to either of those two questions are "yes", then you\'re probably dealing with a security issue. Note that even if you answer "no" to both questions, you may still be dealing with a security issue, so if you\'re unsure, just email us at ',(0,n.kt)("a",{parentName:"p",href:"mailto:dev+security@ai-r.com"},"dev+security@ai-r.com"),"."),(0,n.kt)("h2",{id:"participate-in-cogment-open-source"},"Participate in Cogment Open Source"),(0,n.kt)("p",null,"If you are interested in contributing to Cogment or ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-verse"},"Cogment Verse"),", please get in touch with the team on the ",(0,n.kt)("a",{parentName:"p",href:"https://discord.com/invite/QDxb9Fweqr"},"Discord server")," and share what you're thinking about."),(0,n.kt)("p",null,"You'll need to sign a Contributor License Agreement (CLA) so that you can retain ownership of the code submitted and ",(0,n.kt)("a",{parentName:"p",href:"https://www.ai-r.com"},"AI Redefined")," has legal rights to use the contribution. Once signed, a CLA covers all Cogment projects. Get a CLA by emailing ",(0,n.kt)("a",{parentName:"p",href:"mailto:dev+cla@ai-r.com"},"dev+cla@ai-r.com"),"."),(0,n.kt)("p",null,"To participate in the Cogment Open Source community, please make sure you follow our ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-verse/blob/main/CODE_OF_CONDUCT.md"},"Code of Conduct")," guidelines."),(0,n.kt)("p",null,"If you want to implement a feature or bugfix for an outstanding issue, search for that issue on the dedicated issues page for ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment/issues"},"Cogment")," or ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-verse/issues"},"Cogment Verse")," and comment that you are going to work on this piece. If you need more context on a particular issue, reach out on our ",(0,n.kt)("a",{parentName:"p",href:"https://discord.com/invite/QDxb9Fweqr"},"Discord server"),"."))}l.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/9b35c4f5.8ddc6530.js b/assets/js/9b35c4f5.8ddc6530.js new file mode 100644 index 0000000..b569744 --- /dev/null +++ b/assets/js/9b35c4f5.8ddc6530.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[9255],{3905:(e,t,o)=>{o.d(t,{Zo:()=>m,kt:()=>d});var r=o(7294);function n(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function i(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function a(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?i(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):i(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function s(e,t){if(null==e)return{};var o,r,n=function(e,t){if(null==e)return{};var o,r,n={},i=Object.keys(e);for(r=0;r<i.length;r++)o=i[r],t.indexOf(o)>=0||(n[o]=e[o]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var u=r.createContext({}),c=function(e){var t=r.useContext(u),o=t;return e&&(o="function"==typeof e?e(t):a(a({},t),e)),o},m=function(e){var t=c(e.components);return r.createElement(u.Provider,{value:t},e.children)},l="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},h=r.forwardRef((function(e,t){var o=e.components,n=e.mdxType,i=e.originalType,u=e.parentName,m=s(e,["components","mdxType","originalType","parentName"]),l=c(o),h=n,d=l["".concat(u,".").concat(h)]||l[h]||p[h]||i;return o?r.createElement(d,a(a({ref:t},m),{},{components:o})):r.createElement(d,a({ref:t},m))}));function d(e,t){var o=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var i=o.length,a=new Array(i);a[0]=h;var s={};for(var u in t)hasOwnProperty.call(t,u)&&(s[u]=t[u]);s.originalType=e,s[l]="string"==typeof e?e:n,a[1]=s;for(var c=2;c<i;c++)a[c]=o[c];return r.createElement.apply(null,a)}return r.createElement.apply(null,o)}h.displayName="MDXCreateElement"},562:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>u,contentTitle:()=>a,default:()=>p,frontMatter:()=>i,metadata:()=>s,toc:()=>c});var r=o(7462),n=(o(7294),o(3905));const i={sidebar_position:2},a="Community",s={unversionedId:"community-channels",id:"community-channels",title:"Community",description:"If you have questions about Cogment, a project you are working on or would like to start with Cogment, or would like to become more involved in the open-source development of Cogment, we invite you to join our Discord server. Here members of the Cogment community can come together to chat by voice or text, ask questions, and share solutions. We look forward to connecting with you!",source:"@site/docs/community-channels.md",sourceDirName:".",slug:"/community-channels",permalink:"/docs/community-channels",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"docSidebar",previous:{title:"Overview",permalink:"/docs/"},next:{title:"Core Concepts",permalink:"/docs/guide/core-concepts"}},u={},c=[{value:"Interact with Us",id:"interact-with-us",level:2},{value:"Reporting Bugs",id:"reporting-bugs",level:3},{value:"Security Disclosures",id:"security-disclosures",level:3},{value:"Participate in Cogment Open Source",id:"participate-in-cogment-open-source",level:2}],m={toc:c},l="wrapper";function p(e){let{components:t,...o}=e;return(0,n.kt)(l,(0,r.Z)({},m,o,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("h1",{id:"community"},"Community"),(0,n.kt)("p",null,"If you have questions about Cogment, a project you are working on or would like to start with Cogment, or would like to become more involved in the open-source development of Cogment, we invite you to join our ",(0,n.kt)("a",{parentName:"p",href:"https://discord.com/invite/QDxb9Fweqr"},"Discord server"),". Here members of the Cogment community can come together to chat by voice or text, ask questions, and share solutions. We look forward to connecting with you!"),(0,n.kt)("h2",{id:"interact-with-us"},"Interact with Us"),(0,n.kt)("p",null,"We'd love to hear from you about any project you're working on with Cogment or\n",(0,n.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-verse"},"Cogment Verse"),". Reach out on the ",(0,n.kt)("a",{parentName:"p",href:"https://discord.com/invite/QDxb9Fweqr"},"Discord server")," to discuss your project, report any bugs you might find, or propose any fixes you think might improve our platform."),(0,n.kt)("h3",{id:"reporting-bugs"},"Reporting Bugs"),(0,n.kt)("p",null,"If you do need to report a bug, you can do so on the issues page for ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment/issues"},"Cogment")," or ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-verse/issues"},"Cogment Verse"),". It's useful to check this list first to see if your issue has been raised already before submitting a new one."),(0,n.kt)("p",null,"When filing an issue, make sure to answer these five questions:"),(0,n.kt)("ol",null,(0,n.kt)("li",{parentName:"ol"},"What version of cogment are you using (check using ",(0,n.kt)("inlineCode",{parentName:"li"},"cogment version"),")?"),(0,n.kt)("li",{parentName:"ol"},"What operating system and processor architecture are you using?"),(0,n.kt)("li",{parentName:"ol"},"What did you do?"),(0,n.kt)("li",{parentName:"ol"},"What did you expect to see?"),(0,n.kt)("li",{parentName:"ol"},"What did you see instead?")),(0,n.kt)("h3",{id:"security-disclosures"},"Security Disclosures"),(0,n.kt)("p",null,"If you find a security vulnerability, do NOT open an issue. Any security issues should be submitted directly to ",(0,n.kt)("a",{parentName:"p",href:"mailto:dev+security@ai-r.com"},"dev+security@ai-r.com"),". In order to determine whether you are dealing with a security issue, ask yourself these two questions:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"Can I access something that's not mine, or something I shouldn't have access to?"),(0,n.kt)("li",{parentName:"ul"},"Can I disable something for other people?")),(0,n.kt)("p",null,'If the answer to either of those two questions are "yes", then you\'re probably dealing with a security issue. Note that even if you answer "no" to both questions, you may still be dealing with a security issue, so if you\'re unsure, just email us at ',(0,n.kt)("a",{parentName:"p",href:"mailto:dev+security@ai-r.com"},"dev+security@ai-r.com"),"."),(0,n.kt)("h2",{id:"participate-in-cogment-open-source"},"Participate in Cogment Open Source"),(0,n.kt)("p",null,"If you are interested in contributing to Cogment or ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-verse"},"Cogment Verse"),", please get in touch with the team on the ",(0,n.kt)("a",{parentName:"p",href:"https://discord.com/invite/QDxb9Fweqr"},"Discord server")," and share what you're thinking about."),(0,n.kt)("p",null,"You'll need to sign a Contributor License Agreement (CLA) so that you can retain ownership of the code submitted and ",(0,n.kt)("a",{parentName:"p",href:"https://www.ai-r.com"},"AI Redefined")," has legal rights to use the contribution. Once signed, a CLA covers all Cogment projects. Get a CLA by emailing ",(0,n.kt)("a",{parentName:"p",href:"mailto:dev+cla@ai-r.com"},"dev+cla@ai-r.com"),"."),(0,n.kt)("p",null,"To participate in the Cogment Open Source community, please make sure you follow our ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-verse/blob/main/CODE_OF_CONDUCT.md"},"Code of Conduct")," guidelines."),(0,n.kt)("p",null,"If you want to implement a feature or bugfix for an outstanding issue, search for that issue on the dedicated issues page for ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment/issues"},"Cogment")," or ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-verse/issues"},"Cogment Verse")," and comment that you are going to work on this piece. If you need more context on a particular issue, reach out on our ",(0,n.kt)("a",{parentName:"p",href:"https://discord.com/invite/QDxb9Fweqr"},"Discord server"),"."))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/9b824c8f.1c11dbd9.js b/assets/js/9b824c8f.1c11dbd9.js deleted file mode 100644 index 7f60d87..0000000 --- a/assets/js/9b824c8f.1c11dbd9.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[2880],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>h});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=a.createContext({}),c=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=c(e.components);return a.createElement(l.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,l=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),d=c(n),h=r,u=d["".concat(l,".").concat(h)]||d[h]||m[h]||o;return n?a.createElement(u,i(i({ref:t},p),{},{components:n})):a.createElement(u,i({ref:t},p))}));function h(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,i=new Array(o);i[0]=d;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s.mdxType="string"==typeof e?e:r,i[1]=s;for(var c=2;c<o;c++)i[c]=n[c];return a.createElement.apply(null,i)}return a.createElement.apply(null,n)}d.displayName="MDXCreateElement"},2406:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>i,default:()=>m,frontMatter:()=>o,metadata:()=>s,toc:()=>c});var a=n(7462),r=(n(7294),n(3905));const o={title:"Core Concepts",sidebar_position:1},i="Core Concepts",s={unversionedId:"guide/core-concepts",id:"guide/core-concepts",title:"Core Concepts",description:"Cogment is built around concepts adapted from multi-agent systems (actors, environment), Markov decision processes (action and observation space) and reinforcement learning (trials, rewards). This page aims to explain these concepts at a high level and give some idea of how they are used in Cogment.",source:"@site/docs/guide/core-concepts.md",sourceDirName:"guide",slug:"/guide/core-concepts",permalink:"/docs/guide/core-concepts",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:1,frontMatter:{title:"Core Concepts",sidebar_position:1},sidebar:"docSidebar",previous:{title:"Community",permalink:"/docs/community-channels"},next:{title:"Development guide",permalink:"/docs/guide/development-guide"}},l={},c=[{value:"Environment",id:"environment",level:2},{value:"State and Observation Spaces",id:"state-and-observation-spaces",level:3},{value:"How the Environment works in Cogment",id:"how-the-environment-works-in-cogment",level:3},{value:"Actors",id:"actors",level:2},{value:"Action Space",id:"action-space",level:3},{value:"How Actors work in Cogment",id:"how-actors-work-in-cogment",level:3},{value:"Client and Service Actors",id:"client-and-service-actors",level:4},{value:"Interactions between Actors and the Environment",id:"interactions-between-actors-and-the-environment",level:2},{value:"Trials",id:"trials",level:2},{value:"How Trials work in Cogment",id:"how-trials-work-in-cogment",level:3},{value:"The Specification file",id:"the-specification-file",level:4},{value:"Cogment Architecture",id:"cogment-architecture",level:2},{value:"Context",id:"context",level:3},{value:"Orchestrator",id:"orchestrator",level:3},{value:"Controller",id:"controller",level:3},{value:"Environment",id:"environment-1",level:3},{value:"Actors",id:"actors-1",level:3},{value:"Additional components",id:"additional-components",level:3},{value:"Components availability summary",id:"components-availability-summary",level:2}],p={toc:c};function m(e){let{components:t,...o}=e;return(0,r.kt)("wrapper",(0,a.Z)({},p,o,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"core-concepts"},"Core Concepts"),(0,r.kt)("p",null,"Cogment is built around concepts adapted from multi-agent systems (actors, environment), Markov decision processes (action and observation space) and reinforcement learning (trials, rewards). This page aims to explain these concepts at a high level and give some idea of how they are used in Cogment."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Basic components of Cogment",src:n(6763).Z,width:"2366",height:"1254"})),(0,r.kt)("p",null,"At the most basic level, Cogment facilitates interactions between ",(0,r.kt)("a",{parentName:"p",href:"#actors"},"Actors")," and their ",(0,r.kt)("a",{parentName:"p",href:"#environment"},"Environment"),". Actors take in observations of the Environment as input, and use these to generate actions as outputs. The Environment takes actions as inputs, and outputs the consequences of that action, such as the next observation and, optionally, a numerical feedback signal about how good or bad the action was (eg. reward)."),(0,r.kt)("p",null,"Cogment is designed so that components like the Environment and the Actors can be run as distributed services with easily interchangeable implementations, and with a system to enable efficient transfer of information between services."),(0,r.kt)("h2",{id:"environment"},"Environment"),(0,r.kt)("p",null,"The Environment is the context in which Cogment ",(0,r.kt)("a",{parentName:"p",href:"#trials"},"Trials")," are run. The Environment is the main integration point between Cogment and an external system, either a ",(0,r.kt)("strong",{parentName:"p"},"simulation")," or a ",(0,r.kt)("strong",{parentName:"p"},"real world system"),"."),(0,r.kt)("p",null,"In the most general terms, the Environment is the world in which a human or computer agent (eg. ",(0,r.kt)("a",{parentName:"p",href:"#actors"},"Actors"),") can take actions. For example, in the Atari game ",(0,r.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/Pong"},"Pong"),', the Environment is the simulated arena in which players control "paddles" to keep a "ball" within the bounds of the screen. The Environment also includes the set of rules for what actions exist (eg. you can move your paddles up and down, but not left and right) and also how the game evolves as a consequence of certain actions being taken.'),(0,r.kt)("h3",{id:"state-and-observation-spaces"},"State and Observation Spaces"),(0,r.kt)("p",null,"The Environment can be in different states. The set of all possible states the Environment could be in is called the \"state space\". Usually an Actor needs to have some knowledge about the current state of the world they're in to make decisions about what action should be taken. The Actor doesn't always get access to every detail about the current state of the Environment, but rather gets ",(0,r.kt)("strong",{parentName:"p"},"observations"),' of the current state. The set of all possible observations an Actor could see is called "observation space". In Cogment, we only explicitly deal with ',(0,r.kt)("strong",{parentName:"p"},"observations")," of the Environment."),(0,r.kt)("h3",{id:"how-the-environment-works-in-cogment"},"How the Environment works in Cogment"),(0,r.kt)("p",null,"In Cogment, the basic outline of the Environment is given in the ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/cogment-yaml"},"specification file"),", which configures what parameters are important for setting up the Environment. The general structure of how an Environment works (eg. what info it takes as input and what it generates as output) is specified in the Environment ",(0,r.kt)("em",{parentName:"p"},"implementation"),", along with the rules of how the Environment responds to a given action and produces subsequent observations for the Actor(s). The Environment implementation is accessed by the ",(0,r.kt)("a",{parentName:"p",href:"#orchestrator"},"Orchestrator")," to run the Environment during ",(0,r.kt)("a",{parentName:"p",href:"#trials"},"Trials"),"."),(0,r.kt)("p",null,"Using one of ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/development-guide"},"Cogment's SDKs"),", the Environment can be implemented as a function integrating a ",(0,r.kt)("em",{parentName:"p"},'"state of the world"')," with the Trial. This function performs the following tasks during the Trial:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Generate Observations from the current state of the world, for example retrieving the visible objects from a 3D simulation."),(0,r.kt)("li",{parentName:"ul"},"Apply the Actions, thus updating the state of the world, for example changing the velocity of a moving vehicle in a race simulation."),(0,r.kt)("li",{parentName:"ul"},"Evaluate the performance of ",(0,r.kt)("a",{parentName:"li",href:"#actors"},"Actors")," and send them Rewards, for example by checking if a vehicle crossed the finish line in a race simulation.")),(0,r.kt)("h2",{id:"actors"},"Actors"),(0,r.kt)("p",null,"Actors are roles that can ",(0,r.kt)("em",{parentName:"p"},"do")," stuff, eg. Actors take actions which may affect the state of the Environment. In Cogment, Actors can be either humans or computer-based agents and effectively operate identically."),(0,r.kt)("h3",{id:"action-space"},"Action Space"),(0,r.kt)("p",null,'Actors take Observations about the current state of the Environment as inputs, and produce actions as outputs. The set of all actions that can be produced is called the "Action space".'),(0,r.kt)("p",null,"Each Actor can get a different Observation from the Environment representing what it perceives about the state of the world. The action represents the decision the Actor takes upon receiving this observation. The action selected by the Actor is then applied by the Environment. Cogment leverages this discrete update to orchestrate the execution of the components and the dispatch of data between them."),(0,r.kt)("h3",{id:"how-actors-work-in-cogment"},"How Actors work in Cogment"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Concepts of Actors in Cogment",src:n(7873).Z,width:"1900",height:"1410"})),(0,r.kt)("p",null,'Cogment allocates a dedicated gRPC service to run the computations of Actors, which we call the "Actor Service". It can also refer to the computational node running this service. This service effectively offers the registered actor implementations for use in trials.'),(0,r.kt)("p",null,"The Actor class specifies what kinds of inputs and outputs to expect. The class definition specifies ",(0,r.kt)("em",{parentName:"p"},"what")," an actor is."),(0,r.kt)("p",null,"The Actor implementation is the function the Actor uses to compute what action to take given some input information. If we want to have a bunch of different Actors that all behave similarly (take same kind of inputs and produce same kind of outputs) we can define an Actor class and different instances of that class can use different implementations."),(0,r.kt)("h4",{id:"client-and-service-actors"},"Client and Service Actors"),(0,r.kt)("p",null,"An Actor might be controlled either by a software agent, or by a Human. Whichever the case, the process of generating actions based on observations remains the same, and the ",(0,r.kt)("a",{parentName:"p",href:"#environment"},"Environment"),' treats them the same. Some Actors connect to the trial (we call them "client" Actors) and others will wait for the trial to connect to them (we call these "service" Actors). Service Actors are run on a designated computational node called the Actor Service.'),(0,r.kt)("h2",{id:"interactions-between-actors-and-the-environment"},"Interactions between Actors and the Environment"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Basic concepts",src:n(2144).Z,width:"1864",height:"694"})),(0,r.kt)("p",null,"The Observations and Actions we discussed above are the key pieces of information exchanged between Actors and the Environment."),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Environments take actions as an input and output observations,"),(0,r.kt)("li",{parentName:"ul"},"Actors take observations as an input and output actions.")),(0,r.kt)("p",null,"As discussed before, the Environment can also provide feedback to the Actor about their actions in the form of a numerical reward signal, but it is not strictly necessary for the Environment to do so."),(0,r.kt)("p",null,"In Cogment, Actors and the Environment exchange information via the ",(0,r.kt)("a",{parentName:"p",href:"#orchestrator"},"Orchestrator")," - a core component of Cogment which facilitates the interaction of distributed services. To do so, the observation and action space for the Actors and the Environment are defined as typed data structures. Cogment uses ",(0,r.kt)("a",{parentName:"p",href:"https://developers.google.com/protocol-buffers/"},"Protocol Buffers")," as a format to specify these data structures. This typing defines both an interface contract between the Actors and the Environment and helps convey semantic information, thus facilitating the independent design and development of both. In practice this enables the Actors and Environment to be run as separate services (eg. on separate computational nodes) and have the ",(0,r.kt)("a",{parentName:"p",href:"#orchestrator"},"Orchestrator")," pass these protobuf messages between the different services as needed."),(0,r.kt)("h2",{id:"trials"},"Trials"),(0,r.kt)("p",null,"Trials are how a Cogment deployment runs the sequential interactions between ",(0,r.kt)("a",{parentName:"p",href:"#actors"},"Actors")," and their ",(0,r.kt)("a",{parentName:"p",href:"#environment"},"Environment"),". A trial is defined by the participating ",(0,r.kt)("a",{parentName:"p",href:"#actors"},"Actors")," and the host ",(0,r.kt)("a",{parentName:"p",href:"#environment"},"Environment"),". As a concept, Trials are quite close to Reinforcement Learning's ",(0,r.kt)("strong",{parentName:"p"},"Episodes"),", i.e. all the states that come between an initial state and a terminal state. However, because Cogment can be used outside of an RL context, we prefer using the more generic term of Trial."),(0,r.kt)("h3",{id:"how-trials-work-in-cogment"},"How Trials work in Cogment"),(0,r.kt)("p",null,"Trials are started by clients connecting to Cogment. A trial can end either by being terminated from a client or end by itself, for example once a specific state of the Environment is reached."),(0,r.kt)("p",null,"During the trial:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("a",{parentName:"li",href:"#environment"},"Environment")," generates ",(0,r.kt)("a",{parentName:"li",href:"#states-and-observations"},(0,r.kt)("strong",{parentName:"a"},"observations"))," of its internal state and sends them to the ",(0,r.kt)("a",{parentName:"li",href:"#actors"},"Actors"),"."),(0,r.kt)("li",{parentName:"ul"},"Given these observations, each Actor chooses and sends an action."),(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("a",{parentName:"li",href:"#environment"},"Environment")," receives the actions and updates its internal state."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("strong",{parentName:"li"},"Rewards")," can be sent to the ",(0,r.kt)("a",{parentName:"li",href:"#actors"},"Actors")," from either the Environment or other Actors. A reward is a measure of an actor\u2019s performance within the environment at a given point in time during the trial."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#actors"},"Actors")," receive ",(0,r.kt)("strong",{parentName:"li"},"rewards")," if at least one was sent to them."),(0,r.kt)("li",{parentName:"ul"},"A log of the activity during the trial (observations, actions, rewards) is produced and can be stored.")),(0,r.kt)("h4",{id:"the-specification-file"},"The Specification file"),(0,r.kt)("p",null,"The configurations for how trial elements are set up are defined in a YAML specification file typically called ",(0,r.kt)("inlineCode",{parentName:"p"},"cogment.yaml"),". This file details how elements of the project work, including its actor classes and their action & observation spaces. You can learn more about the specification file in the ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/cogment-yaml"},"dedicated reference page"),"."),(0,r.kt)("hr",null),(0,r.kt)("h2",{id:"cogment-architecture"},"Cogment Architecture"),(0,r.kt)("p",null,"Running trials with Cogment usually involves the deployment of a cluster of services and clients. These components are either provided by the Cogment framework, depicted below in blue, or implemented for a particular project with Software Development Kits (SDKs) in either Python or Javascript, depicted below in orange."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Cogment Architecture",src:n(25).Z,width:"2438",height:"1214"})),(0,r.kt)("p",null,"User implemented components use one of the ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/development-guide"},"Cogment SDKs")," or directly implement the ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/grpc"},"underlying protocol"),". Components communicate using ",(0,r.kt)("a",{parentName:"p",href:"https://grpc.io"},"gRPC"),", clients can also communicate in a web-friendly way using ",(0,r.kt)("a",{parentName:"p",href:"https://grpc.io/docs/platforms/web/"},"gRPC-Web")," and ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/improbable-eng/grpc-web/tree/master/go/grpcwebproxy"},"grpcwebproxy"),"."),(0,r.kt)("h3",{id:"context"},"Context"),(0,r.kt)("p",null,"The Context is a point of entry for Cogment to interface with the different services through SDKs. See also the SDK documentation for Context (",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/python#class-controller"},"Python")," | ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/javascript#class-cogmentcontext"},"JavaScript"),")."),(0,r.kt)("h3",{id:"orchestrator"},"Orchestrator"),(0,r.kt)("p",null,"The Orchestrator is the glue that binds everything together. It is responsible for running the ",(0,r.kt)("a",{parentName:"p",href:"#Trials"},"Trials")," and contacting other services as needed to ensure their execution."),(0,r.kt)("p",null,"The key aspect of Cogment's orchestrator is its capacity to handle a number of network connections in parallel while keeping its responsiveness."),(0,r.kt)("h3",{id:"controller"},"Controller"),(0,r.kt)("p",null,"The Controller is a key part of using Cogment, it initiates communication with the Orchestrator to control the execution of ",(0,r.kt)("a",{parentName:"p",href:"#trials"},"Trials"),". It is responsible for starting Trials, retrieving and watching their state (including the end of the trial), or requesting trial termination. You can see more in the ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/python#class-controller"},"Python SDK documentation")," for the Controller. The Controller is created by the ",(0,r.kt)("a",{parentName:"p",href:"#context"},"Context"),"."),(0,r.kt)("h3",{id:"environment-1"},"Environment"),(0,r.kt)("p",null,"The Environment implementation is accessed by the ",(0,r.kt)("a",{parentName:"p",href:"#orchestrator"},"Orchestrator")," to run the ",(0,r.kt)("a",{parentName:"p",href:"#environment"},"Environment")," during ",(0,r.kt)("a",{parentName:"p",href:"#trials"},"Trials"),"."),(0,r.kt)("p",null,"Using one of ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/development-guide"},"Cogment's SDKs"),", the Environment can be implemented as a function integrating a ",(0,r.kt)("em",{parentName:"p"},'"state of the world"')," with the Trial. This function performs the following tasks during the Trial:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Generate Observations from the current ",(0,r.kt)("em",{parentName:"li"},"state of the world"),", for example retrieving the visible objects from a 3D simulation."),(0,r.kt)("li",{parentName:"ul"},"Apply the Actions, thus updating the ",(0,r.kt)("em",{parentName:"li"},"state of the world"),", for example changing the velocity of a moving vehicle in a race simulation."),(0,r.kt)("li",{parentName:"ul"},"Evaluate the performance of ",(0,r.kt)("a",{parentName:"li",href:"#actors"},"Actors")," and send them Rewards, for example by checking if a vehicle crossed the finish line in a race simulation.")),(0,r.kt)("h3",{id:"actors-1"},"Actors"),(0,r.kt)("p",null,"Cogment handles Actors in two different ways: either as a ",(0,r.kt)("em",{parentName:"p"},"service Actor")," or as a ",(0,r.kt)("em",{parentName:"p"},"client Actor"),". ",(0,r.kt)("strong",{parentName:"p"},"Service Actor")," implementations are accessed by the ",(0,r.kt)("a",{parentName:"p",href:"#orchestrator"},"Orchestrator")," during ",(0,r.kt)("a",{parentName:"p",href:"#trials"},"Trials"),", while ",(0,r.kt)("strong",{parentName:"p"},"Client Actor")," implementations join a Trial by initiating the communication with the Orchestrator. Client Actors implementations can ",(0,r.kt)("em",{parentName:"p"},"reach")," a Cogment deployment through ",(0,r.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/NAT_traversal"},"NAT traversal"),". This makes them particularly well-suited to implement human-driven Actors, in web-browsers for example."),(0,r.kt)("p",null,"Using one of ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/development-guide"},"Cogment's SDKs")," Actors can be implemented as functions handling the integration between a decision-making Actor (software agent or Human) and the ",(0,r.kt)("a",{parentName:"p",href:"#trials"},"Trial"),". This function performs the following tasks during the Trial:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Receive Observations and do Actions in response, for example vectorizing the retrieved observation, feeding it to a neural network and converting its output to an Action."),(0,r.kt)("li",{parentName:"ul"},"Receive Rewards, for example using them to update a neural network."),(0,r.kt)("li",{parentName:"ul"},"Optionally: send and receive direct messages.")),(0,r.kt)("p",null,"Please note that rewards can also be retrieved after the fact using a ",(0,r.kt)("a",{parentName:"p",href:"#additional-optional-services"},"datalog"),"."),(0,r.kt)("h3",{id:"additional-components"},"Additional components"),(0,r.kt)("p",null,"On top of the core components described above, a Cogment deployment can include these additional ones:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("strong",{parentName:"li"},"Datalog")," services can be used to listen to the activity during a trial (actions, observations, rewards, messages)\nin order to, for example, store these data for the offline training of AI agents.\nThe ",(0,r.kt)("a",{parentName:"li",href:"/docs/reference/cli/trial-datastore/trial-datastore-server"},(0,r.kt)("strong",{parentName:"a"},"Trial Datastore"))," is an out-of-the-box implementation\nof this."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/reference/cli/model-registry"},(0,r.kt)("strong",{parentName:"a"},"Model Registry"))," handles the storage and dispatch of AI models trained with\nCogment and used by the actors."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/reference/cli/directory/directory-server"},(0,r.kt)("strong",{parentName:"a"},"Directory"))," handles the publishing and discovery of cogment\nservices.")),(0,r.kt)("h2",{id:"components-availability-summary"},"Components availability summary"),(0,r.kt)("p",null,"The following table summarizes how each component can either be implemented or used out of the box."),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Component"),(0,r.kt)("th",{parentName:"tr",align:null},"Cogment"),(0,r.kt)("th",{parentName:"tr",align:null},"Python SDK"),(0,r.kt)("th",{parentName:"tr",align:null},"Javascript SDK"),(0,r.kt)("th",{parentName:"tr",align:null},"gRPC API"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Orchestrator"),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/cli/orchestrator"},(0,r.kt)("inlineCode",{parentName:"a"},"cogment services orchestrator"))),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 implement ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#control-api"},"Control API")," & ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#client-actor-api"},"Client Actor API"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Controller"),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#get_controllerself-endpoint"},"get controller")),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/javascript/#getcontrollerendpoint"},"get controller")),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 use ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#control-api"},"Control API"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Environment"),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#register_environmentself-impl-impl_name-default"},"register environment")," & ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#async-serve_all_registeredself-served_endpoint-prometheus_port--8000"},"serve")),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 implement ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#environment-api"},"Environment API"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Actor (Service)"),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#register_actorself-impl-impl_name-actor_classes"},"register actor")," & ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#async-serve_all_registeredself-served_endpoint-prometheus_port--8000"},"serve")),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 implement ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#service-actor-api"},"Service Actor API"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Actor (Client)"),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#register_actorself-impl-impl_name-actor_classes"},"register actor")," & join trial"),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/javascript#registeractorimpl-actorname-actorclass"},"register actor")," & ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/javascript#async-jointrialtrialid-endpoint-actorname"},"join trial")),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 use ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#client-actor-api"},"Client Actor API"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Trial Datastore"),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/cli/trial-datastore/trial-datastore-server"},(0,r.kt)("inlineCode",{parentName:"a"},"cogment services trial_datastore"))),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#register_datalogself-impl"},"register datalog"),", ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#async-serve_all_registeredself-served_endpoint-prometheus_port--8000"},"serve")," & ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#get_datastoreself-endpoint"},"get datastore")),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 implement ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#datalog-api"},"Datalog API")," & ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#trial-datastore-api"},"Trial Datastore API"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Trial Datastore Client"),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/cli/trial-datastore/trial-datastore-client"},(0,r.kt)("inlineCode",{parentName:"a"},"cogment client trial_datastore"))),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#get_datastoreself-endpoint"},"get datastore")),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 use ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#trial-datastore-api"},"Trial Datastore API"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Model Registry"),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/cli/model-registry"},(0,r.kt)("inlineCode",{parentName:"a"},"cogment services model_registry"))),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 implement ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#model-registry-api"},"Model Registry API"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Model Registry Client"),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#async-get_model_registryself-endpointendpoint"},"get model registry")),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 use ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#model-registry-api"},"Model Registry API"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Directory"),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/cli/directory/directory-server"},"`cogment services directory")),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 implement ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#directory-api"},"Directory API"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Directory Client"),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/cli/directory/directory-client"},"`cogment client directory")),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#__init__self-user_id-cog_settings-prometheus_registryprometheus_clientcoreregistry-directory_endpointnone-directory_auth_tokennone"},"use directory")),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 use ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#directory-api"},"Directory API"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Pre Trial Hook"),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#register_datalogself-impl"},"register pre trial hook")," & ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#async-serve_all_registeredself-served_endpoint-prometheus_port--8000"},"serve")),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 implement ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#hook-api"},"Pre Trial Hook API"))))))}m.isMDXComponent=!0},2144:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/RL_abstraction-97a3d1d1c56c3a993dd2bb36282f4cf1.png"},7873:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/actor_concepts-59d5511fbddeac496472cd09d60b3e57.png"},6763:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/cogment_components_SDK-0ee632e26db177c18ff1963a144ec93d.png"},25:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/what-is-cogment-aa58359c5eda0b74440675b36d6ed8f1.png"}}]); \ No newline at end of file diff --git a/assets/js/9b824c8f.ce8974a2.js b/assets/js/9b824c8f.ce8974a2.js new file mode 100644 index 0000000..5105749 --- /dev/null +++ b/assets/js/9b824c8f.ce8974a2.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[2880],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>u});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=a.createContext({}),c=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=c(e.components);return a.createElement(l.Provider,{value:t},e.children)},m="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},h=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,l=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),m=c(n),h=r,u=m["".concat(l,".").concat(h)]||m[h]||d[h]||o;return n?a.createElement(u,i(i({ref:t},p),{},{components:n})):a.createElement(u,i({ref:t},p))}));function u(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,i=new Array(o);i[0]=h;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[m]="string"==typeof e?e:r,i[1]=s;for(var c=2;c<o;c++)i[c]=n[c];return a.createElement.apply(null,i)}return a.createElement.apply(null,n)}h.displayName="MDXCreateElement"},2406:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>i,default:()=>d,frontMatter:()=>o,metadata:()=>s,toc:()=>c});var a=n(7462),r=(n(7294),n(3905));const o={title:"Core Concepts",sidebar_position:1},i="Core Concepts",s={unversionedId:"guide/core-concepts",id:"guide/core-concepts",title:"Core Concepts",description:"Cogment is built around concepts adapted from multi-agent systems (actors, environment), Markov decision processes (action and observation space) and reinforcement learning (trials, rewards). This page aims to explain these concepts at a high level and give some idea of how they are used in Cogment.",source:"@site/docs/guide/core-concepts.md",sourceDirName:"guide",slug:"/guide/core-concepts",permalink:"/docs/guide/core-concepts",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:1,frontMatter:{title:"Core Concepts",sidebar_position:1},sidebar:"docSidebar",previous:{title:"Community",permalink:"/docs/community-channels"},next:{title:"Development guide",permalink:"/docs/guide/development-guide"}},l={},c=[{value:"Environment",id:"environment",level:2},{value:"State and Observation Spaces",id:"state-and-observation-spaces",level:3},{value:"How the Environment works in Cogment",id:"how-the-environment-works-in-cogment",level:3},{value:"Actors",id:"actors",level:2},{value:"Action Space",id:"action-space",level:3},{value:"How Actors work in Cogment",id:"how-actors-work-in-cogment",level:3},{value:"Client and Service Actors",id:"client-and-service-actors",level:4},{value:"Interactions between Actors and the Environment",id:"interactions-between-actors-and-the-environment",level:2},{value:"Trials",id:"trials",level:2},{value:"How Trials work in Cogment",id:"how-trials-work-in-cogment",level:3},{value:"The Specification file",id:"the-specification-file",level:4},{value:"Cogment Architecture",id:"cogment-architecture",level:2},{value:"Context",id:"context",level:3},{value:"Orchestrator",id:"orchestrator",level:3},{value:"Controller",id:"controller",level:3},{value:"Environment",id:"environment-1",level:3},{value:"Actors",id:"actors-1",level:3},{value:"Additional components",id:"additional-components",level:3},{value:"Components availability summary",id:"components-availability-summary",level:2}],p={toc:c},m="wrapper";function d(e){let{components:t,...o}=e;return(0,r.kt)(m,(0,a.Z)({},p,o,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"core-concepts"},"Core Concepts"),(0,r.kt)("p",null,"Cogment is built around concepts adapted from multi-agent systems (actors, environment), Markov decision processes (action and observation space) and reinforcement learning (trials, rewards). This page aims to explain these concepts at a high level and give some idea of how they are used in Cogment."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Basic components of Cogment",src:n(6763).Z,width:"2366",height:"1254"})),(0,r.kt)("p",null,"At the most basic level, Cogment facilitates interactions between ",(0,r.kt)("a",{parentName:"p",href:"#actors"},"Actors")," and their ",(0,r.kt)("a",{parentName:"p",href:"#environment"},"Environment"),". Actors take in observations of the Environment as input, and use these to generate actions as outputs. The Environment takes actions as inputs, and outputs the consequences of that action, such as the next observation and, optionally, a numerical feedback signal about how good or bad the action was (eg. reward)."),(0,r.kt)("p",null,"Cogment is designed so that components like the Environment and the Actors can be run as distributed services with easily interchangeable implementations, and with a system to enable efficient transfer of information between services."),(0,r.kt)("h2",{id:"environment"},"Environment"),(0,r.kt)("p",null,"The Environment is the context in which Cogment ",(0,r.kt)("a",{parentName:"p",href:"#trials"},"Trials")," are run. The Environment is the main integration point between Cogment and an external system, either a ",(0,r.kt)("strong",{parentName:"p"},"simulation")," or a ",(0,r.kt)("strong",{parentName:"p"},"real world system"),"."),(0,r.kt)("p",null,"In the most general terms, the Environment is the world in which a human or computer agent (eg. ",(0,r.kt)("a",{parentName:"p",href:"#actors"},"Actors"),") can take actions. For example, in the Atari game ",(0,r.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/Pong"},"Pong"),', the Environment is the simulated arena in which players control "paddles" to keep a "ball" within the bounds of the screen. The Environment also includes the set of rules for what actions exist (eg. you can move your paddles up and down, but not left and right) and also how the game evolves as a consequence of certain actions being taken.'),(0,r.kt)("h3",{id:"state-and-observation-spaces"},"State and Observation Spaces"),(0,r.kt)("p",null,"The Environment can be in different states. The set of all possible states the Environment could be in is called the \"state space\". Usually an Actor needs to have some knowledge about the current state of the world they're in to make decisions about what action should be taken. The Actor doesn't always get access to every detail about the current state of the Environment, but rather gets ",(0,r.kt)("strong",{parentName:"p"},"observations"),' of the current state. The set of all possible observations an Actor could see is called "observation space". In Cogment, we only explicitly deal with ',(0,r.kt)("strong",{parentName:"p"},"observations")," of the Environment."),(0,r.kt)("h3",{id:"how-the-environment-works-in-cogment"},"How the Environment works in Cogment"),(0,r.kt)("p",null,"In Cogment, the basic outline of the Environment is given in the ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/cogment-yaml"},"specification file"),", which configures what parameters are important for setting up the Environment. The general structure of how an Environment works (eg. what info it takes as input and what it generates as output) is specified in the Environment ",(0,r.kt)("em",{parentName:"p"},"implementation"),", along with the rules of how the Environment responds to a given action and produces subsequent observations for the Actor(s). The Environment implementation is accessed by the ",(0,r.kt)("a",{parentName:"p",href:"#orchestrator"},"Orchestrator")," to run the Environment during ",(0,r.kt)("a",{parentName:"p",href:"#trials"},"Trials"),"."),(0,r.kt)("p",null,"Using one of ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/development-guide"},"Cogment's SDKs"),", the Environment can be implemented as a function integrating a ",(0,r.kt)("em",{parentName:"p"},'"state of the world"')," with the Trial. This function performs the following tasks during the Trial:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Generate Observations from the current state of the world, for example retrieving the visible objects from a 3D simulation."),(0,r.kt)("li",{parentName:"ul"},"Apply the Actions, thus updating the state of the world, for example changing the velocity of a moving vehicle in a race simulation."),(0,r.kt)("li",{parentName:"ul"},"Evaluate the performance of ",(0,r.kt)("a",{parentName:"li",href:"#actors"},"Actors")," and send them Rewards, for example by checking if a vehicle crossed the finish line in a race simulation.")),(0,r.kt)("h2",{id:"actors"},"Actors"),(0,r.kt)("p",null,"Actors are roles that can ",(0,r.kt)("em",{parentName:"p"},"do")," stuff, eg. Actors take actions which may affect the state of the Environment. In Cogment, Actors can be either humans or computer-based agents and effectively operate identically."),(0,r.kt)("h3",{id:"action-space"},"Action Space"),(0,r.kt)("p",null,'Actors take Observations about the current state of the Environment as inputs, and produce actions as outputs. The set of all actions that can be produced is called the "Action space".'),(0,r.kt)("p",null,"Each Actor can get a different Observation from the Environment representing what it perceives about the state of the world. The action represents the decision the Actor takes upon receiving this observation. The action selected by the Actor is then applied by the Environment. Cogment leverages this discrete update to orchestrate the execution of the components and the dispatch of data between them."),(0,r.kt)("h3",{id:"how-actors-work-in-cogment"},"How Actors work in Cogment"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Concepts of Actors in Cogment",src:n(7873).Z,width:"1900",height:"1410"})),(0,r.kt)("p",null,'Cogment allocates a dedicated gRPC service to run the computations of Actors, which we call the "Actor Service". It can also refer to the computational node running this service. This service effectively offers the registered actor implementations for use in trials.'),(0,r.kt)("p",null,"The Actor class specifies what kinds of inputs and outputs to expect. The class definition specifies ",(0,r.kt)("em",{parentName:"p"},"what")," an actor is."),(0,r.kt)("p",null,"The Actor implementation is the function the Actor uses to compute what action to take given some input information. If we want to have a bunch of different Actors that all behave similarly (take same kind of inputs and produce same kind of outputs) we can define an Actor class and different instances of that class can use different implementations."),(0,r.kt)("h4",{id:"client-and-service-actors"},"Client and Service Actors"),(0,r.kt)("p",null,"An Actor might be controlled either by a software agent, or by a Human. Whichever the case, the process of generating actions based on observations remains the same, and the ",(0,r.kt)("a",{parentName:"p",href:"#environment"},"Environment"),' treats them the same. Some Actors connect to the trial (we call them "client" Actors) and others will wait for the trial to connect to them (we call these "service" Actors). Service Actors are run on a designated computational node called the Actor Service.'),(0,r.kt)("h2",{id:"interactions-between-actors-and-the-environment"},"Interactions between Actors and the Environment"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Basic concepts",src:n(2144).Z,width:"1864",height:"694"})),(0,r.kt)("p",null,"The Observations and Actions we discussed above are the key pieces of information exchanged between Actors and the Environment."),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Environments take actions as an input and output observations,"),(0,r.kt)("li",{parentName:"ul"},"Actors take observations as an input and output actions.")),(0,r.kt)("p",null,"As discussed before, the Environment can also provide feedback to the Actor about their actions in the form of a numerical reward signal, but it is not strictly necessary for the Environment to do so."),(0,r.kt)("p",null,"In Cogment, Actors and the Environment exchange information via the ",(0,r.kt)("a",{parentName:"p",href:"#orchestrator"},"Orchestrator")," - a core component of Cogment which facilitates the interaction of distributed services. To do so, the observation and action space for the Actors and the Environment are defined as typed data structures. Cogment uses ",(0,r.kt)("a",{parentName:"p",href:"https://developers.google.com/protocol-buffers/"},"Protocol Buffers")," as a format to specify these data structures. This typing defines both an interface contract between the Actors and the Environment and helps convey semantic information, thus facilitating the independent design and development of both. In practice this enables the Actors and Environment to be run as separate services (eg. on separate computational nodes) and have the ",(0,r.kt)("a",{parentName:"p",href:"#orchestrator"},"Orchestrator")," pass these protobuf messages between the different services as needed."),(0,r.kt)("h2",{id:"trials"},"Trials"),(0,r.kt)("p",null,"Trials are how a Cogment deployment runs the sequential interactions between ",(0,r.kt)("a",{parentName:"p",href:"#actors"},"Actors")," and their ",(0,r.kt)("a",{parentName:"p",href:"#environment"},"Environment"),". A trial is defined by the participating ",(0,r.kt)("a",{parentName:"p",href:"#actors"},"Actors")," and the host ",(0,r.kt)("a",{parentName:"p",href:"#environment"},"Environment"),". As a concept, Trials are quite close to Reinforcement Learning's ",(0,r.kt)("strong",{parentName:"p"},"Episodes"),", i.e. all the states that come between an initial state and a terminal state. However, because Cogment can be used outside of an RL context, we prefer using the more generic term of Trial."),(0,r.kt)("h3",{id:"how-trials-work-in-cogment"},"How Trials work in Cogment"),(0,r.kt)("p",null,"Trials are started by clients connecting to Cogment. A trial can end either by being terminated from a client or end by itself, for example once a specific state of the Environment is reached."),(0,r.kt)("p",null,"During the trial:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("a",{parentName:"li",href:"#environment"},"Environment")," generates ",(0,r.kt)("a",{parentName:"li",href:"#states-and-observations"},(0,r.kt)("strong",{parentName:"a"},"observations"))," of its internal state and sends them to the ",(0,r.kt)("a",{parentName:"li",href:"#actors"},"Actors"),"."),(0,r.kt)("li",{parentName:"ul"},"Given these observations, each Actor chooses and sends an action."),(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("a",{parentName:"li",href:"#environment"},"Environment")," receives the actions and updates its internal state."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("strong",{parentName:"li"},"Rewards")," can be sent to the ",(0,r.kt)("a",{parentName:"li",href:"#actors"},"Actors")," from either the Environment or other Actors. A reward is a measure of an actor\u2019s performance within the environment at a given point in time during the trial."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#actors"},"Actors")," receive ",(0,r.kt)("strong",{parentName:"li"},"rewards")," if at least one was sent to them."),(0,r.kt)("li",{parentName:"ul"},"A log of the activity during the trial (observations, actions, rewards) is produced and can be stored.")),(0,r.kt)("h4",{id:"the-specification-file"},"The Specification file"),(0,r.kt)("p",null,"The configurations for how trial elements are set up are defined in a YAML specification file typically called ",(0,r.kt)("inlineCode",{parentName:"p"},"cogment.yaml"),". This file details how elements of the project work, including its actor classes and their action & observation spaces. You can learn more about the specification file in the ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/cogment-yaml"},"dedicated reference page"),"."),(0,r.kt)("hr",null),(0,r.kt)("h2",{id:"cogment-architecture"},"Cogment Architecture"),(0,r.kt)("p",null,"Running trials with Cogment usually involves the deployment of a cluster of services and clients. These components are either provided by the Cogment framework, depicted below in blue, or implemented for a particular project with Software Development Kits (SDKs) in either Python or Javascript, depicted below in orange."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Cogment Architecture",src:n(25).Z,width:"2438",height:"1214"})),(0,r.kt)("p",null,"User implemented components use one of the ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/development-guide"},"Cogment SDKs")," or directly implement the ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/grpc"},"underlying protocol"),". Components communicate using ",(0,r.kt)("a",{parentName:"p",href:"https://grpc.io"},"gRPC"),", clients can also communicate in a web-friendly way using ",(0,r.kt)("a",{parentName:"p",href:"https://grpc.io/docs/platforms/web/"},"gRPC-Web")," and ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/improbable-eng/grpc-web/tree/master/go/grpcwebproxy"},"grpcwebproxy"),"."),(0,r.kt)("h3",{id:"context"},"Context"),(0,r.kt)("p",null,"The Context is a point of entry for Cogment to interface with the different services through SDKs. See also the SDK documentation for Context (",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/python#class-controller"},"Python")," | ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/javascript#class-cogmentcontext"},"JavaScript"),")."),(0,r.kt)("h3",{id:"orchestrator"},"Orchestrator"),(0,r.kt)("p",null,"The Orchestrator is the glue that binds everything together. It is responsible for running the ",(0,r.kt)("a",{parentName:"p",href:"#Trials"},"Trials")," and contacting other services as needed to ensure their execution."),(0,r.kt)("p",null,"The key aspect of Cogment's orchestrator is its capacity to handle a number of network connections in parallel while keeping its responsiveness."),(0,r.kt)("h3",{id:"controller"},"Controller"),(0,r.kt)("p",null,"The Controller is a key part of using Cogment, it initiates communication with the Orchestrator to control the execution of ",(0,r.kt)("a",{parentName:"p",href:"#trials"},"Trials"),". It is responsible for starting Trials, retrieving and watching their state (including the end of the trial), or requesting trial termination. You can see more in the ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/python#class-controller"},"Python SDK documentation")," for the Controller. The Controller is created by the ",(0,r.kt)("a",{parentName:"p",href:"#context"},"Context"),"."),(0,r.kt)("h3",{id:"environment-1"},"Environment"),(0,r.kt)("p",null,"The Environment implementation is accessed by the ",(0,r.kt)("a",{parentName:"p",href:"#orchestrator"},"Orchestrator")," to run the ",(0,r.kt)("a",{parentName:"p",href:"#environment"},"Environment")," during ",(0,r.kt)("a",{parentName:"p",href:"#trials"},"Trials"),"."),(0,r.kt)("p",null,"Using one of ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/development-guide"},"Cogment's SDKs"),", the Environment can be implemented as a function integrating a ",(0,r.kt)("em",{parentName:"p"},'"state of the world"')," with the Trial. This function performs the following tasks during the Trial:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Generate Observations from the current ",(0,r.kt)("em",{parentName:"li"},"state of the world"),", for example retrieving the visible objects from a 3D simulation."),(0,r.kt)("li",{parentName:"ul"},"Apply the Actions, thus updating the ",(0,r.kt)("em",{parentName:"li"},"state of the world"),", for example changing the velocity of a moving vehicle in a race simulation."),(0,r.kt)("li",{parentName:"ul"},"Evaluate the performance of ",(0,r.kt)("a",{parentName:"li",href:"#actors"},"Actors")," and send them Rewards, for example by checking if a vehicle crossed the finish line in a race simulation.")),(0,r.kt)("h3",{id:"actors-1"},"Actors"),(0,r.kt)("p",null,"Cogment handles Actors in two different ways: either as a ",(0,r.kt)("em",{parentName:"p"},"service Actor")," or as a ",(0,r.kt)("em",{parentName:"p"},"client Actor"),". ",(0,r.kt)("strong",{parentName:"p"},"Service Actor")," implementations are accessed by the ",(0,r.kt)("a",{parentName:"p",href:"#orchestrator"},"Orchestrator")," during ",(0,r.kt)("a",{parentName:"p",href:"#trials"},"Trials"),", while ",(0,r.kt)("strong",{parentName:"p"},"Client Actor")," implementations join a Trial by initiating the communication with the Orchestrator. Client Actors implementations can ",(0,r.kt)("em",{parentName:"p"},"reach")," a Cogment deployment through ",(0,r.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/NAT_traversal"},"NAT traversal"),". This makes them particularly well-suited to implement human-driven Actors, in web-browsers for example."),(0,r.kt)("p",null,"Using one of ",(0,r.kt)("a",{parentName:"p",href:"/docs/guide/development-guide"},"Cogment's SDKs")," Actors can be implemented as functions handling the integration between a decision-making Actor (software agent or Human) and the ",(0,r.kt)("a",{parentName:"p",href:"#trials"},"Trial"),". This function performs the following tasks during the Trial:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Receive Observations and do Actions in response, for example vectorizing the retrieved observation, feeding it to a neural network and converting its output to an Action."),(0,r.kt)("li",{parentName:"ul"},"Receive Rewards, for example using them to update a neural network."),(0,r.kt)("li",{parentName:"ul"},"Optionally: send and receive direct messages.")),(0,r.kt)("p",null,"Please note that rewards can also be retrieved after the fact using a ",(0,r.kt)("a",{parentName:"p",href:"#additional-optional-services"},"datalog"),"."),(0,r.kt)("h3",{id:"additional-components"},"Additional components"),(0,r.kt)("p",null,"On top of the core components described above, a Cogment deployment can include these additional ones:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("strong",{parentName:"li"},"Datalog")," services can be used to listen to the activity during a trial (actions, observations, rewards, messages)\nin order to, for example, store these data for the offline training of AI agents.\nThe ",(0,r.kt)("a",{parentName:"li",href:"/docs/reference/cli/trial-datastore/trial-datastore-server"},(0,r.kt)("strong",{parentName:"a"},"Trial Datastore"))," is an out-of-the-box implementation\nof this."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/reference/cli/model-registry"},(0,r.kt)("strong",{parentName:"a"},"Model Registry"))," handles the storage and dispatch of AI models trained with\nCogment and used by the actors."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/reference/cli/directory/directory-server"},(0,r.kt)("strong",{parentName:"a"},"Directory"))," handles the publishing and discovery of cogment\nservices.")),(0,r.kt)("h2",{id:"components-availability-summary"},"Components availability summary"),(0,r.kt)("p",null,"The following table summarizes how each component can either be implemented or used out of the box."),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Component"),(0,r.kt)("th",{parentName:"tr",align:null},"Cogment"),(0,r.kt)("th",{parentName:"tr",align:null},"Python SDK"),(0,r.kt)("th",{parentName:"tr",align:null},"Javascript SDK"),(0,r.kt)("th",{parentName:"tr",align:null},"gRPC API"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Orchestrator"),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/cli/orchestrator"},(0,r.kt)("inlineCode",{parentName:"a"},"cogment services orchestrator"))),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 implement ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#control-api"},"Control API")," & ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#client-actor-api"},"Client Actor API"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Controller"),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#get_controllerself-endpoint"},"get controller")),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/javascript/#getcontrollerendpoint"},"get controller")),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 use ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#control-api"},"Control API"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Environment"),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#register_environmentself-impl-impl_name-default"},"register environment")," & ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#async-serve_all_registeredself-served_endpoint-prometheus_port--8000"},"serve")),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 implement ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#environment-api"},"Environment API"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Actor (Service)"),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#register_actorself-impl-impl_name-actor_classes"},"register actor")," & ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#async-serve_all_registeredself-served_endpoint-prometheus_port--8000"},"serve")),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 implement ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#service-actor-api"},"Service Actor API"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Actor (Client)"),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#register_actorself-impl-impl_name-actor_classes"},"register actor")," & join trial"),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/javascript#registeractorimpl-actorname-actorclass"},"register actor")," & ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/javascript#async-jointrialtrialid-endpoint-actorname"},"join trial")),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 use ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#client-actor-api"},"Client Actor API"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Trial Datastore"),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/cli/trial-datastore/trial-datastore-server"},(0,r.kt)("inlineCode",{parentName:"a"},"cogment services trial_datastore"))),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#register_datalogself-impl"},"register datalog"),", ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#async-serve_all_registeredself-served_endpoint-prometheus_port--8000"},"serve")," & ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#get_datastoreself-endpoint"},"get datastore")),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 implement ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#datalog-api"},"Datalog API")," & ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#trial-datastore-api"},"Trial Datastore API"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Trial Datastore Client"),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/cli/trial-datastore/trial-datastore-client"},(0,r.kt)("inlineCode",{parentName:"a"},"cogment client trial_datastore"))),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#get_datastoreself-endpoint"},"get datastore")),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 use ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#trial-datastore-api"},"Trial Datastore API"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Model Registry"),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/cli/model-registry"},(0,r.kt)("inlineCode",{parentName:"a"},"cogment services model_registry"))),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 implement ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#model-registry-api"},"Model Registry API"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Model Registry Client"),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#async-get_model_registryself-endpointendpoint"},"get model registry")),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 use ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#model-registry-api"},"Model Registry API"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Directory"),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/cli/directory/directory-server"},"`cogment services directory")),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 implement ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#directory-api"},"Directory API"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Directory Client"),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/cli/directory/directory-client"},"`cogment client directory")),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#__init__self-user_id-cog_settings-prometheus_registryprometheus_clientcoreregistry-directory_endpointnone-directory_auth_tokennone"},"use directory")),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 use ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#directory-api"},"Directory API"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Pre Trial Hook"),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#register_datalogself-impl"},"register pre trial hook")," & ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/python#async-serve_all_registeredself-served_endpoint-prometheus_port--8000"},"serve")),(0,r.kt)("td",{parentName:"tr",align:null}),(0,r.kt)("td",{parentName:"tr",align:null},"\u2705 implement ",(0,r.kt)("a",{parentName:"td",href:"/docs/reference/grpc#hook-api"},"Pre Trial Hook API"))))))}d.isMDXComponent=!0},2144:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/RL_abstraction-97a3d1d1c56c3a993dd2bb36282f4cf1.png"},7873:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/actor_concepts-59d5511fbddeac496472cd09d60b3e57.png"},6763:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/cogment_components_SDK-0ee632e26db177c18ff1963a144ec93d.png"},25:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/what-is-cogment-aa58359c5eda0b74440675b36d6ed8f1.png"}}]); \ No newline at end of file diff --git a/assets/js/a57d321a.60ac5400.js b/assets/js/a57d321a.60ac5400.js new file mode 100644 index 0000000..68c8125 --- /dev/null +++ b/assets/js/a57d321a.60ac5400.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[916],{3905:(e,t,n)=>{n.d(t,{Zo:()=>m,kt:()=>g});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var d=r.createContext({}),s=function(e){var t=r.useContext(d),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},m=function(e){var t=s(e.components);return r.createElement(d.Provider,{value:t},e.children)},c="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},u=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,o=e.originalType,d=e.parentName,m=l(e,["components","mdxType","originalType","parentName"]),c=s(n),u=i,g=c["".concat(d,".").concat(u)]||c[u]||p[u]||o;return n?r.createElement(g,a(a({ref:t},m),{},{components:n})):r.createElement(g,a({ref:t},m))}));function g(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var o=n.length,a=new Array(o);a[0]=u;var l={};for(var d in t)hasOwnProperty.call(t,d)&&(l[d]=t[d]);l.originalType=e,l[c]="string"==typeof e?e:i,a[1]=l;for(var s=2;s<o;s++)a[s]=n[s];return r.createElement.apply(null,a)}return r.createElement.apply(null,n)}u.displayName="MDXCreateElement"},5676:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>a,default:()=>p,frontMatter:()=>o,metadata:()=>l,toc:()=>s});var r=n(7462),i=(n(7294),n(3905));const o={title:"Model Registry",sidebar_position:4},a="Model Registry",l={unversionedId:"reference/cli/model-registry",id:"reference/cli/model-registry",title:"Model Registry",description:"Cogment Model Registry is designed to store and make available AI models to be used by Cogment actors.",source:"@site/docs/reference/cli/model-registry.md",sourceDirName:"reference/cli",slug:"/reference/cli/model-registry",permalink:"/docs/reference/cli/model-registry",draft:!1,tags:[],version:"current",lastUpdatedAt:1691703005,formattedLastUpdatedAt:"Aug 10, 2023",sidebarPosition:4,frontMatter:{title:"Model Registry",sidebar_position:4},sidebar:"docSidebar",previous:{title:"Client",permalink:"/docs/reference/cli/trial-datastore/trial-datastore-client"},next:{title:"Web Proxy",permalink:"/docs/reference/cli/web-proxy"}},d={},s=[{value:"Command line",id:"command-line",level:2},{value:"Configuration",id:"configuration",level:2},{value:"<code>port</code>",id:"port",level:3},{value:"<code>grpc_reflection</code>",id:"grpc_reflection",level:3},{value:"<code>archive_dir</code>",id:"archive_dir",level:3},{value:"<code>cache_max_items</code>",id:"cache_max_items",level:3},{value:"<code>sent_version_chunk_size</code>",id:"sent_version_chunk_size",level:3},{value:"<code>log_level</code>",id:"log_level",level:3},{value:"<code>log_file</code>",id:"log_file",level:3},{value:"<code>directory_endpoint</code>",id:"directory_endpoint",level:3},{value:"<code>directory_authentication_token</code>",id:"directory_authentication_token",level:3},{value:"<code>directory_registration_host</code>",id:"directory_registration_host",level:3},{value:"<code>directory_registration_properties</code>",id:"directory_registration_properties",level:3},{value:"API usage examples",id:"api-usage-examples",level:2},{value:"Create or update a model - <code>cogmentAPI.ModelRegistrySP/CreateOrUpdateModel( .cogmentAPI.CreateOrUpdateModelRequest ) returns ( .cogmentAPI.CreateOrUpdateModelReply );</code>",id:"create-or-update-a-model---cogmentapimodelregistryspcreateorupdatemodel-cogmentapicreateorupdatemodelrequest--returns--cogmentapicreateorupdatemodelreply-",level:3},{value:"Delete a model - <code>cogmentAPI.ModelRegistrySP/DeleteModel( .cogmentAPI.DeleteModelRequest ) returns ( .cogmentAPI.DeleteModelReply );</code>",id:"delete-a-model---cogmentapimodelregistryspdeletemodel-cogmentapideletemodelrequest--returns--cogmentapideletemodelreply-",level:3},{value:"Retrieve models - <code>cogmentAPI.ModelRegistrySP/RetrieveModels( .cogmentAPI.RetrieveModelsRequest ) returns ( .cogmentAPI.RetrieveModelsReply );</code>",id:"retrieve-models---cogmentapimodelregistryspretrievemodels-cogmentapiretrievemodelsrequest--returns--cogmentapiretrievemodelsreply-",level:3},{value:"List the models",id:"list-the-models",level:4},{value:"Retrieve specific model(s)",id:"retrieve-specific-models",level:4},{value:"Create a model iteration - <code>cogmentAPI.ModelRegistrySP/CreateVersion( stream .cogmentAPI.CreateVersionRequestChunk ) returns ( .cogmentAPI.CreateVersionReply );</code>",id:"create-a-model-iteration---cogmentapimodelregistryspcreateversion-stream-cogmentapicreateversionrequestchunk--returns--cogmentapicreateversionreply-",level:3},{value:"Retrieve model iteration infos - <code>cogmentAPI.ModelRegistrySP/RetrieveVersionInfos ( .cogmentAPI.RetrieveVersionInfosRequest ) returns ( .cogmentAPI.RetrieveVersionInfosReply );</code>",id:"retrieve-model-iteration-infos---cogmentapimodelregistryspretrieveversioninfos--cogmentapiretrieveversioninfosrequest--returns--cogmentapiretrieveversioninfosreply-",level:3},{value:"List the iterations of a model",id:"list-the-iterations-of-a-model",level:4},{value:"Retrieve specific iterations of a model",id:"retrieve-specific-iterations-of-a-model",level:4},{value:"Retrieve the n-th to last iterations of a model",id:"retrieve-the-n-th-to-last-iterations-of-a-model",level:4},{value:"Retrieve given iteration data - <code>cogmentAPI.ModelRegistrySP/RetrieveVersionData ( .cogmentAPI.RetrieveVersionDataRequest ) returns ( stream .cogmentAPI.RetrieveVersionDataReplyChunk );</code>",id:"retrieve-given-iteration-data---cogmentapimodelregistryspretrieveversiondata--cogmentapiretrieveversiondatarequest--returns--stream-cogmentapiretrieveversiondatareplychunk-",level:3}],m={toc:s},c="wrapper";function p(e){let{components:t,...n}=e;return(0,i.kt)(c,(0,r.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"model-registry"},"Model Registry"),(0,i.kt)("p",null,"Cogment Model Registry is designed to store and make available AI models to be used by Cogment actors."),(0,i.kt)("p",null,"The Model Registry manages models in two ways:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Transient")," (non-archived) model iterations can be used to publish an updated model to users, e.g. during training. Transient model iterations are stored in memory and can be evicted, in particular once the memory limit is reached."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Stored")," model iterations are stored on the filesystem and should be used for long-term storage of specific iterations, e.g. for validation or deployment purposes.")),(0,i.kt)("h2",{id:"command-line"},"Command line"),(0,i.kt)("p",null,"The Model Registry is simply called this way"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"$ cogment services model_registry --port=9000 --archive_dir=./models/\n")),(0,i.kt)("h2",{id:"configuration"},"Configuration"),(0,i.kt)("p",null,"The Model Registry configuration can be specified either through the command line or environment variables."),(0,i.kt)("h3",{id:"port"},(0,i.kt)("inlineCode",{parentName:"h3"},"port")),(0,i.kt)("p",null,"The TCP port where to serve the ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/grpc#model-registry-api"},"The Model Registry API"),"."),(0,i.kt)("p",null,"If set to 0, then the system will automatically choose a free port.\nThis is normally used in combination with a ",(0,i.kt)("a",{parentName:"p",href:"#directory_endpoint"},"Directory"),"."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--port=12000"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_MODEL_REGISTRY_PORT=12000"),","),(0,i.kt)("li",{parentName:"ul"},"its default value is 9002.")),(0,i.kt)("h3",{id:"grpc_reflection"},(0,i.kt)("inlineCode",{parentName:"h3"},"grpc_reflection")),(0,i.kt)("p",null,"Whether or not to enable ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/grpc/grpc/blob/master/doc/server-reflection.md"},"gRPC reflection")," on the served endpoints."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line flag, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--grpc_reflection"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_MODEL_REGISTRY_GRPC_REFLECTION=1"),","),(0,i.kt)("li",{parentName:"ul"},"by default, it is disabled.")),(0,i.kt)("h3",{id:"archive_dir"},(0,i.kt)("inlineCode",{parentName:"h3"},"archive_dir")),(0,i.kt)("p",null,"Path to the directory to store archived model iterations and model metadata."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--archive_dir=./path/to/models/"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_MODEL_REGISTRY_ARCHIVE_DIR=./path/to/models/"),","),(0,i.kt)("li",{parentName:"ul"},"its default value is ",(0,i.kt)("inlineCode",{parentName:"li"},".cogment/model_registry"))),(0,i.kt)("h3",{id:"cache_max_items"},(0,i.kt)("inlineCode",{parentName:"h3"},"cache_max_items")),(0,i.kt)("p",null,"This defines the maximum number of model iterations that can be stored in the transient cache."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--cache_max_items=500"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_MODEL_REGISTRY_VERSION_CACHE_MAX_ITEMS=500"),","),(0,i.kt)("li",{parentName:"ul"},"its default value is 100.")),(0,i.kt)("h3",{id:"sent_version_chunk_size"},(0,i.kt)("inlineCode",{parentName:"h3"},"sent_version_chunk_size")),(0,i.kt)("p",null,"The maximum size for model iteration data chunk sent by the server. It is defined in bytes."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--sent_version_chunk_size=100000"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_MODEL_REGISTRY_SENT_MODEL_VERSION_DATA_CHUNK_SIZE=100000"),","),(0,i.kt)("li",{parentName:"ul"},"its default value is 2097152 Bytes, i.e. 2MB.")),(0,i.kt)("h3",{id:"log_level"},(0,i.kt)("inlineCode",{parentName:"h3"},"log_level")),(0,i.kt)("p",null,"Set to define the minimum level for logging. Possible values are: ",(0,i.kt)("inlineCode",{parentName:"p"},"off"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"error"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"warning"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"info"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"debug"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"trace"),". Note however that all trace and most debug level logs will only output if running the debug compiled version of the Orchestrator."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--log_level=debug"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_LOG_LEVEL=5"),","),(0,i.kt)("li",{parentName:"ul"},"default value is info.")),(0,i.kt)("h3",{id:"log_file"},(0,i.kt)("inlineCode",{parentName:"h3"},"log_file")),(0,i.kt)("p",null,"Base file name for daily log output. The name will be suffixed with the date and a new file will be made every day. If not provided the logs go to stdout."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--log_file=./path/to/cogment.log"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_LOG_FILE=./path/to/cogment.log"),","),(0,i.kt)("li",{parentName:"ul"},"default value is info.")),(0,i.kt)("h3",{id:"directory_endpoint"},(0,i.kt)("inlineCode",{parentName:"h3"},"directory_endpoint")),(0,i.kt)("p",null,"Cogment endpoint of the directory service. It must be a ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#grpc-scheme"},"gRPC endpoint"),". The directory will be used to register the model registry service for discovery by other services. If not provided, the model registry will not auto register, in which case manual registration to the directory must be done, or an explicit address must be provided to access the model registry."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--directory_endpoint=grpc://foo:9005"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005"),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")),(0,i.kt)("h3",{id:"directory_authentication_token"},(0,i.kt)("inlineCode",{parentName:"h3"},"directory_authentication_token")),(0,i.kt)("p",null,"Authentication token for services registered in the Directory. It is recorded in the Directory when registering a service. And a matching token must be provided to inquire for the service. An empty token is the same as no token."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--directory_authentication_token=GH670ploT"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT"),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")),(0,i.kt)("h3",{id:"directory_registration_host"},(0,i.kt)("inlineCode",{parentName:"h3"},"directory_registration_host")),(0,i.kt)("p",null,"This is the host that will be registered to the Directory for the Model Registry service. If not provided, the Model Registry will determine its own IP address and use that as the registration host."),(0,i.kt)("p",null,"In some circumstances, the IP address determined by Cogment may be wrong (e.g. multiple interfaces, load balancing, firewall), thus a host (hostname or IP address) must be explicitly provided."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--directory_registration_host=foo.bar"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_MODEL_REGISTRY_DIRECTORY_REGISTRATION_HOST=foo.bar"),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value (i.e. self determined IP address is used).")),(0,i.kt)("h3",{id:"directory_registration_properties"},(0,i.kt)("inlineCode",{parentName:"h3"},"directory_registration_properties")),(0,i.kt)("p",null,'These are the properties that will be registered to the Directory for the Model Registry service. When inquiring the Directory, the properties inquired must match the properties registered. This is a string representing multiple properties in the form "name=value,name=value,name=value" where the values are optional.'),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'--directory_registration_properties="Sim=20,hpp,mem=HIGH"'),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'COGMENT_MODEL_REGISTRY_DIRECTORY_REGISTRATION_PROPERTIES="Sim=20,hpp,mem=HIGH"'),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")),(0,i.kt)("h2",{id:"api-usage-examples"},"API usage examples"),(0,i.kt)("p",null,"::: tip"),(0,i.kt)("p",null,"The following examples require ",(0,i.kt)("inlineCode",{parentName:"p"},"COGMENT_MODEL_REGISTRY_GRPC_REFLECTION")," to be enabled as well as ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/fullstorydev/grpcurl"},"grpcurl"),"_"),(0,i.kt)("p",null,":::"),(0,i.kt)("h3",{id:"create-or-update-a-model---cogmentapimodelregistryspcreateorupdatemodel-cogmentapicreateorupdatemodelrequest--returns--cogmentapicreateorupdatemodelreply-"},"Create or update a model - ",(0,i.kt)("inlineCode",{parentName:"h3"},"cogmentAPI.ModelRegistrySP/CreateOrUpdateModel( .cogmentAPI.CreateOrUpdateModelRequest ) returns ( .cogmentAPI.CreateOrUpdateModelReply );")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-console"},'$ echo "{\\"model_info\\":{\\"model_id\\":\\"my_model\\",\\"user_data\\":{\\"type\\":\\"my_model_type\\"}}}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/CreateOrUpdateModel\n{\n\n}\n')),(0,i.kt)("h3",{id:"delete-a-model---cogmentapimodelregistryspdeletemodel-cogmentapideletemodelrequest--returns--cogmentapideletemodelreply-"},"Delete a model - ",(0,i.kt)("inlineCode",{parentName:"h3"},"cogmentAPI.ModelRegistrySP/DeleteModel( .cogmentAPI.DeleteModelRequest ) returns ( .cogmentAPI.DeleteModelReply );")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-console"},'$ echo "{\\"model_id\\":\\"my_model\\"}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/DeleteModel\n{\n\n}\n')),(0,i.kt)("h3",{id:"retrieve-models---cogmentapimodelregistryspretrievemodels-cogmentapiretrievemodelsrequest--returns--cogmentapiretrievemodelsreply-"},"Retrieve models - ",(0,i.kt)("inlineCode",{parentName:"h3"},"cogmentAPI.ModelRegistrySP/RetrieveModels( .cogmentAPI.RetrieveModelsRequest ) returns ( .cogmentAPI.RetrieveModelsReply );")),(0,i.kt)("p",null,(0,i.kt)("em",{parentName:"p"},"These examples require ",(0,i.kt)("inlineCode",{parentName:"em"},"COGMENT_MODEL_REGISTRY_GRPC_REFLECTION")," to be enabled as well as ",(0,i.kt)("a",{parentName:"em",href:"https://github.com/fullstorydev/grpcurl"},"grpcurl"))),(0,i.kt)("h4",{id:"list-the-models"},"List the models"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-console"},'$ echo "{}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/RetrieveModels\n{\n "modelInfos": [\n {\n "modelId": "my_model",\n "userData": {\n "type": "my_model_type"\n }\n },\n {\n "modelId": "my_other_model",\n "userData": {\n "type": "my_model_type"\n }\n }\n ],\n "nextModelHandle": "2"\n}\n')),(0,i.kt)("h4",{id:"retrieve-specific-models"},"Retrieve specific model(s)"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-console"},'$ echo "{\\"model_ids\\":[\\"my_other_model\\"]}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/RetrieveModels\n{\n "modelInfos": [\n {\n "modelId": "my_other_model",\n "userData": {\n "type": "my_model_type"\n }\n }\n ],\n "nextModelHandle": "1"\n}\n')),(0,i.kt)("h3",{id:"create-a-model-iteration---cogmentapimodelregistryspcreateversion-stream-cogmentapicreateversionrequestchunk--returns--cogmentapicreateversionreply-"},"Create a model iteration - ",(0,i.kt)("inlineCode",{parentName:"h3"},"cogmentAPI.ModelRegistrySP/CreateVersion( stream .cogmentAPI.CreateVersionRequestChunk ) returns ( .cogmentAPI.CreateVersionReply );")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-console"},'$ echo "{\\"header\\":{\\"version_info\\":{\n \\"model_id\\":\\"my_model\\",\\\n \\"archived\\":true,\\\n \\"data_size\\":$(printf chunk_1chunk_2 | wc -c)\\\n }}}\\\n {\\"body\\":{\\\n \\"data_chunk\\":\\"$(printf chunk_1 | base64)\\"\\\n }}\\\n {\\"body\\":{\\\n \\"data_chunk\\":\\"$(printf chunk_2 | base64)\\"\\\n }}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/CreateVersion\n{\n "versionInfo": {\n "modelId": "my_model",\n "versionNumber": 2,\n "creationTimestamp": "907957639",\n "archived": true,\n "dataHash": "jY0g3VkUK62ILPr2JuaW5g7uQi0EcJVZJu8IYp3yfhI=",\n "dataSize": "14"\n }\n}\n')),(0,i.kt)("h3",{id:"retrieve-model-iteration-infos---cogmentapimodelregistryspretrieveversioninfos--cogmentapiretrieveversioninfosrequest--returns--cogmentapiretrieveversioninfosreply-"},"Retrieve model iteration infos - ",(0,i.kt)("inlineCode",{parentName:"h3"},"cogmentAPI.ModelRegistrySP/RetrieveVersionInfos ( .cogmentAPI.RetrieveVersionInfosRequest ) returns ( .cogmentAPI.RetrieveVersionInfosReply );")),(0,i.kt)("h4",{id:"list-the-iterations-of-a-model"},"List the iterations of a model"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-console"},'$ echo "{\\"model_id\\":\\"my_model\\"}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/RetrieveVersionInfos\n{\n "versionInfos": [\n {\n "modelId": "my_model",\n "versionNumber": 1,\n "creationTimestamp": "1633119005107454620",\n "archived": true,\n "dataHash": "jY0g3VkUK62ILPr2JuaW5g7uQi0EcJVZJu8IYp3yfhI=",\n "dataSize": "14"\n },\n {\n "modelId": "my_model",\n "versionNumber": 2,\n "creationTimestamp": "1633119625907957639",\n "archived": true,\n "dataHash": "jY0g3VkUK62ILPr2JuaW5g7uQi0EcJVZJu8IYp3yfhI=",\n "dataSize": "14"\n }\n ],\n "nextVersionHandle": "3"\n}\n')),(0,i.kt)("h4",{id:"retrieve-specific-iterations-of-a-model"},"Retrieve specific iterations of a model"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-console"},'$ echo "{\\"model_id\\":\\"my_model\\", \\"version_numbers\\":[1]}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/RetrieveVersionInfos\n{\n "versionInfos": [\n {\n "modelId": "my_model",\n "versionNumber": 1,\n "creationTimestamp": "1633119005107454620",\n "archived": true,\n "dataHash": "jY0g3VkUK62ILPr2JuaW5g7uQi0EcJVZJu8IYp3yfhI=",\n "dataSize": "14"\n }\n ],\n "nextVersionHandle": "2"\n}\n')),(0,i.kt)("h4",{id:"retrieve-the-n-th-to-last-iterations-of-a-model"},"Retrieve the n-th to last iterations of a model"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-console"},'$ echo "{\\"model_id\\":\\"my_model\\", \\"version_numbers\\":[-2]}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/RetrieveVersionInfos\n{\n "versionInfos": [\n {\n "modelId": "my_model",\n "versionNumber": 1,\n "creationTimestamp": "1633119005107454620",\n "archived": true,\n "dataHash": "jY0g3VkUK62ILPr2JuaW5g7uQi0EcJVZJu8IYp3yfhI=",\n "dataSize": "14"\n }\n ],\n "nextVersionHandle": "2"\n}\n')),(0,i.kt)("h3",{id:"retrieve-given-iteration-data---cogmentapimodelregistryspretrieveversiondata--cogmentapiretrieveversiondatarequest--returns--stream-cogmentapiretrieveversiondatareplychunk-"},"Retrieve given iteration data - ",(0,i.kt)("inlineCode",{parentName:"h3"},"cogmentAPI.ModelRegistrySP/RetrieveVersionData ( .cogmentAPI.RetrieveVersionDataRequest ) returns ( stream .cogmentAPI.RetrieveVersionDataReplyChunk );")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-console"},'$ echo "{\\"model_id\\":\\"my_model\\", \\"version_number\\":1}" | grpcurl -plaintext -d @ localhost:9000 cogment.ModelRegistrySP/RetrieveVersionData\n{\n "dataChunk": "Y2h1bmtfMWNodW5rXzI="\n}\n')),(0,i.kt)("p",null,"To retrieve the n-th to last iteration, use ",(0,i.kt)("inlineCode",{parentName:"p"},"version_number:-n")," (e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"-1")," for the latest, ",(0,i.kt)("inlineCode",{parentName:"p"},"-2")," for the 2nd to last)."))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/a57d321a.7b1da2dc.js b/assets/js/a57d321a.7b1da2dc.js deleted file mode 100644 index 1b0f0d6..0000000 --- a/assets/js/a57d321a.7b1da2dc.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[916],{3905:(e,t,n)=>{n.d(t,{Zo:()=>m,kt:()=>u});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var d=r.createContext({}),s=function(e){var t=r.useContext(d),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},m=function(e){var t=s(e.components);return r.createElement(d.Provider,{value:t},e.children)},c={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},p=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,o=e.originalType,d=e.parentName,m=l(e,["components","mdxType","originalType","parentName"]),p=s(n),u=i,g=p["".concat(d,".").concat(u)]||p[u]||c[u]||o;return n?r.createElement(g,a(a({ref:t},m),{},{components:n})):r.createElement(g,a({ref:t},m))}));function u(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var o=n.length,a=new Array(o);a[0]=p;var l={};for(var d in t)hasOwnProperty.call(t,d)&&(l[d]=t[d]);l.originalType=e,l.mdxType="string"==typeof e?e:i,a[1]=l;for(var s=2;s<o;s++)a[s]=n[s];return r.createElement.apply(null,a)}return r.createElement.apply(null,n)}p.displayName="MDXCreateElement"},5676:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>a,default:()=>c,frontMatter:()=>o,metadata:()=>l,toc:()=>s});var r=n(7462),i=(n(7294),n(3905));const o={title:"Model Registry",sidebar_position:4},a="Model Registry",l={unversionedId:"reference/cli/model-registry",id:"reference/cli/model-registry",title:"Model Registry",description:"Cogment Model Registry is designed to store and make available AI models to be used by Cogment actors.",source:"@site/docs/reference/cli/model-registry.md",sourceDirName:"reference/cli",slug:"/reference/cli/model-registry",permalink:"/docs/reference/cli/model-registry",draft:!1,tags:[],version:"current",lastUpdatedAt:1691703005,formattedLastUpdatedAt:"Aug 10, 2023",sidebarPosition:4,frontMatter:{title:"Model Registry",sidebar_position:4},sidebar:"docSidebar",previous:{title:"Client",permalink:"/docs/reference/cli/trial-datastore/trial-datastore-client"},next:{title:"Web Proxy",permalink:"/docs/reference/cli/web-proxy"}},d={},s=[{value:"Command line",id:"command-line",level:2},{value:"Configuration",id:"configuration",level:2},{value:"<code>port</code>",id:"port",level:3},{value:"<code>grpc_reflection</code>",id:"grpc_reflection",level:3},{value:"<code>archive_dir</code>",id:"archive_dir",level:3},{value:"<code>cache_max_items</code>",id:"cache_max_items",level:3},{value:"<code>sent_version_chunk_size</code>",id:"sent_version_chunk_size",level:3},{value:"<code>log_level</code>",id:"log_level",level:3},{value:"<code>log_file</code>",id:"log_file",level:3},{value:"<code>directory_endpoint</code>",id:"directory_endpoint",level:3},{value:"<code>directory_authentication_token</code>",id:"directory_authentication_token",level:3},{value:"<code>directory_registration_host</code>",id:"directory_registration_host",level:3},{value:"<code>directory_registration_properties</code>",id:"directory_registration_properties",level:3},{value:"API usage examples",id:"api-usage-examples",level:2},{value:"Create or update a model - <code>cogmentAPI.ModelRegistrySP/CreateOrUpdateModel( .cogmentAPI.CreateOrUpdateModelRequest ) returns ( .cogmentAPI.CreateOrUpdateModelReply );</code>",id:"create-or-update-a-model---cogmentapimodelregistryspcreateorupdatemodel-cogmentapicreateorupdatemodelrequest--returns--cogmentapicreateorupdatemodelreply-",level:3},{value:"Delete a model - <code>cogmentAPI.ModelRegistrySP/DeleteModel( .cogmentAPI.DeleteModelRequest ) returns ( .cogmentAPI.DeleteModelReply );</code>",id:"delete-a-model---cogmentapimodelregistryspdeletemodel-cogmentapideletemodelrequest--returns--cogmentapideletemodelreply-",level:3},{value:"Retrieve models - <code>cogmentAPI.ModelRegistrySP/RetrieveModels( .cogmentAPI.RetrieveModelsRequest ) returns ( .cogmentAPI.RetrieveModelsReply );</code>",id:"retrieve-models---cogmentapimodelregistryspretrievemodels-cogmentapiretrievemodelsrequest--returns--cogmentapiretrievemodelsreply-",level:3},{value:"List the models",id:"list-the-models",level:4},{value:"Retrieve specific model(s)",id:"retrieve-specific-models",level:4},{value:"Create a model iteration - <code>cogmentAPI.ModelRegistrySP/CreateVersion( stream .cogmentAPI.CreateVersionRequestChunk ) returns ( .cogmentAPI.CreateVersionReply );</code>",id:"create-a-model-iteration---cogmentapimodelregistryspcreateversion-stream-cogmentapicreateversionrequestchunk--returns--cogmentapicreateversionreply-",level:3},{value:"Retrieve model iteration infos - <code>cogmentAPI.ModelRegistrySP/RetrieveVersionInfos ( .cogmentAPI.RetrieveVersionInfosRequest ) returns ( .cogmentAPI.RetrieveVersionInfosReply );</code>",id:"retrieve-model-iteration-infos---cogmentapimodelregistryspretrieveversioninfos--cogmentapiretrieveversioninfosrequest--returns--cogmentapiretrieveversioninfosreply-",level:3},{value:"List the iterations of a model",id:"list-the-iterations-of-a-model",level:4},{value:"Retrieve specific iterations of a model",id:"retrieve-specific-iterations-of-a-model",level:4},{value:"Retrieve the n-th to last iterations of a model",id:"retrieve-the-n-th-to-last-iterations-of-a-model",level:4},{value:"Retrieve given iteration data - <code>cogmentAPI.ModelRegistrySP/RetrieveVersionData ( .cogmentAPI.RetrieveVersionDataRequest ) returns ( stream .cogmentAPI.RetrieveVersionDataReplyChunk );</code>",id:"retrieve-given-iteration-data---cogmentapimodelregistryspretrieveversiondata--cogmentapiretrieveversiondatarequest--returns--stream-cogmentapiretrieveversiondatareplychunk-",level:3}],m={toc:s};function c(e){let{components:t,...n}=e;return(0,i.kt)("wrapper",(0,r.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"model-registry"},"Model Registry"),(0,i.kt)("p",null,"Cogment Model Registry is designed to store and make available AI models to be used by Cogment actors."),(0,i.kt)("p",null,"The Model Registry manages models in two ways:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Transient")," (non-archived) model iterations can be used to publish an updated model to users, e.g. during training. Transient model iterations are stored in memory and can be evicted, in particular once the memory limit is reached."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Stored")," model iterations are stored on the filesystem and should be used for long-term storage of specific iterations, e.g. for validation or deployment purposes.")),(0,i.kt)("h2",{id:"command-line"},"Command line"),(0,i.kt)("p",null,"The Model Registry is simply called this way"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"$ cogment services model_registry --port=9000 --archive_dir=./models/\n")),(0,i.kt)("h2",{id:"configuration"},"Configuration"),(0,i.kt)("p",null,"The Model Registry configuration can be specified either through the command line or environment variables."),(0,i.kt)("h3",{id:"port"},(0,i.kt)("inlineCode",{parentName:"h3"},"port")),(0,i.kt)("p",null,"The TCP port where to serve the ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/grpc#model-registry-api"},"The Model Registry API"),"."),(0,i.kt)("p",null,"If set to 0, then the system will automatically choose a free port.\nThis is normally used in combination with a ",(0,i.kt)("a",{parentName:"p",href:"#directory_endpoint"},"Directory"),"."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--port=12000"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_MODEL_REGISTRY_PORT=12000"),","),(0,i.kt)("li",{parentName:"ul"},"its default value is 9002.")),(0,i.kt)("h3",{id:"grpc_reflection"},(0,i.kt)("inlineCode",{parentName:"h3"},"grpc_reflection")),(0,i.kt)("p",null,"Whether or not to enable ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/grpc/grpc/blob/master/doc/server-reflection.md"},"gRPC reflection")," on the served endpoints."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line flag, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--grpc_reflection"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_MODEL_REGISTRY_GRPC_REFLECTION=1"),","),(0,i.kt)("li",{parentName:"ul"},"by default, it is disabled.")),(0,i.kt)("h3",{id:"archive_dir"},(0,i.kt)("inlineCode",{parentName:"h3"},"archive_dir")),(0,i.kt)("p",null,"Path to the directory to store archived model iterations and model metadata."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--archive_dir=./path/to/models/"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_MODEL_REGISTRY_ARCHIVE_DIR=./path/to/models/"),","),(0,i.kt)("li",{parentName:"ul"},"its default value is ",(0,i.kt)("inlineCode",{parentName:"li"},".cogment/model_registry"))),(0,i.kt)("h3",{id:"cache_max_items"},(0,i.kt)("inlineCode",{parentName:"h3"},"cache_max_items")),(0,i.kt)("p",null,"This defines the maximum number of model iterations that can be stored in the transient cache."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--cache_max_items=500"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_MODEL_REGISTRY_VERSION_CACHE_MAX_ITEMS=500"),","),(0,i.kt)("li",{parentName:"ul"},"its default value is 100.")),(0,i.kt)("h3",{id:"sent_version_chunk_size"},(0,i.kt)("inlineCode",{parentName:"h3"},"sent_version_chunk_size")),(0,i.kt)("p",null,"The maximum size for model iteration data chunk sent by the server. It is defined in bytes."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--sent_version_chunk_size=100000"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_MODEL_REGISTRY_SENT_MODEL_VERSION_DATA_CHUNK_SIZE=100000"),","),(0,i.kt)("li",{parentName:"ul"},"its default value is 2097152 Bytes, i.e. 2MB.")),(0,i.kt)("h3",{id:"log_level"},(0,i.kt)("inlineCode",{parentName:"h3"},"log_level")),(0,i.kt)("p",null,"Set to define the minimum level for logging. Possible values are: ",(0,i.kt)("inlineCode",{parentName:"p"},"off"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"error"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"warning"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"info"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"debug"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"trace"),". Note however that all trace and most debug level logs will only output if running the debug compiled version of the Orchestrator."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--log_level=debug"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_LOG_LEVEL=5"),","),(0,i.kt)("li",{parentName:"ul"},"default value is info.")),(0,i.kt)("h3",{id:"log_file"},(0,i.kt)("inlineCode",{parentName:"h3"},"log_file")),(0,i.kt)("p",null,"Base file name for daily log output. The name will be suffixed with the date and a new file will be made every day. If not provided the logs go to stdout."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--log_file=./path/to/cogment.log"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_LOG_FILE=./path/to/cogment.log"),","),(0,i.kt)("li",{parentName:"ul"},"default value is info.")),(0,i.kt)("h3",{id:"directory_endpoint"},(0,i.kt)("inlineCode",{parentName:"h3"},"directory_endpoint")),(0,i.kt)("p",null,"Cogment endpoint of the directory service. It must be a ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#grpc-scheme"},"gRPC endpoint"),". The directory will be used to register the model registry service for discovery by other services. If not provided, the model registry will not auto register, in which case manual registration to the directory must be done, or an explicit address must be provided to access the model registry."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--directory_endpoint=grpc://foo:9005"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005"),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")),(0,i.kt)("h3",{id:"directory_authentication_token"},(0,i.kt)("inlineCode",{parentName:"h3"},"directory_authentication_token")),(0,i.kt)("p",null,"Authentication token for services registered in the Directory. It is recorded in the Directory when registering a service. And a matching token must be provided to inquire for the service. An empty token is the same as no token."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--directory_authentication_token=GH670ploT"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT"),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")),(0,i.kt)("h3",{id:"directory_registration_host"},(0,i.kt)("inlineCode",{parentName:"h3"},"directory_registration_host")),(0,i.kt)("p",null,"This is the host that will be registered to the Directory for the Model Registry service. If not provided, the Model Registry will determine its own IP address and use that as the registration host."),(0,i.kt)("p",null,"In some circumstances, the IP address determined by Cogment may be wrong (e.g. multiple interfaces, load balancing, firewall), thus a host (hostname or IP address) must be explicitly provided."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--directory_registration_host=foo.bar"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_MODEL_REGISTRY_DIRECTORY_REGISTRATION_HOST=foo.bar"),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value (i.e. self determined IP address is used).")),(0,i.kt)("h3",{id:"directory_registration_properties"},(0,i.kt)("inlineCode",{parentName:"h3"},"directory_registration_properties")),(0,i.kt)("p",null,'These are the properties that will be registered to the Directory for the Model Registry service. When inquiring the Directory, the properties inquired must match the properties registered. This is a string representing multiple properties in the form "name=value,name=value,name=value" where the values are optional.'),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'--directory_registration_properties="Sim=20,hpp,mem=HIGH"'),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'COGMENT_MODEL_REGISTRY_DIRECTORY_REGISTRATION_PROPERTIES="Sim=20,hpp,mem=HIGH"'),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")),(0,i.kt)("h2",{id:"api-usage-examples"},"API usage examples"),(0,i.kt)("p",null,"::: tip"),(0,i.kt)("p",null,"The following examples require ",(0,i.kt)("inlineCode",{parentName:"p"},"COGMENT_MODEL_REGISTRY_GRPC_REFLECTION")," to be enabled as well as ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/fullstorydev/grpcurl"},"grpcurl"),"_"),(0,i.kt)("p",null,":::"),(0,i.kt)("h3",{id:"create-or-update-a-model---cogmentapimodelregistryspcreateorupdatemodel-cogmentapicreateorupdatemodelrequest--returns--cogmentapicreateorupdatemodelreply-"},"Create or update a model - ",(0,i.kt)("inlineCode",{parentName:"h3"},"cogmentAPI.ModelRegistrySP/CreateOrUpdateModel( .cogmentAPI.CreateOrUpdateModelRequest ) returns ( .cogmentAPI.CreateOrUpdateModelReply );")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-console"},'$ echo "{\\"model_info\\":{\\"model_id\\":\\"my_model\\",\\"user_data\\":{\\"type\\":\\"my_model_type\\"}}}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/CreateOrUpdateModel\n{\n\n}\n')),(0,i.kt)("h3",{id:"delete-a-model---cogmentapimodelregistryspdeletemodel-cogmentapideletemodelrequest--returns--cogmentapideletemodelreply-"},"Delete a model - ",(0,i.kt)("inlineCode",{parentName:"h3"},"cogmentAPI.ModelRegistrySP/DeleteModel( .cogmentAPI.DeleteModelRequest ) returns ( .cogmentAPI.DeleteModelReply );")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-console"},'$ echo "{\\"model_id\\":\\"my_model\\"}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/DeleteModel\n{\n\n}\n')),(0,i.kt)("h3",{id:"retrieve-models---cogmentapimodelregistryspretrievemodels-cogmentapiretrievemodelsrequest--returns--cogmentapiretrievemodelsreply-"},"Retrieve models - ",(0,i.kt)("inlineCode",{parentName:"h3"},"cogmentAPI.ModelRegistrySP/RetrieveModels( .cogmentAPI.RetrieveModelsRequest ) returns ( .cogmentAPI.RetrieveModelsReply );")),(0,i.kt)("p",null,(0,i.kt)("em",{parentName:"p"},"These examples require ",(0,i.kt)("inlineCode",{parentName:"em"},"COGMENT_MODEL_REGISTRY_GRPC_REFLECTION")," to be enabled as well as ",(0,i.kt)("a",{parentName:"em",href:"https://github.com/fullstorydev/grpcurl"},"grpcurl"))),(0,i.kt)("h4",{id:"list-the-models"},"List the models"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-console"},'$ echo "{}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/RetrieveModels\n{\n "modelInfos": [\n {\n "modelId": "my_model",\n "userData": {\n "type": "my_model_type"\n }\n },\n {\n "modelId": "my_other_model",\n "userData": {\n "type": "my_model_type"\n }\n }\n ],\n "nextModelHandle": "2"\n}\n')),(0,i.kt)("h4",{id:"retrieve-specific-models"},"Retrieve specific model(s)"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-console"},'$ echo "{\\"model_ids\\":[\\"my_other_model\\"]}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/RetrieveModels\n{\n "modelInfos": [\n {\n "modelId": "my_other_model",\n "userData": {\n "type": "my_model_type"\n }\n }\n ],\n "nextModelHandle": "1"\n}\n')),(0,i.kt)("h3",{id:"create-a-model-iteration---cogmentapimodelregistryspcreateversion-stream-cogmentapicreateversionrequestchunk--returns--cogmentapicreateversionreply-"},"Create a model iteration - ",(0,i.kt)("inlineCode",{parentName:"h3"},"cogmentAPI.ModelRegistrySP/CreateVersion( stream .cogmentAPI.CreateVersionRequestChunk ) returns ( .cogmentAPI.CreateVersionReply );")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-console"},'$ echo "{\\"header\\":{\\"version_info\\":{\n \\"model_id\\":\\"my_model\\",\\\n \\"archived\\":true,\\\n \\"data_size\\":$(printf chunk_1chunk_2 | wc -c)\\\n }}}\\\n {\\"body\\":{\\\n \\"data_chunk\\":\\"$(printf chunk_1 | base64)\\"\\\n }}\\\n {\\"body\\":{\\\n \\"data_chunk\\":\\"$(printf chunk_2 | base64)\\"\\\n }}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/CreateVersion\n{\n "versionInfo": {\n "modelId": "my_model",\n "versionNumber": 2,\n "creationTimestamp": "907957639",\n "archived": true,\n "dataHash": "jY0g3VkUK62ILPr2JuaW5g7uQi0EcJVZJu8IYp3yfhI=",\n "dataSize": "14"\n }\n}\n')),(0,i.kt)("h3",{id:"retrieve-model-iteration-infos---cogmentapimodelregistryspretrieveversioninfos--cogmentapiretrieveversioninfosrequest--returns--cogmentapiretrieveversioninfosreply-"},"Retrieve model iteration infos - ",(0,i.kt)("inlineCode",{parentName:"h3"},"cogmentAPI.ModelRegistrySP/RetrieveVersionInfos ( .cogmentAPI.RetrieveVersionInfosRequest ) returns ( .cogmentAPI.RetrieveVersionInfosReply );")),(0,i.kt)("h4",{id:"list-the-iterations-of-a-model"},"List the iterations of a model"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-console"},'$ echo "{\\"model_id\\":\\"my_model\\"}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/RetrieveVersionInfos\n{\n "versionInfos": [\n {\n "modelId": "my_model",\n "versionNumber": 1,\n "creationTimestamp": "1633119005107454620",\n "archived": true,\n "dataHash": "jY0g3VkUK62ILPr2JuaW5g7uQi0EcJVZJu8IYp3yfhI=",\n "dataSize": "14"\n },\n {\n "modelId": "my_model",\n "versionNumber": 2,\n "creationTimestamp": "1633119625907957639",\n "archived": true,\n "dataHash": "jY0g3VkUK62ILPr2JuaW5g7uQi0EcJVZJu8IYp3yfhI=",\n "dataSize": "14"\n }\n ],\n "nextVersionHandle": "3"\n}\n')),(0,i.kt)("h4",{id:"retrieve-specific-iterations-of-a-model"},"Retrieve specific iterations of a model"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-console"},'$ echo "{\\"model_id\\":\\"my_model\\", \\"version_numbers\\":[1]}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/RetrieveVersionInfos\n{\n "versionInfos": [\n {\n "modelId": "my_model",\n "versionNumber": 1,\n "creationTimestamp": "1633119005107454620",\n "archived": true,\n "dataHash": "jY0g3VkUK62ILPr2JuaW5g7uQi0EcJVZJu8IYp3yfhI=",\n "dataSize": "14"\n }\n ],\n "nextVersionHandle": "2"\n}\n')),(0,i.kt)("h4",{id:"retrieve-the-n-th-to-last-iterations-of-a-model"},"Retrieve the n-th to last iterations of a model"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-console"},'$ echo "{\\"model_id\\":\\"my_model\\", \\"version_numbers\\":[-2]}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/RetrieveVersionInfos\n{\n "versionInfos": [\n {\n "modelId": "my_model",\n "versionNumber": 1,\n "creationTimestamp": "1633119005107454620",\n "archived": true,\n "dataHash": "jY0g3VkUK62ILPr2JuaW5g7uQi0EcJVZJu8IYp3yfhI=",\n "dataSize": "14"\n }\n ],\n "nextVersionHandle": "2"\n}\n')),(0,i.kt)("h3",{id:"retrieve-given-iteration-data---cogmentapimodelregistryspretrieveversiondata--cogmentapiretrieveversiondatarequest--returns--stream-cogmentapiretrieveversiondatareplychunk-"},"Retrieve given iteration data - ",(0,i.kt)("inlineCode",{parentName:"h3"},"cogmentAPI.ModelRegistrySP/RetrieveVersionData ( .cogmentAPI.RetrieveVersionDataRequest ) returns ( stream .cogmentAPI.RetrieveVersionDataReplyChunk );")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-console"},'$ echo "{\\"model_id\\":\\"my_model\\", \\"version_number\\":1}" | grpcurl -plaintext -d @ localhost:9000 cogment.ModelRegistrySP/RetrieveVersionData\n{\n "dataChunk": "Y2h1bmtfMWNodW5rXzI="\n}\n')),(0,i.kt)("p",null,"To retrieve the n-th to last iteration, use ",(0,i.kt)("inlineCode",{parentName:"p"},"version_number:-n")," (e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"-1")," for the latest, ",(0,i.kt)("inlineCode",{parentName:"p"},"-2")," for the 2nd to last)."))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/ac5280f2.23c0bab4.js b/assets/js/ac5280f2.23c0bab4.js deleted file mode 100644 index 6432e44..0000000 --- a/assets/js/ac5280f2.23c0bab4.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[8529],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>p});var i=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,i,o=function(e,t){if(null==e)return{};var n,i,o={},r=Object.keys(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=i.createContext({}),c=function(e){var t=i.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},d=function(e){var t=c(e.components);return i.createElement(l.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return i.createElement(i.Fragment,{},t)}},h=i.forwardRef((function(e,t){var n=e.components,o=e.mdxType,r=e.originalType,l=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),h=c(n),p=o,f=h["".concat(l,".").concat(p)]||h[p]||u[p]||r;return n?i.createElement(f,a(a({ref:t},d),{},{components:n})):i.createElement(f,a({ref:t},d))}));function p(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=n.length,a=new Array(r);a[0]=h;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s.mdxType="string"==typeof e?e:o,a[1]=s;for(var c=2;c<r;c++)a[c]=n[c];return i.createElement.apply(null,a)}return i.createElement.apply(null,n)}h.displayName="MDXCreateElement"},5687:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>u,frontMatter:()=>r,metadata:()=>s,toc:()=>c});var i=n(7462),o=(n(7294),n(3905));const r={sidebar_position:7},a="Apache License",s={unversionedId:"license",id:"license",title:"Apache License",description:"Version 2.0, January 2004",source:"@site/docs/license.md",sourceDirName:".",slug:"/license",permalink:"/docs/license",draft:!1,tags:[],version:"current",lastUpdatedAt:1665585711,formattedLastUpdatedAt:"Oct 12, 2022",sidebarPosition:7,frontMatter:{sidebar_position:7},sidebar:"docSidebar",previous:{title:"Cogment 2.0",permalink:"/docs/reference/cogment-v2-changes"}},l={},c=[{value:"Terms and Conditions for use, reproduction, and distribution",id:"terms-and-conditions-for-use-reproduction-and-distribution",level:3},{value:"1. Definitions",id:"1-definitions",level:4},{value:"2. Grant of Copyright License",id:"2-grant-of-copyright-license",level:4},{value:"3. Grant of Patent License",id:"3-grant-of-patent-license",level:4},{value:"4. Redistribution",id:"4-redistribution",level:4},{value:"5. Submission of Contributions",id:"5-submission-of-contributions",level:4},{value:"6. Trademarks",id:"6-trademarks",level:4},{value:"7. Disclaimer of Warranty",id:"7-disclaimer-of-warranty",level:4},{value:"8. Limitation of Liability",id:"8-limitation-of-liability",level:4},{value:"9. Accepting Warranty or Additional Liability",id:"9-accepting-warranty-or-additional-liability",level:4}],d={toc:c};function u(e){let{components:t,...n}=e;return(0,o.kt)("wrapper",(0,i.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"apache-license"},"Apache License"),(0,o.kt)("p",null,(0,o.kt)("em",{parentName:"p"},"Version 2.0, January 2004"),"\n",(0,o.kt)("em",{parentName:"p"},"<",(0,o.kt)("a",{parentName:"em",href:"http://www.apache.org/licenses/"},"http://www.apache.org/licenses/"),">")),(0,o.kt)("h3",{id:"terms-and-conditions-for-use-reproduction-and-distribution"},"Terms and Conditions for use, reproduction, and distribution"),(0,o.kt)("h4",{id:"1-definitions"},"1. Definitions"),(0,o.kt)("p",null,"\u201cLicense\u201d shall mean the terms and conditions for use, reproduction, and\ndistribution as defined by Sections 1 through 9 of this document."),(0,o.kt)("p",null,"\u201cLicensor\u201d shall mean the copyright owner or entity authorized by the copyright\nowner that is granting the License."),(0,o.kt)("p",null,"\u201cLegal Entity\u201d shall mean the union of the acting entity and all other entities\nthat control, are controlled by, or are under common control with that entity.\nFor the purposes of this definition, \u201ccontrol\u201d means ",(0,o.kt)("strong",{parentName:"p"},"(i)")," the power, direct or\nindirect, to cause the direction or management of such entity, whether by\ncontract or otherwise, or ",(0,o.kt)("strong",{parentName:"p"},"(ii)")," ownership of fifty percent (50%) or more of the\noutstanding shares, or ",(0,o.kt)("strong",{parentName:"p"},"(iii)")," beneficial ownership of such entity."),(0,o.kt)("p",null,"\u201cYou\u201d (or \u201cYour\u201d) shall mean an individual or Legal Entity exercising\npermissions granted by this License."),(0,o.kt)("p",null,"\u201cSource\u201d form shall mean the preferred form for making modifications, including\nbut not limited to software source code, documentation source, and configuration\nfiles."),(0,o.kt)("p",null,"\u201cObject\u201d form shall mean any form resulting from mechanical transformation or\ntranslation of a Source form, including but not limited to compiled object code,\ngenerated documentation, and conversions to other media types."),(0,o.kt)("p",null,"\u201cWork\u201d shall mean the work of authorship, whether in Source or Object form, made\navailable under the License, as indicated by a copyright notice that is included\nin or attached to the work (an example is provided in the Appendix below)."),(0,o.kt)("p",null,"\u201cDerivative Works\u201d shall mean any work, whether in Source or Object form, that\nis based on (or derived from) the Work and for which the editorial revisions,\nannotations, elaborations, or other modifications represent, as a whole, an\noriginal work of authorship. For the purposes of this License, Derivative Works\nshall not include works that remain separable from, or merely link (or bind by\nname) to the interfaces of, the Work and Derivative Works thereof."),(0,o.kt)("p",null,"\u201cContribution\u201d shall mean any work of authorship, including the original version\nof the Work and any modifications or additions to that Work or Derivative Works\nthereof, that is intentionally submitted to Licensor for inclusion in the Work\nby the copyright owner or by an individual or Legal Entity authorized to submit\non behalf of the copyright owner. For the purposes of this definition,\n\u201csubmitted\u201d means any form of electronic, verbal, or written communication sent\nto the Licensor or its representatives, including but not limited to\ncommunication on electronic mailing lists, source code control systems, and\nissue tracking systems that are managed by, or on behalf of, the Licensor for\nthe purpose of discussing and improving the Work, but excluding communication\nthat is conspicuously marked or otherwise designated in writing by the copyright\nowner as \u201cNot a Contribution.\u201d"),(0,o.kt)("p",null,"\u201cContributor\u201d shall mean Licensor and any individual or Legal Entity on behalf\nof whom a Contribution has been received by Licensor and subsequently\nincorporated within the Work."),(0,o.kt)("h4",{id:"2-grant-of-copyright-license"},"2. Grant of Copyright License"),(0,o.kt)("p",null,"Subject to the terms and conditions of this License, each Contributor hereby\ngrants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,\nirrevocable copyright license to reproduce, prepare Derivative Works of,\npublicly display, publicly perform, sublicense, and distribute the Work and such\nDerivative Works in Source or Object form."),(0,o.kt)("h4",{id:"3-grant-of-patent-license"},"3. Grant of Patent License"),(0,o.kt)("p",null,"Subject to the terms and conditions of this License, each Contributor hereby\ngrants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,\nirrevocable (except as stated in this section) patent license to make, have\nmade, use, offer to sell, sell, import, and otherwise transfer the Work, where\nsuch license applies only to those patent claims licensable by such Contributor\nthat are necessarily infringed by their Contribution(s) alone or by combination\nof their Contribution(s) with the Work to which such Contribution(s) was\nsubmitted. If You institute patent litigation against any entity (including a\ncross-claim or counterclaim in a lawsuit) alleging that the Work or a\nContribution incorporated within the Work constitutes direct or contributory\npatent infringement, then any patent licenses granted to You under this License\nfor that Work shall terminate as of the date such litigation is filed."),(0,o.kt)("h4",{id:"4-redistribution"},"4. Redistribution"),(0,o.kt)("p",null,"You may reproduce and distribute copies of the Work or Derivative Works thereof\nin any medium, with or without modifications, and in Source or Object form,\nprovided that You meet the following conditions:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},"(a)")," You must give any other recipients of the Work or Derivative Works a copy of\nthis License; and"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},"(b)")," You must cause any modified files to carry prominent notices stating that You\nchanged the files; and"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},"(c)")," You must retain, in the Source form of any Derivative Works that You distribute,\nall copyright, patent, trademark, and attribution notices from the Source form\nof the Work, excluding those notices that do not pertain to any part of the\nDerivative Works; and"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},"(d)")," If the Work includes a \u201cNOTICE\u201d text file as part of its distribution, then any\nDerivative Works that You distribute must include a readable copy of the\nattribution notices contained within such NOTICE file, excluding those notices\nthat do not pertain to any part of the Derivative Works, in at least one of the\nfollowing places: within a NOTICE text file distributed as part of the\nDerivative Works; within the Source form or documentation, if provided along\nwith the Derivative Works; or, within a display generated by the Derivative\nWorks, if and wherever such third-party notices normally appear. The contents of\nthe NOTICE file are for informational purposes only and do not modify the\nLicense. You may add Your own attribution notices within Derivative Works that\nYou distribute, alongside or as an addendum to the NOTICE text from the Work,\nprovided that such additional attribution notices cannot be construed as\nmodifying the License.")),(0,o.kt)("p",null,"You may add Your own copyright statement to Your modifications and may provide\nadditional or different license terms and conditions for use, reproduction, or\ndistribution of Your modifications, or for any such Derivative Works as a whole,\nprovided Your use, reproduction, and distribution of the Work otherwise complies\nwith the conditions stated in this License."),(0,o.kt)("h4",{id:"5-submission-of-contributions"},"5. Submission of Contributions"),(0,o.kt)("p",null,"Unless You explicitly state otherwise, any Contribution intentionally submitted\nfor inclusion in the Work by You to the Licensor shall be under the terms and\nconditions of this License, without any additional terms or conditions.\nNotwithstanding the above, nothing herein shall supersede or modify the terms of\nany separate license agreement you may have executed with Licensor regarding\nsuch Contributions."),(0,o.kt)("h4",{id:"6-trademarks"},"6. Trademarks"),(0,o.kt)("p",null,"This License does not grant permission to use the trade names, trademarks,\nservice marks, or product names of the Licensor, except as required for\nreasonable and customary use in describing the origin of the Work and\nreproducing the content of the NOTICE file."),(0,o.kt)("h4",{id:"7-disclaimer-of-warranty"},"7. Disclaimer of Warranty"),(0,o.kt)("p",null,"Unless required by applicable law or agreed to in writing, Licensor provides the\nWork (and each Contributor provides its Contributions) on an \u201cAS IS\u201d BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,\nincluding, without limitation, any warranties or conditions of TITLE,\nNON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are\nsolely responsible for determining the appropriateness of using or\nredistributing the Work and assume any risks associated with Your exercise of\npermissions under this License."),(0,o.kt)("h4",{id:"8-limitation-of-liability"},"8. Limitation of Liability"),(0,o.kt)("p",null,"In no event and under no legal theory, whether in tort (including negligence),\ncontract, or otherwise, unless required by applicable law (such as deliberate\nand grossly negligent acts) or agreed to in writing, shall any Contributor be\nliable to You for damages, including any direct, indirect, special, incidental,\nor consequential damages of any character arising as a result of this License or\nout of the use or inability to use the Work (including but not limited to\ndamages for loss of goodwill, work stoppage, computer failure or malfunction, or\nany and all other commercial damages or losses), even if such Contributor has\nbeen advised of the possibility of such damages."),(0,o.kt)("h4",{id:"9-accepting-warranty-or-additional-liability"},"9. Accepting Warranty or Additional Liability"),(0,o.kt)("p",null,"While redistributing the Work or Derivative Works thereof, You may choose to\noffer, and charge a fee for, acceptance of support, warranty, indemnity, or\nother liability obligations and/or rights consistent with this License. However,\nin accepting such obligations, You may act only on Your own behalf and on Your\nsole responsibility, not on behalf of any other Contributor, and only if You\nagree to indemnify, defend, and hold each Contributor harmless for any liability\nincurred by, or claims asserted against, such Contributor by reason of your\naccepting any such warranty or additional liability."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"Copyright 2019 Artificial Intelligence Redefined")))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/ac5280f2.4f4b5f86.js b/assets/js/ac5280f2.4f4b5f86.js new file mode 100644 index 0000000..aa98f90 --- /dev/null +++ b/assets/js/ac5280f2.4f4b5f86.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[8529],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>f});var i=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,i,o=function(e,t){if(null==e)return{};var n,i,o={},r=Object.keys(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=i.createContext({}),c=function(e){var t=i.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},d=function(e){var t=c(e.components);return i.createElement(l.Provider,{value:t},e.children)},u="mdxType",h={inlineCode:"code",wrapper:function(e){var t=e.children;return i.createElement(i.Fragment,{},t)}},p=i.forwardRef((function(e,t){var n=e.components,o=e.mdxType,r=e.originalType,l=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),u=c(n),p=o,f=u["".concat(l,".").concat(p)]||u[p]||h[p]||r;return n?i.createElement(f,a(a({ref:t},d),{},{components:n})):i.createElement(f,a({ref:t},d))}));function f(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=n.length,a=new Array(r);a[0]=p;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[u]="string"==typeof e?e:o,a[1]=s;for(var c=2;c<r;c++)a[c]=n[c];return i.createElement.apply(null,a)}return i.createElement.apply(null,n)}p.displayName="MDXCreateElement"},5687:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>h,frontMatter:()=>r,metadata:()=>s,toc:()=>c});var i=n(7462),o=(n(7294),n(3905));const r={sidebar_position:7},a="Apache License",s={unversionedId:"license",id:"license",title:"Apache License",description:"Version 2.0, January 2004",source:"@site/docs/license.md",sourceDirName:".",slug:"/license",permalink:"/docs/license",draft:!1,tags:[],version:"current",lastUpdatedAt:1665763478,formattedLastUpdatedAt:"Oct 14, 2022",sidebarPosition:7,frontMatter:{sidebar_position:7},sidebar:"docSidebar",previous:{title:"Cogment 2.0",permalink:"/docs/reference/cogment-v2-changes"}},l={},c=[{value:"Terms and Conditions for use, reproduction, and distribution",id:"terms-and-conditions-for-use-reproduction-and-distribution",level:3},{value:"1. Definitions",id:"1-definitions",level:4},{value:"2. Grant of Copyright License",id:"2-grant-of-copyright-license",level:4},{value:"3. Grant of Patent License",id:"3-grant-of-patent-license",level:4},{value:"4. Redistribution",id:"4-redistribution",level:4},{value:"5. Submission of Contributions",id:"5-submission-of-contributions",level:4},{value:"6. Trademarks",id:"6-trademarks",level:4},{value:"7. Disclaimer of Warranty",id:"7-disclaimer-of-warranty",level:4},{value:"8. Limitation of Liability",id:"8-limitation-of-liability",level:4},{value:"9. Accepting Warranty or Additional Liability",id:"9-accepting-warranty-or-additional-liability",level:4}],d={toc:c},u="wrapper";function h(e){let{components:t,...n}=e;return(0,o.kt)(u,(0,i.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"apache-license"},"Apache License"),(0,o.kt)("p",null,(0,o.kt)("em",{parentName:"p"},"Version 2.0, January 2004"),"\n",(0,o.kt)("em",{parentName:"p"},"<",(0,o.kt)("a",{parentName:"em",href:"http://www.apache.org/licenses/"},"http://www.apache.org/licenses/"),">")),(0,o.kt)("h3",{id:"terms-and-conditions-for-use-reproduction-and-distribution"},"Terms and Conditions for use, reproduction, and distribution"),(0,o.kt)("h4",{id:"1-definitions"},"1. Definitions"),(0,o.kt)("p",null,"\u201cLicense\u201d shall mean the terms and conditions for use, reproduction, and\ndistribution as defined by Sections 1 through 9 of this document."),(0,o.kt)("p",null,"\u201cLicensor\u201d shall mean the copyright owner or entity authorized by the copyright\nowner that is granting the License."),(0,o.kt)("p",null,"\u201cLegal Entity\u201d shall mean the union of the acting entity and all other entities\nthat control, are controlled by, or are under common control with that entity.\nFor the purposes of this definition, \u201ccontrol\u201d means ",(0,o.kt)("strong",{parentName:"p"},"(i)")," the power, direct or\nindirect, to cause the direction or management of such entity, whether by\ncontract or otherwise, or ",(0,o.kt)("strong",{parentName:"p"},"(ii)")," ownership of fifty percent (50%) or more of the\noutstanding shares, or ",(0,o.kt)("strong",{parentName:"p"},"(iii)")," beneficial ownership of such entity."),(0,o.kt)("p",null,"\u201cYou\u201d (or \u201cYour\u201d) shall mean an individual or Legal Entity exercising\npermissions granted by this License."),(0,o.kt)("p",null,"\u201cSource\u201d form shall mean the preferred form for making modifications, including\nbut not limited to software source code, documentation source, and configuration\nfiles."),(0,o.kt)("p",null,"\u201cObject\u201d form shall mean any form resulting from mechanical transformation or\ntranslation of a Source form, including but not limited to compiled object code,\ngenerated documentation, and conversions to other media types."),(0,o.kt)("p",null,"\u201cWork\u201d shall mean the work of authorship, whether in Source or Object form, made\navailable under the License, as indicated by a copyright notice that is included\nin or attached to the work (an example is provided in the Appendix below)."),(0,o.kt)("p",null,"\u201cDerivative Works\u201d shall mean any work, whether in Source or Object form, that\nis based on (or derived from) the Work and for which the editorial revisions,\nannotations, elaborations, or other modifications represent, as a whole, an\noriginal work of authorship. For the purposes of this License, Derivative Works\nshall not include works that remain separable from, or merely link (or bind by\nname) to the interfaces of, the Work and Derivative Works thereof."),(0,o.kt)("p",null,"\u201cContribution\u201d shall mean any work of authorship, including the original version\nof the Work and any modifications or additions to that Work or Derivative Works\nthereof, that is intentionally submitted to Licensor for inclusion in the Work\nby the copyright owner or by an individual or Legal Entity authorized to submit\non behalf of the copyright owner. For the purposes of this definition,\n\u201csubmitted\u201d means any form of electronic, verbal, or written communication sent\nto the Licensor or its representatives, including but not limited to\ncommunication on electronic mailing lists, source code control systems, and\nissue tracking systems that are managed by, or on behalf of, the Licensor for\nthe purpose of discussing and improving the Work, but excluding communication\nthat is conspicuously marked or otherwise designated in writing by the copyright\nowner as \u201cNot a Contribution.\u201d"),(0,o.kt)("p",null,"\u201cContributor\u201d shall mean Licensor and any individual or Legal Entity on behalf\nof whom a Contribution has been received by Licensor and subsequently\nincorporated within the Work."),(0,o.kt)("h4",{id:"2-grant-of-copyright-license"},"2. Grant of Copyright License"),(0,o.kt)("p",null,"Subject to the terms and conditions of this License, each Contributor hereby\ngrants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,\nirrevocable copyright license to reproduce, prepare Derivative Works of,\npublicly display, publicly perform, sublicense, and distribute the Work and such\nDerivative Works in Source or Object form."),(0,o.kt)("h4",{id:"3-grant-of-patent-license"},"3. Grant of Patent License"),(0,o.kt)("p",null,"Subject to the terms and conditions of this License, each Contributor hereby\ngrants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,\nirrevocable (except as stated in this section) patent license to make, have\nmade, use, offer to sell, sell, import, and otherwise transfer the Work, where\nsuch license applies only to those patent claims licensable by such Contributor\nthat are necessarily infringed by their Contribution(s) alone or by combination\nof their Contribution(s) with the Work to which such Contribution(s) was\nsubmitted. If You institute patent litigation against any entity (including a\ncross-claim or counterclaim in a lawsuit) alleging that the Work or a\nContribution incorporated within the Work constitutes direct or contributory\npatent infringement, then any patent licenses granted to You under this License\nfor that Work shall terminate as of the date such litigation is filed."),(0,o.kt)("h4",{id:"4-redistribution"},"4. Redistribution"),(0,o.kt)("p",null,"You may reproduce and distribute copies of the Work or Derivative Works thereof\nin any medium, with or without modifications, and in Source or Object form,\nprovided that You meet the following conditions:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},"(a)")," You must give any other recipients of the Work or Derivative Works a copy of\nthis License; and"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},"(b)")," You must cause any modified files to carry prominent notices stating that You\nchanged the files; and"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},"(c)")," You must retain, in the Source form of any Derivative Works that You distribute,\nall copyright, patent, trademark, and attribution notices from the Source form\nof the Work, excluding those notices that do not pertain to any part of the\nDerivative Works; and"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},"(d)")," If the Work includes a \u201cNOTICE\u201d text file as part of its distribution, then any\nDerivative Works that You distribute must include a readable copy of the\nattribution notices contained within such NOTICE file, excluding those notices\nthat do not pertain to any part of the Derivative Works, in at least one of the\nfollowing places: within a NOTICE text file distributed as part of the\nDerivative Works; within the Source form or documentation, if provided along\nwith the Derivative Works; or, within a display generated by the Derivative\nWorks, if and wherever such third-party notices normally appear. The contents of\nthe NOTICE file are for informational purposes only and do not modify the\nLicense. You may add Your own attribution notices within Derivative Works that\nYou distribute, alongside or as an addendum to the NOTICE text from the Work,\nprovided that such additional attribution notices cannot be construed as\nmodifying the License.")),(0,o.kt)("p",null,"You may add Your own copyright statement to Your modifications and may provide\nadditional or different license terms and conditions for use, reproduction, or\ndistribution of Your modifications, or for any such Derivative Works as a whole,\nprovided Your use, reproduction, and distribution of the Work otherwise complies\nwith the conditions stated in this License."),(0,o.kt)("h4",{id:"5-submission-of-contributions"},"5. Submission of Contributions"),(0,o.kt)("p",null,"Unless You explicitly state otherwise, any Contribution intentionally submitted\nfor inclusion in the Work by You to the Licensor shall be under the terms and\nconditions of this License, without any additional terms or conditions.\nNotwithstanding the above, nothing herein shall supersede or modify the terms of\nany separate license agreement you may have executed with Licensor regarding\nsuch Contributions."),(0,o.kt)("h4",{id:"6-trademarks"},"6. Trademarks"),(0,o.kt)("p",null,"This License does not grant permission to use the trade names, trademarks,\nservice marks, or product names of the Licensor, except as required for\nreasonable and customary use in describing the origin of the Work and\nreproducing the content of the NOTICE file."),(0,o.kt)("h4",{id:"7-disclaimer-of-warranty"},"7. Disclaimer of Warranty"),(0,o.kt)("p",null,"Unless required by applicable law or agreed to in writing, Licensor provides the\nWork (and each Contributor provides its Contributions) on an \u201cAS IS\u201d BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,\nincluding, without limitation, any warranties or conditions of TITLE,\nNON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are\nsolely responsible for determining the appropriateness of using or\nredistributing the Work and assume any risks associated with Your exercise of\npermissions under this License."),(0,o.kt)("h4",{id:"8-limitation-of-liability"},"8. Limitation of Liability"),(0,o.kt)("p",null,"In no event and under no legal theory, whether in tort (including negligence),\ncontract, or otherwise, unless required by applicable law (such as deliberate\nand grossly negligent acts) or agreed to in writing, shall any Contributor be\nliable to You for damages, including any direct, indirect, special, incidental,\nor consequential damages of any character arising as a result of this License or\nout of the use or inability to use the Work (including but not limited to\ndamages for loss of goodwill, work stoppage, computer failure or malfunction, or\nany and all other commercial damages or losses), even if such Contributor has\nbeen advised of the possibility of such damages."),(0,o.kt)("h4",{id:"9-accepting-warranty-or-additional-liability"},"9. Accepting Warranty or Additional Liability"),(0,o.kt)("p",null,"While redistributing the Work or Derivative Works thereof, You may choose to\noffer, and charge a fee for, acceptance of support, warranty, indemnity, or\nother liability obligations and/or rights consistent with this License. However,\nin accepting such obligations, You may act only on Your own behalf and on Your\nsole responsibility, not on behalf of any other Contributor, and only if You\nagree to indemnify, defend, and hold each Contributor harmless for any liability\nincurred by, or claims asserted against, such Contributor by reason of your\naccepting any such warranty or additional liability."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"Copyright 2019 Artificial Intelligence Redefined")))}h.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/b2327a6c.23dd6cdd.js b/assets/js/b2327a6c.23dd6cdd.js new file mode 100644 index 0000000..7887409 --- /dev/null +++ b/assets/js/b2327a6c.23dd6cdd.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[1909],{3905:(e,t,a)=>{a.d(t,{Zo:()=>d,kt:()=>k});var n=a(7294);function i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function r(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?l(Object(a),!0).forEach((function(t){i(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function o(e,t){if(null==e)return{};var a,n,i=function(e,t){if(null==e)return{};var a,n,i={},l=Object.keys(e);for(n=0;n<l.length;n++)a=l[n],t.indexOf(a)>=0||(i[a]=e[a]);return i}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)a=l[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var p=n.createContext({}),m=function(e){var t=n.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):r(r({},t),e)),a},d=function(e){var t=m(e.components);return n.createElement(p.Provider,{value:t},e.children)},s="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},c=n.forwardRef((function(e,t){var a=e.components,i=e.mdxType,l=e.originalType,p=e.parentName,d=o(e,["components","mdxType","originalType","parentName"]),s=m(a),c=i,k=s["".concat(p,".").concat(c)]||s[c]||u[c]||l;return a?n.createElement(k,r(r({ref:t},d),{},{components:a})):n.createElement(k,r({ref:t},d))}));function k(e,t){var a=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var l=a.length,r=new Array(l);r[0]=c;var o={};for(var p in t)hasOwnProperty.call(t,p)&&(o[p]=t[p]);o.originalType=e,o[s]="string"==typeof e?e:i,r[1]=o;for(var m=2;m<l;m++)r[m]=a[m];return n.createElement.apply(null,r)}return n.createElement.apply(null,a)}c.displayName="MDXCreateElement"},251:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>p,contentTitle:()=>r,default:()=>u,frontMatter:()=>l,metadata:()=>o,toc:()=>m});var n=a(7462),i=(a(7294),a(3905));const l={title:"Client",sidebar_position:2},r="Trial Datastore Client",o={unversionedId:"reference/cli/trial-datastore/trial-datastore-client",id:"reference/cli/trial-datastore/trial-datastore-client",title:"Client",description:"The Trial Datastore client provides command line access to some features of the Trial Datastore, and in general any service implementing the Trial Datastore API.",source:"@site/docs/reference/cli/trial-datastore/trial-datastore-client.md",sourceDirName:"reference/cli/trial-datastore",slug:"/reference/cli/trial-datastore/trial-datastore-client",permalink:"/docs/reference/cli/trial-datastore/trial-datastore-client",draft:!1,tags:[],version:"current",lastUpdatedAt:1691703005,formattedLastUpdatedAt:"Aug 10, 2023",sidebarPosition:2,frontMatter:{title:"Client",sidebar_position:2},sidebar:"docSidebar",previous:{title:"Server",permalink:"/docs/reference/cli/trial-datastore/trial-datastore-server"},next:{title:"Model Registry",permalink:"/docs/reference/cli/model-registry"}},p={},m=[{value:"Common options",id:"common-options",level:3},{value:"<code>endpoint</code>",id:"endpoint",level:4},{value:"<code>timeout</code>",id:"timeout",level:4},{value:"<code>console_output</code>",id:"console_output",level:4},{value:"<code>list_trials</code> command",id:"list_trials-command",level:3},{value:"<code>count</code>",id:"count",level:4},{value:"<code>from</code>",id:"from",level:4},{value:"Command output",id:"command-output",level:4},{value:"<code>delete_trials</code> command",id:"delete_trials-command",level:3},{value:"Command output",id:"command-output-1",level:4},{value:"<code>export</code> command",id:"export-command",level:3},{value:"<code>file</code>",id:"file",level:4},{value:"Command output",id:"command-output-2",level:4},{value:"<code>import</code> command",id:"import-command",level:3},{value:"<code>file</code>",id:"file-1",level:4},{value:"<code>prefix</code>",id:"prefix",level:4},{value:"<code>user_id</code>",id:"user_id",level:4},{value:"Command output",id:"command-output-3",level:4}],d={toc:m},s="wrapper";function u(e){let{components:t,...a}=e;return(0,i.kt)(s,(0,n.Z)({},d,a,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"trial-datastore-client"},"Trial Datastore Client"),(0,i.kt)("p",null,"The Trial Datastore client provides command line access to some features of the ",(0,i.kt)("a",{parentName:"p",href:"#service"},"Trial Datastore"),", and in general any service implementing the ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/grpc#trial-datastore-api"},"Trial Datastore API"),"."),(0,i.kt)("p",null,"It is called this way:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'$ cogment client trial_datastore --endpoint="grpc://trial_datastore:9003" [command]\n')),(0,i.kt)("p",null,"The Trial Datastore client has the following commands:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"#listtrials-command"},(0,i.kt)("inlineCode",{parentName:"a"},"list_trials"))," to list trials stored in the Trial Datastore,"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"#deletetrials-command"},(0,i.kt)("inlineCode",{parentName:"a"},"delete_trials"))," to delete trials from the Trial Datastore,"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"#export-command"},(0,i.kt)("inlineCode",{parentName:"a"},"export"))," to export trials and their samples from the Trial Datastore,"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"#import-command"},(0,i.kt)("inlineCode",{parentName:"a"},"import"))," to import trials and their samples to the Trial Datastore.")),(0,i.kt)("h3",{id:"common-options"},"Common options"),(0,i.kt)("p",null,"A few configuration options are shared by the different commands, they can be specified either through the command line or environment variables."),(0,i.kt)("h4",{id:"endpoint"},(0,i.kt)("inlineCode",{parentName:"h4"},"endpoint")),(0,i.kt)("p",null,"The ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#grpc-scheme"},"gRPC endpoint")," of the target Trial Datastore."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'--endpoint="grpc://10.0.123.5:9003"'),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_TRIAL_DATASTORE_ENDPOINT=grpc://trial_datastore:9003"),","),(0,i.kt)("li",{parentName:"ul"},'its default value is "grpc://localhost:9003" (which is the default when running ',(0,i.kt)("inlineCode",{parentName:"li"},"cogment services trial_datastore")," locally).")),(0,i.kt)("h4",{id:"timeout"},(0,i.kt)("inlineCode",{parentName:"h4"},"timeout")),(0,i.kt)("p",null,'The maximum duration for the execution of the request. The duration should be specified as a sequence of numbers followed by a unit suffix: "300ms", "1.5h" or "2h45m" are valid timeouts. Valid time units are "ns", "us" (or "\xb5s"), "ms", "s", "m", "h".'),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--timeout=1m"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_CLIENT_TIMEOUT=90s"),","),(0,i.kt)("li",{parentName:"ul"},"its default value is 30 seconds.")),(0,i.kt)("h4",{id:"console_output"},(0,i.kt)("inlineCode",{parentName:"h4"},"console_output")),(0,i.kt)("p",null,"The format for what the command outputs to ",(0,i.kt)("inlineCode",{parentName:"p"},"stdout"),". Can be either set to:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"text"),", for human consumption, this output usually only includes partial information to ensure readability,"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"json"),", for consumption through scripts, we recommend using a tool like ",(0,i.kt)("a",{parentName:"li",href:"https://stedolan.github.io/jq/"},(0,i.kt)("inlineCode",{parentName:"a"},"jq"))," to parse and manipulate it.")),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--console_output=json"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_CLIENT_CONSOLE_OUTPUT=text"),","),(0,i.kt)("li",{parentName:"ul"},"its default value is ",(0,i.kt)("inlineCode",{parentName:"li"},"text"),".")),(0,i.kt)("h3",{id:"list_trials-command"},(0,i.kt)("inlineCode",{parentName:"h3"},"list_trials")," command"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"list_trials")," can be used to list the trials stored in a Trial Datastore."),(0,i.kt)("p",null,"It can be called this way:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'$ cogment client trial_datastore --endpoint="grpc://trial_datastore:9003" list_trials --count 20\n')),(0,i.kt)("p",null,"In addition to the ",(0,i.kt)("a",{parentName:"p",href:"#shared-configuration"},"shared configuration"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"list_trials")," can be configured with the following options."),(0,i.kt)("h4",{id:"count"},(0,i.kt)("inlineCode",{parentName:"h4"},"count")),(0,i.kt)("p",null,"The maximum number of trials to retrieve."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--count=45"),","),(0,i.kt)("li",{parentName:"ul"},"its default value is 10.")),(0,i.kt)("h4",{id:"from"},(0,i.kt)("inlineCode",{parentName:"h4"},"from")),(0,i.kt)("p",null,"The handle of the first trial to be retrieved: leave empty to retrieve a first page of results, for subsequent ones, set it to the ",(0,i.kt)("em",{parentName:"p"},"next trial handle")," retrieved alongside the previous page."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--from=23"),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value (which will retrieve the first page of results)")),(0,i.kt)("h4",{id:"command-output"},"Command output"),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"text")," output of ",(0,i.kt)("inlineCode",{parentName:"p"},"list_trials")," is an array listing the following information for each trial."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("em",{parentName:"li"},"trial id"),": the unique ID of the trial."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("em",{parentName:"li"},"user id"),": the ID of the user that started or imported the trial."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("em",{parentName:"li"},"state"),": the ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/grpc#trialstate"},"trial state")," for the last stored sample."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("em",{parentName:"li"},"samples"),": the number of samples received for this trial."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("em",{parentName:"li"},"actors"),": the number of actors involved in this trial.")),(0,i.kt)("p",null,"The number of retrieved trials and the ",(0,i.kt)("em",{parentName:"p"},"next trial handle")," are also printed."),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"json")," output of ",(0,i.kt)("inlineCode",{parentName:"p"},"list_trials")," is an instance of ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/grpc#retrievetrialsreply"},(0,i.kt)("inlineCode",{parentName:"a"},"cogmentAPI.RetrieveTrialsReply"))," serialized in ",(0,i.kt)("a",{parentName:"p",href:"https://developers.google.com/protocol-buffers/docs/proto3#json"},"JSON"),"."),(0,i.kt)("h3",{id:"delete_trials-command"},(0,i.kt)("inlineCode",{parentName:"h3"},"delete_trials")," command"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"delete_trials")," can be used to delete trials stored in a Trial Datastore."),(0,i.kt)("p",null,"It can be called this way:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'$ cogment client delete_trials --endpoint="grpc://trial_datastore:9003" delete_trials <trial_id1> [...]\n')),(0,i.kt)("h4",{id:"command-output-1"},"Command output"),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"text")," output of ",(0,i.kt)("inlineCode",{parentName:"p"},"delete_trials")," is a human readable summary of the operation."),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"json")," output of ",(0,i.kt)("inlineCode",{parentName:"p"},"delete_trials")," is an object holding:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"message"')," a human readable summary,"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"trial_ids"')," the list of deleted trial IDs (this also includes the trial IDs that didn't exist).")),(0,i.kt)("h3",{id:"export-command"},(0,i.kt)("inlineCode",{parentName:"h3"},"export")," command"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"export")," can be used to export the samples of multiple trials."),(0,i.kt)("p",null,"It can be called this way:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'$ cogment client trial_datastore --endpoint="grpc://trial_datastore:9003" export <trial_id1> [...] --file="data.dump"\n')),(0,i.kt)("p",null,"In addition to the ",(0,i.kt)("a",{parentName:"p",href:"#shared-configuration"},"shared configuration"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"export")," can be configured with the following options."),(0,i.kt)("h4",{id:"file"},(0,i.kt)("inlineCode",{parentName:"h4"},"file")),(0,i.kt)("p",null,"Path to the file where the data will be exported. If none is provided the same export is written to ",(0,i.kt)("inlineCode",{parentName:"p"},"stdout")," and no summary output is generated."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'--file="./path/to/data.dump"'),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")),(0,i.kt)("p",null,"The output format is binary, it is composed of the following:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"A ",(0,i.kt)("a",{parentName:"li",href:"https://en.wikipedia.org/wiki/File_format#Magic_number"},"16 bytes ",(0,i.kt)("em",{parentName:"a"},"magic")," string")," used for file identification, its current value is ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENTTRIALS001"),","),(0,i.kt)("li",{parentName:"ul"},"A ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/grpc#trialsamplesfileheader"},(0,i.kt)("inlineCode",{parentName:"a"},"cogmentAPI.TrialSamplesFileHeader"))," protobuf message defining some metadata as well as the parameters of the trials exported in the file,"),(0,i.kt)("li",{parentName:"ul"},"A list of ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/grpc#storedtrialsample"},(0,i.kt)("inlineCode",{parentName:"a"},"cogmentAPI.StoredTrialSample"))," protobuf messages defining the samples.")),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"Protobuf messages are stored in the file as:"),(0,i.kt)("ol",{parentName:"admonition"},(0,i.kt)("li",{parentName:"ol"},"the size of the serialized message, as a 32 bits unsigned integer encoded in little endian,"),(0,i.kt)("li",{parentName:"ol"},"the serialized message."))),(0,i.kt)("h4",{id:"command-output-2"},"Command output"),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"text")," output of ",(0,i.kt)("inlineCode",{parentName:"p"},"export")," is a human readable summary of the operation."),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"json")," output of ",(0,i.kt)("inlineCode",{parentName:"p"},"export")," is an object holding:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"message"'),", a human readable summary."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"bytes"'),", the size of the output file, in bytes,"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"trial_ids"'),", the list of the exported trial IDs,"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"filepath"'),", the path to the output file,")),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"If the ",(0,i.kt)("a",{parentName:"p",href:"#file"},(0,i.kt)("inlineCode",{parentName:"a"},"--file"))," option is not provided, only the binary content is outputed, no other command output is printed.")),(0,i.kt)("h3",{id:"import-command"},(0,i.kt)("inlineCode",{parentName:"h3"},"import")," command"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"import")," can be used to import multiple trials and their samples from a previously ",(0,i.kt)("a",{parentName:"p",href:"#export-command"},"exported")," source."),(0,i.kt)("p",null,"It can be called this way:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'$ cogment client trial_datastore --endpoint="grpc://trial_datastore:9003" import --file="data.dump"\n')),(0,i.kt)("p",null,"In addition to the ",(0,i.kt)("a",{parentName:"p",href:"#shared-configuration"},"shared configuration"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"import")," can be configured with the following options."),(0,i.kt)("h4",{id:"file-1"},(0,i.kt)("inlineCode",{parentName:"h4"},"file")),(0,i.kt)("p",null,"Path to the file from which the data will be imported. If none is provided the import reads from ",(0,i.kt)("inlineCode",{parentName:"p"},"stdin"),"."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'--file="./path/to/data.dump"'),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")),(0,i.kt)("p",null,"The input file format is expected to match the ",(0,i.kt)("a",{parentName:"p",href:"#file"},(0,i.kt)("inlineCode",{parentName:"a"},"export"),"'s"),"."),(0,i.kt)("h4",{id:"prefix"},(0,i.kt)("inlineCode",{parentName:"h4"},"prefix")),(0,i.kt)("p",null,"Prefix to apply to the ID of trials present in the file. This option is useful to prevent ID conflicts as each trial ID needs to be unique."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'--prefix="2022-08-08-import-"'),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")),(0,i.kt)("h4",{id:"user_id"},(0,i.kt)("inlineCode",{parentName:"h4"},"user_id")),(0,i.kt)("p",null,"The User ID to use for the imported trials."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'--user_id="Jane Doe"'),","),(0,i.kt)("li",{parentName:"ul"},"its default value is ",(0,i.kt)("inlineCode",{parentName:"li"},'"cogment CLI"'),".")),(0,i.kt)("h4",{id:"command-output-3"},"Command output"),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"text")," output of ",(0,i.kt)("inlineCode",{parentName:"p"},"import")," is a message specifying the number of imported trials, the input file path and the number of imported samples."),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"json")," output of ",(0,i.kt)("inlineCode",{parentName:"p"},"import")," is an object holding:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"message"'),", a human readable summary."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"samples_count"'),", the number of imported samples,"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"trials"'),", a list containing an object for each trial defining,",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"trial_id"'),", the trial ID,"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"samples_count"'),", the number of imported samples for this trial,"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"filepath"'),", the path to the input file,")))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/b2327a6c.2d13b65b.js b/assets/js/b2327a6c.2d13b65b.js deleted file mode 100644 index 626cffc..0000000 --- a/assets/js/b2327a6c.2d13b65b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[1909],{3905:(e,t,a)=>{a.d(t,{Zo:()=>d,kt:()=>c});var n=a(7294);function i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function r(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?l(Object(a),!0).forEach((function(t){i(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function o(e,t){if(null==e)return{};var a,n,i=function(e,t){if(null==e)return{};var a,n,i={},l=Object.keys(e);for(n=0;n<l.length;n++)a=l[n],t.indexOf(a)>=0||(i[a]=e[a]);return i}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)a=l[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var p=n.createContext({}),m=function(e){var t=n.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):r(r({},t),e)),a},d=function(e){var t=m(e.components);return n.createElement(p.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},u=n.forwardRef((function(e,t){var a=e.components,i=e.mdxType,l=e.originalType,p=e.parentName,d=o(e,["components","mdxType","originalType","parentName"]),u=m(a),c=i,k=u["".concat(p,".").concat(c)]||u[c]||s[c]||l;return a?n.createElement(k,r(r({ref:t},d),{},{components:a})):n.createElement(k,r({ref:t},d))}));function c(e,t){var a=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var l=a.length,r=new Array(l);r[0]=u;var o={};for(var p in t)hasOwnProperty.call(t,p)&&(o[p]=t[p]);o.originalType=e,o.mdxType="string"==typeof e?e:i,r[1]=o;for(var m=2;m<l;m++)r[m]=a[m];return n.createElement.apply(null,r)}return n.createElement.apply(null,a)}u.displayName="MDXCreateElement"},251:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>p,contentTitle:()=>r,default:()=>s,frontMatter:()=>l,metadata:()=>o,toc:()=>m});var n=a(7462),i=(a(7294),a(3905));const l={title:"Client",sidebar_position:2},r="Trial Datastore Client",o={unversionedId:"reference/cli/trial-datastore/trial-datastore-client",id:"reference/cli/trial-datastore/trial-datastore-client",title:"Client",description:"The Trial Datastore client provides command line access to some features of the Trial Datastore, and in general any service implementing the Trial Datastore API.",source:"@site/docs/reference/cli/trial-datastore/trial-datastore-client.md",sourceDirName:"reference/cli/trial-datastore",slug:"/reference/cli/trial-datastore/trial-datastore-client",permalink:"/docs/reference/cli/trial-datastore/trial-datastore-client",draft:!1,tags:[],version:"current",lastUpdatedAt:1691703005,formattedLastUpdatedAt:"Aug 10, 2023",sidebarPosition:2,frontMatter:{title:"Client",sidebar_position:2},sidebar:"docSidebar",previous:{title:"Server",permalink:"/docs/reference/cli/trial-datastore/trial-datastore-server"},next:{title:"Model Registry",permalink:"/docs/reference/cli/model-registry"}},p={},m=[{value:"Common options",id:"common-options",level:3},{value:"<code>endpoint</code>",id:"endpoint",level:4},{value:"<code>timeout</code>",id:"timeout",level:4},{value:"<code>console_output</code>",id:"console_output",level:4},{value:"<code>list_trials</code> command",id:"list_trials-command",level:3},{value:"<code>count</code>",id:"count",level:4},{value:"<code>from</code>",id:"from",level:4},{value:"Command output",id:"command-output",level:4},{value:"<code>delete_trials</code> command",id:"delete_trials-command",level:3},{value:"Command output",id:"command-output-1",level:4},{value:"<code>export</code> command",id:"export-command",level:3},{value:"<code>file</code>",id:"file",level:4},{value:"Command output",id:"command-output-2",level:4},{value:"<code>import</code> command",id:"import-command",level:3},{value:"<code>file</code>",id:"file-1",level:4},{value:"<code>prefix</code>",id:"prefix",level:4},{value:"<code>user_id</code>",id:"user_id",level:4},{value:"Command output",id:"command-output-3",level:4}],d={toc:m};function s(e){let{components:t,...a}=e;return(0,i.kt)("wrapper",(0,n.Z)({},d,a,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"trial-datastore-client"},"Trial Datastore Client"),(0,i.kt)("p",null,"The Trial Datastore client provides command line access to some features of the ",(0,i.kt)("a",{parentName:"p",href:"#service"},"Trial Datastore"),", and in general any service implementing the ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/grpc#trial-datastore-api"},"Trial Datastore API"),"."),(0,i.kt)("p",null,"It is called this way:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'$ cogment client trial_datastore --endpoint="grpc://trial_datastore:9003" [command]\n')),(0,i.kt)("p",null,"The Trial Datastore client has the following commands:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"#listtrials-command"},(0,i.kt)("inlineCode",{parentName:"a"},"list_trials"))," to list trials stored in the Trial Datastore,"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"#deletetrials-command"},(0,i.kt)("inlineCode",{parentName:"a"},"delete_trials"))," to delete trials from the Trial Datastore,"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"#export-command"},(0,i.kt)("inlineCode",{parentName:"a"},"export"))," to export trials and their samples from the Trial Datastore,"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"#import-command"},(0,i.kt)("inlineCode",{parentName:"a"},"import"))," to import trials and their samples to the Trial Datastore.")),(0,i.kt)("h3",{id:"common-options"},"Common options"),(0,i.kt)("p",null,"A few configuration options are shared by the different commands, they can be specified either through the command line or environment variables."),(0,i.kt)("h4",{id:"endpoint"},(0,i.kt)("inlineCode",{parentName:"h4"},"endpoint")),(0,i.kt)("p",null,"The ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#grpc-scheme"},"gRPC endpoint")," of the target Trial Datastore."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'--endpoint="grpc://10.0.123.5:9003"'),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_TRIAL_DATASTORE_ENDPOINT=grpc://trial_datastore:9003"),","),(0,i.kt)("li",{parentName:"ul"},'its default value is "grpc://localhost:9003" (which is the default when running ',(0,i.kt)("inlineCode",{parentName:"li"},"cogment services trial_datastore")," locally).")),(0,i.kt)("h4",{id:"timeout"},(0,i.kt)("inlineCode",{parentName:"h4"},"timeout")),(0,i.kt)("p",null,'The maximum duration for the execution of the request. The duration should be specified as a sequence of numbers followed by a unit suffix: "300ms", "1.5h" or "2h45m" are valid timeouts. Valid time units are "ns", "us" (or "\xb5s"), "ms", "s", "m", "h".'),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--timeout=1m"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_CLIENT_TIMEOUT=90s"),","),(0,i.kt)("li",{parentName:"ul"},"its default value is 30 seconds.")),(0,i.kt)("h4",{id:"console_output"},(0,i.kt)("inlineCode",{parentName:"h4"},"console_output")),(0,i.kt)("p",null,"The format for what the command outputs to ",(0,i.kt)("inlineCode",{parentName:"p"},"stdout"),". Can be either set to:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"text"),", for human consumption, this output usually only includes partial information to ensure readability,"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"json"),", for consumption through scripts, we recommend using a tool like ",(0,i.kt)("a",{parentName:"li",href:"https://stedolan.github.io/jq/"},(0,i.kt)("inlineCode",{parentName:"a"},"jq"))," to parse and manipulate it.")),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--console_output=json"),","),(0,i.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENT_CLIENT_CONSOLE_OUTPUT=text"),","),(0,i.kt)("li",{parentName:"ul"},"its default value is ",(0,i.kt)("inlineCode",{parentName:"li"},"text"),".")),(0,i.kt)("h3",{id:"list_trials-command"},(0,i.kt)("inlineCode",{parentName:"h3"},"list_trials")," command"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"list_trials")," can be used to list the trials stored in a Trial Datastore."),(0,i.kt)("p",null,"It can be called this way:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'$ cogment client trial_datastore --endpoint="grpc://trial_datastore:9003" list_trials --count 20\n')),(0,i.kt)("p",null,"In addition to the ",(0,i.kt)("a",{parentName:"p",href:"#shared-configuration"},"shared configuration"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"list_trials")," can be configured with the following options."),(0,i.kt)("h4",{id:"count"},(0,i.kt)("inlineCode",{parentName:"h4"},"count")),(0,i.kt)("p",null,"The maximum number of trials to retrieve."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--count=45"),","),(0,i.kt)("li",{parentName:"ul"},"its default value is 10.")),(0,i.kt)("h4",{id:"from"},(0,i.kt)("inlineCode",{parentName:"h4"},"from")),(0,i.kt)("p",null,"The handle of the first trial to be retrieved: leave empty to retrieve a first page of results, for subsequent ones, set it to the ",(0,i.kt)("em",{parentName:"p"},"next trial handle")," retrieved alongside the previous page."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"--from=23"),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value (which will retrieve the first page of results)")),(0,i.kt)("h4",{id:"command-output"},"Command output"),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"text")," output of ",(0,i.kt)("inlineCode",{parentName:"p"},"list_trials")," is an array listing the following information for each trial."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("em",{parentName:"li"},"trial id"),": the unique ID of the trial."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("em",{parentName:"li"},"user id"),": the ID of the user that started or imported the trial."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("em",{parentName:"li"},"state"),": the ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/grpc#trialstate"},"trial state")," for the last stored sample."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("em",{parentName:"li"},"samples"),": the number of samples received for this trial."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("em",{parentName:"li"},"actors"),": the number of actors involved in this trial.")),(0,i.kt)("p",null,"The number of retrieved trials and the ",(0,i.kt)("em",{parentName:"p"},"next trial handle")," are also printed."),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"json")," output of ",(0,i.kt)("inlineCode",{parentName:"p"},"list_trials")," is an instance of ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/grpc#retrievetrialsreply"},(0,i.kt)("inlineCode",{parentName:"a"},"cogmentAPI.RetrieveTrialsReply"))," serialized in ",(0,i.kt)("a",{parentName:"p",href:"https://developers.google.com/protocol-buffers/docs/proto3#json"},"JSON"),"."),(0,i.kt)("h3",{id:"delete_trials-command"},(0,i.kt)("inlineCode",{parentName:"h3"},"delete_trials")," command"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"delete_trials")," can be used to delete trials stored in a Trial Datastore."),(0,i.kt)("p",null,"It can be called this way:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'$ cogment client delete_trials --endpoint="grpc://trial_datastore:9003" delete_trials <trial_id1> [...]\n')),(0,i.kt)("h4",{id:"command-output-1"},"Command output"),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"text")," output of ",(0,i.kt)("inlineCode",{parentName:"p"},"delete_trials")," is a human readable summary of the operation."),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"json")," output of ",(0,i.kt)("inlineCode",{parentName:"p"},"delete_trials")," is an object holding:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"message"')," a human readable summary,"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"trial_ids"')," the list of deleted trial IDs (this also includes the trial IDs that didn't exist).")),(0,i.kt)("h3",{id:"export-command"},(0,i.kt)("inlineCode",{parentName:"h3"},"export")," command"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"export")," can be used to export the samples of multiple trials."),(0,i.kt)("p",null,"It can be called this way:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'$ cogment client trial_datastore --endpoint="grpc://trial_datastore:9003" export <trial_id1> [...] --file="data.dump"\n')),(0,i.kt)("p",null,"In addition to the ",(0,i.kt)("a",{parentName:"p",href:"#shared-configuration"},"shared configuration"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"export")," can be configured with the following options."),(0,i.kt)("h4",{id:"file"},(0,i.kt)("inlineCode",{parentName:"h4"},"file")),(0,i.kt)("p",null,"Path to the file where the data will be exported. If none is provided the same export is written to ",(0,i.kt)("inlineCode",{parentName:"p"},"stdout")," and no summary output is generated."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'--file="./path/to/data.dump"'),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")),(0,i.kt)("p",null,"The output format is binary, it is composed of the following:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"A ",(0,i.kt)("a",{parentName:"li",href:"https://en.wikipedia.org/wiki/File_format#Magic_number"},"16 bytes ",(0,i.kt)("em",{parentName:"a"},"magic")," string")," used for file identification, its current value is ",(0,i.kt)("inlineCode",{parentName:"li"},"COGMENTTRIALS001"),","),(0,i.kt)("li",{parentName:"ul"},"A ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/grpc#trialsamplesfileheader"},(0,i.kt)("inlineCode",{parentName:"a"},"cogmentAPI.TrialSamplesFileHeader"))," protobuf message defining some metadata as well as the parameters of the trials exported in the file,"),(0,i.kt)("li",{parentName:"ul"},"A list of ",(0,i.kt)("a",{parentName:"li",href:"/docs/reference/grpc#storedtrialsample"},(0,i.kt)("inlineCode",{parentName:"a"},"cogmentAPI.StoredTrialSample"))," protobuf messages defining the samples.")),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"Protobuf messages are stored in the file as:"),(0,i.kt)("ol",{parentName:"admonition"},(0,i.kt)("li",{parentName:"ol"},"the size of the serialized message, as a 32 bits unsigned integer encoded in little endian,"),(0,i.kt)("li",{parentName:"ol"},"the serialized message."))),(0,i.kt)("h4",{id:"command-output-2"},"Command output"),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"text")," output of ",(0,i.kt)("inlineCode",{parentName:"p"},"export")," is a human readable summary of the operation."),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"json")," output of ",(0,i.kt)("inlineCode",{parentName:"p"},"export")," is an object holding:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"message"'),", a human readable summary."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"bytes"'),", the size of the output file, in bytes,"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"trial_ids"'),", the list of the exported trial IDs,"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"filepath"'),", the path to the output file,")),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"If the ",(0,i.kt)("a",{parentName:"p",href:"#file"},(0,i.kt)("inlineCode",{parentName:"a"},"--file"))," option is not provided, only the binary content is outputed, no other command output is printed.")),(0,i.kt)("h3",{id:"import-command"},(0,i.kt)("inlineCode",{parentName:"h3"},"import")," command"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"import")," can be used to import multiple trials and their samples from a previously ",(0,i.kt)("a",{parentName:"p",href:"#export-command"},"exported")," source."),(0,i.kt)("p",null,"It can be called this way:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'$ cogment client trial_datastore --endpoint="grpc://trial_datastore:9003" import --file="data.dump"\n')),(0,i.kt)("p",null,"In addition to the ",(0,i.kt)("a",{parentName:"p",href:"#shared-configuration"},"shared configuration"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"import")," can be configured with the following options."),(0,i.kt)("h4",{id:"file-1"},(0,i.kt)("inlineCode",{parentName:"h4"},"file")),(0,i.kt)("p",null,"Path to the file from which the data will be imported. If none is provided the import reads from ",(0,i.kt)("inlineCode",{parentName:"p"},"stdin"),"."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'--file="./path/to/data.dump"'),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")),(0,i.kt)("p",null,"The input file format is expected to match the ",(0,i.kt)("a",{parentName:"p",href:"#file"},(0,i.kt)("inlineCode",{parentName:"a"},"export"),"'s"),"."),(0,i.kt)("h4",{id:"prefix"},(0,i.kt)("inlineCode",{parentName:"h4"},"prefix")),(0,i.kt)("p",null,"Prefix to apply to the ID of trials present in the file. This option is useful to prevent ID conflicts as each trial ID needs to be unique."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'--prefix="2022-08-08-import-"'),","),(0,i.kt)("li",{parentName:"ul"},"it has no default value.")),(0,i.kt)("h4",{id:"user_id"},(0,i.kt)("inlineCode",{parentName:"h4"},"user_id")),(0,i.kt)("p",null,"The User ID to use for the imported trials."),(0,i.kt)("p",null,"Can be specified as:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'--user_id="Jane Doe"'),","),(0,i.kt)("li",{parentName:"ul"},"its default value is ",(0,i.kt)("inlineCode",{parentName:"li"},'"cogment CLI"'),".")),(0,i.kt)("h4",{id:"command-output-3"},"Command output"),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"text")," output of ",(0,i.kt)("inlineCode",{parentName:"p"},"import")," is a message specifying the number of imported trials, the input file path and the number of imported samples."),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"json")," output of ",(0,i.kt)("inlineCode",{parentName:"p"},"import")," is an object holding:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"message"'),", a human readable summary."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"samples_count"'),", the number of imported samples,"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"trials"'),", a list containing an object for each trial defining,",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"trial_id"'),", the trial ID,"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"samples_count"'),", the number of imported samples for this trial,"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'"filepath"'),", the path to the input file,")))}s.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/c24ec994.1b981edd.js b/assets/js/c24ec994.1b981edd.js deleted file mode 100644 index 6be269c..0000000 --- a/assets/js/c24ec994.1b981edd.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[5519],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>u});var a=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=a.createContext({}),c=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):r(r({},t),e)),n},p=function(e){var t=c(e.components);return a.createElement(l.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,l=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),m=c(n),u=o,h=m["".concat(l,".").concat(u)]||m[u]||d[u]||i;return n?a.createElement(h,r(r({ref:t},p),{},{components:n})):a.createElement(h,r({ref:t},p))}));function u(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,r=new Array(i);r[0]=m;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s.mdxType="string"==typeof e?e:o,r[1]=s;for(var c=2;c<i;c++)r[c]=n[c];return a.createElement.apply(null,r)}return a.createElement.apply(null,n)}m.displayName="MDXCreateElement"},4985:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>r,default:()=>d,frontMatter:()=>i,metadata:()=>s,toc:()=>c});var a=n(7462),o=(n(7294),n(3905));const i={title:"Step 4 - Making Decisions with Feedback"},r="Making Decisions with Feedback",s={unversionedId:"guide/tutorial/decision-making",id:"guide/tutorial/decision-making",title:"Step 4 - Making Decisions with Feedback",description:"In this step of the tutorial, we will start thinking about rewards. Rewards are a way to evaluate how an Actor performs at a task. They can be used to evaluate or compare different implementations of an Actor, or, especially in the context of Reinforcement Learning, train a model. In Cogment, both the environment and other actors can evaluate an actor. Here, we will focus on sending rewards from the environment.",source:"@site/docs/guide/tutorial/4-decision-making.md",sourceDirName:"guide/tutorial",slug:"/guide/tutorial/decision-making",permalink:"/docs/guide/tutorial/decision-making",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:4,frontMatter:{title:"Step 4 - Making Decisions with Feedback"},sidebar:"docSidebar",previous:{title:"Step 3 - The Environment in Cogment",permalink:"/docs/guide/tutorial/environment-in-cogment"},next:{title:"Advanced Tutorial Steps",permalink:"/docs/guide/tutorial/advanced-tutorials/"}},l={},c=[{value:"Sending Rewards to the Actors",id:"sending-rewards-to-the-actors",level:2},{value:"Enabling Actors to Make Use of Information from the Environment",id:"enabling-actors-to-make-use-of-information-from-the-environment",level:2},{value:"Registering a new Actor with Cogment",id:"registering-a-new-actor-with-cogment",level:2}],p={toc:c};function d(e){let{components:t,...i}=e;return(0,o.kt)("wrapper",(0,a.Z)({},p,i,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"making-decisions-with-feedback"},"Making Decisions with Feedback"),(0,o.kt)("p",null,"In this step of the tutorial, we will start thinking about rewards. Rewards are a way to evaluate how an Actor performs at a task. They can be used to evaluate or compare different implementations of an Actor, or, especially in the context of Reinforcement Learning, train a model. In Cogment, both the environment and other actors can evaluate an actor. Here, we will focus on sending rewards from the environment."),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"including feedback from the environment",src:n(643).Z,width:"2604",height:"940"})),(0,o.kt)("p",null,"Until now, the concept of game is only known to the Environment. It has no impact on the Observation and action spaces, and thus no impact on the Actor implementation. This means an actor wouldn't ",(0,o.kt)("em",{parentName:"p"},"know")," that the round it currently plays is the tie breaker in a game or its very first round. As a result the actor will play every round the same way."),(0,o.kt)("p",null,"In this step we will allow the Environment to send rewards to the actors, and modify ",(0,o.kt)("inlineCode",{parentName:"p"},"Bob"),"'s implementations to make use of this kind of information in gameplay and compare how it performs against ",(0,o.kt)("inlineCode",{parentName:"p"},"Alice"),"'s implementation."),(0,o.kt)("h2",{id:"sending-rewards-to-the-actors"},"Sending Rewards to the Actors"),(0,o.kt)("p",null,"Here, we will modify ",(0,o.kt)("inlineCode",{parentName:"p"},"environment/main.py")," to include rewards when passing information to the Actors. Note that not all actions need to be rewarded. When a game is won, the Environment will add a ",(0,o.kt)("strong",{parentName:"p"},"positive reward to the winner")," (we chose a value of 1) and a ",(0,o.kt)("strong",{parentName:"p"},"negative reward to the loser")," (we chose a value of -1). Cogment also supports the notion of ",(0,o.kt)("em",{parentName:"p"},"confidence"),", a weight between 0 and 1 that expresses the qualification of the reward sender in its appreciation. In this case we are applying objective rules, so we use a confidence of 1."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"In the event loop, when the first player wins a game we add the following:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"environment_session.add_reward(value=1, confidence=1, to=[p1.actor_name])\nenvironment_session.add_reward(value=-1, confidence=1, to=[p2.actor_name])\n")),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"When the second player wins a game we add the following:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"environment_session.add_reward(value=-1, confidence=1, to=[p1.actor_name])\nenvironment_session.add_reward(value=1, confidence=1, to=[p2.actor_name])\n")),(0,o.kt)("p",null,"Modify the ",(0,o.kt)("inlineCode",{parentName:"p"},"environment/main.py")," file to include the above additions."),(0,o.kt)("p",null,"Your Environment implementation event block should now look like this:"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Environment implementation with rewards",src:n(6374).Z,width:"1916",height:"1964"})),(0,o.kt)("p",null,"You can now ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/setup#building-and-running-the-app"},"build and run")," the application to check that it works as expected. In particular, you should see logs relative to the reception of rewards on the Actor side."),(0,o.kt)("h2",{id:"enabling-actors-to-make-use-of-information-from-the-environment"},"Enabling Actors to Make Use of Information from the Environment"),(0,o.kt)("p",null,"In this section, we will create a new Actor implementation in ",(0,o.kt)("inlineCode",{parentName:"p"},"actors/main.py")," below our ",(0,o.kt)("inlineCode",{parentName:"p"},"random_agent")," implementation. We'll call our new implementation ",(0,o.kt)("inlineCode",{parentName:"p"},"heuristic_agent")," - it will just use a simple decision making logic for selecting an action based on the Observation it receives."),(0,o.kt)("p",null,"This Actor will also need to know what moves beat other moves. ",(0,o.kt)("strong",{parentName:"p"},'In the "Settings" section, add the ',(0,o.kt)("inlineCode",{parentName:"strong"},"DEFEATS")," we specified in the Environment:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"DEFEATS = {\n ROCK: PAPER,\n SCISSORS: ROCK,\n PAPER: SCISSORS\n}\n")),(0,o.kt)("p",null,"Now we can include a new Actor implementation that makes choices that utilize this knowledge. In ",(0,o.kt)("inlineCode",{parentName:"p"},"actors/main.py"),' add the following to the "Actor Implementation Functions" section:'),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"async def heuristic_agent(actor_session):\n # initialization\n actor_session.start()\n\n # event loop\n async for event in actor_session.all_events():\n if event.observation:\n observation = event.observation\n print(f\"'{actor_session.name}' received an observation: '{observation}'\")\n if event.type == cogment.EventType.ACTIVE:\n if observation.observation.me.won_last:\n # I won the last round, let's play the same thing\n actor_session.do_action(PlayerAction(move=observation.observation.me.last_move))\n elif observation.observation.them.won_last:\n # I lost the last round, let's play what would have won\n actor_session.do_action(PlayerAction(move=DEFEATS[observation.observation.them.last_move]))\n else:\n # last round was a draw, let's play randomly\n actor_session.do_action(PlayerAction(move=random.choice(MOVES)))\n for reward in event.rewards:\n print(f\"'{actor_session.name}' received a reward for tick #{reward.tick_id}: {reward.value}\")\n\n # termination\n")),(0,o.kt)("p",null,"This heuristic player uses a simple strategy for winning: if my last move was successful, play it again, and if it wasn't, play what would have won the last round. If the last round ended in a draw, select an action at random."),(0,o.kt)("h2",{id:"registering-a-new-actor-with-cogment"},"Registering a new Actor with Cogment"),(0,o.kt)("p",null,"Before we can use this new actor, we will need to register it with Cogment."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"In the ",(0,o.kt)("inlineCode",{parentName:"strong"},"main")," function of ",(0,o.kt)("inlineCode",{parentName:"strong"},"actors/main.py"),", add the following:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'context.register_actor(\n impl=heuristic_agent, # implementation defined above\n impl_name="heuristic_agent",\n actor_classes=["player",] # actor class defined in the cogment.yaml file\n )\n')),(0,o.kt)("p",null,"This will make Cogment aware of an actor of the ",(0,o.kt)("inlineCode",{parentName:"p"},"player")," class which uses the ",(0,o.kt)("inlineCode",{parentName:"p"},"heuristic_agent")," implementation. Next, let's make ",(0,o.kt)("inlineCode",{parentName:"p"},"Bob")," an Actor of this type."),(0,o.kt)("h1",{id:"modifying-bob"},"Modifying ",(0,o.kt)("inlineCode",{parentName:"h1"},"Bob")),(0,o.kt)("p",null,"In ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_runner/main.py"),", we will need to change which type of registered Actor ",(0,o.kt)("inlineCode",{parentName:"p"},"Bob")," is going to be in the game. Since we have registered this new Actor, all we need to do is change the ",(0,o.kt)("inlineCode",{parentName:"p"},"ActorParameters")," for ",(0,o.kt)("inlineCode",{parentName:"p"},"Bob"),". ",(0,o.kt)("strong",{parentName:"p"},"In ",(0,o.kt)("inlineCode",{parentName:"strong"},"trial_runner/main.py")," set the ",(0,o.kt)("inlineCode",{parentName:"strong"},"ActorParameters")," for the Actor named ",(0,o.kt)("inlineCode",{parentName:"strong"},"Bob")," to be:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'actor_1_params = cogment.ActorParameters(\n cog_settings,\n name="Bob",\n class_name="player",\n endpoint=ACTORS_ENDPOINT,\n implementation="heuristic_agent"\n )\n')),(0,o.kt)("p",null,"You can now ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/setup#building-the-application"},"install and run")," the application to check that it works. Don't expect the heuristic player to beat the random player, the nature of the game actually rewards pure randomness in the playing. However, now you have all of the tools necessary implement various strategies and see how they fare against each other. This concludes the basic tutorial for Cogment in RPS. If you'd like to try some more advanced techniques, check out the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/advanced-tutorials/"},"advanced tutorials"),"."))}d.isMDXComponent=!0},643:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/actor-env-interaction-reward-950ec0555811e5b4fa50d22165fb5051.png"},6374:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/environment_implementation_reward-7060bff3febc8f53cd4c23120c7073f9.png"}}]); \ No newline at end of file diff --git a/assets/js/c24ec994.ca06e2db.js b/assets/js/c24ec994.ca06e2db.js new file mode 100644 index 0000000..a329d7a --- /dev/null +++ b/assets/js/c24ec994.ca06e2db.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[5519],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>h});var a=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=a.createContext({}),c=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):r(r({},t),e)),n},p=function(e){var t=c(e.components);return a.createElement(l.Provider,{value:t},e.children)},d="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},u=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,l=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),d=c(n),u=o,h=d["".concat(l,".").concat(u)]||d[u]||m[u]||i;return n?a.createElement(h,r(r({ref:t},p),{},{components:n})):a.createElement(h,r({ref:t},p))}));function h(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,r=new Array(i);r[0]=u;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[d]="string"==typeof e?e:o,r[1]=s;for(var c=2;c<i;c++)r[c]=n[c];return a.createElement.apply(null,r)}return a.createElement.apply(null,n)}u.displayName="MDXCreateElement"},4985:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>r,default:()=>m,frontMatter:()=>i,metadata:()=>s,toc:()=>c});var a=n(7462),o=(n(7294),n(3905));const i={title:"Step 4 - Making Decisions with Feedback"},r="Making Decisions with Feedback",s={unversionedId:"guide/tutorial/decision-making",id:"guide/tutorial/decision-making",title:"Step 4 - Making Decisions with Feedback",description:"In this step of the tutorial, we will start thinking about rewards. Rewards are a way to evaluate how an Actor performs at a task. They can be used to evaluate or compare different implementations of an Actor, or, especially in the context of Reinforcement Learning, train a model. In Cogment, both the environment and other actors can evaluate an actor. Here, we will focus on sending rewards from the environment.",source:"@site/docs/guide/tutorial/4-decision-making.md",sourceDirName:"guide/tutorial",slug:"/guide/tutorial/decision-making",permalink:"/docs/guide/tutorial/decision-making",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:4,frontMatter:{title:"Step 4 - Making Decisions with Feedback"},sidebar:"docSidebar",previous:{title:"Step 3 - The Environment in Cogment",permalink:"/docs/guide/tutorial/environment-in-cogment"},next:{title:"Advanced Tutorial Steps",permalink:"/docs/guide/tutorial/advanced-tutorials/"}},l={},c=[{value:"Sending Rewards to the Actors",id:"sending-rewards-to-the-actors",level:2},{value:"Enabling Actors to Make Use of Information from the Environment",id:"enabling-actors-to-make-use-of-information-from-the-environment",level:2},{value:"Registering a new Actor with Cogment",id:"registering-a-new-actor-with-cogment",level:2}],p={toc:c},d="wrapper";function m(e){let{components:t,...i}=e;return(0,o.kt)(d,(0,a.Z)({},p,i,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"making-decisions-with-feedback"},"Making Decisions with Feedback"),(0,o.kt)("p",null,"In this step of the tutorial, we will start thinking about rewards. Rewards are a way to evaluate how an Actor performs at a task. They can be used to evaluate or compare different implementations of an Actor, or, especially in the context of Reinforcement Learning, train a model. In Cogment, both the environment and other actors can evaluate an actor. Here, we will focus on sending rewards from the environment."),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"including feedback from the environment",src:n(643).Z,width:"2604",height:"940"})),(0,o.kt)("p",null,"Until now, the concept of game is only known to the Environment. It has no impact on the Observation and action spaces, and thus no impact on the Actor implementation. This means an actor wouldn't ",(0,o.kt)("em",{parentName:"p"},"know")," that the round it currently plays is the tie breaker in a game or its very first round. As a result the actor will play every round the same way."),(0,o.kt)("p",null,"In this step we will allow the Environment to send rewards to the actors, and modify ",(0,o.kt)("inlineCode",{parentName:"p"},"Bob"),"'s implementations to make use of this kind of information in gameplay and compare how it performs against ",(0,o.kt)("inlineCode",{parentName:"p"},"Alice"),"'s implementation."),(0,o.kt)("h2",{id:"sending-rewards-to-the-actors"},"Sending Rewards to the Actors"),(0,o.kt)("p",null,"Here, we will modify ",(0,o.kt)("inlineCode",{parentName:"p"},"environment/main.py")," to include rewards when passing information to the Actors. Note that not all actions need to be rewarded. When a game is won, the Environment will add a ",(0,o.kt)("strong",{parentName:"p"},"positive reward to the winner")," (we chose a value of 1) and a ",(0,o.kt)("strong",{parentName:"p"},"negative reward to the loser")," (we chose a value of -1). Cogment also supports the notion of ",(0,o.kt)("em",{parentName:"p"},"confidence"),", a weight between 0 and 1 that expresses the qualification of the reward sender in its appreciation. In this case we are applying objective rules, so we use a confidence of 1."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"In the event loop, when the first player wins a game we add the following:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"environment_session.add_reward(value=1, confidence=1, to=[p1.actor_name])\nenvironment_session.add_reward(value=-1, confidence=1, to=[p2.actor_name])\n")),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"When the second player wins a game we add the following:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"environment_session.add_reward(value=-1, confidence=1, to=[p1.actor_name])\nenvironment_session.add_reward(value=1, confidence=1, to=[p2.actor_name])\n")),(0,o.kt)("p",null,"Modify the ",(0,o.kt)("inlineCode",{parentName:"p"},"environment/main.py")," file to include the above additions."),(0,o.kt)("p",null,"Your Environment implementation event block should now look like this:"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Environment implementation with rewards",src:n(6374).Z,width:"1916",height:"1964"})),(0,o.kt)("p",null,"You can now ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/setup#building-and-running-the-app"},"build and run")," the application to check that it works as expected. In particular, you should see logs relative to the reception of rewards on the Actor side."),(0,o.kt)("h2",{id:"enabling-actors-to-make-use-of-information-from-the-environment"},"Enabling Actors to Make Use of Information from the Environment"),(0,o.kt)("p",null,"In this section, we will create a new Actor implementation in ",(0,o.kt)("inlineCode",{parentName:"p"},"actors/main.py")," below our ",(0,o.kt)("inlineCode",{parentName:"p"},"random_agent")," implementation. We'll call our new implementation ",(0,o.kt)("inlineCode",{parentName:"p"},"heuristic_agent")," - it will just use a simple decision making logic for selecting an action based on the Observation it receives."),(0,o.kt)("p",null,"This Actor will also need to know what moves beat other moves. ",(0,o.kt)("strong",{parentName:"p"},'In the "Settings" section, add the ',(0,o.kt)("inlineCode",{parentName:"strong"},"DEFEATS")," we specified in the Environment:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"DEFEATS = {\n ROCK: PAPER,\n SCISSORS: ROCK,\n PAPER: SCISSORS\n}\n")),(0,o.kt)("p",null,"Now we can include a new Actor implementation that makes choices that utilize this knowledge. In ",(0,o.kt)("inlineCode",{parentName:"p"},"actors/main.py"),' add the following to the "Actor Implementation Functions" section:'),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"async def heuristic_agent(actor_session):\n # initialization\n actor_session.start()\n\n # event loop\n async for event in actor_session.all_events():\n if event.observation:\n observation = event.observation\n print(f\"'{actor_session.name}' received an observation: '{observation}'\")\n if event.type == cogment.EventType.ACTIVE:\n if observation.observation.me.won_last:\n # I won the last round, let's play the same thing\n actor_session.do_action(PlayerAction(move=observation.observation.me.last_move))\n elif observation.observation.them.won_last:\n # I lost the last round, let's play what would have won\n actor_session.do_action(PlayerAction(move=DEFEATS[observation.observation.them.last_move]))\n else:\n # last round was a draw, let's play randomly\n actor_session.do_action(PlayerAction(move=random.choice(MOVES)))\n for reward in event.rewards:\n print(f\"'{actor_session.name}' received a reward for tick #{reward.tick_id}: {reward.value}\")\n\n # termination\n")),(0,o.kt)("p",null,"This heuristic player uses a simple strategy for winning: if my last move was successful, play it again, and if it wasn't, play what would have won the last round. If the last round ended in a draw, select an action at random."),(0,o.kt)("h2",{id:"registering-a-new-actor-with-cogment"},"Registering a new Actor with Cogment"),(0,o.kt)("p",null,"Before we can use this new actor, we will need to register it with Cogment."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"In the ",(0,o.kt)("inlineCode",{parentName:"strong"},"main")," function of ",(0,o.kt)("inlineCode",{parentName:"strong"},"actors/main.py"),", add the following:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'context.register_actor(\n impl=heuristic_agent, # implementation defined above\n impl_name="heuristic_agent",\n actor_classes=["player",] # actor class defined in the cogment.yaml file\n )\n')),(0,o.kt)("p",null,"This will make Cogment aware of an actor of the ",(0,o.kt)("inlineCode",{parentName:"p"},"player")," class which uses the ",(0,o.kt)("inlineCode",{parentName:"p"},"heuristic_agent")," implementation. Next, let's make ",(0,o.kt)("inlineCode",{parentName:"p"},"Bob")," an Actor of this type."),(0,o.kt)("h1",{id:"modifying-bob"},"Modifying ",(0,o.kt)("inlineCode",{parentName:"h1"},"Bob")),(0,o.kt)("p",null,"In ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_runner/main.py"),", we will need to change which type of registered Actor ",(0,o.kt)("inlineCode",{parentName:"p"},"Bob")," is going to be in the game. Since we have registered this new Actor, all we need to do is change the ",(0,o.kt)("inlineCode",{parentName:"p"},"ActorParameters")," for ",(0,o.kt)("inlineCode",{parentName:"p"},"Bob"),". ",(0,o.kt)("strong",{parentName:"p"},"In ",(0,o.kt)("inlineCode",{parentName:"strong"},"trial_runner/main.py")," set the ",(0,o.kt)("inlineCode",{parentName:"strong"},"ActorParameters")," for the Actor named ",(0,o.kt)("inlineCode",{parentName:"strong"},"Bob")," to be:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'actor_1_params = cogment.ActorParameters(\n cog_settings,\n name="Bob",\n class_name="player",\n endpoint=ACTORS_ENDPOINT,\n implementation="heuristic_agent"\n )\n')),(0,o.kt)("p",null,"You can now ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/setup#building-the-application"},"install and run")," the application to check that it works. Don't expect the heuristic player to beat the random player, the nature of the game actually rewards pure randomness in the playing. However, now you have all of the tools necessary implement various strategies and see how they fare against each other. This concludes the basic tutorial for Cogment in RPS. If you'd like to try some more advanced techniques, check out the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/advanced-tutorials/"},"advanced tutorials"),"."))}m.isMDXComponent=!0},643:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/actor-env-interaction-reward-950ec0555811e5b4fa50d22165fb5051.png"},6374:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/environment_implementation_reward-7060bff3febc8f53cd4c23120c7073f9.png"}}]); \ No newline at end of file diff --git a/assets/js/c377a04b.dee11c26.js b/assets/js/c377a04b.dee11c26.js deleted file mode 100644 index 115cf9b..0000000 --- a/assets/js/c377a04b.dee11c26.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[6971],{3905:(e,t,n)=>{n.d(t,{Zo:()=>m,kt:()=>h});var o=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,o,a=function(e,t){if(null==e)return{};var n,o,a={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=o.createContext({}),c=function(e){var t=o.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},m=function(e){var t=c(e.components);return o.createElement(l.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},d=o.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,l=e.parentName,m=s(e,["components","mdxType","originalType","parentName"]),d=c(n),h=a,u=d["".concat(l,".").concat(h)]||d[h]||p[h]||r;return n?o.createElement(u,i(i({ref:t},m),{},{components:n})):o.createElement(u,i({ref:t},m))}));function h(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,i=new Array(r);i[0]=d;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s.mdxType="string"==typeof e?e:a,i[1]=s;for(var c=2;c<r;c++)i[c]=n[c];return o.createElement.apply(null,i)}return o.createElement.apply(null,n)}d.displayName="MDXCreateElement"},1269:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>i,default:()=>p,frontMatter:()=>r,metadata:()=>s,toc:()=>c});var o=n(7462),a=(n(7294),n(3905));const r={title:"Overview",description:"An introduction to Cogment",sidebar_position:1},i="What is Cogment?",s={unversionedId:"index",id:"index",title:"Overview",description:"An introduction to Cogment",source:"@site/docs/index.md",sourceDirName:".",slug:"/",permalink:"/docs/",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:1,frontMatter:{title:"Overview",description:"An introduction to Cogment",sidebar_position:1},sidebar:"docSidebar",next:{title:"Community",permalink:"/docs/community-channels"}},l={},c=[{value:"How does Cogment work?",id:"how-does-cogment-work",level:2},{value:"What are the Core Components of Cogment?",id:"what-are-the-core-components-of-cogment",level:3},{value:"What components are implemented with SDKs?",id:"what-components-are-implemented-with-sdks",level:3},{value:"What is Cogment used for?",id:"what-is-cogment-used-for",level:2},{value:"Getting Started with Cogment",id:"getting-started-with-cogment",level:2},{value:"Citations",id:"citations",level:2}],m={toc:c};function p(e){let{components:t,...r}=e;return(0,a.kt)("wrapper",(0,o.Z)({},m,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"what-is-cogment"},"What is Cogment?"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://cogment.ai"},"Cogment")," is the first open source platform designed to address the challenges of continuously training humans and AI together. Cogment is developed by ",(0,a.kt)("a",{parentName:"p",href:"https://ai-r.com"},"AI Redefined")," to enable AI practitioners to build, train and operate AI agents in simulated or real environments shared with humans. Fundamentally, Cogment is a set of tools designed to make it easier and more scalable to coordinate how Agents share information with each other and the Environment in which they operate."),(0,a.kt)("p",null,"Cogment is designed around the idea of sequential interactions between Actors and their Environment, as in ",(0,a.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/Reinforcement_learning"},"Reinforcement Learning (RL)"),". Cogment uses distributed micro-services to manage these interactions, so that different components can be run independently and asynchronously. This approach makes for more efficient and scalable solutions. It also means that Cogment can handle many actors in the same system, which makes it a great solution for implementing ",(0,a.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/Multi-agent_system"},"Multi-Agent Systems (MAS)")," and Multi-Agent Reinforcement Learning (MARL)."),(0,a.kt)("p",null,"Cogment treats human users and computer-based agents as the same from a high level point of view, rendering them interchangeable. This makes Cogment well-adapted to any kind of Human-In-the-Loop Learning (HILL) process, like Imitation Learning (IL) / Behavior Cloning (BC), RL from human feedback (RLHF) or even Active Learning. This allows computer-based agents to make use of human feedback and ultimately speed up the process of learning."),(0,a.kt)("p",null,"See our ",(0,a.kt)("a",{parentName:"p",href:"https://arxiv.org/abs/2106.11345"},"white paper")," for more details."),(0,a.kt)("h2",{id:"how-does-cogment-work"},"How does Cogment work?"),(0,a.kt)("p",null,"Cogment works by separating the different components of sequential decision-making tasks into different computational streams, and coordinating the results of these computations only when necessary. That is, different parts of the task are run as distributed microservices, and information is passed between services via gRPC protocol. This is made possible by a set of Cogment Core Components that can be used through a ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/cli/"},"Command Line Interface (CLI)"),". These components are packaged in an easily distributable, cross-platform, standalone executable."),(0,a.kt)("p",null,"The full suite of Cogment tooling also includes software development kits (SDKs) for ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/python"},"Python")," and ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/javascript"},"Javascript"),". These SDKs interface with the\nCore Components in order to more easily work with Cogment to build out the specifics of your application, such as the simulated ",(0,a.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#environment"},"Environment")," you want to work in, the ",(0,a.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#actors"},"Actors")," involved, and the details of how you want them to interact in a ",(0,a.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#trials"},"Trial"),"."),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"Cogment components",src:n(6763).Z,width:"2366",height:"1254"})),(0,a.kt)("h3",{id:"what-are-the-core-components-of-cogment"},"What are the Core Components of Cogment?"),(0,a.kt)("p",null,"The Core services, run through the Cogment CLI are:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"The ",(0,a.kt)("a",{parentName:"li",href:"/docs/reference/cli/orchestrator"},(0,a.kt)("strong",{parentName:"a"},"Orchestrator"))," is the ",(0,a.kt)("strong",{parentName:"li"},"heart")," of a Cogment app, which manages the operations and interactions of different components,"),(0,a.kt)("li",{parentName:"ul"},"The ",(0,a.kt)("a",{parentName:"li",href:"/docs/reference/cli/trial-datastore/trial-datastore-server"},(0,a.kt)("strong",{parentName:"a"},"Trial Datastore")),", which stores and makes available data generated while running Cogment,"),(0,a.kt)("li",{parentName:"ul"},"The ",(0,a.kt)("a",{parentName:"li",href:"/docs/reference/cli/model-registry"},(0,a.kt)("strong",{parentName:"a"},"Model Registry")),", which stores different versions of trained AI models to be used by Cogment agents."),(0,a.kt)("li",{parentName:"ul"},"The ",(0,a.kt)("a",{parentName:"li",href:"/docs/reference/cli/directory/directory-server"},(0,a.kt)("strong",{parentName:"a"},"Directory")),", where Cogment services are registered and can be easily found by clients and other services.")),(0,a.kt)("p",null,"The different Cogment components and how they interact can be summarized in the following diagram:"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"summary of Cogment Components",src:n(25).Z,width:"2438",height:"1214"})),(0,a.kt)("p",null,"(The Directory is missing from this diagram, as it mainly works to facilitate the process of connecting all of the different services to each other.)"),(0,a.kt)("h3",{id:"what-components-are-implemented-with-sdks"},"What components are implemented with SDKs?"),(0,a.kt)("p",null,"Software development kits (",(0,a.kt)("strong",{parentName:"p"},"SDKs"),") are available in both ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/python"},"Python")," and\n",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/javascript"},"Javascript"),"."),(0,a.kt)("p",null,"These can be used to build Cogment application services like Actors and simulated Environments, or client components such as an interface for a human user to interact with the application. Additionally, the SDKs are used to specify how Cogment trials (eg. interactions between Actors and their Environment) should be configured and run with the Trial Runner."),(0,a.kt)("p",null,"For more details, please see the dedicated reference page for the SDK in your preferred programming language. Stay tuned for development of new SDKs!"),(0,a.kt)("p",null,"If you would like to get a more hands-on introduction to the details of how Cogment works, you can follow our ",(0,a.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/"},"tutorial"),"."),(0,a.kt)("h2",{id:"what-is-cogment-used-for"},"What is Cogment used for?"),(0,a.kt)("p",null,"Cogment is especially well suited to address multi-agent contexts, regardless of their learning mechanisms (or, for that matter, whether they are of the learning kind or not)."),(0,a.kt)("p",null,"Cogment may be a suitable approach if you want to:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Easily bootstrap a given system using human users, heuristic agents, or both, then transitioning seamlessly to an ML implementation"),(0,a.kt)("li",{parentName:"ul"},"Utilize multiple ML approaches to contribute to a single role, which require balancing their contributions by some criteria (such as some rule set or performance metrics, for example)"),(0,a.kt)("li",{parentName:"ul"},"Comparing different agent types/implementations without requiring any change in the implementation of the environment")),(0,a.kt)("h2",{id:"getting-started-with-cogment"},"Getting Started with Cogment"),(0,a.kt)("p",null,"Before diving right in, we recommend taking the time to read the ",(0,a.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts"},"core concepts")," section which details the terminology we use for several critical concepts of Cogment. You can then proceed to read on how to ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/cli/"},"install")," the platform."),(0,a.kt)("p",null,"To get your hands dirty, proceed to the ",(0,a.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/"},"tutorial")," for an introduction to all things Cogment. While Cogment can do many things, this tutorial aims to be a first introduction to the general principles of Cogment. The tutorial builds an application using the Python SDK to interface with Cogment. For more information about the range of features Cogment can offer, see the ",(0,a.kt)("a",{parentName:"p",href:"/docs/guide/development-guide"},"Development Guide")," or ",(0,a.kt)("a",{parentName:"p",href:"/docs/community-channels"},"get connected with us"),"."),(0,a.kt)("h2",{id:"citations"},"Citations"),(0,a.kt)("p",null,"If you use ",(0,a.kt)("strong",{parentName:"p"},"Cogment")," in your research, please cite our ",(0,a.kt)("a",{parentName:"p",href:"https://arxiv.org/abs/2106.11345"},"white paper")," as follows:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bibtex"},"@misc{air2021cogment,\n title={Cogment: Open Source Framework For Distributed Multi-actor Training, Deployment & Operations},\n author={AI Redefined and Sai Krishna Gottipati and Sagar Kurandwad and Clod\xe9ric Mars and Gregory Szriftgiser and\n Fran\xe7ois Chabot},\n year={2021},\n eprint={2106.11345},\n archivePrefix={arXiv},\n primaryClass={cs.AI}\n}\n")))}p.isMDXComponent=!0},6763:(e,t,n)=>{n.d(t,{Z:()=>o});const o=n.p+"assets/images/cogment_components_SDK-0ee632e26db177c18ff1963a144ec93d.png"},25:(e,t,n)=>{n.d(t,{Z:()=>o});const o=n.p+"assets/images/what-is-cogment-aa58359c5eda0b74440675b36d6ed8f1.png"}}]); \ No newline at end of file diff --git a/assets/js/c377a04b.f8bc1c7c.js b/assets/js/c377a04b.f8bc1c7c.js new file mode 100644 index 0000000..94306b1 --- /dev/null +++ b/assets/js/c377a04b.f8bc1c7c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[6971],{3905:(e,t,n)=>{n.d(t,{Zo:()=>m,kt:()=>u});var o=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,o,a=function(e,t){if(null==e)return{};var n,o,a={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=o.createContext({}),c=function(e){var t=o.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},m=function(e){var t=c(e.components);return o.createElement(l.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},h=o.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,l=e.parentName,m=s(e,["components","mdxType","originalType","parentName"]),p=c(n),h=a,u=p["".concat(l,".").concat(h)]||p[h]||d[h]||r;return n?o.createElement(u,i(i({ref:t},m),{},{components:n})):o.createElement(u,i({ref:t},m))}));function u(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,i=new Array(r);i[0]=h;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[p]="string"==typeof e?e:a,i[1]=s;for(var c=2;c<r;c++)i[c]=n[c];return o.createElement.apply(null,i)}return o.createElement.apply(null,n)}h.displayName="MDXCreateElement"},1269:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>i,default:()=>d,frontMatter:()=>r,metadata:()=>s,toc:()=>c});var o=n(7462),a=(n(7294),n(3905));const r={title:"Overview",description:"An introduction to Cogment",sidebar_position:1},i="What is Cogment?",s={unversionedId:"index",id:"index",title:"Overview",description:"An introduction to Cogment",source:"@site/docs/index.md",sourceDirName:".",slug:"/",permalink:"/docs/",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:1,frontMatter:{title:"Overview",description:"An introduction to Cogment",sidebar_position:1},sidebar:"docSidebar",next:{title:"Community",permalink:"/docs/community-channels"}},l={},c=[{value:"How does Cogment work?",id:"how-does-cogment-work",level:2},{value:"What are the Core Components of Cogment?",id:"what-are-the-core-components-of-cogment",level:3},{value:"What components are implemented with SDKs?",id:"what-components-are-implemented-with-sdks",level:3},{value:"What is Cogment used for?",id:"what-is-cogment-used-for",level:2},{value:"Getting Started with Cogment",id:"getting-started-with-cogment",level:2},{value:"Citations",id:"citations",level:2}],m={toc:c},p="wrapper";function d(e){let{components:t,...r}=e;return(0,a.kt)(p,(0,o.Z)({},m,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"what-is-cogment"},"What is Cogment?"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://cogment.ai"},"Cogment")," is the first open source platform designed to address the challenges of continuously training humans and AI together. Cogment is developed by ",(0,a.kt)("a",{parentName:"p",href:"https://ai-r.com"},"AI Redefined")," to enable AI practitioners to build, train and operate AI agents in simulated or real environments shared with humans. Fundamentally, Cogment is a set of tools designed to make it easier and more scalable to coordinate how Agents share information with each other and the Environment in which they operate."),(0,a.kt)("p",null,"Cogment is designed around the idea of sequential interactions between Actors and their Environment, as in ",(0,a.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/Reinforcement_learning"},"Reinforcement Learning (RL)"),". Cogment uses distributed micro-services to manage these interactions, so that different components can be run independently and asynchronously. This approach makes for more efficient and scalable solutions. It also means that Cogment can handle many actors in the same system, which makes it a great solution for implementing ",(0,a.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/Multi-agent_system"},"Multi-Agent Systems (MAS)")," and Multi-Agent Reinforcement Learning (MARL)."),(0,a.kt)("p",null,"Cogment treats human users and computer-based agents as the same from a high level point of view, rendering them interchangeable. This makes Cogment well-adapted to any kind of Human-In-the-Loop Learning (HILL) process, like Imitation Learning (IL) / Behavior Cloning (BC), RL from human feedback (RLHF) or even Active Learning. This allows computer-based agents to make use of human feedback and ultimately speed up the process of learning."),(0,a.kt)("p",null,"See our ",(0,a.kt)("a",{parentName:"p",href:"https://arxiv.org/abs/2106.11345"},"white paper")," for more details."),(0,a.kt)("h2",{id:"how-does-cogment-work"},"How does Cogment work?"),(0,a.kt)("p",null,"Cogment works by separating the different components of sequential decision-making tasks into different computational streams, and coordinating the results of these computations only when necessary. That is, different parts of the task are run as distributed microservices, and information is passed between services via gRPC protocol. This is made possible by a set of Cogment Core Components that can be used through a ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/cli/"},"Command Line Interface (CLI)"),". These components are packaged in an easily distributable, cross-platform, standalone executable."),(0,a.kt)("p",null,"The full suite of Cogment tooling also includes software development kits (SDKs) for ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/python"},"Python")," and ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/javascript"},"Javascript"),". These SDKs interface with the\nCore Components in order to more easily work with Cogment to build out the specifics of your application, such as the simulated ",(0,a.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#environment"},"Environment")," you want to work in, the ",(0,a.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#actors"},"Actors")," involved, and the details of how you want them to interact in a ",(0,a.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#trials"},"Trial"),"."),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"Cogment components",src:n(6763).Z,width:"2366",height:"1254"})),(0,a.kt)("h3",{id:"what-are-the-core-components-of-cogment"},"What are the Core Components of Cogment?"),(0,a.kt)("p",null,"The Core services, run through the Cogment CLI are:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"The ",(0,a.kt)("a",{parentName:"li",href:"/docs/reference/cli/orchestrator"},(0,a.kt)("strong",{parentName:"a"},"Orchestrator"))," is the ",(0,a.kt)("strong",{parentName:"li"},"heart")," of a Cogment app, which manages the operations and interactions of different components,"),(0,a.kt)("li",{parentName:"ul"},"The ",(0,a.kt)("a",{parentName:"li",href:"/docs/reference/cli/trial-datastore/trial-datastore-server"},(0,a.kt)("strong",{parentName:"a"},"Trial Datastore")),", which stores and makes available data generated while running Cogment,"),(0,a.kt)("li",{parentName:"ul"},"The ",(0,a.kt)("a",{parentName:"li",href:"/docs/reference/cli/model-registry"},(0,a.kt)("strong",{parentName:"a"},"Model Registry")),", which stores different versions of trained AI models to be used by Cogment agents."),(0,a.kt)("li",{parentName:"ul"},"The ",(0,a.kt)("a",{parentName:"li",href:"/docs/reference/cli/directory/directory-server"},(0,a.kt)("strong",{parentName:"a"},"Directory")),", where Cogment services are registered and can be easily found by clients and other services.")),(0,a.kt)("p",null,"The different Cogment components and how they interact can be summarized in the following diagram:"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"summary of Cogment Components",src:n(25).Z,width:"2438",height:"1214"})),(0,a.kt)("p",null,"(The Directory is missing from this diagram, as it mainly works to facilitate the process of connecting all of the different services to each other.)"),(0,a.kt)("h3",{id:"what-components-are-implemented-with-sdks"},"What components are implemented with SDKs?"),(0,a.kt)("p",null,"Software development kits (",(0,a.kt)("strong",{parentName:"p"},"SDKs"),") are available in both ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/python"},"Python")," and\n",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/javascript"},"Javascript"),"."),(0,a.kt)("p",null,"These can be used to build Cogment application services like Actors and simulated Environments, or client components such as an interface for a human user to interact with the application. Additionally, the SDKs are used to specify how Cogment trials (eg. interactions between Actors and their Environment) should be configured and run with the Trial Runner."),(0,a.kt)("p",null,"For more details, please see the dedicated reference page for the SDK in your preferred programming language. Stay tuned for development of new SDKs!"),(0,a.kt)("p",null,"If you would like to get a more hands-on introduction to the details of how Cogment works, you can follow our ",(0,a.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/"},"tutorial"),"."),(0,a.kt)("h2",{id:"what-is-cogment-used-for"},"What is Cogment used for?"),(0,a.kt)("p",null,"Cogment is especially well suited to address multi-agent contexts, regardless of their learning mechanisms (or, for that matter, whether they are of the learning kind or not)."),(0,a.kt)("p",null,"Cogment may be a suitable approach if you want to:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Easily bootstrap a given system using human users, heuristic agents, or both, then transitioning seamlessly to an ML implementation"),(0,a.kt)("li",{parentName:"ul"},"Utilize multiple ML approaches to contribute to a single role, which require balancing their contributions by some criteria (such as some rule set or performance metrics, for example)"),(0,a.kt)("li",{parentName:"ul"},"Comparing different agent types/implementations without requiring any change in the implementation of the environment")),(0,a.kt)("h2",{id:"getting-started-with-cogment"},"Getting Started with Cogment"),(0,a.kt)("p",null,"Before diving right in, we recommend taking the time to read the ",(0,a.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts"},"core concepts")," section which details the terminology we use for several critical concepts of Cogment. You can then proceed to read on how to ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/cli/"},"install")," the platform."),(0,a.kt)("p",null,"To get your hands dirty, proceed to the ",(0,a.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/"},"tutorial")," for an introduction to all things Cogment. While Cogment can do many things, this tutorial aims to be a first introduction to the general principles of Cogment. The tutorial builds an application using the Python SDK to interface with Cogment. For more information about the range of features Cogment can offer, see the ",(0,a.kt)("a",{parentName:"p",href:"/docs/guide/development-guide"},"Development Guide")," or ",(0,a.kt)("a",{parentName:"p",href:"/docs/community-channels"},"get connected with us"),"."),(0,a.kt)("h2",{id:"citations"},"Citations"),(0,a.kt)("p",null,"If you use ",(0,a.kt)("strong",{parentName:"p"},"Cogment")," in your research, please cite our ",(0,a.kt)("a",{parentName:"p",href:"https://arxiv.org/abs/2106.11345"},"white paper")," as follows:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bibtex"},"@misc{air2021cogment,\n title={Cogment: Open Source Framework For Distributed Multi-actor Training, Deployment & Operations},\n author={AI Redefined and Sai Krishna Gottipati and Sagar Kurandwad and Clod\xe9ric Mars and Gregory Szriftgiser and\n Fran\xe7ois Chabot},\n year={2021},\n eprint={2106.11345},\n archivePrefix={arXiv},\n primaryClass={cs.AI}\n}\n")))}d.isMDXComponent=!0},6763:(e,t,n)=>{n.d(t,{Z:()=>o});const o=n.p+"assets/images/cogment_components_SDK-0ee632e26db177c18ff1963a144ec93d.png"},25:(e,t,n)=>{n.d(t,{Z:()=>o});const o=n.p+"assets/images/what-is-cogment-aa58359c5eda0b74440675b36d6ed8f1.png"}}]); \ No newline at end of file diff --git a/assets/js/c3c15305.0d717cd1.js b/assets/js/c3c15305.0d717cd1.js deleted file mode 100644 index 7a05929..0000000 --- a/assets/js/c3c15305.0d717cd1.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[1043],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>d});var a=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},r=Object.keys(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=a.createContext({}),c=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=c(e.components);return a.createElement(s.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},u=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,r=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=c(n),d=o,h=u["".concat(s,".").concat(d)]||u[d]||m[d]||r;return n?a.createElement(h,i(i({ref:t},p),{},{components:n})):a.createElement(h,i({ref:t},p))}));function d(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=n.length,i=new Array(r);i[0]=u;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l.mdxType="string"==typeof e?e:o,i[1]=l;for(var c=2;c<r;c++)i[c]=n[c];return a.createElement.apply(null,i)}return a.createElement.apply(null,n)}u.displayName="MDXCreateElement"},3706:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>m,frontMatter:()=>r,metadata:()=>l,toc:()=>c});var a=n(7462),o=(n(7294),n(3905));const r={title:"CLI",sidebar_position:1},i="Command Line Interface (CLI) executable",l={unversionedId:"reference/cli/index",id:"reference/cli/index",title:"CLI",description:"Repository Latest Release",source:"@site/docs/reference/cli/index.md",sourceDirName:"reference/cli",slug:"/reference/cli/",permalink:"/docs/reference/cli/",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:1,frontMatter:{title:"CLI",sidebar_position:1},sidebar:"docSidebar",previous:{title:"Trial Parameters",permalink:"/docs/reference/parameters"},next:{title:"Orchestrator",permalink:"/docs/reference/cli/orchestrator"}},s={},c=[{value:"Compatibility",id:"compatibility",level:2},{value:"Installation",id:"installation",level:2},{value:"Installation script (compatible with linux and macOS)",id:"installation-script-compatible-with-linux-and-macos",level:3},{value:"Manual installation",id:"manual-installation",level:3},{value:"Docker",id:"docker",level:3},{value:"Unsupported platform",id:"unsupported-platform",level:3},{value:"Building from source",id:"building-from-source",level:3},{value:"Test your installation",id:"test-your-installation",level:2},{value:"Launching a Cogment app",id:"launching-a-cogment-app",level:3},{value:"Troubleshooting",id:"troubleshooting",level:2},{value:"<code>pipe creation failed (24): Too many open files</code> error on macOS",id:"pipe-creation-failed-24-too-many-open-files-error-on-macos",level:3}],p={toc:c};function m(e){let{components:t,...n}=e;return(0,o.kt)("wrapper",(0,a.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"command-line-interface-cli-executable"},"Command Line Interface (CLI) executable"),(0,o.kt)("p",null,(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment"},(0,o.kt)("img",{parentName:"a",src:"https://img.shields.io/badge/repository-cogment%2Fcogment-%235217b8?style=for-the-badge&logo=github",alt:"Repository"}))," ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment/releases"},(0,o.kt)("img",{parentName:"a",src:"https://img.shields.io/github/v/release/cogment/cogment?label=latest%20release&sort=semver&style=for-the-badge",alt:"Latest Release"})),"\n",(0,o.kt)("a",{parentName:"p",href:"https://hub.docker.com/r/cogment/cogment"},(0,o.kt)("img",{parentName:"a",src:"https://img.shields.io/docker/v/cogment/cogment?label=latest%20docker%20release&sort=semver&style=for-the-badge",alt:"Latest Docker Release"}))),(0,o.kt)("p",null,"The main Cogment module is a multi-platform standalone executable usable through a Command Line Interface, it is referred as the ",(0,o.kt)("strong",{parentName:"p"},"Cogment CLI"),"."),(0,o.kt)("p",null,"The Cogment CLI includes the following services:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("a",{parentName:"li",href:"/docs/reference/cli/orchestrator"},"Orchestrator"),", the heart of Cogment which executes the ",(0,o.kt)("a",{parentName:"li",href:"/docs/guide/core-concepts#trials"},"Trials")," by orchestrating the different user implemented services."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("a",{parentName:"li",href:"/docs/reference/cli/directory/directory-server"},"Directory"),' is the "directory" of services, where services register and can be found by clients and other services.'),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("a",{parentName:"li",href:"/docs/reference/cli/trial-datastore/trial-datastore-server"},"Trial Datastore")," able to store and make available the data generated by the Trials."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("a",{parentName:"li",href:"/docs/reference/cli/model-registry"},"Model Registry")," which let's user store AI models and makes them available to actor implementations during training and in production.")),(0,o.kt)("h2",{id:"compatibility"},"Compatibility"),(0,o.kt)("p",null,"The Cogment CLI is available for the following OSes:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},"Linux")," with ",(0,o.kt)("inlineCode",{parentName:"li"},"amd64")," architecture (also known as ",(0,o.kt)("inlineCode",{parentName:"li"},"x86_64"),"), tested on Ubuntu 18.04 and 20.04, should be compatible with most recent distributions,"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},"macOS")," with ",(0,o.kt)("inlineCode",{parentName:"li"},"amd64")," and ",(0,o.kt)("inlineCode",{parentName:"li"},"arm64")," (Apple Silicon) architectures, tested on macOS 12, should be compatible with any macOS version >= 10.15,"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},"Windows")," with ",(0,o.kt)("inlineCode",{parentName:"li"},"amd64")," architecture, should be compatible with any Windows version >= Windows 10 version 1809.")),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"Starting with ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment/releases/tag/v2.2.0"},"v2.2.0"),", the Cogment CLI is available for Linux, macOS and Windows on ",(0,o.kt)("inlineCode",{parentName:"p"},"x86_64"),"."),(0,o.kt)("p",{parentName:"admonition"},"Starting with ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment/releases/tag/v2.6.0"},"v2.6.0"),", the macOS ",(0,o.kt)("inlineCode",{parentName:"p"},"arm64")," version is also available.")),(0,o.kt)("h2",{id:"installation"},"Installation"),(0,o.kt)("h3",{id:"installation-script-compatible-with-linux-and-macos"},"Installation script (compatible with linux and macOS)"),(0,o.kt)("p",null,"This installation method is compatible with virtually any Linux distribution, macOS and WSL2 on Windows. It only requires ",(0,o.kt)("inlineCode",{parentName:"p"},"bash")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"curl"),"."),(0,o.kt)("p",null,"First, download the install script and make sure you can run it using"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"curl --silent -L https://raw.githubusercontent.com/cogment/cogment/main/install.sh --output install-cogment.sh\nchmod +x install-cogment.sh\n")),(0,o.kt)("p",null,"You can then download and install the latest version to ",(0,o.kt)("inlineCode",{parentName:"p"},"/usr/local/bin")," using"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"sudo ./install-cogment.sh\n")),(0,o.kt)("p",null,"Other installation methods are available, for example:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"Install version 2.2.0",(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-console"},"sudo ./install-cogment.sh --version 2.2.0\n"))),(0,o.kt)("li",{parentName:"ul"},"Install prereleased version 2.3.1-beta3, useful because prereleases are not considered by default",(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-console"},"sudo ./install-cogment.sh --version 2.2.0\n"))),(0,o.kt)("li",{parentName:"ul"},"Download the cogment exec in the current folder, make sure it is executable but skip the installation",(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-console"},"./install-cogment.sh --skip-install\n"))),(0,o.kt)("li",{parentName:"ul"},"Specify manually the arch and os",(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-console"},"./install-cogment.sh --arch amd64 --os Windows\n")))),(0,o.kt)("p",null,"All install options can be listed using"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"./install-cogment.sh --help\n")),(0,o.kt)("p",null,"Uninstall is as simple as running:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"sudo rm $(which cogment)\n")),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"Yes, it is possible to install Cogment as a one-line by piping the install script to ",(0,o.kt)("inlineCode",{parentName:"p"},"bash")," ... at the risk of angering your system admin."),(0,o.kt)("pre",{parentName:"admonition"},(0,o.kt)("code",{parentName:"pre",className:"language-console"},"curl --silent -L https://raw.githubusercontent.com/cogment/cogment/main/install.sh | sudo ./install-cogment.sh\n"))),(0,o.kt)("h3",{id:"manual-installation"},"Manual installation"),(0,o.kt)("p",null,"If you are a Windows user (and also if you prefer to do a manual install), you can go through those instructions."),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},"Download the desired version from ",(0,o.kt)("a",{parentName:"li",href:"https://github.com/cogment/cogment/releases/"},"here")," for your platform."),(0,o.kt)("li",{parentName:"ol"},"Copy it as ",(0,o.kt)("inlineCode",{parentName:"li"},"cogment")," in a location that already belongs to your ",(0,o.kt)("inlineCode",{parentName:"li"},"PATH")," (e.g. ",(0,o.kt)("inlineCode",{parentName:"li"},"/usr/local/bin"),") or that you'll ",(0,o.kt)("a",{parentName:"li",href:"https://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them"},"add to your ",(0,o.kt)("inlineCode",{parentName:"a"},"PATH")),", and make sure it is executable (e.g. using ",(0,o.kt)("inlineCode",{parentName:"li"},"chmod +x /usr/local/bin/cogment"),").")),(0,o.kt)("h3",{id:"docker"},"Docker"),(0,o.kt)("p",null,"A Cogment docker image is available on ",(0,o.kt)("a",{parentName:"p",href:"https://hub.docker.com/r/cogment/cogment"},"Docker Hub"),". It can be retrieved with the following:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"docker pull cogment/cogment\n")),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"The docker version of Cogment is very handy for server deployment, however, because of the nature of docker, users need to take care of port forwarding and volume mounting if needed.")),(0,o.kt)("h3",{id:"unsupported-platform"},"Unsupported platform"),(0,o.kt)("p",null,"If your platform is not supported, add an ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment/issues"},"issue")," including the details of your platform and do not hesitate to ",(0,o.kt)("a",{parentName:"p",href:"/docs/community-channels"},"contact us"),"."),(0,o.kt)("h3",{id:"building-from-source"},"Building from source"),(0,o.kt)("p",null,"Building from sources is perfectly possible. Please refer to the ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment#developers"},"build instructions")," for more information."),(0,o.kt)("h2",{id:"test-your-installation"},"Test your installation"),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"Depending on your platform and how you installed Cogment, it might be accessible as ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"./cogment"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.exe")," or ",(0,o.kt)("inlineCode",{parentName:"p"},"docker run cogment/cogment"),". We will use ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment")," for the rest of this page and throughout the documentation.")),(0,o.kt)("p",null,"With a working installation you can run the following in a terminal:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"cogment version\n")),(0,o.kt)("p",null,"You can then list all the commands by typing:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"cogment help\n")),(0,o.kt)("p",null,"or for help on each individual command:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"cogment help <command>\n")),(0,o.kt)("h3",{id:"launching-a-cogment-app"},"Launching a Cogment app"),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"These instructions are only compatible with unix-like environments such as Linux, macOS and WSL2 on Windows.")),(0,o.kt)("p",null,"In order to test that your installation is fully working, run an existing Cogment app, for example one of the steps of the tutorial."),(0,o.kt)("p",null,"Download or clone the sources for the official Rock-Paper-Scissors (",(0,o.kt)("em",{parentName:"p"},"RPS"),") tutorial from ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-tutorial-rps"},"https://github.com/cogment/cogment-tutorial-rps"),"."),(0,o.kt)("p",null,"To run this example you will need to have the following installed on top of Cogment:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://www.python.org/"},"python")," 3.7 or later,"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://virtualenv.pypa.io/en/latest/"},"virtualenv"),".")),(0,o.kt)("p",null,"Once it is done, run the following in the directory you retrieved:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"cd 5-human-player\n./run.sh build\n./run.sh services_start\n")),(0,o.kt)("p",null,"The first call to ",(0,o.kt)("inlineCode",{parentName:"p"},"./run.sh")," command will copy the cogment.yaml, and every referenced proto file, to each module directory, create virtualenvs, and install the python dependencies."),(0,o.kt)("p",null,"The second will start Cogment and the different services for this app. In another terminal you can connect to it and play a few games of ",(0,o.kt)("em",{parentName:"p"},"RPS")," against a simple AI agent."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"./run.sh client_start\n")),(0,o.kt)("p",null,"Congratulations, you have a working installation of Cogment! We recommend you head to the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/"},"Cogment tutorial")," to learn how to implement this ",(0,o.kt)("em",{parentName:"p"},"RPS")," app from scratch."),(0,o.kt)("h2",{id:"troubleshooting"},"Troubleshooting"),(0,o.kt)("h3",{id:"pipe-creation-failed-24-too-many-open-files-error-on-macos"},(0,o.kt)("inlineCode",{parentName:"h3"},"pipe creation failed (24): Too many open files")," error on macOS"),(0,o.kt)("p",null,"On macOS, it is possible that Cogment tries to open too many file handles. In this case, you'll get an error similar to ",(0,o.kt)("inlineCode",{parentName:"p"},"pipe creation failed (24): Too many open files"),"."),(0,o.kt)("p",null,"You can access the current limit and update it using ",(0,o.kt)("inlineCode",{parentName:"p"},"ulimit -n"),". The default version should be something like 256, in most cases we found that Cogment requires 2048. You can set the limit with the following command:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"$ ulimit -n 2048\n")),(0,o.kt)("p",null,"This command changes the limit in the current shell session. This ",(0,o.kt)("a",{parentName:"p",href:"https://unix.stackexchange.com/q/176671"},"stackexchange question")," discusses different ways to make the change persist."),(0,o.kt)("p",null,"For debugging purposes, you can inspect the open file handles using ",(0,o.kt)("inlineCode",{parentName:"p"},"lsof"),". E.g. ",(0,o.kt)("inlineCode",{parentName:"p"},"lsof -c cogment | wc -l")," will count the number of open file handles by Cogment processes."))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/c3c15305.d1d9e182.js b/assets/js/c3c15305.d1d9e182.js new file mode 100644 index 0000000..24e4c2d --- /dev/null +++ b/assets/js/c3c15305.d1d9e182.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[1043],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>h});var a=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},r=Object.keys(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=a.createContext({}),c=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=c(e.components);return a.createElement(s.Provider,{value:t},e.children)},m="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,r=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),m=c(n),d=o,h=m["".concat(s,".").concat(d)]||m[d]||u[d]||r;return n?a.createElement(h,i(i({ref:t},p),{},{components:n})):a.createElement(h,i({ref:t},p))}));function h(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=n.length,i=new Array(r);i[0]=d;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[m]="string"==typeof e?e:o,i[1]=l;for(var c=2;c<r;c++)i[c]=n[c];return a.createElement.apply(null,i)}return a.createElement.apply(null,n)}d.displayName="MDXCreateElement"},3706:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>u,frontMatter:()=>r,metadata:()=>l,toc:()=>c});var a=n(7462),o=(n(7294),n(3905));const r={title:"CLI",sidebar_position:1},i="Command Line Interface (CLI) executable",l={unversionedId:"reference/cli/index",id:"reference/cli/index",title:"CLI",description:"Repository Latest Release",source:"@site/docs/reference/cli/index.md",sourceDirName:"reference/cli",slug:"/reference/cli/",permalink:"/docs/reference/cli/",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:1,frontMatter:{title:"CLI",sidebar_position:1},sidebar:"docSidebar",previous:{title:"Trial Parameters",permalink:"/docs/reference/parameters"},next:{title:"Orchestrator",permalink:"/docs/reference/cli/orchestrator"}},s={},c=[{value:"Compatibility",id:"compatibility",level:2},{value:"Installation",id:"installation",level:2},{value:"Installation script (compatible with linux and macOS)",id:"installation-script-compatible-with-linux-and-macos",level:3},{value:"Manual installation",id:"manual-installation",level:3},{value:"Docker",id:"docker",level:3},{value:"Unsupported platform",id:"unsupported-platform",level:3},{value:"Building from source",id:"building-from-source",level:3},{value:"Test your installation",id:"test-your-installation",level:2},{value:"Launching a Cogment app",id:"launching-a-cogment-app",level:3},{value:"Troubleshooting",id:"troubleshooting",level:2},{value:"<code>pipe creation failed (24): Too many open files</code> error on macOS",id:"pipe-creation-failed-24-too-many-open-files-error-on-macos",level:3}],p={toc:c},m="wrapper";function u(e){let{components:t,...n}=e;return(0,o.kt)(m,(0,a.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"command-line-interface-cli-executable"},"Command Line Interface (CLI) executable"),(0,o.kt)("p",null,(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment"},(0,o.kt)("img",{parentName:"a",src:"https://img.shields.io/badge/repository-cogment%2Fcogment-%235217b8?style=for-the-badge&logo=github",alt:"Repository"}))," ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment/releases"},(0,o.kt)("img",{parentName:"a",src:"https://img.shields.io/github/v/release/cogment/cogment?label=latest%20release&sort=semver&style=for-the-badge",alt:"Latest Release"})),"\n",(0,o.kt)("a",{parentName:"p",href:"https://hub.docker.com/r/cogment/cogment"},(0,o.kt)("img",{parentName:"a",src:"https://img.shields.io/docker/v/cogment/cogment?label=latest%20docker%20release&sort=semver&style=for-the-badge",alt:"Latest Docker Release"}))),(0,o.kt)("p",null,"The main Cogment module is a multi-platform standalone executable usable through a Command Line Interface, it is referred as the ",(0,o.kt)("strong",{parentName:"p"},"Cogment CLI"),"."),(0,o.kt)("p",null,"The Cogment CLI includes the following services:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("a",{parentName:"li",href:"/docs/reference/cli/orchestrator"},"Orchestrator"),", the heart of Cogment which executes the ",(0,o.kt)("a",{parentName:"li",href:"/docs/guide/core-concepts#trials"},"Trials")," by orchestrating the different user implemented services."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("a",{parentName:"li",href:"/docs/reference/cli/directory/directory-server"},"Directory"),' is the "directory" of services, where services register and can be found by clients and other services.'),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("a",{parentName:"li",href:"/docs/reference/cli/trial-datastore/trial-datastore-server"},"Trial Datastore")," able to store and make available the data generated by the Trials."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("a",{parentName:"li",href:"/docs/reference/cli/model-registry"},"Model Registry")," which let's user store AI models and makes them available to actor implementations during training and in production.")),(0,o.kt)("h2",{id:"compatibility"},"Compatibility"),(0,o.kt)("p",null,"The Cogment CLI is available for the following OSes:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},"Linux")," with ",(0,o.kt)("inlineCode",{parentName:"li"},"amd64")," architecture (also known as ",(0,o.kt)("inlineCode",{parentName:"li"},"x86_64"),"), tested on Ubuntu 18.04 and 20.04, should be compatible with most recent distributions,"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},"macOS")," with ",(0,o.kt)("inlineCode",{parentName:"li"},"amd64")," and ",(0,o.kt)("inlineCode",{parentName:"li"},"arm64")," (Apple Silicon) architectures, tested on macOS 12, should be compatible with any macOS version >= 10.15,"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},"Windows")," with ",(0,o.kt)("inlineCode",{parentName:"li"},"amd64")," architecture, should be compatible with any Windows version >= Windows 10 version 1809.")),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"Starting with ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment/releases/tag/v2.2.0"},"v2.2.0"),", the Cogment CLI is available for Linux, macOS and Windows on ",(0,o.kt)("inlineCode",{parentName:"p"},"x86_64"),"."),(0,o.kt)("p",{parentName:"admonition"},"Starting with ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment/releases/tag/v2.6.0"},"v2.6.0"),", the macOS ",(0,o.kt)("inlineCode",{parentName:"p"},"arm64")," version is also available.")),(0,o.kt)("h2",{id:"installation"},"Installation"),(0,o.kt)("h3",{id:"installation-script-compatible-with-linux-and-macos"},"Installation script (compatible with linux and macOS)"),(0,o.kt)("p",null,"This installation method is compatible with virtually any Linux distribution, macOS and WSL2 on Windows. It only requires ",(0,o.kt)("inlineCode",{parentName:"p"},"bash")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"curl"),"."),(0,o.kt)("p",null,"First, download the install script and make sure you can run it using"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"curl --silent -L https://raw.githubusercontent.com/cogment/cogment/main/install.sh --output install-cogment.sh\nchmod +x install-cogment.sh\n")),(0,o.kt)("p",null,"You can then download and install the latest version to ",(0,o.kt)("inlineCode",{parentName:"p"},"/usr/local/bin")," using"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"sudo ./install-cogment.sh\n")),(0,o.kt)("p",null,"Other installation methods are available, for example:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"Install version 2.2.0",(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-console"},"sudo ./install-cogment.sh --version 2.2.0\n"))),(0,o.kt)("li",{parentName:"ul"},"Install prereleased version 2.3.1-beta3, useful because prereleases are not considered by default",(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-console"},"sudo ./install-cogment.sh --version 2.2.0\n"))),(0,o.kt)("li",{parentName:"ul"},"Download the cogment exec in the current folder, make sure it is executable but skip the installation",(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-console"},"./install-cogment.sh --skip-install\n"))),(0,o.kt)("li",{parentName:"ul"},"Specify manually the arch and os",(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-console"},"./install-cogment.sh --arch amd64 --os Windows\n")))),(0,o.kt)("p",null,"All install options can be listed using"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"./install-cogment.sh --help\n")),(0,o.kt)("p",null,"Uninstall is as simple as running:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"sudo rm $(which cogment)\n")),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"Yes, it is possible to install Cogment as a one-line by piping the install script to ",(0,o.kt)("inlineCode",{parentName:"p"},"bash")," ... at the risk of angering your system admin."),(0,o.kt)("pre",{parentName:"admonition"},(0,o.kt)("code",{parentName:"pre",className:"language-console"},"curl --silent -L https://raw.githubusercontent.com/cogment/cogment/main/install.sh | sudo ./install-cogment.sh\n"))),(0,o.kt)("h3",{id:"manual-installation"},"Manual installation"),(0,o.kt)("p",null,"If you are a Windows user (and also if you prefer to do a manual install), you can go through those instructions."),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},"Download the desired version from ",(0,o.kt)("a",{parentName:"li",href:"https://github.com/cogment/cogment/releases/"},"here")," for your platform."),(0,o.kt)("li",{parentName:"ol"},"Copy it as ",(0,o.kt)("inlineCode",{parentName:"li"},"cogment")," in a location that already belongs to your ",(0,o.kt)("inlineCode",{parentName:"li"},"PATH")," (e.g. ",(0,o.kt)("inlineCode",{parentName:"li"},"/usr/local/bin"),") or that you'll ",(0,o.kt)("a",{parentName:"li",href:"https://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them"},"add to your ",(0,o.kt)("inlineCode",{parentName:"a"},"PATH")),", and make sure it is executable (e.g. using ",(0,o.kt)("inlineCode",{parentName:"li"},"chmod +x /usr/local/bin/cogment"),").")),(0,o.kt)("h3",{id:"docker"},"Docker"),(0,o.kt)("p",null,"A Cogment docker image is available on ",(0,o.kt)("a",{parentName:"p",href:"https://hub.docker.com/r/cogment/cogment"},"Docker Hub"),". It can be retrieved with the following:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"docker pull cogment/cogment\n")),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"The docker version of Cogment is very handy for server deployment, however, because of the nature of docker, users need to take care of port forwarding and volume mounting if needed.")),(0,o.kt)("h3",{id:"unsupported-platform"},"Unsupported platform"),(0,o.kt)("p",null,"If your platform is not supported, add an ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment/issues"},"issue")," including the details of your platform and do not hesitate to ",(0,o.kt)("a",{parentName:"p",href:"/docs/community-channels"},"contact us"),"."),(0,o.kt)("h3",{id:"building-from-source"},"Building from source"),(0,o.kt)("p",null,"Building from sources is perfectly possible. Please refer to the ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment#developers"},"build instructions")," for more information."),(0,o.kt)("h2",{id:"test-your-installation"},"Test your installation"),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"Depending on your platform and how you installed Cogment, it might be accessible as ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"./cogment"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.exe")," or ",(0,o.kt)("inlineCode",{parentName:"p"},"docker run cogment/cogment"),". We will use ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment")," for the rest of this page and throughout the documentation.")),(0,o.kt)("p",null,"With a working installation you can run the following in a terminal:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"cogment version\n")),(0,o.kt)("p",null,"You can then list all the commands by typing:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"cogment help\n")),(0,o.kt)("p",null,"or for help on each individual command:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"cogment help <command>\n")),(0,o.kt)("h3",{id:"launching-a-cogment-app"},"Launching a Cogment app"),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"These instructions are only compatible with unix-like environments such as Linux, macOS and WSL2 on Windows.")),(0,o.kt)("p",null,"In order to test that your installation is fully working, run an existing Cogment app, for example one of the steps of the tutorial."),(0,o.kt)("p",null,"Download or clone the sources for the official Rock-Paper-Scissors (",(0,o.kt)("em",{parentName:"p"},"RPS"),") tutorial from ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-tutorial-rps"},"https://github.com/cogment/cogment-tutorial-rps"),"."),(0,o.kt)("p",null,"To run this example you will need to have the following installed on top of Cogment:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://www.python.org/"},"python")," 3.7 or later,"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://virtualenv.pypa.io/en/latest/"},"virtualenv"),".")),(0,o.kt)("p",null,"Once it is done, run the following in the directory you retrieved:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"cd 5-human-player\n./run.sh build\n./run.sh services_start\n")),(0,o.kt)("p",null,"The first call to ",(0,o.kt)("inlineCode",{parentName:"p"},"./run.sh")," command will copy the cogment.yaml, and every referenced proto file, to each module directory, create virtualenvs, and install the python dependencies."),(0,o.kt)("p",null,"The second will start Cogment and the different services for this app. In another terminal you can connect to it and play a few games of ",(0,o.kt)("em",{parentName:"p"},"RPS")," against a simple AI agent."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"./run.sh client_start\n")),(0,o.kt)("p",null,"Congratulations, you have a working installation of Cogment! We recommend you head to the ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/"},"Cogment tutorial")," to learn how to implement this ",(0,o.kt)("em",{parentName:"p"},"RPS")," app from scratch."),(0,o.kt)("h2",{id:"troubleshooting"},"Troubleshooting"),(0,o.kt)("h3",{id:"pipe-creation-failed-24-too-many-open-files-error-on-macos"},(0,o.kt)("inlineCode",{parentName:"h3"},"pipe creation failed (24): Too many open files")," error on macOS"),(0,o.kt)("p",null,"On macOS, it is possible that Cogment tries to open too many file handles. In this case, you'll get an error similar to ",(0,o.kt)("inlineCode",{parentName:"p"},"pipe creation failed (24): Too many open files"),"."),(0,o.kt)("p",null,"You can access the current limit and update it using ",(0,o.kt)("inlineCode",{parentName:"p"},"ulimit -n"),". The default version should be something like 256, in most cases we found that Cogment requires 2048. You can set the limit with the following command:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-console"},"$ ulimit -n 2048\n")),(0,o.kt)("p",null,"This command changes the limit in the current shell session. This ",(0,o.kt)("a",{parentName:"p",href:"https://unix.stackexchange.com/q/176671"},"stackexchange question")," discusses different ways to make the change persist."),(0,o.kt)("p",null,"For debugging purposes, you can inspect the open file handles using ",(0,o.kt)("inlineCode",{parentName:"p"},"lsof"),". E.g. ",(0,o.kt)("inlineCode",{parentName:"p"},"lsof -c cogment | wc -l")," will count the number of open file handles by Cogment processes."))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/c4f5d8e4.75997564.js b/assets/js/c4f5d8e4.75997564.js deleted file mode 100644 index ebe95f5..0000000 --- a/assets/js/c4f5d8e4.75997564.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[4195],{5386:(e,t,n)=>{n.d(t,{Z:()=>o});var a,r,l=n(7294);function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},i.apply(this,arguments)}const o=e=>{let{title:t,titleId:n,...o}=e;return l.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 253.19 53.76","aria-labelledby":n},o),t?l.createElement("title",{id:n},t):null,a||(a=l.createElement("g",{className:"main"},l.createElement("path",{d:"M179.82 40c7.19 0 12.93-3.25 14.78-8.58l-7.3-1.86a7.76 7.76 0 0 1-7.13 4.06c-4.23 0-7.19-2.73-7.89-6.9h23.31a18.22 18.22 0 0 0 .12-2.61c0-9.33-6.5-15.65-16-15.65s-16.3 6.27-16.3 15.54c0 9.57 6.79 16 16.41 16Zm-.29-25.17A7.34 7.34 0 0 1 187 21.4h-14.78c.7-3.95 3.43-6.56 7.31-6.56ZM209.57 36.15V22.38a6.29 6.29 0 0 1 6.26-6.49c3.48 0 5.56 2.55 5.56 6.2V33.7l8.61-1.78v-11c0-7.13-4.47-12.35-11.2-12.35-3.59 0-6.43 1.68-8.63 5.05h-.58V9.39H201v28.54ZM237.85 30.28l8.55-1.78V15.65h6.79V9.39h-6.79l.06-9.39h-6.72l-1.69 9.39h-4.4v6.26h4.17l.03 14.63zM95.8 13.16h-.58a11.72 11.72 0 0 0-9.68-4.64c-8.24 0-14 6.15-14 15.72 0 9.16 5.79 15.24 14 15.24A11.84 11.84 0 0 0 95 35.19h.58v3.31c0 4.87-3.07 8-7.83 8a7.53 7.53 0 0 1-7.54-5.22l-8.29 1.63c1.44 6.66 7.41 10.43 16.08 10.43 9.92 0 16.18-5.45 16.18-14.61V9.39H95.8ZM88 32.47c-4.58 0-7.88-3.48-7.88-8.23s3.3-8.41 7.88-8.41 7.83 3.54 7.83 8.41-3.22 8.23-7.83 8.23ZM119.23 22.15c0-3.83 2.2-6.32 5.56-6.32s5.34 2.49 5.34 6.32v16.93h8.64V22.15c0-3.71 2.32-6.32 5.68-6.32s5.55 2.72 5.55 6.32v16.93h8.59V20.7c0-7.19-4.7-12.18-11.25-12.18a10.21 10.21 0 0 0-9.34 5.57h-.58a10.11 10.11 0 0 0-9.1-5.62 9.63 9.63 0 0 0-8.58 5.33h-.58V9.39h-8.52v29.69h8.58ZM51.43 8.47C41.51 8.47 35 14.67 35 24.24S41.51 40 51.43 40 67.9 33.86 67.9 24.24 61.29 8.47 51.43 8.47Zm0 24.23c-4.64 0-7.89-3.54-7.89-8.46s3.25-8.41 7.89-8.41 7.83 3.48 7.83 8.41S56 32.7 51.43 32.7ZM16.18 32.93c-4.35 0-7.6-3.59-7.6-8.69s3.31-8.7 7.65-8.7a7.27 7.27 0 0 1 7.08 5.51l8-1.05c-1-7-7.13-11.53-15.19-11.53C6.55 8.47 0 14.79 0 24.24S6.67 40 16.12 40c7.94 0 14.15-4.53 15.25-11.54l-8.06-1a7.29 7.29 0 0 1-7.13 5.47Z"}))),r||(r=l.createElement("g",{className:"subscript",fill:"#231f20"},l.createElement("path",{d:"M110.75 43.65h2.67l2.12 7.45h.17l2.14-7.45h2.66l-3.05 9.77h-3.66ZM146.34 53.05a4.55 4.55 0 0 1-1.72-1.86 5.91 5.91 0 0 1-.62-2.74 5.59 5.59 0 0 1 .61-2.67 4.36 4.36 0 0 1 1.71-1.8 4.88 4.88 0 0 1 2.51-.64 4.65 4.65 0 0 1 2.45.65 4.37 4.37 0 0 1 1.66 1.82 5.77 5.77 0 0 1 .6 2.67v.46a3.9 3.9 0 0 1 0 .4h-6.9a3.28 3.28 0 0 0 .42 1.21 2.19 2.19 0 0 0 1.94 1.07 2.25 2.25 0 0 0 1.25-.36 2.35 2.35 0 0 0 .84-1l2.18.61a3.86 3.86 0 0 1-.92 1.5 4.17 4.17 0 0 1-1.52 1 5.33 5.33 0 0 1-1.93.34 4.7 4.7 0 0 1-2.56-.66Zm4.66-5.46a3.13 3.13 0 0 0-.4-1.11 2.11 2.11 0 0 0-.76-.78 2 2 0 0 0-1-.27 2 2 0 0 0-1 .26 2.08 2.08 0 0 0-.74.76 3 3 0 0 0-.4 1.14ZM179 43.65h2.48V45h.19a2.39 2.39 0 0 1 .88-1.1 2.14 2.14 0 0 1 1.27-.41 3.12 3.12 0 0 1 .54 0 1.47 1.47 0 0 1 .46.17v2.56a3.68 3.68 0 0 0-.77-.26 3 3 0 0 0-.67-.09 1.61 1.61 0 0 0-1.35.7 3 3 0 0 0-.52 1.83v5H179ZM212.83 53.32a3.23 3.23 0 0 1-1.45-1.24 3.62 3.62 0 0 1-.5-1.93h2.21a1.74 1.74 0 0 0 .58 1.26 2.11 2.11 0 0 0 1.46.48 1.94 1.94 0 0 0 1.16-.32 1 1 0 0 0 .43-.89.79.79 0 0 0-.23-.63 1.34 1.34 0 0 0-.58-.3 6.18 6.18 0 0 0-1-.18h-.49a8.3 8.3 0 0 1-1.72-.39 2.5 2.5 0 0 1-1.7-2.61 3.14 3.14 0 0 1 .49-1.75 3 3 0 0 1 1.36-1.13 5 5 0 0 1 2-.39 5.14 5.14 0 0 1 2.1.41 3.28 3.28 0 0 1 1.44 1.14 2.87 2.87 0 0 1 .5 1.74h-2.29a1.28 1.28 0 0 0-.49-1 1.9 1.9 0 0 0-1.26-.38 1.83 1.83 0 0 0-1.1.31 1 1 0 0 0-.44.83.73.73 0 0 0 .26.61 1.42 1.42 0 0 0 .64.31 9.54 9.54 0 0 0 1.11.17l.29.06h.12a6.94 6.94 0 0 1 1.72.37 2.93 2.93 0 0 1 1.24.9 2.61 2.61 0 0 1 .49 1.67 3 3 0 0 1-1.92 2.93 5.61 5.61 0 0 1-2.24.4 5.25 5.25 0 0 1-2.19-.45ZM245.75 53.05a4.62 4.62 0 0 1-1.75-1.86 5.91 5.91 0 0 1-.61-2.74 5.71 5.71 0 0 1 .6-2.67 4.45 4.45 0 0 1 1.72-1.8 4.85 4.85 0 0 1 2.5-.64 4.66 4.66 0 0 1 2.46.65 4.43 4.43 0 0 1 1.66 1.82 5.89 5.89 0 0 1 .59 2.67v.46a2.24 2.24 0 0 1 0 .4H246a3.28 3.28 0 0 0 .42 1.21 2.29 2.29 0 0 0 .82.79 2.18 2.18 0 0 0 1.11.28 2.22 2.22 0 0 0 1.24-.36 2.45 2.45 0 0 0 .85-1l2.17.61a3.84 3.84 0 0 1-.91 1.5 4.21 4.21 0 0 1-1.53 1 5.32 5.32 0 0 1-1.92.34 4.76 4.76 0 0 1-2.5-.66Zm4.63-5.46a3.12 3.12 0 0 0-.39-1.11 2.19 2.19 0 0 0-.76-.78 2.07 2.07 0 0 0-1-.27 2 2 0 0 0-1 .26 2.1 2.1 0 0 0-.75.76 3.2 3.2 0 0 0-.39 1.14Z"}))))}},3057:(e,t,n)=>{n.d(t,{ZP:()=>i});var a=n(7462),r=(n(7294),n(3905));const l={toc:[]};function i(e){let{components:t,...n}=e;return(0,r.kt)("wrapper",(0,a.Z)({},l,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"Cogment Verse is a SDK helping researchers and developers in the fields of human-in-the-loop learning (HILL) and multi-agent reinforcement learning (MARL) train and validate their agents at scale. Cogment Verse instantiates the open-source ",(0,r.kt)("a",{parentName:"p",href:"/"},"Cogment")," platform for environments following the OpenAI Gym mold, making it easy to get started."),(0,r.kt)("p",null,"Simply clone the ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-verse"},"repo")," and start training."))}i.isMDXComponent=!0},2058:(e,t,n)=>{n.d(t,{_:()=>o});var a=n(7462),r=n(7294),l=n(6010);const i="cta_i4Jo";function o(e){let{children:t,className:n,...o}=e;return r.createElement("div",(0,a.Z)({className:(0,l.Z)(n,i)},o),t)}},4388:(e,t,n)=>{n.d(t,{V:()=>o});var a=n(7462),r=n(7294),l=n(6010);const i="hero_uw3b";function o(e){let{children:t,className:n,...o}=e;return r.createElement("div",(0,a.Z)({className:(0,l.Z)(n,"hero",i)},o),t)}},5137:(e,t,n)=>{n.d(t,{W:()=>o});var a=n(7462),r=n(7294);const l="screenshots_x3pV";var i=n(6010);function o(e){let{children:t,className:n,...o}=e;return r.createElement("div",(0,a.Z)({className:(0,i.Z)(l,n)},o),t)}},936:(e,t,n)=>{n.d(t,{$:()=>o});var a=n(7462),r=n(7294),l=n(6010);const i="section_ccoD";function o(e){let{children:t,className:n,...o}=e;return r.createElement("div",(0,a.Z)({className:(0,l.Z)(n,i)},o),t)}},5673:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(7294);const r=n.p+"assets/images/atari_double_dunk-957d0719ded0c73d0d19c54205e9d89f.gif",l=n.p+"assets/images/classic_go-194543ef4e433ad1a827c74bb296b9f7.gif",i=n.p+"assets/images/atari_montezumas_revenge-1451d09162dd95c536af9e45af10d6b5.gif",o=n.p+"assets/images/lunar_lander-49afc13c99c3d30fd673b642cbbc2c9b.gif";const s=function(){return a.createElement(a.Fragment,null,a.createElement("img",{src:r,alt:"Atari Double Dunk - From Petting Zoo"}),a.createElement("img",{src:l,alt:"Go - From Petting Zoo"}),a.createElement("img",{src:i,alt:"Atari Montezuma's Revenge - From Open AI Gym"}),a.createElement("img",{src:o,alt:"Lunar Lander - From Open AI Gym"}))}},4825:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ee});var a=n(8947),r=n(1417),l=n(7814),i=n(6010),o=n(7452),s=n(9960),c=n(7294),m=n(6627),u=n(2263),d=n(7462),p=n(4996);const h="logos_W70m",g="logo_kX79";function v(e){let{imgSrc:t,title:n,href:a=null,...r}=e;return a?c.createElement("div",{className:g},c.createElement(s.Z,{href:a},c.createElement("img",{src:(0,p.Z)(t),alt:`logo for ${n}`,title:n}))):c.createElement("div",(0,d.Z)({className:g},r),c.createElement("img",{src:(0,p.Z)(t),alt:`logo for ${n}`,title:n}))}function f(e){let{children:t,...n}=e;return c.createElement("div",(0,d.Z)({className:h},n),t)}const y="benefits_d4xt",w="benefit_pXnC";function E(e){let{children:t,className:n,...a}=e;return c.createElement("div",(0,d.Z)({className:(0,i.Z)(n,y)},a),t)}function Z(e){let{children:t,className:n,...a}=e;return c.createElement("div",(0,d.Z)({className:(0,i.Z)(n,w)},a),t)}var b=n(5137),k=n(2058),N=n(4388),M=n(936),_=n(3905);const C={toc:[{value:"Orchestrate intelligence ecosystems",id:"orchestrate-intelligence-ecosystems",level:4}]};function D(e){let{components:t,...a}=e;return(0,_.kt)("wrapper",(0,d.Z)({},C,a,{components:t,mdxType:"MDXLayout"}),(0,_.kt)("h4",{id:"orchestrate-intelligence-ecosystems"},"Orchestrate intelligence ecosystems"),(0,_.kt)("p",null,(0,_.kt)("img",{alt:"Orchestrate intelligence ecosystems",src:n(6696).Z,width:"1080",height:"1080"})),(0,_.kt)("ul",null,(0,_.kt)("li",{parentName:"ul"},"Best of human & AI capabilities"),(0,_.kt)("li",{parentName:"ul"},"Human supervision when it matters"),(0,_.kt)("li",{parentName:"ul"},"Hybrid AI: Compliance & high performance"),(0,_.kt)("li",{parentName:"ul"},"Modular approach: reduce compute usage & faciliate validation")))}D.isMDXComponent=!0;const x={toc:[{value:"Continuously train AIs & humans together",id:"continuously-train-ais--humans-together",level:4}]};function I(e){let{components:t,...a}=e;return(0,_.kt)("wrapper",(0,d.Z)({},x,a,{components:t,mdxType:"MDXLayout"}),(0,_.kt)("h4",{id:"continuously-train-ais--humans-together"},"Continuously train AIs & humans together"),(0,_.kt)("p",null,(0,_.kt)("img",{alt:"Continuously train AIs & humans together",src:n(607).Z,width:"1080",height:"1080"})),(0,_.kt)("ul",null,(0,_.kt)("li",{parentName:"ul"},"Less data required"),(0,_.kt)("li",{parentName:"ul"},"Real-time adaptation"),(0,_.kt)("li",{parentName:"ul"},"Faster training"),(0,_.kt)("li",{parentName:"ul"},"Fostering of trust")))}I.isMDXComponent=!0;const L={toc:[{value:"Iterate smoothly from sim to real",id:"iterate-smoothly-from-sim-to-real",level:4}]};function X(e){let{components:t,...a}=e;return(0,_.kt)("wrapper",(0,d.Z)({},L,a,{components:t,mdxType:"MDXLayout"}),(0,_.kt)("h4",{id:"iterate-smoothly-from-sim-to-real"},"Iterate smoothly from sim to real"),(0,_.kt)("p",null,(0,_.kt)("img",{alt:"Iterate smoothly from sim to real",src:n(9170).Z,width:"1000",height:"1001"})),(0,_.kt)("ul",null,(0,_.kt)("li",{parentName:"ul"},"Safe and simple design and training in simulation"),(0,_.kt)("li",{parentName:"ul"},"Progressive deployment to real environment"),(0,_.kt)("li",{parentName:"ul"},"Real environments, digital twins, numerical simulations, etc.")))}X.isMDXComponent=!0;const A=[I,D,X],T={toc:[{value:"Hybrid AI",id:"hybrid-ai",level:4}]};function S(e){let{components:t,...n}=e;return(0,_.kt)("wrapper",(0,d.Z)({},T,n,{components:t,mdxType:"MDXLayout"}),(0,_.kt)("h4",{id:"hybrid-ai"},"Hybrid AI"),(0,_.kt)("p",null,"Mix different kind of agents: expert systems, doctrines, search, planners, neural networks\u2026"))}S.isMDXComponent=!0;const V={toc:[{value:"Implementation swapping",id:"implementation-swapping",level:4}]};function z(e){let{components:t,...n}=e;return(0,_.kt)("wrapper",(0,d.Z)({},V,n,{components:t,mdxType:"MDXLayout"}),(0,_.kt)("h4",{id:"implementation-swapping"},"Implementation swapping"),(0,_.kt)("p",null,"Swap actors in and out from one implementation of an agent to another, from a human user to another, or from a human user to a trained or untrained agent, and vice-versa. Bootstrap training with pseudo-humans or rule-based agents."))}z.isMDXComponent=!0;const O={toc:[{value:"Optimized for minimal discontinuity between development and deployment",id:"optimized-for-minimal-discontinuity-between-development-and-deployment",level:4}]};function R(e){let{components:t,...n}=e;return(0,_.kt)("wrapper",(0,d.Z)({},O,n,{components:t,mdxType:"MDXLayout"}),(0,_.kt)("h4",{id:"optimized-for-minimal-discontinuity-between-development-and-deployment"},"Optimized for minimal discontinuity between development and deployment"),(0,_.kt)("p",null,"There is virtually no difference between developed and productionized versions of a Cogment project. Develop in an iterative way, with any part of a project being live-developed so iteration cycles between simulated and real environments can happen as quickly as possible."))}R.isMDXComponent=!0;const P={toc:[{value:"Multi-actor",id:"multi-actor",level:4}]};function F(e){let{components:t,...n}=e;return(0,_.kt)("wrapper",(0,d.Z)({},P,n,{components:t,mdxType:"MDXLayout"}),(0,_.kt)("h4",{id:"multi-actor"},"Multi-actor"),(0,_.kt)("p",null,'Allow multiple agents and multiple human users (all "actors") to exist, train, and work together within the same environment, interacting with one another and their environment. They can be part of collaborative or competitive setups, with heterogeneous roles.'))}F.isMDXComponent=!0;const G={toc:[{value:"Multi-experience learning",id:"multi-experience-learning",level:4}]};function H(e){let{components:t,...n}=e;return(0,_.kt)("wrapper",(0,d.Z)({},G,n,{components:t,mdxType:"MDXLayout"}),(0,_.kt)("h4",{id:"multi-experience-learning"},"Multi-experience learning"),(0,_.kt)("p",null,"Run multiple instances of the same agent in multiple and distributed trials / experiences. The accumulated data can be used in a centralized way to contribute to the training of a single agent, or in a decentralized way to train a population of specialized agents."))}H.isMDXComponent=!0;const J={toc:[{value:"Multi-method",id:"multi-method",level:4}]};function $(e){let{components:t,...n}=e;return(0,_.kt)("wrapper",(0,d.Z)({},J,n,{components:t,mdxType:"MDXLayout"}),(0,_.kt)("h4",{id:"multi-method"},"Multi-method"),(0,_.kt)("p",null,"Train agents in various ways using Reinforcement learning (on policy, off policy, Q learning, etc.), Imitation Learning (behavior cloning), Curriculum Learning\u2026"))}$.isMDXComponent=!0;const j={toc:[{value:"Multi-source and retroactive rewards",id:"multi-source-and-retroactive-rewards",level:4}]};function B(e){let{components:t,...n}=e;return(0,_.kt)("wrapper",(0,d.Z)({},j,n,{components:t,mdxType:"MDXLayout"}),(0,_.kt)("h4",{id:"multi-source-and-retroactive-rewards"},"Multi-source and retroactive rewards"),(0,_.kt)("p",null,"Multiple Reinforcement Learning (RL) agents can use any number of reward sources; environment (real or simulated), users, other agents. Delays in the evaluation are supported while maintaining live training capabilities."))}B.isMDXComponent=!0;const W={toc:[{value:"Tech stack agnostic",id:"tech-stack-agnostic",level:4}]};function q(e){let{components:t,...n}=e;return(0,_.kt)("wrapper",(0,d.Z)({},W,n,{components:t,mdxType:"MDXLayout"}),(0,_.kt)("h4",{id:"tech-stack-agnostic"},"Tech stack agnostic"),(0,_.kt)("p",null,"Develop tech-heterogeneous components working together regardless of the tech stacks used to develop them. Use Pytorch, Keras, or Tensorflow frameworks, with Unity, OpenAI Gym, Petting Zoo or any environments or digital twin simulations."))}q.isMDXComponent=!0;const K=[F,$,q,H,z,B,S,R];var U=n(3057),Q=n(5673),Y=n(5386);function ee(){const{siteConfig:e}=(0,u.Z)();return c.createElement(o.Z,{title:e.title,description:e.tagline},c.createElement(N.V,{className:"shadow--md"},c.createElement("div",{className:"container"},c.createElement("h1",{className:"hero__title"},"Build, train, and operate AI agents in simulated or real environments shared with humans."),c.createElement("h2",{className:"hero__subtitle"},"Cogment is the first open source platform designed to address the challenges of continuously training humans and AI together."),c.createElement(k._,{className:"row"},c.createElement(s.Z,{className:(0,i.Z)("button","button--lg","margin-right--sm","button--primary"),href:"https://github.com/cogment/cogment-verse"},c.createElement(l.G,{icon:r.zhw})," Get started for free"),c.createElement(s.Z,{className:"button button--secondary button--lg",href:"https://discord.com/invite/QDxb9Fweqr"},c.createElement(l.G,{icon:r.omb})," Come chat and share!")))),c.createElement(M.$,{className:(0,i.Z)("margin-vert--lg","padding-vert--lg")},c.createElement("div",{className:"container"},c.createElement("div",{className:"row"},c.createElement("div",{className:"col"},c.createElement("h3",null,"Why Cogment"))),c.createElement(E,{className:"row padding-vert--md"},A.map(((e,t)=>c.createElement(Z,{key:t,className:"col"},c.createElement(e,null))))),c.createElement(k._,{className:"row"},c.createElement(s.Z,{href:"https://ai-r.com/solutions",className:"button button--secondary"},"Discover Cogment-enabled solutions from AI Redefined")))),c.createElement(M.$,{className:(0,i.Z)("shadow--md","padding-vert--lg")},c.createElement("div",{className:(0,i.Z)("margin-vert--lg","container")},c.createElement("div",{className:"row"},c.createElement("div",{className:"col"},c.createElement("h3",null,"Compatible with your existing tools"))),c.createElement("div",{className:"row"},c.createElement("div",{className:"col"},c.createElement(f,null,c.createElement(v,{title:"PyTorch",imgSrc:"/img/3rd_party_tools/pytorch.svg",href:"https://pytorch.org"}),c.createElement(v,{title:"Open AI Gym",imgSrc:"/img/3rd_party_tools/openai_gym.svg",href:"https://gym.openai.com"}),c.createElement(v,{title:"Petting Zoo",imgSrc:"/img/3rd_party_tools/petting_zoo.svg",href:"https://www.pettingzoo.ml"}),c.createElement(v,{title:"Tensorflow",imgSrc:"/img/3rd_party_tools/tensorflow.svg",href:"https://www.tensorflow.org"}))))),c.createElement("div",{className:(0,i.Z)("margin-vert--lg","container")},c.createElement("div",{className:"row"},c.createElement("div",{className:"col"},c.createElement("h3",null,"They're already using Cogment"))),c.createElement("div",{className:"row"},c.createElement("div",{className:"col"},c.createElement(f,null,c.createElement(v,{title:"Thales",imgSrc:"/img/users/thales.svg",href:"https://www.thalesgroup.com"}),c.createElement(v,{title:"The Chandar Research Lab at MILA",imgSrc:"/img/users/mila_chandar_research_lab.svg",href:"https://chandar-lab.github.io"}),c.createElement(v,{title:"The Intelligent Robot Learning Laboratory at University of Alberta",imgSrc:"/img/users/university_of_alberta_intelligent_robot_learning_laboratory.svg",href:"https://irll.ca"}),c.createElement(v,{title:"Alberta Machine Intelligence Institute",imgSrc:"/img/users/alberta_machine_intelligence_institute.svg",href:"https://www.amii.ca"}))))),c.createElement("div",{className:(0,i.Z)("margin-vert--xl","container")},c.createElement("div",{className:"row"},c.createElement("div",{className:(0,i.Z)("col",m.Z.verticallyJustifiedCol)},c.createElement("div",{className:"padding--lg"},c.createElement(Y.Z,null))),c.createElement("div",{className:(0,i.Z)("col",m.Z.verticallyJustifiedCol)},c.createElement(U.ZP,null))),c.createElement(b.W,{className:"row"},c.createElement(Q.Z,null)),c.createElement(k._,{className:"row"},c.createElement(s.Z,{className:"button button--primary button--lg margin-right--sm",to:"/cogment_verse"},"Learn more about Cogment Verse...")))),c.createElement(M.$,{className:(0,i.Z)("margin-vert--lg","padding-vert--lg")},c.createElement("div",{className:"container"},c.createElement("div",{className:"row"},c.createElement("div",{className:"col"},c.createElement("h3",null,"Key features"))),c.createElement("div",{className:"row"},c.createElement("div",{className:(0,i.Z)("col",m.Z.verticallyJustifiedCol)},K.filter(((e,t,n)=>t<n.length/2)).map((e=>c.createElement("div",null,c.createElement(e,null))))),c.createElement("div",{className:(0,i.Z)("col",m.Z.verticallyJustifiedCol)},K.filter(((e,t,n)=>t>=n.length/2)).map((e=>c.createElement("div",null,c.createElement(e,null)))))))))}a.vc.autoAddCss=!1},6627:(e,t,n)=>{n.d(t,{Z:()=>a});const a={verticallyJustifiedCol:"verticallyJustifiedCol__fFm"}},9170:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/iterate-da54e365fa4b823db0e09680cc5ea3c7.svg"},6696:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/orchestrate-20ff18d9d060351df4e61ce4db9236ba.svg"},607:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/train-4f831c56a7e8eb20b9450c27de607f7d.svg"}}]); \ No newline at end of file diff --git a/assets/js/c4f5d8e4.d96c9167.js b/assets/js/c4f5d8e4.d96c9167.js new file mode 100644 index 0000000..9b69a04 --- /dev/null +++ b/assets/js/c4f5d8e4.d96c9167.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[4195],{5386:(e,t,n)=>{n.d(t,{Z:()=>o});var a,r,l=n(7294);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},i.apply(this,arguments)}const o=e=>{let{title:t,titleId:n,...o}=e;return l.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 253.19 53.76","aria-labelledby":n},o),t?l.createElement("title",{id:n},t):null,a||(a=l.createElement("g",{className:"main"},l.createElement("path",{d:"M179.82 40c7.19 0 12.93-3.25 14.78-8.58l-7.3-1.86a7.76 7.76 0 0 1-7.13 4.06c-4.23 0-7.19-2.73-7.89-6.9h23.31a18.22 18.22 0 0 0 .12-2.61c0-9.33-6.5-15.65-16-15.65s-16.3 6.27-16.3 15.54c0 9.57 6.79 16 16.41 16Zm-.29-25.17A7.34 7.34 0 0 1 187 21.4h-14.78c.7-3.95 3.43-6.56 7.31-6.56ZM209.57 36.15V22.38a6.29 6.29 0 0 1 6.26-6.49c3.48 0 5.56 2.55 5.56 6.2V33.7l8.61-1.78v-11c0-7.13-4.47-12.35-11.2-12.35-3.59 0-6.43 1.68-8.63 5.05h-.58V9.39H201v28.54ZM237.85 30.28l8.55-1.78V15.65h6.79V9.39h-6.79l.06-9.39h-6.72l-1.69 9.39h-4.4v6.26h4.17l.03 14.63zM95.8 13.16h-.58a11.72 11.72 0 0 0-9.68-4.64c-8.24 0-14 6.15-14 15.72 0 9.16 5.79 15.24 14 15.24A11.84 11.84 0 0 0 95 35.19h.58v3.31c0 4.87-3.07 8-7.83 8a7.53 7.53 0 0 1-7.54-5.22l-8.29 1.63c1.44 6.66 7.41 10.43 16.08 10.43 9.92 0 16.18-5.45 16.18-14.61V9.39H95.8ZM88 32.47c-4.58 0-7.88-3.48-7.88-8.23s3.3-8.41 7.88-8.41 7.83 3.54 7.83 8.41-3.22 8.23-7.83 8.23ZM119.23 22.15c0-3.83 2.2-6.32 5.56-6.32s5.34 2.49 5.34 6.32v16.93h8.64V22.15c0-3.71 2.32-6.32 5.68-6.32s5.55 2.72 5.55 6.32v16.93h8.59V20.7c0-7.19-4.7-12.18-11.25-12.18a10.21 10.21 0 0 0-9.34 5.57h-.58a10.11 10.11 0 0 0-9.1-5.62 9.63 9.63 0 0 0-8.58 5.33h-.58V9.39h-8.52v29.69h8.58ZM51.43 8.47C41.51 8.47 35 14.67 35 24.24S41.51 40 51.43 40 67.9 33.86 67.9 24.24 61.29 8.47 51.43 8.47Zm0 24.23c-4.64 0-7.89-3.54-7.89-8.46s3.25-8.41 7.89-8.41 7.83 3.48 7.83 8.41S56 32.7 51.43 32.7ZM16.18 32.93c-4.35 0-7.6-3.59-7.6-8.69s3.31-8.7 7.65-8.7a7.27 7.27 0 0 1 7.08 5.51l8-1.05c-1-7-7.13-11.53-15.19-11.53C6.55 8.47 0 14.79 0 24.24S6.67 40 16.12 40c7.94 0 14.15-4.53 15.25-11.54l-8.06-1a7.29 7.29 0 0 1-7.13 5.47Z"}))),r||(r=l.createElement("g",{className:"subscript",fill:"#231f20"},l.createElement("path",{d:"M110.75 43.65h2.67l2.12 7.45h.17l2.14-7.45h2.66l-3.05 9.77h-3.66ZM146.34 53.05a4.55 4.55 0 0 1-1.72-1.86 5.91 5.91 0 0 1-.62-2.74 5.59 5.59 0 0 1 .61-2.67 4.36 4.36 0 0 1 1.71-1.8 4.88 4.88 0 0 1 2.51-.64 4.65 4.65 0 0 1 2.45.65 4.37 4.37 0 0 1 1.66 1.82 5.77 5.77 0 0 1 .6 2.67v.46a3.9 3.9 0 0 1 0 .4h-6.9a3.28 3.28 0 0 0 .42 1.21 2.19 2.19 0 0 0 1.94 1.07 2.25 2.25 0 0 0 1.25-.36 2.35 2.35 0 0 0 .84-1l2.18.61a3.86 3.86 0 0 1-.92 1.5 4.17 4.17 0 0 1-1.52 1 5.33 5.33 0 0 1-1.93.34 4.7 4.7 0 0 1-2.56-.66Zm4.66-5.46a3.13 3.13 0 0 0-.4-1.11 2.11 2.11 0 0 0-.76-.78 2 2 0 0 0-1-.27 2 2 0 0 0-1 .26 2.08 2.08 0 0 0-.74.76 3 3 0 0 0-.4 1.14ZM179 43.65h2.48V45h.19a2.39 2.39 0 0 1 .88-1.1 2.14 2.14 0 0 1 1.27-.41 3.12 3.12 0 0 1 .54 0 1.47 1.47 0 0 1 .46.17v2.56a3.68 3.68 0 0 0-.77-.26 3 3 0 0 0-.67-.09 1.61 1.61 0 0 0-1.35.7 3 3 0 0 0-.52 1.83v5H179ZM212.83 53.32a3.23 3.23 0 0 1-1.45-1.24 3.62 3.62 0 0 1-.5-1.93h2.21a1.74 1.74 0 0 0 .58 1.26 2.11 2.11 0 0 0 1.46.48 1.94 1.94 0 0 0 1.16-.32 1 1 0 0 0 .43-.89.79.79 0 0 0-.23-.63 1.34 1.34 0 0 0-.58-.3 6.18 6.18 0 0 0-1-.18h-.49a8.3 8.3 0 0 1-1.72-.39 2.5 2.5 0 0 1-1.7-2.61 3.14 3.14 0 0 1 .49-1.75 3 3 0 0 1 1.36-1.13 5 5 0 0 1 2-.39 5.14 5.14 0 0 1 2.1.41 3.28 3.28 0 0 1 1.44 1.14 2.87 2.87 0 0 1 .5 1.74h-2.29a1.28 1.28 0 0 0-.49-1 1.9 1.9 0 0 0-1.26-.38 1.83 1.83 0 0 0-1.1.31 1 1 0 0 0-.44.83.73.73 0 0 0 .26.61 1.42 1.42 0 0 0 .64.31 9.54 9.54 0 0 0 1.11.17l.29.06h.12a6.94 6.94 0 0 1 1.72.37 2.93 2.93 0 0 1 1.24.9 2.61 2.61 0 0 1 .49 1.67 3 3 0 0 1-1.92 2.93 5.61 5.61 0 0 1-2.24.4 5.25 5.25 0 0 1-2.19-.45ZM245.75 53.05a4.62 4.62 0 0 1-1.75-1.86 5.91 5.91 0 0 1-.61-2.74 5.71 5.71 0 0 1 .6-2.67 4.45 4.45 0 0 1 1.72-1.8 4.85 4.85 0 0 1 2.5-.64 4.66 4.66 0 0 1 2.46.65 4.43 4.43 0 0 1 1.66 1.82 5.89 5.89 0 0 1 .59 2.67v.46a2.24 2.24 0 0 1 0 .4H246a3.28 3.28 0 0 0 .42 1.21 2.29 2.29 0 0 0 .82.79 2.18 2.18 0 0 0 1.11.28 2.22 2.22 0 0 0 1.24-.36 2.45 2.45 0 0 0 .85-1l2.17.61a3.84 3.84 0 0 1-.91 1.5 4.21 4.21 0 0 1-1.53 1 5.32 5.32 0 0 1-1.92.34 4.76 4.76 0 0 1-2.5-.66Zm4.63-5.46a3.12 3.12 0 0 0-.39-1.11 2.19 2.19 0 0 0-.76-.78 2.07 2.07 0 0 0-1-.27 2 2 0 0 0-1 .26 2.1 2.1 0 0 0-.75.76 3.2 3.2 0 0 0-.39 1.14Z"}))))}},3057:(e,t,n)=>{n.d(t,{ZP:()=>o});var a=n(7462),r=(n(7294),n(3905));const l={toc:[]},i="wrapper";function o(e){let{components:t,...n}=e;return(0,r.kt)(i,(0,a.Z)({},l,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"Cogment Verse is a SDK helping researchers and developers in the fields of human-in-the-loop learning (HILL) and multi-agent reinforcement learning (MARL) train and validate their agents at scale. Cogment Verse instantiates the open-source ",(0,r.kt)("a",{parentName:"p",href:"/"},"Cogment")," platform for environments following the OpenAI Gym mold, making it easy to get started."),(0,r.kt)("p",null,"Simply clone the ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-verse"},"repo")," and start training."))}o.isMDXComponent=!0},2058:(e,t,n)=>{n.d(t,{_:()=>o});var a=n(7462),r=n(7294),l=n(6010);const i={cta:"cta_i4Jo"};function o(e){let{children:t,className:n,...o}=e;return r.createElement("div",(0,a.Z)({className:(0,l.Z)(n,i.cta)},o),t)}},4388:(e,t,n)=>{n.d(t,{V:()=>o});var a=n(7462),r=n(7294),l=n(6010);const i={hero:"hero_uw3b"};function o(e){let{children:t,className:n,...o}=e;return r.createElement("div",(0,a.Z)({className:(0,l.Z)(n,"hero",i.hero)},o),t)}},5137:(e,t,n)=>{n.d(t,{W:()=>o});var a=n(7462),r=n(7294);const l={screenshots:"screenshots_x3pV"};var i=n(6010);function o(e){let{children:t,className:n,...o}=e;return r.createElement("div",(0,a.Z)({className:(0,i.Z)(l.screenshots,n)},o),t)}},936:(e,t,n)=>{n.d(t,{$:()=>o});var a=n(7462),r=n(7294),l=n(6010);const i={section:"section_ccoD"};function o(e){let{children:t,className:n,...o}=e;return r.createElement("div",(0,a.Z)({className:(0,l.Z)(n,i.section)},o),t)}},5673:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(7294);const r=n.p+"assets/images/atari_double_dunk-957d0719ded0c73d0d19c54205e9d89f.gif",l=n.p+"assets/images/classic_go-194543ef4e433ad1a827c74bb296b9f7.gif",i=n.p+"assets/images/atari_montezumas_revenge-1451d09162dd95c536af9e45af10d6b5.gif",o=n.p+"assets/images/lunar_lander-49afc13c99c3d30fd673b642cbbc2c9b.gif";const s=function(){return a.createElement(a.Fragment,null,a.createElement("img",{src:r,alt:"Atari Double Dunk - From Petting Zoo"}),a.createElement("img",{src:l,alt:"Go - From Petting Zoo"}),a.createElement("img",{src:i,alt:"Atari Montezuma's Revenge - From Open AI Gym"}),a.createElement("img",{src:o,alt:"Lunar Lander - From Open AI Gym"}))}},4825:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Q});var a=n(3636),r=n(3024),l=n(7814),i=n(6010),o=n(7452),s=n(9960),c=n(7294),m=n(6627),u=n(2263),d=n(7462),p=n(4996);const h={logos:"logos_W70m",logo:"logo_kX79"};function g(e){let{imgSrc:t,title:n,href:a=null,...r}=e;return a?c.createElement("div",{className:h.logo},c.createElement(s.Z,{href:a},c.createElement("img",{src:(0,p.Z)(t),alt:`logo for ${n}`,title:n}))):c.createElement("div",(0,d.Z)({className:h.logo},r),c.createElement("img",{src:(0,p.Z)(t),alt:`logo for ${n}`,title:n}))}function v(e){let{children:t,...n}=e;return c.createElement("div",(0,d.Z)({className:h.logos},n),t)}const f={benefits:"benefits_d4xt",benefit:"benefit_pXnC"};function y(e){let{children:t,className:n,...a}=e;return c.createElement("div",(0,d.Z)({className:(0,i.Z)(n,f.benefits)},a),t)}function w(e){let{children:t,className:n,...a}=e;return c.createElement("div",(0,d.Z)({className:(0,i.Z)(n,f.benefit)},a),t)}var E=n(5137),b=n(2058),Z=n(4388),k=n(936),N=n(3905);const M={toc:[{value:"Orchestrate intelligence ecosystems",id:"orchestrate-intelligence-ecosystems",level:4}]};function _(e){let{components:t,...a}=e;return(0,N.kt)("wrapper",(0,d.Z)({},M,a,{components:t,mdxType:"MDXLayout"}),(0,N.kt)("h4",{id:"orchestrate-intelligence-ecosystems"},"Orchestrate intelligence ecosystems"),(0,N.kt)("p",null,(0,N.kt)("img",{alt:"Orchestrate intelligence ecosystems",src:n(6696).Z,width:"1080",height:"1080"})),(0,N.kt)("ul",null,(0,N.kt)("li",{parentName:"ul"},"Best of human & AI capabilities"),(0,N.kt)("li",{parentName:"ul"},"Human supervision when it matters"),(0,N.kt)("li",{parentName:"ul"},"Hybrid AI: Compliance & high performance"),(0,N.kt)("li",{parentName:"ul"},"Modular approach: reduce compute usage & faciliate validation")))}_.isMDXComponent=!0;const C={toc:[{value:"Continuously train AIs & humans together",id:"continuously-train-ais--humans-together",level:4}]};function D(e){let{components:t,...a}=e;return(0,N.kt)("wrapper",(0,d.Z)({},C,a,{components:t,mdxType:"MDXLayout"}),(0,N.kt)("h4",{id:"continuously-train-ais--humans-together"},"Continuously train AIs & humans together"),(0,N.kt)("p",null,(0,N.kt)("img",{alt:"Continuously train AIs & humans together",src:n(607).Z,width:"1080",height:"1080"})),(0,N.kt)("ul",null,(0,N.kt)("li",{parentName:"ul"},"Less data required"),(0,N.kt)("li",{parentName:"ul"},"Real-time adaptation"),(0,N.kt)("li",{parentName:"ul"},"Faster training"),(0,N.kt)("li",{parentName:"ul"},"Fostering of trust")))}D.isMDXComponent=!0;const x={toc:[{value:"Iterate smoothly from sim to real",id:"iterate-smoothly-from-sim-to-real",level:4}]};function I(e){let{components:t,...a}=e;return(0,N.kt)("wrapper",(0,d.Z)({},x,a,{components:t,mdxType:"MDXLayout"}),(0,N.kt)("h4",{id:"iterate-smoothly-from-sim-to-real"},"Iterate smoothly from sim to real"),(0,N.kt)("p",null,(0,N.kt)("img",{alt:"Iterate smoothly from sim to real",src:n(9170).Z,width:"1000",height:"1001"})),(0,N.kt)("ul",null,(0,N.kt)("li",{parentName:"ul"},"Safe and simple design and training in simulation"),(0,N.kt)("li",{parentName:"ul"},"Progressive deployment to real environment"),(0,N.kt)("li",{parentName:"ul"},"Real environments, digital twins, numerical simulations, etc.")))}I.isMDXComponent=!0;const L=[D,_,I],X={toc:[{value:"Hybrid AI",id:"hybrid-ai",level:4}]};function A(e){let{components:t,...n}=e;return(0,N.kt)("wrapper",(0,d.Z)({},X,n,{components:t,mdxType:"MDXLayout"}),(0,N.kt)("h4",{id:"hybrid-ai"},"Hybrid AI"),(0,N.kt)("p",null,"Mix different kind of agents: expert systems, doctrines, search, planners, neural networks\u2026"))}A.isMDXComponent=!0;const T={toc:[{value:"Implementation swapping",id:"implementation-swapping",level:4}]};function S(e){let{components:t,...n}=e;return(0,N.kt)("wrapper",(0,d.Z)({},T,n,{components:t,mdxType:"MDXLayout"}),(0,N.kt)("h4",{id:"implementation-swapping"},"Implementation swapping"),(0,N.kt)("p",null,"Swap actors in and out from one implementation of an agent to another, from a human user to another, or from a human user to a trained or untrained agent, and vice-versa. Bootstrap training with pseudo-humans or rule-based agents."))}S.isMDXComponent=!0;const V={toc:[{value:"Optimized for minimal discontinuity between development and deployment",id:"optimized-for-minimal-discontinuity-between-development-and-deployment",level:4}]};function z(e){let{components:t,...n}=e;return(0,N.kt)("wrapper",(0,d.Z)({},V,n,{components:t,mdxType:"MDXLayout"}),(0,N.kt)("h4",{id:"optimized-for-minimal-discontinuity-between-development-and-deployment"},"Optimized for minimal discontinuity between development and deployment"),(0,N.kt)("p",null,"There is virtually no difference between developed and productionized versions of a Cogment project. Develop in an iterative way, with any part of a project being live-developed so iteration cycles between simulated and real environments can happen as quickly as possible."))}z.isMDXComponent=!0;const O={toc:[{value:"Multi-actor",id:"multi-actor",level:4}]};function R(e){let{components:t,...n}=e;return(0,N.kt)("wrapper",(0,d.Z)({},O,n,{components:t,mdxType:"MDXLayout"}),(0,N.kt)("h4",{id:"multi-actor"},"Multi-actor"),(0,N.kt)("p",null,'Allow multiple agents and multiple human users (all "actors") to exist, train, and work together within the same environment, interacting with one another and their environment. They can be part of collaborative or competitive setups, with heterogeneous roles.'))}R.isMDXComponent=!0;const P={toc:[{value:"Multi-experience learning",id:"multi-experience-learning",level:4}]};function F(e){let{components:t,...n}=e;return(0,N.kt)("wrapper",(0,d.Z)({},P,n,{components:t,mdxType:"MDXLayout"}),(0,N.kt)("h4",{id:"multi-experience-learning"},"Multi-experience learning"),(0,N.kt)("p",null,"Run multiple instances of the same agent in multiple and distributed trials / experiences. The accumulated data can be used in a centralized way to contribute to the training of a single agent, or in a decentralized way to train a population of specialized agents."))}F.isMDXComponent=!0;const G={toc:[{value:"Multi-method",id:"multi-method",level:4}]};function H(e){let{components:t,...n}=e;return(0,N.kt)("wrapper",(0,d.Z)({},G,n,{components:t,mdxType:"MDXLayout"}),(0,N.kt)("h4",{id:"multi-method"},"Multi-method"),(0,N.kt)("p",null,"Train agents in various ways using Reinforcement learning (on policy, off policy, Q learning, etc.), Imitation Learning (behavior cloning), Curriculum Learning\u2026"))}H.isMDXComponent=!0;const J={toc:[{value:"Multi-source and retroactive rewards",id:"multi-source-and-retroactive-rewards",level:4}]};function $(e){let{components:t,...n}=e;return(0,N.kt)("wrapper",(0,d.Z)({},J,n,{components:t,mdxType:"MDXLayout"}),(0,N.kt)("h4",{id:"multi-source-and-retroactive-rewards"},"Multi-source and retroactive rewards"),(0,N.kt)("p",null,"Multiple Reinforcement Learning (RL) agents can use any number of reward sources; environment (real or simulated), users, other agents. Delays in the evaluation are supported while maintaining live training capabilities."))}$.isMDXComponent=!0;const j={toc:[{value:"Tech stack agnostic",id:"tech-stack-agnostic",level:4}]};function B(e){let{components:t,...n}=e;return(0,N.kt)("wrapper",(0,d.Z)({},j,n,{components:t,mdxType:"MDXLayout"}),(0,N.kt)("h4",{id:"tech-stack-agnostic"},"Tech stack agnostic"),(0,N.kt)("p",null,"Develop tech-heterogeneous components working together regardless of the tech stacks used to develop them. Use Pytorch, Keras, or Tensorflow frameworks, with Unity, OpenAI Gym, Petting Zoo or any environments or digital twin simulations."))}B.isMDXComponent=!0;const W=[R,H,B,F,S,$,A,z];var q=n(3057),K=n(5673),U=n(5386);function Q(){const{siteConfig:e}=(0,u.Z)();return c.createElement(o.Z,{title:e.title,description:e.tagline},c.createElement(Z.V,{className:"shadow--md"},c.createElement("div",{className:"container"},c.createElement("h1",{className:"hero__title"},"Build, train, and operate AI agents in simulated or real environments shared with humans."),c.createElement("h2",{className:"hero__subtitle"},"Cogment is the first open source platform designed to address the challenges of continuously training humans and AI together."),c.createElement(b._,{className:"row"},c.createElement(s.Z,{className:(0,i.Z)("button","button--lg","margin-right--sm","button--primary"),href:"https://github.com/cogment/cogment-verse"},c.createElement(l.G,{icon:r.zhw})," Get started for free"),c.createElement(s.Z,{className:"button button--secondary button--lg",href:"https://discord.com/invite/QDxb9Fweqr"},c.createElement(l.G,{icon:r.omb})," Come chat and share!")))),c.createElement(k.$,{className:(0,i.Z)("margin-vert--lg","padding-vert--lg")},c.createElement("div",{className:"container"},c.createElement("div",{className:"row"},c.createElement("div",{className:"col"},c.createElement("h3",null,"Why Cogment"))),c.createElement(y,{className:"row padding-vert--md"},L.map(((e,t)=>c.createElement(w,{key:t,className:"col"},c.createElement(e,null))))),c.createElement(b._,{className:"row"},c.createElement(s.Z,{href:"https://ai-r.com/solutions",className:"button button--secondary"},"Discover Cogment-enabled solutions from AI Redefined")))),c.createElement(k.$,{className:(0,i.Z)("shadow--md","padding-vert--lg")},c.createElement("div",{className:(0,i.Z)("margin-vert--lg","container")},c.createElement("div",{className:"row"},c.createElement("div",{className:"col"},c.createElement("h3",null,"Compatible with your existing tools"))),c.createElement("div",{className:"row"},c.createElement("div",{className:"col"},c.createElement(v,null,c.createElement(g,{title:"PyTorch",imgSrc:"/img/3rd_party_tools/pytorch.svg",href:"https://pytorch.org"}),c.createElement(g,{title:"Open AI Gym",imgSrc:"/img/3rd_party_tools/openai_gym.svg",href:"https://gym.openai.com"}),c.createElement(g,{title:"Petting Zoo",imgSrc:"/img/3rd_party_tools/petting_zoo.svg",href:"https://www.pettingzoo.ml"}),c.createElement(g,{title:"Tensorflow",imgSrc:"/img/3rd_party_tools/tensorflow.svg",href:"https://www.tensorflow.org"}))))),c.createElement("div",{className:(0,i.Z)("margin-vert--lg","container")},c.createElement("div",{className:"row"},c.createElement("div",{className:"col"},c.createElement("h3",null,"They're already using Cogment"))),c.createElement("div",{className:"row"},c.createElement("div",{className:"col"},c.createElement(v,null,c.createElement(g,{title:"Thales",imgSrc:"/img/users/thales.svg",href:"https://www.thalesgroup.com"}),c.createElement(g,{title:"The Chandar Research Lab at MILA",imgSrc:"/img/users/mila_chandar_research_lab.svg",href:"https://chandar-lab.github.io"}),c.createElement(g,{title:"The Intelligent Robot Learning Laboratory at University of Alberta",imgSrc:"/img/users/university_of_alberta_intelligent_robot_learning_laboratory.svg",href:"https://irll.ca"}),c.createElement(g,{title:"Alberta Machine Intelligence Institute",imgSrc:"/img/users/alberta_machine_intelligence_institute.svg",href:"https://www.amii.ca"}))))),c.createElement("div",{className:(0,i.Z)("margin-vert--xl","container")},c.createElement("div",{className:"row"},c.createElement("div",{className:(0,i.Z)("col",m.Z.verticallyJustifiedCol)},c.createElement("div",{className:"padding--lg"},c.createElement(U.Z,null))),c.createElement("div",{className:(0,i.Z)("col",m.Z.verticallyJustifiedCol)},c.createElement(q.ZP,null))),c.createElement(E.W,{className:"row"},c.createElement(K.Z,null)),c.createElement(b._,{className:"row"},c.createElement(s.Z,{className:"button button--primary button--lg margin-right--sm",to:"/cogment_verse"},"Learn more about Cogment Verse...")))),c.createElement(k.$,{className:(0,i.Z)("margin-vert--lg","padding-vert--lg")},c.createElement("div",{className:"container"},c.createElement("div",{className:"row"},c.createElement("div",{className:"col"},c.createElement("h3",null,"Key features"))),c.createElement("div",{className:"row"},c.createElement("div",{className:(0,i.Z)("col",m.Z.verticallyJustifiedCol)},W.filter(((e,t,n)=>t<n.length/2)).map((e=>c.createElement("div",null,c.createElement(e,null))))),c.createElement("div",{className:(0,i.Z)("col",m.Z.verticallyJustifiedCol)},W.filter(((e,t,n)=>t>=n.length/2)).map((e=>c.createElement("div",null,c.createElement(e,null)))))))))}a.vc.autoAddCss=!1},6627:(e,t,n)=>{n.d(t,{Z:()=>a});const a={verticallyJustifiedCol:"verticallyJustifiedCol__fFm"}},9170:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/iterate-da54e365fa4b823db0e09680cc5ea3c7.svg"},6696:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/orchestrate-20ff18d9d060351df4e61ce4db9236ba.svg"},607:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/train-4f831c56a7e8eb20b9450c27de607f7d.svg"}}]); \ No newline at end of file diff --git a/assets/js/d03751be.3d85882f.js b/assets/js/d03751be.3d85882f.js deleted file mode 100644 index d887e1b..0000000 --- a/assets/js/d03751be.3d85882f.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[1455],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>u});var i=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t){if(null==e)return{};var n,i,a=function(e,t){if(null==e)return{};var n,i,a={},r=Object.keys(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var p=i.createContext({}),d=function(e){var t=i.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},c=function(e){var t=d(e.components);return i.createElement(p.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return i.createElement(i.Fragment,{},t)}},m=i.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,p=e.parentName,c=o(e,["components","mdxType","originalType","parentName"]),m=d(n),u=a,k=m["".concat(p,".").concat(u)]||m[u]||s[u]||r;return n?i.createElement(k,l(l({ref:t},c),{},{components:n})):i.createElement(k,l({ref:t},c))}));function u(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,l=new Array(r);l[0]=m;var o={};for(var p in t)hasOwnProperty.call(t,p)&&(o[p]=t[p]);o.originalType=e,o.mdxType="string"==typeof e?e:a,l[1]=o;for(var d=2;d<r;d++)l[d]=n[d];return i.createElement.apply(null,l)}return i.createElement.apply(null,n)}m.displayName="MDXCreateElement"},9262:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>l,default:()=>s,frontMatter:()=>r,metadata:()=>o,toc:()=>d});var i=n(7462),a=(n(7294),n(3905));const r={title:"Web Proxy",sidebar_position:5},l="Web Proxy",o={unversionedId:"reference/cli/web-proxy",id:"reference/cli/web-proxy",title:"Web Proxy",description:"This module is still in active development and should be considered a preview version.",source:"@site/docs/reference/cli/web-proxy.md",sourceDirName:"reference/cli",slug:"/reference/cli/web-proxy",permalink:"/docs/reference/cli/web-proxy",draft:!1,tags:[],version:"current",lastUpdatedAt:1691703005,formattedLastUpdatedAt:"Aug 10, 2023",sidebarPosition:5,frontMatter:{title:"Web Proxy",sidebar_position:5},sidebar:"docSidebar",previous:{title:"Model Registry",permalink:"/docs/reference/cli/model-registry"},next:{title:"Launch",permalink:"/docs/reference/cli/launch"}},p={},d=[{value:"Command line",id:"command-line",level:2},{value:"Configuration",id:"configuration",level:2},{value:"<code>web_port</code>",id:"web_port",level:3},{value:"<code>orchestrator_endpoint</code>",id:"orchestrator_endpoint",level:3},{value:"<code>port</code>",id:"port",level:3},{value:"<code>spec_file</code>",id:"spec_file",level:3},{value:"<code>implementation</code>",id:"implementation",level:3},{value:"<code>secret</code>",id:"secret",level:3},{value:"<code>log_level</code>",id:"log_level",level:3},{value:"<code>log_file</code>",id:"log_file",level:3},{value:"<code>directory_endpoint</code>",id:"directory_endpoint",level:3},{value:"<code>directory_authentication_token</code>",id:"directory_authentication_token",level:3},{value:"<code>directory_registration_host</code>",id:"directory_registration_host",level:3},{value:"<code>directory_registration_properties</code>",id:"directory_registration_properties",level:3},{value:"HTTP API",id:"http-api",level:2},{value:"Controller",id:"controller",level:3},{value:"List trials",id:"list-trials",level:4},{value:"Start a trial",id:"start-a-trial",level:4},{value:"Actor",id:"actor",level:3},{value:"Join a trial",id:"join-a-trial",level:4},{value:"Leave a trial",id:"leave-a-trial",level:4},{value:"Act",id:"act",level:4}],c={toc:d};function s(e){let{components:t,...n}=e;return(0,a.kt)("wrapper",(0,i.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"web-proxy"},"Web Proxy"),(0,a.kt)("admonition",{type:"caution"},(0,a.kt)("p",{parentName:"admonition"},"This module is still in active development and should be considered a preview version.")),(0,a.kt)("p",null,"The Cogment Web Proxy is designed to facilitate the use of Cogment with web-based components. It implements a JSON HTTP API that can be easily used from a web application."),(0,a.kt)("p",null,"Current features include the following."),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Using the web proxy as a ",(0,a.kt)("a",{parentName:"li",href:"/docs/guide/core-concepts#controller"},"Controller"),":",(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},"list ongoing trials,"),(0,a.kt)("li",{parentName:"ul"},"start trial."))),(0,a.kt)("li",{parentName:"ul"},"Using the web proxy as an ",(0,a.kt)("a",{parentName:"li",href:"/docs/guide/core-concepts#actors"},"Actor"),":",(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},"Join a trial,"),(0,a.kt)("li",{parentName:"ul"},"Leave a trial,"),(0,a.kt)("li",{parentName:"ul"},"Receive observations and rewards, send actions and rewards.")))),(0,a.kt)("p",null,"Cogment Web Proxy aims at superceding the use of the grpc-web API that can be exposed by the ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/cli/orchestrator"},"orchestrator"),"."),(0,a.kt)("h2",{id:"command-line"},"Command line"),(0,a.kt)("p",null,"The Web Proxy is simply called this way"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"$ cogment services web_proxy --web_port=8080 --spec_file=./cogment.yaml\n")),(0,a.kt)("h2",{id:"configuration"},"Configuration"),(0,a.kt)("p",null,"The Web Proxy configuration can be specified either through the command line or environment variables."),(0,a.kt)("h3",{id:"web_port"},(0,a.kt)("inlineCode",{parentName:"h3"},"web_port")),(0,a.kt)("p",null,"The TCP port where to serve the ",(0,a.kt)("a",{parentName:"p",href:"#http-api"},"Web Proxy HTTP API"),"."),(0,a.kt)("p",null,"Can be specified as:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},"--web_port=80"),","),(0,a.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},"COGMENT_WEB_PROXY_WEB_PORT=8\xb0"),","),(0,a.kt)("li",{parentName:"ul"},"its default value is ",(0,a.kt)("inlineCode",{parentName:"li"},"8080"),".")),(0,a.kt)("h3",{id:"orchestrator_endpoint"},(0,a.kt)("inlineCode",{parentName:"h3"},"orchestrator_endpoint")),(0,a.kt)("p",null,"Cogment endpoint of the orchestrator service. It can be a ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/parameters#grpc-scheme"},"gRPC")," or ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/parameters#discover-host"},"discovery")," endpoint,in which case it'll rely on the ",(0,a.kt)("a",{parentName:"p",href:"#directory_endpoint"},"directory")," configuration."),(0,a.kt)("p",null,"This endpoint is used to access the ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/grpc#control-api"},"gRPC Control API"),"."),(0,a.kt)("p",null,"Can be specified as:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},"--orchestrator_endpoint=grpc://foo:9005"),","),(0,a.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},"COGMENT_ORCHESTRATOR_ENDPOINT=grpc://foo:9005"),","),(0,a.kt)("li",{parentName:"ul"},"its default value is ",(0,a.kt)("inlineCode",{parentName:"li"},"cogment://discover"),".")),(0,a.kt)("h3",{id:"port"},(0,a.kt)("inlineCode",{parentName:"h3"},"port")),(0,a.kt)("p",null,"The TCP port where to serve the ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/grpc#service-actor-api"},"The Service Actor API"),"."),(0,a.kt)("p",null,"If set to 0, then the system will automatically choose a free port.\nThis is normally used in combination with a ",(0,a.kt)("a",{parentName:"p",href:"#directory_endpoint"},"Directory"),"."),(0,a.kt)("p",null,"Can be specified as:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},"--port=12000"),","),(0,a.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},"COGMENT_WEB_PROXY_PORT=12000"),","),(0,a.kt)("li",{parentName:"ul"},"its default value is ",(0,a.kt)("inlineCode",{parentName:"li"},"9002"),".")),(0,a.kt)("h3",{id:"spec_file"},(0,a.kt)("inlineCode",{parentName:"h3"},"spec_file")),(0,a.kt)("p",null,"Path to the ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/cogment-yaml"},"spec file")," specifiying the trial that the proxy will interact with. In particular it is used for JSON serialization of the echanged actions, observations, configurations, ..."),(0,a.kt)("p",null,"Can be specified as:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},"--spec_file=./path/to/cogment.yaml"),","),(0,a.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},"COGMENT_SPEC_FILE=./path/to/cogment.yaml"),","),(0,a.kt)("li",{parentName:"ul"},"its default value is ",(0,a.kt)("inlineCode",{parentName:"li"},"./cogment.yaml"))),(0,a.kt)("h3",{id:"implementation"},(0,a.kt)("inlineCode",{parentName:"h3"},"implementation")),(0,a.kt)("p",null,"This defines the name of the actor implementation managed by the proxy."),(0,a.kt)("p",null,"Can be specified as:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},"--implementation=my_implementation"),","),(0,a.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},"COGMENT_WEB_PROXY_IMPLEMENTATION=my_implementation"),","),(0,a.kt)("li",{parentName:"ul"},"its default value is ",(0,a.kt)("inlineCode",{parentName:"li"},"web"),".")),(0,a.kt)("h3",{id:"secret"},(0,a.kt)("inlineCode",{parentName:"h3"},"secret")),(0,a.kt)("p",null,"The secret used to sign the generated actor trial tokens."),(0,a.kt)("admonition",{type:"info"},(0,a.kt)("p",{parentName:"admonition"},"This value should be changed for any application in production")),(0,a.kt)("p",null,"Can be specified as:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},"--secret=rosebud"),","),(0,a.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},"COGMENT_WEB_PROXY_SECRET=rosebud"),","),(0,a.kt)("li",{parentName:"ul"},"its default value is ",(0,a.kt)("inlineCode",{parentName:"li"},"web_proxy_secret"),".")),(0,a.kt)("h3",{id:"log_level"},(0,a.kt)("inlineCode",{parentName:"h3"},"log_level")),(0,a.kt)("p",null,"Set to define the minimum level for logging. Possible values are: ",(0,a.kt)("inlineCode",{parentName:"p"},"off"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"error"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"warning"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"info"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"debug"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"trace"),". Note however that all trace and most debug level logs will only output if running the debug compiled version of the Orchestrator."),(0,a.kt)("p",null,"Can be specified as:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},"--log_level=debug"),","),(0,a.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},"COGMENT_LOG_LEVEL=5"),","),(0,a.kt)("li",{parentName:"ul"},"default value is info.")),(0,a.kt)("h3",{id:"log_file"},(0,a.kt)("inlineCode",{parentName:"h3"},"log_file")),(0,a.kt)("p",null,"Base file name for daily log output. The name will be suffixed with the date and a new file will be made every day. If not provided the logs go to stdout."),(0,a.kt)("p",null,"Can be specified as:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},"--log_file=./path/to/cogment.log"),","),(0,a.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},"COGMENT_LOG_FILE=./path/to/cogment.log"),","),(0,a.kt)("li",{parentName:"ul"},"default value is info.")),(0,a.kt)("h3",{id:"directory_endpoint"},(0,a.kt)("inlineCode",{parentName:"h3"},"directory_endpoint")),(0,a.kt)("p",null,"Cogment endpoint of the directory service. It must be a ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/parameters#grpc-scheme"},"gRPC endpoint"),". The directory will be used to register the web proxy actor service for discovery by other services and to access the orchestrator. If not provided, the web proxy will not auto register, in which case manual registration to the directory must be done, or an explicit address must be provided to access the web proxy."),(0,a.kt)("p",null,"Can be specified as:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},"--directory_endpoint=grpc://foo:9005"),","),(0,a.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005"),","),(0,a.kt)("li",{parentName:"ul"},"it has no default value.")),(0,a.kt)("h3",{id:"directory_authentication_token"},(0,a.kt)("inlineCode",{parentName:"h3"},"directory_authentication_token")),(0,a.kt)("p",null,"Authentication token for services registered in the Directory. It is recorded in the Directory when registering a service. And a matching token must be provided to inquire for the service. An empty token is the same as no token."),(0,a.kt)("p",null,"Can be specified as:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},"--directory_authentication_token=GH670ploT"),","),(0,a.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT"),","),(0,a.kt)("li",{parentName:"ul"},"it has no default value.")),(0,a.kt)("h3",{id:"directory_registration_host"},(0,a.kt)("inlineCode",{parentName:"h3"},"directory_registration_host")),(0,a.kt)("p",null,"This is the host that will be registered to the Directory for the web proxy service. If not provided, the web proxy will determine its own IP address and use that as the registration host."),(0,a.kt)("p",null,"In some circumstances, the IP address determined by Cogment may be wrong (e.g. multiple interfaces, load balancing, firewall), thus a host (hostname or IP address) must be explicitly provided."),(0,a.kt)("p",null,"Can be specified as:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},"--directory_registration_host=foo.bar"),","),(0,a.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},"COGMENT_MODEL_REGISTRY_DIRECTORY_REGISTRATION_HOST=foo.bar"),","),(0,a.kt)("li",{parentName:"ul"},"it has no default value (i.e. self determined IP address is used).")),(0,a.kt)("h3",{id:"directory_registration_properties"},(0,a.kt)("inlineCode",{parentName:"h3"},"directory_registration_properties")),(0,a.kt)("p",null,'These are the properties that will be registered to the Directory for the web proxy service. When inquiring the Directory, the properties inquired must match the properties registered. This is a string representing multiple properties in the form "name=value,name=value,name=value" where the values are optional.'),(0,a.kt)("p",null,"Can be specified as:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},'--directory_registration_properties="Sim=20,hpp,mem=HIGH"'),","),(0,a.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,a.kt)("inlineCode",{parentName:"li"},'COGMENT_MODEL_REGISTRY_DIRECTORY_REGISTRATION_PROPERTIES="Sim=20,hpp,mem=HIGH"'),","),(0,a.kt)("li",{parentName:"ul"},"it has no default value.")),(0,a.kt)("h2",{id:"http-api"},"HTTP API"),(0,a.kt)("h3",{id:"controller"},"Controller"),(0,a.kt)("h4",{id:"list-trials"},"List trials"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-http"},"GET /controller/trials\n")),(0,a.kt)("p",null,"List all active trials."),(0,a.kt)("p",null,"\ud83d\udea7"),(0,a.kt)("h4",{id:"start-a-trial"},"Start a trial"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-http"},"POST /controller/trials\n")),(0,a.kt)("p",null,"Start a trial from given trial parameters."),(0,a.kt)("admonition",{type:"info"},(0,a.kt)("p",{parentName:"admonition"},"It is forbidden to pass ",(0,a.kt)("a",{parentName:"p",href:"/docs/reference/parameters#grpc-scheme"},"gRPC endpoint")," as part of the trial parameters here")),(0,a.kt)("p",null,"\ud83d\udea7"),(0,a.kt)("h3",{id:"actor"},"Actor"),(0,a.kt)("h4",{id:"join-a-trial"},"Join a trial"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-http"},"POST /actor/:actor_name/:trial_id:\n")),(0,a.kt)("p",null,"Join trial ",(0,a.kt)("inlineCode",{parentName:"p"},"trial_id")," as actor ",(0,a.kt)("inlineCode",{parentName:"p"},"actor_name"),", retrieve the initial observation and the actor trial token"),(0,a.kt)("p",null,"\ud83d\udea7"),(0,a.kt)("h4",{id:"leave-a-trial"},"Leave a trial"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-http"},"DELETE /actor/:actor_name/:trial_id:\n")),(0,a.kt)("p",null,"Explicitly close the trial connection."),(0,a.kt)("p",null,"Requires matching actor trial token passed in the ",(0,a.kt)("inlineCode",{parentName:"p"},"Cogment-Actor-Trial-Token")," header"),(0,a.kt)("p",null,"\ud83d\udea7"),(0,a.kt)("h4",{id:"act"},"Act"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-http"},"POST/GET /actor/:actor_name/:trial_id/:tick_id:\n")),(0,a.kt)("p",null,"Post the action (and potential sent rewards) for a tick (empty action on GET), retrieve the next observation (and potential received rewards)."),(0,a.kt)("p",null,"Requires matching actor trial token passed in the ",(0,a.kt)("inlineCode",{parentName:"p"},"Cogment-Actor-Trial-Token")," header"))}s.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/d03751be.6bff62ea.js b/assets/js/d03751be.6bff62ea.js new file mode 100644 index 0000000..a7a791a --- /dev/null +++ b/assets/js/d03751be.6bff62ea.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[1455],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>h});var i=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},a=Object.keys(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var p=i.createContext({}),d=function(e){var t=i.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},c=function(e){var t=d(e.components);return i.createElement(p.Provider,{value:t},e.children)},s="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return i.createElement(i.Fragment,{},t)}},u=i.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,p=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),s=d(n),u=r,h=s["".concat(p,".").concat(u)]||s[u]||m[u]||a;return n?i.createElement(h,o(o({ref:t},c),{},{components:n})):i.createElement(h,o({ref:t},c))}));function h(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,o=new Array(a);o[0]=u;var l={};for(var p in t)hasOwnProperty.call(t,p)&&(l[p]=t[p]);l.originalType=e,l[s]="string"==typeof e?e:r,o[1]=l;for(var d=2;d<a;d++)o[d]=n[d];return i.createElement.apply(null,o)}return i.createElement.apply(null,n)}u.displayName="MDXCreateElement"},9262:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>o,default:()=>m,frontMatter:()=>a,metadata:()=>l,toc:()=>d});var i=n(7462),r=(n(7294),n(3905));const a={title:"Web Proxy",sidebar_position:5},o="Web Proxy",l={unversionedId:"reference/cli/web-proxy",id:"reference/cli/web-proxy",title:"Web Proxy",description:"This module is still in active development and should be considered a preview version.",source:"@site/docs/reference/cli/web-proxy.md",sourceDirName:"reference/cli",slug:"/reference/cli/web-proxy",permalink:"/docs/reference/cli/web-proxy",draft:!1,tags:[],version:"current",lastUpdatedAt:1701726431,formattedLastUpdatedAt:"Dec 4, 2023",sidebarPosition:5,frontMatter:{title:"Web Proxy",sidebar_position:5},sidebar:"docSidebar",previous:{title:"Model Registry",permalink:"/docs/reference/cli/model-registry"},next:{title:"Launch",permalink:"/docs/reference/cli/launch"}},p={},d=[{value:"Command line",id:"command-line",level:2},{value:"Configuration",id:"configuration",level:2},{value:"<code>web_port</code>",id:"web_port",level:3},{value:"<code>orchestrator_endpoint</code>",id:"orchestrator_endpoint",level:3},{value:"<code>port</code>",id:"port",level:3},{value:"<code>spec_file</code>",id:"spec_file",level:3},{value:"<code>implementation</code>",id:"implementation",level:3},{value:"<code>secret</code>",id:"secret",level:3},{value:"<code>log_level</code>",id:"log_level",level:3},{value:"<code>log_file</code>",id:"log_file",level:3},{value:"<code>directory_endpoint</code>",id:"directory_endpoint",level:3},{value:"<code>directory_authentication_token</code>",id:"directory_authentication_token",level:3},{value:"<code>directory_registration_host</code>",id:"directory_registration_host",level:3},{value:"<code>directory_registration_properties</code>",id:"directory_registration_properties",level:3}],c={toc:d},s="wrapper";function m(e){let{components:t,...n}=e;return(0,r.kt)(s,(0,i.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"web-proxy"},"Web Proxy"),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"This module is still in active development and should be considered a preview version.")),(0,r.kt)("p",null,"The Cogment Web Proxy is designed to facilitate the use of Cogment with web-based components. It implements a JSON HTTP API, whose reference can be found ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/web-proxy-api"},"here"),", that can be easily used from a web application."),(0,r.kt)("p",null,"Current features include the following."),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Using the web proxy as a ",(0,r.kt)("a",{parentName:"li",href:"/docs/guide/core-concepts#controller"},"Controller"),":",(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},"list ongoing trials,"),(0,r.kt)("li",{parentName:"ul"},"start trial."))),(0,r.kt)("li",{parentName:"ul"},"Using the web proxy as an ",(0,r.kt)("a",{parentName:"li",href:"/docs/guide/core-concepts#actors"},"Actor"),":",(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},"Join a trial,"),(0,r.kt)("li",{parentName:"ul"},"Leave a trial,"),(0,r.kt)("li",{parentName:"ul"},"Receive observations and rewards, send actions and rewards.")))),(0,r.kt)("p",null,"Cogment Web Proxy aims at superceding the use of the grpc-web API that can be exposed by the ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/cli/orchestrator"},"orchestrator"),"."),(0,r.kt)("h2",{id:"command-line"},"Command line"),(0,r.kt)("p",null,"The Web Proxy is simply called this way"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"$ cogment services web_proxy --web_port=8080 --spec_file=./cogment.yaml\n")),(0,r.kt)("h2",{id:"configuration"},"Configuration"),(0,r.kt)("p",null,"The Web Proxy configuration can be specified either through the command line or environment variables."),(0,r.kt)("h3",{id:"web_port"},(0,r.kt)("inlineCode",{parentName:"h3"},"web_port")),(0,r.kt)("p",null,"The TCP port where to serve the ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/web-proxy-api"},"Web Proxy HTTP API"),"."),(0,r.kt)("p",null,"Can be specified as:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},"--web_port=80"),","),(0,r.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},"COGMENT_WEB_PROXY_WEB_PORT=8\xb0"),","),(0,r.kt)("li",{parentName:"ul"},"its default value is ",(0,r.kt)("inlineCode",{parentName:"li"},"8080"),".")),(0,r.kt)("h3",{id:"orchestrator_endpoint"},(0,r.kt)("inlineCode",{parentName:"h3"},"orchestrator_endpoint")),(0,r.kt)("p",null,"Cogment endpoint of the orchestrator service. It can be a ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/parameters#grpc-scheme"},"gRPC")," or ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/parameters#discover-host"},"discovery")," endpoint,in which case it'll rely on the ",(0,r.kt)("a",{parentName:"p",href:"#directory_endpoint"},"directory")," configuration."),(0,r.kt)("p",null,"This endpoint is used to access the ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/grpc#control-api"},"gRPC Control API"),"."),(0,r.kt)("p",null,"Can be specified as:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},"--orchestrator_endpoint=grpc://foo:9005"),","),(0,r.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},"COGMENT_ORCHESTRATOR_ENDPOINT=grpc://foo:9005"),","),(0,r.kt)("li",{parentName:"ul"},"its default value is ",(0,r.kt)("inlineCode",{parentName:"li"},"cogment://discover"),".")),(0,r.kt)("h3",{id:"port"},(0,r.kt)("inlineCode",{parentName:"h3"},"port")),(0,r.kt)("p",null,"The TCP port where to serve the ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/grpc#service-actor-api"},"The Service Actor API"),"."),(0,r.kt)("p",null,"If set to 0, then the system will automatically choose a free port.\nThis is normally used in combination with a ",(0,r.kt)("a",{parentName:"p",href:"#directory_endpoint"},"Directory"),"."),(0,r.kt)("p",null,"Can be specified as:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},"--port=12000"),","),(0,r.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},"COGMENT_WEB_PROXY_PORT=12000"),","),(0,r.kt)("li",{parentName:"ul"},"its default value is ",(0,r.kt)("inlineCode",{parentName:"li"},"9002"),".")),(0,r.kt)("h3",{id:"spec_file"},(0,r.kt)("inlineCode",{parentName:"h3"},"spec_file")),(0,r.kt)("p",null,"Path to the ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/cogment-yaml"},"spec file")," specifiying the trial that the proxy will interact with. In particular it is used for JSON serialization of the echanged actions, observations, configurations, ..."),(0,r.kt)("p",null,"Can be specified as:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},"--spec_file=./path/to/cogment.yaml"),","),(0,r.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},"COGMENT_SPEC_FILE=./path/to/cogment.yaml"),","),(0,r.kt)("li",{parentName:"ul"},"its default value is ",(0,r.kt)("inlineCode",{parentName:"li"},"./cogment.yaml"))),(0,r.kt)("h3",{id:"implementation"},(0,r.kt)("inlineCode",{parentName:"h3"},"implementation")),(0,r.kt)("p",null,"This defines the name of the actor implementation managed by the proxy."),(0,r.kt)("p",null,"Can be specified as:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},"--implementation=my_implementation"),","),(0,r.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},"COGMENT_WEB_PROXY_IMPLEMENTATION=my_implementation"),","),(0,r.kt)("li",{parentName:"ul"},"its default value is ",(0,r.kt)("inlineCode",{parentName:"li"},"web"),".")),(0,r.kt)("h3",{id:"secret"},(0,r.kt)("inlineCode",{parentName:"h3"},"secret")),(0,r.kt)("p",null,"The secret used to sign the generated actor trial tokens."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"This value should be changed for any application in production")),(0,r.kt)("p",null,"Can be specified as:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},"--secret=rosebud"),","),(0,r.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},"COGMENT_WEB_PROXY_SECRET=rosebud"),","),(0,r.kt)("li",{parentName:"ul"},"its default value is ",(0,r.kt)("inlineCode",{parentName:"li"},"web_proxy_secret"),".")),(0,r.kt)("h3",{id:"log_level"},(0,r.kt)("inlineCode",{parentName:"h3"},"log_level")),(0,r.kt)("p",null,"Set to define the minimum level for logging. Possible values are: ",(0,r.kt)("inlineCode",{parentName:"p"},"off"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"error"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"warning"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"info"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"debug"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"trace"),". Note however that all trace and most debug level logs will only output if running the debug compiled version of the Orchestrator."),(0,r.kt)("p",null,"Can be specified as:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},"--log_level=debug"),","),(0,r.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},"COGMENT_LOG_LEVEL=5"),","),(0,r.kt)("li",{parentName:"ul"},"default value is info.")),(0,r.kt)("h3",{id:"log_file"},(0,r.kt)("inlineCode",{parentName:"h3"},"log_file")),(0,r.kt)("p",null,"Base file name for daily log output. The name will be suffixed with the date and a new file will be made every day. If not provided the logs go to stdout."),(0,r.kt)("p",null,"Can be specified as:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},"--log_file=./path/to/cogment.log"),","),(0,r.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},"COGMENT_LOG_FILE=./path/to/cogment.log"),","),(0,r.kt)("li",{parentName:"ul"},"default value is info.")),(0,r.kt)("h3",{id:"directory_endpoint"},(0,r.kt)("inlineCode",{parentName:"h3"},"directory_endpoint")),(0,r.kt)("p",null,"Cogment endpoint of the directory service. It must be a ",(0,r.kt)("a",{parentName:"p",href:"/docs/reference/parameters#grpc-scheme"},"gRPC endpoint"),". The directory will be used to register the web proxy actor service for discovery by other services and to access the orchestrator. If not provided, the web proxy will not auto register, in which case manual registration to the directory must be done, or an explicit address must be provided to access the web proxy."),(0,r.kt)("p",null,"Can be specified as:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},"--directory_endpoint=grpc://foo:9005"),","),(0,r.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005"),","),(0,r.kt)("li",{parentName:"ul"},"it has no default value.")),(0,r.kt)("h3",{id:"directory_authentication_token"},(0,r.kt)("inlineCode",{parentName:"h3"},"directory_authentication_token")),(0,r.kt)("p",null,"Authentication token for services registered in the Directory. It is recorded in the Directory when registering a service. And a matching token must be provided to inquire for the service. An empty token is the same as no token."),(0,r.kt)("p",null,"Can be specified as:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},"--directory_authentication_token=GH670ploT"),","),(0,r.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},"COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT"),","),(0,r.kt)("li",{parentName:"ul"},"it has no default value.")),(0,r.kt)("h3",{id:"directory_registration_host"},(0,r.kt)("inlineCode",{parentName:"h3"},"directory_registration_host")),(0,r.kt)("p",null,"This is the host that will be registered to the Directory for the web proxy service. If not provided, the web proxy will determine its own IP address and use that as the registration host."),(0,r.kt)("p",null,"In some circumstances, the IP address determined by Cogment may be wrong (e.g. multiple interfaces, load balancing, firewall), thus a host (hostname or IP address) must be explicitly provided."),(0,r.kt)("p",null,"Can be specified as:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},"--directory_registration_host=foo.bar"),","),(0,r.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},"COGMENT_MODEL_REGISTRY_DIRECTORY_REGISTRATION_HOST=foo.bar"),","),(0,r.kt)("li",{parentName:"ul"},"it has no default value (i.e. self determined IP address is used).")),(0,r.kt)("h3",{id:"directory_registration_properties"},(0,r.kt)("inlineCode",{parentName:"h3"},"directory_registration_properties")),(0,r.kt)("p",null,'These are the properties that will be registered to the Directory for the web proxy service. When inquiring the Directory, the properties inquired must match the properties registered. This is a string representing multiple properties in the form "name=value,name=value,name=value" where the values are optional.'),(0,r.kt)("p",null,"Can be specified as:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"a command line option, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},'--directory_registration_properties="Sim=20,hpp,mem=HIGH"'),","),(0,r.kt)("li",{parentName:"ul"},"an environment variable, e.g. ",(0,r.kt)("inlineCode",{parentName:"li"},'COGMENT_MODEL_REGISTRY_DIRECTORY_REGISTRATION_PROPERTIES="Sim=20,hpp,mem=HIGH"'),","),(0,r.kt)("li",{parentName:"ul"},"it has no default value.")))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/d04964af.19d5aef9.js b/assets/js/d04964af.19d5aef9.js new file mode 100644 index 0000000..db84dca --- /dev/null +++ b/assets/js/d04964af.19d5aef9.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[5893],{3905:(e,t,a)=>{a.d(t,{Zo:()=>p,kt:()=>h});var n=a(7294);function i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function r(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function l(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?r(Object(a),!0).forEach((function(t){i(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):r(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function o(e,t){if(null==e)return{};var a,n,i=function(e,t){if(null==e)return{};var a,n,i={},r=Object.keys(e);for(n=0;n<r.length;n++)a=r[n],t.indexOf(a)>=0||(i[a]=e[a]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var s=n.createContext({}),d=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},p=function(e){var t=d(e.components);return n.createElement(s.Provider,{value:t},e.children)},m="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},c=n.forwardRef((function(e,t){var a=e.components,i=e.mdxType,r=e.originalType,s=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),m=d(a),c=i,h=m["".concat(s,".").concat(c)]||m[c]||u[c]||r;return a?n.createElement(h,l(l({ref:t},p),{},{components:a})):n.createElement(h,l({ref:t},p))}));function h(e,t){var a=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var r=a.length,l=new Array(r);l[0]=c;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[m]="string"==typeof e?e:i,l[1]=o;for(var d=2;d<r;d++)l[d]=a[d];return n.createElement.apply(null,l)}return n.createElement.apply(null,a)}c.displayName="MDXCreateElement"},6111:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>u,frontMatter:()=>r,metadata:()=>o,toc:()=>d});var n=a(7462),i=(a(7294),a(3905));const r={sidebar_position:8},l="gRPC API",o={unversionedId:"reference/grpc",id:"reference/grpc",title:"gRPC API",description:"The low-level cogment communication API is implemented using gRPC services.",source:"@site/docs/reference/grpc.md",sourceDirName:"reference",slug:"/reference/grpc",permalink:"/docs/reference/grpc",draft:!1,tags:[],version:"current",lastUpdatedAt:1701726431,formattedLastUpdatedAt:"Dec 4, 2023",sidebarPosition:8,frontMatter:{sidebar_position:8},sidebar:"docSidebar",previous:{title:"Runner",permalink:"/docs/reference/python-enterprise/runner"},next:{title:"Cogment 2.0",permalink:"/docs/reference/cogment-v2-changes"}},s={},d=[{value:"General",id:"general",level:2},{value:"Limitations",id:"limitations",level:3},{value:"Common types",id:"common-types",level:2},{value:"Common Values",id:"common-values",level:3},{value:"<code>VersionRequest</code>",id:"versionrequest",level:3},{value:"<code>VersionInfo</code>",id:"versioninfo",level:3},{value:"<code>StatusRequest</code>",id:"statusrequest",level:3},{value:"<code>StatusReply</code>",id:"statusreply",level:3},{value:"<code>TrialParams</code>",id:"trialparams",level:3},{value:"<code>DatalogParams</code>",id:"datalogparams",level:3},{value:"<code>EnvironmentParams</code>",id:"environmentparams",level:3},{value:"<code>ActorParams</code>",id:"actorparams",level:3},{value:"<code>SerializedMessage</code>",id:"serializedmessage",level:3},{value:"<code>TrialActor</code>",id:"trialactor",level:3},{value:"<code>Observation</code>",id:"observation",level:3},{value:"<code>Action</code>",id:"action",level:3},{value:"<code>Message</code>",id:"message",level:3},{value:"<code>RewardSource</code>",id:"rewardsource",level:3},{value:"<code>Reward</code>",id:"reward",level:3},{value:"<code>ObservationSet</code>",id:"observationset",level:3},{value:"<code>ActionSet</code>",id:"actionset",level:3},{value:"<code>TrialState</code>",id:"trialstate",level:3},{value:"<code>CommunicationState</code>",id:"communicationstate",level:3},{value:"Control API",id:"control-api",level:2},{value:"Service <code>TrialLifecycleSP</code>",id:"service-triallifecyclesp",level:3},{value:"<code>StartTrial()</code>",id:"starttrial",level:4},{value:"<code>TerminateTrial()</code>",id:"terminatetrial",level:4},{value:"<code>GetTrialInfo()</code>",id:"gettrialinfo",level:4},{value:"<code>WatchTrials()</code>",id:"watchtrials",level:4},{value:"<code>Version()</code>",id:"version",level:4},{value:"<code>TrialStartRequest</code>",id:"trialstartrequest",level:3},{value:"<code>TrialStartReply</code>",id:"trialstartreply",level:3},{value:"<code>TerminateTrialRequest</code>",id:"terminatetrialrequest",level:3},{value:"<code>TerminateTrialReply</code>",id:"terminatetrialreply",level:3},{value:"<code>TrialInfoRequest</code>",id:"trialinforequest",level:3},{value:"<code>TrialInfoReply</code>",id:"trialinforeply",level:3},{value:"<code>TrialInfo</code>",id:"trialinfo",level:3},{value:"<code>TrialListRequest</code>",id:"triallistrequest",level:3},{value:"<code>TrialListEntry</code>",id:"triallistentry",level:3},{value:"Actor API",id:"actor-api",level:2},{value:"Service Actor API",id:"service-actor-api",level:3},{value:"Service <code>ServiceActorSP</code>",id:"service-serviceactorsp",level:4},{value:"Client Actor API",id:"client-actor-api",level:3},{value:"Service <code>ClientActorSP</code>",id:"service-clientactorsp",level:4},{value:"<code>RunTrial()</code>",id:"runtrial",level:3},{value:"<code>Version()</code>",id:"version-1",level:3},{value:"<code>ActorRunTrialInput</code>",id:"actorruntrialinput",level:3},{value:"<code>ActorRunTrialOutput</code>",id:"actorruntrialoutput",level:3},{value:"<code>ActorInitialInput</code>",id:"actorinitialinput",level:3},{value:"<code>ActorInitialOutput</code>",id:"actorinitialoutput",level:3},{value:"Environment API",id:"environment-api",level:2},{value:"Service <code>EnvironmentSP</code>",id:"service-environmentsp",level:3},{value:"<code>RunTrial()</code>",id:"runtrial-1",level:4},{value:"<code>Version()</code>",id:"version-2",level:4},{value:"<code>EnvrRunTrialInput</code>",id:"envrruntrialinput",level:3},{value:"<code>EnvRunTrialOutput</code>",id:"envruntrialoutput",level:3},{value:"<code>EnvInitialInput</code>",id:"envinitialinput",level:3},{value:"<code>EnvInitialOutput</code>",id:"envinitialoutput",level:3},{value:"Data/Log API",id:"datalog-api",level:2},{value:"Service <code>LogExporterSP</code>",id:"service-logexportersp",level:3},{value:"<code>RunTrialDatalog()</code>",id:"runtrialdatalog",level:4},{value:"<code>Version()</code>",id:"version-3",level:4},{value:"<code>LogExporterSampleRequest</code>",id:"logexportersamplerequest",level:3},{value:"<code>LogExporterSampleReply</code>",id:"logexportersamplereply",level:3},{value:"Hook API",id:"hook-api",level:2},{value:"Service <code>TrialHooksSP</code>",id:"service-trialhookssp",level:3},{value:"<code>OnPreTrial()</code>",id:"onpretrial",level:4},{value:"<code>Version()</code>",id:"version-4",level:4},{value:"Directory API",id:"directory-api",level:2},{value:"Service <code>DirectorySP</code>",id:"service-directorysp",level:3},{value:"<code>Register()</code>",id:"register",level:4},{value:"<code>Deregister()</code>",id:"deregister",level:4},{value:"<code>Inquire()</code>",id:"inquire",level:4},{value:"<code>Version()</code>",id:"version-5",level:4},{value:"<code>ServiceType</code>",id:"servicetype",level:3},{value:"<code>ServiceDetails</code>",id:"servicedetails",level:3},{value:"<code>ServiceEndpoint</code>",id:"serviceendpoint",level:3},{value:"<code>RegisterRequest</code>",id:"registerrequest",level:3},{value:"<code>RegisterReply</code>",id:"registerreply",level:3},{value:"<code>DeregisterRequest</code>",id:"deregisterrequest",level:3},{value:"<code>DeregisterReply</code>",id:"deregisterreply",level:3},{value:"<code>InquireRequest</code>",id:"inquirerequest",level:3},{value:"<code>InquireReply</code>",id:"inquirereply",level:3},{value:"Model Registry API",id:"model-registry-api",level:2},{value:"Service <code>ModelRegistrySP</code>",id:"service-modelregistrysp",level:3},{value:"<code>CreateOrUpdateModel()</code>",id:"createorupdatemodel",level:4},{value:"<code>DeleteModel()</code>",id:"deletemodel",level:4},{value:"<code>RetrieveModels()</code>",id:"retrievemodels",level:4},{value:"<code>CreateVersion()</code>",id:"createversion",level:4},{value:"<code>RetrieveVersionInfos()</code>",id:"retrieveversioninfos",level:4},{value:"<code>RetrieveVersionData()</code>",id:"retrieveversiondata",level:4},{value:"<code>CreateOrUpdateModelRequest</code>",id:"createorupdatemodelrequest",level:3},{value:"<code>CreateOrUpdateModelReply</code>",id:"createorupdatemodelreply",level:3},{value:"<code>DeleteModelRequest</code>",id:"deletemodelrequest",level:3},{value:"<code>DeleteModelReply</code>",id:"deletemodelreply",level:3},{value:"<code>RetrieveModelsRequest</code>",id:"retrievemodelsrequest",level:3},{value:"<code>RetrieveModelsReply</code>",id:"retrievemodelsreply",level:3},{value:"<code>CreateVersionRequestChunk</code>",id:"createversionrequestchunk",level:3},{value:"<code>CreateVersionReply</code>",id:"createversionreply",level:3},{value:"<code>RetrieveVersionInfosRequest</code>",id:"retrieveversioninfosrequest",level:3},{value:"<code>RetrieveVersionInfosReply</code>",id:"retrieveversioninfosreply",level:3},{value:"<code>RetrieveVersionDataRequest</code>",id:"retrieveversiondatarequest",level:3},{value:"<code>RetrieveVersionDataReplyChunk</code>",id:"retrieveversiondatareplychunk",level:3},{value:"<code>ModelInfo</code>",id:"modelinfo",level:3},{value:"<code>ModelVersionInfo</code>",id:"modelversioninfo",level:3},{value:"<code>Version()</code>",id:"version-6",level:4},{value:"Trial Datastore API",id:"trial-datastore-api",level:2},{value:"Service <code>TrialDatastoreSP</code>",id:"service-trialdatastoresp",level:3},{value:"<code>RetrieveTrials()</code>",id:"retrievetrials",level:4},{value:"<code>RetrieveSamples()</code>",id:"retrievesamples",level:4},{value:"<code>AddTrial()</code>",id:"addtrial",level:4},{value:"<code>AddSample()</code>",id:"addsample",level:4},{value:"<code>DeleteTrials()</code>",id:"deletetrials",level:4},{value:"<code>StoredTrialInfo</code>",id:"storedtrialinfo",level:3},{value:"<code>StoredTrialSample</code>",id:"storedtrialsample",level:3},{value:"<code>StoredTrialActorSample</code>",id:"storedtrialactorsample",level:3},{value:"<code>StoredTrialActorSampleReward</code>",id:"storedtrialactorsamplereward",level:3},{value:"<code>StoredTrialActorSampleMessage</code>",id:"storedtrialactorsamplemessage",level:3},{value:"<code>StoredTrialSampleField</code>",id:"storedtrialsamplefield",level:3},{value:"<code>RetrieveTrialsRequest</code>",id:"retrievetrialsrequest",level:3},{value:"<code>RetrieveTrialsReply</code>",id:"retrievetrialsreply",level:3},{value:"<code>RetrieveSamplesRequest</code>",id:"retrievesamplesrequest",level:3},{value:"<code>RetrieveSampleReply</code>",id:"retrievesamplereply",level:3},{value:"<code>AddTrialRequest</code>",id:"addtrialrequest",level:3},{value:"<code>AddTrialReply</code>",id:"addtrialreply",level:3},{value:"<code>AddSampleRequest</code>",id:"addsamplerequest",level:3},{value:"<code>AddSamplesReply</code>",id:"addsamplesreply",level:3},{value:"<code>DeleteTrialsRequest</code>",id:"deletetrialsrequest",level:3},{value:"<code>DeleteTrialsReply</code>",id:"deletetrialsreply",level:3},{value:"<code>TrialSamplesFileHeader</code>",id:"trialsamplesfileheader",level:3},{value:"<code>Version()</code>",id:"version-7",level:4}],p={toc:d},m="wrapper";function u(e){let{components:t,...a}=e;return(0,i.kt)(m,(0,n.Z)({},p,a,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"grpc-api"},"gRPC API"),(0,i.kt)("p",null,"The low-level cogment communication API is implemented using ",(0,i.kt)("a",{parentName:"p",href:"https://grpc.github.io/"},"gRPC")," services.\nThese services are collections of procedures to be called remotely (RPC).\ngRPC abstracts the network communication with familiar looking functions (representing the defined procedures), in any number of programming languages.\nHow services are implemented or accessed is highly dependant on the programming language being interfaced, and is beyond the scope of this document (see gRPC API documentation)."),(0,i.kt)("p",null,"This reference requires a basic understanding of gRPC, and in particular the format of the ",(0,i.kt)("inlineCode",{parentName:"p"},"*.proto")," files."),(0,i.kt)("admonition",{type:"info"},(0,i.kt)("p",{parentName:"admonition"},"Cogment's gRPC API is defined and released alongside the ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cli/"},"Cogment CLI"),", the latest version can be accessed at ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment/tree/main/packages/grpc_api"},"https://github.com/cogment/cogment/tree/main/packages/grpc_api"),".")),(0,i.kt)("h2",{id:"general"},"General"),(0,i.kt)("p",null,"In this API, the ",(0,i.kt)("inlineCode",{parentName:"p"},"bytes")," data type is normally used to contain the serialized data of externally defined messages. These messages are well defined in the trial specifications file."),(0,i.kt)("p",null,"On the other hand, the ",(0,i.kt)("inlineCode",{parentName:"p"},"google.protobuf.Any")," data type is normally used to contain messages that are not pre-defined (thus unknown by the framework), and may be decided at runtime. It is then the responsibility of the receiver to deserialize in the correct message type."),(0,i.kt)("p",null,"Empty messages are normally used as a placeholder for easy future, backward compatible, extension to the API."),(0,i.kt)("p",null,"In this API, ",(0,i.kt)("a",{parentName:"p",href:"https://grpc.io/docs/what-is-grpc/core-concepts/#metadata"},"gRPC metadata")," is normally used only for service request (by the caller) for identifying purposes. The details of the required metadata are described with the service calls. Service replies (the callees) are not expected to provide metadata."),(0,i.kt)("p",null,"In some places in the API, we use a list of actor data without information about which actor is where in the list.\nThese lists have a constant length and order throughout a trial (set in the trial parameters), and thus can/must be cross referenced with other such lists within the same trial (e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"actors_in_trial"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"actors_map"),").\nThe actor can be inferred by the position in the list, and the index into the list can sometimes be used to identify an actor."),(0,i.kt)("p",null,'gRPC service names in Cogment are suffixed with "SP" (Service Point).'),(0,i.kt)("h3",{id:"limitations"},"Limitations"),(0,i.kt)("p",null,"Due to normal network delays and unpredictability of the various components, there are limitations related to the communication with the Orchestrator that translate in issues that can arise."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},'In the current version, to simplify the implementation, there is an expectation of "good behavior" from the various components:',(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Actors are expected to respond with an action only after receiving an observation, and to send only one action per observation received."),(0,i.kt)("li",{parentName:"ul"},"The environment is expected to respond with an observation set only after receiving an action set, and to send only one observation set per action set received (and one initial observation set)."),(0,i.kt)("li",{parentName:"ul"},"All components are expected to respond within a reasonable amount of time."),(0,i.kt)("li",{parentName:"ul"},"Hooks do not assume to receive specific parameters, they reply only with well formed parameters, and they do not assume a specific order of hooks being called (when multiple hooks are defined)."),(0,i.kt)("li",{parentName:"ul"},"A ",(0,i.kt)("inlineCode",{parentName:"li"},"TerminateTrial")," (from the Control API) is called only a reasonable delay after a ",(0,i.kt)("inlineCode",{parentName:"li"},"StartTrial")," (e.g. after at least two ticks have executed)."),(0,i.kt)("li",{parentName:"ul"},'Note that what constitutes a "reasonable" amount of time is dependent on many variables.')))),(0,i.kt)("h2",{id:"common-types"},"Common types"),(0,i.kt)("p",null,"Most of the common messages are defined in the ",(0,i.kt)("inlineCode",{parentName:"p"},"common.proto")," file. ",(0,i.kt)("inlineCode",{parentName:"p"},"ObservationSet")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"ActionSet")," are defined in ",(0,i.kt)("inlineCode",{parentName:"p"},"environment.proto"),"."),(0,i.kt)("h3",{id:"common-values"},"Common Values"),(0,i.kt)("p",null,"Some values (and their standardized names) are recurrent throughout the gRPC API."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"tick_id: (uint64/sint64) The monotonic time, in number of steps, since the start of the trial. As an ID, it represents a discrete step in the processing of the trial. A step starts with observations representing a specific point in time, that are followed by actions, rewards and messages in relation to these observations. The first tick ID is 0. Some of these values may accept -1, meaning the latest step (e.g. when sending an action)."),(0,i.kt)("li",{parentName:"ul"},"timestamp: (fixed64) The wall-clock time in nanoseconds since 00:00:00UTC January 1, 1970 (Unix Epoch time)."),(0,i.kt)("li",{parentName:"ul"},"trial_id: (string) The identifier (name) of the trial.")),(0,i.kt)("h3",{id:"versionrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"VersionRequest")),(0,i.kt)("p",null,"Empty message to serve as the request for the ",(0,i.kt)("inlineCode",{parentName:"p"},"Version")," procedure (present in all gRPC services defined in the Cogment API)."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message VersionRequest {}\n")),(0,i.kt)("h3",{id:"versioninfo"},(0,i.kt)("inlineCode",{parentName:"h3"},"VersionInfo")),(0,i.kt)("p",null,"Reply message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"Version"),' procedure (present in all gRPC services defined in the API).\nIt contains a list of version information.\nThe Cogment framework expects at least "cogment-api" and "grpc" versions to be present in the list. The "cogment-api" is for the local version of the Cogment API used by the service. The "grpc" is for the version of gRPC used by the service.\nOther reported versions are specific to the service called, possibly for use by utility and management tools.'),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message Version {\n string name = 1;\n string version = 2;\n}\n\nmessage VersionInfo {\n repeated Version versions = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"versions: List of version information."),(0,i.kt)("li",{parentName:"ul"},'name: The name/software/module for which the version is given. E.g. "cogment-api".'),(0,i.kt)("li",{parentName:"ul"},'version: The version related to the name. E.g. "1.0.0b5".')),(0,i.kt)("h3",{id:"statusrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"StatusRequest")),(0,i.kt)("p",null,"Request message for ",(0,i.kt)("inlineCode",{parentName:"p"},"Status"),' procedure (present in all gRPC services defined in the Cogment API).\nIt contains the list of states and statuses (hereafter referred as "statuses") to request from the service.'),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message StatusRequest {\n repeated string names = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"names: The names of the statuses to request. If a name does not exist, it is ignored (i.e. it does not cause an error).")),(0,i.kt)("p",null,"If no names are requested, the reply will be empty.\nThis can be used as a health/communication check for the service."),(0,i.kt)("p",null,'The "',"*",'" name is always defined. It is not really a status in itself, but requests all ',(0,i.kt)("em",{parentName:"p"},"standard")," statuses.\nWhat it means for a status to be standard depends on the service.\nNon-standard statuses need to be requested explicitly."),(0,i.kt)("p",null,"Names that are usually defined:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},'"overall_load": A representation of the load on the machine where the service is running. A specific meaning is associated with this status by the Cogment Directory ',(0,i.kt)("a",{parentName:"li",href:"/docs/reference/cli/directory/directory-server#load-balancing"},"Load Balancing")," mechanism.")),(0,i.kt)("h3",{id:"statusreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"StatusReply")),(0,i.kt)("p",null,"Reply message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"Status")," procedure (present in all gRPC services defined in the API).\nIt contains the list of requested (and available) statuses.\nReported statuses are specific to the service called (or the machine/system/network it is running on)."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message StatusReply {\n map<string, string> statuses = 1; // <name, value>\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"statuses: Requested statuses (name/value) that are available, in no particular order.")),(0,i.kt)("h3",{id:"trialparams"},(0,i.kt)("inlineCode",{parentName:"h3"},"TrialParams")),(0,i.kt)("p",null,"Global parameters for a trial (see ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#trial-parameters"},"Trial Parameters"),")."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TrialParams {\n SerializedMessage trial_config = 1;\n DatalogParams datalog = 2;\n EnvironmentParams environment = 3;\n repeated ActorParams actors = 4;\n uint32 max_steps = 5;\n uint32 max_inactivity = 6;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"trial_config"),(0,i.kt)("li",{parentName:"ul"},"datalog: (optional) The parameters for the datalog of the trial. If not present, data logging is disabled."),(0,i.kt)("li",{parentName:"ul"},"environment: The parameters for the environment of the trial."),(0,i.kt)("li",{parentName:"ul"},"actors: The parameters for all actors involved in the trial. This list's length and order define the length and order of the lists of actors provided in different places in the API (e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"actors_in_trial"),") for the trial."),(0,i.kt)("li",{parentName:"ul"},"max_steps"),(0,i.kt)("li",{parentName:"ul"},"max_inactivity")),(0,i.kt)("h3",{id:"datalogparams"},(0,i.kt)("inlineCode",{parentName:"h3"},"DatalogParams")),(0,i.kt)("p",null,"Parameters related to the data logger (see ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#trial-parameters"},"Trial Parameters"),")."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message DatalogParams {\n string endpoint = 1;\n repeated string exclude_fields = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"endpoint: This is used by the Orchestrator to connect to the datalog using the ",(0,i.kt)("inlineCode",{parentName:"li"},"LogExporterSP")," gRPC service."),(0,i.kt)("li",{parentName:"ul"},"exclude_fields")),(0,i.kt)("h3",{id:"environmentparams"},(0,i.kt)("inlineCode",{parentName:"h3"},"EnvironmentParams")),(0,i.kt)("p",null,"Parameters related to an environment (see ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#trial-parameters"},"Trial Parameters"),")."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message EnvironmentParams {\n string endpoint = 1;\n SerializedMessage config = 2;\n string implementation = 3;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"endpoint: This is used by the Orchestrator to connect to the environment using the ",(0,i.kt)("inlineCode",{parentName:"li"},"EnvironmentSP")," gRPC service."),(0,i.kt)("li",{parentName:"ul"},"config"),(0,i.kt)("li",{parentName:"ul"},"implementation")),(0,i.kt)("h3",{id:"actorparams"},(0,i.kt)("inlineCode",{parentName:"h3"},"ActorParams")),(0,i.kt)("p",null,"Parameters related to an actor (see ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#trial-parameters"},"Trial Parameters"),")."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message ActorParams {\n string name = 1;\n string actor_class = 2;\n string endpoint = 3;\n string implementation = 4;\n SerializedMessage config = 5;\n float initial_connection_timeout = 6;\n float response_timeout = 7;\n bool optional = 8;\n SerializedMessage default_action = 9;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"name"),(0,i.kt)("li",{parentName:"ul"},"actor_class"),(0,i.kt)("li",{parentName:"ul"},"endpoint: The endpoint is used by the Orchestrator to connect to the actor using the ",(0,i.kt)("inlineCode",{parentName:"li"},"ServiceActorSP"),' gRPC service. If set to "cogment://client", then the actor is a client and will connect to the Orchestrator instead, using the ',(0,i.kt)("inlineCode",{parentName:"li"},"ClientActorSP")," gRPC service."),(0,i.kt)("li",{parentName:"ul"},"implementation"),(0,i.kt)("li",{parentName:"ul"},"config"),(0,i.kt)("li",{parentName:"ul"},"initial_connection_timeout"),(0,i.kt)("li",{parentName:"ul"},"response_timeout"),(0,i.kt)("li",{parentName:"ul"},"optional"),(0,i.kt)("li",{parentName:"ul"},"default_action")),(0,i.kt)("h3",{id:"serializedmessage"},(0,i.kt)("inlineCode",{parentName:"h3"},"SerializedMessage")),(0,i.kt)("p",null,"This contains an optional serialized protobuf message (e.g. config) defined by the user in the spec file. The bytes content is wrapped in a message to be able to differentiate between a default content (i.e. length 0) and the absence of content. This is easily done by testing for the presence of the message."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message SerializedMessage {\n bytes content = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"content: A serialized protobuf message. E.g. for configs of a particular trial, the actual message type is defined in the spec file in its respective section: ",(0,i.kt)("inlineCode",{parentName:"li"},"trial:config_type"),", ",(0,i.kt)("inlineCode",{parentName:"li"},"environment:config_type"),", and ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes:config_type"),".")),(0,i.kt)("h3",{id:"trialactor"},(0,i.kt)("inlineCode",{parentName:"h3"},"TrialActor")),(0,i.kt)("p",null,"Details of an actor participating in a trial."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TrialActor {\n string name = 1;\n string actor_class = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"name: The name of the actor."),(0,i.kt)("li",{parentName:"ul"},"actor_class: The name of the class of actor. For a particular trial, the possible actor classes are defined in the the spec file in the ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes:name")," sections.")),(0,i.kt)("h3",{id:"observation"},(0,i.kt)("inlineCode",{parentName:"h3"},"Observation")),(0,i.kt)("p",null,"A singular observation."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message Observation {\n uint64 tick_id = 1;\n fixed64 timestamp = 2;\n bytes content = 3;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"tick_id: Tick of this observation."),(0,i.kt)("li",{parentName:"ul"},"timestamp: The time of the observation."),(0,i.kt)("li",{parentName:"ul"},"content: The serialized protobuf message representing an observation for a specific actor. In a particular trial, the actual message type for the observation space is defined in the spec file for each actor class in section ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes:observation:space"),". Note that the specific actor represented is defined by the enclosing message.")),(0,i.kt)("h3",{id:"action"},(0,i.kt)("inlineCode",{parentName:"h3"},"Action")),(0,i.kt)("p",null,"Data associated with an actor's action."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message Action {\n uint64 tick_id = 1;\n fixed64 timestamp = 2;\n bytes content = 3;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"tick_id: The tick of the observation on which the action is taken."),(0,i.kt)("li",{parentName:"ul"},"timestamp: The time of the action."),(0,i.kt)("li",{parentName:"ul"},"content: The serialized protobuf message representing an action from a specific actor. In a particular trial, the actual message type for the action space is defined in the spec file for each actor class in section ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes:action:space"),". Note that the specific actor represented is defined by the enclosing message.")),(0,i.kt)("h3",{id:"message"},(0,i.kt)("inlineCode",{parentName:"h3"},"Message")),(0,i.kt)("p",null,"Data associated with a communication (message) destined for an actor or the environment."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message Message {\n sint64 tick_id = 1;\n string sender_name = 2;\n string receiver_name = 3;\n google.protobuf.Any payload = 4;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"tick_id: Tick associated with the message."),(0,i.kt)("li",{parentName:"ul"},"sender_name: The name of the sending actor/environment. This is optional when sending messages (i.e. the sender is already known)."),(0,i.kt)("li",{parentName:"ul"},"receiver_name: The name of the target/receiving actor/environment."),(0,i.kt)("li",{parentName:"ul"},"payload: Data for the target actor/environment. It is the responsibility of the target to understand the type received.")),(0,i.kt)("h3",{id:"rewardsource"},(0,i.kt)("inlineCode",{parentName:"h3"},"RewardSource")),(0,i.kt)("p",null,"Data representing a simple reward source made by a single component/sender, usually for the purpose of training automated agents."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RewardSource {\n string sender_name = 1;\n float value = 2;\n float confidence = 3;\n google.protobuf.Any user_data = 4;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"sender_name: Name of the sender that sent the reward. This is not needed when sending because it will be set by the orchestrator. It is only used by receiving actors."),(0,i.kt)("li",{parentName:"ul"},"value: The numerical value of the provided reward."),(0,i.kt)("li",{parentName:"ul"},"confidence: The weight of this reward in computing the final (aggregated) reward."),(0,i.kt)("li",{parentName:"ul"},"user_data: Additional user data to be consumed by the receiving actor. It is the responsibility of the receiver to understand the type received.")),(0,i.kt)("h3",{id:"reward"},(0,i.kt)("inlineCode",{parentName:"h3"},"Reward")),(0,i.kt)("p",null,"Data representing a reward sent or received, usually for the purpose of training automated agents.\nThis is an aggregate of possibly multiple ",(0,i.kt)("inlineCode",{parentName:"p"},"RewardSource")," (but at least one)."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message Reward {\n sint64 tick_id = 1;\n string receiver_name = 2;\n float value = 3;\n repeated RewardSource sources = 4;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"tick_id: The tick associated with the reward. If set to ",(0,i.kt)("inlineCode",{parentName:"li"},"-1")," when sending a reward, the orchestrator will automatically assign the latest tick. This will always be a valid tick (i.e. >= 0) when receiving a reward."),(0,i.kt)("li",{parentName:"ul"},"receiver_name: Name of the receiving actor (the reward destination)."),(0,i.kt)("li",{parentName:"ul"},"value: The aggregated value (weighted sum) of the provided reward sources. May be ignored when sending a reward; The final value will be computed by the orchestrator."),(0,i.kt)("li",{parentName:"ul"},"sources: The simple reward sources that form this aggregated reward. There must be at least one.")),(0,i.kt)("h3",{id:"observationset"},(0,i.kt)("inlineCode",{parentName:"h3"},"ObservationSet")),(0,i.kt)("p",null,"A set of environment observations for all actors in the trial."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message ObservationSet {\n uint64 tick_id = 1;\n fixed64 timestamp = 2;\n repeated bytes observations = 3;\n repeated int32 actors_map = 4;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"tick_id: The tick to which the observations relate to."),(0,i.kt)("li",{parentName:"ul"},"timestamp: The time when the observation set was made."),(0,i.kt)("li",{parentName:"ul"},"observations: A list of observations. Indexed into by the ",(0,i.kt)("inlineCode",{parentName:"li"},"actors_map"),". Each ",(0,i.kt)("inlineCode",{parentName:"li"},"bytes")," chunk is a serialized protobuf message representing an observation for a specific actor class. For a particular trial, the actual message type for the observation space is defined in the spec file for each actor class in section ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes:observation:space"),". Note that the specific actor represented is defined by the ",(0,i.kt)("inlineCode",{parentName:"li"},"actors_map"),"."),(0,i.kt)("li",{parentName:"ul"},"actors_map: A list of indexes into the ",(0,i.kt)("inlineCode",{parentName:"li"},"observations")," list above. This list of indexes has the same length and order as the list of actors provided in different places in the API (e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"actors_in_trial"),"), for the same trial.")),(0,i.kt)("h3",{id:"actionset"},(0,i.kt)("inlineCode",{parentName:"h3"},"ActionSet")),(0,i.kt)("p",null,"A set of actions from all actors in the trial."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message ActionSet {\n uint64 tick_id = 1;\n fixed64 timestamp = 2;\n repeated bytes actions = 3;\n repeated uint32 unavailable_actors = 4;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"tick_id: The tick to which the actions relate to."),(0,i.kt)("li",{parentName:"ul"},"timestamp: The time when the action set was made (usually after the last action arrived at the Orchestrator)."),(0,i.kt)("li",{parentName:"ul"},"actions: A list of actions. Each ",(0,i.kt)("inlineCode",{parentName:"li"},"bytes")," chunk is a serialized protobuf message representing an action from a specific actor. For an particular trial, the actual message type for the action space is defined in the spec file for each actor class in section ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes:action:space"),". This list has the same length and order as the list of actors provided in different places in the API (e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"actors_in_trial"),"), for the same trial."),(0,i.kt)("li",{parentName:"ul"},"unavailable_actors: List of actors (index of actors) that were not available. Actors in this list have invalid data in the ",(0,i.kt)("inlineCode",{parentName:"li"},"actions")," list.")),(0,i.kt)("h3",{id:"trialstate"},(0,i.kt)("inlineCode",{parentName:"h3"},"TrialState")),(0,i.kt)("p",null,"Enum representing the state of a trial."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"enum TrialState {\n UNKNOWN = 0;\n INITIALIZING = 1;\n PENDING = 2;\n RUNNING = 3;\n TERMINATING = 4;\n ENDED = 5;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"UNKNOWN: Should not be used (it's a requirement of protobuf enums to have a 0 default value)."),(0,i.kt)("li",{parentName:"ul"},"INITIALIZING: The trial is in the process of starting."),(0,i.kt)("li",{parentName:"ul"},"PENDING: The trial is waiting for its final parameters, all its components to be ready, and the first observation."),(0,i.kt)("li",{parentName:"ul"},"RUNNING: The trial is running."),(0,i.kt)("li",{parentName:"ul"},"TERMINATING: The trial is in the process of ending (either a request to end has been received or the last observation has been received)."),(0,i.kt)("li",{parentName:"ul"},"ENDED: The trial has ended. Only a set number of ended trials will be kept in memory (configured in the Orchestrator).")),(0,i.kt)("h3",{id:"communicationstate"},(0,i.kt)("inlineCode",{parentName:"h3"},"CommunicationState")),(0,i.kt)("p",null,"Enum representing the state of communication with the actors and environment."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"enum CommunicationState {\n UNKNOWN_COM_STATE = 0;\n NORMAL = 1;\n HEARTBEAT = 2;\n LAST = 3;\n LAST_ACK = 4;\n END = 5;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"UNKNOWN_COM_STATE: Should not be used (it's a requirement of protobuf enums to have a 0 default value)."),(0,i.kt)("li",{parentName:"ul"},"NORMAL: Normal communication message. Always contains data."),(0,i.kt)("li",{parentName:"ul"},"HEARTBEAT: Heartbeat request/reply message. Contains no data. When received, must be responded in kind."),(0,i.kt)("li",{parentName:"ul"},"LAST: Message indicating that the trial is ending, and ending data is following (as ",(0,i.kt)("inlineCode",{parentName:"li"},"NORMAL"),"). Contains no data."),(0,i.kt)("li",{parentName:"ul"},"LAST_ACK: Message indicating that the last data has been sent (i.e. this is the last outgoing message). Contains no data."),(0,i.kt)("li",{parentName:"ul"},"END: Message indicating that the trial has ended (i.e. this is the final message). Contains no data, except maybe for ",(0,i.kt)("inlineCode",{parentName:"li"},"details"),".")),(0,i.kt)("p",null,"The normal (soft) end of a trial follows this sequence :"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},"Orchestrator or Environment sends ",(0,i.kt)("inlineCode",{parentName:"li"},"LAST")),(0,i.kt)("li",{parentName:"ol"},"Exchange of ",(0,i.kt)("inlineCode",{parentName:"li"},"NORMAL")," finalizing data"),(0,i.kt)("li",{parentName:"ol"},"Component sends ",(0,i.kt)("inlineCode",{parentName:"li"},"LAST_ACK")," (component stops sending after this)"),(0,i.kt)("li",{parentName:"ol"},"Orchestrator sends ",(0,i.kt)("inlineCode",{parentName:"li"},"NORMAL")," finalizing data"),(0,i.kt)("li",{parentName:"ol"},"Orchestrator terminates communication with ",(0,i.kt)("inlineCode",{parentName:"li"},"END"))),(0,i.kt)("p",null,"For a hard termination of a trial, the Orchestrator will send ",(0,i.kt)("inlineCode",{parentName:"p"},"END")," to all components (with no ",(0,i.kt)("inlineCode",{parentName:"p"},"LAST"),"/",(0,i.kt)("inlineCode",{parentName:"p"},"LAST_ACK")," handshake)."),(0,i.kt)("h2",{id:"control-api"},"Control API"),(0,i.kt)("p",null,"This API is defined in ",(0,i.kt)("inlineCode",{parentName:"p"},"orchestrator.proto"),". It is implemented by the cogment orchestrator, and client applications are expected to connect to it using the gRPC client API."),(0,i.kt)("p",null,"This API is used for general control and services related to trials."),(0,i.kt)("h3",{id:"service-triallifecyclesp"},"Service ",(0,i.kt)("inlineCode",{parentName:"h3"},"TrialLifecycleSP")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"service TrialLifecycleSP {\n rpc StartTrial(TrialStartRequest) returns (TrialStartReply) {}\n rpc TerminateTrial(TerminateTrialRequest) returns (TerminateTrialReply) {}\n rpc GetTrialInfo(TrialInfoRequest) returns (TrialInfoReply) {}\n rpc WatchTrials(TrialListRequest) returns (stream TrialListEntry) {}\n rpc Version(VersionRequest) returns (VersionInfo) {}\n}\n")),(0,i.kt)("h4",{id:"starttrial"},(0,i.kt)("inlineCode",{parentName:"h4"},"StartTrial()")),(0,i.kt)("p",null,"Start a new trial."),(0,i.kt)("p",null,"Metadata: None"),(0,i.kt)("h4",{id:"terminatetrial"},(0,i.kt)("inlineCode",{parentName:"h4"},"TerminateTrial()")),(0,i.kt)("p",null,"Request the environment to terminate existing trial(s)."),(0,i.kt)("p",null,"Metadata:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial-id"),": (",(0,i.kt)("em",{parentName:"li"},"one or more"),") Identifier(s) of the trial(s) to terminate.")),(0,i.kt)("h4",{id:"gettrialinfo"},(0,i.kt)("inlineCode",{parentName:"h4"},"GetTrialInfo()")),(0,i.kt)("p",null,"Get extra information about an existing trial."),(0,i.kt)("p",null,"Metadata:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial-id"),": (",(0,i.kt)("em",{parentName:"li"},"zero or more"),") Identifier(s) of the trial(s) we are requesting information about. If no trial id is provided, the request is for information about all active trials.")),(0,i.kt)("h4",{id:"watchtrials"},(0,i.kt)("inlineCode",{parentName:"h4"},"WatchTrials()")),(0,i.kt)("p",null,"Stream state changes from trials."),(0,i.kt)("p",null,"Metadata: None"),(0,i.kt)("h4",{id:"version"},(0,i.kt)("inlineCode",{parentName:"h4"},"Version()")),(0,i.kt)("p",null,"Request version data."),(0,i.kt)("p",null,"Metadata: None"),(0,i.kt)("h3",{id:"trialstartrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"TrialStartRequest")),(0,i.kt)("p",null,"Request message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"StartTrial")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TrialStartRequest {\n oneof start_data {\n SerializedMessage config = 1;\n TrialParams params = 4;\n }\n string user_id = 2;\n string trial_id_requested = 3;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"config: The trial config data. This data can be used by the pre-trial hooks to determine the config for the rest of the components."),(0,i.kt)("li",{parentName:"ul"},"params: The fully defined parameters for the new trial. When this is given to start the trial, the default parameters are ignored, and the pre-trial hooks will not be called."),(0,i.kt)("li",{parentName:"ul"},"user_id: The ID of the user that is starting the trial."),(0,i.kt)("li",{parentName:"ul"},"user_id: The ID of the user that is starting the trial."),(0,i.kt)("li",{parentName:"ul"},"trial_id_requested: The trial identifier requested for the new trial. It must be unique. If not empty, the Orchestrator will try to use this trial_id, otherwise, a UUID will be created.")),(0,i.kt)("h3",{id:"trialstartreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"TrialStartReply")),(0,i.kt)("p",null,"Reply message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"StartTrial")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TrialStartReply {\n string trial_id = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"trial_id: ID of the newly started trial. Empty if the requested trial ID could not be used.")),(0,i.kt)("h3",{id:"terminatetrialrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"TerminateTrialRequest")),(0,i.kt)("p",null,"Request message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"TerminateTrial")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TerminateTrialRequest {}\n")),(0,i.kt)("h3",{id:"terminatetrialreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"TerminateTrialReply")),(0,i.kt)("p",null,"Reply message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"TerminateTrial")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TerminateTrialReply {}\n")),(0,i.kt)("h3",{id:"trialinforequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"TrialInfoRequest")),(0,i.kt)("p",null,"Request message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"GetTrialInfo")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TrialInfoRequest {\n bool get_latest_observation = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"get_latest_observation: If true, request the latest environment observation available for the trial (in addition to standard information).")),(0,i.kt)("h3",{id:"trialinforeply"},(0,i.kt)("inlineCode",{parentName:"h3"},"TrialInfoReply")),(0,i.kt)("p",null,"Reply message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"GetTrialInfo")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TrialInfoReply {\n repeated TrialInfo trial = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"trial: List of information about the trials. Contains only the requested trial info if a trial ID was provided when the call was made (as metadata to the procedure). Otherwise contains information about all active trials.")),(0,i.kt)("h3",{id:"trialinfo"},(0,i.kt)("inlineCode",{parentName:"h3"},"TrialInfo")),(0,i.kt)("p",null,"Message containing information about a trial."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TrialInfo {\n string trial_id = 1;\n string env_name = 2;\n TrialState state = 3;\n uint64 tick_id = 4;\n fixed64 trial_duration = 5;\n ObservationSet latest_observation = 6;\n repeated TrialActor actors_in_trial = 7;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"trial_id: The Identifier of the trial."),(0,i.kt)("li",{parentName:"ul"},"env_name: The name of the environment running the trial."),(0,i.kt)("li",{parentName:"ul"},"state: The state of the trial."),(0,i.kt)("li",{parentName:"ul"},"tick_id: The current tick of the trial."),(0,i.kt)("li",{parentName:"ul"},"trial_duration: The duration of the trial so far, in nanoseconds. If the trial has ended, this is the duration from start to end of the trial. This is meant as an indicator; resolution may not be a nanosecond, and precision is not guaranteed."),(0,i.kt)("li",{parentName:"ul"},"latest_observation: The latest environment observations for all actors. This will be provided only if requested in the ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialInfoRequest"),"."),(0,i.kt)("li",{parentName:"ul"},"actors_in_trial: The list of active actors in the trial.")),(0,i.kt)("h3",{id:"triallistrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"TrialListRequest")),(0,i.kt)("p",null,"Request message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"WatchTrials")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TrialListRequest {\n repeated TrialState filter = 1;\n bool full_info = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"filter: The list of states that are requested. If a trial is not in a state found in this list, it will not be reported. If the list is empty, all states will be reported."),(0,i.kt)("li",{parentName:"ul"},"full_info: If true, full trial information will be returned instead of just trial ID and trial state.")),(0,i.kt)("h3",{id:"triallistentry"},(0,i.kt)("inlineCode",{parentName:"h3"},"TrialListEntry")),(0,i.kt)("p",null,"Stream reply message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"WatchTrials")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TrialListEntry {\n string trial_id = 1;\n TrialState state = 2;\n TrialInfo info = 3;\n}\n\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"trial_id: The Identifier of the trial. Only set if ",(0,i.kt)("inlineCode",{parentName:"li"},"info")," is not present."),(0,i.kt)("li",{parentName:"ul"},"state: The state of the trial. Only set if ",(0,i.kt)("inlineCode",{parentName:"li"},"info")," is not present."),(0,i.kt)("li",{parentName:"ul"},"info: Trial basic information (i.e. without ",(0,i.kt)("inlineCode",{parentName:"li"},"latest_observation")," and ",(0,i.kt)("inlineCode",{parentName:"li"},"actors_in_trials"),"). Present only if requested with ",(0,i.kt)("inlineCode",{parentName:"li"},"full_info")," in the ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialListRequest"),".")),(0,i.kt)("h2",{id:"actor-api"},"Actor API"),(0,i.kt)("p",null,"There are two kinds of actors: Service and Client. They each have their own separate service (respectively ",(0,i.kt)("inlineCode",{parentName:"p"},"ServiceActorSP")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"ClientActorSP"),"). But the messages are identical and work almost the same way (except for the initial phase)."),(0,i.kt)("h3",{id:"service-actor-api"},"Service Actor API"),(0,i.kt)("p",null,"This API is defined in ",(0,i.kt)("inlineCode",{parentName:"p"},"agent.proto"),". It is implemented by the service actor application using the gRPC server API, and the Orchestrator connects to the service actor application using the gRPC client API."),(0,i.kt)("p",null,"This API is used by service actors that will be participating in new trials. They are connected at the start of a trial in which they participate.\nMultiple simultaneous service actors can be served from a single service application instance (i.e. same endpoint).\nAn actor endpoint, for the Orchestrator to connect to, is defined in the ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters"},"trial parameters"),"."),(0,i.kt)("h4",{id:"service-serviceactorsp"},"Service ",(0,i.kt)("inlineCode",{parentName:"h4"},"ServiceActorSP")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"service ServiceActorSP {\n rpc RunTrial(stream ActorRunTrialInput) returns (stream ActorRunTrialOutput) {}\n rpc Version(VersionRequest) returns (VersionInfo) {}\n}\n")),(0,i.kt)("h3",{id:"client-actor-api"},"Client Actor API"),(0,i.kt)("p",null,"This API is defined in ",(0,i.kt)("inlineCode",{parentName:"p"},"orchestrator.proto"),". It is implemented by the Orchestrator using the gRPC server API, and client applications are expected to connect to the Orchestrator using the gRPC client API."),(0,i.kt)("p",null,'This API is used by client actors participating in existing (initializing) trials. The trial expecting client actors will wait for all actors to be connected before starting the trial.\nThe actors connecting this way must have an endpoint set to "cogment://client" in the ',(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters"},"trial parameters"),"."),(0,i.kt)("p",null,"Note the reversal of the input and output messages compared to the service actor ",(0,i.kt)("inlineCode",{parentName:"p"},"RunTrial")," procedure."),(0,i.kt)("h4",{id:"service-clientactorsp"},"Service ",(0,i.kt)("inlineCode",{parentName:"h4"},"ClientActorSP")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"service ClientActorSP {\n rpc RunTrial(stream ActorRunTrialOutput) returns (stream ActorRunTrialInput) {}\n rpc Version(VersionRequest) returns (VersionInfo) {}\n}\n")),(0,i.kt)("h3",{id:"runtrial"},(0,i.kt)("inlineCode",{parentName:"h3"},"RunTrial()")),(0,i.kt)("p",null,"Procedure call to participate in a trial. It is active for the duration of the trial.\nActor actions and data are provided to the Orchestrator in the output message stream, and observations and data are provided by the Orchestrator in the input message stream."),(0,i.kt)("p",null,"Metadata:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial-id"),": Identifier of the trial the actor is participating in. This is supplied to service actors, but must be supplied by client actors.")),(0,i.kt)("h3",{id:"version-1"},(0,i.kt)("inlineCode",{parentName:"h3"},"Version()")),(0,i.kt)("p",null,"Request version data."),(0,i.kt)("p",null,"Metadata: None"),(0,i.kt)("h3",{id:"actorruntrialinput"},(0,i.kt)("inlineCode",{parentName:"h3"},"ActorRunTrialInput")),(0,i.kt)("p",null,"Message received by actors during the streaming ",(0,i.kt)("inlineCode",{parentName:"p"},"RunTrial")," procedure. ",(0,i.kt)("inlineCode",{parentName:"p"},"data")," should contain a message only when ",(0,i.kt)("inlineCode",{parentName:"p"},"state")," is ",(0,i.kt)("inlineCode",{parentName:"p"},"NORMAL")," (or in the case of a hard termination, ",(0,i.kt)("inlineCode",{parentName:"p"},"details")," can be sent with state ",(0,i.kt)("inlineCode",{parentName:"p"},"END"),").\nDefined in the ",(0,i.kt)("inlineCode",{parentName:"p"},"common.proto")," file."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message ActorRunTrialInput {\n CommunicationState state = 1;\n oneof data {\n ActorInitialInput init_input = 2;\n Observation observation = 3;\n Reward reward = 4;\n Message message = 5;\n string details = 6;\n }\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"state: The state of this communication message. Identifies this message as a data or a control message."),(0,i.kt)("li",{parentName:"ul"},"init_input: The initial communication data at the start of a trial. It should always be the first ",(0,i.kt)("inlineCode",{parentName:"li"},"NORMAL")," state message in the stream. Used to report the details of the trial the actor is participating in."),(0,i.kt)("li",{parentName:"ul"},"observation: An observation from the environment."),(0,i.kt)("li",{parentName:"ul"},"reward: Rewards from other participants in the trial."),(0,i.kt)("li",{parentName:"ul"},"message: A message from other participants in the trial."),(0,i.kt)("li",{parentName:"ul"},"details: Explanation for special circumstances, for example when receiving a hard termination signal (a state of ",(0,i.kt)("inlineCode",{parentName:"li"},"END")," without ",(0,i.kt)("inlineCode",{parentName:"li"},"LAST")," or ",(0,i.kt)("inlineCode",{parentName:"li"},"LAST_ACK"),").")),(0,i.kt)("h3",{id:"actorruntrialoutput"},(0,i.kt)("inlineCode",{parentName:"h3"},"ActorRunTrialOutput")),(0,i.kt)("p",null,"Message sent by actors during the streaming ",(0,i.kt)("inlineCode",{parentName:"p"},"RunTrial")," procedure. ",(0,i.kt)("inlineCode",{parentName:"p"},"data")," should contain a message only when ",(0,i.kt)("inlineCode",{parentName:"p"},"state")," is ",(0,i.kt)("inlineCode",{parentName:"p"},"NORMAL"),".\nDefined in the ",(0,i.kt)("inlineCode",{parentName:"p"},"common.proto")," file."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message ActorRunTrialOutput {\n CommunicationState state = 1;\n oneof data {\n ActorInitialOutput init_output = 2;\n Action action = 3;\n Reward reward = 4;\n Message message = 5;\n string details = 6;\n }\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"state: The state of this communication message. Identifies this message as a data or a control message."),(0,i.kt)("li",{parentName:"ul"},"init_output: The initial communication data at the start of a trial. It should always be the first ",(0,i.kt)("inlineCode",{parentName:"li"},"NORMAL")," state message in the stream. Used to initiate or acknowledge connection to a trial."),(0,i.kt)("li",{parentName:"ul"},"action: An action from the actor."),(0,i.kt)("li",{parentName:"ul"},"reward: A reward for other participants in the trial."),(0,i.kt)("li",{parentName:"ul"},"message: A message for other participants in the trial."),(0,i.kt)("li",{parentName:"ul"},"details: ",(0,i.kt)("em",{parentName:"li"},"Reserved"),".")),(0,i.kt)("h3",{id:"actorinitialinput"},(0,i.kt)("inlineCode",{parentName:"h3"},"ActorInitialInput")),(0,i.kt)("p",null,"The initial communication message at the start of a trial. Used to report the details of the trial the actor is participating in.\nFor service actors, this message initiates the connection stream for a new trial. The trial ID is provided in the metadata of the ",(0,i.kt)("inlineCode",{parentName:"p"},"RunTrial")," procedure.\nFor client actors, this message is a reply to a connection request to an existing trial."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message ActorInitialInput {\n string actor_name = 1;\n string actor_class = 2;\n string impl_name = 3;\n string env_name = 4;\n SerializedMessage config = 5;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"actor_name: The name of the actor participating in the trial."),(0,i.kt)("li",{parentName:"ul"},"actor_class: The actor class of the actor participating in the trial."),(0,i.kt)("li",{parentName:"ul"},"impl_name: (optional) Name of the implementation that should run the actor in this trial. If not provided, an arbitrary implementation will be used."),(0,i.kt)("li",{parentName:"ul"},"env_name: The name of the environment running the trial the actor is participating in."),(0,i.kt)("li",{parentName:"ul"},"config: The configuration to start the actor.")),(0,i.kt)("h3",{id:"actorinitialoutput"},(0,i.kt)("inlineCode",{parentName:"h3"},"ActorInitialOutput")),(0,i.kt)("p",null,"The initial communication message at the start of a trial. Used to initiate or acknowledge connection to a trial.\nFor service actors, this message is empty and serves to acknowledge that the actor is ready to start the trial.\nFor client actors, this message serves as a request to connect to an existing trial. The trial ID is provided in the metadata of the ",(0,i.kt)("inlineCode",{parentName:"p"},"RunTrial")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message ActorInitialOutput {\n oneof slot_selection {\n string actor_class = 1;\n string actor_name = 2;\n }\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"actor_name: The name in the trial that the client actor wants to participate as."),(0,i.kt)("li",{parentName:"ul"},"actor_class: The class in the trial that the client actor wants to participate as. In this case, there may be many options, and the Orchestrator will decide precisely which name the client actor will receive.")),(0,i.kt)("h2",{id:"environment-api"},"Environment API"),(0,i.kt)("p",null,"This API is defined in ",(0,i.kt)("inlineCode",{parentName:"p"},"environment.proto"),". It is implemented by the environment application using the gRPC server API, and the Orchestrator connects to the environment application using the gRPC client API."),(0,i.kt)("p",null,"This API is used by environments that will run trials.\nThere is only one environment per trial.\nMultiple simultaneous environments (for different trials) can be served from a single environment application instance (endpoint).\nThe environment endpoint, for the Orchestrator to connect to, is defined in the ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters"},"trial parameters"),"."),(0,i.kt)("h3",{id:"service-environmentsp"},"Service ",(0,i.kt)("inlineCode",{parentName:"h3"},"EnvironmentSP")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"service EnvironmentSP {\n rpc RunTrial(stream EnvRunTrialInput) returns (stream EnvRunTrialOutput) {}\n rpc Version(VersionRequest) returns (VersionInfo) {}\n}\n")),(0,i.kt)("h4",{id:"runtrial-1"},(0,i.kt)("inlineCode",{parentName:"h4"},"RunTrial()")),(0,i.kt)("p",null,"Procedure call to participate in a trial. It is active for the duration of the trial.\nActor actions and data are provided by the Orchestrator in the input message stream, and observations and data are provided to the Orchestrator in the output message stream."),(0,i.kt)("p",null,"Metadata:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial-id"),": Identifier of the trial the environment is participating in.")),(0,i.kt)("h4",{id:"version-2"},(0,i.kt)("inlineCode",{parentName:"h4"},"Version()")),(0,i.kt)("p",null,"Called to request version data."),(0,i.kt)("p",null,"Metadata: None"),(0,i.kt)("h3",{id:"envrruntrialinput"},(0,i.kt)("inlineCode",{parentName:"h3"},"EnvrRunTrialInput")),(0,i.kt)("p",null,"Message received by the environment during the streaming ",(0,i.kt)("inlineCode",{parentName:"p"},"RunTrial")," procedure. ",(0,i.kt)("inlineCode",{parentName:"p"},"data")," should contain a message only when ",(0,i.kt)("inlineCode",{parentName:"p"},"state")," is ",(0,i.kt)("inlineCode",{parentName:"p"},"NORMAL")," (or in the case of a hard termination, ",(0,i.kt)("inlineCode",{parentName:"p"},"details")," can be sent with state ",(0,i.kt)("inlineCode",{parentName:"p"},"END"),")."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message EnvRunTrialInput {\n CommunicationState state = 1;\n oneof data {\n EnvInitialInput init_input = 2;\n ActionSet action_set = 3;\n Message message = 4;\n string details = 5;\n }\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"state: The state of this communication message. Identifies this message as a data or a control message."),(0,i.kt)("li",{parentName:"ul"},"init_input: The initial communication data at the start of a trial. It should always be the first ",(0,i.kt)("inlineCode",{parentName:"li"},"NORMAL")," state message in the stream. Used to provide the details of the trial the environment will run."),(0,i.kt)("li",{parentName:"ul"},"action_set: Actions from all actors in the trial."),(0,i.kt)("li",{parentName:"ul"},"message: A message from other participants in the trial."),(0,i.kt)("li",{parentName:"ul"},"details: Explanation for special circumstances, for example when receiving a hard termination signal (a state of ",(0,i.kt)("inlineCode",{parentName:"li"},"END")," without ",(0,i.kt)("inlineCode",{parentName:"li"},"LAST")," or ",(0,i.kt)("inlineCode",{parentName:"li"},"LAST_ACK"),").")),(0,i.kt)("h3",{id:"envruntrialoutput"},(0,i.kt)("inlineCode",{parentName:"h3"},"EnvRunTrialOutput")),(0,i.kt)("p",null,"Message sent by the environment during the streaming ",(0,i.kt)("inlineCode",{parentName:"p"},"RunTrial")," procedure. ",(0,i.kt)("inlineCode",{parentName:"p"},"data")," should contain a message only when ",(0,i.kt)("inlineCode",{parentName:"p"},"state")," is ",(0,i.kt)("inlineCode",{parentName:"p"},"NORMAL"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message EnvRunTrialOutput {\n CommunicationState state = 1;\n oneof data {\n EnvInitialOutput init_output = 2;\n ObservationSet observation_set = 3;\n Reward reward = 4;\n Message message = 5;\n string details = 6;\n }\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"state: The state of this communication message. Identifies this message as a data or a control message."),(0,i.kt)("li",{parentName:"ul"},"init_output: The initial communication data at the start of a trial. It should always be the first ",(0,i.kt)("inlineCode",{parentName:"li"},"NORMAL")," state message in the stream. Used to acknowledge that the environment is ready to run the trial. Note that the trial will only really start when the environment sends the first set of observations."),(0,i.kt)("li",{parentName:"ul"},"observation_set: Observations for all actors in the trial."),(0,i.kt)("li",{parentName:"ul"},"reward: A reward for other participants in the trial."),(0,i.kt)("li",{parentName:"ul"},"message: A message for other participants in the trial."),(0,i.kt)("li",{parentName:"ul"},"details: ",(0,i.kt)("em",{parentName:"li"},"Reserved"),".")),(0,i.kt)("h3",{id:"envinitialinput"},(0,i.kt)("inlineCode",{parentName:"h3"},"EnvInitialInput")),(0,i.kt)("p",null,"The initial communication message at the start of a trial. This message initiates the connection stream for a new trial. The trial ID is provided in the metadata of the ",(0,i.kt)("inlineCode",{parentName:"p"},"RunTrial")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message EnvInitialInput {\n string name = 1;\n string impl_name = 2;\n uint64 tick_id = 3;\n repeated TrialActor actors_in_trial = 4;\n SerializedMessage config = 5;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"name: The name of the environment participating in the trial."),(0,i.kt)("li",{parentName:"ul"},"impl_name: (optional) Name of the implementation that should run the environment in this trial. If not provided, an arbitrary implementation will be used."),(0,i.kt)("li",{parentName:"ul"},"tick_id: Initial tick id requested to start the environment."),(0,i.kt)("li",{parentName:"ul"},"actors_in_trial: The list of all actors participating in the trial. This list has the same length and order as the list of actors provided in different places in the API, for the same trial."),(0,i.kt)("li",{parentName:"ul"},"config: The configuration to start the environment.")),(0,i.kt)("h3",{id:"envinitialoutput"},(0,i.kt)("inlineCode",{parentName:"h3"},"EnvInitialOutput")),(0,i.kt)("p",null,"The initial communication message at the start of a trial. This message is empty and serves to acknowledge that the environment is ready to run the trial."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message EnvInitialOutput {}\n")),(0,i.kt)("h2",{id:"datalog-api"},"Data/Log API"),(0,i.kt)("p",null,"This API is defined in ",(0,i.kt)("inlineCode",{parentName:"p"},"datalog.proto"),". It is implemented by the data logger application using the gRPC server API, including the out-of-the-box component ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cli/trial-datastore/trial-datastore-server"},(0,i.kt)("inlineCode",{parentName:"a"},"cogment-trial-datastore")),"."),(0,i.kt)("p",null,"The data logger endpoint, for the orchestrator to connect to, is defined in the trial parameters."),(0,i.kt)("h3",{id:"service-logexportersp"},"Service ",(0,i.kt)("inlineCode",{parentName:"h3"},"LogExporterSP")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"service LogExporterSP {\n rpc RunTrialDatalog(stream LogExporterSampleRequest) returns (LogExporterSampleReply) {}\n rpc Version(VersionRequest) returns (VersionInfo) {}\n}\n")),(0,i.kt)("h4",{id:"runtrialdatalog"},(0,i.kt)("inlineCode",{parentName:"h4"},"RunTrialDatalog()")),(0,i.kt)("p",null,"Called for each trial, at the start of the trial.\nThe first data received are the parameters.\nData samples are provided in the request stream following the parameters.\nThe stream is maintained for the duration of the trial."),(0,i.kt)("p",null,"Metadata:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial-id"),": Identifier of the trial that is the source of the data."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"user-id"),": Identifier of the user that started the trial.")),(0,i.kt)("h4",{id:"version-3"},(0,i.kt)("inlineCode",{parentName:"h4"},"Version()")),(0,i.kt)("p",null,"Called to request version data."),(0,i.kt)("p",null,"Metadata: None"),(0,i.kt)("h3",{id:"logexportersamplerequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"LogExporterSampleRequest")),(0,i.kt)("p",null,"Stream request message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"RunTrialDatalog")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message SampleInfo {\n bool out_of_sync = 5;\n uint64 tick_id = 1;\n fixed64 timestamp = 2;\n TrialState state = 3;\n repeated string special_events = 4;\n}\n\nmessage DatalogSample {\n SampleInfo info = 1;\n\n ObservationSet observations = 2;\n repeated Action actions = 3;\n repeated Reward rewards = 4;\n repeated Message messages = 5;\n repeated uint32 default_actors = 6;\n repeated uint32 unavailable_actors = 7;\n}\n\nmessage LogExporterSampleRequest {\n oneof msg {\n TrialParams trial_params = 1;\n DatalogSample sample = 2;\n }\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"out_of_sync: If false, this sample is a normal and full sample. If true, it is an out-of-sync sample that is partially filled, and some of the other value may have a slightly different meaning than for a normal sample."),(0,i.kt)("li",{parentName:"ul"},"tick_id: The tick the data relates to."),(0,i.kt)("li",{parentName:"ul"},"timestamp: The time the data was received. For a full sample, this is the time the observation set was received by the Orchestrator."),(0,i.kt)("li",{parentName:"ul"},"state: The state of the trial at the end of the tick. For out-of-sync samples, the state is undefined."),(0,i.kt)("li",{parentName:"ul"},"special_events: Events not visible from the rest of the data may appear in here. Out-of-sync samples will usually have an explanation of data in the special events list."),(0,i.kt)("li",{parentName:"ul"},"observations: Observations from the environment. Out-of-sync samples may not have observations."),(0,i.kt)("li",{parentName:"ul"},"actions: Actions from all actors. This list has the same length and order as the list of actors provided in ",(0,i.kt)("inlineCode",{parentName:"li"},"trial_params"),". This list may be empty for out-of-sync samples."),(0,i.kt)("li",{parentName:"ul"},"rewards: List of rewards sent to actors."),(0,i.kt)("li",{parentName:"ul"},"messages: List of user data sent to actors or the environment."),(0,i.kt)("li",{parentName:"ul"},"default_actors: List of actors (index of actors) that were not available but had a default action. Actors in this list have invalid data in the ",(0,i.kt)("inlineCode",{parentName:"li"},"actions")," list."),(0,i.kt)("li",{parentName:"ul"},"unavailable_actors: List of actors (index of actors) that were not available and did not have a default action. Actors in this list have invalid data in the ",(0,i.kt)("inlineCode",{parentName:"li"},"actions")," list."),(0,i.kt)("li",{parentName:"ul"},"trial_params: Trial parameters used for a trial. This is sent on start of a trial, as the first message in the ",(0,i.kt)("inlineCode",{parentName:"li"},"RunTrialDatalog")," stream."),(0,i.kt)("li",{parentName:"ul"},"sample: A data sample to be logged. It can be an out-of-sync sample which contains only partial data.")),(0,i.kt)("h3",{id:"logexportersamplereply"},(0,i.kt)("inlineCode",{parentName:"h3"},"LogExporterSampleReply")),(0,i.kt)("p",null,"Reply message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"RunTrialDatalog")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message LogExporterSampleReply {}\n")),(0,i.kt)("h2",{id:"hook-api"},"Hook API"),(0,i.kt)("p",null,"This API is defined in ",(0,i.kt)("inlineCode",{parentName:"p"},"hooks.proto"),". It is implemented by the pre-trial hook application using the gRPC server API, and the orchestrator connects to the application."),(0,i.kt)("p",null,"The pre-trial hook endpoint, for the orchestrator to connect to, are defined on the command line of the Orchestrator (or in environment variables)."),(0,i.kt)("h3",{id:"service-trialhookssp"},"Service ",(0,i.kt)("inlineCode",{parentName:"h3"},"TrialHooksSP")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"service TrialHooksSP {\n rpc OnPreTrial(PreTrialParams) returns (PreTrialParams) {}\n rpc Version(VersionRequest) returns (VersionInfo) {}\n}\n")),(0,i.kt)("h4",{id:"onpretrial"},(0,i.kt)("inlineCode",{parentName:"h4"},"OnPreTrial()")),(0,i.kt)("p",null,"Called before a trial is started to set or modify the parameters for the trial."),(0,i.kt)("p",null,"Metadata:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial-id"),": Identifier of the new trial that will be started."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"user-id"),": Identifier of the user that started the trial.")),(0,i.kt)("h4",{id:"version-4"},(0,i.kt)("inlineCode",{parentName:"h4"},"Version()")),(0,i.kt)("p",null,"Called to request version data."),(0,i.kt)("p",null,"Metadata: None"),(0,i.kt)("h2",{id:"directory-api"},"Directory API"),(0,i.kt)("p",null,"This API is defined in ",(0,i.kt)("inlineCode",{parentName:"p"},"directory.proto"),". It is implemented by the Directory application using the gRPC server API."),(0,i.kt)("h3",{id:"service-directorysp"},"Service ",(0,i.kt)("inlineCode",{parentName:"h3"},"DirectorySP")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"service DirectorySP {\n rpc Register(stream RegisterRequest) returns (stream RegisterReply) {}\n rpc Deregister(stream DeregisterRequest) returns (stream DeregisterReply) {}\n rpc Inquire(InquireRequest) returns (stream InquireReply) {}\n rpc Version(VersionRequest) returns (VersionInfo) {}\n}\n")),(0,i.kt)("h4",{id:"register"},(0,i.kt)("inlineCode",{parentName:"h4"},"Register()")),(0,i.kt)("p",null,"Called to register (add) services to the directory."),(0,i.kt)("p",null,"Metadata:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"authentication_token"),": (Optional) Token of the services being registered. This will be registered with the services and must match when inquiring or deregistering a service.")),(0,i.kt)("h4",{id:"deregister"},(0,i.kt)("inlineCode",{parentName:"h4"},"Deregister()")),(0,i.kt)("p",null,"Called to deregister (remove) previously registered services to the directory."),(0,i.kt)("p",null,"Metadata:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"authentication_token"),": (Optional) Token to authenticate services. This must match the token of the registered services.")),(0,i.kt)("h4",{id:"inquire"},(0,i.kt)("inlineCode",{parentName:"h4"},"Inquire()")),(0,i.kt)("p",null,"Called to inquire (search) the directory for registered services."),(0,i.kt)("p",null,"Metadata:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"authentication_token"),": (Optional) Token to identify the services. This must match the token of the inquired services.")),(0,i.kt)("h4",{id:"version-5"},(0,i.kt)("inlineCode",{parentName:"h4"},"Version()")),(0,i.kt)("p",null,"Called to request version data."),(0,i.kt)("p",null,"Metadata: None"),(0,i.kt)("h3",{id:"servicetype"},(0,i.kt)("inlineCode",{parentName:"h3"},"ServiceType")),(0,i.kt)("p",null,"Type of service registered. This serves to know how to test for health."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"enum ServiceType {\n UNKNOWN_SERVICE = 0;\n TRIAL_LIFE_CYCLE_SERVICE = 1;\n CLIENT_ACTOR_CONNECTION_SERVICE = 2;\n ACTOR_SERVICE = 3;\n ENVIRONMENT_SERVICE = 4;\n PRE_HOOK_SERVICE = 5;\n DATALOG_SERVICE = 6;\n DATASTORE_SERVICE = 7;\n MODEL_REGISTRY_SERVICE = 8;\n DIRECTORY_SERVICE = 9;\n OTHER_SERVICE = 100;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"UNKNOWN_SERVICE: Should not be used (it's a requirement of protobuf enums to have a 0 default value)."),(0,i.kt)("li",{parentName:"ul"},"TRIAL_LIFE_CYCLE_SERVICE: Cogment service accessed with gRPC service ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialLifecycleSP"),"."),(0,i.kt)("li",{parentName:"ul"},"CLIENT_ACTOR_CONNECTION_SERVICE: Cogment service accessed with gRPC service ",(0,i.kt)("inlineCode",{parentName:"li"},"ClientActorSP"),"."),(0,i.kt)("li",{parentName:"ul"},"ACTOR_SERVICE: Cogment service accessed with gRPC service ",(0,i.kt)("inlineCode",{parentName:"li"},"ServiceActorSP"),"."),(0,i.kt)("li",{parentName:"ul"},"ENVIRONMENT_SERVICE: Cogment service accessed with gRPC service ",(0,i.kt)("inlineCode",{parentName:"li"},"EnvironmentSP"),"."),(0,i.kt)("li",{parentName:"ul"},"PRE_HOOK_SERVICE: Cogment service accessed with gRPC service ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialHooksSP"),"."),(0,i.kt)("li",{parentName:"ul"},"DATALOG_SERVICE: Cogment service accessed with gRPC service ",(0,i.kt)("inlineCode",{parentName:"li"},"DatalogSP"),"."),(0,i.kt)("li",{parentName:"ul"},"DATASTORE_SERVICE: Cogment service accessed with gRPC service ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialDatastoreSP"),"."),(0,i.kt)("li",{parentName:"ul"},"MODEL_REGISTRY_SERVICE: Cogment service accessed with gRPC service ",(0,i.kt)("inlineCode",{parentName:"li"},"ModelRegistrySP"),"."),(0,i.kt)("li",{parentName:"ul"},"DIRECTORY_SERVICE: Cogment service accessed with gRPC service ",(0,i.kt)("inlineCode",{parentName:"li"},"DirectorySP"),"."),(0,i.kt)("li",{parentName:"ul"},"OTHER_SERVICE: This is for services not provided by Cogment or that do not have a dedicated service type. The properties registered in the directory should provide the necessary information, but this is left to the users to manage, and no health checking is performed.")),(0,i.kt)("h3",{id:"servicedetails"},(0,i.kt)("inlineCode",{parentName:"h3"},"ServiceDetails")),(0,i.kt)("p",null,"Message containing registration details of a service."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message ServiceDetails {\n ServiceType type = 1;\n map<string, string> properties = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"type: The type of service."),(0,i.kt)("li",{parentName:"ul"},"properties: Properties associated with the service, in a map (property name : property value).")),(0,i.kt)("h3",{id:"serviceendpoint"},(0,i.kt)("inlineCode",{parentName:"h3"},"ServiceEndpoint")),(0,i.kt)("p",null,"Message containing endpoint (connection) details for a service."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message ServiceEndpoint {\n enum Protocol {\n UNKNOWN = 0;\n GRPC = 1;\n GRPC_SSL = 2;\n COGMENT = 3;\n }\n\n Protocol protocol = 1;\n string host = 2;\n uint32 port = 3;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Protocol: The communication protocol for the service.",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"UNKNOWN: Should not be used (it's a requirement of protobuf enums to have a 0 default value)."),(0,i.kt)("li",{parentName:"ul"},"GRPC: The service connection is using gRPC and does not require encryption (SSL)."),(0,i.kt)("li",{parentName:"ul"},"GRPC_SSL: The service connection is using gRPC and is expecting encryption (SSL)."),(0,i.kt)("li",{parentName:"ul"},"COGMENT: This is a protocol specific to Cogment. The host will provide more details."))),(0,i.kt)("li",{parentName:"ul"},"host: For gRPC, this is a network accessible hostname or IP address. For Cogment, this can only be ",(0,i.kt)("inlineCode",{parentName:"li"},"client"),", which indicates that the service is not really a service, but a client, and will connect and not be connected to."),(0,i.kt)("li",{parentName:"ul"},"port: For gRPC, this is the TCP port to connect to. For Cogment, this is not used.")),(0,i.kt)("h3",{id:"registerrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"RegisterRequest")),(0,i.kt)("p",null,"Request message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"Register")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RegisterRequest {\n // URL where to connect to the service.\n ServiceEndpoint endpoint = 1;\n ServiceDetails details = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"endpoint: The connection endpoint of the service to be registered."),(0,i.kt)("li",{parentName:"ul"},"details: The service details to be registered for the service.")),(0,i.kt)("h3",{id:"registerreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"RegisterReply")),(0,i.kt)("p",null,"Reply message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"Register")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RegisterReply {\n enum Status {\n UNKNOWN = 0;\n OK = 1;\n FAILED = 2;\n }\n Status status = 1;\n string error_msg = 2;\n uint64 service_id = 3;\n string secret = 4;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Status: The result status.",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"UNKNOWN: Should not be used (it's a requirement of protobuf enums to have a 0 default value)."),(0,i.kt)("li",{parentName:"ul"},"OK: Registration succeeded and the data is valid."),(0,i.kt)("li",{parentName:"ul"},"FAILED: Registration failed, the data is invalid (more details may be available in the error message)."))),(0,i.kt)("li",{parentName:"ul"},"status: The status of the corresponding registration request."),(0,i.kt)("li",{parentName:"ul"},"error_msg: Any extra details about the failure of the registration (if ",(0,i.kt)("inlineCode",{parentName:"li"},"status")," == ",(0,i.kt)("inlineCode",{parentName:"li"},"FAILED"),")."),(0,i.kt)("li",{parentName:"ul"},"service_id: The ID that the service was given when it was registered in the Directory."),(0,i.kt)("li",{parentName:"ul"},"secret: This is a string that must be provided to deregister the service, and cannot be inquired.")),(0,i.kt)("h3",{id:"deregisterrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"DeregisterRequest")),(0,i.kt)("p",null,"Request message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"Deregister")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message DeregisterRequest {\n uint64 service_id = 1;\n string secret = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"service_id: The ID of the service."),(0,i.kt)("li",{parentName:"ul"},"secret: The string that was given when the service was registered.")),(0,i.kt)("h3",{id:"deregisterreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"DeregisterReply")),(0,i.kt)("p",null,"Reply message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"Deregister")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message DeregisterReply {\n enum Status {\n UNKNOWN = 0;\n OK = 1;\n FAILED = 2;\n }\n Status status = 1;\n string error_msg = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Status: The result status.",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"UNKNOWN: Should not be used (it's a requirement of protobuf enums to have a 0 default value)."),(0,i.kt)("li",{parentName:"ul"},"OK: Deregistration succeeded."),(0,i.kt)("li",{parentName:"ul"},"FAILED: Deregistration failed (more details may be available in the error message)."))),(0,i.kt)("li",{parentName:"ul"},"status: The status of the corresponding deregistration request."),(0,i.kt)("li",{parentName:"ul"},"error_msg: Any extra details about the failure to deregister the service (if ",(0,i.kt)("inlineCode",{parentName:"li"},"status")," == ",(0,i.kt)("inlineCode",{parentName:"li"},"FAILED"),").")),(0,i.kt)("h3",{id:"inquirerequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"InquireRequest")),(0,i.kt)("p",null,"Request message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"Inquire")," procedure. Requires either a service ID, or details of services to find."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message InquireRequest {\n oneof inquiry {\n uint64 service_id = 1;\n ServiceDetails details = 2;\n }\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"service_id: The ID of the service."),(0,i.kt)("li",{parentName:"ul"},"details: The details of services to find.")),(0,i.kt)("h3",{id:"inquirereply"},(0,i.kt)("inlineCode",{parentName:"h3"},"InquireReply")),(0,i.kt)("p",null,"Reply message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"Inquire")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message FullServiceData {\n ServiceEndpoint endpoint = 1;\n uint64 service_id = 2;\n ServiceDetails details = 3;\n}\n\nmessage InquireReply {\n FullServiceData data = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"endpoint: The connection endpoint of the service."),(0,i.kt)("li",{parentName:"ul"},"service_id: The ID of the service."),(0,i.kt)("li",{parentName:"ul"},"details: The details of the service.")),(0,i.kt)("h2",{id:"model-registry-api"},"Model Registry API"),(0,i.kt)("p",null,"This API is defined in ",(0,i.kt)("inlineCode",{parentName:"p"},"model_registry.proto"),". It is implemented by ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cli/model-registry"},(0,i.kt)("inlineCode",{parentName:"a"},"cogment-model-registry")),"."),(0,i.kt)("h3",{id:"service-modelregistrysp"},"Service ",(0,i.kt)("inlineCode",{parentName:"h3"},"ModelRegistrySP")),(0,i.kt)("p",null,"This gRPC API defines a service able to store models, e.g. neural network architecture, weights and any additional parameters."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"service ModelRegistrySP {\n rpc CreateOrUpdateModel(CreateOrUpdateModelRequest) returns (CreateOrUpdateModelReply) {}\n rpc DeleteModel(DeleteModelRequest) returns (DeleteModelReply) {}\n rpc RetrieveModels(RetrieveModelsRequest) returns (RetrieveModelsReply) {}\n\n rpc CreateVersion(stream CreateVersionRequestChunk) returns (CreateVersionReply) {}\n rpc RetrieveVersionInfos(RetrieveVersionInfosRequest) returns (RetrieveVersionInfosReply) {}\n rpc RetrieveVersionData(RetrieveVersionDataRequest) returns (stream RetrieveVersionDataReplyChunk) {}\n\n rpc Version(VersionRequest) returns (VersionInfo) {}\n}\n")),(0,i.kt)("h4",{id:"createorupdatemodel"},(0,i.kt)("inlineCode",{parentName:"h4"},"CreateOrUpdateModel()")),(0,i.kt)("p",null,"Create or update a model in the registry having the given unique (within the registry) ",(0,i.kt)("inlineCode",{parentName:"p"},"model_id"),"."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Metadata: None"),(0,i.kt)("li",{parentName:"ul"},"Request: ",(0,i.kt)("a",{parentName:"li",href:"#createorupdatemodelrequest"},(0,i.kt)("inlineCode",{parentName:"a"},"CreateOrUpdateModelRequest"))),(0,i.kt)("li",{parentName:"ul"},"Reply: ",(0,i.kt)("a",{parentName:"li",href:"#createorupdatemodelreply"},(0,i.kt)("inlineCode",{parentName:"a"},"CreateOrUpdateModelReply")))),(0,i.kt)("h4",{id:"deletemodel"},(0,i.kt)("inlineCode",{parentName:"h4"},"DeleteModel()")),(0,i.kt)("p",null,"Delete a given model and all its iterations from the registry."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Metadata: None"),(0,i.kt)("li",{parentName:"ul"},"Request: ",(0,i.kt)("a",{parentName:"li",href:"#deletemodelrequest"},(0,i.kt)("inlineCode",{parentName:"a"},"DeleteModelRequest"))),(0,i.kt)("li",{parentName:"ul"},"Reply: ",(0,i.kt)("a",{parentName:"li",href:"#deletemodelreply"},(0,i.kt)("inlineCode",{parentName:"a"},"DeleteModelReply")))),(0,i.kt)("h4",{id:"retrievemodels"},(0,i.kt)("inlineCode",{parentName:"h4"},"RetrieveModels()")),(0,i.kt)("p",null,"Retrieve all or selected models. This procedure supports paginated requests."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Metadata: None"),(0,i.kt)("li",{parentName:"ul"},"Request: ",(0,i.kt)("a",{parentName:"li",href:"#retrievemodelsrequest"},(0,i.kt)("inlineCode",{parentName:"a"},"RetrieveModelsRequest"))),(0,i.kt)("li",{parentName:"ul"},"Reply: ",(0,i.kt)("a",{parentName:"li",href:"#retrievemodelsreply"},(0,i.kt)("inlineCode",{parentName:"a"},"RetrieveModelsReply")))),(0,i.kt)("h4",{id:"createversion"},(0,i.kt)("inlineCode",{parentName:"h4"},"CreateVersion()")),(0,i.kt)("p",null,"Create a new iteration of a given model. Because of their potential large size, model iteration data are uploaded as a stream."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Metadata: None"),(0,i.kt)("li",{parentName:"ul"},"Request: Stream of ",(0,i.kt)("a",{parentName:"li",href:"#createversionrequestchunk"},(0,i.kt)("inlineCode",{parentName:"a"},"CreateVersionRequestChunk"))),(0,i.kt)("li",{parentName:"ul"},"Reply: ",(0,i.kt)("a",{parentName:"li",href:"#createversionreply"},(0,i.kt)("inlineCode",{parentName:"a"},"CreateVersionReply")))),(0,i.kt)("h4",{id:"retrieveversioninfos"},(0,i.kt)("inlineCode",{parentName:"h4"},"RetrieveVersionInfos()")),(0,i.kt)("p",null,"Retrieve the information for all or selected iterations of a given model."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Metadata: None"),(0,i.kt)("li",{parentName:"ul"},"Request: ",(0,i.kt)("a",{parentName:"li",href:"#retrieveversioninfosrequest"},(0,i.kt)("inlineCode",{parentName:"a"},"RetrieveVersionInfosRequest"))),(0,i.kt)("li",{parentName:"ul"},"Reply: ",(0,i.kt)("a",{parentName:"li",href:"#retrieveversioninfosreply"},(0,i.kt)("inlineCode",{parentName:"a"},"RetrieveVersionInfosReply")))),(0,i.kt)("h4",{id:"retrieveversiondata"},(0,i.kt)("inlineCode",{parentName:"h4"},"RetrieveVersionData()")),(0,i.kt)("p",null,"Retrieve the data for a specific iteration of the model. Because of their potential large size, data are retrieved as a stream."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Metadata: None"),(0,i.kt)("li",{parentName:"ul"},"Request: ",(0,i.kt)("a",{parentName:"li",href:"#retrieveversiondatarequest"},(0,i.kt)("inlineCode",{parentName:"a"},"RetrieveVersionDataRequest"))),(0,i.kt)("li",{parentName:"ul"},"Reply: Stream of ",(0,i.kt)("a",{parentName:"li",href:"#retrieveversiondatareplychunk"},(0,i.kt)("inlineCode",{parentName:"a"},"RetrieveVersionDataReplyChunk")))),(0,i.kt)("h3",{id:"createorupdatemodelrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"CreateOrUpdateModelRequest")),(0,i.kt)("p",null,"Request for ",(0,i.kt)("a",{parentName:"p",href:"#createorupdatemodel"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.CreateOrUpdateModel()"))),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message CreateOrUpdateModelRequest {\n ModelInfo model_info = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_info"),": Defines the unique model identifier within the registry and the ",(0,i.kt)("inlineCode",{parentName:"li"},"user_data")," to use to create or update the model.")),(0,i.kt)("h3",{id:"createorupdatemodelreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"CreateOrUpdateModelReply")),(0,i.kt)("p",null,"Reply for ",(0,i.kt)("a",{parentName:"p",href:"#createorupdatemodel"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.CreateOrUpdateModel()"))),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message CreateOrUpdateModelReply {}\n")),(0,i.kt)("h3",{id:"deletemodelrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"DeleteModelRequest")),(0,i.kt)("p",null,"Request for ",(0,i.kt)("a",{parentName:"p",href:"#deletemodel"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.DeleteModel()"))),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message DeleteModelRequest {\n string model_id = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_ids"),": Identifier of the model to be deleted.")),(0,i.kt)("h3",{id:"deletemodelreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"DeleteModelReply")),(0,i.kt)("p",null,"Reply for ",(0,i.kt)("a",{parentName:"p",href:"#deletemodel"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.DeleteModel()"))),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message DeleteModelReply {}\n")),(0,i.kt)("h3",{id:"retrievemodelsrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"RetrieveModelsRequest")),(0,i.kt)("p",null,"Request for ",(0,i.kt)("a",{parentName:"p",href:"#retrievemodel"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.RetrieveModel()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RetrieveModelsRequest {\n repeated string model_ids = 1;\n uint32 models_count = 3;\n string model_handle = 4;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_ids"),": List of the identifiers of the desired models, leave empty to retrieve all models."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"models_count"),": (optional) The desired number of models to be retrieved, leave empty (or set to 0) to retrieve all models matching the request."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_handle"),": (optional) Leave empty for the initial request, use previously provided ",(0,i.kt)("inlineCode",{parentName:"li"},"RetrieveModelsReply.next_model_handle")," on the next calls to retrieve the next models.")),(0,i.kt)("h3",{id:"retrievemodelsreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"RetrieveModelsReply")),(0,i.kt)("p",null,"Reply for ",(0,i.kt)("a",{parentName:"p",href:"#retrievemodel"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.RetrieveModel()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RetrieveModelsReply {\n repeated ModelInfo model_infos = 1;\n string next_model_handle = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_infos"),": At most ",(0,i.kt)("inlineCode",{parentName:"li"},"RetrieveModelsRequest.models_count")," models."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"next_model_handle"),": Opaque handle to be used to retrieve the next models matching the request.")),(0,i.kt)("h3",{id:"createversionrequestchunk"},(0,i.kt)("inlineCode",{parentName:"h3"},"CreateVersionRequestChunk")),(0,i.kt)("p",null,"Part of the request stream for ",(0,i.kt)("a",{parentName:"p",href:"#createversion"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.CreateVersion()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message CreateVersionRequestChunk {\n message Header {\n ModelVersionInfo version_info = 1;\n }\n message Body {\n bytes data_chunk = 1;\n }\n oneof msg {\n Header header = 1;\n Body body = 2;\n }\n}\n")),(0,i.kt)("p",null,"The first message in the stream should define ",(0,i.kt)("inlineCode",{parentName:"p"},"header"),":"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"version_info"),": Information regarding the model iteration to create, ",(0,i.kt)("inlineCode",{parentName:"li"},"version_number")," will be ignored. ",(0,i.kt)("inlineCode",{parentName:"li"},"data_hash")," and ",(0,i.kt)("inlineCode",{parentName:"li"},"data_size")," should be computed from the total final data and will be used by the server to validate it.")),(0,i.kt)("p",null,"The following messages should define ",(0,i.kt)("inlineCode",{parentName:"p"},"body"),":"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"data_chunk"),": A chunk of the iteration data, all the chunks in the stream will be concatenated.")),(0,i.kt)("h3",{id:"createversionreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"CreateVersionReply")),(0,i.kt)("p",null,"Reply for ",(0,i.kt)("a",{parentName:"p",href:"#createversion"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.CreateVersion()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message CreateVersionReply {\n ModelVersionInfo version_info = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"version_info"),": The information relative to the created model iteration, in particular the defined ",(0,i.kt)("inlineCode",{parentName:"li"},"version_number"),".")),(0,i.kt)("h3",{id:"retrieveversioninfosrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"RetrieveVersionInfosRequest")),(0,i.kt)("p",null,"Request for ",(0,i.kt)("a",{parentName:"p",href:"#retrieveversioninfos"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.RetrieveVersionInfos()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RetrieveVersionInfosRequest {\n string model_id = 1;\n repeated int32 version_numbers = 2;\n uint32 versions_count = 3;\n string version_handle = 4;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_id"),": Identifier of the model we want to retrieve iterations from."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"version_numbers"),": List of desired iteration number (or -1 to denote the latest iteration). Leave empty to retrieve all iterations of the given model."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"versions_count"),": (optional) The desired number of iterations to be retrieved, leave empty (or set to 0) to retrieve all the iterations matching the request."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"version_handle"),": (optional) Leave empty for the initial request, use previously provided ",(0,i.kt)("inlineCode",{parentName:"li"},"RetrieveVersionInfosReply.next_version_handle")," on the next calls to retrieve the next iterations.")),(0,i.kt)("h3",{id:"retrieveversioninfosreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"RetrieveVersionInfosReply")),(0,i.kt)("p",null,"Reply for ",(0,i.kt)("a",{parentName:"p",href:"#retrieveversioninfos"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.RetrieveVersionInfos()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RetrieveVersionInfosReply {\n repeated ModelVersionInfo version_infos = 1;\n string next_version_handle = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"version_infos"),": At most ",(0,i.kt)("inlineCode",{parentName:"li"},"RetrieveVersionInfosRequest.versions_count")," iterations."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"next_version_handle"),": Opaque handle to be used to retrieve the next iterations matching the request.")),(0,i.kt)("h3",{id:"retrieveversiondatarequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"RetrieveVersionDataRequest")),(0,i.kt)("p",null,"Request for ",(0,i.kt)("a",{parentName:"p",href:"#retrieveversiondata"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.RetrieveVersionData()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RetrieveVersionDataRequest {\n string model_id = 1;\n int32 version_number = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_id"),": Identifier of the model we want to retrieve iteration from."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"version_numbers"),": Number of the desired iteration.")),(0,i.kt)("h3",{id:"retrieveversiondatareplychunk"},(0,i.kt)("inlineCode",{parentName:"h3"},"RetrieveVersionDataReplyChunk")),(0,i.kt)("p",null,"Part of the reply stream of ",(0,i.kt)("a",{parentName:"p",href:"#retrieveversiondata"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.RetrieveVersionData()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RetrieveVersionDataReplyChunk {\n bytes data_chunk = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"data_chunk"),": A chunk of the iteration data. All the chunks in the stream need to be concatenated. The completeness and validity of the received data can be checked using the iteration's ",(0,i.kt)("inlineCode",{parentName:"li"},"data_size")," and ",(0,i.kt)("inlineCode",{parentName:"li"},"data_hash")," respectively.")),(0,i.kt)("h3",{id:"modelinfo"},(0,i.kt)("inlineCode",{parentName:"h3"},"ModelInfo")),(0,i.kt)("p",null,"Defines a model identifier and associated user data."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message ModelInfo {\n string model_id = 1;\n map<string, string> user_data = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_id"),": Unique model identifier."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"user_data"),": Key/value user data associated with the model.")),(0,i.kt)("h3",{id:"modelversioninfo"},(0,i.kt)("inlineCode",{parentName:"h3"},"ModelVersionInfo")),(0,i.kt)("p",null,"Defines a model iteration and associated user data."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message ModelVersionInfo {\n string model_id = 1;\n uint32 version_number = 2;\n fixed64 creation_timestamp = 3;\n bool archived = 4;\n string data_hash = 5;\n fixed64 data_size = 6;\n map<string, string> user_data = 7;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_id"),": Unique identifier, within the registry, of this iteration's model."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"version_number"),": Unique iteration number, assigned incrementally at creation by the model registry."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"creation_timestamp"),": When the model was created as nanosecond Unix epoch time."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"archived"),": If ",(0,i.kt)("inlineCode",{parentName:"li"},"true"),", this iteration is archived and should be stored in a long-term storage. If ",(0,i.kt)("inlineCode",{parentName:"li"},"false"),", this iteration is not archived and can be evicted after a while. Non-archived iterations should be used to ",(0,i.kt)("em",{parentName:"li"},"broadcast")," an update of the model during training."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"data_hash"),": SHA 256 hash (encoded in base64 with standard 64 characters with padding) of this iteration's data, can be used to validate the data and for caching purposes."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"data_size"),": Size (in bytes) of this iteration's data."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"user_data"),": Key/value user data associated with the model, in particular it can be used to provide information required for the deserialization of the data.")),(0,i.kt)("h4",{id:"version-6"},(0,i.kt)("inlineCode",{parentName:"h4"},"Version()")),(0,i.kt)("p",null,"Called to request iteration data."),(0,i.kt)("p",null,"Metadata: None"),(0,i.kt)("h2",{id:"trial-datastore-api"},"Trial Datastore API"),(0,i.kt)("p",null,"This API is defined in ",(0,i.kt)("inlineCode",{parentName:"p"},"trial_datastore.proto"),". It is implemented by ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cli/trial-datastore/trial-datastore-server"},(0,i.kt)("inlineCode",{parentName:"a"},"cogment-trial-datastore")),"."),(0,i.kt)("h3",{id:"service-trialdatastoresp"},"Service ",(0,i.kt)("inlineCode",{parentName:"h3"},"TrialDatastoreSP")),(0,i.kt)("p",null,"This gRPC API defines a service to manage and access data generated by trials."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"service TrialDatastoreSP {\n rpc RetrieveTrials(RetrieveTrialsRequest) returns (RetrieveTrialsReply) {}\n rpc RetrieveSamples(RetrieveSamplesRequest) returns (stream RetrieveSampleReply) {}\n\n rpc AddTrial(AddTrialRequest) returns (AddTrialReply) {}\n rpc AddSample(stream AddSampleRequest) returns (AddSamplesReply) {}\n rpc DeleteTrials(DeleteTrialsRequest) returns (DeleteTrialsReply) {}\n\n rpc Version(VersionRequest) returns (VersionInfo) {}\n}\n")),(0,i.kt)("h4",{id:"retrievetrials"},(0,i.kt)("inlineCode",{parentName:"h4"},"RetrieveTrials()")),(0,i.kt)("p",null,"Retrieve stored trials matching the given request."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Metadata: None"),(0,i.kt)("li",{parentName:"ul"},"Request: ",(0,i.kt)("a",{parentName:"li",href:"#retrievetrialsrequest"},(0,i.kt)("inlineCode",{parentName:"a"},"RetrieveTrialsRequest"))),(0,i.kt)("li",{parentName:"ul"},"Reply: ",(0,i.kt)("a",{parentName:"li",href:"#retrievetrialsrequest"},(0,i.kt)("inlineCode",{parentName:"a"},"RetrieveTrialsRequest")))),(0,i.kt)("h4",{id:"retrievesamples"},(0,i.kt)("inlineCode",{parentName:"h4"},"RetrieveSamples()")),(0,i.kt)("p",null,"Retrieve samples from matching trials, trials can be ongoing."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Metadata: None"),(0,i.kt)("li",{parentName:"ul"},"Request: ",(0,i.kt)("a",{parentName:"li",href:"#retrievesamplesrequest"},(0,i.kt)("inlineCode",{parentName:"a"},"RetrieveSamplesRequest"))),(0,i.kt)("li",{parentName:"ul"},"Reply: Stream of ",(0,i.kt)("a",{parentName:"li",href:"#retrievesamplereply"},(0,i.kt)("inlineCode",{parentName:"a"},"RetrieveSampleReply")))),(0,i.kt)("h4",{id:"addtrial"},(0,i.kt)("inlineCode",{parentName:"h4"},"AddTrial()")),(0,i.kt)("p",null,"Add a trial to the activity logger, as soon as a trial is added, samples can be retrieved using ",(0,i.kt)("inlineCode",{parentName:"p"},"RetrieveSamples()"),"."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Metadata: None"),(0,i.kt)("li",{parentName:"ul"},"Request: ",(0,i.kt)("a",{parentName:"li",href:"#addtrialrequest"},(0,i.kt)("inlineCode",{parentName:"a"},"AddTrialRequest"))),(0,i.kt)("li",{parentName:"ul"},"Reply: ",(0,i.kt)("a",{parentName:"li",href:"#addtrialreply"},(0,i.kt)("inlineCode",{parentName:"a"},"AddTrialReply")))),(0,i.kt)("h4",{id:"addsample"},(0,i.kt)("inlineCode",{parentName:"h4"},"AddSample()")),(0,i.kt)("p",null,"Add samples to a trial in the activity logger as a stream, as soon as a sample is added it is pushed to the matching ongoing ",(0,i.kt)("inlineCode",{parentName:"p"},"RetrieveSamples()")," requests."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Metadata:",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial-id"),": UUID of the trial to add to the activity logger."))),(0,i.kt)("li",{parentName:"ul"},"Request: Stream of ",(0,i.kt)("a",{parentName:"li",href:"#addsamplerequest"},(0,i.kt)("inlineCode",{parentName:"a"},"AddSampleRequest"))),(0,i.kt)("li",{parentName:"ul"},"Reply: ",(0,i.kt)("a",{parentName:"li",href:"#addsamplesreply"},(0,i.kt)("inlineCode",{parentName:"a"},"AddSamplesReply")))),(0,i.kt)("h4",{id:"deletetrials"},(0,i.kt)("inlineCode",{parentName:"h4"},"DeleteTrials()")),(0,i.kt)("p",null,"Delete the trials matching the given request, on failure no trial is deleted."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Metadata: None"),(0,i.kt)("li",{parentName:"ul"},"Request: ",(0,i.kt)("a",{parentName:"li",href:"#deletetrialsrequest"},(0,i.kt)("inlineCode",{parentName:"a"},"DeleteTrialsRequest"))),(0,i.kt)("li",{parentName:"ul"},"Reply: ",(0,i.kt)("a",{parentName:"li",href:"#deletetrialsreply"},(0,i.kt)("inlineCode",{parentName:"a"},"DeleteTrialsReply")))),(0,i.kt)("h3",{id:"storedtrialinfo"},(0,i.kt)("inlineCode",{parentName:"h3"},"StoredTrialInfo")),(0,i.kt)("p",null,"Defines a information about a stored trial"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message StoredTrialInfo {\n string trial_id = 1;\n TrialState last_state = 2;\n string user_id = 3;\n uint32 samples_count = 4;\n TrialParams params = 5;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_id"),": Unique identifier of the trial."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"last_state"),": Last known ",(0,i.kt)("a",{parentName:"li",href:"#trialstate"},"trial state"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"user_id"),": The id of the user that has started the trial."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"samples_count"),": The number samples that are stored for this trial."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"params"),": ",(0,i.kt)("a",{parentName:"li",href:"#trialparams"},"Parameters of the trial"),".")),(0,i.kt)("h3",{id:"storedtrialsample"},(0,i.kt)("inlineCode",{parentName:"h3"},"StoredTrialSample")),(0,i.kt)("p",null,"Represents a sample generated by a trial at a given tick."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message StoredTrialSample {\n string user_id = 1;\n string trial_id = 2;\n uint64 tick_id = 3;\n fixed64 timestamp = 4;\n TrialState state = 5;\n repeated StoredTrialActorSample actor_samples = 6;\n repeated bytes payloads = 7;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"user_id"),": The identifier of the user that has started the trial."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_id"),": Unique identifier of the trial."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"tick_id"),": Tick of this sample."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"timestamp"),": Time of the sample."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"state"),": ",(0,i.kt)("a",{parentName:"li",href:"#trialstate"},"Trial state")," of the sample."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_samples"),": ",(0,i.kt)("a",{parentName:"li",href:"#storedtrialactorsample"},"Sample data related to each actor"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"payloads"),": Serialized payload for the actors observations, actions, rewards and messages during this sample.")),(0,i.kt)("h3",{id:"storedtrialactorsample"},(0,i.kt)("inlineCode",{parentName:"h3"},"StoredTrialActorSample")),(0,i.kt)("p",null,"Represents a sample generated by an actor in a trial at a given tick, only makes sense as a part of a ",(0,i.kt)("a",{parentName:"p",href:"#storedtrialsample"},(0,i.kt)("inlineCode",{parentName:"a"},"StoredTrialSample")),"."),(0,i.kt)("p",null,"Actors are referenced by their index in the ",(0,i.kt)("a",{parentName:"p",href:"#trialparams"},"trial params")," ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialParams.actors")," field. Where it make sense, the actor index can be set to -1 to reference the trial's environment."),(0,i.kt)("p",null,"Payloads (ie observations data, actions data, reward user data and messages payloads) are grouped in the ",(0,i.kt)("inlineCode",{parentName:"p"},"payloads")," field of ",(0,i.kt)("a",{parentName:"p",href:"#storedtrialsample"},(0,i.kt)("inlineCode",{parentName:"a"},"StoredTrialSample"))," and referenced by their index in this field."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message StoredTrialActorSample {\n uint32 actor = 1;\n optional uint32 observation = 2;\n optional uint32 action = 3;\n optional float reward = 4;\n repeated StoredTrialActorSampleReward received_rewards = 6;\n repeated StoredTrialActorSampleReward sent_rewards = 7;\n repeated StoredTrialActorSampleMessage received_messages = 8;\n repeated StoredTrialActorSampleMessage sent_messages = 9;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor"),": The index of the actor."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"observation"),": Observation received by the actor at the current tick, as an index of the observation payload in the parent ",(0,i.kt)("a",{parentName:"li",href:"#storedtrialsample"},(0,i.kt)("inlineCode",{parentName:"a"},"StoredTrialSample")),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"action"),": Action performed by the actor at the current tick, as an index of the action payload in the parent ",(0,i.kt)("a",{parentName:"li",href:"#storedtrialsample"},(0,i.kt)("inlineCode",{parentName:"a"},"StoredTrialSample"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"reward"),": Aggregated value of the rewards received by the actor for the current tick."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"received_rewards"),": List of the ",(0,i.kt)("a",{parentName:"li",href:"#storedtrialactorsamplereward"},"rewards")," received by the actor for the current tick."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"sent_rewards"),": List of the ",(0,i.kt)("a",{parentName:"li",href:"#storedtrialactorsamplereward"},"rewards")," sent by the actor for the current tick."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"received_messages"),": List of the ",(0,i.kt)("a",{parentName:"li",href:"#storedtrialactorsamplemessage"},"messages")," received by the actor between the current tick and the next."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"sent_messages"),": List of the ",(0,i.kt)("a",{parentName:"li",href:"#storedtrialactorsamplemessage"},"messages")," sent by the actor between the current tick and the next.")),(0,i.kt)("h3",{id:"storedtrialactorsamplereward"},(0,i.kt)("inlineCode",{parentName:"h3"},"StoredTrialActorSampleReward")),(0,i.kt)("p",null,"Represents a reward sent or received by an actor, only makes sense as a part of a ",(0,i.kt)("a",{parentName:"p",href:"#storedtrialactorsample"},(0,i.kt)("inlineCode",{parentName:"a"},"StoredTrialActorSample")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message StoredTrialActorSampleReward {\n int32 sender = 1;\n int32 receiver = 2;\n float reward = 4;\n float confidence = 5;\n optional uint32 user_data = 6;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"sender"),": Index of the actor, -1 for the environment, ignored for sent rewards."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"receiver"),": Index of the actor, -1 for the environment, received for sent rewards."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"reward"),": The numerical value of the provided reward."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"confidence"),": The weight of this reward in computing the final (aggregated) reward."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"user_data"),": User data attached to the reward, as an index of the payload in the parent ",(0,i.kt)("a",{parentName:"li",href:"#storedtrialsample"},(0,i.kt)("inlineCode",{parentName:"a"},"StoredTrialSample")),".")),(0,i.kt)("h3",{id:"storedtrialactorsamplemessage"},(0,i.kt)("inlineCode",{parentName:"h3"},"StoredTrialActorSampleMessage")),(0,i.kt)("p",null,"Represents a message sent or received by an actor, only makes sense as a part of a ",(0,i.kt)("a",{parentName:"p",href:"#storedtrialactorsample"},(0,i.kt)("inlineCode",{parentName:"a"},"StoredTrialActorSample")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message StoredTrialActorSampleMessage {\n int32 sender = 1;\n int32 receiver = 2;\n uint32 payload = 3;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"sender"),": Index of the actor, -1 for the environment, ignored for sent messages."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"receiver"),": Index of the actor, -1 for the environment, received for sent messages."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"payload"),": Payload of the message, as an index of the payload in the parent ",(0,i.kt)("a",{parentName:"li",href:"#storedtrialsample"},(0,i.kt)("inlineCode",{parentName:"a"},"StoredTrialSample")),".")),(0,i.kt)("h3",{id:"storedtrialsamplefield"},(0,i.kt)("inlineCode",{parentName:"h3"},"StoredTrialSampleField")),(0,i.kt)("p",null,"Enums representing the fields available in a ",(0,i.kt)("a",{parentName:"p",href:"#storedtrialsample"},(0,i.kt)("inlineCode",{parentName:"a"},"StoredTrialSample")),". Used to filter desired fields."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"enum StoredTrialSampleField {\n STORED_TRIAL_SAMPLE_FIELD_UNKNOWN = 0;\n STORED_TRIAL_SAMPLE_FIELD_OBSERVATION = 1;\n STORED_TRIAL_SAMPLE_FIELD_ACTION = 2;\n STORED_TRIAL_SAMPLE_FIELD_REWARD = 3;\n STORED_TRIAL_SAMPLE_FIELD_RECEIVED_REWARDS = 4;\n STORED_TRIAL_SAMPLE_FIELD_SENT_REWARDS = 5;\n STORED_TRIAL_SAMPLE_FIELD_RECEIVED_MESSAGES = 6;\n STORED_TRIAL_SAMPLE_FIELD_SENT_MESSAGES = 7;\n}\n")),(0,i.kt)("h3",{id:"retrievetrialsrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"RetrieveTrialsRequest")),(0,i.kt)("p",null,"Request for ",(0,i.kt)("a",{parentName:"p",href:"#retrievetrials"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialDatastoreSP.RetrieveTrials()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RetrieveTrialsRequest {\n repeated string trial_ids = 1;\n uint32 timeout = 2;\n uint32 trials_count = 3;\n string trial_handle = 4;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_ids"),": List of desired trial identifiers, if empty all trials are returned."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"timeout"),": (optional - in ms) Wait for trials that might be created within this duration."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trials_count"),": (optional) The desired number of trials to be retrieved, leave empty (or set to 0) for no limit."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_handle"),": (optional) Leave empty for the initial request, use previously provided ",(0,i.kt)("inlineCode",{parentName:"li"},"RetrieveTrialsReply.next_trial_handle")," on the next calls to retrieve the next versions.")),(0,i.kt)("h3",{id:"retrievetrialsreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"RetrieveTrialsReply")),(0,i.kt)("p",null,"Reply for ",(0,i.kt)("a",{parentName:"p",href:"#retrievetrials"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialDatastoreSP.RetrieveTrials()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RetrieveTrialsReply {\n repeated StoredTrialInfo trial_infos = 1;\n string next_trial_handle = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"version_infos"),": At most ",(0,i.kt)("inlineCode",{parentName:"li"},"RetrieveVersionInfosRequest.versions_count")," versions."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"next_version_handle"),": Opaque handle to be used to retrieve the next versions matching the request.")),(0,i.kt)("h3",{id:"retrievesamplesrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"RetrieveSamplesRequest")),(0,i.kt)("p",null,"Request for ",(0,i.kt)("a",{parentName:"p",href:"#retrievesamples"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialDatastoreSP.RetrieveSamples()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RetrieveSamplesRequest {\n repeated string trial_ids = 1;\n repeated string actor_names = 2;\n repeated string actor_classes = 3;\n repeated string actor_implementations = 4;\n repeated StoredTrialSampleField selected_sample_fields = 5;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_ids"),": List of desired trial ids, if empty no data will be returned."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_names"),": List of desired actor names, if empty all actor samples will be returned."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes"),": List of desired actor names, if empty all actor samples will be returned."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_implementations"),": List of desired actor classes, if empty all actor samples will be returned."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"selected_sample_fields"),": (optional) Which fields of ",(0,i.kt)("inlineCode",{parentName:"li"},"StoredTrialSample.ActorSample")," should be returned, if empty all fields are returned.")),(0,i.kt)("h3",{id:"retrievesamplereply"},(0,i.kt)("inlineCode",{parentName:"h3"},"RetrieveSampleReply")),(0,i.kt)("p",null,"Part of the reply stream of ",(0,i.kt)("a",{parentName:"p",href:"#retrievesamples"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialDatastoreSP.RetrieveSamples()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RetrieveSampleReply {\n StoredTrialSample trial_sample = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_sample"),": One ",(0,i.kt)("a",{parentName:"li",href:"#storedtrialsample"},"trial sample")," matching the requested ",(0,i.kt)("inlineCode",{parentName:"li"},"trial_ids")," and filtered according to the desired actors and fields.")),(0,i.kt)("h3",{id:"addtrialrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"AddTrialRequest")),(0,i.kt)("p",null,"Request for ",(0,i.kt)("a",{parentName:"p",href:"#addtrial"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialDatastoreSP.AddTrial()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message AddTrialRequest {\n string user_id = 1;\n TrialParams trial_params = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"user_id"),": The ID of the user that is adding the trial."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_params"),": ",(0,i.kt)("a",{parentName:"li",href:"#trialparams"},"Parameters of the trial"),".")),(0,i.kt)("h3",{id:"addtrialreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"AddTrialReply")),(0,i.kt)("p",null,"Reply for ",(0,i.kt)("a",{parentName:"p",href:"#addtrial"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialDatastoreSP.AddTrial()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message AddTrialReply {}\n")),(0,i.kt)("h3",{id:"addsamplerequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"AddSampleRequest")),(0,i.kt)("p",null,"Part of the request stream of ",(0,i.kt)("a",{parentName:"p",href:"#addsample"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialDatastoreSP.AddSample()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message AddSampleRequest {\n StoredTrialSample trial_sample = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_sample"),": One ",(0,i.kt)("a",{parentName:"li",href:"#storedtrialsample"},"trial sample")," that should match the parameters of the target trial.")),(0,i.kt)("h3",{id:"addsamplesreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"AddSamplesReply")),(0,i.kt)("p",null,"Reply for ",(0,i.kt)("a",{parentName:"p",href:"#addsample"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialDatastoreSP.AddSample()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message AddSamplesReply {}\n")),(0,i.kt)("h3",{id:"deletetrialsrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"DeleteTrialsRequest")),(0,i.kt)("p",null,"Request for ",(0,i.kt)("a",{parentName:"p",href:"#deletetrials"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialDatastoreSP.DeleteTrials()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message DeleteTrialsRequest {\n repeated string trial_ids = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_ids"),": List of the trial ids to delete, if empty no trial is deleted.")),(0,i.kt)("h3",{id:"deletetrialsreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"DeleteTrialsReply")),(0,i.kt)("p",null,"Reply for ",(0,i.kt)("a",{parentName:"p",href:"#deletetrials"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialDatastoreSP.DeleteTrials()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message DeleteTrialsReply {}\n")),(0,i.kt)("h3",{id:"trialsamplesfileheader"},(0,i.kt)("inlineCode",{parentName:"h3"},"TrialSamplesFileHeader")),(0,i.kt)("p",null,"Header for the trial samples file that can be exported using ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cli/trial-datastore/trial-datastore-client#export-command"},(0,i.kt)("inlineCode",{parentName:"a"},"cogment client export")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TrialSamplesFileHeader {\n VersionInfo version_info = 1;\n fixed64 export_timestamp = 2;\n map<string, TrialParams> trial_params = 3;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"version_info"),": (",(0,i.kt)("a",{parentName:"li",href:"#versioninfo"},(0,i.kt)("inlineCode",{parentName:"a"},"cogmentAPI.VersionInfo")),") Version information for the used Cogment CLI."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"export_timestamp"),": (fixed64) The wall-clock time in nanoseconds since 00:00:00UTC January 1, 1970 (Unix Epoch time) at export."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_params"),": (",(0,i.kt)("a",{parentName:"li",href:"#trialparams"},(0,i.kt)("inlineCode",{parentName:"a"},"map<string, cogmentAPI.TrialParams>")),") Parameters of the trials exported in the file referenced by their ID.")),(0,i.kt)("h4",{id:"version-7"},(0,i.kt)("inlineCode",{parentName:"h4"},"Version()")),(0,i.kt)("p",null,"Called to request version data."),(0,i.kt)("p",null,"Metadata: None"))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/d04964af.dad4b03c.js b/assets/js/d04964af.dad4b03c.js deleted file mode 100644 index 8707588..0000000 --- a/assets/js/d04964af.dad4b03c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[5893],{3905:(e,t,a)=>{a.d(t,{Zo:()=>p,kt:()=>c});var n=a(7294);function i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function r(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function l(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?r(Object(a),!0).forEach((function(t){i(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):r(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function o(e,t){if(null==e)return{};var a,n,i=function(e,t){if(null==e)return{};var a,n,i={},r=Object.keys(e);for(n=0;n<r.length;n++)a=r[n],t.indexOf(a)>=0||(i[a]=e[a]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var s=n.createContext({}),d=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},p=function(e){var t=d(e.components);return n.createElement(s.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},u=n.forwardRef((function(e,t){var a=e.components,i=e.mdxType,r=e.originalType,s=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),u=d(a),c=i,h=u["".concat(s,".").concat(c)]||u[c]||m[c]||r;return a?n.createElement(h,l(l({ref:t},p),{},{components:a})):n.createElement(h,l({ref:t},p))}));function c(e,t){var a=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var r=a.length,l=new Array(r);l[0]=u;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o.mdxType="string"==typeof e?e:i,l[1]=o;for(var d=2;d<r;d++)l[d]=a[d];return n.createElement.apply(null,l)}return n.createElement.apply(null,a)}u.displayName="MDXCreateElement"},6111:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>m,frontMatter:()=>r,metadata:()=>o,toc:()=>d});var n=a(7462),i=(a(7294),a(3905));const r={sidebar_position:7},l="gRPC API",o={unversionedId:"reference/grpc",id:"reference/grpc",title:"gRPC API",description:"The low-level cogment communication API is implemented using gRPC services.",source:"@site/docs/reference/grpc.md",sourceDirName:"reference",slug:"/reference/grpc",permalink:"/docs/reference/grpc",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:7,frontMatter:{sidebar_position:7},sidebar:"docSidebar",previous:{title:"Runner",permalink:"/docs/reference/python-enterprise/runner"},next:{title:"Cogment 2.0",permalink:"/docs/reference/cogment-v2-changes"}},s={},d=[{value:"General",id:"general",level:2},{value:"Limitations",id:"limitations",level:3},{value:"Common types",id:"common-types",level:2},{value:"Common Values",id:"common-values",level:3},{value:"<code>VersionRequest</code>",id:"versionrequest",level:3},{value:"<code>VersionInfo</code>",id:"versioninfo",level:3},{value:"<code>StatusRequest</code>",id:"statusrequest",level:3},{value:"<code>StatusReply</code>",id:"statusreply",level:3},{value:"<code>TrialParams</code>",id:"trialparams",level:3},{value:"<code>DatalogParams</code>",id:"datalogparams",level:3},{value:"<code>EnvironmentParams</code>",id:"environmentparams",level:3},{value:"<code>ActorParams</code>",id:"actorparams",level:3},{value:"<code>SerializedMessage</code>",id:"serializedmessage",level:3},{value:"<code>TrialActor</code>",id:"trialactor",level:3},{value:"<code>Observation</code>",id:"observation",level:3},{value:"<code>Action</code>",id:"action",level:3},{value:"<code>Message</code>",id:"message",level:3},{value:"<code>RewardSource</code>",id:"rewardsource",level:3},{value:"<code>Reward</code>",id:"reward",level:3},{value:"<code>ObservationSet</code>",id:"observationset",level:3},{value:"<code>ActionSet</code>",id:"actionset",level:3},{value:"<code>TrialState</code>",id:"trialstate",level:3},{value:"<code>CommunicationState</code>",id:"communicationstate",level:3},{value:"Control API",id:"control-api",level:2},{value:"Service <code>TrialLifecycleSP</code>",id:"service-triallifecyclesp",level:3},{value:"<code>StartTrial()</code>",id:"starttrial",level:4},{value:"<code>TerminateTrial()</code>",id:"terminatetrial",level:4},{value:"<code>GetTrialInfo()</code>",id:"gettrialinfo",level:4},{value:"<code>WatchTrials()</code>",id:"watchtrials",level:4},{value:"<code>Version()</code>",id:"version",level:4},{value:"<code>TrialStartRequest</code>",id:"trialstartrequest",level:3},{value:"<code>TrialStartReply</code>",id:"trialstartreply",level:3},{value:"<code>TerminateTrialRequest</code>",id:"terminatetrialrequest",level:3},{value:"<code>TerminateTrialReply</code>",id:"terminatetrialreply",level:3},{value:"<code>TrialInfoRequest</code>",id:"trialinforequest",level:3},{value:"<code>TrialInfoReply</code>",id:"trialinforeply",level:3},{value:"<code>TrialInfo</code>",id:"trialinfo",level:3},{value:"<code>TrialListRequest</code>",id:"triallistrequest",level:3},{value:"<code>TrialListEntry</code>",id:"triallistentry",level:3},{value:"Actor API",id:"actor-api",level:2},{value:"Service Actor API",id:"service-actor-api",level:3},{value:"Service <code>ServiceActorSP</code>",id:"service-serviceactorsp",level:4},{value:"Client Actor API",id:"client-actor-api",level:3},{value:"Service <code>ClientActorSP</code>",id:"service-clientactorsp",level:4},{value:"<code>RunTrial()</code>",id:"runtrial",level:3},{value:"<code>Version()</code>",id:"version-1",level:3},{value:"<code>ActorRunTrialInput</code>",id:"actorruntrialinput",level:3},{value:"<code>ActorRunTrialOutput</code>",id:"actorruntrialoutput",level:3},{value:"<code>ActorInitialInput</code>",id:"actorinitialinput",level:3},{value:"<code>ActorInitialOutput</code>",id:"actorinitialoutput",level:3},{value:"Environment API",id:"environment-api",level:2},{value:"Service <code>EnvironmentSP</code>",id:"service-environmentsp",level:3},{value:"<code>RunTrial()</code>",id:"runtrial-1",level:4},{value:"<code>Version()</code>",id:"version-2",level:4},{value:"<code>EnvrRunTrialInput</code>",id:"envrruntrialinput",level:3},{value:"<code>EnvRunTrialOutput</code>",id:"envruntrialoutput",level:3},{value:"<code>EnvInitialInput</code>",id:"envinitialinput",level:3},{value:"<code>EnvInitialOutput</code>",id:"envinitialoutput",level:3},{value:"Data/Log API",id:"datalog-api",level:2},{value:"Service <code>LogExporterSP</code>",id:"service-logexportersp",level:3},{value:"<code>RunTrialDatalog()</code>",id:"runtrialdatalog",level:4},{value:"<code>Version()</code>",id:"version-3",level:4},{value:"<code>LogExporterSampleRequest</code>",id:"logexportersamplerequest",level:3},{value:"<code>LogExporterSampleReply</code>",id:"logexportersamplereply",level:3},{value:"Hook API",id:"hook-api",level:2},{value:"Service <code>TrialHooksSP</code>",id:"service-trialhookssp",level:3},{value:"<code>OnPreTrial()</code>",id:"onpretrial",level:4},{value:"<code>Version()</code>",id:"version-4",level:4},{value:"Directory API",id:"directory-api",level:2},{value:"Service <code>DirectorySP</code>",id:"service-directorysp",level:3},{value:"<code>Register()</code>",id:"register",level:4},{value:"<code>Deregister()</code>",id:"deregister",level:4},{value:"<code>Inquire()</code>",id:"inquire",level:4},{value:"<code>Version()</code>",id:"version-5",level:4},{value:"<code>ServiceType</code>",id:"servicetype",level:3},{value:"<code>ServiceDetails</code>",id:"servicedetails",level:3},{value:"<code>ServiceEndpoint</code>",id:"serviceendpoint",level:3},{value:"<code>RegisterRequest</code>",id:"registerrequest",level:3},{value:"<code>RegisterReply</code>",id:"registerreply",level:3},{value:"<code>DeregisterRequest</code>",id:"deregisterrequest",level:3},{value:"<code>DeregisterReply</code>",id:"deregisterreply",level:3},{value:"<code>InquireRequest</code>",id:"inquirerequest",level:3},{value:"<code>InquireReply</code>",id:"inquirereply",level:3},{value:"Model Registry API",id:"model-registry-api",level:2},{value:"Service <code>ModelRegistrySP</code>",id:"service-modelregistrysp",level:3},{value:"<code>CreateOrUpdateModel()</code>",id:"createorupdatemodel",level:4},{value:"<code>DeleteModel()</code>",id:"deletemodel",level:4},{value:"<code>RetrieveModels()</code>",id:"retrievemodels",level:4},{value:"<code>CreateVersion()</code>",id:"createversion",level:4},{value:"<code>RetrieveVersionInfos()</code>",id:"retrieveversioninfos",level:4},{value:"<code>RetrieveVersionData()</code>",id:"retrieveversiondata",level:4},{value:"<code>CreateOrUpdateModelRequest</code>",id:"createorupdatemodelrequest",level:3},{value:"<code>CreateOrUpdateModelReply</code>",id:"createorupdatemodelreply",level:3},{value:"<code>DeleteModelRequest</code>",id:"deletemodelrequest",level:3},{value:"<code>DeleteModelReply</code>",id:"deletemodelreply",level:3},{value:"<code>RetrieveModelsRequest</code>",id:"retrievemodelsrequest",level:3},{value:"<code>RetrieveModelsReply</code>",id:"retrievemodelsreply",level:3},{value:"<code>CreateVersionRequestChunk</code>",id:"createversionrequestchunk",level:3},{value:"<code>CreateVersionReply</code>",id:"createversionreply",level:3},{value:"<code>RetrieveVersionInfosRequest</code>",id:"retrieveversioninfosrequest",level:3},{value:"<code>RetrieveVersionInfosReply</code>",id:"retrieveversioninfosreply",level:3},{value:"<code>RetrieveVersionDataRequest</code>",id:"retrieveversiondatarequest",level:3},{value:"<code>RetrieveVersionDataReplyChunk</code>",id:"retrieveversiondatareplychunk",level:3},{value:"<code>ModelInfo</code>",id:"modelinfo",level:3},{value:"<code>ModelVersionInfo</code>",id:"modelversioninfo",level:3},{value:"<code>Version()</code>",id:"version-6",level:4},{value:"Trial Datastore API",id:"trial-datastore-api",level:2},{value:"Service <code>TrialDatastoreSP</code>",id:"service-trialdatastoresp",level:3},{value:"<code>RetrieveTrials()</code>",id:"retrievetrials",level:4},{value:"<code>RetrieveSamples()</code>",id:"retrievesamples",level:4},{value:"<code>AddTrial()</code>",id:"addtrial",level:4},{value:"<code>AddSample()</code>",id:"addsample",level:4},{value:"<code>DeleteTrials()</code>",id:"deletetrials",level:4},{value:"<code>StoredTrialInfo</code>",id:"storedtrialinfo",level:3},{value:"<code>StoredTrialSample</code>",id:"storedtrialsample",level:3},{value:"<code>StoredTrialActorSample</code>",id:"storedtrialactorsample",level:3},{value:"<code>StoredTrialActorSampleReward</code>",id:"storedtrialactorsamplereward",level:3},{value:"<code>StoredTrialActorSampleMessage</code>",id:"storedtrialactorsamplemessage",level:3},{value:"<code>StoredTrialSampleField</code>",id:"storedtrialsamplefield",level:3},{value:"<code>RetrieveTrialsRequest</code>",id:"retrievetrialsrequest",level:3},{value:"<code>RetrieveTrialsReply</code>",id:"retrievetrialsreply",level:3},{value:"<code>RetrieveSamplesRequest</code>",id:"retrievesamplesrequest",level:3},{value:"<code>RetrieveSampleReply</code>",id:"retrievesamplereply",level:3},{value:"<code>AddTrialRequest</code>",id:"addtrialrequest",level:3},{value:"<code>AddTrialReply</code>",id:"addtrialreply",level:3},{value:"<code>AddSampleRequest</code>",id:"addsamplerequest",level:3},{value:"<code>AddSamplesReply</code>",id:"addsamplesreply",level:3},{value:"<code>DeleteTrialsRequest</code>",id:"deletetrialsrequest",level:3},{value:"<code>DeleteTrialsReply</code>",id:"deletetrialsreply",level:3},{value:"<code>TrialSamplesFileHeader</code>",id:"trialsamplesfileheader",level:3},{value:"<code>Version()</code>",id:"version-7",level:4}],p={toc:d};function m(e){let{components:t,...a}=e;return(0,i.kt)("wrapper",(0,n.Z)({},p,a,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"grpc-api"},"gRPC API"),(0,i.kt)("p",null,"The low-level cogment communication API is implemented using ",(0,i.kt)("a",{parentName:"p",href:"https://grpc.github.io/"},"gRPC")," services.\nThese services are collections of procedures to be called remotely (RPC).\ngRPC abstracts the network communication with familiar looking functions (representing the defined procedures), in any number of programming languages.\nHow services are implemented or accessed is highly dependant on the programming language being interfaced, and is beyond the scope of this document (see gRPC API documentation)."),(0,i.kt)("p",null,"This reference requires a basic understanding of gRPC, and in particular the format of the ",(0,i.kt)("inlineCode",{parentName:"p"},"*.proto")," files."),(0,i.kt)("admonition",{type:"info"},(0,i.kt)("p",{parentName:"admonition"},"Cogment's gRPC API is defined and released alongside the ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cli/"},"Cogment CLI"),", the latest version can be accessed at ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment/tree/main/packages/grpc_api"},"https://github.com/cogment/cogment/tree/main/packages/grpc_api"),".")),(0,i.kt)("h2",{id:"general"},"General"),(0,i.kt)("p",null,"In this API, the ",(0,i.kt)("inlineCode",{parentName:"p"},"bytes")," data type is normally used to contain the serialized data of externally defined messages. These messages are well defined in the trial specifications file."),(0,i.kt)("p",null,"On the other hand, the ",(0,i.kt)("inlineCode",{parentName:"p"},"google.protobuf.Any")," data type is normally used to contain messages that are not pre-defined (thus unknown by the framework), and may be decided at runtime. It is then the responsibility of the receiver to deserialize in the correct message type."),(0,i.kt)("p",null,"Empty messages are normally used as a placeholder for easy future, backward compatible, extension to the API."),(0,i.kt)("p",null,"In this API, ",(0,i.kt)("a",{parentName:"p",href:"https://grpc.io/docs/what-is-grpc/core-concepts/#metadata"},"gRPC metadata")," is normally used only for service request (by the caller) for identifying purposes. The details of the required metadata are described with the service calls. Service replies (the callees) are not expected to provide metadata."),(0,i.kt)("p",null,"In some places in the API, we use a list of actor data without information about which actor is where in the list.\nThese lists have a constant length and order throughout a trial (set in the trial parameters), and thus can/must be cross referenced with other such lists within the same trial (e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"actors_in_trial"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"actors_map"),").\nThe actor can be inferred by the position in the list, and the index into the list can sometimes be used to identify an actor."),(0,i.kt)("p",null,'gRPC service names in Cogment are suffixed with "SP" (Service Point).'),(0,i.kt)("h3",{id:"limitations"},"Limitations"),(0,i.kt)("p",null,"Due to normal network delays and unpredictability of the various components, there are limitations related to the communication with the Orchestrator that translate in issues that can arise."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},'In the current version, to simplify the implementation, there is an expectation of "good behavior" from the various components:',(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Actors are expected to respond with an action only after receiving an observation, and to send only one action per observation received."),(0,i.kt)("li",{parentName:"ul"},"The environment is expected to respond with an observation set only after receiving an action set, and to send only one observation set per action set received (and one initial observation set)."),(0,i.kt)("li",{parentName:"ul"},"All components are expected to respond within a reasonable amount of time."),(0,i.kt)("li",{parentName:"ul"},"Hooks do not assume to receive specific parameters, they reply only with well formed parameters, and they do not assume a specific order of hooks being called (when multiple hooks are defined)."),(0,i.kt)("li",{parentName:"ul"},"A ",(0,i.kt)("inlineCode",{parentName:"li"},"TerminateTrial")," (from the Control API) is called only a reasonable delay after a ",(0,i.kt)("inlineCode",{parentName:"li"},"StartTrial")," (e.g. after at least two ticks have executed)."),(0,i.kt)("li",{parentName:"ul"},'Note that what constitutes a "reasonable" amount of time is dependent on many variables.')))),(0,i.kt)("h2",{id:"common-types"},"Common types"),(0,i.kt)("p",null,"Most of the common messages are defined in the ",(0,i.kt)("inlineCode",{parentName:"p"},"common.proto")," file. ",(0,i.kt)("inlineCode",{parentName:"p"},"ObservationSet")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"ActionSet")," are defined in ",(0,i.kt)("inlineCode",{parentName:"p"},"environment.proto"),"."),(0,i.kt)("h3",{id:"common-values"},"Common Values"),(0,i.kt)("p",null,"Some values (and their standardized names) are recurrent throughout the gRPC API."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"tick_id: (uint64/sint64) The monotonic time, in number of steps, since the start of the trial. As an ID, it represents a discrete step in the processing of the trial. A step starts with observations representing a specific point in time, that are followed by actions, rewards and messages in relation to these observations. The first tick ID is 0. Some of these values may accept -1, meaning the latest step (e.g. when sending an action)."),(0,i.kt)("li",{parentName:"ul"},"timestamp: (fixed64) The wall-clock time in nanoseconds since 00:00:00UTC January 1, 1970 (Unix Epoch time)."),(0,i.kt)("li",{parentName:"ul"},"trial_id: (string) The identifier (name) of the trial.")),(0,i.kt)("h3",{id:"versionrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"VersionRequest")),(0,i.kt)("p",null,"Empty message to serve as the request for the ",(0,i.kt)("inlineCode",{parentName:"p"},"Version")," procedure (present in all gRPC services defined in the Cogment API)."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message VersionRequest {}\n")),(0,i.kt)("h3",{id:"versioninfo"},(0,i.kt)("inlineCode",{parentName:"h3"},"VersionInfo")),(0,i.kt)("p",null,"Reply message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"Version"),' procedure (present in all gRPC services defined in the API).\nIt contains a list of version information.\nThe Cogment framework expects at least "cogment-api" and "grpc" versions to be present in the list. The "cogment-api" is for the local version of the Cogment API used by the service. The "grpc" is for the version of gRPC used by the service.\nOther reported versions are specific to the service called, possibly for use by utility and management tools.'),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message Version {\n string name = 1;\n string version = 2;\n}\n\nmessage VersionInfo {\n repeated Version versions = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"versions: List of version information."),(0,i.kt)("li",{parentName:"ul"},'name: The name/software/module for which the version is given. E.g. "cogment-api".'),(0,i.kt)("li",{parentName:"ul"},'version: The version related to the name. E.g. "1.0.0b5".')),(0,i.kt)("h3",{id:"statusrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"StatusRequest")),(0,i.kt)("p",null,"Request message for ",(0,i.kt)("inlineCode",{parentName:"p"},"Status"),' procedure (present in all gRPC services defined in the Cogment API).\nIt contains the list of states and statuses (hereafter referred as "statuses") to request from the service.'),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message StatusRequest {\n repeated string names = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"names: The names of the statuses to request. If a name does not exist, it is ignored (i.e. it does not cause an error).")),(0,i.kt)("p",null,"If no names are requested, the reply will be empty.\nThis can be used as a health/communication check for the service."),(0,i.kt)("p",null,'The "',"*",'" name is always defined. It is not really a status in itself, but requests all ',(0,i.kt)("em",{parentName:"p"},"standard")," statuses.\nWhat it means for a status to be standard depends on the service.\nNon-standard statuses need to be requested explicitly."),(0,i.kt)("p",null,"Names that are usually defined:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},'"overall_load": A representation of the load on the machine where the service is running. A specific meaning is associated with this status by the Cogment Directory ',(0,i.kt)("a",{parentName:"li",href:"/docs/reference/cli/directory/directory-server#load-balancing"},"Load Balancing")," mechanism.")),(0,i.kt)("h3",{id:"statusreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"StatusReply")),(0,i.kt)("p",null,"Reply message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"Status")," procedure (present in all gRPC services defined in the API).\nIt contains the list of requested (and available) statuses.\nReported statuses are specific to the service called (or the machine/system/network it is running on)."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message StatusReply {\n map<string, string> statuses = 1; // <name, value>\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"statuses: Requested statuses (name/value) that are available, in no particular order.")),(0,i.kt)("h3",{id:"trialparams"},(0,i.kt)("inlineCode",{parentName:"h3"},"TrialParams")),(0,i.kt)("p",null,"Global parameters for a trial (see ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#trial-parameters"},"Trial Parameters"),")."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TrialParams {\n SerializedMessage trial_config = 1;\n DatalogParams datalog = 2;\n EnvironmentParams environment = 3;\n repeated ActorParams actors = 4;\n uint32 max_steps = 5;\n uint32 max_inactivity = 6;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"trial_config"),(0,i.kt)("li",{parentName:"ul"},"datalog: (optional) The parameters for the datalog of the trial. If not present, data logging is disabled."),(0,i.kt)("li",{parentName:"ul"},"environment: The parameters for the environment of the trial."),(0,i.kt)("li",{parentName:"ul"},"actors: The parameters for all actors involved in the trial. This list's length and order define the length and order of the lists of actors provided in different places in the API (e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"actors_in_trial"),") for the trial."),(0,i.kt)("li",{parentName:"ul"},"max_steps"),(0,i.kt)("li",{parentName:"ul"},"max_inactivity")),(0,i.kt)("h3",{id:"datalogparams"},(0,i.kt)("inlineCode",{parentName:"h3"},"DatalogParams")),(0,i.kt)("p",null,"Parameters related to the data logger (see ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#trial-parameters"},"Trial Parameters"),")."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message DatalogParams {\n string endpoint = 1;\n repeated string exclude_fields = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"endpoint: This is used by the Orchestrator to connect to the datalog using the ",(0,i.kt)("inlineCode",{parentName:"li"},"LogExporterSP")," gRPC service."),(0,i.kt)("li",{parentName:"ul"},"exclude_fields")),(0,i.kt)("h3",{id:"environmentparams"},(0,i.kt)("inlineCode",{parentName:"h3"},"EnvironmentParams")),(0,i.kt)("p",null,"Parameters related to an environment (see ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#trial-parameters"},"Trial Parameters"),")."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message EnvironmentParams {\n string endpoint = 1;\n SerializedMessage config = 2;\n string implementation = 3;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"endpoint: This is used by the Orchestrator to connect to the environment using the ",(0,i.kt)("inlineCode",{parentName:"li"},"EnvironmentSP")," gRPC service."),(0,i.kt)("li",{parentName:"ul"},"config"),(0,i.kt)("li",{parentName:"ul"},"implementation")),(0,i.kt)("h3",{id:"actorparams"},(0,i.kt)("inlineCode",{parentName:"h3"},"ActorParams")),(0,i.kt)("p",null,"Parameters related to an actor (see ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters#trial-parameters"},"Trial Parameters"),")."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message ActorParams {\n string name = 1;\n string actor_class = 2;\n string endpoint = 3;\n string implementation = 4;\n SerializedMessage config = 5;\n float initial_connection_timeout = 6;\n float response_timeout = 7;\n bool optional = 8;\n SerializedMessage default_action = 9;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"name"),(0,i.kt)("li",{parentName:"ul"},"actor_class"),(0,i.kt)("li",{parentName:"ul"},"endpoint: The endpoint is used by the Orchestrator to connect to the actor using the ",(0,i.kt)("inlineCode",{parentName:"li"},"ServiceActorSP"),' gRPC service. If set to "cogment://client", then the actor is a client and will connect to the Orchestrator instead, using the ',(0,i.kt)("inlineCode",{parentName:"li"},"ClientActorSP")," gRPC service."),(0,i.kt)("li",{parentName:"ul"},"implementation"),(0,i.kt)("li",{parentName:"ul"},"config"),(0,i.kt)("li",{parentName:"ul"},"initial_connection_timeout"),(0,i.kt)("li",{parentName:"ul"},"response_timeout"),(0,i.kt)("li",{parentName:"ul"},"optional"),(0,i.kt)("li",{parentName:"ul"},"default_action")),(0,i.kt)("h3",{id:"serializedmessage"},(0,i.kt)("inlineCode",{parentName:"h3"},"SerializedMessage")),(0,i.kt)("p",null,"This contains an optional serialized protobuf message (e.g. config) defined by the user in the spec file. The bytes content is wrapped in a message to be able to differentiate between a default content (i.e. length 0) and the absence of content. This is easily done by testing for the presence of the message."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message SerializedMessage {\n bytes content = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"content: A serialized protobuf message. E.g. for configs of a particular trial, the actual message type is defined in the spec file in its respective section: ",(0,i.kt)("inlineCode",{parentName:"li"},"trial:config_type"),", ",(0,i.kt)("inlineCode",{parentName:"li"},"environment:config_type"),", and ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes:config_type"),".")),(0,i.kt)("h3",{id:"trialactor"},(0,i.kt)("inlineCode",{parentName:"h3"},"TrialActor")),(0,i.kt)("p",null,"Details of an actor participating in a trial."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TrialActor {\n string name = 1;\n string actor_class = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"name: The name of the actor."),(0,i.kt)("li",{parentName:"ul"},"actor_class: The name of the class of actor. For a particular trial, the possible actor classes are defined in the the spec file in the ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes:name")," sections.")),(0,i.kt)("h3",{id:"observation"},(0,i.kt)("inlineCode",{parentName:"h3"},"Observation")),(0,i.kt)("p",null,"A singular observation."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message Observation {\n uint64 tick_id = 1;\n fixed64 timestamp = 2;\n bytes content = 3;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"tick_id: Tick of this observation."),(0,i.kt)("li",{parentName:"ul"},"timestamp: The time of the observation."),(0,i.kt)("li",{parentName:"ul"},"content: The serialized protobuf message representing an observation for a specific actor. In a particular trial, the actual message type for the observation space is defined in the spec file for each actor class in section ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes:observation:space"),". Note that the specific actor represented is defined by the enclosing message.")),(0,i.kt)("h3",{id:"action"},(0,i.kt)("inlineCode",{parentName:"h3"},"Action")),(0,i.kt)("p",null,"Data associated with an actor's action."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message Action {\n uint64 tick_id = 1;\n fixed64 timestamp = 2;\n bytes content = 3;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"tick_id: The tick of the observation on which the action is taken."),(0,i.kt)("li",{parentName:"ul"},"timestamp: The time of the action."),(0,i.kt)("li",{parentName:"ul"},"content: The serialized protobuf message representing an action from a specific actor. In a particular trial, the actual message type for the action space is defined in the spec file for each actor class in section ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes:action:space"),". Note that the specific actor represented is defined by the enclosing message.")),(0,i.kt)("h3",{id:"message"},(0,i.kt)("inlineCode",{parentName:"h3"},"Message")),(0,i.kt)("p",null,"Data associated with a communication (message) destined for an actor or the environment."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message Message {\n sint64 tick_id = 1;\n string sender_name = 2;\n string receiver_name = 3;\n google.protobuf.Any payload = 4;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"tick_id: Tick associated with the message."),(0,i.kt)("li",{parentName:"ul"},"sender_name: The name of the sending actor/environment. This is optional when sending messages (i.e. the sender is already known)."),(0,i.kt)("li",{parentName:"ul"},"receiver_name: The name of the target/receiving actor/environment."),(0,i.kt)("li",{parentName:"ul"},"payload: Data for the target actor/environment. It is the responsibility of the target to understand the type received.")),(0,i.kt)("h3",{id:"rewardsource"},(0,i.kt)("inlineCode",{parentName:"h3"},"RewardSource")),(0,i.kt)("p",null,"Data representing a simple reward source made by a single component/sender, usually for the purpose of training automated agents."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RewardSource {\n string sender_name = 1;\n float value = 2;\n float confidence = 3;\n google.protobuf.Any user_data = 4;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"sender_name: Name of the sender that sent the reward. This is not needed when sending because it will be set by the orchestrator. It is only used by receiving actors."),(0,i.kt)("li",{parentName:"ul"},"value: The numerical value of the provided reward."),(0,i.kt)("li",{parentName:"ul"},"confidence: The weight of this reward in computing the final (aggregated) reward."),(0,i.kt)("li",{parentName:"ul"},"user_data: Additional user data to be consumed by the receiving actor. It is the responsibility of the receiver to understand the type received.")),(0,i.kt)("h3",{id:"reward"},(0,i.kt)("inlineCode",{parentName:"h3"},"Reward")),(0,i.kt)("p",null,"Data representing a reward sent or received, usually for the purpose of training automated agents.\nThis is an aggregate of possibly multiple ",(0,i.kt)("inlineCode",{parentName:"p"},"RewardSource")," (but at least one)."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message Reward {\n sint64 tick_id = 1;\n string receiver_name = 2;\n float value = 3;\n repeated RewardSource sources = 4;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"tick_id: The tick associated with the reward. If set to ",(0,i.kt)("inlineCode",{parentName:"li"},"-1")," when sending a reward, the orchestrator will automatically assign the latest tick. This will always be a valid tick (i.e. >= 0) when receiving a reward."),(0,i.kt)("li",{parentName:"ul"},"receiver_name: Name of the receiving actor (the reward destination)."),(0,i.kt)("li",{parentName:"ul"},"value: The aggregated value (weighted sum) of the provided reward sources. May be ignored when sending a reward; The final value will be computed by the orchestrator."),(0,i.kt)("li",{parentName:"ul"},"sources: The simple reward sources that form this aggregated reward. There must be at least one.")),(0,i.kt)("h3",{id:"observationset"},(0,i.kt)("inlineCode",{parentName:"h3"},"ObservationSet")),(0,i.kt)("p",null,"A set of environment observations for all actors in the trial."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message ObservationSet {\n uint64 tick_id = 1;\n fixed64 timestamp = 2;\n repeated bytes observations = 3;\n repeated int32 actors_map = 4;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"tick_id: The tick to which the observations relate to."),(0,i.kt)("li",{parentName:"ul"},"timestamp: The time when the observation set was made."),(0,i.kt)("li",{parentName:"ul"},"observations: A list of observations. Indexed into by the ",(0,i.kt)("inlineCode",{parentName:"li"},"actors_map"),". Each ",(0,i.kt)("inlineCode",{parentName:"li"},"bytes")," chunk is a serialized protobuf message representing an observation for a specific actor class. For a particular trial, the actual message type for the observation space is defined in the spec file for each actor class in section ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes:observation:space"),". Note that the specific actor represented is defined by the ",(0,i.kt)("inlineCode",{parentName:"li"},"actors_map"),"."),(0,i.kt)("li",{parentName:"ul"},"actors_map: A list of indexes into the ",(0,i.kt)("inlineCode",{parentName:"li"},"observations")," list above. This list of indexes has the same length and order as the list of actors provided in different places in the API (e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"actors_in_trial"),"), for the same trial.")),(0,i.kt)("h3",{id:"actionset"},(0,i.kt)("inlineCode",{parentName:"h3"},"ActionSet")),(0,i.kt)("p",null,"A set of actions from all actors in the trial."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message ActionSet {\n uint64 tick_id = 1;\n fixed64 timestamp = 2;\n repeated bytes actions = 3;\n repeated uint32 unavailable_actors = 4;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"tick_id: The tick to which the actions relate to."),(0,i.kt)("li",{parentName:"ul"},"timestamp: The time when the action set was made (usually after the last action arrived at the Orchestrator)."),(0,i.kt)("li",{parentName:"ul"},"actions: A list of actions. Each ",(0,i.kt)("inlineCode",{parentName:"li"},"bytes")," chunk is a serialized protobuf message representing an action from a specific actor. For an particular trial, the actual message type for the action space is defined in the spec file for each actor class in section ",(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes:action:space"),". This list has the same length and order as the list of actors provided in different places in the API (e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"actors_in_trial"),"), for the same trial."),(0,i.kt)("li",{parentName:"ul"},"unavailable_actors: List of actors (index of actors) that were not available. Actors in this list have invalid data in the ",(0,i.kt)("inlineCode",{parentName:"li"},"actions")," list.")),(0,i.kt)("h3",{id:"trialstate"},(0,i.kt)("inlineCode",{parentName:"h3"},"TrialState")),(0,i.kt)("p",null,"Enum representing the state of a trial."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"enum TrialState {\n UNKNOWN = 0;\n INITIALIZING = 1;\n PENDING = 2;\n RUNNING = 3;\n TERMINATING = 4;\n ENDED = 5;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"UNKNOWN: Should not be used (it's a requirement of protobuf enums to have a 0 default value)."),(0,i.kt)("li",{parentName:"ul"},"INITIALIZING: The trial is in the process of starting."),(0,i.kt)("li",{parentName:"ul"},"PENDING: The trial is waiting for its final parameters, all its components to be ready, and the first observation."),(0,i.kt)("li",{parentName:"ul"},"RUNNING: The trial is running."),(0,i.kt)("li",{parentName:"ul"},"TERMINATING: The trial is in the process of ending (either a request to end has been received or the last observation has been received)."),(0,i.kt)("li",{parentName:"ul"},"ENDED: The trial has ended. Only a set number of ended trials will be kept in memory (configured in the Orchestrator).")),(0,i.kt)("h3",{id:"communicationstate"},(0,i.kt)("inlineCode",{parentName:"h3"},"CommunicationState")),(0,i.kt)("p",null,"Enum representing the state of communication with the actors and environment."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"enum CommunicationState {\n UNKNOWN_COM_STATE = 0;\n NORMAL = 1;\n HEARTBEAT = 2;\n LAST = 3;\n LAST_ACK = 4;\n END = 5;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"UNKNOWN_COM_STATE: Should not be used (it's a requirement of protobuf enums to have a 0 default value)."),(0,i.kt)("li",{parentName:"ul"},"NORMAL: Normal communication message. Always contains data."),(0,i.kt)("li",{parentName:"ul"},"HEARTBEAT: Heartbeat request/reply message. Contains no data. When received, must be responded in kind."),(0,i.kt)("li",{parentName:"ul"},"LAST: Message indicating that the trial is ending, and ending data is following (as ",(0,i.kt)("inlineCode",{parentName:"li"},"NORMAL"),"). Contains no data."),(0,i.kt)("li",{parentName:"ul"},"LAST_ACK: Message indicating that the last data has been sent (i.e. this is the last outgoing message). Contains no data."),(0,i.kt)("li",{parentName:"ul"},"END: Message indicating that the trial has ended (i.e. this is the final message). Contains no data, except maybe for ",(0,i.kt)("inlineCode",{parentName:"li"},"details"),".")),(0,i.kt)("p",null,"The normal (soft) end of a trial follows this sequence :"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},"Orchestrator or Environment sends ",(0,i.kt)("inlineCode",{parentName:"li"},"LAST")),(0,i.kt)("li",{parentName:"ol"},"Exchange of ",(0,i.kt)("inlineCode",{parentName:"li"},"NORMAL")," finalizing data"),(0,i.kt)("li",{parentName:"ol"},"Component sends ",(0,i.kt)("inlineCode",{parentName:"li"},"LAST_ACK")," (component stops sending after this)"),(0,i.kt)("li",{parentName:"ol"},"Orchestrator sends ",(0,i.kt)("inlineCode",{parentName:"li"},"NORMAL")," finalizing data"),(0,i.kt)("li",{parentName:"ol"},"Orchestrator terminates communication with ",(0,i.kt)("inlineCode",{parentName:"li"},"END"))),(0,i.kt)("p",null,"For a hard termination of a trial, the Orchestrator will send ",(0,i.kt)("inlineCode",{parentName:"p"},"END")," to all components (with no ",(0,i.kt)("inlineCode",{parentName:"p"},"LAST"),"/",(0,i.kt)("inlineCode",{parentName:"p"},"LAST_ACK")," handshake)."),(0,i.kt)("h2",{id:"control-api"},"Control API"),(0,i.kt)("p",null,"This API is defined in ",(0,i.kt)("inlineCode",{parentName:"p"},"orchestrator.proto"),". It is implemented by the cogment orchestrator, and client applications are expected to connect to it using the gRPC client API."),(0,i.kt)("p",null,"This API is used for general control and services related to trials."),(0,i.kt)("h3",{id:"service-triallifecyclesp"},"Service ",(0,i.kt)("inlineCode",{parentName:"h3"},"TrialLifecycleSP")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"service TrialLifecycleSP {\n rpc StartTrial(TrialStartRequest) returns (TrialStartReply) {}\n rpc TerminateTrial(TerminateTrialRequest) returns (TerminateTrialReply) {}\n rpc GetTrialInfo(TrialInfoRequest) returns (TrialInfoReply) {}\n rpc WatchTrials(TrialListRequest) returns (stream TrialListEntry) {}\n rpc Version(VersionRequest) returns (VersionInfo) {}\n}\n")),(0,i.kt)("h4",{id:"starttrial"},(0,i.kt)("inlineCode",{parentName:"h4"},"StartTrial()")),(0,i.kt)("p",null,"Start a new trial."),(0,i.kt)("p",null,"Metadata: None"),(0,i.kt)("h4",{id:"terminatetrial"},(0,i.kt)("inlineCode",{parentName:"h4"},"TerminateTrial()")),(0,i.kt)("p",null,"Request the environment to terminate existing trial(s)."),(0,i.kt)("p",null,"Metadata:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial-id"),": (",(0,i.kt)("em",{parentName:"li"},"one or more"),") Identifier(s) of the trial(s) to terminate.")),(0,i.kt)("h4",{id:"gettrialinfo"},(0,i.kt)("inlineCode",{parentName:"h4"},"GetTrialInfo()")),(0,i.kt)("p",null,"Get extra information about an existing trial."),(0,i.kt)("p",null,"Metadata:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial-id"),": (",(0,i.kt)("em",{parentName:"li"},"zero or more"),") Identifier(s) of the trial(s) we are requesting information about. If no trial id is provided, the request is for information about all active trials.")),(0,i.kt)("h4",{id:"watchtrials"},(0,i.kt)("inlineCode",{parentName:"h4"},"WatchTrials()")),(0,i.kt)("p",null,"Stream state changes from trials."),(0,i.kt)("p",null,"Metadata: None"),(0,i.kt)("h4",{id:"version"},(0,i.kt)("inlineCode",{parentName:"h4"},"Version()")),(0,i.kt)("p",null,"Request version data."),(0,i.kt)("p",null,"Metadata: None"),(0,i.kt)("h3",{id:"trialstartrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"TrialStartRequest")),(0,i.kt)("p",null,"Request message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"StartTrial")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TrialStartRequest {\n oneof start_data {\n SerializedMessage config = 1;\n TrialParams params = 4;\n }\n string user_id = 2;\n string trial_id_requested = 3;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"config: The trial config data. This data can be used by the pre-trial hooks to determine the config for the rest of the components."),(0,i.kt)("li",{parentName:"ul"},"params: The fully defined parameters for the new trial. When this is given to start the trial, the default parameters are ignored, and the pre-trial hooks will not be called."),(0,i.kt)("li",{parentName:"ul"},"user_id: The ID of the user that is starting the trial."),(0,i.kt)("li",{parentName:"ul"},"user_id: The ID of the user that is starting the trial."),(0,i.kt)("li",{parentName:"ul"},"trial_id_requested: The trial identifier requested for the new trial. It must be unique. If not empty, the Orchestrator will try to use this trial_id, otherwise, a UUID will be created.")),(0,i.kt)("h3",{id:"trialstartreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"TrialStartReply")),(0,i.kt)("p",null,"Reply message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"StartTrial")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TrialStartReply {\n string trial_id = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"trial_id: ID of the newly started trial. Empty if the requested trial ID could not be used.")),(0,i.kt)("h3",{id:"terminatetrialrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"TerminateTrialRequest")),(0,i.kt)("p",null,"Request message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"TerminateTrial")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TerminateTrialRequest {}\n")),(0,i.kt)("h3",{id:"terminatetrialreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"TerminateTrialReply")),(0,i.kt)("p",null,"Reply message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"TerminateTrial")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TerminateTrialReply {}\n")),(0,i.kt)("h3",{id:"trialinforequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"TrialInfoRequest")),(0,i.kt)("p",null,"Request message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"GetTrialInfo")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TrialInfoRequest {\n bool get_latest_observation = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"get_latest_observation: If true, request the latest environment observation available for the trial (in addition to standard information).")),(0,i.kt)("h3",{id:"trialinforeply"},(0,i.kt)("inlineCode",{parentName:"h3"},"TrialInfoReply")),(0,i.kt)("p",null,"Reply message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"GetTrialInfo")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TrialInfoReply {\n repeated TrialInfo trial = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"trial: List of information about the trials. Contains only the requested trial info if a trial ID was provided when the call was made (as metadata to the procedure). Otherwise contains information about all active trials.")),(0,i.kt)("h3",{id:"trialinfo"},(0,i.kt)("inlineCode",{parentName:"h3"},"TrialInfo")),(0,i.kt)("p",null,"Message containing information about a trial."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TrialInfo {\n string trial_id = 1;\n string env_name = 2;\n TrialState state = 3;\n uint64 tick_id = 4;\n fixed64 trial_duration = 5;\n ObservationSet latest_observation = 6;\n repeated TrialActor actors_in_trial = 7;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"trial_id: The Identifier of the trial."),(0,i.kt)("li",{parentName:"ul"},"env_name: The name of the environment running the trial."),(0,i.kt)("li",{parentName:"ul"},"state: The state of the trial."),(0,i.kt)("li",{parentName:"ul"},"tick_id: The current tick of the trial."),(0,i.kt)("li",{parentName:"ul"},"trial_duration: The duration of the trial so far, in nanoseconds. If the trial has ended, this is the duration from start to end of the trial. This is meant as an indicator; resolution may not be a nanosecond, and precision is not guaranteed."),(0,i.kt)("li",{parentName:"ul"},"latest_observation: The latest environment observations for all actors. This will be provided only if requested in the ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialInfoRequest"),"."),(0,i.kt)("li",{parentName:"ul"},"actors_in_trial: The list of active actors in the trial.")),(0,i.kt)("h3",{id:"triallistrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"TrialListRequest")),(0,i.kt)("p",null,"Request message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"WatchTrials")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TrialListRequest {\n repeated TrialState filter = 1;\n bool full_info = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"filter: The list of states that are requested. If a trial is not in a state found in this list, it will not be reported. If the list is empty, all states will be reported."),(0,i.kt)("li",{parentName:"ul"},"full_info: If true, full trial information will be returned instead of just trial ID and trial state.")),(0,i.kt)("h3",{id:"triallistentry"},(0,i.kt)("inlineCode",{parentName:"h3"},"TrialListEntry")),(0,i.kt)("p",null,"Stream reply message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"WatchTrials")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TrialListEntry {\n string trial_id = 1;\n TrialState state = 2;\n TrialInfo info = 3;\n}\n\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"trial_id: The Identifier of the trial. Only set if ",(0,i.kt)("inlineCode",{parentName:"li"},"info")," is not present."),(0,i.kt)("li",{parentName:"ul"},"state: The state of the trial. Only set if ",(0,i.kt)("inlineCode",{parentName:"li"},"info")," is not present."),(0,i.kt)("li",{parentName:"ul"},"info: Trial basic information (i.e. without ",(0,i.kt)("inlineCode",{parentName:"li"},"latest_observation")," and ",(0,i.kt)("inlineCode",{parentName:"li"},"actors_in_trials"),"). Present only if requested with ",(0,i.kt)("inlineCode",{parentName:"li"},"full_info")," in the ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialListRequest"),".")),(0,i.kt)("h2",{id:"actor-api"},"Actor API"),(0,i.kt)("p",null,"There are two kinds of actors: Service and Client. They each have their own separate service (respectively ",(0,i.kt)("inlineCode",{parentName:"p"},"ServiceActorSP")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"ClientActorSP"),"). But the messages are identical and work almost the same way (except for the initial phase)."),(0,i.kt)("h3",{id:"service-actor-api"},"Service Actor API"),(0,i.kt)("p",null,"This API is defined in ",(0,i.kt)("inlineCode",{parentName:"p"},"agent.proto"),". It is implemented by the service actor application using the gRPC server API, and the Orchestrator connects to the service actor application using the gRPC client API."),(0,i.kt)("p",null,"This API is used by service actors that will be participating in new trials. They are connected at the start of a trial in which they participate.\nMultiple simultaneous service actors can be served from a single service application instance (i.e. same endpoint).\nAn actor endpoint, for the Orchestrator to connect to, is defined in the ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters"},"trial parameters"),"."),(0,i.kt)("h4",{id:"service-serviceactorsp"},"Service ",(0,i.kt)("inlineCode",{parentName:"h4"},"ServiceActorSP")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"service ServiceActorSP {\n rpc RunTrial(stream ActorRunTrialInput) returns (stream ActorRunTrialOutput) {}\n rpc Version(VersionRequest) returns (VersionInfo) {}\n}\n")),(0,i.kt)("h3",{id:"client-actor-api"},"Client Actor API"),(0,i.kt)("p",null,"This API is defined in ",(0,i.kt)("inlineCode",{parentName:"p"},"orchestrator.proto"),". It is implemented by the Orchestrator using the gRPC server API, and client applications are expected to connect to the Orchestrator using the gRPC client API."),(0,i.kt)("p",null,'This API is used by client actors participating in existing (initializing) trials. The trial expecting client actors will wait for all actors to be connected before starting the trial.\nThe actors connecting this way must have an endpoint set to "cogment://client" in the ',(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters"},"trial parameters"),"."),(0,i.kt)("p",null,"Note the reversal of the input and output messages compared to the service actor ",(0,i.kt)("inlineCode",{parentName:"p"},"RunTrial")," procedure."),(0,i.kt)("h4",{id:"service-clientactorsp"},"Service ",(0,i.kt)("inlineCode",{parentName:"h4"},"ClientActorSP")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"service ClientActorSP {\n rpc RunTrial(stream ActorRunTrialOutput) returns (stream ActorRunTrialInput) {}\n rpc Version(VersionRequest) returns (VersionInfo) {}\n}\n")),(0,i.kt)("h3",{id:"runtrial"},(0,i.kt)("inlineCode",{parentName:"h3"},"RunTrial()")),(0,i.kt)("p",null,"Procedure call to participate in a trial. It is active for the duration of the trial.\nActor actions and data are provided to the Orchestrator in the output message stream, and observations and data are provided by the Orchestrator in the input message stream."),(0,i.kt)("p",null,"Metadata:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial-id"),": Identifier of the trial the actor is participating in. This is supplied to service actors, but must be supplied by client actors.")),(0,i.kt)("h3",{id:"version-1"},(0,i.kt)("inlineCode",{parentName:"h3"},"Version()")),(0,i.kt)("p",null,"Request version data."),(0,i.kt)("p",null,"Metadata: None"),(0,i.kt)("h3",{id:"actorruntrialinput"},(0,i.kt)("inlineCode",{parentName:"h3"},"ActorRunTrialInput")),(0,i.kt)("p",null,"Message received by actors during the streaming ",(0,i.kt)("inlineCode",{parentName:"p"},"RunTrial")," procedure. ",(0,i.kt)("inlineCode",{parentName:"p"},"data")," should contain a message only when ",(0,i.kt)("inlineCode",{parentName:"p"},"state")," is ",(0,i.kt)("inlineCode",{parentName:"p"},"NORMAL")," (or in the case of a hard termination, ",(0,i.kt)("inlineCode",{parentName:"p"},"details")," can be sent with state ",(0,i.kt)("inlineCode",{parentName:"p"},"END"),").\nDefined in the ",(0,i.kt)("inlineCode",{parentName:"p"},"common.proto")," file."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message ActorRunTrialInput {\n CommunicationState state = 1;\n oneof data {\n ActorInitialInput init_input = 2;\n Observation observation = 3;\n Reward reward = 4;\n Message message = 5;\n string details = 6;\n }\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"state: The state of this communication message. Identifies this message as a data or a control message."),(0,i.kt)("li",{parentName:"ul"},"init_input: The initial communication data at the start of a trial. It should always be the first ",(0,i.kt)("inlineCode",{parentName:"li"},"NORMAL")," state message in the stream. Used to report the details of the trial the actor is participating in."),(0,i.kt)("li",{parentName:"ul"},"observation: An observation from the environment."),(0,i.kt)("li",{parentName:"ul"},"reward: Rewards from other participants in the trial."),(0,i.kt)("li",{parentName:"ul"},"message: A message from other participants in the trial."),(0,i.kt)("li",{parentName:"ul"},"details: Explanation for special circumstances, for example when receiving a hard termination signal (a state of ",(0,i.kt)("inlineCode",{parentName:"li"},"END")," without ",(0,i.kt)("inlineCode",{parentName:"li"},"LAST")," or ",(0,i.kt)("inlineCode",{parentName:"li"},"LAST_ACK"),").")),(0,i.kt)("h3",{id:"actorruntrialoutput"},(0,i.kt)("inlineCode",{parentName:"h3"},"ActorRunTrialOutput")),(0,i.kt)("p",null,"Message sent by actors during the streaming ",(0,i.kt)("inlineCode",{parentName:"p"},"RunTrial")," procedure. ",(0,i.kt)("inlineCode",{parentName:"p"},"data")," should contain a message only when ",(0,i.kt)("inlineCode",{parentName:"p"},"state")," is ",(0,i.kt)("inlineCode",{parentName:"p"},"NORMAL"),".\nDefined in the ",(0,i.kt)("inlineCode",{parentName:"p"},"common.proto")," file."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message ActorRunTrialOutput {\n CommunicationState state = 1;\n oneof data {\n ActorInitialOutput init_output = 2;\n Action action = 3;\n Reward reward = 4;\n Message message = 5;\n string details = 6;\n }\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"state: The state of this communication message. Identifies this message as a data or a control message."),(0,i.kt)("li",{parentName:"ul"},"init_output: The initial communication data at the start of a trial. It should always be the first ",(0,i.kt)("inlineCode",{parentName:"li"},"NORMAL")," state message in the stream. Used to initiate or acknowledge connection to a trial."),(0,i.kt)("li",{parentName:"ul"},"action: An action from the actor."),(0,i.kt)("li",{parentName:"ul"},"reward: A reward for other participants in the trial."),(0,i.kt)("li",{parentName:"ul"},"message: A message for other participants in the trial."),(0,i.kt)("li",{parentName:"ul"},"details: ",(0,i.kt)("em",{parentName:"li"},"Reserved"),".")),(0,i.kt)("h3",{id:"actorinitialinput"},(0,i.kt)("inlineCode",{parentName:"h3"},"ActorInitialInput")),(0,i.kt)("p",null,"The initial communication message at the start of a trial. Used to report the details of the trial the actor is participating in.\nFor service actors, this message initiates the connection stream for a new trial. The trial ID is provided in the metadata of the ",(0,i.kt)("inlineCode",{parentName:"p"},"RunTrial")," procedure.\nFor client actors, this message is a reply to a connection request to an existing trial."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message ActorInitialInput {\n string actor_name = 1;\n string actor_class = 2;\n string impl_name = 3;\n string env_name = 4;\n SerializedMessage config = 5;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"actor_name: The name of the actor participating in the trial."),(0,i.kt)("li",{parentName:"ul"},"actor_class: The actor class of the actor participating in the trial."),(0,i.kt)("li",{parentName:"ul"},"impl_name: (optional) Name of the implementation that should run the actor in this trial. If not provided, an arbitrary implementation will be used."),(0,i.kt)("li",{parentName:"ul"},"env_name: The name of the environment running the trial the actor is participating in."),(0,i.kt)("li",{parentName:"ul"},"config: The configuration to start the actor.")),(0,i.kt)("h3",{id:"actorinitialoutput"},(0,i.kt)("inlineCode",{parentName:"h3"},"ActorInitialOutput")),(0,i.kt)("p",null,"The initial communication message at the start of a trial. Used to initiate or acknowledge connection to a trial.\nFor service actors, this message is empty and serves to acknowledge that the actor is ready to start the trial.\nFor client actors, this message serves as a request to connect to an existing trial. The trial ID is provided in the metadata of the ",(0,i.kt)("inlineCode",{parentName:"p"},"RunTrial")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message ActorInitialOutput {\n oneof slot_selection {\n string actor_class = 1;\n string actor_name = 2;\n }\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"actor_name: The name in the trial that the client actor wants to participate as."),(0,i.kt)("li",{parentName:"ul"},"actor_class: The class in the trial that the client actor wants to participate as. In this case, there may be many options, and the Orchestrator will decide precisely which name the client actor will receive.")),(0,i.kt)("h2",{id:"environment-api"},"Environment API"),(0,i.kt)("p",null,"This API is defined in ",(0,i.kt)("inlineCode",{parentName:"p"},"environment.proto"),". It is implemented by the environment application using the gRPC server API, and the Orchestrator connects to the environment application using the gRPC client API."),(0,i.kt)("p",null,"This API is used by environments that will run trials.\nThere is only one environment per trial.\nMultiple simultaneous environments (for different trials) can be served from a single environment application instance (endpoint).\nThe environment endpoint, for the Orchestrator to connect to, is defined in the ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/parameters"},"trial parameters"),"."),(0,i.kt)("h3",{id:"service-environmentsp"},"Service ",(0,i.kt)("inlineCode",{parentName:"h3"},"EnvironmentSP")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"service EnvironmentSP {\n rpc RunTrial(stream EnvRunTrialInput) returns (stream EnvRunTrialOutput) {}\n rpc Version(VersionRequest) returns (VersionInfo) {}\n}\n")),(0,i.kt)("h4",{id:"runtrial-1"},(0,i.kt)("inlineCode",{parentName:"h4"},"RunTrial()")),(0,i.kt)("p",null,"Procedure call to participate in a trial. It is active for the duration of the trial.\nActor actions and data are provided by the Orchestrator in the input message stream, and observations and data are provided to the Orchestrator in the output message stream."),(0,i.kt)("p",null,"Metadata:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial-id"),": Identifier of the trial the environment is participating in.")),(0,i.kt)("h4",{id:"version-2"},(0,i.kt)("inlineCode",{parentName:"h4"},"Version()")),(0,i.kt)("p",null,"Called to request version data."),(0,i.kt)("p",null,"Metadata: None"),(0,i.kt)("h3",{id:"envrruntrialinput"},(0,i.kt)("inlineCode",{parentName:"h3"},"EnvrRunTrialInput")),(0,i.kt)("p",null,"Message received by the environment during the streaming ",(0,i.kt)("inlineCode",{parentName:"p"},"RunTrial")," procedure. ",(0,i.kt)("inlineCode",{parentName:"p"},"data")," should contain a message only when ",(0,i.kt)("inlineCode",{parentName:"p"},"state")," is ",(0,i.kt)("inlineCode",{parentName:"p"},"NORMAL")," (or in the case of a hard termination, ",(0,i.kt)("inlineCode",{parentName:"p"},"details")," can be sent with state ",(0,i.kt)("inlineCode",{parentName:"p"},"END"),")."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message EnvRunTrialInput {\n CommunicationState state = 1;\n oneof data {\n EnvInitialInput init_input = 2;\n ActionSet action_set = 3;\n Message message = 4;\n string details = 5;\n }\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"state: The state of this communication message. Identifies this message as a data or a control message."),(0,i.kt)("li",{parentName:"ul"},"init_input: The initial communication data at the start of a trial. It should always be the first ",(0,i.kt)("inlineCode",{parentName:"li"},"NORMAL")," state message in the stream. Used to provide the details of the trial the environment will run."),(0,i.kt)("li",{parentName:"ul"},"action_set: Actions from all actors in the trial."),(0,i.kt)("li",{parentName:"ul"},"message: A message from other participants in the trial."),(0,i.kt)("li",{parentName:"ul"},"details: Explanation for special circumstances, for example when receiving a hard termination signal (a state of ",(0,i.kt)("inlineCode",{parentName:"li"},"END")," without ",(0,i.kt)("inlineCode",{parentName:"li"},"LAST")," or ",(0,i.kt)("inlineCode",{parentName:"li"},"LAST_ACK"),").")),(0,i.kt)("h3",{id:"envruntrialoutput"},(0,i.kt)("inlineCode",{parentName:"h3"},"EnvRunTrialOutput")),(0,i.kt)("p",null,"Message sent by the environment during the streaming ",(0,i.kt)("inlineCode",{parentName:"p"},"RunTrial")," procedure. ",(0,i.kt)("inlineCode",{parentName:"p"},"data")," should contain a message only when ",(0,i.kt)("inlineCode",{parentName:"p"},"state")," is ",(0,i.kt)("inlineCode",{parentName:"p"},"NORMAL"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message EnvRunTrialOutput {\n CommunicationState state = 1;\n oneof data {\n EnvInitialOutput init_output = 2;\n ObservationSet observation_set = 3;\n Reward reward = 4;\n Message message = 5;\n string details = 6;\n }\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"state: The state of this communication message. Identifies this message as a data or a control message."),(0,i.kt)("li",{parentName:"ul"},"init_output: The initial communication data at the start of a trial. It should always be the first ",(0,i.kt)("inlineCode",{parentName:"li"},"NORMAL")," state message in the stream. Used to acknowledge that the environment is ready to run the trial. Note that the trial will only really start when the environment sends the first set of observations."),(0,i.kt)("li",{parentName:"ul"},"observation_set: Observations for all actors in the trial."),(0,i.kt)("li",{parentName:"ul"},"reward: A reward for other participants in the trial."),(0,i.kt)("li",{parentName:"ul"},"message: A message for other participants in the trial."),(0,i.kt)("li",{parentName:"ul"},"details: ",(0,i.kt)("em",{parentName:"li"},"Reserved"),".")),(0,i.kt)("h3",{id:"envinitialinput"},(0,i.kt)("inlineCode",{parentName:"h3"},"EnvInitialInput")),(0,i.kt)("p",null,"The initial communication message at the start of a trial. This message initiates the connection stream for a new trial. The trial ID is provided in the metadata of the ",(0,i.kt)("inlineCode",{parentName:"p"},"RunTrial")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message EnvInitialInput {\n string name = 1;\n string impl_name = 2;\n uint64 tick_id = 3;\n repeated TrialActor actors_in_trial = 4;\n SerializedMessage config = 5;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"name: The name of the environment participating in the trial."),(0,i.kt)("li",{parentName:"ul"},"impl_name: (optional) Name of the implementation that should run the environment in this trial. If not provided, an arbitrary implementation will be used."),(0,i.kt)("li",{parentName:"ul"},"tick_id: Initial tick id requested to start the environment."),(0,i.kt)("li",{parentName:"ul"},"actors_in_trial: The list of all actors participating in the trial. This list has the same length and order as the list of actors provided in different places in the API, for the same trial."),(0,i.kt)("li",{parentName:"ul"},"config: The configuration to start the environment.")),(0,i.kt)("h3",{id:"envinitialoutput"},(0,i.kt)("inlineCode",{parentName:"h3"},"EnvInitialOutput")),(0,i.kt)("p",null,"The initial communication message at the start of a trial. This message is empty and serves to acknowledge that the environment is ready to run the trial."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message EnvInitialOutput {}\n")),(0,i.kt)("h2",{id:"datalog-api"},"Data/Log API"),(0,i.kt)("p",null,"This API is defined in ",(0,i.kt)("inlineCode",{parentName:"p"},"datalog.proto"),". It is implemented by the data logger application using the gRPC server API, including the out-of-the-box component ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cli/trial-datastore/trial-datastore-server"},(0,i.kt)("inlineCode",{parentName:"a"},"cogment-trial-datastore")),"."),(0,i.kt)("p",null,"The data logger endpoint, for the orchestrator to connect to, is defined in the trial parameters."),(0,i.kt)("h3",{id:"service-logexportersp"},"Service ",(0,i.kt)("inlineCode",{parentName:"h3"},"LogExporterSP")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"service LogExporterSP {\n rpc RunTrialDatalog(stream LogExporterSampleRequest) returns (LogExporterSampleReply) {}\n rpc Version(VersionRequest) returns (VersionInfo) {}\n}\n")),(0,i.kt)("h4",{id:"runtrialdatalog"},(0,i.kt)("inlineCode",{parentName:"h4"},"RunTrialDatalog()")),(0,i.kt)("p",null,"Called for each trial, at the start of the trial.\nThe first data received are the parameters.\nData samples are provided in the request stream following the parameters.\nThe stream is maintained for the duration of the trial."),(0,i.kt)("p",null,"Metadata:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial-id"),": Identifier of the trial that is the source of the data."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"user-id"),": Identifier of the user that started the trial.")),(0,i.kt)("h4",{id:"version-3"},(0,i.kt)("inlineCode",{parentName:"h4"},"Version()")),(0,i.kt)("p",null,"Called to request version data."),(0,i.kt)("p",null,"Metadata: None"),(0,i.kt)("h3",{id:"logexportersamplerequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"LogExporterSampleRequest")),(0,i.kt)("p",null,"Stream request message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"RunTrialDatalog")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message SampleInfo {\n bool out_of_sync = 5;\n uint64 tick_id = 1;\n fixed64 timestamp = 2;\n TrialState state = 3;\n repeated string special_events = 4;\n}\n\nmessage DatalogSample {\n SampleInfo info = 1;\n\n ObservationSet observations = 2;\n repeated Action actions = 3;\n repeated Reward rewards = 4;\n repeated Message messages = 5;\n repeated uint32 default_actors = 6;\n repeated uint32 unavailable_actors = 7;\n}\n\nmessage LogExporterSampleRequest {\n oneof msg {\n TrialParams trial_params = 1;\n DatalogSample sample = 2;\n }\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"out_of_sync: If false, this sample is a normal and full sample. If true, it is an out-of-sync sample that is partially filled, and some of the other value may have a slightly different meaning than for a normal sample."),(0,i.kt)("li",{parentName:"ul"},"tick_id: The tick the data relates to."),(0,i.kt)("li",{parentName:"ul"},"timestamp: The time the data was received. For a full sample, this is the time the observation set was received by the Orchestrator."),(0,i.kt)("li",{parentName:"ul"},"state: The state of the trial at the end of the tick. For out-of-sync samples, the state is undefined."),(0,i.kt)("li",{parentName:"ul"},"special_events: Events not visible from the rest of the data may appear in here. Out-of-sync samples will usually have an explanation of data in the special events list."),(0,i.kt)("li",{parentName:"ul"},"observations: Observations from the environment. Out-of-sync samples may not have observations."),(0,i.kt)("li",{parentName:"ul"},"actions: Actions from all actors. This list has the same length and order as the list of actors provided in ",(0,i.kt)("inlineCode",{parentName:"li"},"trial_params"),". This list may be empty for out-of-sync samples."),(0,i.kt)("li",{parentName:"ul"},"rewards: List of rewards sent to actors."),(0,i.kt)("li",{parentName:"ul"},"messages: List of user data sent to actors or the environment."),(0,i.kt)("li",{parentName:"ul"},"default_actors: List of actors (index of actors) that were not available but had a default action. Actors in this list have invalid data in the ",(0,i.kt)("inlineCode",{parentName:"li"},"actions")," list."),(0,i.kt)("li",{parentName:"ul"},"unavailable_actors: List of actors (index of actors) that were not available and did not have a default action. Actors in this list have invalid data in the ",(0,i.kt)("inlineCode",{parentName:"li"},"actions")," list."),(0,i.kt)("li",{parentName:"ul"},"trial_params: Trial parameters used for a trial. This is sent on start of a trial, as the first message in the ",(0,i.kt)("inlineCode",{parentName:"li"},"RunTrialDatalog")," stream."),(0,i.kt)("li",{parentName:"ul"},"sample: A data sample to be logged. It can be an out-of-sync sample which contains only partial data.")),(0,i.kt)("h3",{id:"logexportersamplereply"},(0,i.kt)("inlineCode",{parentName:"h3"},"LogExporterSampleReply")),(0,i.kt)("p",null,"Reply message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"RunTrialDatalog")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message LogExporterSampleReply {}\n")),(0,i.kt)("h2",{id:"hook-api"},"Hook API"),(0,i.kt)("p",null,"This API is defined in ",(0,i.kt)("inlineCode",{parentName:"p"},"hooks.proto"),". It is implemented by the pre-trial hook application using the gRPC server API, and the orchestrator connects to the application."),(0,i.kt)("p",null,"The pre-trial hook endpoint, for the orchestrator to connect to, are defined on the command line of the Orchestrator (or in environment variables)."),(0,i.kt)("h3",{id:"service-trialhookssp"},"Service ",(0,i.kt)("inlineCode",{parentName:"h3"},"TrialHooksSP")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"service TrialHooksSP {\n rpc OnPreTrial(PreTrialParams) returns (PreTrialParams) {}\n rpc Version(VersionRequest) returns (VersionInfo) {}\n}\n")),(0,i.kt)("h4",{id:"onpretrial"},(0,i.kt)("inlineCode",{parentName:"h4"},"OnPreTrial()")),(0,i.kt)("p",null,"Called before a trial is started to set or modify the parameters for the trial."),(0,i.kt)("p",null,"Metadata:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial-id"),": Identifier of the new trial that will be started."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"user-id"),": Identifier of the user that started the trial.")),(0,i.kt)("h4",{id:"version-4"},(0,i.kt)("inlineCode",{parentName:"h4"},"Version()")),(0,i.kt)("p",null,"Called to request version data."),(0,i.kt)("p",null,"Metadata: None"),(0,i.kt)("h2",{id:"directory-api"},"Directory API"),(0,i.kt)("p",null,"This API is defined in ",(0,i.kt)("inlineCode",{parentName:"p"},"directory.proto"),". It is implemented by the Directory application using the gRPC server API."),(0,i.kt)("h3",{id:"service-directorysp"},"Service ",(0,i.kt)("inlineCode",{parentName:"h3"},"DirectorySP")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"service DirectorySP {\n rpc Register(stream RegisterRequest) returns (stream RegisterReply) {}\n rpc Deregister(stream DeregisterRequest) returns (stream DeregisterReply) {}\n rpc Inquire(InquireRequest) returns (stream InquireReply) {}\n rpc Version(VersionRequest) returns (VersionInfo) {}\n}\n")),(0,i.kt)("h4",{id:"register"},(0,i.kt)("inlineCode",{parentName:"h4"},"Register()")),(0,i.kt)("p",null,"Called to register (add) services to the directory."),(0,i.kt)("p",null,"Metadata:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"authentication_token"),": (Optional) Token of the services being registered. This will be registered with the services and must match when inquiring or deregistering a service.")),(0,i.kt)("h4",{id:"deregister"},(0,i.kt)("inlineCode",{parentName:"h4"},"Deregister()")),(0,i.kt)("p",null,"Called to deregister (remove) previously registered services to the directory."),(0,i.kt)("p",null,"Metadata:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"authentication_token"),": (Optional) Token to authenticate services. This must match the token of the registered services.")),(0,i.kt)("h4",{id:"inquire"},(0,i.kt)("inlineCode",{parentName:"h4"},"Inquire()")),(0,i.kt)("p",null,"Called to inquire (search) the directory for registered services."),(0,i.kt)("p",null,"Metadata:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"authentication_token"),": (Optional) Token to identify the services. This must match the token of the inquired services.")),(0,i.kt)("h4",{id:"version-5"},(0,i.kt)("inlineCode",{parentName:"h4"},"Version()")),(0,i.kt)("p",null,"Called to request version data."),(0,i.kt)("p",null,"Metadata: None"),(0,i.kt)("h3",{id:"servicetype"},(0,i.kt)("inlineCode",{parentName:"h3"},"ServiceType")),(0,i.kt)("p",null,"Type of service registered. This serves to know how to test for health."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"enum ServiceType {\n UNKNOWN_SERVICE = 0;\n TRIAL_LIFE_CYCLE_SERVICE = 1;\n CLIENT_ACTOR_CONNECTION_SERVICE = 2;\n ACTOR_SERVICE = 3;\n ENVIRONMENT_SERVICE = 4;\n PRE_HOOK_SERVICE = 5;\n DATALOG_SERVICE = 6;\n DATASTORE_SERVICE = 7;\n MODEL_REGISTRY_SERVICE = 8;\n DIRECTORY_SERVICE = 9;\n OTHER_SERVICE = 100;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"UNKNOWN_SERVICE: Should not be used (it's a requirement of protobuf enums to have a 0 default value)."),(0,i.kt)("li",{parentName:"ul"},"TRIAL_LIFE_CYCLE_SERVICE: Cogment service accessed with gRPC service ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialLifecycleSP"),"."),(0,i.kt)("li",{parentName:"ul"},"CLIENT_ACTOR_CONNECTION_SERVICE: Cogment service accessed with gRPC service ",(0,i.kt)("inlineCode",{parentName:"li"},"ClientActorSP"),"."),(0,i.kt)("li",{parentName:"ul"},"ACTOR_SERVICE: Cogment service accessed with gRPC service ",(0,i.kt)("inlineCode",{parentName:"li"},"ServiceActorSP"),"."),(0,i.kt)("li",{parentName:"ul"},"ENVIRONMENT_SERVICE: Cogment service accessed with gRPC service ",(0,i.kt)("inlineCode",{parentName:"li"},"EnvironmentSP"),"."),(0,i.kt)("li",{parentName:"ul"},"PRE_HOOK_SERVICE: Cogment service accessed with gRPC service ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialHooksSP"),"."),(0,i.kt)("li",{parentName:"ul"},"DATALOG_SERVICE: Cogment service accessed with gRPC service ",(0,i.kt)("inlineCode",{parentName:"li"},"DatalogSP"),"."),(0,i.kt)("li",{parentName:"ul"},"DATASTORE_SERVICE: Cogment service accessed with gRPC service ",(0,i.kt)("inlineCode",{parentName:"li"},"TrialDatastoreSP"),"."),(0,i.kt)("li",{parentName:"ul"},"MODEL_REGISTRY_SERVICE: Cogment service accessed with gRPC service ",(0,i.kt)("inlineCode",{parentName:"li"},"ModelRegistrySP"),"."),(0,i.kt)("li",{parentName:"ul"},"DIRECTORY_SERVICE: Cogment service accessed with gRPC service ",(0,i.kt)("inlineCode",{parentName:"li"},"DirectorySP"),"."),(0,i.kt)("li",{parentName:"ul"},"OTHER_SERVICE: This is for services not provided by Cogment or that do not have a dedicated service type. The properties registered in the directory should provide the necessary information, but this is left to the users to manage, and no health checking is performed.")),(0,i.kt)("h3",{id:"servicedetails"},(0,i.kt)("inlineCode",{parentName:"h3"},"ServiceDetails")),(0,i.kt)("p",null,"Message containing registration details of a service."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message ServiceDetails {\n ServiceType type = 1;\n map<string, string> properties = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"type: The type of service."),(0,i.kt)("li",{parentName:"ul"},"properties: Properties associated with the service, in a map (property name : property value).")),(0,i.kt)("h3",{id:"serviceendpoint"},(0,i.kt)("inlineCode",{parentName:"h3"},"ServiceEndpoint")),(0,i.kt)("p",null,"Message containing endpoint (connection) details for a service."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message ServiceEndpoint {\n enum Protocol {\n UNKNOWN = 0;\n GRPC = 1;\n GRPC_SSL = 2;\n COGMENT = 3;\n }\n\n Protocol protocol = 1;\n string host = 2;\n uint32 port = 3;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Protocol: The communication protocol for the service.",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"UNKNOWN: Should not be used (it's a requirement of protobuf enums to have a 0 default value)."),(0,i.kt)("li",{parentName:"ul"},"GRPC: The service connection is using gRPC and does not require encryption (SSL)."),(0,i.kt)("li",{parentName:"ul"},"GRPC_SSL: The service connection is using gRPC and is expecting encryption (SSL)."),(0,i.kt)("li",{parentName:"ul"},"COGMENT: This is a protocol specific to Cogment. The host will provide more details."))),(0,i.kt)("li",{parentName:"ul"},"host: For gRPC, this is a network accessible hostname or IP address. For Cogment, this can only be ",(0,i.kt)("inlineCode",{parentName:"li"},"client"),", which indicates that the service is not really a service, but a client, and will connect and not be connected to."),(0,i.kt)("li",{parentName:"ul"},"port: For gRPC, this is the TCP port to connect to. For Cogment, this is not used.")),(0,i.kt)("h3",{id:"registerrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"RegisterRequest")),(0,i.kt)("p",null,"Request message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"Register")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RegisterRequest {\n // URL where to connect to the service.\n ServiceEndpoint endpoint = 1;\n ServiceDetails details = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"endpoint: The connection endpoint of the service to be registered."),(0,i.kt)("li",{parentName:"ul"},"details: The service details to be registered for the service.")),(0,i.kt)("h3",{id:"registerreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"RegisterReply")),(0,i.kt)("p",null,"Reply message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"Register")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RegisterReply {\n enum Status {\n UNKNOWN = 0;\n OK = 1;\n FAILED = 2;\n }\n Status status = 1;\n string error_msg = 2;\n uint64 service_id = 3;\n string secret = 4;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Status: The result status.",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"UNKNOWN: Should not be used (it's a requirement of protobuf enums to have a 0 default value)."),(0,i.kt)("li",{parentName:"ul"},"OK: Registration succeeded and the data is valid."),(0,i.kt)("li",{parentName:"ul"},"FAILED: Registration failed, the data is invalid (more details may be available in the error message)."))),(0,i.kt)("li",{parentName:"ul"},"status: The status of the corresponding registration request."),(0,i.kt)("li",{parentName:"ul"},"error_msg: Any extra details about the failure of the registration (if ",(0,i.kt)("inlineCode",{parentName:"li"},"status")," == ",(0,i.kt)("inlineCode",{parentName:"li"},"FAILED"),")."),(0,i.kt)("li",{parentName:"ul"},"service_id: The ID that the service was given when it was registered in the Directory."),(0,i.kt)("li",{parentName:"ul"},"secret: This is a string that must be provided to deregister the service, and cannot be inquired.")),(0,i.kt)("h3",{id:"deregisterrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"DeregisterRequest")),(0,i.kt)("p",null,"Request message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"Deregister")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message DeregisterRequest {\n uint64 service_id = 1;\n string secret = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"service_id: The ID of the service."),(0,i.kt)("li",{parentName:"ul"},"secret: The string that was given when the service was registered.")),(0,i.kt)("h3",{id:"deregisterreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"DeregisterReply")),(0,i.kt)("p",null,"Reply message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"Deregister")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message DeregisterReply {\n enum Status {\n UNKNOWN = 0;\n OK = 1;\n FAILED = 2;\n }\n Status status = 1;\n string error_msg = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Status: The result status.",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"UNKNOWN: Should not be used (it's a requirement of protobuf enums to have a 0 default value)."),(0,i.kt)("li",{parentName:"ul"},"OK: Deregistration succeeded."),(0,i.kt)("li",{parentName:"ul"},"FAILED: Deregistration failed (more details may be available in the error message)."))),(0,i.kt)("li",{parentName:"ul"},"status: The status of the corresponding deregistration request."),(0,i.kt)("li",{parentName:"ul"},"error_msg: Any extra details about the failure to deregister the service (if ",(0,i.kt)("inlineCode",{parentName:"li"},"status")," == ",(0,i.kt)("inlineCode",{parentName:"li"},"FAILED"),").")),(0,i.kt)("h3",{id:"inquirerequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"InquireRequest")),(0,i.kt)("p",null,"Request message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"Inquire")," procedure. Requires either a service ID, or details of services to find."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message InquireRequest {\n oneof inquiry {\n uint64 service_id = 1;\n ServiceDetails details = 2;\n }\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"service_id: The ID of the service."),(0,i.kt)("li",{parentName:"ul"},"details: The details of services to find.")),(0,i.kt)("h3",{id:"inquirereply"},(0,i.kt)("inlineCode",{parentName:"h3"},"InquireReply")),(0,i.kt)("p",null,"Reply message for the ",(0,i.kt)("inlineCode",{parentName:"p"},"Inquire")," procedure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message FullServiceData {\n ServiceEndpoint endpoint = 1;\n uint64 service_id = 2;\n ServiceDetails details = 3;\n}\n\nmessage InquireReply {\n FullServiceData data = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"endpoint: The connection endpoint of the service."),(0,i.kt)("li",{parentName:"ul"},"service_id: The ID of the service."),(0,i.kt)("li",{parentName:"ul"},"details: The details of the service.")),(0,i.kt)("h2",{id:"model-registry-api"},"Model Registry API"),(0,i.kt)("p",null,"This API is defined in ",(0,i.kt)("inlineCode",{parentName:"p"},"model_registry.proto"),". It is implemented by ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cli/model-registry"},(0,i.kt)("inlineCode",{parentName:"a"},"cogment-model-registry")),"."),(0,i.kt)("h3",{id:"service-modelregistrysp"},"Service ",(0,i.kt)("inlineCode",{parentName:"h3"},"ModelRegistrySP")),(0,i.kt)("p",null,"This gRPC API defines a service able to store models, e.g. neural network architecture, weights and any additional parameters."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"service ModelRegistrySP {\n rpc CreateOrUpdateModel(CreateOrUpdateModelRequest) returns (CreateOrUpdateModelReply) {}\n rpc DeleteModel(DeleteModelRequest) returns (DeleteModelReply) {}\n rpc RetrieveModels(RetrieveModelsRequest) returns (RetrieveModelsReply) {}\n\n rpc CreateVersion(stream CreateVersionRequestChunk) returns (CreateVersionReply) {}\n rpc RetrieveVersionInfos(RetrieveVersionInfosRequest) returns (RetrieveVersionInfosReply) {}\n rpc RetrieveVersionData(RetrieveVersionDataRequest) returns (stream RetrieveVersionDataReplyChunk) {}\n\n rpc Version(VersionRequest) returns (VersionInfo) {}\n}\n")),(0,i.kt)("h4",{id:"createorupdatemodel"},(0,i.kt)("inlineCode",{parentName:"h4"},"CreateOrUpdateModel()")),(0,i.kt)("p",null,"Create or update a model in the registry having the given unique (within the registry) ",(0,i.kt)("inlineCode",{parentName:"p"},"model_id"),"."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Metadata: None"),(0,i.kt)("li",{parentName:"ul"},"Request: ",(0,i.kt)("a",{parentName:"li",href:"#createorupdatemodelrequest"},(0,i.kt)("inlineCode",{parentName:"a"},"CreateOrUpdateModelRequest"))),(0,i.kt)("li",{parentName:"ul"},"Reply: ",(0,i.kt)("a",{parentName:"li",href:"#createorupdatemodelreply"},(0,i.kt)("inlineCode",{parentName:"a"},"CreateOrUpdateModelReply")))),(0,i.kt)("h4",{id:"deletemodel"},(0,i.kt)("inlineCode",{parentName:"h4"},"DeleteModel()")),(0,i.kt)("p",null,"Delete a given model and all its iterations from the registry."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Metadata: None"),(0,i.kt)("li",{parentName:"ul"},"Request: ",(0,i.kt)("a",{parentName:"li",href:"#deletemodelrequest"},(0,i.kt)("inlineCode",{parentName:"a"},"DeleteModelRequest"))),(0,i.kt)("li",{parentName:"ul"},"Reply: ",(0,i.kt)("a",{parentName:"li",href:"#deletemodelreply"},(0,i.kt)("inlineCode",{parentName:"a"},"DeleteModelReply")))),(0,i.kt)("h4",{id:"retrievemodels"},(0,i.kt)("inlineCode",{parentName:"h4"},"RetrieveModels()")),(0,i.kt)("p",null,"Retrieve all or selected models. This procedure supports paginated requests."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Metadata: None"),(0,i.kt)("li",{parentName:"ul"},"Request: ",(0,i.kt)("a",{parentName:"li",href:"#retrievemodelsrequest"},(0,i.kt)("inlineCode",{parentName:"a"},"RetrieveModelsRequest"))),(0,i.kt)("li",{parentName:"ul"},"Reply: ",(0,i.kt)("a",{parentName:"li",href:"#retrievemodelsreply"},(0,i.kt)("inlineCode",{parentName:"a"},"RetrieveModelsReply")))),(0,i.kt)("h4",{id:"createversion"},(0,i.kt)("inlineCode",{parentName:"h4"},"CreateVersion()")),(0,i.kt)("p",null,"Create a new iteration of a given model. Because of their potential large size, model iteration data are uploaded as a stream."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Metadata: None"),(0,i.kt)("li",{parentName:"ul"},"Request: Stream of ",(0,i.kt)("a",{parentName:"li",href:"#createversionrequestchunk"},(0,i.kt)("inlineCode",{parentName:"a"},"CreateVersionRequestChunk"))),(0,i.kt)("li",{parentName:"ul"},"Reply: ",(0,i.kt)("a",{parentName:"li",href:"#createversionreply"},(0,i.kt)("inlineCode",{parentName:"a"},"CreateVersionReply")))),(0,i.kt)("h4",{id:"retrieveversioninfos"},(0,i.kt)("inlineCode",{parentName:"h4"},"RetrieveVersionInfos()")),(0,i.kt)("p",null,"Retrieve the information for all or selected iterations of a given model."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Metadata: None"),(0,i.kt)("li",{parentName:"ul"},"Request: ",(0,i.kt)("a",{parentName:"li",href:"#retrieveversioninfosrequest"},(0,i.kt)("inlineCode",{parentName:"a"},"RetrieveVersionInfosRequest"))),(0,i.kt)("li",{parentName:"ul"},"Reply: ",(0,i.kt)("a",{parentName:"li",href:"#retrieveversioninfosreply"},(0,i.kt)("inlineCode",{parentName:"a"},"RetrieveVersionInfosReply")))),(0,i.kt)("h4",{id:"retrieveversiondata"},(0,i.kt)("inlineCode",{parentName:"h4"},"RetrieveVersionData()")),(0,i.kt)("p",null,"Retrieve the data for a specific iteration of the model. Because of their potential large size, data are retrieved as a stream."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Metadata: None"),(0,i.kt)("li",{parentName:"ul"},"Request: ",(0,i.kt)("a",{parentName:"li",href:"#retrieveversiondatarequest"},(0,i.kt)("inlineCode",{parentName:"a"},"RetrieveVersionDataRequest"))),(0,i.kt)("li",{parentName:"ul"},"Reply: Stream of ",(0,i.kt)("a",{parentName:"li",href:"#retrieveversiondatareplychunk"},(0,i.kt)("inlineCode",{parentName:"a"},"RetrieveVersionDataReplyChunk")))),(0,i.kt)("h3",{id:"createorupdatemodelrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"CreateOrUpdateModelRequest")),(0,i.kt)("p",null,"Request for ",(0,i.kt)("a",{parentName:"p",href:"#createorupdatemodel"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.CreateOrUpdateModel()"))),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message CreateOrUpdateModelRequest {\n ModelInfo model_info = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_info"),": Defines the unique model identifier within the registry and the ",(0,i.kt)("inlineCode",{parentName:"li"},"user_data")," to use to create or update the model.")),(0,i.kt)("h3",{id:"createorupdatemodelreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"CreateOrUpdateModelReply")),(0,i.kt)("p",null,"Reply for ",(0,i.kt)("a",{parentName:"p",href:"#createorupdatemodel"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.CreateOrUpdateModel()"))),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message CreateOrUpdateModelReply {}\n")),(0,i.kt)("h3",{id:"deletemodelrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"DeleteModelRequest")),(0,i.kt)("p",null,"Request for ",(0,i.kt)("a",{parentName:"p",href:"#deletemodel"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.DeleteModel()"))),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message DeleteModelRequest {\n string model_id = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_ids"),": Identifier of the model to be deleted.")),(0,i.kt)("h3",{id:"deletemodelreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"DeleteModelReply")),(0,i.kt)("p",null,"Reply for ",(0,i.kt)("a",{parentName:"p",href:"#deletemodel"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.DeleteModel()"))),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message DeleteModelReply {}\n")),(0,i.kt)("h3",{id:"retrievemodelsrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"RetrieveModelsRequest")),(0,i.kt)("p",null,"Request for ",(0,i.kt)("a",{parentName:"p",href:"#retrievemodel"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.RetrieveModel()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RetrieveModelsRequest {\n repeated string model_ids = 1;\n uint32 models_count = 3;\n string model_handle = 4;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_ids"),": List of the identifiers of the desired models, leave empty to retrieve all models."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"models_count"),": (optional) The desired number of models to be retrieved, leave empty (or set to 0) to retrieve all models matching the request."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_handle"),": (optional) Leave empty for the initial request, use previously provided ",(0,i.kt)("inlineCode",{parentName:"li"},"RetrieveModelsReply.next_model_handle")," on the next calls to retrieve the next models.")),(0,i.kt)("h3",{id:"retrievemodelsreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"RetrieveModelsReply")),(0,i.kt)("p",null,"Reply for ",(0,i.kt)("a",{parentName:"p",href:"#retrievemodel"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.RetrieveModel()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RetrieveModelsReply {\n repeated ModelInfo model_infos = 1;\n string next_model_handle = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_infos"),": At most ",(0,i.kt)("inlineCode",{parentName:"li"},"RetrieveModelsRequest.models_count")," models."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"next_model_handle"),": Opaque handle to be used to retrieve the next models matching the request.")),(0,i.kt)("h3",{id:"createversionrequestchunk"},(0,i.kt)("inlineCode",{parentName:"h3"},"CreateVersionRequestChunk")),(0,i.kt)("p",null,"Part of the request stream for ",(0,i.kt)("a",{parentName:"p",href:"#createversion"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.CreateVersion()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message CreateVersionRequestChunk {\n message Header {\n ModelVersionInfo version_info = 1;\n }\n message Body {\n bytes data_chunk = 1;\n }\n oneof msg {\n Header header = 1;\n Body body = 2;\n }\n}\n")),(0,i.kt)("p",null,"The first message in the stream should define ",(0,i.kt)("inlineCode",{parentName:"p"},"header"),":"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"version_info"),": Information regarding the model iteration to create, ",(0,i.kt)("inlineCode",{parentName:"li"},"version_number")," will be ignored. ",(0,i.kt)("inlineCode",{parentName:"li"},"data_hash")," and ",(0,i.kt)("inlineCode",{parentName:"li"},"data_size")," should be computed from the total final data and will be used by the server to validate it.")),(0,i.kt)("p",null,"The following messages should define ",(0,i.kt)("inlineCode",{parentName:"p"},"body"),":"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"data_chunk"),": A chunk of the iteration data, all the chunks in the stream will be concatenated.")),(0,i.kt)("h3",{id:"createversionreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"CreateVersionReply")),(0,i.kt)("p",null,"Reply for ",(0,i.kt)("a",{parentName:"p",href:"#createversion"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.CreateVersion()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message CreateVersionReply {\n ModelVersionInfo version_info = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"version_info"),": The information relative to the created model iteration, in particular the defined ",(0,i.kt)("inlineCode",{parentName:"li"},"version_number"),".")),(0,i.kt)("h3",{id:"retrieveversioninfosrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"RetrieveVersionInfosRequest")),(0,i.kt)("p",null,"Request for ",(0,i.kt)("a",{parentName:"p",href:"#retrieveversioninfos"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.RetrieveVersionInfos()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RetrieveVersionInfosRequest {\n string model_id = 1;\n repeated int32 version_numbers = 2;\n uint32 versions_count = 3;\n string version_handle = 4;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_id"),": Identifier of the model we want to retrieve iterations from."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"version_numbers"),": List of desired iteration number (or -1 to denote the latest iteration). Leave empty to retrieve all iterations of the given model."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"versions_count"),": (optional) The desired number of iterations to be retrieved, leave empty (or set to 0) to retrieve all the iterations matching the request."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"version_handle"),": (optional) Leave empty for the initial request, use previously provided ",(0,i.kt)("inlineCode",{parentName:"li"},"RetrieveVersionInfosReply.next_version_handle")," on the next calls to retrieve the next iterations.")),(0,i.kt)("h3",{id:"retrieveversioninfosreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"RetrieveVersionInfosReply")),(0,i.kt)("p",null,"Reply for ",(0,i.kt)("a",{parentName:"p",href:"#retrieveversioninfos"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.RetrieveVersionInfos()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RetrieveVersionInfosReply {\n repeated ModelVersionInfo version_infos = 1;\n string next_version_handle = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"version_infos"),": At most ",(0,i.kt)("inlineCode",{parentName:"li"},"RetrieveVersionInfosRequest.versions_count")," iterations."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"next_version_handle"),": Opaque handle to be used to retrieve the next iterations matching the request.")),(0,i.kt)("h3",{id:"retrieveversiondatarequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"RetrieveVersionDataRequest")),(0,i.kt)("p",null,"Request for ",(0,i.kt)("a",{parentName:"p",href:"#retrieveversiondata"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.RetrieveVersionData()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RetrieveVersionDataRequest {\n string model_id = 1;\n int32 version_number = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_id"),": Identifier of the model we want to retrieve iteration from."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"version_numbers"),": Number of the desired iteration.")),(0,i.kt)("h3",{id:"retrieveversiondatareplychunk"},(0,i.kt)("inlineCode",{parentName:"h3"},"RetrieveVersionDataReplyChunk")),(0,i.kt)("p",null,"Part of the reply stream of ",(0,i.kt)("a",{parentName:"p",href:"#retrieveversiondata"},(0,i.kt)("inlineCode",{parentName:"a"},"ModelRegistrySP.RetrieveVersionData()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RetrieveVersionDataReplyChunk {\n bytes data_chunk = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"data_chunk"),": A chunk of the iteration data. All the chunks in the stream need to be concatenated. The completeness and validity of the received data can be checked using the iteration's ",(0,i.kt)("inlineCode",{parentName:"li"},"data_size")," and ",(0,i.kt)("inlineCode",{parentName:"li"},"data_hash")," respectively.")),(0,i.kt)("h3",{id:"modelinfo"},(0,i.kt)("inlineCode",{parentName:"h3"},"ModelInfo")),(0,i.kt)("p",null,"Defines a model identifier and associated user data."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message ModelInfo {\n string model_id = 1;\n map<string, string> user_data = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_id"),": Unique model identifier."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"user_data"),": Key/value user data associated with the model.")),(0,i.kt)("h3",{id:"modelversioninfo"},(0,i.kt)("inlineCode",{parentName:"h3"},"ModelVersionInfo")),(0,i.kt)("p",null,"Defines a model iteration and associated user data."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message ModelVersionInfo {\n string model_id = 1;\n uint32 version_number = 2;\n fixed64 creation_timestamp = 3;\n bool archived = 4;\n string data_hash = 5;\n fixed64 data_size = 6;\n map<string, string> user_data = 7;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"model_id"),": Unique identifier, within the registry, of this iteration's model."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"version_number"),": Unique iteration number, assigned incrementally at creation by the model registry."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"creation_timestamp"),": When the model was created as nanosecond Unix epoch time."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"archived"),": If ",(0,i.kt)("inlineCode",{parentName:"li"},"true"),", this iteration is archived and should be stored in a long-term storage. If ",(0,i.kt)("inlineCode",{parentName:"li"},"false"),", this iteration is not archived and can be evicted after a while. Non-archived iterations should be used to ",(0,i.kt)("em",{parentName:"li"},"broadcast")," an update of the model during training."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"data_hash"),": SHA 256 hash (encoded in base64 with standard 64 characters with padding) of this iteration's data, can be used to validate the data and for caching purposes."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"data_size"),": Size (in bytes) of this iteration's data."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"user_data"),": Key/value user data associated with the model, in particular it can be used to provide information required for the deserialization of the data.")),(0,i.kt)("h4",{id:"version-6"},(0,i.kt)("inlineCode",{parentName:"h4"},"Version()")),(0,i.kt)("p",null,"Called to request iteration data."),(0,i.kt)("p",null,"Metadata: None"),(0,i.kt)("h2",{id:"trial-datastore-api"},"Trial Datastore API"),(0,i.kt)("p",null,"This API is defined in ",(0,i.kt)("inlineCode",{parentName:"p"},"trial_datastore.proto"),". It is implemented by ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cli/trial-datastore/trial-datastore-server"},(0,i.kt)("inlineCode",{parentName:"a"},"cogment-trial-datastore")),"."),(0,i.kt)("h3",{id:"service-trialdatastoresp"},"Service ",(0,i.kt)("inlineCode",{parentName:"h3"},"TrialDatastoreSP")),(0,i.kt)("p",null,"This gRPC API defines a service to manage and access data generated by trials."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"service TrialDatastoreSP {\n rpc RetrieveTrials(RetrieveTrialsRequest) returns (RetrieveTrialsReply) {}\n rpc RetrieveSamples(RetrieveSamplesRequest) returns (stream RetrieveSampleReply) {}\n\n rpc AddTrial(AddTrialRequest) returns (AddTrialReply) {}\n rpc AddSample(stream AddSampleRequest) returns (AddSamplesReply) {}\n rpc DeleteTrials(DeleteTrialsRequest) returns (DeleteTrialsReply) {}\n\n rpc Version(VersionRequest) returns (VersionInfo) {}\n}\n")),(0,i.kt)("h4",{id:"retrievetrials"},(0,i.kt)("inlineCode",{parentName:"h4"},"RetrieveTrials()")),(0,i.kt)("p",null,"Retrieve stored trials matching the given request."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Metadata: None"),(0,i.kt)("li",{parentName:"ul"},"Request: ",(0,i.kt)("a",{parentName:"li",href:"#retrievetrialsrequest"},(0,i.kt)("inlineCode",{parentName:"a"},"RetrieveTrialsRequest"))),(0,i.kt)("li",{parentName:"ul"},"Reply: ",(0,i.kt)("a",{parentName:"li",href:"#retrievetrialsrequest"},(0,i.kt)("inlineCode",{parentName:"a"},"RetrieveTrialsRequest")))),(0,i.kt)("h4",{id:"retrievesamples"},(0,i.kt)("inlineCode",{parentName:"h4"},"RetrieveSamples()")),(0,i.kt)("p",null,"Retrieve samples from matching trials, trials can be ongoing."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Metadata: None"),(0,i.kt)("li",{parentName:"ul"},"Request: ",(0,i.kt)("a",{parentName:"li",href:"#retrievesamplesrequest"},(0,i.kt)("inlineCode",{parentName:"a"},"RetrieveSamplesRequest"))),(0,i.kt)("li",{parentName:"ul"},"Reply: Stream of ",(0,i.kt)("a",{parentName:"li",href:"#retrievesamplereply"},(0,i.kt)("inlineCode",{parentName:"a"},"RetrieveSampleReply")))),(0,i.kt)("h4",{id:"addtrial"},(0,i.kt)("inlineCode",{parentName:"h4"},"AddTrial()")),(0,i.kt)("p",null,"Add a trial to the activity logger, as soon as a trial is added, samples can be retrieved using ",(0,i.kt)("inlineCode",{parentName:"p"},"RetrieveSamples()"),"."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Metadata: None"),(0,i.kt)("li",{parentName:"ul"},"Request: ",(0,i.kt)("a",{parentName:"li",href:"#addtrialrequest"},(0,i.kt)("inlineCode",{parentName:"a"},"AddTrialRequest"))),(0,i.kt)("li",{parentName:"ul"},"Reply: ",(0,i.kt)("a",{parentName:"li",href:"#addtrialreply"},(0,i.kt)("inlineCode",{parentName:"a"},"AddTrialReply")))),(0,i.kt)("h4",{id:"addsample"},(0,i.kt)("inlineCode",{parentName:"h4"},"AddSample()")),(0,i.kt)("p",null,"Add samples to a trial in the activity logger as a stream, as soon as a sample is added it is pushed to the matching ongoing ",(0,i.kt)("inlineCode",{parentName:"p"},"RetrieveSamples()")," requests."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Metadata:",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial-id"),": UUID of the trial to add to the activity logger."))),(0,i.kt)("li",{parentName:"ul"},"Request: Stream of ",(0,i.kt)("a",{parentName:"li",href:"#addsamplerequest"},(0,i.kt)("inlineCode",{parentName:"a"},"AddSampleRequest"))),(0,i.kt)("li",{parentName:"ul"},"Reply: ",(0,i.kt)("a",{parentName:"li",href:"#addsamplesreply"},(0,i.kt)("inlineCode",{parentName:"a"},"AddSamplesReply")))),(0,i.kt)("h4",{id:"deletetrials"},(0,i.kt)("inlineCode",{parentName:"h4"},"DeleteTrials()")),(0,i.kt)("p",null,"Delete the trials matching the given request, on failure no trial is deleted."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Metadata: None"),(0,i.kt)("li",{parentName:"ul"},"Request: ",(0,i.kt)("a",{parentName:"li",href:"#deletetrialsrequest"},(0,i.kt)("inlineCode",{parentName:"a"},"DeleteTrialsRequest"))),(0,i.kt)("li",{parentName:"ul"},"Reply: ",(0,i.kt)("a",{parentName:"li",href:"#deletetrialsreply"},(0,i.kt)("inlineCode",{parentName:"a"},"DeleteTrialsReply")))),(0,i.kt)("h3",{id:"storedtrialinfo"},(0,i.kt)("inlineCode",{parentName:"h3"},"StoredTrialInfo")),(0,i.kt)("p",null,"Defines a information about a stored trial"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message StoredTrialInfo {\n string trial_id = 1;\n TrialState last_state = 2;\n string user_id = 3;\n uint32 samples_count = 4;\n TrialParams params = 5;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_id"),": Unique identifier of the trial."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"last_state"),": Last known ",(0,i.kt)("a",{parentName:"li",href:"#trialstate"},"trial state"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"user_id"),": The id of the user that has started the trial."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"samples_count"),": The number samples that are stored for this trial."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"params"),": ",(0,i.kt)("a",{parentName:"li",href:"#trialparams"},"Parameters of the trial"),".")),(0,i.kt)("h3",{id:"storedtrialsample"},(0,i.kt)("inlineCode",{parentName:"h3"},"StoredTrialSample")),(0,i.kt)("p",null,"Represents a sample generated by a trial at a given tick."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message StoredTrialSample {\n string user_id = 1;\n string trial_id = 2;\n uint64 tick_id = 3;\n fixed64 timestamp = 4;\n TrialState state = 5;\n repeated StoredTrialActorSample actor_samples = 6;\n repeated bytes payloads = 7;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"user_id"),": The identifier of the user that has started the trial."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_id"),": Unique identifier of the trial."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"tick_id"),": Tick of this sample."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"timestamp"),": Time of the sample."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"state"),": ",(0,i.kt)("a",{parentName:"li",href:"#trialstate"},"Trial state")," of the sample."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_samples"),": ",(0,i.kt)("a",{parentName:"li",href:"#storedtrialactorsample"},"Sample data related to each actor"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"payloads"),": Serialized payload for the actors observations, actions, rewards and messages during this sample.")),(0,i.kt)("h3",{id:"storedtrialactorsample"},(0,i.kt)("inlineCode",{parentName:"h3"},"StoredTrialActorSample")),(0,i.kt)("p",null,"Represents a sample generated by an actor in a trial at a given tick, only makes sense as a part of a ",(0,i.kt)("a",{parentName:"p",href:"#storedtrialsample"},(0,i.kt)("inlineCode",{parentName:"a"},"StoredTrialSample")),"."),(0,i.kt)("p",null,"Actors are referenced by their index in the ",(0,i.kt)("a",{parentName:"p",href:"#trialparams"},"trial params")," ",(0,i.kt)("inlineCode",{parentName:"p"},"TrialParams.actors")," field. Where it make sense, the actor index can be set to -1 to reference the trial's environment."),(0,i.kt)("p",null,"Payloads (ie observations data, actions data, reward user data and messages payloads) are grouped in the ",(0,i.kt)("inlineCode",{parentName:"p"},"payloads")," field of ",(0,i.kt)("a",{parentName:"p",href:"#storedtrialsample"},(0,i.kt)("inlineCode",{parentName:"a"},"StoredTrialSample"))," and referenced by their index in this field."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message StoredTrialActorSample {\n uint32 actor = 1;\n optional uint32 observation = 2;\n optional uint32 action = 3;\n optional float reward = 4;\n repeated StoredTrialActorSampleReward received_rewards = 6;\n repeated StoredTrialActorSampleReward sent_rewards = 7;\n repeated StoredTrialActorSampleMessage received_messages = 8;\n repeated StoredTrialActorSampleMessage sent_messages = 9;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor"),": The index of the actor."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"observation"),": Observation received by the actor at the current tick, as an index of the observation payload in the parent ",(0,i.kt)("a",{parentName:"li",href:"#storedtrialsample"},(0,i.kt)("inlineCode",{parentName:"a"},"StoredTrialSample")),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"action"),": Action performed by the actor at the current tick, as an index of the action payload in the parent ",(0,i.kt)("a",{parentName:"li",href:"#storedtrialsample"},(0,i.kt)("inlineCode",{parentName:"a"},"StoredTrialSample"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"reward"),": Aggregated value of the rewards received by the actor for the current tick."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"received_rewards"),": List of the ",(0,i.kt)("a",{parentName:"li",href:"#storedtrialactorsamplereward"},"rewards")," received by the actor for the current tick."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"sent_rewards"),": List of the ",(0,i.kt)("a",{parentName:"li",href:"#storedtrialactorsamplereward"},"rewards")," sent by the actor for the current tick."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"received_messages"),": List of the ",(0,i.kt)("a",{parentName:"li",href:"#storedtrialactorsamplemessage"},"messages")," received by the actor between the current tick and the next."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"sent_messages"),": List of the ",(0,i.kt)("a",{parentName:"li",href:"#storedtrialactorsamplemessage"},"messages")," sent by the actor between the current tick and the next.")),(0,i.kt)("h3",{id:"storedtrialactorsamplereward"},(0,i.kt)("inlineCode",{parentName:"h3"},"StoredTrialActorSampleReward")),(0,i.kt)("p",null,"Represents a reward sent or received by an actor, only makes sense as a part of a ",(0,i.kt)("a",{parentName:"p",href:"#storedtrialactorsample"},(0,i.kt)("inlineCode",{parentName:"a"},"StoredTrialActorSample")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message StoredTrialActorSampleReward {\n int32 sender = 1;\n int32 receiver = 2;\n float reward = 4;\n float confidence = 5;\n optional uint32 user_data = 6;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"sender"),": Index of the actor, -1 for the environment, ignored for sent rewards."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"receiver"),": Index of the actor, -1 for the environment, received for sent rewards."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"reward"),": The numerical value of the provided reward."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"confidence"),": The weight of this reward in computing the final (aggregated) reward."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"user_data"),": User data attached to the reward, as an index of the payload in the parent ",(0,i.kt)("a",{parentName:"li",href:"#storedtrialsample"},(0,i.kt)("inlineCode",{parentName:"a"},"StoredTrialSample")),".")),(0,i.kt)("h3",{id:"storedtrialactorsamplemessage"},(0,i.kt)("inlineCode",{parentName:"h3"},"StoredTrialActorSampleMessage")),(0,i.kt)("p",null,"Represents a message sent or received by an actor, only makes sense as a part of a ",(0,i.kt)("a",{parentName:"p",href:"#storedtrialactorsample"},(0,i.kt)("inlineCode",{parentName:"a"},"StoredTrialActorSample")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message StoredTrialActorSampleMessage {\n int32 sender = 1;\n int32 receiver = 2;\n uint32 payload = 3;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"sender"),": Index of the actor, -1 for the environment, ignored for sent messages."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"receiver"),": Index of the actor, -1 for the environment, received for sent messages."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"payload"),": Payload of the message, as an index of the payload in the parent ",(0,i.kt)("a",{parentName:"li",href:"#storedtrialsample"},(0,i.kt)("inlineCode",{parentName:"a"},"StoredTrialSample")),".")),(0,i.kt)("h3",{id:"storedtrialsamplefield"},(0,i.kt)("inlineCode",{parentName:"h3"},"StoredTrialSampleField")),(0,i.kt)("p",null,"Enums representing the fields available in a ",(0,i.kt)("a",{parentName:"p",href:"#storedtrialsample"},(0,i.kt)("inlineCode",{parentName:"a"},"StoredTrialSample")),". Used to filter desired fields."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"enum StoredTrialSampleField {\n STORED_TRIAL_SAMPLE_FIELD_UNKNOWN = 0;\n STORED_TRIAL_SAMPLE_FIELD_OBSERVATION = 1;\n STORED_TRIAL_SAMPLE_FIELD_ACTION = 2;\n STORED_TRIAL_SAMPLE_FIELD_REWARD = 3;\n STORED_TRIAL_SAMPLE_FIELD_RECEIVED_REWARDS = 4;\n STORED_TRIAL_SAMPLE_FIELD_SENT_REWARDS = 5;\n STORED_TRIAL_SAMPLE_FIELD_RECEIVED_MESSAGES = 6;\n STORED_TRIAL_SAMPLE_FIELD_SENT_MESSAGES = 7;\n}\n")),(0,i.kt)("h3",{id:"retrievetrialsrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"RetrieveTrialsRequest")),(0,i.kt)("p",null,"Request for ",(0,i.kt)("a",{parentName:"p",href:"#retrievetrials"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialDatastoreSP.RetrieveTrials()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RetrieveTrialsRequest {\n repeated string trial_ids = 1;\n uint32 timeout = 2;\n uint32 trials_count = 3;\n string trial_handle = 4;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_ids"),": List of desired trial identifiers, if empty all trials are returned."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"timeout"),": (optional - in ms) Wait for trials that might be created within this duration."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trials_count"),": (optional) The desired number of trials to be retrieved, leave empty (or set to 0) for no limit."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_handle"),": (optional) Leave empty for the initial request, use previously provided ",(0,i.kt)("inlineCode",{parentName:"li"},"RetrieveTrialsReply.next_trial_handle")," on the next calls to retrieve the next versions.")),(0,i.kt)("h3",{id:"retrievetrialsreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"RetrieveTrialsReply")),(0,i.kt)("p",null,"Reply for ",(0,i.kt)("a",{parentName:"p",href:"#retrievetrials"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialDatastoreSP.RetrieveTrials()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RetrieveTrialsReply {\n repeated StoredTrialInfo trial_infos = 1;\n string next_trial_handle = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"version_infos"),": At most ",(0,i.kt)("inlineCode",{parentName:"li"},"RetrieveVersionInfosRequest.versions_count")," versions."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"next_version_handle"),": Opaque handle to be used to retrieve the next versions matching the request.")),(0,i.kt)("h3",{id:"retrievesamplesrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"RetrieveSamplesRequest")),(0,i.kt)("p",null,"Request for ",(0,i.kt)("a",{parentName:"p",href:"#retrievesamples"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialDatastoreSP.RetrieveSamples()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RetrieveSamplesRequest {\n repeated string trial_ids = 1;\n repeated string actor_names = 2;\n repeated string actor_classes = 3;\n repeated string actor_implementations = 4;\n repeated StoredTrialSampleField selected_sample_fields = 5;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_ids"),": List of desired trial ids, if empty no data will be returned."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_names"),": List of desired actor names, if empty all actor samples will be returned."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_classes"),": List of desired actor names, if empty all actor samples will be returned."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"actor_implementations"),": List of desired actor classes, if empty all actor samples will be returned."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"selected_sample_fields"),": (optional) Which fields of ",(0,i.kt)("inlineCode",{parentName:"li"},"StoredTrialSample.ActorSample")," should be returned, if empty all fields are returned.")),(0,i.kt)("h3",{id:"retrievesamplereply"},(0,i.kt)("inlineCode",{parentName:"h3"},"RetrieveSampleReply")),(0,i.kt)("p",null,"Part of the reply stream of ",(0,i.kt)("a",{parentName:"p",href:"#retrievesamples"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialDatastoreSP.RetrieveSamples()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message RetrieveSampleReply {\n StoredTrialSample trial_sample = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_sample"),": One ",(0,i.kt)("a",{parentName:"li",href:"#storedtrialsample"},"trial sample")," matching the requested ",(0,i.kt)("inlineCode",{parentName:"li"},"trial_ids")," and filtered according to the desired actors and fields.")),(0,i.kt)("h3",{id:"addtrialrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"AddTrialRequest")),(0,i.kt)("p",null,"Request for ",(0,i.kt)("a",{parentName:"p",href:"#addtrial"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialDatastoreSP.AddTrial()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message AddTrialRequest {\n string user_id = 1;\n TrialParams trial_params = 2;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"user_id"),": The ID of the user that is adding the trial."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_params"),": ",(0,i.kt)("a",{parentName:"li",href:"#trialparams"},"Parameters of the trial"),".")),(0,i.kt)("h3",{id:"addtrialreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"AddTrialReply")),(0,i.kt)("p",null,"Reply for ",(0,i.kt)("a",{parentName:"p",href:"#addtrial"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialDatastoreSP.AddTrial()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message AddTrialReply {}\n")),(0,i.kt)("h3",{id:"addsamplerequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"AddSampleRequest")),(0,i.kt)("p",null,"Part of the request stream of ",(0,i.kt)("a",{parentName:"p",href:"#addsample"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialDatastoreSP.AddSample()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message AddSampleRequest {\n StoredTrialSample trial_sample = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_sample"),": One ",(0,i.kt)("a",{parentName:"li",href:"#storedtrialsample"},"trial sample")," that should match the parameters of the target trial.")),(0,i.kt)("h3",{id:"addsamplesreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"AddSamplesReply")),(0,i.kt)("p",null,"Reply for ",(0,i.kt)("a",{parentName:"p",href:"#addsample"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialDatastoreSP.AddSample()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message AddSamplesReply {}\n")),(0,i.kt)("h3",{id:"deletetrialsrequest"},(0,i.kt)("inlineCode",{parentName:"h3"},"DeleteTrialsRequest")),(0,i.kt)("p",null,"Request for ",(0,i.kt)("a",{parentName:"p",href:"#deletetrials"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialDatastoreSP.DeleteTrials()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message DeleteTrialsRequest {\n repeated string trial_ids = 1;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_ids"),": List of the trial ids to delete, if empty no trial is deleted.")),(0,i.kt)("h3",{id:"deletetrialsreply"},(0,i.kt)("inlineCode",{parentName:"h3"},"DeleteTrialsReply")),(0,i.kt)("p",null,"Reply for ",(0,i.kt)("a",{parentName:"p",href:"#deletetrials"},(0,i.kt)("inlineCode",{parentName:"a"},"TrialDatastoreSP.DeleteTrials()")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message DeleteTrialsReply {}\n")),(0,i.kt)("h3",{id:"trialsamplesfileheader"},(0,i.kt)("inlineCode",{parentName:"h3"},"TrialSamplesFileHeader")),(0,i.kt)("p",null,"Header for the trial samples file that can be exported using ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/cli/trial-datastore/trial-datastore-client#export-command"},(0,i.kt)("inlineCode",{parentName:"a"},"cogment client export")),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-protobuf"},"message TrialSamplesFileHeader {\n VersionInfo version_info = 1;\n fixed64 export_timestamp = 2;\n map<string, TrialParams> trial_params = 3;\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"version_info"),": (",(0,i.kt)("a",{parentName:"li",href:"#versioninfo"},(0,i.kt)("inlineCode",{parentName:"a"},"cogmentAPI.VersionInfo")),") Version information for the used Cogment CLI."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"export_timestamp"),": (fixed64) The wall-clock time in nanoseconds since 00:00:00UTC January 1, 1970 (Unix Epoch time) at export."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"trial_params"),": (",(0,i.kt)("a",{parentName:"li",href:"#trialparams"},(0,i.kt)("inlineCode",{parentName:"a"},"map<string, cogmentAPI.TrialParams>")),") Parameters of the trials exported in the file referenced by their ID.")),(0,i.kt)("h4",{id:"version-7"},(0,i.kt)("inlineCode",{parentName:"h4"},"Version()")),(0,i.kt)("p",null,"Called to request version data."),(0,i.kt)("p",null,"Metadata: None"))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/d9378b29.6db302b8.js b/assets/js/d9378b29.6db302b8.js deleted file mode 100644 index 481650a..0000000 --- a/assets/js/d9378b29.6db302b8.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[4007],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>m});var a=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},r=Object.keys(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var p=a.createContext({}),s=function(e){var t=a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},c=function(e){var t=s(e.components);return a.createElement(p.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},u=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,r=e.originalType,p=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),u=s(n),m=o,h=u["".concat(p,".").concat(m)]||u[m]||d[m]||r;return n?a.createElement(h,i(i({ref:t},c),{},{components:n})):a.createElement(h,i({ref:t},c))}));function m(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=n.length,i=new Array(r);i[0]=u;var l={};for(var p in t)hasOwnProperty.call(t,p)&&(l[p]=t[p]);l.originalType=e,l.mdxType="string"==typeof e?e:o,i[1]=l;for(var s=2;s<r;s++)i[s]=n[s];return a.createElement.apply(null,i)}return a.createElement.apply(null,n)}u.displayName="MDXCreateElement"},4489:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>i,default:()=>d,frontMatter:()=>r,metadata:()=>l,toc:()=>s});var a=n(7462),o=(n(7294),n(3905));const r={},i="Add a Human Player in the Loop",l={unversionedId:"guide/tutorial/advanced-tutorials/human-player",id:"guide/tutorial/advanced-tutorials/human-player",title:"Add a Human Player in the Loop",description:"This part of the tutorial follows step 4, make sure you've gone through it before starting this one. Alternatively the completed step 4 can be retrieved from the tutorial's repository.",source:"@site/docs/guide/tutorial/advanced-tutorials/6-human-player.md",sourceDirName:"guide/tutorial/advanced-tutorials",slug:"/guide/tutorial/advanced-tutorials/human-player",permalink:"/docs/guide/tutorial/advanced-tutorials/human-player",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:6,frontMatter:{},sidebar:"docSidebar",previous:{title:"Advanced Tutorial Steps",permalink:"/docs/guide/tutorial/advanced-tutorials/"},next:{title:"Add a Web Client for the Human Player",permalink:"/docs/guide/tutorial/advanced-tutorials/web-client"}},p={},s=[{value:"Client actor implementation",id:"client-actor-implementation",level:2},{value:"Interactive prompt to let Humans play RPS",id:"interactive-prompt-to-let-humans-play-rps",level:2}],c={toc:s};function d(e){let{components:t,...n}=e;return(0,o.kt)("wrapper",(0,a.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"add-a-human-player-in-the-loop"},"Add a Human Player in the Loop"),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"This part of the tutorial follows ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/decision-making"},"step 4"),", make sure you've gone through it before starting this one. Alternatively the completed step 4 can be retrieved from the ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-tutorial-rps"},"tutorial's repository"),".")),(0,o.kt)("p",null,"In this step of the tutorial, we will go over another actor implementation, this time client-side, to enable Humans to play RPS."),(0,o.kt)("h2",{id:"client-actor-implementation"},"Client actor implementation"),(0,o.kt)("p",null,"To involve a human player in our trials, we will add a specific actor implementation in the client. While the previous ",(0,o.kt)("strong",{parentName:"p"},"service actor")," implementations are exposing endpoints Cogment's orchestrator connects to in order to run a trial, this ",(0,o.kt)("strong",{parentName:"p"},"client actor")," implementation connects to the orchestrator to join a trial. It changes a lot under the hood and enables interesting network topology because only the client needs to know how to reach the orchestrator, not the other way around. However, as you'll see, in terms of implementation it is very similar."),(0,o.kt)("p",null,"This actor implementation will be located in the client code in ",(0,o.kt)("inlineCode",{parentName:"p"},"client/main.py")),(0,o.kt)("p",null,"We first need to import the data structures needed to send actions."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'from data_pb2 import PlayerAction, ROCK, PAPER, SCISSORS\n\nMOVES = [ROCK, PAPER, SCISSORS]\nMOVES_STR = ["\ud83d\udc4a rock", "\u270b paper", "\u270c\ufe0f scissors"]\nMOVES_PROMPT = \', \'.join([ f"{name} ({idx})" for idx, name in enumerate(MOVES_STR)])\n')),(0,o.kt)("p",null,"In the ",(0,o.kt)("inlineCode",{parentName:"p"},"main")," function we then implement the ",(0,o.kt)("inlineCode",{parentName:"p"},"human_player")," actor implementation, only playing ",(0,o.kt)("inlineCode",{parentName:"p"},"PAPER")," for the moment, register the implementation and join the trial once it is initialized."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'context = cogment.Context(cog_settings=cog_settings, user_id="rps")\n\nasync def human_player(actor_session):\n round_index = 0\n\n actor_session.start()\n\n async for event in actor_session.all_events():\n if event.observation:\n observation = event.observation\n\n if event.type == cogment.EventType.ACTIVE:\n print(f"\\n-- Round #{round_index + 1} --\\n")\n\n next_action = PlayerAction(move=PAPER)\n actor_session.do_action(next_action)\n\n round_index += 1\n\ncontext.register_actor(\n impl=human_player,\n impl_name="human",\n actor_classes=["player"])\n')),(0,o.kt)("p",null,"We update the configuration of the first actor to use ",(0,o.kt)("em",{parentName:"p"},"special")," endpoint, ",(0,o.kt)("inlineCode",{parentName:"p"},'"cogment://client"'),", which tells the orchestrator to wait for a client to connect to it. We also don't need to specify an implementation name."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'actor_1_params = cogment.ActorParameters(\n cog_settings,\n name="player_1",\n class_name="player",\n endpoint="cogment://client"\n)\n')),(0,o.kt)("p",null,"Because the client actor will be active during the trial, we no longer need to use ",(0,o.kt)("inlineCode",{parentName:"p"},"watch_trials")," to await trial termination but simply need to await ",(0,o.kt)("inlineCode",{parentName:"p"},"context.join_trial")," completion."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'# Defining the trial id on the client side\ntrial_id=f"rps-{datetime.datetime.now().isoformat()}"\n\n# Start a new trial using the trial params we just created\ntrial_id = await controller.start_trial(trial_id_requested=trial_id, trial_params=trial_params)\nprint(f"Trial \'{trial_id}\' started")\n\n# Let the human actor join the trial\nawait context.join_trial(trial_id=trial_id, endpoint=cogment.Endpoint(ORCHESTRATOR_ENDPOINT), actor_name="player_1")\nprint(f"Trial \'{trial_id}\' ended")\n')),(0,o.kt)("p",null,"Modify the ",(0,o.kt)("inlineCode",{parentName:"p"},"client/main.py")," file with these updates."),(0,o.kt)("p",null,"You can now ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/setup#building-and-running-the-app"},"build and run")," the application. Everything should work but player 1 shouldn't fare too well as it only ever plays ",(0,o.kt)("inlineCode",{parentName:"p"},"PAPER"),"."),(0,o.kt)("h2",{id:"interactive-prompt-to-let-humans-play-rps"},"Interactive prompt to let Humans play RPS"),(0,o.kt)("p",null,"Let's add a text user interface to our client in order to finally challenge AIs to a game of RPS."),(0,o.kt)("p",null,"First we'll want to display what was played in the previous round. We will implement a dedicated function ",(0,o.kt)("inlineCode",{parentName:"p"},"print_observation"),"."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'def print_observation(observation):\n print(f"\ud83e\uddd1 played {MOVES_STR[observation.observation.me.last_move]}")\n print(f"\ud83e\udd16 played {MOVES_STR[observation.observation.them.last_move]}")\n if observation.observation.me.won_last:\n print(f" -> \ud83e\uddd1 wins round #{round_index + 1}")\n elif observation.observation.them.won_last:\n print(f" -> \ud83e\udd16 wins the round #{round_index + 1}")\n else:\n print(f" -> round #{round_index + 1} is a draw")\n')),(0,o.kt)("p",null,"It needs to be called whenever the actor receives an observation, except for the first time, before the first round is played. Add the following just after the observation is retrieved in the event loop."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"if round_index > 0:\n # The only time the observation is not relevant is on the first round of the first game\n print_observation(observation)\n")),(0,o.kt)("p",null,"Last but not least, instead of always picking ",(0,o.kt)("inlineCode",{parentName:"p"},"PAPER")," we will read from the keyboard input what the player wishes to play. Using python's ",(0,o.kt)("a",{parentName:"p",href:"https://docs.python.org/3.7/library/functions.html#input"},(0,o.kt)("inlineCode",{parentName:"a"},"input"))," function we can print a prompt and read whatever the user enters before pressing ",(0,o.kt)("inlineCode",{parentName:"p"},"<ENTER>"),"."),(0,o.kt)("p",null,"Note that the following implementation expects a number between 1 and 3 and doesn't handle well any other input."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"move = MOVES[int(input(MOVES_PROMPT))]\nnext_action = PlayerAction(move=move)\n")),(0,o.kt)("p",null,"Modify the ",(0,o.kt)("inlineCode",{parentName:"p"},"client/main.py")," file to include the above additions."),(0,o.kt)("p",null,"You can now ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/setup#building-and-running-the-app"},"build and run")," the application. You'll be presented with a prompt for choosing your moves and comparing your skills to the simple heuristic AI we implemented earlier."),(0,o.kt)("p",null,"This concludes the step 5 of the tutorial: you implemented your first client actor and put your first human in the loop! This is also the final step for the basics tutorial."),(0,o.kt)("p",null,"You can continue by implementing a web client to replace the command line interface we just developed in ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/advanced-tutorials/web-client"},"step 6"),"."))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/d9378b29.fc93762c.js b/assets/js/d9378b29.fc93762c.js new file mode 100644 index 0000000..8cc295c --- /dev/null +++ b/assets/js/d9378b29.fc93762c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[4007],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>h});var a=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},r=Object.keys(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var p=a.createContext({}),s=function(e){var t=a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},c=function(e){var t=s(e.components);return a.createElement(p.Provider,{value:t},e.children)},d="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,r=e.originalType,p=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),d=s(n),m=o,h=d["".concat(p,".").concat(m)]||d[m]||u[m]||r;return n?a.createElement(h,i(i({ref:t},c),{},{components:n})):a.createElement(h,i({ref:t},c))}));function h(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=n.length,i=new Array(r);i[0]=m;var l={};for(var p in t)hasOwnProperty.call(t,p)&&(l[p]=t[p]);l.originalType=e,l[d]="string"==typeof e?e:o,i[1]=l;for(var s=2;s<r;s++)i[s]=n[s];return a.createElement.apply(null,i)}return a.createElement.apply(null,n)}m.displayName="MDXCreateElement"},4489:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>i,default:()=>u,frontMatter:()=>r,metadata:()=>l,toc:()=>s});var a=n(7462),o=(n(7294),n(3905));const r={},i="Add a Human Player in the Loop",l={unversionedId:"guide/tutorial/advanced-tutorials/human-player",id:"guide/tutorial/advanced-tutorials/human-player",title:"Add a Human Player in the Loop",description:"This part of the tutorial follows step 4, make sure you've gone through it before starting this one. Alternatively the completed step 4 can be retrieved from the tutorial's repository.",source:"@site/docs/guide/tutorial/advanced-tutorials/6-human-player.md",sourceDirName:"guide/tutorial/advanced-tutorials",slug:"/guide/tutorial/advanced-tutorials/human-player",permalink:"/docs/guide/tutorial/advanced-tutorials/human-player",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:6,frontMatter:{},sidebar:"docSidebar",previous:{title:"Advanced Tutorial Steps",permalink:"/docs/guide/tutorial/advanced-tutorials/"},next:{title:"Add a Web Client for the Human Player",permalink:"/docs/guide/tutorial/advanced-tutorials/web-client"}},p={},s=[{value:"Client actor implementation",id:"client-actor-implementation",level:2},{value:"Interactive prompt to let Humans play RPS",id:"interactive-prompt-to-let-humans-play-rps",level:2}],c={toc:s},d="wrapper";function u(e){let{components:t,...n}=e;return(0,o.kt)(d,(0,a.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"add-a-human-player-in-the-loop"},"Add a Human Player in the Loop"),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"This part of the tutorial follows ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/decision-making"},"step 4"),", make sure you've gone through it before starting this one. Alternatively the completed step 4 can be retrieved from the ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/cogment/cogment-tutorial-rps"},"tutorial's repository"),".")),(0,o.kt)("p",null,"In this step of the tutorial, we will go over another actor implementation, this time client-side, to enable Humans to play RPS."),(0,o.kt)("h2",{id:"client-actor-implementation"},"Client actor implementation"),(0,o.kt)("p",null,"To involve a human player in our trials, we will add a specific actor implementation in the client. While the previous ",(0,o.kt)("strong",{parentName:"p"},"service actor")," implementations are exposing endpoints Cogment's orchestrator connects to in order to run a trial, this ",(0,o.kt)("strong",{parentName:"p"},"client actor")," implementation connects to the orchestrator to join a trial. It changes a lot under the hood and enables interesting network topology because only the client needs to know how to reach the orchestrator, not the other way around. However, as you'll see, in terms of implementation it is very similar."),(0,o.kt)("p",null,"This actor implementation will be located in the client code in ",(0,o.kt)("inlineCode",{parentName:"p"},"client/main.py")),(0,o.kt)("p",null,"We first need to import the data structures needed to send actions."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'from data_pb2 import PlayerAction, ROCK, PAPER, SCISSORS\n\nMOVES = [ROCK, PAPER, SCISSORS]\nMOVES_STR = ["\ud83d\udc4a rock", "\u270b paper", "\u270c\ufe0f scissors"]\nMOVES_PROMPT = \', \'.join([ f"{name} ({idx})" for idx, name in enumerate(MOVES_STR)])\n')),(0,o.kt)("p",null,"In the ",(0,o.kt)("inlineCode",{parentName:"p"},"main")," function we then implement the ",(0,o.kt)("inlineCode",{parentName:"p"},"human_player")," actor implementation, only playing ",(0,o.kt)("inlineCode",{parentName:"p"},"PAPER")," for the moment, register the implementation and join the trial once it is initialized."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'context = cogment.Context(cog_settings=cog_settings, user_id="rps")\n\nasync def human_player(actor_session):\n round_index = 0\n\n actor_session.start()\n\n async for event in actor_session.all_events():\n if event.observation:\n observation = event.observation\n\n if event.type == cogment.EventType.ACTIVE:\n print(f"\\n-- Round #{round_index + 1} --\\n")\n\n next_action = PlayerAction(move=PAPER)\n actor_session.do_action(next_action)\n\n round_index += 1\n\ncontext.register_actor(\n impl=human_player,\n impl_name="human",\n actor_classes=["player"])\n')),(0,o.kt)("p",null,"We update the configuration of the first actor to use ",(0,o.kt)("em",{parentName:"p"},"special")," endpoint, ",(0,o.kt)("inlineCode",{parentName:"p"},'"cogment://client"'),", which tells the orchestrator to wait for a client to connect to it. We also don't need to specify an implementation name."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'actor_1_params = cogment.ActorParameters(\n cog_settings,\n name="player_1",\n class_name="player",\n endpoint="cogment://client"\n)\n')),(0,o.kt)("p",null,"Because the client actor will be active during the trial, we no longer need to use ",(0,o.kt)("inlineCode",{parentName:"p"},"watch_trials")," to await trial termination but simply need to await ",(0,o.kt)("inlineCode",{parentName:"p"},"context.join_trial")," completion."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'# Defining the trial id on the client side\ntrial_id=f"rps-{datetime.datetime.now().isoformat()}"\n\n# Start a new trial using the trial params we just created\ntrial_id = await controller.start_trial(trial_id_requested=trial_id, trial_params=trial_params)\nprint(f"Trial \'{trial_id}\' started")\n\n# Let the human actor join the trial\nawait context.join_trial(trial_id=trial_id, endpoint=cogment.Endpoint(ORCHESTRATOR_ENDPOINT), actor_name="player_1")\nprint(f"Trial \'{trial_id}\' ended")\n')),(0,o.kt)("p",null,"Modify the ",(0,o.kt)("inlineCode",{parentName:"p"},"client/main.py")," file with these updates."),(0,o.kt)("p",null,"You can now ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/setup#building-and-running-the-app"},"build and run")," the application. Everything should work but player 1 shouldn't fare too well as it only ever plays ",(0,o.kt)("inlineCode",{parentName:"p"},"PAPER"),"."),(0,o.kt)("h2",{id:"interactive-prompt-to-let-humans-play-rps"},"Interactive prompt to let Humans play RPS"),(0,o.kt)("p",null,"Let's add a text user interface to our client in order to finally challenge AIs to a game of RPS."),(0,o.kt)("p",null,"First we'll want to display what was played in the previous round. We will implement a dedicated function ",(0,o.kt)("inlineCode",{parentName:"p"},"print_observation"),"."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'def print_observation(observation):\n print(f"\ud83e\uddd1 played {MOVES_STR[observation.observation.me.last_move]}")\n print(f"\ud83e\udd16 played {MOVES_STR[observation.observation.them.last_move]}")\n if observation.observation.me.won_last:\n print(f" -> \ud83e\uddd1 wins round #{round_index + 1}")\n elif observation.observation.them.won_last:\n print(f" -> \ud83e\udd16 wins the round #{round_index + 1}")\n else:\n print(f" -> round #{round_index + 1} is a draw")\n')),(0,o.kt)("p",null,"It needs to be called whenever the actor receives an observation, except for the first time, before the first round is played. Add the following just after the observation is retrieved in the event loop."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"if round_index > 0:\n # The only time the observation is not relevant is on the first round of the first game\n print_observation(observation)\n")),(0,o.kt)("p",null,"Last but not least, instead of always picking ",(0,o.kt)("inlineCode",{parentName:"p"},"PAPER")," we will read from the keyboard input what the player wishes to play. Using python's ",(0,o.kt)("a",{parentName:"p",href:"https://docs.python.org/3.7/library/functions.html#input"},(0,o.kt)("inlineCode",{parentName:"a"},"input"))," function we can print a prompt and read whatever the user enters before pressing ",(0,o.kt)("inlineCode",{parentName:"p"},"<ENTER>"),"."),(0,o.kt)("p",null,"Note that the following implementation expects a number between 1 and 3 and doesn't handle well any other input."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"move = MOVES[int(input(MOVES_PROMPT))]\nnext_action = PlayerAction(move=move)\n")),(0,o.kt)("p",null,"Modify the ",(0,o.kt)("inlineCode",{parentName:"p"},"client/main.py")," file to include the above additions."),(0,o.kt)("p",null,"You can now ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/setup#building-and-running-the-app"},"build and run")," the application. You'll be presented with a prompt for choosing your moves and comparing your skills to the simple heuristic AI we implemented earlier."),(0,o.kt)("p",null,"This concludes the step 5 of the tutorial: you implemented your first client actor and put your first human in the loop! This is also the final step for the basics tutorial."),(0,o.kt)("p",null,"You can continue by implementing a web client to replace the command line interface we just developed in ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/advanced-tutorials/web-client"},"step 6"),"."))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/e848be99.7ec8f765.js b/assets/js/e848be99.7ec8f765.js new file mode 100644 index 0000000..14110dc --- /dev/null +++ b/assets/js/e848be99.7ec8f765.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[8172],{3905:(e,t,n)=>{n.d(t,{Zo:()=>m,kt:()=>u});var a=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=a.createContext({}),p=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):r(r({},t),e)),n},m=function(e){var t=p(e.components);return a.createElement(l.Provider,{value:t},e.children)},h="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,l=e.parentName,m=s(e,["components","mdxType","originalType","parentName"]),h=p(n),d=o,u=h["".concat(l,".").concat(d)]||h[d]||c[d]||i;return n?a.createElement(u,r(r({ref:t},m),{},{components:n})):a.createElement(u,r({ref:t},m))}));function u(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,r=new Array(i);r[0]=d;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[h]="string"==typeof e?e:o,r[1]=s;for(var p=2;p<i;p++)r[p]=n[p];return a.createElement.apply(null,r)}return a.createElement.apply(null,n)}d.displayName="MDXCreateElement"},9208:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>r,default:()=>c,frontMatter:()=>i,metadata:()=>s,toc:()=>p});var a=n(7462),o=(n(7294),n(3905));const i={title:"Step 3 - The Environment in Cogment"},r="The Environment: A Game of RPS",s={unversionedId:"guide/tutorial/environment-in-cogment",id:"guide/tutorial/environment-in-cogment",title:"Step 3 - The Environment in Cogment",description:"In this step of the tutorial, we will look at what is needed to define the Environment in which Actors operate. Our goal in this section is to implement the rules for how the Environment responds to the actions at each step and produces new Observations for the Actors.",source:"@site/docs/guide/tutorial/3-environment-in-cogment.md",sourceDirName:"guide/tutorial",slug:"/guide/tutorial/environment-in-cogment",permalink:"/docs/guide/tutorial/environment-in-cogment",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:3,frontMatter:{title:"Step 3 - The Environment in Cogment"},sidebar:"docSidebar",previous:{title:"Step 2 - Actors in Cogment",permalink:"/docs/guide/tutorial/actors-in-cogment"},next:{title:"Step 4 - Making Decisions with Feedback",permalink:"/docs/guide/tutorial/decision-making"}},l={},p=[{value:"What does Cogment need to know about the Environment?",id:"what-does-cogment-need-to-know-about-the-environment",level:2},{value:"Defining the Environment Service",id:"defining-the-environment-service",level:2},{value:"Defining the Environment Implementation",id:"defining-the-environment-implementation",level:2},{value:"Implementing the rules of the game",id:"implementing-the-rules-of-the-game",level:2},{value:"The Initialization Block: Creating the First Observations for Each Player",id:"the-initialization-block-creating-the-first-observations-for-each-player",level:3},{value:"The Event Loop: Creating New Observations in Response to Player Actions",id:"the-event-loop-creating-new-observations-in-response-to-player-actions",level:3},{value:"The termination block: reporting on what happened in the game",id:"the-termination-block-reporting-on-what-happened-in-the-game",level:3},{value:"Modifying the Environment Implementation to end the game",id:"modifying-the-environment-implementation-to-end-the-game",level:2},{value:"Modifying the Trial Runner to receive the termination signal from the Environment",id:"modifying-the-trial-runner-to-receive-the-termination-signal-from-the-environment",level:2}],m={toc:p},h="wrapper";function c(e){let{components:t,...i}=e;return(0,o.kt)(h,(0,a.Z)({},m,i,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"the-environment-a-game-of-rps"},"The Environment: A Game of RPS"),(0,o.kt)("p",null,"In this step of the tutorial, we will look at what is needed to define the Environment in which Actors operate. Our goal in this section is to implement the rules for how the Environment responds to the actions at each step and produces new Observations for the Actors."),(0,o.kt)("h2",{id:"what-does-cogment-need-to-know-about-the-environment"},"What does Cogment need to know about the Environment?"),(0,o.kt)("p",null,"The ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#environment"},"Environment")," is the world in which Actors will operate. In the most general terms, we can think of the Environment as being the set of all possible states the world can be in, and the rules which determine the consequences of taking specific actions in these states. For RPS, the Environment can be fully specified by setting which states are possible (the different combinations of ",(0,o.kt)("inlineCode",{parentName:"p"},"ROCK"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"PAPER")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"SCISSORS")," from each Actor), and the rules for what happens when we observe each pair."),(0,o.kt)("p",null,"To fully specify the Environment in Cogment, we need to define what the Environment is (eg. what makes an RPS game), how computes the outcome of player actions, and where those computations are run."),(0,o.kt)("p",null,"To better understand how Cogment thinks of the Environment component, we use the following terminology (similar to that used for Actors):"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("strong",{parentName:"li"},"Environment Service")," is a designated node for taking care of the computations made by the Environment. This is ",(0,o.kt)("em",{parentName:"li"},"where")," the Environment computations happen. The Environment Service is launched by ",(0,o.kt)("inlineCode",{parentName:"li"},"environment/main.py")," on the TCP port set by the ",(0,o.kt)("inlineCode",{parentName:"li"},"ENVIRONMENT_PORT")," variable in the ",(0,o.kt)("inlineCode",{parentName:"li"},".env")," file."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("strong",{parentName:"li"},"Environment Implementation")," is the function that specifies the rules of the game. The implementation takes actions as inputs and produces observations as outputs. This is ",(0,o.kt)("em",{parentName:"li"},"how")," the Environment operations work. The Environment implementation function we will use is ",(0,o.kt)("inlineCode",{parentName:"li"},"rps_environment")," defined in ",(0,o.kt)("inlineCode",{parentName:"li"},"environment/main.py"))),(0,o.kt)("p",null,"Notice that we don't use a class to define ",(0,o.kt)("em",{parentName:"p"},"what")," the Environment does, as we did for the Actors. The specification is still made in the ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file, but instead we define what an RPS game is with the ",(0,o.kt)("inlineCode",{parentName:"p"},"EnvironmentConfig")," message type from the ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto"),". You can look in ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto")," to see, but so far the message is still empty. We will add the necessary information to the message later in this step of the tutorial."),(0,o.kt)("h2",{id:"defining-the-environment-service"},"Defining the Environment Service"),(0,o.kt)("p",null,"Let's look at ",(0,o.kt)("inlineCode",{parentName:"p"},"environment/main.py")," to see how Cogment sets up the Environment."),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Registering environment service with Cogment",src:n(1676).Z,width:"1592",height:"388"}),"\nThe code is very similar to what we saw previously for the Actor service: The ",(0,o.kt)("inlineCode",{parentName:"p"},"main()")," function first initializes a ",(0,o.kt)("a",{parentName:"p",href:"https://cogment.ai/docs/reference/python#class-cogmentcontext"},"context")," in which the Environment will be registered. When registering the Environment in the context, we use the ",(0,o.kt)("inlineCode",{parentName:"p"},"register_environment")," method which takes only an implementation. Here we will use the ",(0,o.kt)("inlineCode",{parentName:"p"},"rps_environment")," function (also defined in ",(0,o.kt)("inlineCode",{parentName:"p"},"environment/main.py"),", more on this in a moment) as our implementation."),(0,o.kt)("p",null,"Then, the ",(0,o.kt)("inlineCode",{parentName:"p"},"main()")," function will start the Environment service on the appropriate port, and awaits the termination of the service."),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"Ports for running services are specified in the ",(0,o.kt)("inlineCode",{parentName:"p"},".env")," file, loaded by the ",(0,o.kt)("inlineCode",{parentName:"p"},".run.sh")," script, and retrieved by the ",(0,o.kt)("inlineCode",{parentName:"p"},"os")," package to make the variable available to Python. To change the port this service uses, update the",(0,o.kt)("inlineCode",{parentName:"p"},".env")," file in the root level of the ",(0,o.kt)("inlineCode",{parentName:"p"},"rps")," directory rather than changing ",(0,o.kt)("inlineCode",{parentName:"p"},"main.py"),".")),(0,o.kt)("h2",{id:"defining-the-environment-implementation"},"Defining the Environment Implementation"),(0,o.kt)("p",null,"The implementation function, called ",(0,o.kt)("inlineCode",{parentName:"p"},"rps_environment")," here, is structured similarly to the Actor's implementation."),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Defining the Environment Implementation function",src:n(8986).Z,width:"1750",height:"1628"})),(0,o.kt)("p",null,"Similar to the Actor implementation, there are three parts to the Environment implementation:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("strong",{parentName:"li"},"initialization")," block, where we can set variables that are important to know before the session starts. Later in this step of the tutorial, we will set up the initialization block to keep track of some stats about previous actions taken and which player won/lost each round."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("strong",{parentName:"li"},"event loop"),", which specifies how the environment produces observations based on the Actors' actions."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("strong",{parentName:"li"},"termination")," block, i.e. what happens after all the events have occurred. Here we'll use the termination block to print out some information about what happened between the players during a round of play.")),(0,o.kt)("p",null,"As with the Actor implementation, the Environment implementation takes as an argument the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-environmentsession--session-"},"Environment session"),", which allows the Orchestrator to manage all the data associate with the Environment's operations in the trial."),(0,o.kt)("p",null,"Note that the Environment implementation makes use of the ",(0,o.kt)("inlineCode",{parentName:"p"},"Observation")," the data structure defined in ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto")," defining the actors observation space, but so far it is just empty - we have not yet provided any data to populate the ",(0,o.kt)("inlineCode",{parentName:"p"},"Observation")," message."),(0,o.kt)("h2",{id:"implementing-the-rules-of-the-game"},"Implementing the rules of the game"),(0,o.kt)("p",null,"We will first need to bring in the relevant datastructures into the ",(0,o.kt)("inlineCode",{parentName:"p"},"environment/main.py")," file so that our Environment implementation can work with the same action space and can create the bservations in the format the Actors expect to receive. We can see in ",(0,o.kt)("inlineCode",{parentName:"p"},"environment/main.py")," that we have already imported the ",(0,o.kt)("inlineCode",{parentName:"p"},"Observation")," data structure."),(0,o.kt)("p",null,"If we look at the definition of the ",(0,o.kt)("inlineCode",{parentName:"p"},"Observation")," message in the ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto"),", we see that it stores two fields of ",(0,o.kt)("inlineCode",{parentName:"p"},"PlayerState")," information: one field keeping track of the player itself and one keeping track of its opponent. This means in order to create the correct type of ",(0,o.kt)("inlineCode",{parentName:"p"},"Observation")," messages, we will also need to import the ",(0,o.kt)("inlineCode",{parentName:"p"},"PlayerState")," data structure to ",(0,o.kt)("inlineCode",{parentName:"p"},"environment/main.py"),". We will also need to import the types of moves that can be made so that we can define the relationships between them."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},'In the "Imports" section at the top of the file, add the following:')),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"from data_pb2 import PlayerState, ROCK, PAPER, SCISSORS\n")),(0,o.kt)("p",null,"Next we can define a mapping between each move and the move that it defeats - this is basically all of the information necessary to establish the rules of the game. ",(0,o.kt)("strong",{parentName:"p"},'In the "Settings" section, add the following:')),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"DEFEATS = {\n ROCK: PAPER,\n SCISSORS: ROCK,\n PAPER: SCISSORS\n}\n")),(0,o.kt)("p",null,'You may have played RPS in which the winner is "best of N rounds" - for example, you must beat your opponent in 2 out of 3 rounds to win the game. We will want the Environment implementation to keep track of the number of rounds played and won by each of the two players so that we can know when to call a winner. Here we will create a simple ',(0,o.kt)("inlineCode",{parentName:"p"},"state")," data structure in the ",(0,o.kt)("inlineCode",{parentName:"p"},"rps_environment")," initialization block to keep track of how often each of players wins a round during the trial. Later we will set up how many successful rounds constitute winning the game. ",(0,o.kt)("strong",{parentName:"p"},"Add the following code to the initialization block of the Environment implementation function (before the event loop):")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'state = {\n "rounds_count": 0,\n "p1": {\n "score": 0\n },\n "p2": {\n "score": 0\n },\n}\n')),(0,o.kt)("h3",{id:"the-initialization-block-creating-the-first-observations-for-each-player"},"The Initialization Block: Creating the First Observations for Each Player"),(0,o.kt)("p",null,"When we start a Trial, each player will need an initial ",(0,o.kt)("inlineCode",{parentName:"p"},"Observation")," from the Environment. The ",(0,o.kt)("inlineCode",{parentName:"p"},"Observation")," message tracks what each player's last move was and whether they won or lost the previous round, so we will have to set these by hand to start. ",(0,o.kt)("strong",{parentName:"p"},"Add the following code to the initialization block:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"p1_state = PlayerState(won_last=False, last_move=None)\np2_state = PlayerState(won_last=False, last_move=None)\nenvironment_session.start([\n (p1.actor_name, Observation(me=p1_state, them=p2_state)),\n (p2.actor_name, Observation(me=p2_state, them=p1_state)),\n])\n")),(0,o.kt)("p",null,"This code does the following:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"Sets the initial state for each of the two Actors - neither won last game nor had a last move"),(0,o.kt)("li",{parentName:"ul"},"Calls for the session to start, which tells the Orchestrator to send an initial observation is sent to all actors. Each actor is given the appropriate ",(0,o.kt)("inlineCode",{parentName:"li"},"Observation")," constructed with the correct initial ",(0,o.kt)("inlineCode",{parentName:"li"},"PlayerState")," messages. One instance of ",(0,o.kt)("inlineCode",{parentName:"li"},"PlayerState")," per player is created, each is used as the ",(0,o.kt)("inlineCode",{parentName:"li"},"me")," and ",(0,o.kt)("inlineCode",{parentName:"li"},"them")," state of each player's ",(0,o.kt)("inlineCode",{parentName:"li"},"Observation"))),(0,o.kt)("h3",{id:"the-event-loop-creating-new-observations-in-response-to-player-actions"},"The Event Loop: Creating New Observations in Response to Player Actions"),(0,o.kt)("p",null,"In the ",(0,o.kt)("strong",{parentName:"p"},"event loop")," we implement how the Environment produces the next Observations in response to the Actor's actions. We need to retrieve each player's action and determine which player won the round. Then, we update the internal ",(0,o.kt)("inlineCode",{parentName:"p"},"state"),". Finally, we produce up-to-date observations for the players."),(0,o.kt)("p",null,"So far, we have printed the actions the Environment received from each player, but these are the ",(0,o.kt)("inlineCode",{parentName:"p"},"PlayerAction")," data structures. What we actually want to work with is the ",(0,o.kt)("inlineCode",{parentName:"p"},".move")," attribute, which stores the index of the action that was taken. We'll use this ",(0,o.kt)("inlineCode",{parentName:"p"},"move")," attribute to determine which of the two players wins. If the two players had the same move, nobody wins. We'll also keep track of this in our ",(0,o.kt)("inlineCode",{parentName:"p"},"state")," object. ",(0,o.kt)("strong",{parentName:"p"},"Add the following code below your print statements:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'# Compute who wins, if the two players had the same move, nobody wins\np1_state = PlayerState(\n won_last=p1_action.move == DEFEATS[p2_action.move],\n last_move=p1_action.move\n)\np2_state = PlayerState(\n won_last=p2_action.move == DEFEATS[p1_action.move],\n last_move=p2_action.move\n)\n\n# keep track of winner/loser of each round\nstate["rounds_count"] += 1\nif p1_state.won_last:\n state["p1"]["score"] += 1\n print(f"{p1.actor_name} wins!")\nelif p2_state.won_last:\n state["p2"]["score"] += 1\n print(f"{p2.actor_name} wins!")\nelse:\n print(f"draw.")\n')),(0,o.kt)("p",null,"This code computes for each player whether they won or lost, based on how their move compared to their opponents move by the hierarchy of moves specified in the ",(0,o.kt)("inlineCode",{parentName:"p"},"DEFEATS")," dictionary. We then log it in the ",(0,o.kt)("inlineCode",{parentName:"p"},"state")," dictionary object defined in the initialization block."),(0,o.kt)("p",null,"Finally, we need to construct the new Observation from these new player states, and pass this information along to the Actors if the trial is still active (eg. if the game hasn't ended). ",(0,o.kt)("strong",{parentName:"p"},"To do this, add the following code to the event loop:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"}," # produce observation of updated state (computed above)\n observations = [\n (p1.actor_name, Observation(me=p1_state, them=p2_state)),\n (p2.actor_name, Observation(me=p2_state, them=p1_state)),\n ]\n if event.type == cogment.EventType.ACTIVE:\n # The trial is active\n environment_session.produce_observations(observations)\n else:\n # The trial termination has been requested\n environment_session.end(observations)\n")),(0,o.kt)("h3",{id:"the-termination-block-reporting-on-what-happened-in-the-game"},"The termination block: reporting on what happened in the game"),(0,o.kt)("p",null,"Finally, we will add some statements to the termination block to present a read-out about what happened in the Trial. ",(0,o.kt)("strong",{parentName:"p"},"In the termination block, replace the ",(0,o.kt)("inlineCode",{parentName:"strong"},'print("environment end")')," with:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"print(f\"Trial {environment_session.get_trial_id()} ended:\")\nprint(f\"\\t * {state['rounds_count']} rounds played\")\nprint(f\"\\t * {p1.actor_name} won {state['p1']['score']} rounds\")\nprint(f\"\\t * {p2.actor_name} won {state['p2']['score']} rounds\")\nprint(f\"\\t * {state['rounds_count'] - state['p1']['score'] - state['p2']['score']} draws\", flush=True)\n")),(0,o.kt)("p",null,"Note we add a ",(0,o.kt)("inlineCode",{parentName:"p"},"flush=True")," to the last print call to flush the data buffer so our output actually gets printed before the service gets terminated."),(0,o.kt)("p",null,"We now have an Environment implementation that will properly construct Observations to pass to the Actors, meaning we have fully defined all the inputs and outputs necessary for the sequential interaction between the Actor and Environment components to play rounds of RPS. However, RPS is usually played in games won by the player reaching a target score, i.e. a number of won rounds."),(0,o.kt)("p",null,"You can ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/setup#building-and-running-the-app"},"install and run")," the application to test your Environment implementation. Given the nature of the game and the fact that the Actors don't actually use the Observation information in any meaningful way, we expect Bob to win around 1/3 of the time, Alice to win 1/3 of the time, and the remaining 1/3 to be draws."),(0,o.kt)("h1",{id:"configuring-the-environment-how-many-successful-rounds-to-win-the-game"},"Configuring the Environment: How many successful rounds to win the game?"),(0,o.kt)("p",null,'We hinted earlier that RPS is not about single, disconnected rounds, but in playing a "best of N" game. Here we will show how the Environment can be configured with parameters. Setting up the game this way will also be useful later when we make an Actor implementation that can meaningfully use the information in the Observations to pick an action with some strategy, rather than randomly.'),(0,o.kt)("p",null,"We want to set up the Environment so that a trial is complete when one of the two players has won enough rounds. ",(0,o.kt)("strong",{parentName:"p"},"We can do this by adding a parameter to our previously empty ",(0,o.kt)("inlineCode",{parentName:"strong"},"EnvironmentConfig")," message in the ",(0,o.kt)("inlineCode",{parentName:"strong"},"data.proto")," file:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-protobuf"},"message EnvironmentConfig {\n int32 target_score = 1;\n}\n")),(0,o.kt)("p",null,"This data structure is referenced within ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," in the ",(0,o.kt)("inlineCode",{parentName:"p"},"environment.config_type")," to define how the Environment is configured (you may think of it as similar to how the Actor classes were specified in the ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file). Note that the ",(0,o.kt)("inlineCode",{parentName:"p"},"target_score")," above is just the first argument to the ",(0,o.kt)("inlineCode",{parentName:"p"},"EnvironmentConfig")," message -- we will set its value when we configure the Environment for the Trial."),(0,o.kt)("p",null,"If we open ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_runner/main.py")," we will see that we pass an empty ",(0,o.kt)("inlineCode",{parentName:"p"},"EnvironmentConfig")," when setting up the Environment in the Trial Runner. We can modify this function to set a value for the ",(0,o.kt)("inlineCode",{parentName:"p"},"target_score")," which a player will need to reach before the game ends. ",(0,o.kt)("strong",{parentName:"p"},"Modify the ",(0,o.kt)("inlineCode",{parentName:"strong"},"EnvironmentConfig")," in the Trial Runner to be the following:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"env_config = EnvironmentConfig(\n target_score = 5\n)\n")),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"Note that whenever we make a modification to the ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto")," file, we will need to re-run ",(0,o.kt)("inlineCode",{parentName:"p"},"./run.sh install")," to regenerate the ",(0,o.kt)("inlineCode",{parentName:"p"},"data_pb2.py")," file which the Python SDK uses for the implementations.")),(0,o.kt)("h2",{id:"modifying-the-environment-implementation-to-end-the-game"},"Modifying the Environment Implementation to end the game"),(0,o.kt)("p",null,"We now need to modify the Environment implementation to handle counting the number of rounds won, and executing the termination of the Trial once the ",(0,o.kt)("inlineCode",{parentName:"p"},"target_score")," has been reached."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"In the initialization block of the ",(0,o.kt)("inlineCode",{parentName:"strong"},"rps_environment")," implementation function in ",(0,o.kt)("inlineCode",{parentName:"strong"},"environment/main.py"),", add the following:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"# Default target score\nif environment_session.config is not None and environment_session.config.target_score >= 0:\n target_score = environment_session.config.target_score\nelse:\n target_score = 3\n")),(0,o.kt)("p",null,"The above code retrieves the value of the ",(0,o.kt)("inlineCode",{parentName:"p"},"target_score")," from the environment's configuration and sets a default value in case nothing is specified. When we configured the trial, we set the ",(0,o.kt)("inlineCode",{parentName:"p"},"target_score")," to be 5, but if the ",(0,o.kt)("inlineCode",{parentName:"p"},"environment_session")," doesn't have the right configuration details, the ",(0,o.kt)("inlineCode",{parentName:"p"},"target_score")," will be set to 3 by the Environment itself."),(0,o.kt)("p",null,"We also want the Environment to request the end of the Trial when this target score has been reached. ",(0,o.kt)("strong",{parentName:"p"},"In the event block, let's modify the code which handles the end of the game (eg. replace the check that the ",(0,o.kt)("inlineCode",{parentName:"strong"},"event.type==cogment.EventType.ACTIVE"),") to be:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'# handle end of game\nif state["p1"]["score"] >= target_score:\n # p1 won\n environment_session.end(observations)\nelif state["p2"]["score"] >= target_score:\n # p2 won\n environment_session.end(observations)\nelse:\n # target score is not reached, continue sending observations to actors\n environment_session.produce_observations(observations)\n')),(0,o.kt)("h2",{id:"modifying-the-trial-runner-to-receive-the-termination-signal-from-the-environment"},"Modifying the Trial Runner to receive the termination signal from the Environment"),(0,o.kt)("p",null,"Previously, the Trial Runner handled the termination of the Trial after 5 seconds. Now we want the Environment to handle the termination of the trial, so we need to modify the Trial Runner code to support this."),(0,o.kt)("p",null,"If we look at the ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_runner/main.py")," file, we will see that the Trial Runner gets the ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_id")," from the controller's ",(0,o.kt)("inlineCode",{parentName:"p"},"start_trial")," method. Because of the asynchronous nature of how these services run, we will need to initiate a function to listen for the trial's end ",(0,o.kt)("em",{parentName:"p"},"before")," we have initiated the trial start. This means we will need to know the ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_id")," ahead of time, so when we call ",(0,o.kt)("inlineCode",{parentName:"p"},"start_trial")," we will pass it our chosen ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_id")," as an argument."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"In ",(0,o.kt)("inlineCode",{parentName:"strong"},"trial_runner/main.py")," we'll change the way the Trial Runner starts the trials to the following:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'# set the name of the trial we want to be listening for\ntrial_id=f"rps-{datetime.datetime.now().isoformat()}"\n\n# Listening for ended trials\nasync def await_trial():\n async for trial_info in controller.watch_trials(trial_state_filters=[cogment.TrialState.ENDED]):\n if trial_info.trial_id == trial_id:\n break\nawait_trial_task = asyncio.create_task(await_trial())\n\n# Start a new trial using the trial params we just created\ntrial_id = await controller.start_trial(trial_id_requested=trial_id, trial_params=trial_params)\nprint(f"Trial \'{trial_id}\' started")\n\n# Wait for the trial to end\nawait await_trial_task\nprint(f"Trial \'{trial_id}\' ended")\n')),(0,o.kt)("p",null,"The above code sets the ID of the trial, then defines how to use ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#async-watchtrialsself-trialstatefilters-fullinfofalse"},(0,o.kt)("inlineCode",{parentName:"a"},"controller.watch_trials"))," that will listen for the Environment to terminate the trial. It starts the trial with the specified ID, and then watches for the trial end."),(0,o.kt)("p",null,"We can now ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/setup#building-and-running-the-app"},"install and run")," the application to see that this works as expected. Bob and Alice play a single game of RPS which ends when one of the two players reaches the target number of rounds."),(0,o.kt)("details",null,(0,o.kt)("summary",null,(0,o.kt)("b",null,(0,o.kt)("span",{style:{fontSize:"20px"}},"Quick Summary"))),(0,o.kt)("p",null,"We learned about how Cogment represents the Environment through its implementation and configuration."),(0,o.kt)("p",null,"We set up the necessary components in ",(0,o.kt)("inlineCode",{parentName:"p"},"environment/main.py")," to specify the rules of RPS, namely:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"\nfrom data_pb2 import PlayerState, ROCK, PAPER, SCISSORS\nDEFEATS = {\n ROCK: PAPER,\n SCISSORS: ROCK,\n PAPER: SCISSORS\n}\n")),(0,o.kt)("p",null,"In the initialWe added a data structure to keep track of statistics over a number of rounds:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'state = {\n "rounds_count": 0,\n "p1": {\n "score": 0\n },\n "p2": {\n "score": 0\n },\n}\n')),(0,o.kt)("p",null,"We constructed initial observations, and started the Environment session to pass these to each Actor:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"p1_state = PlayerState(won_last=False, last_move=None)\np2_state = PlayerState(won_last=False, last_move=None)\nenvironment_session.start([\n (p1.actor_name, Observation(me=p1_state, them=p2_state)),\n (p2.actor_name, Observation(me=p2_state, them=p1_state)),\n])\n")),(0,o.kt)("p",null,"In the event block, we evaluated what each of the Actors did, who won, and stored this information in our ",(0,o.kt)("inlineCode",{parentName:"p"},"state")," data structure."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'# Compute who wins, if the two players had the same move, nobody wins\np1_state = PlayerState(\n won_last=p1_action.move == DEFEATS[p2_action.move],\n last_move=p1_action.move\n)\np2_state = PlayerState(\n won_last=p2_action.move == DEFEATS[p1_action.move],\n last_move=p2_action.move\n)\n\n# keep track of winner/loser of each round\nstate["rounds_count"] += 1\nif p1_state.won_last:\n state["p1"]["score"] += 1\n print(f"{p1.actor_name} wins!")\nelif p2_state.won_last:\n state["p2"]["score"] += 1\n print(f"{p2.actor_name} wins!")\nelse:\n print(f"draw.")\n')),(0,o.kt)("p",null,"We constructed new Observations and had the Environment session pass this information to each Actor."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"}," # produce observation of updated state (computed above)\n observations = [\n (p1.actor_name, Observation(me=p1_state, them=p2_state)),\n (p2.actor_name, Observation(me=p2_state, them=p1_state)),\n ]\n if event.type == cogment.EventType.ACTIVE:\n # The trial is active\n environment_session.produce_observations(observations)\n else:\n # The trial termination has been requested\n environment_session.end(observations)\n")),(0,o.kt)("p",null,"In the termination block, we printed a summary of the rounds played up to the point of termination:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"print(f\"Trial {environment_session.get_trial_id()} ended:\")\nprint(f\"\\t * {state['rounds_count']} rounds played\")\nprint(f\"\\t * {p1.actor_name} won {state['p1']['score']} rounds\")\nprint(f\"\\t * {p2.actor_name} won {state['p2']['score']} rounds\")\nprint(f\"\\t * {state['rounds_count'] - state['p1']['score'] - state['p2']['score']} draws\", flush=True)\n")),(0,o.kt)("p",null,"We then set up the Environment to initiate the termination after a set number of rounds had been won by one of the players. We set the ",(0,o.kt)("inlineCode",{parentName:"p"},"EnvironmentConfig")," in the ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto"),":"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-protobuf"},"message EnvironmentConfig {\n int32 target_score = 1;\n}\n")),(0,o.kt)("p",null,"We made use of this in ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_runner/main.py")," and passed the correct value to the ",(0,o.kt)("inlineCode",{parentName:"p"},"EnvironmentConfig"),"L"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"env_config = EnvironmentConfig(\n target_score = 5\n)\n")),(0,o.kt)("p",null,"We then changed the Environment implementation to be aware of the termination condition, or set one if none was provided:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"# Default target score\nif environment_session.config is not None and environment_session.config.target_score >= 0:\n target_score = environment_session.config.target_score\nelse:\n target_score = 3\n")),(0,o.kt)("p",null,"We then set the Environment to end the trial when this condition was met:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'# handle end of game\nif state["p1"]["score"] >= target_score:\n # p1 won\n environment_session.end(observations)\nelif state["p2"]["score"] >= target_score:\n # p2 won\n environment_session.end(observations)\nelse:\n # target score is not reached, continue sending observations to actors\n environment_session.produce_observations(observations)\n')),(0,o.kt)("p",null,"Finally, we modified the Trial Runner to listen for end signal from the Environment:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'# set the name of the trial we want to be listening for\ntrial_id=f"rps-{datetime.datetime.now().isoformat()}"\n\n# Listening for ended trials\nasync def await_trial():\n async for trial_info in controller.watch_trials(trial_state_filters=[cogment.TrialState.ENDED]):\n if trial_info.trial_id == trial_id:\n break\nawait_trial_task = asyncio.create_task(await_trial())\n\n# Start a new trial using the trial params we just created\ntrial_id = await controller.start_trial(trial_id_requested=trial_id, trial_params=trial_params)\nprint(f"Trial \'{trial_id}\' started")\n\n# Wait for the trial to end\nawait await_trial_task\nprint(f"Trial \'{trial_id}\' ended")\n'))),(0,o.kt)("p",null,"You have now successfully implemented an Environment which is configured to run a game of RPS until one player has won 5 rounds. The Environment receives the Actors' actions and constructs new Observations. However, since the Actors select actions at random, they are not really using the Observation information in any meaningful way. In the next step of the tutorial, we will modify ",(0,o.kt)("inlineCode",{parentName:"p"},"Bob")," to use the information from the Environment to select actions and see how he performs against ",(0,o.kt)("inlineCode",{parentName:"p"},"Alice"),"."))}c.isMDXComponent=!0},8986:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/environment_implementation_0-fa80380b37d4d5170d55c7dbe3208b62.png"},1676:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/environment_main-1026c4be163c7072c12ccdaeffb78468.png"}}]); \ No newline at end of file diff --git a/assets/js/e848be99.fe19ea8a.js b/assets/js/e848be99.fe19ea8a.js deleted file mode 100644 index e3f7a55..0000000 --- a/assets/js/e848be99.fe19ea8a.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[8172],{3905:(e,t,n)=>{n.d(t,{Zo:()=>m,kt:()=>d});var a=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=a.createContext({}),p=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):r(r({},t),e)),n},m=function(e){var t=p(e.components);return a.createElement(l.Provider,{value:t},e.children)},h={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},c=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,l=e.parentName,m=s(e,["components","mdxType","originalType","parentName"]),c=p(n),d=o,u=c["".concat(l,".").concat(d)]||c[d]||h[d]||i;return n?a.createElement(u,r(r({ref:t},m),{},{components:n})):a.createElement(u,r({ref:t},m))}));function d(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,r=new Array(i);r[0]=c;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s.mdxType="string"==typeof e?e:o,r[1]=s;for(var p=2;p<i;p++)r[p]=n[p];return a.createElement.apply(null,r)}return a.createElement.apply(null,n)}c.displayName="MDXCreateElement"},9208:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>r,default:()=>h,frontMatter:()=>i,metadata:()=>s,toc:()=>p});var a=n(7462),o=(n(7294),n(3905));const i={title:"Step 3 - The Environment in Cogment"},r="The Environment: A Game of RPS",s={unversionedId:"guide/tutorial/environment-in-cogment",id:"guide/tutorial/environment-in-cogment",title:"Step 3 - The Environment in Cogment",description:"In this step of the tutorial, we will look at what is needed to define the Environment in which Actors operate. Our goal in this section is to implement the rules for how the Environment responds to the actions at each step and produces new Observations for the Actors.",source:"@site/docs/guide/tutorial/3-environment-in-cogment.md",sourceDirName:"guide/tutorial",slug:"/guide/tutorial/environment-in-cogment",permalink:"/docs/guide/tutorial/environment-in-cogment",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",sidebarPosition:3,frontMatter:{title:"Step 3 - The Environment in Cogment"},sidebar:"docSidebar",previous:{title:"Step 2 - Actors in Cogment",permalink:"/docs/guide/tutorial/actors-in-cogment"},next:{title:"Step 4 - Making Decisions with Feedback",permalink:"/docs/guide/tutorial/decision-making"}},l={},p=[{value:"What does Cogment need to know about the Environment?",id:"what-does-cogment-need-to-know-about-the-environment",level:2},{value:"Defining the Environment Service",id:"defining-the-environment-service",level:2},{value:"Defining the Environment Implementation",id:"defining-the-environment-implementation",level:2},{value:"Implementing the rules of the game",id:"implementing-the-rules-of-the-game",level:2},{value:"The Initialization Block: Creating the First Observations for Each Player",id:"the-initialization-block-creating-the-first-observations-for-each-player",level:3},{value:"The Event Loop: Creating New Observations in Response to Player Actions",id:"the-event-loop-creating-new-observations-in-response-to-player-actions",level:3},{value:"The termination block: reporting on what happened in the game",id:"the-termination-block-reporting-on-what-happened-in-the-game",level:3},{value:"Modifying the Environment Implementation to end the game",id:"modifying-the-environment-implementation-to-end-the-game",level:2},{value:"Modifying the Trial Runner to receive the termination signal from the Environment",id:"modifying-the-trial-runner-to-receive-the-termination-signal-from-the-environment",level:2}],m={toc:p};function h(e){let{components:t,...i}=e;return(0,o.kt)("wrapper",(0,a.Z)({},m,i,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"the-environment-a-game-of-rps"},"The Environment: A Game of RPS"),(0,o.kt)("p",null,"In this step of the tutorial, we will look at what is needed to define the Environment in which Actors operate. Our goal in this section is to implement the rules for how the Environment responds to the actions at each step and produces new Observations for the Actors."),(0,o.kt)("h2",{id:"what-does-cogment-need-to-know-about-the-environment"},"What does Cogment need to know about the Environment?"),(0,o.kt)("p",null,"The ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/core-concepts#environment"},"Environment")," is the world in which Actors will operate. In the most general terms, we can think of the Environment as being the set of all possible states the world can be in, and the rules which determine the consequences of taking specific actions in these states. For RPS, the Environment can be fully specified by setting which states are possible (the different combinations of ",(0,o.kt)("inlineCode",{parentName:"p"},"ROCK"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"PAPER")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"SCISSORS")," from each Actor), and the rules for what happens when we observe each pair."),(0,o.kt)("p",null,"To fully specify the Environment in Cogment, we need to define what the Environment is (eg. what makes an RPS game), how computes the outcome of player actions, and where those computations are run."),(0,o.kt)("p",null,"To better understand how Cogment thinks of the Environment component, we use the following terminology (similar to that used for Actors):"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("strong",{parentName:"li"},"Environment Service")," is a designated node for taking care of the computations made by the Environment. This is ",(0,o.kt)("em",{parentName:"li"},"where")," the Environment computations happen. The Environment Service is launched by ",(0,o.kt)("inlineCode",{parentName:"li"},"environment/main.py")," on the TCP port set by the ",(0,o.kt)("inlineCode",{parentName:"li"},"ENVIRONMENT_PORT")," variable in the ",(0,o.kt)("inlineCode",{parentName:"li"},".env")," file."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("strong",{parentName:"li"},"Environment Implementation")," is the function that specifies the rules of the game. The implementation takes actions as inputs and produces observations as outputs. This is ",(0,o.kt)("em",{parentName:"li"},"how")," the Environment operations work. The Environment implementation function we will use is ",(0,o.kt)("inlineCode",{parentName:"li"},"rps_environment")," defined in ",(0,o.kt)("inlineCode",{parentName:"li"},"environment/main.py"))),(0,o.kt)("p",null,"Notice that we don't use a class to define ",(0,o.kt)("em",{parentName:"p"},"what")," the Environment does, as we did for the Actors. The specification is still made in the ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file, but instead we define what an RPS game is with the ",(0,o.kt)("inlineCode",{parentName:"p"},"EnvironmentConfig")," message type from the ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto"),". You can look in ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto")," to see, but so far the message is still empty. We will add the necessary information to the message later in this step of the tutorial."),(0,o.kt)("h2",{id:"defining-the-environment-service"},"Defining the Environment Service"),(0,o.kt)("p",null,"Let's look at ",(0,o.kt)("inlineCode",{parentName:"p"},"environment/main.py")," to see how Cogment sets up the Environment."),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Registering environment service with Cogment",src:n(1676).Z,width:"1592",height:"388"}),"\nThe code is very similar to what we saw previously for the Actor service: The ",(0,o.kt)("inlineCode",{parentName:"p"},"main()")," function first initializes a ",(0,o.kt)("a",{parentName:"p",href:"https://cogment.ai/docs/reference/python#class-cogmentcontext"},"context")," in which the Environment will be registered. When registering the Environment in the context, we use the ",(0,o.kt)("inlineCode",{parentName:"p"},"register_environment")," method which takes only an implementation. Here we will use the ",(0,o.kt)("inlineCode",{parentName:"p"},"rps_environment")," function (also defined in ",(0,o.kt)("inlineCode",{parentName:"p"},"environment/main.py"),", more on this in a moment) as our implementation."),(0,o.kt)("p",null,"Then, the ",(0,o.kt)("inlineCode",{parentName:"p"},"main()")," function will start the Environment service on the appropriate port, and awaits the termination of the service."),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"Ports for running services are specified in the ",(0,o.kt)("inlineCode",{parentName:"p"},".env")," file, loaded by the ",(0,o.kt)("inlineCode",{parentName:"p"},".run.sh")," script, and retrieved by the ",(0,o.kt)("inlineCode",{parentName:"p"},"os")," package to make the variable available to Python. To change the port this service uses, update the",(0,o.kt)("inlineCode",{parentName:"p"},".env")," file in the root level of the ",(0,o.kt)("inlineCode",{parentName:"p"},"rps")," directory rather than changing ",(0,o.kt)("inlineCode",{parentName:"p"},"main.py"),".")),(0,o.kt)("h2",{id:"defining-the-environment-implementation"},"Defining the Environment Implementation"),(0,o.kt)("p",null,"The implementation function, called ",(0,o.kt)("inlineCode",{parentName:"p"},"rps_environment")," here, is structured similarly to the Actor's implementation."),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Defining the Environment Implementation function",src:n(8986).Z,width:"1750",height:"1628"})),(0,o.kt)("p",null,"Similar to the Actor implementation, there are three parts to the Environment implementation:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("strong",{parentName:"li"},"initialization")," block, where we can set variables that are important to know before the session starts. Later in this step of the tutorial, we will set up the initialization block to keep track of some stats about previous actions taken and which player won/lost each round."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("strong",{parentName:"li"},"event loop"),", which specifies how the environment produces observations based on the Actors' actions."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("strong",{parentName:"li"},"termination")," block, i.e. what happens after all the events have occurred. Here we'll use the termination block to print out some information about what happened between the players during a round of play.")),(0,o.kt)("p",null,"As with the Actor implementation, the Environment implementation takes as an argument the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-environmentsession--session-"},"Environment session"),", which allows the Orchestrator to manage all the data associate with the Environment's operations in the trial."),(0,o.kt)("p",null,"Note that the Environment implementation makes use of the ",(0,o.kt)("inlineCode",{parentName:"p"},"Observation")," the data structure defined in ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto")," defining the actors observation space, but so far it is just empty - we have not yet provided any data to populate the ",(0,o.kt)("inlineCode",{parentName:"p"},"Observation")," message."),(0,o.kt)("h2",{id:"implementing-the-rules-of-the-game"},"Implementing the rules of the game"),(0,o.kt)("p",null,"We will first need to bring in the relevant datastructures into the ",(0,o.kt)("inlineCode",{parentName:"p"},"environment/main.py")," file so that our Environment implementation can work with the same action space and can create the bservations in the format the Actors expect to receive. We can see in ",(0,o.kt)("inlineCode",{parentName:"p"},"environment/main.py")," that we have already imported the ",(0,o.kt)("inlineCode",{parentName:"p"},"Observation")," data structure."),(0,o.kt)("p",null,"If we look at the definition of the ",(0,o.kt)("inlineCode",{parentName:"p"},"Observation")," message in the ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto"),", we see that it stores two fields of ",(0,o.kt)("inlineCode",{parentName:"p"},"PlayerState")," information: one field keeping track of the player itself and one keeping track of its opponent. This means in order to create the correct type of ",(0,o.kt)("inlineCode",{parentName:"p"},"Observation")," messages, we will also need to import the ",(0,o.kt)("inlineCode",{parentName:"p"},"PlayerState")," data structure to ",(0,o.kt)("inlineCode",{parentName:"p"},"environment/main.py"),". We will also need to import the types of moves that can be made so that we can define the relationships between them."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},'In the "Imports" section at the top of the file, add the following:')),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"from data_pb2 import PlayerState, ROCK, PAPER, SCISSORS\n")),(0,o.kt)("p",null,"Next we can define a mapping between each move and the move that it defeats - this is basically all of the information necessary to establish the rules of the game. ",(0,o.kt)("strong",{parentName:"p"},'In the "Settings" section, add the following:')),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"DEFEATS = {\n ROCK: PAPER,\n SCISSORS: ROCK,\n PAPER: SCISSORS\n}\n")),(0,o.kt)("p",null,'You may have played RPS in which the winner is "best of N rounds" - for example, you must beat your opponent in 2 out of 3 rounds to win the game. We will want the Environment implementation to keep track of the number of rounds played and won by each of the two players so that we can know when to call a winner. Here we will create a simple ',(0,o.kt)("inlineCode",{parentName:"p"},"state")," data structure in the ",(0,o.kt)("inlineCode",{parentName:"p"},"rps_environment")," initialization block to keep track of how often each of players wins a round during the trial. Later we will set up how many successful rounds constitute winning the game. ",(0,o.kt)("strong",{parentName:"p"},"Add the following code to the initialization block of the Environment implementation function (before the event loop):")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'state = {\n "rounds_count": 0,\n "p1": {\n "score": 0\n },\n "p2": {\n "score": 0\n },\n}\n')),(0,o.kt)("h3",{id:"the-initialization-block-creating-the-first-observations-for-each-player"},"The Initialization Block: Creating the First Observations for Each Player"),(0,o.kt)("p",null,"When we start a Trial, each player will need an initial ",(0,o.kt)("inlineCode",{parentName:"p"},"Observation")," from the Environment. The ",(0,o.kt)("inlineCode",{parentName:"p"},"Observation")," message tracks what each player's last move was and whether they won or lost the previous round, so we will have to set these by hand to start. ",(0,o.kt)("strong",{parentName:"p"},"Add the following code to the initialization block:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"p1_state = PlayerState(won_last=False, last_move=None)\np2_state = PlayerState(won_last=False, last_move=None)\nenvironment_session.start([\n (p1.actor_name, Observation(me=p1_state, them=p2_state)),\n (p2.actor_name, Observation(me=p2_state, them=p1_state)),\n])\n")),(0,o.kt)("p",null,"This code does the following:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"Sets the initial state for each of the two Actors - neither won last game nor had a last move"),(0,o.kt)("li",{parentName:"ul"},"Calls for the session to start, which tells the Orchestrator to send an initial observation is sent to all actors. Each actor is given the appropriate ",(0,o.kt)("inlineCode",{parentName:"li"},"Observation")," constructed with the correct initial ",(0,o.kt)("inlineCode",{parentName:"li"},"PlayerState")," messages. One instance of ",(0,o.kt)("inlineCode",{parentName:"li"},"PlayerState")," per player is created, each is used as the ",(0,o.kt)("inlineCode",{parentName:"li"},"me")," and ",(0,o.kt)("inlineCode",{parentName:"li"},"them")," state of each player's ",(0,o.kt)("inlineCode",{parentName:"li"},"Observation"))),(0,o.kt)("h3",{id:"the-event-loop-creating-new-observations-in-response-to-player-actions"},"The Event Loop: Creating New Observations in Response to Player Actions"),(0,o.kt)("p",null,"In the ",(0,o.kt)("strong",{parentName:"p"},"event loop")," we implement how the Environment produces the next Observations in response to the Actor's actions. We need to retrieve each player's action and determine which player won the round. Then, we update the internal ",(0,o.kt)("inlineCode",{parentName:"p"},"state"),". Finally, we produce up-to-date observations for the players."),(0,o.kt)("p",null,"So far, we have printed the actions the Environment received from each player, but these are the ",(0,o.kt)("inlineCode",{parentName:"p"},"PlayerAction")," data structures. What we actually want to work with is the ",(0,o.kt)("inlineCode",{parentName:"p"},".move")," attribute, which stores the index of the action that was taken. We'll use this ",(0,o.kt)("inlineCode",{parentName:"p"},"move")," attribute to determine which of the two players wins. If the two players had the same move, nobody wins. We'll also keep track of this in our ",(0,o.kt)("inlineCode",{parentName:"p"},"state")," object. ",(0,o.kt)("strong",{parentName:"p"},"Add the following code below your print statements:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'# Compute who wins, if the two players had the same move, nobody wins\np1_state = PlayerState(\n won_last=p1_action.move == DEFEATS[p2_action.move],\n last_move=p1_action.move\n)\np2_state = PlayerState(\n won_last=p2_action.move == DEFEATS[p1_action.move],\n last_move=p2_action.move\n)\n\n# keep track of winner/loser of each round\nstate["rounds_count"] += 1\nif p1_state.won_last:\n state["p1"]["score"] += 1\n print(f"{p1.actor_name} wins!")\nelif p2_state.won_last:\n state["p2"]["score"] += 1\n print(f"{p2.actor_name} wins!")\nelse:\n print(f"draw.")\n')),(0,o.kt)("p",null,"This code computes for each player whether they won or lost, based on how their move compared to their opponents move by the hierarchy of moves specified in the ",(0,o.kt)("inlineCode",{parentName:"p"},"DEFEATS")," dictionary. We then log it in the ",(0,o.kt)("inlineCode",{parentName:"p"},"state")," dictionary object defined in the initialization block."),(0,o.kt)("p",null,"Finally, we need to construct the new Observation from these new player states, and pass this information along to the Actors if the trial is still active (eg. if the game hasn't ended). ",(0,o.kt)("strong",{parentName:"p"},"To do this, add the following code to the event loop:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"}," # produce observation of updated state (computed above)\n observations = [\n (p1.actor_name, Observation(me=p1_state, them=p2_state)),\n (p2.actor_name, Observation(me=p2_state, them=p1_state)),\n ]\n if event.type == cogment.EventType.ACTIVE:\n # The trial is active\n environment_session.produce_observations(observations)\n else:\n # The trial termination has been requested\n environment_session.end(observations)\n")),(0,o.kt)("h3",{id:"the-termination-block-reporting-on-what-happened-in-the-game"},"The termination block: reporting on what happened in the game"),(0,o.kt)("p",null,"Finally, we will add some statements to the termination block to present a read-out about what happened in the Trial. ",(0,o.kt)("strong",{parentName:"p"},"In the termination block, replace the ",(0,o.kt)("inlineCode",{parentName:"strong"},'print("environment end")')," with:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"print(f\"Trial {environment_session.get_trial_id()} ended:\")\nprint(f\"\\t * {state['rounds_count']} rounds played\")\nprint(f\"\\t * {p1.actor_name} won {state['p1']['score']} rounds\")\nprint(f\"\\t * {p2.actor_name} won {state['p2']['score']} rounds\")\nprint(f\"\\t * {state['rounds_count'] - state['p1']['score'] - state['p2']['score']} draws\", flush=True)\n")),(0,o.kt)("p",null,"Note we add a ",(0,o.kt)("inlineCode",{parentName:"p"},"flush=True")," to the last print call to flush the data buffer so our output actually gets printed before the service gets terminated."),(0,o.kt)("p",null,"We now have an Environment implementation that will properly construct Observations to pass to the Actors, meaning we have fully defined all the inputs and outputs necessary for the sequential interaction between the Actor and Environment components to play rounds of RPS. However, RPS is usually played in games won by the player reaching a target score, i.e. a number of won rounds."),(0,o.kt)("p",null,"You can ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/setup#building-and-running-the-app"},"install and run")," the application to test your Environment implementation. Given the nature of the game and the fact that the Actors don't actually use the Observation information in any meaningful way, we expect Bob to win around 1/3 of the time, Alice to win 1/3 of the time, and the remaining 1/3 to be draws."),(0,o.kt)("h1",{id:"configuring-the-environment-how-many-successful-rounds-to-win-the-game"},"Configuring the Environment: How many successful rounds to win the game?"),(0,o.kt)("p",null,'We hinted earlier that RPS is not about single, disconnected rounds, but in playing a "best of N" game. Here we will show how the Environment can be configured with parameters. Setting up the game this way will also be useful later when we make an Actor implementation that can meaningfully use the information in the Observations to pick an action with some strategy, rather than randomly.'),(0,o.kt)("p",null,"We want to set up the Environment so that a trial is complete when one of the two players has won enough rounds. ",(0,o.kt)("strong",{parentName:"p"},"We can do this by adding a parameter to our previously empty ",(0,o.kt)("inlineCode",{parentName:"strong"},"EnvironmentConfig")," message in the ",(0,o.kt)("inlineCode",{parentName:"strong"},"data.proto")," file:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-protobuf"},"message EnvironmentConfig {\n int32 target_score = 1;\n}\n")),(0,o.kt)("p",null,"This data structure is referenced within ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," in the ",(0,o.kt)("inlineCode",{parentName:"p"},"environment.config_type")," to define how the Environment is configured (you may think of it as similar to how the Actor classes were specified in the ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file). Note that the ",(0,o.kt)("inlineCode",{parentName:"p"},"target_score")," above is just the first argument to the ",(0,o.kt)("inlineCode",{parentName:"p"},"EnvironmentConfig")," message -- we will set its value when we configure the Environment for the Trial."),(0,o.kt)("p",null,"If we open ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_runner/main.py")," we will see that we pass an empty ",(0,o.kt)("inlineCode",{parentName:"p"},"EnvironmentConfig")," when setting up the Environment in the Trial Runner. We can modify this function to set a value for the ",(0,o.kt)("inlineCode",{parentName:"p"},"target_score")," which a player will need to reach before the game ends. ",(0,o.kt)("strong",{parentName:"p"},"Modify the ",(0,o.kt)("inlineCode",{parentName:"strong"},"EnvironmentConfig")," in the Trial Runner to be the following:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"env_config = EnvironmentConfig(\n target_score = 5\n)\n")),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"Note that whenever we make a modification to the ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto")," file, we will need to re-run ",(0,o.kt)("inlineCode",{parentName:"p"},"./run.sh install")," to regenerate the ",(0,o.kt)("inlineCode",{parentName:"p"},"data_pb2.py")," file which the Python SDK uses for the implementations.")),(0,o.kt)("h2",{id:"modifying-the-environment-implementation-to-end-the-game"},"Modifying the Environment Implementation to end the game"),(0,o.kt)("p",null,"We now need to modify the Environment implementation to handle counting the number of rounds won, and executing the termination of the Trial once the ",(0,o.kt)("inlineCode",{parentName:"p"},"target_score")," has been reached."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"In the initialization block of the ",(0,o.kt)("inlineCode",{parentName:"strong"},"rps_environment")," implementation function in ",(0,o.kt)("inlineCode",{parentName:"strong"},"environment/main.py"),", add the following:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"# Default target score\nif environment_session.config is not None and environment_session.config.target_score >= 0:\n target_score = environment_session.config.target_score\nelse:\n target_score = 3\n")),(0,o.kt)("p",null,"The above code retrieves the value of the ",(0,o.kt)("inlineCode",{parentName:"p"},"target_score")," from the environment's configuration and sets a default value in case nothing is specified. When we configured the trial, we set the ",(0,o.kt)("inlineCode",{parentName:"p"},"target_score")," to be 5, but if the ",(0,o.kt)("inlineCode",{parentName:"p"},"environment_session")," doesn't have the right configuration details, the ",(0,o.kt)("inlineCode",{parentName:"p"},"target_score")," will be set to 3 by the Environment itself."),(0,o.kt)("p",null,"We also want the Environment to request the end of the Trial when this target score has been reached. ",(0,o.kt)("strong",{parentName:"p"},"In the event block, let's modify the code which handles the end of the game (eg. replace the check that the ",(0,o.kt)("inlineCode",{parentName:"strong"},"event.type==cogment.EventType.ACTIVE"),") to be:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'# handle end of game\nif state["p1"]["score"] >= target_score:\n # p1 won\n environment_session.end(observations)\nelif state["p2"]["score"] >= target_score:\n # p2 won\n environment_session.end(observations)\nelse:\n # target score is not reached, continue sending observations to actors\n environment_session.produce_observations(observations)\n')),(0,o.kt)("h2",{id:"modifying-the-trial-runner-to-receive-the-termination-signal-from-the-environment"},"Modifying the Trial Runner to receive the termination signal from the Environment"),(0,o.kt)("p",null,"Previously, the Trial Runner handled the termination of the Trial after 5 seconds. Now we want the Environment to handle the termination of the trial, so we need to modify the Trial Runner code to support this."),(0,o.kt)("p",null,"If we look at the ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_runner/main.py")," file, we will see that the Trial Runner gets the ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_id")," from the controller's ",(0,o.kt)("inlineCode",{parentName:"p"},"start_trial")," method. Because of the asynchronous nature of how these services run, we will need to initiate a function to listen for the trial's end ",(0,o.kt)("em",{parentName:"p"},"before")," we have initiated the trial start. This means we will need to know the ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_id")," ahead of time, so when we call ",(0,o.kt)("inlineCode",{parentName:"p"},"start_trial")," we will pass it our chosen ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_id")," as an argument."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"In ",(0,o.kt)("inlineCode",{parentName:"strong"},"trial_runner/main.py")," we'll change the way the Trial Runner starts the trials to the following:")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'# set the name of the trial we want to be listening for\ntrial_id=f"rps-{datetime.datetime.now().isoformat()}"\n\n# Listening for ended trials\nasync def await_trial():\n async for trial_info in controller.watch_trials(trial_state_filters=[cogment.TrialState.ENDED]):\n if trial_info.trial_id == trial_id:\n break\nawait_trial_task = asyncio.create_task(await_trial())\n\n# Start a new trial using the trial params we just created\ntrial_id = await controller.start_trial(trial_id_requested=trial_id, trial_params=trial_params)\nprint(f"Trial \'{trial_id}\' started")\n\n# Wait for the trial to end\nawait await_trial_task\nprint(f"Trial \'{trial_id}\' ended")\n')),(0,o.kt)("p",null,"The above code sets the ID of the trial, then defines how to use ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#async-watchtrialsself-trialstatefilters-fullinfofalse"},(0,o.kt)("inlineCode",{parentName:"a"},"controller.watch_trials"))," that will listen for the Environment to terminate the trial. It starts the trial with the specified ID, and then watches for the trial end."),(0,o.kt)("p",null,"We can now ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/tutorial/setup#building-and-running-the-app"},"install and run")," the application to see that this works as expected. Bob and Alice play a single game of RPS which ends when one of the two players reaches the target number of rounds."),(0,o.kt)("details",null,(0,o.kt)("summary",null,(0,o.kt)("b",null,(0,o.kt)("span",{style:{fontSize:"20px"}},"Quick Summary"))),(0,o.kt)("p",null,"We learned about how Cogment represents the Environment through its implementation and configuration."),(0,o.kt)("p",null,"We set up the necessary components in ",(0,o.kt)("inlineCode",{parentName:"p"},"environment/main.py")," to specify the rules of RPS, namely:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"\nfrom data_pb2 import PlayerState, ROCK, PAPER, SCISSORS\nDEFEATS = {\n ROCK: PAPER,\n SCISSORS: ROCK,\n PAPER: SCISSORS\n}\n")),(0,o.kt)("p",null,"In the initialWe added a data structure to keep track of statistics over a number of rounds:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'state = {\n "rounds_count": 0,\n "p1": {\n "score": 0\n },\n "p2": {\n "score": 0\n },\n}\n')),(0,o.kt)("p",null,"We constructed initial observations, and started the Environment session to pass these to each Actor:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"p1_state = PlayerState(won_last=False, last_move=None)\np2_state = PlayerState(won_last=False, last_move=None)\nenvironment_session.start([\n (p1.actor_name, Observation(me=p1_state, them=p2_state)),\n (p2.actor_name, Observation(me=p2_state, them=p1_state)),\n])\n")),(0,o.kt)("p",null,"In the event block, we evaluated what each of the Actors did, who won, and stored this information in our ",(0,o.kt)("inlineCode",{parentName:"p"},"state")," data structure."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'# Compute who wins, if the two players had the same move, nobody wins\np1_state = PlayerState(\n won_last=p1_action.move == DEFEATS[p2_action.move],\n last_move=p1_action.move\n)\np2_state = PlayerState(\n won_last=p2_action.move == DEFEATS[p1_action.move],\n last_move=p2_action.move\n)\n\n# keep track of winner/loser of each round\nstate["rounds_count"] += 1\nif p1_state.won_last:\n state["p1"]["score"] += 1\n print(f"{p1.actor_name} wins!")\nelif p2_state.won_last:\n state["p2"]["score"] += 1\n print(f"{p2.actor_name} wins!")\nelse:\n print(f"draw.")\n')),(0,o.kt)("p",null,"We constructed new Observations and had the Environment session pass this information to each Actor."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"}," # produce observation of updated state (computed above)\n observations = [\n (p1.actor_name, Observation(me=p1_state, them=p2_state)),\n (p2.actor_name, Observation(me=p2_state, them=p1_state)),\n ]\n if event.type == cogment.EventType.ACTIVE:\n # The trial is active\n environment_session.produce_observations(observations)\n else:\n # The trial termination has been requested\n environment_session.end(observations)\n")),(0,o.kt)("p",null,"In the termination block, we printed a summary of the rounds played up to the point of termination:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"print(f\"Trial {environment_session.get_trial_id()} ended:\")\nprint(f\"\\t * {state['rounds_count']} rounds played\")\nprint(f\"\\t * {p1.actor_name} won {state['p1']['score']} rounds\")\nprint(f\"\\t * {p2.actor_name} won {state['p2']['score']} rounds\")\nprint(f\"\\t * {state['rounds_count'] - state['p1']['score'] - state['p2']['score']} draws\", flush=True)\n")),(0,o.kt)("p",null,"We then set up the Environment to initiate the termination after a set number of rounds had been won by one of the players. We set the ",(0,o.kt)("inlineCode",{parentName:"p"},"EnvironmentConfig")," in the ",(0,o.kt)("inlineCode",{parentName:"p"},"data.proto"),":"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-protobuf"},"message EnvironmentConfig {\n int32 target_score = 1;\n}\n")),(0,o.kt)("p",null,"We made use of this in ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_runner/main.py")," and passed the correct value to the ",(0,o.kt)("inlineCode",{parentName:"p"},"EnvironmentConfig"),"L"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"env_config = EnvironmentConfig(\n target_score = 5\n)\n")),(0,o.kt)("p",null,"We then changed the Environment implementation to be aware of the termination condition, or set one if none was provided:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},"# Default target score\nif environment_session.config is not None and environment_session.config.target_score >= 0:\n target_score = environment_session.config.target_score\nelse:\n target_score = 3\n")),(0,o.kt)("p",null,"We then set the Environment to end the trial when this condition was met:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'# handle end of game\nif state["p1"]["score"] >= target_score:\n # p1 won\n environment_session.end(observations)\nelif state["p2"]["score"] >= target_score:\n # p2 won\n environment_session.end(observations)\nelse:\n # target score is not reached, continue sending observations to actors\n environment_session.produce_observations(observations)\n')),(0,o.kt)("p",null,"Finally, we modified the Trial Runner to listen for end signal from the Environment:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'# set the name of the trial we want to be listening for\ntrial_id=f"rps-{datetime.datetime.now().isoformat()}"\n\n# Listening for ended trials\nasync def await_trial():\n async for trial_info in controller.watch_trials(trial_state_filters=[cogment.TrialState.ENDED]):\n if trial_info.trial_id == trial_id:\n break\nawait_trial_task = asyncio.create_task(await_trial())\n\n# Start a new trial using the trial params we just created\ntrial_id = await controller.start_trial(trial_id_requested=trial_id, trial_params=trial_params)\nprint(f"Trial \'{trial_id}\' started")\n\n# Wait for the trial to end\nawait await_trial_task\nprint(f"Trial \'{trial_id}\' ended")\n'))),(0,o.kt)("p",null,"You have now successfully implemented an Environment which is configured to run a game of RPS until one player has won 5 rounds. The Environment receives the Actors' actions and constructs new Observations. However, since the Actors select actions at random, they are not really using the Observation information in any meaningful way. In the next step of the tutorial, we will modify ",(0,o.kt)("inlineCode",{parentName:"p"},"Bob")," to use the information from the Environment to select actions and see how he performs against ",(0,o.kt)("inlineCode",{parentName:"p"},"Alice"),"."))}h.isMDXComponent=!0},8986:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/environment_implementation_0-fa80380b37d4d5170d55c7dbe3208b62.png"},1676:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/environment_main-1026c4be163c7072c12ccdaeffb78468.png"}}]); \ No newline at end of file diff --git a/assets/js/f012f959.ad12eb4f.js b/assets/js/f012f959.ad12eb4f.js deleted file mode 100644 index a1e32f6..0000000 --- a/assets/js/f012f959.ad12eb4f.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[2229],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>d});var r=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=r.createContext({}),c=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},p=function(e){var t=c(e.components);return r.createElement(s.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),f=c(n),d=o,u=f["".concat(s,".").concat(d)]||f[d]||m[d]||i;return n?r.createElement(u,a(a({ref:t},p),{},{components:n})):r.createElement(u,a({ref:t},p))}));function d(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,a=new Array(i);a[0]=f;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l.mdxType="string"==typeof e?e:o,a[1]=l;for(var c=2;c<i;c++)a[c]=n[c];return r.createElement.apply(null,a)}return r.createElement.apply(null,n)}f.displayName="MDXCreateElement"},4352:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>a,default:()=>m,frontMatter:()=>i,metadata:()=>l,toc:()=>c});var r=n(7462),o=(n(7294),n(3905));const i={title:"Configure Trial from Controller"},a="Fully configure a trial from a [**Controller**](/docs/guide/core-concepts#controller)",l={unversionedId:"guide/implementation-recipes/configure-trial-from-controller",id:"guide/implementation-recipes/configure-trial-from-controller",title:"Configure Trial from Controller",description:"controller)",source:"@site/docs/guide/implementation-recipes/configure-trial-from-controller.md",sourceDirName:"guide/implementation-recipes",slug:"/guide/implementation-recipes/configure-trial-from-controller",permalink:"/docs/guide/implementation-recipes/configure-trial-from-controller",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",frontMatter:{title:"Configure Trial from Controller"},sidebar:"docSidebar",previous:{title:"Implementation Recipes",permalink:"/docs/guide/implementation-recipes/"},next:{title:"Migrate from Cogment v1 to v2",permalink:"/docs/guide/implementation-recipes/v2-migration-guide"}},s={},c=[],p={toc:c};function m(e){let{components:t,...n}=e;return(0,o.kt)("wrapper",(0,r.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"fully-configure-a-trial-from-a-controller"},"Fully configure a trial from a ",(0,o.kt)("a",{parentName:"h1",href:"/docs/guide/core-concepts#controller"},(0,o.kt)("strong",{parentName:"a"},"Controller"))),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"Starting with versions v2.2.0 of Cogment and v2.1.0 of the python SDK, it is now possible to ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/development-guide#start-trial-from-trial-parameters"},"provide the full trial parameters when starting a trial"),". This recipe is still applicable but it is recommended to use the new method instead.")),(0,o.kt)("p",null,"When starting a trial, the controller can only provide an instance of the ",(0,o.kt)("strong",{parentName:"p"},"trial configuration")," message and from this instance the pre trial hook can fill the ",(0,o.kt)("strong",{parentName:"p"},"trial parameters"),", including a full configuring of the environment and actors involved in the trial. More details can be found ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/development-guide#pre-trial-hook"},"here"),". In some cases, you might want to fully configure a trial from the controller. This recipe is dedicated to this use case."),(0,o.kt)("admonition",{type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"Implementing this recipe enables any client having access to the orchestrator to specify URLs - the actor and environment endpoints - that will be accessed (and trusted) by the orchestrator.")),(0,o.kt)("p",null,"The general idea is to define ",(0,o.kt)("inlineCode",{parentName:"p"},"TrialConfig")," so that it includes everything that's needed to parametrize the trial. It should look something like the following."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-proto"},"message EnvironmentParams {\n string endpoint = 1;\n EnvConfig config = 2;\n string implementation = 3;\n}\n\nmessage ActorParams {\n string name = 1;\n string actor_class = 2;\n string endpoint = 3;\n string implementation = 4;\n ActorConfig config = 5;\n}\n\nmessage TrialConfig {\n EnvironmentParams environment = 1;\n repeated ActorParams actors = 2;\n uint32 max_steps = 3;\n uint32 max_inactivity = 4;\n}\n")),(0,o.kt)("p",null,"When starting a trial from the controller you'll need to define the full config."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'trial_id = await controller.start_trial(trial_config=TrialConfig(\n environment=EnvironmentParams(\n endpoint="grpc://my-environment:9000",\n config=# [...],\n implementation="my-implementation"\n )\n))\n')),(0,o.kt)("p",null,"Finally a ",(0,o.kt)("em",{parentName:"p"},"pass-through")," pre-trial hook needs to be implemented, registered and served. Its endpoint must be specified to the Orchestrator on startup."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'async def passthrough_pre_trial_hook(pre_trial_hook_session):\n trial_config = pre_trial_hook_session.trial_config\n pre_trial_hook_session.environment_config = trial_config.environment.config\n pre_trial_hook_session.environment_endpoint = trial_config.environment.endpoint\n pre_trial_hook_session.environment_implementation = trial_config.environment.implementation\n pre_trial_hook_session.actors = [\n {\n "name": actor_params.name,\n "actor_class": actor_params.actor_class,\n "endpoint": actor_params.endpoint,\n "implementation": actor_params.implementation,\n "config": actor_params.config,\n }\n for actor_params in trial_config.actors\n ]\n pre_trial_hook_session.trial_max_steps = trial_config.max_steps\n pre_trial_hook_session.trial_max_inactivity = trial_config.max_inactivity\n\n pre_trial_hook_session.validate()\n\ncontext.register_pre_trial_hook(pre_trial_hook)\n')))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/f012f959.eebb0295.js b/assets/js/f012f959.eebb0295.js new file mode 100644 index 0000000..1f6bba6 --- /dev/null +++ b/assets/js/f012f959.eebb0295.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[2229],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>u});var r=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=r.createContext({}),c=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},p=function(e){var t=c(e.components);return r.createElement(s.Provider,{value:t},e.children)},m="mdxType",f={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),m=c(n),d=o,u=m["".concat(s,".").concat(d)]||m[d]||f[d]||i;return n?r.createElement(u,a(a({ref:t},p),{},{components:n})):r.createElement(u,a({ref:t},p))}));function u(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,a=new Array(i);a[0]=d;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[m]="string"==typeof e?e:o,a[1]=l;for(var c=2;c<i;c++)a[c]=n[c];return r.createElement.apply(null,a)}return r.createElement.apply(null,n)}d.displayName="MDXCreateElement"},4352:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>a,default:()=>f,frontMatter:()=>i,metadata:()=>l,toc:()=>c});var r=n(7462),o=(n(7294),n(3905));const i={title:"Configure Trial from Controller"},a="Fully configure a trial from a [**Controller**](/docs/guide/core-concepts#controller)",l={unversionedId:"guide/implementation-recipes/configure-trial-from-controller",id:"guide/implementation-recipes/configure-trial-from-controller",title:"Configure Trial from Controller",description:"controller)",source:"@site/docs/guide/implementation-recipes/configure-trial-from-controller.md",sourceDirName:"guide/implementation-recipes",slug:"/guide/implementation-recipes/configure-trial-from-controller",permalink:"/docs/guide/implementation-recipes/configure-trial-from-controller",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",frontMatter:{title:"Configure Trial from Controller"},sidebar:"docSidebar",previous:{title:"Implementation Recipes",permalink:"/docs/guide/implementation-recipes/"},next:{title:"Migrate from Cogment v1 to v2",permalink:"/docs/guide/implementation-recipes/v2-migration-guide"}},s={},c=[],p={toc:c},m="wrapper";function f(e){let{components:t,...n}=e;return(0,o.kt)(m,(0,r.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"fully-configure-a-trial-from-a-controller"},"Fully configure a trial from a ",(0,o.kt)("a",{parentName:"h1",href:"/docs/guide/core-concepts#controller"},(0,o.kt)("strong",{parentName:"a"},"Controller"))),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"Starting with versions v2.2.0 of Cogment and v2.1.0 of the python SDK, it is now possible to ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/development-guide#start-trial-from-trial-parameters"},"provide the full trial parameters when starting a trial"),". This recipe is still applicable but it is recommended to use the new method instead.")),(0,o.kt)("p",null,"When starting a trial, the controller can only provide an instance of the ",(0,o.kt)("strong",{parentName:"p"},"trial configuration")," message and from this instance the pre trial hook can fill the ",(0,o.kt)("strong",{parentName:"p"},"trial parameters"),", including a full configuring of the environment and actors involved in the trial. More details can be found ",(0,o.kt)("a",{parentName:"p",href:"/docs/guide/development-guide#pre-trial-hook"},"here"),". In some cases, you might want to fully configure a trial from the controller. This recipe is dedicated to this use case."),(0,o.kt)("admonition",{type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"Implementing this recipe enables any client having access to the orchestrator to specify URLs - the actor and environment endpoints - that will be accessed (and trusted) by the orchestrator.")),(0,o.kt)("p",null,"The general idea is to define ",(0,o.kt)("inlineCode",{parentName:"p"},"TrialConfig")," so that it includes everything that's needed to parametrize the trial. It should look something like the following."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-proto"},"message EnvironmentParams {\n string endpoint = 1;\n EnvConfig config = 2;\n string implementation = 3;\n}\n\nmessage ActorParams {\n string name = 1;\n string actor_class = 2;\n string endpoint = 3;\n string implementation = 4;\n ActorConfig config = 5;\n}\n\nmessage TrialConfig {\n EnvironmentParams environment = 1;\n repeated ActorParams actors = 2;\n uint32 max_steps = 3;\n uint32 max_inactivity = 4;\n}\n")),(0,o.kt)("p",null,"When starting a trial from the controller you'll need to define the full config."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'trial_id = await controller.start_trial(trial_config=TrialConfig(\n environment=EnvironmentParams(\n endpoint="grpc://my-environment:9000",\n config=# [...],\n implementation="my-implementation"\n )\n))\n')),(0,o.kt)("p",null,"Finally a ",(0,o.kt)("em",{parentName:"p"},"pass-through")," pre-trial hook needs to be implemented, registered and served. Its endpoint must be specified to the Orchestrator on startup."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-python"},'async def passthrough_pre_trial_hook(pre_trial_hook_session):\n trial_config = pre_trial_hook_session.trial_config\n pre_trial_hook_session.environment_config = trial_config.environment.config\n pre_trial_hook_session.environment_endpoint = trial_config.environment.endpoint\n pre_trial_hook_session.environment_implementation = trial_config.environment.implementation\n pre_trial_hook_session.actors = [\n {\n "name": actor_params.name,\n "actor_class": actor_params.actor_class,\n "endpoint": actor_params.endpoint,\n "implementation": actor_params.implementation,\n "config": actor_params.config,\n }\n for actor_params in trial_config.actors\n ]\n pre_trial_hook_session.trial_max_steps = trial_config.max_steps\n pre_trial_hook_session.trial_max_inactivity = trial_config.max_inactivity\n\n pre_trial_hook_session.validate()\n\ncontext.register_pre_trial_hook(pre_trial_hook)\n')))}f.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/fd5e6f38.00dde33b.js b/assets/js/fd5e6f38.00dde33b.js new file mode 100644 index 0000000..e7fe6c7 --- /dev/null +++ b/assets/js/fd5e6f38.00dde33b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[3106],{3905:(e,t,n)=>{n.d(t,{Zo:()=>m,kt:()=>h});var a=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var p=a.createContext({}),s=function(e){var t=a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):r(r({},t),e)),n},m=function(e){var t=s(e.components);return a.createElement(p.Provider,{value:t},e.children)},d="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},u=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,p=e.parentName,m=l(e,["components","mdxType","originalType","parentName"]),d=s(n),u=o,h=d["".concat(p,".").concat(u)]||d[u]||c[u]||i;return n?a.createElement(h,r(r({ref:t},m),{},{components:n})):a.createElement(h,r({ref:t},m))}));function h(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,r=new Array(i);r[0]=u;var l={};for(var p in t)hasOwnProperty.call(t,p)&&(l[p]=t[p]);l.originalType=e,l[d]="string"==typeof e?e:o,r[1]=l;for(var s=2;s<i;s++)r[s]=n[s];return a.createElement.apply(null,r)}return a.createElement.apply(null,n)}u.displayName="MDXCreateElement"},845:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>r,default:()=>c,frontMatter:()=>i,metadata:()=>l,toc:()=>s});var a=n(7462),o=(n(7294),n(3905));const i={},r="Migrate from Cogment v1 to v2",l={unversionedId:"guide/implementation-recipes/v2-migration-guide",id:"guide/implementation-recipes/v2-migration-guide",title:"Migrate from Cogment v1 to v2",description:"This document is written as a guide to migrate from Cogment v1 to v2, a full list of the changes is also available here.",source:"@site/docs/guide/implementation-recipes/v2-migration-guide.md",sourceDirName:"guide/implementation-recipes",slug:"/guide/implementation-recipes/v2-migration-guide",permalink:"/docs/guide/implementation-recipes/v2-migration-guide",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",frontMatter:{},sidebar:"docSidebar",previous:{title:"Configure Trial from Controller",permalink:"/docs/guide/implementation-recipes/configure-trial-from-controller"},next:{title:"Tutorial",permalink:"/docs/guide/tutorial/"}},p={},s=[{value:"Updating components",id:"updating-components",level:2},{value:"<code>cogment.yaml</code> split in a spec file and a parameters file",id:"cogmentyaml-split-in-a-spec-file-and-a-parameters-file",level:2},{value:"pre-trial hooks definition moved to an orchestrator configuration",id:"pre-trial-hooks-definition-moved-to-an-orchestrator-configuration",level:2},{value:"Datalog definition now part of each trial's parameters",id:"datalog-definition-now-part-of-each-trials-parameters",level:2},{value:"Datalog API has changed, and now has a python wrapper",id:"datalog-api-has-changed-and-now-has-a-python-wrapper",level:2},{value:"Default trial parameters no longer support definition user configuration for trials, environments and actors",id:"default-trial-parameters-no-longer-support-definition-user-configuration-for-trials-environments-and-actors",level:2},{value:"Prefer using full URL for endpoints",id:"prefer-using-full-url-for-endpoints",level:2},{value:"Support for "delta" observations discontinued",id:"support-for-delta-observations-discontinued",level:2},{value:"New code generation workflow",id:"new-code-generation-workflow",level:2},{value:"Orchestrator environment variables namespaced",id:"orchestrator-environment-variables-namespaced",level:2},{value:"Trials' environments can be named",id:"trials-environments-can-be-named",level:2},{value:"Python SDK",id:"python-sdk",level:2},{value:"Javascript SDK",id:"javascript-sdk",level:2},{value:"Troubleshooting",id:"troubleshooting",level:2}],m={toc:s},d="wrapper";function c(e){let{components:t,...n}=e;return(0,o.kt)(d,(0,a.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"migrate-from-cogment-v1-to-v2"},"Migrate from Cogment v1 to v2"),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"This document is written as a guide to migrate from Cogment v1 to v2, a full list of the changes is also available ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/cogment-v2-changes"},"here"),".")),(0,o.kt)("h2",{id:"updating-components"},"Updating components"),(0,o.kt)("p",null,"The following components needs to be updated to work with Cogment v2:"),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Update the CLI to the latest version and check that the version is correct"),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-console"},"curl --silent -L https://raw.githubusercontent.com/cogment/cogment-cli/main/install.sh | sudo bash\n")),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-console"},"cogment version\n"))),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Update the docker images to the versions compatible with the 2.0 API. These should be updated in ",(0,o.kt)("inlineCode",{parentName:"p"},"Dockerfile"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"*.dockerfile")," or ",(0,o.kt)("inlineCode",{parentName:"p"},"docker-compose.yml")," files in your project. The minimal version to use API 2.0 are:"),(0,o.kt)("ul",{parentName:"li"},(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"cogment/orchestrator:v2.0.0")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"cogment/trial-datastore:v0.2.0")," (prereleased component)"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"cogment/model-registry:v0.4.0")," (prereleased component)"))),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Update the version of the python SDK to ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment[generate]>=2.0.2")," (learn more about generate ",(0,o.kt)("a",{parentName:"p",href:"#new-code-generation-workflow"},"here"),") in your ",(0,o.kt)("inlineCode",{parentName:"p"},"requirements.txt")," files or equivalent.")),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Update the version of the javascript SDK to ",(0,o.kt)("inlineCode",{parentName:"p"},"@cogment/cogment-js-sdk^2")," in your ",(0,o.kt)("inlineCode",{parentName:"p"},"package.json")," files or equivalent."))),(0,o.kt)("h2",{id:"cogmentyaml-split-in-a-spec-file-and-a-parameters-file"},(0,o.kt)("inlineCode",{parentName:"h2"},"cogment.yaml")," split in a spec file and a parameters file"),(0,o.kt)("p",null,"The ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file has seen a lot of changes, the most important one is that we now differ between the ",(0,o.kt)("strong",{parentName:"p"},"spec file")," which specifies the types of trial for a cogment project, including actor classes and their action/observation spaces, and the ",(0,o.kt)("strong",{parentName:"p"},"parameters file")," which specifies default parameters for trials. The spec file is used in the code generation process of each SDKs and is no longer used by the orchestrator. The parameters file is used by the orchestrator, if you use pre-trial hooks to configure the started trials it might not be necessary."),(0,o.kt)("p",null,"We now recommand that two different files, respectively named ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"params.yaml")," be used, however you can still use one file containing both content."),(0,o.kt)("admonition",{title:"Recommended update",type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"Move the ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_params")," section of the existing ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file to a dedicated ",(0,o.kt)("inlineCode",{parentName:"p"},"params.yaml")," file."),(0,o.kt)("p",{parentName:"admonition"},"Further changes are required to both sections, as described below.")),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"If the ",(0,o.kt)("inlineCode",{parentName:"p"},"--config=cogment.yaml")," was provided to the orchestrator, remove it."),(0,o.kt)("p",{parentName:"admonition"},"To provide a parameters file to the orchestrator use the ",(0,o.kt)("inlineCode",{parentName:"p"},"--params=params.yaml")," command line option.")),(0,o.kt)("p",null,"Further details can be found in the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/cogment-yaml"},"spec file documentation"),"."),(0,o.kt)("h2",{id:"pre-trial-hooks-definition-moved-to-an-orchestrator-configuration"},"pre-trial hooks definition moved to an orchestrator configuration"),(0,o.kt)("p",null,"pre-trial hooks are no longer defined in the ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file, but instead are now given to the orchestrator as a command line option or through an environment variable."),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"Remove the ",(0,o.kt)("inlineCode",{parentName:"p"},"trial:pre-hooks")," section from the spec file. Instead specify the hook addresses as gRPC URLs, e.g. ",(0,o.kt)("inlineCode",{parentName:"p"},"grpc://1.1.1.1:9000"),", using the orchestrator cli option ",(0,o.kt)("inlineCode",{parentName:"p"},"--pre_trial_hooks"),", separating potential multiple hooks with comas.")),(0,o.kt)("p",null,"Further details can be found in the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/cli/orchestrator"},"orchestrator documentation"),"."),(0,o.kt)("h2",{id:"datalog-definition-now-part-of-each-trials-parameters"},"Datalog definition now part of each trial's parameters"),(0,o.kt)("p",null,"The datalog definition is no longer a project-wide configuration but can be specified for each trial in its parameters."),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"Remove the ",(0,o.kt)("inlineCode",{parentName:"p"},"datalog")," section from the spec file."),(0,o.kt)("p",{parentName:"admonition"},"Datalog can be defined in the parameters file with the following format:"),(0,o.kt)("pre",{parentName:"admonition"},(0,o.kt)("code",{parentName:"pre",className:"language-yaml"},"trial_params:\n datalog:\n - endpoint: grpc://logger:9000\n")),(0,o.kt)("p",{parentName:"admonition"},"It can also be defined when configuring the trial in the pre-trial hook.")),(0,o.kt)("h2",{id:"datalog-api-has-changed-and-now-has-a-python-wrapper"},"Datalog API has changed, and now has a python wrapper"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"Instead of returning raw protobuf messages, Python wrapper objects are returned, so access to the raw messages is not available anymore"),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("inlineCode",{parentName:"li"},"DatalogSession")," attribute ",(0,o.kt)("inlineCode",{parentName:"li"},"raw_trial_params")," is not available anymore."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("inlineCode",{parentName:"li"},"DatalogSession")," attribute ",(0,o.kt)("inlineCode",{parentName:"li"},"trial_params")," returns a ",(0,o.kt)("inlineCode",{parentName:"li"},"cogment.LogParams")," object instead of a protobuf message."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("inlineCode",{parentName:"li"},"DatalogSession.get_all_samples()")," now generates ",(0,o.kt)("inlineCode",{parentName:"li"},"cogment.LogSample")," objects instead of a protobuf message."),(0,o.kt)("li",{parentName:"ul"},"If there is a need to deserialize v1 data (e.g. from an old database), v1 versions of the sample protobuf messages (",(0,o.kt)("inlineCode",{parentName:"li"},"cogment.api.datalog_pb2.TrialParams_v1")," and ",(0,o.kt)("inlineCode",{parentName:"li"},"cogment.api.datalog_pb2.DatalogSample_v1"),") are provided in the API for convenience.")),(0,o.kt)("p",null,"For more information, please see the following sections of the Python SDK Documentation"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/docs/reference/python#class-cogmentlogsample"},"LogSample")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/docs/reference/python#class-datalogsession"},"DatalogSession"))),(0,o.kt)("h2",{id:"default-trial-parameters-no-longer-support-definition-user-configuration-for-trials-environments-and-actors"},"Default trial parameters no longer support definition user configuration for trials, environments and actors"),(0,o.kt)("p",null,"The ",(0,o.kt)("inlineCode",{parentName:"p"},"config")," sections that were used to define default user configuration of trials, environments and actors are no longer supported. If necessary, these must be provided when starting the trial, for the trial config, and in pre-trial hooks, for the environment and actors config. Defaults can also be defined in the implementation code itself."),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"Remove the ",(0,o.kt)("inlineCode",{parentName:"p"},"config")," sections (for trial, environment and actor) from the params file."),(0,o.kt)("p",{parentName:"admonition"},"For simple projects, provide a default configuration in the implementation code directly, for more complex one use a pre-trial hook.")),(0,o.kt)("h2",{id:"prefer-using-full-url-for-endpoints"},"Prefer using full URL for endpoints"),(0,o.kt)("admonition",{title:"Recommended update",type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"Use full gRPC URLs, starting with ",(0,o.kt)("inlineCode",{parentName:"p"},"grpc://"),", when defining endpoints in the params file on in the SDKs.")),(0,o.kt)("p",null,"Additionaly, to prepare for further features, we are introducing a ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment")," URL scheme. At the moment only the special ",(0,o.kt)("em",{parentName:"p"},"client")," endpoint is concerned."),(0,o.kt)("admonition",{title:"Recommended update",type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"If actors are clients, replace the endpoint value from ",(0,o.kt)("inlineCode",{parentName:"p"},"client")," to ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment://client"))),(0,o.kt)("h2",{id:"support-for-delta-observations-discontinued"},'Support for "delta" observations discontinued'),(0,o.kt)("p",null,'Framework support for "delta" observations has been discontinued. The same result can be obtained user-side in the environment and actor implementations.'),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"Remove the following section from the spec file:"),(0,o.kt)("ul",{parentName:"admonition"},(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"import::python")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"import::javascript")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"actor_classes::observation::delta")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"actor_classes::observation::delta_apply_fn"))),(0,o.kt)("p",{parentName:"admonition"},"In the python SDK, ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-recvobservation"},(0,o.kt)("inlineCode",{parentName:"a"},"RecvObservation"))," ",(0,o.kt)("inlineCode",{parentName:"p"},"delta")," attribute no longer exists."),(0,o.kt)("p",{parentName:"admonition"},"You can support delta observations in your code, for example you could change the definition of your observation message to support both full observation or delta observation."),(0,o.kt)("pre",{parentName:"admonition"},(0,o.kt)("code",{parentName:"pre",className:"language-protobuf"},"message Observation {\n oneof observation_or_delta {\n ObservationMessage obs = 1;\n DeltaObservation delta = 2;\n }\n}\n")),(0,o.kt)("p",{parentName:"admonition"},"As before the environment side can decide to send full or delta observations. On the consumer side, actor or datalog, you'll need to keep the previous observation around to apply the delta to it.")),(0,o.kt)("admonition",{title:"Recommended update",type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"Instead of using ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-recvobservation"},(0,o.kt)("inlineCode",{parentName:"a"},"RecvObservation"))," ",(0,o.kt)("inlineCode",{parentName:"p"},"snapshot")," attribute, use ",(0,o.kt)("inlineCode",{parentName:"p"},"observation")," instead.")),(0,o.kt)("h2",{id:"new-code-generation-workflow"},"New code generation workflow"),(0,o.kt)("p",null,"The code generation step is no longer perfomed by the CLI but by dedicated tools provided with the SDKs. ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment copy")," is provided by the CLI as a cross platform way to copy the required files, i.e. the spec, protobuf and params files, from the root of the project to services source directories. As a result of these ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment sync")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment generate")," are no longer available."),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"Replace any usage of ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment sync")," with ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment copy"),". This new commands needs to know explicitly what files to copy"),(0,o.kt)("pre",{parentName:"admonition"},(0,o.kt)("code",{parentName:"pre",className:"language-console"},"cogment copy data.proto cogment.yaml params.yaml environment_dir actor_dir\n"))),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"For services using the python SDK:"),(0,o.kt)("ul",{parentName:"admonition"},(0,o.kt)("li",{parentName:"ul"},"Make sure you install the SDK and the ",(0,o.kt)("inlineCode",{parentName:"li"},"generate")," tool using ",(0,o.kt)("inlineCode",{parentName:"li"},"pip install cogment[generate]"),"."),(0,o.kt)("li",{parentName:"ul"},"Generate the necessary files with ",(0,o.kt)("inlineCode",{parentName:"li"},"python3 -m cogment.generate --spec cogment.yaml"),"."))),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"For services using the javascript SDK"),(0,o.kt)("ul",{parentName:"admonition"},(0,o.kt)("li",{parentName:"ul"},"Generate the necessary files with ",(0,o.kt)("inlineCode",{parentName:"li"},"npx cogment-js-sdk-generate cogment.yaml"),"."))),(0,o.kt)("h2",{id:"orchestrator-environment-variables-namespaced"},"Orchestrator environment variables namespaced"),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"Change the name of environment variables:"),(0,o.kt)("pre",{parentName:"admonition"},(0,o.kt)("code",{parentName:"pre"},"- From `TRIAL_LIFECYCLE_PORT` to `COGMENT_LIFECYCLE_PORT`\n- From `TRIAL_ACTOR_PORT` to `COGMENT_ACTOR_PORT`\n- From `PROMETHEUS_PORT` to `COGMENT_ORCHESTRATOR_PROMETHEUS_PORT`\n"))),(0,o.kt)("h2",{id:"trials-environments-can-be-named"},"Trials' environments can be named"),(0,o.kt)("p",null,'Just like the actors, the environment in a trial can now be named, this name defaults to "env". The environment name is used to address it, in particular to send messages. Environments and actors names belong to the same "namespace" and must be unique.'),(0,o.kt)("admonition",{title:"Recommended update",type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"Instead of using the ",(0,o.kt)("inlineCode",{parentName:"p"},"to_environment")," arguments of ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#send_messageself-payload-to"},(0,o.kt)("inlineCode",{parentName:"a"},"ActorSession.send_message()")),", use ",(0,o.kt)("inlineCode",{parentName:"p"},"to")," and specify the environment's name.")),(0,o.kt)("h2",{id:"python-sdk"},"Python SDK"),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},(0,o.kt)("inlineCode",{parentName:"p"},"Controller.terminate_trial()")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"Controller.get_trial_info()")," no longer supports providing a single trial identifier as a string."),(0,o.kt)("p",{parentName:"admonition"},"Their usage need to change from"),(0,o.kt)("pre",{parentName:"admonition"},(0,o.kt)("code",{parentName:"pre",className:"language-python"},'# Using named argument\nmy_controller.terminate_trial(trial_id="my_trial_id")\n# Using positional argument\nmy_controller.get_trial_info("my_trial_id")\n')),(0,o.kt)("p",{parentName:"admonition"},"to"),(0,o.kt)("pre",{parentName:"admonition"},(0,o.kt)("code",{parentName:"pre",className:"language-python"},'my_controller.terminate_trial(trial_ids=["my_trial_id"])\nmy_controller.get_trial_info(["my_trial_id"])\n'))),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"In actor implementaion, remove all usage of ",(0,o.kt)("inlineCode",{parentName:"p"},"get_active_actors()"),". This method has been restricted to the environment only."),(0,o.kt)("p",{parentName:"admonition"},"If actors need the full list of actors, there are a few possibilities: - Create a controller in the actor implementation and use the ",(0,o.kt)("inlineCode",{parentName:"p"},"Controller.get_actors()")," method. - Receive the actor list in the config from the pre-trial hooks; the pre-trial hooks have implicit knowledge of all actors (at least the last hook). - Add the information in the actors observation space. - Send the information in a message.")),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"Remove all usage of ",(0,o.kt)("inlineCode",{parentName:"p"},"EnvironmentSession.send_message()")," using the ",(0,o.kt)("inlineCode",{parentName:"p"},"to_environment")," argument.")),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"Rename the parameter ",(0,o.kt)("inlineCode",{parentName:"p"},"observations")," in ",(0,o.kt)("inlineCode",{parentName:"p"},"EnvironmentSession.end(observations=observations)")," to ",(0,o.kt)("inlineCode",{parentName:"p"},"final_observations"),".")),(0,o.kt)("p",null,"Further details can be found in the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python"},"python SDK documentation"),"."),(0,o.kt)("h2",{id:"javascript-sdk"},"Javascript SDK"),(0,o.kt)("p",null,"There has been a complete rework of the JS SDK we therefore recommend you to take a look at the dedicated ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/javascript"},"javascript SDK documentation"),". In more details:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"You can keep your actor function, as well as any logic dealing with the observation object, as its shape has remained the same,"),(0,o.kt)("li",{parentName:"ul"},"If you are using the ",(0,o.kt)("inlineCode",{parentName:"li"},"useActions")," React hook, there is a new version of that hook, which can be retrieved by running ",(0,o.kt)("inlineCode",{parentName:"li"},"cogment init")," with an updated version of the ",(0,o.kt)("a",{parentName:"li",href:"/docs/reference/cli/"},"Cogment CLI"),", and choosing ",(0,o.kt)("inlineCode",{parentName:"li"},"yes")," when prompted if you want a web client.")),(0,o.kt)("h2",{id:"troubleshooting"},"Troubleshooting"),(0,o.kt)("p",null,"Here we list a few error you are likely to see if something was not upgraded properly to Cogment 2.0:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre"},'AttributeError: module "cogment" has no attribute "delta_encoding"\n')),(0,o.kt)("ul",{parentName:"li"},(0,o.kt)("li",{parentName:"ul"},"This would be logged while trying to run a Python script and may happen if you use ",(0,o.kt)("inlineCode",{parentName:"li"},"cogment generate")," instead of the ",(0,o.kt)("a",{parentName:"li",href:"#new-code-generation-workflow"},"new generation workflow"),"."),(0,o.kt)("li",{parentName:"ul"},"This is caused by the discontinuation of ",(0,o.kt)("a",{parentName:"li",href:"#support-for-delta-observations-discontinued"},(0,o.kt)("inlineCode",{parentName:"a"},"delta")," encoding")," for observations."))),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre"},"Failure: [Problem rebuilding trial params [INVALID_ARGUMENT:(environment.config) some_message: Cannot find field.]]\n")),(0,o.kt)("ul",{parentName:"li"},(0,o.kt)("li",{parentName:"ul"},"When starting the Orchestrator with --config or --params."),(0,o.kt)("li",{parentName:"ul"},"This may happen when using an older version of the default parameters in a params or spec file."),(0,o.kt)("li",{parentName:"ul"},'It will happen when the default parameters contain an unknown field; In this particular case, the field config (i.e.from environment.config) is "unknown" because it is not accepted anymore in the Cogment 2.0 default parameters.')))))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/fd5e6f38.65b6ada4.js b/assets/js/fd5e6f38.65b6ada4.js deleted file mode 100644 index 8a9bc8b..0000000 --- a/assets/js/fd5e6f38.65b6ada4.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[3106],{3905:(e,t,n)=>{n.d(t,{Zo:()=>m,kt:()=>u});var a=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var p=a.createContext({}),s=function(e){var t=a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):r(r({},t),e)),n},m=function(e){var t=s(e.components);return a.createElement(p.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},c=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,p=e.parentName,m=l(e,["components","mdxType","originalType","parentName"]),c=s(n),u=o,h=c["".concat(p,".").concat(u)]||c[u]||d[u]||i;return n?a.createElement(h,r(r({ref:t},m),{},{components:n})):a.createElement(h,r({ref:t},m))}));function u(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,r=new Array(i);r[0]=c;var l={};for(var p in t)hasOwnProperty.call(t,p)&&(l[p]=t[p]);l.originalType=e,l.mdxType="string"==typeof e?e:o,r[1]=l;for(var s=2;s<i;s++)r[s]=n[s];return a.createElement.apply(null,r)}return a.createElement.apply(null,n)}c.displayName="MDXCreateElement"},845:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>r,default:()=>d,frontMatter:()=>i,metadata:()=>l,toc:()=>s});var a=n(7462),o=(n(7294),n(3905));const i={},r="Migrate from Cogment v1 to v2",l={unversionedId:"guide/implementation-recipes/v2-migration-guide",id:"guide/implementation-recipes/v2-migration-guide",title:"Migrate from Cogment v1 to v2",description:"This document is written as a guide to migrate from Cogment v1 to v2, a full list of the changes is also available here.",source:"@site/docs/guide/implementation-recipes/v2-migration-guide.md",sourceDirName:"guide/implementation-recipes",slug:"/guide/implementation-recipes/v2-migration-guide",permalink:"/docs/guide/implementation-recipes/v2-migration-guide",draft:!1,tags:[],version:"current",lastUpdatedAt:1696019767,formattedLastUpdatedAt:"Sep 29, 2023",frontMatter:{},sidebar:"docSidebar",previous:{title:"Configure Trial from Controller",permalink:"/docs/guide/implementation-recipes/configure-trial-from-controller"},next:{title:"Tutorial",permalink:"/docs/guide/tutorial/"}},p={},s=[{value:"Updating components",id:"updating-components",level:2},{value:"<code>cogment.yaml</code> split in a spec file and a parameters file",id:"cogmentyaml-split-in-a-spec-file-and-a-parameters-file",level:2},{value:"pre-trial hooks definition moved to an orchestrator configuration",id:"pre-trial-hooks-definition-moved-to-an-orchestrator-configuration",level:2},{value:"Datalog definition now part of each trial's parameters",id:"datalog-definition-now-part-of-each-trials-parameters",level:2},{value:"Datalog API has changed, and now has a python wrapper",id:"datalog-api-has-changed-and-now-has-a-python-wrapper",level:2},{value:"Default trial parameters no longer support definition user configuration for trials, environments and actors",id:"default-trial-parameters-no-longer-support-definition-user-configuration-for-trials-environments-and-actors",level:2},{value:"Prefer using full URL for endpoints",id:"prefer-using-full-url-for-endpoints",level:2},{value:"Support for "delta" observations discontinued",id:"support-for-delta-observations-discontinued",level:2},{value:"New code generation workflow",id:"new-code-generation-workflow",level:2},{value:"Orchestrator environment variables namespaced",id:"orchestrator-environment-variables-namespaced",level:2},{value:"Trials' environments can be named",id:"trials-environments-can-be-named",level:2},{value:"Python SDK",id:"python-sdk",level:2},{value:"Javascript SDK",id:"javascript-sdk",level:2},{value:"Troubleshooting",id:"troubleshooting",level:2}],m={toc:s};function d(e){let{components:t,...n}=e;return(0,o.kt)("wrapper",(0,a.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"migrate-from-cogment-v1-to-v2"},"Migrate from Cogment v1 to v2"),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"This document is written as a guide to migrate from Cogment v1 to v2, a full list of the changes is also available ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/cogment-v2-changes"},"here"),".")),(0,o.kt)("h2",{id:"updating-components"},"Updating components"),(0,o.kt)("p",null,"The following components needs to be updated to work with Cogment v2:"),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Update the CLI to the latest version and check that the version is correct"),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-console"},"curl --silent -L https://raw.githubusercontent.com/cogment/cogment-cli/main/install.sh | sudo bash\n")),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-console"},"cogment version\n"))),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Update the docker images to the versions compatible with the 2.0 API. These should be updated in ",(0,o.kt)("inlineCode",{parentName:"p"},"Dockerfile"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"*.dockerfile")," or ",(0,o.kt)("inlineCode",{parentName:"p"},"docker-compose.yml")," files in your project. The minimal version to use API 2.0 are:"),(0,o.kt)("ul",{parentName:"li"},(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"cogment/orchestrator:v2.0.0")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"cogment/trial-datastore:v0.2.0")," (prereleased component)"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"cogment/model-registry:v0.4.0")," (prereleased component)"))),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Update the version of the python SDK to ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment[generate]>=2.0.2")," (learn more about generate ",(0,o.kt)("a",{parentName:"p",href:"#new-code-generation-workflow"},"here"),") in your ",(0,o.kt)("inlineCode",{parentName:"p"},"requirements.txt")," files or equivalent.")),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Update the version of the javascript SDK to ",(0,o.kt)("inlineCode",{parentName:"p"},"@cogment/cogment-js-sdk^2")," in your ",(0,o.kt)("inlineCode",{parentName:"p"},"package.json")," files or equivalent."))),(0,o.kt)("h2",{id:"cogmentyaml-split-in-a-spec-file-and-a-parameters-file"},(0,o.kt)("inlineCode",{parentName:"h2"},"cogment.yaml")," split in a spec file and a parameters file"),(0,o.kt)("p",null,"The ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file has seen a lot of changes, the most important one is that we now differ between the ",(0,o.kt)("strong",{parentName:"p"},"spec file")," which specifies the types of trial for a cogment project, including actor classes and their action/observation spaces, and the ",(0,o.kt)("strong",{parentName:"p"},"parameters file")," which specifies default parameters for trials. The spec file is used in the code generation process of each SDKs and is no longer used by the orchestrator. The parameters file is used by the orchestrator, if you use pre-trial hooks to configure the started trials it might not be necessary."),(0,o.kt)("p",null,"We now recommand that two different files, respectively named ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"params.yaml")," be used, however you can still use one file containing both content."),(0,o.kt)("admonition",{title:"Recommended update",type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"Move the ",(0,o.kt)("inlineCode",{parentName:"p"},"trial_params")," section of the existing ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file to a dedicated ",(0,o.kt)("inlineCode",{parentName:"p"},"params.yaml")," file."),(0,o.kt)("p",{parentName:"admonition"},"Further changes are required to both sections, as described below.")),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"If the ",(0,o.kt)("inlineCode",{parentName:"p"},"--config=cogment.yaml")," was provided to the orchestrator, remove it."),(0,o.kt)("p",{parentName:"admonition"},"To provide a parameters file to the orchestrator use the ",(0,o.kt)("inlineCode",{parentName:"p"},"--params=params.yaml")," command line option.")),(0,o.kt)("p",null,"Further details can be found in the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/cogment-yaml"},"spec file documentation"),"."),(0,o.kt)("h2",{id:"pre-trial-hooks-definition-moved-to-an-orchestrator-configuration"},"pre-trial hooks definition moved to an orchestrator configuration"),(0,o.kt)("p",null,"pre-trial hooks are no longer defined in the ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment.yaml")," file, but instead are now given to the orchestrator as a command line option or through an environment variable."),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"Remove the ",(0,o.kt)("inlineCode",{parentName:"p"},"trial:pre-hooks")," section from the spec file. Instead specify the hook addresses as gRPC URLs, e.g. ",(0,o.kt)("inlineCode",{parentName:"p"},"grpc://1.1.1.1:9000"),", using the orchestrator cli option ",(0,o.kt)("inlineCode",{parentName:"p"},"--pre_trial_hooks"),", separating potential multiple hooks with comas.")),(0,o.kt)("p",null,"Further details can be found in the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/cli/orchestrator"},"orchestrator documentation"),"."),(0,o.kt)("h2",{id:"datalog-definition-now-part-of-each-trials-parameters"},"Datalog definition now part of each trial's parameters"),(0,o.kt)("p",null,"The datalog definition is no longer a project-wide configuration but can be specified for each trial in its parameters."),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"Remove the ",(0,o.kt)("inlineCode",{parentName:"p"},"datalog")," section from the spec file."),(0,o.kt)("p",{parentName:"admonition"},"Datalog can be defined in the parameters file with the following format:"),(0,o.kt)("pre",{parentName:"admonition"},(0,o.kt)("code",{parentName:"pre",className:"language-yaml"},"trial_params:\n datalog:\n - endpoint: grpc://logger:9000\n")),(0,o.kt)("p",{parentName:"admonition"},"It can also be defined when configuring the trial in the pre-trial hook.")),(0,o.kt)("h2",{id:"datalog-api-has-changed-and-now-has-a-python-wrapper"},"Datalog API has changed, and now has a python wrapper"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"Instead of returning raw protobuf messages, Python wrapper objects are returned, so access to the raw messages is not available anymore"),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("inlineCode",{parentName:"li"},"DatalogSession")," attribute ",(0,o.kt)("inlineCode",{parentName:"li"},"raw_trial_params")," is not available anymore."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("inlineCode",{parentName:"li"},"DatalogSession")," attribute ",(0,o.kt)("inlineCode",{parentName:"li"},"trial_params")," returns a ",(0,o.kt)("inlineCode",{parentName:"li"},"cogment.LogParams")," object instead of a protobuf message."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("inlineCode",{parentName:"li"},"DatalogSession.get_all_samples()")," now generates ",(0,o.kt)("inlineCode",{parentName:"li"},"cogment.LogSample")," objects instead of a protobuf message."),(0,o.kt)("li",{parentName:"ul"},"If there is a need to deserialize v1 data (e.g. from an old database), v1 versions of the sample protobuf messages (",(0,o.kt)("inlineCode",{parentName:"li"},"cogment.api.datalog_pb2.TrialParams_v1")," and ",(0,o.kt)("inlineCode",{parentName:"li"},"cogment.api.datalog_pb2.DatalogSample_v1"),") are provided in the API for convenience.")),(0,o.kt)("p",null,"For more information, please see the following sections of the Python SDK Documentation"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/docs/reference/python#class-cogmentlogsample"},"LogSample")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/docs/reference/python#class-datalogsession"},"DatalogSession"))),(0,o.kt)("h2",{id:"default-trial-parameters-no-longer-support-definition-user-configuration-for-trials-environments-and-actors"},"Default trial parameters no longer support definition user configuration for trials, environments and actors"),(0,o.kt)("p",null,"The ",(0,o.kt)("inlineCode",{parentName:"p"},"config")," sections that were used to define default user configuration of trials, environments and actors are no longer supported. If necessary, these must be provided when starting the trial, for the trial config, and in pre-trial hooks, for the environment and actors config. Defaults can also be defined in the implementation code itself."),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"Remove the ",(0,o.kt)("inlineCode",{parentName:"p"},"config")," sections (for trial, environment and actor) from the params file."),(0,o.kt)("p",{parentName:"admonition"},"For simple projects, provide a default configuration in the implementation code directly, for more complex one use a pre-trial hook.")),(0,o.kt)("h2",{id:"prefer-using-full-url-for-endpoints"},"Prefer using full URL for endpoints"),(0,o.kt)("admonition",{title:"Recommended update",type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"Use full gRPC URLs, starting with ",(0,o.kt)("inlineCode",{parentName:"p"},"grpc://"),", when defining endpoints in the params file on in the SDKs.")),(0,o.kt)("p",null,"Additionaly, to prepare for further features, we are introducing a ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment")," URL scheme. At the moment only the special ",(0,o.kt)("em",{parentName:"p"},"client")," endpoint is concerned."),(0,o.kt)("admonition",{title:"Recommended update",type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"If actors are clients, replace the endpoint value from ",(0,o.kt)("inlineCode",{parentName:"p"},"client")," to ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment://client"))),(0,o.kt)("h2",{id:"support-for-delta-observations-discontinued"},'Support for "delta" observations discontinued'),(0,o.kt)("p",null,'Framework support for "delta" observations has been discontinued. The same result can be obtained user-side in the environment and actor implementations.'),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"Remove the following section from the spec file:"),(0,o.kt)("ul",{parentName:"admonition"},(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"import::python")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"import::javascript")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"actor_classes::observation::delta")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"actor_classes::observation::delta_apply_fn"))),(0,o.kt)("p",{parentName:"admonition"},"In the python SDK, ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-recvobservation"},(0,o.kt)("inlineCode",{parentName:"a"},"RecvObservation"))," ",(0,o.kt)("inlineCode",{parentName:"p"},"delta")," attribute no longer exists."),(0,o.kt)("p",{parentName:"admonition"},"You can support delta observations in your code, for example you could change the definition of your observation message to support both full observation or delta observation."),(0,o.kt)("pre",{parentName:"admonition"},(0,o.kt)("code",{parentName:"pre",className:"language-protobuf"},"message Observation {\n oneof observation_or_delta {\n ObservationMessage obs = 1;\n DeltaObservation delta = 2;\n }\n}\n")),(0,o.kt)("p",{parentName:"admonition"},"As before the environment side can decide to send full or delta observations. On the consumer side, actor or datalog, you'll need to keep the previous observation around to apply the delta to it.")),(0,o.kt)("admonition",{title:"Recommended update",type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"Instead of using ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#class-recvobservation"},(0,o.kt)("inlineCode",{parentName:"a"},"RecvObservation"))," ",(0,o.kt)("inlineCode",{parentName:"p"},"snapshot")," attribute, use ",(0,o.kt)("inlineCode",{parentName:"p"},"observation")," instead.")),(0,o.kt)("h2",{id:"new-code-generation-workflow"},"New code generation workflow"),(0,o.kt)("p",null,"The code generation step is no longer perfomed by the CLI but by dedicated tools provided with the SDKs. ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment copy")," is provided by the CLI as a cross platform way to copy the required files, i.e. the spec, protobuf and params files, from the root of the project to services source directories. As a result of these ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment sync")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment generate")," are no longer available."),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"Replace any usage of ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment sync")," with ",(0,o.kt)("inlineCode",{parentName:"p"},"cogment copy"),". This new commands needs to know explicitly what files to copy"),(0,o.kt)("pre",{parentName:"admonition"},(0,o.kt)("code",{parentName:"pre",className:"language-console"},"cogment copy data.proto cogment.yaml params.yaml environment_dir actor_dir\n"))),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"For services using the python SDK:"),(0,o.kt)("ul",{parentName:"admonition"},(0,o.kt)("li",{parentName:"ul"},"Make sure you install the SDK and the ",(0,o.kt)("inlineCode",{parentName:"li"},"generate")," tool using ",(0,o.kt)("inlineCode",{parentName:"li"},"pip install cogment[generate]"),"."),(0,o.kt)("li",{parentName:"ul"},"Generate the necessary files with ",(0,o.kt)("inlineCode",{parentName:"li"},"python3 -m cogment.generate --spec cogment.yaml"),"."))),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"For services using the javascript SDK"),(0,o.kt)("ul",{parentName:"admonition"},(0,o.kt)("li",{parentName:"ul"},"Generate the necessary files with ",(0,o.kt)("inlineCode",{parentName:"li"},"npx cogment-js-sdk-generate cogment.yaml"),"."))),(0,o.kt)("h2",{id:"orchestrator-environment-variables-namespaced"},"Orchestrator environment variables namespaced"),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"Change the name of environment variables:"),(0,o.kt)("pre",{parentName:"admonition"},(0,o.kt)("code",{parentName:"pre"},"- From `TRIAL_LIFECYCLE_PORT` to `COGMENT_LIFECYCLE_PORT`\n- From `TRIAL_ACTOR_PORT` to `COGMENT_ACTOR_PORT`\n- From `PROMETHEUS_PORT` to `COGMENT_ORCHESTRATOR_PROMETHEUS_PORT`\n"))),(0,o.kt)("h2",{id:"trials-environments-can-be-named"},"Trials' environments can be named"),(0,o.kt)("p",null,'Just like the actors, the environment in a trial can now be named, this name defaults to "env". The environment name is used to address it, in particular to send messages. Environments and actors names belong to the same "namespace" and must be unique.'),(0,o.kt)("admonition",{title:"Recommended update",type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"Instead of using the ",(0,o.kt)("inlineCode",{parentName:"p"},"to_environment")," arguments of ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python#send_messageself-payload-to"},(0,o.kt)("inlineCode",{parentName:"a"},"ActorSession.send_message()")),", use ",(0,o.kt)("inlineCode",{parentName:"p"},"to")," and specify the environment's name.")),(0,o.kt)("h2",{id:"python-sdk"},"Python SDK"),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},(0,o.kt)("inlineCode",{parentName:"p"},"Controller.terminate_trial()")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"Controller.get_trial_info()")," no longer supports providing a single trial identifier as a string."),(0,o.kt)("p",{parentName:"admonition"},"Their usage need to change from"),(0,o.kt)("pre",{parentName:"admonition"},(0,o.kt)("code",{parentName:"pre",className:"language-python"},'# Using named argument\nmy_controller.terminate_trial(trial_id="my_trial_id")\n# Using positional argument\nmy_controller.get_trial_info("my_trial_id")\n')),(0,o.kt)("p",{parentName:"admonition"},"to"),(0,o.kt)("pre",{parentName:"admonition"},(0,o.kt)("code",{parentName:"pre",className:"language-python"},'my_controller.terminate_trial(trial_ids=["my_trial_id"])\nmy_controller.get_trial_info(["my_trial_id"])\n'))),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"In actor implementaion, remove all usage of ",(0,o.kt)("inlineCode",{parentName:"p"},"get_active_actors()"),". This method has been restricted to the environment only."),(0,o.kt)("p",{parentName:"admonition"},"If actors need the full list of actors, there are a few possibilities: - Create a controller in the actor implementation and use the ",(0,o.kt)("inlineCode",{parentName:"p"},"Controller.get_actors()")," method. - Receive the actor list in the config from the pre-trial hooks; the pre-trial hooks have implicit knowledge of all actors (at least the last hook). - Add the information in the actors observation space. - Send the information in a message.")),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"Remove all usage of ",(0,o.kt)("inlineCode",{parentName:"p"},"EnvironmentSession.send_message()")," using the ",(0,o.kt)("inlineCode",{parentName:"p"},"to_environment")," argument.")),(0,o.kt)("admonition",{title:"Required update",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"Rename the parameter ",(0,o.kt)("inlineCode",{parentName:"p"},"observations")," in ",(0,o.kt)("inlineCode",{parentName:"p"},"EnvironmentSession.end(observations=observations)")," to ",(0,o.kt)("inlineCode",{parentName:"p"},"final_observations"),".")),(0,o.kt)("p",null,"Further details can be found in the ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/python"},"python SDK documentation"),"."),(0,o.kt)("h2",{id:"javascript-sdk"},"Javascript SDK"),(0,o.kt)("p",null,"There has been a complete rework of the JS SDK we therefore recommend you to take a look at the dedicated ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/javascript"},"javascript SDK documentation"),". In more details:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"You can keep your actor function, as well as any logic dealing with the observation object, as its shape has remained the same,"),(0,o.kt)("li",{parentName:"ul"},"If you are using the ",(0,o.kt)("inlineCode",{parentName:"li"},"useActions")," React hook, there is a new version of that hook, which can be retrieved by running ",(0,o.kt)("inlineCode",{parentName:"li"},"cogment init")," with an updated version of the ",(0,o.kt)("a",{parentName:"li",href:"/docs/reference/cli/"},"Cogment CLI"),", and choosing ",(0,o.kt)("inlineCode",{parentName:"li"},"yes")," when prompted if you want a web client.")),(0,o.kt)("h2",{id:"troubleshooting"},"Troubleshooting"),(0,o.kt)("p",null,"Here we list a few error you are likely to see if something was not upgraded properly to Cogment 2.0:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre"},'AttributeError: module "cogment" has no attribute "delta_encoding"\n')),(0,o.kt)("ul",{parentName:"li"},(0,o.kt)("li",{parentName:"ul"},"This would be logged while trying to run a Python script and may happen if you use ",(0,o.kt)("inlineCode",{parentName:"li"},"cogment generate")," instead of the ",(0,o.kt)("a",{parentName:"li",href:"#new-code-generation-workflow"},"new generation workflow"),"."),(0,o.kt)("li",{parentName:"ul"},"This is caused by the discontinuation of ",(0,o.kt)("a",{parentName:"li",href:"#support-for-delta-observations-discontinued"},(0,o.kt)("inlineCode",{parentName:"a"},"delta")," encoding")," for observations."))),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre"},"Failure: [Problem rebuilding trial params [INVALID_ARGUMENT:(environment.config) some_message: Cannot find field.]]\n")),(0,o.kt)("ul",{parentName:"li"},(0,o.kt)("li",{parentName:"ul"},"When starting the Orchestrator with --config or --params."),(0,o.kt)("li",{parentName:"ul"},"This may happen when using an older version of the default parameters in a params or spec file."),(0,o.kt)("li",{parentName:"ul"},'It will happen when the default parameters contain an unknown field; In this particular case, the field config (i.e.from environment.config) is "unknown" because it is not accepted anymore in the Cogment 2.0 default parameters.')))))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/main.5e88352e.js b/assets/js/main.5e88352e.js new file mode 100644 index 0000000..46d5e8d --- /dev/null +++ b/assets/js/main.5e88352e.js @@ -0,0 +1,2 @@ +/*! For license information please see main.5e88352e.js.LICENSE.txt */ +(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[179],{830:(e,t,n)=>{"use strict";n.d(t,{W:()=>a});var r=n(7294);function a(){return r.createElement("svg",{width:"20",height:"20",className:"DocSearch-Search-Icon",viewBox:"0 0 20 20"},r.createElement("path",{d:"M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}},1205:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=function(){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,n={},r={util:{encode:function e(t){return t instanceof a?new a(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++t}),e.__id},clone:function e(t,n){var a,o;switch(n=n||{},r.util.type(t)){case"Object":if(o=r.util.objId(t),n[o])return n[o];for(var i in a={},n[o]=a,t)t.hasOwnProperty(i)&&(a[i]=e(t[i],n));return a;case"Array":return o=r.util.objId(t),n[o]?n[o]:(a=[],n[o]=a,t.forEach((function(t,r){a[r]=e(t,n)})),a);default:return t}},getLanguage:function(t){for(;t;){var n=e.exec(t.className);if(n)return n[1].toLowerCase();t=t.parentElement}return"none"},setLanguage:function(t,n){t.className=t.className.replace(RegExp(e,"gi"),""),t.classList.add("language-"+n)},isActive:function(e,t,n){for(var r="no-"+t;e;){var a=e.classList;if(a.contains(t))return!0;if(a.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:n,plaintext:n,text:n,txt:n,extend:function(e,t){var n=r.util.clone(r.languages[e]);for(var a in t)n[a]=t[a];return n},insertBefore:function(e,t,n,a){var o=(a=a||r.languages)[e],i={};for(var l in o)if(o.hasOwnProperty(l)){if(l==t)for(var s in n)n.hasOwnProperty(s)&&(i[s]=n[s]);n.hasOwnProperty(l)||(i[l]=o[l])}var c=a[e];return a[e]=i,r.languages.DFS(r.languages,(function(t,n){n===c&&t!=e&&(this[t]=i)})),i},DFS:function e(t,n,a,o){o=o||{};var i=r.util.objId;for(var l in t)if(t.hasOwnProperty(l)){n.call(t,l,t[l],a||l);var s=t[l],c=r.util.type(s);"Object"!==c||o[i(s)]?"Array"!==c||o[i(s)]||(o[i(s)]=!0,e(s,n,l,o)):(o[i(s)]=!0,e(s,n,null,o))}}},plugins:{},highlight:function(e,t,n){var o={code:e,grammar:t,language:n};return r.hooks.run("before-tokenize",o),o.tokens=r.tokenize(o.code,o.grammar),r.hooks.run("after-tokenize",o),a.stringify(r.util.encode(o.tokens),o.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var a=new l;return s(a,a.head,e),i(e,a,t,a.head,0),function(e){var t=[],n=e.head.next;for(;n!==e.tail;)t.push(n.value),n=n.next;return t}(a)},hooks:{all:{},add:function(e,t){var n=r.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=r.hooks.all[e];if(n&&n.length)for(var a,o=0;a=n[o++];)a(t)}},Token:a};function a(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function o(e,t,n,r){e.lastIndex=t;var a=e.exec(n);if(a&&r&&a[1]){var o=a[1].length;a.index+=o,a[0]=a[0].slice(o)}return a}function i(e,t,n,l,u,d){for(var f in n)if(n.hasOwnProperty(f)&&n[f]){var p=n[f];p=Array.isArray(p)?p:[p];for(var m=0;m<p.length;++m){if(d&&d.cause==f+","+m)return;var h=p[m],g=h.inside,b=!!h.lookbehind,v=!!h.greedy,y=h.alias;if(v&&!h.pattern.global){var w=h.pattern.toString().match(/[imsuy]*$/)[0];h.pattern=RegExp(h.pattern.source,w+"g")}for(var k=h.pattern||h,E=l.next,S=u;E!==t.tail&&!(d&&S>=d.reach);S+=E.value.length,E=E.next){var x=E.value;if(t.length>e.length)return;if(!(x instanceof a)){var C,T=1;if(v){if(!(C=o(k,S,e,b))||C.index>=e.length)break;var _=C.index,A=C.index+C[0].length,L=S;for(L+=E.value.length;_>=L;)L+=(E=E.next).value.length;if(S=L-=E.value.length,E.value instanceof a)continue;for(var R=E;R!==t.tail&&(L<A||"string"==typeof R.value);R=R.next)T++,L+=R.value.length;T--,x=e.slice(S,L),C.index-=S}else if(!(C=o(k,0,x,b)))continue;_=C.index;var P=C[0],N=x.slice(0,_),O=x.slice(_+P.length),I=S+x.length;d&&I>d.reach&&(d.reach=I);var D=E.prev;if(N&&(D=s(t,D,N),S+=N.length),c(t,D,T),E=s(t,D,new a(f,g?r.tokenize(P,g):P,y,P)),O&&s(t,E,O),T>1){var M={cause:f+","+m,reach:I};i(e,t,n,E.prev,S,M),d&&M.reach>d.reach&&(d.reach=M.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function s(e,t,n){var r=t.next,a={value:n,prev:t,next:r};return t.next=a,r.prev=a,e.length++,a}function c(e,t,n){for(var r=t.next,a=0;a<n&&r!==e.tail;a++)r=r.next;t.next=r,r.prev=t,e.length-=a}return a.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var a="";return t.forEach((function(t){a+=e(t,n)})),a}var o={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},i=t.alias;i&&(Array.isArray(i)?Array.prototype.push.apply(o.classes,i):o.classes.push(i)),r.hooks.run("wrap",o);var l="";for(var s in o.attributes)l+=" "+s+'="'+(o.attributes[s]||"").replace(/"/g,""")+'"';return"<"+o.tag+' class="'+o.classes.join(" ")+'"'+l+">"+o.content+"</"+o.tag+">"},r}(),a=r;r.default=r,a.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},a.languages.markup.tag.inside["attr-value"].inside.entity=a.languages.markup.entity,a.languages.markup.doctype.inside["internal-subset"].inside=a.languages.markup,a.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(a.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:a.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:a.languages[t]};var o={};o[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},a.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(a.languages.markup.tag,"addAttribute",{value:function(e,t){a.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:a.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),a.languages.html=a.languages.markup,a.languages.mathml=a.languages.markup,a.languages.svg=a.languages.markup,a.languages.xml=a.languages.extend("markup",{}),a.languages.ssml=a.languages.xml,a.languages.atom=a.languages.xml,a.languages.rss=a.languages.xml,function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var a=["comment","function-name","for-or-select","assign-left","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=r.variable[1].inside,i=0;i<a.length;i++)o[a[i]]=e.languages.bash[a[i]];e.languages.shell=e.languages.bash}(a),a.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},a.languages.c=a.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),a.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),a.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},a.languages.c.string],char:a.languages.c.char,comment:a.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:a.languages.c}}}}),a.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete a.languages.c.boolean,function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(a),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(a),function(e){var t,n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp("\\[(?:[^[\\]\"']|"+n.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[n,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}});var r={pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0},a={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:r,number:a,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:r,number:a})}(a),a.languages.javascript=a.languages.extend("clike",{"class-name":[a.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),a.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,a.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:a.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:a.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:a.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:a.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:a.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),a.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:a.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),a.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),a.languages.markup&&(a.languages.markup.tag.addInlined("script","javascript"),a.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),a.languages.js=a.languages.javascript,function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(a),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+n.source+")?)",a=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,(function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source})),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function i(e,t){t=(t||"").replace(/m/g,"")+"m";var n=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,(function(){return r})).replace(/<<value>>/g,(function(){return e}));return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,(function(){return r}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,(function(){return r})).replace(/<<key>>/g,(function(){return"(?:"+a+"|"+o+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:i(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:i(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:i(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:i(o),lookbehind:!0,greedy:!0},number:{pattern:i(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(a),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(/<inner>/g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,a=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+a+o+"(?:"+a+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+a+o+")(?:"+a+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+a+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+a+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n<r;n++){var a=t[n];if("code"===a.type){var o=a.content[1],i=a.content[3];if(o&&i&&"code-language"===o.type&&"code-block"===i.type&&"string"==typeof o.content){var l=o.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),s="language-"+(l=(/[a-z][\w-]*/i.exec(l)||[""])[0].toLowerCase());i.alias?"string"==typeof i.alias?i.alias=[i.alias,s]:i.alias.push(s):i.alias=[s]}}else e(a.content)}}(e.tokens)})),e.hooks.add("wrap",(function(t){if("code-block"===t.type){for(var n="",r=0,a=t.classes.length;r<a;r++){var o=t.classes[r],c=/language-(.+)/.exec(o);if(c){n=c[1];break}}var u,d=e.languages[n];if(d)t.content=e.highlight((u=t.content,u.replace(i,"").replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,(function(e,t){var n;if("#"===(t=t.toLowerCase())[0])return n="x"===t[1]?parseInt(t.slice(2),16):Number(t.slice(1)),s(n);var r=l[t];return r||e}))),d,n);else if(n&&"none"!==n&&e.plugins.autoloader){var f="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());t.attributes.id=f,e.plugins.autoloader.loadLanguages(n,(function(){var t=document.getElementById(f);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))}))}}}));var i=RegExp(e.languages.markup.tag.pattern.source,"gi"),l={amp:"&",lt:"<",gt:">",quot:'"'},s=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(a),a.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:a.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},a.hooks.add("after-tokenize",(function(e){if("graphql"===e.language)for(var t=e.tokens.filter((function(e){return"string"!=typeof e&&"comment"!==e.type&&"scalar"!==e.type})),n=0;n<t.length;){var r=t[n++];if("keyword"===r.type&&"mutation"===r.content){var a=[];if(d(["definition-mutation","punctuation"])&&"("===u(1).content){n+=2;var o=f(/^\($/,/^\)$/);if(-1===o)continue;for(;n<o;n++){var i=u(0);"variable"===i.type&&(p(i,"variable-input"),a.push(i.content))}n=o+1}if(d(["punctuation","property-query"])&&"{"===u(0).content&&(n++,p(u(0),"property-mutation"),a.length>0)){var l=f(/^\{$/,/^\}$/);if(-1===l)continue;for(var s=n;s<l;s++){var c=t[s];"variable"===c.type&&a.indexOf(c.content)>=0&&p(c,"variable-input")}}}}function u(e){return t[n+e]}function d(e,t){t=t||0;for(var n=0;n<e.length;n++){var r=u(n+t);if(!r||r.type!==e[n])return!1}return!0}function f(e,r){for(var a=1,o=n;o<t.length;o++){var i=t[o],l=i.content;if("punctuation"===i.type&&"string"==typeof l)if(e.test(l))a++;else if(r.test(l)&&0===--a)return o}return-1}function p(e,t){var n=e.alias;n?Array.isArray(n)||(e.alias=n=[n]):e.alias=n=[],n.push(t)}})),a.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,a=r.inside["interpolation-punctuation"],o=r.pattern.source;function i(t,r){if(e.languages[t])return{pattern:RegExp("((?:"+r+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:t}}}}function l(e,t){return"___"+t.toUpperCase()+"_"+e+"___"}function s(t,n,r){var a={code:t,grammar:n,language:r};return e.hooks.run("before-tokenize",a),a.tokens=e.tokenize(a.code,a.grammar),e.hooks.run("after-tokenize",a),a.tokens}function c(t){var n={};n["interpolation-punctuation"]=a;var o=e.tokenize(t,n);if(3===o.length){var i=[1,1];i.push.apply(i,s(o[1],e.languages.javascript,"javascript")),o.splice.apply(o,i)}return new e.Token("interpolation",o,r.alias,t)}function u(t,n,r){var a=e.tokenize(t,{interpolation:{pattern:RegExp(o),lookbehind:!0}}),i=0,u={},d=s(a.map((function(e){if("string"==typeof e)return e;for(var n,a=e.content;-1!==t.indexOf(n=l(i++,r)););return u[n]=a,n})).join(""),n,r),f=Object.keys(u);return i=0,function e(t){for(var n=0;n<t.length;n++){if(i>=f.length)return;var r=t[n];if("string"==typeof r||"string"==typeof r.content){var a=f[i],o="string"==typeof r?r:r.content,l=o.indexOf(a);if(-1!==l){++i;var s=o.substring(0,l),d=c(u[a]),p=o.substring(l+a.length),m=[];if(s&&m.push(s),m.push(d),p){var h=[p];e(h),m.push.apply(m,h)}"string"==typeof r?(t.splice.apply(t,[n,1].concat(m)),n+=m.length-1):r.content=m}}else{var g=r.content;Array.isArray(g)?e(g):e([g])}}}(d),new e.Token(r,d,"language-"+r,t)}e.languages.javascript["template-string"]=[i("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),i("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),i("svg",/\bsvg/.source),i("markdown",/\b(?:markdown|md)/.source),i("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),i("sql",/\bsql/.source),t].filter(Boolean);var d={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function f(e){return"string"==typeof e?e:Array.isArray(e)?e.map(f).join(""):f(e.content)}e.hooks.add("after-tokenize",(function(t){t.language in d&&function t(n){for(var r=0,a=n.length;r<a;r++){var o=n[r];if("string"!=typeof o){var i=o.content;if(Array.isArray(i))if("template-string"===o.type){var l=i[1];if(3===i.length&&"string"!=typeof l&&"embedded-code"===l.type){var s=f(l),c=l.alias,d=Array.isArray(c)?c[0]:c,p=e.languages[d];if(!p)continue;i[1]=u(s,p,d)}}else t(i);else"string"!=typeof i&&t([i])}}}(t.tokens)}))}(a),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(a),function(e){function t(e,t){return RegExp(e.replace(/<ID>/g,(function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source})),t)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var a=n[r],o=e.languages.javascript[a];"RegExp"===e.util.type(o)&&(o=e.languages.javascript[a]={pattern:o});var i=o.inside||{};o.inside=i,i["maybe-class-name"]=/^[A-Z][\s\S]*/}}(a),function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,a=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function o(e,t){return e=e.replace(/<S>/g,(function(){return n})).replace(/<BRACES>/g,(function(){return r})).replace(/<SPREAD>/g,(function(){return a})),RegExp(e,t)}a=o(a).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=o(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:o(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:o(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);var i=function(e){return e?"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(i).join(""):""},l=function(t){for(var n=[],r=0;r<t.length;r++){var a=t[r],o=!1;if("string"!=typeof a&&("tag"===a.type&&a.content[0]&&"tag"===a.content[0].type?"</"===a.content[0].content[0].content?n.length>0&&n[n.length-1].tagName===i(a.content[0].content[1])&&n.pop():"/>"===a.content[a.content.length-1].content||n.push({tagName:i(a.content[0].content[1]),openedBraces:0}):n.length>0&&"punctuation"===a.type&&"{"===a.content?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&"punctuation"===a.type&&"}"===a.content?n[n.length-1].openedBraces--:o=!0),(o||"string"==typeof a)&&n.length>0&&0===n[n.length-1].openedBraces){var s=i(a);r<t.length-1&&("string"==typeof t[r+1]||"plain-text"===t[r+1].type)&&(s+=i(t[r+1]),t.splice(r+1,1)),r>0&&("string"==typeof t[r-1]||"plain-text"===t[r-1].type)&&(s=i(t[r-1])+s,t.splice(r-1,1),r--),t[r]=new e.Token("plain-text",s,null,s)}a.content&&"string"!=typeof a.content&&l(a.content)}};e.hooks.add("after-tokenize",(function(e){"jsx"!==e.language&&"tsx"!==e.language||l(e.tokens)}))}(a),function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],a=[];/^\w+$/.test(n)||a.push(/\w+/.exec(n)[0]),"diff"===n&&a.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:a,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(a),a.languages.git={comment:/^#.*/m,deleted:/^[-\u2013].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/}},coord:/^@@.*@@$/m,"commit-sha1":/^commit \w{40}$/m},a.languages.go=a.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),a.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete a.languages.go["class-name"],function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,a,o){if(n.language===r){var i=n.tokenStack=[];n.code=n.code.replace(a,(function(e){if("function"==typeof o&&!o(e))return e;for(var a,l=i.length;-1!==n.code.indexOf(a=t(r,l));)++l;return i[l]=e,a})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var a=0,o=Object.keys(n.tokenStack);!function i(l){for(var s=0;s<l.length&&!(a>=o.length);s++){var c=l[s];if("string"==typeof c||c.content&&"string"==typeof c.content){var u=o[a],d=n.tokenStack[u],f="string"==typeof c?c:c.content,p=t(r,u),m=f.indexOf(p);if(m>-1){++a;var h=f.substring(0,m),g=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),b=f.substring(m+p.length),v=[];h&&v.push.apply(v,i([h])),v.push(g),b&&v.push.apply(v,i([b])),"string"==typeof c?l.splice.apply(l,[s,1].concat(v)):c.content=v}}else c.content&&i(c.content)}return l}(n.tokens)}}}})}(a),function(e){e.languages.handlebars={comment:/\{\{![\s\S]*?\}\}/,delimiter:{pattern:/^\{\{\{?|\}\}\}?$/,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][+-]?\d+)?/,boolean:/\b(?:false|true)\b/,block:{pattern:/^(\s*(?:~\s*)?)[#\/]\S+?(?=\s*(?:~\s*)?$|\s)/,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\s\S]+/}},punctuation:/[!"#%&':()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/},e.hooks.add("before-tokenize",(function(t){e.languages["markup-templating"].buildPlaceholders(t,"handlebars",/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g)})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"handlebars")})),e.languages.hbs=e.languages.handlebars}(a),a.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},a.languages.webmanifest=a.languages.json,a.languages.less=a.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),a.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}}),a.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/},a.languages.objectivec=a.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete a.languages.objectivec["class-name"],a.languages.objc=a.languages.objectivec,a.languages.ocaml={comment:{pattern:/\(\*[\s\S]*?\*\)/,greedy:!0},char:{pattern:/'(?:[^\\\r\n']|\\(?:.|[ox]?[0-9a-f]{1,3}))'/i,greedy:!0},string:[{pattern:/"(?:\\(?:[\s\S]|\r\n)|[^\\\r\n"])*"/,greedy:!0},{pattern:/\{([a-z_]*)\|[\s\S]*?\|\1\}/,greedy:!0}],number:[/\b(?:0b[01][01_]*|0o[0-7][0-7_]*)\b/i,/\b0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]*)?(?:p[+-]?\d[\d_]*)?(?!\w)/i,/\b\d[\d_]*(?:\.[\d_]*)?(?:e[+-]?\d[\d_]*)?(?!\w)/i],directive:{pattern:/\B#\w+/,alias:"property"},label:{pattern:/\B~\w+/,alias:"property"},"type-variable":{pattern:/\B'\w+/,alias:"function"},variant:{pattern:/`\w+/,alias:"symbol"},keyword:/\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|value|virtual|when|where|while|with)\b/,boolean:/\b(?:false|true)\b/,"operator-like-punctuation":{pattern:/\[[<>|]|[>|]\]|\{<|>\}/,alias:"punctuation"},operator:/\.[.~]|:[=>]|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,punctuation:/;;|::|[(){}\[\].,:;#]|\b_\b/},a.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},a.languages.python["string-interpolation"].inside.interpolation.inside.rest=a.languages.python,a.languages.py=a.languages.python,a.languages.reason=a.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),a.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete a.languages.reason.function,function(e){e.languages.sass=e.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),e.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete e.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,n=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];e.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:n}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:n,important:e.languages.sass.important}}}),delete e.languages.sass.property,delete e.languages.sass.important,e.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})}(a),a.languages.scss=a.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),a.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),a.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),a.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),a.languages.scss.atrule.inside.rest=a.languages.scss,function(e){var t={pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0},r={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},url:{pattern:/\burl\((["']?).*?\1\)/i,greedy:!0},string:{pattern:/("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/,greedy:!0},interpolation:null,func:null,important:/\B!(?:important|optional)\b/i,keyword:{pattern:/(^|\s+)(?:(?:else|for|if|return|unless)(?=\s|$)|@[\w-]+)/,lookbehind:!0},hexcode:/#[\da-f]{3,6}/i,color:[/\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i,{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,boolean:/\b(?:false|true)\b/,operator:[/~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.{2,3}|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/],number:n,punctuation:/[{}()\[\];:,]/};r.interpolation={pattern:/\{[^\r\n}:]+\}/,alias:"variable",inside:{delimiter:{pattern:/^\{|\}$/,alias:"punctuation"},rest:r}},r.func={pattern:/[\w-]+\([^)]*\).*/,inside:{function:/^[^(]+/,rest:r}},e.languages.stylus={"atrule-declaration":{pattern:/(^[ \t]*)@.+/m,lookbehind:!0,inside:{atrule:/^@[\w-]+/,rest:r}},"variable-declaration":{pattern:/(^[ \t]*)[\w$-]+\s*.?=[ \t]*(?:\{[^{}]*\}|\S.*|$)/m,lookbehind:!0,inside:{variable:/^\S+/,rest:r}},statement:{pattern:/(^[ \t]*)(?:else|for|if|return|unless)[ \t].+/m,lookbehind:!0,inside:{keyword:/^\S+/,rest:r}},"property-declaration":{pattern:/((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)(?!\s)[^{\r\n]*(?:;|[^{\r\n,]$(?!(?:\r?\n|\r)(?:\{|\2[ \t])))/m,lookbehind:!0,inside:{property:{pattern:/^[^\s:]+/,inside:{interpolation:r.interpolation}},rest:r}},selector:{pattern:/(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)))*(?:,$|\{|(?=(?:\r?\n|\r)(?:\{|\1[ \t])))/m,lookbehind:!0,inside:{interpolation:r.interpolation,comment:r.comment,punctuation:/[{},]/}},func:r.func,string:r.string,comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0,greedy:!0},interpolation:r.interpolation,punctuation:/[{}()\[\];:.]/}}(a),function(e){var t=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"];var n=e.languages.tsx.tag;n.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+n.pattern.source+")",n.pattern.flags),n.lookbehind=!0}(a),a.languages.wasm={comment:[/\(;[\s\S]*?;\)/,{pattern:/;;.*/,greedy:!0}],string:{pattern:/"(?:\\[\s\S]|[^"\\])*"/,greedy:!0},keyword:[{pattern:/\b(?:align|offset)=/,inside:{operator:/=/}},{pattern:/\b(?:(?:f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|neg?|nearest|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|sqrt|store(?:8|16|32)?|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))?|memory\.(?:grow|size))\b/,inside:{punctuation:/\./}},/\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/],variable:/\$[\w!#$%&'*+\-./:<=>?@\\^`|~]+/,number:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/,punctuation:/[()]/};const o=a},723:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(7294),a=n(7462),o=n(8356),i=n.n(o),l=n(6887);const s={"08714d8c":[()=>n.e(3922).then(n.bind(n,1597)),"@site/docs/reference/parameters.md",1597],"14f1d27f":[()=>n.e(931).then(n.bind(n,8804)),"@site/docs/reference/cli/orchestrator.md",8804],17896441:[()=>Promise.all([n.e(532),n.e(7918)]).then(n.bind(n,3230)),"@theme/DocItem",3230],"1a4e3797":[()=>Promise.all([n.e(532),n.e(7920)]).then(n.bind(n,6675)),"@theme/SearchPage",6675],"1ae06ce2":[()=>Promise.all([n.e(532),n.e(180),n.e(2432)]).then(n.bind(n,9874)),"@site/docs/reference/web-proxy-api.mdx",9874],"1b039142":[()=>n.e(2147).then(n.bind(n,9615)),"@site/docs/guide/tutorial/advanced-tutorials/7-web-client.md",9615],"1be78505":[()=>Promise.all([n.e(532),n.e(9514)]).then(n.bind(n,9963)),"@theme/DocPage",9963],"1d042041":[()=>n.e(5767).then(n.t.bind(n,7085,19)),"/builds/ai-r/cogment/cogment-doc/.docusaurus/docusaurus-theme-search-algolia/default/plugin-route-context-module-100.json",7085],"25848ff4":[()=>n.e(8403).then(n.bind(n,3349)),"@site/docs/reference/python-enterprise/installation.md",3349],"2d986b69":[()=>n.e(8769).then(n.bind(n,5161)),"@site/docs/reference/python.md",5161],"354f5e12":[()=>Promise.all([n.e(532),n.e(9071)]).then(n.bind(n,3056)),"@site/docs/guide/development-guide.mdx",3056],"3f8274eb":[()=>n.e(9690).then(n.bind(n,555)),"@site/docs/reference/cli/status.md",555],"4f085710":[()=>n.e(9921).then(n.bind(n,9967)),"@site/docs/guide/tutorial/index.md",9967],"50751b0a":[()=>n.e(8687).then(n.bind(n,9772)),"@site/docs/reference/cli/directory/directory-server.md",9772],"5e9f5e1a":[()=>Promise.resolve().then(n.bind(n,6809)),"@generated/docusaurus.config",6809],"61fcde8c":[()=>n.e(5171).then(n.bind(n,1975)),"@site/docs/reference/python-enterprise/runner.md",1975],"696a412b":[()=>n.e(928).then(n.bind(n,7113)),"@site/docs/reference/cli/trial-datastore/trial-datastore-server.md",7113],"6c6cf206":[()=>n.e(966).then(n.bind(n,1291)),"@site/docs/guide/implementation-recipes/index.md",1291],"6f2832ad":[()=>n.e(5307).then(n.bind(n,6421)),"@site/docs/guide/tutorial/advanced-tutorials/index.md",6421],"710eddd2":[()=>n.e(7221).then(n.bind(n,1167)),"@site/docs/reference/cli/directory/directory-client.md",1167],"76d0d1d8":[()=>n.e(1257).then(n.bind(n,8113)),"@site/docs/guide/tutorial/advanced-tutorials/8-directory.md",8113],"7a87d372":[()=>n.e(3953).then(n.bind(n,3031)),"@site/docs/reference/cogment-yaml.md",3031],"80b5be58":[()=>n.e(1028).then(n.bind(n,2383)),"@site/docs/guide/tutorial/2-actors-in-cogment.md",2383],"85f318fb":[()=>n.e(4896).then(n.bind(n,2781)),"@site/docs/guide/tutorial/1-setup.md",2781],"8ba33b25":[()=>Promise.all([n.e(532),n.e(1744),n.e(9985)]).then(n.bind(n,2900)),"@site/src/pages/cogment_verse/index.js",2900],"8f51b104":[()=>n.e(7330).then(n.bind(n,8009)),"@site/docs/reference/javascript.md",8009],"8f68e2ce":[()=>n.e(5089).then(n.bind(n,5432)),"@site/docs/reference/cli/launch.md",5432],"92a77eef":[()=>n.e(5505).then(n.bind(n,9214)),"@site/docs/reference/cogment-v2-changes.md",9214],"935f2afb":[()=>n.e(53).then(n.t.bind(n,1109,19)),"~docs/default/version-current-metadata-prop-751.json",1109],"9b35c4f5":[()=>n.e(9255).then(n.bind(n,562)),"@site/docs/community-channels.md",562],"9b824c8f":[()=>n.e(2880).then(n.bind(n,2406)),"@site/docs/guide/core-concepts.md",2406],a57d321a:[()=>n.e(916).then(n.bind(n,5676)),"@site/docs/reference/cli/model-registry.md",5676],ac5280f2:[()=>n.e(8529).then(n.bind(n,5687)),"@site/docs/license.md",5687],b2327a6c:[()=>n.e(1909).then(n.bind(n,251)),"@site/docs/reference/cli/trial-datastore/trial-datastore-client.md",251],be6d912d:[()=>n.e(7107).then(n.t.bind(n,3769,19)),"/builds/ai-r/cogment/cogment-doc/.docusaurus/docusaurus-plugin-content-docs/default/plugin-route-context-module-100.json",3769],c0fe6564:[()=>n.e(5649).then(n.t.bind(n,5745,19)),"/builds/ai-r/cogment/cogment-doc/.docusaurus/docusaurus-plugin-content-pages/default/plugin-route-context-module-100.json",5745],c24ec994:[()=>n.e(5519).then(n.bind(n,4985)),"@site/docs/guide/tutorial/4-decision-making.md",4985],c377a04b:[()=>n.e(6971).then(n.bind(n,1269)),"@site/docs/index.md",1269],c3c15305:[()=>n.e(1043).then(n.bind(n,3706)),"@site/docs/reference/cli/index.md",3706],c4f5d8e4:[()=>Promise.all([n.e(532),n.e(1744),n.e(4195)]).then(n.bind(n,4825)),"@site/src/pages/index.js",4825],d03751be:[()=>n.e(1455).then(n.bind(n,9262)),"@site/docs/reference/cli/web-proxy.md",9262],d04964af:[()=>n.e(5893).then(n.bind(n,6111)),"@site/docs/reference/grpc.md",6111],d9378b29:[()=>n.e(4007).then(n.bind(n,4489)),"@site/docs/guide/tutorial/advanced-tutorials/6-human-player.md",4489],e848be99:[()=>n.e(8172).then(n.bind(n,9208)),"@site/docs/guide/tutorial/3-environment-in-cogment.md",9208],f012f959:[()=>n.e(2229).then(n.bind(n,4352)),"@site/docs/guide/implementation-recipes/configure-trial-from-controller.md",4352],fd5e6f38:[()=>n.e(3106).then(n.bind(n,845)),"@site/docs/guide/implementation-recipes/v2-migration-guide.md",845]};function c(e){let{error:t,retry:n,pastDelay:a}=e;return t?r.createElement("div",{style:{textAlign:"center",color:"#fff",backgroundColor:"#fa383e",borderColor:"#fa383e",borderStyle:"solid",borderRadius:"0.25rem",borderWidth:"1px",boxSizing:"border-box",display:"block",padding:"1rem",flex:"0 0 50%",marginLeft:"25%",marginRight:"25%",marginTop:"5rem",maxWidth:"50%",width:"100%"}},r.createElement("p",null,String(t)),r.createElement("div",null,r.createElement("button",{type:"button",onClick:n},"Retry"))):a?r.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"}},r.createElement("svg",{id:"loader",style:{width:128,height:110,position:"absolute",top:"calc(100vh - 64%)"},viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",stroke:"#61dafb"},r.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1)",strokeWidth:"2"},r.createElement("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0"},r.createElement("animate",{attributeName:"r",begin:"1.5s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-opacity",begin:"1.5s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-width",begin:"1.5s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})),r.createElement("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0"},r.createElement("animate",{attributeName:"r",begin:"3s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-opacity",begin:"3s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-width",begin:"3s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})),r.createElement("circle",{cx:"22",cy:"22",r:"8"},r.createElement("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"6;1;2;3;4;5;6",calcMode:"linear",repeatCount:"indefinite"}))))):null}var u=n(9670),d=n(226);function f(e,t){if("*"===e)return i()({loading:c,loader:()=>n.e(4972).then(n.bind(n,4972)),modules:["@theme/NotFound"],webpack:()=>[4972],render(e,t){const n=e.default;return r.createElement(d.z,{value:{plugin:{name:"native",id:"default"}}},r.createElement(n,t))}});const o=l[`${e}-${t}`],f={},p=[],m=[],h=(0,u.Z)(o);return Object.entries(h).forEach((e=>{let[t,n]=e;const r=s[n];r&&(f[t]=r[0],p.push(r[1]),m.push(r[2]))})),i().Map({loading:c,loader:f,modules:p,webpack:()=>m,render(t,n){const i=JSON.parse(JSON.stringify(o));Object.entries(t).forEach((t=>{let[n,r]=t;const a=r.default;if(!a)throw new Error(`The page component at ${e} doesn't have a default export. This makes it impossible to render anything. Consider default-exporting a React component.`);"object"!=typeof a&&"function"!=typeof a||Object.keys(r).filter((e=>"default"!==e)).forEach((e=>{a[e]=r[e]}));let o=i;const l=n.split(".");l.slice(0,-1).forEach((e=>{o=o[e]})),o[l[l.length-1]]=a}));const l=i.__comp;delete i.__comp;const s=i.__context;return delete i.__context,r.createElement(d.z,{value:s},r.createElement(l,(0,a.Z)({},i,n)))}})}const p=[{path:"/cogment_verse",component:f("/cogment_verse","238"),exact:!0},{path:"/search",component:f("/search","b08"),exact:!0},{path:"/docs",component:f("/docs","106"),routes:[{path:"/docs",component:f("/docs","f31"),exact:!0,sidebar:"docSidebar"},{path:"/docs/community-channels",component:f("/docs/community-channels","fe1"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/core-concepts",component:f("/docs/guide/core-concepts","4f9"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/development-guide",component:f("/docs/guide/development-guide","213"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/implementation-recipes",component:f("/docs/guide/implementation-recipes","3dc"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/implementation-recipes/configure-trial-from-controller",component:f("/docs/guide/implementation-recipes/configure-trial-from-controller","6e2"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/implementation-recipes/v2-migration-guide",component:f("/docs/guide/implementation-recipes/v2-migration-guide","024"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/tutorial",component:f("/docs/guide/tutorial","4db"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/tutorial/actors-in-cogment",component:f("/docs/guide/tutorial/actors-in-cogment","ffe"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/tutorial/advanced-tutorials",component:f("/docs/guide/tutorial/advanced-tutorials","c3b"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/tutorial/advanced-tutorials/directory",component:f("/docs/guide/tutorial/advanced-tutorials/directory","162"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/tutorial/advanced-tutorials/human-player",component:f("/docs/guide/tutorial/advanced-tutorials/human-player","34b"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/tutorial/advanced-tutorials/web-client",component:f("/docs/guide/tutorial/advanced-tutorials/web-client","878"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/tutorial/decision-making",component:f("/docs/guide/tutorial/decision-making","f36"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/tutorial/environment-in-cogment",component:f("/docs/guide/tutorial/environment-in-cogment","bea"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/tutorial/setup",component:f("/docs/guide/tutorial/setup","a29"),exact:!0,sidebar:"docSidebar"},{path:"/docs/license",component:f("/docs/license","f2d"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cli",component:f("/docs/reference/cli","59e"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cli/directory/directory-client",component:f("/docs/reference/cli/directory/directory-client","4f4"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cli/directory/directory-server",component:f("/docs/reference/cli/directory/directory-server","705"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cli/launch",component:f("/docs/reference/cli/launch","548"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cli/model-registry",component:f("/docs/reference/cli/model-registry","16c"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cli/orchestrator",component:f("/docs/reference/cli/orchestrator","962"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cli/status",component:f("/docs/reference/cli/status","77f"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cli/trial-datastore/trial-datastore-client",component:f("/docs/reference/cli/trial-datastore/trial-datastore-client","255"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cli/trial-datastore/trial-datastore-server",component:f("/docs/reference/cli/trial-datastore/trial-datastore-server","436"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cli/web-proxy",component:f("/docs/reference/cli/web-proxy","f0b"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cogment-v2-changes",component:f("/docs/reference/cogment-v2-changes","452"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cogment-yaml",component:f("/docs/reference/cogment-yaml","d31"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/grpc",component:f("/docs/reference/grpc","407"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/javascript",component:f("/docs/reference/javascript","4e0"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/parameters",component:f("/docs/reference/parameters","f82"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/python",component:f("/docs/reference/python","d04"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/python-enterprise/installation",component:f("/docs/reference/python-enterprise/installation","3b7"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/python-enterprise/runner",component:f("/docs/reference/python-enterprise/runner","277"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/web-proxy-api",component:f("/docs/reference/web-proxy-api","943"),exact:!0,sidebar:"docSidebar"}]},{path:"/",component:f("/","7f6"),exact:!0},{path:"*",component:f("*")}]},8934:(e,t,n)=>{"use strict";n.d(t,{_:()=>a,t:()=>o});var r=n(7294);const a=r.createContext(!1);function o(e){let{children:t}=e;const[n,o]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{o(!0)}),[]),r.createElement(a.Provider,{value:n},t)}},7221:(e,t,n)=>{"use strict";var r=n(7294),a=n(3935),o=n(3727),i=n(405),l=n(412);const s=[n(4367),n(2497),n(3310),n(8320),n(2295)];var c=n(723),u=n(6550),d=n(8790);function f(e){let{children:t}=e;return r.createElement(r.Fragment,null,t)}var p=n(7462),m=n(5742),h=n(2263),g=n(4996),b=n(6668),v=n(833),y=n(4711),w=n(9727),k=n(3320),E=n(8780),S=n(197);function x(){const{i18n:{defaultLocale:e,localeConfigs:t}}=(0,h.Z)(),n=(0,y.l)();return r.createElement(m.Z,null,Object.entries(t).map((e=>{let[t,{htmlLang:a}]=e;return r.createElement("link",{key:t,rel:"alternate",href:n.createUrl({locale:t,fullyQualified:!0}),hrefLang:a})})),r.createElement("link",{rel:"alternate",href:n.createUrl({locale:e,fullyQualified:!0}),hrefLang:"x-default"}))}function C(e){let{permalink:t}=e;const{siteConfig:{url:n}}=(0,h.Z)(),a=function(){const{siteConfig:{url:e,baseUrl:t,trailingSlash:n}}=(0,h.Z)(),{pathname:r}=(0,u.TH)();return e+(0,E.applyTrailingSlash)((0,g.Z)(r),{trailingSlash:n,baseUrl:t})}(),o=t?`${n}${t}`:a;return r.createElement(m.Z,null,r.createElement("meta",{property:"og:url",content:o}),r.createElement("link",{rel:"canonical",href:o}))}function T(){const{i18n:{currentLocale:e}}=(0,h.Z)(),{metadata:t,image:n}=(0,b.L)();return r.createElement(r.Fragment,null,r.createElement(m.Z,null,r.createElement("meta",{name:"twitter:card",content:"summary_large_image"}),r.createElement("body",{className:w.h})),n&&r.createElement(v.d,{image:n}),r.createElement(C,null),r.createElement(x,null),r.createElement(S.Z,{tag:k.HX,locale:e}),r.createElement(m.Z,null,t.map(((e,t)=>r.createElement("meta",(0,p.Z)({key:t},e))))))}const _=new Map;function A(e){if(_.has(e.pathname))return{...e,pathname:_.get(e.pathname)};if((0,d.f)(c.Z,e.pathname).some((e=>{let{route:t}=e;return!0===t.exact})))return _.set(e.pathname,e.pathname),e;const t=e.pathname.trim().replace(/(?:\/index)?\.html$/,"")||"/";return _.set(e.pathname,t),{...e,pathname:t}}var L=n(8934),R=n(8940);function P(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const a=s.map((t=>{const r=t.default?.[e]??t[e];return r?.(...n)}));return()=>a.forEach((e=>e?.()))}const N=function(e){let{children:t,location:n,previousLocation:a}=e;return(0,r.useLayoutEffect)((()=>{a!==n&&(!function(e){let{location:t,previousLocation:n}=e;if(!n)return;const r=t.pathname===n.pathname,a=t.hash===n.hash,o=t.search===n.search;if(r&&a&&!o)return;const{hash:i}=t;if(i){const e=decodeURIComponent(i.substring(1)),t=document.getElementById(e);t?.scrollIntoView()}else window.scrollTo(0,0)}({location:n,previousLocation:a}),P("onRouteDidUpdate",{previousLocation:a,location:n}))}),[a,n]),t};function O(e){const t=Array.from(new Set([e,decodeURI(e)])).map((e=>(0,d.f)(c.Z,e))).flat();return Promise.all(t.map((e=>e.route.component.preload?.())))}class I extends r.Component{previousLocation;routeUpdateCleanupCb;constructor(e){super(e),this.previousLocation=null,this.routeUpdateCleanupCb=l.Z.canUseDOM?P("onRouteUpdate",{previousLocation:null,location:this.props.location}):()=>{},this.state={nextRouteHasLoaded:!0}}shouldComponentUpdate(e,t){if(e.location===this.props.location)return t.nextRouteHasLoaded;const n=e.location;return this.previousLocation=this.props.location,this.setState({nextRouteHasLoaded:!1}),this.routeUpdateCleanupCb=P("onRouteUpdate",{previousLocation:this.previousLocation,location:n}),O(n.pathname).then((()=>{this.routeUpdateCleanupCb(),this.setState({nextRouteHasLoaded:!0})})).catch((e=>{console.warn(e),window.location.reload()})),!1}render(){const{children:e,location:t}=this.props;return r.createElement(N,{previousLocation:this.previousLocation,location:t},r.createElement(u.AW,{location:t,render:()=>e}))}}const D=I,M="__docusaurus-base-url-issue-banner-container",F="__docusaurus-base-url-issue-banner",B="__docusaurus-base-url-issue-banner-suggestion-container",j="__DOCUSAURUS_INSERT_BASEURL_BANNER";function z(e){return`\nwindow['${j}'] = true;\n\ndocument.addEventListener('DOMContentLoaded', maybeInsertBanner);\n\nfunction maybeInsertBanner() {\n var shouldInsert = window['${j}'];\n shouldInsert && insertBanner();\n}\n\nfunction insertBanner() {\n var bannerContainer = document.getElementById('${M}');\n if (!bannerContainer) {\n return;\n }\n var bannerHtml = ${JSON.stringify(function(e){return`\n<div id="${F}" style="border: thick solid red; background-color: rgb(255, 230, 179); margin: 20px; padding: 20px; font-size: 20px;">\n <p style="font-weight: bold; font-size: 30px;">Your Docusaurus site did not load properly.</p>\n <p>A very common reason is a wrong site <a href="https://docusaurus.io/docs/docusaurus.config.js/#baseUrl" style="font-weight: bold;">baseUrl configuration</a>.</p>\n <p>Current configured baseUrl = <span style="font-weight: bold; color: red;">${e}</span> ${"/"===e?" (default value)":""}</p>\n <p>We suggest trying baseUrl = <span id="${B}" style="font-weight: bold; color: green;"></span></p>\n</div>\n`}(e)).replace(/</g,"\\<")};\n bannerContainer.innerHTML = bannerHtml;\n var suggestionContainer = document.getElementById('${B}');\n var actualHomePagePath = window.location.pathname;\n var suggestedBaseUrl = actualHomePagePath.substr(-1) === '/'\n ? actualHomePagePath\n : actualHomePagePath + '/';\n suggestionContainer.innerHTML = suggestedBaseUrl;\n}\n`}function U(){const{siteConfig:{baseUrl:e}}=(0,h.Z)();return(0,r.useLayoutEffect)((()=>{window[j]=!1}),[]),r.createElement(r.Fragment,null,!l.Z.canUseDOM&&r.createElement(m.Z,null,r.createElement("script",null,z(e))),r.createElement("div",{id:M}))}function $(){const{siteConfig:{baseUrl:e,baseUrlIssueBanner:t}}=(0,h.Z)(),{pathname:n}=(0,u.TH)();return t&&n===e?r.createElement(U,null):null}function q(){const{siteConfig:{favicon:e,title:t,noIndex:n},i18n:{currentLocale:a,localeConfigs:o}}=(0,h.Z)(),i=(0,g.Z)(e),{htmlLang:l,direction:s}=o[a];return r.createElement(m.Z,null,r.createElement("html",{lang:l,dir:s}),r.createElement("title",null,t),r.createElement("meta",{property:"og:title",content:t}),r.createElement("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0"}),n&&r.createElement("meta",{name:"robots",content:"noindex, nofollow"}),e&&r.createElement("link",{rel:"icon",href:i}))}var H=n(4763),G=n(2389);function Z(){const e=(0,G.Z)();return r.createElement(m.Z,null,r.createElement("html",{"data-has-hydrated":e}))}function V(){const e=(0,d.H)(c.Z),t=(0,u.TH)();return r.createElement(H.Z,null,r.createElement(R.M,null,r.createElement(L.t,null,r.createElement(f,null,r.createElement(q,null),r.createElement(T,null),r.createElement($,null),r.createElement(D,{location:A(t)},e)),r.createElement(Z,null))))}var W=n(6887);const K=function(e){try{return document.createElement("link").relList.supports(e)}catch{return!1}}("prefetch")?function(e){return new Promise(((t,n)=>{if("undefined"==typeof document)return void n();const r=document.createElement("link");r.setAttribute("rel","prefetch"),r.setAttribute("href",e),r.onload=()=>t(),r.onerror=()=>n();const a=document.getElementsByTagName("head")[0]??document.getElementsByName("script")[0]?.parentNode;a?.appendChild(r)}))}:function(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),r.withCredentials=!0,r.onload=()=>{200===r.status?t():n()},r.send(null)}))};var Y=n(9670);const Q=new Set,X=new Set,J=()=>navigator.connection?.effectiveType.includes("2g")||navigator.connection?.saveData,ee={prefetch(e){if(!(e=>!J()&&!X.has(e)&&!Q.has(e))(e))return!1;Q.add(e);const t=(0,d.f)(c.Z,e).flatMap((e=>{return t=e.route.path,Object.entries(W).filter((e=>{let[n]=e;return n.replace(/-[^-]+$/,"")===t})).flatMap((e=>{let[,t]=e;return Object.values((0,Y.Z)(t))}));var t}));return Promise.all(t.map((e=>{const t=n.gca(e);return t&&!t.includes("undefined")?K(t).catch((()=>{})):Promise.resolve()})))},preload:e=>!!(e=>!J()&&!X.has(e))(e)&&(X.add(e),O(e))},te=Object.freeze(ee);if(l.Z.canUseDOM){window.docusaurus=te;const e=a.hydrate;O(window.location.pathname).then((()=>{e(r.createElement(i.B6,null,r.createElement(o.VK,null,r.createElement(V,null))),document.getElementById("__docusaurus"))}))}},8940:(e,t,n)=>{"use strict";n.d(t,{_:()=>u,M:()=>d});var r=n(7294),a=n(6809);const o=JSON.parse('{"docusaurus-plugin-content-docs":{"default":{"path":"/docs","versions":[{"name":"current","label":"Next","isLast":true,"path":"/docs","mainDocId":"index","docs":[{"id":"community-channels","path":"/docs/community-channels","sidebar":"docSidebar"},{"id":"guide/core-concepts","path":"/docs/guide/core-concepts","sidebar":"docSidebar"},{"id":"guide/development-guide","path":"/docs/guide/development-guide","sidebar":"docSidebar"},{"id":"guide/implementation-recipes/configure-trial-from-controller","path":"/docs/guide/implementation-recipes/configure-trial-from-controller","sidebar":"docSidebar"},{"id":"guide/implementation-recipes/index","path":"/docs/guide/implementation-recipes/","sidebar":"docSidebar"},{"id":"guide/implementation-recipes/v2-migration-guide","path":"/docs/guide/implementation-recipes/v2-migration-guide","sidebar":"docSidebar"},{"id":"guide/tutorial/actors-in-cogment","path":"/docs/guide/tutorial/actors-in-cogment","sidebar":"docSidebar"},{"id":"guide/tutorial/advanced-tutorials/directory","path":"/docs/guide/tutorial/advanced-tutorials/directory","sidebar":"docSidebar"},{"id":"guide/tutorial/advanced-tutorials/human-player","path":"/docs/guide/tutorial/advanced-tutorials/human-player","sidebar":"docSidebar"},{"id":"guide/tutorial/advanced-tutorials/index","path":"/docs/guide/tutorial/advanced-tutorials/","sidebar":"docSidebar"},{"id":"guide/tutorial/advanced-tutorials/web-client","path":"/docs/guide/tutorial/advanced-tutorials/web-client","sidebar":"docSidebar"},{"id":"guide/tutorial/decision-making","path":"/docs/guide/tutorial/decision-making","sidebar":"docSidebar"},{"id":"guide/tutorial/environment-in-cogment","path":"/docs/guide/tutorial/environment-in-cogment","sidebar":"docSidebar"},{"id":"guide/tutorial/index","path":"/docs/guide/tutorial/","sidebar":"docSidebar"},{"id":"guide/tutorial/setup","path":"/docs/guide/tutorial/setup","sidebar":"docSidebar"},{"id":"index","path":"/docs/","sidebar":"docSidebar"},{"id":"license","path":"/docs/license","sidebar":"docSidebar"},{"id":"reference/cli/directory/directory-client","path":"/docs/reference/cli/directory/directory-client","sidebar":"docSidebar"},{"id":"reference/cli/directory/directory-server","path":"/docs/reference/cli/directory/directory-server","sidebar":"docSidebar"},{"id":"reference/cli/index","path":"/docs/reference/cli/","sidebar":"docSidebar"},{"id":"reference/cli/launch","path":"/docs/reference/cli/launch","sidebar":"docSidebar"},{"id":"reference/cli/model-registry","path":"/docs/reference/cli/model-registry","sidebar":"docSidebar"},{"id":"reference/cli/orchestrator","path":"/docs/reference/cli/orchestrator","sidebar":"docSidebar"},{"id":"reference/cli/status","path":"/docs/reference/cli/status","sidebar":"docSidebar"},{"id":"reference/cli/trial-datastore/trial-datastore-client","path":"/docs/reference/cli/trial-datastore/trial-datastore-client","sidebar":"docSidebar"},{"id":"reference/cli/trial-datastore/trial-datastore-server","path":"/docs/reference/cli/trial-datastore/trial-datastore-server","sidebar":"docSidebar"},{"id":"reference/cli/web-proxy","path":"/docs/reference/cli/web-proxy","sidebar":"docSidebar"},{"id":"reference/cogment-v2-changes","path":"/docs/reference/cogment-v2-changes","sidebar":"docSidebar"},{"id":"reference/cogment-yaml","path":"/docs/reference/cogment-yaml","sidebar":"docSidebar"},{"id":"reference/grpc","path":"/docs/reference/grpc","sidebar":"docSidebar"},{"id":"reference/javascript","path":"/docs/reference/javascript","sidebar":"docSidebar"},{"id":"reference/parameters","path":"/docs/reference/parameters","sidebar":"docSidebar"},{"id":"reference/python","path":"/docs/reference/python","sidebar":"docSidebar"},{"id":"reference/python-enterprise/installation","path":"/docs/reference/python-enterprise/installation","sidebar":"docSidebar"},{"id":"reference/python-enterprise/runner","path":"/docs/reference/python-enterprise/runner","sidebar":"docSidebar"},{"id":"reference/web-proxy-api","path":"/docs/reference/web-proxy-api","sidebar":"docSidebar"}],"draftIds":[],"sidebars":{"docSidebar":{"link":{"path":"/docs/","label":"index"}}}}],"breadcrumbs":true}}}'),i=JSON.parse('{"defaultLocale":"en","locales":["en"],"path":"i18n","currentLocale":"en","localeConfigs":{"en":{"label":"English","direction":"ltr","htmlLang":"en","calendar":"gregory","path":"en"}}}');var l=n(7529);const s=JSON.parse('{"docusaurusVersion":"2.4.3","pluginVersions":{"docusaurus-plugin-content-docs":{"type":"package","name":"@docusaurus/plugin-content-docs","version":"2.4.3"},"docusaurus-plugin-content-pages":{"type":"package","name":"@docusaurus/plugin-content-pages","version":"2.4.3"},"docusaurus-plugin-google-analytics":{"type":"package","name":"@docusaurus/plugin-google-analytics","version":"2.4.3"},"docusaurus-plugin-sitemap":{"type":"package","name":"@docusaurus/plugin-sitemap","version":"2.4.3"},"docusaurus-theme-classic":{"type":"package","name":"@docusaurus/theme-classic","version":"2.4.3"},"docusaurus-theme-search-algolia":{"type":"package","name":"@docusaurus/theme-search-algolia","version":"2.4.3"},"cogment-web-proxy-openapi":{"type":"project"}}}'),c={siteConfig:a.default,siteMetadata:s,globalData:o,i18n:i,codeTranslations:l},u=r.createContext(c);function d(e){let{children:t}=e;return r.createElement(u.Provider,{value:c},t)}},4763:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(7294),a=n(412),o=n(5742),i=n(8780),l=n(7452);function s(e){let{error:t,tryAgain:n}=e;return r.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",minHeight:"100vh",width:"100%",maxWidth:"80ch",fontSize:"20px",margin:"0 auto",padding:"1rem"}},r.createElement("h1",{style:{fontSize:"3rem"}},"This page crashed"),r.createElement("button",{type:"button",onClick:n,style:{margin:"1rem 0",fontSize:"2rem",cursor:"pointer",borderRadius:20,padding:"1rem"}},"Try again"),r.createElement(c,{error:t}))}function c(e){let{error:t}=e;const n=(0,i.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return r.createElement("p",{style:{whiteSpace:"pre-wrap"}},n)}function u(e){let{error:t,tryAgain:n}=e;return r.createElement(f,{fallback:()=>r.createElement(s,{error:t,tryAgain:n})},r.createElement(o.Z,null,r.createElement("title",null,"Page Error")),r.createElement(l.Z,null,r.createElement(s,{error:t,tryAgain:n})))}const d=e=>r.createElement(u,e);class f extends r.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){a.Z.canUseDOM&&this.setState({error:e})}render(){const{children:e}=this.props,{error:t}=this.state;if(t){const e={error:t,tryAgain:()=>this.setState({error:null})};return(this.props.fallback??d)(e)}return e??null}}},412:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});const r="undefined"!=typeof window&&"document"in window&&"createElement"in window.document,a={canUseDOM:r,canUseEventListeners:r&&("addEventListener"in window||"attachEvent"in window),canUseIntersectionObserver:r&&"IntersectionObserver"in window,canUseViewport:r&&"screen"in window}},5742:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294),a=n(405);function o(e){return r.createElement(a.ql,e)}},9960:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(7462),a=n(7294),o=n(3727),i=n(8780),l=n(2263),s=n(3919),c=n(412);const u=a.createContext({collectLink:()=>{}});var d=n(4996);function f(e,t){let{isNavLink:n,to:f,href:p,activeClassName:m,isActive:h,"data-noBrokenLinkCheck":g,autoAddBaseUrl:b=!0,...v}=e;const{siteConfig:{trailingSlash:y,baseUrl:w}}=(0,l.Z)(),{withBaseUrl:k}=(0,d.C)(),E=(0,a.useContext)(u),S=(0,a.useRef)(null);(0,a.useImperativeHandle)(t,(()=>S.current));const x=f||p;const C=(0,s.Z)(x),T=x?.replace("pathname://","");let _=void 0!==T?(A=T,b&&(e=>e.startsWith("/"))(A)?k(A):A):void 0;var A;_&&C&&(_=(0,i.applyTrailingSlash)(_,{trailingSlash:y,baseUrl:w}));const L=(0,a.useRef)(!1),R=n?o.OL:o.rU,P=c.Z.canUseIntersectionObserver,N=(0,a.useRef)(),O=()=>{L.current||null==_||(window.docusaurus.preload(_),L.current=!0)};(0,a.useEffect)((()=>(!P&&C&&null!=_&&window.docusaurus.prefetch(_),()=>{P&&N.current&&N.current.disconnect()})),[N,_,P,C]);const I=_?.startsWith("#")??!1,D=!_||!C||I;return D||g||E.collectLink(_),D?a.createElement("a",(0,r.Z)({ref:S,href:_},x&&!C&&{target:"_blank",rel:"noopener noreferrer"},v)):a.createElement(R,(0,r.Z)({},v,{onMouseEnter:O,onTouchStart:O,innerRef:e=>{S.current=e,P&&e&&C&&(N.current=new window.IntersectionObserver((t=>{t.forEach((t=>{e===t.target&&(t.isIntersecting||t.intersectionRatio>0)&&(N.current.unobserve(e),N.current.disconnect(),null!=_&&window.docusaurus.prefetch(_))}))})),N.current.observe(e))},to:_},n&&{isActive:h,activeClassName:m}))}const p=a.forwardRef(f)},5999:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s,I:()=>l});var r=n(7294);function a(e,t){const n=e.split(/(\{\w+\})/).map(((e,n)=>{if(n%2==1){const n=t?.[e.slice(1,-1)];if(void 0!==n)return n}return e}));return n.some((e=>(0,r.isValidElement)(e)))?n.map(((e,t)=>(0,r.isValidElement)(e)?r.cloneElement(e,{key:t}):e)).filter((e=>""!==e)):n.join("")}var o=n(7529);function i(e){let{id:t,message:n}=e;if(void 0===t&&void 0===n)throw new Error("Docusaurus translation declarations must have at least a translation id or a default translation message");return o[t??n]??n??t}function l(e,t){let{message:n,id:r}=e;return a(i({message:n,id:r}),t)}function s(e){let{children:t,id:n,values:o}=e;if(t&&"string"!=typeof t)throw console.warn("Illegal <Translate> children",t),new Error("The Docusaurus <Translate> component only accept simple string values");const l=i({message:t,id:n});return r.createElement(r.Fragment,null,a(l,o))}},9935:(e,t,n)=>{"use strict";n.d(t,{m:()=>r});const r="default"},3919:(e,t,n)=>{"use strict";function r(e){return/^(?:\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,{Z:()=>a,b:()=>r})},4996:(e,t,n)=>{"use strict";n.d(t,{C:()=>i,Z:()=>l});var r=n(7294),a=n(2263),o=n(3919);function i(){const{siteConfig:{baseUrl:e,url:t}}=(0,a.Z)(),n=(0,r.useCallback)(((n,r)=>function(e,t,n,r){let{forcePrependBaseUrl:a=!1,absolute:i=!1}=void 0===r?{}:r;if(!n||n.startsWith("#")||(0,o.b)(n))return n;if(a)return t+n.replace(/^\//,"");if(n===t.replace(/\/$/,""))return t;const l=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+l:l}(t,e,n,r)),[t,e]);return{withBaseUrl:n}}function l(e,t){void 0===t&&(t={});const{withBaseUrl:n}=i();return n(e,t)}},2263:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294),a=n(8940);function o(){return(0,r.useContext)(a._)}},2389:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294),a=n(8934);function o(){return(0,r.useContext)(a._)}},9670:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});const r=e=>"object"==typeof e&&!!e&&Object.keys(e).length>0;function a(e){const t={};return function e(n,a){Object.entries(n).forEach((n=>{let[o,i]=n;const l=a?`${a}.${o}`:o;r(i)?e(i,l):t[l]=i}))}(e),t}},226:(e,t,n)=>{"use strict";n.d(t,{_:()=>a,z:()=>o});var r=n(7294);const a=r.createContext(null);function o(e){let{children:t,value:n}=e;const o=r.useContext(a),i=(0,r.useMemo)((()=>function(e){let{parent:t,value:n}=e;if(!t){if(!n)throw new Error("Unexpected: no Docusaurus route context found");if(!("plugin"in n))throw new Error("Unexpected: Docusaurus topmost route context has no `plugin` attribute");return n}const r={...t.data,...n?.data};return{plugin:t.plugin,data:r}}({parent:o,value:n})),[o,n]);return r.createElement(a.Provider,{value:i},t)}},143:(e,t,n)=>{"use strict";n.d(t,{Iw:()=>b,gA:()=>p,WS:()=>m,_r:()=>d,Jo:()=>v,zh:()=>f,yW:()=>g,gB:()=>h});var r=n(6550),a=n(2263),o=n(9935);function i(e,t){void 0===t&&(t={});const n=function(){const{globalData:e}=(0,a.Z)();return e}()[e];if(!n&&t.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin.`);return n}const l=e=>e.versions.find((e=>e.isLast));function s(e,t){const n=l(e);return[...e.versions.filter((e=>e!==n)),n].find((e=>!!(0,r.LX)(t,{path:e.path,exact:!1,strict:!1})))}function c(e,t){const n=s(e,t),a=n?.docs.find((e=>!!(0,r.LX)(t,{path:e.path,exact:!0,strict:!1})));return{activeVersion:n,activeDoc:a,alternateDocVersions:a?function(t){const n={};return e.versions.forEach((e=>{e.docs.forEach((r=>{r.id===t&&(n[e.name]=r)}))})),n}(a.id):{}}}const u={},d=()=>i("docusaurus-plugin-content-docs")??u,f=e=>function(e,t,n){void 0===t&&(t=o.m),void 0===n&&(n={});const r=i(e),a=r?.[t];if(!a&&n.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin with id "${t}".`);return a}("docusaurus-plugin-content-docs",e,{failfast:!0});function p(e){void 0===e&&(e={});const t=d(),{pathname:n}=(0,r.TH)();return function(e,t,n){void 0===n&&(n={});const a=Object.entries(e).sort(((e,t)=>t[1].path.localeCompare(e[1].path))).find((e=>{let[,n]=e;return!!(0,r.LX)(t,{path:n.path,exact:!1,strict:!1})})),o=a?{pluginId:a[0],pluginData:a[1]}:void 0;if(!o&&n.failfast)throw new Error(`Can't find active docs plugin for "${t}" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(e).map((e=>e.path)).join(", ")}`);return o}(t,n,e)}function m(e){void 0===e&&(e={});const t=p(e),{pathname:n}=(0,r.TH)();if(!t)return;return{activePlugin:t,activeVersion:s(t.pluginData,n)}}function h(e){return f(e).versions}function g(e){const t=f(e);return l(t)}function b(e){const t=f(e),{pathname:n}=(0,r.TH)();return c(t,n)}function v(e){const t=f(e),{pathname:n}=(0,r.TH)();return function(e,t){const n=l(e);return{latestDocSuggestion:c(e,t).alternateDocVersions[n.name],latestVersionSuggestion:n}}(t,n)}},4367:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={onRouteDidUpdate(e){let{location:t,previousLocation:n}=e;!n||t.pathname===n.pathname&&t.search===n.search&&t.hash===n.hash||(window.ga("set","page",t.pathname+t.search+t.hash),window.ga("send","pageview"))}}},8320:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var r=n(4865),a=n.n(r);a().configure({showSpinner:!1});const o={onRouteUpdate(e){let{location:t,previousLocation:n}=e;if(n&&t.pathname!==n.pathname){const e=window.setTimeout((()=>{a().start()}),200);return()=>window.clearTimeout(e)}},onRouteDidUpdate(){a().done()}}},3310:(e,t,n)=>{"use strict";n.r(t);var r=n(1205),a=n(6809);!function(e){const{themeConfig:{prism:t}}=a.default,{additionalLanguages:r}=t;globalThis.Prism=e,r.forEach((e=>{n(6726)(`./prism-${e}`)})),delete globalThis.Prism}(r.Z)},9471:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294);const a={iconExternalLink:"iconExternalLink_nPIU"};function o(e){let{width:t=13.5,height:n=13.5}=e;return r.createElement("svg",{width:t,height:n,"aria-hidden":"true",viewBox:"0 0 24 24",className:a.iconExternalLink},r.createElement("path",{fill:"currentColor",d:"M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"}))}},7452:(e,t,n)=>{"use strict";n.d(t,{Z:()=>Rt});var r=n(7294),a=n(6010),o=n(4763),i=n(833),l=n(7462),s=n(6550),c=n(5999),u=n(5936);const d="__docusaurus_skipToContent_fallback";function f(e){e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")}function p(){const e=(0,r.useRef)(null),{action:t}=(0,s.k6)(),n=(0,r.useCallback)((e=>{e.preventDefault();const t=document.querySelector("main:first-of-type")??document.getElementById(d);t&&f(t)}),[]);return(0,u.S)((n=>{let{location:r}=n;e.current&&!r.hash&&"PUSH"===t&&f(e.current)})),{containerRef:e,onClick:n}}const m=(0,c.I)({id:"theme.common.skipToMainContent",description:"The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation",message:"Skip to main content"});function h(e){const t=e.children??m,{containerRef:n,onClick:a}=p();return r.createElement("div",{ref:n,role:"region","aria-label":m},r.createElement("a",(0,l.Z)({},e,{href:`#${d}`,onClick:a}),t))}var g=n(5281),b=n(9727);const v={skipToContent:"skipToContent_fXgn"};function y(){return r.createElement(h,{className:v.skipToContent})}var w=n(6668),k=n(9689);function E(e){let{width:t=21,height:n=21,color:a="currentColor",strokeWidth:o=1.2,className:i,...s}=e;return r.createElement("svg",(0,l.Z)({viewBox:"0 0 15 15",width:t,height:n},s),r.createElement("g",{stroke:a,strokeWidth:o},r.createElement("path",{d:"M.75.75l13.5 13.5M14.25.75L.75 14.25"})))}const S={closeButton:"closeButton_CVFx"};function x(e){return r.createElement("button",(0,l.Z)({type:"button","aria-label":(0,c.I)({id:"theme.AnnouncementBar.closeButtonAriaLabel",message:"Close",description:"The ARIA label for close button of announcement bar"})},e,{className:(0,a.Z)("clean-btn close",S.closeButton,e.className)}),r.createElement(E,{width:14,height:14,strokeWidth:3.1}))}const C={content:"content_knG7"};function T(e){const{announcementBar:t}=(0,w.L)(),{content:n}=t;return r.createElement("div",(0,l.Z)({},e,{className:(0,a.Z)(C.content,e.className),dangerouslySetInnerHTML:{__html:n}}))}const _={announcementBar:"announcementBar_mb4j",announcementBarPlaceholder:"announcementBarPlaceholder_vyr4",announcementBarClose:"announcementBarClose_gvF7",announcementBarContent:"announcementBarContent_xLdY"};function A(){const{announcementBar:e}=(0,w.L)(),{isActive:t,close:n}=(0,k.nT)();if(!t)return null;const{backgroundColor:a,textColor:o,isCloseable:i}=e;return r.createElement("div",{className:_.announcementBar,style:{backgroundColor:a,color:o},role:"banner"},i&&r.createElement("div",{className:_.announcementBarPlaceholder}),r.createElement(T,{className:_.announcementBarContent}),i&&r.createElement(x,{onClick:n,className:_.announcementBarClose}))}var L=n(3163),R=n(2466);var P=n(902),N=n(3102);const O=r.createContext(null);function I(e){let{children:t}=e;const n=function(){const e=(0,L.e)(),t=(0,N.HY)(),[n,a]=(0,r.useState)(!1),o=null!==t.component,i=(0,P.D9)(o);return(0,r.useEffect)((()=>{o&&!i&&a(!0)}),[o,i]),(0,r.useEffect)((()=>{o?e.shown||a(!0):a(!1)}),[e.shown,o]),(0,r.useMemo)((()=>[n,a]),[n])}();return r.createElement(O.Provider,{value:n},t)}function D(e){if(e.component){const t=e.component;return r.createElement(t,e.props)}}function M(){const e=(0,r.useContext)(O);if(!e)throw new P.i6("NavbarSecondaryMenuDisplayProvider");const[t,n]=e,a=(0,r.useCallback)((()=>n(!1)),[n]),o=(0,N.HY)();return(0,r.useMemo)((()=>({shown:t,hide:a,content:D(o)})),[a,o,t])}function F(e){let{header:t,primaryMenu:n,secondaryMenu:o}=e;const{shown:i}=M();return r.createElement("div",{className:"navbar-sidebar"},t,r.createElement("div",{className:(0,a.Z)("navbar-sidebar__items",{"navbar-sidebar__items--show-secondary":i})},r.createElement("div",{className:"navbar-sidebar__item menu"},n),r.createElement("div",{className:"navbar-sidebar__item menu"},o)))}var B=n(2949),j=n(2389);function z(e){return r.createElement("svg",(0,l.Z)({viewBox:"0 0 24 24",width:24,height:24},e),r.createElement("path",{fill:"currentColor",d:"M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"}))}function U(e){return r.createElement("svg",(0,l.Z)({viewBox:"0 0 24 24",width:24,height:24},e),r.createElement("path",{fill:"currentColor",d:"M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"}))}const $={toggle:"toggle_vylO",toggleButton:"toggleButton_gllP",darkToggleIcon:"darkToggleIcon_wfgR",lightToggleIcon:"lightToggleIcon_pyhR",toggleButtonDisabled:"toggleButtonDisabled_aARS"};function q(e){let{className:t,buttonClassName:n,value:o,onChange:i}=e;const l=(0,j.Z)(),s=(0,c.I)({message:"Switch between dark and light mode (currently {mode})",id:"theme.colorToggle.ariaLabel",description:"The ARIA label for the navbar color mode toggle"},{mode:"dark"===o?(0,c.I)({message:"dark mode",id:"theme.colorToggle.ariaLabel.mode.dark",description:"The name for the dark color mode"}):(0,c.I)({message:"light mode",id:"theme.colorToggle.ariaLabel.mode.light",description:"The name for the light color mode"})});return r.createElement("div",{className:(0,a.Z)($.toggle,t)},r.createElement("button",{className:(0,a.Z)("clean-btn",$.toggleButton,!l&&$.toggleButtonDisabled,n),type:"button",onClick:()=>i("dark"===o?"light":"dark"),disabled:!l,title:s,"aria-label":s,"aria-live":"polite"},r.createElement(z,{className:(0,a.Z)($.toggleIcon,$.lightToggleIcon)}),r.createElement(U,{className:(0,a.Z)($.toggleIcon,$.darkToggleIcon)})))}const H=r.memo(q),G={darkNavbarColorModeToggle:"darkNavbarColorModeToggle_X3D1"};function Z(e){let{className:t}=e;const n=(0,w.L)().navbar.style,a=(0,w.L)().colorMode.disableSwitch,{colorMode:o,setColorMode:i}=(0,B.I)();return a?null:r.createElement(H,{className:t,buttonClassName:"dark"===n?G.darkNavbarColorModeToggle:void 0,value:o,onChange:i})}var V=n(1327);function W(){return r.createElement(V.Z,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:"navbar__title text--truncate"})}function K(){const e=(0,L.e)();return r.createElement("button",{type:"button","aria-label":(0,c.I)({id:"theme.docs.sidebar.closeSidebarButtonAriaLabel",message:"Close navigation bar",description:"The ARIA label for close button of mobile sidebar"}),className:"clean-btn navbar-sidebar__close",onClick:()=>e.toggle()},r.createElement(E,{color:"var(--ifm-color-emphasis-600)"}))}function Y(){return r.createElement("div",{className:"navbar-sidebar__brand"},r.createElement(W,null),r.createElement(Z,{className:"margin-right--md"}),r.createElement(K,null))}var Q=n(9960),X=n(4996),J=n(3919),ee=n(8022),te=n(9471);function ne(e){let{activeBasePath:t,activeBaseRegex:n,to:a,href:o,label:i,html:s,isDropdownLink:c,prependBaseUrlToHref:u,...d}=e;const f=(0,X.Z)(a),p=(0,X.Z)(t),m=(0,X.Z)(o,{forcePrependBaseUrl:!0}),h=i&&o&&!(0,J.Z)(o),g=s?{dangerouslySetInnerHTML:{__html:s}}:{children:r.createElement(r.Fragment,null,i,h&&r.createElement(te.Z,c&&{width:12,height:12}))};return o?r.createElement(Q.Z,(0,l.Z)({href:u?m:o},d,g)):r.createElement(Q.Z,(0,l.Z)({to:f,isNavLink:!0},(t||n)&&{isActive:(e,t)=>n?(0,ee.F)(n,t.pathname):t.pathname.startsWith(p)},d,g))}function re(e){let{className:t,isDropdownItem:n=!1,...o}=e;const i=r.createElement(ne,(0,l.Z)({className:(0,a.Z)(n?"dropdown__link":"navbar__item navbar__link",t),isDropdownLink:n},o));return n?r.createElement("li",null,i):i}function ae(e){let{className:t,isDropdownItem:n,...o}=e;return r.createElement("li",{className:"menu__list-item"},r.createElement(ne,(0,l.Z)({className:(0,a.Z)("menu__link",t)},o)))}function oe(e){let{mobile:t=!1,position:n,...a}=e;const o=t?ae:re;return r.createElement(o,(0,l.Z)({},a,{activeClassName:a.activeClassName??(t?"menu__link--active":"navbar__link--active")}))}var ie=n(6043),le=n(8596),se=n(2263);function ce(e,t){return e.some((e=>function(e,t){return!!(0,le.Mg)(e.to,t)||!!(0,ee.F)(e.activeBaseRegex,t)||!(!e.activeBasePath||!t.startsWith(e.activeBasePath))}(e,t)))}function ue(e){let{items:t,position:n,className:o,onClick:i,...s}=e;const c=(0,r.useRef)(null),[u,d]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{const e=e=>{c.current&&!c.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),document.addEventListener("focusin",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e),document.removeEventListener("focusin",e)}}),[c]),r.createElement("div",{ref:c,className:(0,a.Z)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--right":"right"===n,"dropdown--show":u})},r.createElement(ne,(0,l.Z)({"aria-haspopup":"true","aria-expanded":u,role:"button",href:s.to?void 0:"#",className:(0,a.Z)("navbar__link",o)},s,{onClick:s.to?void 0:e=>e.preventDefault(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),d(!u))}}),s.children??s.label),r.createElement("ul",{className:"dropdown__menu"},t.map(((e,t)=>r.createElement(qe,(0,l.Z)({isDropdownItem:!0,activeClassName:"dropdown__link--active"},e,{key:t}))))))}function de(e){let{items:t,className:n,position:o,onClick:i,...c}=e;const u=function(){const{siteConfig:{baseUrl:e}}=(0,se.Z)(),{pathname:t}=(0,s.TH)();return t.replace(e,"/")}(),d=ce(t,u),{collapsed:f,toggleCollapsed:p,setCollapsed:m}=(0,ie.u)({initialState:()=>!d});return(0,r.useEffect)((()=>{d&&m(!d)}),[u,d,m]),r.createElement("li",{className:(0,a.Z)("menu__list-item",{"menu__list-item--collapsed":f})},r.createElement(ne,(0,l.Z)({role:"button",className:(0,a.Z)("menu__link menu__link--sublist menu__link--sublist-caret",n)},c,{onClick:e=>{e.preventDefault(),p()}}),c.children??c.label),r.createElement(ie.z,{lazy:!0,as:"ul",className:"menu__list",collapsed:f},t.map(((e,t)=>r.createElement(qe,(0,l.Z)({mobile:!0,isDropdownItem:!0,onClick:i,activeClassName:"menu__link--active"},e,{key:t}))))))}function fe(e){let{mobile:t=!1,...n}=e;const a=t?de:ue;return r.createElement(a,n)}var pe=n(4711);function me(e){let{width:t=20,height:n=20,...a}=e;return r.createElement("svg",(0,l.Z)({viewBox:"0 0 24 24",width:t,height:n,"aria-hidden":!0},a),r.createElement("path",{fill:"currentColor",d:"M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"}))}const he="iconLanguage_nlXk";function ge(){return r.createElement("svg",{width:"15",height:"15",className:"DocSearch-Control-Key-Icon"},r.createElement("path",{d:"M4.505 4.496h2M5.505 5.496v5M8.216 4.496l.055 5.993M10 7.5c.333.333.5.667.5 1v2M12.326 4.5v5.996M8.384 4.496c1.674 0 2.116 0 2.116 1.5s-.442 1.5-2.116 1.5M3.205 9.303c-.09.448-.277 1.21-1.241 1.203C1 10.5.5 9.513.5 8V7c0-1.57.5-2.5 1.464-2.494.964.006 1.134.598 1.24 1.342M12.553 10.5h1.953",strokeWidth:"1.2",stroke:"currentColor",fill:"none",strokeLinecap:"square"}))}var be=n(830),ve=["translations"];function ye(){return ye=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ye.apply(this,arguments)}function we(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(s){l=!0,a=s}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ke(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ke(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ee(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Se="Ctrl";var xe=r.forwardRef((function(e,t){var n=e.translations,a=void 0===n?{}:n,o=Ee(e,ve),i=a.buttonText,l=void 0===i?"Search":i,s=a.buttonAriaLabel,c=void 0===s?"Search":s,u=we((0,r.useState)(null),2),d=u[0],f=u[1];return(0,r.useEffect)((function(){"undefined"!=typeof navigator&&(/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)?f("\u2318"):f(Se))}),[]),r.createElement("button",ye({type:"button",className:"DocSearch DocSearch-Button","aria-label":c},o,{ref:t}),r.createElement("span",{className:"DocSearch-Button-Container"},r.createElement(be.W,null),r.createElement("span",{className:"DocSearch-Button-Placeholder"},l)),r.createElement("span",{className:"DocSearch-Button-Keys"},null!==d&&r.createElement(r.Fragment,null,r.createElement("kbd",{className:"DocSearch-Button-Key"},d===Se?r.createElement(ge,null):d),r.createElement("kbd",{className:"DocSearch-Button-Key"},"K"))))})),Ce=n(5742),Te=n(6177),_e=n(239),Ae=n(3320);var Le=n(3935);const Re={button:{buttonText:(0,c.I)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"}),buttonAriaLabel:(0,c.I)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"})},modal:{searchBox:{resetButtonTitle:(0,c.I)({id:"theme.SearchModal.searchBox.resetButtonTitle",message:"Clear the query",description:"The label and ARIA label for search box reset button"}),resetButtonAriaLabel:(0,c.I)({id:"theme.SearchModal.searchBox.resetButtonTitle",message:"Clear the query",description:"The label and ARIA label for search box reset button"}),cancelButtonText:(0,c.I)({id:"theme.SearchModal.searchBox.cancelButtonText",message:"Cancel",description:"The label and ARIA label for search box cancel button"}),cancelButtonAriaLabel:(0,c.I)({id:"theme.SearchModal.searchBox.cancelButtonText",message:"Cancel",description:"The label and ARIA label for search box cancel button"})},startScreen:{recentSearchesTitle:(0,c.I)({id:"theme.SearchModal.startScreen.recentSearchesTitle",message:"Recent",description:"The title for recent searches"}),noRecentSearchesText:(0,c.I)({id:"theme.SearchModal.startScreen.noRecentSearchesText",message:"No recent searches",description:"The text when no recent searches"}),saveRecentSearchButtonTitle:(0,c.I)({id:"theme.SearchModal.startScreen.saveRecentSearchButtonTitle",message:"Save this search",description:"The label for save recent search button"}),removeRecentSearchButtonTitle:(0,c.I)({id:"theme.SearchModal.startScreen.removeRecentSearchButtonTitle",message:"Remove this search from history",description:"The label for remove recent search button"}),favoriteSearchesTitle:(0,c.I)({id:"theme.SearchModal.startScreen.favoriteSearchesTitle",message:"Favorite",description:"The title for favorite searches"}),removeFavoriteSearchButtonTitle:(0,c.I)({id:"theme.SearchModal.startScreen.removeFavoriteSearchButtonTitle",message:"Remove this search from favorites",description:"The label for remove favorite search button"})},errorScreen:{titleText:(0,c.I)({id:"theme.SearchModal.errorScreen.titleText",message:"Unable to fetch results",description:"The title for error screen of search modal"}),helpText:(0,c.I)({id:"theme.SearchModal.errorScreen.helpText",message:"You might want to check your network connection.",description:"The help text for error screen of search modal"})},footer:{selectText:(0,c.I)({id:"theme.SearchModal.footer.selectText",message:"to select",description:"The explanatory text of the action for the enter key"}),selectKeyAriaLabel:(0,c.I)({id:"theme.SearchModal.footer.selectKeyAriaLabel",message:"Enter key",description:"The ARIA label for the Enter key button that makes the selection"}),navigateText:(0,c.I)({id:"theme.SearchModal.footer.navigateText",message:"to navigate",description:"The explanatory text of the action for the Arrow up and Arrow down key"}),navigateUpKeyAriaLabel:(0,c.I)({id:"theme.SearchModal.footer.navigateUpKeyAriaLabel",message:"Arrow up",description:"The ARIA label for the Arrow up key button that makes the navigation"}),navigateDownKeyAriaLabel:(0,c.I)({id:"theme.SearchModal.footer.navigateDownKeyAriaLabel",message:"Arrow down",description:"The ARIA label for the Arrow down key button that makes the navigation"}),closeText:(0,c.I)({id:"theme.SearchModal.footer.closeText",message:"to close",description:"The explanatory text of the action for Escape key"}),closeKeyAriaLabel:(0,c.I)({id:"theme.SearchModal.footer.closeKeyAriaLabel",message:"Escape key",description:"The ARIA label for the Escape key button that close the modal"}),searchByText:(0,c.I)({id:"theme.SearchModal.footer.searchByText",message:"Search by",description:"The text explain that the search is making by Algolia"})},noResultsScreen:{noResultsText:(0,c.I)({id:"theme.SearchModal.noResultsScreen.noResultsText",message:"No results for",description:"The text explains that there are no results for the following search"}),suggestedQueryText:(0,c.I)({id:"theme.SearchModal.noResultsScreen.suggestedQueryText",message:"Try searching for",description:"The text for the suggested query when no results are found for the following search"}),reportMissingResultsText:(0,c.I)({id:"theme.SearchModal.noResultsScreen.reportMissingResultsText",message:"Believe this query should return results?",description:"The text for the question where the user thinks there are missing results"}),reportMissingResultsLinkText:(0,c.I)({id:"theme.SearchModal.noResultsScreen.reportMissingResultsLinkText",message:"Let us know.",description:"The text for the link to report missing results"})}},placeholder:(0,c.I)({id:"theme.SearchModal.placeholder",message:"Search docs",description:"The placeholder of the input of the DocSearch pop-up modal"})};let Pe=null;function Ne(e){let{hit:t,children:n}=e;return r.createElement(Q.Z,{to:t.url},n)}function Oe(e){let{state:t,onClose:n}=e;const a=(0,Te.M)();return r.createElement(Q.Z,{to:a(t.query),onClick:n},r.createElement(c.Z,{id:"theme.SearchBar.seeAll",values:{count:t.context.nbHits}},"See all {count} results"))}function Ie(e){let{contextualSearch:t,externalUrlRegex:a,...o}=e;const{siteMetadata:i}=(0,se.Z)(),c=(0,_e.l)(),u=function(){const{locale:e,tags:t}=(0,Ae._q)();return[`language:${e}`,t.map((e=>`docusaurus_tag:${e}`))]}(),d=o.searchParameters?.facetFilters??[],f=t?function(e,t){const n=e=>"string"==typeof e?[e]:e;return[...n(e),...n(t)]}(u,d):d,p={...o.searchParameters,facetFilters:f},m=(0,s.k6)(),h=(0,r.useRef)(null),g=(0,r.useRef)(null),[b,v]=(0,r.useState)(!1),[y,w]=(0,r.useState)(void 0),k=(0,r.useCallback)((()=>Pe?Promise.resolve():Promise.all([n.e(1426).then(n.bind(n,6672)),Promise.all([n.e(532),n.e(6945)]).then(n.bind(n,6945)),Promise.all([n.e(532),n.e(8894)]).then(n.bind(n,8894))]).then((e=>{let[{DocSearchModal:t}]=e;Pe=t}))),[]),E=(0,r.useCallback)((()=>{k().then((()=>{h.current=document.createElement("div"),document.body.insertBefore(h.current,document.body.firstChild),v(!0)}))}),[k,v]),S=(0,r.useCallback)((()=>{v(!1),h.current?.remove()}),[v]),x=(0,r.useCallback)((e=>{k().then((()=>{v(!0),w(e.key)}))}),[k,v,w]),C=(0,r.useRef)({navigate(e){let{itemUrl:t}=e;(0,ee.F)(a,t)?window.location.href=t:m.push(t)}}).current,T=(0,r.useRef)((e=>o.transformItems?o.transformItems(e):e.map((e=>({...e,url:c(e.url)}))))).current,_=(0,r.useMemo)((()=>e=>r.createElement(Oe,(0,l.Z)({},e,{onClose:S}))),[S]),A=(0,r.useCallback)((e=>(e.addAlgoliaAgent("docusaurus",i.docusaurusVersion),e)),[i.docusaurusVersion]);return function(e){var t=e.isOpen,n=e.onOpen,a=e.onClose,o=e.onInput,i=e.searchButtonRef;r.useEffect((function(){function e(e){var r;(27===e.keyCode&&t||"k"===(null===(r=e.key)||void 0===r?void 0:r.toLowerCase())&&(e.metaKey||e.ctrlKey)||!function(e){var t=e.target,n=t.tagName;return t.isContentEditable||"INPUT"===n||"SELECT"===n||"TEXTAREA"===n}(e)&&"/"===e.key&&!t)&&(e.preventDefault(),t?a():document.body.classList.contains("DocSearch--active")||document.body.classList.contains("DocSearch--active")||n()),i&&i.current===document.activeElement&&o&&/[a-zA-Z0-9]/.test(String.fromCharCode(e.keyCode))&&o(e)}return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}),[t,n,a,o,i])}({isOpen:b,onOpen:E,onClose:S,onInput:x,searchButtonRef:g}),r.createElement(r.Fragment,null,r.createElement(Ce.Z,null,r.createElement("link",{rel:"preconnect",href:`https://${o.appId}-dsn.algolia.net`,crossOrigin:"anonymous"})),r.createElement(xe,{onTouchStart:k,onFocus:k,onMouseOver:k,onClick:E,ref:g,translations:Re.button}),b&&Pe&&h.current&&(0,Le.createPortal)(r.createElement(Pe,(0,l.Z)({onClose:S,initialScrollY:window.scrollY,initialQuery:y,navigator:C,transformItems:T,hitComponent:Ne,transformSearchClient:A},o.searchPagePath&&{resultsFooterComponent:_},o,{searchParameters:p,placeholder:Re.placeholder,translations:Re.modal})),h.current))}function De(){const{siteConfig:e}=(0,se.Z)();return r.createElement(Ie,e.themeConfig.algolia)}const Me={searchBox:"searchBox_ZlJk"};function Fe(e){let{children:t,className:n}=e;return r.createElement("div",{className:(0,a.Z)(n,Me.searchBox)},t)}var Be=n(143),je=n(3438);var ze=n(373);const Ue=e=>e.docs.find((t=>t.id===e.mainDocId));const $e={default:oe,localeDropdown:function(e){let{mobile:t,dropdownItemsBefore:n,dropdownItemsAfter:a,...o}=e;const{i18n:{currentLocale:i,locales:u,localeConfigs:d}}=(0,se.Z)(),f=(0,pe.l)(),{search:p,hash:m}=(0,s.TH)(),h=[...n,...u.map((e=>{const n=`${`pathname://${f.createUrl({locale:e,fullyQualified:!1})}`}${p}${m}`;return{label:d[e].label,lang:d[e].htmlLang,to:n,target:"_self",autoAddBaseUrl:!1,className:e===i?t?"menu__link--active":"dropdown__link--active":""}})),...a],g=t?(0,c.I)({message:"Languages",id:"theme.navbar.mobileLanguageDropdown.label",description:"The label for the mobile language switcher dropdown"}):d[i].label;return r.createElement(fe,(0,l.Z)({},o,{mobile:t,label:r.createElement(r.Fragment,null,r.createElement(me,{className:he}),g),items:h}))},search:function(e){let{mobile:t,className:n}=e;return t?null:r.createElement(Fe,{className:n},r.createElement(De,null))},dropdown:fe,html:function(e){let{value:t,className:n,mobile:o=!1,isDropdownItem:i=!1}=e;const l=i?"li":"div";return r.createElement(l,{className:(0,a.Z)({navbar__item:!o&&!i,"menu__list-item":o},n),dangerouslySetInnerHTML:{__html:t}})},doc:function(e){let{docId:t,label:n,docsPluginId:a,...o}=e;const{activeDoc:i}=(0,Be.Iw)(a),s=(0,je.vY)(t,a);return null===s?null:r.createElement(oe,(0,l.Z)({exact:!0},o,{isActive:()=>i?.path===s.path||!!i?.sidebar&&i.sidebar===s.sidebar,label:n??s.id,to:s.path}))},docSidebar:function(e){let{sidebarId:t,label:n,docsPluginId:a,...o}=e;const{activeDoc:i}=(0,Be.Iw)(a),s=(0,je.oz)(t,a).link;if(!s)throw new Error(`DocSidebarNavbarItem: Sidebar with ID "${t}" doesn't have anything to be linked to.`);return r.createElement(oe,(0,l.Z)({exact:!0},o,{isActive:()=>i?.sidebar===t,label:n??s.label,to:s.path}))},docsVersion:function(e){let{label:t,to:n,docsPluginId:a,...o}=e;const i=(0,je.lO)(a)[0],s=t??i.label,c=n??(e=>e.docs.find((t=>t.id===e.mainDocId)))(i).path;return r.createElement(oe,(0,l.Z)({},o,{label:s,to:c}))},docsVersionDropdown:function(e){let{mobile:t,docsPluginId:n,dropdownActiveClassDisabled:a,dropdownItemsBefore:o,dropdownItemsAfter:i,...u}=e;const{search:d,hash:f}=(0,s.TH)(),p=(0,Be.Iw)(n),m=(0,Be.gB)(n),{savePreferredVersionName:h}=(0,ze.J)(n),g=[...o,...m.map((e=>{const t=p.alternateDocVersions[e.name]??Ue(e);return{label:e.label,to:`${t.path}${d}${f}`,isActive:()=>e===p.activeVersion,onClick:()=>h(e.name)}})),...i],b=(0,je.lO)(n)[0],v=t&&g.length>1?(0,c.I)({id:"theme.navbar.mobileVersionsDropdown.label",message:"Versions",description:"The label for the navbar versions dropdown on mobile view"}):b.label,y=t&&g.length>1?void 0:Ue(b).path;return g.length<=1?r.createElement(oe,(0,l.Z)({},u,{mobile:t,label:v,to:y,isActive:a?()=>!1:void 0})):r.createElement(fe,(0,l.Z)({},u,{mobile:t,label:v,to:y,items:g,isActive:a?()=>!1:void 0}))}};function qe(e){let{type:t,...n}=e;const a=function(e,t){return e&&"default"!==e?e:"items"in t?"dropdown":"default"}(t,n),o=$e[a];if(!o)throw new Error(`No NavbarItem component found for type "${t}".`);return r.createElement(o,n)}function He(){const e=(0,L.e)(),t=(0,w.L)().navbar.items;return r.createElement("ul",{className:"menu__list"},t.map(((t,n)=>r.createElement(qe,(0,l.Z)({mobile:!0},t,{onClick:()=>e.toggle(),key:n})))))}function Ge(e){return r.createElement("button",(0,l.Z)({},e,{type:"button",className:"clean-btn navbar-sidebar__back"}),r.createElement(c.Z,{id:"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel",description:"The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)"},"\u2190 Back to main menu"))}function Ze(){const e=0===(0,w.L)().navbar.items.length,t=M();return r.createElement(r.Fragment,null,!e&&r.createElement(Ge,{onClick:()=>t.hide()}),t.content)}function Ve(){const e=(0,L.e)();var t;return void 0===(t=e.shown)&&(t=!0),(0,r.useEffect)((()=>(document.body.style.overflow=t?"hidden":"visible",()=>{document.body.style.overflow="visible"})),[t]),e.shouldRender?r.createElement(F,{header:r.createElement(Y,null),primaryMenu:r.createElement(He,null),secondaryMenu:r.createElement(Ze,null)}):null}const We={navbarHideable:"navbarHideable_m1mJ",navbarHidden:"navbarHidden_jGov"};function Ke(e){return r.createElement("div",(0,l.Z)({role:"presentation"},e,{className:(0,a.Z)("navbar-sidebar__backdrop",e.className)}))}function Ye(e){let{children:t}=e;const{navbar:{hideOnScroll:n,style:o}}=(0,w.L)(),i=(0,L.e)(),{navbarRef:l,isNavbarVisible:s}=function(e){const[t,n]=(0,r.useState)(e),a=(0,r.useRef)(!1),o=(0,r.useRef)(0),i=(0,r.useCallback)((e=>{null!==e&&(o.current=e.getBoundingClientRect().height)}),[]);return(0,R.RF)(((t,r)=>{let{scrollY:i}=t;if(!e)return;if(i<o.current)return void n(!0);if(a.current)return void(a.current=!1);const l=r?.scrollY,s=document.documentElement.scrollHeight-o.current,c=window.innerHeight;l&&i>=l?n(!1):i+c<s&&n(!0)})),(0,u.S)((t=>{if(!e)return;const r=t.location.hash;if(r?document.getElementById(r.substring(1)):void 0)return a.current=!0,void n(!1);n(!0)})),{navbarRef:i,isNavbarVisible:t}}(n);return r.createElement("nav",{ref:l,"aria-label":(0,c.I)({id:"theme.NavBar.navAriaLabel",message:"Main",description:"The ARIA label for the main navigation"}),className:(0,a.Z)("navbar","navbar--fixed-top",n&&[We.navbarHideable,!s&&We.navbarHidden],{"navbar--dark":"dark"===o,"navbar--primary":"primary"===o,"navbar-sidebar--show":i.shown})},t,r.createElement(Ke,{onClick:i.toggle}),r.createElement(Ve,null))}var Qe=n(8780);const Xe={errorBoundaryError:"errorBoundaryError_a6uf"};function Je(e){return r.createElement("button",(0,l.Z)({type:"button"},e),r.createElement(c.Z,{id:"theme.ErrorPageContent.tryAgain",description:"The label of the button to try again rendering when the React error boundary captures an error"},"Try again"))}function et(e){let{error:t}=e;const n=(0,Qe.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return r.createElement("p",{className:Xe.errorBoundaryError},n)}class tt extends r.Component{componentDidCatch(e,t){throw this.props.onError(e,t)}render(){return this.props.children}}const nt="right";function rt(e){let{width:t=30,height:n=30,className:a,...o}=e;return r.createElement("svg",(0,l.Z)({className:a,width:t,height:n,viewBox:"0 0 30 30","aria-hidden":"true"},o),r.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M4 7h22M4 15h22M4 23h22"}))}function at(){const{toggle:e,shown:t}=(0,L.e)();return r.createElement("button",{onClick:e,"aria-label":(0,c.I)({id:"theme.docs.sidebar.toggleSidebarButtonAriaLabel",message:"Toggle navigation bar",description:"The ARIA label for hamburger menu button of mobile navigation"}),"aria-expanded":t,className:"navbar__toggle clean-btn",type:"button"},r.createElement(rt,null))}const ot={colorModeToggle:"colorModeToggle_DEke"};function it(e){let{items:t}=e;return r.createElement(r.Fragment,null,t.map(((e,t)=>r.createElement(tt,{key:t,onError:t=>new Error(`A theme navbar item failed to render.\nPlease double-check the following navbar item (themeConfig.navbar.items) of your Docusaurus config:\n${JSON.stringify(e,null,2)}`,{cause:t})},r.createElement(qe,e)))))}function lt(e){let{left:t,right:n}=e;return r.createElement("div",{className:"navbar__inner"},r.createElement("div",{className:"navbar__items"},t),r.createElement("div",{className:"navbar__items navbar__items--right"},n))}function st(){const e=(0,L.e)(),t=(0,w.L)().navbar.items,[n,a]=function(e){function t(e){return"left"===(e.position??nt)}return[e.filter(t),e.filter((e=>!t(e)))]}(t),o=t.find((e=>"search"===e.type));return r.createElement(lt,{left:r.createElement(r.Fragment,null,!e.disabled&&r.createElement(at,null),r.createElement(W,null),r.createElement(it,{items:n})),right:r.createElement(r.Fragment,null,r.createElement(it,{items:a}),r.createElement(Z,{className:ot.colorModeToggle}),!o&&r.createElement(Fe,null,r.createElement(De,null)))})}function ct(){return r.createElement(Ye,null,r.createElement(st,null))}function ut(e){let{item:t}=e;const{to:n,href:a,label:o,prependBaseUrlToHref:i,...s}=t,c=(0,X.Z)(n),u=(0,X.Z)(a,{forcePrependBaseUrl:!0});return r.createElement(Q.Z,(0,l.Z)({className:"footer__link-item"},a?{href:i?u:a}:{to:c},s),o,a&&!(0,J.Z)(a)&&r.createElement(te.Z,null))}function dt(e){let{item:t}=e;return t.html?r.createElement("li",{className:"footer__item",dangerouslySetInnerHTML:{__html:t.html}}):r.createElement("li",{key:t.href??t.to,className:"footer__item"},r.createElement(ut,{item:t}))}function ft(e){let{column:t}=e;return r.createElement("div",{className:"col footer__col"},r.createElement("div",{className:"footer__title"},t.title),r.createElement("ul",{className:"footer__items clean-list"},t.items.map(((e,t)=>r.createElement(dt,{key:t,item:e})))))}function pt(e){let{columns:t}=e;return r.createElement("div",{className:"row footer__links"},t.map(((e,t)=>r.createElement(ft,{key:t,column:e}))))}function mt(){return r.createElement("span",{className:"footer__link-separator"},"\xb7")}function ht(e){let{item:t}=e;return t.html?r.createElement("span",{className:"footer__link-item",dangerouslySetInnerHTML:{__html:t.html}}):r.createElement(ut,{item:t})}function gt(e){let{links:t}=e;return r.createElement("div",{className:"footer__links text--center"},r.createElement("div",{className:"footer__links"},t.map(((e,n)=>r.createElement(r.Fragment,{key:n},r.createElement(ht,{item:e}),t.length!==n+1&&r.createElement(mt,null))))))}function bt(e){let{links:t}=e;return function(e){return"title"in e[0]}(t)?r.createElement(pt,{columns:t}):r.createElement(gt,{links:t})}var vt=n(941);const yt={footerLogoLink:"footerLogoLink_BH7S"};function wt(e){let{logo:t}=e;const{withBaseUrl:n}=(0,X.C)(),o={light:n(t.src),dark:n(t.srcDark??t.src)};return r.createElement(vt.Z,{className:(0,a.Z)("footer__logo",t.className),alt:t.alt,sources:o,width:t.width,height:t.height,style:t.style})}function kt(e){let{logo:t}=e;return t.href?r.createElement(Q.Z,{href:t.href,className:yt.footerLogoLink,target:t.target},r.createElement(wt,{logo:t})):r.createElement(wt,{logo:t})}function Et(e){let{copyright:t}=e;return r.createElement("div",{className:"footer__copyright",dangerouslySetInnerHTML:{__html:t}})}function St(e){let{style:t,links:n,logo:o,copyright:i}=e;return r.createElement("footer",{className:(0,a.Z)("footer",{"footer--dark":"dark"===t})},r.createElement("div",{className:"container container-fluid"},n,(o||i)&&r.createElement("div",{className:"footer__bottom text--center"},o&&r.createElement("div",{className:"margin-bottom--sm"},o),i)))}function xt(){const{footer:e}=(0,w.L)();if(!e)return null;const{copyright:t,links:n,logo:a,style:o}=e;return r.createElement(St,{style:o,links:n&&n.length>0&&r.createElement(bt,{links:n}),logo:a&&r.createElement(kt,{logo:a}),copyright:t&&r.createElement(Et,{copyright:t})})}const Ct=r.memo(xt),Tt=(0,P.Qc)([B.S,k.pl,R.OC,ze.L5,i.VC,function(e){let{children:t}=e;return r.createElement(N.n2,null,r.createElement(L.M,null,r.createElement(I,null,t)))}]);function _t(e){let{children:t}=e;return r.createElement(Tt,null,t)}function At(e){let{error:t,tryAgain:n}=e;return r.createElement("main",{className:"container margin-vert--xl"},r.createElement("div",{className:"row"},r.createElement("div",{className:"col col--6 col--offset-3"},r.createElement("h1",{className:"hero__title"},r.createElement(c.Z,{id:"theme.ErrorPageContent.title",description:"The title of the fallback page when the page crashed"},"This page crashed.")),r.createElement("div",{className:"margin-vert--lg"},r.createElement(Je,{onClick:n,className:"button button--primary shadow--lw"})),r.createElement("hr",null),r.createElement("div",{className:"margin-vert--md"},r.createElement(et,{error:t})))))}const Lt={mainWrapper:"mainWrapper_z2l0"};function Rt(e){const{children:t,noFooter:n,wrapperClassName:l,title:s,description:c}=e;return(0,b.t)(),r.createElement(_t,null,r.createElement(i.d,{title:s,description:c}),r.createElement(y,null),r.createElement(A,null),r.createElement(ct,null),r.createElement("div",{id:d,className:(0,a.Z)(g.k.wrapper.main,Lt.mainWrapper,l)},r.createElement(o.Z,{fallback:e=>r.createElement(At,e)},t)),!n&&r.createElement(Ct,null))}},1327:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(7462),a=n(7294),o=n(9960),i=n(4996),l=n(2263),s=n(6668),c=n(941);function u(e){let{logo:t,alt:n,imageClassName:r}=e;const o={light:(0,i.Z)(t.src),dark:(0,i.Z)(t.srcDark||t.src)},l=a.createElement(c.Z,{className:t.className,sources:o,height:t.height,width:t.width,alt:n,style:t.style});return r?a.createElement("div",{className:r},l):l}function d(e){const{siteConfig:{title:t}}=(0,l.Z)(),{navbar:{title:n,logo:c}}=(0,s.L)(),{imageClassName:d,titleClassName:f,...p}=e,m=(0,i.Z)(c?.href||"/"),h=n?"":t,g=c?.alt??h;return a.createElement(o.Z,(0,r.Z)({to:m},p,c?.target&&{target:c.target}),c&&a.createElement(u,{logo:c,alt:g,imageClassName:d}),null!=n&&a.createElement("b",{className:f},n))}},197:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294),a=n(5742);function o(e){let{locale:t,version:n,tag:o}=e;const i=t;return r.createElement(a.Z,null,t&&r.createElement("meta",{name:"docusaurus_locale",content:t}),n&&r.createElement("meta",{name:"docusaurus_version",content:n}),o&&r.createElement("meta",{name:"docusaurus_tag",content:o}),i&&r.createElement("meta",{name:"docsearch:language",content:i}),n&&r.createElement("meta",{name:"docsearch:version",content:n}),o&&r.createElement("meta",{name:"docsearch:docusaurus_tag",content:o}))}},941:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(7462),a=n(7294),o=n(6010),i=n(2389),l=n(2949);const s={themedImage:"themedImage_ToTc","themedImage--light":"themedImage--light_HNdA","themedImage--dark":"themedImage--dark_i4oU"};function c(e){const t=(0,i.Z)(),{colorMode:n}=(0,l.I)(),{sources:c,className:u,alt:d,...f}=e,p=t?"dark"===n?["dark"]:["light"]:["light","dark"];return a.createElement(a.Fragment,null,p.map((e=>a.createElement("img",(0,r.Z)({key:e,src:c[e],alt:d,className:(0,o.Z)(s.themedImage,s[`themedImage--${e}`],u)},f)))))}},6043:(e,t,n)=>{"use strict";n.d(t,{u:()=>s,z:()=>g});var r=n(7462),a=n(7294),o=n(412),i=n(1442);const l="ease-in-out";function s(e){let{initialState:t}=e;const[n,r]=(0,a.useState)(t??!1),o=(0,a.useCallback)((()=>{r((e=>!e))}),[]);return{collapsed:n,setCollapsed:r,toggleCollapsed:o}}const c={display:"none",overflow:"hidden",height:"0px"},u={display:"block",overflow:"visible",height:"auto"};function d(e,t){const n=t?c:u;e.style.display=n.display,e.style.overflow=n.overflow,e.style.height=n.height}function f(e){let{collapsibleRef:t,collapsed:n,animation:r}=e;const o=(0,a.useRef)(!1);(0,a.useEffect)((()=>{const e=t.current;function a(){const t=e.scrollHeight,n=r?.duration??function(e){if((0,i.n)())return 1;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}(t);return{transition:`height ${n}ms ${r?.easing??l}`,height:`${t}px`}}function s(){const t=a();e.style.transition=t.transition,e.style.height=t.height}if(!o.current)return d(e,n),void(o.current=!0);return e.style.willChange="height",function(){const t=requestAnimationFrame((()=>{n?(s(),requestAnimationFrame((()=>{e.style.height=c.height,e.style.overflow=c.overflow}))):(e.style.display="block",requestAnimationFrame((()=>{s()})))}));return()=>cancelAnimationFrame(t)}()}),[t,n,r])}function p(e){if(!o.Z.canUseDOM)return e?c:u}function m(e){let{as:t="div",collapsed:n,children:r,animation:o,onCollapseTransitionEnd:i,className:l,disableSSRStyle:s}=e;const c=(0,a.useRef)(null);return f({collapsibleRef:c,collapsed:n,animation:o}),a.createElement(t,{ref:c,style:s?void 0:p(n),onTransitionEnd:e=>{"height"===e.propertyName&&(d(c.current,n),i?.(n))},className:l},r)}function h(e){let{collapsed:t,...n}=e;const[o,i]=(0,a.useState)(!t),[l,s]=(0,a.useState)(t);return(0,a.useLayoutEffect)((()=>{t||i(!0)}),[t]),(0,a.useLayoutEffect)((()=>{o&&s(t)}),[o,t]),o?a.createElement(m,(0,r.Z)({},n,{collapsed:l})):null}function g(e){let{lazy:t,...n}=e;const r=t?h:m;return a.createElement(r,n)}},9689:(e,t,n)=>{"use strict";n.d(t,{nT:()=>m,pl:()=>p});var r=n(7294),a=n(2389),o=n(12),i=n(902),l=n(6668);const s=(0,o.WA)("docusaurus.announcement.dismiss"),c=(0,o.WA)("docusaurus.announcement.id"),u=()=>"true"===s.get(),d=e=>s.set(String(e)),f=r.createContext(null);function p(e){let{children:t}=e;const n=function(){const{announcementBar:e}=(0,l.L)(),t=(0,a.Z)(),[n,o]=(0,r.useState)((()=>!!t&&u()));(0,r.useEffect)((()=>{o(u())}),[]);const i=(0,r.useCallback)((()=>{d(!0),o(!0)}),[]);return(0,r.useEffect)((()=>{if(!e)return;const{id:t}=e;let n=c.get();"annoucement-bar"===n&&(n="announcement-bar");const r=t!==n;c.set(t),r&&d(!1),!r&&u()||o(!1)}),[e]),(0,r.useMemo)((()=>({isActive:!!e&&!n,close:i})),[e,n,i])}();return r.createElement(f.Provider,{value:n},t)}function m(){const e=(0,r.useContext)(f);if(!e)throw new i.i6("AnnouncementBarProvider");return e}},2949:(e,t,n)=>{"use strict";n.d(t,{I:()=>g,S:()=>h});var r=n(7294),a=n(412),o=n(902),i=n(12),l=n(6668);const s=r.createContext(void 0),c="theme",u=(0,i.WA)(c),d={light:"light",dark:"dark"},f=e=>e===d.dark?d.dark:d.light,p=e=>a.Z.canUseDOM?f(document.documentElement.getAttribute("data-theme")):f(e),m=e=>{u.set(f(e))};function h(e){let{children:t}=e;const n=function(){const{colorMode:{defaultMode:e,disableSwitch:t,respectPrefersColorScheme:n}}=(0,l.L)(),[a,o]=(0,r.useState)(p(e));(0,r.useEffect)((()=>{t&&u.del()}),[t]);const i=(0,r.useCallback)((function(t,r){void 0===r&&(r={});const{persist:a=!0}=r;t?(o(t),a&&m(t)):(o(n?window.matchMedia("(prefers-color-scheme: dark)").matches?d.dark:d.light:e),u.del())}),[n,e]);(0,r.useEffect)((()=>{document.documentElement.setAttribute("data-theme",f(a))}),[a]),(0,r.useEffect)((()=>{if(t)return;const e=e=>{if(e.key!==c)return;const t=u.get();null!==t&&i(f(t))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}),[t,i]);const s=(0,r.useRef)(!1);return(0,r.useEffect)((()=>{if(t&&!n)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{window.matchMedia("print").matches||s.current?s.current=window.matchMedia("print").matches:i(null)};return e.addListener(r),()=>e.removeListener(r)}),[i,t,n]),(0,r.useMemo)((()=>({colorMode:a,setColorMode:i,get isDarkTheme(){return a===d.dark},setLightTheme(){i(d.light)},setDarkTheme(){i(d.dark)}})),[a,i])}();return r.createElement(s.Provider,{value:n},t)}function g(){const e=(0,r.useContext)(s);if(null==e)throw new o.i6("ColorModeProvider","Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.");return e}},373:(e,t,n)=>{"use strict";n.d(t,{J:()=>v,L5:()=>g,Oh:()=>y});var r=n(7294),a=n(143),o=n(9935),i=n(6668),l=n(3438),s=n(902),c=n(12);const u=e=>`docs-preferred-version-${e}`,d={save:(e,t,n)=>{(0,c.WA)(u(e),{persistence:t}).set(n)},read:(e,t)=>(0,c.WA)(u(e),{persistence:t}).get(),clear:(e,t)=>{(0,c.WA)(u(e),{persistence:t}).del()}},f=e=>Object.fromEntries(e.map((e=>[e,{preferredVersionName:null}])));const p=r.createContext(null);function m(){const e=(0,a._r)(),t=(0,i.L)().docs.versionPersistence,n=(0,r.useMemo)((()=>Object.keys(e)),[e]),[o,l]=(0,r.useState)((()=>f(n)));(0,r.useEffect)((()=>{l(function(e){let{pluginIds:t,versionPersistence:n,allDocsData:r}=e;function a(e){const t=d.read(e,n);return r[e].versions.some((e=>e.name===t))?{preferredVersionName:t}:(d.clear(e,n),{preferredVersionName:null})}return Object.fromEntries(t.map((e=>[e,a(e)])))}({allDocsData:e,versionPersistence:t,pluginIds:n}))}),[e,t,n]);return[o,(0,r.useMemo)((()=>({savePreferredVersion:function(e,n){d.save(e,t,n),l((t=>({...t,[e]:{preferredVersionName:n}})))}})),[t])]}function h(e){let{children:t}=e;const n=m();return r.createElement(p.Provider,{value:n},t)}function g(e){let{children:t}=e;return l.cE?r.createElement(h,null,t):r.createElement(r.Fragment,null,t)}function b(){const e=(0,r.useContext)(p);if(!e)throw new s.i6("DocsPreferredVersionContextProvider");return e}function v(e){void 0===e&&(e=o.m);const t=(0,a.zh)(e),[n,i]=b(),{preferredVersionName:l}=n[e];return{preferredVersion:t.versions.find((e=>e.name===l))??null,savePreferredVersionName:(0,r.useCallback)((t=>{i.savePreferredVersion(e,t)}),[i,e])}}function y(){const e=(0,a._r)(),[t]=b();function n(n){const r=e[n],{preferredVersionName:a}=t[n];return r.versions.find((e=>e.name===a))??null}const r=Object.keys(e);return Object.fromEntries(r.map((e=>[e,n(e)])))}},1116:(e,t,n)=>{"use strict";n.d(t,{V:()=>s,b:()=>l});var r=n(7294),a=n(902);const o=Symbol("EmptyContext"),i=r.createContext(o);function l(e){let{children:t,name:n,items:a}=e;const o=(0,r.useMemo)((()=>n&&a?{name:n,items:a}:null),[n,a]);return r.createElement(i.Provider,{value:o},t)}function s(){const e=(0,r.useContext)(i);if(e===o)throw new a.i6("DocsSidebarProvider");return e}},3163:(e,t,n)=>{"use strict";n.d(t,{M:()=>d,e:()=>f});var r=n(7294),a=n(3102),o=n(7524),i=n(1980),l=n(6668),s=n(902);const c=r.createContext(void 0);function u(){const e=function(){const e=(0,a.HY)(),{items:t}=(0,l.L)().navbar;return 0===t.length&&!e.component}(),t=(0,o.i)(),n=!e&&"mobile"===t,[s,c]=(0,r.useState)(!1);(0,i.Rb)((()=>{if(s)return c(!1),!1}));const u=(0,r.useCallback)((()=>{c((e=>!e))}),[]);return(0,r.useEffect)((()=>{"desktop"===t&&c(!1)}),[t]),(0,r.useMemo)((()=>({disabled:e,shouldRender:n,toggle:u,shown:s})),[e,n,u,s])}function d(e){let{children:t}=e;const n=u();return r.createElement(c.Provider,{value:n},t)}function f(){const e=r.useContext(c);if(void 0===e)throw new s.i6("NavbarMobileSidebarProvider");return e}},3102:(e,t,n)=>{"use strict";n.d(t,{HY:()=>l,Zo:()=>s,n2:()=>i});var r=n(7294),a=n(902);const o=r.createContext(null);function i(e){let{children:t}=e;const n=(0,r.useState)({component:null,props:null});return r.createElement(o.Provider,{value:n},t)}function l(){const e=(0,r.useContext)(o);if(!e)throw new a.i6("NavbarSecondaryMenuContentProvider");return e[0]}function s(e){let{component:t,props:n}=e;const i=(0,r.useContext)(o);if(!i)throw new a.i6("NavbarSecondaryMenuContentProvider");const[,l]=i,s=(0,a.Ql)(n);return(0,r.useEffect)((()=>{l({component:t,props:s})}),[l,t,s]),(0,r.useEffect)((()=>()=>l({component:null,props:null})),[l]),null}},9727:(e,t,n)=>{"use strict";n.d(t,{h:()=>a,t:()=>o});var r=n(7294);const a="navigation-with-keyboard";function o(){(0,r.useEffect)((()=>{function e(e){"keydown"===e.type&&"Tab"===e.key&&document.body.classList.add(a),"mousedown"===e.type&&document.body.classList.remove(a)}return document.addEventListener("keydown",e),document.addEventListener("mousedown",e),()=>{document.body.classList.remove(a),document.removeEventListener("keydown",e),document.removeEventListener("mousedown",e)}}),[])}},6177:(e,t,n)=>{"use strict";n.d(t,{K:()=>l,M:()=>s});var r=n(7294),a=n(2263),o=n(1980);const i="q";function l(){return(0,o.Nc)(i)}function s(){const{siteConfig:{baseUrl:e,themeConfig:t}}=(0,a.Z)(),{algolia:{searchPagePath:n}}=t;return(0,r.useCallback)((t=>`${e}${n}?${i}=${encodeURIComponent(t)}`),[e,n])}},7524:(e,t,n)=>{"use strict";n.d(t,{i:()=>c});var r=n(7294),a=n(412);const o={desktop:"desktop",mobile:"mobile",ssr:"ssr"},i=996;function l(){return a.Z.canUseDOM?window.innerWidth>i?o.desktop:o.mobile:o.ssr}const s=!1;function c(){const[e,t]=(0,r.useState)((()=>s?"ssr":l()));return(0,r.useEffect)((()=>{function e(){t(l())}const n=s?window.setTimeout(e,1e3):void 0;return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e),clearTimeout(n)}}),[]),e}},5281:(e,t,n)=>{"use strict";n.d(t,{k:()=>r});const r={page:{blogListPage:"blog-list-page",blogPostPage:"blog-post-page",blogTagsListPage:"blog-tags-list-page",blogTagPostListPage:"blog-tags-post-list-page",docsDocPage:"docs-doc-page",docsTagsListPage:"docs-tags-list-page",docsTagDocListPage:"docs-tags-doc-list-page",mdxPage:"mdx-page"},wrapper:{main:"main-wrapper",blogPages:"blog-wrapper",docsPages:"docs-wrapper",mdxPages:"mdx-wrapper"},common:{editThisPage:"theme-edit-this-page",lastUpdated:"theme-last-updated",backToTopButton:"theme-back-to-top-button",codeBlock:"theme-code-block",admonition:"theme-admonition",admonitionType:e=>`theme-admonition-${e}`},layout:{},docs:{docVersionBanner:"theme-doc-version-banner",docVersionBadge:"theme-doc-version-badge",docBreadcrumbs:"theme-doc-breadcrumbs",docMarkdown:"theme-doc-markdown",docTocMobile:"theme-doc-toc-mobile",docTocDesktop:"theme-doc-toc-desktop",docFooter:"theme-doc-footer",docFooterTagsRow:"theme-doc-footer-tags-row",docFooterEditMetaRow:"theme-doc-footer-edit-meta-row",docSidebarContainer:"theme-doc-sidebar-container",docSidebarMenu:"theme-doc-sidebar-menu",docSidebarItemCategory:"theme-doc-sidebar-item-category",docSidebarItemLink:"theme-doc-sidebar-item-link",docSidebarItemCategoryLevel:e=>`theme-doc-sidebar-item-category-level-${e}`,docSidebarItemLinkLevel:e=>`theme-doc-sidebar-item-link-level-${e}`},blog:{}}},1442:(e,t,n)=>{"use strict";function r(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}n.d(t,{n:()=>r})},3438:(e,t,n)=>{"use strict";n.d(t,{Wl:()=>f,_F:()=>h,cE:()=>d,hI:()=>k,lO:()=>v,oz:()=>y,s1:()=>b,vY:()=>w});var r=n(7294),a=n(6550),o=n(8790),i=n(143),l=n(373),s=n(1116),c=n(7392),u=n(8596);const d=!!i._r;function f(e){if(e.href)return e.href;for(const t of e.items){if("link"===t.type)return t.href;if("category"===t.type){const e=f(t);if(e)return e}}}const p=(e,t)=>void 0!==e&&(0,u.Mg)(e,t),m=(e,t)=>e.some((e=>h(e,t)));function h(e,t){return"link"===e.type?p(e.href,t):"category"===e.type&&(p(e.href,t)||m(e.items,t))}function g(e){let{sidebarItems:t,pathname:n,onlyCategories:r=!1}=e;const a=[];return function e(t){for(const o of t)if("category"===o.type&&((0,u.Mg)(o.href,n)||e(o.items))||"link"===o.type&&(0,u.Mg)(o.href,n)){return r&&"category"!==o.type||a.unshift(o),!0}return!1}(t),a}function b(){const e=(0,s.V)(),{pathname:t}=(0,a.TH)(),n=(0,i.gA)()?.pluginData.breadcrumbs;return!1!==n&&e?g({sidebarItems:e.items,pathname:t}):null}function v(e){const{activeVersion:t}=(0,i.Iw)(e),{preferredVersion:n}=(0,l.J)(e),a=(0,i.yW)(e);return(0,r.useMemo)((()=>(0,c.j)([t,n,a].filter(Boolean))),[t,n,a])}function y(e,t){const n=v(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.sidebars?Object.entries(e.sidebars):[])),r=t.find((t=>t[0]===e));if(!r)throw new Error(`Can't find any sidebar with id "${e}" in version${n.length>1?"s":""} ${n.map((e=>e.name)).join(", ")}".\nAvailable sidebar ids are:\n- ${t.map((e=>e[0])).join("\n- ")}`);return r[1]}),[e,n])}function w(e,t){const n=v(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.docs)),r=t.find((t=>t.id===e));if(!r){if(n.flatMap((e=>e.draftIds)).includes(e))return null;throw new Error(`Couldn't find any doc with id "${e}" in version${n.length>1?"s":""} "${n.map((e=>e.name)).join(", ")}".\nAvailable doc ids are:\n- ${(0,c.j)(t.map((e=>e.id))).join("\n- ")}`)}return r}),[e,n])}function k(e){let{route:t,versionMetadata:n}=e;const r=(0,a.TH)(),i=t.routes,l=i.find((e=>(0,a.LX)(r.pathname,e)));if(!l)return null;const s=l.sidebar,c=s?n.docsSidebars[s]:void 0;return{docElement:(0,o.H)(i),sidebarName:s,sidebarItems:c}}},2128:(e,t,n)=>{"use strict";n.d(t,{p:()=>a});var r=n(2263);function a(e){const{siteConfig:t}=(0,r.Z)(),{title:n,titleDelimiter:a}=t;return e?.trim().length?`${e.trim()} ${a} ${n}`:n}},1980:(e,t,n)=>{"use strict";n.d(t,{Nc:()=>c,Rb:()=>l,_X:()=>s});var r=n(7294),a=n(6550),o=n(1688),i=n(902);function l(e){!function(e){const t=(0,a.k6)(),n=(0,i.zX)(e);(0,r.useEffect)((()=>t.block(((e,t)=>n(e,t)))),[t,n])}(((t,n)=>{if("POP"===n)return e(t,n)}))}function s(e){return function(e){const t=(0,a.k6)();return(0,o.useSyncExternalStore)(t.listen,(()=>e(t)),(()=>e(t)))}((t=>null===e?null:new URLSearchParams(t.location.search).get(e)))}function c(e){const t=s(e)??"",n=function(){const e=(0,a.k6)();return(0,r.useCallback)(((t,n,r)=>{const a=new URLSearchParams(e.location.search);n?a.set(t,n):a.delete(t),(r?.push?e.push:e.replace)({search:a.toString()})}),[e])}();return[t,(0,r.useCallback)(((t,r)=>{n(e,t,r)}),[n,e])]}},7392:(e,t,n)=>{"use strict";function r(e,t){return void 0===t&&(t=(e,t)=>e===t),e.filter(((n,r)=>e.findIndex((e=>t(e,n)))!==r))}function a(e){return Array.from(new Set(e))}n.d(t,{j:()=>a,l:()=>r})},833:(e,t,n)=>{"use strict";n.d(t,{FG:()=>f,d:()=>u,VC:()=>p});var r=n(7294),a=n(6010),o=n(5742),i=n(226);function l(){const e=r.useContext(i._);if(!e)throw new Error("Unexpected: no Docusaurus route context found");return e}var s=n(4996),c=n(2128);function u(e){let{title:t,description:n,keywords:a,image:i,children:l}=e;const u=(0,c.p)(t),{withBaseUrl:d}=(0,s.C)(),f=i?d(i,{absolute:!0}):void 0;return r.createElement(o.Z,null,t&&r.createElement("title",null,u),t&&r.createElement("meta",{property:"og:title",content:u}),n&&r.createElement("meta",{name:"description",content:n}),n&&r.createElement("meta",{property:"og:description",content:n}),a&&r.createElement("meta",{name:"keywords",content:Array.isArray(a)?a.join(","):a}),f&&r.createElement("meta",{property:"og:image",content:f}),f&&r.createElement("meta",{name:"twitter:image",content:f}),l)}const d=r.createContext(void 0);function f(e){let{className:t,children:n}=e;const i=r.useContext(d),l=(0,a.Z)(i,t);return r.createElement(d.Provider,{value:l},r.createElement(o.Z,null,r.createElement("html",{className:l})),n)}function p(e){let{children:t}=e;const n=l(),o=`plugin-${n.plugin.name.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi,"")}`;const i=`plugin-id-${n.plugin.id}`;return r.createElement(f,{className:(0,a.Z)(o,i)},t)}},902:(e,t,n)=>{"use strict";n.d(t,{D9:()=>i,Qc:()=>c,Ql:()=>s,i6:()=>l,zX:()=>o});var r=n(7294);const a=n(412).Z.canUseDOM?r.useLayoutEffect:r.useEffect;function o(e){const t=(0,r.useRef)(e);return a((()=>{t.current=e}),[e]),(0,r.useCallback)((function(){return t.current(...arguments)}),[])}function i(e){const t=(0,r.useRef)();return a((()=>{t.current=e})),t.current}class l extends Error{constructor(e,t){super(),this.name="ReactContextError",this.message=`Hook ${this.stack?.split("\n")[1]?.match(/at (?:\w+\.)?(?<name>\w+)/)?.groups.name??""} is called outside the <${e}>. ${t??""}`}}function s(e){const t=Object.entries(e);return t.sort(((e,t)=>e[0].localeCompare(t[0]))),(0,r.useMemo)((()=>e),t.flat())}function c(e){return t=>{let{children:n}=t;return r.createElement(r.Fragment,null,e.reduceRight(((e,t)=>r.createElement(t,null,e)),n))}}},8022:(e,t,n)=>{"use strict";function r(e,t){return void 0!==e&&void 0!==t&&new RegExp(e,"gi").test(t)}n.d(t,{F:()=>r})},8596:(e,t,n)=>{"use strict";n.d(t,{Mg:()=>i,Ns:()=>l});var r=n(7294),a=n(723),o=n(2263);function i(e,t){const n=e=>(!e||e.endsWith("/")?e:`${e}/`)?.toLowerCase();return n(e)===n(t)}function l(){const{baseUrl:e}=(0,o.Z)().siteConfig;return(0,r.useMemo)((()=>function(e){let{baseUrl:t,routes:n}=e;function r(e){return e.path===t&&!0===e.exact}function a(e){return e.path===t&&!e.exact}return function e(t){if(0===t.length)return;return t.find(r)||e(t.filter(a).flatMap((e=>e.routes??[])))}(n)}({routes:a.Z,baseUrl:e})),[e])}},2466:(e,t,n)=>{"use strict";n.d(t,{Ct:()=>p,OC:()=>s,RF:()=>d,o5:()=>f});var r=n(7294),a=n(412),o=n(2389),i=n(902);const l=r.createContext(void 0);function s(e){let{children:t}=e;const n=function(){const e=(0,r.useRef)(!0);return(0,r.useMemo)((()=>({scrollEventsEnabledRef:e,enableScrollEvents:()=>{e.current=!0},disableScrollEvents:()=>{e.current=!1}})),[])}();return r.createElement(l.Provider,{value:n},t)}function c(){const e=(0,r.useContext)(l);if(null==e)throw new i.i6("ScrollControllerProvider");return e}const u=()=>a.Z.canUseDOM?{scrollX:window.pageXOffset,scrollY:window.pageYOffset}:null;function d(e,t){void 0===t&&(t=[]);const{scrollEventsEnabledRef:n}=c(),a=(0,r.useRef)(u()),o=(0,i.zX)(e);(0,r.useEffect)((()=>{const e=()=>{if(!n.current)return;const e=u();o(e,a.current),a.current=e},t={passive:!0};return e(),window.addEventListener("scroll",e,t),()=>window.removeEventListener("scroll",e,t)}),[o,n,...t])}function f(){const e=c(),t=function(){const e=(0,r.useRef)({elem:null,top:0}),t=(0,r.useCallback)((t=>{e.current={elem:t,top:t.getBoundingClientRect().top}}),[]),n=(0,r.useCallback)((()=>{const{current:{elem:t,top:n}}=e;if(!t)return{restored:!1};const r=t.getBoundingClientRect().top-n;return r&&window.scrollBy({left:0,top:r}),e.current={elem:null,top:0},{restored:0!==r}}),[]);return(0,r.useMemo)((()=>({save:t,restore:n})),[n,t])}(),n=(0,r.useRef)(void 0),a=(0,r.useCallback)((r=>{t.save(r),e.disableScrollEvents(),n.current=()=>{const{restored:r}=t.restore();if(n.current=void 0,r){const t=()=>{e.enableScrollEvents(),window.removeEventListener("scroll",t)};window.addEventListener("scroll",t)}else e.enableScrollEvents()}}),[e,t]);return(0,r.useLayoutEffect)((()=>{queueMicrotask((()=>n.current?.()))})),{blockElementScrollPositionUntilNextRender:a}}function p(){const e=(0,r.useRef)(null),t=(0,o.Z)()&&"smooth"===getComputedStyle(document.documentElement).scrollBehavior;return{startScroll:n=>{e.current=t?function(e){return window.scrollTo({top:e,behavior:"smooth"}),()=>{}}(n):function(e){let t=null;const n=document.documentElement.scrollTop>e;return function r(){const a=document.documentElement.scrollTop;(n&&a>e||!n&&a<e)&&(t=requestAnimationFrame(r),window.scrollTo(0,Math.floor(.85*(a-e))+e))}(),()=>t&&cancelAnimationFrame(t)}(n)},cancelScroll:()=>e.current?.()}}},3320:(e,t,n)=>{"use strict";n.d(t,{HX:()=>i,_q:()=>s,os:()=>l});var r=n(143),a=n(2263),o=n(373);const i="default";function l(e,t){return`docs-${e}-${t}`}function s(){const{i18n:e}=(0,a.Z)(),t=(0,r._r)(),n=(0,r.WS)(),s=(0,o.Oh)();const c=[i,...Object.keys(t).map((function(e){const r=n?.activePlugin.pluginId===e?n.activeVersion:void 0,a=s[e],o=t[e].versions.find((e=>e.isLast));return l(e,(r??a??o).name)}))];return{locale:e.currentLocale,tags:c}}},12:(e,t,n)=>{"use strict";n.d(t,{Nk:()=>d,WA:()=>u});var r=n(7294),a=n(1688);const o="localStorage";function i(e){let{key:t,oldValue:n,newValue:r,storage:a}=e;if(n===r)return;const o=document.createEvent("StorageEvent");o.initStorageEvent("storage",!1,!1,t,n,r,window.location.href,a),window.dispatchEvent(o)}function l(e){if(void 0===e&&(e=o),"undefined"==typeof window)throw new Error("Browser storage is not available on Node.js/Docusaurus SSR process.");if("none"===e)return null;try{return window[e]}catch(n){return t=n,s||(console.warn("Docusaurus browser storage is not available.\nPossible reasons: running Docusaurus in an iframe, in an incognito browser session, or using too strict browser privacy settings.",t),s=!0),null}var t}let s=!1;const c={get:()=>null,set:()=>{},del:()=>{},listen:()=>()=>{}};function u(e,t){if("undefined"==typeof window)return function(e){function t(){throw new Error(`Illegal storage API usage for storage key "${e}".\nDocusaurus storage APIs are not supposed to be called on the server-rendering process.\nPlease only call storage APIs in effects and event handlers.`)}return{get:t,set:t,del:t,listen:t}}(e);const n=l(t?.persistence);return null===n?c:{get:()=>{try{return n.getItem(e)}catch(t){return console.error(`Docusaurus storage error, can't get key=${e}`,t),null}},set:t=>{try{const r=n.getItem(e);n.setItem(e,t),i({key:e,oldValue:r,newValue:t,storage:n})}catch(r){console.error(`Docusaurus storage error, can't set ${e}=${t}`,r)}},del:()=>{try{const t=n.getItem(e);n.removeItem(e),i({key:e,oldValue:t,newValue:null,storage:n})}catch(t){console.error(`Docusaurus storage error, can't delete key=${e}`,t)}},listen:t=>{try{const r=r=>{r.storageArea===n&&r.key===e&&t(r)};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)}catch(r){return console.error(`Docusaurus storage error, can't listen for changes of key=${e}`,r),()=>{}}}}}function d(e,t){const n=(0,r.useRef)((()=>null===e?c:u(e,t))).current(),o=(0,r.useCallback)((e=>"undefined"==typeof window?()=>{}:n.listen(e)),[n]);return[(0,a.useSyncExternalStore)(o,(()=>"undefined"==typeof window?null:n.get()),(()=>null)),n]}},4711:(e,t,n)=>{"use strict";n.d(t,{l:()=>i});var r=n(2263),a=n(6550),o=n(8780);function i(){const{siteConfig:{baseUrl:e,url:t,trailingSlash:n},i18n:{defaultLocale:i,currentLocale:l}}=(0,r.Z)(),{pathname:s}=(0,a.TH)(),c=(0,o.applyTrailingSlash)(s,{trailingSlash:n,baseUrl:e}),u=l===i?e:e.replace(`/${l}/`,"/"),d=c.replace(e,"");return{createUrl:function(e){let{locale:n,fullyQualified:r}=e;return`${r?t:""}${function(e){return e===i?`${u}`:`${u}${e}/`}(n)}${d}`}}}},5936:(e,t,n)=>{"use strict";n.d(t,{S:()=>i});var r=n(7294),a=n(6550),o=n(902);function i(e){const t=(0,a.TH)(),n=(0,o.D9)(t),i=(0,o.zX)(e);(0,r.useEffect)((()=>{n&&t!==n&&i({location:t,previousLocation:n})}),[i,t,n])}},6668:(e,t,n)=>{"use strict";n.d(t,{L:()=>a});var r=n(2263);function a(){return(0,r.Z)().siteConfig.themeConfig}},6278:(e,t,n)=>{"use strict";n.d(t,{L:()=>a});var r=n(2263);function a(){const{siteConfig:{themeConfig:e}}=(0,r.Z)();return e}},239:(e,t,n)=>{"use strict";n.d(t,{l:()=>l});var r=n(7294),a=n(8022),o=n(4996),i=n(6278);function l(){const{withBaseUrl:e}=(0,o.C)(),{algolia:{externalUrlRegex:t,replaceSearchResultPathname:n}}=(0,i.L)();return(0,r.useCallback)((r=>{const o=new URL(r);if((0,a.F)(t,o.href))return r;const i=`${o.pathname+o.hash}`;return e(function(e,t){return t?e.replaceAll(new RegExp(t.from,"g"),t.to):e}(i,n))}),[e,t,n])}},8802:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const{trailingSlash:n,baseUrl:r}=t;if(e.startsWith("#"))return e;if(void 0===n)return e;const[a]=e.split(/[#?]/),o="/"===a||a===r?a:(i=a,n?function(e){return e.endsWith("/")?e:`${e}/`}(i):function(e){return e.endsWith("/")?e.slice(0,-1):e}(i));var i;return e.replace(a,o)}},4143:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=void 0,t.getErrorCausalChain=function e(t){return t.cause?[t,...e(t.cause)]:[t]}},8780:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=t.applyTrailingSlash=t.blogPostContainerID=void 0,t.blogPostContainerID="__blog-post-container";var a=n(8802);Object.defineProperty(t,"applyTrailingSlash",{enumerable:!0,get:function(){return r(a).default}});var o=n(4143);Object.defineProperty(t,"getErrorCausalChain",{enumerable:!0,get:function(){return o.getErrorCausalChain}})},6010:(e,t,n)=>{"use strict";function r(e){var t,n,a="";if("string"==typeof e||"number"==typeof e)a+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r(e[t]))&&(a&&(a+=" "),a+=n);else for(t in e)e[t]&&(a&&(a+=" "),a+=t);return a}n.d(t,{Z:()=>a});const a=function(){for(var e,t,n=0,a="";n<arguments.length;)(e=arguments[n++])&&(t=r(e))&&(a&&(a+=" "),a+=t);return a}},9318:(e,t,n)=>{"use strict";n.d(t,{lX:()=>w,q_:()=>T,ob:()=>p,PP:()=>A,Ep:()=>f});var r=n(7462);function a(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,a=e.length;r<a;n+=1,r+=1)e[n]=e[r];e.pop()}const i=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],i=t&&t.split("/")||[],l=e&&a(e),s=t&&a(t),c=l||s;if(e&&a(e)?i=r:r.length&&(i.pop(),i=i.concat(r)),!i.length)return"/";if(i.length){var u=i[i.length-1];n="."===u||".."===u||""===u}else n=!1;for(var d=0,f=i.length;f>=0;f--){var p=i[f];"."===p?o(i,f):".."===p?(o(i,f),d++):d&&(o(i,f),d--)}if(!c)for(;d--;d)i.unshift("..");!c||""===i[0]||i[0]&&a(i[0])||i.unshift("");var m=i.join("/");return n&&"/"!==m.substr(-1)&&(m+="/"),m};var l=n(8776);function s(e){return"/"===e.charAt(0)?e:"/"+e}function c(e){return"/"===e.charAt(0)?e.substr(1):e}function u(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function d(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function f(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}function p(e,t,n,a){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),o.state=t):(void 0===(o=(0,r.Z)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(l){throw l instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):l}return n&&(o.key=n),a?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=i(o.pathname,a.pathname)):o.pathname=a.pathname:o.pathname||(o.pathname="/"),o}function m(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,a):a(!0):a(!1!==o)}else a(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var h=!("undefined"==typeof window||!window.document||!window.document.createElement);function g(e,t){t(window.confirm(e))}var b="popstate",v="hashchange";function y(){try{return window.history.state||{}}catch(e){return{}}}function w(e){void 0===e&&(e={}),h||(0,l.Z)(!1);var t,n=window.history,a=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,o=!(-1===window.navigator.userAgent.indexOf("Trident")),i=e,c=i.forceRefresh,w=void 0!==c&&c,k=i.getUserConfirmation,E=void 0===k?g:k,S=i.keyLength,x=void 0===S?6:S,C=e.basename?d(s(e.basename)):"";function T(e){var t=e||{},n=t.key,r=t.state,a=window.location,o=a.pathname+a.search+a.hash;return C&&(o=u(o,C)),p(o,r,n)}function _(){return Math.random().toString(36).substr(2,x)}var A=m();function L(e){(0,r.Z)(U,e),U.length=n.length,A.notifyListeners(U.location,U.action)}function R(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||O(T(e.state))}function P(){O(T(y()))}var N=!1;function O(e){if(N)N=!1,L();else{A.confirmTransitionTo(e,"POP",E,(function(t){t?L({action:"POP",location:e}):function(e){var t=U.location,n=D.indexOf(t.key);-1===n&&(n=0);var r=D.indexOf(e.key);-1===r&&(r=0);var a=n-r;a&&(N=!0,F(a))}(e)}))}}var I=T(y()),D=[I.key];function M(e){return C+f(e)}function F(e){n.go(e)}var B=0;function j(e){1===(B+=e)&&1===e?(window.addEventListener(b,R),o&&window.addEventListener(v,P)):0===B&&(window.removeEventListener(b,R),o&&window.removeEventListener(v,P))}var z=!1;var U={length:n.length,action:"POP",location:I,createHref:M,push:function(e,t){var r="PUSH",o=p(e,t,_(),U.location);A.confirmTransitionTo(o,r,E,(function(e){if(e){var t=M(o),i=o.key,l=o.state;if(a)if(n.pushState({key:i,state:l},null,t),w)window.location.href=t;else{var s=D.indexOf(U.location.key),c=D.slice(0,s+1);c.push(o.key),D=c,L({action:r,location:o})}else window.location.href=t}}))},replace:function(e,t){var r="REPLACE",o=p(e,t,_(),U.location);A.confirmTransitionTo(o,r,E,(function(e){if(e){var t=M(o),i=o.key,l=o.state;if(a)if(n.replaceState({key:i,state:l},null,t),w)window.location.replace(t);else{var s=D.indexOf(U.location.key);-1!==s&&(D[s]=o.key),L({action:r,location:o})}else window.location.replace(t)}}))},go:F,goBack:function(){F(-1)},goForward:function(){F(1)},block:function(e){void 0===e&&(e=!1);var t=A.setPrompt(e);return z||(j(1),z=!0),function(){return z&&(z=!1,j(-1)),t()}},listen:function(e){var t=A.appendListener(e);return j(1),function(){j(-1),t()}}};return U}var k="hashchange",E={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+c(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:c,decodePath:s},slash:{encodePath:s,decodePath:s}};function S(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function x(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function C(e){window.location.replace(S(window.location.href)+"#"+e)}function T(e){void 0===e&&(e={}),h||(0,l.Z)(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),a=n.getUserConfirmation,o=void 0===a?g:a,i=n.hashType,c=void 0===i?"slash":i,b=e.basename?d(s(e.basename)):"",v=E[c],y=v.encodePath,w=v.decodePath;function T(){var e=w(x());return b&&(e=u(e,b)),p(e)}var _=m();function A(e){(0,r.Z)(z,e),z.length=t.length,_.notifyListeners(z.location,z.action)}var L=!1,R=null;function P(){var e,t,n=x(),r=y(n);if(n!==r)C(r);else{var a=T(),i=z.location;if(!L&&(t=a,(e=i).pathname===t.pathname&&e.search===t.search&&e.hash===t.hash))return;if(R===f(a))return;R=null,function(e){if(L)L=!1,A();else{var t="POP";_.confirmTransitionTo(e,t,o,(function(n){n?A({action:t,location:e}):function(e){var t=z.location,n=D.lastIndexOf(f(t));-1===n&&(n=0);var r=D.lastIndexOf(f(e));-1===r&&(r=0);var a=n-r;a&&(L=!0,M(a))}(e)}))}}(a)}}var N=x(),O=y(N);N!==O&&C(O);var I=T(),D=[f(I)];function M(e){t.go(e)}var F=0;function B(e){1===(F+=e)&&1===e?window.addEventListener(k,P):0===F&&window.removeEventListener(k,P)}var j=!1;var z={length:t.length,action:"POP",location:I,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&(n=S(window.location.href)),n+"#"+y(b+f(e))},push:function(e,t){var n="PUSH",r=p(e,void 0,void 0,z.location);_.confirmTransitionTo(r,n,o,(function(e){if(e){var t=f(r),a=y(b+t);if(x()!==a){R=t,function(e){window.location.hash=e}(a);var o=D.lastIndexOf(f(z.location)),i=D.slice(0,o+1);i.push(t),D=i,A({action:n,location:r})}else A()}}))},replace:function(e,t){var n="REPLACE",r=p(e,void 0,void 0,z.location);_.confirmTransitionTo(r,n,o,(function(e){if(e){var t=f(r),a=y(b+t);x()!==a&&(R=t,C(a));var o=D.indexOf(f(z.location));-1!==o&&(D[o]=t),A({action:n,location:r})}}))},go:M,goBack:function(){M(-1)},goForward:function(){M(1)},block:function(e){void 0===e&&(e=!1);var t=_.setPrompt(e);return j||(B(1),j=!0),function(){return j&&(j=!1,B(-1)),t()}},listen:function(e){var t=_.appendListener(e);return B(1),function(){B(-1),t()}}};return z}function _(e,t,n){return Math.min(Math.max(e,t),n)}function A(e){void 0===e&&(e={});var t=e,n=t.getUserConfirmation,a=t.initialEntries,o=void 0===a?["/"]:a,i=t.initialIndex,l=void 0===i?0:i,s=t.keyLength,c=void 0===s?6:s,u=m();function d(e){(0,r.Z)(w,e),w.length=w.entries.length,u.notifyListeners(w.location,w.action)}function h(){return Math.random().toString(36).substr(2,c)}var g=_(l,0,o.length-1),b=o.map((function(e){return p(e,void 0,"string"==typeof e?h():e.key||h())})),v=f;function y(e){var t=_(w.index+e,0,w.entries.length-1),r=w.entries[t];u.confirmTransitionTo(r,"POP",n,(function(e){e?d({action:"POP",location:r,index:t}):d()}))}var w={length:b.length,action:"POP",location:b[g],index:g,entries:b,createHref:v,push:function(e,t){var r="PUSH",a=p(e,t,h(),w.location);u.confirmTransitionTo(a,r,n,(function(e){if(e){var t=w.index+1,n=w.entries.slice(0);n.length>t?n.splice(t,n.length-t,a):n.push(a),d({action:r,location:a,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",a=p(e,t,h(),w.location);u.confirmTransitionTo(a,r,n,(function(e){e&&(w.entries[w.index]=a,d({action:r,location:a}))}))},go:y,goBack:function(){y(-1)},goForward:function(){y(1)},canGo:function(e){var t=w.index+e;return t>=0&&t<w.entries.length},block:function(e){return void 0===e&&(e=!1),u.setPrompt(e)},listen:function(e){return u.appendListener(e)}};return w}},8679:(e,t,n)=>{"use strict";var r=n(9864),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?i:l[e.$$typeof]||a}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var a=p(n);a&&a!==m&&e(t,a,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var l=s(t),h=s(n),g=0;g<i.length;++g){var b=i[g];if(!(o[b]||r&&r[b]||h&&h[b]||l&&l[b])){var v=f(n,b);try{c(t,b,v)}catch(y){}}}}return t}},1143:e=>{"use strict";e.exports=function(e,t,n,r,a,o,i,l){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,a,o,i,l],u=0;(s=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw s.framesToPop=1,s}}},5826:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},2497:(e,t,n)=>{"use strict";n.r(t)},2295:(e,t,n)=>{"use strict";n.r(t)},4865:function(e,t,n){var r,a;r=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};function a(e,t,n){return e<t?t:e>n?n:e}function o(e){return 100*(-1+e)}function i(e,t,n){var a;return(a="translate3d"===r.positionUsing?{transform:"translate3d("+o(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+o(e)+"%,0)"}:{"margin-left":o(e)+"%"}).transition="all "+t+"ms "+n,a}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=a(e,r.minimum,1),n.status=1===e?null:e;var o=n.render(!t),c=o.querySelector(r.barSelector),u=r.speed,d=r.easing;return o.offsetWidth,l((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),s(c,i(e,u,d)),1===e?(s(o,{transition:"none",opacity:1}),o.offsetWidth,setTimeout((function(){s(o,{transition:"all "+u+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),u)}),u)):setTimeout(t,u)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*a(Math.random()*t,.1,.95)),t=a(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var a,i=t.querySelector(r.barSelector),l=e?"-100":o(n.status||0),c=document.querySelector(r.parent);return s(i,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),r.showSpinner||(a=t.querySelector(r.spinnerSelector))&&p(a),c!=document.body&&u(c,"nprogress-custom-parent"),c.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&p(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var l=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),s=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;for(var r,a=e.length,o=t.charAt(0).toUpperCase()+t.slice(1);a--;)if((r=e[a]+o)in n)return r;return t}function a(e){return e=n(e),t[e]||(t[e]=r(e))}function o(e,t,n){t=a(t),e.style[t]=n}return function(e,t){var n,r,a=arguments;if(2==a.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&o(e,n,r);else o(e,a[1],a[2])}}();function c(e,t){return("string"==typeof e?e:f(e)).indexOf(" "+t+" ")>=0}function u(e,t){var n=f(e),r=n+t;c(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=f(e);c(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function f(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function p(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n},void 0===(a="function"==typeof r?r.call(t,n,t,e):r)||(e.exports=a)},7418:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(a){return!1}}()?Object.assign:function(e,a){for(var o,i,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),s=1;s<arguments.length;s++){for(var c in o=Object(arguments[s]))n.call(o,c)&&(l[c]=o[c]);if(t){i=t(o);for(var u=0;u<i.length;u++)r.call(o,i[u])&&(l[i[u]]=o[i[u]])}}return l}},4779:(e,t,n)=>{var r=n(5826);e.exports=p,e.exports.parse=o,e.exports.compile=function(e,t){return l(o(e,t),t)},e.exports.tokensToFunction=l,e.exports.tokensToRegExp=f;var a=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(e,t){for(var n,r=[],o=0,i=0,l="",u=t&&t.delimiter||"/";null!=(n=a.exec(e));){var d=n[0],f=n[1],p=n.index;if(l+=e.slice(i,p),i=p+d.length,f)l+=f[1];else{var m=e[i],h=n[2],g=n[3],b=n[4],v=n[5],y=n[6],w=n[7];l&&(r.push(l),l="");var k=null!=h&&null!=m&&m!==h,E="+"===y||"*"===y,S="?"===y||"*"===y,x=n[2]||u,C=b||v;r.push({name:g||o++,prefix:h||"",delimiter:x,optional:S,repeat:E,partial:k,asterisk:!!w,pattern:C?c(C):w?".*":"[^"+s(x)+"]+?"})}}return i<e.length&&(l+=e.substr(i)),l&&r.push(l),r}function i(e){return encodeURI(e).replace(/[\/?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function l(e,t){for(var n=new Array(e.length),a=0;a<e.length;a++)"object"==typeof e[a]&&(n[a]=new RegExp("^(?:"+e[a].pattern+")$",d(t)));return function(t,a){for(var o="",l=t||{},s=(a||{}).pretty?i:encodeURIComponent,c=0;c<e.length;c++){var u=e[c];if("string"!=typeof u){var d,f=l[u.name];if(null==f){if(u.optional){u.partial&&(o+=u.prefix);continue}throw new TypeError('Expected "'+u.name+'" to be defined')}if(r(f)){if(!u.repeat)throw new TypeError('Expected "'+u.name+'" to not repeat, but received `'+JSON.stringify(f)+"`");if(0===f.length){if(u.optional)continue;throw new TypeError('Expected "'+u.name+'" to not be empty')}for(var p=0;p<f.length;p++){if(d=s(f[p]),!n[c].test(d))throw new TypeError('Expected all "'+u.name+'" to match "'+u.pattern+'", but received `'+JSON.stringify(d)+"`");o+=(0===p?u.prefix:u.delimiter)+d}}else{if(d=u.asterisk?encodeURI(f).replace(/[?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})):s(f),!n[c].test(d))throw new TypeError('Expected "'+u.name+'" to match "'+u.pattern+'", but received "'+d+'"');o+=u.prefix+d}}else o+=u}return o}}function s(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function c(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function u(e,t){return e.keys=t,e}function d(e){return e&&e.sensitive?"":"i"}function f(e,t,n){r(t)||(n=t||n,t=[]);for(var a=(n=n||{}).strict,o=!1!==n.end,i="",l=0;l<e.length;l++){var c=e[l];if("string"==typeof c)i+=s(c);else{var f=s(c.prefix),p="(?:"+c.pattern+")";t.push(c),c.repeat&&(p+="(?:"+f+p+")*"),i+=p=c.optional?c.partial?f+"("+p+")?":"(?:"+f+"("+p+"))?":f+"("+p+")"}}var m=s(n.delimiter||"/"),h=i.slice(-m.length)===m;return a||(i=(h?i.slice(0,-m.length):i)+"(?:"+m+"(?=$))?"),i+=o?"$":a&&h?"":"(?="+m+"|$)",u(new RegExp("^"+i,d(n)),t)}function p(e,t,n){return r(t)||(n=t||n,t=[]),n=n||{},e instanceof RegExp?function(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return u(e,t)}(e,t):r(e)?function(e,t,n){for(var r=[],a=0;a<e.length;a++)r.push(p(e[a],t,n).source);return u(new RegExp("(?:"+r.join("|")+")",d(n)),t)}(e,t,n):function(e,t,n){return f(o(e,n),t,n)}(e,t,n)}},9901:e=>{e.exports&&(e.exports={core:{meta:{path:"components/prism-core.js",option:"mandatory"},core:"Core"},themes:{meta:{path:"themes/{id}.css",link:"index.html?theme={id}",exclusive:!0},prism:{title:"Default",option:"default"},"prism-dark":"Dark","prism-funky":"Funky","prism-okaidia":{title:"Okaidia",owner:"ocodia"},"prism-twilight":{title:"Twilight",owner:"remybach"},"prism-coy":{title:"Coy",owner:"tshedor"},"prism-solarizedlight":{title:"Solarized Light",owner:"hectormatos2011 "},"prism-tomorrow":{title:"Tomorrow Night",owner:"Rosey"}},languages:{meta:{path:"components/prism-{id}",noCSS:!0,examplesPath:"examples/prism-{id}",addCheckAll:!0},markup:{title:"Markup",alias:["html","xml","svg","mathml","ssml","atom","rss"],aliasTitles:{html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",ssml:"SSML",atom:"Atom",rss:"RSS"},option:"default"},css:{title:"CSS",option:"default",modify:"markup"},clike:{title:"C-like",option:"default"},javascript:{title:"JavaScript",require:"clike",modify:"markup",optional:"regex",alias:"js",option:"default"},abap:{title:"ABAP",owner:"dellagustin"},abnf:{title:"ABNF",owner:"RunDevelopment"},actionscript:{title:"ActionScript",require:"javascript",modify:"markup",owner:"Golmote"},ada:{title:"Ada",owner:"Lucretia"},agda:{title:"Agda",owner:"xy-ren"},al:{title:"AL",owner:"RunDevelopment"},antlr4:{title:"ANTLR4",alias:"g4",owner:"RunDevelopment"},apacheconf:{title:"Apache Configuration",owner:"GuiTeK"},apex:{title:"Apex",require:["clike","sql"],owner:"RunDevelopment"},apl:{title:"APL",owner:"ngn"},applescript:{title:"AppleScript",owner:"Golmote"},aql:{title:"AQL",owner:"RunDevelopment"},arduino:{title:"Arduino",require:"cpp",alias:"ino",owner:"dkern"},arff:{title:"ARFF",owner:"Golmote"},armasm:{title:"ARM Assembly",alias:"arm-asm",owner:"RunDevelopment"},arturo:{title:"Arturo",alias:"art",optional:["bash","css","javascript","markup","markdown","sql"],owner:"drkameleon"},asciidoc:{alias:"adoc",title:"AsciiDoc",owner:"Golmote"},aspnet:{title:"ASP.NET (C#)",require:["markup","csharp"],owner:"nauzilus"},asm6502:{title:"6502 Assembly",owner:"kzurawel"},asmatmel:{title:"Atmel AVR Assembly",owner:"cerkit"},autohotkey:{title:"AutoHotkey",owner:"aviaryan"},autoit:{title:"AutoIt",owner:"Golmote"},avisynth:{title:"AviSynth",alias:"avs",owner:"Zinfidel"},"avro-idl":{title:"Avro IDL",alias:"avdl",owner:"RunDevelopment"},awk:{title:"AWK",alias:"gawk",aliasTitles:{gawk:"GAWK"},owner:"RunDevelopment"},bash:{title:"Bash",alias:["sh","shell"],aliasTitles:{sh:"Shell",shell:"Shell"},owner:"zeitgeist87"},basic:{title:"BASIC",owner:"Golmote"},batch:{title:"Batch",owner:"Golmote"},bbcode:{title:"BBcode",alias:"shortcode",aliasTitles:{shortcode:"Shortcode"},owner:"RunDevelopment"},bbj:{title:"BBj",owner:"hyyan"},bicep:{title:"Bicep",owner:"johnnyreilly"},birb:{title:"Birb",require:"clike",owner:"Calamity210"},bison:{title:"Bison",require:"c",owner:"Golmote"},bnf:{title:"BNF",alias:"rbnf",aliasTitles:{rbnf:"RBNF"},owner:"RunDevelopment"},bqn:{title:"BQN",owner:"yewscion"},brainfuck:{title:"Brainfuck",owner:"Golmote"},brightscript:{title:"BrightScript",owner:"RunDevelopment"},bro:{title:"Bro",owner:"wayward710"},bsl:{title:"BSL (1C:Enterprise)",alias:"oscript",aliasTitles:{oscript:"OneScript"},owner:"Diversus23"},c:{title:"C",require:"clike",owner:"zeitgeist87"},csharp:{title:"C#",require:"clike",alias:["cs","dotnet"],owner:"mvalipour"},cpp:{title:"C++",require:"c",owner:"zeitgeist87"},cfscript:{title:"CFScript",require:"clike",alias:"cfc",owner:"mjclemente"},chaiscript:{title:"ChaiScript",require:["clike","cpp"],owner:"RunDevelopment"},cil:{title:"CIL",owner:"sbrl"},cilkc:{title:"Cilk/C",require:"c",alias:"cilk-c",owner:"OpenCilk"},cilkcpp:{title:"Cilk/C++",require:"cpp",alias:["cilk-cpp","cilk"],owner:"OpenCilk"},clojure:{title:"Clojure",owner:"troglotit"},cmake:{title:"CMake",owner:"mjrogozinski"},cobol:{title:"COBOL",owner:"RunDevelopment"},coffeescript:{title:"CoffeeScript",require:"javascript",alias:"coffee",owner:"R-osey"},concurnas:{title:"Concurnas",alias:"conc",owner:"jasontatton"},csp:{title:"Content-Security-Policy",owner:"ScottHelme"},cooklang:{title:"Cooklang",owner:"ahue"},coq:{title:"Coq",owner:"RunDevelopment"},crystal:{title:"Crystal",require:"ruby",owner:"MakeNowJust"},"css-extras":{title:"CSS Extras",require:"css",modify:"css",owner:"milesj"},csv:{title:"CSV",owner:"RunDevelopment"},cue:{title:"CUE",owner:"RunDevelopment"},cypher:{title:"Cypher",owner:"RunDevelopment"},d:{title:"D",require:"clike",owner:"Golmote"},dart:{title:"Dart",require:"clike",owner:"Golmote"},dataweave:{title:"DataWeave",owner:"machaval"},dax:{title:"DAX",owner:"peterbud"},dhall:{title:"Dhall",owner:"RunDevelopment"},diff:{title:"Diff",owner:"uranusjr"},django:{title:"Django/Jinja2",require:"markup-templating",alias:"jinja2",owner:"romanvm"},"dns-zone-file":{title:"DNS zone file",owner:"RunDevelopment",alias:"dns-zone"},docker:{title:"Docker",alias:"dockerfile",owner:"JustinBeckwith"},dot:{title:"DOT (Graphviz)",alias:"gv",optional:"markup",owner:"RunDevelopment"},ebnf:{title:"EBNF",owner:"RunDevelopment"},editorconfig:{title:"EditorConfig",owner:"osipxd"},eiffel:{title:"Eiffel",owner:"Conaclos"},ejs:{title:"EJS",require:["javascript","markup-templating"],owner:"RunDevelopment",alias:"eta",aliasTitles:{eta:"Eta"}},elixir:{title:"Elixir",owner:"Golmote"},elm:{title:"Elm",owner:"zwilias"},etlua:{title:"Embedded Lua templating",require:["lua","markup-templating"],owner:"RunDevelopment"},erb:{title:"ERB",require:["ruby","markup-templating"],owner:"Golmote"},erlang:{title:"Erlang",owner:"Golmote"},"excel-formula":{title:"Excel Formula",alias:["xlsx","xls"],owner:"RunDevelopment"},fsharp:{title:"F#",require:"clike",owner:"simonreynolds7"},factor:{title:"Factor",owner:"catb0t"},false:{title:"False",owner:"edukisto"},"firestore-security-rules":{title:"Firestore security rules",require:"clike",owner:"RunDevelopment"},flow:{title:"Flow",require:"javascript",owner:"Golmote"},fortran:{title:"Fortran",owner:"Golmote"},ftl:{title:"FreeMarker Template Language",require:"markup-templating",owner:"RunDevelopment"},gml:{title:"GameMaker Language",alias:"gamemakerlanguage",require:"clike",owner:"LiarOnce"},gap:{title:"GAP (CAS)",owner:"RunDevelopment"},gcode:{title:"G-code",owner:"RunDevelopment"},gdscript:{title:"GDScript",owner:"RunDevelopment"},gedcom:{title:"GEDCOM",owner:"Golmote"},gettext:{title:"gettext",alias:"po",owner:"RunDevelopment"},gherkin:{title:"Gherkin",owner:"hason"},git:{title:"Git",owner:"lgiraudel"},glsl:{title:"GLSL",require:"c",owner:"Golmote"},gn:{title:"GN",alias:"gni",owner:"RunDevelopment"},"linker-script":{title:"GNU Linker Script",alias:"ld",owner:"RunDevelopment"},go:{title:"Go",require:"clike",owner:"arnehormann"},"go-module":{title:"Go module",alias:"go-mod",owner:"RunDevelopment"},gradle:{title:"Gradle",require:"clike",owner:"zeabdelkhalek-badido18"},graphql:{title:"GraphQL",optional:"markdown",owner:"Golmote"},groovy:{title:"Groovy",require:"clike",owner:"robfletcher"},haml:{title:"Haml",require:"ruby",optional:["css","css-extras","coffeescript","erb","javascript","less","markdown","scss","textile"],owner:"Golmote"},handlebars:{title:"Handlebars",require:"markup-templating",alias:["hbs","mustache"],aliasTitles:{mustache:"Mustache"},owner:"Golmote"},haskell:{title:"Haskell",alias:"hs",owner:"bholst"},haxe:{title:"Haxe",require:"clike",optional:"regex",owner:"Golmote"},hcl:{title:"HCL",owner:"outsideris"},hlsl:{title:"HLSL",require:"c",owner:"RunDevelopment"},hoon:{title:"Hoon",owner:"matildepark"},http:{title:"HTTP",optional:["csp","css","hpkp","hsts","javascript","json","markup","uri"],owner:"danielgtaylor"},hpkp:{title:"HTTP Public-Key-Pins",owner:"ScottHelme"},hsts:{title:"HTTP Strict-Transport-Security",owner:"ScottHelme"},ichigojam:{title:"IchigoJam",owner:"BlueCocoa"},icon:{title:"Icon",owner:"Golmote"},"icu-message-format":{title:"ICU Message Format",owner:"RunDevelopment"},idris:{title:"Idris",alias:"idr",owner:"KeenS",require:"haskell"},ignore:{title:".ignore",owner:"osipxd",alias:["gitignore","hgignore","npmignore"],aliasTitles:{gitignore:".gitignore",hgignore:".hgignore",npmignore:".npmignore"}},inform7:{title:"Inform 7",owner:"Golmote"},ini:{title:"Ini",owner:"aviaryan"},io:{title:"Io",owner:"AlesTsurko"},j:{title:"J",owner:"Golmote"},java:{title:"Java",require:"clike",owner:"sherblot"},javadoc:{title:"JavaDoc",require:["markup","java","javadoclike"],modify:"java",optional:"scala",owner:"RunDevelopment"},javadoclike:{title:"JavaDoc-like",modify:["java","javascript","php"],owner:"RunDevelopment"},javastacktrace:{title:"Java stack trace",owner:"RunDevelopment"},jexl:{title:"Jexl",owner:"czosel"},jolie:{title:"Jolie",require:"clike",owner:"thesave"},jq:{title:"JQ",owner:"RunDevelopment"},jsdoc:{title:"JSDoc",require:["javascript","javadoclike","typescript"],modify:"javascript",optional:["actionscript","coffeescript"],owner:"RunDevelopment"},"js-extras":{title:"JS Extras",require:"javascript",modify:"javascript",optional:["actionscript","coffeescript","flow","n4js","typescript"],owner:"RunDevelopment"},json:{title:"JSON",alias:"webmanifest",aliasTitles:{webmanifest:"Web App Manifest"},owner:"CupOfTea696"},json5:{title:"JSON5",require:"json",owner:"RunDevelopment"},jsonp:{title:"JSONP",require:"json",owner:"RunDevelopment"},jsstacktrace:{title:"JS stack trace",owner:"sbrl"},"js-templates":{title:"JS Templates",require:"javascript",modify:"javascript",optional:["css","css-extras","graphql","markdown","markup","sql"],owner:"RunDevelopment"},julia:{title:"Julia",owner:"cdagnino"},keepalived:{title:"Keepalived Configure",owner:"dev-itsheng"},keyman:{title:"Keyman",owner:"mcdurdin"},kotlin:{title:"Kotlin",alias:["kt","kts"],aliasTitles:{kts:"Kotlin Script"},require:"clike",owner:"Golmote"},kumir:{title:"KuMir (\u041a\u0443\u041c\u0438\u0440)",alias:"kum",owner:"edukisto"},kusto:{title:"Kusto",owner:"RunDevelopment"},latex:{title:"LaTeX",alias:["tex","context"],aliasTitles:{tex:"TeX",context:"ConTeXt"},owner:"japborst"},latte:{title:"Latte",require:["clike","markup-templating","php"],owner:"nette"},less:{title:"Less",require:"css",optional:"css-extras",owner:"Golmote"},lilypond:{title:"LilyPond",require:"scheme",alias:"ly",owner:"RunDevelopment"},liquid:{title:"Liquid",require:"markup-templating",owner:"cinhtau"},lisp:{title:"Lisp",alias:["emacs","elisp","emacs-lisp"],owner:"JuanCaicedo"},livescript:{title:"LiveScript",owner:"Golmote"},llvm:{title:"LLVM IR",owner:"porglezomp"},log:{title:"Log file",optional:"javastacktrace",owner:"RunDevelopment"},lolcode:{title:"LOLCODE",owner:"Golmote"},lua:{title:"Lua",owner:"Golmote"},magma:{title:"Magma (CAS)",owner:"RunDevelopment"},makefile:{title:"Makefile",owner:"Golmote"},markdown:{title:"Markdown",require:"markup",optional:"yaml",alias:"md",owner:"Golmote"},"markup-templating":{title:"Markup templating",require:"markup",owner:"Golmote"},mata:{title:"Mata",owner:"RunDevelopment"},matlab:{title:"MATLAB",owner:"Golmote"},maxscript:{title:"MAXScript",owner:"RunDevelopment"},mel:{title:"MEL",owner:"Golmote"},mermaid:{title:"Mermaid",owner:"RunDevelopment"},metafont:{title:"METAFONT",owner:"LaeriExNihilo"},mizar:{title:"Mizar",owner:"Golmote"},mongodb:{title:"MongoDB",owner:"airs0urce",require:"javascript"},monkey:{title:"Monkey",owner:"Golmote"},moonscript:{title:"MoonScript",alias:"moon",owner:"RunDevelopment"},n1ql:{title:"N1QL",owner:"TMWilds"},n4js:{title:"N4JS",require:"javascript",optional:"jsdoc",alias:"n4jsd",owner:"bsmith-n4"},"nand2tetris-hdl":{title:"Nand To Tetris HDL",owner:"stephanmax"},naniscript:{title:"Naninovel Script",owner:"Elringus",alias:"nani"},nasm:{title:"NASM",owner:"rbmj"},neon:{title:"NEON",owner:"nette"},nevod:{title:"Nevod",owner:"nezaboodka"},nginx:{title:"nginx",owner:"volado"},nim:{title:"Nim",owner:"Golmote"},nix:{title:"Nix",owner:"Golmote"},nsis:{title:"NSIS",owner:"idleberg"},objectivec:{title:"Objective-C",require:"c",alias:"objc",owner:"uranusjr"},ocaml:{title:"OCaml",owner:"Golmote"},odin:{title:"Odin",owner:"edukisto"},opencl:{title:"OpenCL",require:"c",modify:["c","cpp"],owner:"Milania1"},openqasm:{title:"OpenQasm",alias:"qasm",owner:"RunDevelopment"},oz:{title:"Oz",owner:"Golmote"},parigp:{title:"PARI/GP",owner:"Golmote"},parser:{title:"Parser",require:"markup",owner:"Golmote"},pascal:{title:"Pascal",alias:"objectpascal",aliasTitles:{objectpascal:"Object Pascal"},owner:"Golmote"},pascaligo:{title:"Pascaligo",owner:"DefinitelyNotAGoat"},psl:{title:"PATROL Scripting Language",owner:"bertysentry"},pcaxis:{title:"PC-Axis",alias:"px",owner:"RunDevelopment"},peoplecode:{title:"PeopleCode",alias:"pcode",owner:"RunDevelopment"},perl:{title:"Perl",owner:"Golmote"},php:{title:"PHP",require:"markup-templating",owner:"milesj"},phpdoc:{title:"PHPDoc",require:["php","javadoclike"],modify:"php",owner:"RunDevelopment"},"php-extras":{title:"PHP Extras",require:"php",modify:"php",owner:"milesj"},"plant-uml":{title:"PlantUML",alias:"plantuml",owner:"RunDevelopment"},plsql:{title:"PL/SQL",require:"sql",owner:"Golmote"},powerquery:{title:"PowerQuery",alias:["pq","mscript"],owner:"peterbud"},powershell:{title:"PowerShell",owner:"nauzilus"},processing:{title:"Processing",require:"clike",owner:"Golmote"},prolog:{title:"Prolog",owner:"Golmote"},promql:{title:"PromQL",owner:"arendjr"},properties:{title:".properties",owner:"Golmote"},protobuf:{title:"Protocol Buffers",require:"clike",owner:"just-boris"},pug:{title:"Pug",require:["markup","javascript"],optional:["coffeescript","ejs","handlebars","less","livescript","markdown","scss","stylus","twig"],owner:"Golmote"},puppet:{title:"Puppet",owner:"Golmote"},pure:{title:"Pure",optional:["c","cpp","fortran"],owner:"Golmote"},purebasic:{title:"PureBasic",require:"clike",alias:"pbfasm",owner:"HeX0R101"},purescript:{title:"PureScript",require:"haskell",alias:"purs",owner:"sriharshachilakapati"},python:{title:"Python",alias:"py",owner:"multipetros"},qsharp:{title:"Q#",require:"clike",alias:"qs",owner:"fedonman"},q:{title:"Q (kdb+ database)",owner:"Golmote"},qml:{title:"QML",require:"javascript",owner:"RunDevelopment"},qore:{title:"Qore",require:"clike",owner:"temnroegg"},r:{title:"R",owner:"Golmote"},racket:{title:"Racket",require:"scheme",alias:"rkt",owner:"RunDevelopment"},cshtml:{title:"Razor C#",alias:"razor",require:["markup","csharp"],optional:["css","css-extras","javascript","js-extras"],owner:"RunDevelopment"},jsx:{title:"React JSX",require:["markup","javascript"],optional:["jsdoc","js-extras","js-templates"],owner:"vkbansal"},tsx:{title:"React TSX",require:["jsx","typescript"]},reason:{title:"Reason",require:"clike",owner:"Golmote"},regex:{title:"Regex",owner:"RunDevelopment"},rego:{title:"Rego",owner:"JordanSh"},renpy:{title:"Ren'py",alias:"rpy",owner:"HyuchiaDiego"},rescript:{title:"ReScript",alias:"res",owner:"vmarcosp"},rest:{title:"reST (reStructuredText)",owner:"Golmote"},rip:{title:"Rip",owner:"ravinggenius"},roboconf:{title:"Roboconf",owner:"Golmote"},robotframework:{title:"Robot Framework",alias:"robot",owner:"RunDevelopment"},ruby:{title:"Ruby",require:"clike",alias:"rb",owner:"samflores"},rust:{title:"Rust",owner:"Golmote"},sas:{title:"SAS",optional:["groovy","lua","sql"],owner:"Golmote"},sass:{title:"Sass (Sass)",require:"css",optional:"css-extras",owner:"Golmote"},scss:{title:"Sass (SCSS)",require:"css",optional:"css-extras",owner:"MoOx"},scala:{title:"Scala",require:"java",owner:"jozic"},scheme:{title:"Scheme",owner:"bacchus123"},"shell-session":{title:"Shell session",require:"bash",alias:["sh-session","shellsession"],owner:"RunDevelopment"},smali:{title:"Smali",owner:"RunDevelopment"},smalltalk:{title:"Smalltalk",owner:"Golmote"},smarty:{title:"Smarty",require:"markup-templating",optional:"php",owner:"Golmote"},sml:{title:"SML",alias:"smlnj",aliasTitles:{smlnj:"SML/NJ"},owner:"RunDevelopment"},solidity:{title:"Solidity (Ethereum)",alias:"sol",require:"clike",owner:"glachaud"},"solution-file":{title:"Solution file",alias:"sln",owner:"RunDevelopment"},soy:{title:"Soy (Closure Template)",require:"markup-templating",owner:"Golmote"},sparql:{title:"SPARQL",require:"turtle",owner:"Triply-Dev",alias:"rq"},"splunk-spl":{title:"Splunk SPL",owner:"RunDevelopment"},sqf:{title:"SQF: Status Quo Function (Arma 3)",require:"clike",owner:"RunDevelopment"},sql:{title:"SQL",owner:"multipetros"},squirrel:{title:"Squirrel",require:"clike",owner:"RunDevelopment"},stan:{title:"Stan",owner:"RunDevelopment"},stata:{title:"Stata Ado",require:["mata","java","python"],owner:"RunDevelopment"},iecst:{title:"Structured Text (IEC 61131-3)",owner:"serhioromano"},stylus:{title:"Stylus",owner:"vkbansal"},supercollider:{title:"SuperCollider",alias:"sclang",owner:"RunDevelopment"},swift:{title:"Swift",owner:"chrischares"},systemd:{title:"Systemd configuration file",owner:"RunDevelopment"},"t4-templating":{title:"T4 templating",owner:"RunDevelopment"},"t4-cs":{title:"T4 Text Templates (C#)",require:["t4-templating","csharp"],alias:"t4",owner:"RunDevelopment"},"t4-vb":{title:"T4 Text Templates (VB)",require:["t4-templating","vbnet"],owner:"RunDevelopment"},tap:{title:"TAP",owner:"isaacs",require:"yaml"},tcl:{title:"Tcl",owner:"PeterChaplin"},tt2:{title:"Template Toolkit 2",require:["clike","markup-templating"],owner:"gflohr"},textile:{title:"Textile",require:"markup",optional:"css",owner:"Golmote"},toml:{title:"TOML",owner:"RunDevelopment"},tremor:{title:"Tremor",alias:["trickle","troy"],owner:"darach",aliasTitles:{trickle:"trickle",troy:"troy"}},turtle:{title:"Turtle",alias:"trig",aliasTitles:{trig:"TriG"},owner:"jakubklimek"},twig:{title:"Twig",require:"markup-templating",owner:"brandonkelly"},typescript:{title:"TypeScript",require:"javascript",optional:"js-templates",alias:"ts",owner:"vkbansal"},typoscript:{title:"TypoScript",alias:"tsconfig",aliasTitles:{tsconfig:"TSConfig"},owner:"dkern"},unrealscript:{title:"UnrealScript",alias:["uscript","uc"],owner:"RunDevelopment"},uorazor:{title:"UO Razor Script",owner:"jaseowns"},uri:{title:"URI",alias:"url",aliasTitles:{url:"URL"},owner:"RunDevelopment"},v:{title:"V",require:"clike",owner:"taggon"},vala:{title:"Vala",require:"clike",optional:"regex",owner:"TemplarVolk"},vbnet:{title:"VB.Net",require:"basic",owner:"Bigsby"},velocity:{title:"Velocity",require:"markup",owner:"Golmote"},verilog:{title:"Verilog",owner:"a-rey"},vhdl:{title:"VHDL",owner:"a-rey"},vim:{title:"vim",owner:"westonganger"},"visual-basic":{title:"Visual Basic",alias:["vb","vba"],aliasTitles:{vba:"VBA"},owner:"Golmote"},warpscript:{title:"WarpScript",owner:"RunDevelopment"},wasm:{title:"WebAssembly",owner:"Golmote"},"web-idl":{title:"Web IDL",alias:"webidl",owner:"RunDevelopment"},wgsl:{title:"WGSL",owner:"Dr4gonthree"},wiki:{title:"Wiki markup",require:"markup",owner:"Golmote"},wolfram:{title:"Wolfram language",alias:["mathematica","nb","wl"],aliasTitles:{mathematica:"Mathematica",nb:"Mathematica Notebook"},owner:"msollami"},wren:{title:"Wren",owner:"clsource"},xeora:{title:"Xeora",require:"markup",alias:"xeoracube",aliasTitles:{xeoracube:"XeoraCube"},owner:"freakmaxi"},"xml-doc":{title:"XML doc (.net)",require:"markup",modify:["csharp","fsharp","vbnet"],owner:"RunDevelopment"},xojo:{title:"Xojo (REALbasic)",owner:"Golmote"},xquery:{title:"XQuery",require:"markup",owner:"Golmote"},yaml:{title:"YAML",alias:"yml",owner:"hason"},yang:{title:"YANG",owner:"RunDevelopment"},zig:{title:"Zig",owner:"RunDevelopment"}},plugins:{meta:{path:"plugins/{id}/prism-{id}",link:"plugins/{id}/"},"line-highlight":{title:"Line Highlight",description:"Highlights specific lines and/or line ranges."},"line-numbers":{title:"Line Numbers",description:"Line number at the beginning of code lines.",owner:"kuba-kubula"},"show-invisibles":{title:"Show Invisibles",description:"Show hidden characters such as tabs and line breaks.",optional:["autolinker","data-uri-highlight"]},autolinker:{title:"Autolinker",description:"Converts URLs and emails in code to clickable links. Parses Markdown links in comments."},wpd:{title:"WebPlatform Docs",description:'Makes tokens link to <a href="https://webplatform.github.io/docs/">WebPlatform.org documentation</a>. The links open in a new tab.'},"custom-class":{title:"Custom Class",description:"This plugin allows you to prefix Prism's default classes (<code>.comment</code> can become <code>.namespace--comment</code>) or replace them with your defined ones (like <code>.editor__comment</code>). You can even add new classes.",owner:"dvkndn",noCSS:!0},"file-highlight":{title:"File Highlight",description:"Fetch external files and highlight them with Prism. Used on the Prism website itself.",noCSS:!0},"show-language":{title:"Show Language",description:"Display the highlighted language in code blocks (inline code does not show the label).",owner:"nauzilus",noCSS:!0,require:"toolbar"},"jsonp-highlight":{title:"JSONP Highlight",description:"Fetch content with JSONP and highlight some interesting content (e.g. GitHub/Gists or Bitbucket API).",noCSS:!0,owner:"nauzilus"},"highlight-keywords":{title:"Highlight Keywords",description:"Adds special CSS classes for each keyword for fine-grained highlighting.",owner:"vkbansal",noCSS:!0},"remove-initial-line-feed":{title:"Remove initial line feed",description:"Removes the initial line feed in code blocks.",owner:"Golmote",noCSS:!0},"inline-color":{title:"Inline color",description:"Adds a small inline preview for colors in style sheets.",require:"css-extras",owner:"RunDevelopment"},previewers:{title:"Previewers",description:"Previewers for angles, colors, gradients, easing and time.",require:"css-extras",owner:"Golmote"},autoloader:{title:"Autoloader",description:"Automatically loads the needed languages to highlight the code blocks.",owner:"Golmote",noCSS:!0},"keep-markup":{title:"Keep Markup",description:"Prevents custom markup from being dropped out during highlighting.",owner:"Golmote",optional:"normalize-whitespace",noCSS:!0},"command-line":{title:"Command Line",description:"Display a command line with a prompt and, optionally, the output/response from the commands.",owner:"chriswells0"},"unescaped-markup":{title:"Unescaped Markup",description:"Write markup without having to escape anything."},"normalize-whitespace":{title:"Normalize Whitespace",description:"Supports multiple operations to normalize whitespace in code blocks.",owner:"zeitgeist87",optional:"unescaped-markup",noCSS:!0},"data-uri-highlight":{title:"Data-URI Highlight",description:"Highlights data-URI contents.",owner:"Golmote",noCSS:!0},toolbar:{title:"Toolbar",description:"Attach a toolbar for plugins to easily register buttons on the top of a code block.",owner:"mAAdhaTTah"},"copy-to-clipboard":{title:"Copy to Clipboard Button",description:"Add a button that copies the code block to the clipboard when clicked.",owner:"mAAdhaTTah",require:"toolbar",noCSS:!0},"download-button":{title:"Download Button",description:"A button in the toolbar of a code block adding a convenient way to download a code file.",owner:"Golmote",require:"toolbar",noCSS:!0},"match-braces":{title:"Match braces",description:"Highlights matching braces.",owner:"RunDevelopment"},"diff-highlight":{title:"Diff Highlight",description:"Highlights the code inside diff blocks.",owner:"RunDevelopment",require:"diff"},"filter-highlight-all":{title:"Filter highlightAll",description:"Filters the elements the <code>highlightAll</code> and <code>highlightAllUnder</code> methods actually highlight.",owner:"RunDevelopment",noCSS:!0},treeview:{title:"Treeview",description:"A language with special styles to highlight file system tree structures.",owner:"Golmote"}}})},2885:(e,t,n)=>{const r=n(9901),a=n(9642),o=new Set;function i(e){void 0===e?e=Object.keys(r.languages).filter((e=>"meta"!=e)):Array.isArray(e)||(e=[e]);const t=[...o,...Object.keys(Prism.languages)];a(r,e,t).load((e=>{if(!(e in r.languages))return void(i.silent||console.warn("Language does not exist: "+e));const t="./prism-"+e;delete n.c[n(6500).resolve(t)],delete Prism.languages[e],n(6500)(t),o.add(e)}))}i.silent=!1,e.exports=i},6726:(e,t,n)=>{var r={"./":2885};function a(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=o,e.exports=a,a.id=6726},6500:(e,t,n)=>{var r={"./":2885};function a(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=o,e.exports=a,a.id=6500},9642:e=>{"use strict";var t=function(){var e=function(){};function t(e,t){Array.isArray(e)?e.forEach(t):null!=e&&t(e,0)}function n(e){for(var t={},n=0,r=e.length;n<r;n++)t[e[n]]=!0;return t}function r(e){var n={},r=[];function a(r,o){if(!(r in n)){o.push(r);var i=o.indexOf(r);if(i<o.length-1)throw new Error("Circular dependency: "+o.slice(i).join(" -> "));var l={},s=e[r];if(s){function c(t){if(!(t in e))throw new Error(r+" depends on an unknown component "+t);if(!(t in l))for(var i in a(t,o),l[t]=!0,n[t])l[i]=!0}t(s.require,c),t(s.optional,c),t(s.modify,c)}n[r]=l,o.pop()}}return function(e){var t=n[e];return t||(a(e,r),t=n[e]),t}}function a(e){for(var t in e)return!0;return!1}return function(o,i,l){var s=function(e){var t={};for(var n in e){var r=e[n];for(var a in r)if("meta"!=a){var o=r[a];t[a]="string"==typeof o?{title:o}:o}}return t}(o),c=function(e){var n;return function(r){if(r in e)return r;if(!n)for(var a in n={},e){var o=e[a];t(o&&o.alias,(function(t){if(t in n)throw new Error(t+" cannot be alias for both "+a+" and "+n[t]);if(t in e)throw new Error(t+" cannot be alias of "+a+" because it is a component.");n[t]=a}))}return n[r]||r}}(s);i=i.map(c),l=(l||[]).map(c);var u=n(i),d=n(l);i.forEach((function e(n){var r=s[n];t(r&&r.require,(function(t){t in d||(u[t]=!0,e(t))}))}));for(var f,p=r(s),m=u;a(m);){for(var h in f={},m){var g=s[h];t(g&&g.modify,(function(e){e in d&&(f[e]=!0)}))}for(var b in d)if(!(b in u))for(var v in p(b))if(v in u){f[b]=!0;break}for(var y in m=f)u[y]=!0}var w={getIds:function(){var e=[];return w.load((function(t){e.push(t)})),e},load:function(t,n){return function(t,n,r,a){var o=a?a.series:void 0,i=a?a.parallel:e,l={},s={};function c(e){if(e in l)return l[e];s[e]=!0;var a,u=[];for(var d in t(e))d in n&&u.push(d);if(0===u.length)a=r(e);else{var f=i(u.map((function(e){var t=c(e);return delete s[e],t})));o?a=o(f,(function(){return r(e)})):r(e)}return l[e]=a}for(var u in n)c(u);var d=[];for(var f in s)d.push(l[f]);return i(d)}(p,u,t,n)}};return w}}();e.exports=t},2703:(e,t,n)=>{"use strict";var r=n(414);function a(){}function o(){}o.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,o,i){if(i!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:a};return n.PropTypes=n,n}},5697:(e,t,n)=>{e.exports=n(2703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4448:(e,t,n)=>{"use strict";var r=n(7294),a=n(7418),o=n(3840);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(i(227));var l=new Set,s={};function c(e,t){u(e,t),u(e+"Capture",t)}function u(e,t){for(s[e]=t,e=0;e<t.length;e++)l.add(t[e])}var d=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p=Object.prototype.hasOwnProperty,m={},h={};function g(e,t,n,r,a,o,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){b[e]=new g(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];b[t]=new g(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){b[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){b[e]=new g(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){b[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){b[e]=new g(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){b[e]=new g(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){b[e]=new g(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){b[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)}));var v=/[\-:]([a-z])/g;function y(e){return e[1].toUpperCase()}function w(e,t,n,r){var a=b.hasOwnProperty(t)?b[t]:null;(null!==a?0===a.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,a,r)&&(n=null),r||null===a?function(e){return!!p.call(h,e)||!p.call(m,e)&&(f.test(e)?h[e]=!0:(m[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=null===n?3!==a.type&&"":n:(t=a.attributeName,r=a.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(a=a.type)||4===a&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(v,y);b[t]=new g(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(v,y);b[t]=new g(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(v,y);b[t]=new g(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){b[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)})),b.xlinkHref=new g("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){b[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)}));var k=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,E=60103,S=60106,x=60107,C=60108,T=60114,_=60109,A=60110,L=60112,R=60113,P=60120,N=60115,O=60116,I=60121,D=60128,M=60129,F=60130,B=60131;if("function"==typeof Symbol&&Symbol.for){var j=Symbol.for;E=j("react.element"),S=j("react.portal"),x=j("react.fragment"),C=j("react.strict_mode"),T=j("react.profiler"),_=j("react.provider"),A=j("react.context"),L=j("react.forward_ref"),R=j("react.suspense"),P=j("react.suspense_list"),N=j("react.memo"),O=j("react.lazy"),I=j("react.block"),j("react.scope"),D=j("react.opaque.id"),M=j("react.debug_trace_mode"),F=j("react.offscreen"),B=j("react.legacy_hidden")}var z,U="function"==typeof Symbol&&Symbol.iterator;function $(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=U&&e[U]||e["@@iterator"])?e:null}function q(e){if(void 0===z)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);z=t&&t[1]||""}return"\n"+z+e}var H=!1;function G(e,t){if(!e||H)return"";H=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(s){var r=s}Reflect.construct(e,[],t)}else{try{t.call()}catch(s){r=s}e.call(t.prototype)}else{try{throw Error()}catch(s){r=s}e()}}catch(s){if(s&&r&&"string"==typeof s.stack){for(var a=s.stack.split("\n"),o=r.stack.split("\n"),i=a.length-1,l=o.length-1;1<=i&&0<=l&&a[i]!==o[l];)l--;for(;1<=i&&0<=l;i--,l--)if(a[i]!==o[l]){if(1!==i||1!==l)do{if(i--,0>--l||a[i]!==o[l])return"\n"+a[i].replace(" at new "," at ")}while(1<=i&&0<=l);break}}}finally{H=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?q(e):""}function Z(e){switch(e.tag){case 5:return q(e.type);case 16:return q("Lazy");case 13:return q("Suspense");case 19:return q("SuspenseList");case 0:case 2:case 15:return e=G(e.type,!1);case 11:return e=G(e.type.render,!1);case 22:return e=G(e.type._render,!1);case 1:return e=G(e.type,!0);default:return""}}function V(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case x:return"Fragment";case S:return"Portal";case T:return"Profiler";case C:return"StrictMode";case R:return"Suspense";case P:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case A:return(e.displayName||"Context")+".Consumer";case _:return(e._context.displayName||"Context")+".Provider";case L:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case N:return V(e.type);case I:return V(e._render);case O:t=e._payload,e=e._init;try{return V(e(t))}catch(n){}}return null}function W(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function K(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Y(e){e._valueTracker||(e._valueTracker=function(e){var t=K(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var a=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Q(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=K(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function X(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function J(e,t){var n=t.checked;return a({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ee(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=W(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function te(e,t){null!=(t=t.checked)&&w(e,"checked",t,!1)}function ne(e,t){te(e,t);var n=W(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ae(e,t.type,n):t.hasOwnProperty("defaultValue")&&ae(e,t.type,W(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function re(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ae(e,t,n){"number"===t&&X(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function oe(e,t){return e=a({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function ie(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+W(n),t=null,a=0;a<e.length;a++){if(e[a].value===n)return e[a].selected=!0,void(r&&(e[a].defaultSelected=!0));null!==t||e[a].disabled||(t=e[a])}null!==t&&(t.selected=!0)}}function le(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(i(91));return a({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function se(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(i(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(i(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:W(n)}}function ce(e,t){var n=W(t.value),r=W(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ue(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var de={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function fe(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function pe(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?fe(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var me,he,ge=(he=function(e,t){if(e.namespaceURI!==de.svg||"innerHTML"in e)e.innerHTML=t;else{for((me=me||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=me.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return he(e,t)}))}:he);function be(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var ve={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ye=["Webkit","ms","Moz","O"];function we(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||ve.hasOwnProperty(e)&&ve[e]?(""+t).trim():t+"px"}function ke(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),a=we(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}Object.keys(ve).forEach((function(e){ye.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ve[t]=ve[e]}))}));var Ee=a({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Se(e,t){if(t){if(Ee[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(i(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(i(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(i(62))}}function xe(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Ce(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Te=null,_e=null,Ae=null;function Le(e){if(e=na(e)){if("function"!=typeof Te)throw Error(i(280));var t=e.stateNode;t&&(t=aa(t),Te(e.stateNode,e.type,t))}}function Re(e){_e?Ae?Ae.push(e):Ae=[e]:_e=e}function Pe(){if(_e){var e=_e,t=Ae;if(Ae=_e=null,Le(e),t)for(e=0;e<t.length;e++)Le(t[e])}}function Ne(e,t){return e(t)}function Oe(e,t,n,r,a){return e(t,n,r,a)}function Ie(){}var De=Ne,Me=!1,Fe=!1;function Be(){null===_e&&null===Ae||(Ie(),Pe())}function je(e,t){var n=e.stateNode;if(null===n)return null;var r=aa(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(i(231,t,typeof n));return n}var ze=!1;if(d)try{var Ue={};Object.defineProperty(Ue,"passive",{get:function(){ze=!0}}),window.addEventListener("test",Ue,Ue),window.removeEventListener("test",Ue,Ue)}catch(he){ze=!1}function $e(e,t,n,r,a,o,i,l,s){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var qe=!1,He=null,Ge=!1,Ze=null,Ve={onError:function(e){qe=!0,He=e}};function We(e,t,n,r,a,o,i,l,s){qe=!1,He=null,$e.apply(Ve,arguments)}function Ke(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Ye(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Qe(e){if(Ke(e)!==e)throw Error(i(188))}function Xe(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ke(e)))throw Error(i(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(null===a)break;var o=a.alternate;if(null===o){if(null!==(r=a.return)){n=r;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return Qe(a),e;if(o===r)return Qe(a),t;o=o.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=o;else{for(var l=!1,s=a.child;s;){if(s===n){l=!0,n=a,r=o;break}if(s===r){l=!0,r=a,n=o;break}s=s.sibling}if(!l){for(s=o.child;s;){if(s===n){l=!0,n=o,r=a;break}if(s===r){l=!0,r=o,n=a;break}s=s.sibling}if(!l)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(3!==n.tag)throw Error(i(188));return n.stateNode.current===n?e:t}(e),!e)return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function Je(e,t){for(var n=e.alternate;null!==t;){if(t===e||t===n)return!0;t=t.return}return!1}var et,tt,nt,rt,at=!1,ot=[],it=null,lt=null,st=null,ct=new Map,ut=new Map,dt=[],ft="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function pt(e,t,n,r,a){return{blockedOn:e,domEventName:t,eventSystemFlags:16|n,nativeEvent:a,targetContainers:[r]}}function mt(e,t){switch(e){case"focusin":case"focusout":it=null;break;case"dragenter":case"dragleave":lt=null;break;case"mouseover":case"mouseout":st=null;break;case"pointerover":case"pointerout":ct.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ut.delete(t.pointerId)}}function ht(e,t,n,r,a,o){return null===e||e.nativeEvent!==o?(e=pt(t,n,r,a,o),null!==t&&(null!==(t=na(t))&&tt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==a&&-1===t.indexOf(a)&&t.push(a),e)}function gt(e){var t=ta(e.target);if(null!==t){var n=Ke(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Ye(n)))return e.blockedOn=t,void rt(e.lanePriority,(function(){o.unstable_runWithPriority(e.priority,(function(){nt(n)}))}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function bt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Xt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=na(n))&&tt(t),e.blockedOn=n,!1;t.shift()}return!0}function vt(e,t,n){bt(e)&&n.delete(t)}function yt(){for(at=!1;0<ot.length;){var e=ot[0];if(null!==e.blockedOn){null!==(e=na(e.blockedOn))&&et(e);break}for(var t=e.targetContainers;0<t.length;){var n=Xt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n){e.blockedOn=n;break}t.shift()}null===e.blockedOn&&ot.shift()}null!==it&&bt(it)&&(it=null),null!==lt&&bt(lt)&&(lt=null),null!==st&&bt(st)&&(st=null),ct.forEach(vt),ut.forEach(vt)}function wt(e,t){e.blockedOn===t&&(e.blockedOn=null,at||(at=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,yt)))}function kt(e){function t(t){return wt(t,e)}if(0<ot.length){wt(ot[0],e);for(var n=1;n<ot.length;n++){var r=ot[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==it&&wt(it,e),null!==lt&&wt(lt,e),null!==st&&wt(st,e),ct.forEach(t),ut.forEach(t),n=0;n<dt.length;n++)(r=dt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<dt.length&&null===(n=dt[0]).blockedOn;)gt(n),null===n.blockedOn&&dt.shift()}function Et(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var St={animationend:Et("Animation","AnimationEnd"),animationiteration:Et("Animation","AnimationIteration"),animationstart:Et("Animation","AnimationStart"),transitionend:Et("Transition","TransitionEnd")},xt={},Ct={};function Tt(e){if(xt[e])return xt[e];if(!St[e])return e;var t,n=St[e];for(t in n)if(n.hasOwnProperty(t)&&t in Ct)return xt[e]=n[t];return e}d&&(Ct=document.createElement("div").style,"AnimationEvent"in window||(delete St.animationend.animation,delete St.animationiteration.animation,delete St.animationstart.animation),"TransitionEvent"in window||delete St.transitionend.transition);var _t=Tt("animationend"),At=Tt("animationiteration"),Lt=Tt("animationstart"),Rt=Tt("transitionend"),Pt=new Map,Nt=new Map,Ot=["abort","abort",_t,"animationEnd",At,"animationIteration",Lt,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Rt,"transitionEnd","waiting","waiting"];function It(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],a=e[n+1];a="on"+(a[0].toUpperCase()+a.slice(1)),Nt.set(r,t),Pt.set(r,a),c(a,[r])}}(0,o.unstable_now)();var Dt=8;function Mt(e){if(0!=(1&e))return Dt=15,1;if(0!=(2&e))return Dt=14,2;if(0!=(4&e))return Dt=13,4;var t=24&e;return 0!==t?(Dt=12,t):0!=(32&e)?(Dt=11,32):0!==(t=192&e)?(Dt=10,t):0!=(256&e)?(Dt=9,256):0!==(t=3584&e)?(Dt=8,t):0!=(4096&e)?(Dt=7,4096):0!==(t=4186112&e)?(Dt=6,t):0!==(t=62914560&e)?(Dt=5,t):67108864&e?(Dt=4,67108864):0!=(134217728&e)?(Dt=3,134217728):0!==(t=805306368&e)?(Dt=2,t):0!=(1073741824&e)?(Dt=1,1073741824):(Dt=8,e)}function Ft(e,t){var n=e.pendingLanes;if(0===n)return Dt=0;var r=0,a=0,o=e.expiredLanes,i=e.suspendedLanes,l=e.pingedLanes;if(0!==o)r=o,a=Dt=15;else if(0!==(o=134217727&n)){var s=o&~i;0!==s?(r=Mt(s),a=Dt):0!==(l&=o)&&(r=Mt(l),a=Dt)}else 0!==(o=n&~i)?(r=Mt(o),a=Dt):0!==l&&(r=Mt(l),a=Dt);if(0===r)return 0;if(r=n&((0>(r=31-qt(r))?0:1<<r)<<1)-1,0!==t&&t!==r&&0==(t&i)){if(Mt(t),a<=Dt)return t;Dt=a}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)a=1<<(n=31-qt(t)),r|=e[n],t&=~a;return r}function Bt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function jt(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=zt(24&~t))?jt(10,t):e;case 10:return 0===(e=zt(192&~t))?jt(8,t):e;case 8:return 0===(e=zt(3584&~t))&&(0===(e=zt(4186112&~t))&&(e=512)),e;case 2:return 0===(t=zt(805306368&~t))&&(t=268435456),t}throw Error(i(358,e))}function zt(e){return e&-e}function Ut(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function $t(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,(e=e.eventTimes)[t=31-qt(t)]=n}var qt=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(Ht(e)/Gt|0)|0},Ht=Math.log,Gt=Math.LN2;var Zt=o.unstable_UserBlockingPriority,Vt=o.unstable_runWithPriority,Wt=!0;function Kt(e,t,n,r){Me||Ie();var a=Qt,o=Me;Me=!0;try{Oe(a,e,t,n,r)}finally{(Me=o)||Be()}}function Yt(e,t,n,r){Vt(Zt,Qt.bind(null,e,t,n,r))}function Qt(e,t,n,r){var a;if(Wt)if((a=0==(4&t))&&0<ot.length&&-1<ft.indexOf(e))e=pt(null,e,t,n,r),ot.push(e);else{var o=Xt(e,t,n,r);if(null===o)a&&mt(e,r);else{if(a){if(-1<ft.indexOf(e))return e=pt(o,e,t,n,r),void ot.push(e);if(function(e,t,n,r,a){switch(t){case"focusin":return it=ht(it,e,t,n,r,a),!0;case"dragenter":return lt=ht(lt,e,t,n,r,a),!0;case"mouseover":return st=ht(st,e,t,n,r,a),!0;case"pointerover":var o=a.pointerId;return ct.set(o,ht(ct.get(o)||null,e,t,n,r,a)),!0;case"gotpointercapture":return o=a.pointerId,ut.set(o,ht(ut.get(o)||null,e,t,n,r,a)),!0}return!1}(o,e,t,n,r))return;mt(e,r)}Ir(e,t,r,null,n)}}}function Xt(e,t,n,r){var a=Ce(r);if(null!==(a=ta(a))){var o=Ke(a);if(null===o)a=null;else{var i=o.tag;if(13===i){if(null!==(a=Ye(o)))return a;a=null}else if(3===i){if(o.stateNode.hydrate)return 3===o.tag?o.stateNode.containerInfo:null;a=null}else o!==a&&(a=null)}}return Ir(e,t,r,a,n),null}var Jt=null,en=null,tn=null;function nn(){if(tn)return tn;var e,t,n=en,r=n.length,a="value"in Jt?Jt.value:Jt.textContent,o=a.length;for(e=0;e<r&&n[e]===a[e];e++);var i=r-e;for(t=1;t<=i&&n[r-t]===a[o-t];t++);return tn=a.slice(e,1<t?1-t:void 0)}function rn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function an(){return!0}function on(){return!1}function ln(e){function t(t,n,r,a,o){for(var i in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=a,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(i)&&(t=e[i],this[i]=t?t(a):a[i]);return this.isDefaultPrevented=(null!=a.defaultPrevented?a.defaultPrevented:!1===a.returnValue)?an:on,this.isPropagationStopped=on,this}return a(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=an)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=an)},persist:function(){},isPersistent:an}),t}var sn,cn,un,dn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fn=ln(dn),pn=a({},dn,{view:0,detail:0}),mn=ln(pn),hn=a({},pn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_n,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==un&&(un&&"mousemove"===e.type?(sn=e.screenX-un.screenX,cn=e.screenY-un.screenY):cn=sn=0,un=e),sn)},movementY:function(e){return"movementY"in e?e.movementY:cn}}),gn=ln(hn),bn=ln(a({},hn,{dataTransfer:0})),vn=ln(a({},pn,{relatedTarget:0})),yn=ln(a({},dn,{animationName:0,elapsedTime:0,pseudoElement:0})),wn=a({},dn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),kn=ln(wn),En=ln(a({},dn,{data:0})),Sn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},xn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Cn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Tn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Cn[e])&&!!t[e]}function _n(){return Tn}var An=a({},pn,{key:function(e){if(e.key){var t=Sn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=rn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?xn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_n,charCode:function(e){return"keypress"===e.type?rn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?rn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Ln=ln(An),Rn=ln(a({},hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Pn=ln(a({},pn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_n})),Nn=ln(a({},dn,{propertyName:0,elapsedTime:0,pseudoElement:0})),On=a({},hn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),In=ln(On),Dn=[9,13,27,32],Mn=d&&"CompositionEvent"in window,Fn=null;d&&"documentMode"in document&&(Fn=document.documentMode);var Bn=d&&"TextEvent"in window&&!Fn,jn=d&&(!Mn||Fn&&8<Fn&&11>=Fn),zn=String.fromCharCode(32),Un=!1;function $n(e,t){switch(e){case"keyup":return-1!==Dn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Hn=!1;var Gn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Zn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Gn[e.type]:"textarea"===t}function Vn(e,t,n,r){Re(r),0<(t=Mr(t,"onChange")).length&&(n=new fn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Wn=null,Kn=null;function Yn(e){Ar(e,0)}function Qn(e){if(Q(ra(e)))return e}function Xn(e,t){if("change"===e)return t}var Jn=!1;if(d){var er;if(d){var tr="oninput"in document;if(!tr){var nr=document.createElement("div");nr.setAttribute("oninput","return;"),tr="function"==typeof nr.oninput}er=tr}else er=!1;Jn=er&&(!document.documentMode||9<document.documentMode)}function rr(){Wn&&(Wn.detachEvent("onpropertychange",ar),Kn=Wn=null)}function ar(e){if("value"===e.propertyName&&Qn(Kn)){var t=[];if(Vn(t,Kn,e,Ce(e)),e=Yn,Me)e(t);else{Me=!0;try{Ne(e,t)}finally{Me=!1,Be()}}}}function or(e,t,n){"focusin"===e?(rr(),Kn=n,(Wn=t).attachEvent("onpropertychange",ar)):"focusout"===e&&rr()}function ir(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Qn(Kn)}function lr(e,t){if("click"===e)return Qn(t)}function sr(e,t){if("input"===e||"change"===e)return Qn(t)}var cr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},ur=Object.prototype.hasOwnProperty;function dr(e,t){if(cr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!ur.call(t,n[r])||!cr(e[n[r]],t[n[r]]))return!1;return!0}function fr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pr(e,t){var n,r=fr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=fr(r)}}function mr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?mr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function hr(){for(var e=window,t=X();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=X((e=t.contentWindow).document)}return t}function gr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var br=d&&"documentMode"in document&&11>=document.documentMode,vr=null,yr=null,wr=null,kr=!1;function Er(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;kr||null==vr||vr!==X(r)||("selectionStart"in(r=vr)&&gr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},wr&&dr(wr,r)||(wr=r,0<(r=Mr(yr,"onSelect")).length&&(t=new fn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=vr)))}It("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),It("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),It(Ot,2);for(var Sr="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),xr=0;xr<Sr.length;xr++)Nt.set(Sr[xr],0);u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Cr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Tr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Cr));function _r(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,a,o,l,s,c){if(We.apply(this,arguments),qe){if(!qe)throw Error(i(198));var u=He;qe=!1,He=null,Ge||(Ge=!0,Ze=u)}}(r,t,void 0,e),e.currentTarget=null}function Ar(e,t){t=0!=(4&t);for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var i=r.length-1;0<=i;i--){var l=r[i],s=l.instance,c=l.currentTarget;if(l=l.listener,s!==o&&a.isPropagationStopped())break e;_r(a,l,c),o=s}else for(i=0;i<r.length;i++){if(s=(l=r[i]).instance,c=l.currentTarget,l=l.listener,s!==o&&a.isPropagationStopped())break e;_r(a,l,c),o=s}}}if(Ge)throw e=Ze,Ge=!1,Ze=null,e}function Lr(e,t){var n=oa(t),r=e+"__bubble";n.has(r)||(Or(t,e,2,!1),n.add(r))}var Rr="_reactListening"+Math.random().toString(36).slice(2);function Pr(e){e[Rr]||(e[Rr]=!0,l.forEach((function(t){Tr.has(t)||Nr(t,!1,e,null),Nr(t,!0,e,null)})))}function Nr(e,t,n,r){var a=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,o=n;if("selectionchange"===e&&9!==n.nodeType&&(o=n.ownerDocument),null!==r&&!t&&Tr.has(e)){if("scroll"!==e)return;a|=2,o=r}var i=oa(o),l=e+"__"+(t?"capture":"bubble");i.has(l)||(t&&(a|=4),Or(o,e,a,t),i.add(l))}function Or(e,t,n,r){var a=Nt.get(t);switch(void 0===a?2:a){case 0:a=Kt;break;case 1:a=Yt;break;default:a=Qt}n=a.bind(null,t,n,e),a=void 0,!ze||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(a=!0),r?void 0!==a?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):void 0!==a?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function Ir(e,t,n,r,a){var o=r;if(0==(1&t)&&0==(2&t)&&null!==r)e:for(;;){if(null===r)return;var i=r.tag;if(3===i||4===i){var l=r.stateNode.containerInfo;if(l===a||8===l.nodeType&&l.parentNode===a)break;if(4===i)for(i=r.return;null!==i;){var s=i.tag;if((3===s||4===s)&&((s=i.stateNode.containerInfo)===a||8===s.nodeType&&s.parentNode===a))return;i=i.return}for(;null!==l;){if(null===(i=ta(l)))return;if(5===(s=i.tag)||6===s){r=o=i;continue e}l=l.parentNode}}r=r.return}!function(e,t,n){if(Fe)return e(t,n);Fe=!0;try{return De(e,t,n)}finally{Fe=!1,Be()}}((function(){var r=o,a=Ce(n),i=[];e:{var l=Pt.get(e);if(void 0!==l){var s=fn,c=e;switch(e){case"keypress":if(0===rn(n))break e;case"keydown":case"keyup":s=Ln;break;case"focusin":c="focus",s=vn;break;case"focusout":c="blur",s=vn;break;case"beforeblur":case"afterblur":s=vn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":s=gn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":s=bn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":s=Pn;break;case _t:case At:case Lt:s=yn;break;case Rt:s=Nn;break;case"scroll":s=mn;break;case"wheel":s=In;break;case"copy":case"cut":case"paste":s=kn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":s=Rn}var u=0!=(4&t),d=!u&&"scroll"===e,f=u?null!==l?l+"Capture":null:l;u=[];for(var p,m=r;null!==m;){var h=(p=m).stateNode;if(5===p.tag&&null!==h&&(p=h,null!==f&&(null!=(h=je(m,f))&&u.push(Dr(m,h,p)))),d)break;m=m.return}0<u.length&&(l=new s(l,c,null,n,a),i.push({event:l,listeners:u}))}}if(0==(7&t)){if(s="mouseout"===e||"pointerout"===e,(!(l="mouseover"===e||"pointerover"===e)||0!=(16&t)||!(c=n.relatedTarget||n.fromElement)||!ta(c)&&!c[Jr])&&(s||l)&&(l=a.window===a?a:(l=a.ownerDocument)?l.defaultView||l.parentWindow:window,s?(s=r,null!==(c=(c=n.relatedTarget||n.toElement)?ta(c):null)&&(c!==(d=Ke(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(s=null,c=r),s!==c)){if(u=gn,h="onMouseLeave",f="onMouseEnter",m="mouse","pointerout"!==e&&"pointerover"!==e||(u=Rn,h="onPointerLeave",f="onPointerEnter",m="pointer"),d=null==s?l:ra(s),p=null==c?l:ra(c),(l=new u(h,m+"leave",s,n,a)).target=d,l.relatedTarget=p,h=null,ta(a)===r&&((u=new u(f,m+"enter",c,n,a)).target=p,u.relatedTarget=d,h=u),d=h,s&&c)e:{for(f=c,m=0,p=u=s;p;p=Fr(p))m++;for(p=0,h=f;h;h=Fr(h))p++;for(;0<m-p;)u=Fr(u),m--;for(;0<p-m;)f=Fr(f),p--;for(;m--;){if(u===f||null!==f&&u===f.alternate)break e;u=Fr(u),f=Fr(f)}u=null}else u=null;null!==s&&Br(i,l,s,u,!1),null!==c&&null!==d&&Br(i,d,c,u,!0)}if("select"===(s=(l=r?ra(r):window).nodeName&&l.nodeName.toLowerCase())||"input"===s&&"file"===l.type)var g=Xn;else if(Zn(l))if(Jn)g=sr;else{g=ir;var b=or}else(s=l.nodeName)&&"input"===s.toLowerCase()&&("checkbox"===l.type||"radio"===l.type)&&(g=lr);switch(g&&(g=g(e,r))?Vn(i,g,n,a):(b&&b(e,l,r),"focusout"===e&&(b=l._wrapperState)&&b.controlled&&"number"===l.type&&ae(l,"number",l.value)),b=r?ra(r):window,e){case"focusin":(Zn(b)||"true"===b.contentEditable)&&(vr=b,yr=r,wr=null);break;case"focusout":wr=yr=vr=null;break;case"mousedown":kr=!0;break;case"contextmenu":case"mouseup":case"dragend":kr=!1,Er(i,n,a);break;case"selectionchange":if(br)break;case"keydown":case"keyup":Er(i,n,a)}var v;if(Mn)e:{switch(e){case"compositionstart":var y="onCompositionStart";break e;case"compositionend":y="onCompositionEnd";break e;case"compositionupdate":y="onCompositionUpdate";break e}y=void 0}else Hn?$n(e,n)&&(y="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(y="onCompositionStart");y&&(jn&&"ko"!==n.locale&&(Hn||"onCompositionStart"!==y?"onCompositionEnd"===y&&Hn&&(v=nn()):(en="value"in(Jt=a)?Jt.value:Jt.textContent,Hn=!0)),0<(b=Mr(r,y)).length&&(y=new En(y,e,null,n,a),i.push({event:y,listeners:b}),v?y.data=v:null!==(v=qn(n))&&(y.data=v))),(v=Bn?function(e,t){switch(e){case"compositionend":return qn(t);case"keypress":return 32!==t.which?null:(Un=!0,zn);case"textInput":return(e=t.data)===zn&&Un?null:e;default:return null}}(e,n):function(e,t){if(Hn)return"compositionend"===e||!Mn&&$n(e,t)?(e=nn(),tn=en=Jt=null,Hn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return jn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Mr(r,"onBeforeInput")).length&&(a=new En("onBeforeInput","beforeinput",null,n,a),i.push({event:a,listeners:r}),a.data=v))}Ar(i,t)}))}function Dr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Mr(e,t){for(var n=t+"Capture",r=[];null!==e;){var a=e,o=a.stateNode;5===a.tag&&null!==o&&(a=o,null!=(o=je(e,n))&&r.unshift(Dr(e,o,a)),null!=(o=je(e,t))&&r.push(Dr(e,o,a))),e=e.return}return r}function Fr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Br(e,t,n,r,a){for(var o=t._reactName,i=[];null!==n&&n!==r;){var l=n,s=l.alternate,c=l.stateNode;if(null!==s&&s===r)break;5===l.tag&&null!==c&&(l=c,a?null!=(s=je(n,o))&&i.unshift(Dr(n,s,l)):a||null!=(s=je(n,o))&&i.push(Dr(n,s,l))),n=n.return}0!==i.length&&e.push({event:t,listeners:i})}function jr(){}var zr=null,Ur=null;function $r(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function qr(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Hr="function"==typeof setTimeout?setTimeout:void 0,Gr="function"==typeof clearTimeout?clearTimeout:void 0;function Zr(e){1===e.nodeType?e.textContent="":9===e.nodeType&&(null!=(e=e.body)&&(e.textContent=""))}function Vr(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function Wr(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var Kr=0;var Yr=Math.random().toString(36).slice(2),Qr="__reactFiber$"+Yr,Xr="__reactProps$"+Yr,Jr="__reactContainer$"+Yr,ea="__reactEvents$"+Yr;function ta(e){var t=e[Qr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Jr]||n[Qr]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Wr(e);null!==e;){if(n=e[Qr])return n;e=Wr(e)}return t}n=(e=n).parentNode}return null}function na(e){return!(e=e[Qr]||e[Jr])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function ra(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(i(33))}function aa(e){return e[Xr]||null}function oa(e){var t=e[ea];return void 0===t&&(t=e[ea]=new Set),t}var ia=[],la=-1;function sa(e){return{current:e}}function ca(e){0>la||(e.current=ia[la],ia[la]=null,la--)}function ua(e,t){la++,ia[la]=e.current,e.current=t}var da={},fa=sa(da),pa=sa(!1),ma=da;function ha(e,t){var n=e.type.contextTypes;if(!n)return da;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a,o={};for(a in n)o[a]=t[a];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function ga(e){return null!=(e=e.childContextTypes)}function ba(){ca(pa),ca(fa)}function va(e,t,n){if(fa.current!==da)throw Error(i(168));ua(fa,t),ua(pa,n)}function ya(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in e))throw Error(i(108,V(t)||"Unknown",o));return a({},n,r)}function wa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||da,ma=fa.current,ua(fa,e),ua(pa,pa.current),!0}function ka(e,t,n){var r=e.stateNode;if(!r)throw Error(i(169));n?(e=ya(e,t,ma),r.__reactInternalMemoizedMergedChildContext=e,ca(pa),ca(fa),ua(fa,e)):ca(pa),ua(pa,n)}var Ea=null,Sa=null,xa=o.unstable_runWithPriority,Ca=o.unstable_scheduleCallback,Ta=o.unstable_cancelCallback,_a=o.unstable_shouldYield,Aa=o.unstable_requestPaint,La=o.unstable_now,Ra=o.unstable_getCurrentPriorityLevel,Pa=o.unstable_ImmediatePriority,Na=o.unstable_UserBlockingPriority,Oa=o.unstable_NormalPriority,Ia=o.unstable_LowPriority,Da=o.unstable_IdlePriority,Ma={},Fa=void 0!==Aa?Aa:function(){},Ba=null,ja=null,za=!1,Ua=La(),$a=1e4>Ua?La:function(){return La()-Ua};function qa(){switch(Ra()){case Pa:return 99;case Na:return 98;case Oa:return 97;case Ia:return 96;case Da:return 95;default:throw Error(i(332))}}function Ha(e){switch(e){case 99:return Pa;case 98:return Na;case 97:return Oa;case 96:return Ia;case 95:return Da;default:throw Error(i(332))}}function Ga(e,t){return e=Ha(e),xa(e,t)}function Za(e,t,n){return e=Ha(e),Ca(e,t,n)}function Va(){if(null!==ja){var e=ja;ja=null,Ta(e)}Wa()}function Wa(){if(!za&&null!==Ba){za=!0;var e=0;try{var t=Ba;Ga(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),Ba=null}catch(n){throw null!==Ba&&(Ba=Ba.slice(e+1)),Ca(Pa,Va),n}finally{za=!1}}}var Ka=k.ReactCurrentBatchConfig;function Ya(e,t){if(e&&e.defaultProps){for(var n in t=a({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var Qa=sa(null),Xa=null,Ja=null,eo=null;function to(){eo=Ja=Xa=null}function no(e){var t=Qa.current;ca(Qa),e.type._context._currentValue=t}function ro(e,t){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)===t){if(null===n||(n.childLanes&t)===t)break;n.childLanes|=t}else e.childLanes|=t,null!==n&&(n.childLanes|=t);e=e.return}}function ao(e,t){Xa=e,eo=Ja=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(Mi=!0),e.firstContext=null)}function oo(e,t){if(eo!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(eo=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Ja){if(null===Xa)throw Error(i(308));Ja=t,Xa.dependencies={lanes:0,firstContext:t,responders:null}}else Ja=Ja.next=t;return e._currentValue}var io=!1;function lo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function so(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function co(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function uo(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function fo(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var a=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?a=o=i:o=o.next=i,n=n.next}while(null!==n);null===o?a=o=t:o=o.next=t}else a=o=t;return n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:o,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function po(e,t,n,r){var o=e.updateQueue;io=!1;var i=o.firstBaseUpdate,l=o.lastBaseUpdate,s=o.shared.pending;if(null!==s){o.shared.pending=null;var c=s,u=c.next;c.next=null,null===l?i=u:l.next=u,l=c;var d=e.alternate;if(null!==d){var f=(d=d.updateQueue).lastBaseUpdate;f!==l&&(null===f?d.firstBaseUpdate=u:f.next=u,d.lastBaseUpdate=c)}}if(null!==i){for(f=o.baseState,l=0,d=u=c=null;;){s=i.lane;var p=i.eventTime;if((r&s)===s){null!==d&&(d=d.next={eventTime:p,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var m=e,h=i;switch(s=t,p=n,h.tag){case 1:if("function"==typeof(m=h.payload)){f=m.call(p,f,s);break e}f=m;break e;case 3:m.flags=-4097&m.flags|64;case 0:if(null==(s="function"==typeof(m=h.payload)?m.call(p,f,s):m))break e;f=a({},f,s);break e;case 2:io=!0}}null!==i.callback&&(e.flags|=32,null===(s=o.effects)?o.effects=[i]:s.push(i))}else p={eventTime:p,lane:s,tag:i.tag,payload:i.payload,callback:i.callback,next:null},null===d?(u=d=p,c=f):d=d.next=p,l|=s;if(null===(i=i.next)){if(null===(s=o.shared.pending))break;i=s.next,s.next=null,o.lastBaseUpdate=s,o.shared.pending=null}}null===d&&(c=f),o.baseState=c,o.firstBaseUpdate=u,o.lastBaseUpdate=d,Ul|=l,e.lanes=l,e.memoizedState=f}}function mo(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(null!==a){if(r.callback=null,r=n,"function"!=typeof a)throw Error(i(191,a));a.call(r)}}}var ho=(new r.Component).refs;function go(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:a({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var bo={isMounted:function(e){return!!(e=e._reactInternals)&&Ke(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=fs(),a=ps(e),o=co(r,a);o.payload=t,null!=n&&(o.callback=n),uo(e,o),ms(e,a,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=fs(),a=ps(e),o=co(r,a);o.tag=1,o.payload=t,null!=n&&(o.callback=n),uo(e,o),ms(e,a,r)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=fs(),r=ps(e),a=co(n,r);a.tag=2,null!=t&&(a.callback=t),uo(e,a),ms(e,r,n)}};function vo(e,t,n,r,a,o,i){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,i):!t.prototype||!t.prototype.isPureReactComponent||(!dr(n,r)||!dr(a,o))}function yo(e,t,n){var r=!1,a=da,o=t.contextType;return"object"==typeof o&&null!==o?o=oo(o):(a=ga(t)?ma:fa.current,o=(r=null!=(r=t.contextTypes))?ha(e,a):da),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=bo,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=o),t}function wo(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&bo.enqueueReplaceState(t,t.state,null)}function ko(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs=ho,lo(e);var o=t.contextType;"object"==typeof o&&null!==o?a.context=oo(o):(o=ga(t)?ma:fa.current,a.context=ha(e,o)),po(e,n,a,r),a.state=e.memoizedState,"function"==typeof(o=t.getDerivedStateFromProps)&&(go(e,t,o,n),a.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof a.getSnapshotBeforeUpdate||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||(t=a.state,"function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),t!==a.state&&bo.enqueueReplaceState(a,a.state,null),po(e,n,a,r),a.state=e.memoizedState),"function"==typeof a.componentDidMount&&(e.flags|=4)}var Eo=Array.isArray;function So(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(i(309));var r=n.stateNode}if(!r)throw Error(i(147,e));var a=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===a?t.ref:(t=function(e){var t=r.refs;t===ho&&(t=r.refs={}),null===e?delete t[a]:t[a]=e},t._stringRef=a,t)}if("string"!=typeof e)throw Error(i(284));if(!n._owner)throw Error(i(290,e))}return e}function xo(e,t){if("textarea"!==e.type)throw Error(i(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function Co(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.flags=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function a(e,t){return(e=Zs(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags=2,n):r:(t.flags=2,n):n}function l(t){return e&&null===t.alternate&&(t.flags=2),t}function s(e,t,n,r){return null===t||6!==t.tag?((t=Ys(n,e.mode,r)).return=e,t):((t=a(t,n)).return=e,t)}function c(e,t,n,r){return null!==t&&t.elementType===n.type?((r=a(t,n.props)).ref=So(e,t,n),r.return=e,r):((r=Vs(n.type,n.key,n.props,null,e.mode,r)).ref=So(e,t,n),r.return=e,r)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Qs(n,e.mode,r)).return=e,t):((t=a(t,n.children||[])).return=e,t)}function d(e,t,n,r,o){return null===t||7!==t.tag?((t=Ws(n,e.mode,r,o)).return=e,t):((t=a(t,n)).return=e,t)}function f(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=Ys(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case E:return(n=Vs(t.type,t.key,t.props,null,e.mode,n)).ref=So(e,null,t),n.return=e,n;case S:return(t=Qs(t,e.mode,n)).return=e,t}if(Eo(t)||$(t))return(t=Ws(t,e.mode,n,null)).return=e,t;xo(e,t)}return null}function p(e,t,n,r){var a=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==a?null:s(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case E:return n.key===a?n.type===x?d(e,t,n.props.children,r,a):c(e,t,n,r):null;case S:return n.key===a?u(e,t,n,r):null}if(Eo(n)||$(n))return null!==a?null:d(e,t,n,r,null);xo(e,n)}return null}function m(e,t,n,r,a){if("string"==typeof r||"number"==typeof r)return s(t,e=e.get(n)||null,""+r,a);if("object"==typeof r&&null!==r){switch(r.$$typeof){case E:return e=e.get(null===r.key?n:r.key)||null,r.type===x?d(t,e,r.props.children,a,r.key):c(t,e,r,a);case S:return u(t,e=e.get(null===r.key?n:r.key)||null,r,a)}if(Eo(r)||$(r))return d(t,e=e.get(n)||null,r,a,null);xo(t,r)}return null}function h(a,i,l,s){for(var c=null,u=null,d=i,h=i=0,g=null;null!==d&&h<l.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var b=p(a,d,l[h],s);if(null===b){null===d&&(d=g);break}e&&d&&null===b.alternate&&t(a,d),i=o(b,i,h),null===u?c=b:u.sibling=b,u=b,d=g}if(h===l.length)return n(a,d),c;if(null===d){for(;h<l.length;h++)null!==(d=f(a,l[h],s))&&(i=o(d,i,h),null===u?c=d:u.sibling=d,u=d);return c}for(d=r(a,d);h<l.length;h++)null!==(g=m(d,a,h,l[h],s))&&(e&&null!==g.alternate&&d.delete(null===g.key?h:g.key),i=o(g,i,h),null===u?c=g:u.sibling=g,u=g);return e&&d.forEach((function(e){return t(a,e)})),c}function g(a,l,s,c){var u=$(s);if("function"!=typeof u)throw Error(i(150));if(null==(s=u.call(s)))throw Error(i(151));for(var d=u=null,h=l,g=l=0,b=null,v=s.next();null!==h&&!v.done;g++,v=s.next()){h.index>g?(b=h,h=null):b=h.sibling;var y=p(a,h,v.value,c);if(null===y){null===h&&(h=b);break}e&&h&&null===y.alternate&&t(a,h),l=o(y,l,g),null===d?u=y:d.sibling=y,d=y,h=b}if(v.done)return n(a,h),u;if(null===h){for(;!v.done;g++,v=s.next())null!==(v=f(a,v.value,c))&&(l=o(v,l,g),null===d?u=v:d.sibling=v,d=v);return u}for(h=r(a,h);!v.done;g++,v=s.next())null!==(v=m(h,a,g,v.value,c))&&(e&&null!==v.alternate&&h.delete(null===v.key?g:v.key),l=o(v,l,g),null===d?u=v:d.sibling=v,d=v);return e&&h.forEach((function(e){return t(a,e)})),u}return function(e,r,o,s){var c="object"==typeof o&&null!==o&&o.type===x&&null===o.key;c&&(o=o.props.children);var u="object"==typeof o&&null!==o;if(u)switch(o.$$typeof){case E:e:{for(u=o.key,c=r;null!==c;){if(c.key===u){if(7===c.tag){if(o.type===x){n(e,c.sibling),(r=a(c,o.props.children)).return=e,e=r;break e}}else if(c.elementType===o.type){n(e,c.sibling),(r=a(c,o.props)).ref=So(e,c,o),r.return=e,e=r;break e}n(e,c);break}t(e,c),c=c.sibling}o.type===x?((r=Ws(o.props.children,e.mode,s,o.key)).return=e,e=r):((s=Vs(o.type,o.key,o.props,null,e.mode,s)).ref=So(e,r,o),s.return=e,e=s)}return l(e);case S:e:{for(c=o.key;null!==r;){if(r.key===c){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),(r=a(r,o.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Qs(o,e.mode,s)).return=e,e=r}return l(e)}if("string"==typeof o||"number"==typeof o)return o=""+o,null!==r&&6===r.tag?(n(e,r.sibling),(r=a(r,o)).return=e,e=r):(n(e,r),(r=Ys(o,e.mode,s)).return=e,e=r),l(e);if(Eo(o))return h(e,r,o,s);if($(o))return g(e,r,o,s);if(u&&xo(e,o),void 0===o&&!c)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(i(152,V(e.type)||"Component"))}return n(e,r)}}var To=Co(!0),_o=Co(!1),Ao={},Lo=sa(Ao),Ro=sa(Ao),Po=sa(Ao);function No(e){if(e===Ao)throw Error(i(174));return e}function Oo(e,t){switch(ua(Po,t),ua(Ro,e),ua(Lo,Ao),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:pe(null,"");break;default:t=pe(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}ca(Lo),ua(Lo,t)}function Io(){ca(Lo),ca(Ro),ca(Po)}function Do(e){No(Po.current);var t=No(Lo.current),n=pe(t,e.type);t!==n&&(ua(Ro,e),ua(Lo,n))}function Mo(e){Ro.current===e&&(ca(Lo),ca(Ro))}var Fo=sa(0);function Bo(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var jo=null,zo=null,Uo=!1;function $o(e,t){var n=Hs(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.flags=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function qo(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);default:return!1}}function Ho(e){if(Uo){var t=zo;if(t){var n=t;if(!qo(e,t)){if(!(t=Vr(n.nextSibling))||!qo(e,t))return e.flags=-1025&e.flags|2,Uo=!1,void(jo=e);$o(jo,n)}jo=e,zo=Vr(t.firstChild)}else e.flags=-1025&e.flags|2,Uo=!1,jo=e}}function Go(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;jo=e}function Zo(e){if(e!==jo)return!1;if(!Uo)return Go(e),Uo=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!qr(t,e.memoizedProps))for(t=zo;t;)$o(e,t),t=Vr(t.nextSibling);if(Go(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(i(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){zo=Vr(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}zo=null}}else zo=jo?Vr(e.stateNode.nextSibling):null;return!0}function Vo(){zo=jo=null,Uo=!1}var Wo=[];function Ko(){for(var e=0;e<Wo.length;e++)Wo[e]._workInProgressVersionPrimary=null;Wo.length=0}var Yo=k.ReactCurrentDispatcher,Qo=k.ReactCurrentBatchConfig,Xo=0,Jo=null,ei=null,ti=null,ni=!1,ri=!1;function ai(){throw Error(i(321))}function oi(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!cr(e[n],t[n]))return!1;return!0}function ii(e,t,n,r,a,o){if(Xo=o,Jo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Yo.current=null===e||null===e.memoizedState?Ni:Oi,e=n(r,a),ri){o=0;do{if(ri=!1,!(25>o))throw Error(i(301));o+=1,ti=ei=null,t.updateQueue=null,Yo.current=Ii,e=n(r,a)}while(ri)}if(Yo.current=Pi,t=null!==ei&&null!==ei.next,Xo=0,ti=ei=Jo=null,ni=!1,t)throw Error(i(300));return e}function li(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ti?Jo.memoizedState=ti=e:ti=ti.next=e,ti}function si(){if(null===ei){var e=Jo.alternate;e=null!==e?e.memoizedState:null}else e=ei.next;var t=null===ti?Jo.memoizedState:ti.next;if(null!==t)ti=t,ei=e;else{if(null===e)throw Error(i(310));e={memoizedState:(ei=e).memoizedState,baseState:ei.baseState,baseQueue:ei.baseQueue,queue:ei.queue,next:null},null===ti?Jo.memoizedState=ti=e:ti=ti.next=e}return ti}function ci(e,t){return"function"==typeof t?t(e):t}function ui(e){var t=si(),n=t.queue;if(null===n)throw Error(i(311));n.lastRenderedReducer=e;var r=ei,a=r.baseQueue,o=n.pending;if(null!==o){if(null!==a){var l=a.next;a.next=o.next,o.next=l}r.baseQueue=a=o,n.pending=null}if(null!==a){a=a.next,r=r.baseState;var s=l=o=null,c=a;do{var u=c.lane;if((Xo&u)===u)null!==s&&(s=s.next={lane:0,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),r=c.eagerReducer===e?c.eagerState:e(r,c.action);else{var d={lane:u,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===s?(l=s=d,o=r):s=s.next=d,Jo.lanes|=u,Ul|=u}c=c.next}while(null!==c&&c!==a);null===s?o=r:s.next=l,cr(r,t.memoizedState)||(Mi=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=s,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function di(e){var t=si(),n=t.queue;if(null===n)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(null!==a){n.pending=null;var l=a=a.next;do{o=e(o,l.action),l=l.next}while(l!==a);cr(o,t.memoizedState)||(Mi=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function fi(e,t,n){var r=t._getVersion;r=r(t._source);var a=t._workInProgressVersionPrimary;if(null!==a?e=a===r:(e=e.mutableReadLanes,(e=(Xo&e)===e)&&(t._workInProgressVersionPrimary=r,Wo.push(t))),e)return n(t._source);throw Wo.push(t),Error(i(350))}function pi(e,t,n,r){var a=Ol;if(null===a)throw Error(i(349));var o=t._getVersion,l=o(t._source),s=Yo.current,c=s.useState((function(){return fi(a,t,n)})),u=c[1],d=c[0];c=ti;var f=e.memoizedState,p=f.refs,m=p.getSnapshot,h=f.source;f=f.subscribe;var g=Jo;return e.memoizedState={refs:p,source:t,subscribe:r},s.useEffect((function(){p.getSnapshot=n,p.setSnapshot=u;var e=o(t._source);if(!cr(l,e)){e=n(t._source),cr(d,e)||(u(e),e=ps(g),a.mutableReadLanes|=e&a.pendingLanes),e=a.mutableReadLanes,a.entangledLanes|=e;for(var r=a.entanglements,i=e;0<i;){var s=31-qt(i),c=1<<s;r[s]|=e,i&=~c}}}),[n,t,r]),s.useEffect((function(){return r(t._source,(function(){var e=p.getSnapshot,n=p.setSnapshot;try{n(e(t._source));var r=ps(g);a.mutableReadLanes|=r&a.pendingLanes}catch(o){n((function(){throw o}))}}))}),[t,r]),cr(m,n)&&cr(h,t)&&cr(f,r)||((e={pending:null,dispatch:null,lastRenderedReducer:ci,lastRenderedState:d}).dispatch=u=Ri.bind(null,Jo,e),c.queue=e,c.baseQueue=null,d=fi(a,t,n),c.memoizedState=c.baseState=d),d}function mi(e,t,n){return pi(si(),e,t,n)}function hi(e){var t=li();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:ci,lastRenderedState:e}).dispatch=Ri.bind(null,Jo,e),[t.memoizedState,e]}function gi(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=Jo.updateQueue)?(t={lastEffect:null},Jo.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function bi(e){return e={current:e},li().memoizedState=e}function vi(){return si().memoizedState}function yi(e,t,n,r){var a=li();Jo.flags|=e,a.memoizedState=gi(1|t,n,void 0,void 0===r?null:r)}function wi(e,t,n,r){var a=si();r=void 0===r?null:r;var o=void 0;if(null!==ei){var i=ei.memoizedState;if(o=i.destroy,null!==r&&oi(r,i.deps))return void gi(t,n,o,r)}Jo.flags|=e,a.memoizedState=gi(1|t,n,o,r)}function ki(e,t){return yi(516,4,e,t)}function Ei(e,t){return wi(516,4,e,t)}function Si(e,t){return wi(4,2,e,t)}function xi(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Ci(e,t,n){return n=null!=n?n.concat([e]):null,wi(4,2,xi.bind(null,t,e),n)}function Ti(){}function _i(e,t){var n=si();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&oi(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ai(e,t){var n=si();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&oi(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Li(e,t){var n=qa();Ga(98>n?98:n,(function(){e(!0)})),Ga(97<n?97:n,(function(){var n=Qo.transition;Qo.transition=1;try{e(!1),t()}finally{Qo.transition=n}}))}function Ri(e,t,n){var r=fs(),a=ps(e),o={lane:a,action:n,eagerReducer:null,eagerState:null,next:null},i=t.pending;if(null===i?o.next=o:(o.next=i.next,i.next=o),t.pending=o,i=e.alternate,e===Jo||null!==i&&i===Jo)ri=ni=!0;else{if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var l=t.lastRenderedState,s=i(l,n);if(o.eagerReducer=i,o.eagerState=s,cr(s,l))return}catch(c){}ms(e,a,r)}}var Pi={readContext:oo,useCallback:ai,useContext:ai,useEffect:ai,useImperativeHandle:ai,useLayoutEffect:ai,useMemo:ai,useReducer:ai,useRef:ai,useState:ai,useDebugValue:ai,useDeferredValue:ai,useTransition:ai,useMutableSource:ai,useOpaqueIdentifier:ai,unstable_isNewReconciler:!1},Ni={readContext:oo,useCallback:function(e,t){return li().memoizedState=[e,void 0===t?null:t],e},useContext:oo,useEffect:ki,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,yi(4,2,xi.bind(null,t,e),n)},useLayoutEffect:function(e,t){return yi(4,2,e,t)},useMemo:function(e,t){var n=li();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=li();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Ri.bind(null,Jo,e),[r.memoizedState,e]},useRef:bi,useState:hi,useDebugValue:Ti,useDeferredValue:function(e){var t=hi(e),n=t[0],r=t[1];return ki((function(){var t=Qo.transition;Qo.transition=1;try{r(e)}finally{Qo.transition=t}}),[e]),n},useTransition:function(){var e=hi(!1),t=e[0];return bi(e=Li.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,n){var r=li();return r.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:n},pi(r,e,t,n)},useOpaqueIdentifier:function(){if(Uo){var e=!1,t=function(e){return{$$typeof:D,toString:e,valueOf:e}}((function(){throw e||(e=!0,n("r:"+(Kr++).toString(36))),Error(i(355))})),n=hi(t)[1];return 0==(2&Jo.mode)&&(Jo.flags|=516,gi(5,(function(){n("r:"+(Kr++).toString(36))}),void 0,null)),t}return hi(t="r:"+(Kr++).toString(36)),t},unstable_isNewReconciler:!1},Oi={readContext:oo,useCallback:_i,useContext:oo,useEffect:Ei,useImperativeHandle:Ci,useLayoutEffect:Si,useMemo:Ai,useReducer:ui,useRef:vi,useState:function(){return ui(ci)},useDebugValue:Ti,useDeferredValue:function(e){var t=ui(ci),n=t[0],r=t[1];return Ei((function(){var t=Qo.transition;Qo.transition=1;try{r(e)}finally{Qo.transition=t}}),[e]),n},useTransition:function(){var e=ui(ci)[0];return[vi().current,e]},useMutableSource:mi,useOpaqueIdentifier:function(){return ui(ci)[0]},unstable_isNewReconciler:!1},Ii={readContext:oo,useCallback:_i,useContext:oo,useEffect:Ei,useImperativeHandle:Ci,useLayoutEffect:Si,useMemo:Ai,useReducer:di,useRef:vi,useState:function(){return di(ci)},useDebugValue:Ti,useDeferredValue:function(e){var t=di(ci),n=t[0],r=t[1];return Ei((function(){var t=Qo.transition;Qo.transition=1;try{r(e)}finally{Qo.transition=t}}),[e]),n},useTransition:function(){var e=di(ci)[0];return[vi().current,e]},useMutableSource:mi,useOpaqueIdentifier:function(){return di(ci)[0]},unstable_isNewReconciler:!1},Di=k.ReactCurrentOwner,Mi=!1;function Fi(e,t,n,r){t.child=null===e?_o(t,null,n,r):To(t,e.child,n,r)}function Bi(e,t,n,r,a){n=n.render;var o=t.ref;return ao(t,a),r=ii(e,t,n,r,o,a),null===e||Mi?(t.flags|=1,Fi(e,t,r,a),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~a,ol(e,t,a))}function ji(e,t,n,r,a,o){if(null===e){var i=n.type;return"function"!=typeof i||Gs(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Vs(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,zi(e,t,i,r,a,o))}return i=e.child,0==(a&o)&&(a=i.memoizedProps,(n=null!==(n=n.compare)?n:dr)(a,r)&&e.ref===t.ref)?ol(e,t,o):(t.flags|=1,(e=Zs(i,r)).ref=t.ref,e.return=t,t.child=e)}function zi(e,t,n,r,a,o){if(null!==e&&dr(e.memoizedProps,r)&&e.ref===t.ref){if(Mi=!1,0==(o&a))return t.lanes=e.lanes,ol(e,t,o);0!=(16384&e.flags)&&(Mi=!0)}return qi(e,t,n,r,o)}function Ui(e,t,n){var r=t.pendingProps,a=r.children,o=null!==e?e.memoizedState:null;if("hidden"===r.mode||"unstable-defer-without-hiding"===r.mode)if(0==(4&t.mode))t.memoizedState={baseLanes:0},Es(t,n);else{if(0==(1073741824&n))return e=null!==o?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},Es(t,e),null;t.memoizedState={baseLanes:0},Es(t,null!==o?o.baseLanes:n)}else null!==o?(r=o.baseLanes|n,t.memoizedState=null):r=n,Es(t,r);return Fi(e,t,a,n),t.child}function $i(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=128)}function qi(e,t,n,r,a){var o=ga(n)?ma:fa.current;return o=ha(t,o),ao(t,a),n=ii(e,t,n,r,o,a),null===e||Mi?(t.flags|=1,Fi(e,t,n,a),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~a,ol(e,t,a))}function Hi(e,t,n,r,a){if(ga(n)){var o=!0;wa(t)}else o=!1;if(ao(t,a),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),yo(t,n,r),ko(t,n,r,a),r=!0;else if(null===e){var i=t.stateNode,l=t.memoizedProps;i.props=l;var s=i.context,c=n.contextType;"object"==typeof c&&null!==c?c=oo(c):c=ha(t,c=ga(n)?ma:fa.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof i.getSnapshotBeforeUpdate;d||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(l!==r||s!==c)&&wo(t,i,r,c),io=!1;var f=t.memoizedState;i.state=f,po(t,r,i,a),s=t.memoizedState,l!==r||f!==s||pa.current||io?("function"==typeof u&&(go(t,n,u,r),s=t.memoizedState),(l=io||vo(t,n,l,r,f,s,c))?(d||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||("function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount()),"function"==typeof i.componentDidMount&&(t.flags|=4)):("function"==typeof i.componentDidMount&&(t.flags|=4),t.memoizedProps=r,t.memoizedState=s),i.props=r,i.state=s,i.context=c,r=l):("function"==typeof i.componentDidMount&&(t.flags|=4),r=!1)}else{i=t.stateNode,so(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:Ya(t.type,l),i.props=c,d=t.pendingProps,f=i.context,"object"==typeof(s=n.contextType)&&null!==s?s=oo(s):s=ha(t,s=ga(n)?ma:fa.current);var p=n.getDerivedStateFromProps;(u="function"==typeof p||"function"==typeof i.getSnapshotBeforeUpdate)||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(l!==d||f!==s)&&wo(t,i,r,s),io=!1,f=t.memoizedState,i.state=f,po(t,r,i,a);var m=t.memoizedState;l!==d||f!==m||pa.current||io?("function"==typeof p&&(go(t,n,p,r),m=t.memoizedState),(c=io||vo(t,n,c,r,f,m,s))?(u||"function"!=typeof i.UNSAFE_componentWillUpdate&&"function"!=typeof i.componentWillUpdate||("function"==typeof i.componentWillUpdate&&i.componentWillUpdate(r,m,s),"function"==typeof i.UNSAFE_componentWillUpdate&&i.UNSAFE_componentWillUpdate(r,m,s)),"function"==typeof i.componentDidUpdate&&(t.flags|=4),"function"==typeof i.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!=typeof i.componentDidUpdate||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=256),t.memoizedProps=r,t.memoizedState=m),i.props=r,i.state=m,i.context=s,r=c):("function"!=typeof i.componentDidUpdate||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=256),r=!1)}return Gi(e,t,n,r,o,a)}function Gi(e,t,n,r,a,o){$i(e,t);var i=0!=(64&t.flags);if(!r&&!i)return a&&ka(t,n,!1),ol(e,t,o);r=t.stateNode,Di.current=t;var l=i&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&i?(t.child=To(t,e.child,null,o),t.child=To(t,null,l,o)):Fi(e,t,l,o),t.memoizedState=r.state,a&&ka(t,n,!0),t.child}function Zi(e){var t=e.stateNode;t.pendingContext?va(0,t.pendingContext,t.pendingContext!==t.context):t.context&&va(0,t.context,!1),Oo(e,t.containerInfo)}var Vi,Wi,Ki,Yi,Qi={dehydrated:null,retryLane:0};function Xi(e,t,n){var r,a=t.pendingProps,o=Fo.current,i=!1;return(r=0!=(64&t.flags))||(r=(null===e||null!==e.memoizedState)&&0!=(2&o)),r?(i=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===a.fallback||!0===a.unstable_avoidThisFallback||(o|=1),ua(Fo,1&o),null===e?(void 0!==a.fallback&&Ho(t),e=a.children,o=a.fallback,i?(e=Ji(t,e,o,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Qi,e):"number"==typeof a.unstable_expectedLoadTime?(e=Ji(t,e,o,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Qi,t.lanes=33554432,e):((n=Ks({mode:"visible",children:e},t.mode,n,null)).return=t,t.child=n)):(e.memoizedState,i?(a=tl(e,t,a.children,a.fallback,n),i=t.child,o=e.child.memoizedState,i.memoizedState=null===o?{baseLanes:n}:{baseLanes:o.baseLanes|n},i.childLanes=e.childLanes&~n,t.memoizedState=Qi,a):(n=el(e,t,a.children,n),t.memoizedState=null,n))}function Ji(e,t,n,r){var a=e.mode,o=e.child;return t={mode:"hidden",children:t},0==(2&a)&&null!==o?(o.childLanes=0,o.pendingProps=t):o=Ks(t,a,0,null),n=Ws(n,a,r,null),o.return=e,n.return=e,o.sibling=n,e.child=o,n}function el(e,t,n,r){var a=e.child;return e=a.sibling,n=Zs(a,{mode:"visible",children:n}),0==(2&t.mode)&&(n.lanes=r),n.return=t,n.sibling=null,null!==e&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=n}function tl(e,t,n,r,a){var o=t.mode,i=e.child;e=i.sibling;var l={mode:"hidden",children:n};return 0==(2&o)&&t.child!==i?((n=t.child).childLanes=0,n.pendingProps=l,null!==(i=n.lastEffect)?(t.firstEffect=n.firstEffect,t.lastEffect=i,i.nextEffect=null):t.firstEffect=t.lastEffect=null):n=Zs(i,l),null!==e?r=Zs(e,r):(r=Ws(r,o,a,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}function nl(e,t){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),ro(e.return,t)}function rl(e,t,n,r,a,o){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a,lastEffect:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=a,i.lastEffect=o)}function al(e,t,n){var r=t.pendingProps,a=r.revealOrder,o=r.tail;if(Fi(e,t,r.children,n),0!=(2&(r=Fo.current)))r=1&r|2,t.flags|=64;else{if(null!==e&&0!=(64&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&nl(e,n);else if(19===e.tag)nl(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ua(Fo,r),0==(2&t.mode))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;null!==n;)null!==(e=n.alternate)&&null===Bo(e)&&(a=n),n=n.sibling;null===(n=a)?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),rl(t,!1,a,n,o,t.lastEffect);break;case"backwards":for(n=null,a=t.child,t.child=null;null!==a;){if(null!==(e=a.alternate)&&null===Bo(e)){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}rl(t,!0,n,null,o,t.lastEffect);break;case"together":rl(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function ol(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Ul|=t.lanes,0!=(n&t.childLanes)){if(null!==e&&t.child!==e.child)throw Error(i(153));if(null!==t.child){for(n=Zs(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Zs(e,e.pendingProps)).return=t;n.sibling=null}return t.child}return null}function il(e,t){if(!Uo)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ll(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:case 17:return ga(t.type)&&ba(),null;case 3:return Io(),ca(pa),ca(fa),Ko(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(Zo(t)?t.flags|=4:r.hydrate||(t.flags|=256)),Wi(t),null;case 5:Mo(t);var o=No(Po.current);if(n=t.type,null!==e&&null!=t.stateNode)Ki(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=128);else{if(!r){if(null===t.stateNode)throw Error(i(166));return null}if(e=No(Lo.current),Zo(t)){r=t.stateNode,n=t.type;var l=t.memoizedProps;switch(r[Qr]=t,r[Xr]=l,n){case"dialog":Lr("cancel",r),Lr("close",r);break;case"iframe":case"object":case"embed":Lr("load",r);break;case"video":case"audio":for(e=0;e<Cr.length;e++)Lr(Cr[e],r);break;case"source":Lr("error",r);break;case"img":case"image":case"link":Lr("error",r),Lr("load",r);break;case"details":Lr("toggle",r);break;case"input":ee(r,l),Lr("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!l.multiple},Lr("invalid",r);break;case"textarea":se(r,l),Lr("invalid",r)}for(var c in Se(n,l),e=null,l)l.hasOwnProperty(c)&&(o=l[c],"children"===c?"string"==typeof o?r.textContent!==o&&(e=["children",o]):"number"==typeof o&&r.textContent!==""+o&&(e=["children",""+o]):s.hasOwnProperty(c)&&null!=o&&"onScroll"===c&&Lr("scroll",r));switch(n){case"input":Y(r),re(r,l,!0);break;case"textarea":Y(r),ue(r);break;case"select":case"option":break;default:"function"==typeof l.onClick&&(r.onclick=jr)}r=e,t.updateQueue=r,null!==r&&(t.flags|=4)}else{switch(c=9===o.nodeType?o:o.ownerDocument,e===de.html&&(e=fe(n)),e===de.html?"script"===n?((e=c.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=c.createElement(n,{is:r.is}):(e=c.createElement(n),"select"===n&&(c=e,r.multiple?c.multiple=!0:r.size&&(c.size=r.size))):e=c.createElementNS(e,n),e[Qr]=t,e[Xr]=r,Vi(e,t,!1,!1),t.stateNode=e,c=xe(n,r),n){case"dialog":Lr("cancel",e),Lr("close",e),o=r;break;case"iframe":case"object":case"embed":Lr("load",e),o=r;break;case"video":case"audio":for(o=0;o<Cr.length;o++)Lr(Cr[o],e);o=r;break;case"source":Lr("error",e),o=r;break;case"img":case"image":case"link":Lr("error",e),Lr("load",e),o=r;break;case"details":Lr("toggle",e),o=r;break;case"input":ee(e,r),o=J(e,r),Lr("invalid",e);break;case"option":o=oe(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=a({},r,{value:void 0}),Lr("invalid",e);break;case"textarea":se(e,r),o=le(e,r),Lr("invalid",e);break;default:o=r}Se(n,o);var u=o;for(l in u)if(u.hasOwnProperty(l)){var d=u[l];"style"===l?ke(e,d):"dangerouslySetInnerHTML"===l?null!=(d=d?d.__html:void 0)&&ge(e,d):"children"===l?"string"==typeof d?("textarea"!==n||""!==d)&&be(e,d):"number"==typeof d&&be(e,""+d):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(s.hasOwnProperty(l)?null!=d&&"onScroll"===l&&Lr("scroll",e):null!=d&&w(e,l,d,c))}switch(n){case"input":Y(e),re(e,r,!1);break;case"textarea":Y(e),ue(e);break;case"option":null!=r.value&&e.setAttribute("value",""+W(r.value));break;case"select":e.multiple=!!r.multiple,null!=(l=r.value)?ie(e,!!r.multiple,l,!1):null!=r.defaultValue&&ie(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof o.onClick&&(e.onclick=jr)}$r(n,r)&&(t.flags|=4)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)Yi(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(i(166));n=No(Po.current),No(Lo.current),Zo(t)?(r=t.stateNode,n=t.memoizedProps,r[Qr]=t,r.nodeValue!==n&&(t.flags|=4)):((r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Qr]=t,t.stateNode=r)}return null;case 13:return ca(Fo),r=t.memoizedState,0!=(64&t.flags)?(t.lanes=n,t):(r=null!==r,n=!1,null===e?void 0!==t.memoizedProps.fallback&&Zo(t):n=null!==e.memoizedState,r&&!n&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&Fo.current)?0===Bl&&(Bl=3):(0!==Bl&&3!==Bl||(Bl=4),null===Ol||0==(134217727&Ul)&&0==(134217727&$l)||vs(Ol,Dl))),(r||n)&&(t.flags|=4),null);case 4:return Io(),Wi(t),null===e&&Pr(t.stateNode.containerInfo),null;case 10:return no(t),null;case 19:if(ca(Fo),null===(r=t.memoizedState))return null;if(l=0!=(64&t.flags),null===(c=r.rendering))if(l)il(r,!1);else{if(0!==Bl||null!==e&&0!=(64&e.flags))for(e=t.child;null!==e;){if(null!==(c=Bo(e))){for(t.flags|=64,il(r,!1),null!==(l=c.updateQueue)&&(t.updateQueue=l,t.flags|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=n,n=t.child;null!==n;)e=r,(l=n).flags&=2,l.nextEffect=null,l.firstEffect=null,l.lastEffect=null,null===(c=l.alternate)?(l.childLanes=0,l.lanes=e,l.child=null,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=c.childLanes,l.lanes=c.lanes,l.child=c.child,l.memoizedProps=c.memoizedProps,l.memoizedState=c.memoizedState,l.updateQueue=c.updateQueue,l.type=c.type,e=c.dependencies,l.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ua(Fo,1&Fo.current|2),t.child}e=e.sibling}null!==r.tail&&$a()>Zl&&(t.flags|=64,l=!0,il(r,!1),t.lanes=33554432)}else{if(!l)if(null!==(e=Bo(c))){if(t.flags|=64,l=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),il(r,!0),null===r.tail&&"hidden"===r.tailMode&&!c.alternate&&!Uo)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*$a()-r.renderingStartTime>Zl&&1073741824!==n&&(t.flags|=64,l=!0,il(r,!1),t.lanes=33554432);r.isBackwards?(c.sibling=t.child,t.child=c):(null!==(n=r.last)?n.sibling=c:t.child=c,r.last=c)}return null!==r.tail?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=$a(),n.sibling=null,t=Fo.current,ua(Fo,l?1&t|2:1&t),n):null;case 23:case 24:return Ss(),null!==e&&null!==e.memoizedState!=(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==r.mode&&(t.flags|=4),null}throw Error(i(156,t.tag))}function sl(e){switch(e.tag){case 1:ga(e.type)&&ba();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(Io(),ca(pa),ca(fa),Ko(),0!=(64&(t=e.flags)))throw Error(i(285));return e.flags=-4097&t|64,e;case 5:return Mo(e),null;case 13:return ca(Fo),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return ca(Fo),null;case 4:return Io(),null;case 10:return no(e),null;case 23:case 24:return Ss(),null;default:return null}}function cl(e,t){try{var n="",r=t;do{n+=Z(r),r=r.return}while(r);var a=n}catch(o){a="\nError generating stack: "+o.message+"\n"+o.stack}return{value:e,source:t,stack:a}}function ul(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}Vi=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Wi=function(){},Ki=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,No(Lo.current);var i,l=null;switch(n){case"input":o=J(e,o),r=J(e,r),l=[];break;case"option":o=oe(e,o),r=oe(e,r),l=[];break;case"select":o=a({},o,{value:void 0}),r=a({},r,{value:void 0}),l=[];break;case"textarea":o=le(e,o),r=le(e,r),l=[];break;default:"function"!=typeof o.onClick&&"function"==typeof r.onClick&&(e.onclick=jr)}for(d in Se(n,r),n=null,o)if(!r.hasOwnProperty(d)&&o.hasOwnProperty(d)&&null!=o[d])if("style"===d){var c=o[d];for(i in c)c.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else"dangerouslySetInnerHTML"!==d&&"children"!==d&&"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&"autoFocus"!==d&&(s.hasOwnProperty(d)?l||(l=[]):(l=l||[]).push(d,null));for(d in r){var u=r[d];if(c=null!=o?o[d]:void 0,r.hasOwnProperty(d)&&u!==c&&(null!=u||null!=c))if("style"===d)if(c){for(i in c)!c.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in u)u.hasOwnProperty(i)&&c[i]!==u[i]&&(n||(n={}),n[i]=u[i])}else n||(l||(l=[]),l.push(d,n)),n=u;else"dangerouslySetInnerHTML"===d?(u=u?u.__html:void 0,c=c?c.__html:void 0,null!=u&&c!==u&&(l=l||[]).push(d,u)):"children"===d?"string"!=typeof u&&"number"!=typeof u||(l=l||[]).push(d,""+u):"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&(s.hasOwnProperty(d)?(null!=u&&"onScroll"===d&&Lr("scroll",e),l||c===u||(l=[])):"object"==typeof u&&null!==u&&u.$$typeof===D?u.toString():(l=l||[]).push(d,u))}n&&(l=l||[]).push("style",n);var d=l;(t.updateQueue=d)&&(t.flags|=4)}},Yi=function(e,t,n,r){n!==r&&(t.flags|=4)};var dl="function"==typeof WeakMap?WeakMap:Map;function fl(e,t,n){(n=co(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Yl||(Yl=!0,Ql=r),ul(0,t)},n}function pl(e,t,n){(n=co(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var a=t.value;n.payload=function(){return ul(0,t),r(a)}}var o=e.stateNode;return null!==o&&"function"==typeof o.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===Xl?Xl=new Set([this]):Xl.add(this),ul(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}var ml="function"==typeof WeakSet?WeakSet:Set;function hl(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(n){zs(e,n)}else t.current=null}function gl(e,t){switch(t.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17:return;case 1:if(256&t.flags&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:Ya(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(256&t.flags&&Zr(t.stateNode.containerInfo))}throw Error(i(163))}function bl(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{if(3==(3&e.tag)){var r=e.create;e.destroy=r()}e=e.next}while(e!==t)}if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{var a=e;r=a.next,0!=(4&(a=a.tag))&&0!=(1&a)&&(Fs(n,e),Ms(n,e)),e=r}while(e!==t)}return;case 1:return e=n.stateNode,4&n.flags&&(null===t?e.componentDidMount():(r=n.elementType===n.type?t.memoizedProps:Ya(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=n.updateQueue)&&mo(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:case 1:e=n.child.stateNode}mo(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.flags&&$r(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&kt(n)))))}throw Error(i(163))}function vl(e,t){for(var n=e;;){if(5===n.tag){var r=n.stateNode;if(t)"function"==typeof(r=r.style).setProperty?r.setProperty("display","none","important"):r.display="none";else{r=n.stateNode;var a=n.memoizedProps.style;a=null!=a&&a.hasOwnProperty("display")?a.display:null,r.style.display=we("display",a)}}else if(6===n.tag)n.stateNode.nodeValue=t?"":n.memoizedProps;else if((23!==n.tag&&24!==n.tag||null===n.memoizedState||n===e)&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function yl(e,t){if(Sa&&"function"==typeof Sa.onCommitFiberUnmount)try{Sa.onCommitFiberUnmount(Ea,t)}catch(o){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var n=e=e.next;do{var r=n,a=r.destroy;if(r=r.tag,void 0!==a)if(0!=(4&r))Fs(t,n);else{r=t;try{a()}catch(o){zs(r,o)}}n=n.next}while(n!==e)}break;case 1:if(hl(t),"function"==typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(o){zs(t,o)}break;case 5:hl(t);break;case 4:Cl(e,t)}}function wl(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function kl(e){return 5===e.tag||3===e.tag||4===e.tag}function El(e){e:{for(var t=e.return;null!==t;){if(kl(t))break e;t=t.return}throw Error(i(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(i(161))}16&n.flags&&(be(t,""),n.flags&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||kl(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.flags)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.flags)){n=n.stateNode;break e}}r?Sl(e,n,t):xl(e,n,t)}function Sl(e,t,n){var r=e.tag,a=5===r||6===r;if(a)e=a?e.stateNode:e.stateNode.instance,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=jr));else if(4!==r&&null!==(e=e.child))for(Sl(e,t,n),e=e.sibling;null!==e;)Sl(e,t,n),e=e.sibling}function xl(e,t,n){var r=e.tag,a=5===r||6===r;if(a)e=a?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(xl(e,t,n),e=e.sibling;null!==e;)xl(e,t,n),e=e.sibling}function Cl(e,t){for(var n,r,a=t,o=!1;;){if(!o){o=a.return;e:for(;;){if(null===o)throw Error(i(160));switch(n=o.stateNode,o.tag){case 5:r=!1;break e;case 3:case 4:n=n.containerInfo,r=!0;break e}o=o.return}o=!0}if(5===a.tag||6===a.tag){e:for(var l=e,s=a,c=s;;)if(yl(l,c),null!==c.child&&4!==c.tag)c.child.return=c,c=c.child;else{if(c===s)break e;for(;null===c.sibling;){if(null===c.return||c.return===s)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}r?(l=n,s=a.stateNode,8===l.nodeType?l.parentNode.removeChild(s):l.removeChild(s)):n.removeChild(a.stateNode)}else if(4===a.tag){if(null!==a.child){n=a.stateNode.containerInfo,r=!0,a.child.return=a,a=a.child;continue}}else if(yl(e,a),null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break;for(;null===a.sibling;){if(null===a.return||a.return===t)return;4===(a=a.return).tag&&(o=!1)}a.sibling.return=a.return,a=a.sibling}}function Tl(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var r=n=n.next;do{3==(3&r.tag)&&(e=r.destroy,r.destroy=void 0,void 0!==e&&e()),r=r.next}while(r!==n)}return;case 1:case 12:case 17:return;case 5:if(null!=(n=t.stateNode)){r=t.memoizedProps;var a=null!==e?e.memoizedProps:r;e=t.type;var o=t.updateQueue;if(t.updateQueue=null,null!==o){for(n[Xr]=r,"input"===e&&"radio"===r.type&&null!=r.name&&te(n,r),xe(e,a),t=xe(e,r),a=0;a<o.length;a+=2){var l=o[a],s=o[a+1];"style"===l?ke(n,s):"dangerouslySetInnerHTML"===l?ge(n,s):"children"===l?be(n,s):w(n,l,s,t)}switch(e){case"input":ne(n,r);break;case"textarea":ce(n,r);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(o=r.value)?ie(n,!!r.multiple,o,!1):e!==!!r.multiple&&(null!=r.defaultValue?ie(n,!!r.multiple,r.defaultValue,!0):ie(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(i(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((n=t.stateNode).hydrate&&(n.hydrate=!1,kt(n.containerInfo)));case 13:return null!==t.memoizedState&&(Gl=$a(),vl(t.child,!0)),void _l(t);case 19:return void _l(t);case 23:case 24:return void vl(t,null!==t.memoizedState)}throw Error(i(163))}function _l(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new ml),t.forEach((function(t){var r=$s.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Al(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&(null!==(t=t.memoizedState)&&null===t.dehydrated)}var Ll=Math.ceil,Rl=k.ReactCurrentDispatcher,Pl=k.ReactCurrentOwner,Nl=0,Ol=null,Il=null,Dl=0,Ml=0,Fl=sa(0),Bl=0,jl=null,zl=0,Ul=0,$l=0,ql=0,Hl=null,Gl=0,Zl=1/0;function Vl(){Zl=$a()+500}var Wl,Kl=null,Yl=!1,Ql=null,Xl=null,Jl=!1,es=null,ts=90,ns=[],rs=[],as=null,os=0,is=null,ls=-1,ss=0,cs=0,us=null,ds=!1;function fs(){return 0!=(48&Nl)?$a():-1!==ls?ls:ls=$a()}function ps(e){if(0==(2&(e=e.mode)))return 1;if(0==(4&e))return 99===qa()?1:2;if(0===ss&&(ss=zl),0!==Ka.transition){0!==cs&&(cs=null!==Hl?Hl.pendingLanes:0),e=ss;var t=4186112&~cs;return 0===(t&=-t)&&(0===(t=(e=4186112&~e)&-e)&&(t=8192)),t}return e=qa(),0!=(4&Nl)&&98===e?e=jt(12,ss):e=jt(e=function(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(e),ss),e}function ms(e,t,n){if(50<os)throw os=0,is=null,Error(i(185));if(null===(e=hs(e,t)))return null;$t(e,t,n),e===Ol&&($l|=t,4===Bl&&vs(e,Dl));var r=qa();1===t?0!=(8&Nl)&&0==(48&Nl)?ys(e):(gs(e,n),0===Nl&&(Vl(),Va())):(0==(4&Nl)||98!==r&&99!==r||(null===as?as=new Set([e]):as.add(e)),gs(e,n)),Hl=e}function hs(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}function gs(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,a=e.pingedLanes,o=e.expirationTimes,l=e.pendingLanes;0<l;){var s=31-qt(l),c=1<<s,u=o[s];if(-1===u){if(0==(c&r)||0!=(c&a)){u=t,Mt(c);var d=Dt;o[s]=10<=d?u+250:6<=d?u+5e3:-1}}else u<=t&&(e.expiredLanes|=c);l&=~c}if(r=Ft(e,e===Ol?Dl:0),t=Dt,0===r)null!==n&&(n!==Ma&&Ta(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==Ma&&Ta(n)}15===t?(n=ys.bind(null,e),null===Ba?(Ba=[n],ja=Ca(Pa,Wa)):Ba.push(n),n=Ma):14===t?n=Za(99,ys.bind(null,e)):(n=function(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(i(358,e))}}(t),n=Za(n,bs.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function bs(e){if(ls=-1,cs=ss=0,0!=(48&Nl))throw Error(i(327));var t=e.callbackNode;if(Ds()&&e.callbackNode!==t)return null;var n=Ft(e,e===Ol?Dl:0);if(0===n)return null;var r=n,a=Nl;Nl|=16;var o=Ts();for(Ol===e&&Dl===r||(Vl(),xs(e,r));;)try{Ls();break}catch(s){Cs(e,s)}if(to(),Rl.current=o,Nl=a,null!==Il?r=0:(Ol=null,Dl=0,r=Bl),0!=(zl&$l))xs(e,0);else if(0!==r){if(2===r&&(Nl|=64,e.hydrate&&(e.hydrate=!1,Zr(e.containerInfo)),0!==(n=Bt(e))&&(r=_s(e,n))),1===r)throw t=jl,xs(e,0),vs(e,n),gs(e,$a()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(i(345));case 2:case 5:Ns(e);break;case 3:if(vs(e,n),(62914560&n)===n&&10<(r=Gl+500-$a())){if(0!==Ft(e,0))break;if(((a=e.suspendedLanes)&n)!==n){fs(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Hr(Ns.bind(null,e),r);break}Ns(e);break;case 4:if(vs(e,n),(4186112&n)===n)break;for(r=e.eventTimes,a=-1;0<n;){var l=31-qt(n);o=1<<l,(l=r[l])>a&&(a=l),n&=~o}if(n=a,10<(n=(120>(n=$a()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Ll(n/1960))-n)){e.timeoutHandle=Hr(Ns.bind(null,e),n);break}Ns(e);break;default:throw Error(i(329))}}return gs(e,$a()),e.callbackNode===t?bs.bind(null,e):null}function vs(e,t){for(t&=~ql,t&=~$l,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-qt(t),r=1<<n;e[n]=-1,t&=~r}}function ys(e){if(0!=(48&Nl))throw Error(i(327));if(Ds(),e===Ol&&0!=(e.expiredLanes&Dl)){var t=Dl,n=_s(e,t);0!=(zl&$l)&&(n=_s(e,t=Ft(e,t)))}else n=_s(e,t=Ft(e,0));if(0!==e.tag&&2===n&&(Nl|=64,e.hydrate&&(e.hydrate=!1,Zr(e.containerInfo)),0!==(t=Bt(e))&&(n=_s(e,t))),1===n)throw n=jl,xs(e,0),vs(e,t),gs(e,$a()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ns(e),gs(e,$a()),null}function ws(e,t){var n=Nl;Nl|=1;try{return e(t)}finally{0===(Nl=n)&&(Vl(),Va())}}function ks(e,t){var n=Nl;Nl&=-2,Nl|=8;try{return e(t)}finally{0===(Nl=n)&&(Vl(),Va())}}function Es(e,t){ua(Fl,Ml),Ml|=t,zl|=t}function Ss(){Ml=Fl.current,ca(Fl)}function xs(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,Gr(n)),null!==Il)for(n=Il.return;null!==n;){var r=n;switch(r.tag){case 1:null!=(r=r.type.childContextTypes)&&ba();break;case 3:Io(),ca(pa),ca(fa),Ko();break;case 5:Mo(r);break;case 4:Io();break;case 13:case 19:ca(Fo);break;case 10:no(r);break;case 23:case 24:Ss()}n=n.return}Ol=e,Il=Zs(e.current,null),Dl=Ml=zl=t,Bl=0,jl=null,ql=$l=Ul=0}function Cs(e,t){for(;;){var n=Il;try{if(to(),Yo.current=Pi,ni){for(var r=Jo.memoizedState;null!==r;){var a=r.queue;null!==a&&(a.pending=null),r=r.next}ni=!1}if(Xo=0,ti=ei=Jo=null,ri=!1,Pl.current=null,null===n||null===n.return){Bl=1,jl=t,Il=null;break}e:{var o=e,i=n.return,l=n,s=t;if(t=Dl,l.flags|=2048,l.firstEffect=l.lastEffect=null,null!==s&&"object"==typeof s&&"function"==typeof s.then){var c=s;if(0==(2&l.mode)){var u=l.alternate;u?(l.updateQueue=u.updateQueue,l.memoizedState=u.memoizedState,l.lanes=u.lanes):(l.updateQueue=null,l.memoizedState=null)}var d=0!=(1&Fo.current),f=i;do{var p;if(p=13===f.tag){var m=f.memoizedState;if(null!==m)p=null!==m.dehydrated;else{var h=f.memoizedProps;p=void 0!==h.fallback&&(!0!==h.unstable_avoidThisFallback||!d)}}if(p){var g=f.updateQueue;if(null===g){var b=new Set;b.add(c),f.updateQueue=b}else g.add(c);if(0==(2&f.mode)){if(f.flags|=64,l.flags|=16384,l.flags&=-2981,1===l.tag)if(null===l.alternate)l.tag=17;else{var v=co(-1,1);v.tag=2,uo(l,v)}l.lanes|=1;break e}s=void 0,l=t;var y=o.pingCache;if(null===y?(y=o.pingCache=new dl,s=new Set,y.set(c,s)):void 0===(s=y.get(c))&&(s=new Set,y.set(c,s)),!s.has(l)){s.add(l);var w=Us.bind(null,o,c,l);c.then(w,w)}f.flags|=4096,f.lanes=t;break e}f=f.return}while(null!==f);s=Error((V(l.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==Bl&&(Bl=2),s=cl(s,l),f=i;do{switch(f.tag){case 3:o=s,f.flags|=4096,t&=-t,f.lanes|=t,fo(f,fl(0,o,t));break e;case 1:o=s;var k=f.type,E=f.stateNode;if(0==(64&f.flags)&&("function"==typeof k.getDerivedStateFromError||null!==E&&"function"==typeof E.componentDidCatch&&(null===Xl||!Xl.has(E)))){f.flags|=4096,t&=-t,f.lanes|=t,fo(f,pl(f,o,t));break e}}f=f.return}while(null!==f)}Ps(n)}catch(S){t=S,Il===n&&null!==n&&(Il=n=n.return);continue}break}}function Ts(){var e=Rl.current;return Rl.current=Pi,null===e?Pi:e}function _s(e,t){var n=Nl;Nl|=16;var r=Ts();for(Ol===e&&Dl===t||xs(e,t);;)try{As();break}catch(a){Cs(e,a)}if(to(),Nl=n,Rl.current=r,null!==Il)throw Error(i(261));return Ol=null,Dl=0,Bl}function As(){for(;null!==Il;)Rs(Il)}function Ls(){for(;null!==Il&&!_a();)Rs(Il)}function Rs(e){var t=Wl(e.alternate,e,Ml);e.memoizedProps=e.pendingProps,null===t?Ps(e):Il=t,Pl.current=null}function Ps(e){var t=e;do{var n=t.alternate;if(e=t.return,0==(2048&t.flags)){if(null!==(n=ll(n,t,Ml)))return void(Il=n);if(24!==(n=t).tag&&23!==n.tag||null===n.memoizedState||0!=(1073741824&Ml)||0==(4&n.mode)){for(var r=0,a=n.child;null!==a;)r|=a.lanes|a.childLanes,a=a.sibling;n.childLanes=r}null!==e&&0==(2048&e.flags)&&(null===e.firstEffect&&(e.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(null!==e.lastEffect?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}else{if(null!==(n=sl(t)))return n.flags&=2047,void(Il=n);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(null!==(t=t.sibling))return void(Il=t);Il=t=e}while(null!==t);0===Bl&&(Bl=5)}function Ns(e){var t=qa();return Ga(99,Os.bind(null,e,t)),null}function Os(e,t){do{Ds()}while(null!==es);if(0!=(48&Nl))throw Error(i(327));var n=e.finishedWork;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(i(177));e.callbackNode=null;var r=n.lanes|n.childLanes,a=r,o=e.pendingLanes&~a;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=a,e.mutableReadLanes&=a,e.entangledLanes&=a,a=e.entanglements;for(var l=e.eventTimes,s=e.expirationTimes;0<o;){var c=31-qt(o),u=1<<c;a[c]=0,l[c]=-1,s[c]=-1,o&=~u}if(null!==as&&0==(24&r)&&as.has(e)&&as.delete(e),e===Ol&&(Il=Ol=null,Dl=0),1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){if(a=Nl,Nl|=32,Pl.current=null,zr=Wt,gr(l=hr())){if("selectionStart"in l)s={start:l.selectionStart,end:l.selectionEnd};else e:if(s=(s=l.ownerDocument)&&s.defaultView||window,(u=s.getSelection&&s.getSelection())&&0!==u.rangeCount){s=u.anchorNode,o=u.anchorOffset,c=u.focusNode,u=u.focusOffset;try{s.nodeType,c.nodeType}catch(T){s=null;break e}var d=0,f=-1,p=-1,m=0,h=0,g=l,b=null;t:for(;;){for(var v;g!==s||0!==o&&3!==g.nodeType||(f=d+o),g!==c||0!==u&&3!==g.nodeType||(p=d+u),3===g.nodeType&&(d+=g.nodeValue.length),null!==(v=g.firstChild);)b=g,g=v;for(;;){if(g===l)break t;if(b===s&&++m===o&&(f=d),b===c&&++h===u&&(p=d),null!==(v=g.nextSibling))break;b=(g=b).parentNode}g=v}s=-1===f||-1===p?null:{start:f,end:p}}else s=null;s=s||{start:0,end:0}}else s=null;Ur={focusedElem:l,selectionRange:s},Wt=!1,us=null,ds=!1,Kl=r;do{try{Is()}catch(T){if(null===Kl)throw Error(i(330));zs(Kl,T),Kl=Kl.nextEffect}}while(null!==Kl);us=null,Kl=r;do{try{for(l=e;null!==Kl;){var y=Kl.flags;if(16&y&&be(Kl.stateNode,""),128&y){var w=Kl.alternate;if(null!==w){var k=w.ref;null!==k&&("function"==typeof k?k(null):k.current=null)}}switch(1038&y){case 2:El(Kl),Kl.flags&=-3;break;case 6:El(Kl),Kl.flags&=-3,Tl(Kl.alternate,Kl);break;case 1024:Kl.flags&=-1025;break;case 1028:Kl.flags&=-1025,Tl(Kl.alternate,Kl);break;case 4:Tl(Kl.alternate,Kl);break;case 8:Cl(l,s=Kl);var E=s.alternate;wl(s),null!==E&&wl(E)}Kl=Kl.nextEffect}}catch(T){if(null===Kl)throw Error(i(330));zs(Kl,T),Kl=Kl.nextEffect}}while(null!==Kl);if(k=Ur,w=hr(),y=k.focusedElem,l=k.selectionRange,w!==y&&y&&y.ownerDocument&&mr(y.ownerDocument.documentElement,y)){null!==l&&gr(y)&&(w=l.start,void 0===(k=l.end)&&(k=w),"selectionStart"in y?(y.selectionStart=w,y.selectionEnd=Math.min(k,y.value.length)):(k=(w=y.ownerDocument||document)&&w.defaultView||window).getSelection&&(k=k.getSelection(),s=y.textContent.length,E=Math.min(l.start,s),l=void 0===l.end?E:Math.min(l.end,s),!k.extend&&E>l&&(s=l,l=E,E=s),s=pr(y,E),o=pr(y,l),s&&o&&(1!==k.rangeCount||k.anchorNode!==s.node||k.anchorOffset!==s.offset||k.focusNode!==o.node||k.focusOffset!==o.offset)&&((w=w.createRange()).setStart(s.node,s.offset),k.removeAllRanges(),E>l?(k.addRange(w),k.extend(o.node,o.offset)):(w.setEnd(o.node,o.offset),k.addRange(w))))),w=[];for(k=y;k=k.parentNode;)1===k.nodeType&&w.push({element:k,left:k.scrollLeft,top:k.scrollTop});for("function"==typeof y.focus&&y.focus(),y=0;y<w.length;y++)(k=w[y]).element.scrollLeft=k.left,k.element.scrollTop=k.top}Wt=!!zr,Ur=zr=null,e.current=n,Kl=r;do{try{for(y=e;null!==Kl;){var S=Kl.flags;if(36&S&&bl(y,Kl.alternate,Kl),128&S){w=void 0;var x=Kl.ref;if(null!==x){var C=Kl.stateNode;Kl.tag,w=C,"function"==typeof x?x(w):x.current=w}}Kl=Kl.nextEffect}}catch(T){if(null===Kl)throw Error(i(330));zs(Kl,T),Kl=Kl.nextEffect}}while(null!==Kl);Kl=null,Fa(),Nl=a}else e.current=n;if(Jl)Jl=!1,es=e,ts=t;else for(Kl=r;null!==Kl;)t=Kl.nextEffect,Kl.nextEffect=null,8&Kl.flags&&((S=Kl).sibling=null,S.stateNode=null),Kl=t;if(0===(r=e.pendingLanes)&&(Xl=null),1===r?e===is?os++:(os=0,is=e):os=0,n=n.stateNode,Sa&&"function"==typeof Sa.onCommitFiberRoot)try{Sa.onCommitFiberRoot(Ea,n,void 0,64==(64&n.current.flags))}catch(T){}if(gs(e,$a()),Yl)throw Yl=!1,e=Ql,Ql=null,e;return 0!=(8&Nl)||Va(),null}function Is(){for(;null!==Kl;){var e=Kl.alternate;ds||null===us||(0!=(8&Kl.flags)?Je(Kl,us)&&(ds=!0):13===Kl.tag&&Al(e,Kl)&&Je(Kl,us)&&(ds=!0));var t=Kl.flags;0!=(256&t)&&gl(e,Kl),0==(512&t)||Jl||(Jl=!0,Za(97,(function(){return Ds(),null}))),Kl=Kl.nextEffect}}function Ds(){if(90!==ts){var e=97<ts?97:ts;return ts=90,Ga(e,Bs)}return!1}function Ms(e,t){ns.push(t,e),Jl||(Jl=!0,Za(97,(function(){return Ds(),null})))}function Fs(e,t){rs.push(t,e),Jl||(Jl=!0,Za(97,(function(){return Ds(),null})))}function Bs(){if(null===es)return!1;var e=es;if(es=null,0!=(48&Nl))throw Error(i(331));var t=Nl;Nl|=32;var n=rs;rs=[];for(var r=0;r<n.length;r+=2){var a=n[r],o=n[r+1],l=a.destroy;if(a.destroy=void 0,"function"==typeof l)try{l()}catch(c){if(null===o)throw Error(i(330));zs(o,c)}}for(n=ns,ns=[],r=0;r<n.length;r+=2){a=n[r],o=n[r+1];try{var s=a.create;a.destroy=s()}catch(c){if(null===o)throw Error(i(330));zs(o,c)}}for(s=e.current.firstEffect;null!==s;)e=s.nextEffect,s.nextEffect=null,8&s.flags&&(s.sibling=null,s.stateNode=null),s=e;return Nl=t,Va(),!0}function js(e,t,n){uo(e,t=fl(0,t=cl(n,t),1)),t=fs(),null!==(e=hs(e,1))&&($t(e,1,t),gs(e,t))}function zs(e,t){if(3===e.tag)js(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){js(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Xl||!Xl.has(r))){var a=pl(n,e=cl(t,e),1);if(uo(n,a),a=fs(),null!==(n=hs(n,1)))$t(n,1,a),gs(n,a);else if("function"==typeof r.componentDidCatch&&(null===Xl||!Xl.has(r)))try{r.componentDidCatch(t,e)}catch(o){}break}}n=n.return}}function Us(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=fs(),e.pingedLanes|=e.suspendedLanes&n,Ol===e&&(Dl&n)===n&&(4===Bl||3===Bl&&(62914560&Dl)===Dl&&500>$a()-Gl?xs(e,0):ql|=n),gs(e,t)}function $s(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(0==(2&(t=e.mode))?t=1:0==(4&t)?t=99===qa()?1:2:(0===ss&&(ss=zl),0===(t=zt(62914560&~ss))&&(t=4194304))),n=fs(),null!==(e=hs(e,t))&&($t(e,t,n),gs(e,n))}function qs(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Hs(e,t,n,r){return new qs(e,t,n,r)}function Gs(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Zs(e,t){var n=e.alternate;return null===n?((n=Hs(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Vs(e,t,n,r,a,o){var l=2;if(r=e,"function"==typeof e)Gs(e)&&(l=1);else if("string"==typeof e)l=5;else e:switch(e){case x:return Ws(n.children,a,o,t);case M:l=8,a|=16;break;case C:l=8,a|=1;break;case T:return(e=Hs(12,n,t,8|a)).elementType=T,e.type=T,e.lanes=o,e;case R:return(e=Hs(13,n,t,a)).type=R,e.elementType=R,e.lanes=o,e;case P:return(e=Hs(19,n,t,a)).elementType=P,e.lanes=o,e;case F:return Ks(n,a,o,t);case B:return(e=Hs(24,n,t,a)).elementType=B,e.lanes=o,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case _:l=10;break e;case A:l=9;break e;case L:l=11;break e;case N:l=14;break e;case O:l=16,r=null;break e;case I:l=22;break e}throw Error(i(130,null==e?e:typeof e,""))}return(t=Hs(l,n,t,a)).elementType=e,t.type=r,t.lanes=o,t}function Ws(e,t,n,r){return(e=Hs(7,e,r,t)).lanes=n,e}function Ks(e,t,n,r){return(e=Hs(23,e,r,t)).elementType=F,e.lanes=n,e}function Ys(e,t,n){return(e=Hs(6,e,null,t)).lanes=n,e}function Qs(e,t,n){return(t=Hs(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Xs(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=Ut(0),this.expirationTimes=Ut(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ut(0),this.mutableSourceEagerHydrationData=null}function Js(e,t,n,r){var a=t.current,o=fs(),l=ps(a);e:if(n){t:{if(Ke(n=n._reactInternals)!==n||1!==n.tag)throw Error(i(170));var s=n;do{switch(s.tag){case 3:s=s.stateNode.context;break t;case 1:if(ga(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break t}}s=s.return}while(null!==s);throw Error(i(171))}if(1===n.tag){var c=n.type;if(ga(c)){n=ya(n,c,s);break e}}n=s}else n=da;return null===t.context?t.context=n:t.pendingContext=n,(t=co(o,l)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),uo(a,t),ms(a,l,o),l}function ec(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function tc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function nc(e,t){tc(e,t),(e=e.alternate)&&tc(e,t)}function rc(e,t,n){var r=null!=n&&null!=n.hydrationOptions&&n.hydrationOptions.mutableSources||null;if(n=new Xs(e,t,null!=n&&!0===n.hydrate),t=Hs(3,null,null,2===t?7:1===t?3:0),n.current=t,t.stateNode=n,lo(t),e[Jr]=n.current,Pr(8===e.nodeType?e.parentNode:e),r)for(e=0;e<r.length;e++){var a=(t=r[e])._getVersion;a=a(t._source),null==n.mutableSourceEagerHydrationData?n.mutableSourceEagerHydrationData=[t,a]:n.mutableSourceEagerHydrationData.push(t,a)}this._internalRoot=n}function ac(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function oc(e,t,n,r,a){var o=n._reactRootContainer;if(o){var i=o._internalRoot;if("function"==typeof a){var l=a;a=function(){var e=ec(i);l.call(e)}}Js(t,i,e,a)}else{if(o=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new rc(e,0,t?{hydrate:!0}:void 0)}(n,r),i=o._internalRoot,"function"==typeof a){var s=a;a=function(){var e=ec(i);s.call(e)}}ks((function(){Js(t,i,e,a)}))}return ec(i)}function ic(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!ac(t))throw Error(i(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:S,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)}Wl=function(e,t,n){var r=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||pa.current)Mi=!0;else{if(0==(n&r)){switch(Mi=!1,t.tag){case 3:Zi(t),Vo();break;case 5:Do(t);break;case 1:ga(t.type)&&wa(t);break;case 4:Oo(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var a=t.type._context;ua(Qa,a._currentValue),a._currentValue=r;break;case 13:if(null!==t.memoizedState)return 0!=(n&t.child.childLanes)?Xi(e,t,n):(ua(Fo,1&Fo.current),null!==(t=ol(e,t,n))?t.sibling:null);ua(Fo,1&Fo.current);break;case 19:if(r=0!=(n&t.childLanes),0!=(64&e.flags)){if(r)return al(e,t,n);t.flags|=64}if(null!==(a=t.memoizedState)&&(a.rendering=null,a.tail=null,a.lastEffect=null),ua(Fo,Fo.current),r)break;return null;case 23:case 24:return t.lanes=0,Ui(e,t,n)}return ol(e,t,n)}Mi=0!=(16384&e.flags)}else Mi=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,a=ha(t,fa.current),ao(t,n),a=ii(null,t,r,e,a,n),t.flags|=1,"object"==typeof a&&null!==a&&"function"==typeof a.render&&void 0===a.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,ga(r)){var o=!0;wa(t)}else o=!1;t.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,lo(t);var l=r.getDerivedStateFromProps;"function"==typeof l&&go(t,r,l,e),a.updater=bo,t.stateNode=a,a._reactInternals=t,ko(t,r,e,n),t=Gi(null,t,r,!0,o,n)}else t.tag=0,Fi(null,t,a,n),t=t.child;return t;case 16:a=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,a=(o=a._init)(a._payload),t.type=a,o=t.tag=function(e){if("function"==typeof e)return Gs(e)?1:0;if(null!=e){if((e=e.$$typeof)===L)return 11;if(e===N)return 14}return 2}(a),e=Ya(a,e),o){case 0:t=qi(null,t,a,e,n);break e;case 1:t=Hi(null,t,a,e,n);break e;case 11:t=Bi(null,t,a,e,n);break e;case 14:t=ji(null,t,a,Ya(a.type,e),r,n);break e}throw Error(i(306,a,""))}return t;case 0:return r=t.type,a=t.pendingProps,qi(e,t,r,a=t.elementType===r?a:Ya(r,a),n);case 1:return r=t.type,a=t.pendingProps,Hi(e,t,r,a=t.elementType===r?a:Ya(r,a),n);case 3:if(Zi(t),r=t.updateQueue,null===e||null===r)throw Error(i(282));if(r=t.pendingProps,a=null!==(a=t.memoizedState)?a.element:null,so(e,t),po(t,r,null,n),(r=t.memoizedState.element)===a)Vo(),t=ol(e,t,n);else{if((o=(a=t.stateNode).hydrate)&&(zo=Vr(t.stateNode.containerInfo.firstChild),jo=t,o=Uo=!0),o){if(null!=(e=a.mutableSourceEagerHydrationData))for(a=0;a<e.length;a+=2)(o=e[a])._workInProgressVersionPrimary=e[a+1],Wo.push(o);for(n=_o(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else Fi(e,t,r,n),Vo();t=t.child}return t;case 5:return Do(t),null===e&&Ho(t),r=t.type,a=t.pendingProps,o=null!==e?e.memoizedProps:null,l=a.children,qr(r,a)?l=null:null!==o&&qr(r,o)&&(t.flags|=16),$i(e,t),Fi(e,t,l,n),t.child;case 6:return null===e&&Ho(t),null;case 13:return Xi(e,t,n);case 4:return Oo(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=To(t,null,r,n):Fi(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,Bi(e,t,r,a=t.elementType===r?a:Ya(r,a),n);case 7:return Fi(e,t,t.pendingProps,n),t.child;case 8:case 12:return Fi(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,a=t.pendingProps,l=t.memoizedProps,o=a.value;var s=t.type._context;if(ua(Qa,s._currentValue),s._currentValue=o,null!==l)if(s=l.value,0===(o=cr(s,o)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(s,o):1073741823))){if(l.children===a.children&&!pa.current){t=ol(e,t,n);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var c=s.dependencies;if(null!==c){l=s.child;for(var u=c.firstContext;null!==u;){if(u.context===r&&0!=(u.observedBits&o)){1===s.tag&&((u=co(-1,n&-n)).tag=2,uo(s,u)),s.lanes|=n,null!==(u=s.alternate)&&(u.lanes|=n),ro(s.return,n),c.lanes|=n;break}u=u.next}}else l=10===s.tag&&s.type===t.type?null:s.child;if(null!==l)l.return=s;else for(l=s;null!==l;){if(l===t){l=null;break}if(null!==(s=l.sibling)){s.return=l.return,l=s;break}l=l.return}s=l}Fi(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=(o=t.pendingProps).children,ao(t,n),r=r(a=oo(a,o.unstable_observedBits)),t.flags|=1,Fi(e,t,r,n),t.child;case 14:return o=Ya(a=t.type,t.pendingProps),ji(e,t,a,o=Ya(a.type,o),r,n);case 15:return zi(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Ya(r,a),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,ga(r)?(e=!0,wa(t)):e=!1,ao(t,n),yo(t,r,a),ko(t,r,a,n),Gi(null,t,r,!0,e,n);case 19:return al(e,t,n);case 23:case 24:return Ui(e,t,n)}throw Error(i(156,t.tag))},rc.prototype.render=function(e){Js(e,this._internalRoot,null,null)},rc.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;Js(null,e,null,(function(){t[Jr]=null}))},et=function(e){13===e.tag&&(ms(e,4,fs()),nc(e,4))},tt=function(e){13===e.tag&&(ms(e,67108864,fs()),nc(e,67108864))},nt=function(e){if(13===e.tag){var t=fs(),n=ps(e);ms(e,n,t),nc(e,n)}},rt=function(e,t){return t()},Te=function(e,t,n){switch(t){case"input":if(ne(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=aa(r);if(!a)throw Error(i(90));Q(r),ne(r,a)}}}break;case"textarea":ce(e,n);break;case"select":null!=(t=n.value)&&ie(e,!!n.multiple,t,!1)}},Ne=ws,Oe=function(e,t,n,r,a){var o=Nl;Nl|=4;try{return Ga(98,e.bind(null,t,n,r,a))}finally{0===(Nl=o)&&(Vl(),Va())}},Ie=function(){0==(49&Nl)&&(function(){if(null!==as){var e=as;as=null,e.forEach((function(e){e.expiredLanes|=24&e.pendingLanes,gs(e,$a())}))}Va()}(),Ds())},De=function(e,t){var n=Nl;Nl|=2;try{return e(t)}finally{0===(Nl=n)&&(Vl(),Va())}};var lc={Events:[na,ra,aa,Re,Pe,Ds,{current:!1}]},sc={findFiberByHostInstance:ta,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},cc={bundleType:sc.bundleType,version:sc.version,rendererPackageName:sc.rendererPackageName,rendererConfig:sc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:k.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Xe(e))?null:e.stateNode},findFiberByHostInstance:sc.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var uc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!uc.isDisabled&&uc.supportsFiber)try{Ea=uc.inject(cc),Sa=uc}catch(he){}}t.createPortal=ic,t.hydrate=function(e,t,n){if(!ac(t))throw Error(i(200));return oc(null,e,t,!0,n)},t.unstable_batchedUpdates=ws},3935:(e,t,n)=>{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(4448)},9590:e=>{var t="undefined"!=typeof Element,n="function"==typeof Map,r="function"==typeof Set,a="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function o(e,i){if(e===i)return!0;if(e&&i&&"object"==typeof e&&"object"==typeof i){if(e.constructor!==i.constructor)return!1;var l,s,c,u;if(Array.isArray(e)){if((l=e.length)!=i.length)return!1;for(s=l;0!=s--;)if(!o(e[s],i[s]))return!1;return!0}if(n&&e instanceof Map&&i instanceof Map){if(e.size!==i.size)return!1;for(u=e.entries();!(s=u.next()).done;)if(!i.has(s.value[0]))return!1;for(u=e.entries();!(s=u.next()).done;)if(!o(s.value[1],i.get(s.value[0])))return!1;return!0}if(r&&e instanceof Set&&i instanceof Set){if(e.size!==i.size)return!1;for(u=e.entries();!(s=u.next()).done;)if(!i.has(s.value[0]))return!1;return!0}if(a&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(i)){if((l=e.length)!=i.length)return!1;for(s=l;0!=s--;)if(e[s]!==i[s])return!1;return!0}if(e.constructor===RegExp)return e.source===i.source&&e.flags===i.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof i.valueOf)return e.valueOf()===i.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof i.toString)return e.toString()===i.toString();if((l=(c=Object.keys(e)).length)!==Object.keys(i).length)return!1;for(s=l;0!=s--;)if(!Object.prototype.hasOwnProperty.call(i,c[s]))return!1;if(t&&e instanceof Element)return!1;for(s=l;0!=s--;)if(("_owner"!==c[s]&&"__v"!==c[s]&&"__o"!==c[s]||!e.$$typeof)&&!o(e[c[s]],i[c[s]]))return!1;return!0}return e!=e&&i!=i}e.exports=function(e,t){try{return o(e,t)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}},405:(e,t,n)=>{"use strict";n.d(t,{B6:()=>G,ql:()=>J});var r=n(7294),a=n(5697),o=n.n(a),i=n(9590),l=n.n(i),s=n(1143),c=n.n(s),u=n(6774),d=n.n(u);function f(){return f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f.apply(this,arguments)}function p(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,m(e,t)}function m(e,t){return m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},m(e,t)}function h(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(a[n]=e[n]);return a}var g={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title",FRAGMENT:"Symbol(react.fragment)"},b={rel:["amphtml","canonical","alternate"]},v={type:["application/ld+json"]},y={charset:"",name:["robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},w=Object.keys(g).map((function(e){return g[e]})),k={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},E=Object.keys(k).reduce((function(e,t){return e[k[t]]=t,e}),{}),S=function(e,t){for(var n=e.length-1;n>=0;n-=1){var r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},x=function(e){var t=S(e,g.TITLE),n=S(e,"titleTemplate");if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,(function(){return t}));var r=S(e,"defaultTitle");return t||r||void 0},C=function(e){return S(e,"onChangeClientState")||function(){}},T=function(e,t){return t.filter((function(t){return void 0!==t[e]})).map((function(t){return t[e]})).reduce((function(e,t){return f({},e,t)}),{})},_=function(e,t){return t.filter((function(e){return void 0!==e[g.BASE]})).map((function(e){return e[g.BASE]})).reverse().reduce((function(t,n){if(!t.length)for(var r=Object.keys(n),a=0;a<r.length;a+=1){var o=r[a].toLowerCase();if(-1!==e.indexOf(o)&&n[o])return t.concat(n)}return t}),[])},A=function(e,t,n){var r={};return n.filter((function(t){return!!Array.isArray(t[e])||(void 0!==t[e]&&console&&"function"==typeof console.warn&&console.warn("Helmet: "+e+' should be of type "Array". Instead found type "'+typeof t[e]+'"'),!1)})).map((function(t){return t[e]})).reverse().reduce((function(e,n){var a={};n.filter((function(e){for(var n,o=Object.keys(e),i=0;i<o.length;i+=1){var l=o[i],s=l.toLowerCase();-1===t.indexOf(s)||"rel"===n&&"canonical"===e[n].toLowerCase()||"rel"===s&&"stylesheet"===e[s].toLowerCase()||(n=s),-1===t.indexOf(l)||"innerHTML"!==l&&"cssText"!==l&&"itemprop"!==l||(n=l)}if(!n||!e[n])return!1;var c=e[n].toLowerCase();return r[n]||(r[n]={}),a[n]||(a[n]={}),!r[n][c]&&(a[n][c]=!0,!0)})).reverse().forEach((function(t){return e.push(t)}));for(var o=Object.keys(a),i=0;i<o.length;i+=1){var l=o[i],s=f({},r[l],a[l]);r[l]=s}return e}),[]).reverse()},L=function(e,t){if(Array.isArray(e)&&e.length)for(var n=0;n<e.length;n+=1)if(e[n][t])return!0;return!1},R=function(e){return Array.isArray(e)?e.join(""):e},P=function(e,t){return Array.isArray(e)?e.reduce((function(e,n){return function(e,t){for(var n=Object.keys(e),r=0;r<n.length;r+=1)if(t[n[r]]&&t[n[r]].includes(e[n[r]]))return!0;return!1}(n,t)?e.priority.push(n):e.default.push(n),e}),{priority:[],default:[]}):{default:e}},N=function(e,t){var n;return f({},e,((n={})[t]=void 0,n))},O=[g.NOSCRIPT,g.SCRIPT,g.STYLE],I=function(e,t){return void 0===t&&(t=!0),!1===t?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},D=function(e){return Object.keys(e).reduce((function(t,n){var r=void 0!==e[n]?n+'="'+e[n]+'"':""+n;return t?t+" "+r:r}),"")},M=function(e,t){return void 0===t&&(t={}),Object.keys(e).reduce((function(t,n){return t[k[n]||n]=e[n],t}),t)},F=function(e,t){return t.map((function(t,n){var a,o=((a={key:n})["data-rh"]=!0,a);return Object.keys(t).forEach((function(e){var n=k[e]||e;"innerHTML"===n||"cssText"===n?o.dangerouslySetInnerHTML={__html:t.innerHTML||t.cssText}:o[n]=t[e]})),r.createElement(e,o)}))},B=function(e,t,n){switch(e){case g.TITLE:return{toComponent:function(){return n=t.titleAttributes,(a={key:e=t.title})["data-rh"]=!0,o=M(n,a),[r.createElement(g.TITLE,o,e)];var e,n,a,o},toString:function(){return function(e,t,n,r){var a=D(n),o=R(t);return a?"<"+e+' data-rh="true" '+a+">"+I(o,r)+"</"+e+">":"<"+e+' data-rh="true">'+I(o,r)+"</"+e+">"}(e,t.title,t.titleAttributes,n)}};case"bodyAttributes":case"htmlAttributes":return{toComponent:function(){return M(t)},toString:function(){return D(t)}};default:return{toComponent:function(){return F(e,t)},toString:function(){return function(e,t,n){return t.reduce((function(t,r){var a=Object.keys(r).filter((function(e){return!("innerHTML"===e||"cssText"===e)})).reduce((function(e,t){var a=void 0===r[t]?t:t+'="'+I(r[t],n)+'"';return e?e+" "+a:a}),""),o=r.innerHTML||r.cssText||"",i=-1===O.indexOf(e);return t+"<"+e+' data-rh="true" '+a+(i?"/>":">"+o+"</"+e+">")}),"")}(e,t,n)}}}},j=function(e){var t=e.baseTag,n=e.bodyAttributes,r=e.encode,a=e.htmlAttributes,o=e.noscriptTags,i=e.styleTags,l=e.title,s=void 0===l?"":l,c=e.titleAttributes,u=e.linkTags,d=e.metaTags,f=e.scriptTags,p={toComponent:function(){},toString:function(){return""}};if(e.prioritizeSeoTags){var m=function(e){var t=e.linkTags,n=e.scriptTags,r=e.encode,a=P(e.metaTags,y),o=P(t,b),i=P(n,v);return{priorityMethods:{toComponent:function(){return[].concat(F(g.META,a.priority),F(g.LINK,o.priority),F(g.SCRIPT,i.priority))},toString:function(){return B(g.META,a.priority,r)+" "+B(g.LINK,o.priority,r)+" "+B(g.SCRIPT,i.priority,r)}},metaTags:a.default,linkTags:o.default,scriptTags:i.default}}(e);p=m.priorityMethods,u=m.linkTags,d=m.metaTags,f=m.scriptTags}return{priority:p,base:B(g.BASE,t,r),bodyAttributes:B("bodyAttributes",n,r),htmlAttributes:B("htmlAttributes",a,r),link:B(g.LINK,u,r),meta:B(g.META,d,r),noscript:B(g.NOSCRIPT,o,r),script:B(g.SCRIPT,f,r),style:B(g.STYLE,i,r),title:B(g.TITLE,{title:s,titleAttributes:c},r)}},z=[],U=function(e,t){var n=this;void 0===t&&(t="undefined"!=typeof document),this.instances=[],this.value={setHelmet:function(e){n.context.helmet=e},helmetInstances:{get:function(){return n.canUseDOM?z:n.instances},add:function(e){(n.canUseDOM?z:n.instances).push(e)},remove:function(e){var t=(n.canUseDOM?z:n.instances).indexOf(e);(n.canUseDOM?z:n.instances).splice(t,1)}}},this.context=e,this.canUseDOM=t,t||(e.helmet=j({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))},$=r.createContext({}),q=o().shape({setHelmet:o().func,helmetInstances:o().shape({get:o().func,add:o().func,remove:o().func})}),H="undefined"!=typeof document,G=function(e){function t(n){var r;return(r=e.call(this,n)||this).helmetData=new U(r.props.context,t.canUseDOM),r}return p(t,e),t.prototype.render=function(){return r.createElement($.Provider,{value:this.helmetData.value},this.props.children)},t}(r.Component);G.canUseDOM=H,G.propTypes={context:o().shape({helmet:o().shape()}),children:o().node.isRequired},G.defaultProps={context:{}},G.displayName="HelmetProvider";var Z=function(e,t){var n,r=document.head||document.querySelector(g.HEAD),a=r.querySelectorAll(e+"[data-rh]"),o=[].slice.call(a),i=[];return t&&t.length&&t.forEach((function(t){var r=document.createElement(e);for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&("innerHTML"===a?r.innerHTML=t.innerHTML:"cssText"===a?r.styleSheet?r.styleSheet.cssText=t.cssText:r.appendChild(document.createTextNode(t.cssText)):r.setAttribute(a,void 0===t[a]?"":t[a]));r.setAttribute("data-rh","true"),o.some((function(e,t){return n=t,r.isEqualNode(e)}))?o.splice(n,1):i.push(r)})),o.forEach((function(e){return e.parentNode.removeChild(e)})),i.forEach((function(e){return r.appendChild(e)})),{oldTags:o,newTags:i}},V=function(e,t){var n=document.getElementsByTagName(e)[0];if(n){for(var r=n.getAttribute("data-rh"),a=r?r.split(","):[],o=[].concat(a),i=Object.keys(t),l=0;l<i.length;l+=1){var s=i[l],c=t[s]||"";n.getAttribute(s)!==c&&n.setAttribute(s,c),-1===a.indexOf(s)&&a.push(s);var u=o.indexOf(s);-1!==u&&o.splice(u,1)}for(var d=o.length-1;d>=0;d-=1)n.removeAttribute(o[d]);a.length===o.length?n.removeAttribute("data-rh"):n.getAttribute("data-rh")!==i.join(",")&&n.setAttribute("data-rh",i.join(","))}},W=function(e,t){var n=e.baseTag,r=e.htmlAttributes,a=e.linkTags,o=e.metaTags,i=e.noscriptTags,l=e.onChangeClientState,s=e.scriptTags,c=e.styleTags,u=e.title,d=e.titleAttributes;V(g.BODY,e.bodyAttributes),V(g.HTML,r),function(e,t){void 0!==e&&document.title!==e&&(document.title=R(e)),V(g.TITLE,t)}(u,d);var f={baseTag:Z(g.BASE,n),linkTags:Z(g.LINK,a),metaTags:Z(g.META,o),noscriptTags:Z(g.NOSCRIPT,i),scriptTags:Z(g.SCRIPT,s),styleTags:Z(g.STYLE,c)},p={},m={};Object.keys(f).forEach((function(e){var t=f[e],n=t.newTags,r=t.oldTags;n.length&&(p[e]=n),r.length&&(m[e]=f[e].oldTags)})),t&&t(),l(e,p,m)},K=null,Y=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).rendered=!1,t}p(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e){return!d()(e,this.props)},n.componentDidUpdate=function(){this.emitChange()},n.componentWillUnmount=function(){this.props.context.helmetInstances.remove(this),this.emitChange()},n.emitChange=function(){var e,t,n=this.props.context,r=n.setHelmet,a=null,o=(e=n.helmetInstances.get().map((function(e){var t=f({},e.props);return delete t.context,t})),{baseTag:_(["href"],e),bodyAttributes:T("bodyAttributes",e),defer:S(e,"defer"),encode:S(e,"encodeSpecialCharacters"),htmlAttributes:T("htmlAttributes",e),linkTags:A(g.LINK,["rel","href"],e),metaTags:A(g.META,["name","charset","http-equiv","property","itemprop"],e),noscriptTags:A(g.NOSCRIPT,["innerHTML"],e),onChangeClientState:C(e),scriptTags:A(g.SCRIPT,["src","innerHTML"],e),styleTags:A(g.STYLE,["cssText"],e),title:x(e),titleAttributes:T("titleAttributes",e),prioritizeSeoTags:L(e,"prioritizeSeoTags")});G.canUseDOM?(t=o,K&&cancelAnimationFrame(K),t.defer?K=requestAnimationFrame((function(){W(t,(function(){K=null}))})):(W(t),K=null)):j&&(a=j(o)),r(a)},n.init=function(){this.rendered||(this.rendered=!0,this.props.context.helmetInstances.add(this),this.emitChange())},n.render=function(){return this.init(),null},t}(r.Component);Y.propTypes={context:q.isRequired},Y.displayName="HelmetDispatcher";var Q=["children"],X=["children"],J=function(e){function t(){return e.apply(this,arguments)||this}p(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e){return!l()(N(this.props,"helmetData"),N(e,"helmetData"))},n.mapNestedChildrenToProps=function(e,t){if(!t)return null;switch(e.type){case g.SCRIPT:case g.NOSCRIPT:return{innerHTML:t};case g.STYLE:return{cssText:t};default:throw new Error("<"+e.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")}},n.flattenArrayTypeChildren=function(e){var t,n=e.child,r=e.arrayTypeChildren;return f({},r,((t={})[n.type]=[].concat(r[n.type]||[],[f({},e.newChildProps,this.mapNestedChildrenToProps(n,e.nestedChildren))]),t))},n.mapObjectTypeChildren=function(e){var t,n,r=e.child,a=e.newProps,o=e.newChildProps,i=e.nestedChildren;switch(r.type){case g.TITLE:return f({},a,((t={})[r.type]=i,t.titleAttributes=f({},o),t));case g.BODY:return f({},a,{bodyAttributes:f({},o)});case g.HTML:return f({},a,{htmlAttributes:f({},o)});default:return f({},a,((n={})[r.type]=f({},o),n))}},n.mapArrayTypeChildrenToProps=function(e,t){var n=f({},t);return Object.keys(e).forEach((function(t){var r;n=f({},n,((r={})[t]=e[t],r))})),n},n.warnOnInvalidChildren=function(e,t){return c()(w.some((function(t){return e.type===t})),"function"==typeof e.type?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":"Only elements types "+w.join(", ")+" are allowed. Helmet does not support rendering <"+e.type+"> elements. Refer to our API for more information."),c()(!t||"string"==typeof t||Array.isArray(t)&&!t.some((function(e){return"string"!=typeof e})),"Helmet expects a string as a child of <"+e.type+">. Did you forget to wrap your children in braces? ( <"+e.type+">{``}</"+e.type+"> ) Refer to our API for more information."),!0},n.mapChildrenToProps=function(e,t){var n=this,a={};return r.Children.forEach(e,(function(e){if(e&&e.props){var r=e.props,o=r.children,i=h(r,Q),l=Object.keys(i).reduce((function(e,t){return e[E[t]||t]=i[t],e}),{}),s=e.type;switch("symbol"==typeof s?s=s.toString():n.warnOnInvalidChildren(e,o),s){case g.FRAGMENT:t=n.mapChildrenToProps(o,t);break;case g.LINK:case g.META:case g.NOSCRIPT:case g.SCRIPT:case g.STYLE:a=n.flattenArrayTypeChildren({child:e,arrayTypeChildren:a,newChildProps:l,nestedChildren:o});break;default:t=n.mapObjectTypeChildren({child:e,newProps:t,newChildProps:l,nestedChildren:o})}}})),this.mapArrayTypeChildrenToProps(a,t)},n.render=function(){var e=this.props,t=e.children,n=h(e,X),a=f({},n),o=n.helmetData;return t&&(a=this.mapChildrenToProps(t,a)),!o||o instanceof U||(o=new U(o.context,o.instances)),o?r.createElement(Y,f({},a,{context:o.value,helmetData:void 0})):r.createElement($.Consumer,null,(function(e){return r.createElement(Y,f({},a,{context:e}))}))},t}(r.Component);J.propTypes={base:o().object,bodyAttributes:o().object,children:o().oneOfType([o().arrayOf(o().node),o().node]),defaultTitle:o().string,defer:o().bool,encodeSpecialCharacters:o().bool,htmlAttributes:o().object,link:o().arrayOf(o().object),meta:o().arrayOf(o().object),noscript:o().arrayOf(o().object),onChangeClientState:o().func,script:o().arrayOf(o().object),style:o().arrayOf(o().object),title:o().string,titleAttributes:o().object,titleTemplate:o().string,prioritizeSeoTags:o().bool,helmetData:o().object},J.defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1},J.displayName="Helmet"},9921:(e,t)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,a=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.suspense_list"):60120,h=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,b=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,y=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function k(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case o:case l:case i:case p:return e;default:switch(e=e&&e.$$typeof){case c:case f:case g:case h:case s:return e;default:return t}}case a:return t}}}function E(e){return k(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=s,t.Element=r,t.ForwardRef=f,t.Fragment=o,t.Lazy=g,t.Memo=h,t.Portal=a,t.Profiler=l,t.StrictMode=i,t.Suspense=p,t.isAsyncMode=function(e){return E(e)||k(e)===u},t.isConcurrentMode=E,t.isContextConsumer=function(e){return k(e)===c},t.isContextProvider=function(e){return k(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return k(e)===f},t.isFragment=function(e){return k(e)===o},t.isLazy=function(e){return k(e)===g},t.isMemo=function(e){return k(e)===h},t.isPortal=function(e){return k(e)===a},t.isProfiler=function(e){return k(e)===l},t.isStrictMode=function(e){return k(e)===i},t.isSuspense=function(e){return k(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===l||e===i||e===p||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===h||e.$$typeof===s||e.$$typeof===c||e.$$typeof===f||e.$$typeof===v||e.$$typeof===y||e.$$typeof===w||e.$$typeof===b)},t.typeOf=k},9864:(e,t,n)=>{"use strict";e.exports=n(9921)},8356:(e,t,n)=>{"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i.apply(this,arguments)}var l=n(7294),s=n(5697),c=[],u=[];function d(e){var t=e(),n={loading:!0,loaded:null,error:null};return n.promise=t.then((function(e){return n.loading=!1,n.loaded=e,e})).catch((function(e){throw n.loading=!1,n.error=e,e})),n}function f(e){var t={loading:!1,loaded:{},error:null},n=[];try{Object.keys(e).forEach((function(r){var a=d(e[r]);a.loading?t.loading=!0:(t.loaded[r]=a.loaded,t.error=a.error),n.push(a.promise),a.promise.then((function(e){t.loaded[r]=e})).catch((function(e){t.error=e}))}))}catch(r){t.error=r}return t.promise=Promise.all(n).then((function(e){return t.loading=!1,e})).catch((function(e){throw t.loading=!1,e})),t}function p(e,t){return l.createElement((n=e)&&n.__esModule?n.default:n,t);var n}function m(e,t){var d,f;if(!t.loading)throw new Error("react-loadable requires a `loading` component");var m=i({loader:null,loading:null,delay:200,timeout:null,render:p,webpack:null,modules:null},t),h=null;function g(){return h||(h=e(m.loader)),h.promise}return c.push(g),"function"==typeof m.webpack&&u.push((function(){if((0,m.webpack)().every((function(e){return void 0!==e&&void 0!==n.m[e]})))return g()})),f=d=function(t){function n(n){var r;return o(a(a(r=t.call(this,n)||this)),"retry",(function(){r.setState({error:null,loading:!0,timedOut:!1}),h=e(m.loader),r._loadModule()})),g(),r.state={error:h.error,pastDelay:!1,timedOut:!1,loading:h.loading,loaded:h.loaded},r}r(n,t),n.preload=function(){return g()};var i=n.prototype;return i.UNSAFE_componentWillMount=function(){this._loadModule()},i.componentDidMount=function(){this._mounted=!0},i._loadModule=function(){var e=this;if(this.context.loadable&&Array.isArray(m.modules)&&m.modules.forEach((function(t){e.context.loadable.report(t)})),h.loading){var t=function(t){e._mounted&&e.setState(t)};"number"==typeof m.delay&&(0===m.delay?this.setState({pastDelay:!0}):this._delay=setTimeout((function(){t({pastDelay:!0})}),m.delay)),"number"==typeof m.timeout&&(this._timeout=setTimeout((function(){t({timedOut:!0})}),m.timeout));var n=function(){t({error:h.error,loaded:h.loaded,loading:h.loading}),e._clearTimeouts()};h.promise.then((function(){return n(),null})).catch((function(e){return n(),null}))}},i.componentWillUnmount=function(){this._mounted=!1,this._clearTimeouts()},i._clearTimeouts=function(){clearTimeout(this._delay),clearTimeout(this._timeout)},i.render=function(){return this.state.loading||this.state.error?l.createElement(m.loading,{isLoading:this.state.loading,pastDelay:this.state.pastDelay,timedOut:this.state.timedOut,error:this.state.error,retry:this.retry}):this.state.loaded?m.render(this.state.loaded,this.props):null},n}(l.Component),o(d,"contextTypes",{loadable:s.shape({report:s.func.isRequired})}),f}function h(e){return m(d,e)}h.Map=function(e){if("function"!=typeof e.render)throw new Error("LoadableMap requires a `render(loaded, props)` function");return m(f,e)};var g=function(e){function t(){return e.apply(this,arguments)||this}r(t,e);var n=t.prototype;return n.getChildContext=function(){return{loadable:{report:this.props.report}}},n.render=function(){return l.Children.only(this.props.children)},t}(l.Component);function b(e){for(var t=[];e.length;){var n=e.pop();t.push(n())}return Promise.all(t).then((function(){if(e.length)return b(e)}))}o(g,"propTypes",{report:s.func.isRequired}),o(g,"childContextTypes",{loadable:s.shape({report:s.func.isRequired}).isRequired}),h.Capture=g,h.preloadAll=function(){return new Promise((function(e,t){b(c).then(e,t)}))},h.preloadReady=function(){return new Promise((function(e,t){b(u).then(e,e)}))},e.exports=h},8790:(e,t,n)=>{"use strict";n.d(t,{H:()=>l,f:()=>i});var r=n(6550),a=n(7462),o=n(7294);function i(e,t,n){return void 0===n&&(n=[]),e.some((function(e){var a=e.path?(0,r.LX)(t,e):n.length?n[n.length-1].match:r.F0.computeRootMatch(t);return a&&(n.push({route:e,match:a}),e.routes&&i(e.routes,t,n)),a})),n}function l(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),e?o.createElement(r.rs,n,e.map((function(e,n){return o.createElement(r.AW,{key:e.key||n,path:e.path,exact:e.exact,strict:e.strict,render:function(n){return e.render?e.render((0,a.Z)({},n,{},t,{route:e})):o.createElement(e.component,(0,a.Z)({},n,t,{route:e}))}})}))):null}},3727:(e,t,n)=>{"use strict";n.d(t,{OL:()=>y,VK:()=>u,rU:()=>g});var r=n(6550),a=n(4578),o=n(7294),i=n(9318),l=n(7462),s=n(3366),c=n(8776),u=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).history=(0,i.lX)(t.props),t}return(0,a.Z)(t,e),t.prototype.render=function(){return o.createElement(r.F0,{history:this.history,children:this.props.children})},t}(o.Component);o.Component;var d=function(e,t){return"function"==typeof e?e(t):e},f=function(e,t){return"string"==typeof e?(0,i.ob)(e,null,null,t):e},p=function(e){return e},m=o.forwardRef;void 0===m&&(m=p);var h=m((function(e,t){var n=e.innerRef,r=e.navigate,a=e.onClick,i=(0,s.Z)(e,["innerRef","navigate","onClick"]),c=i.target,u=(0,l.Z)({},i,{onClick:function(e){try{a&&a(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||c&&"_self"!==c||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return u.ref=p!==m&&t||n,o.createElement("a",u)}));var g=m((function(e,t){var n=e.component,a=void 0===n?h:n,u=e.replace,g=e.to,b=e.innerRef,v=(0,s.Z)(e,["component","replace","to","innerRef"]);return o.createElement(r.s6.Consumer,null,(function(e){e||(0,c.Z)(!1);var n=e.history,r=f(d(g,e.location),e.location),s=r?n.createHref(r):"",h=(0,l.Z)({},v,{href:s,navigate:function(){var t=d(g,e.location),r=(0,i.Ep)(e.location)===(0,i.Ep)(f(t));(u||r?n.replace:n.push)(t)}});return p!==m?h.ref=t||b:h.innerRef=b,o.createElement(a,h)}))})),b=function(e){return e},v=o.forwardRef;void 0===v&&(v=b);var y=v((function(e,t){var n=e["aria-current"],a=void 0===n?"page":n,i=e.activeClassName,u=void 0===i?"active":i,p=e.activeStyle,m=e.className,h=e.exact,y=e.isActive,w=e.location,k=e.sensitive,E=e.strict,S=e.style,x=e.to,C=e.innerRef,T=(0,s.Z)(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return o.createElement(r.s6.Consumer,null,(function(e){e||(0,c.Z)(!1);var n=w||e.location,i=f(d(x,n),n),s=i.pathname,_=s&&s.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),A=_?(0,r.LX)(n.pathname,{path:_,exact:h,sensitive:k,strict:E}):null,L=!!(y?y(A,n):A),R="function"==typeof m?m(L):m,P="function"==typeof S?S(L):S;L&&(R=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return e})).join(" ")}(R,u),P=(0,l.Z)({},P,p));var N=(0,l.Z)({"aria-current":L&&a||null,className:R,style:P,to:i},T);return b!==v?N.ref=t||C:N.innerRef=C,o.createElement(g,N)}))}))},6550:(e,t,n)=>{"use strict";n.d(t,{AW:()=>x,F0:()=>y,LX:()=>S,TH:()=>O,k6:()=>N,rs:()=>R,s6:()=>v});var r=n(4578),a=n(7294),o=n(5697),i=n.n(o),l=n(9318),s=n(8776),c=n(7462),u=n(4779),d=n.n(u),f=(n(9864),n(3366)),p=(n(8679),1073741823),m="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:{};var h=a.createContext||function(e,t){var n,o,l="__create-react-context-"+function(){var e="__global_unique_id__";return m[e]=(m[e]||0)+1}()+"__",s=function(e){function n(){for(var t,n,r,a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return(t=e.call.apply(e,[this].concat(o))||this).emitter=(n=t.props.value,r=[],{on:function(e){r.push(e)},off:function(e){r=r.filter((function(t){return t!==e}))},get:function(){return n},set:function(e,t){n=e,r.forEach((function(e){return e(n,t)}))}}),t}(0,r.Z)(n,e);var a=n.prototype;return a.getChildContext=function(){var e;return(e={})[l]=this.emitter,e},a.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n,r=this.props.value,a=e.value;((o=r)===(i=a)?0!==o||1/o==1/i:o!=o&&i!=i)?n=0:(n="function"==typeof t?t(r,a):p,0!==(n|=0)&&this.emitter.set(e.value,n))}var o,i},a.render=function(){return this.props.children},n}(a.Component);s.childContextTypes=((n={})[l]=i().object.isRequired,n);var c=function(t){function n(){for(var e,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(e=t.call.apply(t,[this].concat(r))||this).observedBits=void 0,e.state={value:e.getValue()},e.onUpdate=function(t,n){0!=((0|e.observedBits)&n)&&e.setState({value:e.getValue()})},e}(0,r.Z)(n,t);var a=n.prototype;return a.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?p:t},a.componentDidMount=function(){this.context[l]&&this.context[l].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?p:e},a.componentWillUnmount=function(){this.context[l]&&this.context[l].off(this.onUpdate)},a.getValue=function(){return this.context[l]?this.context[l].get():e},a.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},n}(a.Component);return c.contextTypes=((o={})[l]=i().object,o),{Provider:s,Consumer:c}},g=function(e){var t=h();return t.displayName=e,t},b=g("Router-History"),v=g("Router"),y=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._pendingLocation=e}))),n}(0,r.Z)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){var e=this;this._isMounted=!0,this.unlisten&&this.unlisten(),this.props.staticContext||(this.unlisten=this.props.history.listen((function(t){e._isMounted&&e.setState({location:t})}))),this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&(this.unlisten(),this._isMounted=!1,this._pendingLocation=null)},n.render=function(){return a.createElement(v.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},a.createElement(b.Provider,{children:this.props.children||null,value:this.props.history}))},t}(a.Component);a.Component;a.Component;var w={},k=1e4,E=0;function S(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,a=n.exact,o=void 0!==a&&a,i=n.strict,l=void 0!==i&&i,s=n.sensitive,c=void 0!==s&&s;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=w[n]||(w[n]={});if(r[e])return r[e];var a=[],o={regexp:d()(e,a,t),keys:a};return E<k&&(r[e]=o,E++),o}(n,{end:o,strict:l,sensitive:c}),a=r.regexp,i=r.keys,s=a.exec(e);if(!s)return null;var u=s[0],f=s.slice(1),p=e===u;return o&&!p?null:{path:n,url:"/"===n&&""===u?"/":u,isExact:p,params:i.reduce((function(e,t,n){return e[t.name]=f[n],e}),{})}}),null)}var x=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.Z)(t,e),t.prototype.render=function(){var e=this;return a.createElement(v.Consumer,null,(function(t){t||(0,s.Z)(!1);var n=e.props.location||t.location,r=e.props.computedMatch?e.props.computedMatch:e.props.path?S(n.pathname,e.props):t.match,o=(0,c.Z)({},t,{location:n,match:r}),i=e.props,l=i.children,u=i.component,d=i.render;return Array.isArray(l)&&function(e){return 0===a.Children.count(e)}(l)&&(l=null),a.createElement(v.Provider,{value:o},o.match?l?"function"==typeof l?l(o):l:u?a.createElement(u,o):d?d(o):null:"function"==typeof l?l(o):null)}))},t}(a.Component);function C(e){return"/"===e.charAt(0)?e:"/"+e}function T(e,t){if(!e)return t;var n=C(e);return 0!==t.pathname.indexOf(n)?t:(0,c.Z)({},t,{pathname:t.pathname.substr(n.length)})}function _(e){return"string"==typeof e?e:(0,l.Ep)(e)}function A(e){return function(){(0,s.Z)(!1)}}function L(){}a.Component;var R=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.Z)(t,e),t.prototype.render=function(){var e=this;return a.createElement(v.Consumer,null,(function(t){t||(0,s.Z)(!1);var n,r,o=e.props.location||t.location;return a.Children.forEach(e.props.children,(function(e){if(null==r&&a.isValidElement(e)){n=e;var i=e.props.path||e.props.from;r=i?S(o.pathname,(0,c.Z)({},e.props,{path:i})):t.match}})),r?a.cloneElement(n,{location:o,computedMatch:r}):null}))},t}(a.Component);var P=a.useContext;function N(){return P(b)}function O(){return P(v).location}},2408:(e,t,n)=>{"use strict";var r=n(7418),a=60103,o=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var i=60109,l=60110,s=60112;t.Suspense=60113;var c=60115,u=60116;if("function"==typeof Symbol&&Symbol.for){var d=Symbol.for;a=d("react.element"),o=d("react.portal"),t.Fragment=d("react.fragment"),t.StrictMode=d("react.strict_mode"),t.Profiler=d("react.profiler"),i=d("react.provider"),l=d("react.context"),s=d("react.forward_ref"),t.Suspense=d("react.suspense"),c=d("react.memo"),u=d("react.lazy")}var f="function"==typeof Symbol&&Symbol.iterator;function p(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h={};function g(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||m}function b(){}function v(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||m}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(p(85));this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=g.prototype;var y=v.prototype=new b;y.constructor=v,r(y,g.prototype),y.isPureReactComponent=!0;var w={current:null},k=Object.prototype.hasOwnProperty,E={key:!0,ref:!0,__self:!0,__source:!0};function S(e,t,n){var r,o={},i=null,l=null;if(null!=t)for(r in void 0!==t.ref&&(l=t.ref),void 0!==t.key&&(i=""+t.key),t)k.call(t,r)&&!E.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(1===s)o.children=n;else if(1<s){for(var c=Array(s),u=0;u<s;u++)c[u]=arguments[u+2];o.children=c}if(e&&e.defaultProps)for(r in s=e.defaultProps)void 0===o[r]&&(o[r]=s[r]);return{$$typeof:a,type:e,key:i,ref:l,props:o,_owner:w.current}}function x(e){return"object"==typeof e&&null!==e&&e.$$typeof===a}var C=/\/+/g;function T(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function _(e,t,n,r,i){var l=typeof e;"undefined"!==l&&"boolean"!==l||(e=null);var s=!1;if(null===e)s=!0;else switch(l){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case a:case o:s=!0}}if(s)return i=i(s=e),e=""===r?"."+T(s,0):r,Array.isArray(i)?(n="",null!=e&&(n=e.replace(C,"$&/")+"/"),_(i,t,n,"",(function(e){return e}))):null!=i&&(x(i)&&(i=function(e,t){return{$$typeof:a,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(C,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=""===r?".":r+":",Array.isArray(e))for(var c=0;c<e.length;c++){var u=r+T(l=e[c],c);s+=_(l,t,n,u,i)}else if(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=f&&e[f]||e["@@iterator"])?e:null}(e),"function"==typeof u)for(e=u.call(e),c=0;!(l=e.next()).done;)s+=_(l=l.value,t,n,u=r+T(l,c++),i);else if("object"===l)throw t=""+e,Error(p(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return s}function A(e,t,n){if(null==e)return e;var r=[],a=0;return _(e,r,"","",(function(e){return t.call(n,e,a++)})),r}function L(e){if(-1===e._status){var t=e._result;t=t(),e._status=0,e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}if(1===e._status)return e._result;throw e._result}var R={current:null};function P(){var e=R.current;if(null===e)throw Error(p(321));return e}var N={ReactCurrentDispatcher:R,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:w,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:A,forEach:function(e,t,n){A(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return A(e,(function(){t++})),t},toArray:function(e){return A(e,(function(e){return e}))||[]},only:function(e){if(!x(e))throw Error(p(143));return e}},t.Component=g,t.PureComponent=v,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=N,t.cloneElement=function(e,t,n){if(null==e)throw Error(p(267,e));var o=r({},e.props),i=e.key,l=e.ref,s=e._owner;if(null!=t){if(void 0!==t.ref&&(l=t.ref,s=w.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(u in t)k.call(t,u)&&!E.hasOwnProperty(u)&&(o[u]=void 0===t[u]&&void 0!==c?c[u]:t[u])}var u=arguments.length-2;if(1===u)o.children=n;else if(1<u){c=Array(u);for(var d=0;d<u;d++)c[d]=arguments[d+2];o.children=c}return{$$typeof:a,type:e.type,key:i,ref:l,props:o,_owner:s}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:l,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:i,_context:e},e.Consumer=e},t.createElement=S,t.createFactory=function(e){var t=S.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:s,render:e}},t.isValidElement=x,t.lazy=function(e){return{$$typeof:u,_payload:{_status:-1,_result:e},_init:L}},t.memo=function(e,t){return{$$typeof:c,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return P().useCallback(e,t)},t.useContext=function(e,t){return P().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return P().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return P().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return P().useLayoutEffect(e,t)},t.useMemo=function(e,t){return P().useMemo(e,t)},t.useReducer=function(e,t,n){return P().useReducer(e,t,n)},t.useRef=function(e){return P().useRef(e)},t.useState=function(e){return P().useState(e)},t.version="17.0.2"},7294:(e,t,n)=>{"use strict";e.exports=n(2408)},53:(e,t)=>{"use strict";var n,r,a,o;if("object"==typeof performance&&"function"==typeof performance.now){var i=performance;t.unstable_now=function(){return i.now()}}else{var l=Date,s=l.now();t.unstable_now=function(){return l.now()-s}}if("undefined"==typeof window||"function"!=typeof MessageChannel){var c=null,u=null,d=function(){if(null!==c)try{var e=t.unstable_now();c(!0,e),c=null}catch(n){throw setTimeout(d,0),n}};n=function(e){null!==c?setTimeout(n,0,e):(c=e,setTimeout(d,0))},r=function(e,t){u=setTimeout(e,t)},a=function(){clearTimeout(u)},t.unstable_shouldYield=function(){return!1},o=t.unstable_forceFrameRate=function(){}}else{var f=window.setTimeout,p=window.clearTimeout;if("undefined"!=typeof console){var m=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!=typeof m&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var h=!1,g=null,b=-1,v=5,y=0;t.unstable_shouldYield=function(){return t.unstable_now()>=y},o=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):v=0<e?Math.floor(1e3/e):5};var w=new MessageChannel,k=w.port2;w.port1.onmessage=function(){if(null!==g){var e=t.unstable_now();y=e+v;try{g(!0,e)?k.postMessage(null):(h=!1,g=null)}catch(n){throw k.postMessage(null),n}}else h=!1},n=function(e){g=e,h||(h=!0,k.postMessage(null))},r=function(e,n){b=f((function(){e(t.unstable_now())}),n)},a=function(){p(b),b=-1}}function E(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,a=e[r];if(!(void 0!==a&&0<C(a,t)))break e;e[r]=t,e[n]=a,n=r}}function S(e){return void 0===(e=e[0])?null:e}function x(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length;r<a;){var o=2*(r+1)-1,i=e[o],l=o+1,s=e[l];if(void 0!==i&&0>C(i,n))void 0!==s&&0>C(s,i)?(e[r]=s,e[l]=n,r=l):(e[r]=i,e[o]=n,r=o);else{if(!(void 0!==s&&0>C(s,n)))break e;e[r]=s,e[l]=n,r=l}}}return t}return null}function C(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var T=[],_=[],A=1,L=null,R=3,P=!1,N=!1,O=!1;function I(e){for(var t=S(_);null!==t;){if(null===t.callback)x(_);else{if(!(t.startTime<=e))break;x(_),t.sortIndex=t.expirationTime,E(T,t)}t=S(_)}}function D(e){if(O=!1,I(e),!N)if(null!==S(T))N=!0,n(M);else{var t=S(_);null!==t&&r(D,t.startTime-e)}}function M(e,n){N=!1,O&&(O=!1,a()),P=!0;var o=R;try{for(I(n),L=S(T);null!==L&&(!(L.expirationTime>n)||e&&!t.unstable_shouldYield());){var i=L.callback;if("function"==typeof i){L.callback=null,R=L.priorityLevel;var l=i(L.expirationTime<=n);n=t.unstable_now(),"function"==typeof l?L.callback=l:L===S(T)&&x(T),I(n)}else x(T);L=S(T)}if(null!==L)var s=!0;else{var c=S(_);null!==c&&r(D,c.startTime-n),s=!1}return s}finally{L=null,R=o,P=!1}}var F=o;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){N||P||(N=!0,n(M))},t.unstable_getCurrentPriorityLevel=function(){return R},t.unstable_getFirstCallbackNode=function(){return S(T)},t.unstable_next=function(e){switch(R){case 1:case 2:case 3:var t=3;break;default:t=R}var n=R;R=t;try{return e()}finally{R=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=F,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=R;R=e;try{return t()}finally{R=n}},t.unstable_scheduleCallback=function(e,o,i){var l=t.unstable_now();switch("object"==typeof i&&null!==i?i="number"==typeof(i=i.delay)&&0<i?l+i:l:i=l,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return e={id:A++,callback:o,priorityLevel:e,startTime:i,expirationTime:s=i+s,sortIndex:-1},i>l?(e.sortIndex=i,E(_,e),null===S(T)&&e===S(_)&&(O?a():O=!0,r(D,i-l))):(e.sortIndex=s,E(T,e),N||P||(N=!0,n(M))),e},t.unstable_wrapCallback=function(e){var t=R;return function(){var n=R;R=t;try{return e.apply(this,arguments)}finally{R=n}}}},3840:(e,t,n)=>{"use strict";e.exports=n(53)},6774:e=>{e.exports=function(e,t,n,r){var a=n?n.call(r,e,t):void 0;if(void 0!==a)return!!a;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(t),s=0;s<o.length;s++){var c=o[s];if(!l(c))return!1;var u=e[c],d=t[c];if(!1===(a=n?n.call(r,u,d,c):void 0)||void 0===a&&u!==d)return!1}return!0}},3250:(e,t,n)=>{"use strict";var r=n(7294);var a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=r.useState,i=r.useEffect,l=r.useLayoutEffect,s=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!a(e,n)}catch(r){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=o({inst:{value:n,getSnapshot:t}}),a=r[0].inst,u=r[1];return l((function(){a.value=n,a.getSnapshot=t,c(a)&&u({inst:a})}),[e,n,t]),i((function(){return c(a)&&u({inst:a}),e((function(){c(a)&&u({inst:a})}))}),[e]),s(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},1688:(e,t,n)=>{"use strict";e.exports=n(3250)},6809:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={title:"Cogment",tagline:"Innovative open source AI platform developed by AI Redefined, designed to leverage the advent of AI to benefit humankind through human-AI collaboration.",url:"https://cogment.ai",baseUrl:"/",trailingSlash:!1,onBrokenLinks:"throw",onBrokenMarkdownLinks:"warn",favicon:"img/favicon.png",organizationName:"cogment",projectName:"cogment-doc",deploymentBranch:"gh-pages",presets:[["classic",{docs:{sidebarPath:"/builds/ai-r/cogment/cogment-doc/sidebars.js",showLastUpdateTime:!0},blog:!1,theme:{customCss:["/builds/ai-r/cogment/cogment-doc/src/css/custom.css"]},pages:{path:"src/pages"},sitemap:{},googleAnalytics:{trackingID:"UA-146998765-2",anonymizeIP:!0}}]],themes:[],plugins:[["./cogment-web-proxy-openapi-plugin",{output:"api/web-proxy-openapi.json",version:"latest"}]],themeConfig:{image:"img/cogment_logo_meta.png",colorMode:{defaultMode:"light",disableSwitch:!0,respectPrefersColorScheme:!1},navbar:{logo:{alt:"Cogment",src:"img/cogment_logo.svg"},items:[{type:"doc",docId:"index",position:"right",label:"Documentation"},{position:"right",label:"Cogment Verse",to:"cogment_verse"},{href:"https://github.com/cogment",label:"GitHub",position:"right"},{type:"doc",docId:"community-channels",label:"Community",position:"right"}],hideOnScroll:!1},footer:{links:[{title:"Documentation",items:[{label:"Overview",to:"/docs"},{label:"Core concepts",to:"/docs/guide/core-concepts"},{label:"Development guide",to:"/docs/guide/development-guide"},{label:"CLI reference",to:"/docs/reference/cli"},{label:"Python SDK reference",to:"/docs/reference/python"},{label:"Javascript SDK reference",to:"/docs/reference/javascript"}]},{title:"Community",items:[{label:"Github",href:"https://github.com/cogment"},{label:"Discord",href:"https://discord.com/invite/QDxb9Fweqr"},{label:"Twitter",href:"https://twitter.com/AI_Redefined"},{label:"LinkedIn",href:"https://www.linkedin.com/company/ai-r"},{label:"Facebook",href:"https://www.facebook.com/AIRedefined/"}]},{title:"AI Redefined",items:[{label:"Homepage",href:"https://ai-r.com/"},{label:"Solutions",href:"https://ai-r.com/solutions/"},{label:"About AIR",href:"https://ai-r.com/about-air/"},{label:"News",href:"https://ai-r.com/news/"},{label:"Contact",href:"https://ai-r.com/contact/"}]}],copyright:"Copyright \xa9 2023 AI Redefined Inc.",style:"light"},prism:{theme:{plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},darkTheme:{plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},additionalLanguages:[],magicComments:[{className:"theme-code-block-highlighted-line",line:"highlight-next-line",block:{start:"highlight-start",end:"highlight-end"}}]},algolia:{appId:"L5URPTBK9E",apiKey:"a47b82547b2b987f6e4c501900ddcf6e",indexName:"cogment",contextualSearch:!0,searchParameters:{},searchPagePath:"search"},docs:{versionPersistence:"localStorage",sidebar:{hideable:!1,autoCollapseCategories:!1}},metadata:[],tableOfContents:{minHeadingLevel:2,maxHeadingLevel:3}},baseUrlIssueBanner:!0,i18n:{defaultLocale:"en",path:"i18n",locales:["en"],localeConfigs:{}},onDuplicateRoutes:"warn",staticDirectories:["static"],customFields:{},scripts:[],headTags:[],stylesheets:[],clientModules:[],titleDelimiter:"|",noIndex:!1,markdown:{mermaid:!1}}},7462:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}n.d(t,{Z:()=>r})},4578:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(9611);function a(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(0,r.Z)(e,t)}},3366:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}n.d(t,{Z:()=>r})},9611:(e,t,n)=>{"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{Z:()=>r})},8776:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=!0,a="Invariant failed";function o(e,t){if(!e){if(r)throw new Error(a);var n="function"==typeof t?t():t,o=n?"".concat(a,": ").concat(n):a;throw new Error(o)}}},7529:e=>{"use strict";e.exports={}},6887:e=>{"use strict";e.exports=JSON.parse('{"/cogment_verse-238":{"__comp":"8ba33b25","__context":{"plugin":"c0fe6564"},"config":"5e9f5e1a"},"/search-b08":{"__comp":"1a4e3797","__context":{"plugin":"1d042041"}},"/docs-106":{"__comp":"1be78505","__context":{"plugin":"be6d912d"},"versionMetadata":"935f2afb"},"/docs-f31":{"__comp":"17896441","content":"c377a04b"},"/docs/community-channels-fe1":{"__comp":"17896441","content":"9b35c4f5"},"/docs/guide/core-concepts-4f9":{"__comp":"17896441","content":"9b824c8f"},"/docs/guide/development-guide-213":{"__comp":"17896441","content":"354f5e12"},"/docs/guide/implementation-recipes-3dc":{"__comp":"17896441","content":"6c6cf206"},"/docs/guide/implementation-recipes/configure-trial-from-controller-6e2":{"__comp":"17896441","content":"f012f959"},"/docs/guide/implementation-recipes/v2-migration-guide-024":{"__comp":"17896441","content":"fd5e6f38"},"/docs/guide/tutorial-4db":{"__comp":"17896441","content":"4f085710"},"/docs/guide/tutorial/actors-in-cogment-ffe":{"__comp":"17896441","content":"80b5be58"},"/docs/guide/tutorial/advanced-tutorials-c3b":{"__comp":"17896441","content":"6f2832ad"},"/docs/guide/tutorial/advanced-tutorials/directory-162":{"__comp":"17896441","content":"76d0d1d8"},"/docs/guide/tutorial/advanced-tutorials/human-player-34b":{"__comp":"17896441","content":"d9378b29"},"/docs/guide/tutorial/advanced-tutorials/web-client-878":{"__comp":"17896441","content":"1b039142"},"/docs/guide/tutorial/decision-making-f36":{"__comp":"17896441","content":"c24ec994"},"/docs/guide/tutorial/environment-in-cogment-bea":{"__comp":"17896441","content":"e848be99"},"/docs/guide/tutorial/setup-a29":{"__comp":"17896441","content":"85f318fb"},"/docs/license-f2d":{"__comp":"17896441","content":"ac5280f2"},"/docs/reference/cli-59e":{"__comp":"17896441","content":"c3c15305"},"/docs/reference/cli/directory/directory-client-4f4":{"__comp":"17896441","content":"710eddd2"},"/docs/reference/cli/directory/directory-server-705":{"__comp":"17896441","content":"50751b0a"},"/docs/reference/cli/launch-548":{"__comp":"17896441","content":"8f68e2ce"},"/docs/reference/cli/model-registry-16c":{"__comp":"17896441","content":"a57d321a"},"/docs/reference/cli/orchestrator-962":{"__comp":"17896441","content":"14f1d27f"},"/docs/reference/cli/status-77f":{"__comp":"17896441","content":"3f8274eb"},"/docs/reference/cli/trial-datastore/trial-datastore-client-255":{"__comp":"17896441","content":"b2327a6c"},"/docs/reference/cli/trial-datastore/trial-datastore-server-436":{"__comp":"17896441","content":"696a412b"},"/docs/reference/cli/web-proxy-f0b":{"__comp":"17896441","content":"d03751be"},"/docs/reference/cogment-v2-changes-452":{"__comp":"17896441","content":"92a77eef"},"/docs/reference/cogment-yaml-d31":{"__comp":"17896441","content":"7a87d372"},"/docs/reference/grpc-407":{"__comp":"17896441","content":"d04964af"},"/docs/reference/javascript-4e0":{"__comp":"17896441","content":"8f51b104"},"/docs/reference/parameters-f82":{"__comp":"17896441","content":"08714d8c"},"/docs/reference/python-d04":{"__comp":"17896441","content":"2d986b69"},"/docs/reference/python-enterprise/installation-3b7":{"__comp":"17896441","content":"25848ff4"},"/docs/reference/python-enterprise/runner-277":{"__comp":"17896441","content":"61fcde8c"},"/docs/reference/web-proxy-api-943":{"__comp":"17896441","content":"1ae06ce2"},"/-7f6":{"__comp":"c4f5d8e4","__context":{"plugin":"c0fe6564"},"config":"5e9f5e1a"}}')}},e=>{e.O(0,[532],(()=>{return t=7221,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/assets/js/main.cd67fb39.js.LICENSE.txt b/assets/js/main.5e88352e.js.LICENSE.txt similarity index 100% rename from assets/js/main.cd67fb39.js.LICENSE.txt rename to assets/js/main.5e88352e.js.LICENSE.txt diff --git a/assets/js/main.cd67fb39.js b/assets/js/main.cd67fb39.js deleted file mode 100644 index bb02f0a..0000000 --- a/assets/js/main.cd67fb39.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see main.cd67fb39.js.LICENSE.txt */ -(self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[]).push([[179],{830:(e,t,n)=>{"use strict";n.d(t,{W:()=>a});var r=n(7294);function a(){return r.createElement("svg",{width:"20",height:"20",className:"DocSearch-Search-Icon",viewBox:"0 0 20 20"},r.createElement("path",{d:"M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}},723:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(7294),a=n(7462),o=n(8356),i=n.n(o),l=n(6887);const s={"08714d8c":[()=>n.e(3922).then(n.bind(n,1597)),"@site/docs/reference/parameters.md",1597],"14f1d27f":[()=>n.e(931).then(n.bind(n,8804)),"@site/docs/reference/cli/orchestrator.md",8804],17896441:[()=>Promise.all([n.e(532),n.e(7918)]).then(n.bind(n,8246)),"@theme/DocItem",8246],"1a4e3797":[()=>Promise.all([n.e(532),n.e(7920)]).then(n.bind(n,6675)),"@theme/SearchPage",6675],"1b039142":[()=>n.e(2147).then(n.bind(n,9615)),"@site/docs/guide/tutorial/advanced-tutorials/7-web-client.md",9615],"1be78505":[()=>Promise.all([n.e(532),n.e(9514)]).then(n.bind(n,9963)),"@theme/DocPage",9963],"1d042041":[()=>n.e(5767).then(n.t.bind(n,7085,19)),"/builds/ai-r/cogment/cogment-doc/.docusaurus/docusaurus-theme-search-algolia/default/plugin-route-context-module-100.json",7085],"25848ff4":[()=>n.e(8403).then(n.bind(n,3349)),"@site/docs/reference/python-enterprise/installation.md",3349],"2d986b69":[()=>n.e(8769).then(n.bind(n,5161)),"@site/docs/reference/python.md",5161],"354f5e12":[()=>Promise.all([n.e(532),n.e(9071)]).then(n.bind(n,3056)),"@site/docs/guide/development-guide.mdx",3056],"3f8274eb":[()=>n.e(9690).then(n.bind(n,555)),"@site/docs/reference/cli/status.md",555],"4f085710":[()=>n.e(9921).then(n.bind(n,9967)),"@site/docs/guide/tutorial/index.md",9967],"50751b0a":[()=>n.e(8687).then(n.bind(n,9772)),"@site/docs/reference/cli/directory/directory-server.md",9772],"5e9f5e1a":[()=>Promise.resolve().then(n.bind(n,6809)),"@generated/docusaurus.config",6809],"61fcde8c":[()=>n.e(5171).then(n.bind(n,1975)),"@site/docs/reference/python-enterprise/runner.md",1975],"696a412b":[()=>n.e(928).then(n.bind(n,7113)),"@site/docs/reference/cli/trial-datastore/trial-datastore-server.md",7113],"6c6cf206":[()=>n.e(966).then(n.bind(n,1291)),"@site/docs/guide/implementation-recipes/index.md",1291],"6f2832ad":[()=>n.e(5307).then(n.bind(n,6421)),"@site/docs/guide/tutorial/advanced-tutorials/index.md",6421],"710eddd2":[()=>n.e(7221).then(n.bind(n,1167)),"@site/docs/reference/cli/directory/directory-client.md",1167],"76d0d1d8":[()=>n.e(1257).then(n.bind(n,8113)),"@site/docs/guide/tutorial/advanced-tutorials/8-directory.md",8113],"7a87d372":[()=>n.e(3953).then(n.bind(n,3031)),"@site/docs/reference/cogment-yaml.md",3031],"80b5be58":[()=>n.e(1028).then(n.bind(n,2383)),"@site/docs/guide/tutorial/2-actors-in-cogment.md",2383],"85f318fb":[()=>n.e(4896).then(n.bind(n,2781)),"@site/docs/guide/tutorial/1-setup.md",2781],"8ba33b25":[()=>Promise.all([n.e(532),n.e(4698),n.e(9985)]).then(n.bind(n,2900)),"@site/src/pages/cogment_verse/index.js",2900],"8f51b104":[()=>n.e(7330).then(n.bind(n,8009)),"@site/docs/reference/javascript.md",8009],"8f68e2ce":[()=>n.e(5089).then(n.bind(n,5432)),"@site/docs/reference/cli/launch.md",5432],"92a77eef":[()=>n.e(5505).then(n.bind(n,9214)),"@site/docs/reference/cogment-v2-changes.md",9214],"935f2afb":[()=>n.e(53).then(n.t.bind(n,1109,19)),"~docs/default/version-current-metadata-prop-751.json",1109],"9b35c4f5":[()=>n.e(9255).then(n.bind(n,562)),"@site/docs/community-channels.md",562],"9b824c8f":[()=>n.e(2880).then(n.bind(n,2406)),"@site/docs/guide/core-concepts.md",2406],a57d321a:[()=>n.e(916).then(n.bind(n,5676)),"@site/docs/reference/cli/model-registry.md",5676],ac5280f2:[()=>n.e(8529).then(n.bind(n,5687)),"@site/docs/license.md",5687],b2327a6c:[()=>n.e(1909).then(n.bind(n,251)),"@site/docs/reference/cli/trial-datastore/trial-datastore-client.md",251],be6d912d:[()=>n.e(7107).then(n.t.bind(n,3769,19)),"/builds/ai-r/cogment/cogment-doc/.docusaurus/docusaurus-plugin-content-docs/default/plugin-route-context-module-100.json",3769],c0fe6564:[()=>n.e(5649).then(n.t.bind(n,5745,19)),"/builds/ai-r/cogment/cogment-doc/.docusaurus/docusaurus-plugin-content-pages/default/plugin-route-context-module-100.json",5745],c24ec994:[()=>n.e(5519).then(n.bind(n,4985)),"@site/docs/guide/tutorial/4-decision-making.md",4985],c377a04b:[()=>n.e(6971).then(n.bind(n,1269)),"@site/docs/index.md",1269],c3c15305:[()=>n.e(1043).then(n.bind(n,3706)),"@site/docs/reference/cli/index.md",3706],c4f5d8e4:[()=>Promise.all([n.e(532),n.e(4698),n.e(4195)]).then(n.bind(n,4825)),"@site/src/pages/index.js",4825],d03751be:[()=>n.e(1455).then(n.bind(n,9262)),"@site/docs/reference/cli/web-proxy.md",9262],d04964af:[()=>n.e(5893).then(n.bind(n,6111)),"@site/docs/reference/grpc.md",6111],d9378b29:[()=>n.e(4007).then(n.bind(n,4489)),"@site/docs/guide/tutorial/advanced-tutorials/6-human-player.md",4489],e848be99:[()=>n.e(8172).then(n.bind(n,9208)),"@site/docs/guide/tutorial/3-environment-in-cogment.md",9208],f012f959:[()=>n.e(2229).then(n.bind(n,4352)),"@site/docs/guide/implementation-recipes/configure-trial-from-controller.md",4352],fd5e6f38:[()=>n.e(3106).then(n.bind(n,845)),"@site/docs/guide/implementation-recipes/v2-migration-guide.md",845]};function c(e){let{error:t,retry:n,pastDelay:a}=e;return t?r.createElement("div",{style:{textAlign:"center",color:"#fff",backgroundColor:"#fa383e",borderColor:"#fa383e",borderStyle:"solid",borderRadius:"0.25rem",borderWidth:"1px",boxSizing:"border-box",display:"block",padding:"1rem",flex:"0 0 50%",marginLeft:"25%",marginRight:"25%",marginTop:"5rem",maxWidth:"50%",width:"100%"}},r.createElement("p",null,String(t)),r.createElement("div",null,r.createElement("button",{type:"button",onClick:n},"Retry"))):a?r.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"}},r.createElement("svg",{id:"loader",style:{width:128,height:110,position:"absolute",top:"calc(100vh - 64%)"},viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",stroke:"#61dafb"},r.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1)",strokeWidth:"2"},r.createElement("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0"},r.createElement("animate",{attributeName:"r",begin:"1.5s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-opacity",begin:"1.5s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-width",begin:"1.5s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})),r.createElement("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0"},r.createElement("animate",{attributeName:"r",begin:"3s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-opacity",begin:"3s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-width",begin:"3s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})),r.createElement("circle",{cx:"22",cy:"22",r:"8"},r.createElement("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"6;1;2;3;4;5;6",calcMode:"linear",repeatCount:"indefinite"}))))):null}var u=n(9670),d=n(226);function f(e,t){if("*"===e)return i()({loading:c,loader:()=>n.e(4972).then(n.bind(n,4972)),modules:["@theme/NotFound"],webpack:()=>[4972],render(e,t){const n=e.default;return r.createElement(d.z,{value:{plugin:{name:"native",id:"default"}}},r.createElement(n,t))}});const o=l[`${e}-${t}`],f={},p=[],m=[],h=(0,u.Z)(o);return Object.entries(h).forEach((e=>{let[t,n]=e;const r=s[n];r&&(f[t]=r[0],p.push(r[1]),m.push(r[2]))})),i().Map({loading:c,loader:f,modules:p,webpack:()=>m,render(t,n){const i=JSON.parse(JSON.stringify(o));Object.entries(t).forEach((t=>{let[n,r]=t;const a=r.default;if(!a)throw new Error(`The page component at ${e} doesn't have a default export. This makes it impossible to render anything. Consider default-exporting a React component.`);"object"!=typeof a&&"function"!=typeof a||Object.keys(r).filter((e=>"default"!==e)).forEach((e=>{a[e]=r[e]}));let o=i;const l=n.split(".");l.slice(0,-1).forEach((e=>{o=o[e]})),o[l[l.length-1]]=a}));const l=i.__comp;delete i.__comp;const s=i.__context;return delete i.__context,r.createElement(d.z,{value:s},r.createElement(l,(0,a.Z)({},i,n)))}})}const p=[{path:"/cogment_verse",component:f("/cogment_verse","238"),exact:!0},{path:"/search",component:f("/search","b08"),exact:!0},{path:"/docs",component:f("/docs","390"),routes:[{path:"/docs",component:f("/docs","f31"),exact:!0,sidebar:"docSidebar"},{path:"/docs/community-channels",component:f("/docs/community-channels","fe1"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/core-concepts",component:f("/docs/guide/core-concepts","4f9"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/development-guide",component:f("/docs/guide/development-guide","213"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/implementation-recipes",component:f("/docs/guide/implementation-recipes","3dc"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/implementation-recipes/configure-trial-from-controller",component:f("/docs/guide/implementation-recipes/configure-trial-from-controller","6e2"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/implementation-recipes/v2-migration-guide",component:f("/docs/guide/implementation-recipes/v2-migration-guide","024"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/tutorial",component:f("/docs/guide/tutorial","4db"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/tutorial/actors-in-cogment",component:f("/docs/guide/tutorial/actors-in-cogment","ffe"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/tutorial/advanced-tutorials",component:f("/docs/guide/tutorial/advanced-tutorials","c3b"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/tutorial/advanced-tutorials/directory",component:f("/docs/guide/tutorial/advanced-tutorials/directory","162"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/tutorial/advanced-tutorials/human-player",component:f("/docs/guide/tutorial/advanced-tutorials/human-player","34b"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/tutorial/advanced-tutorials/web-client",component:f("/docs/guide/tutorial/advanced-tutorials/web-client","878"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/tutorial/decision-making",component:f("/docs/guide/tutorial/decision-making","f36"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/tutorial/environment-in-cogment",component:f("/docs/guide/tutorial/environment-in-cogment","bea"),exact:!0,sidebar:"docSidebar"},{path:"/docs/guide/tutorial/setup",component:f("/docs/guide/tutorial/setup","a29"),exact:!0,sidebar:"docSidebar"},{path:"/docs/license",component:f("/docs/license","f2d"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cli",component:f("/docs/reference/cli","59e"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cli/directory/directory-client",component:f("/docs/reference/cli/directory/directory-client","4f4"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cli/directory/directory-server",component:f("/docs/reference/cli/directory/directory-server","705"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cli/launch",component:f("/docs/reference/cli/launch","548"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cli/model-registry",component:f("/docs/reference/cli/model-registry","16c"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cli/orchestrator",component:f("/docs/reference/cli/orchestrator","962"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cli/status",component:f("/docs/reference/cli/status","77f"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cli/trial-datastore/trial-datastore-client",component:f("/docs/reference/cli/trial-datastore/trial-datastore-client","255"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cli/trial-datastore/trial-datastore-server",component:f("/docs/reference/cli/trial-datastore/trial-datastore-server","436"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cli/web-proxy",component:f("/docs/reference/cli/web-proxy","f0b"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cogment-v2-changes",component:f("/docs/reference/cogment-v2-changes","452"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/cogment-yaml",component:f("/docs/reference/cogment-yaml","d31"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/grpc",component:f("/docs/reference/grpc","407"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/javascript",component:f("/docs/reference/javascript","4e0"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/parameters",component:f("/docs/reference/parameters","f82"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/python",component:f("/docs/reference/python","d04"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/python-enterprise/installation",component:f("/docs/reference/python-enterprise/installation","3b7"),exact:!0,sidebar:"docSidebar"},{path:"/docs/reference/python-enterprise/runner",component:f("/docs/reference/python-enterprise/runner","277"),exact:!0,sidebar:"docSidebar"}]},{path:"/",component:f("/","7f6"),exact:!0},{path:"*",component:f("*")}]},8934:(e,t,n)=>{"use strict";n.d(t,{_:()=>a,t:()=>o});var r=n(7294);const a=r.createContext(!1);function o(e){let{children:t}=e;const[n,o]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{o(!0)}),[]),r.createElement(a.Provider,{value:n},t)}},9383:(e,t,n)=>{"use strict";var r=n(7294),a=n(3935),o=n(3727),i=n(405),l=n(412);const s=[n(4367),n(2497),n(3310),n(8320),n(2295)];var c=n(723),u=n(6775),d=n(8790);function f(e){let{children:t}=e;return r.createElement(r.Fragment,null,t)}var p=n(7462),m=n(5742),h=n(2263),g=n(4996),b=n(6668),v=n(833),y=n(4711),w=n(9727),k=n(3320),E=n(197);function S(){const{i18n:{defaultLocale:e,localeConfigs:t}}=(0,h.Z)(),n=(0,y.l)();return r.createElement(m.Z,null,Object.entries(t).map((e=>{let[t,{htmlLang:a}]=e;return r.createElement("link",{key:t,rel:"alternate",href:n.createUrl({locale:t,fullyQualified:!0}),hrefLang:a})})),r.createElement("link",{rel:"alternate",href:n.createUrl({locale:e,fullyQualified:!0}),hrefLang:"x-default"}))}function x(e){let{permalink:t}=e;const{siteConfig:{url:n}}=(0,h.Z)(),a=function(){const{siteConfig:{url:e}}=(0,h.Z)(),{pathname:t}=(0,u.TH)();return e+(0,g.Z)(t)}(),o=t?`${n}${t}`:a;return r.createElement(m.Z,null,r.createElement("meta",{property:"og:url",content:o}),r.createElement("link",{rel:"canonical",href:o}))}function C(){const{i18n:{currentLocale:e}}=(0,h.Z)(),{metadata:t,image:n}=(0,b.L)();return r.createElement(r.Fragment,null,r.createElement(m.Z,null,r.createElement("meta",{name:"twitter:card",content:"summary_large_image"}),r.createElement("body",{className:w.h})),n&&r.createElement(v.d,{image:n}),r.createElement(x,null),r.createElement(S,null),r.createElement(E.Z,{tag:k.HX,locale:e}),r.createElement(m.Z,null,t.map(((e,t)=>r.createElement("meta",(0,p.Z)({key:t},e))))))}const T=new Map;function _(e){if(T.has(e.pathname))return{...e,pathname:T.get(e.pathname)};if((0,d.f)(c.Z,e.pathname).some((e=>{let{route:t}=e;return!0===t.exact})))return T.set(e.pathname,e.pathname),e;const t=e.pathname.trim().replace(/(?:\/index)?\.html$/,"")||"/";return T.set(e.pathname,t),{...e,pathname:t}}var A=n(8934),L=n(8940);function R(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const a=s.map((t=>{var r;const a=(null==(r=t.default)?void 0:r[e])??t[e];return null==a?void 0:a(...n)}));return()=>a.forEach((e=>null==e?void 0:e()))}const N=function(e){let{children:t,location:n,previousLocation:a}=e;return(0,r.useLayoutEffect)((()=>{a!==n&&(!function(e){let{location:t,previousLocation:n}=e;if(!n)return;const r=t.pathname===n.pathname,a=t.hash===n.hash,o=t.search===n.search;if(r&&a&&!o)return;const{hash:i}=t;if(i){const e=decodeURIComponent(i.substring(1)),t=document.getElementById(e);null==t||t.scrollIntoView()}else window.scrollTo(0,0)}({location:n,previousLocation:a}),R("onRouteDidUpdate",{previousLocation:a,location:n}))}),[a,n]),t};function P(e){const t=Array.from(new Set([e,decodeURI(e)])).map((e=>(0,d.f)(c.Z,e))).flat();return Promise.all(t.map((e=>null==e.route.component.preload?void 0:e.route.component.preload())))}class O extends r.Component{previousLocation;routeUpdateCleanupCb;constructor(e){super(e),this.previousLocation=null,this.routeUpdateCleanupCb=l.Z.canUseDOM?R("onRouteUpdate",{previousLocation:null,location:this.props.location}):()=>{},this.state={nextRouteHasLoaded:!0}}shouldComponentUpdate(e,t){if(e.location===this.props.location)return t.nextRouteHasLoaded;const n=e.location;return this.previousLocation=this.props.location,this.setState({nextRouteHasLoaded:!1}),this.routeUpdateCleanupCb=R("onRouteUpdate",{previousLocation:this.previousLocation,location:n}),P(n.pathname).then((()=>{this.routeUpdateCleanupCb(),this.setState({nextRouteHasLoaded:!0})})).catch((e=>{console.warn(e),window.location.reload()})),!1}render(){const{children:e,location:t}=this.props;return r.createElement(N,{previousLocation:this.previousLocation,location:t},r.createElement(u.AW,{location:t,render:()=>e}))}}const I=O,D="docusaurus-base-url-issue-banner-container",M="docusaurus-base-url-issue-banner-suggestion-container",F="__DOCUSAURUS_INSERT_BASEURL_BANNER";function B(e){return`\nwindow['${F}'] = true;\n\ndocument.addEventListener('DOMContentLoaded', maybeInsertBanner);\n\nfunction maybeInsertBanner() {\n var shouldInsert = window['${F}'];\n shouldInsert && insertBanner();\n}\n\nfunction insertBanner() {\n var bannerContainer = document.getElementById('${D}');\n if (!bannerContainer) {\n return;\n }\n var bannerHtml = ${JSON.stringify(function(e){return`\n<div id="docusaurus-base-url-issue-banner" style="border: thick solid red; background-color: rgb(255, 230, 179); margin: 20px; padding: 20px; font-size: 20px;">\n <p style="font-weight: bold; font-size: 30px;">Your Docusaurus site did not load properly.</p>\n <p>A very common reason is a wrong site <a href="https://docusaurus.io/docs/docusaurus.config.js/#baseUrl" style="font-weight: bold;">baseUrl configuration</a>.</p>\n <p>Current configured baseUrl = <span style="font-weight: bold; color: red;">${e}</span> ${"/"===e?" (default value)":""}</p>\n <p>We suggest trying baseUrl = <span id="${M}" style="font-weight: bold; color: green;"></span></p>\n</div>\n`}(e)).replace(/</g,"\\<")};\n bannerContainer.innerHTML = bannerHtml;\n var suggestionContainer = document.getElementById('${M}');\n var actualHomePagePath = window.location.pathname;\n var suggestedBaseUrl = actualHomePagePath.substr(-1) === '/'\n ? actualHomePagePath\n : actualHomePagePath + '/';\n suggestionContainer.innerHTML = suggestedBaseUrl;\n}\n`}function j(){const{siteConfig:{baseUrl:e}}=(0,h.Z)();return(0,r.useLayoutEffect)((()=>{window[F]=!1}),[]),r.createElement(r.Fragment,null,!l.Z.canUseDOM&&r.createElement(m.Z,null,r.createElement("script",null,B(e))),r.createElement("div",{id:D}))}function z(){const{siteConfig:{baseUrl:e,baseUrlIssueBanner:t}}=(0,h.Z)(),{pathname:n}=(0,u.TH)();return t&&n===e?r.createElement(j,null):null}function U(){const{siteConfig:{favicon:e,title:t,noIndex:n},i18n:{currentLocale:a,localeConfigs:o}}=(0,h.Z)(),i=(0,g.Z)(e),{htmlLang:l,direction:s}=o[a];return r.createElement(m.Z,null,r.createElement("html",{lang:l,dir:s}),r.createElement("title",null,t),r.createElement("meta",{property:"og:title",content:t}),r.createElement("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0"}),n&&r.createElement("meta",{name:"robots",content:"noindex, nofollow"}),e&&r.createElement("link",{rel:"icon",href:i}))}var $=n(4763);function q(){const e=(0,d.H)(c.Z),t=(0,u.TH)();return r.createElement($.Z,null,r.createElement(L.M,null,r.createElement(A.t,null,r.createElement(f,null,r.createElement(U,null),r.createElement(C,null),r.createElement(z,null),r.createElement(I,{location:_(t)},e)))))}var H=n(6887);const G=function(e){try{return document.createElement("link").relList.supports(e)}catch{return!1}}("prefetch")?function(e){return new Promise(((t,n)=>{var r;if("undefined"==typeof document)return void n();const a=document.createElement("link");a.setAttribute("rel","prefetch"),a.setAttribute("href",e),a.onload=()=>t(),a.onerror=()=>n();const o=document.getElementsByTagName("head")[0]??(null==(r=document.getElementsByName("script")[0])?void 0:r.parentNode);null==o||o.appendChild(a)}))}:function(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),r.withCredentials=!0,r.onload=()=>{200===r.status?t():n()},r.send(null)}))};var Z=n(9670);const V=new Set,W=new Set,K=()=>{var e,t;return(null==(e=navigator.connection)?void 0:e.effectiveType.includes("2g"))||(null==(t=navigator.connection)?void 0:t.saveData)},Y={prefetch(e){if(!(e=>!K()&&!W.has(e)&&!V.has(e))(e))return!1;V.add(e);const t=(0,d.f)(c.Z,e).flatMap((e=>{return t=e.route.path,Object.entries(H).filter((e=>{let[n]=e;return n.replace(/-[^-]+$/,"")===t})).flatMap((e=>{let[,t]=e;return Object.values((0,Z.Z)(t))}));var t}));return Promise.all(t.map((e=>{const t=n.gca(e);return t&&!t.includes("undefined")?G(t).catch((()=>{})):Promise.resolve()})))},preload:e=>!!(e=>!K()&&!W.has(e))(e)&&(W.add(e),P(e))},Q=Object.freeze(Y);if(l.Z.canUseDOM){window.docusaurus=Q;const e=a.hydrate;P(window.location.pathname).then((()=>{e(r.createElement(i.B6,null,r.createElement(o.VK,null,r.createElement(q,null))),document.getElementById("__docusaurus"))}))}},8940:(e,t,n)=>{"use strict";n.d(t,{_:()=>u,M:()=>d});var r=n(7294),a=n(6809);const o=JSON.parse('{"docusaurus-plugin-content-docs":{"default":{"path":"/docs","versions":[{"name":"current","label":"Next","isLast":true,"path":"/docs","mainDocId":"index","docs":[{"id":"community-channels","path":"/docs/community-channels","sidebar":"docSidebar"},{"id":"guide/core-concepts","path":"/docs/guide/core-concepts","sidebar":"docSidebar"},{"id":"guide/development-guide","path":"/docs/guide/development-guide","sidebar":"docSidebar"},{"id":"guide/implementation-recipes/configure-trial-from-controller","path":"/docs/guide/implementation-recipes/configure-trial-from-controller","sidebar":"docSidebar"},{"id":"guide/implementation-recipes/index","path":"/docs/guide/implementation-recipes/","sidebar":"docSidebar"},{"id":"guide/implementation-recipes/v2-migration-guide","path":"/docs/guide/implementation-recipes/v2-migration-guide","sidebar":"docSidebar"},{"id":"guide/tutorial/actors-in-cogment","path":"/docs/guide/tutorial/actors-in-cogment","sidebar":"docSidebar"},{"id":"guide/tutorial/advanced-tutorials/directory","path":"/docs/guide/tutorial/advanced-tutorials/directory","sidebar":"docSidebar"},{"id":"guide/tutorial/advanced-tutorials/human-player","path":"/docs/guide/tutorial/advanced-tutorials/human-player","sidebar":"docSidebar"},{"id":"guide/tutorial/advanced-tutorials/index","path":"/docs/guide/tutorial/advanced-tutorials/","sidebar":"docSidebar"},{"id":"guide/tutorial/advanced-tutorials/web-client","path":"/docs/guide/tutorial/advanced-tutorials/web-client","sidebar":"docSidebar"},{"id":"guide/tutorial/decision-making","path":"/docs/guide/tutorial/decision-making","sidebar":"docSidebar"},{"id":"guide/tutorial/environment-in-cogment","path":"/docs/guide/tutorial/environment-in-cogment","sidebar":"docSidebar"},{"id":"guide/tutorial/index","path":"/docs/guide/tutorial/","sidebar":"docSidebar"},{"id":"guide/tutorial/setup","path":"/docs/guide/tutorial/setup","sidebar":"docSidebar"},{"id":"index","path":"/docs/","sidebar":"docSidebar"},{"id":"license","path":"/docs/license","sidebar":"docSidebar"},{"id":"reference/cli/directory/directory-client","path":"/docs/reference/cli/directory/directory-client","sidebar":"docSidebar"},{"id":"reference/cli/directory/directory-server","path":"/docs/reference/cli/directory/directory-server","sidebar":"docSidebar"},{"id":"reference/cli/index","path":"/docs/reference/cli/","sidebar":"docSidebar"},{"id":"reference/cli/launch","path":"/docs/reference/cli/launch","sidebar":"docSidebar"},{"id":"reference/cli/model-registry","path":"/docs/reference/cli/model-registry","sidebar":"docSidebar"},{"id":"reference/cli/orchestrator","path":"/docs/reference/cli/orchestrator","sidebar":"docSidebar"},{"id":"reference/cli/status","path":"/docs/reference/cli/status","sidebar":"docSidebar"},{"id":"reference/cli/trial-datastore/trial-datastore-client","path":"/docs/reference/cli/trial-datastore/trial-datastore-client","sidebar":"docSidebar"},{"id":"reference/cli/trial-datastore/trial-datastore-server","path":"/docs/reference/cli/trial-datastore/trial-datastore-server","sidebar":"docSidebar"},{"id":"reference/cli/web-proxy","path":"/docs/reference/cli/web-proxy","sidebar":"docSidebar"},{"id":"reference/cogment-v2-changes","path":"/docs/reference/cogment-v2-changes","sidebar":"docSidebar"},{"id":"reference/cogment-yaml","path":"/docs/reference/cogment-yaml","sidebar":"docSidebar"},{"id":"reference/grpc","path":"/docs/reference/grpc","sidebar":"docSidebar"},{"id":"reference/javascript","path":"/docs/reference/javascript","sidebar":"docSidebar"},{"id":"reference/parameters","path":"/docs/reference/parameters","sidebar":"docSidebar"},{"id":"reference/python","path":"/docs/reference/python","sidebar":"docSidebar"},{"id":"reference/python-enterprise/installation","path":"/docs/reference/python-enterprise/installation","sidebar":"docSidebar"},{"id":"reference/python-enterprise/runner","path":"/docs/reference/python-enterprise/runner","sidebar":"docSidebar"}],"draftIds":[],"sidebars":{"docSidebar":{"link":{"path":"/docs/","label":"index"}}}}],"breadcrumbs":true}}}'),i=JSON.parse('{"defaultLocale":"en","locales":["en"],"path":"i18n","currentLocale":"en","localeConfigs":{"en":{"label":"English","direction":"ltr","htmlLang":"en","calendar":"gregory","path":"en"}}}');var l=n(7529);const s=JSON.parse('{"docusaurusVersion":"2.4.0","pluginVersions":{"docusaurus-plugin-content-docs":{"type":"package","name":"@docusaurus/plugin-content-docs","version":"2.4.0"},"docusaurus-plugin-content-pages":{"type":"package","name":"@docusaurus/plugin-content-pages","version":"2.4.0"},"docusaurus-plugin-google-analytics":{"type":"package","name":"@docusaurus/plugin-google-analytics","version":"2.4.0"},"docusaurus-plugin-sitemap":{"type":"package","name":"@docusaurus/plugin-sitemap","version":"2.4.0"},"docusaurus-theme-classic":{"type":"package","name":"@docusaurus/theme-classic","version":"2.4.0"},"docusaurus-theme-search-algolia":{"type":"package","name":"@docusaurus/theme-search-algolia","version":"2.4.0"}}}'),c={siteConfig:a.default,siteMetadata:s,globalData:o,i18n:i,codeTranslations:l},u=r.createContext(c);function d(e){let{children:t}=e;return r.createElement(u.Provider,{value:c},t)}},4763:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(7294),a=n(412),o=n(5742),i=n(8780),l=n(7452);function s(e){let{error:t,tryAgain:n}=e;return r.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",minHeight:"100vh",width:"100%",maxWidth:"80ch",fontSize:"20px",margin:"0 auto",padding:"1rem"}},r.createElement("h1",{style:{fontSize:"3rem"}},"This page crashed"),r.createElement("button",{type:"button",onClick:n,style:{margin:"1rem 0",fontSize:"2rem",cursor:"pointer",borderRadius:20,padding:"1rem"}},"Try again"),r.createElement(c,{error:t}))}function c(e){let{error:t}=e;const n=(0,i.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return r.createElement("p",{style:{whiteSpace:"pre-wrap"}},n)}function u(e){let{error:t,tryAgain:n}=e;return r.createElement(f,{fallback:()=>r.createElement(s,{error:t,tryAgain:n})},r.createElement(o.Z,null,r.createElement("title",null,"Page Error")),r.createElement(l.Z,null,r.createElement(s,{error:t,tryAgain:n})))}const d=e=>r.createElement(u,e);class f extends r.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){a.Z.canUseDOM&&this.setState({error:e})}render(){const{children:e}=this.props,{error:t}=this.state;if(t){const e={error:t,tryAgain:()=>this.setState({error:null})};return(this.props.fallback??d)(e)}return e??null}}},412:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});const r="undefined"!=typeof window&&"document"in window&&"createElement"in window.document,a={canUseDOM:r,canUseEventListeners:r&&("addEventListener"in window||"attachEvent"in window),canUseIntersectionObserver:r&&"IntersectionObserver"in window,canUseViewport:r&&"screen"in window}},5742:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294),a=n(405);function o(e){return r.createElement(a.ql,e)}},9960:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(7462),a=n(7294),o=n(3727),i=n(8780),l=n(2263),s=n(3919),c=n(412);const u=a.createContext({collectLink:()=>{}});var d=n(4996);function f(e,t){var n;let{isNavLink:f,to:p,href:m,activeClassName:h,isActive:g,"data-noBrokenLinkCheck":b,autoAddBaseUrl:v=!0,...y}=e;const{siteConfig:{trailingSlash:w,baseUrl:k}}=(0,l.Z)(),{withBaseUrl:E}=(0,d.C)(),S=(0,a.useContext)(u),x=(0,a.useRef)(null);(0,a.useImperativeHandle)(t,(()=>x.current));const C=p||m;const T=(0,s.Z)(C),_=null==C?void 0:C.replace("pathname://","");let A=void 0!==_?(L=_,v&&(e=>e.startsWith("/"))(L)?E(L):L):void 0;var L;A&&T&&(A=(0,i.applyTrailingSlash)(A,{trailingSlash:w,baseUrl:k}));const R=(0,a.useRef)(!1),N=f?o.OL:o.rU,P=c.Z.canUseIntersectionObserver,O=(0,a.useRef)(),I=()=>{R.current||null==A||(window.docusaurus.preload(A),R.current=!0)};(0,a.useEffect)((()=>(!P&&T&&null!=A&&window.docusaurus.prefetch(A),()=>{P&&O.current&&O.current.disconnect()})),[O,A,P,T]);const D=(null==(n=A)?void 0:n.startsWith("#"))??!1,M=!A||!T||D;return M||b||S.collectLink(A),M?a.createElement("a",(0,r.Z)({ref:x,href:A},C&&!T&&{target:"_blank",rel:"noopener noreferrer"},y)):a.createElement(N,(0,r.Z)({},y,{onMouseEnter:I,onTouchStart:I,innerRef:e=>{x.current=e,P&&e&&T&&(O.current=new window.IntersectionObserver((t=>{t.forEach((t=>{e===t.target&&(t.isIntersecting||t.intersectionRatio>0)&&(O.current.unobserve(e),O.current.disconnect(),null!=A&&window.docusaurus.prefetch(A))}))})),O.current.observe(e))},to:A},f&&{isActive:g,activeClassName:h}))}const p=a.forwardRef(f)},5999:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s,I:()=>l});var r=n(7294);function a(e,t){const n=e.split(/(\{\w+\})/).map(((e,n)=>{if(n%2==1){const n=null==t?void 0:t[e.slice(1,-1)];if(void 0!==n)return n}return e}));return n.some((e=>(0,r.isValidElement)(e)))?n.map(((e,t)=>(0,r.isValidElement)(e)?r.cloneElement(e,{key:t}):e)).filter((e=>""!==e)):n.join("")}var o=n(7529);function i(e){let{id:t,message:n}=e;if(void 0===t&&void 0===n)throw new Error("Docusaurus translation declarations must have at least a translation id or a default translation message");return o[t??n]??n??t}function l(e,t){let{message:n,id:r}=e;return a(i({message:n,id:r}),t)}function s(e){let{children:t,id:n,values:o}=e;if(t&&"string"!=typeof t)throw console.warn("Illegal <Translate> children",t),new Error("The Docusaurus <Translate> component only accept simple string values");const l=i({message:t,id:n});return r.createElement(r.Fragment,null,a(l,o))}},9935:(e,t,n)=>{"use strict";n.d(t,{m:()=>r});const r="default"},3919:(e,t,n)=>{"use strict";function r(e){return/^(?:\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,{Z:()=>a,b:()=>r})},4996:(e,t,n)=>{"use strict";n.d(t,{C:()=>i,Z:()=>l});var r=n(7294),a=n(2263),o=n(3919);function i(){const{siteConfig:{baseUrl:e,url:t}}=(0,a.Z)(),n=(0,r.useCallback)(((n,r)=>function(e,t,n,r){let{forcePrependBaseUrl:a=!1,absolute:i=!1}=void 0===r?{}:r;if(!n||n.startsWith("#")||(0,o.b)(n))return n;if(a)return t+n.replace(/^\//,"");if(n===t.replace(/\/$/,""))return t;const l=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+l:l}(t,e,n,r)),[t,e]);return{withBaseUrl:n}}function l(e,t){void 0===t&&(t={});const{withBaseUrl:n}=i();return n(e,t)}},2263:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294),a=n(8940);function o(){return(0,r.useContext)(a._)}},2389:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294),a=n(8934);function o(){return(0,r.useContext)(a._)}},9670:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});function r(e){const t={};return function e(n,r){Object.entries(n).forEach((n=>{let[a,o]=n;const i=r?`${r}.${a}`:a;var l;"object"==typeof(l=o)&&l&&Object.keys(l).length>0?e(o,i):t[i]=o}))}(e),t}},226:(e,t,n)=>{"use strict";n.d(t,{_:()=>a,z:()=>o});var r=n(7294);const a=r.createContext(null);function o(e){let{children:t,value:n}=e;const o=r.useContext(a),i=(0,r.useMemo)((()=>function(e){let{parent:t,value:n}=e;if(!t){if(!n)throw new Error("Unexpected: no Docusaurus route context found");if(!("plugin"in n))throw new Error("Unexpected: Docusaurus topmost route context has no `plugin` attribute");return n}const r={...t.data,...null==n?void 0:n.data};return{plugin:t.plugin,data:r}}({parent:o,value:n})),[o,n]);return r.createElement(a.Provider,{value:i},t)}},143:(e,t,n)=>{"use strict";n.d(t,{Iw:()=>b,gA:()=>p,WS:()=>m,_r:()=>d,Jo:()=>v,zh:()=>f,yW:()=>g,gB:()=>h});var r=n(6775),a=n(2263),o=n(9935);function i(e,t){void 0===t&&(t={});const n=function(){const{globalData:e}=(0,a.Z)();return e}()[e];if(!n&&t.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin.`);return n}const l=e=>e.versions.find((e=>e.isLast));function s(e,t){const n=l(e);return[...e.versions.filter((e=>e!==n)),n].find((e=>!!(0,r.LX)(t,{path:e.path,exact:!1,strict:!1})))}function c(e,t){const n=s(e,t),a=null==n?void 0:n.docs.find((e=>!!(0,r.LX)(t,{path:e.path,exact:!0,strict:!1})));return{activeVersion:n,activeDoc:a,alternateDocVersions:a?function(t){const n={};return e.versions.forEach((e=>{e.docs.forEach((r=>{r.id===t&&(n[e.name]=r)}))})),n}(a.id):{}}}const u={},d=()=>i("docusaurus-plugin-content-docs")??u,f=e=>function(e,t,n){void 0===t&&(t=o.m),void 0===n&&(n={});const r=i(e),a=null==r?void 0:r[t];if(!a&&n.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin with id "${t}".`);return a}("docusaurus-plugin-content-docs",e,{failfast:!0});function p(e){void 0===e&&(e={});const t=d(),{pathname:n}=(0,r.TH)();return function(e,t,n){void 0===n&&(n={});const a=Object.entries(e).sort(((e,t)=>t[1].path.localeCompare(e[1].path))).find((e=>{let[,n]=e;return!!(0,r.LX)(t,{path:n.path,exact:!1,strict:!1})})),o=a?{pluginId:a[0],pluginData:a[1]}:void 0;if(!o&&n.failfast)throw new Error(`Can't find active docs plugin for "${t}" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(e).map((e=>e.path)).join(", ")}`);return o}(t,n,e)}function m(e){void 0===e&&(e={});const t=p(e),{pathname:n}=(0,r.TH)();if(!t)return;return{activePlugin:t,activeVersion:s(t.pluginData,n)}}function h(e){return f(e).versions}function g(e){const t=f(e);return l(t)}function b(e){const t=f(e),{pathname:n}=(0,r.TH)();return c(t,n)}function v(e){const t=f(e),{pathname:n}=(0,r.TH)();return function(e,t){const n=l(e);return{latestDocSuggestion:c(e,t).alternateDocVersions[n.name],latestVersionSuggestion:n}}(t,n)}},4367:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={onRouteDidUpdate(e){let{location:t,previousLocation:n}=e;!n||t.pathname===n.pathname&&t.search===n.search&&t.hash===n.hash||(window.ga("set","page",t.pathname+t.search+t.hash),window.ga("send","pageview"))}}},8320:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var r=n(4865),a=n.n(r);a().configure({showSpinner:!1});const o={onRouteUpdate(e){let{location:t,previousLocation:n}=e;if(n&&t.pathname!==n.pathname){const e=window.setTimeout((()=>{a().start()}),200);return()=>window.clearTimeout(e)}},onRouteDidUpdate(){a().done()}}},3310:(e,t,n)=>{"use strict";n.r(t);var r=n(7410),a=n(6809);!function(e){const{themeConfig:{prism:t}}=a.default,{additionalLanguages:r}=t;globalThis.Prism=e,r.forEach((e=>{n(6726)(`./prism-${e}`)})),delete globalThis.Prism}(r.Z)},9471:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294);const a="iconExternalLink_nPIU";function o(e){let{width:t=13.5,height:n=13.5}=e;return r.createElement("svg",{width:t,height:n,"aria-hidden":"true",viewBox:"0 0 24 24",className:a},r.createElement("path",{fill:"currentColor",d:"M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"}))}},7452:(e,t,n)=>{"use strict";n.d(t,{Z:()=>Ot});var r=n(7294),a=n(6010),o=n(4763),i=n(7462),l=n(6775),s=n(5999),c=n(5936);const u="docusaurus_skipToContent_fallback";function d(e){e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")}function f(){const e=(0,r.useRef)(null),{action:t}=(0,l.k6)(),n=(0,r.useCallback)((e=>{e.preventDefault();const t=document.querySelector("main:first-of-type")??document.getElementById(u);t&&d(t)}),[]);return(0,c.S)((n=>{let{location:r}=n;e.current&&!r.hash&&"PUSH"===t&&d(e.current)})),{containerRef:e,onClick:n}}const p=(0,s.I)({id:"theme.common.skipToMainContent",description:"The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation",message:"Skip to main content"});function m(e){const t=e.children??p,{containerRef:n,onClick:a}=f();return r.createElement("div",{ref:n,role:"region","aria-label":p},r.createElement("a",(0,i.Z)({},e,{href:`#${u}`,onClick:a}),t))}var h=n(833),g=n(5281),b=n(9727);const v="skipToContent_fXgn";function y(){return r.createElement(m,{className:v})}var w=n(6668),k=n(9689);function E(e){let{width:t=21,height:n=21,color:a="currentColor",strokeWidth:o=1.2,className:l,...s}=e;return r.createElement("svg",(0,i.Z)({viewBox:"0 0 15 15",width:t,height:n},s),r.createElement("g",{stroke:a,strokeWidth:o},r.createElement("path",{d:"M.75.75l13.5 13.5M14.25.75L.75 14.25"})))}const S="closeButton_CVFx";function x(e){return r.createElement("button",(0,i.Z)({type:"button","aria-label":(0,s.I)({id:"theme.AnnouncementBar.closeButtonAriaLabel",message:"Close",description:"The ARIA label for close button of announcement bar"})},e,{className:(0,a.Z)("clean-btn close",S,e.className)}),r.createElement(E,{width:14,height:14,strokeWidth:3.1}))}const C="content_knG7";function T(e){const{announcementBar:t}=(0,w.L)(),{content:n}=t;return r.createElement("div",(0,i.Z)({},e,{className:(0,a.Z)(C,e.className),dangerouslySetInnerHTML:{__html:n}}))}const _="announcementBar_mb4j",A="announcementBarPlaceholder_vyr4",L="announcementBarClose_gvF7",R="announcementBarContent_xLdY";function N(){const{announcementBar:e}=(0,w.L)(),{isActive:t,close:n}=(0,k.nT)();if(!t)return null;const{backgroundColor:a,textColor:o,isCloseable:i}=e;return r.createElement("div",{className:_,style:{backgroundColor:a,color:o},role:"banner"},i&&r.createElement("div",{className:A}),r.createElement(T,{className:R}),i&&r.createElement(x,{onClick:n,className:L}))}var P=n(3163),O=n(2466);var I=n(902),D=n(3102);const M=r.createContext(null);function F(e){let{children:t}=e;const n=function(){const e=(0,P.e)(),t=(0,D.HY)(),[n,a]=(0,r.useState)(!1),o=null!==t.component,i=(0,I.D9)(o);return(0,r.useEffect)((()=>{o&&!i&&a(!0)}),[o,i]),(0,r.useEffect)((()=>{o?e.shown||a(!0):a(!1)}),[e.shown,o]),(0,r.useMemo)((()=>[n,a]),[n])}();return r.createElement(M.Provider,{value:n},t)}function B(e){if(e.component){const t=e.component;return r.createElement(t,e.props)}}function j(){const e=(0,r.useContext)(M);if(!e)throw new I.i6("NavbarSecondaryMenuDisplayProvider");const[t,n]=e,a=(0,r.useCallback)((()=>n(!1)),[n]),o=(0,D.HY)();return(0,r.useMemo)((()=>({shown:t,hide:a,content:B(o)})),[a,o,t])}function z(e){let{header:t,primaryMenu:n,secondaryMenu:o}=e;const{shown:i}=j();return r.createElement("div",{className:"navbar-sidebar"},t,r.createElement("div",{className:(0,a.Z)("navbar-sidebar__items",{"navbar-sidebar__items--show-secondary":i})},r.createElement("div",{className:"navbar-sidebar__item menu"},n),r.createElement("div",{className:"navbar-sidebar__item menu"},o)))}var U=n(2949),$=n(2389);function q(e){return r.createElement("svg",(0,i.Z)({viewBox:"0 0 24 24",width:24,height:24},e),r.createElement("path",{fill:"currentColor",d:"M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"}))}function H(e){return r.createElement("svg",(0,i.Z)({viewBox:"0 0 24 24",width:24,height:24},e),r.createElement("path",{fill:"currentColor",d:"M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"}))}const G={toggle:"toggle_vylO",toggleButton:"toggleButton_gllP",darkToggleIcon:"darkToggleIcon_wfgR",lightToggleIcon:"lightToggleIcon_pyhR",toggleButtonDisabled:"toggleButtonDisabled_aARS"};function Z(e){let{className:t,buttonClassName:n,value:o,onChange:i}=e;const l=(0,$.Z)(),c=(0,s.I)({message:"Switch between dark and light mode (currently {mode})",id:"theme.colorToggle.ariaLabel",description:"The ARIA label for the navbar color mode toggle"},{mode:"dark"===o?(0,s.I)({message:"dark mode",id:"theme.colorToggle.ariaLabel.mode.dark",description:"The name for the dark color mode"}):(0,s.I)({message:"light mode",id:"theme.colorToggle.ariaLabel.mode.light",description:"The name for the light color mode"})});return r.createElement("div",{className:(0,a.Z)(G.toggle,t)},r.createElement("button",{className:(0,a.Z)("clean-btn",G.toggleButton,!l&&G.toggleButtonDisabled,n),type:"button",onClick:()=>i("dark"===o?"light":"dark"),disabled:!l,title:c,"aria-label":c,"aria-live":"polite"},r.createElement(q,{className:(0,a.Z)(G.toggleIcon,G.lightToggleIcon)}),r.createElement(H,{className:(0,a.Z)(G.toggleIcon,G.darkToggleIcon)})))}const V=r.memo(Z),W="darkNavbarColorModeToggle_X3D1";function K(e){let{className:t}=e;const n=(0,w.L)().navbar.style,a=(0,w.L)().colorMode.disableSwitch,{colorMode:o,setColorMode:i}=(0,U.I)();return a?null:r.createElement(V,{className:t,buttonClassName:"dark"===n?W:void 0,value:o,onChange:i})}var Y=n(1327);function Q(){return r.createElement(Y.Z,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:"navbar__title text--truncate"})}function X(){const e=(0,P.e)();return r.createElement("button",{type:"button","aria-label":(0,s.I)({id:"theme.docs.sidebar.closeSidebarButtonAriaLabel",message:"Close navigation bar",description:"The ARIA label for close button of mobile sidebar"}),className:"clean-btn navbar-sidebar__close",onClick:()=>e.toggle()},r.createElement(E,{color:"var(--ifm-color-emphasis-600)"}))}function J(){return r.createElement("div",{className:"navbar-sidebar__brand"},r.createElement(Q,null),r.createElement(K,{className:"margin-right--md"}),r.createElement(X,null))}var ee=n(9960),te=n(4996),ne=n(3919),re=n(8022),ae=n(9471);function oe(e){let{activeBasePath:t,activeBaseRegex:n,to:a,href:o,label:l,html:s,isDropdownLink:c,prependBaseUrlToHref:u,...d}=e;const f=(0,te.Z)(a),p=(0,te.Z)(t),m=(0,te.Z)(o,{forcePrependBaseUrl:!0}),h=l&&o&&!(0,ne.Z)(o),g=s?{dangerouslySetInnerHTML:{__html:s}}:{children:r.createElement(r.Fragment,null,l,h&&r.createElement(ae.Z,c&&{width:12,height:12}))};return o?r.createElement(ee.Z,(0,i.Z)({href:u?m:o},d,g)):r.createElement(ee.Z,(0,i.Z)({to:f,isNavLink:!0},(t||n)&&{isActive:(e,t)=>n?(0,re.F)(n,t.pathname):t.pathname.startsWith(p)},d,g))}function ie(e){let{className:t,isDropdownItem:n=!1,...o}=e;const l=r.createElement(oe,(0,i.Z)({className:(0,a.Z)(n?"dropdown__link":"navbar__item navbar__link",t),isDropdownLink:n},o));return n?r.createElement("li",null,l):l}function le(e){let{className:t,isDropdownItem:n,...o}=e;return r.createElement("li",{className:"menu__list-item"},r.createElement(oe,(0,i.Z)({className:(0,a.Z)("menu__link",t)},o)))}function se(e){let{mobile:t=!1,position:n,...a}=e;const o=t?le:ie;return r.createElement(o,(0,i.Z)({},a,{activeClassName:a.activeClassName??(t?"menu__link--active":"navbar__link--active")}))}var ce=n(6043),ue=n(8596),de=n(2263);function fe(e,t){return e.some((e=>function(e,t){return!!(0,ue.Mg)(e.to,t)||!!(0,re.F)(e.activeBaseRegex,t)||!(!e.activeBasePath||!t.startsWith(e.activeBasePath))}(e,t)))}function pe(e){let{items:t,position:n,className:o,onClick:l,...s}=e;const c=(0,r.useRef)(null),[u,d]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{const e=e=>{c.current&&!c.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),document.addEventListener("focusin",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e),document.removeEventListener("focusin",e)}}),[c]),r.createElement("div",{ref:c,className:(0,a.Z)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--right":"right"===n,"dropdown--show":u})},r.createElement(oe,(0,i.Z)({"aria-haspopup":"true","aria-expanded":u,role:"button",href:s.to?void 0:"#",className:(0,a.Z)("navbar__link",o)},s,{onClick:s.to?void 0:e=>e.preventDefault(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),d(!u))}}),s.children??s.label),r.createElement("ul",{className:"dropdown__menu"},t.map(((e,t)=>r.createElement(Ze,(0,i.Z)({isDropdownItem:!0,activeClassName:"dropdown__link--active"},e,{key:t}))))))}function me(e){let{items:t,className:n,position:o,onClick:s,...c}=e;const u=function(){const{siteConfig:{baseUrl:e}}=(0,de.Z)(),{pathname:t}=(0,l.TH)();return t.replace(e,"/")}(),d=fe(t,u),{collapsed:f,toggleCollapsed:p,setCollapsed:m}=(0,ce.u)({initialState:()=>!d});return(0,r.useEffect)((()=>{d&&m(!d)}),[u,d,m]),r.createElement("li",{className:(0,a.Z)("menu__list-item",{"menu__list-item--collapsed":f})},r.createElement(oe,(0,i.Z)({role:"button",className:(0,a.Z)("menu__link menu__link--sublist menu__link--sublist-caret",n)},c,{onClick:e=>{e.preventDefault(),p()}}),c.children??c.label),r.createElement(ce.z,{lazy:!0,as:"ul",className:"menu__list",collapsed:f},t.map(((e,t)=>r.createElement(Ze,(0,i.Z)({mobile:!0,isDropdownItem:!0,onClick:s,activeClassName:"menu__link--active"},e,{key:t}))))))}function he(e){let{mobile:t=!1,...n}=e;const a=t?me:pe;return r.createElement(a,n)}var ge=n(4711);function be(e){let{width:t=20,height:n=20,...a}=e;return r.createElement("svg",(0,i.Z)({viewBox:"0 0 24 24",width:t,height:n,"aria-hidden":!0},a),r.createElement("path",{fill:"currentColor",d:"M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"}))}const ve="iconLanguage_nlXk";function ye(){return r.createElement("svg",{width:"15",height:"15",className:"DocSearch-Control-Key-Icon"},r.createElement("path",{d:"M4.505 4.496h2M5.505 5.496v5M8.216 4.496l.055 5.993M10 7.5c.333.333.5.667.5 1v2M12.326 4.5v5.996M8.384 4.496c1.674 0 2.116 0 2.116 1.5s-.442 1.5-2.116 1.5M3.205 9.303c-.09.448-.277 1.21-1.241 1.203C1 10.5.5 9.513.5 8V7c0-1.57.5-2.5 1.464-2.494.964.006 1.134.598 1.24 1.342M12.553 10.5h1.953",strokeWidth:"1.2",stroke:"currentColor",fill:"none",strokeLinecap:"square"}))}var we=n(830),ke=["translations"];function Ee(){return Ee=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ee.apply(this,arguments)}function Se(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(s){l=!0,a=s}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return xe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xe(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ce(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Te="Ctrl";var _e=r.forwardRef((function(e,t){var n=e.translations,a=void 0===n?{}:n,o=Ce(e,ke),i=a.buttonText,l=void 0===i?"Search":i,s=a.buttonAriaLabel,c=void 0===s?"Search":s,u=Se((0,r.useState)(null),2),d=u[0],f=u[1];return(0,r.useEffect)((function(){"undefined"!=typeof navigator&&(/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)?f("\u2318"):f(Te))}),[]),r.createElement("button",Ee({type:"button",className:"DocSearch DocSearch-Button","aria-label":c},o,{ref:t}),r.createElement("span",{className:"DocSearch-Button-Container"},r.createElement(we.W,null),r.createElement("span",{className:"DocSearch-Button-Placeholder"},l)),r.createElement("span",{className:"DocSearch-Button-Keys"},null!==d&&r.createElement(r.Fragment,null,r.createElement("kbd",{className:"DocSearch-Button-Key"},d===Te?r.createElement(ye,null):d),r.createElement("kbd",{className:"DocSearch-Button-Key"},"K"))))})),Ae=n(5742),Le=n(6177),Re=n(239),Ne=n(3320);var Pe=n(3935);const Oe={button:{buttonText:(0,s.I)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"}),buttonAriaLabel:(0,s.I)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"})},modal:{searchBox:{resetButtonTitle:(0,s.I)({id:"theme.SearchModal.searchBox.resetButtonTitle",message:"Clear the query",description:"The label and ARIA label for search box reset button"}),resetButtonAriaLabel:(0,s.I)({id:"theme.SearchModal.searchBox.resetButtonTitle",message:"Clear the query",description:"The label and ARIA label for search box reset button"}),cancelButtonText:(0,s.I)({id:"theme.SearchModal.searchBox.cancelButtonText",message:"Cancel",description:"The label and ARIA label for search box cancel button"}),cancelButtonAriaLabel:(0,s.I)({id:"theme.SearchModal.searchBox.cancelButtonText",message:"Cancel",description:"The label and ARIA label for search box cancel button"})},startScreen:{recentSearchesTitle:(0,s.I)({id:"theme.SearchModal.startScreen.recentSearchesTitle",message:"Recent",description:"The title for recent searches"}),noRecentSearchesText:(0,s.I)({id:"theme.SearchModal.startScreen.noRecentSearchesText",message:"No recent searches",description:"The text when no recent searches"}),saveRecentSearchButtonTitle:(0,s.I)({id:"theme.SearchModal.startScreen.saveRecentSearchButtonTitle",message:"Save this search",description:"The label for save recent search button"}),removeRecentSearchButtonTitle:(0,s.I)({id:"theme.SearchModal.startScreen.removeRecentSearchButtonTitle",message:"Remove this search from history",description:"The label for remove recent search button"}),favoriteSearchesTitle:(0,s.I)({id:"theme.SearchModal.startScreen.favoriteSearchesTitle",message:"Favorite",description:"The title for favorite searches"}),removeFavoriteSearchButtonTitle:(0,s.I)({id:"theme.SearchModal.startScreen.removeFavoriteSearchButtonTitle",message:"Remove this search from favorites",description:"The label for remove favorite search button"})},errorScreen:{titleText:(0,s.I)({id:"theme.SearchModal.errorScreen.titleText",message:"Unable to fetch results",description:"The title for error screen of search modal"}),helpText:(0,s.I)({id:"theme.SearchModal.errorScreen.helpText",message:"You might want to check your network connection.",description:"The help text for error screen of search modal"})},footer:{selectText:(0,s.I)({id:"theme.SearchModal.footer.selectText",message:"to select",description:"The explanatory text of the action for the enter key"}),selectKeyAriaLabel:(0,s.I)({id:"theme.SearchModal.footer.selectKeyAriaLabel",message:"Enter key",description:"The ARIA label for the Enter key button that makes the selection"}),navigateText:(0,s.I)({id:"theme.SearchModal.footer.navigateText",message:"to navigate",description:"The explanatory text of the action for the Arrow up and Arrow down key"}),navigateUpKeyAriaLabel:(0,s.I)({id:"theme.SearchModal.footer.navigateUpKeyAriaLabel",message:"Arrow up",description:"The ARIA label for the Arrow up key button that makes the navigation"}),navigateDownKeyAriaLabel:(0,s.I)({id:"theme.SearchModal.footer.navigateDownKeyAriaLabel",message:"Arrow down",description:"The ARIA label for the Arrow down key button that makes the navigation"}),closeText:(0,s.I)({id:"theme.SearchModal.footer.closeText",message:"to close",description:"The explanatory text of the action for Escape key"}),closeKeyAriaLabel:(0,s.I)({id:"theme.SearchModal.footer.closeKeyAriaLabel",message:"Escape key",description:"The ARIA label for the Escape key button that close the modal"}),searchByText:(0,s.I)({id:"theme.SearchModal.footer.searchByText",message:"Search by",description:"The text explain that the search is making by Algolia"})},noResultsScreen:{noResultsText:(0,s.I)({id:"theme.SearchModal.noResultsScreen.noResultsText",message:"No results for",description:"The text explains that there are no results for the following search"}),suggestedQueryText:(0,s.I)({id:"theme.SearchModal.noResultsScreen.suggestedQueryText",message:"Try searching for",description:"The text for the suggested query when no results are found for the following search"}),reportMissingResultsText:(0,s.I)({id:"theme.SearchModal.noResultsScreen.reportMissingResultsText",message:"Believe this query should return results?",description:"The text for the question where the user thinks there are missing results"}),reportMissingResultsLinkText:(0,s.I)({id:"theme.SearchModal.noResultsScreen.reportMissingResultsLinkText",message:"Let us know.",description:"The text for the link to report missing results"})}},placeholder:(0,s.I)({id:"theme.SearchModal.placeholder",message:"Search docs",description:"The placeholder of the input of the DocSearch pop-up modal"})};let Ie=null;function De(e){let{hit:t,children:n}=e;return r.createElement(ee.Z,{to:t.url},n)}function Me(e){let{state:t,onClose:n}=e;const a=(0,Le.M)();return r.createElement(ee.Z,{to:a(t.query),onClick:n},r.createElement(s.Z,{id:"theme.SearchBar.seeAll",values:{count:t.context.nbHits}},"See all {count} results"))}function Fe(e){var t;let{contextualSearch:a,externalUrlRegex:o,...s}=e;const{siteMetadata:c}=(0,de.Z)(),u=(0,Re.l)(),d=function(){const{locale:e,tags:t}=(0,Ne._q)();return[`language:${e}`,t.map((e=>`docusaurus_tag:${e}`))]}(),f=(null==(t=s.searchParameters)?void 0:t.facetFilters)??[],p=a?function(e,t){const n=e=>"string"==typeof e?[e]:e;return[...n(e),...n(t)]}(d,f):f,m={...s.searchParameters,facetFilters:p},h=(0,l.k6)(),g=(0,r.useRef)(null),b=(0,r.useRef)(null),[v,y]=(0,r.useState)(!1),[w,k]=(0,r.useState)(void 0),E=(0,r.useCallback)((()=>Ie?Promise.resolve():Promise.all([n.e(6780).then(n.bind(n,6780)),Promise.all([n.e(532),n.e(6945)]).then(n.bind(n,6945)),Promise.all([n.e(532),n.e(8894)]).then(n.bind(n,8894))]).then((e=>{let[{DocSearchModal:t}]=e;Ie=t}))),[]),S=(0,r.useCallback)((()=>{E().then((()=>{g.current=document.createElement("div"),document.body.insertBefore(g.current,document.body.firstChild),y(!0)}))}),[E,y]),x=(0,r.useCallback)((()=>{var e;y(!1),null==(e=g.current)||e.remove()}),[y]),C=(0,r.useCallback)((e=>{E().then((()=>{y(!0),k(e.key)}))}),[E,y,k]),T=(0,r.useRef)({navigate(e){let{itemUrl:t}=e;(0,re.F)(o,t)?window.location.href=t:h.push(t)}}).current,_=(0,r.useRef)((e=>s.transformItems?s.transformItems(e):e.map((e=>({...e,url:u(e.url)}))))).current,A=(0,r.useMemo)((()=>e=>r.createElement(Me,(0,i.Z)({},e,{onClose:x}))),[x]),L=(0,r.useCallback)((e=>(e.addAlgoliaAgent("docusaurus",c.docusaurusVersion),e)),[c.docusaurusVersion]);return function(e){var t=e.isOpen,n=e.onOpen,a=e.onClose,o=e.onInput,i=e.searchButtonRef;r.useEffect((function(){function e(e){(27===e.keyCode&&t||"k"===e.key.toLowerCase()&&(e.metaKey||e.ctrlKey)||!function(e){var t=e.target,n=t.tagName;return t.isContentEditable||"INPUT"===n||"SELECT"===n||"TEXTAREA"===n}(e)&&"/"===e.key&&!t)&&(e.preventDefault(),t?a():document.body.classList.contains("DocSearch--active")||document.body.classList.contains("DocSearch--active")||n()),i&&i.current===document.activeElement&&o&&/[a-zA-Z0-9]/.test(String.fromCharCode(e.keyCode))&&o(e)}return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}),[t,n,a,o,i])}({isOpen:v,onOpen:S,onClose:x,onInput:C,searchButtonRef:b}),r.createElement(r.Fragment,null,r.createElement(Ae.Z,null,r.createElement("link",{rel:"preconnect",href:`https://${s.appId}-dsn.algolia.net`,crossOrigin:"anonymous"})),r.createElement(_e,{onTouchStart:E,onFocus:E,onMouseOver:E,onClick:S,ref:b,translations:Oe.button}),v&&Ie&&g.current&&(0,Pe.createPortal)(r.createElement(Ie,(0,i.Z)({onClose:x,initialScrollY:window.scrollY,initialQuery:w,navigator:T,transformItems:_,hitComponent:De,transformSearchClient:L},s.searchPagePath&&{resultsFooterComponent:A},s,{searchParameters:m,placeholder:Oe.placeholder,translations:Oe.modal})),g.current))}function Be(){const{siteConfig:e}=(0,de.Z)();return r.createElement(Fe,e.themeConfig.algolia)}const je="searchBox_ZlJk";function ze(e){let{children:t,className:n}=e;return r.createElement("div",{className:(0,a.Z)(n,je)},t)}var Ue=n(143),$e=n(3438);var qe=n(373);const He=e=>e.docs.find((t=>t.id===e.mainDocId));const Ge={default:se,localeDropdown:function(e){let{mobile:t,dropdownItemsBefore:n,dropdownItemsAfter:a,...o}=e;const{i18n:{currentLocale:c,locales:u,localeConfigs:d}}=(0,de.Z)(),f=(0,ge.l)(),{search:p,hash:m}=(0,l.TH)(),h=[...n,...u.map((e=>{const n=`${`pathname://${f.createUrl({locale:e,fullyQualified:!1})}`}${p}${m}`;return{label:d[e].label,lang:d[e].htmlLang,to:n,target:"_self",autoAddBaseUrl:!1,className:e===c?t?"menu__link--active":"dropdown__link--active":""}})),...a],g=t?(0,s.I)({message:"Languages",id:"theme.navbar.mobileLanguageDropdown.label",description:"The label for the mobile language switcher dropdown"}):d[c].label;return r.createElement(he,(0,i.Z)({},o,{mobile:t,label:r.createElement(r.Fragment,null,r.createElement(be,{className:ve}),g),items:h}))},search:function(e){let{mobile:t,className:n}=e;return t?null:r.createElement(ze,{className:n},r.createElement(Be,null))},dropdown:he,html:function(e){let{value:t,className:n,mobile:o=!1,isDropdownItem:i=!1}=e;const l=i?"li":"div";return r.createElement(l,{className:(0,a.Z)({navbar__item:!o&&!i,"menu__list-item":o},n),dangerouslySetInnerHTML:{__html:t}})},doc:function(e){let{docId:t,label:n,docsPluginId:a,...o}=e;const{activeDoc:l}=(0,Ue.Iw)(a),s=(0,$e.vY)(t,a);return null===s?null:r.createElement(se,(0,i.Z)({exact:!0},o,{isActive:()=>(null==l?void 0:l.path)===s.path||!(null==l||!l.sidebar)&&l.sidebar===s.sidebar,label:n??s.id,to:s.path}))},docSidebar:function(e){let{sidebarId:t,label:n,docsPluginId:a,...o}=e;const{activeDoc:l}=(0,Ue.Iw)(a),s=(0,$e.oz)(t,a).link;if(!s)throw new Error(`DocSidebarNavbarItem: Sidebar with ID "${t}" doesn't have anything to be linked to.`);return r.createElement(se,(0,i.Z)({exact:!0},o,{isActive:()=>(null==l?void 0:l.sidebar)===t,label:n??s.label,to:s.path}))},docsVersion:function(e){let{label:t,to:n,docsPluginId:a,...o}=e;const l=(0,$e.lO)(a)[0],s=t??l.label,c=n??(e=>e.docs.find((t=>t.id===e.mainDocId)))(l).path;return r.createElement(se,(0,i.Z)({},o,{label:s,to:c}))},docsVersionDropdown:function(e){let{mobile:t,docsPluginId:n,dropdownActiveClassDisabled:a,dropdownItemsBefore:o,dropdownItemsAfter:c,...u}=e;const{search:d,hash:f}=(0,l.TH)(),p=(0,Ue.Iw)(n),m=(0,Ue.gB)(n),{savePreferredVersionName:h}=(0,qe.J)(n),g=[...o,...m.map((e=>{const t=p.alternateDocVersions[e.name]??He(e);return{label:e.label,to:`${t.path}${d}${f}`,isActive:()=>e===p.activeVersion,onClick:()=>h(e.name)}})),...c],b=(0,$e.lO)(n)[0],v=t&&g.length>1?(0,s.I)({id:"theme.navbar.mobileVersionsDropdown.label",message:"Versions",description:"The label for the navbar versions dropdown on mobile view"}):b.label,y=t&&g.length>1?void 0:He(b).path;return g.length<=1?r.createElement(se,(0,i.Z)({},u,{mobile:t,label:v,to:y,isActive:a?()=>!1:void 0})):r.createElement(he,(0,i.Z)({},u,{mobile:t,label:v,to:y,items:g,isActive:a?()=>!1:void 0}))}};function Ze(e){let{type:t,...n}=e;const a=function(e,t){return e&&"default"!==e?e:"items"in t?"dropdown":"default"}(t,n),o=Ge[a];if(!o)throw new Error(`No NavbarItem component found for type "${t}".`);return r.createElement(o,n)}function Ve(){const e=(0,P.e)(),t=(0,w.L)().navbar.items;return r.createElement("ul",{className:"menu__list"},t.map(((t,n)=>r.createElement(Ze,(0,i.Z)({mobile:!0},t,{onClick:()=>e.toggle(),key:n})))))}function We(e){return r.createElement("button",(0,i.Z)({},e,{type:"button",className:"clean-btn navbar-sidebar__back"}),r.createElement(s.Z,{id:"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel",description:"The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)"},"\u2190 Back to main menu"))}function Ke(){const e=0===(0,w.L)().navbar.items.length,t=j();return r.createElement(r.Fragment,null,!e&&r.createElement(We,{onClick:()=>t.hide()}),t.content)}function Ye(){const e=(0,P.e)();var t;return void 0===(t=e.shown)&&(t=!0),(0,r.useEffect)((()=>(document.body.style.overflow=t?"hidden":"visible",()=>{document.body.style.overflow="visible"})),[t]),e.shouldRender?r.createElement(z,{header:r.createElement(J,null),primaryMenu:r.createElement(Ve,null),secondaryMenu:r.createElement(Ke,null)}):null}const Qe="navbarHideable_m1mJ",Xe="navbarHidden_jGov";function Je(e){return r.createElement("div",(0,i.Z)({role:"presentation"},e,{className:(0,a.Z)("navbar-sidebar__backdrop",e.className)}))}function et(e){let{children:t}=e;const{navbar:{hideOnScroll:n,style:o}}=(0,w.L)(),i=(0,P.e)(),{navbarRef:l,isNavbarVisible:u}=function(e){const[t,n]=(0,r.useState)(e),a=(0,r.useRef)(!1),o=(0,r.useRef)(0),i=(0,r.useCallback)((e=>{null!==e&&(o.current=e.getBoundingClientRect().height)}),[]);return(0,O.RF)(((t,r)=>{let{scrollY:i}=t;if(!e)return;if(i<o.current)return void n(!0);if(a.current)return void(a.current=!1);const l=null==r?void 0:r.scrollY,s=document.documentElement.scrollHeight-o.current,c=window.innerHeight;l&&i>=l?n(!1):i+c<s&&n(!0)})),(0,c.S)((t=>{if(!e)return;const r=t.location.hash;if(r?document.getElementById(r.substring(1)):void 0)return a.current=!0,void n(!1);n(!0)})),{navbarRef:i,isNavbarVisible:t}}(n);return r.createElement("nav",{ref:l,"aria-label":(0,s.I)({id:"theme.NavBar.navAriaLabel",message:"Main",description:"The ARIA label for the main navigation"}),className:(0,a.Z)("navbar","navbar--fixed-top",n&&[Qe,!u&&Xe],{"navbar--dark":"dark"===o,"navbar--primary":"primary"===o,"navbar-sidebar--show":i.shown})},t,r.createElement(Je,{onClick:i.toggle}),r.createElement(Ye,null))}var tt=n(8780);const nt="errorBoundaryError_a6uf";function rt(e){return r.createElement("button",(0,i.Z)({type:"button"},e),r.createElement(s.Z,{id:"theme.ErrorPageContent.tryAgain",description:"The label of the button to try again rendering when the React error boundary captures an error"},"Try again"))}function at(e){let{error:t}=e;const n=(0,tt.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return r.createElement("p",{className:nt},n)}class ot extends r.Component{componentDidCatch(e,t){throw this.props.onError(e,t)}render(){return this.props.children}}function it(e){let{width:t=30,height:n=30,className:a,...o}=e;return r.createElement("svg",(0,i.Z)({className:a,width:t,height:n,viewBox:"0 0 30 30","aria-hidden":"true"},o),r.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M4 7h22M4 15h22M4 23h22"}))}function lt(){const{toggle:e,shown:t}=(0,P.e)();return r.createElement("button",{onClick:e,"aria-label":(0,s.I)({id:"theme.docs.sidebar.toggleSidebarButtonAriaLabel",message:"Toggle navigation bar",description:"The ARIA label for hamburger menu button of mobile navigation"}),"aria-expanded":t,className:"navbar__toggle clean-btn",type:"button"},r.createElement(it,null))}const st="colorModeToggle_DEke";function ct(e){let{items:t}=e;return r.createElement(r.Fragment,null,t.map(((e,t)=>r.createElement(ot,{key:t,onError:t=>new Error(`A theme navbar item failed to render.\nPlease double-check the following navbar item (themeConfig.navbar.items) of your Docusaurus config:\n${JSON.stringify(e,null,2)}`,{cause:t})},r.createElement(Ze,e)))))}function ut(e){let{left:t,right:n}=e;return r.createElement("div",{className:"navbar__inner"},r.createElement("div",{className:"navbar__items"},t),r.createElement("div",{className:"navbar__items navbar__items--right"},n))}function dt(){const e=(0,P.e)(),t=(0,w.L)().navbar.items,[n,a]=function(e){function t(e){return"left"===(e.position??"right")}return[e.filter(t),e.filter((e=>!t(e)))]}(t),o=t.find((e=>"search"===e.type));return r.createElement(ut,{left:r.createElement(r.Fragment,null,!e.disabled&&r.createElement(lt,null),r.createElement(Q,null),r.createElement(ct,{items:n})),right:r.createElement(r.Fragment,null,r.createElement(ct,{items:a}),r.createElement(K,{className:st}),!o&&r.createElement(ze,null,r.createElement(Be,null)))})}function ft(){return r.createElement(et,null,r.createElement(dt,null))}function pt(e){let{item:t}=e;const{to:n,href:a,label:o,prependBaseUrlToHref:l,...s}=t,c=(0,te.Z)(n),u=(0,te.Z)(a,{forcePrependBaseUrl:!0});return r.createElement(ee.Z,(0,i.Z)({className:"footer__link-item"},a?{href:l?u:a}:{to:c},s),o,a&&!(0,ne.Z)(a)&&r.createElement(ae.Z,null))}function mt(e){let{item:t}=e;return t.html?r.createElement("li",{className:"footer__item",dangerouslySetInnerHTML:{__html:t.html}}):r.createElement("li",{key:t.href??t.to,className:"footer__item"},r.createElement(pt,{item:t}))}function ht(e){let{column:t}=e;return r.createElement("div",{className:"col footer__col"},r.createElement("div",{className:"footer__title"},t.title),r.createElement("ul",{className:"footer__items clean-list"},t.items.map(((e,t)=>r.createElement(mt,{key:t,item:e})))))}function gt(e){let{columns:t}=e;return r.createElement("div",{className:"row footer__links"},t.map(((e,t)=>r.createElement(ht,{key:t,column:e}))))}function bt(){return r.createElement("span",{className:"footer__link-separator"},"\xb7")}function vt(e){let{item:t}=e;return t.html?r.createElement("span",{className:"footer__link-item",dangerouslySetInnerHTML:{__html:t.html}}):r.createElement(pt,{item:t})}function yt(e){let{links:t}=e;return r.createElement("div",{className:"footer__links text--center"},r.createElement("div",{className:"footer__links"},t.map(((e,n)=>r.createElement(r.Fragment,{key:n},r.createElement(vt,{item:e}),t.length!==n+1&&r.createElement(bt,null))))))}function wt(e){let{links:t}=e;return function(e){return"title"in e[0]}(t)?r.createElement(gt,{columns:t}):r.createElement(yt,{links:t})}var kt=n(941);const Et="footerLogoLink_BH7S";function St(e){let{logo:t}=e;const{withBaseUrl:n}=(0,te.C)(),o={light:n(t.src),dark:n(t.srcDark??t.src)};return r.createElement(kt.Z,{className:(0,a.Z)("footer__logo",t.className),alt:t.alt,sources:o,width:t.width,height:t.height,style:t.style})}function xt(e){let{logo:t}=e;return t.href?r.createElement(ee.Z,{href:t.href,className:Et,target:t.target},r.createElement(St,{logo:t})):r.createElement(St,{logo:t})}function Ct(e){let{copyright:t}=e;return r.createElement("div",{className:"footer__copyright",dangerouslySetInnerHTML:{__html:t}})}function Tt(e){let{style:t,links:n,logo:o,copyright:i}=e;return r.createElement("footer",{className:(0,a.Z)("footer",{"footer--dark":"dark"===t})},r.createElement("div",{className:"container container-fluid"},n,(o||i)&&r.createElement("div",{className:"footer__bottom text--center"},o&&r.createElement("div",{className:"margin-bottom--sm"},o),i)))}function _t(){const{footer:e}=(0,w.L)();if(!e)return null;const{copyright:t,links:n,logo:a,style:o}=e;return r.createElement(Tt,{style:o,links:n&&n.length>0&&r.createElement(wt,{links:n}),logo:a&&r.createElement(xt,{logo:a}),copyright:t&&r.createElement(Ct,{copyright:t})})}const At=r.memo(_t),Lt=(0,I.Qc)([U.S,k.pl,O.OC,qe.L5,h.VC,function(e){let{children:t}=e;return r.createElement(D.n2,null,r.createElement(P.M,null,r.createElement(F,null,t)))}]);function Rt(e){let{children:t}=e;return r.createElement(Lt,null,t)}function Nt(e){let{error:t,tryAgain:n}=e;return r.createElement("main",{className:"container margin-vert--xl"},r.createElement("div",{className:"row"},r.createElement("div",{className:"col col--6 col--offset-3"},r.createElement("h1",{className:"hero__title"},r.createElement(s.Z,{id:"theme.ErrorPageContent.title",description:"The title of the fallback page when the page crashed"},"This page crashed.")),r.createElement("div",{className:"margin-vert--lg"},r.createElement(rt,{onClick:n,className:"button button--primary shadow--lw"})),r.createElement("hr",null),r.createElement("div",{className:"margin-vert--md"},r.createElement(at,{error:t})))))}const Pt="mainWrapper_z2l0";function Ot(e){const{children:t,noFooter:n,wrapperClassName:i,title:l,description:s}=e;return(0,b.t)(),r.createElement(Rt,null,r.createElement(h.d,{title:l,description:s}),r.createElement(y,null),r.createElement(N,null),r.createElement(ft,null),r.createElement("div",{id:u,className:(0,a.Z)(g.k.wrapper.main,Pt,i)},r.createElement(o.Z,{fallback:e=>r.createElement(Nt,e)},t)),!n&&r.createElement(At,null))}},1327:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(7462),a=n(7294),o=n(9960),i=n(4996),l=n(2263),s=n(6668),c=n(941);function u(e){let{logo:t,alt:n,imageClassName:r}=e;const o={light:(0,i.Z)(t.src),dark:(0,i.Z)(t.srcDark||t.src)},l=a.createElement(c.Z,{className:t.className,sources:o,height:t.height,width:t.width,alt:n,style:t.style});return r?a.createElement("div",{className:r},l):l}function d(e){const{siteConfig:{title:t}}=(0,l.Z)(),{navbar:{title:n,logo:c}}=(0,s.L)(),{imageClassName:d,titleClassName:f,...p}=e,m=(0,i.Z)((null==c?void 0:c.href)||"/"),h=n?"":t,g=(null==c?void 0:c.alt)??h;return a.createElement(o.Z,(0,r.Z)({to:m},p,(null==c?void 0:c.target)&&{target:c.target}),c&&a.createElement(u,{logo:c,alt:g,imageClassName:d}),null!=n&&a.createElement("b",{className:f},n))}},197:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294),a=n(5742);function o(e){let{locale:t,version:n,tag:o}=e;const i=t;return r.createElement(a.Z,null,t&&r.createElement("meta",{name:"docusaurus_locale",content:t}),n&&r.createElement("meta",{name:"docusaurus_version",content:n}),o&&r.createElement("meta",{name:"docusaurus_tag",content:o}),i&&r.createElement("meta",{name:"docsearch:language",content:i}),n&&r.createElement("meta",{name:"docsearch:version",content:n}),o&&r.createElement("meta",{name:"docsearch:docusaurus_tag",content:o}))}},941:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(7462),a=n(7294),o=n(6010),i=n(2389),l=n(2949);const s={themedImage:"themedImage_ToTc","themedImage--light":"themedImage--light_HNdA","themedImage--dark":"themedImage--dark_i4oU"};function c(e){const t=(0,i.Z)(),{colorMode:n}=(0,l.I)(),{sources:c,className:u,alt:d,...f}=e,p=t?"dark"===n?["dark"]:["light"]:["light","dark"];return a.createElement(a.Fragment,null,p.map((e=>a.createElement("img",(0,r.Z)({key:e,src:c[e],alt:d,className:(0,o.Z)(s.themedImage,s[`themedImage--${e}`],u)},f)))))}},6043:(e,t,n)=>{"use strict";n.d(t,{u:()=>i,z:()=>h});var r=n(7462),a=n(7294),o=n(412);function i(e){let{initialState:t}=e;const[n,r]=(0,a.useState)(t??!1),o=(0,a.useCallback)((()=>{r((e=>!e))}),[]);return{collapsed:n,setCollapsed:r,toggleCollapsed:o}}const l={display:"none",overflow:"hidden",height:"0px"},s={display:"block",overflow:"visible",height:"auto"};function c(e,t){const n=t?l:s;e.style.display=n.display,e.style.overflow=n.overflow,e.style.height=n.height}function u(e){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return 0;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}function d(e){let{collapsibleRef:t,collapsed:n,animation:r}=e;const o=(0,a.useRef)(!1);(0,a.useEffect)((()=>{const e=t.current;function a(){const t=function(){const t=e.scrollHeight;return{transition:`height ${(null==r?void 0:r.duration)??u(t)}ms ${(null==r?void 0:r.easing)??"ease-in-out"}`,height:`${t}px`}}();e.style.transition=t.transition,e.style.height=t.height}if(!o.current)return c(e,n),void(o.current=!0);return e.style.willChange="height",function(){const t=requestAnimationFrame((()=>{n?(a(),requestAnimationFrame((()=>{e.style.height=l.height,e.style.overflow=l.overflow}))):(e.style.display="block",requestAnimationFrame((()=>{a()})))}));return()=>cancelAnimationFrame(t)}()}),[t,n,r])}function f(e){if(!o.Z.canUseDOM)return e?l:s}function p(e){let{as:t="div",collapsed:n,children:r,animation:o,onCollapseTransitionEnd:i,className:l,disableSSRStyle:s}=e;const u=(0,a.useRef)(null);return d({collapsibleRef:u,collapsed:n,animation:o}),a.createElement(t,{ref:u,style:s?void 0:f(n),onTransitionEnd:e=>{"height"===e.propertyName&&(c(u.current,n),null==i||i(n))},className:l},r)}function m(e){let{collapsed:t,...n}=e;const[o,i]=(0,a.useState)(!t),[l,s]=(0,a.useState)(t);return(0,a.useLayoutEffect)((()=>{t||i(!0)}),[t]),(0,a.useLayoutEffect)((()=>{o&&s(t)}),[o,t]),o?a.createElement(p,(0,r.Z)({},n,{collapsed:l})):null}function h(e){let{lazy:t,...n}=e;const r=t?m:p;return a.createElement(r,n)}},9689:(e,t,n)=>{"use strict";n.d(t,{nT:()=>m,pl:()=>p});var r=n(7294),a=n(2389),o=n(12),i=n(902),l=n(6668);const s=(0,o.WA)("docusaurus.announcement.dismiss"),c=(0,o.WA)("docusaurus.announcement.id"),u=()=>"true"===s.get(),d=e=>s.set(String(e)),f=r.createContext(null);function p(e){let{children:t}=e;const n=function(){const{announcementBar:e}=(0,l.L)(),t=(0,a.Z)(),[n,o]=(0,r.useState)((()=>!!t&&u()));(0,r.useEffect)((()=>{o(u())}),[]);const i=(0,r.useCallback)((()=>{d(!0),o(!0)}),[]);return(0,r.useEffect)((()=>{if(!e)return;const{id:t}=e;let n=c.get();"annoucement-bar"===n&&(n="announcement-bar");const r=t!==n;c.set(t),r&&d(!1),!r&&u()||o(!1)}),[e]),(0,r.useMemo)((()=>({isActive:!!e&&!n,close:i})),[e,n,i])}();return r.createElement(f.Provider,{value:n},t)}function m(){const e=(0,r.useContext)(f);if(!e)throw new i.i6("AnnouncementBarProvider");return e}},2949:(e,t,n)=>{"use strict";n.d(t,{I:()=>g,S:()=>h});var r=n(7294),a=n(412),o=n(902),i=n(12),l=n(6668);const s=r.createContext(void 0),c="theme",u=(0,i.WA)(c),d="light",f="dark",p=e=>e===f?f:d;function m(){const{colorMode:{defaultMode:e,disableSwitch:t,respectPrefersColorScheme:n}}=(0,l.L)(),[o,i]=(0,r.useState)((e=>a.Z.canUseDOM?p(document.documentElement.getAttribute("data-theme")):p(e))(e));(0,r.useEffect)((()=>{t&&u.del()}),[t]);const s=(0,r.useCallback)((function(t,r){void 0===r&&(r={});const{persist:a=!0}=r;t?(i(t),a&&(e=>{u.set(p(e))})(t)):(i(n?window.matchMedia("(prefers-color-scheme: dark)").matches?f:d:e),u.del())}),[n,e]);(0,r.useEffect)((()=>{document.documentElement.setAttribute("data-theme",p(o))}),[o]),(0,r.useEffect)((()=>{if(t)return;const e=e=>{if(e.key!==c)return;const t=u.get();null!==t&&s(p(t))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}),[t,s]);const m=(0,r.useRef)(!1);return(0,r.useEffect)((()=>{if(t&&!n)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{window.matchMedia("print").matches||m.current?m.current=window.matchMedia("print").matches:s(null)};return e.addListener(r),()=>e.removeListener(r)}),[s,t,n]),(0,r.useMemo)((()=>({colorMode:o,setColorMode:s,get isDarkTheme(){return o===f},setLightTheme(){s(d)},setDarkTheme(){s(f)}})),[o,s])}function h(e){let{children:t}=e;const n=m();return r.createElement(s.Provider,{value:n},t)}function g(){const e=(0,r.useContext)(s);if(null==e)throw new o.i6("ColorModeProvider","Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.");return e}},373:(e,t,n)=>{"use strict";n.d(t,{J:()=>y,L5:()=>b,Oh:()=>w});var r=n(7294),a=n(143),o=n(9935),i=n(6668),l=n(3438),s=n(902),c=n(12);const u=e=>`docs-preferred-version-${e}`,d=(e,t,n)=>{(0,c.WA)(u(e),{persistence:t}).set(n)},f=(e,t)=>(0,c.WA)(u(e),{persistence:t}).get(),p=(e,t)=>{(0,c.WA)(u(e),{persistence:t}).del()};const m=r.createContext(null);function h(){const e=(0,a._r)(),t=(0,i.L)().docs.versionPersistence,n=(0,r.useMemo)((()=>Object.keys(e)),[e]),[o,l]=(0,r.useState)((()=>(e=>Object.fromEntries(e.map((e=>[e,{preferredVersionName:null}]))))(n)));(0,r.useEffect)((()=>{l(function(e){let{pluginIds:t,versionPersistence:n,allDocsData:r}=e;function a(e){const t=f(e,n);return r[e].versions.some((e=>e.name===t))?{preferredVersionName:t}:(p(e,n),{preferredVersionName:null})}return Object.fromEntries(t.map((e=>[e,a(e)])))}({allDocsData:e,versionPersistence:t,pluginIds:n}))}),[e,t,n]);return[o,(0,r.useMemo)((()=>({savePreferredVersion:function(e,n){d(e,t,n),l((t=>({...t,[e]:{preferredVersionName:n}})))}})),[t])]}function g(e){let{children:t}=e;const n=h();return r.createElement(m.Provider,{value:n},t)}function b(e){let{children:t}=e;return l.cE?r.createElement(g,null,t):r.createElement(r.Fragment,null,t)}function v(){const e=(0,r.useContext)(m);if(!e)throw new s.i6("DocsPreferredVersionContextProvider");return e}function y(e){void 0===e&&(e=o.m);const t=(0,a.zh)(e),[n,i]=v(),{preferredVersionName:l}=n[e];return{preferredVersion:t.versions.find((e=>e.name===l))??null,savePreferredVersionName:(0,r.useCallback)((t=>{i.savePreferredVersion(e,t)}),[i,e])}}function w(){const e=(0,a._r)(),[t]=v();function n(n){const r=e[n],{preferredVersionName:a}=t[n];return r.versions.find((e=>e.name===a))??null}const r=Object.keys(e);return Object.fromEntries(r.map((e=>[e,n(e)])))}},1116:(e,t,n)=>{"use strict";n.d(t,{V:()=>s,b:()=>l});var r=n(7294),a=n(902);const o=Symbol("EmptyContext"),i=r.createContext(o);function l(e){let{children:t,name:n,items:a}=e;const o=(0,r.useMemo)((()=>n&&a?{name:n,items:a}:null),[n,a]);return r.createElement(i.Provider,{value:o},t)}function s(){const e=(0,r.useContext)(i);if(e===o)throw new a.i6("DocsSidebarProvider");return e}},3163:(e,t,n)=>{"use strict";n.d(t,{M:()=>d,e:()=>f});var r=n(7294),a=n(3102),o=n(7524),i=n(1980),l=n(6668),s=n(902);const c=r.createContext(void 0);function u(){const e=function(){const e=(0,a.HY)(),{items:t}=(0,l.L)().navbar;return 0===t.length&&!e.component}(),t=(0,o.i)(),n=!e&&"mobile"===t,[s,c]=(0,r.useState)(!1);(0,i.Rb)((()=>{if(s)return c(!1),!1}));const u=(0,r.useCallback)((()=>{c((e=>!e))}),[]);return(0,r.useEffect)((()=>{"desktop"===t&&c(!1)}),[t]),(0,r.useMemo)((()=>({disabled:e,shouldRender:n,toggle:u,shown:s})),[e,n,u,s])}function d(e){let{children:t}=e;const n=u();return r.createElement(c.Provider,{value:n},t)}function f(){const e=r.useContext(c);if(void 0===e)throw new s.i6("NavbarMobileSidebarProvider");return e}},3102:(e,t,n)=>{"use strict";n.d(t,{HY:()=>l,Zo:()=>s,n2:()=>i});var r=n(7294),a=n(902);const o=r.createContext(null);function i(e){let{children:t}=e;const n=(0,r.useState)({component:null,props:null});return r.createElement(o.Provider,{value:n},t)}function l(){const e=(0,r.useContext)(o);if(!e)throw new a.i6("NavbarSecondaryMenuContentProvider");return e[0]}function s(e){let{component:t,props:n}=e;const i=(0,r.useContext)(o);if(!i)throw new a.i6("NavbarSecondaryMenuContentProvider");const[,l]=i,s=(0,a.Ql)(n);return(0,r.useEffect)((()=>{l({component:t,props:s})}),[l,t,s]),(0,r.useEffect)((()=>()=>l({component:null,props:null})),[l]),null}},9727:(e,t,n)=>{"use strict";n.d(t,{h:()=>a,t:()=>o});var r=n(7294);const a="navigation-with-keyboard";function o(){(0,r.useEffect)((()=>{function e(e){"keydown"===e.type&&"Tab"===e.key&&document.body.classList.add(a),"mousedown"===e.type&&document.body.classList.remove(a)}return document.addEventListener("keydown",e),document.addEventListener("mousedown",e),()=>{document.body.classList.remove(a),document.removeEventListener("keydown",e),document.removeEventListener("mousedown",e)}}),[])}},6177:(e,t,n)=>{"use strict";n.d(t,{K:()=>i,M:()=>l});var r=n(7294),a=n(2263),o=n(1980);function i(){return(0,o.Nc)("q")}function l(){const{siteConfig:{baseUrl:e,themeConfig:t}}=(0,a.Z)(),{algolia:{searchPagePath:n}}=t;return(0,r.useCallback)((t=>`${e}${n}?q=${encodeURIComponent(t)}`),[e,n])}},7524:(e,t,n)=>{"use strict";n.d(t,{i:()=>c});var r=n(7294),a=n(412);const o="desktop",i="mobile",l="ssr";function s(){return a.Z.canUseDOM?window.innerWidth>996?o:i:l}function c(){const[e,t]=(0,r.useState)((()=>s()));return(0,r.useEffect)((()=>{function e(){t(s())}return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e),clearTimeout(undefined)}}),[]),e}},5281:(e,t,n)=>{"use strict";n.d(t,{k:()=>r});const r={page:{blogListPage:"blog-list-page",blogPostPage:"blog-post-page",blogTagsListPage:"blog-tags-list-page",blogTagPostListPage:"blog-tags-post-list-page",docsDocPage:"docs-doc-page",docsTagsListPage:"docs-tags-list-page",docsTagDocListPage:"docs-tags-doc-list-page",mdxPage:"mdx-page"},wrapper:{main:"main-wrapper",blogPages:"blog-wrapper",docsPages:"docs-wrapper",mdxPages:"mdx-wrapper"},common:{editThisPage:"theme-edit-this-page",lastUpdated:"theme-last-updated",backToTopButton:"theme-back-to-top-button",codeBlock:"theme-code-block",admonition:"theme-admonition",admonitionType:e=>`theme-admonition-${e}`},layout:{},docs:{docVersionBanner:"theme-doc-version-banner",docVersionBadge:"theme-doc-version-badge",docBreadcrumbs:"theme-doc-breadcrumbs",docMarkdown:"theme-doc-markdown",docTocMobile:"theme-doc-toc-mobile",docTocDesktop:"theme-doc-toc-desktop",docFooter:"theme-doc-footer",docFooterTagsRow:"theme-doc-footer-tags-row",docFooterEditMetaRow:"theme-doc-footer-edit-meta-row",docSidebarContainer:"theme-doc-sidebar-container",docSidebarMenu:"theme-doc-sidebar-menu",docSidebarItemCategory:"theme-doc-sidebar-item-category",docSidebarItemLink:"theme-doc-sidebar-item-link",docSidebarItemCategoryLevel:e=>`theme-doc-sidebar-item-category-level-${e}`,docSidebarItemLinkLevel:e=>`theme-doc-sidebar-item-link-level-${e}`},blog:{}}},3438:(e,t,n)=>{"use strict";n.d(t,{Wl:()=>f,_F:()=>m,cE:()=>d,hI:()=>w,lO:()=>b,oz:()=>v,s1:()=>g,vY:()=>y});var r=n(7294),a=n(6775),o=n(8790),i=n(143),l=n(373),s=n(1116),c=n(7392),u=n(8596);const d=!!i._r;function f(e){if(e.href)return e.href;for(const t of e.items){if("link"===t.type)return t.href;if("category"===t.type){const e=f(t);if(e)return e}}}const p=(e,t)=>void 0!==e&&(0,u.Mg)(e,t);function m(e,t){return"link"===e.type?p(e.href,t):"category"===e.type&&(p(e.href,t)||((e,t)=>e.some((e=>m(e,t))))(e.items,t))}function h(e){let{sidebarItems:t,pathname:n,onlyCategories:r=!1}=e;const a=[];return function e(t){for(const o of t)if("category"===o.type&&((0,u.Mg)(o.href,n)||e(o.items))||"link"===o.type&&(0,u.Mg)(o.href,n)){return r&&"category"!==o.type||a.unshift(o),!0}return!1}(t),a}function g(){var e;const t=(0,s.V)(),{pathname:n}=(0,a.TH)();return!1!==(null==(e=(0,i.gA)())?void 0:e.pluginData.breadcrumbs)&&t?h({sidebarItems:t.items,pathname:n}):null}function b(e){const{activeVersion:t}=(0,i.Iw)(e),{preferredVersion:n}=(0,l.J)(e),a=(0,i.yW)(e);return(0,r.useMemo)((()=>(0,c.j)([t,n,a].filter(Boolean))),[t,n,a])}function v(e,t){const n=b(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.sidebars?Object.entries(e.sidebars):[])),r=t.find((t=>t[0]===e));if(!r)throw new Error(`Can't find any sidebar with id "${e}" in version${n.length>1?"s":""} ${n.map((e=>e.name)).join(", ")}".\nAvailable sidebar ids are:\n- ${Object.keys(t).join("\n- ")}`);return r[1]}),[e,n])}function y(e,t){const n=b(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.docs)),r=t.find((t=>t.id===e));if(!r){if(n.flatMap((e=>e.draftIds)).includes(e))return null;throw new Error(`Couldn't find any doc with id "${e}" in version${n.length>1?"s":""} "${n.map((e=>e.name)).join(", ")}".\nAvailable doc ids are:\n- ${(0,c.j)(t.map((e=>e.id))).join("\n- ")}`)}return r}),[e,n])}function w(e){let{route:t,versionMetadata:n}=e;const r=(0,a.TH)(),i=t.routes,l=i.find((e=>(0,a.LX)(r.pathname,e)));if(!l)return null;const s=l.sidebar,c=s?n.docsSidebars[s]:void 0;return{docElement:(0,o.H)(i),sidebarName:s,sidebarItems:c}}},2128:(e,t,n)=>{"use strict";n.d(t,{p:()=>a});var r=n(2263);function a(e){const{siteConfig:t}=(0,r.Z)(),{title:n,titleDelimiter:a}=t;return null!=e&&e.trim().length?`${e.trim()} ${a} ${n}`:n}},1980:(e,t,n)=>{"use strict";n.d(t,{Nc:()=>c,Rb:()=>l,_X:()=>s});var r=n(7294),a=n(6775),o=n(1688),i=n(902);function l(e){!function(e){const t=(0,a.k6)(),n=(0,i.zX)(e);(0,r.useEffect)((()=>t.block(((e,t)=>n(e,t)))),[t,n])}(((t,n)=>{if("POP"===n)return e(t,n)}))}function s(e){return function(e){const t=(0,a.k6)();return(0,o.useSyncExternalStore)(t.listen,(()=>e(t)),(()=>e(t)))}((t=>null===e?null:new URLSearchParams(t.location.search).get(e)))}function c(e){const t=s(e)??"",n=function(){const e=(0,a.k6)();return(0,r.useCallback)(((t,n,r)=>{const a=new URLSearchParams(e.location.search);n?a.set(t,n):a.delete(t),(null!=r&&r.push?e.push:e.replace)({search:a.toString()})}),[e])}();return[t,(0,r.useCallback)(((t,r)=>{n(e,t,r)}),[n,e])]}},7392:(e,t,n)=>{"use strict";function r(e,t){return void 0===t&&(t=(e,t)=>e===t),e.filter(((n,r)=>e.findIndex((e=>t(e,n)))!==r))}function a(e){return Array.from(new Set(e))}n.d(t,{j:()=>a,l:()=>r})},833:(e,t,n)=>{"use strict";n.d(t,{FG:()=>f,d:()=>u,VC:()=>p});var r=n(7294),a=n(6010),o=n(5742),i=n(226);function l(){const e=r.useContext(i._);if(!e)throw new Error("Unexpected: no Docusaurus route context found");return e}var s=n(4996),c=n(2128);function u(e){let{title:t,description:n,keywords:a,image:i,children:l}=e;const u=(0,c.p)(t),{withBaseUrl:d}=(0,s.C)(),f=i?d(i,{absolute:!0}):void 0;return r.createElement(o.Z,null,t&&r.createElement("title",null,u),t&&r.createElement("meta",{property:"og:title",content:u}),n&&r.createElement("meta",{name:"description",content:n}),n&&r.createElement("meta",{property:"og:description",content:n}),a&&r.createElement("meta",{name:"keywords",content:Array.isArray(a)?a.join(","):a}),f&&r.createElement("meta",{property:"og:image",content:f}),f&&r.createElement("meta",{name:"twitter:image",content:f}),l)}const d=r.createContext(void 0);function f(e){let{className:t,children:n}=e;const i=r.useContext(d),l=(0,a.Z)(i,t);return r.createElement(d.Provider,{value:l},r.createElement(o.Z,null,r.createElement("html",{className:l})),n)}function p(e){let{children:t}=e;const n=l(),o=`plugin-${n.plugin.name.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi,"")}`;const i=`plugin-id-${n.plugin.id}`;return r.createElement(f,{className:(0,a.Z)(o,i)},t)}},902:(e,t,n)=>{"use strict";n.d(t,{D9:()=>i,Qc:()=>c,Ql:()=>s,i6:()=>l,zX:()=>o});var r=n(7294);const a=n(412).Z.canUseDOM?r.useLayoutEffect:r.useEffect;function o(e){const t=(0,r.useRef)(e);return a((()=>{t.current=e}),[e]),(0,r.useCallback)((function(){return t.current(...arguments)}),[])}function i(e){const t=(0,r.useRef)();return a((()=>{t.current=e})),t.current}class l extends Error{constructor(e,t){var n,r,a;super(),this.name="ReactContextError",this.message=`Hook ${(null==(n=this.stack)||null==(r=n.split("\n")[1])||null==(a=r.match(/at (?:\w+\.)?(?<name>\w+)/))?void 0:a.groups.name)??""} is called outside the <${e}>. ${t??""}`}}function s(e){const t=Object.entries(e);return t.sort(((e,t)=>e[0].localeCompare(t[0]))),(0,r.useMemo)((()=>e),t.flat())}function c(e){return t=>{let{children:n}=t;return r.createElement(r.Fragment,null,e.reduceRight(((e,t)=>r.createElement(t,null,e)),n))}}},8022:(e,t,n)=>{"use strict";function r(e,t){return void 0!==e&&void 0!==t&&new RegExp(e,"gi").test(t)}n.d(t,{F:()=>r})},8596:(e,t,n)=>{"use strict";n.d(t,{Mg:()=>i,Ns:()=>l});var r=n(7294),a=n(723),o=n(2263);function i(e,t){const n=e=>{var t;return null==(t=!e||e.endsWith("/")?e:`${e}/`)?void 0:t.toLowerCase()};return n(e)===n(t)}function l(){const{baseUrl:e}=(0,o.Z)().siteConfig;return(0,r.useMemo)((()=>function(e){let{baseUrl:t,routes:n}=e;function r(e){return e.path===t&&!0===e.exact}function a(e){return e.path===t&&!e.exact}return function e(t){if(0===t.length)return;return t.find(r)||e(t.filter(a).flatMap((e=>e.routes??[])))}(n)}({routes:a.Z,baseUrl:e})),[e])}},2466:(e,t,n)=>{"use strict";n.d(t,{Ct:()=>p,OC:()=>s,RF:()=>d,o5:()=>f});var r=n(7294),a=n(412),o=n(2389),i=n(902);const l=r.createContext(void 0);function s(e){let{children:t}=e;const n=function(){const e=(0,r.useRef)(!0);return(0,r.useMemo)((()=>({scrollEventsEnabledRef:e,enableScrollEvents:()=>{e.current=!0},disableScrollEvents:()=>{e.current=!1}})),[])}();return r.createElement(l.Provider,{value:n},t)}function c(){const e=(0,r.useContext)(l);if(null==e)throw new i.i6("ScrollControllerProvider");return e}const u=()=>a.Z.canUseDOM?{scrollX:window.pageXOffset,scrollY:window.pageYOffset}:null;function d(e,t){void 0===t&&(t=[]);const{scrollEventsEnabledRef:n}=c(),a=(0,r.useRef)(u()),o=(0,i.zX)(e);(0,r.useEffect)((()=>{const e=()=>{if(!n.current)return;const e=u();o(e,a.current),a.current=e},t={passive:!0};return e(),window.addEventListener("scroll",e,t),()=>window.removeEventListener("scroll",e,t)}),[o,n,...t])}function f(){const e=c(),t=function(){const e=(0,r.useRef)({elem:null,top:0}),t=(0,r.useCallback)((t=>{e.current={elem:t,top:t.getBoundingClientRect().top}}),[]),n=(0,r.useCallback)((()=>{const{current:{elem:t,top:n}}=e;if(!t)return{restored:!1};const r=t.getBoundingClientRect().top-n;return r&&window.scrollBy({left:0,top:r}),e.current={elem:null,top:0},{restored:0!==r}}),[]);return(0,r.useMemo)((()=>({save:t,restore:n})),[n,t])}(),n=(0,r.useRef)(void 0),a=(0,r.useCallback)((r=>{t.save(r),e.disableScrollEvents(),n.current=()=>{const{restored:r}=t.restore();if(n.current=void 0,r){const t=()=>{e.enableScrollEvents(),window.removeEventListener("scroll",t)};window.addEventListener("scroll",t)}else e.enableScrollEvents()}}),[e,t]);return(0,r.useLayoutEffect)((()=>{queueMicrotask((()=>null==n.current?void 0:n.current()))})),{blockElementScrollPositionUntilNextRender:a}}function p(){const e=(0,r.useRef)(null),t=(0,o.Z)()&&"smooth"===getComputedStyle(document.documentElement).scrollBehavior;return{startScroll:n=>{e.current=t?function(e){return window.scrollTo({top:e,behavior:"smooth"}),()=>{}}(n):function(e){let t=null;const n=document.documentElement.scrollTop>e;return function r(){const a=document.documentElement.scrollTop;(n&&a>e||!n&&a<e)&&(t=requestAnimationFrame(r),window.scrollTo(0,Math.floor(.85*(a-e))+e))}(),()=>t&&cancelAnimationFrame(t)}(n)},cancelScroll:()=>null==e.current?void 0:e.current()}}},3320:(e,t,n)=>{"use strict";n.d(t,{HX:()=>i,_q:()=>s,os:()=>l});var r=n(143),a=n(2263),o=n(373);const i="default";function l(e,t){return`docs-${e}-${t}`}function s(){const{i18n:e}=(0,a.Z)(),t=(0,r._r)(),n=(0,r.WS)(),s=(0,o.Oh)();const c=[i,...Object.keys(t).map((function(e){const r=(null==n?void 0:n.activePlugin.pluginId)===e?n.activeVersion:void 0,a=s[e],o=t[e].versions.find((e=>e.isLast));return l(e,(r??a??o).name)}))];return{locale:e.currentLocale,tags:c}}},12:(e,t,n)=>{"use strict";n.d(t,{Nk:()=>d,WA:()=>u});var r=n(7294),a=n(1688);const o="localStorage";function i(e){let{key:t,oldValue:n,newValue:r,storage:a}=e;if(n===r)return;const o=document.createEvent("StorageEvent");o.initStorageEvent("storage",!1,!1,t,n,r,window.location.href,a),window.dispatchEvent(o)}function l(e){if(void 0===e&&(e=o),"undefined"==typeof window)throw new Error("Browser storage is not available on Node.js/Docusaurus SSR process.");if("none"===e)return null;try{return window[e]}catch(n){return t=n,s||(console.warn("Docusaurus browser storage is not available.\nPossible reasons: running Docusaurus in an iframe, in an incognito browser session, or using too strict browser privacy settings.",t),s=!0),null}var t}let s=!1;const c={get:()=>null,set:()=>{},del:()=>{},listen:()=>()=>{}};function u(e,t){if("undefined"==typeof window)return function(e){function t(){throw new Error(`Illegal storage API usage for storage key "${e}".\nDocusaurus storage APIs are not supposed to be called on the server-rendering process.\nPlease only call storage APIs in effects and event handlers.`)}return{get:t,set:t,del:t,listen:t}}(e);const n=l(null==t?void 0:t.persistence);return null===n?c:{get:()=>{try{return n.getItem(e)}catch(t){return console.error(`Docusaurus storage error, can't get key=${e}`,t),null}},set:t=>{try{const r=n.getItem(e);n.setItem(e,t),i({key:e,oldValue:r,newValue:t,storage:n})}catch(r){console.error(`Docusaurus storage error, can't set ${e}=${t}`,r)}},del:()=>{try{const t=n.getItem(e);n.removeItem(e),i({key:e,oldValue:t,newValue:null,storage:n})}catch(t){console.error(`Docusaurus storage error, can't delete key=${e}`,t)}},listen:t=>{try{const r=r=>{r.storageArea===n&&r.key===e&&t(r)};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)}catch(r){return console.error(`Docusaurus storage error, can't listen for changes of key=${e}`,r),()=>{}}}}}function d(e,t){const n=(0,r.useRef)((()=>null===e?c:u(e,t))).current(),o=(0,r.useCallback)((e=>"undefined"==typeof window?()=>{}:n.listen(e)),[n]);return[(0,a.useSyncExternalStore)(o,(()=>"undefined"==typeof window?null:n.get()),(()=>null)),n]}},4711:(e,t,n)=>{"use strict";n.d(t,{l:()=>o});var r=n(2263),a=n(6775);function o(){const{siteConfig:{baseUrl:e,url:t},i18n:{defaultLocale:n,currentLocale:o}}=(0,r.Z)(),{pathname:i}=(0,a.TH)(),l=o===n?e:e.replace(`/${o}/`,"/"),s=i.replace(e,"");return{createUrl:function(e){let{locale:r,fullyQualified:a}=e;return`${a?t:""}${function(e){return e===n?`${l}`:`${l}${e}/`}(r)}${s}`}}}},5936:(e,t,n)=>{"use strict";n.d(t,{S:()=>i});var r=n(7294),a=n(6775),o=n(902);function i(e){const t=(0,a.TH)(),n=(0,o.D9)(t),i=(0,o.zX)(e);(0,r.useEffect)((()=>{n&&t!==n&&i({location:t,previousLocation:n})}),[i,t,n])}},6668:(e,t,n)=>{"use strict";n.d(t,{L:()=>a});var r=n(2263);function a(){return(0,r.Z)().siteConfig.themeConfig}},6278:(e,t,n)=>{"use strict";n.d(t,{L:()=>a});var r=n(2263);function a(){const{siteConfig:{themeConfig:e}}=(0,r.Z)();return e}},239:(e,t,n)=>{"use strict";n.d(t,{l:()=>l});var r=n(7294),a=n(8022),o=n(4996),i=n(6278);function l(){const{withBaseUrl:e}=(0,o.C)(),{algolia:{externalUrlRegex:t,replaceSearchResultPathname:n}}=(0,i.L)();return(0,r.useCallback)((r=>{const o=new URL(r);if((0,a.F)(t,o.href))return r;const i=`${o.pathname+o.hash}`;return e(function(e,t){return t?e.replaceAll(new RegExp(t.from,"g"),t.to):e}(i,n))}),[e,t,n])}},8802:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const{trailingSlash:n,baseUrl:r}=t;if(e.startsWith("#"))return e;if(void 0===n)return e;const[a]=e.split(/[#?]/),o="/"===a||a===r?a:(i=a,n?function(e){return e.endsWith("/")?e:`${e}/`}(i):function(e){return e.endsWith("/")?e.slice(0,-1):e}(i));var i;return e.replace(a,o)}},4143:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=void 0,t.getErrorCausalChain=function e(t){return t.cause?[t,...e(t.cause)]:[t]}},8780:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=t.applyTrailingSlash=t.blogPostContainerID=void 0,t.blogPostContainerID="post-content";var a=n(8802);Object.defineProperty(t,"applyTrailingSlash",{enumerable:!0,get:function(){return r(a).default}});var o=n(4143);Object.defineProperty(t,"getErrorCausalChain",{enumerable:!0,get:function(){return o.getErrorCausalChain}})},6010:(e,t,n)=>{"use strict";function r(e){var t,n,a="";if("string"==typeof e||"number"==typeof e)a+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r(e[t]))&&(a&&(a+=" "),a+=n);else for(t in e)e[t]&&(a&&(a+=" "),a+=t);return a}n.d(t,{Z:()=>a});const a=function(){for(var e,t,n=0,a="";n<arguments.length;)(e=arguments[n++])&&(t=r(e))&&(a&&(a+=" "),a+=t);return a}},9318:(e,t,n)=>{"use strict";n.d(t,{lX:()=>w,q_:()=>T,ob:()=>p,PP:()=>A,Ep:()=>f});var r=n(7462);function a(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,a=e.length;r<a;n+=1,r+=1)e[n]=e[r];e.pop()}const i=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],i=t&&t.split("/")||[],l=e&&a(e),s=t&&a(t),c=l||s;if(e&&a(e)?i=r:r.length&&(i.pop(),i=i.concat(r)),!i.length)return"/";if(i.length){var u=i[i.length-1];n="."===u||".."===u||""===u}else n=!1;for(var d=0,f=i.length;f>=0;f--){var p=i[f];"."===p?o(i,f):".."===p?(o(i,f),d++):d&&(o(i,f),d--)}if(!c)for(;d--;d)i.unshift("..");!c||""===i[0]||i[0]&&a(i[0])||i.unshift("");var m=i.join("/");return n&&"/"!==m.substr(-1)&&(m+="/"),m};var l=n(2177);function s(e){return"/"===e.charAt(0)?e:"/"+e}function c(e){return"/"===e.charAt(0)?e.substr(1):e}function u(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function d(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function f(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}function p(e,t,n,a){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),o.state=t):(void 0===(o=(0,r.Z)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(l){throw l instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):l}return n&&(o.key=n),a?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=i(o.pathname,a.pathname)):o.pathname=a.pathname:o.pathname||(o.pathname="/"),o}function m(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,a):a(!0):a(!1!==o)}else a(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var h=!("undefined"==typeof window||!window.document||!window.document.createElement);function g(e,t){t(window.confirm(e))}var b="popstate",v="hashchange";function y(){try{return window.history.state||{}}catch(e){return{}}}function w(e){void 0===e&&(e={}),h||(0,l.Z)(!1);var t,n=window.history,a=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,o=!(-1===window.navigator.userAgent.indexOf("Trident")),i=e,c=i.forceRefresh,w=void 0!==c&&c,k=i.getUserConfirmation,E=void 0===k?g:k,S=i.keyLength,x=void 0===S?6:S,C=e.basename?d(s(e.basename)):"";function T(e){var t=e||{},n=t.key,r=t.state,a=window.location,o=a.pathname+a.search+a.hash;return C&&(o=u(o,C)),p(o,r,n)}function _(){return Math.random().toString(36).substr(2,x)}var A=m();function L(e){(0,r.Z)(U,e),U.length=n.length,A.notifyListeners(U.location,U.action)}function R(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||O(T(e.state))}function N(){O(T(y()))}var P=!1;function O(e){if(P)P=!1,L();else{A.confirmTransitionTo(e,"POP",E,(function(t){t?L({action:"POP",location:e}):function(e){var t=U.location,n=D.indexOf(t.key);-1===n&&(n=0);var r=D.indexOf(e.key);-1===r&&(r=0);var a=n-r;a&&(P=!0,F(a))}(e)}))}}var I=T(y()),D=[I.key];function M(e){return C+f(e)}function F(e){n.go(e)}var B=0;function j(e){1===(B+=e)&&1===e?(window.addEventListener(b,R),o&&window.addEventListener(v,N)):0===B&&(window.removeEventListener(b,R),o&&window.removeEventListener(v,N))}var z=!1;var U={length:n.length,action:"POP",location:I,createHref:M,push:function(e,t){var r="PUSH",o=p(e,t,_(),U.location);A.confirmTransitionTo(o,r,E,(function(e){if(e){var t=M(o),i=o.key,l=o.state;if(a)if(n.pushState({key:i,state:l},null,t),w)window.location.href=t;else{var s=D.indexOf(U.location.key),c=D.slice(0,s+1);c.push(o.key),D=c,L({action:r,location:o})}else window.location.href=t}}))},replace:function(e,t){var r="REPLACE",o=p(e,t,_(),U.location);A.confirmTransitionTo(o,r,E,(function(e){if(e){var t=M(o),i=o.key,l=o.state;if(a)if(n.replaceState({key:i,state:l},null,t),w)window.location.replace(t);else{var s=D.indexOf(U.location.key);-1!==s&&(D[s]=o.key),L({action:r,location:o})}else window.location.replace(t)}}))},go:F,goBack:function(){F(-1)},goForward:function(){F(1)},block:function(e){void 0===e&&(e=!1);var t=A.setPrompt(e);return z||(j(1),z=!0),function(){return z&&(z=!1,j(-1)),t()}},listen:function(e){var t=A.appendListener(e);return j(1),function(){j(-1),t()}}};return U}var k="hashchange",E={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+c(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:c,decodePath:s},slash:{encodePath:s,decodePath:s}};function S(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function x(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function C(e){window.location.replace(S(window.location.href)+"#"+e)}function T(e){void 0===e&&(e={}),h||(0,l.Z)(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),a=n.getUserConfirmation,o=void 0===a?g:a,i=n.hashType,c=void 0===i?"slash":i,b=e.basename?d(s(e.basename)):"",v=E[c],y=v.encodePath,w=v.decodePath;function T(){var e=w(x());return b&&(e=u(e,b)),p(e)}var _=m();function A(e){(0,r.Z)(z,e),z.length=t.length,_.notifyListeners(z.location,z.action)}var L=!1,R=null;function N(){var e,t,n=x(),r=y(n);if(n!==r)C(r);else{var a=T(),i=z.location;if(!L&&(t=a,(e=i).pathname===t.pathname&&e.search===t.search&&e.hash===t.hash))return;if(R===f(a))return;R=null,function(e){if(L)L=!1,A();else{var t="POP";_.confirmTransitionTo(e,t,o,(function(n){n?A({action:t,location:e}):function(e){var t=z.location,n=D.lastIndexOf(f(t));-1===n&&(n=0);var r=D.lastIndexOf(f(e));-1===r&&(r=0);var a=n-r;a&&(L=!0,M(a))}(e)}))}}(a)}}var P=x(),O=y(P);P!==O&&C(O);var I=T(),D=[f(I)];function M(e){t.go(e)}var F=0;function B(e){1===(F+=e)&&1===e?window.addEventListener(k,N):0===F&&window.removeEventListener(k,N)}var j=!1;var z={length:t.length,action:"POP",location:I,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&(n=S(window.location.href)),n+"#"+y(b+f(e))},push:function(e,t){var n="PUSH",r=p(e,void 0,void 0,z.location);_.confirmTransitionTo(r,n,o,(function(e){if(e){var t=f(r),a=y(b+t);if(x()!==a){R=t,function(e){window.location.hash=e}(a);var o=D.lastIndexOf(f(z.location)),i=D.slice(0,o+1);i.push(t),D=i,A({action:n,location:r})}else A()}}))},replace:function(e,t){var n="REPLACE",r=p(e,void 0,void 0,z.location);_.confirmTransitionTo(r,n,o,(function(e){if(e){var t=f(r),a=y(b+t);x()!==a&&(R=t,C(a));var o=D.indexOf(f(z.location));-1!==o&&(D[o]=t),A({action:n,location:r})}}))},go:M,goBack:function(){M(-1)},goForward:function(){M(1)},block:function(e){void 0===e&&(e=!1);var t=_.setPrompt(e);return j||(B(1),j=!0),function(){return j&&(j=!1,B(-1)),t()}},listen:function(e){var t=_.appendListener(e);return B(1),function(){B(-1),t()}}};return z}function _(e,t,n){return Math.min(Math.max(e,t),n)}function A(e){void 0===e&&(e={});var t=e,n=t.getUserConfirmation,a=t.initialEntries,o=void 0===a?["/"]:a,i=t.initialIndex,l=void 0===i?0:i,s=t.keyLength,c=void 0===s?6:s,u=m();function d(e){(0,r.Z)(w,e),w.length=w.entries.length,u.notifyListeners(w.location,w.action)}function h(){return Math.random().toString(36).substr(2,c)}var g=_(l,0,o.length-1),b=o.map((function(e){return p(e,void 0,"string"==typeof e?h():e.key||h())})),v=f;function y(e){var t=_(w.index+e,0,w.entries.length-1),r=w.entries[t];u.confirmTransitionTo(r,"POP",n,(function(e){e?d({action:"POP",location:r,index:t}):d()}))}var w={length:b.length,action:"POP",location:b[g],index:g,entries:b,createHref:v,push:function(e,t){var r="PUSH",a=p(e,t,h(),w.location);u.confirmTransitionTo(a,r,n,(function(e){if(e){var t=w.index+1,n=w.entries.slice(0);n.length>t?n.splice(t,n.length-t,a):n.push(a),d({action:r,location:a,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",a=p(e,t,h(),w.location);u.confirmTransitionTo(a,r,n,(function(e){e&&(w.entries[w.index]=a,d({action:r,location:a}))}))},go:y,goBack:function(){y(-1)},goForward:function(){y(1)},canGo:function(e){var t=w.index+e;return t>=0&&t<w.entries.length},block:function(e){return void 0===e&&(e=!1),u.setPrompt(e)},listen:function(e){return u.appendListener(e)}};return w}},8679:(e,t,n)=>{"use strict";var r=n(9864),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?i:l[e.$$typeof]||a}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var a=p(n);a&&a!==m&&e(t,a,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var l=s(t),h=s(n),g=0;g<i.length;++g){var b=i[g];if(!(o[b]||r&&r[b]||h&&h[b]||l&&l[b])){var v=f(n,b);try{c(t,b,v)}catch(y){}}}}return t}},1143:e=>{"use strict";e.exports=function(e,t,n,r,a,o,i,l){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,a,o,i,l],u=0;(s=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw s.framesToPop=1,s}}},5826:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},2497:(e,t,n)=>{"use strict";n.r(t)},2295:(e,t,n)=>{"use strict";n.r(t)},4865:function(e,t,n){var r,a;r=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};function a(e,t,n){return e<t?t:e>n?n:e}function o(e){return 100*(-1+e)}function i(e,t,n){var a;return(a="translate3d"===r.positionUsing?{transform:"translate3d("+o(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+o(e)+"%,0)"}:{"margin-left":o(e)+"%"}).transition="all "+t+"ms "+n,a}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=a(e,r.minimum,1),n.status=1===e?null:e;var o=n.render(!t),c=o.querySelector(r.barSelector),u=r.speed,d=r.easing;return o.offsetWidth,l((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),s(c,i(e,u,d)),1===e?(s(o,{transition:"none",opacity:1}),o.offsetWidth,setTimeout((function(){s(o,{transition:"all "+u+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),u)}),u)):setTimeout(t,u)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*a(Math.random()*t,.1,.95)),t=a(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var a,i=t.querySelector(r.barSelector),l=e?"-100":o(n.status||0),c=document.querySelector(r.parent);return s(i,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),r.showSpinner||(a=t.querySelector(r.spinnerSelector))&&p(a),c!=document.body&&u(c,"nprogress-custom-parent"),c.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&p(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var l=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),s=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;for(var r,a=e.length,o=t.charAt(0).toUpperCase()+t.slice(1);a--;)if((r=e[a]+o)in n)return r;return t}function a(e){return e=n(e),t[e]||(t[e]=r(e))}function o(e,t,n){t=a(t),e.style[t]=n}return function(e,t){var n,r,a=arguments;if(2==a.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&o(e,n,r);else o(e,a[1],a[2])}}();function c(e,t){return("string"==typeof e?e:f(e)).indexOf(" "+t+" ")>=0}function u(e,t){var n=f(e),r=n+t;c(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=f(e);c(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function f(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function p(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n},void 0===(a="function"==typeof r?r.call(t,n,t,e):r)||(e.exports=a)},7418:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(a){return!1}}()?Object.assign:function(e,o){for(var i,l,s=a(e),c=1;c<arguments.length;c++){for(var u in i=Object(arguments[c]))n.call(i,u)&&(s[u]=i[u]);if(t){l=t(i);for(var d=0;d<l.length;d++)r.call(i,l[d])&&(s[l[d]]=i[l[d]])}}return s}},4779:(e,t,n)=>{var r=n(5826);e.exports=p,e.exports.parse=o,e.exports.compile=function(e,t){return l(o(e,t),t)},e.exports.tokensToFunction=l,e.exports.tokensToRegExp=f;var a=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(e,t){for(var n,r=[],o=0,i=0,l="",u=t&&t.delimiter||"/";null!=(n=a.exec(e));){var d=n[0],f=n[1],p=n.index;if(l+=e.slice(i,p),i=p+d.length,f)l+=f[1];else{var m=e[i],h=n[2],g=n[3],b=n[4],v=n[5],y=n[6],w=n[7];l&&(r.push(l),l="");var k=null!=h&&null!=m&&m!==h,E="+"===y||"*"===y,S="?"===y||"*"===y,x=n[2]||u,C=b||v;r.push({name:g||o++,prefix:h||"",delimiter:x,optional:S,repeat:E,partial:k,asterisk:!!w,pattern:C?c(C):w?".*":"[^"+s(x)+"]+?"})}}return i<e.length&&(l+=e.substr(i)),l&&r.push(l),r}function i(e){return encodeURI(e).replace(/[\/?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function l(e,t){for(var n=new Array(e.length),a=0;a<e.length;a++)"object"==typeof e[a]&&(n[a]=new RegExp("^(?:"+e[a].pattern+")$",d(t)));return function(t,a){for(var o="",l=t||{},s=(a||{}).pretty?i:encodeURIComponent,c=0;c<e.length;c++){var u=e[c];if("string"!=typeof u){var d,f=l[u.name];if(null==f){if(u.optional){u.partial&&(o+=u.prefix);continue}throw new TypeError('Expected "'+u.name+'" to be defined')}if(r(f)){if(!u.repeat)throw new TypeError('Expected "'+u.name+'" to not repeat, but received `'+JSON.stringify(f)+"`");if(0===f.length){if(u.optional)continue;throw new TypeError('Expected "'+u.name+'" to not be empty')}for(var p=0;p<f.length;p++){if(d=s(f[p]),!n[c].test(d))throw new TypeError('Expected all "'+u.name+'" to match "'+u.pattern+'", but received `'+JSON.stringify(d)+"`");o+=(0===p?u.prefix:u.delimiter)+d}}else{if(d=u.asterisk?encodeURI(f).replace(/[?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})):s(f),!n[c].test(d))throw new TypeError('Expected "'+u.name+'" to match "'+u.pattern+'", but received "'+d+'"');o+=u.prefix+d}}else o+=u}return o}}function s(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function c(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function u(e,t){return e.keys=t,e}function d(e){return e&&e.sensitive?"":"i"}function f(e,t,n){r(t)||(n=t||n,t=[]);for(var a=(n=n||{}).strict,o=!1!==n.end,i="",l=0;l<e.length;l++){var c=e[l];if("string"==typeof c)i+=s(c);else{var f=s(c.prefix),p="(?:"+c.pattern+")";t.push(c),c.repeat&&(p+="(?:"+f+p+")*"),i+=p=c.optional?c.partial?f+"("+p+")?":"(?:"+f+"("+p+"))?":f+"("+p+")"}}var m=s(n.delimiter||"/"),h=i.slice(-m.length)===m;return a||(i=(h?i.slice(0,-m.length):i)+"(?:"+m+"(?=$))?"),i+=o?"$":a&&h?"":"(?="+m+"|$)",u(new RegExp("^"+i,d(n)),t)}function p(e,t,n){return r(t)||(n=t||n,t=[]),n=n||{},e instanceof RegExp?function(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return u(e,t)}(e,t):r(e)?function(e,t,n){for(var r=[],a=0;a<e.length;a++)r.push(p(e[a],t,n).source);return u(new RegExp("(?:"+r.join("|")+")",d(n)),t)}(e,t,n):function(e,t,n){return f(o(e,n),t,n)}(e,t,n)}},7410:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=function(){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,n={},r={util:{encode:function e(t){return t instanceof a?new a(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++t}),e.__id},clone:function e(t,n){var a,o;switch(n=n||{},r.util.type(t)){case"Object":if(o=r.util.objId(t),n[o])return n[o];for(var i in a={},n[o]=a,t)t.hasOwnProperty(i)&&(a[i]=e(t[i],n));return a;case"Array":return o=r.util.objId(t),n[o]?n[o]:(a=[],n[o]=a,t.forEach((function(t,r){a[r]=e(t,n)})),a);default:return t}},getLanguage:function(t){for(;t;){var n=e.exec(t.className);if(n)return n[1].toLowerCase();t=t.parentElement}return"none"},setLanguage:function(t,n){t.className=t.className.replace(RegExp(e,"gi"),""),t.classList.add("language-"+n)},isActive:function(e,t,n){for(var r="no-"+t;e;){var a=e.classList;if(a.contains(t))return!0;if(a.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:n,plaintext:n,text:n,txt:n,extend:function(e,t){var n=r.util.clone(r.languages[e]);for(var a in t)n[a]=t[a];return n},insertBefore:function(e,t,n,a){var o=(a=a||r.languages)[e],i={};for(var l in o)if(o.hasOwnProperty(l)){if(l==t)for(var s in n)n.hasOwnProperty(s)&&(i[s]=n[s]);n.hasOwnProperty(l)||(i[l]=o[l])}var c=a[e];return a[e]=i,r.languages.DFS(r.languages,(function(t,n){n===c&&t!=e&&(this[t]=i)})),i},DFS:function e(t,n,a,o){o=o||{};var i=r.util.objId;for(var l in t)if(t.hasOwnProperty(l)){n.call(t,l,t[l],a||l);var s=t[l],c=r.util.type(s);"Object"!==c||o[i(s)]?"Array"!==c||o[i(s)]||(o[i(s)]=!0,e(s,n,l,o)):(o[i(s)]=!0,e(s,n,null,o))}}},plugins:{},highlight:function(e,t,n){var o={code:e,grammar:t,language:n};return r.hooks.run("before-tokenize",o),o.tokens=r.tokenize(o.code,o.grammar),r.hooks.run("after-tokenize",o),a.stringify(r.util.encode(o.tokens),o.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var a=new l;return s(a,a.head,e),i(e,a,t,a.head,0),function(e){var t=[],n=e.head.next;for(;n!==e.tail;)t.push(n.value),n=n.next;return t}(a)},hooks:{all:{},add:function(e,t){var n=r.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=r.hooks.all[e];if(n&&n.length)for(var a,o=0;a=n[o++];)a(t)}},Token:a};function a(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function o(e,t,n,r){e.lastIndex=t;var a=e.exec(n);if(a&&r&&a[1]){var o=a[1].length;a.index+=o,a[0]=a[0].slice(o)}return a}function i(e,t,n,l,u,d){for(var f in n)if(n.hasOwnProperty(f)&&n[f]){var p=n[f];p=Array.isArray(p)?p:[p];for(var m=0;m<p.length;++m){if(d&&d.cause==f+","+m)return;var h=p[m],g=h.inside,b=!!h.lookbehind,v=!!h.greedy,y=h.alias;if(v&&!h.pattern.global){var w=h.pattern.toString().match(/[imsuy]*$/)[0];h.pattern=RegExp(h.pattern.source,w+"g")}for(var k=h.pattern||h,E=l.next,S=u;E!==t.tail&&!(d&&S>=d.reach);S+=E.value.length,E=E.next){var x=E.value;if(t.length>e.length)return;if(!(x instanceof a)){var C,T=1;if(v){if(!(C=o(k,S,e,b))||C.index>=e.length)break;var _=C.index,A=C.index+C[0].length,L=S;for(L+=E.value.length;_>=L;)L+=(E=E.next).value.length;if(S=L-=E.value.length,E.value instanceof a)continue;for(var R=E;R!==t.tail&&(L<A||"string"==typeof R.value);R=R.next)T++,L+=R.value.length;T--,x=e.slice(S,L),C.index-=S}else if(!(C=o(k,0,x,b)))continue;_=C.index;var N=C[0],P=x.slice(0,_),O=x.slice(_+N.length),I=S+x.length;d&&I>d.reach&&(d.reach=I);var D=E.prev;if(P&&(D=s(t,D,P),S+=P.length),c(t,D,T),E=s(t,D,new a(f,g?r.tokenize(N,g):N,y,N)),O&&s(t,E,O),T>1){var M={cause:f+","+m,reach:I};i(e,t,n,E.prev,S,M),d&&M.reach>d.reach&&(d.reach=M.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function s(e,t,n){var r=t.next,a={value:n,prev:t,next:r};return t.next=a,r.prev=a,e.length++,a}function c(e,t,n){for(var r=t.next,a=0;a<n&&r!==e.tail;a++)r=r.next;t.next=r,r.prev=t,e.length-=a}return a.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var a="";return t.forEach((function(t){a+=e(t,n)})),a}var o={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},i=t.alias;i&&(Array.isArray(i)?Array.prototype.push.apply(o.classes,i):o.classes.push(i)),r.hooks.run("wrap",o);var l="";for(var s in o.attributes)l+=" "+s+'="'+(o.attributes[s]||"").replace(/"/g,""")+'"';return"<"+o.tag+' class="'+o.classes.join(" ")+'"'+l+">"+o.content+"</"+o.tag+">"},r}(),a=r;r.default=r,a.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},a.languages.markup.tag.inside["attr-value"].inside.entity=a.languages.markup.entity,a.languages.markup.doctype.inside["internal-subset"].inside=a.languages.markup,a.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(a.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:a.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:a.languages[t]};var o={};o[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},a.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(a.languages.markup.tag,"addAttribute",{value:function(e,t){a.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:a.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),a.languages.html=a.languages.markup,a.languages.mathml=a.languages.markup,a.languages.svg=a.languages.markup,a.languages.xml=a.languages.extend("markup",{}),a.languages.ssml=a.languages.xml,a.languages.atom=a.languages.xml,a.languages.rss=a.languages.xml,function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var a=["comment","function-name","for-or-select","assign-left","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=r.variable[1].inside,i=0;i<a.length;i++)o[a[i]]=e.languages.bash[a[i]];e.languages.shell=e.languages.bash}(a),a.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},a.languages.c=a.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),a.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),a.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},a.languages.c.string],char:a.languages.c.char,comment:a.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:a.languages.c}}}}),a.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete a.languages.c.boolean,function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(a),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(a),function(e){var t,n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp("\\[(?:[^[\\]\"']|"+n.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[n,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}});var r={pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0},a={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:r,number:a,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:r,number:a})}(a),a.languages.javascript=a.languages.extend("clike",{"class-name":[a.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),a.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,a.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:a.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:a.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:a.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:a.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:a.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),a.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:a.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),a.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),a.languages.markup&&(a.languages.markup.tag.addInlined("script","javascript"),a.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),a.languages.js=a.languages.javascript,function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(a),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+n.source+")?)",a=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,(function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source})),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function i(e,t){t=(t||"").replace(/m/g,"")+"m";var n=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,(function(){return r})).replace(/<<value>>/g,(function(){return e}));return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,(function(){return r}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,(function(){return r})).replace(/<<key>>/g,(function(){return"(?:"+a+"|"+o+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:i(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:i(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:i(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:i(o),lookbehind:!0,greedy:!0},number:{pattern:i(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(a),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(/<inner>/g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,a=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+a+o+"(?:"+a+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+a+o+")(?:"+a+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+a+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+a+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n<r;n++){var a=t[n];if("code"===a.type){var o=a.content[1],i=a.content[3];if(o&&i&&"code-language"===o.type&&"code-block"===i.type&&"string"==typeof o.content){var l=o.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),s="language-"+(l=(/[a-z][\w-]*/i.exec(l)||[""])[0].toLowerCase());i.alias?"string"==typeof i.alias?i.alias=[i.alias,s]:i.alias.push(s):i.alias=[s]}}else e(a.content)}}(e.tokens)})),e.hooks.add("wrap",(function(t){if("code-block"===t.type){for(var n="",r=0,a=t.classes.length;r<a;r++){var o=t.classes[r],c=/language-(.+)/.exec(o);if(c){n=c[1];break}}var u,d=e.languages[n];if(d)t.content=e.highlight((u=t.content,u.replace(i,"").replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,(function(e,t){var n;if("#"===(t=t.toLowerCase())[0])return n="x"===t[1]?parseInt(t.slice(2),16):Number(t.slice(1)),s(n);var r=l[t];return r||e}))),d,n);else if(n&&"none"!==n&&e.plugins.autoloader){var f="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());t.attributes.id=f,e.plugins.autoloader.loadLanguages(n,(function(){var t=document.getElementById(f);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))}))}}}));var i=RegExp(e.languages.markup.tag.pattern.source,"gi"),l={amp:"&",lt:"<",gt:">",quot:'"'},s=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(a),a.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:a.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},a.hooks.add("after-tokenize",(function(e){if("graphql"===e.language)for(var t=e.tokens.filter((function(e){return"string"!=typeof e&&"comment"!==e.type&&"scalar"!==e.type})),n=0;n<t.length;){var r=t[n++];if("keyword"===r.type&&"mutation"===r.content){var a=[];if(d(["definition-mutation","punctuation"])&&"("===u(1).content){n+=2;var o=f(/^\($/,/^\)$/);if(-1===o)continue;for(;n<o;n++){var i=u(0);"variable"===i.type&&(p(i,"variable-input"),a.push(i.content))}n=o+1}if(d(["punctuation","property-query"])&&"{"===u(0).content&&(n++,p(u(0),"property-mutation"),a.length>0)){var l=f(/^\{$/,/^\}$/);if(-1===l)continue;for(var s=n;s<l;s++){var c=t[s];"variable"===c.type&&a.indexOf(c.content)>=0&&p(c,"variable-input")}}}}function u(e){return t[n+e]}function d(e,t){t=t||0;for(var n=0;n<e.length;n++){var r=u(n+t);if(!r||r.type!==e[n])return!1}return!0}function f(e,r){for(var a=1,o=n;o<t.length;o++){var i=t[o],l=i.content;if("punctuation"===i.type&&"string"==typeof l)if(e.test(l))a++;else if(r.test(l)&&0===--a)return o}return-1}function p(e,t){var n=e.alias;n?Array.isArray(n)||(e.alias=n=[n]):e.alias=n=[],n.push(t)}})),a.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,a=r.inside["interpolation-punctuation"],o=r.pattern.source;function i(t,r){if(e.languages[t])return{pattern:RegExp("((?:"+r+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:t}}}}function l(e,t){return"___"+t.toUpperCase()+"_"+e+"___"}function s(t,n,r){var a={code:t,grammar:n,language:r};return e.hooks.run("before-tokenize",a),a.tokens=e.tokenize(a.code,a.grammar),e.hooks.run("after-tokenize",a),a.tokens}function c(t){var n={};n["interpolation-punctuation"]=a;var o=e.tokenize(t,n);if(3===o.length){var i=[1,1];i.push.apply(i,s(o[1],e.languages.javascript,"javascript")),o.splice.apply(o,i)}return new e.Token("interpolation",o,r.alias,t)}function u(t,n,r){var a=e.tokenize(t,{interpolation:{pattern:RegExp(o),lookbehind:!0}}),i=0,u={},d=s(a.map((function(e){if("string"==typeof e)return e;for(var n,a=e.content;-1!==t.indexOf(n=l(i++,r)););return u[n]=a,n})).join(""),n,r),f=Object.keys(u);return i=0,function e(t){for(var n=0;n<t.length;n++){if(i>=f.length)return;var r=t[n];if("string"==typeof r||"string"==typeof r.content){var a=f[i],o="string"==typeof r?r:r.content,l=o.indexOf(a);if(-1!==l){++i;var s=o.substring(0,l),d=c(u[a]),p=o.substring(l+a.length),m=[];if(s&&m.push(s),m.push(d),p){var h=[p];e(h),m.push.apply(m,h)}"string"==typeof r?(t.splice.apply(t,[n,1].concat(m)),n+=m.length-1):r.content=m}}else{var g=r.content;Array.isArray(g)?e(g):e([g])}}}(d),new e.Token(r,d,"language-"+r,t)}e.languages.javascript["template-string"]=[i("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),i("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),i("svg",/\bsvg/.source),i("markdown",/\b(?:markdown|md)/.source),i("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),i("sql",/\bsql/.source),t].filter(Boolean);var d={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function f(e){return"string"==typeof e?e:Array.isArray(e)?e.map(f).join(""):f(e.content)}e.hooks.add("after-tokenize",(function(t){t.language in d&&function t(n){for(var r=0,a=n.length;r<a;r++){var o=n[r];if("string"!=typeof o){var i=o.content;if(Array.isArray(i))if("template-string"===o.type){var l=i[1];if(3===i.length&&"string"!=typeof l&&"embedded-code"===l.type){var s=f(l),c=l.alias,d=Array.isArray(c)?c[0]:c,p=e.languages[d];if(!p)continue;i[1]=u(s,p,d)}}else t(i);else"string"!=typeof i&&t([i])}}}(t.tokens)}))}(a),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(a),function(e){function t(e,t){return RegExp(e.replace(/<ID>/g,(function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source})),t)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var a=n[r],o=e.languages.javascript[a];"RegExp"===e.util.type(o)&&(o=e.languages.javascript[a]={pattern:o});var i=o.inside||{};o.inside=i,i["maybe-class-name"]=/^[A-Z][\s\S]*/}}(a),function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,a=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function o(e,t){return e=e.replace(/<S>/g,(function(){return n})).replace(/<BRACES>/g,(function(){return r})).replace(/<SPREAD>/g,(function(){return a})),RegExp(e,t)}a=o(a).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=o(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:o(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:o(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);var i=function(e){return e?"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(i).join(""):""},l=function(t){for(var n=[],r=0;r<t.length;r++){var a=t[r],o=!1;if("string"!=typeof a&&("tag"===a.type&&a.content[0]&&"tag"===a.content[0].type?"</"===a.content[0].content[0].content?n.length>0&&n[n.length-1].tagName===i(a.content[0].content[1])&&n.pop():"/>"===a.content[a.content.length-1].content||n.push({tagName:i(a.content[0].content[1]),openedBraces:0}):n.length>0&&"punctuation"===a.type&&"{"===a.content?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&"punctuation"===a.type&&"}"===a.content?n[n.length-1].openedBraces--:o=!0),(o||"string"==typeof a)&&n.length>0&&0===n[n.length-1].openedBraces){var s=i(a);r<t.length-1&&("string"==typeof t[r+1]||"plain-text"===t[r+1].type)&&(s+=i(t[r+1]),t.splice(r+1,1)),r>0&&("string"==typeof t[r-1]||"plain-text"===t[r-1].type)&&(s=i(t[r-1])+s,t.splice(r-1,1),r--),t[r]=new e.Token("plain-text",s,null,s)}a.content&&"string"!=typeof a.content&&l(a.content)}};e.hooks.add("after-tokenize",(function(e){"jsx"!==e.language&&"tsx"!==e.language||l(e.tokens)}))}(a),function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],a=[];/^\w+$/.test(n)||a.push(/\w+/.exec(n)[0]),"diff"===n&&a.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:a,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(a),a.languages.git={comment:/^#.*/m,deleted:/^[-\u2013].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/}},coord:/^@@.*@@$/m,"commit-sha1":/^commit \w{40}$/m},a.languages.go=a.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),a.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete a.languages.go["class-name"],function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,a,o){if(n.language===r){var i=n.tokenStack=[];n.code=n.code.replace(a,(function(e){if("function"==typeof o&&!o(e))return e;for(var a,l=i.length;-1!==n.code.indexOf(a=t(r,l));)++l;return i[l]=e,a})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var a=0,o=Object.keys(n.tokenStack);!function i(l){for(var s=0;s<l.length&&!(a>=o.length);s++){var c=l[s];if("string"==typeof c||c.content&&"string"==typeof c.content){var u=o[a],d=n.tokenStack[u],f="string"==typeof c?c:c.content,p=t(r,u),m=f.indexOf(p);if(m>-1){++a;var h=f.substring(0,m),g=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),b=f.substring(m+p.length),v=[];h&&v.push.apply(v,i([h])),v.push(g),b&&v.push.apply(v,i([b])),"string"==typeof c?l.splice.apply(l,[s,1].concat(v)):c.content=v}}else c.content&&i(c.content)}return l}(n.tokens)}}}})}(a),function(e){e.languages.handlebars={comment:/\{\{![\s\S]*?\}\}/,delimiter:{pattern:/^\{\{\{?|\}\}\}?$/,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][+-]?\d+)?/,boolean:/\b(?:false|true)\b/,block:{pattern:/^(\s*(?:~\s*)?)[#\/]\S+?(?=\s*(?:~\s*)?$|\s)/,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\s\S]+/}},punctuation:/[!"#%&':()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/},e.hooks.add("before-tokenize",(function(t){e.languages["markup-templating"].buildPlaceholders(t,"handlebars",/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g)})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"handlebars")})),e.languages.hbs=e.languages.handlebars}(a),a.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},a.languages.webmanifest=a.languages.json,a.languages.less=a.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),a.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}}),a.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/},a.languages.objectivec=a.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete a.languages.objectivec["class-name"],a.languages.objc=a.languages.objectivec,a.languages.ocaml={comment:{pattern:/\(\*[\s\S]*?\*\)/,greedy:!0},char:{pattern:/'(?:[^\\\r\n']|\\(?:.|[ox]?[0-9a-f]{1,3}))'/i,greedy:!0},string:[{pattern:/"(?:\\(?:[\s\S]|\r\n)|[^\\\r\n"])*"/,greedy:!0},{pattern:/\{([a-z_]*)\|[\s\S]*?\|\1\}/,greedy:!0}],number:[/\b(?:0b[01][01_]*|0o[0-7][0-7_]*)\b/i,/\b0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]*)?(?:p[+-]?\d[\d_]*)?(?!\w)/i,/\b\d[\d_]*(?:\.[\d_]*)?(?:e[+-]?\d[\d_]*)?(?!\w)/i],directive:{pattern:/\B#\w+/,alias:"property"},label:{pattern:/\B~\w+/,alias:"property"},"type-variable":{pattern:/\B'\w+/,alias:"function"},variant:{pattern:/`\w+/,alias:"symbol"},keyword:/\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|value|virtual|when|where|while|with)\b/,boolean:/\b(?:false|true)\b/,"operator-like-punctuation":{pattern:/\[[<>|]|[>|]\]|\{<|>\}/,alias:"punctuation"},operator:/\.[.~]|:[=>]|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,punctuation:/;;|::|[(){}\[\].,:;#]|\b_\b/},a.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},a.languages.python["string-interpolation"].inside.interpolation.inside.rest=a.languages.python,a.languages.py=a.languages.python,a.languages.reason=a.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),a.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete a.languages.reason.function,function(e){e.languages.sass=e.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),e.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete e.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,n=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];e.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:n}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:n,important:e.languages.sass.important}}}),delete e.languages.sass.property,delete e.languages.sass.important,e.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})}(a),a.languages.scss=a.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),a.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),a.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),a.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),a.languages.scss.atrule.inside.rest=a.languages.scss,function(e){var t={pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0},r={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},url:{pattern:/\burl\((["']?).*?\1\)/i,greedy:!0},string:{pattern:/("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/,greedy:!0},interpolation:null,func:null,important:/\B!(?:important|optional)\b/i,keyword:{pattern:/(^|\s+)(?:(?:else|for|if|return|unless)(?=\s|$)|@[\w-]+)/,lookbehind:!0},hexcode:/#[\da-f]{3,6}/i,color:[/\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i,{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,boolean:/\b(?:false|true)\b/,operator:[/~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.{2,3}|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/],number:n,punctuation:/[{}()\[\];:,]/};r.interpolation={pattern:/\{[^\r\n}:]+\}/,alias:"variable",inside:{delimiter:{pattern:/^\{|\}$/,alias:"punctuation"},rest:r}},r.func={pattern:/[\w-]+\([^)]*\).*/,inside:{function:/^[^(]+/,rest:r}},e.languages.stylus={"atrule-declaration":{pattern:/(^[ \t]*)@.+/m,lookbehind:!0,inside:{atrule:/^@[\w-]+/,rest:r}},"variable-declaration":{pattern:/(^[ \t]*)[\w$-]+\s*.?=[ \t]*(?:\{[^{}]*\}|\S.*|$)/m,lookbehind:!0,inside:{variable:/^\S+/,rest:r}},statement:{pattern:/(^[ \t]*)(?:else|for|if|return|unless)[ \t].+/m,lookbehind:!0,inside:{keyword:/^\S+/,rest:r}},"property-declaration":{pattern:/((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)(?!\s)[^{\r\n]*(?:;|[^{\r\n,]$(?!(?:\r?\n|\r)(?:\{|\2[ \t])))/m,lookbehind:!0,inside:{property:{pattern:/^[^\s:]+/,inside:{interpolation:r.interpolation}},rest:r}},selector:{pattern:/(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)))*(?:,$|\{|(?=(?:\r?\n|\r)(?:\{|\1[ \t])))/m,lookbehind:!0,inside:{interpolation:r.interpolation,comment:r.comment,punctuation:/[{},]/}},func:r.func,string:r.string,comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0,greedy:!0},interpolation:r.interpolation,punctuation:/[{}()\[\];:.]/}}(a),function(e){var t=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"];var n=e.languages.tsx.tag;n.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+n.pattern.source+")",n.pattern.flags),n.lookbehind=!0}(a),a.languages.wasm={comment:[/\(;[\s\S]*?;\)/,{pattern:/;;.*/,greedy:!0}],string:{pattern:/"(?:\\[\s\S]|[^"\\])*"/,greedy:!0},keyword:[{pattern:/\b(?:align|offset)=/,inside:{operator:/=/}},{pattern:/\b(?:(?:f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|neg?|nearest|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|sqrt|store(?:8|16|32)?|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))?|memory\.(?:grow|size))\b/,inside:{punctuation:/\./}},/\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/],variable:/\$[\w!#$%&'*+\-./:<=>?@\\^`|~]+/,number:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/,punctuation:/[()]/};const o=a},9901:e=>{e.exports&&(e.exports={core:{meta:{path:"components/prism-core.js",option:"mandatory"},core:"Core"},themes:{meta:{path:"themes/{id}.css",link:"index.html?theme={id}",exclusive:!0},prism:{title:"Default",option:"default"},"prism-dark":"Dark","prism-funky":"Funky","prism-okaidia":{title:"Okaidia",owner:"ocodia"},"prism-twilight":{title:"Twilight",owner:"remybach"},"prism-coy":{title:"Coy",owner:"tshedor"},"prism-solarizedlight":{title:"Solarized Light",owner:"hectormatos2011 "},"prism-tomorrow":{title:"Tomorrow Night",owner:"Rosey"}},languages:{meta:{path:"components/prism-{id}",noCSS:!0,examplesPath:"examples/prism-{id}",addCheckAll:!0},markup:{title:"Markup",alias:["html","xml","svg","mathml","ssml","atom","rss"],aliasTitles:{html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",ssml:"SSML",atom:"Atom",rss:"RSS"},option:"default"},css:{title:"CSS",option:"default",modify:"markup"},clike:{title:"C-like",option:"default"},javascript:{title:"JavaScript",require:"clike",modify:"markup",optional:"regex",alias:"js",option:"default"},abap:{title:"ABAP",owner:"dellagustin"},abnf:{title:"ABNF",owner:"RunDevelopment"},actionscript:{title:"ActionScript",require:"javascript",modify:"markup",owner:"Golmote"},ada:{title:"Ada",owner:"Lucretia"},agda:{title:"Agda",owner:"xy-ren"},al:{title:"AL",owner:"RunDevelopment"},antlr4:{title:"ANTLR4",alias:"g4",owner:"RunDevelopment"},apacheconf:{title:"Apache Configuration",owner:"GuiTeK"},apex:{title:"Apex",require:["clike","sql"],owner:"RunDevelopment"},apl:{title:"APL",owner:"ngn"},applescript:{title:"AppleScript",owner:"Golmote"},aql:{title:"AQL",owner:"RunDevelopment"},arduino:{title:"Arduino",require:"cpp",alias:"ino",owner:"dkern"},arff:{title:"ARFF",owner:"Golmote"},armasm:{title:"ARM Assembly",alias:"arm-asm",owner:"RunDevelopment"},arturo:{title:"Arturo",alias:"art",optional:["bash","css","javascript","markup","markdown","sql"],owner:"drkameleon"},asciidoc:{alias:"adoc",title:"AsciiDoc",owner:"Golmote"},aspnet:{title:"ASP.NET (C#)",require:["markup","csharp"],owner:"nauzilus"},asm6502:{title:"6502 Assembly",owner:"kzurawel"},asmatmel:{title:"Atmel AVR Assembly",owner:"cerkit"},autohotkey:{title:"AutoHotkey",owner:"aviaryan"},autoit:{title:"AutoIt",owner:"Golmote"},avisynth:{title:"AviSynth",alias:"avs",owner:"Zinfidel"},"avro-idl":{title:"Avro IDL",alias:"avdl",owner:"RunDevelopment"},awk:{title:"AWK",alias:"gawk",aliasTitles:{gawk:"GAWK"},owner:"RunDevelopment"},bash:{title:"Bash",alias:["sh","shell"],aliasTitles:{sh:"Shell",shell:"Shell"},owner:"zeitgeist87"},basic:{title:"BASIC",owner:"Golmote"},batch:{title:"Batch",owner:"Golmote"},bbcode:{title:"BBcode",alias:"shortcode",aliasTitles:{shortcode:"Shortcode"},owner:"RunDevelopment"},bbj:{title:"BBj",owner:"hyyan"},bicep:{title:"Bicep",owner:"johnnyreilly"},birb:{title:"Birb",require:"clike",owner:"Calamity210"},bison:{title:"Bison",require:"c",owner:"Golmote"},bnf:{title:"BNF",alias:"rbnf",aliasTitles:{rbnf:"RBNF"},owner:"RunDevelopment"},bqn:{title:"BQN",owner:"yewscion"},brainfuck:{title:"Brainfuck",owner:"Golmote"},brightscript:{title:"BrightScript",owner:"RunDevelopment"},bro:{title:"Bro",owner:"wayward710"},bsl:{title:"BSL (1C:Enterprise)",alias:"oscript",aliasTitles:{oscript:"OneScript"},owner:"Diversus23"},c:{title:"C",require:"clike",owner:"zeitgeist87"},csharp:{title:"C#",require:"clike",alias:["cs","dotnet"],owner:"mvalipour"},cpp:{title:"C++",require:"c",owner:"zeitgeist87"},cfscript:{title:"CFScript",require:"clike",alias:"cfc",owner:"mjclemente"},chaiscript:{title:"ChaiScript",require:["clike","cpp"],owner:"RunDevelopment"},cil:{title:"CIL",owner:"sbrl"},cilkc:{title:"Cilk/C",require:"c",alias:"cilk-c",owner:"OpenCilk"},cilkcpp:{title:"Cilk/C++",require:"cpp",alias:["cilk-cpp","cilk"],owner:"OpenCilk"},clojure:{title:"Clojure",owner:"troglotit"},cmake:{title:"CMake",owner:"mjrogozinski"},cobol:{title:"COBOL",owner:"RunDevelopment"},coffeescript:{title:"CoffeeScript",require:"javascript",alias:"coffee",owner:"R-osey"},concurnas:{title:"Concurnas",alias:"conc",owner:"jasontatton"},csp:{title:"Content-Security-Policy",owner:"ScottHelme"},cooklang:{title:"Cooklang",owner:"ahue"},coq:{title:"Coq",owner:"RunDevelopment"},crystal:{title:"Crystal",require:"ruby",owner:"MakeNowJust"},"css-extras":{title:"CSS Extras",require:"css",modify:"css",owner:"milesj"},csv:{title:"CSV",owner:"RunDevelopment"},cue:{title:"CUE",owner:"RunDevelopment"},cypher:{title:"Cypher",owner:"RunDevelopment"},d:{title:"D",require:"clike",owner:"Golmote"},dart:{title:"Dart",require:"clike",owner:"Golmote"},dataweave:{title:"DataWeave",owner:"machaval"},dax:{title:"DAX",owner:"peterbud"},dhall:{title:"Dhall",owner:"RunDevelopment"},diff:{title:"Diff",owner:"uranusjr"},django:{title:"Django/Jinja2",require:"markup-templating",alias:"jinja2",owner:"romanvm"},"dns-zone-file":{title:"DNS zone file",owner:"RunDevelopment",alias:"dns-zone"},docker:{title:"Docker",alias:"dockerfile",owner:"JustinBeckwith"},dot:{title:"DOT (Graphviz)",alias:"gv",optional:"markup",owner:"RunDevelopment"},ebnf:{title:"EBNF",owner:"RunDevelopment"},editorconfig:{title:"EditorConfig",owner:"osipxd"},eiffel:{title:"Eiffel",owner:"Conaclos"},ejs:{title:"EJS",require:["javascript","markup-templating"],owner:"RunDevelopment",alias:"eta",aliasTitles:{eta:"Eta"}},elixir:{title:"Elixir",owner:"Golmote"},elm:{title:"Elm",owner:"zwilias"},etlua:{title:"Embedded Lua templating",require:["lua","markup-templating"],owner:"RunDevelopment"},erb:{title:"ERB",require:["ruby","markup-templating"],owner:"Golmote"},erlang:{title:"Erlang",owner:"Golmote"},"excel-formula":{title:"Excel Formula",alias:["xlsx","xls"],owner:"RunDevelopment"},fsharp:{title:"F#",require:"clike",owner:"simonreynolds7"},factor:{title:"Factor",owner:"catb0t"},false:{title:"False",owner:"edukisto"},"firestore-security-rules":{title:"Firestore security rules",require:"clike",owner:"RunDevelopment"},flow:{title:"Flow",require:"javascript",owner:"Golmote"},fortran:{title:"Fortran",owner:"Golmote"},ftl:{title:"FreeMarker Template Language",require:"markup-templating",owner:"RunDevelopment"},gml:{title:"GameMaker Language",alias:"gamemakerlanguage",require:"clike",owner:"LiarOnce"},gap:{title:"GAP (CAS)",owner:"RunDevelopment"},gcode:{title:"G-code",owner:"RunDevelopment"},gdscript:{title:"GDScript",owner:"RunDevelopment"},gedcom:{title:"GEDCOM",owner:"Golmote"},gettext:{title:"gettext",alias:"po",owner:"RunDevelopment"},gherkin:{title:"Gherkin",owner:"hason"},git:{title:"Git",owner:"lgiraudel"},glsl:{title:"GLSL",require:"c",owner:"Golmote"},gn:{title:"GN",alias:"gni",owner:"RunDevelopment"},"linker-script":{title:"GNU Linker Script",alias:"ld",owner:"RunDevelopment"},go:{title:"Go",require:"clike",owner:"arnehormann"},"go-module":{title:"Go module",alias:"go-mod",owner:"RunDevelopment"},gradle:{title:"Gradle",require:"clike",owner:"zeabdelkhalek-badido18"},graphql:{title:"GraphQL",optional:"markdown",owner:"Golmote"},groovy:{title:"Groovy",require:"clike",owner:"robfletcher"},haml:{title:"Haml",require:"ruby",optional:["css","css-extras","coffeescript","erb","javascript","less","markdown","scss","textile"],owner:"Golmote"},handlebars:{title:"Handlebars",require:"markup-templating",alias:["hbs","mustache"],aliasTitles:{mustache:"Mustache"},owner:"Golmote"},haskell:{title:"Haskell",alias:"hs",owner:"bholst"},haxe:{title:"Haxe",require:"clike",optional:"regex",owner:"Golmote"},hcl:{title:"HCL",owner:"outsideris"},hlsl:{title:"HLSL",require:"c",owner:"RunDevelopment"},hoon:{title:"Hoon",owner:"matildepark"},http:{title:"HTTP",optional:["csp","css","hpkp","hsts","javascript","json","markup","uri"],owner:"danielgtaylor"},hpkp:{title:"HTTP Public-Key-Pins",owner:"ScottHelme"},hsts:{title:"HTTP Strict-Transport-Security",owner:"ScottHelme"},ichigojam:{title:"IchigoJam",owner:"BlueCocoa"},icon:{title:"Icon",owner:"Golmote"},"icu-message-format":{title:"ICU Message Format",owner:"RunDevelopment"},idris:{title:"Idris",alias:"idr",owner:"KeenS",require:"haskell"},ignore:{title:".ignore",owner:"osipxd",alias:["gitignore","hgignore","npmignore"],aliasTitles:{gitignore:".gitignore",hgignore:".hgignore",npmignore:".npmignore"}},inform7:{title:"Inform 7",owner:"Golmote"},ini:{title:"Ini",owner:"aviaryan"},io:{title:"Io",owner:"AlesTsurko"},j:{title:"J",owner:"Golmote"},java:{title:"Java",require:"clike",owner:"sherblot"},javadoc:{title:"JavaDoc",require:["markup","java","javadoclike"],modify:"java",optional:"scala",owner:"RunDevelopment"},javadoclike:{title:"JavaDoc-like",modify:["java","javascript","php"],owner:"RunDevelopment"},javastacktrace:{title:"Java stack trace",owner:"RunDevelopment"},jexl:{title:"Jexl",owner:"czosel"},jolie:{title:"Jolie",require:"clike",owner:"thesave"},jq:{title:"JQ",owner:"RunDevelopment"},jsdoc:{title:"JSDoc",require:["javascript","javadoclike","typescript"],modify:"javascript",optional:["actionscript","coffeescript"],owner:"RunDevelopment"},"js-extras":{title:"JS Extras",require:"javascript",modify:"javascript",optional:["actionscript","coffeescript","flow","n4js","typescript"],owner:"RunDevelopment"},json:{title:"JSON",alias:"webmanifest",aliasTitles:{webmanifest:"Web App Manifest"},owner:"CupOfTea696"},json5:{title:"JSON5",require:"json",owner:"RunDevelopment"},jsonp:{title:"JSONP",require:"json",owner:"RunDevelopment"},jsstacktrace:{title:"JS stack trace",owner:"sbrl"},"js-templates":{title:"JS Templates",require:"javascript",modify:"javascript",optional:["css","css-extras","graphql","markdown","markup","sql"],owner:"RunDevelopment"},julia:{title:"Julia",owner:"cdagnino"},keepalived:{title:"Keepalived Configure",owner:"dev-itsheng"},keyman:{title:"Keyman",owner:"mcdurdin"},kotlin:{title:"Kotlin",alias:["kt","kts"],aliasTitles:{kts:"Kotlin Script"},require:"clike",owner:"Golmote"},kumir:{title:"KuMir (\u041a\u0443\u041c\u0438\u0440)",alias:"kum",owner:"edukisto"},kusto:{title:"Kusto",owner:"RunDevelopment"},latex:{title:"LaTeX",alias:["tex","context"],aliasTitles:{tex:"TeX",context:"ConTeXt"},owner:"japborst"},latte:{title:"Latte",require:["clike","markup-templating","php"],owner:"nette"},less:{title:"Less",require:"css",optional:"css-extras",owner:"Golmote"},lilypond:{title:"LilyPond",require:"scheme",alias:"ly",owner:"RunDevelopment"},liquid:{title:"Liquid",require:"markup-templating",owner:"cinhtau"},lisp:{title:"Lisp",alias:["emacs","elisp","emacs-lisp"],owner:"JuanCaicedo"},livescript:{title:"LiveScript",owner:"Golmote"},llvm:{title:"LLVM IR",owner:"porglezomp"},log:{title:"Log file",optional:"javastacktrace",owner:"RunDevelopment"},lolcode:{title:"LOLCODE",owner:"Golmote"},lua:{title:"Lua",owner:"Golmote"},magma:{title:"Magma (CAS)",owner:"RunDevelopment"},makefile:{title:"Makefile",owner:"Golmote"},markdown:{title:"Markdown",require:"markup",optional:"yaml",alias:"md",owner:"Golmote"},"markup-templating":{title:"Markup templating",require:"markup",owner:"Golmote"},mata:{title:"Mata",owner:"RunDevelopment"},matlab:{title:"MATLAB",owner:"Golmote"},maxscript:{title:"MAXScript",owner:"RunDevelopment"},mel:{title:"MEL",owner:"Golmote"},mermaid:{title:"Mermaid",owner:"RunDevelopment"},metafont:{title:"METAFONT",owner:"LaeriExNihilo"},mizar:{title:"Mizar",owner:"Golmote"},mongodb:{title:"MongoDB",owner:"airs0urce",require:"javascript"},monkey:{title:"Monkey",owner:"Golmote"},moonscript:{title:"MoonScript",alias:"moon",owner:"RunDevelopment"},n1ql:{title:"N1QL",owner:"TMWilds"},n4js:{title:"N4JS",require:"javascript",optional:"jsdoc",alias:"n4jsd",owner:"bsmith-n4"},"nand2tetris-hdl":{title:"Nand To Tetris HDL",owner:"stephanmax"},naniscript:{title:"Naninovel Script",owner:"Elringus",alias:"nani"},nasm:{title:"NASM",owner:"rbmj"},neon:{title:"NEON",owner:"nette"},nevod:{title:"Nevod",owner:"nezaboodka"},nginx:{title:"nginx",owner:"volado"},nim:{title:"Nim",owner:"Golmote"},nix:{title:"Nix",owner:"Golmote"},nsis:{title:"NSIS",owner:"idleberg"},objectivec:{title:"Objective-C",require:"c",alias:"objc",owner:"uranusjr"},ocaml:{title:"OCaml",owner:"Golmote"},odin:{title:"Odin",owner:"edukisto"},opencl:{title:"OpenCL",require:"c",modify:["c","cpp"],owner:"Milania1"},openqasm:{title:"OpenQasm",alias:"qasm",owner:"RunDevelopment"},oz:{title:"Oz",owner:"Golmote"},parigp:{title:"PARI/GP",owner:"Golmote"},parser:{title:"Parser",require:"markup",owner:"Golmote"},pascal:{title:"Pascal",alias:"objectpascal",aliasTitles:{objectpascal:"Object Pascal"},owner:"Golmote"},pascaligo:{title:"Pascaligo",owner:"DefinitelyNotAGoat"},psl:{title:"PATROL Scripting Language",owner:"bertysentry"},pcaxis:{title:"PC-Axis",alias:"px",owner:"RunDevelopment"},peoplecode:{title:"PeopleCode",alias:"pcode",owner:"RunDevelopment"},perl:{title:"Perl",owner:"Golmote"},php:{title:"PHP",require:"markup-templating",owner:"milesj"},phpdoc:{title:"PHPDoc",require:["php","javadoclike"],modify:"php",owner:"RunDevelopment"},"php-extras":{title:"PHP Extras",require:"php",modify:"php",owner:"milesj"},"plant-uml":{title:"PlantUML",alias:"plantuml",owner:"RunDevelopment"},plsql:{title:"PL/SQL",require:"sql",owner:"Golmote"},powerquery:{title:"PowerQuery",alias:["pq","mscript"],owner:"peterbud"},powershell:{title:"PowerShell",owner:"nauzilus"},processing:{title:"Processing",require:"clike",owner:"Golmote"},prolog:{title:"Prolog",owner:"Golmote"},promql:{title:"PromQL",owner:"arendjr"},properties:{title:".properties",owner:"Golmote"},protobuf:{title:"Protocol Buffers",require:"clike",owner:"just-boris"},pug:{title:"Pug",require:["markup","javascript"],optional:["coffeescript","ejs","handlebars","less","livescript","markdown","scss","stylus","twig"],owner:"Golmote"},puppet:{title:"Puppet",owner:"Golmote"},pure:{title:"Pure",optional:["c","cpp","fortran"],owner:"Golmote"},purebasic:{title:"PureBasic",require:"clike",alias:"pbfasm",owner:"HeX0R101"},purescript:{title:"PureScript",require:"haskell",alias:"purs",owner:"sriharshachilakapati"},python:{title:"Python",alias:"py",owner:"multipetros"},qsharp:{title:"Q#",require:"clike",alias:"qs",owner:"fedonman"},q:{title:"Q (kdb+ database)",owner:"Golmote"},qml:{title:"QML",require:"javascript",owner:"RunDevelopment"},qore:{title:"Qore",require:"clike",owner:"temnroegg"},r:{title:"R",owner:"Golmote"},racket:{title:"Racket",require:"scheme",alias:"rkt",owner:"RunDevelopment"},cshtml:{title:"Razor C#",alias:"razor",require:["markup","csharp"],optional:["css","css-extras","javascript","js-extras"],owner:"RunDevelopment"},jsx:{title:"React JSX",require:["markup","javascript"],optional:["jsdoc","js-extras","js-templates"],owner:"vkbansal"},tsx:{title:"React TSX",require:["jsx","typescript"]},reason:{title:"Reason",require:"clike",owner:"Golmote"},regex:{title:"Regex",owner:"RunDevelopment"},rego:{title:"Rego",owner:"JordanSh"},renpy:{title:"Ren'py",alias:"rpy",owner:"HyuchiaDiego"},rescript:{title:"ReScript",alias:"res",owner:"vmarcosp"},rest:{title:"reST (reStructuredText)",owner:"Golmote"},rip:{title:"Rip",owner:"ravinggenius"},roboconf:{title:"Roboconf",owner:"Golmote"},robotframework:{title:"Robot Framework",alias:"robot",owner:"RunDevelopment"},ruby:{title:"Ruby",require:"clike",alias:"rb",owner:"samflores"},rust:{title:"Rust",owner:"Golmote"},sas:{title:"SAS",optional:["groovy","lua","sql"],owner:"Golmote"},sass:{title:"Sass (Sass)",require:"css",optional:"css-extras",owner:"Golmote"},scss:{title:"Sass (SCSS)",require:"css",optional:"css-extras",owner:"MoOx"},scala:{title:"Scala",require:"java",owner:"jozic"},scheme:{title:"Scheme",owner:"bacchus123"},"shell-session":{title:"Shell session",require:"bash",alias:["sh-session","shellsession"],owner:"RunDevelopment"},smali:{title:"Smali",owner:"RunDevelopment"},smalltalk:{title:"Smalltalk",owner:"Golmote"},smarty:{title:"Smarty",require:"markup-templating",optional:"php",owner:"Golmote"},sml:{title:"SML",alias:"smlnj",aliasTitles:{smlnj:"SML/NJ"},owner:"RunDevelopment"},solidity:{title:"Solidity (Ethereum)",alias:"sol",require:"clike",owner:"glachaud"},"solution-file":{title:"Solution file",alias:"sln",owner:"RunDevelopment"},soy:{title:"Soy (Closure Template)",require:"markup-templating",owner:"Golmote"},sparql:{title:"SPARQL",require:"turtle",owner:"Triply-Dev",alias:"rq"},"splunk-spl":{title:"Splunk SPL",owner:"RunDevelopment"},sqf:{title:"SQF: Status Quo Function (Arma 3)",require:"clike",owner:"RunDevelopment"},sql:{title:"SQL",owner:"multipetros"},squirrel:{title:"Squirrel",require:"clike",owner:"RunDevelopment"},stan:{title:"Stan",owner:"RunDevelopment"},stata:{title:"Stata Ado",require:["mata","java","python"],owner:"RunDevelopment"},iecst:{title:"Structured Text (IEC 61131-3)",owner:"serhioromano"},stylus:{title:"Stylus",owner:"vkbansal"},supercollider:{title:"SuperCollider",alias:"sclang",owner:"RunDevelopment"},swift:{title:"Swift",owner:"chrischares"},systemd:{title:"Systemd configuration file",owner:"RunDevelopment"},"t4-templating":{title:"T4 templating",owner:"RunDevelopment"},"t4-cs":{title:"T4 Text Templates (C#)",require:["t4-templating","csharp"],alias:"t4",owner:"RunDevelopment"},"t4-vb":{title:"T4 Text Templates (VB)",require:["t4-templating","vbnet"],owner:"RunDevelopment"},tap:{title:"TAP",owner:"isaacs",require:"yaml"},tcl:{title:"Tcl",owner:"PeterChaplin"},tt2:{title:"Template Toolkit 2",require:["clike","markup-templating"],owner:"gflohr"},textile:{title:"Textile",require:"markup",optional:"css",owner:"Golmote"},toml:{title:"TOML",owner:"RunDevelopment"},tremor:{title:"Tremor",alias:["trickle","troy"],owner:"darach",aliasTitles:{trickle:"trickle",troy:"troy"}},turtle:{title:"Turtle",alias:"trig",aliasTitles:{trig:"TriG"},owner:"jakubklimek"},twig:{title:"Twig",require:"markup-templating",owner:"brandonkelly"},typescript:{title:"TypeScript",require:"javascript",optional:"js-templates",alias:"ts",owner:"vkbansal"},typoscript:{title:"TypoScript",alias:"tsconfig",aliasTitles:{tsconfig:"TSConfig"},owner:"dkern"},unrealscript:{title:"UnrealScript",alias:["uscript","uc"],owner:"RunDevelopment"},uorazor:{title:"UO Razor Script",owner:"jaseowns"},uri:{title:"URI",alias:"url",aliasTitles:{url:"URL"},owner:"RunDevelopment"},v:{title:"V",require:"clike",owner:"taggon"},vala:{title:"Vala",require:"clike",optional:"regex",owner:"TemplarVolk"},vbnet:{title:"VB.Net",require:"basic",owner:"Bigsby"},velocity:{title:"Velocity",require:"markup",owner:"Golmote"},verilog:{title:"Verilog",owner:"a-rey"},vhdl:{title:"VHDL",owner:"a-rey"},vim:{title:"vim",owner:"westonganger"},"visual-basic":{title:"Visual Basic",alias:["vb","vba"],aliasTitles:{vba:"VBA"},owner:"Golmote"},warpscript:{title:"WarpScript",owner:"RunDevelopment"},wasm:{title:"WebAssembly",owner:"Golmote"},"web-idl":{title:"Web IDL",alias:"webidl",owner:"RunDevelopment"},wgsl:{title:"WGSL",owner:"Dr4gonthree"},wiki:{title:"Wiki markup",require:"markup",owner:"Golmote"},wolfram:{title:"Wolfram language",alias:["mathematica","nb","wl"],aliasTitles:{mathematica:"Mathematica",nb:"Mathematica Notebook"},owner:"msollami"},wren:{title:"Wren",owner:"clsource"},xeora:{title:"Xeora",require:"markup",alias:"xeoracube",aliasTitles:{xeoracube:"XeoraCube"},owner:"freakmaxi"},"xml-doc":{title:"XML doc (.net)",require:"markup",modify:["csharp","fsharp","vbnet"],owner:"RunDevelopment"},xojo:{title:"Xojo (REALbasic)",owner:"Golmote"},xquery:{title:"XQuery",require:"markup",owner:"Golmote"},yaml:{title:"YAML",alias:"yml",owner:"hason"},yang:{title:"YANG",owner:"RunDevelopment"},zig:{title:"Zig",owner:"RunDevelopment"}},plugins:{meta:{path:"plugins/{id}/prism-{id}",link:"plugins/{id}/"},"line-highlight":{title:"Line Highlight",description:"Highlights specific lines and/or line ranges."},"line-numbers":{title:"Line Numbers",description:"Line number at the beginning of code lines.",owner:"kuba-kubula"},"show-invisibles":{title:"Show Invisibles",description:"Show hidden characters such as tabs and line breaks.",optional:["autolinker","data-uri-highlight"]},autolinker:{title:"Autolinker",description:"Converts URLs and emails in code to clickable links. Parses Markdown links in comments."},wpd:{title:"WebPlatform Docs",description:'Makes tokens link to <a href="https://webplatform.github.io/docs/">WebPlatform.org documentation</a>. The links open in a new tab.'},"custom-class":{title:"Custom Class",description:"This plugin allows you to prefix Prism's default classes (<code>.comment</code> can become <code>.namespace--comment</code>) or replace them with your defined ones (like <code>.editor__comment</code>). You can even add new classes.",owner:"dvkndn",noCSS:!0},"file-highlight":{title:"File Highlight",description:"Fetch external files and highlight them with Prism. Used on the Prism website itself.",noCSS:!0},"show-language":{title:"Show Language",description:"Display the highlighted language in code blocks (inline code does not show the label).",owner:"nauzilus",noCSS:!0,require:"toolbar"},"jsonp-highlight":{title:"JSONP Highlight",description:"Fetch content with JSONP and highlight some interesting content (e.g. GitHub/Gists or Bitbucket API).",noCSS:!0,owner:"nauzilus"},"highlight-keywords":{title:"Highlight Keywords",description:"Adds special CSS classes for each keyword for fine-grained highlighting.",owner:"vkbansal",noCSS:!0},"remove-initial-line-feed":{title:"Remove initial line feed",description:"Removes the initial line feed in code blocks.",owner:"Golmote",noCSS:!0},"inline-color":{title:"Inline color",description:"Adds a small inline preview for colors in style sheets.",require:"css-extras",owner:"RunDevelopment"},previewers:{title:"Previewers",description:"Previewers for angles, colors, gradients, easing and time.",require:"css-extras",owner:"Golmote"},autoloader:{title:"Autoloader",description:"Automatically loads the needed languages to highlight the code blocks.",owner:"Golmote",noCSS:!0},"keep-markup":{title:"Keep Markup",description:"Prevents custom markup from being dropped out during highlighting.",owner:"Golmote",optional:"normalize-whitespace",noCSS:!0},"command-line":{title:"Command Line",description:"Display a command line with a prompt and, optionally, the output/response from the commands.",owner:"chriswells0"},"unescaped-markup":{title:"Unescaped Markup",description:"Write markup without having to escape anything."},"normalize-whitespace":{title:"Normalize Whitespace",description:"Supports multiple operations to normalize whitespace in code blocks.",owner:"zeitgeist87",optional:"unescaped-markup",noCSS:!0},"data-uri-highlight":{title:"Data-URI Highlight",description:"Highlights data-URI contents.",owner:"Golmote",noCSS:!0},toolbar:{title:"Toolbar",description:"Attach a toolbar for plugins to easily register buttons on the top of a code block.",owner:"mAAdhaTTah"},"copy-to-clipboard":{title:"Copy to Clipboard Button",description:"Add a button that copies the code block to the clipboard when clicked.",owner:"mAAdhaTTah",require:"toolbar",noCSS:!0},"download-button":{title:"Download Button",description:"A button in the toolbar of a code block adding a convenient way to download a code file.",owner:"Golmote",require:"toolbar",noCSS:!0},"match-braces":{title:"Match braces",description:"Highlights matching braces.",owner:"RunDevelopment"},"diff-highlight":{title:"Diff Highlight",description:"Highlights the code inside diff blocks.",owner:"RunDevelopment",require:"diff"},"filter-highlight-all":{title:"Filter highlightAll",description:"Filters the elements the <code>highlightAll</code> and <code>highlightAllUnder</code> methods actually highlight.",owner:"RunDevelopment",noCSS:!0},treeview:{title:"Treeview",description:"A language with special styles to highlight file system tree structures.",owner:"Golmote"}}})},2885:(e,t,n)=>{const r=n(9901),a=n(9642),o=new Set;function i(e){void 0===e?e=Object.keys(r.languages).filter((e=>"meta"!=e)):Array.isArray(e)||(e=[e]);const t=[...o,...Object.keys(Prism.languages)];a(r,e,t).load((e=>{if(!(e in r.languages))return void(i.silent||console.warn("Language does not exist: "+e));const t="./prism-"+e;delete n.c[n(6500).resolve(t)],delete Prism.languages[e],n(6500)(t),o.add(e)}))}i.silent=!1,e.exports=i},6726:(e,t,n)=>{var r={"./":2885};function a(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=o,e.exports=a,a.id=6726},6500:(e,t,n)=>{var r={"./":2885};function a(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=o,e.exports=a,a.id=6500},9642:e=>{"use strict";var t=function(){var e=function(){};function t(e,t){Array.isArray(e)?e.forEach(t):null!=e&&t(e,0)}function n(e){for(var t={},n=0,r=e.length;n<r;n++)t[e[n]]=!0;return t}function r(e){var n={},r=[];function a(r,o){if(!(r in n)){o.push(r);var i=o.indexOf(r);if(i<o.length-1)throw new Error("Circular dependency: "+o.slice(i).join(" -> "));var l={},s=e[r];if(s){function c(t){if(!(t in e))throw new Error(r+" depends on an unknown component "+t);if(!(t in l))for(var i in a(t,o),l[t]=!0,n[t])l[i]=!0}t(s.require,c),t(s.optional,c),t(s.modify,c)}n[r]=l,o.pop()}}return function(e){var t=n[e];return t||(a(e,r),t=n[e]),t}}function a(e){for(var t in e)return!0;return!1}return function(o,i,l){var s=function(e){var t={};for(var n in e){var r=e[n];for(var a in r)if("meta"!=a){var o=r[a];t[a]="string"==typeof o?{title:o}:o}}return t}(o),c=function(e){var n;return function(r){if(r in e)return r;if(!n)for(var a in n={},e){var o=e[a];t(o&&o.alias,(function(t){if(t in n)throw new Error(t+" cannot be alias for both "+a+" and "+n[t]);if(t in e)throw new Error(t+" cannot be alias of "+a+" because it is a component.");n[t]=a}))}return n[r]||r}}(s);i=i.map(c),l=(l||[]).map(c);var u=n(i),d=n(l);i.forEach((function e(n){var r=s[n];t(r&&r.require,(function(t){t in d||(u[t]=!0,e(t))}))}));for(var f,p=r(s),m=u;a(m);){for(var h in f={},m){var g=s[h];t(g&&g.modify,(function(e){e in d&&(f[e]=!0)}))}for(var b in d)if(!(b in u))for(var v in p(b))if(v in u){f[b]=!0;break}for(var y in m=f)u[y]=!0}var w={getIds:function(){var e=[];return w.load((function(t){e.push(t)})),e},load:function(t,n){return function(t,n,r,a){var o=a?a.series:void 0,i=a?a.parallel:e,l={},s={};function c(e){if(e in l)return l[e];s[e]=!0;var a,u=[];for(var d in t(e))d in n&&u.push(d);if(0===u.length)a=r(e);else{var f=i(u.map((function(e){var t=c(e);return delete s[e],t})));o?a=o(f,(function(){return r(e)})):r(e)}return l[e]=a}for(var u in n)c(u);var d=[];for(var f in s)d.push(l[f]);return i(d)}(p,u,t,n)}};return w}}();e.exports=t},2703:(e,t,n)=>{"use strict";var r=n(414);function a(){}function o(){}o.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,o,i){if(i!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:a};return n.PropTypes=n,n}},5697:(e,t,n)=>{e.exports=n(2703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4448:(e,t,n)=>{"use strict";var r=n(7294),a=n(7418),o=n(3840);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(i(227));var l=new Set,s={};function c(e,t){u(e,t),u(e+"Capture",t)}function u(e,t){for(s[e]=t,e=0;e<t.length;e++)l.add(t[e])}var d=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p=Object.prototype.hasOwnProperty,m={},h={};function g(e,t,n,r,a,o,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){b[e]=new g(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];b[t]=new g(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){b[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){b[e]=new g(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){b[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){b[e]=new g(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){b[e]=new g(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){b[e]=new g(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){b[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)}));var v=/[\-:]([a-z])/g;function y(e){return e[1].toUpperCase()}function w(e,t,n,r){var a=b.hasOwnProperty(t)?b[t]:null;(null!==a?0===a.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,a,r)&&(n=null),r||null===a?function(e){return!!p.call(h,e)||!p.call(m,e)&&(f.test(e)?h[e]=!0:(m[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=null===n?3!==a.type&&"":n:(t=a.attributeName,r=a.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(a=a.type)||4===a&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(v,y);b[t]=new g(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(v,y);b[t]=new g(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(v,y);b[t]=new g(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){b[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)})),b.xlinkHref=new g("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){b[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)}));var k=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,E=60103,S=60106,x=60107,C=60108,T=60114,_=60109,A=60110,L=60112,R=60113,N=60120,P=60115,O=60116,I=60121,D=60128,M=60129,F=60130,B=60131;if("function"==typeof Symbol&&Symbol.for){var j=Symbol.for;E=j("react.element"),S=j("react.portal"),x=j("react.fragment"),C=j("react.strict_mode"),T=j("react.profiler"),_=j("react.provider"),A=j("react.context"),L=j("react.forward_ref"),R=j("react.suspense"),N=j("react.suspense_list"),P=j("react.memo"),O=j("react.lazy"),I=j("react.block"),j("react.scope"),D=j("react.opaque.id"),M=j("react.debug_trace_mode"),F=j("react.offscreen"),B=j("react.legacy_hidden")}var z,U="function"==typeof Symbol&&Symbol.iterator;function $(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=U&&e[U]||e["@@iterator"])?e:null}function q(e){if(void 0===z)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);z=t&&t[1]||""}return"\n"+z+e}var H=!1;function G(e,t){if(!e||H)return"";H=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(s){var r=s}Reflect.construct(e,[],t)}else{try{t.call()}catch(s){r=s}e.call(t.prototype)}else{try{throw Error()}catch(s){r=s}e()}}catch(s){if(s&&r&&"string"==typeof s.stack){for(var a=s.stack.split("\n"),o=r.stack.split("\n"),i=a.length-1,l=o.length-1;1<=i&&0<=l&&a[i]!==o[l];)l--;for(;1<=i&&0<=l;i--,l--)if(a[i]!==o[l]){if(1!==i||1!==l)do{if(i--,0>--l||a[i]!==o[l])return"\n"+a[i].replace(" at new "," at ")}while(1<=i&&0<=l);break}}}finally{H=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?q(e):""}function Z(e){switch(e.tag){case 5:return q(e.type);case 16:return q("Lazy");case 13:return q("Suspense");case 19:return q("SuspenseList");case 0:case 2:case 15:return e=G(e.type,!1);case 11:return e=G(e.type.render,!1);case 22:return e=G(e.type._render,!1);case 1:return e=G(e.type,!0);default:return""}}function V(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case x:return"Fragment";case S:return"Portal";case T:return"Profiler";case C:return"StrictMode";case R:return"Suspense";case N:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case A:return(e.displayName||"Context")+".Consumer";case _:return(e._context.displayName||"Context")+".Provider";case L:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case P:return V(e.type);case I:return V(e._render);case O:t=e._payload,e=e._init;try{return V(e(t))}catch(n){}}return null}function W(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function K(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Y(e){e._valueTracker||(e._valueTracker=function(e){var t=K(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var a=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Q(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=K(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function X(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function J(e,t){var n=t.checked;return a({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ee(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=W(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function te(e,t){null!=(t=t.checked)&&w(e,"checked",t,!1)}function ne(e,t){te(e,t);var n=W(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ae(e,t.type,n):t.hasOwnProperty("defaultValue")&&ae(e,t.type,W(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function re(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ae(e,t,n){"number"===t&&X(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function oe(e,t){return e=a({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function ie(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+W(n),t=null,a=0;a<e.length;a++){if(e[a].value===n)return e[a].selected=!0,void(r&&(e[a].defaultSelected=!0));null!==t||e[a].disabled||(t=e[a])}null!==t&&(t.selected=!0)}}function le(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(i(91));return a({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function se(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(i(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(i(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:W(n)}}function ce(e,t){var n=W(t.value),r=W(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ue(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var de="http://www.w3.org/1999/xhtml",fe="http://www.w3.org/2000/svg";function pe(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function me(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?pe(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var he,ge,be=(ge=function(e,t){if(e.namespaceURI!==fe||"innerHTML"in e)e.innerHTML=t;else{for((he=he||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=he.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return ge(e,t)}))}:ge);function ve(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var ye={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},we=["Webkit","ms","Moz","O"];function ke(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||ye.hasOwnProperty(e)&&ye[e]?(""+t).trim():t+"px"}function Ee(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),a=ke(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}Object.keys(ye).forEach((function(e){we.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ye[t]=ye[e]}))}));var Se=a({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function xe(e,t){if(t){if(Se[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(i(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(i(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(i(62))}}function Ce(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Te(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var _e=null,Ae=null,Le=null;function Re(e){if(e=ra(e)){if("function"!=typeof _e)throw Error(i(280));var t=e.stateNode;t&&(t=oa(t),_e(e.stateNode,e.type,t))}}function Ne(e){Ae?Le?Le.push(e):Le=[e]:Ae=e}function Pe(){if(Ae){var e=Ae,t=Le;if(Le=Ae=null,Re(e),t)for(e=0;e<t.length;e++)Re(t[e])}}function Oe(e,t){return e(t)}function Ie(e,t,n,r,a){return e(t,n,r,a)}function De(){}var Me=Oe,Fe=!1,Be=!1;function je(){null===Ae&&null===Le||(De(),Pe())}function ze(e,t){var n=e.stateNode;if(null===n)return null;var r=oa(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(i(231,t,typeof n));return n}var Ue=!1;if(d)try{var $e={};Object.defineProperty($e,"passive",{get:function(){Ue=!0}}),window.addEventListener("test",$e,$e),window.removeEventListener("test",$e,$e)}catch(ge){Ue=!1}function qe(e,t,n,r,a,o,i,l,s){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var He=!1,Ge=null,Ze=!1,Ve=null,We={onError:function(e){He=!0,Ge=e}};function Ke(e,t,n,r,a,o,i,l,s){He=!1,Ge=null,qe.apply(We,arguments)}function Ye(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Qe(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Xe(e){if(Ye(e)!==e)throw Error(i(188))}function Je(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ye(e)))throw Error(i(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(null===a)break;var o=a.alternate;if(null===o){if(null!==(r=a.return)){n=r;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return Xe(a),e;if(o===r)return Xe(a),t;o=o.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=o;else{for(var l=!1,s=a.child;s;){if(s===n){l=!0,n=a,r=o;break}if(s===r){l=!0,r=a,n=o;break}s=s.sibling}if(!l){for(s=o.child;s;){if(s===n){l=!0,n=o,r=a;break}if(s===r){l=!0,r=o,n=a;break}s=s.sibling}if(!l)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(3!==n.tag)throw Error(i(188));return n.stateNode.current===n?e:t}(e),!e)return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function et(e,t){for(var n=e.alternate;null!==t;){if(t===e||t===n)return!0;t=t.return}return!1}var tt,nt,rt,at,ot=!1,it=[],lt=null,st=null,ct=null,ut=new Map,dt=new Map,ft=[],pt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function mt(e,t,n,r,a){return{blockedOn:e,domEventName:t,eventSystemFlags:16|n,nativeEvent:a,targetContainers:[r]}}function ht(e,t){switch(e){case"focusin":case"focusout":lt=null;break;case"dragenter":case"dragleave":st=null;break;case"mouseover":case"mouseout":ct=null;break;case"pointerover":case"pointerout":ut.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":dt.delete(t.pointerId)}}function gt(e,t,n,r,a,o){return null===e||e.nativeEvent!==o?(e=mt(t,n,r,a,o),null!==t&&(null!==(t=ra(t))&&nt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==a&&-1===t.indexOf(a)&&t.push(a),e)}function bt(e){var t=na(e.target);if(null!==t){var n=Ye(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Qe(n)))return e.blockedOn=t,void at(e.lanePriority,(function(){o.unstable_runWithPriority(e.priority,(function(){rt(n)}))}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function vt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Jt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=ra(n))&&nt(t),e.blockedOn=n,!1;t.shift()}return!0}function yt(e,t,n){vt(e)&&n.delete(t)}function wt(){for(ot=!1;0<it.length;){var e=it[0];if(null!==e.blockedOn){null!==(e=ra(e.blockedOn))&&tt(e);break}for(var t=e.targetContainers;0<t.length;){var n=Jt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n){e.blockedOn=n;break}t.shift()}null===e.blockedOn&&it.shift()}null!==lt&&vt(lt)&&(lt=null),null!==st&&vt(st)&&(st=null),null!==ct&&vt(ct)&&(ct=null),ut.forEach(yt),dt.forEach(yt)}function kt(e,t){e.blockedOn===t&&(e.blockedOn=null,ot||(ot=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,wt)))}function Et(e){function t(t){return kt(t,e)}if(0<it.length){kt(it[0],e);for(var n=1;n<it.length;n++){var r=it[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==lt&&kt(lt,e),null!==st&&kt(st,e),null!==ct&&kt(ct,e),ut.forEach(t),dt.forEach(t),n=0;n<ft.length;n++)(r=ft[n]).blockedOn===e&&(r.blockedOn=null);for(;0<ft.length&&null===(n=ft[0]).blockedOn;)bt(n),null===n.blockedOn&&ft.shift()}function St(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var xt={animationend:St("Animation","AnimationEnd"),animationiteration:St("Animation","AnimationIteration"),animationstart:St("Animation","AnimationStart"),transitionend:St("Transition","TransitionEnd")},Ct={},Tt={};function _t(e){if(Ct[e])return Ct[e];if(!xt[e])return e;var t,n=xt[e];for(t in n)if(n.hasOwnProperty(t)&&t in Tt)return Ct[e]=n[t];return e}d&&(Tt=document.createElement("div").style,"AnimationEvent"in window||(delete xt.animationend.animation,delete xt.animationiteration.animation,delete xt.animationstart.animation),"TransitionEvent"in window||delete xt.transitionend.transition);var At=_t("animationend"),Lt=_t("animationiteration"),Rt=_t("animationstart"),Nt=_t("transitionend"),Pt=new Map,Ot=new Map,It=["abort","abort",At,"animationEnd",Lt,"animationIteration",Rt,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Nt,"transitionEnd","waiting","waiting"];function Dt(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],a=e[n+1];a="on"+(a[0].toUpperCase()+a.slice(1)),Ot.set(r,t),Pt.set(r,a),c(a,[r])}}(0,o.unstable_now)();var Mt=8;function Ft(e){if(0!=(1&e))return Mt=15,1;if(0!=(2&e))return Mt=14,2;if(0!=(4&e))return Mt=13,4;var t=24&e;return 0!==t?(Mt=12,t):0!=(32&e)?(Mt=11,32):0!==(t=192&e)?(Mt=10,t):0!=(256&e)?(Mt=9,256):0!==(t=3584&e)?(Mt=8,t):0!=(4096&e)?(Mt=7,4096):0!==(t=4186112&e)?(Mt=6,t):0!==(t=62914560&e)?(Mt=5,t):67108864&e?(Mt=4,67108864):0!=(134217728&e)?(Mt=3,134217728):0!==(t=805306368&e)?(Mt=2,t):0!=(1073741824&e)?(Mt=1,1073741824):(Mt=8,e)}function Bt(e,t){var n=e.pendingLanes;if(0===n)return Mt=0;var r=0,a=0,o=e.expiredLanes,i=e.suspendedLanes,l=e.pingedLanes;if(0!==o)r=o,a=Mt=15;else if(0!==(o=134217727&n)){var s=o&~i;0!==s?(r=Ft(s),a=Mt):0!==(l&=o)&&(r=Ft(l),a=Mt)}else 0!==(o=n&~i)?(r=Ft(o),a=Mt):0!==l&&(r=Ft(l),a=Mt);if(0===r)return 0;if(r=n&((0>(r=31-Ht(r))?0:1<<r)<<1)-1,0!==t&&t!==r&&0==(t&i)){if(Ft(t),a<=Mt)return t;Mt=a}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)a=1<<(n=31-Ht(t)),r|=e[n],t&=~a;return r}function jt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function zt(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=Ut(24&~t))?zt(10,t):e;case 10:return 0===(e=Ut(192&~t))?zt(8,t):e;case 8:return 0===(e=Ut(3584&~t))&&(0===(e=Ut(4186112&~t))&&(e=512)),e;case 2:return 0===(t=Ut(805306368&~t))&&(t=268435456),t}throw Error(i(358,e))}function Ut(e){return e&-e}function $t(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function qt(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,(e=e.eventTimes)[t=31-Ht(t)]=n}var Ht=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(Gt(e)/Zt|0)|0},Gt=Math.log,Zt=Math.LN2;var Vt=o.unstable_UserBlockingPriority,Wt=o.unstable_runWithPriority,Kt=!0;function Yt(e,t,n,r){Fe||De();var a=Xt,o=Fe;Fe=!0;try{Ie(a,e,t,n,r)}finally{(Fe=o)||je()}}function Qt(e,t,n,r){Wt(Vt,Xt.bind(null,e,t,n,r))}function Xt(e,t,n,r){var a;if(Kt)if((a=0==(4&t))&&0<it.length&&-1<pt.indexOf(e))e=mt(null,e,t,n,r),it.push(e);else{var o=Jt(e,t,n,r);if(null===o)a&&ht(e,r);else{if(a){if(-1<pt.indexOf(e))return e=mt(o,e,t,n,r),void it.push(e);if(function(e,t,n,r,a){switch(t){case"focusin":return lt=gt(lt,e,t,n,r,a),!0;case"dragenter":return st=gt(st,e,t,n,r,a),!0;case"mouseover":return ct=gt(ct,e,t,n,r,a),!0;case"pointerover":var o=a.pointerId;return ut.set(o,gt(ut.get(o)||null,e,t,n,r,a)),!0;case"gotpointercapture":return o=a.pointerId,dt.set(o,gt(dt.get(o)||null,e,t,n,r,a)),!0}return!1}(o,e,t,n,r))return;ht(e,r)}Dr(e,t,r,null,n)}}}function Jt(e,t,n,r){var a=Te(r);if(null!==(a=na(a))){var o=Ye(a);if(null===o)a=null;else{var i=o.tag;if(13===i){if(null!==(a=Qe(o)))return a;a=null}else if(3===i){if(o.stateNode.hydrate)return 3===o.tag?o.stateNode.containerInfo:null;a=null}else o!==a&&(a=null)}}return Dr(e,t,r,a,n),null}var en=null,tn=null,nn=null;function rn(){if(nn)return nn;var e,t,n=tn,r=n.length,a="value"in en?en.value:en.textContent,o=a.length;for(e=0;e<r&&n[e]===a[e];e++);var i=r-e;for(t=1;t<=i&&n[r-t]===a[o-t];t++);return nn=a.slice(e,1<t?1-t:void 0)}function an(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function on(){return!0}function ln(){return!1}function sn(e){function t(t,n,r,a,o){for(var i in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=a,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(i)&&(t=e[i],this[i]=t?t(a):a[i]);return this.isDefaultPrevented=(null!=a.defaultPrevented?a.defaultPrevented:!1===a.returnValue)?on:ln,this.isPropagationStopped=ln,this}return a(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=on)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=on)},persist:function(){},isPersistent:on}),t}var cn,un,dn,fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pn=sn(fn),mn=a({},fn,{view:0,detail:0}),hn=sn(mn),gn=a({},mn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:An,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==dn&&(dn&&"mousemove"===e.type?(cn=e.screenX-dn.screenX,un=e.screenY-dn.screenY):un=cn=0,dn=e),cn)},movementY:function(e){return"movementY"in e?e.movementY:un}}),bn=sn(gn),vn=sn(a({},gn,{dataTransfer:0})),yn=sn(a({},mn,{relatedTarget:0})),wn=sn(a({},fn,{animationName:0,elapsedTime:0,pseudoElement:0})),kn=a({},fn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),En=sn(kn),Sn=sn(a({},fn,{data:0})),xn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Cn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Tn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _n(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Tn[e])&&!!t[e]}function An(){return _n}var Ln=a({},mn,{key:function(e){if(e.key){var t=xn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=an(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Cn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:An,charCode:function(e){return"keypress"===e.type?an(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?an(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Rn=sn(Ln),Nn=sn(a({},gn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Pn=sn(a({},mn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:An})),On=sn(a({},fn,{propertyName:0,elapsedTime:0,pseudoElement:0})),In=a({},gn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Dn=sn(In),Mn=[9,13,27,32],Fn=d&&"CompositionEvent"in window,Bn=null;d&&"documentMode"in document&&(Bn=document.documentMode);var jn=d&&"TextEvent"in window&&!Bn,zn=d&&(!Fn||Bn&&8<Bn&&11>=Bn),Un=String.fromCharCode(32),$n=!1;function qn(e,t){switch(e){case"keyup":return-1!==Mn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Gn=!1;var Zn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Vn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Zn[e.type]:"textarea"===t}function Wn(e,t,n,r){Ne(r),0<(t=Fr(t,"onChange")).length&&(n=new pn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Kn=null,Yn=null;function Qn(e){Lr(e,0)}function Xn(e){if(Q(aa(e)))return e}function Jn(e,t){if("change"===e)return t}var er=!1;if(d){var tr;if(d){var nr="oninput"in document;if(!nr){var rr=document.createElement("div");rr.setAttribute("oninput","return;"),nr="function"==typeof rr.oninput}tr=nr}else tr=!1;er=tr&&(!document.documentMode||9<document.documentMode)}function ar(){Kn&&(Kn.detachEvent("onpropertychange",or),Yn=Kn=null)}function or(e){if("value"===e.propertyName&&Xn(Yn)){var t=[];if(Wn(t,Yn,e,Te(e)),e=Qn,Fe)e(t);else{Fe=!0;try{Oe(e,t)}finally{Fe=!1,je()}}}}function ir(e,t,n){"focusin"===e?(ar(),Yn=n,(Kn=t).attachEvent("onpropertychange",or)):"focusout"===e&&ar()}function lr(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Xn(Yn)}function sr(e,t){if("click"===e)return Xn(t)}function cr(e,t){if("input"===e||"change"===e)return Xn(t)}var ur="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},dr=Object.prototype.hasOwnProperty;function fr(e,t){if(ur(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!dr.call(t,n[r])||!ur(e[n[r]],t[n[r]]))return!1;return!0}function pr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mr(e,t){var n,r=pr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=pr(r)}}function hr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?hr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function gr(){for(var e=window,t=X();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=X((e=t.contentWindow).document)}return t}function br(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var vr=d&&"documentMode"in document&&11>=document.documentMode,yr=null,wr=null,kr=null,Er=!1;function Sr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;Er||null==yr||yr!==X(r)||("selectionStart"in(r=yr)&&br(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},kr&&fr(kr,r)||(kr=r,0<(r=Fr(wr,"onSelect")).length&&(t=new pn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=yr)))}Dt("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),Dt("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),Dt(It,2);for(var xr="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),Cr=0;Cr<xr.length;Cr++)Ot.set(xr[Cr],0);u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Tr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),_r=new Set("cancel close invalid load scroll toggle".split(" ").concat(Tr));function Ar(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,a,o,l,s,c){if(Ke.apply(this,arguments),He){if(!He)throw Error(i(198));var u=Ge;He=!1,Ge=null,Ze||(Ze=!0,Ve=u)}}(r,t,void 0,e),e.currentTarget=null}function Lr(e,t){t=0!=(4&t);for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var i=r.length-1;0<=i;i--){var l=r[i],s=l.instance,c=l.currentTarget;if(l=l.listener,s!==o&&a.isPropagationStopped())break e;Ar(a,l,c),o=s}else for(i=0;i<r.length;i++){if(s=(l=r[i]).instance,c=l.currentTarget,l=l.listener,s!==o&&a.isPropagationStopped())break e;Ar(a,l,c),o=s}}}if(Ze)throw e=Ve,Ze=!1,Ve=null,e}function Rr(e,t){var n=ia(t),r=e+"__bubble";n.has(r)||(Ir(t,e,2,!1),n.add(r))}var Nr="_reactListening"+Math.random().toString(36).slice(2);function Pr(e){e[Nr]||(e[Nr]=!0,l.forEach((function(t){_r.has(t)||Or(t,!1,e,null),Or(t,!0,e,null)})))}function Or(e,t,n,r){var a=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,o=n;if("selectionchange"===e&&9!==n.nodeType&&(o=n.ownerDocument),null!==r&&!t&&_r.has(e)){if("scroll"!==e)return;a|=2,o=r}var i=ia(o),l=e+"__"+(t?"capture":"bubble");i.has(l)||(t&&(a|=4),Ir(o,e,a,t),i.add(l))}function Ir(e,t,n,r){var a=Ot.get(t);switch(void 0===a?2:a){case 0:a=Yt;break;case 1:a=Qt;break;default:a=Xt}n=a.bind(null,t,n,e),a=void 0,!Ue||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(a=!0),r?void 0!==a?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):void 0!==a?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function Dr(e,t,n,r,a){var o=r;if(0==(1&t)&&0==(2&t)&&null!==r)e:for(;;){if(null===r)return;var i=r.tag;if(3===i||4===i){var l=r.stateNode.containerInfo;if(l===a||8===l.nodeType&&l.parentNode===a)break;if(4===i)for(i=r.return;null!==i;){var s=i.tag;if((3===s||4===s)&&((s=i.stateNode.containerInfo)===a||8===s.nodeType&&s.parentNode===a))return;i=i.return}for(;null!==l;){if(null===(i=na(l)))return;if(5===(s=i.tag)||6===s){r=o=i;continue e}l=l.parentNode}}r=r.return}!function(e,t,n){if(Be)return e(t,n);Be=!0;try{Me(e,t,n)}finally{Be=!1,je()}}((function(){var r=o,a=Te(n),i=[];e:{var l=Pt.get(e);if(void 0!==l){var s=pn,c=e;switch(e){case"keypress":if(0===an(n))break e;case"keydown":case"keyup":s=Rn;break;case"focusin":c="focus",s=yn;break;case"focusout":c="blur",s=yn;break;case"beforeblur":case"afterblur":s=yn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":s=bn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":s=vn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":s=Pn;break;case At:case Lt:case Rt:s=wn;break;case Nt:s=On;break;case"scroll":s=hn;break;case"wheel":s=Dn;break;case"copy":case"cut":case"paste":s=En;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":s=Nn}var u=0!=(4&t),d=!u&&"scroll"===e,f=u?null!==l?l+"Capture":null:l;u=[];for(var p,m=r;null!==m;){var h=(p=m).stateNode;if(5===p.tag&&null!==h&&(p=h,null!==f&&(null!=(h=ze(m,f))&&u.push(Mr(m,h,p)))),d)break;m=m.return}0<u.length&&(l=new s(l,c,null,n,a),i.push({event:l,listeners:u}))}}if(0==(7&t)){if(s="mouseout"===e||"pointerout"===e,(!(l="mouseover"===e||"pointerover"===e)||0!=(16&t)||!(c=n.relatedTarget||n.fromElement)||!na(c)&&!c[ea])&&(s||l)&&(l=a.window===a?a:(l=a.ownerDocument)?l.defaultView||l.parentWindow:window,s?(s=r,null!==(c=(c=n.relatedTarget||n.toElement)?na(c):null)&&(c!==(d=Ye(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(s=null,c=r),s!==c)){if(u=bn,h="onMouseLeave",f="onMouseEnter",m="mouse","pointerout"!==e&&"pointerover"!==e||(u=Nn,h="onPointerLeave",f="onPointerEnter",m="pointer"),d=null==s?l:aa(s),p=null==c?l:aa(c),(l=new u(h,m+"leave",s,n,a)).target=d,l.relatedTarget=p,h=null,na(a)===r&&((u=new u(f,m+"enter",c,n,a)).target=p,u.relatedTarget=d,h=u),d=h,s&&c)e:{for(f=c,m=0,p=u=s;p;p=Br(p))m++;for(p=0,h=f;h;h=Br(h))p++;for(;0<m-p;)u=Br(u),m--;for(;0<p-m;)f=Br(f),p--;for(;m--;){if(u===f||null!==f&&u===f.alternate)break e;u=Br(u),f=Br(f)}u=null}else u=null;null!==s&&jr(i,l,s,u,!1),null!==c&&null!==d&&jr(i,d,c,u,!0)}if("select"===(s=(l=r?aa(r):window).nodeName&&l.nodeName.toLowerCase())||"input"===s&&"file"===l.type)var g=Jn;else if(Vn(l))if(er)g=cr;else{g=lr;var b=ir}else(s=l.nodeName)&&"input"===s.toLowerCase()&&("checkbox"===l.type||"radio"===l.type)&&(g=sr);switch(g&&(g=g(e,r))?Wn(i,g,n,a):(b&&b(e,l,r),"focusout"===e&&(b=l._wrapperState)&&b.controlled&&"number"===l.type&&ae(l,"number",l.value)),b=r?aa(r):window,e){case"focusin":(Vn(b)||"true"===b.contentEditable)&&(yr=b,wr=r,kr=null);break;case"focusout":kr=wr=yr=null;break;case"mousedown":Er=!0;break;case"contextmenu":case"mouseup":case"dragend":Er=!1,Sr(i,n,a);break;case"selectionchange":if(vr)break;case"keydown":case"keyup":Sr(i,n,a)}var v;if(Fn)e:{switch(e){case"compositionstart":var y="onCompositionStart";break e;case"compositionend":y="onCompositionEnd";break e;case"compositionupdate":y="onCompositionUpdate";break e}y=void 0}else Gn?qn(e,n)&&(y="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(y="onCompositionStart");y&&(zn&&"ko"!==n.locale&&(Gn||"onCompositionStart"!==y?"onCompositionEnd"===y&&Gn&&(v=rn()):(tn="value"in(en=a)?en.value:en.textContent,Gn=!0)),0<(b=Fr(r,y)).length&&(y=new Sn(y,e,null,n,a),i.push({event:y,listeners:b}),v?y.data=v:null!==(v=Hn(n))&&(y.data=v))),(v=jn?function(e,t){switch(e){case"compositionend":return Hn(t);case"keypress":return 32!==t.which?null:($n=!0,Un);case"textInput":return(e=t.data)===Un&&$n?null:e;default:return null}}(e,n):function(e,t){if(Gn)return"compositionend"===e||!Fn&&qn(e,t)?(e=rn(),nn=tn=en=null,Gn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return zn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Fr(r,"onBeforeInput")).length&&(a=new Sn("onBeforeInput","beforeinput",null,n,a),i.push({event:a,listeners:r}),a.data=v))}Lr(i,t)}))}function Mr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Fr(e,t){for(var n=t+"Capture",r=[];null!==e;){var a=e,o=a.stateNode;5===a.tag&&null!==o&&(a=o,null!=(o=ze(e,n))&&r.unshift(Mr(e,o,a)),null!=(o=ze(e,t))&&r.push(Mr(e,o,a))),e=e.return}return r}function Br(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function jr(e,t,n,r,a){for(var o=t._reactName,i=[];null!==n&&n!==r;){var l=n,s=l.alternate,c=l.stateNode;if(null!==s&&s===r)break;5===l.tag&&null!==c&&(l=c,a?null!=(s=ze(n,o))&&i.unshift(Mr(n,s,l)):a||null!=(s=ze(n,o))&&i.push(Mr(n,s,l))),n=n.return}0!==i.length&&e.push({event:t,listeners:i})}function zr(){}var Ur=null,$r=null;function qr(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Hr(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Gr="function"==typeof setTimeout?setTimeout:void 0,Zr="function"==typeof clearTimeout?clearTimeout:void 0;function Vr(e){1===e.nodeType?e.textContent="":9===e.nodeType&&(null!=(e=e.body)&&(e.textContent=""))}function Wr(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function Kr(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var Yr=0;var Qr=Math.random().toString(36).slice(2),Xr="__reactFiber$"+Qr,Jr="__reactProps$"+Qr,ea="__reactContainer$"+Qr,ta="__reactEvents$"+Qr;function na(e){var t=e[Xr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ea]||n[Xr]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Kr(e);null!==e;){if(n=e[Xr])return n;e=Kr(e)}return t}n=(e=n).parentNode}return null}function ra(e){return!(e=e[Xr]||e[ea])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function aa(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(i(33))}function oa(e){return e[Jr]||null}function ia(e){var t=e[ta];return void 0===t&&(t=e[ta]=new Set),t}var la=[],sa=-1;function ca(e){return{current:e}}function ua(e){0>sa||(e.current=la[sa],la[sa]=null,sa--)}function da(e,t){sa++,la[sa]=e.current,e.current=t}var fa={},pa=ca(fa),ma=ca(!1),ha=fa;function ga(e,t){var n=e.type.contextTypes;if(!n)return fa;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a,o={};for(a in n)o[a]=t[a];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function ba(e){return null!=(e=e.childContextTypes)}function va(){ua(ma),ua(pa)}function ya(e,t,n){if(pa.current!==fa)throw Error(i(168));da(pa,t),da(ma,n)}function wa(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in e))throw Error(i(108,V(t)||"Unknown",o));return a({},n,r)}function ka(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fa,ha=pa.current,da(pa,e),da(ma,ma.current),!0}function Ea(e,t,n){var r=e.stateNode;if(!r)throw Error(i(169));n?(e=wa(e,t,ha),r.__reactInternalMemoizedMergedChildContext=e,ua(ma),ua(pa),da(pa,e)):ua(ma),da(ma,n)}var Sa=null,xa=null,Ca=o.unstable_runWithPriority,Ta=o.unstable_scheduleCallback,_a=o.unstable_cancelCallback,Aa=o.unstable_shouldYield,La=o.unstable_requestPaint,Ra=o.unstable_now,Na=o.unstable_getCurrentPriorityLevel,Pa=o.unstable_ImmediatePriority,Oa=o.unstable_UserBlockingPriority,Ia=o.unstable_NormalPriority,Da=o.unstable_LowPriority,Ma=o.unstable_IdlePriority,Fa={},Ba=void 0!==La?La:function(){},ja=null,za=null,Ua=!1,$a=Ra(),qa=1e4>$a?Ra:function(){return Ra()-$a};function Ha(){switch(Na()){case Pa:return 99;case Oa:return 98;case Ia:return 97;case Da:return 96;case Ma:return 95;default:throw Error(i(332))}}function Ga(e){switch(e){case 99:return Pa;case 98:return Oa;case 97:return Ia;case 96:return Da;case 95:return Ma;default:throw Error(i(332))}}function Za(e,t){return e=Ga(e),Ca(e,t)}function Va(e,t,n){return e=Ga(e),Ta(e,t,n)}function Wa(){if(null!==za){var e=za;za=null,_a(e)}Ka()}function Ka(){if(!Ua&&null!==ja){Ua=!0;var e=0;try{var t=ja;Za(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),ja=null}catch(n){throw null!==ja&&(ja=ja.slice(e+1)),Ta(Pa,Wa),n}finally{Ua=!1}}}var Ya=k.ReactCurrentBatchConfig;function Qa(e,t){if(e&&e.defaultProps){for(var n in t=a({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var Xa=ca(null),Ja=null,eo=null,to=null;function no(){to=eo=Ja=null}function ro(e){var t=Xa.current;ua(Xa),e.type._context._currentValue=t}function ao(e,t){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)===t){if(null===n||(n.childLanes&t)===t)break;n.childLanes|=t}else e.childLanes|=t,null!==n&&(n.childLanes|=t);e=e.return}}function oo(e,t){Ja=e,to=eo=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(Fi=!0),e.firstContext=null)}function io(e,t){if(to!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(to=e,t=1073741823),t={context:e,observedBits:t,next:null},null===eo){if(null===Ja)throw Error(i(308));eo=t,Ja.dependencies={lanes:0,firstContext:t,responders:null}}else eo=eo.next=t;return e._currentValue}var lo=!1;function so(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function co(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function uo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function fo(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function po(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var a=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?a=o=i:o=o.next=i,n=n.next}while(null!==n);null===o?a=o=t:o=o.next=t}else a=o=t;return n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:o,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function mo(e,t,n,r){var o=e.updateQueue;lo=!1;var i=o.firstBaseUpdate,l=o.lastBaseUpdate,s=o.shared.pending;if(null!==s){o.shared.pending=null;var c=s,u=c.next;c.next=null,null===l?i=u:l.next=u,l=c;var d=e.alternate;if(null!==d){var f=(d=d.updateQueue).lastBaseUpdate;f!==l&&(null===f?d.firstBaseUpdate=u:f.next=u,d.lastBaseUpdate=c)}}if(null!==i){for(f=o.baseState,l=0,d=u=c=null;;){s=i.lane;var p=i.eventTime;if((r&s)===s){null!==d&&(d=d.next={eventTime:p,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var m=e,h=i;switch(s=t,p=n,h.tag){case 1:if("function"==typeof(m=h.payload)){f=m.call(p,f,s);break e}f=m;break e;case 3:m.flags=-4097&m.flags|64;case 0:if(null==(s="function"==typeof(m=h.payload)?m.call(p,f,s):m))break e;f=a({},f,s);break e;case 2:lo=!0}}null!==i.callback&&(e.flags|=32,null===(s=o.effects)?o.effects=[i]:s.push(i))}else p={eventTime:p,lane:s,tag:i.tag,payload:i.payload,callback:i.callback,next:null},null===d?(u=d=p,c=f):d=d.next=p,l|=s;if(null===(i=i.next)){if(null===(s=o.shared.pending))break;i=s.next,s.next=null,o.lastBaseUpdate=s,o.shared.pending=null}}null===d&&(c=f),o.baseState=c,o.firstBaseUpdate=u,o.lastBaseUpdate=d,Ul|=l,e.lanes=l,e.memoizedState=f}}function ho(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(null!==a){if(r.callback=null,r=n,"function"!=typeof a)throw Error(i(191,a));a.call(r)}}}var go=(new r.Component).refs;function bo(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:a({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var vo={isMounted:function(e){return!!(e=e._reactInternals)&&Ye(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=fs(),a=ps(e),o=uo(r,a);o.payload=t,null!=n&&(o.callback=n),fo(e,o),ms(e,a,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=fs(),a=ps(e),o=uo(r,a);o.tag=1,o.payload=t,null!=n&&(o.callback=n),fo(e,o),ms(e,a,r)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=fs(),r=ps(e),a=uo(n,r);a.tag=2,null!=t&&(a.callback=t),fo(e,a),ms(e,r,n)}};function yo(e,t,n,r,a,o,i){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,i):!t.prototype||!t.prototype.isPureReactComponent||(!fr(n,r)||!fr(a,o))}function wo(e,t,n){var r=!1,a=fa,o=t.contextType;return"object"==typeof o&&null!==o?o=io(o):(a=ba(t)?ha:pa.current,o=(r=null!=(r=t.contextTypes))?ga(e,a):fa),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=vo,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=o),t}function ko(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&vo.enqueueReplaceState(t,t.state,null)}function Eo(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs=go,so(e);var o=t.contextType;"object"==typeof o&&null!==o?a.context=io(o):(o=ba(t)?ha:pa.current,a.context=ga(e,o)),mo(e,n,a,r),a.state=e.memoizedState,"function"==typeof(o=t.getDerivedStateFromProps)&&(bo(e,t,o,n),a.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof a.getSnapshotBeforeUpdate||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||(t=a.state,"function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),t!==a.state&&vo.enqueueReplaceState(a,a.state,null),mo(e,n,a,r),a.state=e.memoizedState),"function"==typeof a.componentDidMount&&(e.flags|=4)}var So=Array.isArray;function xo(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(i(309));var r=n.stateNode}if(!r)throw Error(i(147,e));var a=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===a?t.ref:(t=function(e){var t=r.refs;t===go&&(t=r.refs={}),null===e?delete t[a]:t[a]=e},t._stringRef=a,t)}if("string"!=typeof e)throw Error(i(284));if(!n._owner)throw Error(i(290,e))}return e}function Co(e,t){if("textarea"!==e.type)throw Error(i(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function To(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.flags=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function a(e,t){return(e=Zs(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags=2,n):r:(t.flags=2,n):n}function l(t){return e&&null===t.alternate&&(t.flags=2),t}function s(e,t,n,r){return null===t||6!==t.tag?((t=Ys(n,e.mode,r)).return=e,t):((t=a(t,n)).return=e,t)}function c(e,t,n,r){return null!==t&&t.elementType===n.type?((r=a(t,n.props)).ref=xo(e,t,n),r.return=e,r):((r=Vs(n.type,n.key,n.props,null,e.mode,r)).ref=xo(e,t,n),r.return=e,r)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Qs(n,e.mode,r)).return=e,t):((t=a(t,n.children||[])).return=e,t)}function d(e,t,n,r,o){return null===t||7!==t.tag?((t=Ws(n,e.mode,r,o)).return=e,t):((t=a(t,n)).return=e,t)}function f(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=Ys(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case E:return(n=Vs(t.type,t.key,t.props,null,e.mode,n)).ref=xo(e,null,t),n.return=e,n;case S:return(t=Qs(t,e.mode,n)).return=e,t}if(So(t)||$(t))return(t=Ws(t,e.mode,n,null)).return=e,t;Co(e,t)}return null}function p(e,t,n,r){var a=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==a?null:s(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case E:return n.key===a?n.type===x?d(e,t,n.props.children,r,a):c(e,t,n,r):null;case S:return n.key===a?u(e,t,n,r):null}if(So(n)||$(n))return null!==a?null:d(e,t,n,r,null);Co(e,n)}return null}function m(e,t,n,r,a){if("string"==typeof r||"number"==typeof r)return s(t,e=e.get(n)||null,""+r,a);if("object"==typeof r&&null!==r){switch(r.$$typeof){case E:return e=e.get(null===r.key?n:r.key)||null,r.type===x?d(t,e,r.props.children,a,r.key):c(t,e,r,a);case S:return u(t,e=e.get(null===r.key?n:r.key)||null,r,a)}if(So(r)||$(r))return d(t,e=e.get(n)||null,r,a,null);Co(t,r)}return null}function h(a,i,l,s){for(var c=null,u=null,d=i,h=i=0,g=null;null!==d&&h<l.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var b=p(a,d,l[h],s);if(null===b){null===d&&(d=g);break}e&&d&&null===b.alternate&&t(a,d),i=o(b,i,h),null===u?c=b:u.sibling=b,u=b,d=g}if(h===l.length)return n(a,d),c;if(null===d){for(;h<l.length;h++)null!==(d=f(a,l[h],s))&&(i=o(d,i,h),null===u?c=d:u.sibling=d,u=d);return c}for(d=r(a,d);h<l.length;h++)null!==(g=m(d,a,h,l[h],s))&&(e&&null!==g.alternate&&d.delete(null===g.key?h:g.key),i=o(g,i,h),null===u?c=g:u.sibling=g,u=g);return e&&d.forEach((function(e){return t(a,e)})),c}function g(a,l,s,c){var u=$(s);if("function"!=typeof u)throw Error(i(150));if(null==(s=u.call(s)))throw Error(i(151));for(var d=u=null,h=l,g=l=0,b=null,v=s.next();null!==h&&!v.done;g++,v=s.next()){h.index>g?(b=h,h=null):b=h.sibling;var y=p(a,h,v.value,c);if(null===y){null===h&&(h=b);break}e&&h&&null===y.alternate&&t(a,h),l=o(y,l,g),null===d?u=y:d.sibling=y,d=y,h=b}if(v.done)return n(a,h),u;if(null===h){for(;!v.done;g++,v=s.next())null!==(v=f(a,v.value,c))&&(l=o(v,l,g),null===d?u=v:d.sibling=v,d=v);return u}for(h=r(a,h);!v.done;g++,v=s.next())null!==(v=m(h,a,g,v.value,c))&&(e&&null!==v.alternate&&h.delete(null===v.key?g:v.key),l=o(v,l,g),null===d?u=v:d.sibling=v,d=v);return e&&h.forEach((function(e){return t(a,e)})),u}return function(e,r,o,s){var c="object"==typeof o&&null!==o&&o.type===x&&null===o.key;c&&(o=o.props.children);var u="object"==typeof o&&null!==o;if(u)switch(o.$$typeof){case E:e:{for(u=o.key,c=r;null!==c;){if(c.key===u){if(7===c.tag){if(o.type===x){n(e,c.sibling),(r=a(c,o.props.children)).return=e,e=r;break e}}else if(c.elementType===o.type){n(e,c.sibling),(r=a(c,o.props)).ref=xo(e,c,o),r.return=e,e=r;break e}n(e,c);break}t(e,c),c=c.sibling}o.type===x?((r=Ws(o.props.children,e.mode,s,o.key)).return=e,e=r):((s=Vs(o.type,o.key,o.props,null,e.mode,s)).ref=xo(e,r,o),s.return=e,e=s)}return l(e);case S:e:{for(c=o.key;null!==r;){if(r.key===c){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),(r=a(r,o.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Qs(o,e.mode,s)).return=e,e=r}return l(e)}if("string"==typeof o||"number"==typeof o)return o=""+o,null!==r&&6===r.tag?(n(e,r.sibling),(r=a(r,o)).return=e,e=r):(n(e,r),(r=Ys(o,e.mode,s)).return=e,e=r),l(e);if(So(o))return h(e,r,o,s);if($(o))return g(e,r,o,s);if(u&&Co(e,o),void 0===o&&!c)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(i(152,V(e.type)||"Component"))}return n(e,r)}}var _o=To(!0),Ao=To(!1),Lo={},Ro=ca(Lo),No=ca(Lo),Po=ca(Lo);function Oo(e){if(e===Lo)throw Error(i(174));return e}function Io(e,t){switch(da(Po,t),da(No,e),da(Ro,Lo),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:me(null,"");break;default:t=me(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}ua(Ro),da(Ro,t)}function Do(){ua(Ro),ua(No),ua(Po)}function Mo(e){Oo(Po.current);var t=Oo(Ro.current),n=me(t,e.type);t!==n&&(da(No,e),da(Ro,n))}function Fo(e){No.current===e&&(ua(Ro),ua(No))}var Bo=ca(0);function jo(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var zo=null,Uo=null,$o=!1;function qo(e,t){var n=Hs(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.flags=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Ho(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);default:return!1}}function Go(e){if($o){var t=Uo;if(t){var n=t;if(!Ho(e,t)){if(!(t=Wr(n.nextSibling))||!Ho(e,t))return e.flags=-1025&e.flags|2,$o=!1,void(zo=e);qo(zo,n)}zo=e,Uo=Wr(t.firstChild)}else e.flags=-1025&e.flags|2,$o=!1,zo=e}}function Zo(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;zo=e}function Vo(e){if(e!==zo)return!1;if(!$o)return Zo(e),$o=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!Hr(t,e.memoizedProps))for(t=Uo;t;)qo(e,t),t=Wr(t.nextSibling);if(Zo(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(i(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){Uo=Wr(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}Uo=null}}else Uo=zo?Wr(e.stateNode.nextSibling):null;return!0}function Wo(){Uo=zo=null,$o=!1}var Ko=[];function Yo(){for(var e=0;e<Ko.length;e++)Ko[e]._workInProgressVersionPrimary=null;Ko.length=0}var Qo=k.ReactCurrentDispatcher,Xo=k.ReactCurrentBatchConfig,Jo=0,ei=null,ti=null,ni=null,ri=!1,ai=!1;function oi(){throw Error(i(321))}function ii(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ur(e[n],t[n]))return!1;return!0}function li(e,t,n,r,a,o){if(Jo=o,ei=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Qo.current=null===e||null===e.memoizedState?Oi:Ii,e=n(r,a),ai){o=0;do{if(ai=!1,!(25>o))throw Error(i(301));o+=1,ni=ti=null,t.updateQueue=null,Qo.current=Di,e=n(r,a)}while(ai)}if(Qo.current=Pi,t=null!==ti&&null!==ti.next,Jo=0,ni=ti=ei=null,ri=!1,t)throw Error(i(300));return e}function si(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ni?ei.memoizedState=ni=e:ni=ni.next=e,ni}function ci(){if(null===ti){var e=ei.alternate;e=null!==e?e.memoizedState:null}else e=ti.next;var t=null===ni?ei.memoizedState:ni.next;if(null!==t)ni=t,ti=e;else{if(null===e)throw Error(i(310));e={memoizedState:(ti=e).memoizedState,baseState:ti.baseState,baseQueue:ti.baseQueue,queue:ti.queue,next:null},null===ni?ei.memoizedState=ni=e:ni=ni.next=e}return ni}function ui(e,t){return"function"==typeof t?t(e):t}function di(e){var t=ci(),n=t.queue;if(null===n)throw Error(i(311));n.lastRenderedReducer=e;var r=ti,a=r.baseQueue,o=n.pending;if(null!==o){if(null!==a){var l=a.next;a.next=o.next,o.next=l}r.baseQueue=a=o,n.pending=null}if(null!==a){a=a.next,r=r.baseState;var s=l=o=null,c=a;do{var u=c.lane;if((Jo&u)===u)null!==s&&(s=s.next={lane:0,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),r=c.eagerReducer===e?c.eagerState:e(r,c.action);else{var d={lane:u,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===s?(l=s=d,o=r):s=s.next=d,ei.lanes|=u,Ul|=u}c=c.next}while(null!==c&&c!==a);null===s?o=r:s.next=l,ur(r,t.memoizedState)||(Fi=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=s,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function fi(e){var t=ci(),n=t.queue;if(null===n)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(null!==a){n.pending=null;var l=a=a.next;do{o=e(o,l.action),l=l.next}while(l!==a);ur(o,t.memoizedState)||(Fi=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function pi(e,t,n){var r=t._getVersion;r=r(t._source);var a=t._workInProgressVersionPrimary;if(null!==a?e=a===r:(e=e.mutableReadLanes,(e=(Jo&e)===e)&&(t._workInProgressVersionPrimary=r,Ko.push(t))),e)return n(t._source);throw Ko.push(t),Error(i(350))}function mi(e,t,n,r){var a=Ol;if(null===a)throw Error(i(349));var o=t._getVersion,l=o(t._source),s=Qo.current,c=s.useState((function(){return pi(a,t,n)})),u=c[1],d=c[0];c=ni;var f=e.memoizedState,p=f.refs,m=p.getSnapshot,h=f.source;f=f.subscribe;var g=ei;return e.memoizedState={refs:p,source:t,subscribe:r},s.useEffect((function(){p.getSnapshot=n,p.setSnapshot=u;var e=o(t._source);if(!ur(l,e)){e=n(t._source),ur(d,e)||(u(e),e=ps(g),a.mutableReadLanes|=e&a.pendingLanes),e=a.mutableReadLanes,a.entangledLanes|=e;for(var r=a.entanglements,i=e;0<i;){var s=31-Ht(i),c=1<<s;r[s]|=e,i&=~c}}}),[n,t,r]),s.useEffect((function(){return r(t._source,(function(){var e=p.getSnapshot,n=p.setSnapshot;try{n(e(t._source));var r=ps(g);a.mutableReadLanes|=r&a.pendingLanes}catch(o){n((function(){throw o}))}}))}),[t,r]),ur(m,n)&&ur(h,t)&&ur(f,r)||((e={pending:null,dispatch:null,lastRenderedReducer:ui,lastRenderedState:d}).dispatch=u=Ni.bind(null,ei,e),c.queue=e,c.baseQueue=null,d=pi(a,t,n),c.memoizedState=c.baseState=d),d}function hi(e,t,n){return mi(ci(),e,t,n)}function gi(e){var t=si();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:ui,lastRenderedState:e}).dispatch=Ni.bind(null,ei,e),[t.memoizedState,e]}function bi(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=ei.updateQueue)?(t={lastEffect:null},ei.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function vi(e){return e={current:e},si().memoizedState=e}function yi(){return ci().memoizedState}function wi(e,t,n,r){var a=si();ei.flags|=e,a.memoizedState=bi(1|t,n,void 0,void 0===r?null:r)}function ki(e,t,n,r){var a=ci();r=void 0===r?null:r;var o=void 0;if(null!==ti){var i=ti.memoizedState;if(o=i.destroy,null!==r&&ii(r,i.deps))return void bi(t,n,o,r)}ei.flags|=e,a.memoizedState=bi(1|t,n,o,r)}function Ei(e,t){return wi(516,4,e,t)}function Si(e,t){return ki(516,4,e,t)}function xi(e,t){return ki(4,2,e,t)}function Ci(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Ti(e,t,n){return n=null!=n?n.concat([e]):null,ki(4,2,Ci.bind(null,t,e),n)}function _i(){}function Ai(e,t){var n=ci();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ii(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Li(e,t){var n=ci();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ii(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ri(e,t){var n=Ha();Za(98>n?98:n,(function(){e(!0)})),Za(97<n?97:n,(function(){var n=Xo.transition;Xo.transition=1;try{e(!1),t()}finally{Xo.transition=n}}))}function Ni(e,t,n){var r=fs(),a=ps(e),o={lane:a,action:n,eagerReducer:null,eagerState:null,next:null},i=t.pending;if(null===i?o.next=o:(o.next=i.next,i.next=o),t.pending=o,i=e.alternate,e===ei||null!==i&&i===ei)ai=ri=!0;else{if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var l=t.lastRenderedState,s=i(l,n);if(o.eagerReducer=i,o.eagerState=s,ur(s,l))return}catch(c){}ms(e,a,r)}}var Pi={readContext:io,useCallback:oi,useContext:oi,useEffect:oi,useImperativeHandle:oi,useLayoutEffect:oi,useMemo:oi,useReducer:oi,useRef:oi,useState:oi,useDebugValue:oi,useDeferredValue:oi,useTransition:oi,useMutableSource:oi,useOpaqueIdentifier:oi,unstable_isNewReconciler:!1},Oi={readContext:io,useCallback:function(e,t){return si().memoizedState=[e,void 0===t?null:t],e},useContext:io,useEffect:Ei,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,wi(4,2,Ci.bind(null,t,e),n)},useLayoutEffect:function(e,t){return wi(4,2,e,t)},useMemo:function(e,t){var n=si();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=si();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Ni.bind(null,ei,e),[r.memoizedState,e]},useRef:vi,useState:gi,useDebugValue:_i,useDeferredValue:function(e){var t=gi(e),n=t[0],r=t[1];return Ei((function(){var t=Xo.transition;Xo.transition=1;try{r(e)}finally{Xo.transition=t}}),[e]),n},useTransition:function(){var e=gi(!1),t=e[0];return vi(e=Ri.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,n){var r=si();return r.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:n},mi(r,e,t,n)},useOpaqueIdentifier:function(){if($o){var e=!1,t=function(e){return{$$typeof:D,toString:e,valueOf:e}}((function(){throw e||(e=!0,n("r:"+(Yr++).toString(36))),Error(i(355))})),n=gi(t)[1];return 0==(2&ei.mode)&&(ei.flags|=516,bi(5,(function(){n("r:"+(Yr++).toString(36))}),void 0,null)),t}return gi(t="r:"+(Yr++).toString(36)),t},unstable_isNewReconciler:!1},Ii={readContext:io,useCallback:Ai,useContext:io,useEffect:Si,useImperativeHandle:Ti,useLayoutEffect:xi,useMemo:Li,useReducer:di,useRef:yi,useState:function(){return di(ui)},useDebugValue:_i,useDeferredValue:function(e){var t=di(ui),n=t[0],r=t[1];return Si((function(){var t=Xo.transition;Xo.transition=1;try{r(e)}finally{Xo.transition=t}}),[e]),n},useTransition:function(){var e=di(ui)[0];return[yi().current,e]},useMutableSource:hi,useOpaqueIdentifier:function(){return di(ui)[0]},unstable_isNewReconciler:!1},Di={readContext:io,useCallback:Ai,useContext:io,useEffect:Si,useImperativeHandle:Ti,useLayoutEffect:xi,useMemo:Li,useReducer:fi,useRef:yi,useState:function(){return fi(ui)},useDebugValue:_i,useDeferredValue:function(e){var t=fi(ui),n=t[0],r=t[1];return Si((function(){var t=Xo.transition;Xo.transition=1;try{r(e)}finally{Xo.transition=t}}),[e]),n},useTransition:function(){var e=fi(ui)[0];return[yi().current,e]},useMutableSource:hi,useOpaqueIdentifier:function(){return fi(ui)[0]},unstable_isNewReconciler:!1},Mi=k.ReactCurrentOwner,Fi=!1;function Bi(e,t,n,r){t.child=null===e?Ao(t,null,n,r):_o(t,e.child,n,r)}function ji(e,t,n,r,a){n=n.render;var o=t.ref;return oo(t,a),r=li(e,t,n,r,o,a),null===e||Fi?(t.flags|=1,Bi(e,t,r,a),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~a,ol(e,t,a))}function zi(e,t,n,r,a,o){if(null===e){var i=n.type;return"function"!=typeof i||Gs(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Vs(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,Ui(e,t,i,r,a,o))}return i=e.child,0==(a&o)&&(a=i.memoizedProps,(n=null!==(n=n.compare)?n:fr)(a,r)&&e.ref===t.ref)?ol(e,t,o):(t.flags|=1,(e=Zs(i,r)).ref=t.ref,e.return=t,t.child=e)}function Ui(e,t,n,r,a,o){if(null!==e&&fr(e.memoizedProps,r)&&e.ref===t.ref){if(Fi=!1,0==(o&a))return t.lanes=e.lanes,ol(e,t,o);0!=(16384&e.flags)&&(Fi=!0)}return Hi(e,t,n,r,o)}function $i(e,t,n){var r=t.pendingProps,a=r.children,o=null!==e?e.memoizedState:null;if("hidden"===r.mode||"unstable-defer-without-hiding"===r.mode)if(0==(4&t.mode))t.memoizedState={baseLanes:0},Es(t,n);else{if(0==(1073741824&n))return e=null!==o?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},Es(t,e),null;t.memoizedState={baseLanes:0},Es(t,null!==o?o.baseLanes:n)}else null!==o?(r=o.baseLanes|n,t.memoizedState=null):r=n,Es(t,r);return Bi(e,t,a,n),t.child}function qi(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=128)}function Hi(e,t,n,r,a){var o=ba(n)?ha:pa.current;return o=ga(t,o),oo(t,a),n=li(e,t,n,r,o,a),null===e||Fi?(t.flags|=1,Bi(e,t,n,a),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~a,ol(e,t,a))}function Gi(e,t,n,r,a){if(ba(n)){var o=!0;ka(t)}else o=!1;if(oo(t,a),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),wo(t,n,r),Eo(t,n,r,a),r=!0;else if(null===e){var i=t.stateNode,l=t.memoizedProps;i.props=l;var s=i.context,c=n.contextType;"object"==typeof c&&null!==c?c=io(c):c=ga(t,c=ba(n)?ha:pa.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof i.getSnapshotBeforeUpdate;d||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(l!==r||s!==c)&&ko(t,i,r,c),lo=!1;var f=t.memoizedState;i.state=f,mo(t,r,i,a),s=t.memoizedState,l!==r||f!==s||ma.current||lo?("function"==typeof u&&(bo(t,n,u,r),s=t.memoizedState),(l=lo||yo(t,n,l,r,f,s,c))?(d||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||("function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount()),"function"==typeof i.componentDidMount&&(t.flags|=4)):("function"==typeof i.componentDidMount&&(t.flags|=4),t.memoizedProps=r,t.memoizedState=s),i.props=r,i.state=s,i.context=c,r=l):("function"==typeof i.componentDidMount&&(t.flags|=4),r=!1)}else{i=t.stateNode,co(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:Qa(t.type,l),i.props=c,d=t.pendingProps,f=i.context,"object"==typeof(s=n.contextType)&&null!==s?s=io(s):s=ga(t,s=ba(n)?ha:pa.current);var p=n.getDerivedStateFromProps;(u="function"==typeof p||"function"==typeof i.getSnapshotBeforeUpdate)||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(l!==d||f!==s)&&ko(t,i,r,s),lo=!1,f=t.memoizedState,i.state=f,mo(t,r,i,a);var m=t.memoizedState;l!==d||f!==m||ma.current||lo?("function"==typeof p&&(bo(t,n,p,r),m=t.memoizedState),(c=lo||yo(t,n,c,r,f,m,s))?(u||"function"!=typeof i.UNSAFE_componentWillUpdate&&"function"!=typeof i.componentWillUpdate||("function"==typeof i.componentWillUpdate&&i.componentWillUpdate(r,m,s),"function"==typeof i.UNSAFE_componentWillUpdate&&i.UNSAFE_componentWillUpdate(r,m,s)),"function"==typeof i.componentDidUpdate&&(t.flags|=4),"function"==typeof i.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!=typeof i.componentDidUpdate||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=256),t.memoizedProps=r,t.memoizedState=m),i.props=r,i.state=m,i.context=s,r=c):("function"!=typeof i.componentDidUpdate||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=256),r=!1)}return Zi(e,t,n,r,o,a)}function Zi(e,t,n,r,a,o){qi(e,t);var i=0!=(64&t.flags);if(!r&&!i)return a&&Ea(t,n,!1),ol(e,t,o);r=t.stateNode,Mi.current=t;var l=i&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&i?(t.child=_o(t,e.child,null,o),t.child=_o(t,null,l,o)):Bi(e,t,l,o),t.memoizedState=r.state,a&&Ea(t,n,!0),t.child}function Vi(e){var t=e.stateNode;t.pendingContext?ya(0,t.pendingContext,t.pendingContext!==t.context):t.context&&ya(0,t.context,!1),Io(e,t.containerInfo)}var Wi,Ki,Yi,Qi={dehydrated:null,retryLane:0};function Xi(e,t,n){var r,a=t.pendingProps,o=Bo.current,i=!1;return(r=0!=(64&t.flags))||(r=(null===e||null!==e.memoizedState)&&0!=(2&o)),r?(i=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===a.fallback||!0===a.unstable_avoidThisFallback||(o|=1),da(Bo,1&o),null===e?(void 0!==a.fallback&&Go(t),e=a.children,o=a.fallback,i?(e=Ji(t,e,o,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Qi,e):"number"==typeof a.unstable_expectedLoadTime?(e=Ji(t,e,o,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Qi,t.lanes=33554432,e):((n=Ks({mode:"visible",children:e},t.mode,n,null)).return=t,t.child=n)):(e.memoizedState,i?(a=tl(e,t,a.children,a.fallback,n),i=t.child,o=e.child.memoizedState,i.memoizedState=null===o?{baseLanes:n}:{baseLanes:o.baseLanes|n},i.childLanes=e.childLanes&~n,t.memoizedState=Qi,a):(n=el(e,t,a.children,n),t.memoizedState=null,n))}function Ji(e,t,n,r){var a=e.mode,o=e.child;return t={mode:"hidden",children:t},0==(2&a)&&null!==o?(o.childLanes=0,o.pendingProps=t):o=Ks(t,a,0,null),n=Ws(n,a,r,null),o.return=e,n.return=e,o.sibling=n,e.child=o,n}function el(e,t,n,r){var a=e.child;return e=a.sibling,n=Zs(a,{mode:"visible",children:n}),0==(2&t.mode)&&(n.lanes=r),n.return=t,n.sibling=null,null!==e&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=n}function tl(e,t,n,r,a){var o=t.mode,i=e.child;e=i.sibling;var l={mode:"hidden",children:n};return 0==(2&o)&&t.child!==i?((n=t.child).childLanes=0,n.pendingProps=l,null!==(i=n.lastEffect)?(t.firstEffect=n.firstEffect,t.lastEffect=i,i.nextEffect=null):t.firstEffect=t.lastEffect=null):n=Zs(i,l),null!==e?r=Zs(e,r):(r=Ws(r,o,a,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}function nl(e,t){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),ao(e.return,t)}function rl(e,t,n,r,a,o){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a,lastEffect:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=a,i.lastEffect=o)}function al(e,t,n){var r=t.pendingProps,a=r.revealOrder,o=r.tail;if(Bi(e,t,r.children,n),0!=(2&(r=Bo.current)))r=1&r|2,t.flags|=64;else{if(null!==e&&0!=(64&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&nl(e,n);else if(19===e.tag)nl(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(da(Bo,r),0==(2&t.mode))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;null!==n;)null!==(e=n.alternate)&&null===jo(e)&&(a=n),n=n.sibling;null===(n=a)?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),rl(t,!1,a,n,o,t.lastEffect);break;case"backwards":for(n=null,a=t.child,t.child=null;null!==a;){if(null!==(e=a.alternate)&&null===jo(e)){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}rl(t,!0,n,null,o,t.lastEffect);break;case"together":rl(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function ol(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Ul|=t.lanes,0!=(n&t.childLanes)){if(null!==e&&t.child!==e.child)throw Error(i(153));if(null!==t.child){for(n=Zs(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Zs(e,e.pendingProps)).return=t;n.sibling=null}return t.child}return null}function il(e,t){if(!$o)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ll(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:case 17:return ba(t.type)&&va(),null;case 3:return Do(),ua(ma),ua(pa),Yo(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(Vo(t)?t.flags|=4:r.hydrate||(t.flags|=256)),null;case 5:Fo(t);var o=Oo(Po.current);if(n=t.type,null!==e&&null!=t.stateNode)Ki(e,t,n,r),e.ref!==t.ref&&(t.flags|=128);else{if(!r){if(null===t.stateNode)throw Error(i(166));return null}if(e=Oo(Ro.current),Vo(t)){r=t.stateNode,n=t.type;var l=t.memoizedProps;switch(r[Xr]=t,r[Jr]=l,n){case"dialog":Rr("cancel",r),Rr("close",r);break;case"iframe":case"object":case"embed":Rr("load",r);break;case"video":case"audio":for(e=0;e<Tr.length;e++)Rr(Tr[e],r);break;case"source":Rr("error",r);break;case"img":case"image":case"link":Rr("error",r),Rr("load",r);break;case"details":Rr("toggle",r);break;case"input":ee(r,l),Rr("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!l.multiple},Rr("invalid",r);break;case"textarea":se(r,l),Rr("invalid",r)}for(var c in xe(n,l),e=null,l)l.hasOwnProperty(c)&&(o=l[c],"children"===c?"string"==typeof o?r.textContent!==o&&(e=["children",o]):"number"==typeof o&&r.textContent!==""+o&&(e=["children",""+o]):s.hasOwnProperty(c)&&null!=o&&"onScroll"===c&&Rr("scroll",r));switch(n){case"input":Y(r),re(r,l,!0);break;case"textarea":Y(r),ue(r);break;case"select":case"option":break;default:"function"==typeof l.onClick&&(r.onclick=zr)}r=e,t.updateQueue=r,null!==r&&(t.flags|=4)}else{switch(c=9===o.nodeType?o:o.ownerDocument,e===de&&(e=pe(n)),e===de?"script"===n?((e=c.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=c.createElement(n,{is:r.is}):(e=c.createElement(n),"select"===n&&(c=e,r.multiple?c.multiple=!0:r.size&&(c.size=r.size))):e=c.createElementNS(e,n),e[Xr]=t,e[Jr]=r,Wi(e,t),t.stateNode=e,c=Ce(n,r),n){case"dialog":Rr("cancel",e),Rr("close",e),o=r;break;case"iframe":case"object":case"embed":Rr("load",e),o=r;break;case"video":case"audio":for(o=0;o<Tr.length;o++)Rr(Tr[o],e);o=r;break;case"source":Rr("error",e),o=r;break;case"img":case"image":case"link":Rr("error",e),Rr("load",e),o=r;break;case"details":Rr("toggle",e),o=r;break;case"input":ee(e,r),o=J(e,r),Rr("invalid",e);break;case"option":o=oe(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=a({},r,{value:void 0}),Rr("invalid",e);break;case"textarea":se(e,r),o=le(e,r),Rr("invalid",e);break;default:o=r}xe(n,o);var u=o;for(l in u)if(u.hasOwnProperty(l)){var d=u[l];"style"===l?Ee(e,d):"dangerouslySetInnerHTML"===l?null!=(d=d?d.__html:void 0)&&be(e,d):"children"===l?"string"==typeof d?("textarea"!==n||""!==d)&&ve(e,d):"number"==typeof d&&ve(e,""+d):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(s.hasOwnProperty(l)?null!=d&&"onScroll"===l&&Rr("scroll",e):null!=d&&w(e,l,d,c))}switch(n){case"input":Y(e),re(e,r,!1);break;case"textarea":Y(e),ue(e);break;case"option":null!=r.value&&e.setAttribute("value",""+W(r.value));break;case"select":e.multiple=!!r.multiple,null!=(l=r.value)?ie(e,!!r.multiple,l,!1):null!=r.defaultValue&&ie(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof o.onClick&&(e.onclick=zr)}qr(n,r)&&(t.flags|=4)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)Yi(0,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(i(166));n=Oo(Po.current),Oo(Ro.current),Vo(t)?(r=t.stateNode,n=t.memoizedProps,r[Xr]=t,r.nodeValue!==n&&(t.flags|=4)):((r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Xr]=t,t.stateNode=r)}return null;case 13:return ua(Bo),r=t.memoizedState,0!=(64&t.flags)?(t.lanes=n,t):(r=null!==r,n=!1,null===e?void 0!==t.memoizedProps.fallback&&Vo(t):n=null!==e.memoizedState,r&&!n&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&Bo.current)?0===Bl&&(Bl=3):(0!==Bl&&3!==Bl||(Bl=4),null===Ol||0==(134217727&Ul)&&0==(134217727&$l)||vs(Ol,Dl))),(r||n)&&(t.flags|=4),null);case 4:return Do(),null===e&&Pr(t.stateNode.containerInfo),null;case 10:return ro(t),null;case 19:if(ua(Bo),null===(r=t.memoizedState))return null;if(l=0!=(64&t.flags),null===(c=r.rendering))if(l)il(r,!1);else{if(0!==Bl||null!==e&&0!=(64&e.flags))for(e=t.child;null!==e;){if(null!==(c=jo(e))){for(t.flags|=64,il(r,!1),null!==(l=c.updateQueue)&&(t.updateQueue=l,t.flags|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=n,n=t.child;null!==n;)e=r,(l=n).flags&=2,l.nextEffect=null,l.firstEffect=null,l.lastEffect=null,null===(c=l.alternate)?(l.childLanes=0,l.lanes=e,l.child=null,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=c.childLanes,l.lanes=c.lanes,l.child=c.child,l.memoizedProps=c.memoizedProps,l.memoizedState=c.memoizedState,l.updateQueue=c.updateQueue,l.type=c.type,e=c.dependencies,l.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return da(Bo,1&Bo.current|2),t.child}e=e.sibling}null!==r.tail&&qa()>Zl&&(t.flags|=64,l=!0,il(r,!1),t.lanes=33554432)}else{if(!l)if(null!==(e=jo(c))){if(t.flags|=64,l=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),il(r,!0),null===r.tail&&"hidden"===r.tailMode&&!c.alternate&&!$o)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*qa()-r.renderingStartTime>Zl&&1073741824!==n&&(t.flags|=64,l=!0,il(r,!1),t.lanes=33554432);r.isBackwards?(c.sibling=t.child,t.child=c):(null!==(n=r.last)?n.sibling=c:t.child=c,r.last=c)}return null!==r.tail?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=qa(),n.sibling=null,t=Bo.current,da(Bo,l?1&t|2:1&t),n):null;case 23:case 24:return Ss(),null!==e&&null!==e.memoizedState!=(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==r.mode&&(t.flags|=4),null}throw Error(i(156,t.tag))}function sl(e){switch(e.tag){case 1:ba(e.type)&&va();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(Do(),ua(ma),ua(pa),Yo(),0!=(64&(t=e.flags)))throw Error(i(285));return e.flags=-4097&t|64,e;case 5:return Fo(e),null;case 13:return ua(Bo),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return ua(Bo),null;case 4:return Do(),null;case 10:return ro(e),null;case 23:case 24:return Ss(),null;default:return null}}function cl(e,t){try{var n="",r=t;do{n+=Z(r),r=r.return}while(r);var a=n}catch(o){a="\nError generating stack: "+o.message+"\n"+o.stack}return{value:e,source:t,stack:a}}function ul(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}Wi=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ki=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Oo(Ro.current);var i,l=null;switch(n){case"input":o=J(e,o),r=J(e,r),l=[];break;case"option":o=oe(e,o),r=oe(e,r),l=[];break;case"select":o=a({},o,{value:void 0}),r=a({},r,{value:void 0}),l=[];break;case"textarea":o=le(e,o),r=le(e,r),l=[];break;default:"function"!=typeof o.onClick&&"function"==typeof r.onClick&&(e.onclick=zr)}for(d in xe(n,r),n=null,o)if(!r.hasOwnProperty(d)&&o.hasOwnProperty(d)&&null!=o[d])if("style"===d){var c=o[d];for(i in c)c.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else"dangerouslySetInnerHTML"!==d&&"children"!==d&&"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&"autoFocus"!==d&&(s.hasOwnProperty(d)?l||(l=[]):(l=l||[]).push(d,null));for(d in r){var u=r[d];if(c=null!=o?o[d]:void 0,r.hasOwnProperty(d)&&u!==c&&(null!=u||null!=c))if("style"===d)if(c){for(i in c)!c.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in u)u.hasOwnProperty(i)&&c[i]!==u[i]&&(n||(n={}),n[i]=u[i])}else n||(l||(l=[]),l.push(d,n)),n=u;else"dangerouslySetInnerHTML"===d?(u=u?u.__html:void 0,c=c?c.__html:void 0,null!=u&&c!==u&&(l=l||[]).push(d,u)):"children"===d?"string"!=typeof u&&"number"!=typeof u||(l=l||[]).push(d,""+u):"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&(s.hasOwnProperty(d)?(null!=u&&"onScroll"===d&&Rr("scroll",e),l||c===u||(l=[])):"object"==typeof u&&null!==u&&u.$$typeof===D?u.toString():(l=l||[]).push(d,u))}n&&(l=l||[]).push("style",n);var d=l;(t.updateQueue=d)&&(t.flags|=4)}},Yi=function(e,t,n,r){n!==r&&(t.flags|=4)};var dl="function"==typeof WeakMap?WeakMap:Map;function fl(e,t,n){(n=uo(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Yl||(Yl=!0,Ql=r),ul(0,t)},n}function pl(e,t,n){(n=uo(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var a=t.value;n.payload=function(){return ul(0,t),r(a)}}var o=e.stateNode;return null!==o&&"function"==typeof o.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===Xl?Xl=new Set([this]):Xl.add(this),ul(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}var ml="function"==typeof WeakSet?WeakSet:Set;function hl(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(n){zs(e,n)}else t.current=null}function gl(e,t){switch(t.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17:return;case 1:if(256&t.flags&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:Qa(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(256&t.flags&&Vr(t.stateNode.containerInfo))}throw Error(i(163))}function bl(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{if(3==(3&e.tag)){var r=e.create;e.destroy=r()}e=e.next}while(e!==t)}if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{var a=e;r=a.next,0!=(4&(a=a.tag))&&0!=(1&a)&&(Fs(n,e),Ms(n,e)),e=r}while(e!==t)}return;case 1:return e=n.stateNode,4&n.flags&&(null===t?e.componentDidMount():(r=n.elementType===n.type?t.memoizedProps:Qa(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=n.updateQueue)&&ho(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:case 1:e=n.child.stateNode}ho(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.flags&&qr(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&Et(n)))))}throw Error(i(163))}function vl(e,t){for(var n=e;;){if(5===n.tag){var r=n.stateNode;if(t)"function"==typeof(r=r.style).setProperty?r.setProperty("display","none","important"):r.display="none";else{r=n.stateNode;var a=n.memoizedProps.style;a=null!=a&&a.hasOwnProperty("display")?a.display:null,r.style.display=ke("display",a)}}else if(6===n.tag)n.stateNode.nodeValue=t?"":n.memoizedProps;else if((23!==n.tag&&24!==n.tag||null===n.memoizedState||n===e)&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function yl(e,t){if(xa&&"function"==typeof xa.onCommitFiberUnmount)try{xa.onCommitFiberUnmount(Sa,t)}catch(o){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var n=e=e.next;do{var r=n,a=r.destroy;if(r=r.tag,void 0!==a)if(0!=(4&r))Fs(t,n);else{r=t;try{a()}catch(o){zs(r,o)}}n=n.next}while(n!==e)}break;case 1:if(hl(t),"function"==typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(o){zs(t,o)}break;case 5:hl(t);break;case 4:Cl(e,t)}}function wl(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function kl(e){return 5===e.tag||3===e.tag||4===e.tag}function El(e){e:{for(var t=e.return;null!==t;){if(kl(t))break e;t=t.return}throw Error(i(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(i(161))}16&n.flags&&(ve(t,""),n.flags&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||kl(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.flags)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.flags)){n=n.stateNode;break e}}r?Sl(e,n,t):xl(e,n,t)}function Sl(e,t,n){var r=e.tag,a=5===r||6===r;if(a)e=a?e.stateNode:e.stateNode.instance,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=zr));else if(4!==r&&null!==(e=e.child))for(Sl(e,t,n),e=e.sibling;null!==e;)Sl(e,t,n),e=e.sibling}function xl(e,t,n){var r=e.tag,a=5===r||6===r;if(a)e=a?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(xl(e,t,n),e=e.sibling;null!==e;)xl(e,t,n),e=e.sibling}function Cl(e,t){for(var n,r,a=t,o=!1;;){if(!o){o=a.return;e:for(;;){if(null===o)throw Error(i(160));switch(n=o.stateNode,o.tag){case 5:r=!1;break e;case 3:case 4:n=n.containerInfo,r=!0;break e}o=o.return}o=!0}if(5===a.tag||6===a.tag){e:for(var l=e,s=a,c=s;;)if(yl(l,c),null!==c.child&&4!==c.tag)c.child.return=c,c=c.child;else{if(c===s)break e;for(;null===c.sibling;){if(null===c.return||c.return===s)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}r?(l=n,s=a.stateNode,8===l.nodeType?l.parentNode.removeChild(s):l.removeChild(s)):n.removeChild(a.stateNode)}else if(4===a.tag){if(null!==a.child){n=a.stateNode.containerInfo,r=!0,a.child.return=a,a=a.child;continue}}else if(yl(e,a),null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break;for(;null===a.sibling;){if(null===a.return||a.return===t)return;4===(a=a.return).tag&&(o=!1)}a.sibling.return=a.return,a=a.sibling}}function Tl(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var r=n=n.next;do{3==(3&r.tag)&&(e=r.destroy,r.destroy=void 0,void 0!==e&&e()),r=r.next}while(r!==n)}return;case 1:case 12:case 17:return;case 5:if(null!=(n=t.stateNode)){r=t.memoizedProps;var a=null!==e?e.memoizedProps:r;e=t.type;var o=t.updateQueue;if(t.updateQueue=null,null!==o){for(n[Jr]=r,"input"===e&&"radio"===r.type&&null!=r.name&&te(n,r),Ce(e,a),t=Ce(e,r),a=0;a<o.length;a+=2){var l=o[a],s=o[a+1];"style"===l?Ee(n,s):"dangerouslySetInnerHTML"===l?be(n,s):"children"===l?ve(n,s):w(n,l,s,t)}switch(e){case"input":ne(n,r);break;case"textarea":ce(n,r);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(o=r.value)?ie(n,!!r.multiple,o,!1):e!==!!r.multiple&&(null!=r.defaultValue?ie(n,!!r.multiple,r.defaultValue,!0):ie(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(i(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((n=t.stateNode).hydrate&&(n.hydrate=!1,Et(n.containerInfo)));case 13:return null!==t.memoizedState&&(Gl=qa(),vl(t.child,!0)),void _l(t);case 19:return void _l(t);case 23:case 24:return void vl(t,null!==t.memoizedState)}throw Error(i(163))}function _l(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new ml),t.forEach((function(t){var r=$s.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Al(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&(null!==(t=t.memoizedState)&&null===t.dehydrated)}var Ll=Math.ceil,Rl=k.ReactCurrentDispatcher,Nl=k.ReactCurrentOwner,Pl=0,Ol=null,Il=null,Dl=0,Ml=0,Fl=ca(0),Bl=0,jl=null,zl=0,Ul=0,$l=0,ql=0,Hl=null,Gl=0,Zl=1/0;function Vl(){Zl=qa()+500}var Wl,Kl=null,Yl=!1,Ql=null,Xl=null,Jl=!1,es=null,ts=90,ns=[],rs=[],as=null,os=0,is=null,ls=-1,ss=0,cs=0,us=null,ds=!1;function fs(){return 0!=(48&Pl)?qa():-1!==ls?ls:ls=qa()}function ps(e){if(0==(2&(e=e.mode)))return 1;if(0==(4&e))return 99===Ha()?1:2;if(0===ss&&(ss=zl),0!==Ya.transition){0!==cs&&(cs=null!==Hl?Hl.pendingLanes:0),e=ss;var t=4186112&~cs;return 0===(t&=-t)&&(0===(t=(e=4186112&~e)&-e)&&(t=8192)),t}return e=Ha(),0!=(4&Pl)&&98===e?e=zt(12,ss):e=zt(e=function(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(e),ss),e}function ms(e,t,n){if(50<os)throw os=0,is=null,Error(i(185));if(null===(e=hs(e,t)))return null;qt(e,t,n),e===Ol&&($l|=t,4===Bl&&vs(e,Dl));var r=Ha();1===t?0!=(8&Pl)&&0==(48&Pl)?ys(e):(gs(e,n),0===Pl&&(Vl(),Wa())):(0==(4&Pl)||98!==r&&99!==r||(null===as?as=new Set([e]):as.add(e)),gs(e,n)),Hl=e}function hs(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}function gs(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,a=e.pingedLanes,o=e.expirationTimes,l=e.pendingLanes;0<l;){var s=31-Ht(l),c=1<<s,u=o[s];if(-1===u){if(0==(c&r)||0!=(c&a)){u=t,Ft(c);var d=Mt;o[s]=10<=d?u+250:6<=d?u+5e3:-1}}else u<=t&&(e.expiredLanes|=c);l&=~c}if(r=Bt(e,e===Ol?Dl:0),t=Mt,0===r)null!==n&&(n!==Fa&&_a(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==Fa&&_a(n)}15===t?(n=ys.bind(null,e),null===ja?(ja=[n],za=Ta(Pa,Ka)):ja.push(n),n=Fa):14===t?n=Va(99,ys.bind(null,e)):(n=function(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(i(358,e))}}(t),n=Va(n,bs.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function bs(e){if(ls=-1,cs=ss=0,0!=(48&Pl))throw Error(i(327));var t=e.callbackNode;if(Ds()&&e.callbackNode!==t)return null;var n=Bt(e,e===Ol?Dl:0);if(0===n)return null;var r=n,a=Pl;Pl|=16;var o=Ts();for(Ol===e&&Dl===r||(Vl(),xs(e,r));;)try{Ls();break}catch(s){Cs(e,s)}if(no(),Rl.current=o,Pl=a,null!==Il?r=0:(Ol=null,Dl=0,r=Bl),0!=(zl&$l))xs(e,0);else if(0!==r){if(2===r&&(Pl|=64,e.hydrate&&(e.hydrate=!1,Vr(e.containerInfo)),0!==(n=jt(e))&&(r=_s(e,n))),1===r)throw t=jl,xs(e,0),vs(e,n),gs(e,qa()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(i(345));case 2:case 5:Ps(e);break;case 3:if(vs(e,n),(62914560&n)===n&&10<(r=Gl+500-qa())){if(0!==Bt(e,0))break;if(((a=e.suspendedLanes)&n)!==n){fs(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Gr(Ps.bind(null,e),r);break}Ps(e);break;case 4:if(vs(e,n),(4186112&n)===n)break;for(r=e.eventTimes,a=-1;0<n;){var l=31-Ht(n);o=1<<l,(l=r[l])>a&&(a=l),n&=~o}if(n=a,10<(n=(120>(n=qa()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Ll(n/1960))-n)){e.timeoutHandle=Gr(Ps.bind(null,e),n);break}Ps(e);break;default:throw Error(i(329))}}return gs(e,qa()),e.callbackNode===t?bs.bind(null,e):null}function vs(e,t){for(t&=~ql,t&=~$l,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ht(t),r=1<<n;e[n]=-1,t&=~r}}function ys(e){if(0!=(48&Pl))throw Error(i(327));if(Ds(),e===Ol&&0!=(e.expiredLanes&Dl)){var t=Dl,n=_s(e,t);0!=(zl&$l)&&(n=_s(e,t=Bt(e,t)))}else n=_s(e,t=Bt(e,0));if(0!==e.tag&&2===n&&(Pl|=64,e.hydrate&&(e.hydrate=!1,Vr(e.containerInfo)),0!==(t=jt(e))&&(n=_s(e,t))),1===n)throw n=jl,xs(e,0),vs(e,t),gs(e,qa()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ps(e),gs(e,qa()),null}function ws(e,t){var n=Pl;Pl|=1;try{return e(t)}finally{0===(Pl=n)&&(Vl(),Wa())}}function ks(e,t){var n=Pl;Pl&=-2,Pl|=8;try{return e(t)}finally{0===(Pl=n)&&(Vl(),Wa())}}function Es(e,t){da(Fl,Ml),Ml|=t,zl|=t}function Ss(){Ml=Fl.current,ua(Fl)}function xs(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,Zr(n)),null!==Il)for(n=Il.return;null!==n;){var r=n;switch(r.tag){case 1:null!=(r=r.type.childContextTypes)&&va();break;case 3:Do(),ua(ma),ua(pa),Yo();break;case 5:Fo(r);break;case 4:Do();break;case 13:case 19:ua(Bo);break;case 10:ro(r);break;case 23:case 24:Ss()}n=n.return}Ol=e,Il=Zs(e.current,null),Dl=Ml=zl=t,Bl=0,jl=null,ql=$l=Ul=0}function Cs(e,t){for(;;){var n=Il;try{if(no(),Qo.current=Pi,ri){for(var r=ei.memoizedState;null!==r;){var a=r.queue;null!==a&&(a.pending=null),r=r.next}ri=!1}if(Jo=0,ni=ti=ei=null,ai=!1,Nl.current=null,null===n||null===n.return){Bl=1,jl=t,Il=null;break}e:{var o=e,i=n.return,l=n,s=t;if(t=Dl,l.flags|=2048,l.firstEffect=l.lastEffect=null,null!==s&&"object"==typeof s&&"function"==typeof s.then){var c=s;if(0==(2&l.mode)){var u=l.alternate;u?(l.updateQueue=u.updateQueue,l.memoizedState=u.memoizedState,l.lanes=u.lanes):(l.updateQueue=null,l.memoizedState=null)}var d=0!=(1&Bo.current),f=i;do{var p;if(p=13===f.tag){var m=f.memoizedState;if(null!==m)p=null!==m.dehydrated;else{var h=f.memoizedProps;p=void 0!==h.fallback&&(!0!==h.unstable_avoidThisFallback||!d)}}if(p){var g=f.updateQueue;if(null===g){var b=new Set;b.add(c),f.updateQueue=b}else g.add(c);if(0==(2&f.mode)){if(f.flags|=64,l.flags|=16384,l.flags&=-2981,1===l.tag)if(null===l.alternate)l.tag=17;else{var v=uo(-1,1);v.tag=2,fo(l,v)}l.lanes|=1;break e}s=void 0,l=t;var y=o.pingCache;if(null===y?(y=o.pingCache=new dl,s=new Set,y.set(c,s)):void 0===(s=y.get(c))&&(s=new Set,y.set(c,s)),!s.has(l)){s.add(l);var w=Us.bind(null,o,c,l);c.then(w,w)}f.flags|=4096,f.lanes=t;break e}f=f.return}while(null!==f);s=Error((V(l.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==Bl&&(Bl=2),s=cl(s,l),f=i;do{switch(f.tag){case 3:o=s,f.flags|=4096,t&=-t,f.lanes|=t,po(f,fl(0,o,t));break e;case 1:o=s;var k=f.type,E=f.stateNode;if(0==(64&f.flags)&&("function"==typeof k.getDerivedStateFromError||null!==E&&"function"==typeof E.componentDidCatch&&(null===Xl||!Xl.has(E)))){f.flags|=4096,t&=-t,f.lanes|=t,po(f,pl(f,o,t));break e}}f=f.return}while(null!==f)}Ns(n)}catch(S){t=S,Il===n&&null!==n&&(Il=n=n.return);continue}break}}function Ts(){var e=Rl.current;return Rl.current=Pi,null===e?Pi:e}function _s(e,t){var n=Pl;Pl|=16;var r=Ts();for(Ol===e&&Dl===t||xs(e,t);;)try{As();break}catch(a){Cs(e,a)}if(no(),Pl=n,Rl.current=r,null!==Il)throw Error(i(261));return Ol=null,Dl=0,Bl}function As(){for(;null!==Il;)Rs(Il)}function Ls(){for(;null!==Il&&!Aa();)Rs(Il)}function Rs(e){var t=Wl(e.alternate,e,Ml);e.memoizedProps=e.pendingProps,null===t?Ns(e):Il=t,Nl.current=null}function Ns(e){var t=e;do{var n=t.alternate;if(e=t.return,0==(2048&t.flags)){if(null!==(n=ll(n,t,Ml)))return void(Il=n);if(24!==(n=t).tag&&23!==n.tag||null===n.memoizedState||0!=(1073741824&Ml)||0==(4&n.mode)){for(var r=0,a=n.child;null!==a;)r|=a.lanes|a.childLanes,a=a.sibling;n.childLanes=r}null!==e&&0==(2048&e.flags)&&(null===e.firstEffect&&(e.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(null!==e.lastEffect?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}else{if(null!==(n=sl(t)))return n.flags&=2047,void(Il=n);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(null!==(t=t.sibling))return void(Il=t);Il=t=e}while(null!==t);0===Bl&&(Bl=5)}function Ps(e){var t=Ha();return Za(99,Os.bind(null,e,t)),null}function Os(e,t){do{Ds()}while(null!==es);if(0!=(48&Pl))throw Error(i(327));var n=e.finishedWork;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(i(177));e.callbackNode=null;var r=n.lanes|n.childLanes,a=r,o=e.pendingLanes&~a;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=a,e.mutableReadLanes&=a,e.entangledLanes&=a,a=e.entanglements;for(var l=e.eventTimes,s=e.expirationTimes;0<o;){var c=31-Ht(o),u=1<<c;a[c]=0,l[c]=-1,s[c]=-1,o&=~u}if(null!==as&&0==(24&r)&&as.has(e)&&as.delete(e),e===Ol&&(Il=Ol=null,Dl=0),1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){if(a=Pl,Pl|=32,Nl.current=null,Ur=Kt,br(l=gr())){if("selectionStart"in l)s={start:l.selectionStart,end:l.selectionEnd};else e:if(s=(s=l.ownerDocument)&&s.defaultView||window,(u=s.getSelection&&s.getSelection())&&0!==u.rangeCount){s=u.anchorNode,o=u.anchorOffset,c=u.focusNode,u=u.focusOffset;try{s.nodeType,c.nodeType}catch(T){s=null;break e}var d=0,f=-1,p=-1,m=0,h=0,g=l,b=null;t:for(;;){for(var v;g!==s||0!==o&&3!==g.nodeType||(f=d+o),g!==c||0!==u&&3!==g.nodeType||(p=d+u),3===g.nodeType&&(d+=g.nodeValue.length),null!==(v=g.firstChild);)b=g,g=v;for(;;){if(g===l)break t;if(b===s&&++m===o&&(f=d),b===c&&++h===u&&(p=d),null!==(v=g.nextSibling))break;b=(g=b).parentNode}g=v}s=-1===f||-1===p?null:{start:f,end:p}}else s=null;s=s||{start:0,end:0}}else s=null;$r={focusedElem:l,selectionRange:s},Kt=!1,us=null,ds=!1,Kl=r;do{try{Is()}catch(T){if(null===Kl)throw Error(i(330));zs(Kl,T),Kl=Kl.nextEffect}}while(null!==Kl);us=null,Kl=r;do{try{for(l=e;null!==Kl;){var y=Kl.flags;if(16&y&&ve(Kl.stateNode,""),128&y){var w=Kl.alternate;if(null!==w){var k=w.ref;null!==k&&("function"==typeof k?k(null):k.current=null)}}switch(1038&y){case 2:El(Kl),Kl.flags&=-3;break;case 6:El(Kl),Kl.flags&=-3,Tl(Kl.alternate,Kl);break;case 1024:Kl.flags&=-1025;break;case 1028:Kl.flags&=-1025,Tl(Kl.alternate,Kl);break;case 4:Tl(Kl.alternate,Kl);break;case 8:Cl(l,s=Kl);var E=s.alternate;wl(s),null!==E&&wl(E)}Kl=Kl.nextEffect}}catch(T){if(null===Kl)throw Error(i(330));zs(Kl,T),Kl=Kl.nextEffect}}while(null!==Kl);if(k=$r,w=gr(),y=k.focusedElem,l=k.selectionRange,w!==y&&y&&y.ownerDocument&&hr(y.ownerDocument.documentElement,y)){null!==l&&br(y)&&(w=l.start,void 0===(k=l.end)&&(k=w),"selectionStart"in y?(y.selectionStart=w,y.selectionEnd=Math.min(k,y.value.length)):(k=(w=y.ownerDocument||document)&&w.defaultView||window).getSelection&&(k=k.getSelection(),s=y.textContent.length,E=Math.min(l.start,s),l=void 0===l.end?E:Math.min(l.end,s),!k.extend&&E>l&&(s=l,l=E,E=s),s=mr(y,E),o=mr(y,l),s&&o&&(1!==k.rangeCount||k.anchorNode!==s.node||k.anchorOffset!==s.offset||k.focusNode!==o.node||k.focusOffset!==o.offset)&&((w=w.createRange()).setStart(s.node,s.offset),k.removeAllRanges(),E>l?(k.addRange(w),k.extend(o.node,o.offset)):(w.setEnd(o.node,o.offset),k.addRange(w))))),w=[];for(k=y;k=k.parentNode;)1===k.nodeType&&w.push({element:k,left:k.scrollLeft,top:k.scrollTop});for("function"==typeof y.focus&&y.focus(),y=0;y<w.length;y++)(k=w[y]).element.scrollLeft=k.left,k.element.scrollTop=k.top}Kt=!!Ur,$r=Ur=null,e.current=n,Kl=r;do{try{for(y=e;null!==Kl;){var S=Kl.flags;if(36&S&&bl(y,Kl.alternate,Kl),128&S){w=void 0;var x=Kl.ref;if(null!==x){var C=Kl.stateNode;Kl.tag,w=C,"function"==typeof x?x(w):x.current=w}}Kl=Kl.nextEffect}}catch(T){if(null===Kl)throw Error(i(330));zs(Kl,T),Kl=Kl.nextEffect}}while(null!==Kl);Kl=null,Ba(),Pl=a}else e.current=n;if(Jl)Jl=!1,es=e,ts=t;else for(Kl=r;null!==Kl;)t=Kl.nextEffect,Kl.nextEffect=null,8&Kl.flags&&((S=Kl).sibling=null,S.stateNode=null),Kl=t;if(0===(r=e.pendingLanes)&&(Xl=null),1===r?e===is?os++:(os=0,is=e):os=0,n=n.stateNode,xa&&"function"==typeof xa.onCommitFiberRoot)try{xa.onCommitFiberRoot(Sa,n,void 0,64==(64&n.current.flags))}catch(T){}if(gs(e,qa()),Yl)throw Yl=!1,e=Ql,Ql=null,e;return 0!=(8&Pl)||Wa(),null}function Is(){for(;null!==Kl;){var e=Kl.alternate;ds||null===us||(0!=(8&Kl.flags)?et(Kl,us)&&(ds=!0):13===Kl.tag&&Al(e,Kl)&&et(Kl,us)&&(ds=!0));var t=Kl.flags;0!=(256&t)&&gl(e,Kl),0==(512&t)||Jl||(Jl=!0,Va(97,(function(){return Ds(),null}))),Kl=Kl.nextEffect}}function Ds(){if(90!==ts){var e=97<ts?97:ts;return ts=90,Za(e,Bs)}return!1}function Ms(e,t){ns.push(t,e),Jl||(Jl=!0,Va(97,(function(){return Ds(),null})))}function Fs(e,t){rs.push(t,e),Jl||(Jl=!0,Va(97,(function(){return Ds(),null})))}function Bs(){if(null===es)return!1;var e=es;if(es=null,0!=(48&Pl))throw Error(i(331));var t=Pl;Pl|=32;var n=rs;rs=[];for(var r=0;r<n.length;r+=2){var a=n[r],o=n[r+1],l=a.destroy;if(a.destroy=void 0,"function"==typeof l)try{l()}catch(c){if(null===o)throw Error(i(330));zs(o,c)}}for(n=ns,ns=[],r=0;r<n.length;r+=2){a=n[r],o=n[r+1];try{var s=a.create;a.destroy=s()}catch(c){if(null===o)throw Error(i(330));zs(o,c)}}for(s=e.current.firstEffect;null!==s;)e=s.nextEffect,s.nextEffect=null,8&s.flags&&(s.sibling=null,s.stateNode=null),s=e;return Pl=t,Wa(),!0}function js(e,t,n){fo(e,t=fl(0,t=cl(n,t),1)),t=fs(),null!==(e=hs(e,1))&&(qt(e,1,t),gs(e,t))}function zs(e,t){if(3===e.tag)js(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){js(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Xl||!Xl.has(r))){var a=pl(n,e=cl(t,e),1);if(fo(n,a),a=fs(),null!==(n=hs(n,1)))qt(n,1,a),gs(n,a);else if("function"==typeof r.componentDidCatch&&(null===Xl||!Xl.has(r)))try{r.componentDidCatch(t,e)}catch(o){}break}}n=n.return}}function Us(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=fs(),e.pingedLanes|=e.suspendedLanes&n,Ol===e&&(Dl&n)===n&&(4===Bl||3===Bl&&(62914560&Dl)===Dl&&500>qa()-Gl?xs(e,0):ql|=n),gs(e,t)}function $s(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(0==(2&(t=e.mode))?t=1:0==(4&t)?t=99===Ha()?1:2:(0===ss&&(ss=zl),0===(t=Ut(62914560&~ss))&&(t=4194304))),n=fs(),null!==(e=hs(e,t))&&(qt(e,t,n),gs(e,n))}function qs(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Hs(e,t,n,r){return new qs(e,t,n,r)}function Gs(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Zs(e,t){var n=e.alternate;return null===n?((n=Hs(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Vs(e,t,n,r,a,o){var l=2;if(r=e,"function"==typeof e)Gs(e)&&(l=1);else if("string"==typeof e)l=5;else e:switch(e){case x:return Ws(n.children,a,o,t);case M:l=8,a|=16;break;case C:l=8,a|=1;break;case T:return(e=Hs(12,n,t,8|a)).elementType=T,e.type=T,e.lanes=o,e;case R:return(e=Hs(13,n,t,a)).type=R,e.elementType=R,e.lanes=o,e;case N:return(e=Hs(19,n,t,a)).elementType=N,e.lanes=o,e;case F:return Ks(n,a,o,t);case B:return(e=Hs(24,n,t,a)).elementType=B,e.lanes=o,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case _:l=10;break e;case A:l=9;break e;case L:l=11;break e;case P:l=14;break e;case O:l=16,r=null;break e;case I:l=22;break e}throw Error(i(130,null==e?e:typeof e,""))}return(t=Hs(l,n,t,a)).elementType=e,t.type=r,t.lanes=o,t}function Ws(e,t,n,r){return(e=Hs(7,e,r,t)).lanes=n,e}function Ks(e,t,n,r){return(e=Hs(23,e,r,t)).elementType=F,e.lanes=n,e}function Ys(e,t,n){return(e=Hs(6,e,null,t)).lanes=n,e}function Qs(e,t,n){return(t=Hs(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Xs(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=$t(0),this.expirationTimes=$t(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$t(0),this.mutableSourceEagerHydrationData=null}function Js(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:S,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function ec(e,t,n,r){var a=t.current,o=fs(),l=ps(a);e:if(n){t:{if(Ye(n=n._reactInternals)!==n||1!==n.tag)throw Error(i(170));var s=n;do{switch(s.tag){case 3:s=s.stateNode.context;break t;case 1:if(ba(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break t}}s=s.return}while(null!==s);throw Error(i(171))}if(1===n.tag){var c=n.type;if(ba(c)){n=wa(n,c,s);break e}}n=s}else n=fa;return null===t.context?t.context=n:t.pendingContext=n,(t=uo(o,l)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),fo(a,t),ms(a,l,o),l}function tc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function nc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function rc(e,t){nc(e,t),(e=e.alternate)&&nc(e,t)}function ac(e,t,n){var r=null!=n&&null!=n.hydrationOptions&&n.hydrationOptions.mutableSources||null;if(n=new Xs(e,t,null!=n&&!0===n.hydrate),t=Hs(3,null,null,2===t?7:1===t?3:0),n.current=t,t.stateNode=n,so(t),e[ea]=n.current,Pr(8===e.nodeType?e.parentNode:e),r)for(e=0;e<r.length;e++){var a=(t=r[e])._getVersion;a=a(t._source),null==n.mutableSourceEagerHydrationData?n.mutableSourceEagerHydrationData=[t,a]:n.mutableSourceEagerHydrationData.push(t,a)}this._internalRoot=n}function oc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function ic(e,t,n,r,a){var o=n._reactRootContainer;if(o){var i=o._internalRoot;if("function"==typeof a){var l=a;a=function(){var e=tc(i);l.call(e)}}ec(t,i,e,a)}else{if(o=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new ac(e,0,t?{hydrate:!0}:void 0)}(n,r),i=o._internalRoot,"function"==typeof a){var s=a;a=function(){var e=tc(i);s.call(e)}}ks((function(){ec(t,i,e,a)}))}return tc(i)}function lc(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!oc(t))throw Error(i(200));return Js(e,t,null,n)}Wl=function(e,t,n){var r=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||ma.current)Fi=!0;else{if(0==(n&r)){switch(Fi=!1,t.tag){case 3:Vi(t),Wo();break;case 5:Mo(t);break;case 1:ba(t.type)&&ka(t);break;case 4:Io(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var a=t.type._context;da(Xa,a._currentValue),a._currentValue=r;break;case 13:if(null!==t.memoizedState)return 0!=(n&t.child.childLanes)?Xi(e,t,n):(da(Bo,1&Bo.current),null!==(t=ol(e,t,n))?t.sibling:null);da(Bo,1&Bo.current);break;case 19:if(r=0!=(n&t.childLanes),0!=(64&e.flags)){if(r)return al(e,t,n);t.flags|=64}if(null!==(a=t.memoizedState)&&(a.rendering=null,a.tail=null,a.lastEffect=null),da(Bo,Bo.current),r)break;return null;case 23:case 24:return t.lanes=0,$i(e,t,n)}return ol(e,t,n)}Fi=0!=(16384&e.flags)}else Fi=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,a=ga(t,pa.current),oo(t,n),a=li(null,t,r,e,a,n),t.flags|=1,"object"==typeof a&&null!==a&&"function"==typeof a.render&&void 0===a.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,ba(r)){var o=!0;ka(t)}else o=!1;t.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,so(t);var l=r.getDerivedStateFromProps;"function"==typeof l&&bo(t,r,l,e),a.updater=vo,t.stateNode=a,a._reactInternals=t,Eo(t,r,e,n),t=Zi(null,t,r,!0,o,n)}else t.tag=0,Bi(null,t,a,n),t=t.child;return t;case 16:a=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,a=(o=a._init)(a._payload),t.type=a,o=t.tag=function(e){if("function"==typeof e)return Gs(e)?1:0;if(null!=e){if((e=e.$$typeof)===L)return 11;if(e===P)return 14}return 2}(a),e=Qa(a,e),o){case 0:t=Hi(null,t,a,e,n);break e;case 1:t=Gi(null,t,a,e,n);break e;case 11:t=ji(null,t,a,e,n);break e;case 14:t=zi(null,t,a,Qa(a.type,e),r,n);break e}throw Error(i(306,a,""))}return t;case 0:return r=t.type,a=t.pendingProps,Hi(e,t,r,a=t.elementType===r?a:Qa(r,a),n);case 1:return r=t.type,a=t.pendingProps,Gi(e,t,r,a=t.elementType===r?a:Qa(r,a),n);case 3:if(Vi(t),r=t.updateQueue,null===e||null===r)throw Error(i(282));if(r=t.pendingProps,a=null!==(a=t.memoizedState)?a.element:null,co(e,t),mo(t,r,null,n),(r=t.memoizedState.element)===a)Wo(),t=ol(e,t,n);else{if((o=(a=t.stateNode).hydrate)&&(Uo=Wr(t.stateNode.containerInfo.firstChild),zo=t,o=$o=!0),o){if(null!=(e=a.mutableSourceEagerHydrationData))for(a=0;a<e.length;a+=2)(o=e[a])._workInProgressVersionPrimary=e[a+1],Ko.push(o);for(n=Ao(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else Bi(e,t,r,n),Wo();t=t.child}return t;case 5:return Mo(t),null===e&&Go(t),r=t.type,a=t.pendingProps,o=null!==e?e.memoizedProps:null,l=a.children,Hr(r,a)?l=null:null!==o&&Hr(r,o)&&(t.flags|=16),qi(e,t),Bi(e,t,l,n),t.child;case 6:return null===e&&Go(t),null;case 13:return Xi(e,t,n);case 4:return Io(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=_o(t,null,r,n):Bi(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,ji(e,t,r,a=t.elementType===r?a:Qa(r,a),n);case 7:return Bi(e,t,t.pendingProps,n),t.child;case 8:case 12:return Bi(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,a=t.pendingProps,l=t.memoizedProps,o=a.value;var s=t.type._context;if(da(Xa,s._currentValue),s._currentValue=o,null!==l)if(s=l.value,0===(o=ur(s,o)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(s,o):1073741823))){if(l.children===a.children&&!ma.current){t=ol(e,t,n);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var c=s.dependencies;if(null!==c){l=s.child;for(var u=c.firstContext;null!==u;){if(u.context===r&&0!=(u.observedBits&o)){1===s.tag&&((u=uo(-1,n&-n)).tag=2,fo(s,u)),s.lanes|=n,null!==(u=s.alternate)&&(u.lanes|=n),ao(s.return,n),c.lanes|=n;break}u=u.next}}else l=10===s.tag&&s.type===t.type?null:s.child;if(null!==l)l.return=s;else for(l=s;null!==l;){if(l===t){l=null;break}if(null!==(s=l.sibling)){s.return=l.return,l=s;break}l=l.return}s=l}Bi(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=(o=t.pendingProps).children,oo(t,n),r=r(a=io(a,o.unstable_observedBits)),t.flags|=1,Bi(e,t,r,n),t.child;case 14:return o=Qa(a=t.type,t.pendingProps),zi(e,t,a,o=Qa(a.type,o),r,n);case 15:return Ui(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Qa(r,a),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,ba(r)?(e=!0,ka(t)):e=!1,oo(t,n),wo(t,r,a),Eo(t,r,a,n),Zi(null,t,r,!0,e,n);case 19:return al(e,t,n);case 23:case 24:return $i(e,t,n)}throw Error(i(156,t.tag))},ac.prototype.render=function(e){ec(e,this._internalRoot,null,null)},ac.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;ec(null,e,null,(function(){t[ea]=null}))},tt=function(e){13===e.tag&&(ms(e,4,fs()),rc(e,4))},nt=function(e){13===e.tag&&(ms(e,67108864,fs()),rc(e,67108864))},rt=function(e){if(13===e.tag){var t=fs(),n=ps(e);ms(e,n,t),rc(e,n)}},at=function(e,t){return t()},_e=function(e,t,n){switch(t){case"input":if(ne(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=oa(r);if(!a)throw Error(i(90));Q(r),ne(r,a)}}}break;case"textarea":ce(e,n);break;case"select":null!=(t=n.value)&&ie(e,!!n.multiple,t,!1)}},Oe=ws,Ie=function(e,t,n,r,a){var o=Pl;Pl|=4;try{return Za(98,e.bind(null,t,n,r,a))}finally{0===(Pl=o)&&(Vl(),Wa())}},De=function(){0==(49&Pl)&&(function(){if(null!==as){var e=as;as=null,e.forEach((function(e){e.expiredLanes|=24&e.pendingLanes,gs(e,qa())}))}Wa()}(),Ds())},Me=function(e,t){var n=Pl;Pl|=2;try{return e(t)}finally{0===(Pl=n)&&(Vl(),Wa())}};var sc={Events:[ra,aa,oa,Ne,Pe,Ds,{current:!1}]},cc={findFiberByHostInstance:na,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},uc={bundleType:cc.bundleType,version:cc.version,rendererPackageName:cc.rendererPackageName,rendererConfig:cc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:k.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Je(e))?null:e.stateNode},findFiberByHostInstance:cc.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var dc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!dc.isDisabled&&dc.supportsFiber)try{Sa=dc.inject(uc),xa=dc}catch(ge){}}t.createPortal=lc,t.hydrate=function(e,t,n){if(!oc(t))throw Error(i(200));return ic(null,e,t,!0,n)}},3935:(e,t,n)=>{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(4448)},9590:e=>{var t="undefined"!=typeof Element,n="function"==typeof Map,r="function"==typeof Set,a="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function o(e,i){if(e===i)return!0;if(e&&i&&"object"==typeof e&&"object"==typeof i){if(e.constructor!==i.constructor)return!1;var l,s,c,u;if(Array.isArray(e)){if((l=e.length)!=i.length)return!1;for(s=l;0!=s--;)if(!o(e[s],i[s]))return!1;return!0}if(n&&e instanceof Map&&i instanceof Map){if(e.size!==i.size)return!1;for(u=e.entries();!(s=u.next()).done;)if(!i.has(s.value[0]))return!1;for(u=e.entries();!(s=u.next()).done;)if(!o(s.value[1],i.get(s.value[0])))return!1;return!0}if(r&&e instanceof Set&&i instanceof Set){if(e.size!==i.size)return!1;for(u=e.entries();!(s=u.next()).done;)if(!i.has(s.value[0]))return!1;return!0}if(a&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(i)){if((l=e.length)!=i.length)return!1;for(s=l;0!=s--;)if(e[s]!==i[s])return!1;return!0}if(e.constructor===RegExp)return e.source===i.source&&e.flags===i.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===i.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===i.toString();if((l=(c=Object.keys(e)).length)!==Object.keys(i).length)return!1;for(s=l;0!=s--;)if(!Object.prototype.hasOwnProperty.call(i,c[s]))return!1;if(t&&e instanceof Element)return!1;for(s=l;0!=s--;)if(("_owner"!==c[s]&&"__v"!==c[s]&&"__o"!==c[s]||!e.$$typeof)&&!o(e[c[s]],i[c[s]]))return!1;return!0}return e!=e&&i!=i}e.exports=function(e,t){try{return o(e,t)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}},405:(e,t,n)=>{"use strict";n.d(t,{B6:()=>G,ql:()=>J});var r=n(7294),a=n(5697),o=n.n(a),i=n(9590),l=n.n(i),s=n(1143),c=n.n(s),u=n(6774),d=n.n(u);function f(){return f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f.apply(this,arguments)}function p(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,m(e,t)}function m(e,t){return m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},m(e,t)}function h(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(a[n]=e[n]);return a}var g={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title",FRAGMENT:"Symbol(react.fragment)"},b={rel:["amphtml","canonical","alternate"]},v={type:["application/ld+json"]},y={charset:"",name:["robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},w=Object.keys(g).map((function(e){return g[e]})),k={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},E=Object.keys(k).reduce((function(e,t){return e[k[t]]=t,e}),{}),S=function(e,t){for(var n=e.length-1;n>=0;n-=1){var r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},x=function(e){var t=S(e,g.TITLE),n=S(e,"titleTemplate");if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,(function(){return t}));var r=S(e,"defaultTitle");return t||r||void 0},C=function(e){return S(e,"onChangeClientState")||function(){}},T=function(e,t){return t.filter((function(t){return void 0!==t[e]})).map((function(t){return t[e]})).reduce((function(e,t){return f({},e,t)}),{})},_=function(e,t){return t.filter((function(e){return void 0!==e[g.BASE]})).map((function(e){return e[g.BASE]})).reverse().reduce((function(t,n){if(!t.length)for(var r=Object.keys(n),a=0;a<r.length;a+=1){var o=r[a].toLowerCase();if(-1!==e.indexOf(o)&&n[o])return t.concat(n)}return t}),[])},A=function(e,t,n){var r={};return n.filter((function(t){return!!Array.isArray(t[e])||(void 0!==t[e]&&console&&"function"==typeof console.warn&&console.warn("Helmet: "+e+' should be of type "Array". Instead found type "'+typeof t[e]+'"'),!1)})).map((function(t){return t[e]})).reverse().reduce((function(e,n){var a={};n.filter((function(e){for(var n,o=Object.keys(e),i=0;i<o.length;i+=1){var l=o[i],s=l.toLowerCase();-1===t.indexOf(s)||"rel"===n&&"canonical"===e[n].toLowerCase()||"rel"===s&&"stylesheet"===e[s].toLowerCase()||(n=s),-1===t.indexOf(l)||"innerHTML"!==l&&"cssText"!==l&&"itemprop"!==l||(n=l)}if(!n||!e[n])return!1;var c=e[n].toLowerCase();return r[n]||(r[n]={}),a[n]||(a[n]={}),!r[n][c]&&(a[n][c]=!0,!0)})).reverse().forEach((function(t){return e.push(t)}));for(var o=Object.keys(a),i=0;i<o.length;i+=1){var l=o[i],s=f({},r[l],a[l]);r[l]=s}return e}),[]).reverse()},L=function(e,t){if(Array.isArray(e)&&e.length)for(var n=0;n<e.length;n+=1)if(e[n][t])return!0;return!1},R=function(e){return Array.isArray(e)?e.join(""):e},N=function(e,t){return Array.isArray(e)?e.reduce((function(e,n){return function(e,t){for(var n=Object.keys(e),r=0;r<n.length;r+=1)if(t[n[r]]&&t[n[r]].includes(e[n[r]]))return!0;return!1}(n,t)?e.priority.push(n):e.default.push(n),e}),{priority:[],default:[]}):{default:e}},P=function(e,t){var n;return f({},e,((n={})[t]=void 0,n))},O=[g.NOSCRIPT,g.SCRIPT,g.STYLE],I=function(e,t){return void 0===t&&(t=!0),!1===t?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},D=function(e){return Object.keys(e).reduce((function(t,n){var r=void 0!==e[n]?n+'="'+e[n]+'"':""+n;return t?t+" "+r:r}),"")},M=function(e,t){return void 0===t&&(t={}),Object.keys(e).reduce((function(t,n){return t[k[n]||n]=e[n],t}),t)},F=function(e,t){return t.map((function(t,n){var a,o=((a={key:n})["data-rh"]=!0,a);return Object.keys(t).forEach((function(e){var n=k[e]||e;"innerHTML"===n||"cssText"===n?o.dangerouslySetInnerHTML={__html:t.innerHTML||t.cssText}:o[n]=t[e]})),r.createElement(e,o)}))},B=function(e,t,n){switch(e){case g.TITLE:return{toComponent:function(){return n=t.titleAttributes,(a={key:e=t.title})["data-rh"]=!0,o=M(n,a),[r.createElement(g.TITLE,o,e)];var e,n,a,o},toString:function(){return function(e,t,n,r){var a=D(n),o=R(t);return a?"<"+e+' data-rh="true" '+a+">"+I(o,r)+"</"+e+">":"<"+e+' data-rh="true">'+I(o,r)+"</"+e+">"}(e,t.title,t.titleAttributes,n)}};case"bodyAttributes":case"htmlAttributes":return{toComponent:function(){return M(t)},toString:function(){return D(t)}};default:return{toComponent:function(){return F(e,t)},toString:function(){return function(e,t,n){return t.reduce((function(t,r){var a=Object.keys(r).filter((function(e){return!("innerHTML"===e||"cssText"===e)})).reduce((function(e,t){var a=void 0===r[t]?t:t+'="'+I(r[t],n)+'"';return e?e+" "+a:a}),""),o=r.innerHTML||r.cssText||"",i=-1===O.indexOf(e);return t+"<"+e+' data-rh="true" '+a+(i?"/>":">"+o+"</"+e+">")}),"")}(e,t,n)}}}},j=function(e){var t=e.baseTag,n=e.bodyAttributes,r=e.encode,a=e.htmlAttributes,o=e.noscriptTags,i=e.styleTags,l=e.title,s=void 0===l?"":l,c=e.titleAttributes,u=e.linkTags,d=e.metaTags,f=e.scriptTags,p={toComponent:function(){},toString:function(){return""}};if(e.prioritizeSeoTags){var m=function(e){var t=e.linkTags,n=e.scriptTags,r=e.encode,a=N(e.metaTags,y),o=N(t,b),i=N(n,v);return{priorityMethods:{toComponent:function(){return[].concat(F(g.META,a.priority),F(g.LINK,o.priority),F(g.SCRIPT,i.priority))},toString:function(){return B(g.META,a.priority,r)+" "+B(g.LINK,o.priority,r)+" "+B(g.SCRIPT,i.priority,r)}},metaTags:a.default,linkTags:o.default,scriptTags:i.default}}(e);p=m.priorityMethods,u=m.linkTags,d=m.metaTags,f=m.scriptTags}return{priority:p,base:B(g.BASE,t,r),bodyAttributes:B("bodyAttributes",n,r),htmlAttributes:B("htmlAttributes",a,r),link:B(g.LINK,u,r),meta:B(g.META,d,r),noscript:B(g.NOSCRIPT,o,r),script:B(g.SCRIPT,f,r),style:B(g.STYLE,i,r),title:B(g.TITLE,{title:s,titleAttributes:c},r)}},z=[],U=function(e,t){var n=this;void 0===t&&(t="undefined"!=typeof document),this.instances=[],this.value={setHelmet:function(e){n.context.helmet=e},helmetInstances:{get:function(){return n.canUseDOM?z:n.instances},add:function(e){(n.canUseDOM?z:n.instances).push(e)},remove:function(e){var t=(n.canUseDOM?z:n.instances).indexOf(e);(n.canUseDOM?z:n.instances).splice(t,1)}}},this.context=e,this.canUseDOM=t,t||(e.helmet=j({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))},$=r.createContext({}),q=o().shape({setHelmet:o().func,helmetInstances:o().shape({get:o().func,add:o().func,remove:o().func})}),H="undefined"!=typeof document,G=function(e){function t(n){var r;return(r=e.call(this,n)||this).helmetData=new U(r.props.context,t.canUseDOM),r}return p(t,e),t.prototype.render=function(){return r.createElement($.Provider,{value:this.helmetData.value},this.props.children)},t}(r.Component);G.canUseDOM=H,G.propTypes={context:o().shape({helmet:o().shape()}),children:o().node.isRequired},G.defaultProps={context:{}},G.displayName="HelmetProvider";var Z=function(e,t){var n,r=document.head||document.querySelector(g.HEAD),a=r.querySelectorAll(e+"[data-rh]"),o=[].slice.call(a),i=[];return t&&t.length&&t.forEach((function(t){var r=document.createElement(e);for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&("innerHTML"===a?r.innerHTML=t.innerHTML:"cssText"===a?r.styleSheet?r.styleSheet.cssText=t.cssText:r.appendChild(document.createTextNode(t.cssText)):r.setAttribute(a,void 0===t[a]?"":t[a]));r.setAttribute("data-rh","true"),o.some((function(e,t){return n=t,r.isEqualNode(e)}))?o.splice(n,1):i.push(r)})),o.forEach((function(e){return e.parentNode.removeChild(e)})),i.forEach((function(e){return r.appendChild(e)})),{oldTags:o,newTags:i}},V=function(e,t){var n=document.getElementsByTagName(e)[0];if(n){for(var r=n.getAttribute("data-rh"),a=r?r.split(","):[],o=[].concat(a),i=Object.keys(t),l=0;l<i.length;l+=1){var s=i[l],c=t[s]||"";n.getAttribute(s)!==c&&n.setAttribute(s,c),-1===a.indexOf(s)&&a.push(s);var u=o.indexOf(s);-1!==u&&o.splice(u,1)}for(var d=o.length-1;d>=0;d-=1)n.removeAttribute(o[d]);a.length===o.length?n.removeAttribute("data-rh"):n.getAttribute("data-rh")!==i.join(",")&&n.setAttribute("data-rh",i.join(","))}},W=function(e,t){var n=e.baseTag,r=e.htmlAttributes,a=e.linkTags,o=e.metaTags,i=e.noscriptTags,l=e.onChangeClientState,s=e.scriptTags,c=e.styleTags,u=e.title,d=e.titleAttributes;V(g.BODY,e.bodyAttributes),V(g.HTML,r),function(e,t){void 0!==e&&document.title!==e&&(document.title=R(e)),V(g.TITLE,t)}(u,d);var f={baseTag:Z(g.BASE,n),linkTags:Z(g.LINK,a),metaTags:Z(g.META,o),noscriptTags:Z(g.NOSCRIPT,i),scriptTags:Z(g.SCRIPT,s),styleTags:Z(g.STYLE,c)},p={},m={};Object.keys(f).forEach((function(e){var t=f[e],n=t.newTags,r=t.oldTags;n.length&&(p[e]=n),r.length&&(m[e]=f[e].oldTags)})),t&&t(),l(e,p,m)},K=null,Y=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).rendered=!1,t}p(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e){return!d()(e,this.props)},n.componentDidUpdate=function(){this.emitChange()},n.componentWillUnmount=function(){this.props.context.helmetInstances.remove(this),this.emitChange()},n.emitChange=function(){var e,t,n=this.props.context,r=n.setHelmet,a=null,o=(e=n.helmetInstances.get().map((function(e){var t=f({},e.props);return delete t.context,t})),{baseTag:_(["href"],e),bodyAttributes:T("bodyAttributes",e),defer:S(e,"defer"),encode:S(e,"encodeSpecialCharacters"),htmlAttributes:T("htmlAttributes",e),linkTags:A(g.LINK,["rel","href"],e),metaTags:A(g.META,["name","charset","http-equiv","property","itemprop"],e),noscriptTags:A(g.NOSCRIPT,["innerHTML"],e),onChangeClientState:C(e),scriptTags:A(g.SCRIPT,["src","innerHTML"],e),styleTags:A(g.STYLE,["cssText"],e),title:x(e),titleAttributes:T("titleAttributes",e),prioritizeSeoTags:L(e,"prioritizeSeoTags")});G.canUseDOM?(t=o,K&&cancelAnimationFrame(K),t.defer?K=requestAnimationFrame((function(){W(t,(function(){K=null}))})):(W(t),K=null)):j&&(a=j(o)),r(a)},n.init=function(){this.rendered||(this.rendered=!0,this.props.context.helmetInstances.add(this),this.emitChange())},n.render=function(){return this.init(),null},t}(r.Component);Y.propTypes={context:q.isRequired},Y.displayName="HelmetDispatcher";var Q=["children"],X=["children"],J=function(e){function t(){return e.apply(this,arguments)||this}p(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e){return!l()(P(this.props,"helmetData"),P(e,"helmetData"))},n.mapNestedChildrenToProps=function(e,t){if(!t)return null;switch(e.type){case g.SCRIPT:case g.NOSCRIPT:return{innerHTML:t};case g.STYLE:return{cssText:t};default:throw new Error("<"+e.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")}},n.flattenArrayTypeChildren=function(e){var t,n=e.child,r=e.arrayTypeChildren;return f({},r,((t={})[n.type]=[].concat(r[n.type]||[],[f({},e.newChildProps,this.mapNestedChildrenToProps(n,e.nestedChildren))]),t))},n.mapObjectTypeChildren=function(e){var t,n,r=e.child,a=e.newProps,o=e.newChildProps,i=e.nestedChildren;switch(r.type){case g.TITLE:return f({},a,((t={})[r.type]=i,t.titleAttributes=f({},o),t));case g.BODY:return f({},a,{bodyAttributes:f({},o)});case g.HTML:return f({},a,{htmlAttributes:f({},o)});default:return f({},a,((n={})[r.type]=f({},o),n))}},n.mapArrayTypeChildrenToProps=function(e,t){var n=f({},t);return Object.keys(e).forEach((function(t){var r;n=f({},n,((r={})[t]=e[t],r))})),n},n.warnOnInvalidChildren=function(e,t){return c()(w.some((function(t){return e.type===t})),"function"==typeof e.type?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":"Only elements types "+w.join(", ")+" are allowed. Helmet does not support rendering <"+e.type+"> elements. Refer to our API for more information."),c()(!t||"string"==typeof t||Array.isArray(t)&&!t.some((function(e){return"string"!=typeof e})),"Helmet expects a string as a child of <"+e.type+">. Did you forget to wrap your children in braces? ( <"+e.type+">{``}</"+e.type+"> ) Refer to our API for more information."),!0},n.mapChildrenToProps=function(e,t){var n=this,a={};return r.Children.forEach(e,(function(e){if(e&&e.props){var r=e.props,o=r.children,i=h(r,Q),l=Object.keys(i).reduce((function(e,t){return e[E[t]||t]=i[t],e}),{}),s=e.type;switch("symbol"==typeof s?s=s.toString():n.warnOnInvalidChildren(e,o),s){case g.FRAGMENT:t=n.mapChildrenToProps(o,t);break;case g.LINK:case g.META:case g.NOSCRIPT:case g.SCRIPT:case g.STYLE:a=n.flattenArrayTypeChildren({child:e,arrayTypeChildren:a,newChildProps:l,nestedChildren:o});break;default:t=n.mapObjectTypeChildren({child:e,newProps:t,newChildProps:l,nestedChildren:o})}}})),this.mapArrayTypeChildrenToProps(a,t)},n.render=function(){var e=this.props,t=e.children,n=h(e,X),a=f({},n),o=n.helmetData;return t&&(a=this.mapChildrenToProps(t,a)),!o||o instanceof U||(o=new U(o.context,o.instances)),o?r.createElement(Y,f({},a,{context:o.value,helmetData:void 0})):r.createElement($.Consumer,null,(function(e){return r.createElement(Y,f({},a,{context:e}))}))},t}(r.Component);J.propTypes={base:o().object,bodyAttributes:o().object,children:o().oneOfType([o().arrayOf(o().node),o().node]),defaultTitle:o().string,defer:o().bool,encodeSpecialCharacters:o().bool,htmlAttributes:o().object,link:o().arrayOf(o().object),meta:o().arrayOf(o().object),noscript:o().arrayOf(o().object),onChangeClientState:o().func,script:o().arrayOf(o().object),style:o().arrayOf(o().object),title:o().string,titleAttributes:o().object,titleTemplate:o().string,prioritizeSeoTags:o().bool,helmetData:o().object},J.defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1},J.displayName="Helmet"},9921:(e,t)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,a=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.suspense_list"):60120,h=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,b=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,y=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function k(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case o:case l:case i:case p:return e;default:switch(e=e&&e.$$typeof){case c:case f:case g:case h:case s:return e;default:return t}}case a:return t}}}function E(e){return k(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=s,t.Element=r,t.ForwardRef=f,t.Fragment=o,t.Lazy=g,t.Memo=h,t.Portal=a,t.Profiler=l,t.StrictMode=i,t.Suspense=p,t.isAsyncMode=function(e){return E(e)||k(e)===u},t.isConcurrentMode=E,t.isContextConsumer=function(e){return k(e)===c},t.isContextProvider=function(e){return k(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return k(e)===f},t.isFragment=function(e){return k(e)===o},t.isLazy=function(e){return k(e)===g},t.isMemo=function(e){return k(e)===h},t.isPortal=function(e){return k(e)===a},t.isProfiler=function(e){return k(e)===l},t.isStrictMode=function(e){return k(e)===i},t.isSuspense=function(e){return k(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===l||e===i||e===p||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===h||e.$$typeof===s||e.$$typeof===c||e.$$typeof===f||e.$$typeof===v||e.$$typeof===y||e.$$typeof===w||e.$$typeof===b)},t.typeOf=k},9864:(e,t,n)=>{"use strict";e.exports=n(9921)},8356:(e,t,n)=>{"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i.apply(this,arguments)}var l=n(7294),s=n(5697),c=[],u=[];function d(e){var t=e(),n={loading:!0,loaded:null,error:null};return n.promise=t.then((function(e){return n.loading=!1,n.loaded=e,e})).catch((function(e){throw n.loading=!1,n.error=e,e})),n}function f(e){var t={loading:!1,loaded:{},error:null},n=[];try{Object.keys(e).forEach((function(r){var a=d(e[r]);a.loading?t.loading=!0:(t.loaded[r]=a.loaded,t.error=a.error),n.push(a.promise),a.promise.then((function(e){t.loaded[r]=e})).catch((function(e){t.error=e}))}))}catch(r){t.error=r}return t.promise=Promise.all(n).then((function(e){return t.loading=!1,e})).catch((function(e){throw t.loading=!1,e})),t}function p(e,t){return l.createElement((n=e)&&n.__esModule?n.default:n,t);var n}function m(e,t){var d,f;if(!t.loading)throw new Error("react-loadable requires a `loading` component");var m=i({loader:null,loading:null,delay:200,timeout:null,render:p,webpack:null,modules:null},t),h=null;function g(){return h||(h=e(m.loader)),h.promise}return c.push(g),"function"==typeof m.webpack&&u.push((function(){if((0,m.webpack)().every((function(e){return void 0!==e&&void 0!==n.m[e]})))return g()})),f=d=function(t){function n(n){var r;return o(a(a(r=t.call(this,n)||this)),"retry",(function(){r.setState({error:null,loading:!0,timedOut:!1}),h=e(m.loader),r._loadModule()})),g(),r.state={error:h.error,pastDelay:!1,timedOut:!1,loading:h.loading,loaded:h.loaded},r}r(n,t),n.preload=function(){return g()};var i=n.prototype;return i.UNSAFE_componentWillMount=function(){this._loadModule()},i.componentDidMount=function(){this._mounted=!0},i._loadModule=function(){var e=this;if(this.context.loadable&&Array.isArray(m.modules)&&m.modules.forEach((function(t){e.context.loadable.report(t)})),h.loading){var t=function(t){e._mounted&&e.setState(t)};"number"==typeof m.delay&&(0===m.delay?this.setState({pastDelay:!0}):this._delay=setTimeout((function(){t({pastDelay:!0})}),m.delay)),"number"==typeof m.timeout&&(this._timeout=setTimeout((function(){t({timedOut:!0})}),m.timeout));var n=function(){t({error:h.error,loaded:h.loaded,loading:h.loading}),e._clearTimeouts()};h.promise.then((function(){return n(),null})).catch((function(e){return n(),null}))}},i.componentWillUnmount=function(){this._mounted=!1,this._clearTimeouts()},i._clearTimeouts=function(){clearTimeout(this._delay),clearTimeout(this._timeout)},i.render=function(){return this.state.loading||this.state.error?l.createElement(m.loading,{isLoading:this.state.loading,pastDelay:this.state.pastDelay,timedOut:this.state.timedOut,error:this.state.error,retry:this.retry}):this.state.loaded?m.render(this.state.loaded,this.props):null},n}(l.Component),o(d,"contextTypes",{loadable:s.shape({report:s.func.isRequired})}),f}function h(e){return m(d,e)}h.Map=function(e){if("function"!=typeof e.render)throw new Error("LoadableMap requires a `render(loaded, props)` function");return m(f,e)};var g=function(e){function t(){return e.apply(this,arguments)||this}r(t,e);var n=t.prototype;return n.getChildContext=function(){return{loadable:{report:this.props.report}}},n.render=function(){return l.Children.only(this.props.children)},t}(l.Component);function b(e){for(var t=[];e.length;){var n=e.pop();t.push(n())}return Promise.all(t).then((function(){if(e.length)return b(e)}))}o(g,"propTypes",{report:s.func.isRequired}),o(g,"childContextTypes",{loadable:s.shape({report:s.func.isRequired}).isRequired}),h.Capture=g,h.preloadAll=function(){return new Promise((function(e,t){b(c).then(e,t)}))},h.preloadReady=function(){return new Promise((function(e,t){b(u).then(e,e)}))},e.exports=h},8790:(e,t,n)=>{"use strict";n.d(t,{H:()=>l,f:()=>i});var r=n(6775),a=n(7462),o=n(7294);function i(e,t,n){return void 0===n&&(n=[]),e.some((function(e){var a=e.path?(0,r.LX)(t,e):n.length?n[n.length-1].match:r.F0.computeRootMatch(t);return a&&(n.push({route:e,match:a}),e.routes&&i(e.routes,t,n)),a})),n}function l(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),e?o.createElement(r.rs,n,e.map((function(e,n){return o.createElement(r.AW,{key:e.key||n,path:e.path,exact:e.exact,strict:e.strict,render:function(n){return e.render?e.render((0,a.Z)({},n,{},t,{route:e})):o.createElement(e.component,(0,a.Z)({},n,t,{route:e}))}})}))):null}},3727:(e,t,n)=>{"use strict";n.d(t,{OL:()=>y,VK:()=>u,rU:()=>g});var r=n(6775),a=n(5068),o=n(7294),i=n(9318),l=n(7462),s=n(3366),c=n(2177),u=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).history=(0,i.lX)(t.props),t}return(0,a.Z)(t,e),t.prototype.render=function(){return o.createElement(r.F0,{history:this.history,children:this.props.children})},t}(o.Component);o.Component;var d=function(e,t){return"function"==typeof e?e(t):e},f=function(e,t){return"string"==typeof e?(0,i.ob)(e,null,null,t):e},p=function(e){return e},m=o.forwardRef;void 0===m&&(m=p);var h=m((function(e,t){var n=e.innerRef,r=e.navigate,a=e.onClick,i=(0,s.Z)(e,["innerRef","navigate","onClick"]),c=i.target,u=(0,l.Z)({},i,{onClick:function(e){try{a&&a(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||c&&"_self"!==c||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return u.ref=p!==m&&t||n,o.createElement("a",u)}));var g=m((function(e,t){var n=e.component,a=void 0===n?h:n,u=e.replace,g=e.to,b=e.innerRef,v=(0,s.Z)(e,["component","replace","to","innerRef"]);return o.createElement(r.s6.Consumer,null,(function(e){e||(0,c.Z)(!1);var n=e.history,r=f(d(g,e.location),e.location),s=r?n.createHref(r):"",h=(0,l.Z)({},v,{href:s,navigate:function(){var t=d(g,e.location),r=(0,i.Ep)(e.location)===(0,i.Ep)(f(t));(u||r?n.replace:n.push)(t)}});return p!==m?h.ref=t||b:h.innerRef=b,o.createElement(a,h)}))})),b=function(e){return e},v=o.forwardRef;void 0===v&&(v=b);var y=v((function(e,t){var n=e["aria-current"],a=void 0===n?"page":n,i=e.activeClassName,u=void 0===i?"active":i,p=e.activeStyle,m=e.className,h=e.exact,y=e.isActive,w=e.location,k=e.sensitive,E=e.strict,S=e.style,x=e.to,C=e.innerRef,T=(0,s.Z)(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return o.createElement(r.s6.Consumer,null,(function(e){e||(0,c.Z)(!1);var n=w||e.location,i=f(d(x,n),n),s=i.pathname,_=s&&s.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),A=_?(0,r.LX)(n.pathname,{path:_,exact:h,sensitive:k,strict:E}):null,L=!!(y?y(A,n):A),R="function"==typeof m?m(L):m,N="function"==typeof S?S(L):S;L&&(R=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return e})).join(" ")}(R,u),N=(0,l.Z)({},N,p));var P=(0,l.Z)({"aria-current":L&&a||null,className:R,style:N,to:i},T);return b!==v?P.ref=t||C:P.innerRef=C,o.createElement(g,P)}))}))},6775:(e,t,n)=>{"use strict";n.d(t,{AW:()=>C,F0:()=>k,rs:()=>N,s6:()=>w,LX:()=>x,k6:()=>O,TH:()=>I});var r=n(5068),a=n(7294),o=n(9318),i=n(5697),l=n.n(i),s=1073741823,c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:{};function u(e){var t=[];return{on:function(e){t.push(e)},off:function(e){t=t.filter((function(t){return t!==e}))},get:function(){return e},set:function(n,r){e=n,t.forEach((function(t){return t(e,r)}))}}}var d=a.createContext||function(e,t){var n,o,i="__create-react-context-"+function(){var e="__global_unique_id__";return c[e]=(c[e]||0)+1}()+"__",d=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).emitter=u(t.props.value),t}(0,r.Z)(n,e);var a=n.prototype;return a.getChildContext=function(){var e;return(e={})[i]=this.emitter,e},a.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n,r=this.props.value,a=e.value;((o=r)===(i=a)?0!==o||1/o==1/i:o!=o&&i!=i)?n=0:(n="function"==typeof t?t(r,a):s,0!==(n|=0)&&this.emitter.set(e.value,n))}var o,i},a.render=function(){return this.props.children},n}(a.Component);d.childContextTypes=((n={})[i]=l().object.isRequired,n);var f=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).state={value:e.getValue()},e.onUpdate=function(t,n){0!=((0|e.observedBits)&n)&&e.setState({value:e.getValue()})},e}(0,r.Z)(n,t);var a=n.prototype;return a.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?s:t},a.componentDidMount=function(){this.context[i]&&this.context[i].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?s:e},a.componentWillUnmount=function(){this.context[i]&&this.context[i].off(this.onUpdate)},a.getValue=function(){return this.context[i]?this.context[i].get():e},a.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},n}(a.Component);return f.contextTypes=((o={})[i]=l().object,o),{Provider:d,Consumer:f}};const f=d;var p=n(2177),m=n(7462),h=n(4779),g=n.n(h),b=(n(9864),n(3366)),v=(n(8679),function(e){var t=f();return t.displayName=e,t}),y=v("Router-History"),w=v("Router"),k=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._pendingLocation=e}))),n}(0,r.Z)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){var e=this;this._isMounted=!0,this.unlisten&&this.unlisten(),this.props.staticContext||(this.unlisten=this.props.history.listen((function(t){e._isMounted&&e.setState({location:t})}))),this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&(this.unlisten(),this._isMounted=!1,this._pendingLocation=null)},n.render=function(){return a.createElement(w.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},a.createElement(y.Provider,{children:this.props.children||null,value:this.props.history}))},t}(a.Component);a.Component;a.Component;var E={},S=0;function x(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,a=n.exact,o=void 0!==a&&a,i=n.strict,l=void 0!==i&&i,s=n.sensitive,c=void 0!==s&&s;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=E[n]||(E[n]={});if(r[e])return r[e];var a=[],o={regexp:g()(e,a,t),keys:a};return S<1e4&&(r[e]=o,S++),o}(n,{end:o,strict:l,sensitive:c}),a=r.regexp,i=r.keys,s=a.exec(e);if(!s)return null;var u=s[0],d=s.slice(1),f=e===u;return o&&!f?null:{path:n,url:"/"===n&&""===u?"/":u,isExact:f,params:i.reduce((function(e,t,n){return e[t.name]=d[n],e}),{})}}),null)}var C=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.Z)(t,e),t.prototype.render=function(){var e=this;return a.createElement(w.Consumer,null,(function(t){t||(0,p.Z)(!1);var n=e.props.location||t.location,r=e.props.computedMatch?e.props.computedMatch:e.props.path?x(n.pathname,e.props):t.match,o=(0,m.Z)({},t,{location:n,match:r}),i=e.props,l=i.children,s=i.component,c=i.render;return Array.isArray(l)&&function(e){return 0===a.Children.count(e)}(l)&&(l=null),a.createElement(w.Provider,{value:o},o.match?l?"function"==typeof l?l(o):l:s?a.createElement(s,o):c?c(o):null:"function"==typeof l?l(o):null)}))},t}(a.Component);function T(e){return"/"===e.charAt(0)?e:"/"+e}function _(e,t){if(!e)return t;var n=T(e);return 0!==t.pathname.indexOf(n)?t:(0,m.Z)({},t,{pathname:t.pathname.substr(n.length)})}function A(e){return"string"==typeof e?e:(0,o.Ep)(e)}function L(e){return function(){(0,p.Z)(!1)}}function R(){}a.Component;var N=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.Z)(t,e),t.prototype.render=function(){var e=this;return a.createElement(w.Consumer,null,(function(t){t||(0,p.Z)(!1);var n,r,o=e.props.location||t.location;return a.Children.forEach(e.props.children,(function(e){if(null==r&&a.isValidElement(e)){n=e;var i=e.props.path||e.props.from;r=i?x(o.pathname,(0,m.Z)({},e.props,{path:i})):t.match}})),r?a.cloneElement(n,{location:o,computedMatch:r}):null}))},t}(a.Component);var P=a.useContext;function O(){return P(y)}function I(){return P(w).location}},2408:(e,t,n)=>{"use strict";var r=n(7418),a=60103,o=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var i=60109,l=60110,s=60112;t.Suspense=60113;var c=60115,u=60116;if("function"==typeof Symbol&&Symbol.for){var d=Symbol.for;a=d("react.element"),o=d("react.portal"),t.Fragment=d("react.fragment"),t.StrictMode=d("react.strict_mode"),t.Profiler=d("react.profiler"),i=d("react.provider"),l=d("react.context"),s=d("react.forward_ref"),t.Suspense=d("react.suspense"),c=d("react.memo"),u=d("react.lazy")}var f="function"==typeof Symbol&&Symbol.iterator;function p(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h={};function g(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||m}function b(){}function v(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||m}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(p(85));this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=g.prototype;var y=v.prototype=new b;y.constructor=v,r(y,g.prototype),y.isPureReactComponent=!0;var w={current:null},k=Object.prototype.hasOwnProperty,E={key:!0,ref:!0,__self:!0,__source:!0};function S(e,t,n){var r,o={},i=null,l=null;if(null!=t)for(r in void 0!==t.ref&&(l=t.ref),void 0!==t.key&&(i=""+t.key),t)k.call(t,r)&&!E.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(1===s)o.children=n;else if(1<s){for(var c=Array(s),u=0;u<s;u++)c[u]=arguments[u+2];o.children=c}if(e&&e.defaultProps)for(r in s=e.defaultProps)void 0===o[r]&&(o[r]=s[r]);return{$$typeof:a,type:e,key:i,ref:l,props:o,_owner:w.current}}function x(e){return"object"==typeof e&&null!==e&&e.$$typeof===a}var C=/\/+/g;function T(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function _(e,t,n,r,i){var l=typeof e;"undefined"!==l&&"boolean"!==l||(e=null);var s=!1;if(null===e)s=!0;else switch(l){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case a:case o:s=!0}}if(s)return i=i(s=e),e=""===r?"."+T(s,0):r,Array.isArray(i)?(n="",null!=e&&(n=e.replace(C,"$&/")+"/"),_(i,t,n,"",(function(e){return e}))):null!=i&&(x(i)&&(i=function(e,t){return{$$typeof:a,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(C,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=""===r?".":r+":",Array.isArray(e))for(var c=0;c<e.length;c++){var u=r+T(l=e[c],c);s+=_(l,t,n,u,i)}else if(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=f&&e[f]||e["@@iterator"])?e:null}(e),"function"==typeof u)for(e=u.call(e),c=0;!(l=e.next()).done;)s+=_(l=l.value,t,n,u=r+T(l,c++),i);else if("object"===l)throw t=""+e,Error(p(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return s}function A(e,t,n){if(null==e)return e;var r=[],a=0;return _(e,r,"","",(function(e){return t.call(n,e,a++)})),r}function L(e){if(-1===e._status){var t=e._result;t=t(),e._status=0,e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}if(1===e._status)return e._result;throw e._result}var R={current:null};function N(){var e=R.current;if(null===e)throw Error(p(321));return e}var P={ReactCurrentDispatcher:R,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:w,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:A,forEach:function(e,t,n){A(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return A(e,(function(){t++})),t},toArray:function(e){return A(e,(function(e){return e}))||[]},only:function(e){if(!x(e))throw Error(p(143));return e}},t.Component=g,t.PureComponent=v,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=P,t.cloneElement=function(e,t,n){if(null==e)throw Error(p(267,e));var o=r({},e.props),i=e.key,l=e.ref,s=e._owner;if(null!=t){if(void 0!==t.ref&&(l=t.ref,s=w.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(u in t)k.call(t,u)&&!E.hasOwnProperty(u)&&(o[u]=void 0===t[u]&&void 0!==c?c[u]:t[u])}var u=arguments.length-2;if(1===u)o.children=n;else if(1<u){c=Array(u);for(var d=0;d<u;d++)c[d]=arguments[d+2];o.children=c}return{$$typeof:a,type:e.type,key:i,ref:l,props:o,_owner:s}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:l,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:i,_context:e},e.Consumer=e},t.createElement=S,t.createFactory=function(e){var t=S.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:s,render:e}},t.isValidElement=x,t.lazy=function(e){return{$$typeof:u,_payload:{_status:-1,_result:e},_init:L}},t.memo=function(e,t){return{$$typeof:c,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return N().useCallback(e,t)},t.useContext=function(e,t){return N().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return N().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return N().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return N().useLayoutEffect(e,t)},t.useMemo=function(e,t){return N().useMemo(e,t)},t.useReducer=function(e,t,n){return N().useReducer(e,t,n)},t.useRef=function(e){return N().useRef(e)},t.useState=function(e){return N().useState(e)},t.version="17.0.2"},7294:(e,t,n)=>{"use strict";e.exports=n(2408)},53:(e,t)=>{"use strict";var n,r,a,o;if("object"==typeof performance&&"function"==typeof performance.now){var i=performance;t.unstable_now=function(){return i.now()}}else{var l=Date,s=l.now();t.unstable_now=function(){return l.now()-s}}if("undefined"==typeof window||"function"!=typeof MessageChannel){var c=null,u=null,d=function(){if(null!==c)try{var e=t.unstable_now();c(!0,e),c=null}catch(n){throw setTimeout(d,0),n}};n=function(e){null!==c?setTimeout(n,0,e):(c=e,setTimeout(d,0))},r=function(e,t){u=setTimeout(e,t)},a=function(){clearTimeout(u)},t.unstable_shouldYield=function(){return!1},o=t.unstable_forceFrameRate=function(){}}else{var f=window.setTimeout,p=window.clearTimeout;if("undefined"!=typeof console){var m=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!=typeof m&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var h=!1,g=null,b=-1,v=5,y=0;t.unstable_shouldYield=function(){return t.unstable_now()>=y},o=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):v=0<e?Math.floor(1e3/e):5};var w=new MessageChannel,k=w.port2;w.port1.onmessage=function(){if(null!==g){var e=t.unstable_now();y=e+v;try{g(!0,e)?k.postMessage(null):(h=!1,g=null)}catch(n){throw k.postMessage(null),n}}else h=!1},n=function(e){g=e,h||(h=!0,k.postMessage(null))},r=function(e,n){b=f((function(){e(t.unstable_now())}),n)},a=function(){p(b),b=-1}}function E(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,a=e[r];if(!(void 0!==a&&0<C(a,t)))break e;e[r]=t,e[n]=a,n=r}}function S(e){return void 0===(e=e[0])?null:e}function x(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length;r<a;){var o=2*(r+1)-1,i=e[o],l=o+1,s=e[l];if(void 0!==i&&0>C(i,n))void 0!==s&&0>C(s,i)?(e[r]=s,e[l]=n,r=l):(e[r]=i,e[o]=n,r=o);else{if(!(void 0!==s&&0>C(s,n)))break e;e[r]=s,e[l]=n,r=l}}}return t}return null}function C(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var T=[],_=[],A=1,L=null,R=3,N=!1,P=!1,O=!1;function I(e){for(var t=S(_);null!==t;){if(null===t.callback)x(_);else{if(!(t.startTime<=e))break;x(_),t.sortIndex=t.expirationTime,E(T,t)}t=S(_)}}function D(e){if(O=!1,I(e),!P)if(null!==S(T))P=!0,n(M);else{var t=S(_);null!==t&&r(D,t.startTime-e)}}function M(e,n){P=!1,O&&(O=!1,a()),N=!0;var o=R;try{for(I(n),L=S(T);null!==L&&(!(L.expirationTime>n)||e&&!t.unstable_shouldYield());){var i=L.callback;if("function"==typeof i){L.callback=null,R=L.priorityLevel;var l=i(L.expirationTime<=n);n=t.unstable_now(),"function"==typeof l?L.callback=l:L===S(T)&&x(T),I(n)}else x(T);L=S(T)}if(null!==L)var s=!0;else{var c=S(_);null!==c&&r(D,c.startTime-n),s=!1}return s}finally{L=null,R=o,N=!1}}var F=o;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){P||N||(P=!0,n(M))},t.unstable_getCurrentPriorityLevel=function(){return R},t.unstable_getFirstCallbackNode=function(){return S(T)},t.unstable_next=function(e){switch(R){case 1:case 2:case 3:var t=3;break;default:t=R}var n=R;R=t;try{return e()}finally{R=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=F,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=R;R=e;try{return t()}finally{R=n}},t.unstable_scheduleCallback=function(e,o,i){var l=t.unstable_now();switch("object"==typeof i&&null!==i?i="number"==typeof(i=i.delay)&&0<i?l+i:l:i=l,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return e={id:A++,callback:o,priorityLevel:e,startTime:i,expirationTime:s=i+s,sortIndex:-1},i>l?(e.sortIndex=i,E(_,e),null===S(T)&&e===S(_)&&(O?a():O=!0,r(D,i-l))):(e.sortIndex=s,E(T,e),P||N||(P=!0,n(M))),e},t.unstable_wrapCallback=function(e){var t=R;return function(){var n=R;R=t;try{return e.apply(this,arguments)}finally{R=n}}}},3840:(e,t,n)=>{"use strict";e.exports=n(53)},6774:e=>{e.exports=function(e,t,n,r){var a=n?n.call(r,e,t):void 0;if(void 0!==a)return!!a;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(t),s=0;s<o.length;s++){var c=o[s];if(!l(c))return!1;var u=e[c],d=t[c];if(!1===(a=n?n.call(r,u,d,c):void 0)||void 0===a&&u!==d)return!1}return!0}},2177:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r="Invariant failed";function a(e,t){if(!e)throw new Error(r)}},3250:(e,t,n)=>{"use strict";var r=n(7294);var a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=r.useState,i=r.useEffect,l=r.useLayoutEffect,s=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!a(e,n)}catch(r){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=o({inst:{value:n,getSnapshot:t}}),a=r[0].inst,u=r[1];return l((function(){a.value=n,a.getSnapshot=t,c(a)&&u({inst:a})}),[e,n,t]),i((function(){return c(a)&&u({inst:a}),e((function(){c(a)&&u({inst:a})}))}),[e]),s(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},1688:(e,t,n)=>{"use strict";e.exports=n(3250)},6809:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={title:"Cogment",tagline:"Innovative open source AI platform developed by AI Redefined, designed to leverage the advent of AI to benefit humankind through human-AI collaboration.",url:"https://cogment.ai",baseUrl:"/",trailingSlash:!1,onBrokenLinks:"throw",onBrokenMarkdownLinks:"warn",favicon:"img/favicon.png",organizationName:"cogment",projectName:"cogment-doc",deploymentBranch:"gh-pages",presets:[["classic",{docs:{sidebarPath:"/builds/ai-r/cogment/cogment-doc/sidebars.js",showLastUpdateTime:!0},blog:!1,theme:{customCss:["/builds/ai-r/cogment/cogment-doc/src/css/custom.css"]},pages:{path:"src/pages"},sitemap:{},googleAnalytics:{trackingID:"UA-146998765-2",anonymizeIP:!0}}]],themes:[],themeConfig:{image:"img/cogment_logo_meta.png",colorMode:{defaultMode:"light",disableSwitch:!0,respectPrefersColorScheme:!1},navbar:{logo:{alt:"Cogment",src:"img/cogment_logo.svg"},items:[{type:"doc",docId:"index",position:"right",label:"Documentation"},{position:"right",label:"Cogment Verse",to:"cogment_verse"},{href:"https://github.com/cogment",label:"GitHub",position:"right"},{type:"doc",docId:"community-channels",label:"Community",position:"right"}],hideOnScroll:!1},footer:{links:[{title:"Documentation",items:[{label:"Overview",to:"/docs"},{label:"Core concepts",to:"/docs/guide/core-concepts"},{label:"Development guide",to:"/docs/guide/development-guide"},{label:"CLI reference",to:"/docs/reference/cli"},{label:"Python SDK reference",to:"/docs/reference/python"},{label:"Javascript SDK reference",to:"/docs/reference/javascript"}]},{title:"Community",items:[{label:"Github",href:"https://github.com/cogment"},{label:"Discord",href:"https://discord.com/invite/QDxb9Fweqr"},{label:"Twitter",href:"https://twitter.com/AI_Redefined"},{label:"LinkedIn",href:"https://www.linkedin.com/company/ai-r"},{label:"Facebook",href:"https://www.facebook.com/AIRedefined/"}]},{title:"AI Redefined",items:[{label:"Homepage",href:"https://ai-r.com/"},{label:"Solutions",href:"https://ai-r.com/solutions/"},{label:"About AIR",href:"https://ai-r.com/about-air/"},{label:"News",href:"https://ai-r.com/news/"},{label:"Contact",href:"https://ai-r.com/contact/"}]}],copyright:"Copyright \xa9 2023 AI Redefined Inc.",style:"light"},prism:{theme:{plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},darkTheme:{plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},additionalLanguages:[],magicComments:[{className:"theme-code-block-highlighted-line",line:"highlight-next-line",block:{start:"highlight-start",end:"highlight-end"}}]},algolia:{appId:"L5URPTBK9E",apiKey:"a47b82547b2b987f6e4c501900ddcf6e",indexName:"cogment",contextualSearch:!0,searchParameters:{},searchPagePath:"search"},docs:{versionPersistence:"localStorage",sidebar:{hideable:!1,autoCollapseCategories:!1}},metadata:[],tableOfContents:{minHeadingLevel:2,maxHeadingLevel:3}},baseUrlIssueBanner:!0,i18n:{defaultLocale:"en",path:"i18n",locales:["en"],localeConfigs:{}},onDuplicateRoutes:"warn",staticDirectories:["static"],customFields:{},plugins:[],scripts:[],headTags:[],stylesheets:[],clientModules:[],titleDelimiter:"|",noIndex:!1,markdown:{mermaid:!1}}},7462:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}n.d(t,{Z:()=>r})},5068:(e,t,n)=>{"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}function a(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}n.d(t,{Z:()=>a})},3366:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}n.d(t,{Z:()=>r})},7529:e=>{"use strict";e.exports={}},6887:e=>{"use strict";e.exports=JSON.parse('{"/cogment_verse-238":{"__comp":"8ba33b25","__context":{"plugin":"c0fe6564"},"config":"5e9f5e1a"},"/search-b08":{"__comp":"1a4e3797","__context":{"plugin":"1d042041"}},"/docs-390":{"__comp":"1be78505","__context":{"plugin":"be6d912d"},"versionMetadata":"935f2afb"},"/docs-f31":{"__comp":"17896441","content":"c377a04b"},"/docs/community-channels-fe1":{"__comp":"17896441","content":"9b35c4f5"},"/docs/guide/core-concepts-4f9":{"__comp":"17896441","content":"9b824c8f"},"/docs/guide/development-guide-213":{"__comp":"17896441","content":"354f5e12"},"/docs/guide/implementation-recipes-3dc":{"__comp":"17896441","content":"6c6cf206"},"/docs/guide/implementation-recipes/configure-trial-from-controller-6e2":{"__comp":"17896441","content":"f012f959"},"/docs/guide/implementation-recipes/v2-migration-guide-024":{"__comp":"17896441","content":"fd5e6f38"},"/docs/guide/tutorial-4db":{"__comp":"17896441","content":"4f085710"},"/docs/guide/tutorial/actors-in-cogment-ffe":{"__comp":"17896441","content":"80b5be58"},"/docs/guide/tutorial/advanced-tutorials-c3b":{"__comp":"17896441","content":"6f2832ad"},"/docs/guide/tutorial/advanced-tutorials/directory-162":{"__comp":"17896441","content":"76d0d1d8"},"/docs/guide/tutorial/advanced-tutorials/human-player-34b":{"__comp":"17896441","content":"d9378b29"},"/docs/guide/tutorial/advanced-tutorials/web-client-878":{"__comp":"17896441","content":"1b039142"},"/docs/guide/tutorial/decision-making-f36":{"__comp":"17896441","content":"c24ec994"},"/docs/guide/tutorial/environment-in-cogment-bea":{"__comp":"17896441","content":"e848be99"},"/docs/guide/tutorial/setup-a29":{"__comp":"17896441","content":"85f318fb"},"/docs/license-f2d":{"__comp":"17896441","content":"ac5280f2"},"/docs/reference/cli-59e":{"__comp":"17896441","content":"c3c15305"},"/docs/reference/cli/directory/directory-client-4f4":{"__comp":"17896441","content":"710eddd2"},"/docs/reference/cli/directory/directory-server-705":{"__comp":"17896441","content":"50751b0a"},"/docs/reference/cli/launch-548":{"__comp":"17896441","content":"8f68e2ce"},"/docs/reference/cli/model-registry-16c":{"__comp":"17896441","content":"a57d321a"},"/docs/reference/cli/orchestrator-962":{"__comp":"17896441","content":"14f1d27f"},"/docs/reference/cli/status-77f":{"__comp":"17896441","content":"3f8274eb"},"/docs/reference/cli/trial-datastore/trial-datastore-client-255":{"__comp":"17896441","content":"b2327a6c"},"/docs/reference/cli/trial-datastore/trial-datastore-server-436":{"__comp":"17896441","content":"696a412b"},"/docs/reference/cli/web-proxy-f0b":{"__comp":"17896441","content":"d03751be"},"/docs/reference/cogment-v2-changes-452":{"__comp":"17896441","content":"92a77eef"},"/docs/reference/cogment-yaml-d31":{"__comp":"17896441","content":"7a87d372"},"/docs/reference/grpc-407":{"__comp":"17896441","content":"d04964af"},"/docs/reference/javascript-4e0":{"__comp":"17896441","content":"8f51b104"},"/docs/reference/parameters-f82":{"__comp":"17896441","content":"08714d8c"},"/docs/reference/python-d04":{"__comp":"17896441","content":"2d986b69"},"/docs/reference/python-enterprise/installation-3b7":{"__comp":"17896441","content":"25848ff4"},"/docs/reference/python-enterprise/runner-277":{"__comp":"17896441","content":"61fcde8c"},"/-7f6":{"__comp":"c4f5d8e4","__context":{"plugin":"c0fe6564"},"config":"5e9f5e1a"}}')}},e=>{e.O(0,[532],(()=>{return t=9383,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/assets/js/runtime~main.08a7e066.js b/assets/js/runtime~main.08a7e066.js deleted file mode 100644 index 01f8784..0000000 --- a/assets/js/runtime~main.08a7e066.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,f,t,r,d,a={},c={};function o(e){var f=c[e];if(void 0!==f)return f.exports;var t=c[e]={id:e,loaded:!1,exports:{}};return a[e].call(t.exports,t,t.exports,o),t.loaded=!0,t.exports}o.m=a,o.c=c,e=[],o.O=(f,t,r,d)=>{if(!t){var a=1/0;for(i=0;i<e.length;i++){t=e[i][0],r=e[i][1],d=e[i][2];for(var c=!0,b=0;b<t.length;b++)(!1&d||a>=d)&&Object.keys(o.O).every((e=>o.O[e](t[b])))?t.splice(b--,1):(c=!1,d<a&&(a=d));if(c){e.splice(i--,1);var n=r();void 0!==n&&(f=n)}}return f}d=d||0;for(var i=e.length;i>0&&e[i-1][2]>d;i--)e[i]=e[i-1];e[i]=[t,r,d]},o.n=e=>{var f=e&&e.__esModule?()=>e.default:()=>e;return o.d(f,{a:f}),f},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var d=Object.create(null);o.r(d);var a={};f=f||[null,t({}),t([]),t(t)];for(var c=2&r&&e;"object"==typeof c&&!~f.indexOf(c);c=t(c))Object.getOwnPropertyNames(c).forEach((f=>a[f]=()=>e[f]));return a.default=()=>e,o.d(d,a),d},o.d=(e,f)=>{for(var t in f)o.o(f,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:f[t]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((f,t)=>(o.f[t](e,f),f)),[])),o.u=e=>"assets/js/"+({53:"935f2afb",916:"a57d321a",928:"696a412b",931:"14f1d27f",966:"6c6cf206",1028:"80b5be58",1043:"c3c15305",1257:"76d0d1d8",1455:"d03751be",1909:"b2327a6c",2147:"1b039142",2229:"f012f959",2880:"9b824c8f",3106:"fd5e6f38",3922:"08714d8c",3953:"7a87d372",4007:"d9378b29",4195:"c4f5d8e4",4896:"85f318fb",5089:"8f68e2ce",5171:"61fcde8c",5307:"6f2832ad",5505:"92a77eef",5519:"c24ec994",5649:"c0fe6564",5767:"1d042041",5893:"d04964af",6971:"c377a04b",7107:"be6d912d",7221:"710eddd2",7330:"8f51b104",7918:"17896441",7920:"1a4e3797",8172:"e848be99",8403:"25848ff4",8529:"ac5280f2",8687:"50751b0a",8769:"2d986b69",9071:"354f5e12",9255:"9b35c4f5",9514:"1be78505",9690:"3f8274eb",9921:"4f085710",9985:"8ba33b25"}[e]||e)+"."+{53:"eaa09a8c",916:"7b1da2dc",928:"30d5fb90",931:"e67f3f33",966:"4874a857",1028:"7a80df6d",1043:"0d717cd1",1257:"fef871bb",1455:"3d85882f",1909:"2d13b65b",2147:"34999ad0",2229:"ad12eb4f",2880:"1c11dbd9",3106:"65b6ada4",3922:"8066bd98",3953:"7e5409a8",4007:"6db302b8",4195:"75997564",4698:"8c4037a9",4896:"18658faf",4972:"9c4c5fed",5089:"68e819b0",5171:"4dd88737",5307:"e5b5393c",5505:"3834a1d4",5519:"1b981edd",5649:"fc79d8f6",5767:"3353ac3b",5893:"dad4b03c",6780:"2e464230",6945:"46b11133",6971:"dee11c26",7107:"6d137fe3",7221:"97c3fcd9",7330:"a7e302fa",7918:"e1ad11d7",7920:"2adc3808",8172:"fe19ea8a",8403:"57f5c5cf",8529:"23c0bab4",8687:"5ac1ed00",8769:"356337e0",8894:"2f96187b",9071:"28413fb0",9255:"4724485f",9514:"b5adb11b",9690:"7b2c5f8f",9921:"99943333",9985:"993fc35e"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),r={},d="cogment-doc:",o.l=(e,f,t,a)=>{if(r[e])r[e].push(f);else{var c,b;if(void 0!==t)for(var n=document.getElementsByTagName("script"),i=0;i<n.length;i++){var u=n[i];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==d+t){c=u;break}}c||(b=!0,(c=document.createElement("script")).charset="utf-8",c.timeout=120,o.nc&&c.setAttribute("nonce",o.nc),c.setAttribute("data-webpack",d+t),c.src=e),r[e]=[f];var l=(f,t)=>{c.onerror=c.onload=null,clearTimeout(s);var d=r[e];if(delete r[e],c.parentNode&&c.parentNode.removeChild(c),d&&d.forEach((e=>e(t))),f)return f(t)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=l.bind(null,c.onerror),c.onload=l.bind(null,c.onload),b&&document.head.appendChild(c)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.p="/",o.gca=function(e){return e={17896441:"7918","935f2afb":"53",a57d321a:"916","696a412b":"928","14f1d27f":"931","6c6cf206":"966","80b5be58":"1028",c3c15305:"1043","76d0d1d8":"1257",d03751be:"1455",b2327a6c:"1909","1b039142":"2147",f012f959:"2229","9b824c8f":"2880",fd5e6f38:"3106","08714d8c":"3922","7a87d372":"3953",d9378b29:"4007",c4f5d8e4:"4195","85f318fb":"4896","8f68e2ce":"5089","61fcde8c":"5171","6f2832ad":"5307","92a77eef":"5505",c24ec994:"5519",c0fe6564:"5649","1d042041":"5767",d04964af:"5893",c377a04b:"6971",be6d912d:"7107","710eddd2":"7221","8f51b104":"7330","1a4e3797":"7920",e848be99:"8172","25848ff4":"8403",ac5280f2:"8529","50751b0a":"8687","2d986b69":"8769","354f5e12":"9071","9b35c4f5":"9255","1be78505":"9514","3f8274eb":"9690","4f085710":"9921","8ba33b25":"9985"}[e]||e,o.p+o.u(e)},(()=>{var e={1303:0,532:0};o.f.j=(f,t)=>{var r=o.o(e,f)?e[f]:void 0;if(0!==r)if(r)t.push(r[2]);else if(/^(1303|532)$/.test(f))e[f]=0;else{var d=new Promise(((t,d)=>r=e[f]=[t,d]));t.push(r[2]=d);var a=o.p+o.u(f),c=new Error;o.l(a,(t=>{if(o.o(e,f)&&(0!==(r=e[f])&&(e[f]=void 0),r)){var d=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;c.message="Loading chunk "+f+" failed.\n("+d+": "+a+")",c.name="ChunkLoadError",c.type=d,c.request=a,r[1](c)}}),"chunk-"+f,f)}},o.O.j=f=>0===e[f];var f=(f,t)=>{var r,d,a=t[0],c=t[1],b=t[2],n=0;if(a.some((f=>0!==e[f]))){for(r in c)o.o(c,r)&&(o.m[r]=c[r]);if(b)var i=b(o)}for(f&&f(t);n<a.length;n++)d=a[n],o.o(e,d)&&e[d]&&e[d][0](),e[d]=0;return o.O(i)},t=self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[];t.forEach(f.bind(null,0)),t.push=f.bind(null,t.push.bind(t))})()})(); \ No newline at end of file diff --git a/assets/js/runtime~main.6c3ff3f8.js b/assets/js/runtime~main.6c3ff3f8.js new file mode 100644 index 0000000..654e1c2 --- /dev/null +++ b/assets/js/runtime~main.6c3ff3f8.js @@ -0,0 +1 @@ +(()=>{"use strict";var e,t,f,r,d,c={},a={};function o(e){var t=a[e];if(void 0!==t)return t.exports;var f=a[e]={id:e,loaded:!1,exports:{}};return c[e].call(f.exports,f,f.exports,o),f.loaded=!0,f.exports}o.m=c,o.c=a,e=[],o.O=(t,f,r,d)=>{if(!f){var c=1/0;for(i=0;i<e.length;i++){f=e[i][0],r=e[i][1],d=e[i][2];for(var a=!0,b=0;b<f.length;b++)(!1&d||c>=d)&&Object.keys(o.O).every((e=>o.O[e](f[b])))?f.splice(b--,1):(a=!1,d<c&&(c=d));if(a){e.splice(i--,1);var n=r();void 0!==n&&(t=n)}}return t}d=d||0;for(var i=e.length;i>0&&e[i-1][2]>d;i--)e[i]=e[i-1];e[i]=[f,r,d]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},f=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var d=Object.create(null);o.r(d);var c={};t=t||[null,f({}),f([]),f(f)];for(var a=2&r&&e;"object"==typeof a&&!~t.indexOf(a);a=f(a))Object.getOwnPropertyNames(a).forEach((t=>c[t]=()=>e[t]));return c.default=()=>e,o.d(d,c),d},o.d=(e,t)=>{for(var f in t)o.o(t,f)&&!o.o(e,f)&&Object.defineProperty(e,f,{enumerable:!0,get:t[f]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,f)=>(o.f[f](e,t),t)),[])),o.u=e=>"assets/js/"+({53:"935f2afb",916:"a57d321a",928:"696a412b",931:"14f1d27f",966:"6c6cf206",1028:"80b5be58",1043:"c3c15305",1257:"76d0d1d8",1455:"d03751be",1909:"b2327a6c",2147:"1b039142",2229:"f012f959",2432:"1ae06ce2",2880:"9b824c8f",3106:"fd5e6f38",3922:"08714d8c",3953:"7a87d372",4007:"d9378b29",4195:"c4f5d8e4",4896:"85f318fb",5089:"8f68e2ce",5171:"61fcde8c",5307:"6f2832ad",5505:"92a77eef",5519:"c24ec994",5649:"c0fe6564",5767:"1d042041",5893:"d04964af",6971:"c377a04b",7107:"be6d912d",7221:"710eddd2",7330:"8f51b104",7918:"17896441",7920:"1a4e3797",8172:"e848be99",8403:"25848ff4",8529:"ac5280f2",8687:"50751b0a",8769:"2d986b69",9071:"354f5e12",9255:"9b35c4f5",9514:"1be78505",9690:"3f8274eb",9921:"4f085710",9985:"8ba33b25"}[e]||e)+"."+{53:"09e8e1d7",180:"266d3c72",916:"60ac5400",928:"d894ab23",931:"df7b274f",966:"5b4ed37f",1028:"275e3f65",1043:"d1d9e182",1257:"322e3cf9",1426:"0c0df919",1455:"6bff62ea",1744:"dbc8bcaa",1909:"23dd6cdd",2147:"844cbc15",2229:"eebb0295",2432:"b025e158",2880:"ce8974a2",3106:"00dde33b",3922:"2b3a3d60",3953:"6b3c6bdb",4007:"fc93762c",4195:"d96c9167",4896:"fb5b0e0a",4972:"9c4c5fed",5089:"9a776507",5171:"6d225a73",5307:"a9a521bd",5505:"a4d602b3",5519:"ca06e2db",5649:"fc79d8f6",5767:"3353ac3b",5893:"19d5aef9",6945:"46b11133",6971:"f8bc1c7c",7107:"6d137fe3",7221:"0d5614ca",7330:"ad70d212",7918:"82a14470",7920:"98c7b9ce",8172:"7ec8f765",8403:"82af9e63",8529:"4f4b5f86",8687:"e8e54558",8769:"a602b553",8894:"2f96187b",9071:"51aa68f8",9255:"8ddc6530",9514:"88fe94d0",9690:"2403290b",9921:"4ae361d8",9985:"3073f947"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r={},d="cogment-doc:",o.l=(e,t,f,c)=>{if(r[e])r[e].push(t);else{var a,b;if(void 0!==f)for(var n=document.getElementsByTagName("script"),i=0;i<n.length;i++){var l=n[i];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==d+f){a=l;break}}a||(b=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.setAttribute("data-webpack",d+f),a.src=e),r[e]=[t];var u=(t,f)=>{a.onerror=a.onload=null,clearTimeout(s);var d=r[e];if(delete r[e],a.parentNode&&a.parentNode.removeChild(a),d&&d.forEach((e=>e(f))),t)return t(f)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=u.bind(null,a.onerror),a.onload=u.bind(null,a.onload),b&&document.head.appendChild(a)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),o.p="/",o.gca=function(e){return e={17896441:"7918","935f2afb":"53",a57d321a:"916","696a412b":"928","14f1d27f":"931","6c6cf206":"966","80b5be58":"1028",c3c15305:"1043","76d0d1d8":"1257",d03751be:"1455",b2327a6c:"1909","1b039142":"2147",f012f959:"2229","1ae06ce2":"2432","9b824c8f":"2880",fd5e6f38:"3106","08714d8c":"3922","7a87d372":"3953",d9378b29:"4007",c4f5d8e4:"4195","85f318fb":"4896","8f68e2ce":"5089","61fcde8c":"5171","6f2832ad":"5307","92a77eef":"5505",c24ec994:"5519",c0fe6564:"5649","1d042041":"5767",d04964af:"5893",c377a04b:"6971",be6d912d:"7107","710eddd2":"7221","8f51b104":"7330","1a4e3797":"7920",e848be99:"8172","25848ff4":"8403",ac5280f2:"8529","50751b0a":"8687","2d986b69":"8769","354f5e12":"9071","9b35c4f5":"9255","1be78505":"9514","3f8274eb":"9690","4f085710":"9921","8ba33b25":"9985"}[e]||e,o.p+o.u(e)},(()=>{var e={1303:0,532:0};o.f.j=(t,f)=>{var r=o.o(e,t)?e[t]:void 0;if(0!==r)if(r)f.push(r[2]);else if(/^(1303|532)$/.test(t))e[t]=0;else{var d=new Promise(((f,d)=>r=e[t]=[f,d]));f.push(r[2]=d);var c=o.p+o.u(t),a=new Error;o.l(c,(f=>{if(o.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var d=f&&("load"===f.type?"missing":f.type),c=f&&f.target&&f.target.src;a.message="Loading chunk "+t+" failed.\n("+d+": "+c+")",a.name="ChunkLoadError",a.type=d,a.request=c,r[1](a)}}),"chunk-"+t,t)}},o.O.j=t=>0===e[t];var t=(t,f)=>{var r,d,c=f[0],a=f[1],b=f[2],n=0;if(c.some((t=>0!==e[t]))){for(r in a)o.o(a,r)&&(o.m[r]=a[r]);if(b)var i=b(o)}for(t&&t(f);n<c.length;n++)d=c[n],o.o(e,d)&&e[d]&&e[d][0](),e[d]=0;return o.O(i)},f=self.webpackChunkcogment_doc=self.webpackChunkcogment_doc||[];f.forEach(t.bind(null,0)),f.push=t.bind(null,f.push.bind(f))})(),o.nc=void 0})(); \ No newline at end of file diff --git a/cogment_verse.html b/cogment_verse.html index e27febf..5a63283 100644 --- a/cogment_verse.html +++ b/cogment_verse.html @@ -1,28 +1,28 @@ <!doctype html> -<html lang="en" dir="ltr" class="plugin-pages plugin-id-default"> +<html lang="en" dir="ltr" class="plugin-pages plugin-id-default" data-has-hydrated="false"> <head> <meta charset="UTF-8"> -<meta name="generator" content="Docusaurus v2.4.0"> +<meta name="generator" content="Docusaurus v2.4.3"> <title data-rh="true">Cogment Verse | Cogment - - - + + +
-

Research platform for Human-in-the-loop learning & Multi-Agent Reinforcement Learning

Start building & training agents with HILL and MARL techniques within Gym, Petting Zoo, and more...

Video Demo

Key features

Cogment Verse is a SDK helping researchers and developers in the fields of human-in-the-loop learning (HILL) and multi-agent reinforcement learning (MARL) train and validate their agents at scale. Cogment Verse instantiates the open-source Cogment platform for environments following the OpenAI Gym mold, making it easy to get started.

Simply clone the repo and start training.

Atari Double Dunk - From Petting ZooGo - From Petting ZooAtari Montezuma's Revenge - From Open AI GymLunar Lander - From Open AI Gym

HILL and MARL Training

Our SDK includes base implementations for multiple RL algorithms such as DQN, TD3, A2C and PPO for both single- and multi-agent reinforcement learning (MARL). For human-in-the-loop learning, Cogment Verse includes different paradigms like learning from demonstrations (behavior cloning), learning from human interventions, and learning from explicit human feedback (RLHF). More importantly, the SDK makes it easy to implement any asynchronous centralized training / decentralized execution algorithm.

Interactive Web Application

A built-in interactive web application enables seamless human participation in episodes during the training and validation processes. Additional environments can be made interactive with very little web development required..

Collaboration Patterns

Library of predefined roles for agents or humans facilitating the implementation of multiple collaboration patterns: co-players, teacher/student dual control, evaluators, etc.

Extensive Environment Library

The existing environment library includes the standard OpenAI Gym environments as well as board games, card games, and other multi-agent environments from Petting Zoo. Other environments are gradually being added, such as Isaac Gym or Overcooked-AI. Implementing your own interactive custom environments is also quite straightforward.

Experiments Management

Monitor and manage reproducible experiments, thanks to:

Citation

If you use Cogment Verse in your research, please cite our demo paper appearing in AAMAS 2023 proceedings:

@inproceedings{cogment_verse_2023,
+

Research platform for Human-in-the-loop learning & Multi-Agent Reinforcement Learning

Start building & training agents with HILL and MARL techniques within Gym, Petting Zoo, and more...

Video Demo

Key features

Cogment Verse is a SDK helping researchers and developers in the fields of human-in-the-loop learning (HILL) and multi-agent reinforcement learning (MARL) train and validate their agents at scale. Cogment Verse instantiates the open-source Cogment platform for environments following the OpenAI Gym mold, making it easy to get started.

Simply clone the repo and start training.

Atari Double Dunk - From Petting ZooGo - From Petting ZooAtari Montezuma's Revenge - From Open AI GymLunar Lander - From Open AI Gym

HILL and MARL Training

Our SDK includes base implementations for multiple RL algorithms such as DQN, TD3, A2C and PPO for both single- and multi-agent reinforcement learning (MARL). For human-in-the-loop learning, Cogment Verse includes different paradigms like learning from demonstrations (behavior cloning), learning from human interventions, and learning from explicit human feedback (RLHF). More importantly, the SDK makes it easy to implement any asynchronous centralized training / decentralized execution algorithm.

Interactive Web Application

A built-in interactive web application enables seamless human participation in episodes during the training and validation processes. Additional environments can be made interactive with very little web development required..

Collaboration Patterns

Library of predefined roles for agents or humans facilitating the implementation of multiple collaboration patterns: co-players, teacher/student dual control, evaluators, etc.

Extensive Environment Library

The existing environment library includes the standard OpenAI Gym environments as well as board games, card games, and other multi-agent environments from Petting Zoo. Other environments are gradually being added, such as Isaac Gym or Overcooked-AI. Implementing your own interactive custom environments is also quite straightforward.

Experiments Management

Monitor and manage reproducible experiments, thanks to:

Citation

If you use Cogment Verse in your research, please cite our demo paper appearing in AAMAS 2023 proceedings:

@inproceedings{cogment_verse_2023,
   title={Hiking up that HILL with Cogment-Verse: Train \& Operate Multi-agent Systems Learning from Humans},
   author={Gottipati, Sai Krishna and Nguyen, Luong-Ha and Mars, Clod{\'e}ric and Taylor, Matthew E},
   booktitle={Proceedings of the 2023 International Conference on Autonomous Agents and Multiagent Systems},
   pages={3065--3067},
   year={2023}
 }
-
- - +
+ + \ No newline at end of file diff --git a/docs.html b/docs.html index d338c2e..fef9e44 100644 --- a/docs.html +++ b/docs.html @@ -1,23 +1,23 @@ - + - + Overview | Cogment - - - + + +
-

What is Cogment?

Cogment is the first open source platform designed to address the challenges of continuously training humans and AI together. Cogment is developed by AI Redefined to enable AI practitioners to build, train and operate AI agents in simulated or real environments shared with humans. Fundamentally, Cogment is a set of tools designed to make it easier and more scalable to coordinate how Agents share information with each other and the Environment in which they operate.

Cogment is designed around the idea of sequential interactions between Actors and their Environment, as in Reinforcement Learning (RL). Cogment uses distributed micro-services to manage these interactions, so that different components can be run independently and asynchronously. This approach makes for more efficient and scalable solutions. It also means that Cogment can handle many actors in the same system, which makes it a great solution for implementing Multi-Agent Systems (MAS) and Multi-Agent Reinforcement Learning (MARL).

Cogment treats human users and computer-based agents as the same from a high level point of view, rendering them interchangeable. This makes Cogment well-adapted to any kind of Human-In-the-Loop Learning (HILL) process, like Imitation Learning (IL) / Behavior Cloning (BC), RL from human feedback (RLHF) or even Active Learning. This allows computer-based agents to make use of human feedback and ultimately speed up the process of learning.

See our white paper for more details.

How does Cogment work?

Cogment works by separating the different components of sequential decision-making tasks into different computational streams, and coordinating the results of these computations only when necessary. That is, different parts of the task are run as distributed microservices, and information is passed between services via gRPC protocol. This is made possible by a set of Cogment Core Components that can be used through a Command Line Interface (CLI). These components are packaged in an easily distributable, cross-platform, standalone executable.

The full suite of Cogment tooling also includes software development kits (SDKs) for Python and Javascript. These SDKs interface with the +

What is Cogment?

Cogment is the first open source platform designed to address the challenges of continuously training humans and AI together. Cogment is developed by AI Redefined to enable AI practitioners to build, train and operate AI agents in simulated or real environments shared with humans. Fundamentally, Cogment is a set of tools designed to make it easier and more scalable to coordinate how Agents share information with each other and the Environment in which they operate.

Cogment is designed around the idea of sequential interactions between Actors and their Environment, as in Reinforcement Learning (RL). Cogment uses distributed micro-services to manage these interactions, so that different components can be run independently and asynchronously. This approach makes for more efficient and scalable solutions. It also means that Cogment can handle many actors in the same system, which makes it a great solution for implementing Multi-Agent Systems (MAS) and Multi-Agent Reinforcement Learning (MARL).

Cogment treats human users and computer-based agents as the same from a high level point of view, rendering them interchangeable. This makes Cogment well-adapted to any kind of Human-In-the-Loop Learning (HILL) process, like Imitation Learning (IL) / Behavior Cloning (BC), RL from human feedback (RLHF) or even Active Learning. This allows computer-based agents to make use of human feedback and ultimately speed up the process of learning.

See our white paper for more details.

How does Cogment work?

Cogment works by separating the different components of sequential decision-making tasks into different computational streams, and coordinating the results of these computations only when necessary. That is, different parts of the task are run as distributed microservices, and information is passed between services via gRPC protocol. This is made possible by a set of Cogment Core Components that can be used through a Command Line Interface (CLI). These components are packaged in an easily distributable, cross-platform, standalone executable.

The full suite of Cogment tooling also includes software development kits (SDKs) for Python and Javascript. These SDKs interface with the Core Components in order to more easily work with Cogment to build out the specifics of your application, such as the simulated Environment you want to work in, the Actors involved, and the details of how you want them to interact in a Trial.

Cogment components

What are the Core Components of Cogment?

The Core services, run through the Cogment CLI are:

  • The Orchestrator is the heart of a Cogment app, which manages the operations and interactions of different components,
  • The Trial Datastore, which stores and makes available data generated while running Cogment,
  • The Model Registry, which stores different versions of trained AI models to be used by Cogment agents.
  • The Directory, where Cogment services are registered and can be easily found by clients and other services.

The different Cogment components and how they interact can be summarized in the following diagram:

summary of Cogment Components

(The Directory is missing from this diagram, as it mainly works to facilitate the process of connecting all of the different services to each other.)

What components are implemented with SDKs?

Software development kits (SDKs) are available in both Python and -Javascript.

These can be used to build Cogment application services like Actors and simulated Environments, or client components such as an interface for a human user to interact with the application. Additionally, the SDKs are used to specify how Cogment trials (eg. interactions between Actors and their Environment) should be configured and run with the Trial Runner.

For more details, please see the dedicated reference page for the SDK in your preferred programming language. Stay tuned for development of new SDKs!

If you would like to get a more hands-on introduction to the details of how Cogment works, you can follow our tutorial.

What is Cogment used for?

Cogment is especially well suited to address multi-agent contexts, regardless of their learning mechanisms (or, for that matter, whether they are of the learning kind or not).

Cogment may be a suitable approach if you want to:

  • Easily bootstrap a given system using human users, heuristic agents, or both, then transitioning seamlessly to an ML implementation
  • Utilize multiple ML approaches to contribute to a single role, which require balancing their contributions by some criteria (such as some rule set or performance metrics, for example)
  • Comparing different agent types/implementations without requiring any change in the implementation of the environment

Getting Started with Cogment

Before diving right in, we recommend taking the time to read the core concepts section which details the terminology we use for several critical concepts of Cogment. You can then proceed to read on how to install the platform.

To get your hands dirty, proceed to the tutorial for an introduction to all things Cogment. While Cogment can do many things, this tutorial aims to be a first introduction to the general principles of Cogment. The tutorial builds an application using the Python SDK to interface with Cogment. For more information about the range of features Cogment can offer, see the Development Guide or get connected with us.

Citations

If you use Cogment in your research, please cite our white paper as follows:

@misc{air2021cogment,
title={Cogment: Open Source Framework For Distributed Multi-actor Training, Deployment & Operations},
author={AI Redefined and Sai Krishna Gottipati and Sagar Kurandwad and Clodéric Mars and Gregory Szriftgiser and
François Chabot},
year={2021},
eprint={2106.11345},
archivePrefix={arXiv},
primaryClass={cs.AI}
}
- - +Javascript.

These can be used to build Cogment application services like Actors and simulated Environments, or client components such as an interface for a human user to interact with the application. Additionally, the SDKs are used to specify how Cogment trials (eg. interactions between Actors and their Environment) should be configured and run with the Trial Runner.

For more details, please see the dedicated reference page for the SDK in your preferred programming language. Stay tuned for development of new SDKs!

If you would like to get a more hands-on introduction to the details of how Cogment works, you can follow our tutorial.

What is Cogment used for?

Cogment is especially well suited to address multi-agent contexts, regardless of their learning mechanisms (or, for that matter, whether they are of the learning kind or not).

Cogment may be a suitable approach if you want to:

  • Easily bootstrap a given system using human users, heuristic agents, or both, then transitioning seamlessly to an ML implementation
  • Utilize multiple ML approaches to contribute to a single role, which require balancing their contributions by some criteria (such as some rule set or performance metrics, for example)
  • Comparing different agent types/implementations without requiring any change in the implementation of the environment

Getting Started with Cogment

Before diving right in, we recommend taking the time to read the core concepts section which details the terminology we use for several critical concepts of Cogment. You can then proceed to read on how to install the platform.

To get your hands dirty, proceed to the tutorial for an introduction to all things Cogment. While Cogment can do many things, this tutorial aims to be a first introduction to the general principles of Cogment. The tutorial builds an application using the Python SDK to interface with Cogment. For more information about the range of features Cogment can offer, see the Development Guide or get connected with us.

Citations

If you use Cogment in your research, please cite our white paper as follows:

@misc{air2021cogment,
title={Cogment: Open Source Framework For Distributed Multi-actor Training, Deployment & Operations},
author={AI Redefined and Sai Krishna Gottipati and Sagar Kurandwad and Clodéric Mars and Gregory Szriftgiser and
François Chabot},
year={2021},
eprint={2106.11345},
archivePrefix={arXiv},
primaryClass={cs.AI}
}
+ + \ No newline at end of file diff --git a/docs/community-channels.html b/docs/community-channels.html index 4076c70..c519ca7 100644 --- a/docs/community-channels.html +++ b/docs/community-channels.html @@ -1,22 +1,22 @@ - + - + Community | Cogment - - - + + +
-

Community

If you have questions about Cogment, a project you are working on or would like to start with Cogment, or would like to become more involved in the open-source development of Cogment, we invite you to join our Discord server. Here members of the Cogment community can come together to chat by voice or text, ask questions, and share solutions. We look forward to connecting with you!

Interact with Us

We'd love to hear from you about any project you're working on with Cogment or -Cogment Verse. Reach out on the Discord server to discuss your project, report any bugs you might find, or propose any fixes you think might improve our platform.

Reporting Bugs

If you do need to report a bug, you can do so on the issues page for Cogment or Cogment Verse. It's useful to check this list first to see if your issue has been raised already before submitting a new one.

When filing an issue, make sure to answer these five questions:

  1. What version of cogment are you using (check using cogment version)?
  2. What operating system and processor architecture are you using?
  3. What did you do?
  4. What did you expect to see?
  5. What did you see instead?

Security Disclosures

If you find a security vulnerability, do NOT open an issue. Any security issues should be submitted directly to dev+security@ai-r.com. In order to determine whether you are dealing with a security issue, ask yourself these two questions:

  • Can I access something that's not mine, or something I shouldn't have access to?
  • Can I disable something for other people?

If the answer to either of those two questions are "yes", then you're probably dealing with a security issue. Note that even if you answer "no" to both questions, you may still be dealing with a security issue, so if you're unsure, just email us at dev+security@ai-r.com.

Participate in Cogment Open Source

If you are interested in contributing to Cogment or Cogment Verse, please get in touch with the team on the Discord server and share what you're thinking about.

You'll need to sign a Contributor License Agreement (CLA) so that you can retain ownership of the code submitted and AI Redefined has legal rights to use the contribution. Once signed, a CLA covers all Cogment projects. Get a CLA by emailing dev+cla@ai-r.com.

To participate in the Cogment Open Source community, please make sure you follow our Code of Conduct guidelines.

If you want to implement a feature or bugfix for an outstanding issue, search for that issue on the dedicated issues page for Cogment or Cogment Verse and comment that you are going to work on this piece. If you need more context on a particular issue, reach out on our Discord server.

- - +

Community

If you have questions about Cogment, a project you are working on or would like to start with Cogment, or would like to become more involved in the open-source development of Cogment, we invite you to join our Discord server. Here members of the Cogment community can come together to chat by voice or text, ask questions, and share solutions. We look forward to connecting with you!

Interact with Us

We'd love to hear from you about any project you're working on with Cogment or +Cogment Verse. Reach out on the Discord server to discuss your project, report any bugs you might find, or propose any fixes you think might improve our platform.

Reporting Bugs

If you do need to report a bug, you can do so on the issues page for Cogment or Cogment Verse. It's useful to check this list first to see if your issue has been raised already before submitting a new one.

When filing an issue, make sure to answer these five questions:

  1. What version of cogment are you using (check using cogment version)?
  2. What operating system and processor architecture are you using?
  3. What did you do?
  4. What did you expect to see?
  5. What did you see instead?

Security Disclosures

If you find a security vulnerability, do NOT open an issue. Any security issues should be submitted directly to dev+security@ai-r.com. In order to determine whether you are dealing with a security issue, ask yourself these two questions:

  • Can I access something that's not mine, or something I shouldn't have access to?
  • Can I disable something for other people?

If the answer to either of those two questions are "yes", then you're probably dealing with a security issue. Note that even if you answer "no" to both questions, you may still be dealing with a security issue, so if you're unsure, just email us at dev+security@ai-r.com.

Participate in Cogment Open Source

If you are interested in contributing to Cogment or Cogment Verse, please get in touch with the team on the Discord server and share what you're thinking about.

You'll need to sign a Contributor License Agreement (CLA) so that you can retain ownership of the code submitted and AI Redefined has legal rights to use the contribution. Once signed, a CLA covers all Cogment projects. Get a CLA by emailing dev+cla@ai-r.com.

To participate in the Cogment Open Source community, please make sure you follow our Code of Conduct guidelines.

If you want to implement a feature or bugfix for an outstanding issue, search for that issue on the dedicated issues page for Cogment or Cogment Verse and comment that you are going to work on this piece. If you need more context on a particular issue, reach out on our Discord server.

+ + \ No newline at end of file diff --git a/docs/guide/core-concepts.html b/docs/guide/core-concepts.html index 958b731..19c2a97 100644 --- a/docs/guide/core-concepts.html +++ b/docs/guide/core-concepts.html @@ -1,26 +1,26 @@ - + - + Core Concepts | Cogment - - - + + +
-

Core Concepts

Cogment is built around concepts adapted from multi-agent systems (actors, environment), Markov decision processes (action and observation space) and reinforcement learning (trials, rewards). This page aims to explain these concepts at a high level and give some idea of how they are used in Cogment.

Basic components of Cogment

At the most basic level, Cogment facilitates interactions between Actors and their Environment. Actors take in observations of the Environment as input, and use these to generate actions as outputs. The Environment takes actions as inputs, and outputs the consequences of that action, such as the next observation and, optionally, a numerical feedback signal about how good or bad the action was (eg. reward).

Cogment is designed so that components like the Environment and the Actors can be run as distributed services with easily interchangeable implementations, and with a system to enable efficient transfer of information between services.

Environment

The Environment is the context in which Cogment Trials are run. The Environment is the main integration point between Cogment and an external system, either a simulation or a real world system.

In the most general terms, the Environment is the world in which a human or computer agent (eg. Actors) can take actions. For example, in the Atari game Pong, the Environment is the simulated arena in which players control "paddles" to keep a "ball" within the bounds of the screen. The Environment also includes the set of rules for what actions exist (eg. you can move your paddles up and down, but not left and right) and also how the game evolves as a consequence of certain actions being taken.

State and Observation Spaces

The Environment can be in different states. The set of all possible states the Environment could be in is called the "state space". Usually an Actor needs to have some knowledge about the current state of the world they're in to make decisions about what action should be taken. The Actor doesn't always get access to every detail about the current state of the Environment, but rather gets observations of the current state. The set of all possible observations an Actor could see is called "observation space". In Cogment, we only explicitly deal with observations of the Environment.

How the Environment works in Cogment

In Cogment, the basic outline of the Environment is given in the specification file, which configures what parameters are important for setting up the Environment. The general structure of how an Environment works (eg. what info it takes as input and what it generates as output) is specified in the Environment implementation, along with the rules of how the Environment responds to a given action and produces subsequent observations for the Actor(s). The Environment implementation is accessed by the Orchestrator to run the Environment during Trials.

Using one of Cogment's SDKs, the Environment can be implemented as a function integrating a "state of the world" with the Trial. This function performs the following tasks during the Trial:

  • Generate Observations from the current state of the world, for example retrieving the visible objects from a 3D simulation.
  • Apply the Actions, thus updating the state of the world, for example changing the velocity of a moving vehicle in a race simulation.
  • Evaluate the performance of Actors and send them Rewards, for example by checking if a vehicle crossed the finish line in a race simulation.

Actors

Actors are roles that can do stuff, eg. Actors take actions which may affect the state of the Environment. In Cogment, Actors can be either humans or computer-based agents and effectively operate identically.

Action Space

Actors take Observations about the current state of the Environment as inputs, and produce actions as outputs. The set of all actions that can be produced is called the "Action space".

Each Actor can get a different Observation from the Environment representing what it perceives about the state of the world. The action represents the decision the Actor takes upon receiving this observation. The action selected by the Actor is then applied by the Environment. Cogment leverages this discrete update to orchestrate the execution of the components and the dispatch of data between them.

How Actors work in Cogment

Concepts of Actors in Cogment

Cogment allocates a dedicated gRPC service to run the computations of Actors, which we call the "Actor Service". It can also refer to the computational node running this service. This service effectively offers the registered actor implementations for use in trials.

The Actor class specifies what kinds of inputs and outputs to expect. The class definition specifies what an actor is.

The Actor implementation is the function the Actor uses to compute what action to take given some input information. If we want to have a bunch of different Actors that all behave similarly (take same kind of inputs and produce same kind of outputs) we can define an Actor class and different instances of that class can use different implementations.

Client and Service Actors

An Actor might be controlled either by a software agent, or by a Human. Whichever the case, the process of generating actions based on observations remains the same, and the Environment treats them the same. Some Actors connect to the trial (we call them "client" Actors) and others will wait for the trial to connect to them (we call these "service" Actors). Service Actors are run on a designated computational node called the Actor Service.

Interactions between Actors and the Environment

Basic concepts

The Observations and Actions we discussed above are the key pieces of information exchanged between Actors and the Environment.

  • Environments take actions as an input and output observations,
  • Actors take observations as an input and output actions.

As discussed before, the Environment can also provide feedback to the Actor about their actions in the form of a numerical reward signal, but it is not strictly necessary for the Environment to do so.

In Cogment, Actors and the Environment exchange information via the Orchestrator - a core component of Cogment which facilitates the interaction of distributed services. To do so, the observation and action space for the Actors and the Environment are defined as typed data structures. Cogment uses Protocol Buffers as a format to specify these data structures. This typing defines both an interface contract between the Actors and the Environment and helps convey semantic information, thus facilitating the independent design and development of both. In practice this enables the Actors and Environment to be run as separate services (eg. on separate computational nodes) and have the Orchestrator pass these protobuf messages between the different services as needed.

Trials

Trials are how a Cogment deployment runs the sequential interactions between Actors and their Environment. A trial is defined by the participating Actors and the host Environment. As a concept, Trials are quite close to Reinforcement Learning's Episodes, i.e. all the states that come between an initial state and a terminal state. However, because Cogment can be used outside of an RL context, we prefer using the more generic term of Trial.

How Trials work in Cogment

Trials are started by clients connecting to Cogment. A trial can end either by being terminated from a client or end by itself, for example once a specific state of the Environment is reached.

During the trial:

  • The Environment generates observations of its internal state and sends them to the Actors.
  • Given these observations, each Actor chooses and sends an action.
  • The Environment receives the actions and updates its internal state.
  • Rewards can be sent to the Actors from either the Environment or other Actors. A reward is a measure of an actor’s performance within the environment at a given point in time during the trial.
  • Actors receive rewards if at least one was sent to them.
  • A log of the activity during the trial (observations, actions, rewards) is produced and can be stored.

The Specification file

The configurations for how trial elements are set up are defined in a YAML specification file typically called cogment.yaml. This file details how elements of the project work, including its actor classes and their action & observation spaces. You can learn more about the specification file in the dedicated reference page.


Cogment Architecture

Running trials with Cogment usually involves the deployment of a cluster of services and clients. These components are either provided by the Cogment framework, depicted below in blue, or implemented for a particular project with Software Development Kits (SDKs) in either Python or Javascript, depicted below in orange.

Cogment Architecture

User implemented components use one of the Cogment SDKs or directly implement the underlying protocol. Components communicate using gRPC, clients can also communicate in a web-friendly way using gRPC-Web and grpcwebproxy.

Context

The Context is a point of entry for Cogment to interface with the different services through SDKs. See also the SDK documentation for Context (Python | JavaScript).

Orchestrator

The Orchestrator is the glue that binds everything together. It is responsible for running the Trials and contacting other services as needed to ensure their execution.

The key aspect of Cogment's orchestrator is its capacity to handle a number of network connections in parallel while keeping its responsiveness.

Controller

The Controller is a key part of using Cogment, it initiates communication with the Orchestrator to control the execution of Trials. It is responsible for starting Trials, retrieving and watching their state (including the end of the trial), or requesting trial termination. You can see more in the Python SDK documentation for the Controller. The Controller is created by the Context.

Environment

The Environment implementation is accessed by the Orchestrator to run the Environment during Trials.

Using one of Cogment's SDKs, the Environment can be implemented as a function integrating a "state of the world" with the Trial. This function performs the following tasks during the Trial:

  • Generate Observations from the current state of the world, for example retrieving the visible objects from a 3D simulation.
  • Apply the Actions, thus updating the state of the world, for example changing the velocity of a moving vehicle in a race simulation.
  • Evaluate the performance of Actors and send them Rewards, for example by checking if a vehicle crossed the finish line in a race simulation.

Actors

Cogment handles Actors in two different ways: either as a service Actor or as a client Actor. Service Actor implementations are accessed by the Orchestrator during Trials, while Client Actor implementations join a Trial by initiating the communication with the Orchestrator. Client Actors implementations can reach a Cogment deployment through NAT traversal. This makes them particularly well-suited to implement human-driven Actors, in web-browsers for example.

Using one of Cogment's SDKs Actors can be implemented as functions handling the integration between a decision-making Actor (software agent or Human) and the Trial. This function performs the following tasks during the Trial:

  • Receive Observations and do Actions in response, for example vectorizing the retrieved observation, feeding it to a neural network and converting its output to an Action.
  • Receive Rewards, for example using them to update a neural network.
  • Optionally: send and receive direct messages.

Please note that rewards can also be retrieved after the fact using a datalog.

Additional components

On top of the core components described above, a Cogment deployment can include these additional ones:

  • Datalog services can be used to listen to the activity during a trial (actions, observations, rewards, messages) +

    Core Concepts

    Cogment is built around concepts adapted from multi-agent systems (actors, environment), Markov decision processes (action and observation space) and reinforcement learning (trials, rewards). This page aims to explain these concepts at a high level and give some idea of how they are used in Cogment.

    Basic components of Cogment

    At the most basic level, Cogment facilitates interactions between Actors and their Environment. Actors take in observations of the Environment as input, and use these to generate actions as outputs. The Environment takes actions as inputs, and outputs the consequences of that action, such as the next observation and, optionally, a numerical feedback signal about how good or bad the action was (eg. reward).

    Cogment is designed so that components like the Environment and the Actors can be run as distributed services with easily interchangeable implementations, and with a system to enable efficient transfer of information between services.

    Environment

    The Environment is the context in which Cogment Trials are run. The Environment is the main integration point between Cogment and an external system, either a simulation or a real world system.

    In the most general terms, the Environment is the world in which a human or computer agent (eg. Actors) can take actions. For example, in the Atari game Pong, the Environment is the simulated arena in which players control "paddles" to keep a "ball" within the bounds of the screen. The Environment also includes the set of rules for what actions exist (eg. you can move your paddles up and down, but not left and right) and also how the game evolves as a consequence of certain actions being taken.

    State and Observation Spaces

    The Environment can be in different states. The set of all possible states the Environment could be in is called the "state space". Usually an Actor needs to have some knowledge about the current state of the world they're in to make decisions about what action should be taken. The Actor doesn't always get access to every detail about the current state of the Environment, but rather gets observations of the current state. The set of all possible observations an Actor could see is called "observation space". In Cogment, we only explicitly deal with observations of the Environment.

    How the Environment works in Cogment

    In Cogment, the basic outline of the Environment is given in the specification file, which configures what parameters are important for setting up the Environment. The general structure of how an Environment works (eg. what info it takes as input and what it generates as output) is specified in the Environment implementation, along with the rules of how the Environment responds to a given action and produces subsequent observations for the Actor(s). The Environment implementation is accessed by the Orchestrator to run the Environment during Trials.

    Using one of Cogment's SDKs, the Environment can be implemented as a function integrating a "state of the world" with the Trial. This function performs the following tasks during the Trial:

    • Generate Observations from the current state of the world, for example retrieving the visible objects from a 3D simulation.
    • Apply the Actions, thus updating the state of the world, for example changing the velocity of a moving vehicle in a race simulation.
    • Evaluate the performance of Actors and send them Rewards, for example by checking if a vehicle crossed the finish line in a race simulation.

    Actors

    Actors are roles that can do stuff, eg. Actors take actions which may affect the state of the Environment. In Cogment, Actors can be either humans or computer-based agents and effectively operate identically.

    Action Space

    Actors take Observations about the current state of the Environment as inputs, and produce actions as outputs. The set of all actions that can be produced is called the "Action space".

    Each Actor can get a different Observation from the Environment representing what it perceives about the state of the world. The action represents the decision the Actor takes upon receiving this observation. The action selected by the Actor is then applied by the Environment. Cogment leverages this discrete update to orchestrate the execution of the components and the dispatch of data between them.

    How Actors work in Cogment

    Concepts of Actors in Cogment

    Cogment allocates a dedicated gRPC service to run the computations of Actors, which we call the "Actor Service". It can also refer to the computational node running this service. This service effectively offers the registered actor implementations for use in trials.

    The Actor class specifies what kinds of inputs and outputs to expect. The class definition specifies what an actor is.

    The Actor implementation is the function the Actor uses to compute what action to take given some input information. If we want to have a bunch of different Actors that all behave similarly (take same kind of inputs and produce same kind of outputs) we can define an Actor class and different instances of that class can use different implementations.

    Client and Service Actors

    An Actor might be controlled either by a software agent, or by a Human. Whichever the case, the process of generating actions based on observations remains the same, and the Environment treats them the same. Some Actors connect to the trial (we call them "client" Actors) and others will wait for the trial to connect to them (we call these "service" Actors). Service Actors are run on a designated computational node called the Actor Service.

    Interactions between Actors and the Environment

    Basic concepts

    The Observations and Actions we discussed above are the key pieces of information exchanged between Actors and the Environment.

    • Environments take actions as an input and output observations,
    • Actors take observations as an input and output actions.

    As discussed before, the Environment can also provide feedback to the Actor about their actions in the form of a numerical reward signal, but it is not strictly necessary for the Environment to do so.

    In Cogment, Actors and the Environment exchange information via the Orchestrator - a core component of Cogment which facilitates the interaction of distributed services. To do so, the observation and action space for the Actors and the Environment are defined as typed data structures. Cogment uses Protocol Buffers as a format to specify these data structures. This typing defines both an interface contract between the Actors and the Environment and helps convey semantic information, thus facilitating the independent design and development of both. In practice this enables the Actors and Environment to be run as separate services (eg. on separate computational nodes) and have the Orchestrator pass these protobuf messages between the different services as needed.

    Trials

    Trials are how a Cogment deployment runs the sequential interactions between Actors and their Environment. A trial is defined by the participating Actors and the host Environment. As a concept, Trials are quite close to Reinforcement Learning's Episodes, i.e. all the states that come between an initial state and a terminal state. However, because Cogment can be used outside of an RL context, we prefer using the more generic term of Trial.

    How Trials work in Cogment

    Trials are started by clients connecting to Cogment. A trial can end either by being terminated from a client or end by itself, for example once a specific state of the Environment is reached.

    During the trial:

    • The Environment generates observations of its internal state and sends them to the Actors.
    • Given these observations, each Actor chooses and sends an action.
    • The Environment receives the actions and updates its internal state.
    • Rewards can be sent to the Actors from either the Environment or other Actors. A reward is a measure of an actor’s performance within the environment at a given point in time during the trial.
    • Actors receive rewards if at least one was sent to them.
    • A log of the activity during the trial (observations, actions, rewards) is produced and can be stored.

    The Specification file

    The configurations for how trial elements are set up are defined in a YAML specification file typically called cogment.yaml. This file details how elements of the project work, including its actor classes and their action & observation spaces. You can learn more about the specification file in the dedicated reference page.


    Cogment Architecture

    Running trials with Cogment usually involves the deployment of a cluster of services and clients. These components are either provided by the Cogment framework, depicted below in blue, or implemented for a particular project with Software Development Kits (SDKs) in either Python or Javascript, depicted below in orange.

    Cogment Architecture

    User implemented components use one of the Cogment SDKs or directly implement the underlying protocol. Components communicate using gRPC, clients can also communicate in a web-friendly way using gRPC-Web and grpcwebproxy.

    Context

    The Context is a point of entry for Cogment to interface with the different services through SDKs. See also the SDK documentation for Context (Python | JavaScript).

    Orchestrator

    The Orchestrator is the glue that binds everything together. It is responsible for running the Trials and contacting other services as needed to ensure their execution.

    The key aspect of Cogment's orchestrator is its capacity to handle a number of network connections in parallel while keeping its responsiveness.

    Controller

    The Controller is a key part of using Cogment, it initiates communication with the Orchestrator to control the execution of Trials. It is responsible for starting Trials, retrieving and watching their state (including the end of the trial), or requesting trial termination. You can see more in the Python SDK documentation for the Controller. The Controller is created by the Context.

    Environment

    The Environment implementation is accessed by the Orchestrator to run the Environment during Trials.

    Using one of Cogment's SDKs, the Environment can be implemented as a function integrating a "state of the world" with the Trial. This function performs the following tasks during the Trial:

    • Generate Observations from the current state of the world, for example retrieving the visible objects from a 3D simulation.
    • Apply the Actions, thus updating the state of the world, for example changing the velocity of a moving vehicle in a race simulation.
    • Evaluate the performance of Actors and send them Rewards, for example by checking if a vehicle crossed the finish line in a race simulation.

    Actors

    Cogment handles Actors in two different ways: either as a service Actor or as a client Actor. Service Actor implementations are accessed by the Orchestrator during Trials, while Client Actor implementations join a Trial by initiating the communication with the Orchestrator. Client Actors implementations can reach a Cogment deployment through NAT traversal. This makes them particularly well-suited to implement human-driven Actors, in web-browsers for example.

    Using one of Cogment's SDKs Actors can be implemented as functions handling the integration between a decision-making Actor (software agent or Human) and the Trial. This function performs the following tasks during the Trial:

    • Receive Observations and do Actions in response, for example vectorizing the retrieved observation, feeding it to a neural network and converting its output to an Action.
    • Receive Rewards, for example using them to update a neural network.
    • Optionally: send and receive direct messages.

    Please note that rewards can also be retrieved after the fact using a datalog.

    Additional components

    On top of the core components described above, a Cogment deployment can include these additional ones:

    • Datalog services can be used to listen to the activity during a trial (actions, observations, rewards, messages) in order to, for example, store these data for the offline training of AI agents. The Trial Datastore is an out-of-the-box implementation of this.
    • Model Registry handles the storage and dispatch of AI models trained with Cogment and used by the actors.
    • Directory handles the publishing and discovery of cogment -services.

    Components availability summary

    The following table summarizes how each component can either be implemented or used out of the box.

    ComponentCogmentPython SDKJavascript SDKgRPC API
    Orchestratorcogment services orchestrator✅ implement Control API & Client Actor API
    Controllerget controllerget controller✅ use Control API
    Environmentregister environment & serve✅ implement Environment API
    Actor (Service)register actor & serve✅ implement Service Actor API
    Actor (Client)register actor & join trialregister actor & join trial✅ use Client Actor API
    Trial Datastorecogment services trial_datastoreregister datalog, serve & get datastore✅ implement Datalog API & Trial Datastore API
    Trial Datastore Clientcogment client trial_datastoreget datastore✅ use Trial Datastore API
    Model Registrycogment services model_registry✅ implement Model Registry API
    Model Registry Clientget model registry✅ use Model Registry API
    Directory`cogment services directory✅ implement Directory API
    Directory Client`cogment client directoryuse directory✅ use Directory API
    Pre Trial Hookregister pre trial hook & serve✅ implement Pre Trial Hook API
- - +services.

Components availability summary

The following table summarizes how each component can either be implemented or used out of the box.

ComponentCogmentPython SDKJavascript SDKgRPC API
Orchestratorcogment services orchestrator✅ implement Control API & Client Actor API
Controllerget controllerget controller✅ use Control API
Environmentregister environment & serve✅ implement Environment API
Actor (Service)register actor & serve✅ implement Service Actor API
Actor (Client)register actor & join trialregister actor & join trial✅ use Client Actor API
Trial Datastorecogment services trial_datastoreregister datalog, serve & get datastore✅ implement Datalog API & Trial Datastore API
Trial Datastore Clientcogment client trial_datastoreget datastore✅ use Trial Datastore API
Model Registrycogment services model_registry✅ implement Model Registry API
Model Registry Clientget model registry✅ use Model Registry API
Directory`cogment services directory✅ implement Directory API
Directory Client`cogment client directoryuse directory✅ use Directory API
Pre Trial Hookregister pre trial hook & serve✅ implement Pre Trial Hook API
+ + \ No newline at end of file diff --git a/docs/guide/development-guide.html b/docs/guide/development-guide.html index 62f18c3..05ef8af 100644 --- a/docs/guide/development-guide.html +++ b/docs/guide/development-guide.html @@ -1,27 +1,27 @@ - + - + Development guide | Cogment - - - + + +
-

Development guide

This document gives a high level view of what it is to develop a Cogment based application using Cogment SDKs. It assumes the reader is familiar with the Cogment core concepts.

note

Some features aren't available in Javascript, if there's only Python examples under a certain section, that feature is python only.

The High-level Cogment API expects users to use protocol buffers to declare a project's data structures. The intricacies of protobufs are beyond the scope of this document. Basic knowledge of the technology and its usage is assumed.

The spec file

The spec file, usually named cogment.yaml, defines the specifics of a type of trials for a Cogment app: actor classes as well as environment & trial configuration types. It is the starting point for a project.

An actor class is primarily defined by its observation space and action space.

The data structures describing these spaces are declared by using a protocol buffer message type. Observations and actions will simply be instances of the matching type.

For example, in the following, driver and pedestrian share a common view of the environment, hence use the same observation space, but have different actions available to them.

import:
proto:
- city.proto

actors:
driver:
observation:
space: city.Observation

action:
space: city.DriverAction

pedestrian:
observation:
space: city.Observation

action:
space: city.PedestrianAction
tip

This shows only the relevant part of the full spec file, you can find the full list of configurable options in the reference page.

Compiling the spec file

In order to use the spec file within the various supported languages, it needs to be compiled. This is done by the code generation modules of the specific language's SDK you are using.

For the python SDK, the generation step requires an extra from the cogment package. Using pip you can install the SDK with its extra using:

pip install cogment[generate]

The generation can then be executed using:

python -m cogment.generate cogment.yaml

This will create a cog_settings.py file as well as multiple *_pb.py files.

Environment

Environments are implemented by functions that take a environment session instance.

This function will be called once for each trial. This function usually consists of three sections.

  • The environment's initialization, where its internal state can be initialized and processes started. It ends with the sending of the initial observations to the actors participating in the trial.
  • Its event loop, where the environment iterates through the events occurring during the trial and produces observations as well as receives messages. In this loop the environment can end the trial on its own or the end can be requested, see the Trial lifetime section for further information.
  • Its termination, where cleanup occurs.

In the common case where all actors within a trial share the same observation, a bare-minimum environment service would look like this:

async def environment(environment_session):
# -- Initialization --

# Retrieve the actors participating in the trial
actors = environment_session.get_active_actors()

# Start the trial and send a starting observation to all actors
environment_session.start([("*", Observation())])

# -- Event loop --
async for event in environment_session.all_events():
if event.actions:
# `event.actions` is a list of the actions done by the actors
actions = event.actions
if event.type == cogment.EventType.ACTIVE:
# The trial is active, produce an observation in response to the actions
environment_session.produce_observations([("*", Observation())])
# Alternatively the environment can decide to **end** the trial with the following
# environment_session.end([("*", Observation())])
else:
# The trial termination has been requested
# Produce a final observation
environment_session.end([("*", Observation())])

for message in event.messages:
# `event.messages` is a list of all the messages received by the environment (it can be empty)

# Handle each message here.

# -- Termination --
print(f"Trial [{environment_session.get_trial_id()}] terminated")

For further details, take a look at the cogment.EnvironmentSession class reference.

This environment implementation needs to be registered and served so that the Orchestrator can reach it. This can be done through a Context instance.

context = cogment.Context(user_id="my_user_id", cog_settings=cog_settings)

context.register_environment(impl=environment, impl_name="my_environment")

await context.serve_all_registered(cogment.ServedEndpoint(port=9000))

For further details, take a look at the cogment.Context class reference.

Sending observations

The environment session has 3 different methods able to send observations: start, produce_observations and end. Each of those methods takes a list of 2-tuples destination / observation.

As demonstrated above, sending the same observation to all actors is done using "*" as the destination.

environment_session.produce_observations([("*", Observation(...))])

It is also possible to send different observations to different actors. This can be useful to send observations of the world from the point of view of the actor or to send partial observations.

environment_session.produce_observations([
("my_first_actor_name", Observation(...)),
("my_second_actor_name", Observation(...))
])

Please note that the environment should always send observations such as each actor in the trial receives one.

Actor

Actors implementations look a lot like the environment's. They take actor session instance and have the same three sections: initialization, event loop and termination.

The event loops in Actors' implementations handle three basic types of events:

  • observation produced by the environment and should lead to an action being done.
  • rewards sent by other actors or the environment, we'll talk about them in more details below.
  • messages sent by other actors or the environment, we'll talk about them in more details below.

A typical actor implementation would look like this:

async def driver_actor(actor_session):
# -- Initialization --

# Notify that the actor is ready for the trial to start.
actor_session.start()

async for event in actor_session.all_events():
if event.observation:
# `event.observation` is an instance of the Observation produced by the environment
observation = event.observation
if event.type == cogment.EventType.ACTIVE:
# The trial is active, it is expecting the agent to do an action
actor_session.do_action(DriverAction(...))

for reward in event.rewards:
# `event.rewards` is a list of all the rewards received by the actor (it can be empty)

# Handle each reward here.

for message in event.messages:
# `event.messages` is a list of all the messages received by the actor (it can be empty)

# Handle each message here.

# -- Termination --
print(f"Trial [{actor_session.get_trial_id()}] terminated")

For further details, take a look at the cogment.ActorSession class reference.

Service actor / Client actor

A Cogment app can use two types of actors, they are identical in terms of implementation but differ in how they interact with the app's Orchestrator.

Service actors are accessible in the same way the environment is, through a Context instance.

context = cogment.Context(cog_settings=cog_settings, user_id="my_user_id")
context.register_actor(impl=actor, impl_name="driver_actor", actor_classes=["driver"])
context.register_actor(impl=actor_slow, impl_name="driver_actor_slow", actor_classes=["driver"])

await context.serve_all_registered(cogment.ServedEndpoint(port=9000))

Note that it is also through this registrating that the implementation is associated with one or more actor classes it implements.

Client actors, contrary to Service actors, are not served to the Orchestrator. They connect as clients of the Orchestrator and join a trial that has started.

context = cogment.Context(cog_settings=cog_settings, user_id="my_user_id")
context.register_actor(
impl=actor,
impl_name="human_pedestrian",
actor_classes=["pedestrian"]
)

await context.join_trial(
trial_id=trial_id,
cogment.Endpoint(url="grpc://orchestrator:9000"),
actor_name="Alice"
)

Note that a trial including one or more client actors will wait for all of them to join before any actor can start processing events.

Due to the different network requirements, client actors are a good fit when implementing a frontend for human actors.

Actor Availability

There are four actor parameters (see Trial Parameters) to manage actor responses for a trial: initial_connection_timeout, response_timeout, optional and default_action. -The timeouts control when an actor becomes unavailable, and the other two control what happens when it becomes unavailable.

The trial will be hard terminated by the Orchestrator if a required (non-optional) actor becomes unavailable, whereas it can continue if an optional actor becomes unavailable.

The default_action is for optional actors; when the actor is unavailable, the default action will be sent to the environment. If there is no default action defined, the environment is informed that the actor is unavailable, but no action is provided.

E.g. If a required actor (with optional set to False) has a response_timeout set to 5.0 seconds, but takes more than 5 seconds to respond to a new observation (e.g. due to excessive computation, or a crash), then the trial will be terminated.

Controller

Trials are started by clients of the Orchestrator using a Controller. Instances of a controller are built from the context instance and connect to an Orchestrator endpoint.

controller = context.get_controller(
endpoint=cogment.Endpoint(url="grpc://orchestrator:9000")
)

For further details, take a look at the Controller class reference.

Start and terminate trials

The controller can then be used to create trials and request their termination.

trial_id = await controller.start_trial(trial_config=TrialConfig())

# ...

await controller.terminate_trial([trial_id])
tip

The default behavior of the Controller's terminate trial function is to trigger a soft termination, an optional hard parameters can be set to True to trigger a hard termination.

Start trial from trial parameters

The above example uses an instance of the user-defined trial configuration to start the trial. This instance is then provided to a pre-trial hook to fully define the trial parameters. It is also possible to fully provide the trial parameters when starting the trial.

actor_1_params = cogment.ActorParameters(
cog_settings,
name="Alice",
class_name="pedestrian",
endpoint="cogment://client"
)
actor_2_params = cogment.ActorParameters(
cog_settings,
name="ai_driver",
class_name="driver",
endpoint="grpc://driver_actors:9000",
implementation="driver_actor_slow"
)

environment_config=EnvironmentConfig(
# ...
)

trial_params=cogment.TrialParameters(
cog_settings,
environment_name="environment",
environment_implementation="my_environment"
environment_endpoint="grpc://environment:9000",
environment_config=environment_config,
actors=[
actor_1_params,
actor_2_params,
]
)

For further details, take a look at the cogment.TrialParameters class reference.

Watch trials

The controller can also be used to subscribe to events occuring in the trials run by the Orchestrator it connects to. For example, this can be used to wait for a trial's end:

async for trial_info in controller.watch_trials(trial_state_filters=[
cogment.TrialState.ENDED
]):
print(f"The trial having id [{trial_info.trial_id}] ended")

Rewards

Creating

Rewards are sent to Actors from another actor or the Environment. The session instance passed to their implementation can be used for this purpose.

session.add_reward(value=-1, confidence=1, tick_id=-1, to=['an_actor_name'])

Rewards consist of an arbitrary numerical value describing how the reward "sender" believes the actor performed. +

Development guide

This document gives a high level view of what it is to develop a Cogment based application using Cogment SDKs. It assumes the reader is familiar with the Cogment core concepts.

note

Some features aren't available in Javascript, if there's only Python examples under a certain section, that feature is python only.

The High-level Cogment API expects users to use protocol buffers to declare a project's data structures. The intricacies of protobufs are beyond the scope of this document. Basic knowledge of the technology and its usage is assumed.

The spec file

The spec file, usually named cogment.yaml, defines the specifics of a type of trials for a Cogment app: actor classes as well as environment & trial configuration types. It is the starting point for a project.

An actor class is primarily defined by its observation space and action space.

The data structures describing these spaces are declared by using a protocol buffer message type. Observations and actions will simply be instances of the matching type.

For example, in the following, driver and pedestrian share a common view of the environment, hence use the same observation space, but have different actions available to them.

import:
proto:
- city.proto

actors:
driver:
observation:
space: city.Observation

action:
space: city.DriverAction

pedestrian:
observation:
space: city.Observation

action:
space: city.PedestrianAction
tip

This shows only the relevant part of the full spec file, you can find the full list of configurable options in the reference page.

Compiling the spec file

In order to use the spec file within the various supported languages, it needs to be compiled. This is done by the code generation modules of the specific language's SDK you are using.

For the python SDK, the generation step requires an extra from the cogment package. Using pip you can install the SDK with its extra using:

pip install cogment[generate]

The generation can then be executed using:

python -m cogment.generate cogment.yaml

This will create a cog_settings.py file as well as multiple *_pb.py files.

Environment

Environments are implemented by functions that take a environment session instance.

This function will be called once for each trial. This function usually consists of three sections.

  • The environment's initialization, where its internal state can be initialized and processes started. It ends with the sending of the initial observations to the actors participating in the trial.
  • Its event loop, where the environment iterates through the events occurring during the trial and produces observations as well as receives messages. In this loop the environment can end the trial on its own or the end can be requested, see the Trial lifetime section for further information.
  • Its termination, where cleanup occurs.

In the common case where all actors within a trial share the same observation, a bare-minimum environment service would look like this:

async def environment(environment_session):
# -- Initialization --

# Retrieve the actors participating in the trial
actors = environment_session.get_active_actors()

# Start the trial and send a starting observation to all actors
environment_session.start([("*", Observation())])

# -- Event loop --
async for event in environment_session.all_events():
if event.actions:
# `event.actions` is a list of the actions done by the actors
actions = event.actions
if event.type == cogment.EventType.ACTIVE:
# The trial is active, produce an observation in response to the actions
environment_session.produce_observations([("*", Observation())])
# Alternatively the environment can decide to **end** the trial with the following
# environment_session.end([("*", Observation())])
else:
# The trial termination has been requested
# Produce a final observation
environment_session.end([("*", Observation())])

for message in event.messages:
# `event.messages` is a list of all the messages received by the environment (it can be empty)

# Handle each message here.

# -- Termination --
print(f"Trial [{environment_session.get_trial_id()}] terminated")

For further details, take a look at the cogment.EnvironmentSession class reference.

This environment implementation needs to be registered and served so that the Orchestrator can reach it. This can be done through a Context instance.

context = cogment.Context(user_id="my_user_id", cog_settings=cog_settings)

context.register_environment(impl=environment, impl_name="my_environment")

await context.serve_all_registered(cogment.ServedEndpoint(port=9000))

For further details, take a look at the cogment.Context class reference.

Sending observations

The environment session has 3 different methods able to send observations: start, produce_observations and end. Each of those methods takes a list of 2-tuples destination / observation.

As demonstrated above, sending the same observation to all actors is done using "*" as the destination.

environment_session.produce_observations([("*", Observation(...))])

It is also possible to send different observations to different actors. This can be useful to send observations of the world from the point of view of the actor or to send partial observations.

environment_session.produce_observations([
("my_first_actor_name", Observation(...)),
("my_second_actor_name", Observation(...))
])

Please note that the environment should always send observations such as each actor in the trial receives one.

Actor

Actors implementations look a lot like the environment's. They take actor session instance and have the same three sections: initialization, event loop and termination.

The event loops in Actors' implementations handle three basic types of events:

  • observation produced by the environment and should lead to an action being done.
  • rewards sent by other actors or the environment, we'll talk about them in more details below.
  • messages sent by other actors or the environment, we'll talk about them in more details below.

A typical actor implementation would look like this:

async def driver_actor(actor_session):
# -- Initialization --

# Notify that the actor is ready for the trial to start.
actor_session.start()

async for event in actor_session.all_events():
if event.observation:
# `event.observation` is an instance of the Observation produced by the environment
observation = event.observation
if event.type == cogment.EventType.ACTIVE:
# The trial is active, it is expecting the agent to do an action
actor_session.do_action(DriverAction(...))

for reward in event.rewards:
# `event.rewards` is a list of all the rewards received by the actor (it can be empty)

# Handle each reward here.

for message in event.messages:
# `event.messages` is a list of all the messages received by the actor (it can be empty)

# Handle each message here.

# -- Termination --
print(f"Trial [{actor_session.get_trial_id()}] terminated")

For further details, take a look at the cogment.ActorSession class reference.

Service actor / Client actor

A Cogment app can use two types of actors, they are identical in terms of implementation but differ in how they interact with the app's Orchestrator.

Service actors are accessible in the same way the environment is, through a Context instance.

context = cogment.Context(cog_settings=cog_settings, user_id="my_user_id")
context.register_actor(impl=actor, impl_name="driver_actor", actor_classes=["driver"])
context.register_actor(impl=actor_slow, impl_name="driver_actor_slow", actor_classes=["driver"])

await context.serve_all_registered(cogment.ServedEndpoint(port=9000))

Note that it is also through this registrating that the implementation is associated with one or more actor classes it implements.

Client actors, contrary to Service actors, are not served to the Orchestrator. They connect as clients of the Orchestrator and join a trial that has started.

context = cogment.Context(cog_settings=cog_settings, user_id="my_user_id")
context.register_actor(
impl=actor,
impl_name="human_pedestrian",
actor_classes=["pedestrian"]
)

await context.join_trial(
trial_id=trial_id,
cogment.Endpoint(url="grpc://orchestrator:9000"),
actor_name="Alice"
)

Note that a trial including one or more client actors will wait for all of them to join before any actor can start processing events.

Due to the different network requirements, client actors are a good fit when implementing a frontend for human actors.

Actor Availability

There are four actor parameters (see Trial Parameters) to manage actor responses for a trial: initial_connection_timeout, response_timeout, optional and default_action. +The timeouts control when an actor becomes unavailable, and the other two control what happens when it becomes unavailable.

The trial will be hard terminated by the Orchestrator if a required (non-optional) actor becomes unavailable, whereas it can continue if an optional actor becomes unavailable.

The default_action is for optional actors; when the actor is unavailable, the default action will be sent to the environment. If there is no default action defined, the environment is informed that the actor is unavailable, but no action is provided.

E.g. If a required actor (with optional set to False) has a response_timeout set to 5.0 seconds, but takes more than 5 seconds to respond to a new observation (e.g. due to excessive computation, or a crash), then the trial will be terminated.

Controller

Trials are started by clients of the Orchestrator using a Controller. Instances of a controller are built from the context instance and connect to an Orchestrator endpoint.

controller = context.get_controller(
endpoint=cogment.Endpoint(url="grpc://orchestrator:9000")
)

For further details, take a look at the Controller class reference.

Start and terminate trials

The controller can then be used to create trials and request their termination.

trial_id = await controller.start_trial(trial_config=TrialConfig())

# ...

await controller.terminate_trial([trial_id])
tip

The default behavior of the Controller's terminate trial function is to trigger a soft termination, an optional hard parameters can be set to True to trigger a hard termination.

Start trial from trial parameters

The above example uses an instance of the user-defined trial configuration to start the trial. This instance is then provided to a pre-trial hook to fully define the trial parameters. It is also possible to fully provide the trial parameters when starting the trial.

actor_1_params = cogment.ActorParameters(
cog_settings,
name="Alice",
class_name="pedestrian",
endpoint="cogment://client"
)
actor_2_params = cogment.ActorParameters(
cog_settings,
name="ai_driver",
class_name="driver",
endpoint="grpc://driver_actors:9000",
implementation="driver_actor_slow"
)

environment_config=EnvironmentConfig(
# ...
)

trial_params=cogment.TrialParameters(
cog_settings,
environment_name="environment",
environment_implementation="my_environment"
environment_endpoint="grpc://environment:9000",
environment_config=environment_config,
actors=[
actor_1_params,
actor_2_params,
]
)

For further details, take a look at the cogment.TrialParameters class reference.

Watch trials

The controller can also be used to subscribe to events occuring in the trials run by the Orchestrator it connects to. For example, this can be used to wait for a trial's end:

async for trial_info in controller.watch_trials(trial_state_filters=[
cogment.TrialState.ENDED
]):
print(f"The trial having id [{trial_info.trial_id}] ended")

Rewards

Creating

Rewards are sent to Actors from another actor or the Environment. The session instance passed to their implementation can be used for this purpose.

session.add_reward(value=-1, confidence=1, tick_id=-1, to=['an_actor_name'])

Rewards consist of an arbitrary numerical value describing how the reward "sender" believes the actor performed. It is weighted by a value between 0 and 1 qualifying the confidence of the "sender" in its reward, from a very low confidence just above 0 to a very high confidence approaching 1. The confidence value is used to collate all the rewards sent to an actor at the same time. Optionally, a reward can be provided with arbitrary user data.

Each reward applies to a list of recipients (either all the actors, all the actors of a given class or a specific actor) at a specific point in time, during the trial, defined as a tick. The tick ID can represent a past action if the value is smaller than the current tick ID ("future" actions are not allowed). -Past actions, like sending a reward related to a past tick ID, are handled in accordance with the nb_buffered_ticks trial parameter.

The full documentation for session.add_reward can be found here.

Consuming

All the Rewards that are sent and destined to each specific actor for a given point in time are collated together by the framework.

The actor can take into account the reward directly as the trial is running by consuming the "reward" event in their event loop.

async for event in actor_session.all_events():
# [...]
for reward in event.rewards:
# `reward.tick_id` is the id of the tick this reward concerns.
tick_id = reward.tick_id
# `reward.value` is the aggregated value of the reward.
value = reward.value
for source_reward in reward.all_sources():
# Iterate over individual source rewards.
reward_value = source_reward.value
reward_confidence = source_reward.confidence
reward_sender = source_reward.sender
reward_user_data = source_reward.user_data

Messages

Creating

Messages can be created and sent between actors or the environment within a trial using their session instance.

session.send_message(
user_data=MyProtobufDataStructure(...), # any protobuf data structure can be used here.
to=['pedestrian:*'], # send the message to all the actors of the "pedestrian" class
)

The full documentation for session.send_message can be found here.

Messages consist of an arbitrary payload, their user_data/payload, defined as an instance of any protobuf data structure.

A message can be sent to one, many or all actors in a trial and / or to the environment.

Consuming

All the messages that are sent and intended for each specific actor or environment will be received by the target actor or environment.

Actors or the environment can use the message directly, live, as the trial is running, by consuming message event in their event loop.

async for event in actor_session.all_events():
# [...]
for message in event.messages:
# `message.sender_name` is the name of the actor who sent a message
sender_name = message.sender_name
# `message.payload` is the content of the message, it needs to be unpacked
payload = message.payload

Pre-trial hook

When starting a trial from a controller, an instance of the message type defined in trial:config_type can be provided. This instance is then passed to the registered Pre trial hooks when the Orcehstrator was started. The role of these hooks is to fully parametrize the trial based on the provided config. To achieve that, they can modify the default trial params defined in the parameters to specify the environment (i.e. its endpoint, implementation name & configuration), the number and parameters of the participant actors (i.e. their name, class, endpoint, implementation name & configuration) as well as additional parameters for the trial. The pre-trial hook can therefore be used to dynamically configure trials, to act as a service endpoint registry, or a load balancer.

Pre-trial hook implementations are registered in the same way the environment or actor implementation are and follow the same session pattern.

async def my_pre_trial_hook(pre_hook_session):
# The trial config provided by the controller can be retrieved like that
trial_config = pre_hook_session.trial_config
# The trial params can be edited directly
pre_hook_session.environment_config = # [...]
pre_hook_session.environment_endpoint = "grpc://my_environment:9000"
pre_hook_session.actors = [
{
"name": "my_first_actor_name",
"actor_class": "driver",
"endpoint": "grpc://driver:9000",
"implementation": "driver_actor",
"config": # [...],
},
{
"name": "my_second_actor_name",
"actor_class": "predestrian",
"endpoint": "cogment://client",
"config": # [...],
},
]
# And finally should be validated
pre_hook_session.validate()

context.register_pre_trial_hook(impl=my_pre_trial_hook)

Trial lifetime

Over their lifetime trials can be in different states managed by the Orchestrator. The current state of the trial can be accessed by a Controler.

Possible Trial States are defined as:

Trial start

The trial starts with a request from a Controller to the Orchestrator. At creation the trial is in the INITIALIZING state.

If no trial params are provided at this stage, registered Pre-trial hooks are called in sequence. The trial is now fully initialized and becomes PENDING as it wait for all the components, actors and environment to be available.

Once all the non-optional actors are available and the environment sends the initial observation set, the trial becomes RUNNING. If at least one non-optional actor is unavailable, it terminates right away and becomes ENDED.

Trial run

As long as the trial is RUNNING, the Orchestrator executes steps:

  • To each actor, the Orchestrator sends an event, having the ACTIVE type, containing its observation,
  • The Orchestrator then waits to receive one action per actor,
  • To the environment, the Orchestrator sends an event, having the ACTIVE type, containing the set of actions,
  • The Orchestrator then waits to receive the set of observations from the environment.

Trial end

Trial ended by the environment

This is the normal way for a trial to end.

  1. The environment sends the final observation set, using the session's end method.
  2. The trial state is set to TERMINATING.
  3. Observations are sent to the actors with the event type ENDING. Rewards and messages sent before that point will sent to their destination; later ones will not.
  4. Once all the last events are received, the Orchestrator sends a event of type FINAL to all the components.
  5. The trial becomes ENDED.

Soft termination

Soft termination can be triggered either by the user, using the Controller or after a maximum number of steps, if the trial Parameter max_steps is set.

  1. The Orchestrator waits until it receives the next action set from the actors.
  2. The trial state is set to TERMINATING.
  3. Actions are sent to the environment with the event type ENDING.
  4. From this point on the flow is the same as when the trial is ended by the environment.
note

After a soft termination is initiated (i.e. after receiving an event of type ENDING), the next set of observations sent by the environment will always be the last one (i.e. using end or produce_observation will have the same behavior).

Hard termination

Hard termination can be triggered in multiple ways:

  • By the user, using the Controller.
  • Because of unavailable actors. If a required (non-optional) actor becomes unavailable (for any reason), the trial will be terminated (see Actor Availability).
  • Because of inactivity. If a component (actor, environment, pre-trial hook, etc) does not respond, the trial will be waiting and be inactive. If the trial is inactive for too long (see Parameter max_inactivity), it will be terminated. With actor components this may happen when the timeout is too long (or indefinite) then the actor never becomes unavailable (see Actor Availability) and the trial will keep waiting for it.
  • Because of a critical error.

In all this cases:

  1. The trial becomes TERMINATING.
  2. The Orchestrator sends a event of type FINAL to all the components.
  3. The trial becomes ENDED.
- - +Past actions, like sending a reward related to a past tick ID, are handled in accordance with the nb_buffered_ticks trial parameter.

The full documentation for session.add_reward can be found here.

Consuming

All the Rewards that are sent and destined to each specific actor for a given point in time are collated together by the framework.

The actor can take into account the reward directly as the trial is running by consuming the "reward" event in their event loop.

async for event in actor_session.all_events():
# [...]
for reward in event.rewards:
# `reward.tick_id` is the id of the tick this reward concerns.
tick_id = reward.tick_id
# `reward.value` is the aggregated value of the reward.
value = reward.value
for source_reward in reward.all_sources():
# Iterate over individual source rewards.
reward_value = source_reward.value
reward_confidence = source_reward.confidence
reward_sender = source_reward.sender
reward_user_data = source_reward.user_data

Messages

Creating

Messages can be created and sent between actors or the environment within a trial using their session instance.

session.send_message(
user_data=MyProtobufDataStructure(...), # any protobuf data structure can be used here.
to=['pedestrian:*'], # send the message to all the actors of the "pedestrian" class
)

The full documentation for session.send_message can be found here.

Messages consist of an arbitrary payload, their user_data/payload, defined as an instance of any protobuf data structure.

A message can be sent to one, many or all actors in a trial and / or to the environment.

Consuming

All the messages that are sent and intended for each specific actor or environment will be received by the target actor or environment.

Actors or the environment can use the message directly, live, as the trial is running, by consuming message event in their event loop.

async for event in actor_session.all_events():
# [...]
for message in event.messages:
# `message.sender_name` is the name of the actor who sent a message
sender_name = message.sender_name
# `message.payload` is the content of the message, it needs to be unpacked
payload = message.payload

Pre-trial hook

When starting a trial from a controller, an instance of the message type defined in trial:config_type can be provided. This instance is then passed to the registered Pre trial hooks when the Orcehstrator was started. The role of these hooks is to fully parametrize the trial based on the provided config. To achieve that, they can modify the default trial params defined in the parameters to specify the environment (i.e. its endpoint, implementation name & configuration), the number and parameters of the participant actors (i.e. their name, class, endpoint, implementation name & configuration) as well as additional parameters for the trial. The pre-trial hook can therefore be used to dynamically configure trials, to act as a service endpoint registry, or a load balancer.

Pre-trial hook implementations are registered in the same way the environment or actor implementation are and follow the same session pattern.

async def my_pre_trial_hook(pre_hook_session):
# The trial config provided by the controller can be retrieved like that
trial_config = pre_hook_session.trial_config
# The trial params can be edited directly
pre_hook_session.environment_config = # [...]
pre_hook_session.environment_endpoint = "grpc://my_environment:9000"
pre_hook_session.actors = [
{
"name": "my_first_actor_name",
"actor_class": "driver",
"endpoint": "grpc://driver:9000",
"implementation": "driver_actor",
"config": # [...],
},
{
"name": "my_second_actor_name",
"actor_class": "predestrian",
"endpoint": "cogment://client",
"config": # [...],
},
]
# And finally should be validated
pre_hook_session.validate()

context.register_pre_trial_hook(impl=my_pre_trial_hook)

Trial lifetime

Over their lifetime trials can be in different states managed by the Orchestrator. The current state of the trial can be accessed by a Controler.

Possible Trial States are defined as:

Trial start

The trial starts with a request from a Controller to the Orchestrator. At creation the trial is in the INITIALIZING state.

If no trial params are provided at this stage, registered Pre-trial hooks are called in sequence. The trial is now fully initialized and becomes PENDING as it wait for all the components, actors and environment to be available.

Once all the non-optional actors are available and the environment sends the initial observation set, the trial becomes RUNNING. If at least one non-optional actor is unavailable, it terminates right away and becomes ENDED.

Trial run

As long as the trial is RUNNING, the Orchestrator executes steps:

  • To each actor, the Orchestrator sends an event, having the ACTIVE type, containing its observation,
  • The Orchestrator then waits to receive one action per actor,
  • To the environment, the Orchestrator sends an event, having the ACTIVE type, containing the set of actions,
  • The Orchestrator then waits to receive the set of observations from the environment.

Trial end

Trial ended by the environment

This is the normal way for a trial to end.

  1. The environment sends the final observation set, using the session's end method.
  2. The trial state is set to TERMINATING.
  3. Observations are sent to the actors with the event type ENDING. Rewards and messages sent before that point will sent to their destination; later ones will not.
  4. Once all the last events are received, the Orchestrator sends a event of type FINAL to all the components.
  5. The trial becomes ENDED.

Soft termination

Soft termination can be triggered either by the user, using the Controller or after a maximum number of steps, if the trial Parameter max_steps is set.

  1. The Orchestrator waits until it receives the next action set from the actors.
  2. The trial state is set to TERMINATING.
  3. Actions are sent to the environment with the event type ENDING.
  4. From this point on the flow is the same as when the trial is ended by the environment.
note

After a soft termination is initiated (i.e. after receiving an event of type ENDING), the next set of observations sent by the environment will always be the last one (i.e. using end or produce_observation will have the same behavior).

Hard termination

Hard termination can be triggered in multiple ways:

  • By the user, using the Controller.
  • Because of unavailable actors. If a required (non-optional) actor becomes unavailable (for any reason), the trial will be terminated (see Actor Availability).
  • Because of inactivity. If a component (actor, environment, pre-trial hook, etc) does not respond, the trial will be waiting and be inactive. If the trial is inactive for too long (see Parameter max_inactivity), it will be terminated. With actor components this may happen when the timeout is too long (or indefinite) then the actor never becomes unavailable (see Actor Availability) and the trial will keep waiting for it.
  • Because of a critical error.

In all this cases:

  1. The trial becomes TERMINATING.
  2. The Orchestrator sends a event of type FINAL to all the components.
  3. The trial becomes ENDED.
+ + \ No newline at end of file diff --git a/docs/guide/implementation-recipes.html b/docs/guide/implementation-recipes.html index 1d554d1..7dc0ee9 100644 --- a/docs/guide/implementation-recipes.html +++ b/docs/guide/implementation-recipes.html @@ -1,21 +1,21 @@ - + - + Implementation Recipes | Cogment - - - + + + - - +
+ + \ No newline at end of file diff --git a/docs/guide/implementation-recipes/configure-trial-from-controller.html b/docs/guide/implementation-recipes/configure-trial-from-controller.html index b4b7a90..7c09302 100644 --- a/docs/guide/implementation-recipes/configure-trial-from-controller.html +++ b/docs/guide/implementation-recipes/configure-trial-from-controller.html @@ -1,21 +1,21 @@ - + - + Configure Trial from Controller | Cogment - - - + + +
-

Fully configure a trial from a Controller

note

Starting with versions v2.2.0 of Cogment and v2.1.0 of the python SDK, it is now possible to provide the full trial parameters when starting a trial. This recipe is still applicable but it is recommended to use the new method instead.

When starting a trial, the controller can only provide an instance of the trial configuration message and from this instance the pre trial hook can fill the trial parameters, including a full configuring of the environment and actors involved in the trial. More details can be found here. In some cases, you might want to fully configure a trial from the controller. This recipe is dedicated to this use case.

caution

Implementing this recipe enables any client having access to the orchestrator to specify URLs - the actor and environment endpoints - that will be accessed (and trusted) by the orchestrator.

The general idea is to define TrialConfig so that it includes everything that's needed to parametrize the trial. It should look something like the following.

message EnvironmentParams {
string endpoint = 1;
EnvConfig config = 2;
string implementation = 3;
}

message ActorParams {
string name = 1;
string actor_class = 2;
string endpoint = 3;
string implementation = 4;
ActorConfig config = 5;
}

message TrialConfig {
EnvironmentParams environment = 1;
repeated ActorParams actors = 2;
uint32 max_steps = 3;
uint32 max_inactivity = 4;
}

When starting a trial from the controller you'll need to define the full config.

trial_id = await controller.start_trial(trial_config=TrialConfig(
environment=EnvironmentParams(
endpoint="grpc://my-environment:9000",
config=# [...],
implementation="my-implementation"
)
))

Finally a pass-through pre-trial hook needs to be implemented, registered and served. Its endpoint must be specified to the Orchestrator on startup.

async def passthrough_pre_trial_hook(pre_trial_hook_session):
trial_config = pre_trial_hook_session.trial_config
pre_trial_hook_session.environment_config = trial_config.environment.config
pre_trial_hook_session.environment_endpoint = trial_config.environment.endpoint
pre_trial_hook_session.environment_implementation = trial_config.environment.implementation
pre_trial_hook_session.actors = [
{
"name": actor_params.name,
"actor_class": actor_params.actor_class,
"endpoint": actor_params.endpoint,
"implementation": actor_params.implementation,
"config": actor_params.config,
}
for actor_params in trial_config.actors
]
pre_trial_hook_session.trial_max_steps = trial_config.max_steps
pre_trial_hook_session.trial_max_inactivity = trial_config.max_inactivity

pre_trial_hook_session.validate()

context.register_pre_trial_hook(pre_trial_hook)
- - +

Fully configure a trial from a Controller

note

Starting with versions v2.2.0 of Cogment and v2.1.0 of the python SDK, it is now possible to provide the full trial parameters when starting a trial. This recipe is still applicable but it is recommended to use the new method instead.

When starting a trial, the controller can only provide an instance of the trial configuration message and from this instance the pre trial hook can fill the trial parameters, including a full configuring of the environment and actors involved in the trial. More details can be found here. In some cases, you might want to fully configure a trial from the controller. This recipe is dedicated to this use case.

caution

Implementing this recipe enables any client having access to the orchestrator to specify URLs - the actor and environment endpoints - that will be accessed (and trusted) by the orchestrator.

The general idea is to define TrialConfig so that it includes everything that's needed to parametrize the trial. It should look something like the following.

message EnvironmentParams {
string endpoint = 1;
EnvConfig config = 2;
string implementation = 3;
}

message ActorParams {
string name = 1;
string actor_class = 2;
string endpoint = 3;
string implementation = 4;
ActorConfig config = 5;
}

message TrialConfig {
EnvironmentParams environment = 1;
repeated ActorParams actors = 2;
uint32 max_steps = 3;
uint32 max_inactivity = 4;
}

When starting a trial from the controller you'll need to define the full config.

trial_id = await controller.start_trial(trial_config=TrialConfig(
environment=EnvironmentParams(
endpoint="grpc://my-environment:9000",
config=# [...],
implementation="my-implementation"
)
))

Finally a pass-through pre-trial hook needs to be implemented, registered and served. Its endpoint must be specified to the Orchestrator on startup.

async def passthrough_pre_trial_hook(pre_trial_hook_session):
trial_config = pre_trial_hook_session.trial_config
pre_trial_hook_session.environment_config = trial_config.environment.config
pre_trial_hook_session.environment_endpoint = trial_config.environment.endpoint
pre_trial_hook_session.environment_implementation = trial_config.environment.implementation
pre_trial_hook_session.actors = [
{
"name": actor_params.name,
"actor_class": actor_params.actor_class,
"endpoint": actor_params.endpoint,
"implementation": actor_params.implementation,
"config": actor_params.config,
}
for actor_params in trial_config.actors
]
pre_trial_hook_session.trial_max_steps = trial_config.max_steps
pre_trial_hook_session.trial_max_inactivity = trial_config.max_inactivity

pre_trial_hook_session.validate()

context.register_pre_trial_hook(pre_trial_hook)
+ + \ No newline at end of file diff --git a/docs/guide/implementation-recipes/v2-migration-guide.html b/docs/guide/implementation-recipes/v2-migration-guide.html index 986f859..f32063e 100644 --- a/docs/guide/implementation-recipes/v2-migration-guide.html +++ b/docs/guide/implementation-recipes/v2-migration-guide.html @@ -1,21 +1,21 @@ - + - + Migrate from Cogment v1 to v2 | Cogment - - - + + +
-

Migrate from Cogment v1 to v2

tip

This document is written as a guide to migrate from Cogment v1 to v2, a full list of the changes is also available here.

Updating components

The following components needs to be updated to work with Cogment v2:

  1. Update the CLI to the latest version and check that the version is correct

    curl --silent -L https://raw.githubusercontent.com/cogment/cogment-cli/main/install.sh | sudo bash
    cogment version
  2. Update the docker images to the versions compatible with the 2.0 API. These should be updated in Dockerfile, *.dockerfile or docker-compose.yml files in your project. The minimal version to use API 2.0 are:

    • cogment/orchestrator:v2.0.0
    • cogment/trial-datastore:v0.2.0 (prereleased component)
    • cogment/model-registry:v0.4.0 (prereleased component)
  3. Update the version of the python SDK to cogment[generate]>=2.0.2 (learn more about generate here) in your requirements.txt files or equivalent.

  4. Update the version of the javascript SDK to @cogment/cogment-js-sdk^2 in your package.json files or equivalent.

cogment.yaml split in a spec file and a parameters file

The cogment.yaml file has seen a lot of changes, the most important one is that we now differ between the spec file which specifies the types of trial for a cogment project, including actor classes and their action/observation spaces, and the parameters file which specifies default parameters for trials. The spec file is used in the code generation process of each SDKs and is no longer used by the orchestrator. The parameters file is used by the orchestrator, if you use pre-trial hooks to configure the started trials it might not be necessary.

We now recommand that two different files, respectively named cogment.yaml and params.yaml be used, however you can still use one file containing both content.

Recommended update

Move the trial_params section of the existing cogment.yaml file to a dedicated params.yaml file.

Further changes are required to both sections, as described below.

Required update

If the --config=cogment.yaml was provided to the orchestrator, remove it.

To provide a parameters file to the orchestrator use the --params=params.yaml command line option.

Further details can be found in the spec file documentation.

pre-trial hooks definition moved to an orchestrator configuration

pre-trial hooks are no longer defined in the cogment.yaml file, but instead are now given to the orchestrator as a command line option or through an environment variable.

Required update

Remove the trial:pre-hooks section from the spec file. Instead specify the hook addresses as gRPC URLs, e.g. grpc://1.1.1.1:9000, using the orchestrator cli option --pre_trial_hooks, separating potential multiple hooks with comas.

Further details can be found in the orchestrator documentation.

Datalog definition now part of each trial's parameters

The datalog definition is no longer a project-wide configuration but can be specified for each trial in its parameters.

Required update

Remove the datalog section from the spec file.

Datalog can be defined in the parameters file with the following format:

trial_params:
datalog:
- endpoint: grpc://logger:9000

It can also be defined when configuring the trial in the pre-trial hook.

Datalog API has changed, and now has a python wrapper

  • Instead of returning raw protobuf messages, Python wrapper objects are returned, so access to the raw messages is not available anymore
  • The DatalogSession attribute raw_trial_params is not available anymore.
  • The DatalogSession attribute trial_params returns a cogment.LogParams object instead of a protobuf message.
  • The DatalogSession.get_all_samples() now generates cogment.LogSample objects instead of a protobuf message.
  • If there is a need to deserialize v1 data (e.g. from an old database), v1 versions of the sample protobuf messages (cogment.api.datalog_pb2.TrialParams_v1 and cogment.api.datalog_pb2.DatalogSample_v1) are provided in the API for convenience.

For more information, please see the following sections of the Python SDK Documentation

Default trial parameters no longer support definition user configuration for trials, environments and actors

The config sections that were used to define default user configuration of trials, environments and actors are no longer supported. If necessary, these must be provided when starting the trial, for the trial config, and in pre-trial hooks, for the environment and actors config. Defaults can also be defined in the implementation code itself.

Required update

Remove the config sections (for trial, environment and actor) from the params file.

For simple projects, provide a default configuration in the implementation code directly, for more complex one use a pre-trial hook.

Prefer using full URL for endpoints

Recommended update

Use full gRPC URLs, starting with grpc://, when defining endpoints in the params file on in the SDKs.

Additionaly, to prepare for further features, we are introducing a cogment URL scheme. At the moment only the special client endpoint is concerned.

Recommended update

If actors are clients, replace the endpoint value from client to cogment://client

Support for "delta" observations discontinued

Framework support for "delta" observations has been discontinued. The same result can be obtained user-side in the environment and actor implementations.

Required update

Remove the following section from the spec file:

  • import::python
  • import::javascript
  • actor_classes::observation::delta
  • actor_classes::observation::delta_apply_fn

In the python SDK, RecvObservation delta attribute no longer exists.

You can support delta observations in your code, for example you could change the definition of your observation message to support both full observation or delta observation.

message Observation {
oneof observation_or_delta {
ObservationMessage obs = 1;
DeltaObservation delta = 2;
}
}

As before the environment side can decide to send full or delta observations. On the consumer side, actor or datalog, you'll need to keep the previous observation around to apply the delta to it.

Recommended update

Instead of using RecvObservation snapshot attribute, use observation instead.

New code generation workflow

The code generation step is no longer perfomed by the CLI but by dedicated tools provided with the SDKs. cogment copy is provided by the CLI as a cross platform way to copy the required files, i.e. the spec, protobuf and params files, from the root of the project to services source directories. As a result of these cogment sync and cogment generate are no longer available.

Required update

Replace any usage of cogment sync with cogment copy. This new commands needs to know explicitly what files to copy

cogment copy data.proto cogment.yaml params.yaml environment_dir actor_dir
Required update

For services using the python SDK:

  • Make sure you install the SDK and the generate tool using pip install cogment[generate].
  • Generate the necessary files with python3 -m cogment.generate --spec cogment.yaml.
Required update

For services using the javascript SDK

  • Generate the necessary files with npx cogment-js-sdk-generate cogment.yaml.

Orchestrator environment variables namespaced

Required update

Change the name of environment variables:

-   From `TRIAL_LIFECYCLE_PORT` to `COGMENT_LIFECYCLE_PORT`
- From `TRIAL_ACTOR_PORT` to `COGMENT_ACTOR_PORT`
- From `PROMETHEUS_PORT` to `COGMENT_ORCHESTRATOR_PROMETHEUS_PORT`

Trials' environments can be named

Just like the actors, the environment in a trial can now be named, this name defaults to "env". The environment name is used to address it, in particular to send messages. Environments and actors names belong to the same "namespace" and must be unique.

Recommended update

Instead of using the to_environment arguments of ActorSession.send_message(), use to and specify the environment's name.

Python SDK

Required update

Controller.terminate_trial() and Controller.get_trial_info() no longer supports providing a single trial identifier as a string.

Their usage need to change from

# Using named argument
my_controller.terminate_trial(trial_id="my_trial_id")
# Using positional argument
my_controller.get_trial_info("my_trial_id")

to

my_controller.terminate_trial(trial_ids=["my_trial_id"])
my_controller.get_trial_info(["my_trial_id"])
Required update

In actor implementaion, remove all usage of get_active_actors(). This method has been restricted to the environment only.

If actors need the full list of actors, there are a few possibilities: - Create a controller in the actor implementation and use the Controller.get_actors() method. - Receive the actor list in the config from the pre-trial hooks; the pre-trial hooks have implicit knowledge of all actors (at least the last hook). - Add the information in the actors observation space. - Send the information in a message.

Required update

Remove all usage of EnvironmentSession.send_message() using the to_environment argument.

Required update

Rename the parameter observations in EnvironmentSession.end(observations=observations) to final_observations.

Further details can be found in the python SDK documentation.

Javascript SDK

There has been a complete rework of the JS SDK we therefore recommend you to take a look at the dedicated javascript SDK documentation. In more details:

  • You can keep your actor function, as well as any logic dealing with the observation object, as its shape has remained the same,
  • If you are using the useActions React hook, there is a new version of that hook, which can be retrieved by running cogment init with an updated version of the Cogment CLI, and choosing yes when prompted if you want a web client.

Troubleshooting

Here we list a few error you are likely to see if something was not upgraded properly to Cogment 2.0:

  • AttributeError: module "cogment" has no attribute "delta_encoding"
    • This would be logged while trying to run a Python script and may happen if you use cogment generate instead of the new generation workflow.
    • This is caused by the discontinuation of delta encoding for observations.
  • Failure: [Problem rebuilding trial params [INVALID_ARGUMENT:(environment.config) some_message: Cannot find field.]]
    • When starting the Orchestrator with --config or --params.
    • This may happen when using an older version of the default parameters in a params or spec file.
    • It will happen when the default parameters contain an unknown field; In this particular case, the field config (i.e.from environment.config) is "unknown" because it is not accepted anymore in the Cogment 2.0 default parameters.
- - +

Migrate from Cogment v1 to v2

tip

This document is written as a guide to migrate from Cogment v1 to v2, a full list of the changes is also available here.

Updating components

The following components needs to be updated to work with Cogment v2:

  1. Update the CLI to the latest version and check that the version is correct

    curl --silent -L https://raw.githubusercontent.com/cogment/cogment-cli/main/install.sh | sudo bash
    cogment version
  2. Update the docker images to the versions compatible with the 2.0 API. These should be updated in Dockerfile, *.dockerfile or docker-compose.yml files in your project. The minimal version to use API 2.0 are:

    • cogment/orchestrator:v2.0.0
    • cogment/trial-datastore:v0.2.0 (prereleased component)
    • cogment/model-registry:v0.4.0 (prereleased component)
  3. Update the version of the python SDK to cogment[generate]>=2.0.2 (learn more about generate here) in your requirements.txt files or equivalent.

  4. Update the version of the javascript SDK to @cogment/cogment-js-sdk^2 in your package.json files or equivalent.

cogment.yaml split in a spec file and a parameters file

The cogment.yaml file has seen a lot of changes, the most important one is that we now differ between the spec file which specifies the types of trial for a cogment project, including actor classes and their action/observation spaces, and the parameters file which specifies default parameters for trials. The spec file is used in the code generation process of each SDKs and is no longer used by the orchestrator. The parameters file is used by the orchestrator, if you use pre-trial hooks to configure the started trials it might not be necessary.

We now recommand that two different files, respectively named cogment.yaml and params.yaml be used, however you can still use one file containing both content.

Recommended update

Move the trial_params section of the existing cogment.yaml file to a dedicated params.yaml file.

Further changes are required to both sections, as described below.

Required update

If the --config=cogment.yaml was provided to the orchestrator, remove it.

To provide a parameters file to the orchestrator use the --params=params.yaml command line option.

Further details can be found in the spec file documentation.

pre-trial hooks definition moved to an orchestrator configuration

pre-trial hooks are no longer defined in the cogment.yaml file, but instead are now given to the orchestrator as a command line option or through an environment variable.

Required update

Remove the trial:pre-hooks section from the spec file. Instead specify the hook addresses as gRPC URLs, e.g. grpc://1.1.1.1:9000, using the orchestrator cli option --pre_trial_hooks, separating potential multiple hooks with comas.

Further details can be found in the orchestrator documentation.

Datalog definition now part of each trial's parameters

The datalog definition is no longer a project-wide configuration but can be specified for each trial in its parameters.

Required update

Remove the datalog section from the spec file.

Datalog can be defined in the parameters file with the following format:

trial_params:
datalog:
- endpoint: grpc://logger:9000

It can also be defined when configuring the trial in the pre-trial hook.

Datalog API has changed, and now has a python wrapper

  • Instead of returning raw protobuf messages, Python wrapper objects are returned, so access to the raw messages is not available anymore
  • The DatalogSession attribute raw_trial_params is not available anymore.
  • The DatalogSession attribute trial_params returns a cogment.LogParams object instead of a protobuf message.
  • The DatalogSession.get_all_samples() now generates cogment.LogSample objects instead of a protobuf message.
  • If there is a need to deserialize v1 data (e.g. from an old database), v1 versions of the sample protobuf messages (cogment.api.datalog_pb2.TrialParams_v1 and cogment.api.datalog_pb2.DatalogSample_v1) are provided in the API for convenience.

For more information, please see the following sections of the Python SDK Documentation

Default trial parameters no longer support definition user configuration for trials, environments and actors

The config sections that were used to define default user configuration of trials, environments and actors are no longer supported. If necessary, these must be provided when starting the trial, for the trial config, and in pre-trial hooks, for the environment and actors config. Defaults can also be defined in the implementation code itself.

Required update

Remove the config sections (for trial, environment and actor) from the params file.

For simple projects, provide a default configuration in the implementation code directly, for more complex one use a pre-trial hook.

Prefer using full URL for endpoints

Recommended update

Use full gRPC URLs, starting with grpc://, when defining endpoints in the params file on in the SDKs.

Additionaly, to prepare for further features, we are introducing a cogment URL scheme. At the moment only the special client endpoint is concerned.

Recommended update

If actors are clients, replace the endpoint value from client to cogment://client

Support for "delta" observations discontinued

Framework support for "delta" observations has been discontinued. The same result can be obtained user-side in the environment and actor implementations.

Required update

Remove the following section from the spec file:

  • import::python
  • import::javascript
  • actor_classes::observation::delta
  • actor_classes::observation::delta_apply_fn

In the python SDK, RecvObservation delta attribute no longer exists.

You can support delta observations in your code, for example you could change the definition of your observation message to support both full observation or delta observation.

message Observation {
oneof observation_or_delta {
ObservationMessage obs = 1;
DeltaObservation delta = 2;
}
}

As before the environment side can decide to send full or delta observations. On the consumer side, actor or datalog, you'll need to keep the previous observation around to apply the delta to it.

Recommended update

Instead of using RecvObservation snapshot attribute, use observation instead.

New code generation workflow

The code generation step is no longer perfomed by the CLI but by dedicated tools provided with the SDKs. cogment copy is provided by the CLI as a cross platform way to copy the required files, i.e. the spec, protobuf and params files, from the root of the project to services source directories. As a result of these cogment sync and cogment generate are no longer available.

Required update

Replace any usage of cogment sync with cogment copy. This new commands needs to know explicitly what files to copy

cogment copy data.proto cogment.yaml params.yaml environment_dir actor_dir
Required update

For services using the python SDK:

  • Make sure you install the SDK and the generate tool using pip install cogment[generate].
  • Generate the necessary files with python3 -m cogment.generate --spec cogment.yaml.
Required update

For services using the javascript SDK

  • Generate the necessary files with npx cogment-js-sdk-generate cogment.yaml.

Orchestrator environment variables namespaced

Required update

Change the name of environment variables:

-   From `TRIAL_LIFECYCLE_PORT` to `COGMENT_LIFECYCLE_PORT`
- From `TRIAL_ACTOR_PORT` to `COGMENT_ACTOR_PORT`
- From `PROMETHEUS_PORT` to `COGMENT_ORCHESTRATOR_PROMETHEUS_PORT`

Trials' environments can be named

Just like the actors, the environment in a trial can now be named, this name defaults to "env". The environment name is used to address it, in particular to send messages. Environments and actors names belong to the same "namespace" and must be unique.

Recommended update

Instead of using the to_environment arguments of ActorSession.send_message(), use to and specify the environment's name.

Python SDK

Required update

Controller.terminate_trial() and Controller.get_trial_info() no longer supports providing a single trial identifier as a string.

Their usage need to change from

# Using named argument
my_controller.terminate_trial(trial_id="my_trial_id")
# Using positional argument
my_controller.get_trial_info("my_trial_id")

to

my_controller.terminate_trial(trial_ids=["my_trial_id"])
my_controller.get_trial_info(["my_trial_id"])
Required update

In actor implementaion, remove all usage of get_active_actors(). This method has been restricted to the environment only.

If actors need the full list of actors, there are a few possibilities: - Create a controller in the actor implementation and use the Controller.get_actors() method. - Receive the actor list in the config from the pre-trial hooks; the pre-trial hooks have implicit knowledge of all actors (at least the last hook). - Add the information in the actors observation space. - Send the information in a message.

Required update

Remove all usage of EnvironmentSession.send_message() using the to_environment argument.

Required update

Rename the parameter observations in EnvironmentSession.end(observations=observations) to final_observations.

Further details can be found in the python SDK documentation.

Javascript SDK

There has been a complete rework of the JS SDK we therefore recommend you to take a look at the dedicated javascript SDK documentation. In more details:

  • You can keep your actor function, as well as any logic dealing with the observation object, as its shape has remained the same,
  • If you are using the useActions React hook, there is a new version of that hook, which can be retrieved by running cogment init with an updated version of the Cogment CLI, and choosing yes when prompted if you want a web client.

Troubleshooting

Here we list a few error you are likely to see if something was not upgraded properly to Cogment 2.0:

  • AttributeError: module "cogment" has no attribute "delta_encoding"
    • This would be logged while trying to run a Python script and may happen if you use cogment generate instead of the new generation workflow.
    • This is caused by the discontinuation of delta encoding for observations.
  • Failure: [Problem rebuilding trial params [INVALID_ARGUMENT:(environment.config) some_message: Cannot find field.]]
    • When starting the Orchestrator with --config or --params.
    • This may happen when using an older version of the default parameters in a params or spec file.
    • It will happen when the default parameters contain an unknown field; In this particular case, the field config (i.e.from environment.config) is "unknown" because it is not accepted anymore in the Cogment 2.0 default parameters.
+ + \ No newline at end of file diff --git a/docs/guide/tutorial.html b/docs/guide/tutorial.html index 1049cff..a790ab1 100644 --- a/docs/guide/tutorial.html +++ b/docs/guide/tutorial.html @@ -1,21 +1,21 @@ - + - + Tutorial | Cogment - - - + + +
-

Tutorial

Here we will learn about the different elements of Cogment and how they fit together by creating a simulated game of Rock-Paper-Scissors. To run this tutorial locally, you will need to download or clone the source code from our github repository.

Prerequisites

This tutorial assumes a strong working knowledge of Python, as well as some basic familiarity with the following:

Why Rock-Paper-Scissors (RPS)?

RPS is a hand game, usually played between two players, in which each player selects one of three possible hand-signs indicating rock, paper, or scissors.

Schematic of rock-paper-scissors from Wikipedia

RPS is a simultaneous, zero-sum game which has only two possible outcomes:

  • One player's action beats the other (i.e. they win and their opponent loses), or
  • Both players choose the same action and the game is a draw.

RPS is a very simple game with straightforward rules. As long as we forbid pure random moves, which are very difficult to beat, it is an interesting testbed to develop AIs that compete with Humans. Unlike "deep" games such as chess or go, the power is not really in the brute force exploration of possible outcomes, but rather in getting some level of understanding of how the opponent plays to be able to anticipate their moves. A good read on the subject of AI and RPS is this article by Benjamin Peterson: Towards an AI for Rock, Paper, Scissors. This means as a tutorial to get acquainted with Cogment, RPS is simple enough to be easily implemented, and interesting enough to be a good example to showcase the different kinds of things Cogment is capable of doing.

Formalizing RPS

Cogment is designed with the abstraction of reinforcement Learning in mind: tasks are broken down into sequential interactions between Actor(s) and the Environment. The Actors are the players of RPS, and the Environment is the world the players operate in: which types of actions are allowed, the rules that specify the consequences of actions (eg. "scissors beats paper").

Abstraction of Interactions

Actors usually need to know some information about the state of the world in order to make a choice about which action to select -- this kind of information is called an "Observation".

The Environment receives these actions and produces consequences -- updated Observations on the state of the world, and sometimes a reward signal, such as a win or loss. Reward signals are a useful way of quantifying goals, and are used in RL for training AI-based actors to improve their behaviour in pursuit of maximizing the rewards.

The repeated sequential interactions between players and the RPS game environment are handled by running Trials which coordinate the exchange of information between Actors and the Environment until a terminal condition is met.

How does Cogment think of these pieces?

Cogment runs as a distributed microservices architecture, meaning that the RPS Environment, each of the Actors, and the Cogment machinery that supports their interactions are all set up as separate services whose processes can be run on separate computation nodes. The operations carried out on each of these services are coordinated by the Orchestrator, a key component of Cogment that ties all services together in order to execute the Trials.

Cogment components used in RPS

Tutorial Roadmap

By the end of this basic tutorial you should understand the key elements of Cogment and how they work together. In particular, these steps cover how Cogment handles Actors and Environments and how the interactions between them are orchestrated to run trials. We start with a basic skeleton of each of these pieces, and add more detail as we go through the tutorial.

tutorial roadmap

The first step of the tutorial is to get the code set up and make sure it functions properly. The basic code doesn't do anything interesting, but we will walk through what components are included so that it's clear how the different pieces fit together.

In step 2, we will look at how Cogment represents Actors, what information they operate with, and how they communicate with the other components of the application

In step 3, we will flesh out the details of the Environment. This involves specifying what types of actions are allowed in the game and the rules for what happens when actions are taken, as well as configuring the conditions for when a game has been won.

In step 4, we will add feedback from the Environment and enable one of the Actors to reason about action selection given information in the Observation it receives. We'll look at how two Actors using different implementations perform in a game of RPS.

Once you understand the basic components of Cogment and how they work together, you may be interested in more advanced tutorials on how to implement more complex things with Cogment. We treat the more advanced tutorials as a "choose your own adventure" style of guide: play with a human in the loop, connect a web client for a better human user interface, or improve operational efficiency by using some more advanced Cogment tooling.

- - +

Tutorial

Here we will learn about the different elements of Cogment and how they fit together by creating a simulated game of Rock-Paper-Scissors. To run this tutorial locally, you will need to download or clone the source code from our github repository.

Prerequisites

This tutorial assumes a strong working knowledge of Python, as well as some basic familiarity with the following:

Why Rock-Paper-Scissors (RPS)?

RPS is a hand game, usually played between two players, in which each player selects one of three possible hand-signs indicating rock, paper, or scissors.

Schematic of rock-paper-scissors from Wikipedia

RPS is a simultaneous, zero-sum game which has only two possible outcomes:

  • One player's action beats the other (i.e. they win and their opponent loses), or
  • Both players choose the same action and the game is a draw.

RPS is a very simple game with straightforward rules. As long as we forbid pure random moves, which are very difficult to beat, it is an interesting testbed to develop AIs that compete with Humans. Unlike "deep" games such as chess or go, the power is not really in the brute force exploration of possible outcomes, but rather in getting some level of understanding of how the opponent plays to be able to anticipate their moves. A good read on the subject of AI and RPS is this article by Benjamin Peterson: Towards an AI for Rock, Paper, Scissors. This means as a tutorial to get acquainted with Cogment, RPS is simple enough to be easily implemented, and interesting enough to be a good example to showcase the different kinds of things Cogment is capable of doing.

Formalizing RPS

Cogment is designed with the abstraction of reinforcement Learning in mind: tasks are broken down into sequential interactions between Actor(s) and the Environment. The Actors are the players of RPS, and the Environment is the world the players operate in: which types of actions are allowed, the rules that specify the consequences of actions (eg. "scissors beats paper").

Abstraction of Interactions

Actors usually need to know some information about the state of the world in order to make a choice about which action to select -- this kind of information is called an "Observation".

The Environment receives these actions and produces consequences -- updated Observations on the state of the world, and sometimes a reward signal, such as a win or loss. Reward signals are a useful way of quantifying goals, and are used in RL for training AI-based actors to improve their behaviour in pursuit of maximizing the rewards.

The repeated sequential interactions between players and the RPS game environment are handled by running Trials which coordinate the exchange of information between Actors and the Environment until a terminal condition is met.

How does Cogment think of these pieces?

Cogment runs as a distributed microservices architecture, meaning that the RPS Environment, each of the Actors, and the Cogment machinery that supports their interactions are all set up as separate services whose processes can be run on separate computation nodes. The operations carried out on each of these services are coordinated by the Orchestrator, a key component of Cogment that ties all services together in order to execute the Trials.

Cogment components used in RPS

Tutorial Roadmap

By the end of this basic tutorial you should understand the key elements of Cogment and how they work together. In particular, these steps cover how Cogment handles Actors and Environments and how the interactions between them are orchestrated to run trials. We start with a basic skeleton of each of these pieces, and add more detail as we go through the tutorial.

tutorial roadmap

The first step of the tutorial is to get the code set up and make sure it functions properly. The basic code doesn't do anything interesting, but we will walk through what components are included so that it's clear how the different pieces fit together.

In step 2, we will look at how Cogment represents Actors, what information they operate with, and how they communicate with the other components of the application

In step 3, we will flesh out the details of the Environment. This involves specifying what types of actions are allowed in the game and the rules for what happens when actions are taken, as well as configuring the conditions for when a game has been won.

In step 4, we will add feedback from the Environment and enable one of the Actors to reason about action selection given information in the Observation it receives. We'll look at how two Actors using different implementations perform in a game of RPS.

Once you understand the basic components of Cogment and how they work together, you may be interested in more advanced tutorials on how to implement more complex things with Cogment. We treat the more advanced tutorials as a "choose your own adventure" style of guide: play with a human in the loop, connect a web client for a better human user interface, or improve operational efficiency by using some more advanced Cogment tooling.

+ + \ No newline at end of file diff --git a/docs/guide/tutorial/actors-in-cogment.html b/docs/guide/tutorial/actors-in-cogment.html index fb47066..820cff4 100644 --- a/docs/guide/tutorial/actors-in-cogment.html +++ b/docs/guide/tutorial/actors-in-cogment.html @@ -1,22 +1,22 @@ - + - + Step 2 - Actors in Cogment | Cogment - - - + + +
-

Actors: Players of RPS

Now that we have a working but empty Cogment app, let's look at how these pieces interact in the context of the RPS game. In this step of the tutorial, we will lay out how Actors are defined in Cogment. To build out our RPS application, we will add the ability for our Actors to select actions (rather than produce empty strings).

Actors and Environment interaction in RPS

What does Cogment need to know about an Actor?

In Cogment, the general concept of an Actor is a role that has agency. In RPS, this is a player of the game. At a high level, Cogment operates the same whether the Actor is human or machine-based. For now, we will just look at machine-based Actors. A more in-depth tutorial will guide you through implementing a client Actor which can be used by a human player to participate in the RPS game.

To fully specify Actors in Cogment, we need to define what they do (what observations they take and actions they produce), how they do it, and where they run those computations.

To better understand how Cogment represents Actors, the following terminology is important to highlight:

  • The Actor Service is the designated computational node where Actor instances run. A service can manage multiple Actor instances concurrently. The Actor Service is where the computations are run. The Actor Service is launched by actors/main.py on the TCP port set by the ACTORS_PORT variable in the .env file.
  • The Actor Class is the specification of the attributes and behaviours that an Actor can have, for example what sort of inputs the Actor expects and what sort of outputs it will produce. If we want to have several different Actors that all behave similarly (take same type of inputs and produce same type of outputs) we can define an Actor class and different instances of that class can use different implementations. The Actor Class defines what the Actor does. The Actor Classes are defined in the cogment.yaml file in the root directory (which is copied to each service directory as part of the ./run.sh install command).
  • The Actor Implementation is the logic of how the role operates. Specifically, the implementation refers to the function which controls how the Actor makes decisions about what action to output given some input information about the state of the world. The Actor implementation is how the Actor chooses actions. The function we use for our first Actor implementation is defined in actors/main.py.

different concepts of actors -In the above image, we showcase these different concepts: the Actor Class "Player" lays out the skeleton for what components the Actor will need to manage. We can create an instance of this class (gray) with an Actor Implementation that does random action selection, which takes an Observation as input and produces an action as output. The computations made by the Player Actor instance are run on the Actor Service.

Defining the Actor Service

Let's look at actors/main.py to see how Cogment handles the concepts of the Actor Service, Actor Class, and Actor Implementation in the RPS application. If we look at the main() function that is invoked by running this file, we see:

Main function for registering actors on actor service

The main() function first initializes a context in which the Actors will be registered. When registering an Actor, we specify the class this Actor will be an instance of (from the options given in cogment.yaml), and which implementation will be used. So far in our RPS application, we have only registered one type of Actor: an instance of the player class using the random_agent implementation.

After registering each of the different types of Actors that Cogment will be responsible for managing in the application, this function starts the Actor Service that will handle any Actor-associated computations on the appropriate port, and awaits the termination of the service.

note

Ports for running services are specified in the .env file, loaded by the .run.sh script, and retrieved by the os package to make the variable available to Python. To change the port this service uses, update the.env file in the root directory rather than changing main.py.

Defining the Actor Class

The Actor Class is where we define the domain over which the Actor will operate, i.e. what inputs and outputs the Actor is expected to handle. We specify the Actor Class in the cogment.yaml file, using the imported Protocol Buffer (protobuf) messages from the associated data.proto file.

The cogment.yaml file lets Cogment know how to configure each of the components involved in running the Trial, so we will return to it again later. The actor_classes section describes what types of Actors exist in this game (here only player Actors), and what the inputs and outputs of an instance of the player class of Actor look like:

Actor Class definitions

This tells Cogment that an instance of the player Actor class will expect observations specified by the rps.Observation message, and will produce actions of a form defined by the rps.PlayerAction message. The Actor Class is fully specified here by its Observation space and Action Space.

note

Message types are referenced by rps.SomeMessageName, since message types imported from a .proto are referred to through their package namespace, which has been set to rps in the data.proto file. (For more information about the general use of the cogment.yaml file, see the dedicated reference page.)

Action Space

The action space refers to the set of valid actions which can be taken by an Actor at each step of the game. The cogment.yaml file tells Cogment that a member of the player Actor class can take actions of type PlayerAction as defined in the data.proto file.

If we look at the PlayerAction message in data.proto, we see it is a message of type Move, where a Move is defined to be one of ROCK, PAPER, or SCISSORS, or an UNKNOWN move:

defining the action space

We also specify here that a Move is an enum type of Protobuf message, meaning that it can take only one of a predefined list of values. We include UNKNOWN in this because the first argument of an enum will be its default value, and we don't wish any of our actions to be a default behaviour. Together these specify the action space: a valid action for a player type Actor is a single one of the list of possible moves.

Observation Space

The observation space refers to the set of possible inputs an Actor can receive at each step of the game. Observations are what Actors perceive from the Environment about what is the current state of their world, which they use to make decisions about what actions they should take.

In the context of RPS, the Environment is limited to the two players, the actions they took, and the consequence of both of their actions.

The cogment.yaml file tells Cogment that a member of the player Actor class receives observations of the form Observation as defined in the data.proto file.

The Observation message type itself specifies that each player considers information about themselves and their opponent, and that these pieces of information are of the type PlayerState:

defining the observation space

Note that last_move is optional because during the first round of the game, the players have not yet played any move. For all other steps of the game, each player is considering what was their last move, their opponents last move, and which of the two of them won or lost the match.

Defining the Actor Implementation

While the Class defines how an Actor expects to receive observations and output actions, the Actor implementation specifies the details of how the Actor makes decisions. This implementation function is a callback function, used once per actor and per trial and handles the full lifetime of the Actor.

Until now, we have used a partially completed random_agent implementation defined in the actors/main.py file. It is partially complete because the player's actions are currently empty. In this step, we will enable our Actor to select actions at random.

defining the random actor

An Actor implementation specifies:

  • The actor's initialization, before the async for. This is where, for example, the Actor's internal data can be defined before calling actor_session.start() to notify that it is ready.
  • The event loop, which specifies how the Actor makes decisions about what action to select in response to an observation in each step, and what kind of rewards it might receive from selecting its action. Here, you can see that by default the action gets an empty PlayerAction message (the data structure defined in data.proto), which has the expected format but contains no data.
  • The termination block, i.e. what the Actor does after all the events.

The argument passed to the Actor implementation is the Actor's session, which allows the Orchestrator to manage all the data associate with the Actor's operations in the trial.

Completing the random_agent Actor Implementation

We'll modify the random_agent function defined in actors/main.py to enable our Actor implementation to select random actions (rather than produce empty strings). First, we need to import the different options Move can take, as defined in our data structures in data.proto. We will also need to import the Python package random, which will enable us to choose one of the Move options at random.

In the "Imports" section at the top of the file, add the following:

from data_pb2 import ROCK, PAPER, SCISSORS
import random

We will store all of the possible options for the types of MOVES we can take in a list. Add the following code to the "Settings" section:

MOVES = [ROCK, PAPER, SCISSORS]

Recall from above that the PlayerAction message has one field: move. This is the piece we need to pass to the formerly empty PlayerAction message inside the event loop of the random_agent instance definition. Replace the if event.observation: block in the event loop with the following:

if event.observation:
print(f"'{actor_session.name}' received an observation: '{event.observation}'")
if event.type == cogment.EventType.ACTIVE:
action = PlayerAction(move=random.choice(MOVES)) ## NEW IN STEP 2
actor_session.do_action(action)

The completed Actor implementation should look like this:

completed random actor implementation

We now have an Actor that will randomly select actions. We showed earlier in this step of the tutorial where this implementation is used when registering instances of Actors with the service. Next, we will show how Cogment specifies which Actors and how many of them will participate in the Trial.

Specifying which Actors participate in the Trial

If we look at the trial_runner/main.py code, we will see the code that tells Cogment exactly which participants will be part of a trial.

basic trial runner

This code creates the context in which to run the trial, and a controller which will actually carry out the function of starting the trial, monitoring its state, and ending the trial.

This is also where we say specifically which Actors will be part of the trial. Here, we are going to create a trial with two Actors which use identical parameter settings, except for having different names. Each player uses an instance of the Actor type we registered on the Actor Service in actors/main.py - if we call for a different implementation or class here, Cogment won't know what to do with that because no other Actor types have been registered with the Actor service.

We can change the player names to Bob and Alice in trial_runner/main.py just to see how that impacts what gets reported as the services are running:

actor_1_params = cogment.ActorParameters(
cog_settings,
name="Bob", # player_1
class_name="player",
endpoint=ACTORS_ENDPOINT,
implementation="random_agent"
)
actor_2_params = cogment.ActorParameters(
cog_settings,
name="Alice", # player_2
class_name="player",
endpoint=ACTORS_ENDPOINT,
implementation="random_agent"
)

To learn more about the parameters, check the cogment.TrialParameters class reference.

Then we specify the parameters of the trial -- including the specifications for our two players -- and pass these trial parameters to the controller to start a new trial. In this trial runner, our controller will terminate the trial after the players have played for 5 seconds.

Then the Trial Runner tells the controller to start a trial with the specified parameters. The start_trial call will return a unique identifier for the trial. The Trial Runner uses this information to request the end of the trial with terminate_trial. It is also possible to tell the controller the ID you want your trial to have, by passing your chosen ID to the trial_id_requested parameter of the start_trial method. We will do this in the next step of the tutorial.

We can now run the application, and we will see the service terminal logs report that each player selects a valid action instead of an empty one.

Bob and Alice pick actions

We can also see that the services terminal prints out what the Actors were receiving from the Environment as Observations:

Bob and Alice get empty observations

Quick Summary

We learned about how Cogment represents Actors and the different concepts of the Actor Service, Actor Class, and Actor Implementation.

We enabled the random_agent Actor implementation to select actions by importing the ROCK PAPER SCISSORS data structures defined in the data.proto (via data_pb2.py), the random package, and changing the event block to:

async for event in actor_session.all_events():
if event.observation:
print(f"'{actor_session.name}' received an observation: '{event.observation}'")
if event.type == cogment.EventType.ACTIVE:
action = PlayerAction(move=random.choice(MOVES)) # new in step 2
actor_session.do_action(action)
for reward in event.rewards:
print(f"'{actor_session.name}' received a reward for tick #{reward.tick_id}: {reward.value}")

We also looked at how the Trial Runner calls upon Actors to participate in the trial. We modified the parameters for the Actors in the Trial Runner and gave each player a name:

actor_1_params = cogment.ActorParameters(
cog_settings,
name="Bob",
class_name="player",
endpoint=ACTORS_ENDPOINT,
implementation="random_agent"
)
actor_2_params = cogment.ActorParameters(
cog_settings,
name="Alice",
class_name="player",
endpoint=ACTORS_ENDPOINT,
implementation="random_agent"
)

In the next step of the tutorial, we will go through how Cogment represents the Environment, and set up the Environment implementation to give Bob and Alice observations about the state of the world that contain meaningful information.

- - +

Actors: Players of RPS

Now that we have a working but empty Cogment app, let's look at how these pieces interact in the context of the RPS game. In this step of the tutorial, we will lay out how Actors are defined in Cogment. To build out our RPS application, we will add the ability for our Actors to select actions (rather than produce empty strings).

Actors and Environment interaction in RPS

What does Cogment need to know about an Actor?

In Cogment, the general concept of an Actor is a role that has agency. In RPS, this is a player of the game. At a high level, Cogment operates the same whether the Actor is human or machine-based. For now, we will just look at machine-based Actors. A more in-depth tutorial will guide you through implementing a client Actor which can be used by a human player to participate in the RPS game.

To fully specify Actors in Cogment, we need to define what they do (what observations they take and actions they produce), how they do it, and where they run those computations.

To better understand how Cogment represents Actors, the following terminology is important to highlight:

  • The Actor Service is the designated computational node where Actor instances run. A service can manage multiple Actor instances concurrently. The Actor Service is where the computations are run. The Actor Service is launched by actors/main.py on the TCP port set by the ACTORS_PORT variable in the .env file.
  • The Actor Class is the specification of the attributes and behaviours that an Actor can have, for example what sort of inputs the Actor expects and what sort of outputs it will produce. If we want to have several different Actors that all behave similarly (take same type of inputs and produce same type of outputs) we can define an Actor class and different instances of that class can use different implementations. The Actor Class defines what the Actor does. The Actor Classes are defined in the cogment.yaml file in the root directory (which is copied to each service directory as part of the ./run.sh install command).
  • The Actor Implementation is the logic of how the role operates. Specifically, the implementation refers to the function which controls how the Actor makes decisions about what action to output given some input information about the state of the world. The Actor implementation is how the Actor chooses actions. The function we use for our first Actor implementation is defined in actors/main.py.

different concepts of actors +In the above image, we showcase these different concepts: the Actor Class "Player" lays out the skeleton for what components the Actor will need to manage. We can create an instance of this class (gray) with an Actor Implementation that does random action selection, which takes an Observation as input and produces an action as output. The computations made by the Player Actor instance are run on the Actor Service.

Defining the Actor Service

Let's look at actors/main.py to see how Cogment handles the concepts of the Actor Service, Actor Class, and Actor Implementation in the RPS application. If we look at the main() function that is invoked by running this file, we see:

Main function for registering actors on actor service

The main() function first initializes a context in which the Actors will be registered. When registering an Actor, we specify the class this Actor will be an instance of (from the options given in cogment.yaml), and which implementation will be used. So far in our RPS application, we have only registered one type of Actor: an instance of the player class using the random_agent implementation.

After registering each of the different types of Actors that Cogment will be responsible for managing in the application, this function starts the Actor Service that will handle any Actor-associated computations on the appropriate port, and awaits the termination of the service.

note

Ports for running services are specified in the .env file, loaded by the .run.sh script, and retrieved by the os package to make the variable available to Python. To change the port this service uses, update the.env file in the root directory rather than changing main.py.

Defining the Actor Class

The Actor Class is where we define the domain over which the Actor will operate, i.e. what inputs and outputs the Actor is expected to handle. We specify the Actor Class in the cogment.yaml file, using the imported Protocol Buffer (protobuf) messages from the associated data.proto file.

The cogment.yaml file lets Cogment know how to configure each of the components involved in running the Trial, so we will return to it again later. The actor_classes section describes what types of Actors exist in this game (here only player Actors), and what the inputs and outputs of an instance of the player class of Actor look like:

Actor Class definitions

This tells Cogment that an instance of the player Actor class will expect observations specified by the rps.Observation message, and will produce actions of a form defined by the rps.PlayerAction message. The Actor Class is fully specified here by its Observation space and Action Space.

note

Message types are referenced by rps.SomeMessageName, since message types imported from a .proto are referred to through their package namespace, which has been set to rps in the data.proto file. (For more information about the general use of the cogment.yaml file, see the dedicated reference page.)

Action Space

The action space refers to the set of valid actions which can be taken by an Actor at each step of the game. The cogment.yaml file tells Cogment that a member of the player Actor class can take actions of type PlayerAction as defined in the data.proto file.

If we look at the PlayerAction message in data.proto, we see it is a message of type Move, where a Move is defined to be one of ROCK, PAPER, or SCISSORS, or an UNKNOWN move:

defining the action space

We also specify here that a Move is an enum type of Protobuf message, meaning that it can take only one of a predefined list of values. We include UNKNOWN in this because the first argument of an enum will be its default value, and we don't wish any of our actions to be a default behaviour. Together these specify the action space: a valid action for a player type Actor is a single one of the list of possible moves.

Observation Space

The observation space refers to the set of possible inputs an Actor can receive at each step of the game. Observations are what Actors perceive from the Environment about what is the current state of their world, which they use to make decisions about what actions they should take.

In the context of RPS, the Environment is limited to the two players, the actions they took, and the consequence of both of their actions.

The cogment.yaml file tells Cogment that a member of the player Actor class receives observations of the form Observation as defined in the data.proto file.

The Observation message type itself specifies that each player considers information about themselves and their opponent, and that these pieces of information are of the type PlayerState:

defining the observation space

Note that last_move is optional because during the first round of the game, the players have not yet played any move. For all other steps of the game, each player is considering what was their last move, their opponents last move, and which of the two of them won or lost the match.

Defining the Actor Implementation

While the Class defines how an Actor expects to receive observations and output actions, the Actor implementation specifies the details of how the Actor makes decisions. This implementation function is a callback function, used once per actor and per trial and handles the full lifetime of the Actor.

Until now, we have used a partially completed random_agent implementation defined in the actors/main.py file. It is partially complete because the player's actions are currently empty. In this step, we will enable our Actor to select actions at random.

defining the random actor

An Actor implementation specifies:

  • The actor's initialization, before the async for. This is where, for example, the Actor's internal data can be defined before calling actor_session.start() to notify that it is ready.
  • The event loop, which specifies how the Actor makes decisions about what action to select in response to an observation in each step, and what kind of rewards it might receive from selecting its action. Here, you can see that by default the action gets an empty PlayerAction message (the data structure defined in data.proto), which has the expected format but contains no data.
  • The termination block, i.e. what the Actor does after all the events.

The argument passed to the Actor implementation is the Actor's session, which allows the Orchestrator to manage all the data associate with the Actor's operations in the trial.

Completing the random_agent Actor Implementation

We'll modify the random_agent function defined in actors/main.py to enable our Actor implementation to select random actions (rather than produce empty strings). First, we need to import the different options Move can take, as defined in our data structures in data.proto. We will also need to import the Python package random, which will enable us to choose one of the Move options at random.

In the "Imports" section at the top of the file, add the following:

from data_pb2 import ROCK, PAPER, SCISSORS
import random

We will store all of the possible options for the types of MOVES we can take in a list. Add the following code to the "Settings" section:

MOVES = [ROCK, PAPER, SCISSORS]

Recall from above that the PlayerAction message has one field: move. This is the piece we need to pass to the formerly empty PlayerAction message inside the event loop of the random_agent instance definition. Replace the if event.observation: block in the event loop with the following:

if event.observation:
print(f"'{actor_session.name}' received an observation: '{event.observation}'")
if event.type == cogment.EventType.ACTIVE:
action = PlayerAction(move=random.choice(MOVES)) ## NEW IN STEP 2
actor_session.do_action(action)

The completed Actor implementation should look like this:

completed random actor implementation

We now have an Actor that will randomly select actions. We showed earlier in this step of the tutorial where this implementation is used when registering instances of Actors with the service. Next, we will show how Cogment specifies which Actors and how many of them will participate in the Trial.

Specifying which Actors participate in the Trial

If we look at the trial_runner/main.py code, we will see the code that tells Cogment exactly which participants will be part of a trial.

basic trial runner

This code creates the context in which to run the trial, and a controller which will actually carry out the function of starting the trial, monitoring its state, and ending the trial.

This is also where we say specifically which Actors will be part of the trial. Here, we are going to create a trial with two Actors which use identical parameter settings, except for having different names. Each player uses an instance of the Actor type we registered on the Actor Service in actors/main.py - if we call for a different implementation or class here, Cogment won't know what to do with that because no other Actor types have been registered with the Actor service.

We can change the player names to Bob and Alice in trial_runner/main.py just to see how that impacts what gets reported as the services are running:

actor_1_params = cogment.ActorParameters(
cog_settings,
name="Bob", # player_1
class_name="player",
endpoint=ACTORS_ENDPOINT,
implementation="random_agent"
)
actor_2_params = cogment.ActorParameters(
cog_settings,
name="Alice", # player_2
class_name="player",
endpoint=ACTORS_ENDPOINT,
implementation="random_agent"
)

To learn more about the parameters, check the cogment.TrialParameters class reference.

Then we specify the parameters of the trial -- including the specifications for our two players -- and pass these trial parameters to the controller to start a new trial. In this trial runner, our controller will terminate the trial after the players have played for 5 seconds.

Then the Trial Runner tells the controller to start a trial with the specified parameters. The start_trial call will return a unique identifier for the trial. The Trial Runner uses this information to request the end of the trial with terminate_trial. It is also possible to tell the controller the ID you want your trial to have, by passing your chosen ID to the trial_id_requested parameter of the start_trial method. We will do this in the next step of the tutorial.

We can now run the application, and we will see the service terminal logs report that each player selects a valid action instead of an empty one.

Bob and Alice pick actions

We can also see that the services terminal prints out what the Actors were receiving from the Environment as Observations:

Bob and Alice get empty observations

Quick Summary

We learned about how Cogment represents Actors and the different concepts of the Actor Service, Actor Class, and Actor Implementation.

We enabled the random_agent Actor implementation to select actions by importing the ROCK PAPER SCISSORS data structures defined in the data.proto (via data_pb2.py), the random package, and changing the event block to:

async for event in actor_session.all_events():
if event.observation:
print(f"'{actor_session.name}' received an observation: '{event.observation}'")
if event.type == cogment.EventType.ACTIVE:
action = PlayerAction(move=random.choice(MOVES)) # new in step 2
actor_session.do_action(action)
for reward in event.rewards:
print(f"'{actor_session.name}' received a reward for tick #{reward.tick_id}: {reward.value}")

We also looked at how the Trial Runner calls upon Actors to participate in the trial. We modified the parameters for the Actors in the Trial Runner and gave each player a name:

actor_1_params = cogment.ActorParameters(
cog_settings,
name="Bob",
class_name="player",
endpoint=ACTORS_ENDPOINT,
implementation="random_agent"
)
actor_2_params = cogment.ActorParameters(
cog_settings,
name="Alice",
class_name="player",
endpoint=ACTORS_ENDPOINT,
implementation="random_agent"
)

In the next step of the tutorial, we will go through how Cogment represents the Environment, and set up the Environment implementation to give Bob and Alice observations about the state of the world that contain meaningful information.

+ + \ No newline at end of file diff --git a/docs/guide/tutorial/advanced-tutorials.html b/docs/guide/tutorial/advanced-tutorials.html index 4d01e80..e2a89e8 100644 --- a/docs/guide/tutorial/advanced-tutorials.html +++ b/docs/guide/tutorial/advanced-tutorials.html @@ -1,21 +1,21 @@ - + - + Advanced Tutorial Steps | Cogment - - - + + +
-

Advanced Tutorial Steps

This section offers an interested reader a set of advanced tutorials to learn how about how to do more complex things with Cogment. These tutorials build off of the RPS basics tutorial, so it may be useful to follow these.

You can use the more advanced tutorials in a "choose your own adventure" style:

The steps above are in order of increasing complexity, but you need not necessarily complete all of them. You can get a working starting point by following the installation instructions and copying the code for the desired step of the tutorial you'd like to explore.

- - +

Advanced Tutorial Steps

This section offers an interested reader a set of advanced tutorials to learn how about how to do more complex things with Cogment. These tutorials build off of the RPS basics tutorial, so it may be useful to follow these.

You can use the more advanced tutorials in a "choose your own adventure" style:

The steps above are in order of increasing complexity, but you need not necessarily complete all of them. You can get a working starting point by following the installation instructions and copying the code for the desired step of the tutorial you'd like to explore.

+ + \ No newline at end of file diff --git a/docs/guide/tutorial/advanced-tutorials/directory.html b/docs/guide/tutorial/advanced-tutorials/directory.html index fcc23df..6d9ae17 100644 --- a/docs/guide/tutorial/advanced-tutorials/directory.html +++ b/docs/guide/tutorial/advanced-tutorials/directory.html @@ -1,49 +1,49 @@ - + - + Improve Operational Efficiency with a Cogment Directory for Service Discovery | Cogment - - - + + +
-

Improve Operational Efficiency with a Cogment Directory for Service Discovery

note

It is not necessary to have gone through all the previous sections to understand this part, but the code changes refer to the code in the previous step. The code can be retrieved from the tutorial's repository.

In this step of the tutorial, we will add the Cogment Directory to +

Improve Operational Efficiency with a Cogment Directory for Service Discovery

note

It is not necessary to have gone through all the previous sections to understand this part, but the code changes refer to the code in the previous step. The code can be retrieved from the tutorial's repository.

In this step of the tutorial, we will add the Cogment Directory to the project. A directory is a register of services together with the network addresses where to connect to the services. This will let components find the services they need instead of having to already know the network address. -It makes it easier to manage more complicated projects and complex deployments.

Adding the Directory service

In the ./run.sh script we will add the command to start the Directory service.

function directory_start() {
cogment services directory --port=9005
}

Since the Directory is a service that all other services depend upon, it needs to be started first.

Here we have a few choices; we could decide to start it in a separate terminal before the other services, or we could +It makes it easier to manage more complicated projects and complex deployments.

Adding the Directory service

In the ./run.sh script we will add the command to start the Directory service.

function directory_start() {
cogment services directory --port=9005
}

Since the Directory is a service that all other services depend upon, it needs to be started first.

Here we have a few choices; we could decide to start it in a separate terminal before the other services, or we could start it in the background with the same command as starting the services. It could also be kept running all the time.

For the purpose of demonstration and simplicity we will start it in the background, so in the ./run.sh script we will -change the services_start command like this:

function services_start() {
directory_start &
sleep 3
_run_parallel orchestrator_start environment_start random_agent_start dqn_agent_start
}

Registering services to the Directory

Now that we have a directory, we need to register the services so they can be "discovered" by components. +change the services_start command like this:

function services_start() {
directory_start &
sleep 3
_run_parallel orchestrator_start environment_start random_agent_start dqn_agent_start
}

Registering services to the Directory

Now that we have a directory, we need to register the services so they can be "discovered" by components. The Cogment SDK and CLI know how to use a directory and will register themselves if possible. To make it possible, the components need to know the network address of the directory. -This can be provided on an individual basis at the code level, e.g.:

  context = cogment.Context(cog_settings=cog_settings, user_id="rps", directory_endpoint="grpc://localhost:9005")

For the CLI it can be provided on the command line, e.g.:

$ cogment services orchestrator --directory_endpoint="grpc://localhost:9005"

But the easiest way is to set the environment variable COGMENT_DIRECTORY_ENDPOINT, which is what we will do here by -adding it to the ./.env file. And while we are there, we will parametrize the directory port for better maintainability:

DIRECTORY_PORT=9005
COGMENT_DIRECTORY_ENDPOINT="grpc://localhost:${DIRECTORY_PORT}"

and in ./run.sh we update the directory start command like this:

function directory_start() {
_load_dot_env
cogment services directory --port="${DIRECTORY_PORT}"
}
note

In special circumstances, which we don't need for this tutorial, components can be registered explicitly with the +This can be provided on an individual basis at the code level, e.g.:

  context = cogment.Context(cog_settings=cog_settings, user_id="rps", directory_endpoint="grpc://localhost:9005")

For the CLI it can be provided on the command line, e.g.:

$ cogment services orchestrator --directory_endpoint="grpc://localhost:9005"

But the easiest way is to set the environment variable COGMENT_DIRECTORY_ENDPOINT, which is what we will do here by +adding it to the ./.env file. And while we are there, we will parametrize the directory port for better maintainability:

DIRECTORY_PORT=9005
COGMENT_DIRECTORY_ENDPOINT="grpc://localhost:${DIRECTORY_PORT}"

and in ./run.sh we update the directory start command like this:

function directory_start() {
_load_dot_env
cogment services directory --port="${DIRECTORY_PORT}"
}
note

In special circumstances, which we don't need for this tutorial, components can be registered explicitly with the Directory client CLI.

Discovering services from the Directory

We have a directory, and the services are registered in that directory, but for it to be useful, we need to "discover" these services. This is done by providing Cogment with discovery endpoints -instead grpc endpoints (i.e. network addresses).

Let's start with the Trial Runner (./trial_runner/main.py), we'll change the endpoint variables to context discovery endpoints like this:

ORCHESTRATOR_ENDPOINT = "cogment://discover"
ENVIRONMENT_ENDPOINT = "cogment://discover"
RANDOM_AGENT_ENDPOINT = "cogment://discover"
DQN_AGENT_ENDPOINT = "cogment://discover"

How is Cogment differentiating and finding the right service? This is done by using the context where the endpoint is provided, thus the name "context" discovery endpoint. Endpoints can also be "explicit" discovery endpoints, in which case they don't use the context in which they are used; all the information is in the endpoint explicitly (since we consider the context information to be implicit).

An example of context information can be seen here where the orchestrator endpoint is given:

controller = await context.get_controller(endpoint=cogment.Endpoint("cogment://discover"))

The cogment://discover string does not contain anything to say that this is for an orchestrator. -But because it is given to the get_controller parameter which requires an orchestrator endpoint, Cogment has the context that this is an endpoint to communicate with an orchestrator, so it will use this fact (i.e. this must be an endpoint for an orchestrator) to inquire the directory. In other words, it matters where a context discovery endpoint is used.

We can also simplify the code even further because the method get_controller has a default endpoint parameter, and the default value for a cogment.Endpoint is a pure context discovery endpoint (i.e. "cogment://discover"), so we can change it like this:

controller = await context.get_controller()

Which means that we don't need the ORCHESTRATOR_ENDPOINT variable anymore, and we'll remove that from the Trial Runner file. +instead grpc endpoints (i.e. network addresses).

Let's start with the Trial Runner (./trial_runner/main.py), we'll change the endpoint variables to context discovery endpoints like this:

ORCHESTRATOR_ENDPOINT = "cogment://discover"
ENVIRONMENT_ENDPOINT = "cogment://discover"
RANDOM_AGENT_ENDPOINT = "cogment://discover"
DQN_AGENT_ENDPOINT = "cogment://discover"

How is Cogment differentiating and finding the right service? This is done by using the context where the endpoint is provided, thus the name "context" discovery endpoint. Endpoints can also be "explicit" discovery endpoints, in which case they don't use the context in which they are used; all the information is in the endpoint explicitly (since we consider the context information to be implicit).

An example of context information can be seen here where the orchestrator endpoint is given:

controller = await context.get_controller(endpoint=cogment.Endpoint("cogment://discover"))

The cogment://discover string does not contain anything to say that this is for an orchestrator. +But because it is given to the get_controller parameter which requires an orchestrator endpoint, Cogment has the context that this is an endpoint to communicate with an orchestrator, so it will use this fact (i.e. this must be an endpoint for an orchestrator) to inquire the directory. In other words, it matters where a context discovery endpoint is used.

We can also simplify the code even further because the method get_controller has a default endpoint parameter, and the default value for a cogment.Endpoint is a pure context discovery endpoint (i.e. "cogment://discover"), so we can change it like this:

controller = await context.get_controller()

Which means that we don't need the ORCHESTRATOR_ENDPOINT variable anymore, and we'll remove that from the Trial Runner file. Then we also don't need the ORCHESTRATOR_HOST environment variable, and we'll remove that from the ./.env file. Note that we still want to keep the ORCHESTRATOR_PORT environment variable to centralize the port selection for our different services, it just makes it easier to maintain our project.

Now we do the same (still in the Trial Runner file) for the environment; we remove the ENVIRONMENT_ENDPOINT variable, and -since the environment also has a pure context discovery default endpoint, we can remove it:

trial_params=cogment.TrialParameters(
cog_settings,
environment_name="env",
environment_config=environment_config,
actors=[
actor_1_params,
actor_2_params,
]
)

And we remove the ENVIRONMENT_HOST environment variable from the ./.env file.

And finally for the actors... But wait a second, we have multiple actors, how is Cogment to differentiate them? +since the environment also has a pure context discovery default endpoint, we can remove it:

trial_params=cogment.TrialParameters(
cog_settings,
environment_name="env",
environment_config=environment_config,
actors=[
actor_1_params,
actor_2_params,
]
)

And we remove the ENVIRONMENT_HOST environment variable from the ./.env file.

And finally for the actors... But wait a second, we have multiple actors, how is Cogment to differentiate them? In this case, it is easy, the context for actors has three elements: that it is an "actor, its actor class, and its implementation name (note that the environment also has an implementation name in its context, but here we only have one environment, so there is no confusion). Since all our actors have different implementation names, then the context is sufficient to uniquely identify our actors. So we do the same here as we did for the environment, and again the default endpoint for actors is a context discovery -endpoint, so we can remove it, getting:

actor_1_params = cogment.ActorParameters(
cog_settings,
name="player_1",
class_name="player",
implementation="dqn_agent"
)
actor_2_params = cogment.ActorParameters(
cog_settings,
name="player_2",
class_name="player",
implementation="heuristic_agent"
)

and the final ./.env file looks like this:

ORCHESTRATOR_PORT=9000
ENVIRONMENT_PORT=9001
RANDOM_AGENT_PORT=9002
DQN_AGENT_PORT=9003
DIRECTORY_PORT=9005
COGMENT_DIRECTORY_ENDPOINT="grpc://localhost:${DIRECTORY_PORT}"
note

In cases when the context would not be enough to differentiate between services, the directory allows properties to be +endpoint, so we can remove it, getting:

actor_1_params = cogment.ActorParameters(
cog_settings,
name="player_1",
class_name="player",
implementation="dqn_agent"
)
actor_2_params = cogment.ActorParameters(
cog_settings,
name="player_2",
class_name="player",
implementation="heuristic_agent"
)

and the final ./.env file looks like this:

ORCHESTRATOR_PORT=9000
ENVIRONMENT_PORT=9001
RANDOM_AGENT_PORT=9002
DQN_AGENT_PORT=9003
DIRECTORY_PORT=9005
COGMENT_DIRECTORY_ENDPOINT="grpc://localhost:${DIRECTORY_PORT}"
note

In cases when the context would not be enough to differentiate between services, the directory allows properties to be added to registered services (e.g. for actors, as parameters to the Context.register_actor method), and these properties can be added to a context discovery endpoint (e.g. cogment://discover?tag=red&zone=1).

Special case for Client Actors

In step 5 and 6 of the tutorial we had a client actor. Client actors are effectively not services and thus don't register themselves in the directory. They could be explicitly registered using the CLI if it could simplify things, but for the purpose of this tutorial, it is not useful. On the other hand, the way a client actor joins a trial is simplified when there is a directory. -Instead of something like this:

await context.join_trial(trial_id=trial_id, endpoint=cogment.Endpoint(ORCHESTRATOR_ENDPOINT), actor_name="player_1")

Because, again, the endpoint parameter has a default context discovery endpoint, this would suffice:

await context.join_trial(trial_id=trial_id, actor_name="player_1")

Authentication Token

All directory communications require an Authentication Token. By default, this is empty, but it can be set to any string and used in many situations. One case that is useful is to isolate different running projects, when there is only a single directory that is always running. The easiest way to do this is to add this environment variable to the ./.env file:

COGMENT_DIRECTORY_AUTHENTICATION_TOKEN="project-tutorial-8"

Then all registrations will use this authentication token and all inquiries will require this authentication token +Instead of something like this:

await context.join_trial(trial_id=trial_id, endpoint=cogment.Endpoint(ORCHESTRATOR_ENDPOINT), actor_name="player_1")

Because, again, the endpoint parameter has a default context discovery endpoint, this would suffice:

await context.join_trial(trial_id=trial_id, actor_name="player_1")

Authentication Token

All directory communications require an Authentication Token. By default, this is empty, but it can be set to any string and used in many situations. One case that is useful is to isolate different running projects, when there is only a single directory that is always running. The easiest way to do this is to add this environment variable to the ./.env file:

COGMENT_DIRECTORY_AUTHENTICATION_TOKEN="project-tutorial-8"

Then all registrations will use this authentication token and all inquiries will require this authentication token (i.e. only services that were registered with this authentication token will be found).

Step 8.5: Using Cogment environment variables

In this step we'll use the Cogment environment variables to simplify management of the project. -So we will add these environment variables to the ./.env file:

COGMENT_DIRECTORY_PORT=9005
COGMENT_LIFECYCLE_PORT=9000
COGMENT_ACTOR_PORT=9000

and remove the tutorial specifc variables, which leaves us with a ./.env file that looks like this:

# Local (tutorial specific) variables
ENVIRONMENT_PORT=9001
RANDOM_AGENT_PORT=9002
DQN_AGENT_PORT=9003

# Cogment environment variables
COGMENT_LIFECYCLE_PORT=9000
COGMENT_ACTOR_PORT=9000
COGMENT_DIRECTORY_PORT=9005
COGMENT_DIRECTORY_ENDPOINT="grpc://localhost:${COGMENT_DIRECTORY_PORT}"
COGMENT_DIRECTORY_AUTHENTICATION_TOKEN="project-tutorial-8"

With this, these two commands in the ./run.sh file are simplified to:

function directory_start() {
_load_dot_env
cogment services directory
}

function orchestrator_start() {
_load_dot_env
cogment services orchestrator
}
- - +So we will add these environment variables to the ./.env file:

COGMENT_DIRECTORY_PORT=9005
COGMENT_LIFECYCLE_PORT=9000
COGMENT_ACTOR_PORT=9000

and remove the tutorial specifc variables, which leaves us with a ./.env file that looks like this:

# Local (tutorial specific) variables
ENVIRONMENT_PORT=9001
RANDOM_AGENT_PORT=9002
DQN_AGENT_PORT=9003

# Cogment environment variables
COGMENT_LIFECYCLE_PORT=9000
COGMENT_ACTOR_PORT=9000
COGMENT_DIRECTORY_PORT=9005
COGMENT_DIRECTORY_ENDPOINT="grpc://localhost:${COGMENT_DIRECTORY_PORT}"
COGMENT_DIRECTORY_AUTHENTICATION_TOKEN="project-tutorial-8"

With this, these two commands in the ./run.sh file are simplified to:

function directory_start() {
_load_dot_env
cogment services directory
}

function orchestrator_start() {
_load_dot_env
cogment services orchestrator
}
+ + \ No newline at end of file diff --git a/docs/guide/tutorial/advanced-tutorials/human-player.html b/docs/guide/tutorial/advanced-tutorials/human-player.html index 86ae8cd..1d6145c 100644 --- a/docs/guide/tutorial/advanced-tutorials/human-player.html +++ b/docs/guide/tutorial/advanced-tutorials/human-player.html @@ -1,21 +1,21 @@ - + - + Add a Human Player in the Loop | Cogment - - - + + +
-

Add a Human Player in the Loop

note

This part of the tutorial follows step 4, make sure you've gone through it before starting this one. Alternatively the completed step 4 can be retrieved from the tutorial's repository.

In this step of the tutorial, we will go over another actor implementation, this time client-side, to enable Humans to play RPS.

Client actor implementation

To involve a human player in our trials, we will add a specific actor implementation in the client. While the previous service actor implementations are exposing endpoints Cogment's orchestrator connects to in order to run a trial, this client actor implementation connects to the orchestrator to join a trial. It changes a lot under the hood and enables interesting network topology because only the client needs to know how to reach the orchestrator, not the other way around. However, as you'll see, in terms of implementation it is very similar.

This actor implementation will be located in the client code in client/main.py

We first need to import the data structures needed to send actions.

from data_pb2 import PlayerAction, ROCK, PAPER, SCISSORS

MOVES = [ROCK, PAPER, SCISSORS]
MOVES_STR = ["👊 rock", "✋ paper", "✌️ scissors"]
MOVES_PROMPT = ', '.join([ f"{name} ({idx})" for idx, name in enumerate(MOVES_STR)])

In the main function we then implement the human_player actor implementation, only playing PAPER for the moment, register the implementation and join the trial once it is initialized.

context = cogment.Context(cog_settings=cog_settings, user_id="rps")

async def human_player(actor_session):
round_index = 0

actor_session.start()

async for event in actor_session.all_events():
if event.observation:
observation = event.observation

if event.type == cogment.EventType.ACTIVE:
print(f"\n-- Round #{round_index + 1} --\n")

next_action = PlayerAction(move=PAPER)
actor_session.do_action(next_action)

round_index += 1

context.register_actor(
impl=human_player,
impl_name="human",
actor_classes=["player"])

We update the configuration of the first actor to use special endpoint, "cogment://client", which tells the orchestrator to wait for a client to connect to it. We also don't need to specify an implementation name.

actor_1_params = cogment.ActorParameters(
cog_settings,
name="player_1",
class_name="player",
endpoint="cogment://client"
)

Because the client actor will be active during the trial, we no longer need to use watch_trials to await trial termination but simply need to await context.join_trial completion.

# Defining the trial id on the client side
trial_id=f"rps-{datetime.datetime.now().isoformat()}"

# Start a new trial using the trial params we just created
trial_id = await controller.start_trial(trial_id_requested=trial_id, trial_params=trial_params)
print(f"Trial '{trial_id}' started")

# Let the human actor join the trial
await context.join_trial(trial_id=trial_id, endpoint=cogment.Endpoint(ORCHESTRATOR_ENDPOINT), actor_name="player_1")
print(f"Trial '{trial_id}' ended")

Modify the client/main.py file with these updates.

You can now build and run the application. Everything should work but player 1 shouldn't fare too well as it only ever plays PAPER.

Interactive prompt to let Humans play RPS

Let's add a text user interface to our client in order to finally challenge AIs to a game of RPS.

First we'll want to display what was played in the previous round. We will implement a dedicated function print_observation.

def print_observation(observation):
print(f"🧑 played {MOVES_STR[observation.observation.me.last_move]}")
print(f"🤖 played {MOVES_STR[observation.observation.them.last_move]}")
if observation.observation.me.won_last:
print(f" -> 🧑 wins round #{round_index + 1}")
elif observation.observation.them.won_last:
print(f" -> 🤖 wins the round #{round_index + 1}")
else:
print(f" -> round #{round_index + 1} is a draw")

It needs to be called whenever the actor receives an observation, except for the first time, before the first round is played. Add the following just after the observation is retrieved in the event loop.

if round_index > 0:
# The only time the observation is not relevant is on the first round of the first game
print_observation(observation)

Last but not least, instead of always picking PAPER we will read from the keyboard input what the player wishes to play. Using python's input function we can print a prompt and read whatever the user enters before pressing <ENTER>.

Note that the following implementation expects a number between 1 and 3 and doesn't handle well any other input.

move = MOVES[int(input(MOVES_PROMPT))]
next_action = PlayerAction(move=move)

Modify the client/main.py file to include the above additions.

You can now build and run the application. You'll be presented with a prompt for choosing your moves and comparing your skills to the simple heuristic AI we implemented earlier.

This concludes the step 5 of the tutorial: you implemented your first client actor and put your first human in the loop! This is also the final step for the basics tutorial.

You can continue by implementing a web client to replace the command line interface we just developed in step 6.

- - +

Add a Human Player in the Loop

note

This part of the tutorial follows step 4, make sure you've gone through it before starting this one. Alternatively the completed step 4 can be retrieved from the tutorial's repository.

In this step of the tutorial, we will go over another actor implementation, this time client-side, to enable Humans to play RPS.

Client actor implementation

To involve a human player in our trials, we will add a specific actor implementation in the client. While the previous service actor implementations are exposing endpoints Cogment's orchestrator connects to in order to run a trial, this client actor implementation connects to the orchestrator to join a trial. It changes a lot under the hood and enables interesting network topology because only the client needs to know how to reach the orchestrator, not the other way around. However, as you'll see, in terms of implementation it is very similar.

This actor implementation will be located in the client code in client/main.py

We first need to import the data structures needed to send actions.

from data_pb2 import PlayerAction, ROCK, PAPER, SCISSORS

MOVES = [ROCK, PAPER, SCISSORS]
MOVES_STR = ["👊 rock", "✋ paper", "✌️ scissors"]
MOVES_PROMPT = ', '.join([ f"{name} ({idx})" for idx, name in enumerate(MOVES_STR)])

In the main function we then implement the human_player actor implementation, only playing PAPER for the moment, register the implementation and join the trial once it is initialized.

context = cogment.Context(cog_settings=cog_settings, user_id="rps")

async def human_player(actor_session):
round_index = 0

actor_session.start()

async for event in actor_session.all_events():
if event.observation:
observation = event.observation

if event.type == cogment.EventType.ACTIVE:
print(f"\n-- Round #{round_index + 1} --\n")

next_action = PlayerAction(move=PAPER)
actor_session.do_action(next_action)

round_index += 1

context.register_actor(
impl=human_player,
impl_name="human",
actor_classes=["player"])

We update the configuration of the first actor to use special endpoint, "cogment://client", which tells the orchestrator to wait for a client to connect to it. We also don't need to specify an implementation name.

actor_1_params = cogment.ActorParameters(
cog_settings,
name="player_1",
class_name="player",
endpoint="cogment://client"
)

Because the client actor will be active during the trial, we no longer need to use watch_trials to await trial termination but simply need to await context.join_trial completion.

# Defining the trial id on the client side
trial_id=f"rps-{datetime.datetime.now().isoformat()}"

# Start a new trial using the trial params we just created
trial_id = await controller.start_trial(trial_id_requested=trial_id, trial_params=trial_params)
print(f"Trial '{trial_id}' started")

# Let the human actor join the trial
await context.join_trial(trial_id=trial_id, endpoint=cogment.Endpoint(ORCHESTRATOR_ENDPOINT), actor_name="player_1")
print(f"Trial '{trial_id}' ended")

Modify the client/main.py file with these updates.

You can now build and run the application. Everything should work but player 1 shouldn't fare too well as it only ever plays PAPER.

Interactive prompt to let Humans play RPS

Let's add a text user interface to our client in order to finally challenge AIs to a game of RPS.

First we'll want to display what was played in the previous round. We will implement a dedicated function print_observation.

def print_observation(observation):
print(f"🧑 played {MOVES_STR[observation.observation.me.last_move]}")
print(f"🤖 played {MOVES_STR[observation.observation.them.last_move]}")
if observation.observation.me.won_last:
print(f" -> 🧑 wins round #{round_index + 1}")
elif observation.observation.them.won_last:
print(f" -> 🤖 wins the round #{round_index + 1}")
else:
print(f" -> round #{round_index + 1} is a draw")

It needs to be called whenever the actor receives an observation, except for the first time, before the first round is played. Add the following just after the observation is retrieved in the event loop.

if round_index > 0:
# The only time the observation is not relevant is on the first round of the first game
print_observation(observation)

Last but not least, instead of always picking PAPER we will read from the keyboard input what the player wishes to play. Using python's input function we can print a prompt and read whatever the user enters before pressing <ENTER>.

Note that the following implementation expects a number between 1 and 3 and doesn't handle well any other input.

move = MOVES[int(input(MOVES_PROMPT))]
next_action = PlayerAction(move=move)

Modify the client/main.py file to include the above additions.

You can now build and run the application. You'll be presented with a prompt for choosing your moves and comparing your skills to the simple heuristic AI we implemented earlier.

This concludes the step 5 of the tutorial: you implemented your first client actor and put your first human in the loop! This is also the final step for the basics tutorial.

You can continue by implementing a web client to replace the command line interface we just developed in step 6.

+ + \ No newline at end of file diff --git a/docs/guide/tutorial/advanced-tutorials/web-client.html b/docs/guide/tutorial/advanced-tutorials/web-client.html index 9a9113b..007b3bb 100644 --- a/docs/guide/tutorial/advanced-tutorials/web-client.html +++ b/docs/guide/tutorial/advanced-tutorials/web-client.html @@ -1,21 +1,21 @@ - + - + Add a Web Client for the Human Player | Cogment - - - + + +
-

Add a Web Client for the Human Player

note

This part of the tutorial follows step 5, make sure you've gone through it before starting this one. Alternatively the completed step 5 can be retrieved from the tutorial's repository.

In this step of the tutorial, we will go over a web client implementation, to enable Humans to play RPS, while being able to take advantage of various web technologies.

Prerequisites

To develop a web client, we will need a working installation of Node.js, version 14 or later. You can download and install this from: https://nodejs.org/en/download/

The web client

In the previous steps, we triggered the trials by running ./run.sh trial_runner_start. This launched a trial using code in trial_runner/main.py. In this step we will trigger a trial using a React web app.

Before we start with the Cogment side of things, we'll need to get a few prerequisite files setup.

Creating a React app

First, we will initialize a React app. This can be done very simply by running from the root rps folder:

npx create-react-app web_client

Once this is done, we will be able to open a React app in our browser by running the following commands:

cd web_client
npm start

Adding Material UI

We will be using Material UI for this web client. This will provide us with a nice and clean way to add styles to our application, as well as some components which we will use to reduce code size.

Install Material UI by running the following commands from inside of the web_client folder:

npm install @mui/material @emotion/react @emotion/styled
npm install @mui/icons-material
note

Due to the nature of create-react-app when installed using the npx command, the resulting installation will always utilize the latest version of React. This may cause dependecy issues when installing Material UI. As such, whenever such issues are encountered, please refer to the Material UI documentation to confirm the correct required version of React.

Update the run script

In this tutorial we will add a new service that builds and serves the web clients. We will also need to configure the orchestrator to expose its services to the web client using grpcweb.

tip

Cogment internally relies on grpcwebproxy to allow its grpc endpoints to be utilized by web applications. Web applications cannot natively use the grpc protocol that all Cogment modules use to communicate with one another. Using this proxy to translate the web socket connections it accepts into grpc requests solves this issue.

We will need to update the run.sh script and the .env file to do that.

note

The run.sh script that we use for this tutorial is a helpful way to build services and run them, you can take inspiration from it in your own projects.

To prepare for the additional service, let's add the following environment variables to the .env file:

ORCHESTRATOR_HTTP_PORT=9003 # This is the port that orchestrator will listen on for grpcweb connections.
WEB_CLIENT_PORT=8000 # This is the port that the web client will listen on.

In the ./run.sh script we will add two new commands to build and start the web client:

function web_client_build() {
_load_dot_env # Load the environment variables from the dotenv file
cp "${ROOT_DIR}/data.proto" "${ROOT_DIR}/cogment.yaml" "${ROOT_DIR}/web_client" # Copy the spec and protobuf files
cd "${ROOT_DIR}/web_client"
npm install # Install dependencies
npx cogment-js-sdk-generate cogment.yaml # Run the code generation phase
}

function web_client_start() {
_load_dot_env
export PORT="${WEB_CLIENT_PORT}" # Define the PORT the web client will use
export REACT_APP_ORCHESTRATOR_HTTP_ENDPOINT="http://${ORCHESTRATOR_HOST}:${ORCHESTRATOR_HTTP_PORT}" # Define the endpoint it will connect to
cd "${ROOT_DIR}/web_client"
npm start
}

We will also need to pass additional parameters to cogment when starting the orchestrator to enable the grpcweb server and to specifiy the trial parameters. The latter is needed because contrary to clients using the python sdk, web clients can't specify the trial parameters directly.

function orchestrator_start() {
_load_dot_env
cogment services orchestrator \
--actor_port="${ORCHESTRATOR_PORT}" \
--lifecycle_port="${ORCHESTRATOR_PORT}" \
--actor_web_port="${ORCHESTRATOR_HTTP_PORT}" \
--params="./params.yaml"
}

Finally in this file, we will add the web client build to the build command.

function build() {
_run_sequence client_build environment_build random_agent_build web_client_build
}

The parameters file

The parameters file is a .yaml file that specifies the default trial parameters to Cogment. In this tutorial, we will use the following parameters:

trial_params:
environment:
endpoint: grpc://localhost:9001

actors:
- name: player_1
actor_class: player
endpoint: cogment://client
- name: player_2
actor_class: player
implementation: heuristic_agent
endpoint: grpc://localhost:9002

Create a params.yaml file in the root folder with the previous content.

Adding Cogment to our web client

The easiest way to add Cogment to any web client is to start with a React app, then follow the three steps below:

  1. Install the Javascript SDK and typescript using:

    npm install @cogment/cogment-js-sdk
    npm install --save-dev typescript

    while inside of the web_client folder

  2. Copy the hooks folder from the tutorial's repository, found at 6-web-client/web_client/src/, into your src folder.

  3. Navigate nack to the rps folder then run the following command to generate Javascript files from your trial specs:

    ./run.sh web_client_build

Now that all that's done, we can finally start coding our web client!

CODE

NOTE: For each of the following files, we will provide the styles in a code block. Feel free to skip these, or make your own; they are not important to the function of this application.

index.js / index.css

When we created our React app, these two files were generated automatically. Replace their content with the following:

NOTE: These can also be downloaded from the tutorial's repository.

index.css:

body {
margin: 0;
background-color: #c5cce8;
}

index.js

import React from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import { App } from "./App";
import {
createTheme,
responsiveFontSizes,
ThemeProvider,
} from "@mui/material/styles";

let theme = createTheme({
palette: {
primary: {
light: "#c5cce8",
main: "#6B80C4",
},
secondary: {
main: "#ffb400",
},
},
});

theme = responsiveFontSizes(theme);

const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
<React.StrictMode>
<ThemeProvider theme={theme}>
<App />
</ThemeProvider>
</React.StrictMode>
);

This is simply to provide styles to our Material UI components. We haven't started with the actual Cogment part yet, which is exactly what we'll be doing next.

App.js

We'll start with a few imports. Some of these files don't exist yet, so we'll be creating them:

//First is some React imports
import React, { useEffect } from "react";

//Then some imports for icons and Material UI functionality we'll be using
import { Box, Button, Typography } from "@mui/material";
import { useTheme } from "@mui/material/styles";

//And here's the important part: we're importing the two things that will allow us to use Cogment.

//First, the 'useActions' hook which will give us our observations as a human agent, as well as allow us to send actions.
import { useActions } from "./hooks/useActions";

//Second, our 'cogSettings'. This is a file that was generated when we ran
//`npx cogment-js-sdk-generate cogment.yaml`
//This file tells our web client relevant information about our trials, environments, and actor classes.
import { cogSettings } from "./CogSettings";

//These are messages which were defined in data.proto. These imports will need to change whenever their corresponding messages in data.proto are changed and `npx cogment-js-sdk-generate cogment.yaml` is run.
import { rps as PB } from "./data_pb";

Then we add a function that will convert the play, encoded as the same "move" enum that we defined in our data.proto, to a string we can use in our application:

function getMoveText(move) {
switch (move) {
case 0:
return "rock";
case 1:
return "paper";
case 2:
return "scissors";
default:
throw new Error("Not a rock, paper, or scissors");
}
}

Finally, the React component.

At the start of this component is the most important part of our application: the useAction hook.

This hook returns an array with 3 elements:

  • event: this contains all the information about any observation, reward, or message we've received this tick. We will use this to see what plays we and the computer made.

  • startTrial: this is a function which takes no arguments, and is a very simple way to start a new trial with our player actor.

  • sendAction: this is a function which takes an argument of type 'Action'. This class can be imported from data_pb.js, but we'll see that later in this tutorial.

This hook takes in 3 arguments:

  • cogSettings: this is what's imported from CogSettings.js. It provides all the relevant information about data.proto to this hook so that it can function.

  • actorName: the name of the human actor which this web client will be representing. It should be aligned with what's defined in params.yaml.

  • actorClass: the class of the human actor which this web client will be representing. It should be aligned with what's defined in params.yaml.

export const App = () => {
const [event, startTrial, sendAction] = useActions(
cogSettings,
"player_1",
"player"
);

//Function to construct the Action which the player will send when they click either rock, paper, or scissors
const choose = (move) => {
const action = new PB.PlayerAction({
move,
});
sendAction(action);
};

//This will start a trial as soon as we're connected to the orchestrator
useEffect(() => {
if (startTrial) startTrial();
}, [startTrial]);

//Get any observation from the current event, events have observations, messages, and rewards, and all three can be unpacked from the event object
//We will also unpack a helpful variable called 'last', this will allow us to know when the trial has ended
const { observation, last } = event;

const [gameState, setGameState] = useState({
gameStage: "start",
roundIndex: 0,
lastMoveComputer: 0,
lastMoveHuman: 0,
});
const [firstObservation, setFirstObservation] = useState(true);

useEffect(() => {
//Parse game state out of the observation
//Some events don't contain an observation, so we need to store the observation contents in a state
if (!observation) return;

//The first observation is not useful, as it just contains the default game state, before players have made moves
if (firstObservation) {
setFirstObservation(false);
return;
}

//Get all relevant information from the observation
const roundIndex = gameState.roundIndex + 1;
const gameStage = "playing";
const lastMoveComputer = observation.them.lastMove;
const lastMoveHuman = observation.me.lastMove;
const lastWonComputer = observation.them.wonLast;
const lastWonHuman = observation.me.wonLast;

setGameState({
gameStage,
roundIndex,
lastMoveComputer,
lastMoveHuman,
lastWonComputer,
lastWonHuman,
});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [observation]);

//The layout of the page
return (
<Box>
{/*
Tell the player everything we know about the trial state, such as, plays, who won, etc...
*/}
<Typography>Game stage: {gameState.gameStage}</Typography>
<Typography>
Human's move:{" "}
{gameState.gameStage !== "start" &&
getMoveText(gameState.lastMoveHuman)}
</Typography>
<Typography>
Computer's move:{" "}
{gameState.gameStage !== "start" &&
getMoveText(gameState.lastMoveComputer)}
</Typography>
<Typography>
Did Human win last round?{" "}
{observation && gameState.lastWonHuman ? "Yes" : "No"}
</Typography>
<Typography>
Did Computer win last round?{" "}
{observation && gameState.lastWonComputer ? "Yes" : "No"}
</Typography>
<Button onClick={() => choose(0)}>Rock</Button>
<Button onClick={() => choose(1)}>Paper</Button>
<Button onClick={() => choose(2)}>Scissors</Button>
</Box>
);
};

hooks/useActions.js

This hook does multiple things. It starts a trial, joins a trial, sends actions, and receives information from the orchestrator. The following is its annotated code:

import { Context } from "@cogment/cogment-js-sdk";
import { useEffect, useState } from "react";

export const useActions = (cogSettings, actorName, actorClass) => {
const [event, setEvent] = useState({
observation: null,
actions: null,
messages: null,
rewards: null,
type: null,
last: false,
});

const [startTrial, setStartTrial] = useState(null);
const [sendAction, setSendAction] = useState(null);

//Set up the connection and register the actor only once, regardless of re-rendering
useEffect(() => {
const context = new Context(cogSettings, actorName);

context.registerActor(
async (actorSession) => {
actorSession.start();

//Double arrow function here beause react will turn a single one into a lazy loaded function
setSendAction(() => (action) => {
actorSession.doAction(action);
});

for await (const event of actorSession.eventLoop()) {
const eventUseActions = event;

eventUseActions.last = event.type === 3;

setEvent(eventUseActions);
}
},
actorName,
actorClass
);

const endpoint = process.env.REACT_APP_ORCHESTRATOR_HTTP_ENDPOINT;
const controller = context.getController(endpoint);

//Need to output a function so that the user can start the trial when all actors are connected
//Again, double arrow function cause react will turn a single one into a lazy loaded function
setStartTrial(() => async () => {
const trialId = await controller.startTrial();
await context.joinTrial(trialId, endpoint, actorName);
});
}, [cogSettings, actorName, actorClass]);

return [event, startTrial, sendAction];
};

We also need to create web_client/.eslintignore and add the following to it to ignore checks on the generate files:

src/*_pb*
src/cog_settings*

You can now see our app fully functional running the following commands in the rps folder:

./run.sh build
./run.sh services_start

In another terminal, start the web client:

 ./run.sh web_client_start

And opening up <localhost:8000> in our browser.

And with that we're done!

Making it look good

If we want a fancier interface, there is a completed UI in the tutorials repository that we can copy into our project. Then, along with some style code that can be found in the repository version of App.js, just replace the return statement from App.js with the following:

<Box>
<Header observation={observation} gameState={gameState} />
<Container className={classes.container}>
<Player
score={humanScore}
color={theme.palette.primary.main}
IconClass={PersonIcon}
choose={choose}
isHuman
/>

<Player
score={computerScore}
color={theme.palette.secondary.main}
IconClass={ComputerIcon}
selected={
gameState !== "start" &&
getMoveText(observation.them.lastRoundMove)
}
/>
</Container>
</Box>
- - +

Add a Web Client for the Human Player

note

This part of the tutorial follows step 5, make sure you've gone through it before starting this one. Alternatively the completed step 5 can be retrieved from the tutorial's repository.

In this step of the tutorial, we will go over a web client implementation, to enable Humans to play RPS, while being able to take advantage of various web technologies.

Prerequisites

To develop a web client, we will need a working installation of Node.js, version 14 or later. You can download and install this from: https://nodejs.org/en/download/

The web client

In the previous steps, we triggered the trials by running ./run.sh trial_runner_start. This launched a trial using code in trial_runner/main.py. In this step we will trigger a trial using a React web app.

Before we start with the Cogment side of things, we'll need to get a few prerequisite files setup.

Creating a React app

First, we will initialize a React app. This can be done very simply by running from the root rps folder:

npx create-react-app web_client

Once this is done, we will be able to open a React app in our browser by running the following commands:

cd web_client
npm start

Adding Material UI

We will be using Material UI for this web client. This will provide us with a nice and clean way to add styles to our application, as well as some components which we will use to reduce code size.

Install Material UI by running the following commands from inside of the web_client folder:

npm install @mui/material @emotion/react @emotion/styled
npm install @mui/icons-material
note

Due to the nature of create-react-app when installed using the npx command, the resulting installation will always utilize the latest version of React. This may cause dependecy issues when installing Material UI. As such, whenever such issues are encountered, please refer to the Material UI documentation to confirm the correct required version of React.

Update the run script

In this tutorial we will add a new service that builds and serves the web clients. We will also need to configure the orchestrator to expose its services to the web client using grpcweb.

tip

Cogment internally relies on grpcwebproxy to allow its grpc endpoints to be utilized by web applications. Web applications cannot natively use the grpc protocol that all Cogment modules use to communicate with one another. Using this proxy to translate the web socket connections it accepts into grpc requests solves this issue.

We will need to update the run.sh script and the .env file to do that.

note

The run.sh script that we use for this tutorial is a helpful way to build services and run them, you can take inspiration from it in your own projects.

To prepare for the additional service, let's add the following environment variables to the .env file:

ORCHESTRATOR_HTTP_PORT=9003 # This is the port that orchestrator will listen on for grpcweb connections.
WEB_CLIENT_PORT=8000 # This is the port that the web client will listen on.

In the ./run.sh script we will add two new commands to build and start the web client:

function web_client_build() {
_load_dot_env # Load the environment variables from the dotenv file
cp "${ROOT_DIR}/data.proto" "${ROOT_DIR}/cogment.yaml" "${ROOT_DIR}/web_client" # Copy the spec and protobuf files
cd "${ROOT_DIR}/web_client"
npm install # Install dependencies
npx cogment-js-sdk-generate cogment.yaml # Run the code generation phase
}

function web_client_start() {
_load_dot_env
export PORT="${WEB_CLIENT_PORT}" # Define the PORT the web client will use
export REACT_APP_ORCHESTRATOR_HTTP_ENDPOINT="http://${ORCHESTRATOR_HOST}:${ORCHESTRATOR_HTTP_PORT}" # Define the endpoint it will connect to
cd "${ROOT_DIR}/web_client"
npm start
}

We will also need to pass additional parameters to cogment when starting the orchestrator to enable the grpcweb server and to specifiy the trial parameters. The latter is needed because contrary to clients using the python sdk, web clients can't specify the trial parameters directly.

function orchestrator_start() {
_load_dot_env
cogment services orchestrator \
--actor_port="${ORCHESTRATOR_PORT}" \
--lifecycle_port="${ORCHESTRATOR_PORT}" \
--actor_web_port="${ORCHESTRATOR_HTTP_PORT}" \
--params="./params.yaml"
}

Finally in this file, we will add the web client build to the build command.

function build() {
_run_sequence client_build environment_build random_agent_build web_client_build
}

The parameters file

The parameters file is a .yaml file that specifies the default trial parameters to Cogment. In this tutorial, we will use the following parameters:

trial_params:
environment:
endpoint: grpc://localhost:9001

actors:
- name: player_1
actor_class: player
endpoint: cogment://client
- name: player_2
actor_class: player
implementation: heuristic_agent
endpoint: grpc://localhost:9002

Create a params.yaml file in the root folder with the previous content.

Adding Cogment to our web client

The easiest way to add Cogment to any web client is to start with a React app, then follow the three steps below:

  1. Install the Javascript SDK and typescript using:

    npm install @cogment/cogment-js-sdk
    npm install --save-dev typescript

    while inside of the web_client folder

  2. Copy the hooks folder from the tutorial's repository, found at 6-web-client/web_client/src/, into your src folder.

  3. Navigate nack to the rps folder then run the following command to generate Javascript files from your trial specs:

    ./run.sh web_client_build

Now that all that's done, we can finally start coding our web client!

CODE

NOTE: For each of the following files, we will provide the styles in a code block. Feel free to skip these, or make your own; they are not important to the function of this application.

index.js / index.css

When we created our React app, these two files were generated automatically. Replace their content with the following:

NOTE: These can also be downloaded from the tutorial's repository.

index.css:

body {
margin: 0;
background-color: #c5cce8;
}

index.js

import React from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import { App } from "./App";
import {
createTheme,
responsiveFontSizes,
ThemeProvider,
} from "@mui/material/styles";

let theme = createTheme({
palette: {
primary: {
light: "#c5cce8",
main: "#6B80C4",
},
secondary: {
main: "#ffb400",
},
},
});

theme = responsiveFontSizes(theme);

const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
<React.StrictMode>
<ThemeProvider theme={theme}>
<App />
</ThemeProvider>
</React.StrictMode>
);

This is simply to provide styles to our Material UI components. We haven't started with the actual Cogment part yet, which is exactly what we'll be doing next.

App.js

We'll start with a few imports. Some of these files don't exist yet, so we'll be creating them:

//First is some React imports
import React, { useEffect } from "react";

//Then some imports for icons and Material UI functionality we'll be using
import { Box, Button, Typography } from "@mui/material";
import { useTheme } from "@mui/material/styles";

//And here's the important part: we're importing the two things that will allow us to use Cogment.

//First, the 'useActions' hook which will give us our observations as a human agent, as well as allow us to send actions.
import { useActions } from "./hooks/useActions";

//Second, our 'cogSettings'. This is a file that was generated when we ran
//`npx cogment-js-sdk-generate cogment.yaml`
//This file tells our web client relevant information about our trials, environments, and actor classes.
import { cogSettings } from "./CogSettings";

//These are messages which were defined in data.proto. These imports will need to change whenever their corresponding messages in data.proto are changed and `npx cogment-js-sdk-generate cogment.yaml` is run.
import { rps as PB } from "./data_pb";

Then we add a function that will convert the play, encoded as the same "move" enum that we defined in our data.proto, to a string we can use in our application:

function getMoveText(move) {
switch (move) {
case 0:
return "rock";
case 1:
return "paper";
case 2:
return "scissors";
default:
throw new Error("Not a rock, paper, or scissors");
}
}

Finally, the React component.

At the start of this component is the most important part of our application: the useAction hook.

This hook returns an array with 3 elements:

  • event: this contains all the information about any observation, reward, or message we've received this tick. We will use this to see what plays we and the computer made.

  • startTrial: this is a function which takes no arguments, and is a very simple way to start a new trial with our player actor.

  • sendAction: this is a function which takes an argument of type 'Action'. This class can be imported from data_pb.js, but we'll see that later in this tutorial.

This hook takes in 3 arguments:

  • cogSettings: this is what's imported from CogSettings.js. It provides all the relevant information about data.proto to this hook so that it can function.

  • actorName: the name of the human actor which this web client will be representing. It should be aligned with what's defined in params.yaml.

  • actorClass: the class of the human actor which this web client will be representing. It should be aligned with what's defined in params.yaml.

export const App = () => {
const [event, startTrial, sendAction] = useActions(
cogSettings,
"player_1",
"player"
);

//Function to construct the Action which the player will send when they click either rock, paper, or scissors
const choose = (move) => {
const action = new PB.PlayerAction({
move,
});
sendAction(action);
};

//This will start a trial as soon as we're connected to the orchestrator
useEffect(() => {
if (startTrial) startTrial();
}, [startTrial]);

//Get any observation from the current event, events have observations, messages, and rewards, and all three can be unpacked from the event object
//We will also unpack a helpful variable called 'last', this will allow us to know when the trial has ended
const { observation, last } = event;

const [gameState, setGameState] = useState({
gameStage: "start",
roundIndex: 0,
lastMoveComputer: 0,
lastMoveHuman: 0,
});
const [firstObservation, setFirstObservation] = useState(true);

useEffect(() => {
//Parse game state out of the observation
//Some events don't contain an observation, so we need to store the observation contents in a state
if (!observation) return;

//The first observation is not useful, as it just contains the default game state, before players have made moves
if (firstObservation) {
setFirstObservation(false);
return;
}

//Get all relevant information from the observation
const roundIndex = gameState.roundIndex + 1;
const gameStage = "playing";
const lastMoveComputer = observation.them.lastMove;
const lastMoveHuman = observation.me.lastMove;
const lastWonComputer = observation.them.wonLast;
const lastWonHuman = observation.me.wonLast;

setGameState({
gameStage,
roundIndex,
lastMoveComputer,
lastMoveHuman,
lastWonComputer,
lastWonHuman,
});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [observation]);

//The layout of the page
return (
<Box>
{/*
Tell the player everything we know about the trial state, such as, plays, who won, etc...
*/}
<Typography>Game stage: {gameState.gameStage}</Typography>
<Typography>
Human's move:{" "}
{gameState.gameStage !== "start" &&
getMoveText(gameState.lastMoveHuman)}
</Typography>
<Typography>
Computer's move:{" "}
{gameState.gameStage !== "start" &&
getMoveText(gameState.lastMoveComputer)}
</Typography>
<Typography>
Did Human win last round?{" "}
{observation && gameState.lastWonHuman ? "Yes" : "No"}
</Typography>
<Typography>
Did Computer win last round?{" "}
{observation && gameState.lastWonComputer ? "Yes" : "No"}
</Typography>
<Button onClick={() => choose(0)}>Rock</Button>
<Button onClick={() => choose(1)}>Paper</Button>
<Button onClick={() => choose(2)}>Scissors</Button>
</Box>
);
};

hooks/useActions.js

This hook does multiple things. It starts a trial, joins a trial, sends actions, and receives information from the orchestrator. The following is its annotated code:

import { Context } from "@cogment/cogment-js-sdk";
import { useEffect, useState } from "react";

export const useActions = (cogSettings, actorName, actorClass) => {
const [event, setEvent] = useState({
observation: null,
actions: null,
messages: null,
rewards: null,
type: null,
last: false,
});

const [startTrial, setStartTrial] = useState(null);
const [sendAction, setSendAction] = useState(null);

//Set up the connection and register the actor only once, regardless of re-rendering
useEffect(() => {
const context = new Context(cogSettings, actorName);

context.registerActor(
async (actorSession) => {
actorSession.start();

//Double arrow function here beause react will turn a single one into a lazy loaded function
setSendAction(() => (action) => {
actorSession.doAction(action);
});

for await (const event of actorSession.eventLoop()) {
const eventUseActions = event;

eventUseActions.last = event.type === 3;

setEvent(eventUseActions);
}
},
actorName,
actorClass
);

const endpoint = process.env.REACT_APP_ORCHESTRATOR_HTTP_ENDPOINT;
const controller = context.getController(endpoint);

//Need to output a function so that the user can start the trial when all actors are connected
//Again, double arrow function cause react will turn a single one into a lazy loaded function
setStartTrial(() => async () => {
const trialId = await controller.startTrial();
await context.joinTrial(trialId, endpoint, actorName);
});
}, [cogSettings, actorName, actorClass]);

return [event, startTrial, sendAction];
};

We also need to create web_client/.eslintignore and add the following to it to ignore checks on the generate files:

src/*_pb*
src/cog_settings*

You can now see our app fully functional running the following commands in the rps folder:

./run.sh build
./run.sh services_start

In another terminal, start the web client:

 ./run.sh web_client_start

And opening up <localhost:8000> in our browser.

And with that we're done!

Making it look good

If we want a fancier interface, there is a completed UI in the tutorials repository that we can copy into our project. Then, along with some style code that can be found in the repository version of App.js, just replace the return statement from App.js with the following:

<Box>
<Header observation={observation} gameState={gameState} />
<Container className={classes.container}>
<Player
score={humanScore}
color={theme.palette.primary.main}
IconClass={PersonIcon}
choose={choose}
isHuman
/>

<Player
score={computerScore}
color={theme.palette.secondary.main}
IconClass={ComputerIcon}
selected={
gameState !== "start" &&
getMoveText(observation.them.lastRoundMove)
}
/>
</Container>
</Box>
+ + \ No newline at end of file diff --git a/docs/guide/tutorial/decision-making.html b/docs/guide/tutorial/decision-making.html index 1c9e9f9..d5bfb80 100644 --- a/docs/guide/tutorial/decision-making.html +++ b/docs/guide/tutorial/decision-making.html @@ -1,21 +1,21 @@ - + - + Step 4 - Making Decisions with Feedback | Cogment - - - + + +
-

Making Decisions with Feedback

In this step of the tutorial, we will start thinking about rewards. Rewards are a way to evaluate how an Actor performs at a task. They can be used to evaluate or compare different implementations of an Actor, or, especially in the context of Reinforcement Learning, train a model. In Cogment, both the environment and other actors can evaluate an actor. Here, we will focus on sending rewards from the environment.

including feedback from the environment

Until now, the concept of game is only known to the Environment. It has no impact on the Observation and action spaces, and thus no impact on the Actor implementation. This means an actor wouldn't know that the round it currently plays is the tie breaker in a game or its very first round. As a result the actor will play every round the same way.

In this step we will allow the Environment to send rewards to the actors, and modify Bob's implementations to make use of this kind of information in gameplay and compare how it performs against Alice's implementation.

Sending Rewards to the Actors

Here, we will modify environment/main.py to include rewards when passing information to the Actors. Note that not all actions need to be rewarded. When a game is won, the Environment will add a positive reward to the winner (we chose a value of 1) and a negative reward to the loser (we chose a value of -1). Cogment also supports the notion of confidence, a weight between 0 and 1 that expresses the qualification of the reward sender in its appreciation. In this case we are applying objective rules, so we use a confidence of 1.

In the event loop, when the first player wins a game we add the following:

environment_session.add_reward(value=1, confidence=1, to=[p1.actor_name])
environment_session.add_reward(value=-1, confidence=1, to=[p2.actor_name])

When the second player wins a game we add the following:

environment_session.add_reward(value=-1, confidence=1, to=[p1.actor_name])
environment_session.add_reward(value=1, confidence=1, to=[p2.actor_name])

Modify the environment/main.py file to include the above additions.

Your Environment implementation event block should now look like this:

Environment implementation with rewards

You can now build and run the application to check that it works as expected. In particular, you should see logs relative to the reception of rewards on the Actor side.

Enabling Actors to Make Use of Information from the Environment

In this section, we will create a new Actor implementation in actors/main.py below our random_agent implementation. We'll call our new implementation heuristic_agent - it will just use a simple decision making logic for selecting an action based on the Observation it receives.

This Actor will also need to know what moves beat other moves. In the "Settings" section, add the DEFEATS we specified in the Environment:

DEFEATS = {
ROCK: PAPER,
SCISSORS: ROCK,
PAPER: SCISSORS
}

Now we can include a new Actor implementation that makes choices that utilize this knowledge. In actors/main.py add the following to the "Actor Implementation Functions" section:

async def heuristic_agent(actor_session):
# initialization
actor_session.start()

# event loop
async for event in actor_session.all_events():
if event.observation:
observation = event.observation
print(f"'{actor_session.name}' received an observation: '{observation}'")
if event.type == cogment.EventType.ACTIVE:
if observation.observation.me.won_last:
# I won the last round, let's play the same thing
actor_session.do_action(PlayerAction(move=observation.observation.me.last_move))
elif observation.observation.them.won_last:
# I lost the last round, let's play what would have won
actor_session.do_action(PlayerAction(move=DEFEATS[observation.observation.them.last_move]))
else:
# last round was a draw, let's play randomly
actor_session.do_action(PlayerAction(move=random.choice(MOVES)))
for reward in event.rewards:
print(f"'{actor_session.name}' received a reward for tick #{reward.tick_id}: {reward.value}")

# termination

This heuristic player uses a simple strategy for winning: if my last move was successful, play it again, and if it wasn't, play what would have won the last round. If the last round ended in a draw, select an action at random.

Registering a new Actor with Cogment

Before we can use this new actor, we will need to register it with Cogment.

In the main function of actors/main.py, add the following:

context.register_actor(
impl=heuristic_agent, # implementation defined above
impl_name="heuristic_agent",
actor_classes=["player",] # actor class defined in the cogment.yaml file
)

This will make Cogment aware of an actor of the player class which uses the heuristic_agent implementation. Next, let's make Bob an Actor of this type.

Modifying Bob

In trial_runner/main.py, we will need to change which type of registered Actor Bob is going to be in the game. Since we have registered this new Actor, all we need to do is change the ActorParameters for Bob. In trial_runner/main.py set the ActorParameters for the Actor named Bob to be:

actor_1_params = cogment.ActorParameters(
cog_settings,
name="Bob",
class_name="player",
endpoint=ACTORS_ENDPOINT,
implementation="heuristic_agent"
)

You can now install and run the application to check that it works. Don't expect the heuristic player to beat the random player, the nature of the game actually rewards pure randomness in the playing. However, now you have all of the tools necessary implement various strategies and see how they fare against each other. This concludes the basic tutorial for Cogment in RPS. If you'd like to try some more advanced techniques, check out the advanced tutorials.

- - +

Making Decisions with Feedback

In this step of the tutorial, we will start thinking about rewards. Rewards are a way to evaluate how an Actor performs at a task. They can be used to evaluate or compare different implementations of an Actor, or, especially in the context of Reinforcement Learning, train a model. In Cogment, both the environment and other actors can evaluate an actor. Here, we will focus on sending rewards from the environment.

including feedback from the environment

Until now, the concept of game is only known to the Environment. It has no impact on the Observation and action spaces, and thus no impact on the Actor implementation. This means an actor wouldn't know that the round it currently plays is the tie breaker in a game or its very first round. As a result the actor will play every round the same way.

In this step we will allow the Environment to send rewards to the actors, and modify Bob's implementations to make use of this kind of information in gameplay and compare how it performs against Alice's implementation.

Sending Rewards to the Actors

Here, we will modify environment/main.py to include rewards when passing information to the Actors. Note that not all actions need to be rewarded. When a game is won, the Environment will add a positive reward to the winner (we chose a value of 1) and a negative reward to the loser (we chose a value of -1). Cogment also supports the notion of confidence, a weight between 0 and 1 that expresses the qualification of the reward sender in its appreciation. In this case we are applying objective rules, so we use a confidence of 1.

In the event loop, when the first player wins a game we add the following:

environment_session.add_reward(value=1, confidence=1, to=[p1.actor_name])
environment_session.add_reward(value=-1, confidence=1, to=[p2.actor_name])

When the second player wins a game we add the following:

environment_session.add_reward(value=-1, confidence=1, to=[p1.actor_name])
environment_session.add_reward(value=1, confidence=1, to=[p2.actor_name])

Modify the environment/main.py file to include the above additions.

Your Environment implementation event block should now look like this:

Environment implementation with rewards

You can now build and run the application to check that it works as expected. In particular, you should see logs relative to the reception of rewards on the Actor side.

Enabling Actors to Make Use of Information from the Environment

In this section, we will create a new Actor implementation in actors/main.py below our random_agent implementation. We'll call our new implementation heuristic_agent - it will just use a simple decision making logic for selecting an action based on the Observation it receives.

This Actor will also need to know what moves beat other moves. In the "Settings" section, add the DEFEATS we specified in the Environment:

DEFEATS = {
ROCK: PAPER,
SCISSORS: ROCK,
PAPER: SCISSORS
}

Now we can include a new Actor implementation that makes choices that utilize this knowledge. In actors/main.py add the following to the "Actor Implementation Functions" section:

async def heuristic_agent(actor_session):
# initialization
actor_session.start()

# event loop
async for event in actor_session.all_events():
if event.observation:
observation = event.observation
print(f"'{actor_session.name}' received an observation: '{observation}'")
if event.type == cogment.EventType.ACTIVE:
if observation.observation.me.won_last:
# I won the last round, let's play the same thing
actor_session.do_action(PlayerAction(move=observation.observation.me.last_move))
elif observation.observation.them.won_last:
# I lost the last round, let's play what would have won
actor_session.do_action(PlayerAction(move=DEFEATS[observation.observation.them.last_move]))
else:
# last round was a draw, let's play randomly
actor_session.do_action(PlayerAction(move=random.choice(MOVES)))
for reward in event.rewards:
print(f"'{actor_session.name}' received a reward for tick #{reward.tick_id}: {reward.value}")

# termination

This heuristic player uses a simple strategy for winning: if my last move was successful, play it again, and if it wasn't, play what would have won the last round. If the last round ended in a draw, select an action at random.

Registering a new Actor with Cogment

Before we can use this new actor, we will need to register it with Cogment.

In the main function of actors/main.py, add the following:

context.register_actor(
impl=heuristic_agent, # implementation defined above
impl_name="heuristic_agent",
actor_classes=["player",] # actor class defined in the cogment.yaml file
)

This will make Cogment aware of an actor of the player class which uses the heuristic_agent implementation. Next, let's make Bob an Actor of this type.

Modifying Bob

In trial_runner/main.py, we will need to change which type of registered Actor Bob is going to be in the game. Since we have registered this new Actor, all we need to do is change the ActorParameters for Bob. In trial_runner/main.py set the ActorParameters for the Actor named Bob to be:

actor_1_params = cogment.ActorParameters(
cog_settings,
name="Bob",
class_name="player",
endpoint=ACTORS_ENDPOINT,
implementation="heuristic_agent"
)

You can now install and run the application to check that it works. Don't expect the heuristic player to beat the random player, the nature of the game actually rewards pure randomness in the playing. However, now you have all of the tools necessary implement various strategies and see how they fare against each other. This concludes the basic tutorial for Cogment in RPS. If you'd like to try some more advanced techniques, check out the advanced tutorials.

+ + \ No newline at end of file diff --git a/docs/guide/tutorial/environment-in-cogment.html b/docs/guide/tutorial/environment-in-cogment.html index a4479da..fd6281d 100644 --- a/docs/guide/tutorial/environment-in-cogment.html +++ b/docs/guide/tutorial/environment-in-cogment.html @@ -1,22 +1,22 @@ - + - + Step 3 - The Environment in Cogment | Cogment - - - + + +
-

The Environment: A Game of RPS

In this step of the tutorial, we will look at what is needed to define the Environment in which Actors operate. Our goal in this section is to implement the rules for how the Environment responds to the actions at each step and produces new Observations for the Actors.

What does Cogment need to know about the Environment?

The Environment is the world in which Actors will operate. In the most general terms, we can think of the Environment as being the set of all possible states the world can be in, and the rules which determine the consequences of taking specific actions in these states. For RPS, the Environment can be fully specified by setting which states are possible (the different combinations of ROCK, PAPER and SCISSORS from each Actor), and the rules for what happens when we observe each pair.

To fully specify the Environment in Cogment, we need to define what the Environment is (eg. what makes an RPS game), how computes the outcome of player actions, and where those computations are run.

To better understand how Cogment thinks of the Environment component, we use the following terminology (similar to that used for Actors):

  • The Environment Service is a designated node for taking care of the computations made by the Environment. This is where the Environment computations happen. The Environment Service is launched by environment/main.py on the TCP port set by the ENVIRONMENT_PORT variable in the .env file.
  • The Environment Implementation is the function that specifies the rules of the game. The implementation takes actions as inputs and produces observations as outputs. This is how the Environment operations work. The Environment implementation function we will use is rps_environment defined in environment/main.py

Notice that we don't use a class to define what the Environment does, as we did for the Actors. The specification is still made in the cogment.yaml file, but instead we define what an RPS game is with the EnvironmentConfig message type from the data.proto. You can look in cogment.yaml and data.proto to see, but so far the message is still empty. We will add the necessary information to the message later in this step of the tutorial.

Defining the Environment Service

Let's look at environment/main.py to see how Cogment sets up the Environment.

Registering environment service with Cogment -The code is very similar to what we saw previously for the Actor service: The main() function first initializes a context in which the Environment will be registered. When registering the Environment in the context, we use the register_environment method which takes only an implementation. Here we will use the rps_environment function (also defined in environment/main.py, more on this in a moment) as our implementation.

Then, the main() function will start the Environment service on the appropriate port, and awaits the termination of the service.

note

Ports for running services are specified in the .env file, loaded by the .run.sh script, and retrieved by the os package to make the variable available to Python. To change the port this service uses, update the.env file in the root level of the rps directory rather than changing main.py.

Defining the Environment Implementation

The implementation function, called rps_environment here, is structured similarly to the Actor's implementation.

Defining the Environment Implementation function

Similar to the Actor implementation, there are three parts to the Environment implementation:

  • The initialization block, where we can set variables that are important to know before the session starts. Later in this step of the tutorial, we will set up the initialization block to keep track of some stats about previous actions taken and which player won/lost each round.
  • The event loop, which specifies how the environment produces observations based on the Actors' actions.
  • The termination block, i.e. what happens after all the events have occurred. Here we'll use the termination block to print out some information about what happened between the players during a round of play.

As with the Actor implementation, the Environment implementation takes as an argument the Environment session, which allows the Orchestrator to manage all the data associate with the Environment's operations in the trial.

Note that the Environment implementation makes use of the Observation the data structure defined in data.proto defining the actors observation space, but so far it is just empty - we have not yet provided any data to populate the Observation message.

Implementing the rules of the game

We will first need to bring in the relevant datastructures into the environment/main.py file so that our Environment implementation can work with the same action space and can create the bservations in the format the Actors expect to receive. We can see in environment/main.py that we have already imported the Observation data structure.

If we look at the definition of the Observation message in the data.proto, we see that it stores two fields of PlayerState information: one field keeping track of the player itself and one keeping track of its opponent. This means in order to create the correct type of Observation messages, we will also need to import the PlayerState data structure to environment/main.py. We will also need to import the types of moves that can be made so that we can define the relationships between them.

In the "Imports" section at the top of the file, add the following:

from data_pb2 import PlayerState, ROCK, PAPER, SCISSORS

Next we can define a mapping between each move and the move that it defeats - this is basically all of the information necessary to establish the rules of the game. In the "Settings" section, add the following:

DEFEATS = {
ROCK: PAPER,
SCISSORS: ROCK,
PAPER: SCISSORS
}

You may have played RPS in which the winner is "best of N rounds" - for example, you must beat your opponent in 2 out of 3 rounds to win the game. We will want the Environment implementation to keep track of the number of rounds played and won by each of the two players so that we can know when to call a winner. Here we will create a simple state data structure in the rps_environment initialization block to keep track of how often each of players wins a round during the trial. Later we will set up how many successful rounds constitute winning the game. Add the following code to the initialization block of the Environment implementation function (before the event loop):

state = {
"rounds_count": 0,
"p1": {
"score": 0
},
"p2": {
"score": 0
},
}

The Initialization Block: Creating the First Observations for Each Player

When we start a Trial, each player will need an initial Observation from the Environment. The Observation message tracks what each player's last move was and whether they won or lost the previous round, so we will have to set these by hand to start. Add the following code to the initialization block:

p1_state = PlayerState(won_last=False, last_move=None)
p2_state = PlayerState(won_last=False, last_move=None)
environment_session.start([
(p1.actor_name, Observation(me=p1_state, them=p2_state)),
(p2.actor_name, Observation(me=p2_state, them=p1_state)),
])

This code does the following:

  • Sets the initial state for each of the two Actors - neither won last game nor had a last move
  • Calls for the session to start, which tells the Orchestrator to send an initial observation is sent to all actors. Each actor is given the appropriate Observation constructed with the correct initial PlayerState messages. One instance of PlayerState per player is created, each is used as the me and them state of each player's Observation

The Event Loop: Creating New Observations in Response to Player Actions

In the event loop we implement how the Environment produces the next Observations in response to the Actor's actions. We need to retrieve each player's action and determine which player won the round. Then, we update the internal state. Finally, we produce up-to-date observations for the players.

So far, we have printed the actions the Environment received from each player, but these are the PlayerAction data structures. What we actually want to work with is the .move attribute, which stores the index of the action that was taken. We'll use this move attribute to determine which of the two players wins. If the two players had the same move, nobody wins. We'll also keep track of this in our state object. Add the following code below your print statements:

# Compute who wins, if the two players had the same move, nobody wins
p1_state = PlayerState(
won_last=p1_action.move == DEFEATS[p2_action.move],
last_move=p1_action.move
)
p2_state = PlayerState(
won_last=p2_action.move == DEFEATS[p1_action.move],
last_move=p2_action.move
)

# keep track of winner/loser of each round
state["rounds_count"] += 1
if p1_state.won_last:
state["p1"]["score"] += 1
print(f"{p1.actor_name} wins!")
elif p2_state.won_last:
state["p2"]["score"] += 1
print(f"{p2.actor_name} wins!")
else:
print(f"draw.")

This code computes for each player whether they won or lost, based on how their move compared to their opponents move by the hierarchy of moves specified in the DEFEATS dictionary. We then log it in the state dictionary object defined in the initialization block.

Finally, we need to construct the new Observation from these new player states, and pass this information along to the Actors if the trial is still active (eg. if the game hasn't ended). To do this, add the following code to the event loop:

    # produce observation of updated state (computed above)
observations = [
(p1.actor_name, Observation(me=p1_state, them=p2_state)),
(p2.actor_name, Observation(me=p2_state, them=p1_state)),
]
if event.type == cogment.EventType.ACTIVE:
# The trial is active
environment_session.produce_observations(observations)
else:
# The trial termination has been requested
environment_session.end(observations)

The termination block: reporting on what happened in the game

Finally, we will add some statements to the termination block to present a read-out about what happened in the Trial. In the termination block, replace the print("environment end") with:

print(f"Trial {environment_session.get_trial_id()} ended:")
print(f"\t * {state['rounds_count']} rounds played")
print(f"\t * {p1.actor_name} won {state['p1']['score']} rounds")
print(f"\t * {p2.actor_name} won {state['p2']['score']} rounds")
print(f"\t * {state['rounds_count'] - state['p1']['score'] - state['p2']['score']} draws", flush=True)

Note we add a flush=True to the last print call to flush the data buffer so our output actually gets printed before the service gets terminated.

We now have an Environment implementation that will properly construct Observations to pass to the Actors, meaning we have fully defined all the inputs and outputs necessary for the sequential interaction between the Actor and Environment components to play rounds of RPS. However, RPS is usually played in games won by the player reaching a target score, i.e. a number of won rounds.

You can install and run the application to test your Environment implementation. Given the nature of the game and the fact that the Actors don't actually use the Observation information in any meaningful way, we expect Bob to win around 1/3 of the time, Alice to win 1/3 of the time, and the remaining 1/3 to be draws.

Configuring the Environment: How many successful rounds to win the game?

We hinted earlier that RPS is not about single, disconnected rounds, but in playing a "best of N" game. Here we will show how the Environment can be configured with parameters. Setting up the game this way will also be useful later when we make an Actor implementation that can meaningfully use the information in the Observations to pick an action with some strategy, rather than randomly.

We want to set up the Environment so that a trial is complete when one of the two players has won enough rounds. We can do this by adding a parameter to our previously empty EnvironmentConfig message in the data.proto file:

message EnvironmentConfig {
int32 target_score = 1;
}

This data structure is referenced within cogment.yaml in the environment.config_type to define how the Environment is configured (you may think of it as similar to how the Actor classes were specified in the cogment.yaml file). Note that the target_score above is just the first argument to the EnvironmentConfig message -- we will set its value when we configure the Environment for the Trial.

If we open trial_runner/main.py we will see that we pass an empty EnvironmentConfig when setting up the Environment in the Trial Runner. We can modify this function to set a value for the target_score which a player will need to reach before the game ends. Modify the EnvironmentConfig in the Trial Runner to be the following:

env_config = EnvironmentConfig(
target_score = 5
)
note

Note that whenever we make a modification to the data.proto file, we will need to re-run ./run.sh install to regenerate the data_pb2.py file which the Python SDK uses for the implementations.

Modifying the Environment Implementation to end the game

We now need to modify the Environment implementation to handle counting the number of rounds won, and executing the termination of the Trial once the target_score has been reached.

In the initialization block of the rps_environment implementation function in environment/main.py, add the following:

# Default target score
if environment_session.config is not None and environment_session.config.target_score >= 0:
target_score = environment_session.config.target_score
else:
target_score = 3

The above code retrieves the value of the target_score from the environment's configuration and sets a default value in case nothing is specified. When we configured the trial, we set the target_score to be 5, but if the environment_session doesn't have the right configuration details, the target_score will be set to 3 by the Environment itself.

We also want the Environment to request the end of the Trial when this target score has been reached. In the event block, let's modify the code which handles the end of the game (eg. replace the check that the event.type==cogment.EventType.ACTIVE) to be:

# handle end of game
if state["p1"]["score"] >= target_score:
# p1 won
environment_session.end(observations)
elif state["p2"]["score"] >= target_score:
# p2 won
environment_session.end(observations)
else:
# target score is not reached, continue sending observations to actors
environment_session.produce_observations(observations)

Modifying the Trial Runner to receive the termination signal from the Environment

Previously, the Trial Runner handled the termination of the Trial after 5 seconds. Now we want the Environment to handle the termination of the trial, so we need to modify the Trial Runner code to support this.

If we look at the trial_runner/main.py file, we will see that the Trial Runner gets the trial_id from the controller's start_trial method. Because of the asynchronous nature of how these services run, we will need to initiate a function to listen for the trial's end before we have initiated the trial start. This means we will need to know the trial_id ahead of time, so when we call start_trial we will pass it our chosen trial_id as an argument.

In trial_runner/main.py we'll change the way the Trial Runner starts the trials to the following:

# set the name of the trial we want to be listening for
trial_id=f"rps-{datetime.datetime.now().isoformat()}"

# Listening for ended trials
async def await_trial():
async for trial_info in controller.watch_trials(trial_state_filters=[cogment.TrialState.ENDED]):
if trial_info.trial_id == trial_id:
break
await_trial_task = asyncio.create_task(await_trial())

# Start a new trial using the trial params we just created
trial_id = await controller.start_trial(trial_id_requested=trial_id, trial_params=trial_params)
print(f"Trial '{trial_id}' started")

# Wait for the trial to end
await await_trial_task
print(f"Trial '{trial_id}' ended")

The above code sets the ID of the trial, then defines how to use controller.watch_trials that will listen for the Environment to terminate the trial. It starts the trial with the specified ID, and then watches for the trial end.

We can now install and run the application to see that this works as expected. Bob and Alice play a single game of RPS which ends when one of the two players reaches the target number of rounds.

Quick Summary

We learned about how Cogment represents the Environment through its implementation and configuration.

We set up the necessary components in environment/main.py to specify the rules of RPS, namely:


from data_pb2 import PlayerState, ROCK, PAPER, SCISSORS
DEFEATS = {
ROCK: PAPER,
SCISSORS: ROCK,
PAPER: SCISSORS
}

In the initialWe added a data structure to keep track of statistics over a number of rounds:

state = {
"rounds_count": 0,
"p1": {
"score": 0
},
"p2": {
"score": 0
},
}

We constructed initial observations, and started the Environment session to pass these to each Actor:

p1_state = PlayerState(won_last=False, last_move=None)
p2_state = PlayerState(won_last=False, last_move=None)
environment_session.start([
(p1.actor_name, Observation(me=p1_state, them=p2_state)),
(p2.actor_name, Observation(me=p2_state, them=p1_state)),
])

In the event block, we evaluated what each of the Actors did, who won, and stored this information in our state data structure.

# Compute who wins, if the two players had the same move, nobody wins
p1_state = PlayerState(
won_last=p1_action.move == DEFEATS[p2_action.move],
last_move=p1_action.move
)
p2_state = PlayerState(
won_last=p2_action.move == DEFEATS[p1_action.move],
last_move=p2_action.move
)

# keep track of winner/loser of each round
state["rounds_count"] += 1
if p1_state.won_last:
state["p1"]["score"] += 1
print(f"{p1.actor_name} wins!")
elif p2_state.won_last:
state["p2"]["score"] += 1
print(f"{p2.actor_name} wins!")
else:
print(f"draw.")

We constructed new Observations and had the Environment session pass this information to each Actor.

    # produce observation of updated state (computed above)
observations = [
(p1.actor_name, Observation(me=p1_state, them=p2_state)),
(p2.actor_name, Observation(me=p2_state, them=p1_state)),
]
if event.type == cogment.EventType.ACTIVE:
# The trial is active
environment_session.produce_observations(observations)
else:
# The trial termination has been requested
environment_session.end(observations)

In the termination block, we printed a summary of the rounds played up to the point of termination:

print(f"Trial {environment_session.get_trial_id()} ended:")
print(f"\t * {state['rounds_count']} rounds played")
print(f"\t * {p1.actor_name} won {state['p1']['score']} rounds")
print(f"\t * {p2.actor_name} won {state['p2']['score']} rounds")
print(f"\t * {state['rounds_count'] - state['p1']['score'] - state['p2']['score']} draws", flush=True)

We then set up the Environment to initiate the termination after a set number of rounds had been won by one of the players. We set the EnvironmentConfig in the data.proto:

message EnvironmentConfig {
int32 target_score = 1;
}

We made use of this in trial_runner/main.py and passed the correct value to the EnvironmentConfigL

env_config = EnvironmentConfig(
target_score = 5
)

We then changed the Environment implementation to be aware of the termination condition, or set one if none was provided:

# Default target score
if environment_session.config is not None and environment_session.config.target_score >= 0:
target_score = environment_session.config.target_score
else:
target_score = 3

We then set the Environment to end the trial when this condition was met:

# handle end of game
if state["p1"]["score"] >= target_score:
# p1 won
environment_session.end(observations)
elif state["p2"]["score"] >= target_score:
# p2 won
environment_session.end(observations)
else:
# target score is not reached, continue sending observations to actors
environment_session.produce_observations(observations)

Finally, we modified the Trial Runner to listen for end signal from the Environment:

# set the name of the trial we want to be listening for
trial_id=f"rps-{datetime.datetime.now().isoformat()}"

# Listening for ended trials
async def await_trial():
async for trial_info in controller.watch_trials(trial_state_filters=[cogment.TrialState.ENDED]):
if trial_info.trial_id == trial_id:
break
await_trial_task = asyncio.create_task(await_trial())

# Start a new trial using the trial params we just created
trial_id = await controller.start_trial(trial_id_requested=trial_id, trial_params=trial_params)
print(f"Trial '{trial_id}' started")

# Wait for the trial to end
await await_trial_task
print(f"Trial '{trial_id}' ended")

You have now successfully implemented an Environment which is configured to run a game of RPS until one player has won 5 rounds. The Environment receives the Actors' actions and constructs new Observations. However, since the Actors select actions at random, they are not really using the Observation information in any meaningful way. In the next step of the tutorial, we will modify Bob to use the information from the Environment to select actions and see how he performs against Alice.

- - +

The Environment: A Game of RPS

In this step of the tutorial, we will look at what is needed to define the Environment in which Actors operate. Our goal in this section is to implement the rules for how the Environment responds to the actions at each step and produces new Observations for the Actors.

What does Cogment need to know about the Environment?

The Environment is the world in which Actors will operate. In the most general terms, we can think of the Environment as being the set of all possible states the world can be in, and the rules which determine the consequences of taking specific actions in these states. For RPS, the Environment can be fully specified by setting which states are possible (the different combinations of ROCK, PAPER and SCISSORS from each Actor), and the rules for what happens when we observe each pair.

To fully specify the Environment in Cogment, we need to define what the Environment is (eg. what makes an RPS game), how computes the outcome of player actions, and where those computations are run.

To better understand how Cogment thinks of the Environment component, we use the following terminology (similar to that used for Actors):

  • The Environment Service is a designated node for taking care of the computations made by the Environment. This is where the Environment computations happen. The Environment Service is launched by environment/main.py on the TCP port set by the ENVIRONMENT_PORT variable in the .env file.
  • The Environment Implementation is the function that specifies the rules of the game. The implementation takes actions as inputs and produces observations as outputs. This is how the Environment operations work. The Environment implementation function we will use is rps_environment defined in environment/main.py

Notice that we don't use a class to define what the Environment does, as we did for the Actors. The specification is still made in the cogment.yaml file, but instead we define what an RPS game is with the EnvironmentConfig message type from the data.proto. You can look in cogment.yaml and data.proto to see, but so far the message is still empty. We will add the necessary information to the message later in this step of the tutorial.

Defining the Environment Service

Let's look at environment/main.py to see how Cogment sets up the Environment.

Registering environment service with Cogment +The code is very similar to what we saw previously for the Actor service: The main() function first initializes a context in which the Environment will be registered. When registering the Environment in the context, we use the register_environment method which takes only an implementation. Here we will use the rps_environment function (also defined in environment/main.py, more on this in a moment) as our implementation.

Then, the main() function will start the Environment service on the appropriate port, and awaits the termination of the service.

note

Ports for running services are specified in the .env file, loaded by the .run.sh script, and retrieved by the os package to make the variable available to Python. To change the port this service uses, update the.env file in the root level of the rps directory rather than changing main.py.

Defining the Environment Implementation

The implementation function, called rps_environment here, is structured similarly to the Actor's implementation.

Defining the Environment Implementation function

Similar to the Actor implementation, there are three parts to the Environment implementation:

  • The initialization block, where we can set variables that are important to know before the session starts. Later in this step of the tutorial, we will set up the initialization block to keep track of some stats about previous actions taken and which player won/lost each round.
  • The event loop, which specifies how the environment produces observations based on the Actors' actions.
  • The termination block, i.e. what happens after all the events have occurred. Here we'll use the termination block to print out some information about what happened between the players during a round of play.

As with the Actor implementation, the Environment implementation takes as an argument the Environment session, which allows the Orchestrator to manage all the data associate with the Environment's operations in the trial.

Note that the Environment implementation makes use of the Observation the data structure defined in data.proto defining the actors observation space, but so far it is just empty - we have not yet provided any data to populate the Observation message.

Implementing the rules of the game

We will first need to bring in the relevant datastructures into the environment/main.py file so that our Environment implementation can work with the same action space and can create the bservations in the format the Actors expect to receive. We can see in environment/main.py that we have already imported the Observation data structure.

If we look at the definition of the Observation message in the data.proto, we see that it stores two fields of PlayerState information: one field keeping track of the player itself and one keeping track of its opponent. This means in order to create the correct type of Observation messages, we will also need to import the PlayerState data structure to environment/main.py. We will also need to import the types of moves that can be made so that we can define the relationships between them.

In the "Imports" section at the top of the file, add the following:

from data_pb2 import PlayerState, ROCK, PAPER, SCISSORS

Next we can define a mapping between each move and the move that it defeats - this is basically all of the information necessary to establish the rules of the game. In the "Settings" section, add the following:

DEFEATS = {
ROCK: PAPER,
SCISSORS: ROCK,
PAPER: SCISSORS
}

You may have played RPS in which the winner is "best of N rounds" - for example, you must beat your opponent in 2 out of 3 rounds to win the game. We will want the Environment implementation to keep track of the number of rounds played and won by each of the two players so that we can know when to call a winner. Here we will create a simple state data structure in the rps_environment initialization block to keep track of how often each of players wins a round during the trial. Later we will set up how many successful rounds constitute winning the game. Add the following code to the initialization block of the Environment implementation function (before the event loop):

state = {
"rounds_count": 0,
"p1": {
"score": 0
},
"p2": {
"score": 0
},
}

The Initialization Block: Creating the First Observations for Each Player

When we start a Trial, each player will need an initial Observation from the Environment. The Observation message tracks what each player's last move was and whether they won or lost the previous round, so we will have to set these by hand to start. Add the following code to the initialization block:

p1_state = PlayerState(won_last=False, last_move=None)
p2_state = PlayerState(won_last=False, last_move=None)
environment_session.start([
(p1.actor_name, Observation(me=p1_state, them=p2_state)),
(p2.actor_name, Observation(me=p2_state, them=p1_state)),
])

This code does the following:

  • Sets the initial state for each of the two Actors - neither won last game nor had a last move
  • Calls for the session to start, which tells the Orchestrator to send an initial observation is sent to all actors. Each actor is given the appropriate Observation constructed with the correct initial PlayerState messages. One instance of PlayerState per player is created, each is used as the me and them state of each player's Observation

The Event Loop: Creating New Observations in Response to Player Actions

In the event loop we implement how the Environment produces the next Observations in response to the Actor's actions. We need to retrieve each player's action and determine which player won the round. Then, we update the internal state. Finally, we produce up-to-date observations for the players.

So far, we have printed the actions the Environment received from each player, but these are the PlayerAction data structures. What we actually want to work with is the .move attribute, which stores the index of the action that was taken. We'll use this move attribute to determine which of the two players wins. If the two players had the same move, nobody wins. We'll also keep track of this in our state object. Add the following code below your print statements:

# Compute who wins, if the two players had the same move, nobody wins
p1_state = PlayerState(
won_last=p1_action.move == DEFEATS[p2_action.move],
last_move=p1_action.move
)
p2_state = PlayerState(
won_last=p2_action.move == DEFEATS[p1_action.move],
last_move=p2_action.move
)

# keep track of winner/loser of each round
state["rounds_count"] += 1
if p1_state.won_last:
state["p1"]["score"] += 1
print(f"{p1.actor_name} wins!")
elif p2_state.won_last:
state["p2"]["score"] += 1
print(f"{p2.actor_name} wins!")
else:
print(f"draw.")

This code computes for each player whether they won or lost, based on how their move compared to their opponents move by the hierarchy of moves specified in the DEFEATS dictionary. We then log it in the state dictionary object defined in the initialization block.

Finally, we need to construct the new Observation from these new player states, and pass this information along to the Actors if the trial is still active (eg. if the game hasn't ended). To do this, add the following code to the event loop:

    # produce observation of updated state (computed above)
observations = [
(p1.actor_name, Observation(me=p1_state, them=p2_state)),
(p2.actor_name, Observation(me=p2_state, them=p1_state)),
]
if event.type == cogment.EventType.ACTIVE:
# The trial is active
environment_session.produce_observations(observations)
else:
# The trial termination has been requested
environment_session.end(observations)

The termination block: reporting on what happened in the game

Finally, we will add some statements to the termination block to present a read-out about what happened in the Trial. In the termination block, replace the print("environment end") with:

print(f"Trial {environment_session.get_trial_id()} ended:")
print(f"\t * {state['rounds_count']} rounds played")
print(f"\t * {p1.actor_name} won {state['p1']['score']} rounds")
print(f"\t * {p2.actor_name} won {state['p2']['score']} rounds")
print(f"\t * {state['rounds_count'] - state['p1']['score'] - state['p2']['score']} draws", flush=True)

Note we add a flush=True to the last print call to flush the data buffer so our output actually gets printed before the service gets terminated.

We now have an Environment implementation that will properly construct Observations to pass to the Actors, meaning we have fully defined all the inputs and outputs necessary for the sequential interaction between the Actor and Environment components to play rounds of RPS. However, RPS is usually played in games won by the player reaching a target score, i.e. a number of won rounds.

You can install and run the application to test your Environment implementation. Given the nature of the game and the fact that the Actors don't actually use the Observation information in any meaningful way, we expect Bob to win around 1/3 of the time, Alice to win 1/3 of the time, and the remaining 1/3 to be draws.

Configuring the Environment: How many successful rounds to win the game?

We hinted earlier that RPS is not about single, disconnected rounds, but in playing a "best of N" game. Here we will show how the Environment can be configured with parameters. Setting up the game this way will also be useful later when we make an Actor implementation that can meaningfully use the information in the Observations to pick an action with some strategy, rather than randomly.

We want to set up the Environment so that a trial is complete when one of the two players has won enough rounds. We can do this by adding a parameter to our previously empty EnvironmentConfig message in the data.proto file:

message EnvironmentConfig {
int32 target_score = 1;
}

This data structure is referenced within cogment.yaml in the environment.config_type to define how the Environment is configured (you may think of it as similar to how the Actor classes were specified in the cogment.yaml file). Note that the target_score above is just the first argument to the EnvironmentConfig message -- we will set its value when we configure the Environment for the Trial.

If we open trial_runner/main.py we will see that we pass an empty EnvironmentConfig when setting up the Environment in the Trial Runner. We can modify this function to set a value for the target_score which a player will need to reach before the game ends. Modify the EnvironmentConfig in the Trial Runner to be the following:

env_config = EnvironmentConfig(
target_score = 5
)
note

Note that whenever we make a modification to the data.proto file, we will need to re-run ./run.sh install to regenerate the data_pb2.py file which the Python SDK uses for the implementations.

Modifying the Environment Implementation to end the game

We now need to modify the Environment implementation to handle counting the number of rounds won, and executing the termination of the Trial once the target_score has been reached.

In the initialization block of the rps_environment implementation function in environment/main.py, add the following:

# Default target score
if environment_session.config is not None and environment_session.config.target_score >= 0:
target_score = environment_session.config.target_score
else:
target_score = 3

The above code retrieves the value of the target_score from the environment's configuration and sets a default value in case nothing is specified. When we configured the trial, we set the target_score to be 5, but if the environment_session doesn't have the right configuration details, the target_score will be set to 3 by the Environment itself.

We also want the Environment to request the end of the Trial when this target score has been reached. In the event block, let's modify the code which handles the end of the game (eg. replace the check that the event.type==cogment.EventType.ACTIVE) to be:

# handle end of game
if state["p1"]["score"] >= target_score:
# p1 won
environment_session.end(observations)
elif state["p2"]["score"] >= target_score:
# p2 won
environment_session.end(observations)
else:
# target score is not reached, continue sending observations to actors
environment_session.produce_observations(observations)

Modifying the Trial Runner to receive the termination signal from the Environment

Previously, the Trial Runner handled the termination of the Trial after 5 seconds. Now we want the Environment to handle the termination of the trial, so we need to modify the Trial Runner code to support this.

If we look at the trial_runner/main.py file, we will see that the Trial Runner gets the trial_id from the controller's start_trial method. Because of the asynchronous nature of how these services run, we will need to initiate a function to listen for the trial's end before we have initiated the trial start. This means we will need to know the trial_id ahead of time, so when we call start_trial we will pass it our chosen trial_id as an argument.

In trial_runner/main.py we'll change the way the Trial Runner starts the trials to the following:

# set the name of the trial we want to be listening for
trial_id=f"rps-{datetime.datetime.now().isoformat()}"

# Listening for ended trials
async def await_trial():
async for trial_info in controller.watch_trials(trial_state_filters=[cogment.TrialState.ENDED]):
if trial_info.trial_id == trial_id:
break
await_trial_task = asyncio.create_task(await_trial())

# Start a new trial using the trial params we just created
trial_id = await controller.start_trial(trial_id_requested=trial_id, trial_params=trial_params)
print(f"Trial '{trial_id}' started")

# Wait for the trial to end
await await_trial_task
print(f"Trial '{trial_id}' ended")

The above code sets the ID of the trial, then defines how to use controller.watch_trials that will listen for the Environment to terminate the trial. It starts the trial with the specified ID, and then watches for the trial end.

We can now install and run the application to see that this works as expected. Bob and Alice play a single game of RPS which ends when one of the two players reaches the target number of rounds.

Quick Summary

We learned about how Cogment represents the Environment through its implementation and configuration.

We set up the necessary components in environment/main.py to specify the rules of RPS, namely:


from data_pb2 import PlayerState, ROCK, PAPER, SCISSORS
DEFEATS = {
ROCK: PAPER,
SCISSORS: ROCK,
PAPER: SCISSORS
}

In the initialWe added a data structure to keep track of statistics over a number of rounds:

state = {
"rounds_count": 0,
"p1": {
"score": 0
},
"p2": {
"score": 0
},
}

We constructed initial observations, and started the Environment session to pass these to each Actor:

p1_state = PlayerState(won_last=False, last_move=None)
p2_state = PlayerState(won_last=False, last_move=None)
environment_session.start([
(p1.actor_name, Observation(me=p1_state, them=p2_state)),
(p2.actor_name, Observation(me=p2_state, them=p1_state)),
])

In the event block, we evaluated what each of the Actors did, who won, and stored this information in our state data structure.

# Compute who wins, if the two players had the same move, nobody wins
p1_state = PlayerState(
won_last=p1_action.move == DEFEATS[p2_action.move],
last_move=p1_action.move
)
p2_state = PlayerState(
won_last=p2_action.move == DEFEATS[p1_action.move],
last_move=p2_action.move
)

# keep track of winner/loser of each round
state["rounds_count"] += 1
if p1_state.won_last:
state["p1"]["score"] += 1
print(f"{p1.actor_name} wins!")
elif p2_state.won_last:
state["p2"]["score"] += 1
print(f"{p2.actor_name} wins!")
else:
print(f"draw.")

We constructed new Observations and had the Environment session pass this information to each Actor.

    # produce observation of updated state (computed above)
observations = [
(p1.actor_name, Observation(me=p1_state, them=p2_state)),
(p2.actor_name, Observation(me=p2_state, them=p1_state)),
]
if event.type == cogment.EventType.ACTIVE:
# The trial is active
environment_session.produce_observations(observations)
else:
# The trial termination has been requested
environment_session.end(observations)

In the termination block, we printed a summary of the rounds played up to the point of termination:

print(f"Trial {environment_session.get_trial_id()} ended:")
print(f"\t * {state['rounds_count']} rounds played")
print(f"\t * {p1.actor_name} won {state['p1']['score']} rounds")
print(f"\t * {p2.actor_name} won {state['p2']['score']} rounds")
print(f"\t * {state['rounds_count'] - state['p1']['score'] - state['p2']['score']} draws", flush=True)

We then set up the Environment to initiate the termination after a set number of rounds had been won by one of the players. We set the EnvironmentConfig in the data.proto:

message EnvironmentConfig {
int32 target_score = 1;
}

We made use of this in trial_runner/main.py and passed the correct value to the EnvironmentConfigL

env_config = EnvironmentConfig(
target_score = 5
)

We then changed the Environment implementation to be aware of the termination condition, or set one if none was provided:

# Default target score
if environment_session.config is not None and environment_session.config.target_score >= 0:
target_score = environment_session.config.target_score
else:
target_score = 3

We then set the Environment to end the trial when this condition was met:

# handle end of game
if state["p1"]["score"] >= target_score:
# p1 won
environment_session.end(observations)
elif state["p2"]["score"] >= target_score:
# p2 won
environment_session.end(observations)
else:
# target score is not reached, continue sending observations to actors
environment_session.produce_observations(observations)

Finally, we modified the Trial Runner to listen for end signal from the Environment:

# set the name of the trial we want to be listening for
trial_id=f"rps-{datetime.datetime.now().isoformat()}"

# Listening for ended trials
async def await_trial():
async for trial_info in controller.watch_trials(trial_state_filters=[cogment.TrialState.ENDED]):
if trial_info.trial_id == trial_id:
break
await_trial_task = asyncio.create_task(await_trial())

# Start a new trial using the trial params we just created
trial_id = await controller.start_trial(trial_id_requested=trial_id, trial_params=trial_params)
print(f"Trial '{trial_id}' started")

# Wait for the trial to end
await await_trial_task
print(f"Trial '{trial_id}' ended")

You have now successfully implemented an Environment which is configured to run a game of RPS until one player has won 5 rounds. The Environment receives the Actors' actions and constructs new Observations. However, since the Actors select actions at random, they are not really using the Observation information in any meaningful way. In the next step of the tutorial, we will modify Bob to use the information from the Environment to select actions and see how he performs against Alice.

+ + \ No newline at end of file diff --git a/docs/guide/tutorial/setup.html b/docs/guide/tutorial/setup.html index 9304b1e..52aa3b2 100644 --- a/docs/guide/tutorial/setup.html +++ b/docs/guide/tutorial/setup.html @@ -1,21 +1,21 @@ - + - + Step 1 - An Empty Cogment Application | Cogment - - - + + +
-

Set Up the Code & Test a Trial

In this step of the tutorial, we will get the RPS code set up properly and test run a single trial. This will establish the basic working code needed for all subsequent steps of the tutorial. We will go over the components of the repository at a very high level. If any terminology is unclear, it may be useful to refer to the Core Concepts.

note

These instructions are for unix-like environments such as Linux, macOS and WSL2 on Windows.

Getting Set Up

To begin with, you'll need a working installation of Cogment. If you haven't done so already, follow our installation instructions.

Additionally, you'll need:

Cloning the RPS Source Code

If you followed the test step of the installation instructions you have probably already downloaded the sources for the tutorial from the github repository. If not, now is the time to do so.

This repository contains completed code for each step of the tutorial in separate folders. If at any point you make a mistake and can't get something working, you can copy the code from the folder corresponding to the last step you completed to get a fresh starting point.

Creating your development directory

First, let's make a new directory called rps, and set this as our working directory. Unless otherwise mentioned, all operations for the rest of the tutorial are done from the rps directory. We will then copy the code from the folder for step 1 of the tutorial from the directory 1-setup/, which contains a blank slate Cogment application as a starting point.

Execute the following commands in your terminal:

mkdir rps
cp -r <relative path to cloned repository>/basic_tutorial_steps/1-setup/ rps/
cd rps

We now have a starting point for developing the RPS project. This code copied from basic_tutorial_steps/1-setup will run an empty Cogment application with two Actors able to play RPS.

What's in this directory?

Service Directories

If we look at the elements of rps, we will see 3 directories. Each directory contains the code required for managing that service, for now contained completely in a main.py file that does all the work for that service. These services are:

  • environment/ which specifies the dynamics of the game itself (what actions are allowed, what are the consequences of those actions),
  • actors/ which specifies how the Actor(s) work -- what information they get from the environment, and how they use it for making a decision on what action to take next
  • trial_runner/ which specifies how the Actors and Environment interact within Cogment, and launches the trials to run the games of RPS.

At this stage, each module contains only the main.py files. When we build the application, more files will be copied into each directory automatically.

Configuration & Execution Files

The root of the rps directory also contains files which set the necessary configurations for running the application (.env, data.proto, and cogment.yaml), as well as the run.sh, requirements.txt and services.yaml files, which contain all the functions necessary for installing dependencies and running the Cogment project.

.env

This file is used to set environment variables. (Note that "environment" in this context refers to the operating system environment, which is not related to the concept of the Environment in the RL or Cogment context.) The variables set in this file specify configurations that are known to all parts of the application while it is running. The .env file is used in this project to specify the TCP ports through which different Cogment services (such as Actors or the Environment) can be accessed.

data.proto

In Cogment, we use Protocol Buffers to serialize data for communication across different services. In this project, the structure of these protobuf messages are defined in the file data.proto. This file does most of the heavy lifting in creating data structures in Python and setting variables to the relevant parameter values (more on this later). The application 'knows' to use the messages defined here by importing it in the cogment.yaml configuration file.

cogment.yaml

The cogment.yaml file specifies all of the details about how the trials will be implemented. In particular, this file defines what protobuf messages the Environment and Actor(s) participating in the trial will expect and use as inputs and outputs. More information about what kinds of information can/should be included in a Spec File such as cogment.yaml can be found on the Spec File reference page.

run.sh

The run.sh file acts as the main command menu for the Cogment project: it contains all of the functions necessary for building and running the code.

requirements.txt

The requirements.txt file tells the Python package manager what packages need to be installed for this project to work. If we want any non-standard Python packages to run our application, we will specify them here and the package manager will install them in the virtual environment. For now, this file specifies we only need to install the most recent version of the Cogment Python SDK.

services.yaml

The services.yaml file is passed to the Cogment CLI utility command launch. For the purposes of this tutorial, it's sufficient to understand that the contents of the services.yaml file describe a set of processes to be run in parallel - with the additional condition that once any of these processes terminate, the others will terminate as well. More information about the launch process can be found on the Launch reference page.

Building the Application

To get all this code to work together, we will need to run the install process in the run.sh file.

In your terminal run the install process with:

./run.sh install

What exactly is happening in the install?

We can understand what the install function does by taking a closer look at the run.sh file. You'll see that this function does the following:

  • Creates a virtual environment and installs Cogment and any required Python packages there
  • Runs the Cogment Python code generation tool to make the files cog_settings.py and data_pb2.py which are used by the Python SDK to know about the configurations and data structures which will be used in the application (more on this below).

Now everything is set up to start the application.

Running the Application

Now that we have built all the necessary components, we want to make sure the application can run.

We will need two terminals open:

  • A terminal to run the services. Those services are the environment, the actors, and the Cogment Orchestrator, which is responsible for coordinating the services together.
  • A terminal to run the client that connects to the services in order to run the trial. This client is the trial_runner.

We need to have the services running already before the Trial Runner can connect. In the first terminal, start the Cogment app services with the command:

./run.sh services_start

This command starts the services named in the services.yaml file. You should see something like:

services_start

In the second terminal, start the Trial Runner with the command:

./run.sh trial_runner_start

At this stage, the Trial Runner starts the trial, lets it run for a few seconds, and then terminates the trial. In the second terminal, you will see something like:

trial runner_start

In our application services terminal, this will also generate some logs reporting what happened. You should see something like this:

services running

At this point, both the action strings received by the Environment and the Observations received by the Actors are empty. In the next steps of the tutorial, we will add them in.

You can now terminate the services using ctrl+C. At this point we have a working but empty Cogment app.

Quick Summary

We got the RPS code from the github repository, and created a new directory rps to work from.

We ran

./run.sh install

to build the necessary elements to get the app up and running.

In one terminal, we started the orchestrator, environment, and actors services with:

./run.sh services_start

In a second terminal, we started the trial runner to begin a trial with:

./run.sh client_start

The client terminal printed the start and end of the trial, and the services trial reported some empty actions.

In the next step, we will look a little more closely at how Cogment represents the Actors, and enable them to select ROCK, PAPER, or SCISSORS rather than empty actions.

- - +

Set Up the Code & Test a Trial

In this step of the tutorial, we will get the RPS code set up properly and test run a single trial. This will establish the basic working code needed for all subsequent steps of the tutorial. We will go over the components of the repository at a very high level. If any terminology is unclear, it may be useful to refer to the Core Concepts.

note

These instructions are for unix-like environments such as Linux, macOS and WSL2 on Windows.

Getting Set Up

To begin with, you'll need a working installation of Cogment. If you haven't done so already, follow our installation instructions.

Additionally, you'll need:

Cloning the RPS Source Code

If you followed the test step of the installation instructions you have probably already downloaded the sources for the tutorial from the github repository. If not, now is the time to do so.

This repository contains completed code for each step of the tutorial in separate folders. If at any point you make a mistake and can't get something working, you can copy the code from the folder corresponding to the last step you completed to get a fresh starting point.

Creating your development directory

First, let's make a new directory called rps, and set this as our working directory. Unless otherwise mentioned, all operations for the rest of the tutorial are done from the rps directory. We will then copy the code from the folder for step 1 of the tutorial from the directory 1-setup/, which contains a blank slate Cogment application as a starting point.

Execute the following commands in your terminal:

mkdir rps
cp -r <relative path to cloned repository>/basic_tutorial_steps/1-setup/ rps/
cd rps

We now have a starting point for developing the RPS project. This code copied from basic_tutorial_steps/1-setup will run an empty Cogment application with two Actors able to play RPS.

What's in this directory?

Service Directories

If we look at the elements of rps, we will see 3 directories. Each directory contains the code required for managing that service, for now contained completely in a main.py file that does all the work for that service. These services are:

  • environment/ which specifies the dynamics of the game itself (what actions are allowed, what are the consequences of those actions),
  • actors/ which specifies how the Actor(s) work -- what information they get from the environment, and how they use it for making a decision on what action to take next
  • trial_runner/ which specifies how the Actors and Environment interact within Cogment, and launches the trials to run the games of RPS.

At this stage, each module contains only the main.py files. When we build the application, more files will be copied into each directory automatically.

Configuration & Execution Files

The root of the rps directory also contains files which set the necessary configurations for running the application (.env, data.proto, and cogment.yaml), as well as the run.sh, requirements.txt and services.yaml files, which contain all the functions necessary for installing dependencies and running the Cogment project.

.env

This file is used to set environment variables. (Note that "environment" in this context refers to the operating system environment, which is not related to the concept of the Environment in the RL or Cogment context.) The variables set in this file specify configurations that are known to all parts of the application while it is running. The .env file is used in this project to specify the TCP ports through which different Cogment services (such as Actors or the Environment) can be accessed.

data.proto

In Cogment, we use Protocol Buffers to serialize data for communication across different services. In this project, the structure of these protobuf messages are defined in the file data.proto. This file does most of the heavy lifting in creating data structures in Python and setting variables to the relevant parameter values (more on this later). The application 'knows' to use the messages defined here by importing it in the cogment.yaml configuration file.

cogment.yaml

The cogment.yaml file specifies all of the details about how the trials will be implemented. In particular, this file defines what protobuf messages the Environment and Actor(s) participating in the trial will expect and use as inputs and outputs. More information about what kinds of information can/should be included in a Spec File such as cogment.yaml can be found on the Spec File reference page.

run.sh

The run.sh file acts as the main command menu for the Cogment project: it contains all of the functions necessary for building and running the code.

requirements.txt

The requirements.txt file tells the Python package manager what packages need to be installed for this project to work. If we want any non-standard Python packages to run our application, we will specify them here and the package manager will install them in the virtual environment. For now, this file specifies we only need to install the most recent version of the Cogment Python SDK.

services.yaml

The services.yaml file is passed to the Cogment CLI utility command launch. For the purposes of this tutorial, it's sufficient to understand that the contents of the services.yaml file describe a set of processes to be run in parallel - with the additional condition that once any of these processes terminate, the others will terminate as well. More information about the launch process can be found on the Launch reference page.

Building the Application

To get all this code to work together, we will need to run the install process in the run.sh file.

In your terminal run the install process with:

./run.sh install

What exactly is happening in the install?

We can understand what the install function does by taking a closer look at the run.sh file. You'll see that this function does the following:

  • Creates a virtual environment and installs Cogment and any required Python packages there
  • Runs the Cogment Python code generation tool to make the files cog_settings.py and data_pb2.py which are used by the Python SDK to know about the configurations and data structures which will be used in the application (more on this below).

Now everything is set up to start the application.

Running the Application

Now that we have built all the necessary components, we want to make sure the application can run.

We will need two terminals open:

  • A terminal to run the services. Those services are the environment, the actors, and the Cogment Orchestrator, which is responsible for coordinating the services together.
  • A terminal to run the client that connects to the services in order to run the trial. This client is the trial_runner.

We need to have the services running already before the Trial Runner can connect. In the first terminal, start the Cogment app services with the command:

./run.sh services_start

This command starts the services named in the services.yaml file. You should see something like:

services_start

In the second terminal, start the Trial Runner with the command:

./run.sh trial_runner_start

At this stage, the Trial Runner starts the trial, lets it run for a few seconds, and then terminates the trial. In the second terminal, you will see something like:

trial runner_start

In our application services terminal, this will also generate some logs reporting what happened. You should see something like this:

services running

At this point, both the action strings received by the Environment and the Observations received by the Actors are empty. In the next steps of the tutorial, we will add them in.

You can now terminate the services using ctrl+C. At this point we have a working but empty Cogment app.

Quick Summary

We got the RPS code from the github repository, and created a new directory rps to work from.

We ran

./run.sh install

to build the necessary elements to get the app up and running.

In one terminal, we started the orchestrator, environment, and actors services with:

./run.sh services_start

In a second terminal, we started the trial runner to begin a trial with:

./run.sh client_start

The client terminal printed the start and end of the trial, and the services trial reported some empty actions.

In the next step, we will look a little more closely at how Cogment represents the Actors, and enable them to select ROCK, PAPER, or SCISSORS rather than empty actions.

+ + \ No newline at end of file diff --git a/docs/license.html b/docs/license.html index d00d670..f060170 100644 --- a/docs/license.html +++ b/docs/license.html @@ -1,20 +1,20 @@ - + - + Apache License | Cogment - - - + + +
-

Apache License

Version 2.0, January 2004 +

Apache License

Version 2.0, January 2004 <http://www.apache.org/licenses/>

Terms and Conditions for use, reproduction, and distribution

1. Definitions

“License” shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.

“Licensor” shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.

“Legal Entity” shall mean the union of the acting entity and all other entities @@ -115,8 +115,8 @@ sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your -accepting any such warranty or additional liability.

Copyright 2019 Artificial Intelligence Redefined

- - +accepting any such warranty or additional liability.

Copyright 2019 Artificial Intelligence Redefined

+ + \ No newline at end of file diff --git a/docs/reference/cli.html b/docs/reference/cli.html index 64dd17a..aecda33 100644 --- a/docs/reference/cli.html +++ b/docs/reference/cli.html @@ -1,22 +1,22 @@ - + - + CLI | Cogment - - - + + +
-

Command Line Interface (CLI) executable

Repository Latest Release -Latest Docker Release

The main Cogment module is a multi-platform standalone executable usable through a Command Line Interface, it is referred as the Cogment CLI.

The Cogment CLI includes the following services:

  • The Orchestrator, the heart of Cogment which executes the Trials by orchestrating the different user implemented services.
  • The Directory is the "directory" of services, where services register and can be found by clients and other services.
  • The Trial Datastore able to store and make available the data generated by the Trials.
  • The Model Registry which let's user store AI models and makes them available to actor implementations during training and in production.

Compatibility

The Cogment CLI is available for the following OSes:

  • Linux with amd64 architecture (also known as x86_64), tested on Ubuntu 18.04 and 20.04, should be compatible with most recent distributions,
  • macOS with amd64 and arm64 (Apple Silicon) architectures, tested on macOS 12, should be compatible with any macOS version >= 10.15,
  • Windows with amd64 architecture, should be compatible with any Windows version >= Windows 10 version 1809.
tip

Starting with v2.2.0, the Cogment CLI is available for Linux, macOS and Windows on x86_64.

Starting with v2.6.0, the macOS arm64 version is also available.

Installation

Installation script (compatible with linux and macOS)

This installation method is compatible with virtually any Linux distribution, macOS and WSL2 on Windows. It only requires bash and curl.

First, download the install script and make sure you can run it using

curl --silent -L https://raw.githubusercontent.com/cogment/cogment/main/install.sh --output install-cogment.sh
chmod +x install-cogment.sh

You can then download and install the latest version to /usr/local/bin using

sudo ./install-cogment.sh

Other installation methods are available, for example:

  • Install version 2.2.0
    sudo ./install-cogment.sh --version 2.2.0
  • Install prereleased version 2.3.1-beta3, useful because prereleases are not considered by default
    sudo ./install-cogment.sh --version 2.2.0
  • Download the cogment exec in the current folder, make sure it is executable but skip the installation
    ./install-cogment.sh --skip-install
  • Specify manually the arch and os
    ./install-cogment.sh --arch amd64 --os Windows

All install options can be listed using

./install-cogment.sh --help

Uninstall is as simple as running:

sudo rm $(which cogment)
tip

Yes, it is possible to install Cogment as a one-line by piping the install script to bash ... at the risk of angering your system admin.

curl --silent -L https://raw.githubusercontent.com/cogment/cogment/main/install.sh | sudo ./install-cogment.sh

Manual installation

If you are a Windows user (and also if you prefer to do a manual install), you can go through those instructions.

  1. Download the desired version from here for your platform.
  2. Copy it as cogment in a location that already belongs to your PATH (e.g. /usr/local/bin) or that you'll add to your PATH, and make sure it is executable (e.g. using chmod +x /usr/local/bin/cogment).

Docker

A Cogment docker image is available on Docker Hub. It can be retrieved with the following:

docker pull cogment/cogment
note

The docker version of Cogment is very handy for server deployment, however, because of the nature of docker, users need to take care of port forwarding and volume mounting if needed.

Unsupported platform

If your platform is not supported, add an issue including the details of your platform and do not hesitate to contact us.

Building from source

Building from sources is perfectly possible. Please refer to the build instructions for more information.

Test your installation

note

Depending on your platform and how you installed Cogment, it might be accessible as cogment, ./cogment, cogment.exe or docker run cogment/cogment. We will use cogment for the rest of this page and throughout the documentation.

With a working installation you can run the following in a terminal:

cogment version

You can then list all the commands by typing:

cogment help

or for help on each individual command:

cogment help <command>

Launching a Cogment app

note

These instructions are only compatible with unix-like environments such as Linux, macOS and WSL2 on Windows.

In order to test that your installation is fully working, run an existing Cogment app, for example one of the steps of the tutorial.

Download or clone the sources for the official Rock-Paper-Scissors (RPS) tutorial from https://github.com/cogment/cogment-tutorial-rps.

To run this example you will need to have the following installed on top of Cogment:

Once it is done, run the following in the directory you retrieved:

cd 5-human-player
./run.sh build
./run.sh services_start

The first call to ./run.sh command will copy the cogment.yaml, and every referenced proto file, to each module directory, create virtualenvs, and install the python dependencies.

The second will start Cogment and the different services for this app. In another terminal you can connect to it and play a few games of RPS against a simple AI agent.

./run.sh client_start

Congratulations, you have a working installation of Cogment! We recommend you head to the Cogment tutorial to learn how to implement this RPS app from scratch.

Troubleshooting

pipe creation failed (24): Too many open files error on macOS

On macOS, it is possible that Cogment tries to open too many file handles. In this case, you'll get an error similar to pipe creation failed (24): Too many open files.

You can access the current limit and update it using ulimit -n. The default version should be something like 256, in most cases we found that Cogment requires 2048. You can set the limit with the following command:

$ ulimit -n 2048

This command changes the limit in the current shell session. This stackexchange question discusses different ways to make the change persist.

For debugging purposes, you can inspect the open file handles using lsof. E.g. lsof -c cogment | wc -l will count the number of open file handles by Cogment processes.

- - +

Command Line Interface (CLI) executable

Repository Latest Release +Latest Docker Release

The main Cogment module is a multi-platform standalone executable usable through a Command Line Interface, it is referred as the Cogment CLI.

The Cogment CLI includes the following services:

  • The Orchestrator, the heart of Cogment which executes the Trials by orchestrating the different user implemented services.
  • The Directory is the "directory" of services, where services register and can be found by clients and other services.
  • The Trial Datastore able to store and make available the data generated by the Trials.
  • The Model Registry which let's user store AI models and makes them available to actor implementations during training and in production.

Compatibility

The Cogment CLI is available for the following OSes:

  • Linux with amd64 architecture (also known as x86_64), tested on Ubuntu 18.04 and 20.04, should be compatible with most recent distributions,
  • macOS with amd64 and arm64 (Apple Silicon) architectures, tested on macOS 12, should be compatible with any macOS version >= 10.15,
  • Windows with amd64 architecture, should be compatible with any Windows version >= Windows 10 version 1809.
tip

Starting with v2.2.0, the Cogment CLI is available for Linux, macOS and Windows on x86_64.

Starting with v2.6.0, the macOS arm64 version is also available.

Installation

Installation script (compatible with linux and macOS)

This installation method is compatible with virtually any Linux distribution, macOS and WSL2 on Windows. It only requires bash and curl.

First, download the install script and make sure you can run it using

curl --silent -L https://raw.githubusercontent.com/cogment/cogment/main/install.sh --output install-cogment.sh
chmod +x install-cogment.sh

You can then download and install the latest version to /usr/local/bin using

sudo ./install-cogment.sh

Other installation methods are available, for example:

  • Install version 2.2.0
    sudo ./install-cogment.sh --version 2.2.0
  • Install prereleased version 2.3.1-beta3, useful because prereleases are not considered by default
    sudo ./install-cogment.sh --version 2.2.0
  • Download the cogment exec in the current folder, make sure it is executable but skip the installation
    ./install-cogment.sh --skip-install
  • Specify manually the arch and os
    ./install-cogment.sh --arch amd64 --os Windows

All install options can be listed using

./install-cogment.sh --help

Uninstall is as simple as running:

sudo rm $(which cogment)
tip

Yes, it is possible to install Cogment as a one-line by piping the install script to bash ... at the risk of angering your system admin.

curl --silent -L https://raw.githubusercontent.com/cogment/cogment/main/install.sh | sudo ./install-cogment.sh

Manual installation

If you are a Windows user (and also if you prefer to do a manual install), you can go through those instructions.

  1. Download the desired version from here for your platform.
  2. Copy it as cogment in a location that already belongs to your PATH (e.g. /usr/local/bin) or that you'll add to your PATH, and make sure it is executable (e.g. using chmod +x /usr/local/bin/cogment).

Docker

A Cogment docker image is available on Docker Hub. It can be retrieved with the following:

docker pull cogment/cogment
note

The docker version of Cogment is very handy for server deployment, however, because of the nature of docker, users need to take care of port forwarding and volume mounting if needed.

Unsupported platform

If your platform is not supported, add an issue including the details of your platform and do not hesitate to contact us.

Building from source

Building from sources is perfectly possible. Please refer to the build instructions for more information.

Test your installation

note

Depending on your platform and how you installed Cogment, it might be accessible as cogment, ./cogment, cogment.exe or docker run cogment/cogment. We will use cogment for the rest of this page and throughout the documentation.

With a working installation you can run the following in a terminal:

cogment version

You can then list all the commands by typing:

cogment help

or for help on each individual command:

cogment help <command>

Launching a Cogment app

note

These instructions are only compatible with unix-like environments such as Linux, macOS and WSL2 on Windows.

In order to test that your installation is fully working, run an existing Cogment app, for example one of the steps of the tutorial.

Download or clone the sources for the official Rock-Paper-Scissors (RPS) tutorial from https://github.com/cogment/cogment-tutorial-rps.

To run this example you will need to have the following installed on top of Cogment:

Once it is done, run the following in the directory you retrieved:

cd 5-human-player
./run.sh build
./run.sh services_start

The first call to ./run.sh command will copy the cogment.yaml, and every referenced proto file, to each module directory, create virtualenvs, and install the python dependencies.

The second will start Cogment and the different services for this app. In another terminal you can connect to it and play a few games of RPS against a simple AI agent.

./run.sh client_start

Congratulations, you have a working installation of Cogment! We recommend you head to the Cogment tutorial to learn how to implement this RPS app from scratch.

Troubleshooting

pipe creation failed (24): Too many open files error on macOS

On macOS, it is possible that Cogment tries to open too many file handles. In this case, you'll get an error similar to pipe creation failed (24): Too many open files.

You can access the current limit and update it using ulimit -n. The default version should be something like 256, in most cases we found that Cogment requires 2048. You can set the limit with the following command:

$ ulimit -n 2048

This command changes the limit in the current shell session. This stackexchange question discusses different ways to make the change persist.

For debugging purposes, you can inspect the open file handles using lsof. E.g. lsof -c cogment | wc -l will count the number of open file handles by Cogment processes.

+ + \ No newline at end of file diff --git a/docs/reference/cli/directory/directory-client.html b/docs/reference/cli/directory/directory-client.html index cd2952c..0034c35 100644 --- a/docs/reference/cli/directory/directory-client.html +++ b/docs/reference/cli/directory/directory-client.html @@ -1,25 +1,25 @@ - + - + Client | Cogment - - - + + +
-

Directory Client

The Directory Client is a utility to manually access (through the command line interface) the Directory service. It can be used to register, deregister (remove) and inquire services.

Common Options

All directory clients have these options in common.

timeout

The maximum duration for the execution of the request. The duration should be specified as a sequence of numbers followed by a unit suffix: "300ms", "1.5h" or "2h45m" are valid timeouts. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".

Can be specified as:

  • a command line option, e.g. --timeout=1m,
  • an environment variable, e.g. COGMENT_CLIENT_TIMEOUT=90s,
  • its default value is 30 seconds.

directory_endpoint

Cogment endpoint of the directory service. It must be a gRPC endpoint.

Can be specified as:

  • a command line option, e.g. --directory_endpoint=grpc://foo:9005,
  • an environment variable, e.g. COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005,
  • its default value is "grpc://localhost:9005" (which is the default when running cogment services directory locally).

directory_authentication_token

Authentication token for services registered in the Directory. It is recorded in the Directory when registering a service. And a matching token must be provided to inquire for the service. An empty token is the same as no token.

Can be specified as:

  • a command line option, e.g. --directory_authentication_token=GH670ploT,
  • an environment variable, e.g. COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT,
  • it has no default value.

Directory Client Register

This command is used to register (add) a service to the Directory.

E.g.:

$ cogment client directory register --directory_endpoint="grpc://dir:9005" --host="act" --port=9030 --type="actor" --properties="__actor_class=reporter,intensity=5,high_profile"

Service ID [7722934920723] Secret [ZGi6GLe]

Output

If successful, the output is the service ID of the newly registered service, and its secret string. The secret string is necessary to deregister the service.

Command line

protocol

The protocol (URL scheme) for the service endpoint. Can only be grpc or cogment. Default: grpc.

host

The host for the service endpoint.

port

The TCP port for the service endpoint.

ssl_required

A boolean value (true/false) to indicate if SSL (encryption) is required to access the service. Default: false.

type

The service type. Can be actor, environment, prehook, datalog, lifecycle, actservice, datastore, modelregistry or other. +

Directory Client

The Directory Client is a utility to manually access (through the command line interface) the Directory service. It can be used to register, deregister (remove) and inquire services.

Common Options

All directory clients have these options in common.

timeout

The maximum duration for the execution of the request. The duration should be specified as a sequence of numbers followed by a unit suffix: "300ms", "1.5h" or "2h45m" are valid timeouts. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".

Can be specified as:

  • a command line option, e.g. --timeout=1m,
  • an environment variable, e.g. COGMENT_CLIENT_TIMEOUT=90s,
  • its default value is 30 seconds.

directory_endpoint

Cogment endpoint of the directory service. It must be a gRPC endpoint.

Can be specified as:

  • a command line option, e.g. --directory_endpoint=grpc://foo:9005,
  • an environment variable, e.g. COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005,
  • its default value is "grpc://localhost:9005" (which is the default when running cogment services directory locally).

directory_authentication_token

Authentication token for services registered in the Directory. It is recorded in the Directory when registering a service. And a matching token must be provided to inquire for the service. An empty token is the same as no token.

Can be specified as:

  • a command line option, e.g. --directory_authentication_token=GH670ploT,
  • an environment variable, e.g. COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT,
  • it has no default value.

Directory Client Register

This command is used to register (add) a service to the Directory.

E.g.:

$ cogment client directory register --directory_endpoint="grpc://dir:9005" --host="act" --port=9030 --type="actor" --properties="__actor_class=reporter,intensity=5,high_profile"

Service ID [7722934920723] Secret [ZGi6GLe]

Output

If successful, the output is the service ID of the newly registered service, and its secret string. The secret string is necessary to deregister the service.

Command line

protocol

The protocol (URL scheme) for the service endpoint. Can only be grpc or cogment. Default: grpc.

host

The host for the service endpoint.

port

The TCP port for the service endpoint.

ssl_required

A boolean value (true/false) to indicate if SSL (encryption) is required to access the service. Default: false.

type

The service type. Can be actor, environment, prehook, datalog, lifecycle, actservice, datastore, modelregistry or other. These are the same keywords used as paths in Cogment discovery endpoints.

permanent

A boolean value (true/false) to indicate if the service is to stay permanently in the directory (until explicitly deregistered). Permanent services are not checked for health or lifetime limits. Permanent services also get updated instead of being duplicated. Default: false.

properties

The properties to be associated with the service. In the form of "name=value,name=value" where the value is optional. -The names and values of properties are restricted to a limited character set (see endpoint query).

Also see special properties used by Cogment.

Directory Client Deregister

This command is used to deregister (remove/delete) a service from the Directory.

E.g.:

$ cogment client directory deregister --directory_endpoint="grpc://dir:9005" --service_id=7722934920723 --secret="ZGi6GLe"

Output

If successful, no output is produced.

Command line

service_id

The ID of the service to remove.

secret

The secret string that was returned when the service was registered.

Directory Client Inquire

This command is used to inquire (find) services in the Directory. Note that if services are not found (or the authentication token does not match), an empty list is returned, but there is no "error".

E.g.:

$ cogment client directory inquire --type="actor" --properties="intensity=5,high_profile"

[11] Services found
Service ID [7722934920723]
Endpoint [grpc://act:9030] SSL required [false]
Type [actor]
[__registration_source] = [Cogment-Command_Line]
[high_profile] = []
[intensity] = [5]
[__actor_class] = [reporter]

Output

If successful, the number of services found and the details of each service is output.

Command line

service_id

The ID of the service to find. If this is provided, the type and properties options cannot be used.

type

The service type to find. Can be actor, environment, prehook, datalog, lifecycle, actservice, datastore, modelregistry or other. +The names and values of properties are restricted to a limited character set (see endpoint query).

Also see special properties used by Cogment.

Directory Client Deregister

This command is used to deregister (remove/delete) a service from the Directory.

E.g.:

$ cogment client directory deregister --directory_endpoint="grpc://dir:9005" --service_id=7722934920723 --secret="ZGi6GLe"

Output

If successful, no output is produced.

Command line

service_id

The ID of the service to remove.

secret

The secret string that was returned when the service was registered.

Directory Client Inquire

This command is used to inquire (find) services in the Directory. Note that if services are not found (or the authentication token does not match), an empty list is returned, but there is no "error".

E.g.:

$ cogment client directory inquire --type="actor" --properties="intensity=5,high_profile"

[11] Services found
Service ID [7722934920723]
Endpoint [grpc://act:9030] SSL required [false]
Type [actor]
[__registration_source] = [Cogment-Command_Line]
[high_profile] = []
[intensity] = [5]
[__actor_class] = [reporter]

Output

If successful, the number of services found and the details of each service is output.

Command line

service_id

The ID of the service to find. If this is provided, the type and properties options cannot be used.

type

The service type to find. Can be actor, environment, prehook, datalog, lifecycle, actservice, datastore, modelregistry or other. These are the same keywords used as paths in Cogment discovery endpoints.

If this is provided, the service_id option cannot be used.

properties

The properties associated with the service to find. In the form of "name=value,name=value" where the value is optional. All properties must match (in name and value) the properties of the service for a match to occur.

If this is provided, the service_id option cannot be used.

Directory Client WaitForReady

The client will wait for a connection to the directory. -If a connection cannot be established within the timeout period, it returns an error, otherwise it returns success.

- - +If a connection cannot be established within the timeout period, it returns an error, otherwise it returns success.

+ + \ No newline at end of file diff --git a/docs/reference/cli/directory/directory-server.html b/docs/reference/cli/directory/directory-server.html index f853da3..a58ca2a 100644 --- a/docs/reference/cli/directory/directory-server.html +++ b/docs/reference/cli/directory/directory-server.html @@ -1,21 +1,21 @@ - + - + Server | Cogment - - - + + +
-

Directory Server

The Directory is an implementation of the directory gRPC service. It is the service to find other services. Typically, every other Cogment service only needs to know the address of the Directory to access anything in Cogment.

A regular health check is done on non-permanent network services to make sure they remain available (i.e. network reachable). -If a service fails the health check, it is automatically removed from the Directory.

The Directory works in tandem with the Cogment endpoints, in particular the ones with a discover host (referred as discovery endpoints).

A Directory Client is also part of the Cogment CLI to access the Directory from the command line.

Command line

The Directory is a Cogment CLI service:

$ cogment services directory --port=9005

Options

port

The TCP port where to serve the directory gRPC service. This is where the users of the Directory connect to.

Can be specified as:

  • a command line option, e.g. --port,
  • an environment variable, e.g. COGMENT_DIRECTORY_PORT,
  • default value is 9005.

grpc_reflection

Whether or not to enable gRPC reflection on the served directory endpoint.

Can be specified as:

  • a command line option, e.g. --grpc_reflection,
  • an environment variable, e.g. COGMENT_DIRECTORY_GRPC_REFLECTION=1,
  • by default, it is disabled.

log_level

Set to define the minimum level for logging. Possible values are: off, error, warning, info, debug, trace.

Can be specified as:

  • a command line option, e.g. --log_level=debug,
  • an environment variable, e.g. COGMENT_LOG_LEVEL=info,
  • default value is info.

log_file

Base file name for daily log output. The name will be suffixed with the date and a new file will be made every day. If not provided, the logs go to stdout.

Can be specified as:

  • a command line option, e.g. --log_file=./path/to/cogment.log,
  • an environment variable, e.g. COGMENT_LOG_FILE=./path/to/cogment.log,
  • default value is info.

registration_lag

The maximum number of seconds to wait before responding with no result (either due to a service not registered, or that has failed a health check). +

Directory Server

The Directory is an implementation of the directory gRPC service. It is the service to find other services. Typically, every other Cogment service only needs to know the address of the Directory to access anything in Cogment.

A regular health check is done on non-permanent network services to make sure they remain available (i.e. network reachable). +If a service fails the health check, it is automatically removed from the Directory.

The Directory works in tandem with the Cogment endpoints, in particular the ones with a discover host (referred as discovery endpoints).

A Directory Client is also part of the Cogment CLI to access the Directory from the command line.

Command line

The Directory is a Cogment CLI service:

$ cogment services directory --port=9005

Options

port

The TCP port where to serve the directory gRPC service. This is where the users of the Directory connect to.

Can be specified as:

  • a command line option, e.g. --port,
  • an environment variable, e.g. COGMENT_DIRECTORY_PORT,
  • default value is 9005.

grpc_reflection

Whether or not to enable gRPC reflection on the served directory endpoint.

Can be specified as:

  • a command line option, e.g. --grpc_reflection,
  • an environment variable, e.g. COGMENT_DIRECTORY_GRPC_REFLECTION=1,
  • by default, it is disabled.

log_level

Set to define the minimum level for logging. Possible values are: off, error, warning, info, debug, trace.

Can be specified as:

  • a command line option, e.g. --log_level=debug,
  • an environment variable, e.g. COGMENT_LOG_LEVEL=info,
  • default value is info.

log_file

Base file name for daily log output. The name will be suffixed with the date and a new file will be made every day. If not provided, the logs go to stdout.

Can be specified as:

  • a command line option, e.g. --log_file=./path/to/cogment.log,
  • an environment variable, e.g. COGMENT_LOG_FILE=./path/to/cogment.log,
  • default value is info.

registration_lag

The maximum number of seconds to wait before responding with no result (either due to a service not registered, or that has failed a health check). This can be used when components may start at slightly different time, and some components may inquire about a component that did not have time to register yet. It may also help when services sometimes go temporarily offline.

Can be specified as:

  • a command line option, e.g. --registration_lag,
  • an environment variable, e.g. COGMENT_DIRECTORY_REGISTRATION_LAG,
  • default value is 0.
note

Unserviceable services are not considered for this lag. I.e. the directory will not wait for a service to become "serviceable".

persistence_file

The file name where persistence data will be read from on start-up and stored afterward. @@ -43,8 +43,8 @@ A normal value is between 0 and 100, representing the load on the machine where the service is running. A value of 0 means that there is no load, and a value of 100 means that the machine is very loaded (and may not be able to do processing in a timely manner). The exact meaning of the value is dependent on the service reporting. -A value of 255 indicates that the machine is not fit to run any new service (and thus it is "unserviceable").

Data

The Directory maintains the following data for each service:

  • service ID: This is a numerical (64 bits unsigned integer) value generated by the Directory and assigned to the service on registration. It is unique to that service as long as it is in the Directory. Although very unlikely, it is possible for this ID to be re-used after the service is deregistered. Zero (0) is not a valid ID.
  • endpoint: It consists of four distinct information:
    • protocol: The protocol (URL scheme) for the endpoint (grpc or cogment). The cogment protocol is not considered a "network" protocol and thus will not be checked for health (network connectivity).
    • host: The host for the endpoint (e.g. somewhere.com). For the grpc protocol this represents a TCP/IP network resource; it can be a network hostname or an IP address. For the cogment protocol it must be a registered name (see cogment endpoints) and typically does not represent a network resource.
    • port: The TCP port where the registered service is providing its services. This is required for grpc protocol hosts.
    • ssl requirement: Whether the service requires an encrypted SSL connection.
  • type: The type of service. This also determines how health checks are performed on the service (i.e. which gRPC service should be used to check the health of the service).
    • client actor connection: Provides client actor gRPC API service
    • trial lifecycle management: Provides lifecycle gRPC API service
    • actor: Provides actor gRPC API service
    • environment: Provides environment gRPC API service
    • pre-hook: Provides pre-hook gRPC API service
    • datalog: Provides datalog gRPC API service
    • datastore: Provides datastore gRPC API service
    • model registry: Provides model registry gRPC API service
    • other: This type of service does not provide a gRPC API service or it is not a type of service known to Cogment. Only the ability to perform a tcp connection will be tested for health checking.
  • permanent: This determines if the service should be kept in the directory regardless of health (network connectivity). It also prevents duplication of the service in the directory (i.e. if a duplicate is registered, the service will just be updated with the new information, and keep the same ID and secret).
  • properties: This is a free form mapping of name and value strings. But Cogment may require properties of specific names for its operation, in particular for endpoint discovery. These special property names are prefixed with a double underscore (__), e.g. __implementation. Also, for proper use in Cogment, property names and values should be restricted to a limited character set (see endpoint query).
  • secret: This is a secret string that is generated by the Directory on registering a new service. It must be provided to deregister a service. There is no way to recover this value, so it must be recorded after registration.
  • authentication token: A string to authenticate users of the registered service. It is provided by the user for registration of a new service, and the same token must be provided to access (deregister or inquire) that service.
- - +A value of 255 indicates that the machine is not fit to run any new service (and thus it is "unserviceable").

Data

The Directory maintains the following data for each service:

  • service ID: This is a numerical (64 bits unsigned integer) value generated by the Directory and assigned to the service on registration. It is unique to that service as long as it is in the Directory. Although very unlikely, it is possible for this ID to be re-used after the service is deregistered. Zero (0) is not a valid ID.
  • endpoint: It consists of four distinct information:
    • protocol: The protocol (URL scheme) for the endpoint (grpc or cogment). The cogment protocol is not considered a "network" protocol and thus will not be checked for health (network connectivity).
    • host: The host for the endpoint (e.g. somewhere.com). For the grpc protocol this represents a TCP/IP network resource; it can be a network hostname or an IP address. For the cogment protocol it must be a registered name (see cogment endpoints) and typically does not represent a network resource.
    • port: The TCP port where the registered service is providing its services. This is required for grpc protocol hosts.
    • ssl requirement: Whether the service requires an encrypted SSL connection.
  • type: The type of service. This also determines how health checks are performed on the service (i.e. which gRPC service should be used to check the health of the service).
    • client actor connection: Provides client actor gRPC API service
    • trial lifecycle management: Provides lifecycle gRPC API service
    • actor: Provides actor gRPC API service
    • environment: Provides environment gRPC API service
    • pre-hook: Provides pre-hook gRPC API service
    • datalog: Provides datalog gRPC API service
    • datastore: Provides datastore gRPC API service
    • model registry: Provides model registry gRPC API service
    • other: This type of service does not provide a gRPC API service or it is not a type of service known to Cogment. Only the ability to perform a tcp connection will be tested for health checking.
  • permanent: This determines if the service should be kept in the directory regardless of health (network connectivity). It also prevents duplication of the service in the directory (i.e. if a duplicate is registered, the service will just be updated with the new information, and keep the same ID and secret).
  • properties: This is a free form mapping of name and value strings. But Cogment may require properties of specific names for its operation, in particular for endpoint discovery. These special property names are prefixed with a double underscore (__), e.g. __implementation. Also, for proper use in Cogment, property names and values should be restricted to a limited character set (see endpoint query).
  • secret: This is a secret string that is generated by the Directory on registering a new service. It must be provided to deregister a service. There is no way to recover this value, so it must be recorded after registration.
  • authentication token: A string to authenticate users of the registered service. It is provided by the user for registration of a new service, and the same token must be provided to access (deregister or inquire) that service.
+ + \ No newline at end of file diff --git a/docs/reference/cli/launch.html b/docs/reference/cli/launch.html index d6f0d57..7df1f58 100644 --- a/docs/reference/cli/launch.html +++ b/docs/reference/cli/launch.html @@ -1,48 +1,48 @@ - + - + Launch | Cogment - - - + + +
-

Launch

Launch is a utility command meant to facilitate locally launching and shutting down an entire Cogment project at once.

When launch is used, a set of processes will be launched to run in parallel, as described by a YAML definition file. +

Launch

Launch is a utility command meant to facilitate locally launching and shutting down an entire Cogment project at once.

When launch is used, a set of processes will be launched to run in parallel, as described by a YAML definition file. Once any of these processes terminates, all other ones will be terminated as well.

The order of of the script execution is undefined, which is to say that they may not start in the order they are defined, and may not always start in the same order. -Script dependency can be used if a certain order must be used.

Command line

cogment launch [options] filename [args...]

filename: Name (and path) of the YAML definition file describing the processes to launch.

options:

[-q], [--quiet]: Disable some of the output generated by the launcher. Process output is never disabled by this option. To increase the level, more "q" can be added, up to -qqq disabling all launcher generated output except errors.

args: These are arguments that will be used in variable substitution in the definition file. If some arguments start with a dash (-) a double dash (--) must be used to separate these from the launch options.

E.g.:

$ cogment launch --quiet ./launch.yaml 1000 8
$ cogment launch -qq ./launch.yaml 1000 8
$ cogment launch --quiet ./launch.yaml -- --file ./myfile --match_all

definition file

The launch definition file is a YAML formatted file where the details of the parallel processes to run are defined. +Script dependency can be used if a certain order must be used.

Command line

cogment launch [options] filename [args...]

filename: Name (and path) of the YAML definition file describing the processes to launch.

options:

[-q], [--quiet]: Disable some of the output generated by the launcher. Process output is never disabled by this option. To increase the level, more "q" can be added, up to -qqq disabling all launcher generated output except errors.

args: These are arguments that will be used in variable substitution in the definition file. If some arguments start with a dash (-) a double dash (--) must be used to separate these from the launch options.

E.g.:

$ cogment launch --quiet ./launch.yaml 1000 8
$ cogment launch -qq ./launch.yaml 1000 8
$ cogment launch --quiet ./launch.yaml -- --file ./myfile --match_all

definition file

The launch definition file is a YAML formatted file where the details of the parallel processes to run are defined. The file consists of at least a scripts top level node, and may also contain a global top level node.

Nodes

Scripts

The scripts node contains the details of the processes to run. Each node under scripts represents a process to run. -The name of the node becomes the identity of the script/process and serves to identify the process output.

Each process will run the contents of the commands list in sequence (i.e. the next command will start when the previous ends). Each command runs in an independent environment (e.g. environment variables set by one command will not be seen by the others).

E.g.:

scripts:
process_a: # The name of this process is "process_a"
commands:
- ["retrieve_db.sh"]
- ["python3", "env/main.py"]

process_b: # The name of this process is "process_b"
commands:
- ["cogment", "service", "orchestrator"]

The output will then look something like this:

2023-06-30T22:24:08Z [TRACE ] [process_a] Ready
2023-06-30T22:24:08Z [TRACE ] [process_a:(1/2)] Launch [retrieve_db.sh]
2023-06-30T22:24:08Z [TRACE ] [process_b] Ready
2023-06-30T22:24:08Z [stdout] [process_a:(1/2)] Retrieving default database...
2023-06-30T22:24:08Z [TRACE ] [process_b:(1/1)] Launch [cogment services orchestrator]
2023-06-30T22:24:08Z [stderr] [process_b:(1/1)] 2023-06-30T22:24:08Z [INFO] [cmd] starting the orchestrator service [version:2.16.0]
2023-06-30T22:24:09Z [stderr] [process_a:(1/2)] Record #2278 inconsistent
2023-06-30T22:24:12Z [stdout] [process_a:(1/2)] Database retrieved in /app/sb/
2023-06-30T22:24:12Z [TRACE ] [process_a:(1/2)] Completed
2023-06-30T22:24:12Z [TRACE ] [process_a:(2/2)] Launch [python3 env/main.py]
...

Notes:

  • "[TRACE ]" is low level information from the launcher (it could also be "[INFO ]" for more important information).
  • "[stdout]", and "[stderr]" are the output from the process.
  • "process_a" and "process_b" are the names given to the processes in the definition file.
  • "(1/2)" means that it is the first command out of two for that process.
  • The times/dates are in RFC3339 format.
Environment Variables

You can set environment variables using the environment node of the process. -These will be part of the environment of all commands in the process.

E.g:

scripts:
orchestrator:
environment:
COGMENT_ORCHESTRATOR_ACTOR_PORT: 9000
COGMENT_LIFECYCLE_PORT: 9000
commands:
- ["cogment", "services", "orchestrator"]
Working folder

By default, the current working folder is set to the folder containing the launch definition file (not the folder where the Launch command is executed). -You can change the working folder with the folder node for each process.

E.g.:

# Definition file is in "/home/user"
scripts:
actor_alpha:
folder: ./actors/alpha # Working folder is "/home/user/actors/alpha"
commands:
- ["python3", "main.py"]
Quiet

You can control the process output by setting this value to True or False. +The name of the node becomes the identity of the script/process and serves to identify the process output.

Each process will run the contents of the commands list in sequence (i.e. the next command will start when the previous ends). Each command runs in an independent environment (e.g. environment variables set by one command will not be seen by the others).

E.g.:

scripts:
process_a: # The name of this process is "process_a"
commands:
- ["retrieve_db.sh"]
- ["python3", "env/main.py"]

process_b: # The name of this process is "process_b"
commands:
- ["cogment", "service", "orchestrator"]

The output will then look something like this:

2023-06-30T22:24:08Z [TRACE ] [process_a] Ready
2023-06-30T22:24:08Z [TRACE ] [process_a:(1/2)] Launch [retrieve_db.sh]
2023-06-30T22:24:08Z [TRACE ] [process_b] Ready
2023-06-30T22:24:08Z [stdout] [process_a:(1/2)] Retrieving default database...
2023-06-30T22:24:08Z [TRACE ] [process_b:(1/1)] Launch [cogment services orchestrator]
2023-06-30T22:24:08Z [stderr] [process_b:(1/1)] 2023-06-30T22:24:08Z [INFO] [cmd] starting the orchestrator service [version:2.16.0]
2023-06-30T22:24:09Z [stderr] [process_a:(1/2)] Record #2278 inconsistent
2023-06-30T22:24:12Z [stdout] [process_a:(1/2)] Database retrieved in /app/sb/
2023-06-30T22:24:12Z [TRACE ] [process_a:(1/2)] Completed
2023-06-30T22:24:12Z [TRACE ] [process_a:(2/2)] Launch [python3 env/main.py]
...

Notes:

  • "[TRACE ]" is low level information from the launcher (it could also be "[INFO ]" for more important information).
  • "[stdout]", and "[stderr]" are the output from the process.
  • "process_a" and "process_b" are the names given to the processes in the definition file.
  • "(1/2)" means that it is the first command out of two for that process.
  • The times/dates are in RFC3339 format.
Environment Variables

You can set environment variables using the environment node of the process. +These will be part of the environment of all commands in the process.

E.g:

scripts:
orchestrator:
environment:
COGMENT_ORCHESTRATOR_ACTOR_PORT: 9000
COGMENT_LIFECYCLE_PORT: 9000
commands:
- ["cogment", "services", "orchestrator"]
Working folder

By default, the current working folder is set to the folder containing the launch definition file (not the folder where the Launch command is executed). +You can change the working folder with the folder node for each process.

E.g.:

# Definition file is in "/home/user"
scripts:
actor_alpha:
folder: ./actors/alpha # Working folder is "/home/user/actors/alpha"
commands:
- ["python3", "main.py"]
Quiet

You can control the process output by setting this value to True or False. By default this is False, in which case standard process output (stdout and stderr) are also output by the launcher. -If set to True, standard process output is discarded and not output by the launcher.

E.g.:

scripts:
setup:
quiet: True
commands:
- ["python3", "setup.py"]
Dependency (Cogment >= 2.16)

Inter-process dependency can also be defined using the depends_on and ready_output nodes of the script.

The depends_on node is a list of process names that this script depends on. +If set to True, standard process output is discarded and not output by the launcher.

E.g.:

scripts:
setup:
quiet: True
commands:
- ["python3", "setup.py"]
Dependency (Cogment >= 2.16)

Inter-process dependency can also be defined using the depends_on and ready_output nodes of the script.

The depends_on node is a list of process names that this script depends on. Which means that all the listed processes must be "ready" before the current process is started.

The ready_output node is a regex (regular expression) string to search for in the output of the process. When the regex matches the output, the process is considered to be "ready". -If no regex string is provided (or the regex string is empty), the process is considered "ready" as soon as it starts.

E.g.:

scripts:
process_a:
quiet: True
commands:
- ["retrieve_db.sh"]
- ["python3", "env/main.py"]
ready_output: "^Database retrieved in"

process_b:
depends_on:
- process_a
commands:
- ["cogment", "service", "orchestrator"]

Notes:

  • It is better to use single quotes to define the regex string to prevent YAML from interpreting control characters (e.g. backslash).
  • Be aware that colors and other terminal controls (e.g. curses) in the process output can make matching difficult.
  • The version of regex currently used mostly follows Google's RE2.
  • The matching of the process output is not affected by the quiet script option.

Global (Cogment >= 2.15)

The global node contains values that have a global scope (i.e. they affect all scripts defined in the file). +If no regex string is provided (or the regex string is empty), the process is considered "ready" as soon as it starts.

E.g.:

scripts:
process_a:
quiet: True
commands:
- ["retrieve_db.sh"]
- ["python3", "env/main.py"]
ready_output: "^Database retrieved in"

process_b:
depends_on:
- process_a
commands:
- ["cogment", "service", "orchestrator"]

Notes:

  • It is better to use single quotes to define the regex string to prevent YAML from interpreting control characters (e.g. backslash).
  • Be aware that colors and other terminal controls (e.g. curses) in the process output can make matching difficult.
  • The version of regex currently used mostly follows Google's RE2.
  • The matching of the process output is not affected by the quiet script option.

Global (Cogment >= 2.15)

The global node contains values that have a global scope (i.e. they affect all scripts defined in the file). Some of these values can be overridden by the individual scripts.

Environment Variables

You can set global environment variables using the environment node under the global node. -These variables will be part of the environment of all scripts, unless overridden locally in the script's own environment node.

E.g:

global:
environment:
COGMENT_LOG_LEVEL: info
COGMENT_DIRECTORY_ENDPOINT: grpc://server:9010
Working folder

By default, the current working folder is set to the folder containing the launch definition file (not the folder where the Launch command is executed). +These variables will be part of the environment of all scripts, unless overridden locally in the script's own environment node.

E.g:

global:
environment:
COGMENT_LOG_LEVEL: info
COGMENT_DIRECTORY_ENDPOINT: grpc://server:9010
Working folder

By default, the current working folder is set to the folder containing the launch definition file (not the folder where the Launch command is executed). This can be changed with the folder node under the global node. It will then become the default folder for all scripts, unless locally changed by the script's own folder node. -Each level can also build on the previous one if the provided folder is a relative folder.

E.g.:

# Definition file is in "/home/user"
global:
folder: ./app # Default folder for all scripts is set to "/home/user/app"
scripts:
local:
folder: ./inside # Working folder is then "/home/user/app/inside"
somewhere:
folder: /home/away # Working folder is then "/home/away"

Variable substitution

You can substitute launch variables using {{.VAR}} in strings anywhere in the commands, environment or ready_output nodes of the yaml definition file. +Each level can also build on the previous one if the provided folder is a relative folder.

E.g.:

# Definition file is in "/home/user"
global:
folder: ./app # Default folder for all scripts is set to "/home/user/app"
scripts:
local:
folder: ./inside # Working folder is then "/home/user/app/inside"
somewhere:
folder: /home/away # Working folder is then "/home/away"

Variable substitution

You can substitute launch variables using {{.VAR}} in strings anywhere in the commands, environment or ready_output nodes of the yaml definition file. All environment variables when launch is started are defined as launch variables. New environment variables set in the definition file also define launch variables. -And launch defines some special variables internally also.

In the concerned strings, the double open curly brackets ("{{") delimit the start of a variable to be substituted, therefore to include a literal double open brackets in a string, you have to surround them with backticks inside substitution brackets: {{`{{`}}.

Undefined values will be replaced with <no value>.

E.g.:

$ export OWNER=Elvis
$ cogment launch ./launch.yaml
scripts:
say_hi:
environment:
Type: "How"
Question: "{{.Type}} are you?"
commands:
- ["echo", "Hello, {{.OWNER}}. {{.Question}}"] # echo "Hello, Elvis. How are you?"
- ["echo", "{{`{{`}} brackets }}"] # echo "{{ brackets }}"
- ["echo", "no val: {{.MADE_UP_VARIABLE}}"] # echo "no val: <no value>"
ready_output: "Hello, {{.OWNER}}.*"

Special Variables

The launch program will also define variables that can be used in substitutions. +And launch defines some special variables internally also.

In the concerned strings, the double open curly brackets ("{{") delimit the start of a variable to be substituted, therefore to include a literal double open brackets in a string, you have to surround them with backticks inside substitution brackets: {{`{{`}}.

Undefined values will be replaced with <no value>.

E.g.:

$ export OWNER=Elvis
$ cogment launch ./launch.yaml
scripts:
say_hi:
environment:
Type: "How"
Question: "{{.Type}} are you?"
commands:
- ["echo", "Hello, {{.OWNER}}. {{.Question}}"] # echo "Hello, Elvis. How are you?"
- ["echo", "{{`{{`}} brackets }}"] # echo "{{ brackets }}"
- ["echo", "no val: {{.MADE_UP_VARIABLE}}"] # echo "no val: <no value>"
ready_output: "Hello, {{.OWNER}}.*"

Special Variables

The launch program will also define variables that can be used in substitutions. These internally defined variables start with a double underscore (__).

Environment variables with conflicting names will be replaced by these internal launch variables. Note that this only affects variable substitution, not the environment of the command execution. And internal launch variables are not available as environment variables.

Arguments (Cogment >= 2.15)

The arguments from the command line of launch define variables and can thus be substituted. E.g. cogment launch ./launch.yaml arg1 arg2 arg3 will define __1, __2 and __3 respectively corresponding to arg1, arg2 and arg3. They can then be substituted with {{.__1}}, {{.__2}}, {{.__3}}.

__1 to __9 are always defined, but will be empty if no corresponding argument was given on the command line. -Arguments 10 (__10) and above will only be defined if they were provided on the command line.

E.g.:

$ cogment launch -q ./launch.yaml 42 foo
scripts:
args_out:
commands:
- ["echo", "args:", "{{.__1}}", "{{.__2}}", "{{.__3}}"] # echo "args:" "42" "foo" ""
- ["echo", "empty: >{{.__3}}< >{{.__6}}<"] # echo "empty: >< ><"
- ["echo", "no args: {{.__10}} {{.__42}}"] # echo "no args: <no value> <no value>"
ready_output: ".* {{.__2}} $"
All Arguments (Cogment >= 2.17)

The number of arguments on the command line of launch is defined in __NB_ARGS. -And all the launch arguments can be added to a script command with __ALL_ARGS.

The __ALL_ARGS variable is special in terms of substitution; if the command argument string is exactly {{.__ALL_ARGS}}, then all launch arguments will be added to this command. Otherwise if it is only part of a string, it will substitute a string containing all launch arguments.

In other words, a command argument "{{.ALL_ARGS}}" will expand to multiple arguments for the command, whereas something like "--{{.ALL_ARGS}}" will stay as one argument (a string that contains all launch arguments preceded by "--").

E.g.:

$ cogment launch ./launch.yaml 42 foo extra
scripts:
args_out:
commands:
- ["echo", "nb of args: {{.__NB_ARGS}}]"] # echo "nb of args: 3"
- ["echo", "all:", "{{.__ALL_ARGS}}", "and more"] # echo "all:" "42" "foo" "extra" "and more"
- ["echo", "all:", "args: {{.__ALL_ARGS}}"] # echo "all:" "args: 42 foo extra"
ready_output: "args:.*{{.__2}}"

File Example

global:
environment:
RUN_NAME: "COGRUN-{{.HOSTNAME}}-{{.__1}}"
COGMENT_LOG_LEVEL: info
DIR_PORT: 9010
COGMENT_DIRECTORY_ENDPOINT: "grpc://server:{{.DIR_PORT}}"
folder: /app

scripts:
prep:
commands:
- ["./importdata.sh"]
- ["./cudasetup.sh"]
- ["sleep", "infinity"] # To prevent process from ending
ready_output: "^Done"
directory:
quiet: true
folder: ./cogment
environment:
COGMENT_DIRECTORY_PORT: "{{.DIR_PORT}}"
depends_on:
- prep
commands:
- ["cogment", "services", "directory"]
ready_output: 'Listening \[port:[0-9]*\]' # To match "Listening [port:9010]"
orchestrator:
folder: ./cogment
environment:
COGMENT_ORCHESTRATOR_ACTOR_PORT: 0
COGMENT_LIFECYCLE_PORT: 0
depends_on:
- directory
commands:
- ["cogment", "services", "orchestrator"]
runner:
folder: ./pycode
depends_on:
- directory
- orchestrator
commands:
- [
"python3",
"runner.py",
"-u {{.USER}}",
"-n {{.RUN_NAME}}",
"{{.__2}}",
]
report:
commands:
- ["reporting_service"]
- - +Arguments 10 (__10) and above will only be defined if they were provided on the command line.

E.g.:

$ cogment launch -q ./launch.yaml 42 foo
scripts:
args_out:
commands:
- ["echo", "args:", "{{.__1}}", "{{.__2}}", "{{.__3}}"] # echo "args:" "42" "foo" ""
- ["echo", "empty: >{{.__3}}< >{{.__6}}<"] # echo "empty: >< ><"
- ["echo", "no args: {{.__10}} {{.__42}}"] # echo "no args: <no value> <no value>"
ready_output: ".* {{.__2}} $"
All Arguments (Cogment >= 2.17)

The number of arguments on the command line of launch is defined in __NB_ARGS. +And all the launch arguments can be added to a script command with __ALL_ARGS.

The __ALL_ARGS variable is special in terms of substitution; if the command argument string is exactly {{.__ALL_ARGS}}, then all launch arguments will be added to this command. Otherwise if it is only part of a string, it will substitute a string containing all launch arguments.

In other words, a command argument "{{.ALL_ARGS}}" will expand to multiple arguments for the command, whereas something like "--{{.ALL_ARGS}}" will stay as one argument (a string that contains all launch arguments preceded by "--").

E.g.:

$ cogment launch ./launch.yaml 42 foo extra
scripts:
args_out:
commands:
- ["echo", "nb of args: {{.__NB_ARGS}}]"] # echo "nb of args: 3"
- ["echo", "all:", "{{.__ALL_ARGS}}", "and more"] # echo "all:" "42" "foo" "extra" "and more"
- ["echo", "all:", "args: {{.__ALL_ARGS}}"] # echo "all:" "args: 42 foo extra"
ready_output: "args:.*{{.__2}}"

File Example

global:
environment:
RUN_NAME: "COGRUN-{{.HOSTNAME}}-{{.__1}}"
COGMENT_LOG_LEVEL: info
DIR_PORT: 9010
COGMENT_DIRECTORY_ENDPOINT: "grpc://server:{{.DIR_PORT}}"
folder: /app

scripts:
prep:
commands:
- ["./importdata.sh"]
- ["./cudasetup.sh"]
- ["sleep", "infinity"] # To prevent process from ending
ready_output: "^Done"
directory:
quiet: true
folder: ./cogment
environment:
COGMENT_DIRECTORY_PORT: "{{.DIR_PORT}}"
depends_on:
- prep
commands:
- ["cogment", "services", "directory"]
ready_output: 'Listening \[port:[0-9]*\]' # To match "Listening [port:9010]"
orchestrator:
folder: ./cogment
environment:
COGMENT_ORCHESTRATOR_ACTOR_PORT: 0
COGMENT_LIFECYCLE_PORT: 0
depends_on:
- directory
commands:
- ["cogment", "services", "orchestrator"]
runner:
folder: ./pycode
depends_on:
- directory
- orchestrator
commands:
- [
"python3",
"runner.py",
"-u {{.USER}}",
"-n {{.RUN_NAME}}",
"{{.__2}}",
]
report:
commands:
- ["reporting_service"]
+ + \ No newline at end of file diff --git a/docs/reference/cli/model-registry.html b/docs/reference/cli/model-registry.html index 29a7796..c637d6c 100644 --- a/docs/reference/cli/model-registry.html +++ b/docs/reference/cli/model-registry.html @@ -1,22 +1,22 @@ - + - + Model Registry | Cogment - - - + + +
-

Model Registry

Cogment Model Registry is designed to store and make available AI models to be used by Cogment actors.

The Model Registry manages models in two ways:

  • Transient (non-archived) model iterations can be used to publish an updated model to users, e.g. during training. Transient model iterations are stored in memory and can be evicted, in particular once the memory limit is reached.
  • Stored model iterations are stored on the filesystem and should be used for long-term storage of specific iterations, e.g. for validation or deployment purposes.

Command line

The Model Registry is simply called this way

$ cogment services model_registry --port=9000 --archive_dir=./models/

Configuration

The Model Registry configuration can be specified either through the command line or environment variables.

port

The TCP port where to serve the The Model Registry API.

If set to 0, then the system will automatically choose a free port. -This is normally used in combination with a Directory.

Can be specified as:

  • a command line option, e.g. --port=12000,
  • an environment variable, e.g. COGMENT_MODEL_REGISTRY_PORT=12000,
  • its default value is 9002.

grpc_reflection

Whether or not to enable gRPC reflection on the served endpoints.

Can be specified as:

  • a command line flag, e.g. --grpc_reflection,
  • an environment variable, e.g. COGMENT_MODEL_REGISTRY_GRPC_REFLECTION=1,
  • by default, it is disabled.

archive_dir

Path to the directory to store archived model iterations and model metadata.

Can be specified as:

  • a command line option, e.g. --archive_dir=./path/to/models/,
  • an environment variable, e.g. COGMENT_MODEL_REGISTRY_ARCHIVE_DIR=./path/to/models/,
  • its default value is .cogment/model_registry

cache_max_items

This defines the maximum number of model iterations that can be stored in the transient cache.

Can be specified as:

  • a command line option, e.g. --cache_max_items=500,
  • an environment variable, e.g. COGMENT_MODEL_REGISTRY_VERSION_CACHE_MAX_ITEMS=500,
  • its default value is 100.

sent_version_chunk_size

The maximum size for model iteration data chunk sent by the server. It is defined in bytes.

Can be specified as:

  • a command line option, e.g. --sent_version_chunk_size=100000,
  • an environment variable, e.g. COGMENT_MODEL_REGISTRY_SENT_MODEL_VERSION_DATA_CHUNK_SIZE=100000,
  • its default value is 2097152 Bytes, i.e. 2MB.

log_level

Set to define the minimum level for logging. Possible values are: off, error, warning, info, debug, trace. Note however that all trace and most debug level logs will only output if running the debug compiled version of the Orchestrator.

Can be specified as:

  • a command line option, e.g. --log_level=debug,
  • an environment variable, e.g. COGMENT_LOG_LEVEL=5,
  • default value is info.

log_file

Base file name for daily log output. The name will be suffixed with the date and a new file will be made every day. If not provided the logs go to stdout.

Can be specified as:

  • a command line option, e.g. --log_file=./path/to/cogment.log,
  • an environment variable, e.g. COGMENT_LOG_FILE=./path/to/cogment.log,
  • default value is info.

directory_endpoint

Cogment endpoint of the directory service. It must be a gRPC endpoint. The directory will be used to register the model registry service for discovery by other services. If not provided, the model registry will not auto register, in which case manual registration to the directory must be done, or an explicit address must be provided to access the model registry.

Can be specified as:

  • a command line option, e.g. --directory_endpoint=grpc://foo:9005,
  • an environment variable, e.g. COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005,
  • it has no default value.

directory_authentication_token

Authentication token for services registered in the Directory. It is recorded in the Directory when registering a service. And a matching token must be provided to inquire for the service. An empty token is the same as no token.

Can be specified as:

  • a command line option, e.g. --directory_authentication_token=GH670ploT,
  • an environment variable, e.g. COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT,
  • it has no default value.

directory_registration_host

This is the host that will be registered to the Directory for the Model Registry service. If not provided, the Model Registry will determine its own IP address and use that as the registration host.

In some circumstances, the IP address determined by Cogment may be wrong (e.g. multiple interfaces, load balancing, firewall), thus a host (hostname or IP address) must be explicitly provided.

Can be specified as:

  • a command line option, e.g. --directory_registration_host=foo.bar,
  • an environment variable, e.g. COGMENT_MODEL_REGISTRY_DIRECTORY_REGISTRATION_HOST=foo.bar,
  • it has no default value (i.e. self determined IP address is used).

directory_registration_properties

These are the properties that will be registered to the Directory for the Model Registry service. When inquiring the Directory, the properties inquired must match the properties registered. This is a string representing multiple properties in the form "name=value,name=value,name=value" where the values are optional.

Can be specified as:

  • a command line option, e.g. --directory_registration_properties="Sim=20,hpp,mem=HIGH",
  • an environment variable, e.g. COGMENT_MODEL_REGISTRY_DIRECTORY_REGISTRATION_PROPERTIES="Sim=20,hpp,mem=HIGH",
  • it has no default value.

API usage examples

::: tip

The following examples require COGMENT_MODEL_REGISTRY_GRPC_REFLECTION to be enabled as well as grpcurl_

:::

Create or update a model - cogmentAPI.ModelRegistrySP/CreateOrUpdateModel( .cogmentAPI.CreateOrUpdateModelRequest ) returns ( .cogmentAPI.CreateOrUpdateModelReply );

$ echo "{\"model_info\":{\"model_id\":\"my_model\",\"user_data\":{\"type\":\"my_model_type\"}}}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/CreateOrUpdateModel
{

}

Delete a model - cogmentAPI.ModelRegistrySP/DeleteModel( .cogmentAPI.DeleteModelRequest ) returns ( .cogmentAPI.DeleteModelReply );

$ echo "{\"model_id\":\"my_model\"}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/DeleteModel
{

}

Retrieve models - cogmentAPI.ModelRegistrySP/RetrieveModels( .cogmentAPI.RetrieveModelsRequest ) returns ( .cogmentAPI.RetrieveModelsReply );

These examples require COGMENT_MODEL_REGISTRY_GRPC_REFLECTION to be enabled as well as grpcurl

List the models

$ echo "{}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/RetrieveModels
{
"modelInfos": [
{
"modelId": "my_model",
"userData": {
"type": "my_model_type"
}
},
{
"modelId": "my_other_model",
"userData": {
"type": "my_model_type"
}
}
],
"nextModelHandle": "2"
}

Retrieve specific model(s)

$ echo "{\"model_ids\":[\"my_other_model\"]}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/RetrieveModels
{
"modelInfos": [
{
"modelId": "my_other_model",
"userData": {
"type": "my_model_type"
}
}
],
"nextModelHandle": "1"
}

Create a model iteration - cogmentAPI.ModelRegistrySP/CreateVersion( stream .cogmentAPI.CreateVersionRequestChunk ) returns ( .cogmentAPI.CreateVersionReply );

$ echo "{\"header\":{\"version_info\":{
\"model_id\":\"my_model\",\
\"archived\":true,\
\"data_size\":$(printf chunk_1chunk_2 | wc -c)\
}}}\
{\"body\":{\
\"data_chunk\":\"$(printf chunk_1 | base64)\"\
}}\
{\"body\":{\
\"data_chunk\":\"$(printf chunk_2 | base64)\"\
}}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/CreateVersion
{
"versionInfo": {
"modelId": "my_model",
"versionNumber": 2,
"creationTimestamp": "907957639",
"archived": true,
"dataHash": "jY0g3VkUK62ILPr2JuaW5g7uQi0EcJVZJu8IYp3yfhI=",
"dataSize": "14"
}
}

Retrieve model iteration infos - cogmentAPI.ModelRegistrySP/RetrieveVersionInfos ( .cogmentAPI.RetrieveVersionInfosRequest ) returns ( .cogmentAPI.RetrieveVersionInfosReply );

List the iterations of a model

$ echo "{\"model_id\":\"my_model\"}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/RetrieveVersionInfos
{
"versionInfos": [
{
"modelId": "my_model",
"versionNumber": 1,
"creationTimestamp": "1633119005107454620",
"archived": true,
"dataHash": "jY0g3VkUK62ILPr2JuaW5g7uQi0EcJVZJu8IYp3yfhI=",
"dataSize": "14"
},
{
"modelId": "my_model",
"versionNumber": 2,
"creationTimestamp": "1633119625907957639",
"archived": true,
"dataHash": "jY0g3VkUK62ILPr2JuaW5g7uQi0EcJVZJu8IYp3yfhI=",
"dataSize": "14"
}
],
"nextVersionHandle": "3"
}

Retrieve specific iterations of a model

$ echo "{\"model_id\":\"my_model\", \"version_numbers\":[1]}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/RetrieveVersionInfos
{
"versionInfos": [
{
"modelId": "my_model",
"versionNumber": 1,
"creationTimestamp": "1633119005107454620",
"archived": true,
"dataHash": "jY0g3VkUK62ILPr2JuaW5g7uQi0EcJVZJu8IYp3yfhI=",
"dataSize": "14"
}
],
"nextVersionHandle": "2"
}

Retrieve the n-th to last iterations of a model

$ echo "{\"model_id\":\"my_model\", \"version_numbers\":[-2]}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/RetrieveVersionInfos
{
"versionInfos": [
{
"modelId": "my_model",
"versionNumber": 1,
"creationTimestamp": "1633119005107454620",
"archived": true,
"dataHash": "jY0g3VkUK62ILPr2JuaW5g7uQi0EcJVZJu8IYp3yfhI=",
"dataSize": "14"
}
],
"nextVersionHandle": "2"
}

Retrieve given iteration data - cogmentAPI.ModelRegistrySP/RetrieveVersionData ( .cogmentAPI.RetrieveVersionDataRequest ) returns ( stream .cogmentAPI.RetrieveVersionDataReplyChunk );

$ echo "{\"model_id\":\"my_model\", \"version_number\":1}" | grpcurl -plaintext -d @ localhost:9000 cogment.ModelRegistrySP/RetrieveVersionData
{
"dataChunk": "Y2h1bmtfMWNodW5rXzI="
}

To retrieve the n-th to last iteration, use version_number:-n (e.g. -1 for the latest, -2 for the 2nd to last).

- - +

Model Registry

Cogment Model Registry is designed to store and make available AI models to be used by Cogment actors.

The Model Registry manages models in two ways:

  • Transient (non-archived) model iterations can be used to publish an updated model to users, e.g. during training. Transient model iterations are stored in memory and can be evicted, in particular once the memory limit is reached.
  • Stored model iterations are stored on the filesystem and should be used for long-term storage of specific iterations, e.g. for validation or deployment purposes.

Command line

The Model Registry is simply called this way

$ cogment services model_registry --port=9000 --archive_dir=./models/

Configuration

The Model Registry configuration can be specified either through the command line or environment variables.

port

The TCP port where to serve the The Model Registry API.

If set to 0, then the system will automatically choose a free port. +This is normally used in combination with a Directory.

Can be specified as:

  • a command line option, e.g. --port=12000,
  • an environment variable, e.g. COGMENT_MODEL_REGISTRY_PORT=12000,
  • its default value is 9002.

grpc_reflection

Whether or not to enable gRPC reflection on the served endpoints.

Can be specified as:

  • a command line flag, e.g. --grpc_reflection,
  • an environment variable, e.g. COGMENT_MODEL_REGISTRY_GRPC_REFLECTION=1,
  • by default, it is disabled.

archive_dir

Path to the directory to store archived model iterations and model metadata.

Can be specified as:

  • a command line option, e.g. --archive_dir=./path/to/models/,
  • an environment variable, e.g. COGMENT_MODEL_REGISTRY_ARCHIVE_DIR=./path/to/models/,
  • its default value is .cogment/model_registry

cache_max_items

This defines the maximum number of model iterations that can be stored in the transient cache.

Can be specified as:

  • a command line option, e.g. --cache_max_items=500,
  • an environment variable, e.g. COGMENT_MODEL_REGISTRY_VERSION_CACHE_MAX_ITEMS=500,
  • its default value is 100.

sent_version_chunk_size

The maximum size for model iteration data chunk sent by the server. It is defined in bytes.

Can be specified as:

  • a command line option, e.g. --sent_version_chunk_size=100000,
  • an environment variable, e.g. COGMENT_MODEL_REGISTRY_SENT_MODEL_VERSION_DATA_CHUNK_SIZE=100000,
  • its default value is 2097152 Bytes, i.e. 2MB.

log_level

Set to define the minimum level for logging. Possible values are: off, error, warning, info, debug, trace. Note however that all trace and most debug level logs will only output if running the debug compiled version of the Orchestrator.

Can be specified as:

  • a command line option, e.g. --log_level=debug,
  • an environment variable, e.g. COGMENT_LOG_LEVEL=5,
  • default value is info.

log_file

Base file name for daily log output. The name will be suffixed with the date and a new file will be made every day. If not provided the logs go to stdout.

Can be specified as:

  • a command line option, e.g. --log_file=./path/to/cogment.log,
  • an environment variable, e.g. COGMENT_LOG_FILE=./path/to/cogment.log,
  • default value is info.

directory_endpoint

Cogment endpoint of the directory service. It must be a gRPC endpoint. The directory will be used to register the model registry service for discovery by other services. If not provided, the model registry will not auto register, in which case manual registration to the directory must be done, or an explicit address must be provided to access the model registry.

Can be specified as:

  • a command line option, e.g. --directory_endpoint=grpc://foo:9005,
  • an environment variable, e.g. COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005,
  • it has no default value.

directory_authentication_token

Authentication token for services registered in the Directory. It is recorded in the Directory when registering a service. And a matching token must be provided to inquire for the service. An empty token is the same as no token.

Can be specified as:

  • a command line option, e.g. --directory_authentication_token=GH670ploT,
  • an environment variable, e.g. COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT,
  • it has no default value.

directory_registration_host

This is the host that will be registered to the Directory for the Model Registry service. If not provided, the Model Registry will determine its own IP address and use that as the registration host.

In some circumstances, the IP address determined by Cogment may be wrong (e.g. multiple interfaces, load balancing, firewall), thus a host (hostname or IP address) must be explicitly provided.

Can be specified as:

  • a command line option, e.g. --directory_registration_host=foo.bar,
  • an environment variable, e.g. COGMENT_MODEL_REGISTRY_DIRECTORY_REGISTRATION_HOST=foo.bar,
  • it has no default value (i.e. self determined IP address is used).

directory_registration_properties

These are the properties that will be registered to the Directory for the Model Registry service. When inquiring the Directory, the properties inquired must match the properties registered. This is a string representing multiple properties in the form "name=value,name=value,name=value" where the values are optional.

Can be specified as:

  • a command line option, e.g. --directory_registration_properties="Sim=20,hpp,mem=HIGH",
  • an environment variable, e.g. COGMENT_MODEL_REGISTRY_DIRECTORY_REGISTRATION_PROPERTIES="Sim=20,hpp,mem=HIGH",
  • it has no default value.

API usage examples

::: tip

The following examples require COGMENT_MODEL_REGISTRY_GRPC_REFLECTION to be enabled as well as grpcurl_

:::

Create or update a model - cogmentAPI.ModelRegistrySP/CreateOrUpdateModel( .cogmentAPI.CreateOrUpdateModelRequest ) returns ( .cogmentAPI.CreateOrUpdateModelReply );

$ echo "{\"model_info\":{\"model_id\":\"my_model\",\"user_data\":{\"type\":\"my_model_type\"}}}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/CreateOrUpdateModel
{

}

Delete a model - cogmentAPI.ModelRegistrySP/DeleteModel( .cogmentAPI.DeleteModelRequest ) returns ( .cogmentAPI.DeleteModelReply );

$ echo "{\"model_id\":\"my_model\"}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/DeleteModel
{

}

Retrieve models - cogmentAPI.ModelRegistrySP/RetrieveModels( .cogmentAPI.RetrieveModelsRequest ) returns ( .cogmentAPI.RetrieveModelsReply );

These examples require COGMENT_MODEL_REGISTRY_GRPC_REFLECTION to be enabled as well as grpcurl

List the models

$ echo "{}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/RetrieveModels
{
"modelInfos": [
{
"modelId": "my_model",
"userData": {
"type": "my_model_type"
}
},
{
"modelId": "my_other_model",
"userData": {
"type": "my_model_type"
}
}
],
"nextModelHandle": "2"
}

Retrieve specific model(s)

$ echo "{\"model_ids\":[\"my_other_model\"]}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/RetrieveModels
{
"modelInfos": [
{
"modelId": "my_other_model",
"userData": {
"type": "my_model_type"
}
}
],
"nextModelHandle": "1"
}

Create a model iteration - cogmentAPI.ModelRegistrySP/CreateVersion( stream .cogmentAPI.CreateVersionRequestChunk ) returns ( .cogmentAPI.CreateVersionReply );

$ echo "{\"header\":{\"version_info\":{
\"model_id\":\"my_model\",\
\"archived\":true,\
\"data_size\":$(printf chunk_1chunk_2 | wc -c)\
}}}\
{\"body\":{\
\"data_chunk\":\"$(printf chunk_1 | base64)\"\
}}\
{\"body\":{\
\"data_chunk\":\"$(printf chunk_2 | base64)\"\
}}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/CreateVersion
{
"versionInfo": {
"modelId": "my_model",
"versionNumber": 2,
"creationTimestamp": "907957639",
"archived": true,
"dataHash": "jY0g3VkUK62ILPr2JuaW5g7uQi0EcJVZJu8IYp3yfhI=",
"dataSize": "14"
}
}

Retrieve model iteration infos - cogmentAPI.ModelRegistrySP/RetrieveVersionInfos ( .cogmentAPI.RetrieveVersionInfosRequest ) returns ( .cogmentAPI.RetrieveVersionInfosReply );

List the iterations of a model

$ echo "{\"model_id\":\"my_model\"}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/RetrieveVersionInfos
{
"versionInfos": [
{
"modelId": "my_model",
"versionNumber": 1,
"creationTimestamp": "1633119005107454620",
"archived": true,
"dataHash": "jY0g3VkUK62ILPr2JuaW5g7uQi0EcJVZJu8IYp3yfhI=",
"dataSize": "14"
},
{
"modelId": "my_model",
"versionNumber": 2,
"creationTimestamp": "1633119625907957639",
"archived": true,
"dataHash": "jY0g3VkUK62ILPr2JuaW5g7uQi0EcJVZJu8IYp3yfhI=",
"dataSize": "14"
}
],
"nextVersionHandle": "3"
}

Retrieve specific iterations of a model

$ echo "{\"model_id\":\"my_model\", \"version_numbers\":[1]}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/RetrieveVersionInfos
{
"versionInfos": [
{
"modelId": "my_model",
"versionNumber": 1,
"creationTimestamp": "1633119005107454620",
"archived": true,
"dataHash": "jY0g3VkUK62ILPr2JuaW5g7uQi0EcJVZJu8IYp3yfhI=",
"dataSize": "14"
}
],
"nextVersionHandle": "2"
}

Retrieve the n-th to last iterations of a model

$ echo "{\"model_id\":\"my_model\", \"version_numbers\":[-2]}" | grpcurl -plaintext -d @ localhost:9000 cogmentAPI.ModelRegistrySP/RetrieveVersionInfos
{
"versionInfos": [
{
"modelId": "my_model",
"versionNumber": 1,
"creationTimestamp": "1633119005107454620",
"archived": true,
"dataHash": "jY0g3VkUK62ILPr2JuaW5g7uQi0EcJVZJu8IYp3yfhI=",
"dataSize": "14"
}
],
"nextVersionHandle": "2"
}

Retrieve given iteration data - cogmentAPI.ModelRegistrySP/RetrieveVersionData ( .cogmentAPI.RetrieveVersionDataRequest ) returns ( stream .cogmentAPI.RetrieveVersionDataReplyChunk );

$ echo "{\"model_id\":\"my_model\", \"version_number\":1}" | grpcurl -plaintext -d @ localhost:9000 cogment.ModelRegistrySP/RetrieveVersionData
{
"dataChunk": "Y2h1bmtfMWNodW5rXzI="
}

To retrieve the n-th to last iteration, use version_number:-n (e.g. -1 for the latest, -2 for the 2nd to last).

+ + \ No newline at end of file diff --git a/docs/reference/cli/orchestrator.html b/docs/reference/cli/orchestrator.html index 0d12d1b..56bbf3b 100644 --- a/docs/reference/cli/orchestrator.html +++ b/docs/reference/cli/orchestrator.html @@ -1,27 +1,27 @@ - + - + Orchestrator | Cogment - - - + + +
-

Orchestrator

The Orchestrator is the heart of Cogment. It ties all services together to execute trials.

Command line

The Orchestrator is simply called this way

$ cogment services orchestrator --lifecycle_port=9001 --actor_port=9001 --pre_trial_hooks=grpc://config:9001

Configuration

The orchestrator configuration can be specified either through the command line or environment variables.

lifecycle_port

The TCP port where to serve the trial lifecycle gRPC service. +

Orchestrator

The Orchestrator is the heart of Cogment. It ties all services together to execute trials.

Command line

The Orchestrator is simply called this way

$ cogment services orchestrator --lifecycle_port=9001 --actor_port=9001 --pre_trial_hooks=grpc://config:9001

Configuration

The orchestrator configuration can be specified either through the command line or environment variables.

lifecycle_port

The TCP port where to serve the trial lifecycle gRPC service. This is where the Controller connects to. It can be the same as the actor_port.

If set to 0, then the system will automatically choose a free port. This is normally used in combination with a Directory.

Can be specified as:

  • a command line option, e.g. --lifecycle_port=12000,
  • an environment variable, e.g. COGMENT_LIFECYCLE_PORT=12000,
  • its default value is 9000.

actor_port

The TCP port where to serve the client actor gRPC service. This is where Client Actors (as opposed to service actors) connect to. It can be the same as the lifecycle_port.

If set to 0, then the system will automatically choose a free port. -This is normally used in combination with a Directory.

Can be specified as:

  • a command line option, e.g. --actor_port=12000,
  • an environment variable, e.g. COGMENT_ACTOR_PORT=12000,
  • its default value is 9000.

actor_web_port

The TCP port used to serve the client actor gRPC service for consumption over websocket. This is required for Client Actors running in a web browser.

Can be specified as:

  • a command line option, e.g. --actor_web_port=8080,
  • an environment variable, e.g. COGMENT_WEB_PROXY_PORT=12000,
  • its default value is 0, which means the http port is disabled.

params

The name of the YAML file containing the default parameters for new trials. Some of the parameters must match their corresponding values in the spec file (typically cogment.yaml) and may therefore lock an Orchestrator instance to specific types of trials. If pre-trial hooks are defined, these parameters are sent to the first hook before a trial starts. These parameters are ignored if the parameters are provided on trial start (see TrialStartRequest).

Can be specified as:

  • a command line option, e.g. --params=./path/to/params.yaml,
  • an environment variable, e.g. COGMENT_DEFAULT_PARAMS_FILE=./path/to/params.yaml,
  • it has no default value.

directory_endpoint

Cogment endpoint of the directory service. It must be a gRPC endpoint. The directory will be used to register the orchestrator services, and to discover services for new trials.

If not provided, the endpoints provided to the Orchestrator or in the parameters must not be discovery endpoints (i.e. must not require a directory). And the Orchestrator will not auto register its services, in which case manual registration to the directory must be done, or an explicit address must be provided to access the Orchestrator.

Can be specified as:

  • a command line option, e.g. --directory_endpoint=grpc://foo:9005,
  • an environment variable, e.g. COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005,
  • it has no default value.

directory_authentication_token

Authentication token for services registered in the Directory. It is recorded in the Directory when registering a service. And a matching token must be provided to inquire for the service. An empty token is the same as no token.

Can be specified as:

  • a command line option, e.g. --directory_authentication_token=GH670ploT,
  • an environment variable, e.g. COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT,
  • it has no default value.

directory_auto_register

If 0, then the Orchestrator will not register its services to the Directory; The services must be externally registered, or gRPC endpoints used to reach the services. If 1, then the Orchestrator will register its services to the directory service if possible. Other values are reserved.

Can be specified as:

  • a command line option, e.g. --directory_auto_register=0,
  • an environment variable, e.g. COGMENT_ORCHESTRATOR_DIRECTORY_AUTO_REGISTER=0,
  • its default value is 1.

directory_registration_host

This is the host that will be registered to the Directory for the Orchestrator services. If not provided, the Orchestrator will determine its own IP address and use that as the registration host.

In some circumstances, the IP address determined by Cogment may be wrong (e.g. multiple interfaces, load balancing, firewall), thus a host (hostname or IP address) must be explicitly provided.

Can be specified as:

  • a command line option, e.g. --directory_registration_host=foo.bar,
  • an environment variable, e.g. COGMENT_ORCHESTRATOR_DIRECTORY_REGISTRATION_HOST=foo.bar,
  • it has no default value (i.e. self determined IP address is used).

directory_registration_properties

These are the properties that will be registered to the Directory for the Orchestrator services. When inquiring the Directory, the properties inquired must match the properties registered. This is a string representing multiple properties in the form "name=value,name=value,name=value" where the values are optional.

Can be specified as:

  • a command line option, e.g. --directory_registration_properties="Sim=20,hpp,mem=HIGH",
  • an environment variable, e.g. COGMENT_ORCHESTRATOR_DIRECTORY_REGISTRATION_PROPERTIES="Sim=20,hpp,mem=HIGH",
  • it has no default value.

pre_trial_hooks

Cogment endpoint definitions for pre-trial hooks. Hooks may be called before a new trial starts; They are then called in order, in a pipeline fashion, to set the parameters for a new trial. The first hook will receive the default parameters, and the result of the last hook will be used as the parameters for the new trial.

Can be specified as:

  • a command line option with different endpoints separated by commas, e.g. --pre_trial_hooks=grpc://foo:9000,grpc://bar:9000, and/or with the option passed multiple times, e.g. --pre_trial_hooks=grpc://foo:9000 --pre_trial_hooks=grpc://bar:9000,
  • an environment variable with different endpoints separated by spaces, e.g. COGMENT_PRE_TRIAL_HOOKS="grpc://foo:9000 grpc://bar:9000",
  • it has no default value.

prometheus_port

The TCP port where to serve Prometheus metrics. Must be different than lifecycle_port and actor_port. If not specified, the Prometheus server is disabled.

Can be specified as:

  • a command line option, e.g. --prometheus_port=8000,
  • an environment variable, e.g. COGMENT_ORCHESTRATOR_PROMETHEUS_PORT=8000,
  • its default value is 0, which means the prometheus server is disabled.

status_file

File containing simple status for the Orchestrator. This is useful when running the Orchestrator inside containers or synchronizing with external components. The file is open and stays open while the Orchestrator runs. The file will contain one to three letters: I, R, T. "I" indicates that the Orchestrator is initializing. When the Orchestrator starts, the file only contains this letter. "R" indicates that the Orchestrator is ready. This letter is added to the file (thus the file will normally contain "IR" at this point). "T" indicates that the Orchestrator has terminated (crashes will not set this file to "T"). Thus after a normal end, the file will contain "IRT".

Can be specified as:

  • a command line option, e.g. --status_file=./path/to/status,
  • an environment variable, e.g. COGMENT_STATUS_FILE=./path/to/status,
  • it has no default value.

private_key

File name containg a PEM encoded private key for encrypted communication.

Can be specified as:

  • a command line option, e.g. --private_key=./path/to/key.pem,
  • an environment variable, e.g. COGMENT_PRIVATE_KEY_FILE=./path/to/key.pem,
  • it has no default value.

root_cert

File name containing a PEM encoded trusted root certificate.

Can be specified as:

  • a command line option, e.g. --root_cert=./path/to/cert.pem,
  • an environment variable, e.g. COGMENT_ROOT_CERT_FILE=./path/to/cert.pem,
  • it has no default value.

trust_chain

File name containing a PEM encoded trust chain.

Can be specified as:

  • a command line option, e.g. --trust_chain=./path/to/chain.pem,
  • an environment variable, e.g. COGMENT_TRUST_CHAIN_FILE=./path/to/chain.pem,
  • it has no default value.

gc_frequency

Number of (started) trials between trial garbage collection. The Orchestrator periodically deletes ended and stale trials; this parameter controls how often this cleanup happens. The garbage collection may happen on the start of any trial.

Can be specified as:

  • a command line option, e.g. --gc_frequency=5,
  • an environment variable, e.g. COGMENT_GC_FREQUENCY=5,
  • default value is 10.

log_level

Set to define the minimum level for logging. Possible values are: off, error, warning, info, debug, trace. Note however that all trace and most debug level logs will only output if running the debug compiled version of the Orchestrator.

Can be specified as:

  • a command line option, e.g. --log_level=debug,
  • an environment variable, e.g. COGMENT_LOG_LEVEL=debug,
  • default value is info.

log_file

Base file name for daily log output. The name will be suffixed with the date and a new file will be made every day. If not provided the logs go to stdout.

Can be specified as:

  • a command line option, e.g. --log_file=./path/to/cogment.log,
  • an environment variable, e.g. COGMENT_LOG_FILE=./path/to/cogment.log,
  • default value is info.
- - +This is normally used in combination with a Directory.

Can be specified as:

  • a command line option, e.g. --actor_port=12000,
  • an environment variable, e.g. COGMENT_ACTOR_PORT=12000,
  • its default value is 9000.

actor_web_port

The TCP port used to serve the client actor gRPC service for consumption over websocket. This is required for Client Actors running in a web browser.

Can be specified as:

  • a command line option, e.g. --actor_web_port=8080,
  • an environment variable, e.g. COGMENT_WEB_PROXY_PORT=12000,
  • its default value is 0, which means the http port is disabled.

params

The name of the YAML file containing the default parameters for new trials. Some of the parameters must match their corresponding values in the spec file (typically cogment.yaml) and may therefore lock an Orchestrator instance to specific types of trials. If pre-trial hooks are defined, these parameters are sent to the first hook before a trial starts. These parameters are ignored if the parameters are provided on trial start (see TrialStartRequest).

Can be specified as:

  • a command line option, e.g. --params=./path/to/params.yaml,
  • an environment variable, e.g. COGMENT_DEFAULT_PARAMS_FILE=./path/to/params.yaml,
  • it has no default value.

directory_endpoint

Cogment endpoint of the directory service. It must be a gRPC endpoint. The directory will be used to register the orchestrator services, and to discover services for new trials.

If not provided, the endpoints provided to the Orchestrator or in the parameters must not be discovery endpoints (i.e. must not require a directory). And the Orchestrator will not auto register its services, in which case manual registration to the directory must be done, or an explicit address must be provided to access the Orchestrator.

Can be specified as:

  • a command line option, e.g. --directory_endpoint=grpc://foo:9005,
  • an environment variable, e.g. COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005,
  • it has no default value.

directory_authentication_token

Authentication token for services registered in the Directory. It is recorded in the Directory when registering a service. And a matching token must be provided to inquire for the service. An empty token is the same as no token.

Can be specified as:

  • a command line option, e.g. --directory_authentication_token=GH670ploT,
  • an environment variable, e.g. COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT,
  • it has no default value.

directory_auto_register

If 0, then the Orchestrator will not register its services to the Directory; The services must be externally registered, or gRPC endpoints used to reach the services. If 1, then the Orchestrator will register its services to the directory service if possible. Other values are reserved.

Can be specified as:

  • a command line option, e.g. --directory_auto_register=0,
  • an environment variable, e.g. COGMENT_ORCHESTRATOR_DIRECTORY_AUTO_REGISTER=0,
  • its default value is 1.

directory_registration_host

This is the host that will be registered to the Directory for the Orchestrator services. If not provided, the Orchestrator will determine its own IP address and use that as the registration host.

In some circumstances, the IP address determined by Cogment may be wrong (e.g. multiple interfaces, load balancing, firewall), thus a host (hostname or IP address) must be explicitly provided.

Can be specified as:

  • a command line option, e.g. --directory_registration_host=foo.bar,
  • an environment variable, e.g. COGMENT_ORCHESTRATOR_DIRECTORY_REGISTRATION_HOST=foo.bar,
  • it has no default value (i.e. self determined IP address is used).

directory_registration_properties

These are the properties that will be registered to the Directory for the Orchestrator services. When inquiring the Directory, the properties inquired must match the properties registered. This is a string representing multiple properties in the form "name=value,name=value,name=value" where the values are optional.

Can be specified as:

  • a command line option, e.g. --directory_registration_properties="Sim=20,hpp,mem=HIGH",
  • an environment variable, e.g. COGMENT_ORCHESTRATOR_DIRECTORY_REGISTRATION_PROPERTIES="Sim=20,hpp,mem=HIGH",
  • it has no default value.

pre_trial_hooks

Cogment endpoint definitions for pre-trial hooks. Hooks may be called before a new trial starts; They are then called in order, in a pipeline fashion, to set the parameters for a new trial. The first hook will receive the default parameters, and the result of the last hook will be used as the parameters for the new trial.

Can be specified as:

  • a command line option with different endpoints separated by commas, e.g. --pre_trial_hooks=grpc://foo:9000,grpc://bar:9000, and/or with the option passed multiple times, e.g. --pre_trial_hooks=grpc://foo:9000 --pre_trial_hooks=grpc://bar:9000,
  • an environment variable with different endpoints separated by spaces, e.g. COGMENT_PRE_TRIAL_HOOKS="grpc://foo:9000 grpc://bar:9000",
  • it has no default value.

prometheus_port

The TCP port where to serve Prometheus metrics. Must be different than lifecycle_port and actor_port. If not specified, the Prometheus server is disabled.

Can be specified as:

  • a command line option, e.g. --prometheus_port=8000,
  • an environment variable, e.g. COGMENT_ORCHESTRATOR_PROMETHEUS_PORT=8000,
  • its default value is 0, which means the prometheus server is disabled.

status_file

File containing simple status for the Orchestrator. This is useful when running the Orchestrator inside containers or synchronizing with external components. The file is open and stays open while the Orchestrator runs. The file will contain one to three letters: I, R, T. "I" indicates that the Orchestrator is initializing. When the Orchestrator starts, the file only contains this letter. "R" indicates that the Orchestrator is ready. This letter is added to the file (thus the file will normally contain "IR" at this point). "T" indicates that the Orchestrator has terminated (crashes will not set this file to "T"). Thus after a normal end, the file will contain "IRT".

Can be specified as:

  • a command line option, e.g. --status_file=./path/to/status,
  • an environment variable, e.g. COGMENT_STATUS_FILE=./path/to/status,
  • it has no default value.

private_key

File name containg a PEM encoded private key for encrypted communication.

Can be specified as:

  • a command line option, e.g. --private_key=./path/to/key.pem,
  • an environment variable, e.g. COGMENT_PRIVATE_KEY_FILE=./path/to/key.pem,
  • it has no default value.

root_cert

File name containing a PEM encoded trusted root certificate.

Can be specified as:

  • a command line option, e.g. --root_cert=./path/to/cert.pem,
  • an environment variable, e.g. COGMENT_ROOT_CERT_FILE=./path/to/cert.pem,
  • it has no default value.

trust_chain

File name containing a PEM encoded trust chain.

Can be specified as:

  • a command line option, e.g. --trust_chain=./path/to/chain.pem,
  • an environment variable, e.g. COGMENT_TRUST_CHAIN_FILE=./path/to/chain.pem,
  • it has no default value.

gc_frequency

Number of (started) trials between trial garbage collection. The Orchestrator periodically deletes ended and stale trials; this parameter controls how often this cleanup happens. The garbage collection may happen on the start of any trial.

Can be specified as:

  • a command line option, e.g. --gc_frequency=5,
  • an environment variable, e.g. COGMENT_GC_FREQUENCY=5,
  • default value is 10.

log_level

Set to define the minimum level for logging. Possible values are: off, error, warning, info, debug, trace. Note however that all trace and most debug level logs will only output if running the debug compiled version of the Orchestrator.

Can be specified as:

  • a command line option, e.g. --log_level=debug,
  • an environment variable, e.g. COGMENT_LOG_LEVEL=debug,
  • default value is info.

log_file

Base file name for daily log output. The name will be suffixed with the date and a new file will be made every day. If not provided the logs go to stdout.

Can be specified as:

  • a command line option, e.g. --log_file=./path/to/cogment.log,
  • an environment variable, e.g. COGMENT_LOG_FILE=./path/to/cogment.log,
  • default value is info.
+ + \ No newline at end of file diff --git a/docs/reference/cli/status.html b/docs/reference/cli/status.html index fee2b75..ec42147 100644 --- a/docs/reference/cli/status.html +++ b/docs/reference/cli/status.html @@ -1,28 +1,28 @@ - + - + Status | Cogment - - - + + +
-

Status

Status is a utility command to request the status of Cogment services. It can also inquire the directory to find services to request status.

cogment status [options] [statuses...]

Common

directory_endpoint

Cogment endpoint of the directory service. It must be a gRPC endpoint. The directory will be used to discover the services from which to request status.

Can be specified as:

  • a command line option, e.g. --directory_endpoint=grpc://foo:9005,
  • an environment variable, e.g. COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005,
  • its default value is "grpc://localhost:9005" (which is the default when running cogment services directory locally).

directory_authentication_token

Authentication token for services registered in the Directory. An empty token is the same as no token. Only services with the matching authentication token will be found in the directory.

Can be specified as:

  • a command line option, e.g. --directory_authentication_token=GH670ploT,
  • an environment variable, e.g. COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT,
  • it has no default value.

verbose

Controls how much of the service information (received from the directory) is printed. The default only prints the directory ID of the service. To increase the amount of information, more "v" can be added, up to -vvvv to print all service information (similar to the Cogment Directory Client "inquire" command).

Can be specified as:

  • a command line option, e.g. --verbose, -v, -vv, -vvv, -vvvv
  • it has no default value (i.e. minimal verbosity)

endpoint

Cogment endpoint to the service from which to request statuses.

If this is a discovery endpoint then a directory must be provided. +

Status

Status is a utility command to request the status of Cogment services. It can also inquire the directory to find services to request status.

cogment status [options] [statuses...]

Common

directory_endpoint

Cogment endpoint of the directory service. It must be a gRPC endpoint. The directory will be used to discover the services from which to request status.

Can be specified as:

  • a command line option, e.g. --directory_endpoint=grpc://foo:9005,
  • an environment variable, e.g. COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005,
  • its default value is "grpc://localhost:9005" (which is the default when running cogment services directory locally).

directory_authentication_token

Authentication token for services registered in the Directory. An empty token is the same as no token. Only services with the matching authentication token will be found in the directory.

Can be specified as:

  • a command line option, e.g. --directory_authentication_token=GH670ploT,
  • an environment variable, e.g. COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT,
  • it has no default value.

verbose

Controls how much of the service information (received from the directory) is printed. The default only prints the directory ID of the service. To increase the amount of information, more "v" can be added, up to -vvvv to print all service information (similar to the Cogment Directory Client "inquire" command).

Can be specified as:

  • a command line option, e.g. --verbose, -v, -vv, -vvv, -vvvv
  • it has no default value (i.e. minimal verbosity)

endpoint

Cogment endpoint to the service from which to request statuses.

If this is a discovery endpoint then a directory must be provided. If it is a grpc endpoint and a type option is provided, the service must match the type provided or the status request will fail.

Can be specified as:

  • a command line option, e.g. --endpoint=grpc://172.2.17.23:45367,
  • its default value is "cogment://discover" (which will inquire the directory for all healthy services).

type

The type of service from which to request statuses. This is relevant only if the endpoint is a grpc endpoint (because directory entries include the type data). If this type is not provided, all types will be tried to determine if one works (if there are multiple services at the endpoint, only one will be reported).

Possible values are: actor, environment, prehook, datalog, lifecycle, actservice, datastore, modelregistry or other. These are the same keywords used as paths in Cogment discovery endpoints.

Can be specified as:

  • a command line option, e.g. --type=actor,
  • it has no default value.

Statuses

The names of the statuses to request.

If none is provided, a request will still be made for no statuses; This can serve as a health/communication test.

The star (*) status can be used to request all "standard" statuses (note that at the command line, the star may need to be enclosed in quotation marks to prevent it from being interpreted by the command shell). What defines a "standard" status depends on the service, it often excludes debug statuses and statuses that require extra computation. Non-standard statuses must be requested explicitly by name. -Explicit (named) statuses can precede the star (*) in the list of statuses to request, but all names following the star status will be ignored.

E.g.:

$ cogment status '*'
$ cogment status overall_load nb_sessions
$ cogment status nb_samples_processed '*'
- - +Explicit (named) statuses can precede the star (*) in the list of statuses to request, but all names following the star status will be ignored.

E.g.:

$ cogment status '*'
$ cogment status overall_load nb_sessions
$ cogment status nb_samples_processed '*'
+ + \ No newline at end of file diff --git a/docs/reference/cli/trial-datastore/trial-datastore-client.html b/docs/reference/cli/trial-datastore/trial-datastore-client.html index bac04fe..0b57f81 100644 --- a/docs/reference/cli/trial-datastore/trial-datastore-client.html +++ b/docs/reference/cli/trial-datastore/trial-datastore-client.html @@ -1,21 +1,21 @@ - + - + Client | Cogment - - - + + +
-

Trial Datastore Client

The Trial Datastore client provides command line access to some features of the Trial Datastore, and in general any service implementing the Trial Datastore API.

It is called this way:

$ cogment client trial_datastore --endpoint="grpc://trial_datastore:9003" [command]

The Trial Datastore client has the following commands:

  • list_trials to list trials stored in the Trial Datastore,
  • delete_trials to delete trials from the Trial Datastore,
  • export to export trials and their samples from the Trial Datastore,
  • import to import trials and their samples to the Trial Datastore.

Common options

A few configuration options are shared by the different commands, they can be specified either through the command line or environment variables.

endpoint

The gRPC endpoint of the target Trial Datastore.

Can be specified as:

  • a command line option, e.g. --endpoint="grpc://10.0.123.5:9003",
  • an environment variable, e.g. COGMENT_TRIAL_DATASTORE_ENDPOINT=grpc://trial_datastore:9003,
  • its default value is "grpc://localhost:9003" (which is the default when running cogment services trial_datastore locally).

timeout

The maximum duration for the execution of the request. The duration should be specified as a sequence of numbers followed by a unit suffix: "300ms", "1.5h" or "2h45m" are valid timeouts. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".

Can be specified as:

  • a command line option, e.g. --timeout=1m,
  • an environment variable, e.g. COGMENT_CLIENT_TIMEOUT=90s,
  • its default value is 30 seconds.

console_output

The format for what the command outputs to stdout. Can be either set to:

  • text, for human consumption, this output usually only includes partial information to ensure readability,
  • json, for consumption through scripts, we recommend using a tool like jq to parse and manipulate it.

Can be specified as:

  • a command line option, e.g. --console_output=json,
  • an environment variable, e.g. COGMENT_CLIENT_CONSOLE_OUTPUT=text,
  • its default value is text.

list_trials command

list_trials can be used to list the trials stored in a Trial Datastore.

It can be called this way:

$ cogment client trial_datastore --endpoint="grpc://trial_datastore:9003" list_trials --count 20

In addition to the shared configuration, list_trials can be configured with the following options.

count

The maximum number of trials to retrieve.

Can be specified as:

  • a command line option, e.g. --count=45,
  • its default value is 10.

from

The handle of the first trial to be retrieved: leave empty to retrieve a first page of results, for subsequent ones, set it to the next trial handle retrieved alongside the previous page.

Can be specified as:

  • a command line option, e.g. --from=23,
  • it has no default value (which will retrieve the first page of results)

Command output

The text output of list_trials is an array listing the following information for each trial.

  • trial id: the unique ID of the trial.
  • user id: the ID of the user that started or imported the trial.
  • state: the trial state for the last stored sample.
  • samples: the number of samples received for this trial.
  • actors: the number of actors involved in this trial.

The number of retrieved trials and the next trial handle are also printed.

The json output of list_trials is an instance of cogmentAPI.RetrieveTrialsReply serialized in JSON.

delete_trials command

delete_trials can be used to delete trials stored in a Trial Datastore.

It can be called this way:

$ cogment client delete_trials --endpoint="grpc://trial_datastore:9003" delete_trials <trial_id1> [...]

Command output

The text output of delete_trials is a human readable summary of the operation.

The json output of delete_trials is an object holding:

  • "message" a human readable summary,
  • "trial_ids" the list of deleted trial IDs (this also includes the trial IDs that didn't exist).

export command

export can be used to export the samples of multiple trials.

It can be called this way:

$ cogment client trial_datastore --endpoint="grpc://trial_datastore:9003" export <trial_id1> [...] --file="data.dump"

In addition to the shared configuration, export can be configured with the following options.

file

Path to the file where the data will be exported. If none is provided the same export is written to stdout and no summary output is generated.

Can be specified as:

  • a command line option, e.g. --file="./path/to/data.dump",
  • it has no default value.

The output format is binary, it is composed of the following:

note

Protobuf messages are stored in the file as:

  1. the size of the serialized message, as a 32 bits unsigned integer encoded in little endian,
  2. the serialized message.

Command output

The text output of export is a human readable summary of the operation.

The json output of export is an object holding:

  • "message", a human readable summary.
  • "bytes", the size of the output file, in bytes,
  • "trial_ids", the list of the exported trial IDs,
  • "filepath", the path to the output file,
note

If the --file option is not provided, only the binary content is outputed, no other command output is printed.

import command

import can be used to import multiple trials and their samples from a previously exported source.

It can be called this way:

$ cogment client trial_datastore --endpoint="grpc://trial_datastore:9003" import --file="data.dump"

In addition to the shared configuration, import can be configured with the following options.

file

Path to the file from which the data will be imported. If none is provided the import reads from stdin.

Can be specified as:

  • a command line option, e.g. --file="./path/to/data.dump",
  • it has no default value.

The input file format is expected to match the export's.

prefix

Prefix to apply to the ID of trials present in the file. This option is useful to prevent ID conflicts as each trial ID needs to be unique.

Can be specified as:

  • a command line option, e.g. --prefix="2022-08-08-import-",
  • it has no default value.

user_id

The User ID to use for the imported trials.

Can be specified as:

  • a command line option, e.g. --user_id="Jane Doe",
  • its default value is "cogment CLI".

Command output

The text output of import is a message specifying the number of imported trials, the input file path and the number of imported samples.

The json output of import is an object holding:

  • "message", a human readable summary.
  • "samples_count", the number of imported samples,
  • "trials", a list containing an object for each trial defining,
    • "trial_id", the trial ID,
    • "samples_count", the number of imported samples for this trial,
  • "filepath", the path to the input file,
- - +

Trial Datastore Client

The Trial Datastore client provides command line access to some features of the Trial Datastore, and in general any service implementing the Trial Datastore API.

It is called this way:

$ cogment client trial_datastore --endpoint="grpc://trial_datastore:9003" [command]

The Trial Datastore client has the following commands:

  • list_trials to list trials stored in the Trial Datastore,
  • delete_trials to delete trials from the Trial Datastore,
  • export to export trials and their samples from the Trial Datastore,
  • import to import trials and their samples to the Trial Datastore.

Common options

A few configuration options are shared by the different commands, they can be specified either through the command line or environment variables.

endpoint

The gRPC endpoint of the target Trial Datastore.

Can be specified as:

  • a command line option, e.g. --endpoint="grpc://10.0.123.5:9003",
  • an environment variable, e.g. COGMENT_TRIAL_DATASTORE_ENDPOINT=grpc://trial_datastore:9003,
  • its default value is "grpc://localhost:9003" (which is the default when running cogment services trial_datastore locally).

timeout

The maximum duration for the execution of the request. The duration should be specified as a sequence of numbers followed by a unit suffix: "300ms", "1.5h" or "2h45m" are valid timeouts. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".

Can be specified as:

  • a command line option, e.g. --timeout=1m,
  • an environment variable, e.g. COGMENT_CLIENT_TIMEOUT=90s,
  • its default value is 30 seconds.

console_output

The format for what the command outputs to stdout. Can be either set to:

  • text, for human consumption, this output usually only includes partial information to ensure readability,
  • json, for consumption through scripts, we recommend using a tool like jq to parse and manipulate it.

Can be specified as:

  • a command line option, e.g. --console_output=json,
  • an environment variable, e.g. COGMENT_CLIENT_CONSOLE_OUTPUT=text,
  • its default value is text.

list_trials command

list_trials can be used to list the trials stored in a Trial Datastore.

It can be called this way:

$ cogment client trial_datastore --endpoint="grpc://trial_datastore:9003" list_trials --count 20

In addition to the shared configuration, list_trials can be configured with the following options.

count

The maximum number of trials to retrieve.

Can be specified as:

  • a command line option, e.g. --count=45,
  • its default value is 10.

from

The handle of the first trial to be retrieved: leave empty to retrieve a first page of results, for subsequent ones, set it to the next trial handle retrieved alongside the previous page.

Can be specified as:

  • a command line option, e.g. --from=23,
  • it has no default value (which will retrieve the first page of results)

Command output

The text output of list_trials is an array listing the following information for each trial.

  • trial id: the unique ID of the trial.
  • user id: the ID of the user that started or imported the trial.
  • state: the trial state for the last stored sample.
  • samples: the number of samples received for this trial.
  • actors: the number of actors involved in this trial.

The number of retrieved trials and the next trial handle are also printed.

The json output of list_trials is an instance of cogmentAPI.RetrieveTrialsReply serialized in JSON.

delete_trials command

delete_trials can be used to delete trials stored in a Trial Datastore.

It can be called this way:

$ cogment client delete_trials --endpoint="grpc://trial_datastore:9003" delete_trials <trial_id1> [...]

Command output

The text output of delete_trials is a human readable summary of the operation.

The json output of delete_trials is an object holding:

  • "message" a human readable summary,
  • "trial_ids" the list of deleted trial IDs (this also includes the trial IDs that didn't exist).

export command

export can be used to export the samples of multiple trials.

It can be called this way:

$ cogment client trial_datastore --endpoint="grpc://trial_datastore:9003" export <trial_id1> [...] --file="data.dump"

In addition to the shared configuration, export can be configured with the following options.

file

Path to the file where the data will be exported. If none is provided the same export is written to stdout and no summary output is generated.

Can be specified as:

  • a command line option, e.g. --file="./path/to/data.dump",
  • it has no default value.

The output format is binary, it is composed of the following:

note

Protobuf messages are stored in the file as:

  1. the size of the serialized message, as a 32 bits unsigned integer encoded in little endian,
  2. the serialized message.

Command output

The text output of export is a human readable summary of the operation.

The json output of export is an object holding:

  • "message", a human readable summary.
  • "bytes", the size of the output file, in bytes,
  • "trial_ids", the list of the exported trial IDs,
  • "filepath", the path to the output file,
note

If the --file option is not provided, only the binary content is outputed, no other command output is printed.

import command

import can be used to import multiple trials and their samples from a previously exported source.

It can be called this way:

$ cogment client trial_datastore --endpoint="grpc://trial_datastore:9003" import --file="data.dump"

In addition to the shared configuration, import can be configured with the following options.

file

Path to the file from which the data will be imported. If none is provided the import reads from stdin.

Can be specified as:

  • a command line option, e.g. --file="./path/to/data.dump",
  • it has no default value.

The input file format is expected to match the export's.

prefix

Prefix to apply to the ID of trials present in the file. This option is useful to prevent ID conflicts as each trial ID needs to be unique.

Can be specified as:

  • a command line option, e.g. --prefix="2022-08-08-import-",
  • it has no default value.

user_id

The User ID to use for the imported trials.

Can be specified as:

  • a command line option, e.g. --user_id="Jane Doe",
  • its default value is "cogment CLI".

Command output

The text output of import is a message specifying the number of imported trials, the input file path and the number of imported samples.

The json output of import is an object holding:

  • "message", a human readable summary.
  • "samples_count", the number of imported samples,
  • "trials", a list containing an object for each trial defining,
    • "trial_id", the trial ID,
    • "samples_count", the number of imported samples for this trial,
  • "filepath", the path to the input file,
+ + \ No newline at end of file diff --git a/docs/reference/cli/trial-datastore/trial-datastore-server.html b/docs/reference/cli/trial-datastore/trial-datastore-server.html index d8fa073..4a47541 100644 --- a/docs/reference/cli/trial-datastore/trial-datastore-server.html +++ b/docs/reference/cli/trial-datastore/trial-datastore-server.html @@ -1,25 +1,25 @@ - + - + Server | Cogment - - - + + +
-

Trial Datastore Server

Cogment Trial Datastore implements the datalog API. It is designed to store the trajectory samples generated by the trials for online and offline usage.

The Cogment CLI also includes an implementation of a client.

The Trial Datastore service included in the Cogment CLI can work in two modes:

  • Memory storage, which is the default mode, stores the data in memory up to a maximum size and then evicts the least recently used samples.
  • File storage stores the data on disk in a file. The storage engine relies on bbolt.

The Trial Datastore service is simply called this way

$ cogment services trial_datastore --port=9000 --file_storage=./database.db

Configuration

The Trial Datastore configuration can be specified either through the command line or environment variables.

port

The TCP port where to offer gRPC services. +

Trial Datastore Server

Cogment Trial Datastore implements the datalog API. It is designed to store the trajectory samples generated by the trials for online and offline usage.

The Cogment CLI also includes an implementation of a client.

The Trial Datastore service included in the Cogment CLI can work in two modes:

  • Memory storage, which is the default mode, stores the data in memory up to a maximum size and then evicts the least recently used samples.
  • File storage stores the data on disk in a file. The storage engine relies on bbolt.

The Trial Datastore service is simply called this way

$ cogment services trial_datastore --port=9000 --file_storage=./database.db

Configuration

The Trial Datastore configuration can be specified either through the command line or environment variables.

port

The TCP port where to offer gRPC services. The Trial Datastore offers two services at the same TCP port: the Datalog API and the Trial Datastore API. The Datalog API is where the Datastore receives the raw trial data from the Orchestrator. The Trial Datastore API is is where the Datastore delivers online or offline stored data (typically to actors for training).

If set to 0, then the system will automatically choose a free port. -This is normally used in combination with a Directory.

Can be specified as:

  • a command line option, e.g. --port=12000,
  • an environment variable, e.g. COGMENT_TRIAL_DATASTORE_PORT=12000,
  • its default value is 9003.

grpc_reflection

Whether or not to enable gRPC reflection on the served endpoints.

Can be specified as:

  • a command line flag, e.g. --grpc_reflection,
  • an environment variable, e.g. COGMENT_TRIAL_DATASTORE_GRPC_REFLECTION=1,
  • by default, it is disabled.

memory_storage_max_samples_size

This defines the maximum cumulated size of samples the memory storage holds before evicting least recently used trials samples. It is defined in bytes.

Can be specified as:

  • a command line option, e.g. --memory_storage_max_samples_size=100000000,
  • an environment variable, e.g. COGMENT_TRIAL_DATASTORE_MEMORY_STORAGE_MAX_SAMPLE_SIZE=100000000,
  • its default value is 1073741824 Bytes, i.e. 1GB.

file_storage

Path to the database file used by the file storage. If provided, the trial datastore will use the file storage.

Can be specified as:

  • a command line flag, e.g. --file_storage, to use the default value .cogment/trial_datastore.db,
  • a command line option, e.g. --file_storage=./path/to/trial_datastore.db,
  • an environment variable, e.g. COGMENT_TRIAL_DATASTORE_FILE_STORAGE_PATH=./path/to/trial_datastore.db,
  • it has no default value.

log_level

Set to define the minimum level for logging. Possible values are: off, error, warning, info, debug, trace. Note however that all trace and most debug level logs will only output if running the debug compiled version of the Orchestrator.

Can be specified as:

  • a command line option, e.g. --log_level=debug,
  • an environment variable, e.g. COGMENT_LOG_LEVEL=5,
  • default value is info.

log_file

Base file name for daily log output. The name will be suffixed with the date and a new file will be made every day. If not provided the logs go to stdout.

Can be specified as:

  • a command line option, e.g. --log_file=./path/to/cogment.log,
  • an environment variable, e.g. COGMENT_LOG_FILE=./path/to/cogment.log,
  • default value is info.

directory_endpoint

Cogment endpoint of the directory service. It must be a gRPC endpoint. The directory will be used to register the trial datastore services for discovery by other services. If not provided, the trial datastore will not auto register, in which case manual registration to the directory must be done, or an explicit address must be provided to access the services of the trial datastore.

Can be specified as:

  • a command line option, e.g. --directory_endpoint=grpc://foo:9005,
  • an environment variable, e.g. COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005,
  • it has no default value.

directory_authentication_token

Authentication token for services registered in the Directory. It is recorded in the Directory when registering a service. And a matching token must be provided to inquire for the service. An empty token is the same as no token.

Can be specified as:

  • a command line option, e.g. --directory_authentication_token=GH670ploT,
  • an environment variable, e.g. COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT,
  • it has no default value.

directory_registration_host

This is the host that will be registered to the Directory for the Trial Datastore services. If not provided, the Trial Datastore will determine its own IP address and use that as the registration host.

In some circumstances, the IP address determined by Cogment may be wrong (e.g. multiple interfaces, load balancing, firewall), thus a host (hostname or IP address) must be explicitly provided.

Can be specified as:

  • a command line option, e.g. --directory_registration_host=foo.bar,
  • an environment variable, e.g. COGMENT_TRIAL_DATASTORE_DIRECTORY_REGISTRATION_HOST=foo.bar,
  • it has no default value (i.e. self determined IP address is used).

directory_registration_properties

These are the properties that will be registered to the Directory for the Trial Datastore services. When inquiring the Directory, the properties inquired must match the properties registered. This is a string representing multiple properties in the form "name=value,name=value,name=value" where the values are optional.

Can be specified as:

  • a command line option, e.g. --directory_registration_properties="Sim=20,hpp,mem=HIGH",
  • an environment variable, e.g. COGMENT_TRIAL_DATASTORE_DIRECTORY_REGISTRATION_PROPERTIES="Sim=20,hpp,mem=HIGH",
  • it has no default value.
- - +This is normally used in combination with a Directory.

Can be specified as:

  • a command line option, e.g. --port=12000,
  • an environment variable, e.g. COGMENT_TRIAL_DATASTORE_PORT=12000,
  • its default value is 9003.

grpc_reflection

Whether or not to enable gRPC reflection on the served endpoints.

Can be specified as:

  • a command line flag, e.g. --grpc_reflection,
  • an environment variable, e.g. COGMENT_TRIAL_DATASTORE_GRPC_REFLECTION=1,
  • by default, it is disabled.

memory_storage_max_samples_size

This defines the maximum cumulated size of samples the memory storage holds before evicting least recently used trials samples. It is defined in bytes.

Can be specified as:

  • a command line option, e.g. --memory_storage_max_samples_size=100000000,
  • an environment variable, e.g. COGMENT_TRIAL_DATASTORE_MEMORY_STORAGE_MAX_SAMPLE_SIZE=100000000,
  • its default value is 1073741824 Bytes, i.e. 1GB.

file_storage

Path to the database file used by the file storage. If provided, the trial datastore will use the file storage.

Can be specified as:

  • a command line flag, e.g. --file_storage, to use the default value .cogment/trial_datastore.db,
  • a command line option, e.g. --file_storage=./path/to/trial_datastore.db,
  • an environment variable, e.g. COGMENT_TRIAL_DATASTORE_FILE_STORAGE_PATH=./path/to/trial_datastore.db,
  • it has no default value.

log_level

Set to define the minimum level for logging. Possible values are: off, error, warning, info, debug, trace. Note however that all trace and most debug level logs will only output if running the debug compiled version of the Orchestrator.

Can be specified as:

  • a command line option, e.g. --log_level=debug,
  • an environment variable, e.g. COGMENT_LOG_LEVEL=5,
  • default value is info.

log_file

Base file name for daily log output. The name will be suffixed with the date and a new file will be made every day. If not provided the logs go to stdout.

Can be specified as:

  • a command line option, e.g. --log_file=./path/to/cogment.log,
  • an environment variable, e.g. COGMENT_LOG_FILE=./path/to/cogment.log,
  • default value is info.

directory_endpoint

Cogment endpoint of the directory service. It must be a gRPC endpoint. The directory will be used to register the trial datastore services for discovery by other services. If not provided, the trial datastore will not auto register, in which case manual registration to the directory must be done, or an explicit address must be provided to access the services of the trial datastore.

Can be specified as:

  • a command line option, e.g. --directory_endpoint=grpc://foo:9005,
  • an environment variable, e.g. COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005,
  • it has no default value.

directory_authentication_token

Authentication token for services registered in the Directory. It is recorded in the Directory when registering a service. And a matching token must be provided to inquire for the service. An empty token is the same as no token.

Can be specified as:

  • a command line option, e.g. --directory_authentication_token=GH670ploT,
  • an environment variable, e.g. COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT,
  • it has no default value.

directory_registration_host

This is the host that will be registered to the Directory for the Trial Datastore services. If not provided, the Trial Datastore will determine its own IP address and use that as the registration host.

In some circumstances, the IP address determined by Cogment may be wrong (e.g. multiple interfaces, load balancing, firewall), thus a host (hostname or IP address) must be explicitly provided.

Can be specified as:

  • a command line option, e.g. --directory_registration_host=foo.bar,
  • an environment variable, e.g. COGMENT_TRIAL_DATASTORE_DIRECTORY_REGISTRATION_HOST=foo.bar,
  • it has no default value (i.e. self determined IP address is used).

directory_registration_properties

These are the properties that will be registered to the Directory for the Trial Datastore services. When inquiring the Directory, the properties inquired must match the properties registered. This is a string representing multiple properties in the form "name=value,name=value,name=value" where the values are optional.

Can be specified as:

  • a command line option, e.g. --directory_registration_properties="Sim=20,hpp,mem=HIGH",
  • an environment variable, e.g. COGMENT_TRIAL_DATASTORE_DIRECTORY_REGISTRATION_PROPERTIES="Sim=20,hpp,mem=HIGH",
  • it has no default value.
+ + \ No newline at end of file diff --git a/docs/reference/cli/web-proxy.html b/docs/reference/cli/web-proxy.html index da28bb8..097dcb9 100644 --- a/docs/reference/cli/web-proxy.html +++ b/docs/reference/cli/web-proxy.html @@ -1,22 +1,22 @@ - + - + Web Proxy | Cogment - - - + + +
-

Web Proxy

caution

This module is still in active development and should be considered a preview version.

The Cogment Web Proxy is designed to facilitate the use of Cogment with web-based components. It implements a JSON HTTP API that can be easily used from a web application.

Current features include the following.

  • Using the web proxy as a Controller:
    • list ongoing trials,
    • start trial.
  • Using the web proxy as an Actor:
    • Join a trial,
    • Leave a trial,
    • Receive observations and rewards, send actions and rewards.

Cogment Web Proxy aims at superceding the use of the grpc-web API that can be exposed by the orchestrator.

Command line

The Web Proxy is simply called this way

$ cogment services web_proxy --web_port=8080 --spec_file=./cogment.yaml

Configuration

The Web Proxy configuration can be specified either through the command line or environment variables.

web_port

The TCP port where to serve the Web Proxy HTTP API.

Can be specified as:

  • a command line option, e.g. --web_port=80,
  • an environment variable, e.g. COGMENT_WEB_PROXY_WEB_PORT=8°,
  • its default value is 8080.

orchestrator_endpoint

Cogment endpoint of the orchestrator service. It can be a gRPC or discovery endpoint,in which case it'll rely on the directory configuration.

This endpoint is used to access the gRPC Control API.

Can be specified as:

  • a command line option, e.g. --orchestrator_endpoint=grpc://foo:9005,
  • an environment variable, e.g. COGMENT_ORCHESTRATOR_ENDPOINT=grpc://foo:9005,
  • its default value is cogment://discover.

port

The TCP port where to serve the The Service Actor API.

If set to 0, then the system will automatically choose a free port. -This is normally used in combination with a Directory.

Can be specified as:

  • a command line option, e.g. --port=12000,
  • an environment variable, e.g. COGMENT_WEB_PROXY_PORT=12000,
  • its default value is 9002.

spec_file

Path to the spec file specifiying the trial that the proxy will interact with. In particular it is used for JSON serialization of the echanged actions, observations, configurations, ...

Can be specified as:

  • a command line option, e.g. --spec_file=./path/to/cogment.yaml,
  • an environment variable, e.g. COGMENT_SPEC_FILE=./path/to/cogment.yaml,
  • its default value is ./cogment.yaml

implementation

This defines the name of the actor implementation managed by the proxy.

Can be specified as:

  • a command line option, e.g. --implementation=my_implementation,
  • an environment variable, e.g. COGMENT_WEB_PROXY_IMPLEMENTATION=my_implementation,
  • its default value is web.

secret

The secret used to sign the generated actor trial tokens.

info

This value should be changed for any application in production

Can be specified as:

  • a command line option, e.g. --secret=rosebud,
  • an environment variable, e.g. COGMENT_WEB_PROXY_SECRET=rosebud,
  • its default value is web_proxy_secret.

log_level

Set to define the minimum level for logging. Possible values are: off, error, warning, info, debug, trace. Note however that all trace and most debug level logs will only output if running the debug compiled version of the Orchestrator.

Can be specified as:

  • a command line option, e.g. --log_level=debug,
  • an environment variable, e.g. COGMENT_LOG_LEVEL=5,
  • default value is info.

log_file

Base file name for daily log output. The name will be suffixed with the date and a new file will be made every day. If not provided the logs go to stdout.

Can be specified as:

  • a command line option, e.g. --log_file=./path/to/cogment.log,
  • an environment variable, e.g. COGMENT_LOG_FILE=./path/to/cogment.log,
  • default value is info.

directory_endpoint

Cogment endpoint of the directory service. It must be a gRPC endpoint. The directory will be used to register the web proxy actor service for discovery by other services and to access the orchestrator. If not provided, the web proxy will not auto register, in which case manual registration to the directory must be done, or an explicit address must be provided to access the web proxy.

Can be specified as:

  • a command line option, e.g. --directory_endpoint=grpc://foo:9005,
  • an environment variable, e.g. COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005,
  • it has no default value.

directory_authentication_token

Authentication token for services registered in the Directory. It is recorded in the Directory when registering a service. And a matching token must be provided to inquire for the service. An empty token is the same as no token.

Can be specified as:

  • a command line option, e.g. --directory_authentication_token=GH670ploT,
  • an environment variable, e.g. COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT,
  • it has no default value.

directory_registration_host

This is the host that will be registered to the Directory for the web proxy service. If not provided, the web proxy will determine its own IP address and use that as the registration host.

In some circumstances, the IP address determined by Cogment may be wrong (e.g. multiple interfaces, load balancing, firewall), thus a host (hostname or IP address) must be explicitly provided.

Can be specified as:

  • a command line option, e.g. --directory_registration_host=foo.bar,
  • an environment variable, e.g. COGMENT_MODEL_REGISTRY_DIRECTORY_REGISTRATION_HOST=foo.bar,
  • it has no default value (i.e. self determined IP address is used).

directory_registration_properties

These are the properties that will be registered to the Directory for the web proxy service. When inquiring the Directory, the properties inquired must match the properties registered. This is a string representing multiple properties in the form "name=value,name=value,name=value" where the values are optional.

Can be specified as:

  • a command line option, e.g. --directory_registration_properties="Sim=20,hpp,mem=HIGH",
  • an environment variable, e.g. COGMENT_MODEL_REGISTRY_DIRECTORY_REGISTRATION_PROPERTIES="Sim=20,hpp,mem=HIGH",
  • it has no default value.

HTTP API

Controller

List trials

GET /controller/trials

List all active trials.

🚧

Start a trial

POST /controller/trials

Start a trial from given trial parameters.

info

It is forbidden to pass gRPC endpoint as part of the trial parameters here

🚧

Actor

Join a trial

POST /actor/:actor_name/:trial_id:

Join trial trial_id as actor actor_name, retrieve the initial observation and the actor trial token

🚧

Leave a trial

DELETE /actor/:actor_name/:trial_id:

Explicitly close the trial connection.

Requires matching actor trial token passed in the Cogment-Actor-Trial-Token header

🚧

Act

POST/GET /actor/:actor_name/:trial_id/:tick_id:

Post the action (and potential sent rewards) for a tick (empty action on GET), retrieve the next observation (and potential received rewards).

Requires matching actor trial token passed in the Cogment-Actor-Trial-Token header

- - +

Web Proxy

caution

This module is still in active development and should be considered a preview version.

The Cogment Web Proxy is designed to facilitate the use of Cogment with web-based components. It implements a JSON HTTP API, whose reference can be found here, that can be easily used from a web application.

Current features include the following.

  • Using the web proxy as a Controller:
    • list ongoing trials,
    • start trial.
  • Using the web proxy as an Actor:
    • Join a trial,
    • Leave a trial,
    • Receive observations and rewards, send actions and rewards.

Cogment Web Proxy aims at superceding the use of the grpc-web API that can be exposed by the orchestrator.

Command line

The Web Proxy is simply called this way

$ cogment services web_proxy --web_port=8080 --spec_file=./cogment.yaml

Configuration

The Web Proxy configuration can be specified either through the command line or environment variables.

web_port

The TCP port where to serve the Web Proxy HTTP API.

Can be specified as:

  • a command line option, e.g. --web_port=80,
  • an environment variable, e.g. COGMENT_WEB_PROXY_WEB_PORT=8°,
  • its default value is 8080.

orchestrator_endpoint

Cogment endpoint of the orchestrator service. It can be a gRPC or discovery endpoint,in which case it'll rely on the directory configuration.

This endpoint is used to access the gRPC Control API.

Can be specified as:

  • a command line option, e.g. --orchestrator_endpoint=grpc://foo:9005,
  • an environment variable, e.g. COGMENT_ORCHESTRATOR_ENDPOINT=grpc://foo:9005,
  • its default value is cogment://discover.

port

The TCP port where to serve the The Service Actor API.

If set to 0, then the system will automatically choose a free port. +This is normally used in combination with a Directory.

Can be specified as:

  • a command line option, e.g. --port=12000,
  • an environment variable, e.g. COGMENT_WEB_PROXY_PORT=12000,
  • its default value is 9002.

spec_file

Path to the spec file specifiying the trial that the proxy will interact with. In particular it is used for JSON serialization of the echanged actions, observations, configurations, ...

Can be specified as:

  • a command line option, e.g. --spec_file=./path/to/cogment.yaml,
  • an environment variable, e.g. COGMENT_SPEC_FILE=./path/to/cogment.yaml,
  • its default value is ./cogment.yaml

implementation

This defines the name of the actor implementation managed by the proxy.

Can be specified as:

  • a command line option, e.g. --implementation=my_implementation,
  • an environment variable, e.g. COGMENT_WEB_PROXY_IMPLEMENTATION=my_implementation,
  • its default value is web.

secret

The secret used to sign the generated actor trial tokens.

info

This value should be changed for any application in production

Can be specified as:

  • a command line option, e.g. --secret=rosebud,
  • an environment variable, e.g. COGMENT_WEB_PROXY_SECRET=rosebud,
  • its default value is web_proxy_secret.

log_level

Set to define the minimum level for logging. Possible values are: off, error, warning, info, debug, trace. Note however that all trace and most debug level logs will only output if running the debug compiled version of the Orchestrator.

Can be specified as:

  • a command line option, e.g. --log_level=debug,
  • an environment variable, e.g. COGMENT_LOG_LEVEL=5,
  • default value is info.

log_file

Base file name for daily log output. The name will be suffixed with the date and a new file will be made every day. If not provided the logs go to stdout.

Can be specified as:

  • a command line option, e.g. --log_file=./path/to/cogment.log,
  • an environment variable, e.g. COGMENT_LOG_FILE=./path/to/cogment.log,
  • default value is info.

directory_endpoint

Cogment endpoint of the directory service. It must be a gRPC endpoint. The directory will be used to register the web proxy actor service for discovery by other services and to access the orchestrator. If not provided, the web proxy will not auto register, in which case manual registration to the directory must be done, or an explicit address must be provided to access the web proxy.

Can be specified as:

  • a command line option, e.g. --directory_endpoint=grpc://foo:9005,
  • an environment variable, e.g. COGMENT_DIRECTORY_ENDPOINT=grpc://foo:9005,
  • it has no default value.

directory_authentication_token

Authentication token for services registered in the Directory. It is recorded in the Directory when registering a service. And a matching token must be provided to inquire for the service. An empty token is the same as no token.

Can be specified as:

  • a command line option, e.g. --directory_authentication_token=GH670ploT,
  • an environment variable, e.g. COGMENT_DIRECTORY_AUTHENTICATION_TOKEN=GH670ploT,
  • it has no default value.

directory_registration_host

This is the host that will be registered to the Directory for the web proxy service. If not provided, the web proxy will determine its own IP address and use that as the registration host.

In some circumstances, the IP address determined by Cogment may be wrong (e.g. multiple interfaces, load balancing, firewall), thus a host (hostname or IP address) must be explicitly provided.

Can be specified as:

  • a command line option, e.g. --directory_registration_host=foo.bar,
  • an environment variable, e.g. COGMENT_MODEL_REGISTRY_DIRECTORY_REGISTRATION_HOST=foo.bar,
  • it has no default value (i.e. self determined IP address is used).

directory_registration_properties

These are the properties that will be registered to the Directory for the web proxy service. When inquiring the Directory, the properties inquired must match the properties registered. This is a string representing multiple properties in the form "name=value,name=value,name=value" where the values are optional.

Can be specified as:

  • a command line option, e.g. --directory_registration_properties="Sim=20,hpp,mem=HIGH",
  • an environment variable, e.g. COGMENT_MODEL_REGISTRY_DIRECTORY_REGISTRATION_PROPERTIES="Sim=20,hpp,mem=HIGH",
  • it has no default value.
+ + \ No newline at end of file diff --git a/docs/reference/cogment-v2-changes.html b/docs/reference/cogment-v2-changes.html index 4198dd3..d3cf68e 100644 --- a/docs/reference/cogment-v2-changes.html +++ b/docs/reference/cogment-v2-changes.html @@ -1,21 +1,21 @@ - + - + Cogment 2.0 | Cogment - - - + + +
-

Cogment 2.0

tip

This document describes the full list of the changes for Cogment 2.O. A migration guide is available here.

Cogment 2.0 is a massive internal change to Cogment, starting with the underlying gRPC API that has seen a major refactoring. But there is a minimal amount of changes that affect the use of cogment. The changes that affect users are in three categories: breaking changes, deprecated behavior and new functionalities.

Breaking changes

These are changes that, if the related features were used, will prevent Cogment v1 projects from working with Cogment v2. They represent the minimum changes necessary to upgrade to v2.

Cogment.yaml

  • Delta types of observations (and all related settings) are not supported anymore. This means that in cogment.yaml, these sections are now ignored:
    • import::python
    • import::javascript
    • actor_classes::observation::delta
    • actor_classes::observation::delta_apply_fn
  • config (for trial, environment and actor) are not accepted in the parameters section anymore.

Python SDK

  • The Session.get_active_actors() method has been restricted to the environment only. This means that actors cannot call this method anymore (it will raise an exception). If actors need the full list of actors, there are a few possibilities:
    • Create a controller in the actor implementation and use the Controller.get_actors() method.
    • Receive the actor list in the config from the pre-trial hooks; the pre-trial hooks have implicit knowledge of all actors (at least the last hook).
    • Add the information in the actors observation space.
    • Send the information in a message.
  • The EnvironmentSession.send_message() method will not accept a to_environment parameter anymore (since it does not make sense anyway).
  • The Controller.terminate_trial() method parameter trial_id has been renamed trial_ids.
  • The Controller.get_trial_info() method parameter trial_id has been renamed trial_ids.

Javascript SDK

Except for the following, everything has been subject to breaking changes:

  • The shape of the observation object has remained the same
  • You can keep the actor function that you have in your v1 project

Please refer to the new Javascript API Reference

Datalog sample

Since the Datalog samples, unlike everything else in the SDK, used the raw API protobuf, it has implicitly changed. But in v2, there is now a wrapper for it, which replaces direct access to the protobuf content.

If people still have serialized v1 data stored (e.g. in a database), v1 versions of the sample protobuf messages (DatalogSample_v1) are provided in the API for convenience, so users can deserialize the data into v1 samples and extract the information.

For more info, visit the gRPC api documentation

Orchestrator

  • The environment variables read by the Orchestrator on start have changed names to help prevent clashes.
    • TRIAL_LIFECYCLE_PORT becomes COGMENT_LIFECYCLE_PORT
    • TRIAL_ACTOR_PORT becomes COGMENT_ACTOR_PORT
    • PROMETHEUS_PORT becomes COGMENT_ORCHESTRATOR_PROMETHEUS_PORT
  • The Orchestrator does not search for the file named cogment.yaml as the default spec file anymore. The spec file name must be explicit on the command line using --config=cogment.yaml.
  • For further information, refer to the Orchestrator documentation.

Deprecated Behaviors

These are changes that are optional to upgrade to Cogment v2, but will eventually be phased out and become breaking changes in a future version. If these features are used with Cogment v2, warnings will be issued.

Cogment.yaml

The spec file is not used by the Orchestrator anymore, and when used by the other components, these sections of the file will be ignored:

  • The trial_params section is not needed anymore (since the Orchestrator has its own parameters file)
  • The datalog section is deprecated (the details of the datalog have been moved to the Orchestrator parameters file)
  • The trial:pre-hooks section is deprecated (these values are now passed to the Orchestrator on the command line)

For more information, visit the Cogment.yaml documentation.

Orchestrator

Providing a spec file (cogment.yaml) to the Orchestrator is deprecated. The new behavior is as follows:

  • Provide a YAML default parameters file (command line option --params) with the top level section trial_params.
  • Add the datalog section to the parameters (if desired), without type (for type none just omit the datalog section). I.e. Whereas the spec file was defining a single data logger for all trials, the new Orchestrator can have a different data logger for each trial, and thus a datalog section is now found in the trial default parameters. Example of the new parameters datalog section:
trial_params:
datalog:
- endpoint: grpc://logger:9000
- exclude_fields: [messages, actions]
  • The endpoint for a client actor in the parameters must now be cogment://client instead of just client. E.g.:
trial_params:
actors:
- endpoint: cogment://client
  • Pre-trial hooks are defined on the command line (or environment variable) as opposed to being found in the spec file.
tip

The Cogment Orchestrator and the generate tools ignore the sections of the YAML files that are not relevant to them, therefore the content of the spec and parameters files can be combined in a single file safely.

The Orchestrator needs a parameters file or pre-trial hooks (or both). Thus with pre-trial hooks and no parameters file (or a carefully defined parameters file) the Orchestrator is now independent of any trial specifications (spec file) and can run any type of trial. With a fully defined parameters file and no hooks, the Orchestrator can work as before for simple projects.

Python SDK

  • The ActorSession.send_message() method should not use the to_environment parameter anymore. The environment is targeted using its name (defaulted to "env" if not given specifically, or ActorSession.env_name).
  • The joining of a trial by a client actor (Context.join_trial()) should now be made by providing an actor name or class (unlike previously where an implementation name was provided). This is to allow the pre-trial hooks to decide on the details of the actor (including implementation) that should be used, the same way as for service actors.
  • In RecvObservation, the snapshot attribute is deprecated. A new attribute observation takes its place.
  • The Controller.terminate_trial() method parameter trial_ids now takes a list of IDs (instead of a single string for one ID).
  • The Controller.get_trial_info() method parameter trial_ids now takes a list of IDs (instead of a single string for one ID or None).
  • The url attribute of cogment.Endpoint must now be a gRPC type URL (i.e. start with grpc://). Endpoint is used to join a trial and to get a Controller.

New Functionalities

These are changes that are additional and transparent to a v1 project.

Parameters

These are the parameters defined in the new file given to the Orchestrator, and that can be changed by pre-trial hooks.

  • The environment can be given a name, similarly to the actors. If not given, it defaults to "env".

Python SDK

  • When starting a trial (Controller.start_trial()), a new trial_id_requested parameter requests the trial ID to be a specific string instead of an automatic UUID. It is a "request" because the trial will not start if the id conflicts with another active trial; an empty ID string will be returned if the trial is not started.
  • Controller.terminate_trial() method has a new parameter hard. This parameter forces a hard/immediate termination of the trial. As opposed to a "soft" termination which will wait for the next tick to terminate nicely.
  • The ActorSession and EnvironmentSession have a new method sending_done() to indicate that they have finished sending data and will now only be listening until the end of the trial. This is required only if the new auto_done_sending parameter of the start() method is False (It is True by default for backward compatibility). This only needs to be manually done (i.e. auto_done_sending=False) in special situations.
  • PrehookSession.get_user_id() new method.
  • PrehookSession.environment_name new attribute.
  • DatalogSession.user_id new attribute (this info used to be available in the protobuf DatalogSample).
  • RecvAction.tick_id new attribute.
- - +

Cogment 2.0

tip

This document describes the full list of the changes for Cogment 2.O. A migration guide is available here.

Cogment 2.0 is a massive internal change to Cogment, starting with the underlying gRPC API that has seen a major refactoring. But there is a minimal amount of changes that affect the use of cogment. The changes that affect users are in three categories: breaking changes, deprecated behavior and new functionalities.

Breaking changes

These are changes that, if the related features were used, will prevent Cogment v1 projects from working with Cogment v2. They represent the minimum changes necessary to upgrade to v2.

Cogment.yaml

  • Delta types of observations (and all related settings) are not supported anymore. This means that in cogment.yaml, these sections are now ignored:
    • import::python
    • import::javascript
    • actor_classes::observation::delta
    • actor_classes::observation::delta_apply_fn
  • config (for trial, environment and actor) are not accepted in the parameters section anymore.

Python SDK

  • The Session.get_active_actors() method has been restricted to the environment only. This means that actors cannot call this method anymore (it will raise an exception). If actors need the full list of actors, there are a few possibilities:
    • Create a controller in the actor implementation and use the Controller.get_actors() method.
    • Receive the actor list in the config from the pre-trial hooks; the pre-trial hooks have implicit knowledge of all actors (at least the last hook).
    • Add the information in the actors observation space.
    • Send the information in a message.
  • The EnvironmentSession.send_message() method will not accept a to_environment parameter anymore (since it does not make sense anyway).
  • The Controller.terminate_trial() method parameter trial_id has been renamed trial_ids.
  • The Controller.get_trial_info() method parameter trial_id has been renamed trial_ids.

Javascript SDK

Except for the following, everything has been subject to breaking changes:

  • The shape of the observation object has remained the same
  • You can keep the actor function that you have in your v1 project

Please refer to the new Javascript API Reference

Datalog sample

Since the Datalog samples, unlike everything else in the SDK, used the raw API protobuf, it has implicitly changed. But in v2, there is now a wrapper for it, which replaces direct access to the protobuf content.

If people still have serialized v1 data stored (e.g. in a database), v1 versions of the sample protobuf messages (DatalogSample_v1) are provided in the API for convenience, so users can deserialize the data into v1 samples and extract the information.

For more info, visit the gRPC api documentation

Orchestrator

  • The environment variables read by the Orchestrator on start have changed names to help prevent clashes.
    • TRIAL_LIFECYCLE_PORT becomes COGMENT_LIFECYCLE_PORT
    • TRIAL_ACTOR_PORT becomes COGMENT_ACTOR_PORT
    • PROMETHEUS_PORT becomes COGMENT_ORCHESTRATOR_PROMETHEUS_PORT
  • The Orchestrator does not search for the file named cogment.yaml as the default spec file anymore. The spec file name must be explicit on the command line using --config=cogment.yaml.
  • For further information, refer to the Orchestrator documentation.

Deprecated Behaviors

These are changes that are optional to upgrade to Cogment v2, but will eventually be phased out and become breaking changes in a future version. If these features are used with Cogment v2, warnings will be issued.

Cogment.yaml

The spec file is not used by the Orchestrator anymore, and when used by the other components, these sections of the file will be ignored:

  • The trial_params section is not needed anymore (since the Orchestrator has its own parameters file)
  • The datalog section is deprecated (the details of the datalog have been moved to the Orchestrator parameters file)
  • The trial:pre-hooks section is deprecated (these values are now passed to the Orchestrator on the command line)

For more information, visit the Cogment.yaml documentation.

Orchestrator

Providing a spec file (cogment.yaml) to the Orchestrator is deprecated. The new behavior is as follows:

  • Provide a YAML default parameters file (command line option --params) with the top level section trial_params.
  • Add the datalog section to the parameters (if desired), without type (for type none just omit the datalog section). I.e. Whereas the spec file was defining a single data logger for all trials, the new Orchestrator can have a different data logger for each trial, and thus a datalog section is now found in the trial default parameters. Example of the new parameters datalog section:
trial_params:
datalog:
- endpoint: grpc://logger:9000
- exclude_fields: [messages, actions]
  • The endpoint for a client actor in the parameters must now be cogment://client instead of just client. E.g.:
trial_params:
actors:
- endpoint: cogment://client
  • Pre-trial hooks are defined on the command line (or environment variable) as opposed to being found in the spec file.
tip

The Cogment Orchestrator and the generate tools ignore the sections of the YAML files that are not relevant to them, therefore the content of the spec and parameters files can be combined in a single file safely.

The Orchestrator needs a parameters file or pre-trial hooks (or both). Thus with pre-trial hooks and no parameters file (or a carefully defined parameters file) the Orchestrator is now independent of any trial specifications (spec file) and can run any type of trial. With a fully defined parameters file and no hooks, the Orchestrator can work as before for simple projects.

Python SDK

  • The ActorSession.send_message() method should not use the to_environment parameter anymore. The environment is targeted using its name (defaulted to "env" if not given specifically, or ActorSession.env_name).
  • The joining of a trial by a client actor (Context.join_trial()) should now be made by providing an actor name or class (unlike previously where an implementation name was provided). This is to allow the pre-trial hooks to decide on the details of the actor (including implementation) that should be used, the same way as for service actors.
  • In RecvObservation, the snapshot attribute is deprecated. A new attribute observation takes its place.
  • The Controller.terminate_trial() method parameter trial_ids now takes a list of IDs (instead of a single string for one ID).
  • The Controller.get_trial_info() method parameter trial_ids now takes a list of IDs (instead of a single string for one ID or None).
  • The url attribute of cogment.Endpoint must now be a gRPC type URL (i.e. start with grpc://). Endpoint is used to join a trial and to get a Controller.

New Functionalities

These are changes that are additional and transparent to a v1 project.

Parameters

These are the parameters defined in the new file given to the Orchestrator, and that can be changed by pre-trial hooks.

  • The environment can be given a name, similarly to the actors. If not given, it defaults to "env".

Python SDK

  • When starting a trial (Controller.start_trial()), a new trial_id_requested parameter requests the trial ID to be a specific string instead of an automatic UUID. It is a "request" because the trial will not start if the id conflicts with another active trial; an empty ID string will be returned if the trial is not started.
  • Controller.terminate_trial() method has a new parameter hard. This parameter forces a hard/immediate termination of the trial. As opposed to a "soft" termination which will wait for the next tick to terminate nicely.
  • The ActorSession and EnvironmentSession have a new method sending_done() to indicate that they have finished sending data and will now only be listening until the end of the trial. This is required only if the new auto_done_sending parameter of the start() method is False (It is True by default for backward compatibility). This only needs to be manually done (i.e. auto_done_sending=False) in special situations.
  • PrehookSession.get_user_id() new method.
  • PrehookSession.environment_name new attribute.
  • DatalogSession.user_id new attribute (this info used to be available in the protobuf DatalogSample).
  • RecvAction.tick_id new attribute.
+ + \ No newline at end of file diff --git a/docs/reference/cogment-yaml.html b/docs/reference/cogment-yaml.html index 5702f13..80a5ea0 100644 --- a/docs/reference/cogment-yaml.html +++ b/docs/reference/cogment-yaml.html @@ -1,21 +1,21 @@ - + - + Specifications File | Cogment - - - + + +
-

Specifications File

The specifications file (typically named cogment.yaml) is central to every Cogment project that use a Cogment SDK. This file is used to define the specifics of a type of trials. It can also contain data (the commands section) used by the Cogment CLI tool. A generator tool specific to each SDK takes this file as its main input to, among other things, configure the SDK.

The top level sections in the file are:

  • import: Used to import other proto files into the definition of the project
  • commands: Optional. Defines the commands that can be run by the Cogment CLI
  • trial: Define trial specific properties
  • environment: Define environment specific properties
  • actor_classes: Define actor specific properties (for each actor class)

In this document, "section" refers to YAML mappings.

Import

The import section is used to specify external data structures, and optionally code, that is referenced in other parts of the file. The referenced files must be in the same folder as the spec file. The import sections are:

  • proto: List of protobuf definition files. Message types defined in these files are used to communicate between the various components

All Cogment projects will need at least one proto import to define the data structures exchanged between the various components.

E.g.:

import:
proto:
- filename1.proto
- filename2.proto

⚠️ N.B. When using message types imported from a .proto file, types need to be referred through their package namespace, not the filename containing them.

Commands

This section is optional and defines commands that can then be executed using the Cogment CLI run command. The commands will be executed by a sub-shell and thus can be any shell command. The commands can also recursively call Cogment, either built-in CLI commands, or other commands defined here. But care should be taken not to create infinite recursive calls.

E.g.:

commands:
generate: |
cd client && python -m cogment.generate --spec cogment.yaml && cd ..
cd environment && python -m cogment.generate --spec cogment.yaml && cd ..
copy: cogment copy cogment.yaml *.proto params.yaml client environment
start: docker-compose up orchestrator agent env
play: cogment run start && docker-compose run launcher

To run one of these commands, the Cogment CLI command run must be used, e.g.: cogment run start. And as such there is no problem differentiating between cogment run copy and cogment copy (the latter is the builtin CLI command, and the former is the command defined in the cogment.yaml file).

The cogment command section exists so that commands can be executed in a platform independant manner.

Trial

This section defines properties related to the trial and trial management. It has the properties:

  • config_type: (optional) The protobuf message type (data structure) that will be passed on to the pre-trial hooks.

E.g.:

trial:
config_type: namespace.DataType

Environment

This section defines properties related to the environment. It has the properties:

  • config_type: (optional) The protobuf message type used to configure the environment
environment:
config_type: namespace.DataType

Actor Classes

Arguably the most important section of the spec file, the actor classes section describes the actor types that can be present in the project's trials.

The content of this section is a list of actor classes, each containing the necessary properties to define an actor class. These properties are:

  • name: The name by which this actor class is known
  • action: Mapping of properties- space: The protobuf message type that represents all the possible actions that this actor class can perform (its action space)
  • observation: Mapping of properties
    • space: The protobuf message type that represents a snapshot of the data that this actor class has access to (its observation space)
  • config_type: (optional) Defines the protobuf message type used to configure this actor class

Each actor class should define both an observation and action space as protobuf message types.

actor_classes:
- name: BigPlayer
action:
space: namespace.PlayerAction
observation:
space: namespace.PlayerObservation
config_type: namespace.PlayerConfig

- name: SmallPlayer
action:
space: namespace.PlayerAction
observation:
space: namespace.PlayerObservation
config_type: namespace.PlayerConfig

- name: Referee
action:
space: namespace.RefereeAction
observation:
space: namespace.RefereeObservation
config_type: namespace.RefereeConfig
- - +

Specifications File

The specifications file (typically named cogment.yaml) is central to every Cogment project that use a Cogment SDK. This file is used to define the specifics of a type of trials. It can also contain data (the commands section) used by the Cogment CLI tool. A generator tool specific to each SDK takes this file as its main input to, among other things, configure the SDK.

The top level sections in the file are:

  • import: Used to import other proto files into the definition of the project
  • commands: Optional. Defines the commands that can be run by the Cogment CLI
  • trial: Define trial specific properties
  • environment: Define environment specific properties
  • actor_classes: Define actor specific properties (for each actor class)

In this document, "section" refers to YAML mappings.

Import

The import section is used to specify external data structures, and optionally code, that is referenced in other parts of the file. The referenced files must be in the same folder as the spec file. The import sections are:

  • proto: List of protobuf definition files. Message types defined in these files are used to communicate between the various components

All Cogment projects will need at least one proto import to define the data structures exchanged between the various components.

E.g.:

import:
proto:
- filename1.proto
- filename2.proto

⚠️ N.B. When using message types imported from a .proto file, types need to be referred through their package namespace, not the filename containing them.

Commands

This section is optional and defines commands that can then be executed using the Cogment CLI run command. The commands will be executed by a sub-shell and thus can be any shell command. The commands can also recursively call Cogment, either built-in CLI commands, or other commands defined here. But care should be taken not to create infinite recursive calls.

E.g.:

commands:
generate: |
cd client && python -m cogment.generate --spec cogment.yaml && cd ..
cd environment && python -m cogment.generate --spec cogment.yaml && cd ..
copy: cogment copy cogment.yaml *.proto params.yaml client environment
start: docker-compose up orchestrator agent env
play: cogment run start && docker-compose run launcher

To run one of these commands, the Cogment CLI command run must be used, e.g.: cogment run start. And as such there is no problem differentiating between cogment run copy and cogment copy (the latter is the builtin CLI command, and the former is the command defined in the cogment.yaml file).

The cogment command section exists so that commands can be executed in a platform independant manner.

Trial

This section defines properties related to the trial and trial management. It has the properties:

  • config_type: (optional) The protobuf message type (data structure) that will be passed on to the pre-trial hooks.

E.g.:

trial:
config_type: namespace.DataType

Environment

This section defines properties related to the environment. It has the properties:

  • config_type: (optional) The protobuf message type used to configure the environment
environment:
config_type: namespace.DataType

Actor Classes

Arguably the most important section of the spec file, the actor classes section describes the actor types that can be present in the project's trials.

The content of this section is a list of actor classes, each containing the necessary properties to define an actor class. These properties are:

  • name: The name by which this actor class is known
  • action: Mapping of properties- space: The protobuf message type that represents all the possible actions that this actor class can perform (its action space)
  • observation: Mapping of properties
    • space: The protobuf message type that represents a snapshot of the data that this actor class has access to (its observation space)
  • config_type: (optional) Defines the protobuf message type used to configure this actor class

Each actor class should define both an observation and action space as protobuf message types.

actor_classes:
- name: BigPlayer
action:
space: namespace.PlayerAction
observation:
space: namespace.PlayerObservation
config_type: namespace.PlayerConfig

- name: SmallPlayer
action:
space: namespace.PlayerAction
observation:
space: namespace.PlayerObservation
config_type: namespace.PlayerConfig

- name: Referee
action:
space: namespace.RefereeAction
observation:
space: namespace.RefereeObservation
config_type: namespace.RefereeConfig
+ + \ No newline at end of file diff --git a/docs/reference/grpc.html b/docs/reference/grpc.html index 612c4be..3d7575a 100644 --- a/docs/reference/grpc.html +++ b/docs/reference/grpc.html @@ -1,53 +1,53 @@ - + - + gRPC API | Cogment - - - + + +
-

gRPC API

The low-level cogment communication API is implemented using gRPC services. +

gRPC API

The low-level cogment communication API is implemented using gRPC services. These services are collections of procedures to be called remotely (RPC). gRPC abstracts the network communication with familiar looking functions (representing the defined procedures), in any number of programming languages. How services are implemented or accessed is highly dependant on the programming language being interfaced, and is beyond the scope of this document (see gRPC API documentation).

This reference requires a basic understanding of gRPC, and in particular the format of the *.proto files.

info

Cogment's gRPC API is defined and released alongside the Cogment CLI, the latest version can be accessed at https://github.com/cogment/cogment/tree/main/packages/grpc_api.

General

In this API, the bytes data type is normally used to contain the serialized data of externally defined messages. These messages are well defined in the trial specifications file.

On the other hand, the google.protobuf.Any data type is normally used to contain messages that are not pre-defined (thus unknown by the framework), and may be decided at runtime. It is then the responsibility of the receiver to deserialize in the correct message type.

Empty messages are normally used as a placeholder for easy future, backward compatible, extension to the API.

In this API, gRPC metadata is normally used only for service request (by the caller) for identifying purposes. The details of the required metadata are described with the service calls. Service replies (the callees) are not expected to provide metadata.

In some places in the API, we use a list of actor data without information about which actor is where in the list. These lists have a constant length and order throughout a trial (set in the trial parameters), and thus can/must be cross referenced with other such lists within the same trial (e.g. actors_in_trial, actors_map). -The actor can be inferred by the position in the list, and the index into the list can sometimes be used to identify an actor.

gRPC service names in Cogment are suffixed with "SP" (Service Point).

Limitations

Due to normal network delays and unpredictability of the various components, there are limitations related to the communication with the Orchestrator that translate in issues that can arise.

  • In the current version, to simplify the implementation, there is an expectation of "good behavior" from the various components:
    • Actors are expected to respond with an action only after receiving an observation, and to send only one action per observation received.
    • The environment is expected to respond with an observation set only after receiving an action set, and to send only one observation set per action set received (and one initial observation set).
    • All components are expected to respond within a reasonable amount of time.
    • Hooks do not assume to receive specific parameters, they reply only with well formed parameters, and they do not assume a specific order of hooks being called (when multiple hooks are defined).
    • A TerminateTrial (from the Control API) is called only a reasonable delay after a StartTrial (e.g. after at least two ticks have executed).
    • Note that what constitutes a "reasonable" amount of time is dependent on many variables.

Common types

Most of the common messages are defined in the common.proto file. ObservationSet and ActionSet are defined in environment.proto.

Common Values

Some values (and their standardized names) are recurrent throughout the gRPC API.

  • tick_id: (uint64/sint64) The monotonic time, in number of steps, since the start of the trial. As an ID, it represents a discrete step in the processing of the trial. A step starts with observations representing a specific point in time, that are followed by actions, rewards and messages in relation to these observations. The first tick ID is 0. Some of these values may accept -1, meaning the latest step (e.g. when sending an action).
  • timestamp: (fixed64) The wall-clock time in nanoseconds since 00:00:00UTC January 1, 1970 (Unix Epoch time).
  • trial_id: (string) The identifier (name) of the trial.

VersionRequest

Empty message to serve as the request for the Version procedure (present in all gRPC services defined in the Cogment API).

message VersionRequest {}

VersionInfo

Reply message for the Version procedure (present in all gRPC services defined in the API). +The actor can be inferred by the position in the list, and the index into the list can sometimes be used to identify an actor.

gRPC service names in Cogment are suffixed with "SP" (Service Point).

Limitations

Due to normal network delays and unpredictability of the various components, there are limitations related to the communication with the Orchestrator that translate in issues that can arise.

  • In the current version, to simplify the implementation, there is an expectation of "good behavior" from the various components:
    • Actors are expected to respond with an action only after receiving an observation, and to send only one action per observation received.
    • The environment is expected to respond with an observation set only after receiving an action set, and to send only one observation set per action set received (and one initial observation set).
    • All components are expected to respond within a reasonable amount of time.
    • Hooks do not assume to receive specific parameters, they reply only with well formed parameters, and they do not assume a specific order of hooks being called (when multiple hooks are defined).
    • A TerminateTrial (from the Control API) is called only a reasonable delay after a StartTrial (e.g. after at least two ticks have executed).
    • Note that what constitutes a "reasonable" amount of time is dependent on many variables.

Common types

Most of the common messages are defined in the common.proto file. ObservationSet and ActionSet are defined in environment.proto.

Common Values

Some values (and their standardized names) are recurrent throughout the gRPC API.

  • tick_id: (uint64/sint64) The monotonic time, in number of steps, since the start of the trial. As an ID, it represents a discrete step in the processing of the trial. A step starts with observations representing a specific point in time, that are followed by actions, rewards and messages in relation to these observations. The first tick ID is 0. Some of these values may accept -1, meaning the latest step (e.g. when sending an action).
  • timestamp: (fixed64) The wall-clock time in nanoseconds since 00:00:00UTC January 1, 1970 (Unix Epoch time).
  • trial_id: (string) The identifier (name) of the trial.

VersionRequest

Empty message to serve as the request for the Version procedure (present in all gRPC services defined in the Cogment API).

message VersionRequest {}

VersionInfo

Reply message for the Version procedure (present in all gRPC services defined in the API). It contains a list of version information. The Cogment framework expects at least "cogment-api" and "grpc" versions to be present in the list. The "cogment-api" is for the local version of the Cogment API used by the service. The "grpc" is for the version of gRPC used by the service. -Other reported versions are specific to the service called, possibly for use by utility and management tools.

message Version {
string name = 1;
string version = 2;
}

message VersionInfo {
repeated Version versions = 1;
}
  • versions: List of version information.
  • name: The name/software/module for which the version is given. E.g. "cogment-api".
  • version: The version related to the name. E.g. "1.0.0b5".

StatusRequest

Request message for Status procedure (present in all gRPC services defined in the Cogment API). -It contains the list of states and statuses (hereafter referred as "statuses") to request from the service.

message StatusRequest {
repeated string names = 1;
}
  • names: The names of the statuses to request. If a name does not exist, it is ignored (i.e. it does not cause an error).

If no names are requested, the reply will be empty. +Other reported versions are specific to the service called, possibly for use by utility and management tools.

message Version {
string name = 1;
string version = 2;
}

message VersionInfo {
repeated Version versions = 1;
}
  • versions: List of version information.
  • name: The name/software/module for which the version is given. E.g. "cogment-api".
  • version: The version related to the name. E.g. "1.0.0b5".

StatusRequest

Request message for Status procedure (present in all gRPC services defined in the Cogment API). +It contains the list of states and statuses (hereafter referred as "statuses") to request from the service.

message StatusRequest {
repeated string names = 1;
}
  • names: The names of the statuses to request. If a name does not exist, it is ignored (i.e. it does not cause an error).

If no names are requested, the reply will be empty. This can be used as a health/communication check for the service.

The "*" name is always defined. It is not really a status in itself, but requests all standard statuses. What it means for a status to be standard depends on the service. Non-standard statuses need to be requested explicitly.

Names that are usually defined:

  • "overall_load": A representation of the load on the machine where the service is running. A specific meaning is associated with this status by the Cogment Directory Load Balancing mechanism.

StatusReply

Reply message for the Status procedure (present in all gRPC services defined in the API). It contains the list of requested (and available) statuses. -Reported statuses are specific to the service called (or the machine/system/network it is running on).

message StatusReply {
map<string, string> statuses = 1; // <name, value>
}
  • statuses: Requested statuses (name/value) that are available, in no particular order.

TrialParams

Global parameters for a trial (see Trial Parameters).

message TrialParams {
SerializedMessage trial_config = 1;
DatalogParams datalog = 2;
EnvironmentParams environment = 3;
repeated ActorParams actors = 4;
uint32 max_steps = 5;
uint32 max_inactivity = 6;
}
  • trial_config
  • datalog: (optional) The parameters for the datalog of the trial. If not present, data logging is disabled.
  • environment: The parameters for the environment of the trial.
  • actors: The parameters for all actors involved in the trial. This list's length and order define the length and order of the lists of actors provided in different places in the API (e.g. actors_in_trial) for the trial.
  • max_steps
  • max_inactivity

DatalogParams

Parameters related to the data logger (see Trial Parameters).

message DatalogParams {
string endpoint = 1;
repeated string exclude_fields = 2;
}
  • endpoint: This is used by the Orchestrator to connect to the datalog using the LogExporterSP gRPC service.
  • exclude_fields

EnvironmentParams

Parameters related to an environment (see Trial Parameters).

message EnvironmentParams {
string endpoint = 1;
SerializedMessage config = 2;
string implementation = 3;
}
  • endpoint: This is used by the Orchestrator to connect to the environment using the EnvironmentSP gRPC service.
  • config
  • implementation

ActorParams

Parameters related to an actor (see Trial Parameters).

message ActorParams {
string name = 1;
string actor_class = 2;
string endpoint = 3;
string implementation = 4;
SerializedMessage config = 5;
float initial_connection_timeout = 6;
float response_timeout = 7;
bool optional = 8;
SerializedMessage default_action = 9;
}
  • name
  • actor_class
  • endpoint: The endpoint is used by the Orchestrator to connect to the actor using the ServiceActorSP gRPC service. If set to "cogment://client", then the actor is a client and will connect to the Orchestrator instead, using the ClientActorSP gRPC service.
  • implementation
  • config
  • initial_connection_timeout
  • response_timeout
  • optional
  • default_action

SerializedMessage

This contains an optional serialized protobuf message (e.g. config) defined by the user in the spec file. The bytes content is wrapped in a message to be able to differentiate between a default content (i.e. length 0) and the absence of content. This is easily done by testing for the presence of the message.

message SerializedMessage {
bytes content = 1;
}
  • content: A serialized protobuf message. E.g. for configs of a particular trial, the actual message type is defined in the spec file in its respective section: trial:config_type, environment:config_type, and actor_classes:config_type.

TrialActor

Details of an actor participating in a trial.

message TrialActor {
string name = 1;
string actor_class = 2;
}
  • name: The name of the actor.
  • actor_class: The name of the class of actor. For a particular trial, the possible actor classes are defined in the the spec file in the actor_classes:name sections.

Observation

A singular observation.

message Observation {
uint64 tick_id = 1;
fixed64 timestamp = 2;
bytes content = 3;
}
  • tick_id: Tick of this observation.
  • timestamp: The time of the observation.
  • content: The serialized protobuf message representing an observation for a specific actor. In a particular trial, the actual message type for the observation space is defined in the spec file for each actor class in section actor_classes:observation:space. Note that the specific actor represented is defined by the enclosing message.

Action

Data associated with an actor's action.

message Action {
uint64 tick_id = 1;
fixed64 timestamp = 2;
bytes content = 3;
}
  • tick_id: The tick of the observation on which the action is taken.
  • timestamp: The time of the action.
  • content: The serialized protobuf message representing an action from a specific actor. In a particular trial, the actual message type for the action space is defined in the spec file for each actor class in section actor_classes:action:space. Note that the specific actor represented is defined by the enclosing message.

Message

Data associated with a communication (message) destined for an actor or the environment.

message Message {
sint64 tick_id = 1;
string sender_name = 2;
string receiver_name = 3;
google.protobuf.Any payload = 4;
}
  • tick_id: Tick associated with the message.
  • sender_name: The name of the sending actor/environment. This is optional when sending messages (i.e. the sender is already known).
  • receiver_name: The name of the target/receiving actor/environment.
  • payload: Data for the target actor/environment. It is the responsibility of the target to understand the type received.

RewardSource

Data representing a simple reward source made by a single component/sender, usually for the purpose of training automated agents.

message RewardSource {
string sender_name = 1;
float value = 2;
float confidence = 3;
google.protobuf.Any user_data = 4;
}
  • sender_name: Name of the sender that sent the reward. This is not needed when sending because it will be set by the orchestrator. It is only used by receiving actors.
  • value: The numerical value of the provided reward.
  • confidence: The weight of this reward in computing the final (aggregated) reward.
  • user_data: Additional user data to be consumed by the receiving actor. It is the responsibility of the receiver to understand the type received.

Reward

Data representing a reward sent or received, usually for the purpose of training automated agents. -This is an aggregate of possibly multiple RewardSource (but at least one).

message Reward {
sint64 tick_id = 1;
string receiver_name = 2;
float value = 3;
repeated RewardSource sources = 4;
}
  • tick_id: The tick associated with the reward. If set to -1 when sending a reward, the orchestrator will automatically assign the latest tick. This will always be a valid tick (i.e. >= 0) when receiving a reward.
  • receiver_name: Name of the receiving actor (the reward destination).
  • value: The aggregated value (weighted sum) of the provided reward sources. May be ignored when sending a reward; The final value will be computed by the orchestrator.
  • sources: The simple reward sources that form this aggregated reward. There must be at least one.

ObservationSet

A set of environment observations for all actors in the trial.

message ObservationSet {
uint64 tick_id = 1;
fixed64 timestamp = 2;
repeated bytes observations = 3;
repeated int32 actors_map = 4;
}
  • tick_id: The tick to which the observations relate to.
  • timestamp: The time when the observation set was made.
  • observations: A list of observations. Indexed into by the actors_map. Each bytes chunk is a serialized protobuf message representing an observation for a specific actor class. For a particular trial, the actual message type for the observation space is defined in the spec file for each actor class in section actor_classes:observation:space. Note that the specific actor represented is defined by the actors_map.
  • actors_map: A list of indexes into the observations list above. This list of indexes has the same length and order as the list of actors provided in different places in the API (e.g. actors_in_trial), for the same trial.

ActionSet

A set of actions from all actors in the trial.

message ActionSet {
uint64 tick_id = 1;
fixed64 timestamp = 2;
repeated bytes actions = 3;
repeated uint32 unavailable_actors = 4;
}
  • tick_id: The tick to which the actions relate to.
  • timestamp: The time when the action set was made (usually after the last action arrived at the Orchestrator).
  • actions: A list of actions. Each bytes chunk is a serialized protobuf message representing an action from a specific actor. For an particular trial, the actual message type for the action space is defined in the spec file for each actor class in section actor_classes:action:space. This list has the same length and order as the list of actors provided in different places in the API (e.g. actors_in_trial), for the same trial.
  • unavailable_actors: List of actors (index of actors) that were not available. Actors in this list have invalid data in the actions list.

TrialState

Enum representing the state of a trial.

enum TrialState {
UNKNOWN = 0;
INITIALIZING = 1;
PENDING = 2;
RUNNING = 3;
TERMINATING = 4;
ENDED = 5;
}
  • UNKNOWN: Should not be used (it's a requirement of protobuf enums to have a 0 default value).
  • INITIALIZING: The trial is in the process of starting.
  • PENDING: The trial is waiting for its final parameters, all its components to be ready, and the first observation.
  • RUNNING: The trial is running.
  • TERMINATING: The trial is in the process of ending (either a request to end has been received or the last observation has been received).
  • ENDED: The trial has ended. Only a set number of ended trials will be kept in memory (configured in the Orchestrator).

CommunicationState

Enum representing the state of communication with the actors and environment.

enum CommunicationState {
UNKNOWN_COM_STATE = 0;
NORMAL = 1;
HEARTBEAT = 2;
LAST = 3;
LAST_ACK = 4;
END = 5;
}
  • UNKNOWN_COM_STATE: Should not be used (it's a requirement of protobuf enums to have a 0 default value).
  • NORMAL: Normal communication message. Always contains data.
  • HEARTBEAT: Heartbeat request/reply message. Contains no data. When received, must be responded in kind.
  • LAST: Message indicating that the trial is ending, and ending data is following (as NORMAL). Contains no data.
  • LAST_ACK: Message indicating that the last data has been sent (i.e. this is the last outgoing message). Contains no data.
  • END: Message indicating that the trial has ended (i.e. this is the final message). Contains no data, except maybe for details.

The normal (soft) end of a trial follows this sequence :

  1. Orchestrator or Environment sends LAST
  2. Exchange of NORMAL finalizing data
  3. Component sends LAST_ACK (component stops sending after this)
  4. Orchestrator sends NORMAL finalizing data
  5. Orchestrator terminates communication with END

For a hard termination of a trial, the Orchestrator will send END to all components (with no LAST/LAST_ACK handshake).

Control API

This API is defined in orchestrator.proto. It is implemented by the cogment orchestrator, and client applications are expected to connect to it using the gRPC client API.

This API is used for general control and services related to trials.

Service TrialLifecycleSP

service TrialLifecycleSP {
rpc StartTrial(TrialStartRequest) returns (TrialStartReply) {}
rpc TerminateTrial(TerminateTrialRequest) returns (TerminateTrialReply) {}
rpc GetTrialInfo(TrialInfoRequest) returns (TrialInfoReply) {}
rpc WatchTrials(TrialListRequest) returns (stream TrialListEntry) {}
rpc Version(VersionRequest) returns (VersionInfo) {}
}

StartTrial()

Start a new trial.

Metadata: None

TerminateTrial()

Request the environment to terminate existing trial(s).

Metadata:

  • trial-id: (one or more) Identifier(s) of the trial(s) to terminate.

GetTrialInfo()

Get extra information about an existing trial.

Metadata:

  • trial-id: (zero or more) Identifier(s) of the trial(s) we are requesting information about. If no trial id is provided, the request is for information about all active trials.

WatchTrials()

Stream state changes from trials.

Metadata: None

Version()

Request version data.

Metadata: None

TrialStartRequest

Request message for the StartTrial procedure.

message TrialStartRequest {
oneof start_data {
SerializedMessage config = 1;
TrialParams params = 4;
}
string user_id = 2;
string trial_id_requested = 3;
}
  • config: The trial config data. This data can be used by the pre-trial hooks to determine the config for the rest of the components.
  • params: The fully defined parameters for the new trial. When this is given to start the trial, the default parameters are ignored, and the pre-trial hooks will not be called.
  • user_id: The ID of the user that is starting the trial.
  • user_id: The ID of the user that is starting the trial.
  • trial_id_requested: The trial identifier requested for the new trial. It must be unique. If not empty, the Orchestrator will try to use this trial_id, otherwise, a UUID will be created.

TrialStartReply

Reply message for the StartTrial procedure.

message TrialStartReply {
string trial_id = 1;
}
  • trial_id: ID of the newly started trial. Empty if the requested trial ID could not be used.

TerminateTrialRequest

Request message for the TerminateTrial procedure.

message TerminateTrialRequest {}

TerminateTrialReply

Reply message for the TerminateTrial procedure.

message TerminateTrialReply {}

TrialInfoRequest

Request message for the GetTrialInfo procedure.

message TrialInfoRequest {
bool get_latest_observation = 1;
}
  • get_latest_observation: If true, request the latest environment observation available for the trial (in addition to standard information).

TrialInfoReply

Reply message for the GetTrialInfo procedure.

message TrialInfoReply {
repeated TrialInfo trial = 1;
}
  • trial: List of information about the trials. Contains only the requested trial info if a trial ID was provided when the call was made (as metadata to the procedure). Otherwise contains information about all active trials.

TrialInfo

Message containing information about a trial.

message TrialInfo {
string trial_id = 1;
string env_name = 2;
TrialState state = 3;
uint64 tick_id = 4;
fixed64 trial_duration = 5;
ObservationSet latest_observation = 6;
repeated TrialActor actors_in_trial = 7;
}
  • trial_id: The Identifier of the trial.
  • env_name: The name of the environment running the trial.
  • state: The state of the trial.
  • tick_id: The current tick of the trial.
  • trial_duration: The duration of the trial so far, in nanoseconds. If the trial has ended, this is the duration from start to end of the trial. This is meant as an indicator; resolution may not be a nanosecond, and precision is not guaranteed.
  • latest_observation: The latest environment observations for all actors. This will be provided only if requested in the TrialInfoRequest.
  • actors_in_trial: The list of active actors in the trial.

TrialListRequest

Request message for the WatchTrials procedure.

message TrialListRequest {
repeated TrialState filter = 1;
bool full_info = 2;
}
  • filter: The list of states that are requested. If a trial is not in a state found in this list, it will not be reported. If the list is empty, all states will be reported.
  • full_info: If true, full trial information will be returned instead of just trial ID and trial state.

TrialListEntry

Stream reply message for the WatchTrials procedure.

message TrialListEntry {
string trial_id = 1;
TrialState state = 2;
TrialInfo info = 3;
}

  • trial_id: The Identifier of the trial. Only set if info is not present.
  • state: The state of the trial. Only set if info is not present.
  • info: Trial basic information (i.e. without latest_observation and actors_in_trials). Present only if requested with full_info in the TrialListRequest.

Actor API

There are two kinds of actors: Service and Client. They each have their own separate service (respectively ServiceActorSP and ClientActorSP). But the messages are identical and work almost the same way (except for the initial phase).

Service Actor API

This API is defined in agent.proto. It is implemented by the service actor application using the gRPC server API, and the Orchestrator connects to the service actor application using the gRPC client API.

This API is used by service actors that will be participating in new trials. They are connected at the start of a trial in which they participate. +Reported statuses are specific to the service called (or the machine/system/network it is running on).

message StatusReply {
map<string, string> statuses = 1; // <name, value>
}
  • statuses: Requested statuses (name/value) that are available, in no particular order.

TrialParams

Global parameters for a trial (see Trial Parameters).

message TrialParams {
SerializedMessage trial_config = 1;
DatalogParams datalog = 2;
EnvironmentParams environment = 3;
repeated ActorParams actors = 4;
uint32 max_steps = 5;
uint32 max_inactivity = 6;
}
  • trial_config
  • datalog: (optional) The parameters for the datalog of the trial. If not present, data logging is disabled.
  • environment: The parameters for the environment of the trial.
  • actors: The parameters for all actors involved in the trial. This list's length and order define the length and order of the lists of actors provided in different places in the API (e.g. actors_in_trial) for the trial.
  • max_steps
  • max_inactivity

DatalogParams

Parameters related to the data logger (see Trial Parameters).

message DatalogParams {
string endpoint = 1;
repeated string exclude_fields = 2;
}
  • endpoint: This is used by the Orchestrator to connect to the datalog using the LogExporterSP gRPC service.
  • exclude_fields

EnvironmentParams

Parameters related to an environment (see Trial Parameters).

message EnvironmentParams {
string endpoint = 1;
SerializedMessage config = 2;
string implementation = 3;
}
  • endpoint: This is used by the Orchestrator to connect to the environment using the EnvironmentSP gRPC service.
  • config
  • implementation

ActorParams

Parameters related to an actor (see Trial Parameters).

message ActorParams {
string name = 1;
string actor_class = 2;
string endpoint = 3;
string implementation = 4;
SerializedMessage config = 5;
float initial_connection_timeout = 6;
float response_timeout = 7;
bool optional = 8;
SerializedMessage default_action = 9;
}
  • name
  • actor_class
  • endpoint: The endpoint is used by the Orchestrator to connect to the actor using the ServiceActorSP gRPC service. If set to "cogment://client", then the actor is a client and will connect to the Orchestrator instead, using the ClientActorSP gRPC service.
  • implementation
  • config
  • initial_connection_timeout
  • response_timeout
  • optional
  • default_action

SerializedMessage

This contains an optional serialized protobuf message (e.g. config) defined by the user in the spec file. The bytes content is wrapped in a message to be able to differentiate between a default content (i.e. length 0) and the absence of content. This is easily done by testing for the presence of the message.

message SerializedMessage {
bytes content = 1;
}
  • content: A serialized protobuf message. E.g. for configs of a particular trial, the actual message type is defined in the spec file in its respective section: trial:config_type, environment:config_type, and actor_classes:config_type.

TrialActor

Details of an actor participating in a trial.

message TrialActor {
string name = 1;
string actor_class = 2;
}
  • name: The name of the actor.
  • actor_class: The name of the class of actor. For a particular trial, the possible actor classes are defined in the the spec file in the actor_classes:name sections.

Observation

A singular observation.

message Observation {
uint64 tick_id = 1;
fixed64 timestamp = 2;
bytes content = 3;
}
  • tick_id: Tick of this observation.
  • timestamp: The time of the observation.
  • content: The serialized protobuf message representing an observation for a specific actor. In a particular trial, the actual message type for the observation space is defined in the spec file for each actor class in section actor_classes:observation:space. Note that the specific actor represented is defined by the enclosing message.

Action

Data associated with an actor's action.

message Action {
uint64 tick_id = 1;
fixed64 timestamp = 2;
bytes content = 3;
}
  • tick_id: The tick of the observation on which the action is taken.
  • timestamp: The time of the action.
  • content: The serialized protobuf message representing an action from a specific actor. In a particular trial, the actual message type for the action space is defined in the spec file for each actor class in section actor_classes:action:space. Note that the specific actor represented is defined by the enclosing message.

Message

Data associated with a communication (message) destined for an actor or the environment.

message Message {
sint64 tick_id = 1;
string sender_name = 2;
string receiver_name = 3;
google.protobuf.Any payload = 4;
}
  • tick_id: Tick associated with the message.
  • sender_name: The name of the sending actor/environment. This is optional when sending messages (i.e. the sender is already known).
  • receiver_name: The name of the target/receiving actor/environment.
  • payload: Data for the target actor/environment. It is the responsibility of the target to understand the type received.

RewardSource

Data representing a simple reward source made by a single component/sender, usually for the purpose of training automated agents.

message RewardSource {
string sender_name = 1;
float value = 2;
float confidence = 3;
google.protobuf.Any user_data = 4;
}
  • sender_name: Name of the sender that sent the reward. This is not needed when sending because it will be set by the orchestrator. It is only used by receiving actors.
  • value: The numerical value of the provided reward.
  • confidence: The weight of this reward in computing the final (aggregated) reward.
  • user_data: Additional user data to be consumed by the receiving actor. It is the responsibility of the receiver to understand the type received.

Reward

Data representing a reward sent or received, usually for the purpose of training automated agents. +This is an aggregate of possibly multiple RewardSource (but at least one).

message Reward {
sint64 tick_id = 1;
string receiver_name = 2;
float value = 3;
repeated RewardSource sources = 4;
}
  • tick_id: The tick associated with the reward. If set to -1 when sending a reward, the orchestrator will automatically assign the latest tick. This will always be a valid tick (i.e. >= 0) when receiving a reward.
  • receiver_name: Name of the receiving actor (the reward destination).
  • value: The aggregated value (weighted sum) of the provided reward sources. May be ignored when sending a reward; The final value will be computed by the orchestrator.
  • sources: The simple reward sources that form this aggregated reward. There must be at least one.

ObservationSet

A set of environment observations for all actors in the trial.

message ObservationSet {
uint64 tick_id = 1;
fixed64 timestamp = 2;
repeated bytes observations = 3;
repeated int32 actors_map = 4;
}
  • tick_id: The tick to which the observations relate to.
  • timestamp: The time when the observation set was made.
  • observations: A list of observations. Indexed into by the actors_map. Each bytes chunk is a serialized protobuf message representing an observation for a specific actor class. For a particular trial, the actual message type for the observation space is defined in the spec file for each actor class in section actor_classes:observation:space. Note that the specific actor represented is defined by the actors_map.
  • actors_map: A list of indexes into the observations list above. This list of indexes has the same length and order as the list of actors provided in different places in the API (e.g. actors_in_trial), for the same trial.

ActionSet

A set of actions from all actors in the trial.

message ActionSet {
uint64 tick_id = 1;
fixed64 timestamp = 2;
repeated bytes actions = 3;
repeated uint32 unavailable_actors = 4;
}
  • tick_id: The tick to which the actions relate to.
  • timestamp: The time when the action set was made (usually after the last action arrived at the Orchestrator).
  • actions: A list of actions. Each bytes chunk is a serialized protobuf message representing an action from a specific actor. For an particular trial, the actual message type for the action space is defined in the spec file for each actor class in section actor_classes:action:space. This list has the same length and order as the list of actors provided in different places in the API (e.g. actors_in_trial), for the same trial.
  • unavailable_actors: List of actors (index of actors) that were not available. Actors in this list have invalid data in the actions list.

TrialState

Enum representing the state of a trial.

enum TrialState {
UNKNOWN = 0;
INITIALIZING = 1;
PENDING = 2;
RUNNING = 3;
TERMINATING = 4;
ENDED = 5;
}
  • UNKNOWN: Should not be used (it's a requirement of protobuf enums to have a 0 default value).
  • INITIALIZING: The trial is in the process of starting.
  • PENDING: The trial is waiting for its final parameters, all its components to be ready, and the first observation.
  • RUNNING: The trial is running.
  • TERMINATING: The trial is in the process of ending (either a request to end has been received or the last observation has been received).
  • ENDED: The trial has ended. Only a set number of ended trials will be kept in memory (configured in the Orchestrator).

CommunicationState

Enum representing the state of communication with the actors and environment.

enum CommunicationState {
UNKNOWN_COM_STATE = 0;
NORMAL = 1;
HEARTBEAT = 2;
LAST = 3;
LAST_ACK = 4;
END = 5;
}
  • UNKNOWN_COM_STATE: Should not be used (it's a requirement of protobuf enums to have a 0 default value).
  • NORMAL: Normal communication message. Always contains data.
  • HEARTBEAT: Heartbeat request/reply message. Contains no data. When received, must be responded in kind.
  • LAST: Message indicating that the trial is ending, and ending data is following (as NORMAL). Contains no data.
  • LAST_ACK: Message indicating that the last data has been sent (i.e. this is the last outgoing message). Contains no data.
  • END: Message indicating that the trial has ended (i.e. this is the final message). Contains no data, except maybe for details.

The normal (soft) end of a trial follows this sequence :

  1. Orchestrator or Environment sends LAST
  2. Exchange of NORMAL finalizing data
  3. Component sends LAST_ACK (component stops sending after this)
  4. Orchestrator sends NORMAL finalizing data
  5. Orchestrator terminates communication with END

For a hard termination of a trial, the Orchestrator will send END to all components (with no LAST/LAST_ACK handshake).

Control API

This API is defined in orchestrator.proto. It is implemented by the cogment orchestrator, and client applications are expected to connect to it using the gRPC client API.

This API is used for general control and services related to trials.

Service TrialLifecycleSP

service TrialLifecycleSP {
rpc StartTrial(TrialStartRequest) returns (TrialStartReply) {}
rpc TerminateTrial(TerminateTrialRequest) returns (TerminateTrialReply) {}
rpc GetTrialInfo(TrialInfoRequest) returns (TrialInfoReply) {}
rpc WatchTrials(TrialListRequest) returns (stream TrialListEntry) {}
rpc Version(VersionRequest) returns (VersionInfo) {}
}

StartTrial()

Start a new trial.

Metadata: None

TerminateTrial()

Request the environment to terminate existing trial(s).

Metadata:

  • trial-id: (one or more) Identifier(s) of the trial(s) to terminate.

GetTrialInfo()

Get extra information about an existing trial.

Metadata:

  • trial-id: (zero or more) Identifier(s) of the trial(s) we are requesting information about. If no trial id is provided, the request is for information about all active trials.

WatchTrials()

Stream state changes from trials.

Metadata: None

Version()

Request version data.

Metadata: None

TrialStartRequest

Request message for the StartTrial procedure.

message TrialStartRequest {
oneof start_data {
SerializedMessage config = 1;
TrialParams params = 4;
}
string user_id = 2;
string trial_id_requested = 3;
}
  • config: The trial config data. This data can be used by the pre-trial hooks to determine the config for the rest of the components.
  • params: The fully defined parameters for the new trial. When this is given to start the trial, the default parameters are ignored, and the pre-trial hooks will not be called.
  • user_id: The ID of the user that is starting the trial.
  • user_id: The ID of the user that is starting the trial.
  • trial_id_requested: The trial identifier requested for the new trial. It must be unique. If not empty, the Orchestrator will try to use this trial_id, otherwise, a UUID will be created.

TrialStartReply

Reply message for the StartTrial procedure.

message TrialStartReply {
string trial_id = 1;
}
  • trial_id: ID of the newly started trial. Empty if the requested trial ID could not be used.

TerminateTrialRequest

Request message for the TerminateTrial procedure.

message TerminateTrialRequest {}

TerminateTrialReply

Reply message for the TerminateTrial procedure.

message TerminateTrialReply {}

TrialInfoRequest

Request message for the GetTrialInfo procedure.

message TrialInfoRequest {
bool get_latest_observation = 1;
}
  • get_latest_observation: If true, request the latest environment observation available for the trial (in addition to standard information).

TrialInfoReply

Reply message for the GetTrialInfo procedure.

message TrialInfoReply {
repeated TrialInfo trial = 1;
}
  • trial: List of information about the trials. Contains only the requested trial info if a trial ID was provided when the call was made (as metadata to the procedure). Otherwise contains information about all active trials.

TrialInfo

Message containing information about a trial.

message TrialInfo {
string trial_id = 1;
string env_name = 2;
TrialState state = 3;
uint64 tick_id = 4;
fixed64 trial_duration = 5;
ObservationSet latest_observation = 6;
repeated TrialActor actors_in_trial = 7;
}
  • trial_id: The Identifier of the trial.
  • env_name: The name of the environment running the trial.
  • state: The state of the trial.
  • tick_id: The current tick of the trial.
  • trial_duration: The duration of the trial so far, in nanoseconds. If the trial has ended, this is the duration from start to end of the trial. This is meant as an indicator; resolution may not be a nanosecond, and precision is not guaranteed.
  • latest_observation: The latest environment observations for all actors. This will be provided only if requested in the TrialInfoRequest.
  • actors_in_trial: The list of active actors in the trial.

TrialListRequest

Request message for the WatchTrials procedure.

message TrialListRequest {
repeated TrialState filter = 1;
bool full_info = 2;
}
  • filter: The list of states that are requested. If a trial is not in a state found in this list, it will not be reported. If the list is empty, all states will be reported.
  • full_info: If true, full trial information will be returned instead of just trial ID and trial state.

TrialListEntry

Stream reply message for the WatchTrials procedure.

message TrialListEntry {
string trial_id = 1;
TrialState state = 2;
TrialInfo info = 3;
}

  • trial_id: The Identifier of the trial. Only set if info is not present.
  • state: The state of the trial. Only set if info is not present.
  • info: Trial basic information (i.e. without latest_observation and actors_in_trials). Present only if requested with full_info in the TrialListRequest.

Actor API

There are two kinds of actors: Service and Client. They each have their own separate service (respectively ServiceActorSP and ClientActorSP). But the messages are identical and work almost the same way (except for the initial phase).

Service Actor API

This API is defined in agent.proto. It is implemented by the service actor application using the gRPC server API, and the Orchestrator connects to the service actor application using the gRPC client API.

This API is used by service actors that will be participating in new trials. They are connected at the start of a trial in which they participate. Multiple simultaneous service actors can be served from a single service application instance (i.e. same endpoint). -An actor endpoint, for the Orchestrator to connect to, is defined in the trial parameters.

Service ServiceActorSP

service ServiceActorSP {
rpc RunTrial(stream ActorRunTrialInput) returns (stream ActorRunTrialOutput) {}
rpc Version(VersionRequest) returns (VersionInfo) {}
}

Client Actor API

This API is defined in orchestrator.proto. It is implemented by the Orchestrator using the gRPC server API, and client applications are expected to connect to the Orchestrator using the gRPC client API.

This API is used by client actors participating in existing (initializing) trials. The trial expecting client actors will wait for all actors to be connected before starting the trial. -The actors connecting this way must have an endpoint set to "cogment://client" in the trial parameters.

Note the reversal of the input and output messages compared to the service actor RunTrial procedure.

Service ClientActorSP

service ClientActorSP {
rpc RunTrial(stream ActorRunTrialOutput) returns (stream ActorRunTrialInput) {}
rpc Version(VersionRequest) returns (VersionInfo) {}
}

RunTrial()

Procedure call to participate in a trial. It is active for the duration of the trial. +An actor endpoint, for the Orchestrator to connect to, is defined in the trial parameters.

Service ServiceActorSP

service ServiceActorSP {
rpc RunTrial(stream ActorRunTrialInput) returns (stream ActorRunTrialOutput) {}
rpc Version(VersionRequest) returns (VersionInfo) {}
}

Client Actor API

This API is defined in orchestrator.proto. It is implemented by the Orchestrator using the gRPC server API, and client applications are expected to connect to the Orchestrator using the gRPC client API.

This API is used by client actors participating in existing (initializing) trials. The trial expecting client actors will wait for all actors to be connected before starting the trial. +The actors connecting this way must have an endpoint set to "cogment://client" in the trial parameters.

Note the reversal of the input and output messages compared to the service actor RunTrial procedure.

Service ClientActorSP

service ClientActorSP {
rpc RunTrial(stream ActorRunTrialOutput) returns (stream ActorRunTrialInput) {}
rpc Version(VersionRequest) returns (VersionInfo) {}
}

RunTrial()

Procedure call to participate in a trial. It is active for the duration of the trial. Actor actions and data are provided to the Orchestrator in the output message stream, and observations and data are provided by the Orchestrator in the input message stream.

Metadata:

  • trial-id: Identifier of the trial the actor is participating in. This is supplied to service actors, but must be supplied by client actors.

Version()

Request version data.

Metadata: None

ActorRunTrialInput

Message received by actors during the streaming RunTrial procedure. data should contain a message only when state is NORMAL (or in the case of a hard termination, details can be sent with state END). -Defined in the common.proto file.

message ActorRunTrialInput {
CommunicationState state = 1;
oneof data {
ActorInitialInput init_input = 2;
Observation observation = 3;
Reward reward = 4;
Message message = 5;
string details = 6;
}
}
  • state: The state of this communication message. Identifies this message as a data or a control message.
  • init_input: The initial communication data at the start of a trial. It should always be the first NORMAL state message in the stream. Used to report the details of the trial the actor is participating in.
  • observation: An observation from the environment.
  • reward: Rewards from other participants in the trial.
  • message: A message from other participants in the trial.
  • details: Explanation for special circumstances, for example when receiving a hard termination signal (a state of END without LAST or LAST_ACK).

ActorRunTrialOutput

Message sent by actors during the streaming RunTrial procedure. data should contain a message only when state is NORMAL. -Defined in the common.proto file.

message ActorRunTrialOutput {
CommunicationState state = 1;
oneof data {
ActorInitialOutput init_output = 2;
Action action = 3;
Reward reward = 4;
Message message = 5;
string details = 6;
}
}
  • state: The state of this communication message. Identifies this message as a data or a control message.
  • init_output: The initial communication data at the start of a trial. It should always be the first NORMAL state message in the stream. Used to initiate or acknowledge connection to a trial.
  • action: An action from the actor.
  • reward: A reward for other participants in the trial.
  • message: A message for other participants in the trial.
  • details: Reserved.

ActorInitialInput

The initial communication message at the start of a trial. Used to report the details of the trial the actor is participating in. +Defined in the common.proto file.

message ActorRunTrialInput {
CommunicationState state = 1;
oneof data {
ActorInitialInput init_input = 2;
Observation observation = 3;
Reward reward = 4;
Message message = 5;
string details = 6;
}
}
  • state: The state of this communication message. Identifies this message as a data or a control message.
  • init_input: The initial communication data at the start of a trial. It should always be the first NORMAL state message in the stream. Used to report the details of the trial the actor is participating in.
  • observation: An observation from the environment.
  • reward: Rewards from other participants in the trial.
  • message: A message from other participants in the trial.
  • details: Explanation for special circumstances, for example when receiving a hard termination signal (a state of END without LAST or LAST_ACK).

ActorRunTrialOutput

Message sent by actors during the streaming RunTrial procedure. data should contain a message only when state is NORMAL. +Defined in the common.proto file.

message ActorRunTrialOutput {
CommunicationState state = 1;
oneof data {
ActorInitialOutput init_output = 2;
Action action = 3;
Reward reward = 4;
Message message = 5;
string details = 6;
}
}
  • state: The state of this communication message. Identifies this message as a data or a control message.
  • init_output: The initial communication data at the start of a trial. It should always be the first NORMAL state message in the stream. Used to initiate or acknowledge connection to a trial.
  • action: An action from the actor.
  • reward: A reward for other participants in the trial.
  • message: A message for other participants in the trial.
  • details: Reserved.

ActorInitialInput

The initial communication message at the start of a trial. Used to report the details of the trial the actor is participating in. For service actors, this message initiates the connection stream for a new trial. The trial ID is provided in the metadata of the RunTrial procedure. -For client actors, this message is a reply to a connection request to an existing trial.

message ActorInitialInput {
string actor_name = 1;
string actor_class = 2;
string impl_name = 3;
string env_name = 4;
SerializedMessage config = 5;
}
  • actor_name: The name of the actor participating in the trial.
  • actor_class: The actor class of the actor participating in the trial.
  • impl_name: (optional) Name of the implementation that should run the actor in this trial. If not provided, an arbitrary implementation will be used.
  • env_name: The name of the environment running the trial the actor is participating in.
  • config: The configuration to start the actor.

ActorInitialOutput

The initial communication message at the start of a trial. Used to initiate or acknowledge connection to a trial. +For client actors, this message is a reply to a connection request to an existing trial.

message ActorInitialInput {
string actor_name = 1;
string actor_class = 2;
string impl_name = 3;
string env_name = 4;
SerializedMessage config = 5;
}
  • actor_name: The name of the actor participating in the trial.
  • actor_class: The actor class of the actor participating in the trial.
  • impl_name: (optional) Name of the implementation that should run the actor in this trial. If not provided, an arbitrary implementation will be used.
  • env_name: The name of the environment running the trial the actor is participating in.
  • config: The configuration to start the actor.

ActorInitialOutput

The initial communication message at the start of a trial. Used to initiate or acknowledge connection to a trial. For service actors, this message is empty and serves to acknowledge that the actor is ready to start the trial. -For client actors, this message serves as a request to connect to an existing trial. The trial ID is provided in the metadata of the RunTrial procedure.

message ActorInitialOutput {
oneof slot_selection {
string actor_class = 1;
string actor_name = 2;
}
}
  • actor_name: The name in the trial that the client actor wants to participate as.
  • actor_class: The class in the trial that the client actor wants to participate as. In this case, there may be many options, and the Orchestrator will decide precisely which name the client actor will receive.

Environment API

This API is defined in environment.proto. It is implemented by the environment application using the gRPC server API, and the Orchestrator connects to the environment application using the gRPC client API.

This API is used by environments that will run trials. +For client actors, this message serves as a request to connect to an existing trial. The trial ID is provided in the metadata of the RunTrial procedure.

message ActorInitialOutput {
oneof slot_selection {
string actor_class = 1;
string actor_name = 2;
}
}
  • actor_name: The name in the trial that the client actor wants to participate as.
  • actor_class: The class in the trial that the client actor wants to participate as. In this case, there may be many options, and the Orchestrator will decide precisely which name the client actor will receive.

Environment API

This API is defined in environment.proto. It is implemented by the environment application using the gRPC server API, and the Orchestrator connects to the environment application using the gRPC client API.

This API is used by environments that will run trials. There is only one environment per trial. Multiple simultaneous environments (for different trials) can be served from a single environment application instance (endpoint). -The environment endpoint, for the Orchestrator to connect to, is defined in the trial parameters.

Service EnvironmentSP

service EnvironmentSP {
rpc RunTrial(stream EnvRunTrialInput) returns (stream EnvRunTrialOutput) {}
rpc Version(VersionRequest) returns (VersionInfo) {}
}

RunTrial()

Procedure call to participate in a trial. It is active for the duration of the trial. -Actor actions and data are provided by the Orchestrator in the input message stream, and observations and data are provided to the Orchestrator in the output message stream.

Metadata:

  • trial-id: Identifier of the trial the environment is participating in.

Version()

Called to request version data.

Metadata: None

EnvrRunTrialInput

Message received by the environment during the streaming RunTrial procedure. data should contain a message only when state is NORMAL (or in the case of a hard termination, details can be sent with state END).

message EnvRunTrialInput {
CommunicationState state = 1;
oneof data {
EnvInitialInput init_input = 2;
ActionSet action_set = 3;
Message message = 4;
string details = 5;
}
}
  • state: The state of this communication message. Identifies this message as a data or a control message.
  • init_input: The initial communication data at the start of a trial. It should always be the first NORMAL state message in the stream. Used to provide the details of the trial the environment will run.
  • action_set: Actions from all actors in the trial.
  • message: A message from other participants in the trial.
  • details: Explanation for special circumstances, for example when receiving a hard termination signal (a state of END without LAST or LAST_ACK).

EnvRunTrialOutput

Message sent by the environment during the streaming RunTrial procedure. data should contain a message only when state is NORMAL.

message EnvRunTrialOutput {
CommunicationState state = 1;
oneof data {
EnvInitialOutput init_output = 2;
ObservationSet observation_set = 3;
Reward reward = 4;
Message message = 5;
string details = 6;
}
}
  • state: The state of this communication message. Identifies this message as a data or a control message.
  • init_output: The initial communication data at the start of a trial. It should always be the first NORMAL state message in the stream. Used to acknowledge that the environment is ready to run the trial. Note that the trial will only really start when the environment sends the first set of observations.
  • observation_set: Observations for all actors in the trial.
  • reward: A reward for other participants in the trial.
  • message: A message for other participants in the trial.
  • details: Reserved.

EnvInitialInput

The initial communication message at the start of a trial. This message initiates the connection stream for a new trial. The trial ID is provided in the metadata of the RunTrial procedure.

message EnvInitialInput {
string name = 1;
string impl_name = 2;
uint64 tick_id = 3;
repeated TrialActor actors_in_trial = 4;
SerializedMessage config = 5;
}
  • name: The name of the environment participating in the trial.
  • impl_name: (optional) Name of the implementation that should run the environment in this trial. If not provided, an arbitrary implementation will be used.
  • tick_id: Initial tick id requested to start the environment.
  • actors_in_trial: The list of all actors participating in the trial. This list has the same length and order as the list of actors provided in different places in the API, for the same trial.
  • config: The configuration to start the environment.

EnvInitialOutput

The initial communication message at the start of a trial. This message is empty and serves to acknowledge that the environment is ready to run the trial.

message EnvInitialOutput {}

Data/Log API

This API is defined in datalog.proto. It is implemented by the data logger application using the gRPC server API, including the out-of-the-box component cogment-trial-datastore.

The data logger endpoint, for the orchestrator to connect to, is defined in the trial parameters.

Service LogExporterSP

service LogExporterSP {
rpc RunTrialDatalog(stream LogExporterSampleRequest) returns (LogExporterSampleReply) {}
rpc Version(VersionRequest) returns (VersionInfo) {}
}

RunTrialDatalog()

Called for each trial, at the start of the trial. +The environment endpoint, for the Orchestrator to connect to, is defined in the trial parameters.

Service EnvironmentSP

service EnvironmentSP {
rpc RunTrial(stream EnvRunTrialInput) returns (stream EnvRunTrialOutput) {}
rpc Version(VersionRequest) returns (VersionInfo) {}
}

RunTrial()

Procedure call to participate in a trial. It is active for the duration of the trial. +Actor actions and data are provided by the Orchestrator in the input message stream, and observations and data are provided to the Orchestrator in the output message stream.

Metadata:

  • trial-id: Identifier of the trial the environment is participating in.

Version()

Called to request version data.

Metadata: None

EnvrRunTrialInput

Message received by the environment during the streaming RunTrial procedure. data should contain a message only when state is NORMAL (or in the case of a hard termination, details can be sent with state END).

message EnvRunTrialInput {
CommunicationState state = 1;
oneof data {
EnvInitialInput init_input = 2;
ActionSet action_set = 3;
Message message = 4;
string details = 5;
}
}
  • state: The state of this communication message. Identifies this message as a data or a control message.
  • init_input: The initial communication data at the start of a trial. It should always be the first NORMAL state message in the stream. Used to provide the details of the trial the environment will run.
  • action_set: Actions from all actors in the trial.
  • message: A message from other participants in the trial.
  • details: Explanation for special circumstances, for example when receiving a hard termination signal (a state of END without LAST or LAST_ACK).

EnvRunTrialOutput

Message sent by the environment during the streaming RunTrial procedure. data should contain a message only when state is NORMAL.

message EnvRunTrialOutput {
CommunicationState state = 1;
oneof data {
EnvInitialOutput init_output = 2;
ObservationSet observation_set = 3;
Reward reward = 4;
Message message = 5;
string details = 6;
}
}
  • state: The state of this communication message. Identifies this message as a data or a control message.
  • init_output: The initial communication data at the start of a trial. It should always be the first NORMAL state message in the stream. Used to acknowledge that the environment is ready to run the trial. Note that the trial will only really start when the environment sends the first set of observations.
  • observation_set: Observations for all actors in the trial.
  • reward: A reward for other participants in the trial.
  • message: A message for other participants in the trial.
  • details: Reserved.

EnvInitialInput

The initial communication message at the start of a trial. This message initiates the connection stream for a new trial. The trial ID is provided in the metadata of the RunTrial procedure.

message EnvInitialInput {
string name = 1;
string impl_name = 2;
uint64 tick_id = 3;
repeated TrialActor actors_in_trial = 4;
SerializedMessage config = 5;
}
  • name: The name of the environment participating in the trial.
  • impl_name: (optional) Name of the implementation that should run the environment in this trial. If not provided, an arbitrary implementation will be used.
  • tick_id: Initial tick id requested to start the environment.
  • actors_in_trial: The list of all actors participating in the trial. This list has the same length and order as the list of actors provided in different places in the API, for the same trial.
  • config: The configuration to start the environment.

EnvInitialOutput

The initial communication message at the start of a trial. This message is empty and serves to acknowledge that the environment is ready to run the trial.

message EnvInitialOutput {}

Data/Log API

This API is defined in datalog.proto. It is implemented by the data logger application using the gRPC server API, including the out-of-the-box component cogment-trial-datastore.

The data logger endpoint, for the orchestrator to connect to, is defined in the trial parameters.

Service LogExporterSP

service LogExporterSP {
rpc RunTrialDatalog(stream LogExporterSampleRequest) returns (LogExporterSampleReply) {}
rpc Version(VersionRequest) returns (VersionInfo) {}
}

RunTrialDatalog()

Called for each trial, at the start of the trial. The first data received are the parameters. Data samples are provided in the request stream following the parameters. -The stream is maintained for the duration of the trial.

Metadata:

  • trial-id: Identifier of the trial that is the source of the data.
  • user-id: Identifier of the user that started the trial.

Version()

Called to request version data.

Metadata: None

LogExporterSampleRequest

Stream request message for the RunTrialDatalog procedure.

message SampleInfo {
bool out_of_sync = 5;
uint64 tick_id = 1;
fixed64 timestamp = 2;
TrialState state = 3;
repeated string special_events = 4;
}

message DatalogSample {
SampleInfo info = 1;

ObservationSet observations = 2;
repeated Action actions = 3;
repeated Reward rewards = 4;
repeated Message messages = 5;
repeated uint32 default_actors = 6;
repeated uint32 unavailable_actors = 7;
}

message LogExporterSampleRequest {
oneof msg {
TrialParams trial_params = 1;
DatalogSample sample = 2;
}
}
  • out_of_sync: If false, this sample is a normal and full sample. If true, it is an out-of-sync sample that is partially filled, and some of the other value may have a slightly different meaning than for a normal sample.
  • tick_id: The tick the data relates to.
  • timestamp: The time the data was received. For a full sample, this is the time the observation set was received by the Orchestrator.
  • state: The state of the trial at the end of the tick. For out-of-sync samples, the state is undefined.
  • special_events: Events not visible from the rest of the data may appear in here. Out-of-sync samples will usually have an explanation of data in the special events list.
  • observations: Observations from the environment. Out-of-sync samples may not have observations.
  • actions: Actions from all actors. This list has the same length and order as the list of actors provided in trial_params. This list may be empty for out-of-sync samples.
  • rewards: List of rewards sent to actors.
  • messages: List of user data sent to actors or the environment.
  • default_actors: List of actors (index of actors) that were not available but had a default action. Actors in this list have invalid data in the actions list.
  • unavailable_actors: List of actors (index of actors) that were not available and did not have a default action. Actors in this list have invalid data in the actions list.
  • trial_params: Trial parameters used for a trial. This is sent on start of a trial, as the first message in the RunTrialDatalog stream.
  • sample: A data sample to be logged. It can be an out-of-sync sample which contains only partial data.

LogExporterSampleReply

Reply message for the RunTrialDatalog procedure.

message LogExporterSampleReply {}

Hook API

This API is defined in hooks.proto. It is implemented by the pre-trial hook application using the gRPC server API, and the orchestrator connects to the application.

The pre-trial hook endpoint, for the orchestrator to connect to, are defined on the command line of the Orchestrator (or in environment variables).

Service TrialHooksSP

service TrialHooksSP {
rpc OnPreTrial(PreTrialParams) returns (PreTrialParams) {}
rpc Version(VersionRequest) returns (VersionInfo) {}
}

OnPreTrial()

Called before a trial is started to set or modify the parameters for the trial.

Metadata:

  • trial-id: Identifier of the new trial that will be started.
  • user-id: Identifier of the user that started the trial.

Version()

Called to request version data.

Metadata: None

Directory API

This API is defined in directory.proto. It is implemented by the Directory application using the gRPC server API.

Service DirectorySP

service DirectorySP {
rpc Register(stream RegisterRequest) returns (stream RegisterReply) {}
rpc Deregister(stream DeregisterRequest) returns (stream DeregisterReply) {}
rpc Inquire(InquireRequest) returns (stream InquireReply) {}
rpc Version(VersionRequest) returns (VersionInfo) {}
}

Register()

Called to register (add) services to the directory.

Metadata:

  • authentication_token: (Optional) Token of the services being registered. This will be registered with the services and must match when inquiring or deregistering a service.

Deregister()

Called to deregister (remove) previously registered services to the directory.

Metadata:

  • authentication_token: (Optional) Token to authenticate services. This must match the token of the registered services.

Inquire()

Called to inquire (search) the directory for registered services.

Metadata:

  • authentication_token: (Optional) Token to identify the services. This must match the token of the inquired services.

Version()

Called to request version data.

Metadata: None

ServiceType

Type of service registered. This serves to know how to test for health.

enum ServiceType {
UNKNOWN_SERVICE = 0;
TRIAL_LIFE_CYCLE_SERVICE = 1;
CLIENT_ACTOR_CONNECTION_SERVICE = 2;
ACTOR_SERVICE = 3;
ENVIRONMENT_SERVICE = 4;
PRE_HOOK_SERVICE = 5;
DATALOG_SERVICE = 6;
DATASTORE_SERVICE = 7;
MODEL_REGISTRY_SERVICE = 8;
DIRECTORY_SERVICE = 9;
OTHER_SERVICE = 100;
}
  • UNKNOWN_SERVICE: Should not be used (it's a requirement of protobuf enums to have a 0 default value).
  • TRIAL_LIFE_CYCLE_SERVICE: Cogment service accessed with gRPC service TrialLifecycleSP.
  • CLIENT_ACTOR_CONNECTION_SERVICE: Cogment service accessed with gRPC service ClientActorSP.
  • ACTOR_SERVICE: Cogment service accessed with gRPC service ServiceActorSP.
  • ENVIRONMENT_SERVICE: Cogment service accessed with gRPC service EnvironmentSP.
  • PRE_HOOK_SERVICE: Cogment service accessed with gRPC service TrialHooksSP.
  • DATALOG_SERVICE: Cogment service accessed with gRPC service DatalogSP.
  • DATASTORE_SERVICE: Cogment service accessed with gRPC service TrialDatastoreSP.
  • MODEL_REGISTRY_SERVICE: Cogment service accessed with gRPC service ModelRegistrySP.
  • DIRECTORY_SERVICE: Cogment service accessed with gRPC service DirectorySP.
  • OTHER_SERVICE: This is for services not provided by Cogment or that do not have a dedicated service type. The properties registered in the directory should provide the necessary information, but this is left to the users to manage, and no health checking is performed.

ServiceDetails

Message containing registration details of a service.

message ServiceDetails {
ServiceType type = 1;
map<string, string> properties = 2;
}
  • type: The type of service.
  • properties: Properties associated with the service, in a map (property name : property value).

ServiceEndpoint

Message containing endpoint (connection) details for a service.

message ServiceEndpoint {
enum Protocol {
UNKNOWN = 0;
GRPC = 1;
GRPC_SSL = 2;
COGMENT = 3;
}

Protocol protocol = 1;
string host = 2;
uint32 port = 3;
}
  • Protocol: The communication protocol for the service.
    • UNKNOWN: Should not be used (it's a requirement of protobuf enums to have a 0 default value).
    • GRPC: The service connection is using gRPC and does not require encryption (SSL).
    • GRPC_SSL: The service connection is using gRPC and is expecting encryption (SSL).
    • COGMENT: This is a protocol specific to Cogment. The host will provide more details.
  • host: For gRPC, this is a network accessible hostname or IP address. For Cogment, this can only be client, which indicates that the service is not really a service, but a client, and will connect and not be connected to.
  • port: For gRPC, this is the TCP port to connect to. For Cogment, this is not used.

RegisterRequest

Request message for the Register procedure.

message RegisterRequest {
// URL where to connect to the service.
ServiceEndpoint endpoint = 1;
ServiceDetails details = 2;
}
  • endpoint: The connection endpoint of the service to be registered.
  • details: The service details to be registered for the service.

RegisterReply

Reply message for the Register procedure.

message RegisterReply {
enum Status {
UNKNOWN = 0;
OK = 1;
FAILED = 2;
}
Status status = 1;
string error_msg = 2;
uint64 service_id = 3;
string secret = 4;
}
  • Status: The result status.
    • UNKNOWN: Should not be used (it's a requirement of protobuf enums to have a 0 default value).
    • OK: Registration succeeded and the data is valid.
    • FAILED: Registration failed, the data is invalid (more details may be available in the error message).
  • status: The status of the corresponding registration request.
  • error_msg: Any extra details about the failure of the registration (if status == FAILED).
  • service_id: The ID that the service was given when it was registered in the Directory.
  • secret: This is a string that must be provided to deregister the service, and cannot be inquired.

DeregisterRequest

Request message for the Deregister procedure.

message DeregisterRequest {
uint64 service_id = 1;
string secret = 2;
}
  • service_id: The ID of the service.
  • secret: The string that was given when the service was registered.

DeregisterReply

Reply message for the Deregister procedure.

message DeregisterReply {
enum Status {
UNKNOWN = 0;
OK = 1;
FAILED = 2;
}
Status status = 1;
string error_msg = 2;
}
  • Status: The result status.
    • UNKNOWN: Should not be used (it's a requirement of protobuf enums to have a 0 default value).
    • OK: Deregistration succeeded.
    • FAILED: Deregistration failed (more details may be available in the error message).
  • status: The status of the corresponding deregistration request.
  • error_msg: Any extra details about the failure to deregister the service (if status == FAILED).

InquireRequest

Request message for the Inquire procedure. Requires either a service ID, or details of services to find.

message InquireRequest {
oneof inquiry {
uint64 service_id = 1;
ServiceDetails details = 2;
}
}
  • service_id: The ID of the service.
  • details: The details of services to find.

InquireReply

Reply message for the Inquire procedure.

message FullServiceData {
ServiceEndpoint endpoint = 1;
uint64 service_id = 2;
ServiceDetails details = 3;
}

message InquireReply {
FullServiceData data = 1;
}
  • endpoint: The connection endpoint of the service.
  • service_id: The ID of the service.
  • details: The details of the service.

Model Registry API

This API is defined in model_registry.proto. It is implemented by cogment-model-registry.

Service ModelRegistrySP

This gRPC API defines a service able to store models, e.g. neural network architecture, weights and any additional parameters.

service ModelRegistrySP {
rpc CreateOrUpdateModel(CreateOrUpdateModelRequest) returns (CreateOrUpdateModelReply) {}
rpc DeleteModel(DeleteModelRequest) returns (DeleteModelReply) {}
rpc RetrieveModels(RetrieveModelsRequest) returns (RetrieveModelsReply) {}

rpc CreateVersion(stream CreateVersionRequestChunk) returns (CreateVersionReply) {}
rpc RetrieveVersionInfos(RetrieveVersionInfosRequest) returns (RetrieveVersionInfosReply) {}
rpc RetrieveVersionData(RetrieveVersionDataRequest) returns (stream RetrieveVersionDataReplyChunk) {}

rpc Version(VersionRequest) returns (VersionInfo) {}
}

CreateOrUpdateModel()

Create or update a model in the registry having the given unique (within the registry) model_id.

DeleteModel()

Delete a given model and all its iterations from the registry.

RetrieveModels()

Retrieve all or selected models. This procedure supports paginated requests.

CreateVersion()

Create a new iteration of a given model. Because of their potential large size, model iteration data are uploaded as a stream.

RetrieveVersionInfos()

Retrieve the information for all or selected iterations of a given model.

RetrieveVersionData()

Retrieve the data for a specific iteration of the model. Because of their potential large size, data are retrieved as a stream.

CreateOrUpdateModelRequest

Request for ModelRegistrySP.CreateOrUpdateModel()

message CreateOrUpdateModelRequest {
ModelInfo model_info = 1;
}
  • model_info: Defines the unique model identifier within the registry and the user_data to use to create or update the model.

CreateOrUpdateModelReply

Reply for ModelRegistrySP.CreateOrUpdateModel()

message CreateOrUpdateModelReply {}

DeleteModelRequest

Request for ModelRegistrySP.DeleteModel()

message DeleteModelRequest {
string model_id = 1;
}
  • model_ids: Identifier of the model to be deleted.

DeleteModelReply

Reply for ModelRegistrySP.DeleteModel()

message DeleteModelReply {}

RetrieveModelsRequest

Request for ModelRegistrySP.RetrieveModel().

message RetrieveModelsRequest {
repeated string model_ids = 1;
uint32 models_count = 3;
string model_handle = 4;
}
  • model_ids: List of the identifiers of the desired models, leave empty to retrieve all models.
  • models_count: (optional) The desired number of models to be retrieved, leave empty (or set to 0) to retrieve all models matching the request.
  • model_handle: (optional) Leave empty for the initial request, use previously provided RetrieveModelsReply.next_model_handle on the next calls to retrieve the next models.

RetrieveModelsReply

Reply for ModelRegistrySP.RetrieveModel().

message RetrieveModelsReply {
repeated ModelInfo model_infos = 1;
string next_model_handle = 2;
}
  • model_infos: At most RetrieveModelsRequest.models_count models.
  • next_model_handle: Opaque handle to be used to retrieve the next models matching the request.

CreateVersionRequestChunk

Part of the request stream for ModelRegistrySP.CreateVersion().

message CreateVersionRequestChunk {
message Header {
ModelVersionInfo version_info = 1;
}
message Body {
bytes data_chunk = 1;
}
oneof msg {
Header header = 1;
Body body = 2;
}
}

The first message in the stream should define header:

  • version_info: Information regarding the model iteration to create, version_number will be ignored. data_hash and data_size should be computed from the total final data and will be used by the server to validate it.

The following messages should define body:

  • data_chunk: A chunk of the iteration data, all the chunks in the stream will be concatenated.

CreateVersionReply

Reply for ModelRegistrySP.CreateVersion().

message CreateVersionReply {
ModelVersionInfo version_info = 1;
}
  • version_info: The information relative to the created model iteration, in particular the defined version_number.

RetrieveVersionInfosRequest

Request for ModelRegistrySP.RetrieveVersionInfos().

message RetrieveVersionInfosRequest {
string model_id = 1;
repeated int32 version_numbers = 2;
uint32 versions_count = 3;
string version_handle = 4;
}
  • model_id: Identifier of the model we want to retrieve iterations from.
  • version_numbers: List of desired iteration number (or -1 to denote the latest iteration). Leave empty to retrieve all iterations of the given model.
  • versions_count: (optional) The desired number of iterations to be retrieved, leave empty (or set to 0) to retrieve all the iterations matching the request.
  • version_handle: (optional) Leave empty for the initial request, use previously provided RetrieveVersionInfosReply.next_version_handle on the next calls to retrieve the next iterations.

RetrieveVersionInfosReply

Reply for ModelRegistrySP.RetrieveVersionInfos().

message RetrieveVersionInfosReply {
repeated ModelVersionInfo version_infos = 1;
string next_version_handle = 2;
}
  • version_infos: At most RetrieveVersionInfosRequest.versions_count iterations.
  • next_version_handle: Opaque handle to be used to retrieve the next iterations matching the request.

RetrieveVersionDataRequest

Request for ModelRegistrySP.RetrieveVersionData().

message RetrieveVersionDataRequest {
string model_id = 1;
int32 version_number = 2;
}
  • model_id: Identifier of the model we want to retrieve iteration from.
  • version_numbers: Number of the desired iteration.

RetrieveVersionDataReplyChunk

Part of the reply stream of ModelRegistrySP.RetrieveVersionData().

message RetrieveVersionDataReplyChunk {
bytes data_chunk = 1;
}
  • data_chunk: A chunk of the iteration data. All the chunks in the stream need to be concatenated. The completeness and validity of the received data can be checked using the iteration's data_size and data_hash respectively.

ModelInfo

Defines a model identifier and associated user data.

message ModelInfo {
string model_id = 1;
map<string, string> user_data = 2;
}
  • model_id: Unique model identifier.
  • user_data: Key/value user data associated with the model.

ModelVersionInfo

Defines a model iteration and associated user data.

message ModelVersionInfo {
string model_id = 1;
uint32 version_number = 2;
fixed64 creation_timestamp = 3;
bool archived = 4;
string data_hash = 5;
fixed64 data_size = 6;
map<string, string> user_data = 7;
}
  • model_id: Unique identifier, within the registry, of this iteration's model.
  • version_number: Unique iteration number, assigned incrementally at creation by the model registry.
  • creation_timestamp: When the model was created as nanosecond Unix epoch time.
  • archived: If true, this iteration is archived and should be stored in a long-term storage. If false, this iteration is not archived and can be evicted after a while. Non-archived iterations should be used to broadcast an update of the model during training.
  • data_hash: SHA 256 hash (encoded in base64 with standard 64 characters with padding) of this iteration's data, can be used to validate the data and for caching purposes.
  • data_size: Size (in bytes) of this iteration's data.
  • user_data: Key/value user data associated with the model, in particular it can be used to provide information required for the deserialization of the data.

Version()

Called to request iteration data.

Metadata: None

Trial Datastore API

This API is defined in trial_datastore.proto. It is implemented by cogment-trial-datastore.

Service TrialDatastoreSP

This gRPC API defines a service to manage and access data generated by trials.

service TrialDatastoreSP {
rpc RetrieveTrials(RetrieveTrialsRequest) returns (RetrieveTrialsReply) {}
rpc RetrieveSamples(RetrieveSamplesRequest) returns (stream RetrieveSampleReply) {}

rpc AddTrial(AddTrialRequest) returns (AddTrialReply) {}
rpc AddSample(stream AddSampleRequest) returns (AddSamplesReply) {}
rpc DeleteTrials(DeleteTrialsRequest) returns (DeleteTrialsReply) {}

rpc Version(VersionRequest) returns (VersionInfo) {}
}

RetrieveTrials()

Retrieve stored trials matching the given request.

RetrieveSamples()

Retrieve samples from matching trials, trials can be ongoing.

AddTrial()

Add a trial to the activity logger, as soon as a trial is added, samples can be retrieved using RetrieveSamples().

AddSample()

Add samples to a trial in the activity logger as a stream, as soon as a sample is added it is pushed to the matching ongoing RetrieveSamples() requests.

DeleteTrials()

Delete the trials matching the given request, on failure no trial is deleted.

StoredTrialInfo

Defines a information about a stored trial

message StoredTrialInfo {
string trial_id = 1;
TrialState last_state = 2;
string user_id = 3;
uint32 samples_count = 4;
TrialParams params = 5;
}
  • trial_id: Unique identifier of the trial.
  • last_state: Last known trial state.
  • user_id: The id of the user that has started the trial.
  • samples_count: The number samples that are stored for this trial.
  • params: Parameters of the trial.

StoredTrialSample

Represents a sample generated by a trial at a given tick.

message StoredTrialSample {
string user_id = 1;
string trial_id = 2;
uint64 tick_id = 3;
fixed64 timestamp = 4;
TrialState state = 5;
repeated StoredTrialActorSample actor_samples = 6;
repeated bytes payloads = 7;
}
  • user_id: The identifier of the user that has started the trial.
  • trial_id: Unique identifier of the trial.
  • tick_id: Tick of this sample.
  • timestamp: Time of the sample.
  • state: Trial state of the sample.
  • actor_samples: Sample data related to each actor.
  • payloads: Serialized payload for the actors observations, actions, rewards and messages during this sample.

StoredTrialActorSample

Represents a sample generated by an actor in a trial at a given tick, only makes sense as a part of a StoredTrialSample.

Actors are referenced by their index in the trial params TrialParams.actors field. Where it make sense, the actor index can be set to -1 to reference the trial's environment.

Payloads (ie observations data, actions data, reward user data and messages payloads) are grouped in the payloads field of StoredTrialSample and referenced by their index in this field.

message StoredTrialActorSample {
uint32 actor = 1;
optional uint32 observation = 2;
optional uint32 action = 3;
optional float reward = 4;
repeated StoredTrialActorSampleReward received_rewards = 6;
repeated StoredTrialActorSampleReward sent_rewards = 7;
repeated StoredTrialActorSampleMessage received_messages = 8;
repeated StoredTrialActorSampleMessage sent_messages = 9;
}
  • actor: The index of the actor.
  • observation: Observation received by the actor at the current tick, as an index of the observation payload in the parent StoredTrialSample.
  • action: Action performed by the actor at the current tick, as an index of the action payload in the parent StoredTrialSample
  • reward: Aggregated value of the rewards received by the actor for the current tick.
  • received_rewards: List of the rewards received by the actor for the current tick.
  • sent_rewards: List of the rewards sent by the actor for the current tick.
  • received_messages: List of the messages received by the actor between the current tick and the next.
  • sent_messages: List of the messages sent by the actor between the current tick and the next.

StoredTrialActorSampleReward

Represents a reward sent or received by an actor, only makes sense as a part of a StoredTrialActorSample.

message StoredTrialActorSampleReward {
int32 sender = 1;
int32 receiver = 2;
float reward = 4;
float confidence = 5;
optional uint32 user_data = 6;
}
  • sender: Index of the actor, -1 for the environment, ignored for sent rewards.
  • receiver: Index of the actor, -1 for the environment, received for sent rewards.
  • reward: The numerical value of the provided reward.
  • confidence: The weight of this reward in computing the final (aggregated) reward.
  • user_data: User data attached to the reward, as an index of the payload in the parent StoredTrialSample.

StoredTrialActorSampleMessage

Represents a message sent or received by an actor, only makes sense as a part of a StoredTrialActorSample.

message StoredTrialActorSampleMessage {
int32 sender = 1;
int32 receiver = 2;
uint32 payload = 3;
}
  • sender: Index of the actor, -1 for the environment, ignored for sent messages.
  • receiver: Index of the actor, -1 for the environment, received for sent messages.
  • payload: Payload of the message, as an index of the payload in the parent StoredTrialSample.

StoredTrialSampleField

Enums representing the fields available in a StoredTrialSample. Used to filter desired fields.

enum StoredTrialSampleField {
STORED_TRIAL_SAMPLE_FIELD_UNKNOWN = 0;
STORED_TRIAL_SAMPLE_FIELD_OBSERVATION = 1;
STORED_TRIAL_SAMPLE_FIELD_ACTION = 2;
STORED_TRIAL_SAMPLE_FIELD_REWARD = 3;
STORED_TRIAL_SAMPLE_FIELD_RECEIVED_REWARDS = 4;
STORED_TRIAL_SAMPLE_FIELD_SENT_REWARDS = 5;
STORED_TRIAL_SAMPLE_FIELD_RECEIVED_MESSAGES = 6;
STORED_TRIAL_SAMPLE_FIELD_SENT_MESSAGES = 7;
}

RetrieveTrialsRequest

Request for TrialDatastoreSP.RetrieveTrials().

message RetrieveTrialsRequest {
repeated string trial_ids = 1;
uint32 timeout = 2;
uint32 trials_count = 3;
string trial_handle = 4;
}
  • trial_ids: List of desired trial identifiers, if empty all trials are returned.
  • timeout: (optional - in ms) Wait for trials that might be created within this duration.
  • trials_count: (optional) The desired number of trials to be retrieved, leave empty (or set to 0) for no limit.
  • trial_handle: (optional) Leave empty for the initial request, use previously provided RetrieveTrialsReply.next_trial_handle on the next calls to retrieve the next versions.

RetrieveTrialsReply

Reply for TrialDatastoreSP.RetrieveTrials().

message RetrieveTrialsReply {
repeated StoredTrialInfo trial_infos = 1;
string next_trial_handle = 2;
}
  • version_infos: At most RetrieveVersionInfosRequest.versions_count versions.
  • next_version_handle: Opaque handle to be used to retrieve the next versions matching the request.

RetrieveSamplesRequest

Request for TrialDatastoreSP.RetrieveSamples().

message RetrieveSamplesRequest {
repeated string trial_ids = 1;
repeated string actor_names = 2;
repeated string actor_classes = 3;
repeated string actor_implementations = 4;
repeated StoredTrialSampleField selected_sample_fields = 5;
}
  • trial_ids: List of desired trial ids, if empty no data will be returned.
  • actor_names: List of desired actor names, if empty all actor samples will be returned.
  • actor_classes: List of desired actor names, if empty all actor samples will be returned.
  • actor_implementations: List of desired actor classes, if empty all actor samples will be returned.
  • selected_sample_fields: (optional) Which fields of StoredTrialSample.ActorSample should be returned, if empty all fields are returned.

RetrieveSampleReply

Part of the reply stream of TrialDatastoreSP.RetrieveSamples().

message RetrieveSampleReply {
StoredTrialSample trial_sample = 1;
}
  • trial_sample: One trial sample matching the requested trial_ids and filtered according to the desired actors and fields.

AddTrialRequest

Request for TrialDatastoreSP.AddTrial().

message AddTrialRequest {
string user_id = 1;
TrialParams trial_params = 2;
}

AddTrialReply

Reply for TrialDatastoreSP.AddTrial().

message AddTrialReply {}

AddSampleRequest

Part of the request stream of TrialDatastoreSP.AddSample().

message AddSampleRequest {
StoredTrialSample trial_sample = 1;
}
  • trial_sample: One trial sample that should match the parameters of the target trial.

AddSamplesReply

Reply for TrialDatastoreSP.AddSample().

message AddSamplesReply {}

DeleteTrialsRequest

Request for TrialDatastoreSP.DeleteTrials().

message DeleteTrialsRequest {
repeated string trial_ids = 1;
}
  • trial_ids: List of the trial ids to delete, if empty no trial is deleted.

DeleteTrialsReply

Reply for TrialDatastoreSP.DeleteTrials().

message DeleteTrialsReply {}

TrialSamplesFileHeader

Header for the trial samples file that can be exported using cogment client export.

message TrialSamplesFileHeader {
VersionInfo version_info = 1;
fixed64 export_timestamp = 2;
map<string, TrialParams> trial_params = 3;
}
  • version_info: (cogmentAPI.VersionInfo) Version information for the used Cogment CLI.
  • export_timestamp: (fixed64) The wall-clock time in nanoseconds since 00:00:00UTC January 1, 1970 (Unix Epoch time) at export.
  • trial_params: (map<string, cogmentAPI.TrialParams>) Parameters of the trials exported in the file referenced by their ID.

Version()

Called to request version data.

Metadata: None

- - +The stream is maintained for the duration of the trial.

Metadata:

  • trial-id: Identifier of the trial that is the source of the data.
  • user-id: Identifier of the user that started the trial.

Version()

Called to request version data.

Metadata: None

LogExporterSampleRequest

Stream request message for the RunTrialDatalog procedure.

message SampleInfo {
bool out_of_sync = 5;
uint64 tick_id = 1;
fixed64 timestamp = 2;
TrialState state = 3;
repeated string special_events = 4;
}

message DatalogSample {
SampleInfo info = 1;

ObservationSet observations = 2;
repeated Action actions = 3;
repeated Reward rewards = 4;
repeated Message messages = 5;
repeated uint32 default_actors = 6;
repeated uint32 unavailable_actors = 7;
}

message LogExporterSampleRequest {
oneof msg {
TrialParams trial_params = 1;
DatalogSample sample = 2;
}
}
  • out_of_sync: If false, this sample is a normal and full sample. If true, it is an out-of-sync sample that is partially filled, and some of the other value may have a slightly different meaning than for a normal sample.
  • tick_id: The tick the data relates to.
  • timestamp: The time the data was received. For a full sample, this is the time the observation set was received by the Orchestrator.
  • state: The state of the trial at the end of the tick. For out-of-sync samples, the state is undefined.
  • special_events: Events not visible from the rest of the data may appear in here. Out-of-sync samples will usually have an explanation of data in the special events list.
  • observations: Observations from the environment. Out-of-sync samples may not have observations.
  • actions: Actions from all actors. This list has the same length and order as the list of actors provided in trial_params. This list may be empty for out-of-sync samples.
  • rewards: List of rewards sent to actors.
  • messages: List of user data sent to actors or the environment.
  • default_actors: List of actors (index of actors) that were not available but had a default action. Actors in this list have invalid data in the actions list.
  • unavailable_actors: List of actors (index of actors) that were not available and did not have a default action. Actors in this list have invalid data in the actions list.
  • trial_params: Trial parameters used for a trial. This is sent on start of a trial, as the first message in the RunTrialDatalog stream.
  • sample: A data sample to be logged. It can be an out-of-sync sample which contains only partial data.

LogExporterSampleReply

Reply message for the RunTrialDatalog procedure.

message LogExporterSampleReply {}

Hook API

This API is defined in hooks.proto. It is implemented by the pre-trial hook application using the gRPC server API, and the orchestrator connects to the application.

The pre-trial hook endpoint, for the orchestrator to connect to, are defined on the command line of the Orchestrator (or in environment variables).

Service TrialHooksSP

service TrialHooksSP {
rpc OnPreTrial(PreTrialParams) returns (PreTrialParams) {}
rpc Version(VersionRequest) returns (VersionInfo) {}
}

OnPreTrial()

Called before a trial is started to set or modify the parameters for the trial.

Metadata:

  • trial-id: Identifier of the new trial that will be started.
  • user-id: Identifier of the user that started the trial.

Version()

Called to request version data.

Metadata: None

Directory API

This API is defined in directory.proto. It is implemented by the Directory application using the gRPC server API.

Service DirectorySP

service DirectorySP {
rpc Register(stream RegisterRequest) returns (stream RegisterReply) {}
rpc Deregister(stream DeregisterRequest) returns (stream DeregisterReply) {}
rpc Inquire(InquireRequest) returns (stream InquireReply) {}
rpc Version(VersionRequest) returns (VersionInfo) {}
}

Register()

Called to register (add) services to the directory.

Metadata:

  • authentication_token: (Optional) Token of the services being registered. This will be registered with the services and must match when inquiring or deregistering a service.

Deregister()

Called to deregister (remove) previously registered services to the directory.

Metadata:

  • authentication_token: (Optional) Token to authenticate services. This must match the token of the registered services.

Inquire()

Called to inquire (search) the directory for registered services.

Metadata:

  • authentication_token: (Optional) Token to identify the services. This must match the token of the inquired services.

Version()

Called to request version data.

Metadata: None

ServiceType

Type of service registered. This serves to know how to test for health.

enum ServiceType {
UNKNOWN_SERVICE = 0;
TRIAL_LIFE_CYCLE_SERVICE = 1;
CLIENT_ACTOR_CONNECTION_SERVICE = 2;
ACTOR_SERVICE = 3;
ENVIRONMENT_SERVICE = 4;
PRE_HOOK_SERVICE = 5;
DATALOG_SERVICE = 6;
DATASTORE_SERVICE = 7;
MODEL_REGISTRY_SERVICE = 8;
DIRECTORY_SERVICE = 9;
OTHER_SERVICE = 100;
}
  • UNKNOWN_SERVICE: Should not be used (it's a requirement of protobuf enums to have a 0 default value).
  • TRIAL_LIFE_CYCLE_SERVICE: Cogment service accessed with gRPC service TrialLifecycleSP.
  • CLIENT_ACTOR_CONNECTION_SERVICE: Cogment service accessed with gRPC service ClientActorSP.
  • ACTOR_SERVICE: Cogment service accessed with gRPC service ServiceActorSP.
  • ENVIRONMENT_SERVICE: Cogment service accessed with gRPC service EnvironmentSP.
  • PRE_HOOK_SERVICE: Cogment service accessed with gRPC service TrialHooksSP.
  • DATALOG_SERVICE: Cogment service accessed with gRPC service DatalogSP.
  • DATASTORE_SERVICE: Cogment service accessed with gRPC service TrialDatastoreSP.
  • MODEL_REGISTRY_SERVICE: Cogment service accessed with gRPC service ModelRegistrySP.
  • DIRECTORY_SERVICE: Cogment service accessed with gRPC service DirectorySP.
  • OTHER_SERVICE: This is for services not provided by Cogment or that do not have a dedicated service type. The properties registered in the directory should provide the necessary information, but this is left to the users to manage, and no health checking is performed.

ServiceDetails

Message containing registration details of a service.

message ServiceDetails {
ServiceType type = 1;
map<string, string> properties = 2;
}
  • type: The type of service.
  • properties: Properties associated with the service, in a map (property name : property value).

ServiceEndpoint

Message containing endpoint (connection) details for a service.

message ServiceEndpoint {
enum Protocol {
UNKNOWN = 0;
GRPC = 1;
GRPC_SSL = 2;
COGMENT = 3;
}

Protocol protocol = 1;
string host = 2;
uint32 port = 3;
}
  • Protocol: The communication protocol for the service.
    • UNKNOWN: Should not be used (it's a requirement of protobuf enums to have a 0 default value).
    • GRPC: The service connection is using gRPC and does not require encryption (SSL).
    • GRPC_SSL: The service connection is using gRPC and is expecting encryption (SSL).
    • COGMENT: This is a protocol specific to Cogment. The host will provide more details.
  • host: For gRPC, this is a network accessible hostname or IP address. For Cogment, this can only be client, which indicates that the service is not really a service, but a client, and will connect and not be connected to.
  • port: For gRPC, this is the TCP port to connect to. For Cogment, this is not used.

RegisterRequest

Request message for the Register procedure.

message RegisterRequest {
// URL where to connect to the service.
ServiceEndpoint endpoint = 1;
ServiceDetails details = 2;
}
  • endpoint: The connection endpoint of the service to be registered.
  • details: The service details to be registered for the service.

RegisterReply

Reply message for the Register procedure.

message RegisterReply {
enum Status {
UNKNOWN = 0;
OK = 1;
FAILED = 2;
}
Status status = 1;
string error_msg = 2;
uint64 service_id = 3;
string secret = 4;
}
  • Status: The result status.
    • UNKNOWN: Should not be used (it's a requirement of protobuf enums to have a 0 default value).
    • OK: Registration succeeded and the data is valid.
    • FAILED: Registration failed, the data is invalid (more details may be available in the error message).
  • status: The status of the corresponding registration request.
  • error_msg: Any extra details about the failure of the registration (if status == FAILED).
  • service_id: The ID that the service was given when it was registered in the Directory.
  • secret: This is a string that must be provided to deregister the service, and cannot be inquired.

DeregisterRequest

Request message for the Deregister procedure.

message DeregisterRequest {
uint64 service_id = 1;
string secret = 2;
}
  • service_id: The ID of the service.
  • secret: The string that was given when the service was registered.

DeregisterReply

Reply message for the Deregister procedure.

message DeregisterReply {
enum Status {
UNKNOWN = 0;
OK = 1;
FAILED = 2;
}
Status status = 1;
string error_msg = 2;
}
  • Status: The result status.
    • UNKNOWN: Should not be used (it's a requirement of protobuf enums to have a 0 default value).
    • OK: Deregistration succeeded.
    • FAILED: Deregistration failed (more details may be available in the error message).
  • status: The status of the corresponding deregistration request.
  • error_msg: Any extra details about the failure to deregister the service (if status == FAILED).

InquireRequest

Request message for the Inquire procedure. Requires either a service ID, or details of services to find.

message InquireRequest {
oneof inquiry {
uint64 service_id = 1;
ServiceDetails details = 2;
}
}
  • service_id: The ID of the service.
  • details: The details of services to find.

InquireReply

Reply message for the Inquire procedure.

message FullServiceData {
ServiceEndpoint endpoint = 1;
uint64 service_id = 2;
ServiceDetails details = 3;
}

message InquireReply {
FullServiceData data = 1;
}
  • endpoint: The connection endpoint of the service.
  • service_id: The ID of the service.
  • details: The details of the service.

Model Registry API

This API is defined in model_registry.proto. It is implemented by cogment-model-registry.

Service ModelRegistrySP

This gRPC API defines a service able to store models, e.g. neural network architecture, weights and any additional parameters.

service ModelRegistrySP {
rpc CreateOrUpdateModel(CreateOrUpdateModelRequest) returns (CreateOrUpdateModelReply) {}
rpc DeleteModel(DeleteModelRequest) returns (DeleteModelReply) {}
rpc RetrieveModels(RetrieveModelsRequest) returns (RetrieveModelsReply) {}

rpc CreateVersion(stream CreateVersionRequestChunk) returns (CreateVersionReply) {}
rpc RetrieveVersionInfos(RetrieveVersionInfosRequest) returns (RetrieveVersionInfosReply) {}
rpc RetrieveVersionData(RetrieveVersionDataRequest) returns (stream RetrieveVersionDataReplyChunk) {}

rpc Version(VersionRequest) returns (VersionInfo) {}
}

CreateOrUpdateModel()

Create or update a model in the registry having the given unique (within the registry) model_id.

DeleteModel()

Delete a given model and all its iterations from the registry.

RetrieveModels()

Retrieve all or selected models. This procedure supports paginated requests.

CreateVersion()

Create a new iteration of a given model. Because of their potential large size, model iteration data are uploaded as a stream.

RetrieveVersionInfos()

Retrieve the information for all or selected iterations of a given model.

RetrieveVersionData()

Retrieve the data for a specific iteration of the model. Because of their potential large size, data are retrieved as a stream.

CreateOrUpdateModelRequest

Request for ModelRegistrySP.CreateOrUpdateModel()

message CreateOrUpdateModelRequest {
ModelInfo model_info = 1;
}
  • model_info: Defines the unique model identifier within the registry and the user_data to use to create or update the model.

CreateOrUpdateModelReply

Reply for ModelRegistrySP.CreateOrUpdateModel()

message CreateOrUpdateModelReply {}

DeleteModelRequest

Request for ModelRegistrySP.DeleteModel()

message DeleteModelRequest {
string model_id = 1;
}
  • model_ids: Identifier of the model to be deleted.

DeleteModelReply

Reply for ModelRegistrySP.DeleteModel()

message DeleteModelReply {}

RetrieveModelsRequest

Request for ModelRegistrySP.RetrieveModel().

message RetrieveModelsRequest {
repeated string model_ids = 1;
uint32 models_count = 3;
string model_handle = 4;
}
  • model_ids: List of the identifiers of the desired models, leave empty to retrieve all models.
  • models_count: (optional) The desired number of models to be retrieved, leave empty (or set to 0) to retrieve all models matching the request.
  • model_handle: (optional) Leave empty for the initial request, use previously provided RetrieveModelsReply.next_model_handle on the next calls to retrieve the next models.

RetrieveModelsReply

Reply for ModelRegistrySP.RetrieveModel().

message RetrieveModelsReply {
repeated ModelInfo model_infos = 1;
string next_model_handle = 2;
}
  • model_infos: At most RetrieveModelsRequest.models_count models.
  • next_model_handle: Opaque handle to be used to retrieve the next models matching the request.

CreateVersionRequestChunk

Part of the request stream for ModelRegistrySP.CreateVersion().

message CreateVersionRequestChunk {
message Header {
ModelVersionInfo version_info = 1;
}
message Body {
bytes data_chunk = 1;
}
oneof msg {
Header header = 1;
Body body = 2;
}
}

The first message in the stream should define header:

  • version_info: Information regarding the model iteration to create, version_number will be ignored. data_hash and data_size should be computed from the total final data and will be used by the server to validate it.

The following messages should define body:

  • data_chunk: A chunk of the iteration data, all the chunks in the stream will be concatenated.

CreateVersionReply

Reply for ModelRegistrySP.CreateVersion().

message CreateVersionReply {
ModelVersionInfo version_info = 1;
}
  • version_info: The information relative to the created model iteration, in particular the defined version_number.

RetrieveVersionInfosRequest

Request for ModelRegistrySP.RetrieveVersionInfos().

message RetrieveVersionInfosRequest {
string model_id = 1;
repeated int32 version_numbers = 2;
uint32 versions_count = 3;
string version_handle = 4;
}
  • model_id: Identifier of the model we want to retrieve iterations from.
  • version_numbers: List of desired iteration number (or -1 to denote the latest iteration). Leave empty to retrieve all iterations of the given model.
  • versions_count: (optional) The desired number of iterations to be retrieved, leave empty (or set to 0) to retrieve all the iterations matching the request.
  • version_handle: (optional) Leave empty for the initial request, use previously provided RetrieveVersionInfosReply.next_version_handle on the next calls to retrieve the next iterations.

RetrieveVersionInfosReply

Reply for ModelRegistrySP.RetrieveVersionInfos().

message RetrieveVersionInfosReply {
repeated ModelVersionInfo version_infos = 1;
string next_version_handle = 2;
}
  • version_infos: At most RetrieveVersionInfosRequest.versions_count iterations.
  • next_version_handle: Opaque handle to be used to retrieve the next iterations matching the request.

RetrieveVersionDataRequest

Request for ModelRegistrySP.RetrieveVersionData().

message RetrieveVersionDataRequest {
string model_id = 1;
int32 version_number = 2;
}
  • model_id: Identifier of the model we want to retrieve iteration from.
  • version_numbers: Number of the desired iteration.

RetrieveVersionDataReplyChunk

Part of the reply stream of ModelRegistrySP.RetrieveVersionData().

message RetrieveVersionDataReplyChunk {
bytes data_chunk = 1;
}
  • data_chunk: A chunk of the iteration data. All the chunks in the stream need to be concatenated. The completeness and validity of the received data can be checked using the iteration's data_size and data_hash respectively.

ModelInfo

Defines a model identifier and associated user data.

message ModelInfo {
string model_id = 1;
map<string, string> user_data = 2;
}
  • model_id: Unique model identifier.
  • user_data: Key/value user data associated with the model.

ModelVersionInfo

Defines a model iteration and associated user data.

message ModelVersionInfo {
string model_id = 1;
uint32 version_number = 2;
fixed64 creation_timestamp = 3;
bool archived = 4;
string data_hash = 5;
fixed64 data_size = 6;
map<string, string> user_data = 7;
}
  • model_id: Unique identifier, within the registry, of this iteration's model.
  • version_number: Unique iteration number, assigned incrementally at creation by the model registry.
  • creation_timestamp: When the model was created as nanosecond Unix epoch time.
  • archived: If true, this iteration is archived and should be stored in a long-term storage. If false, this iteration is not archived and can be evicted after a while. Non-archived iterations should be used to broadcast an update of the model during training.
  • data_hash: SHA 256 hash (encoded in base64 with standard 64 characters with padding) of this iteration's data, can be used to validate the data and for caching purposes.
  • data_size: Size (in bytes) of this iteration's data.
  • user_data: Key/value user data associated with the model, in particular it can be used to provide information required for the deserialization of the data.

Version()

Called to request iteration data.

Metadata: None

Trial Datastore API

This API is defined in trial_datastore.proto. It is implemented by cogment-trial-datastore.

Service TrialDatastoreSP

This gRPC API defines a service to manage and access data generated by trials.

service TrialDatastoreSP {
rpc RetrieveTrials(RetrieveTrialsRequest) returns (RetrieveTrialsReply) {}
rpc RetrieveSamples(RetrieveSamplesRequest) returns (stream RetrieveSampleReply) {}

rpc AddTrial(AddTrialRequest) returns (AddTrialReply) {}
rpc AddSample(stream AddSampleRequest) returns (AddSamplesReply) {}
rpc DeleteTrials(DeleteTrialsRequest) returns (DeleteTrialsReply) {}

rpc Version(VersionRequest) returns (VersionInfo) {}
}

RetrieveTrials()

Retrieve stored trials matching the given request.

RetrieveSamples()

Retrieve samples from matching trials, trials can be ongoing.

AddTrial()

Add a trial to the activity logger, as soon as a trial is added, samples can be retrieved using RetrieveSamples().

AddSample()

Add samples to a trial in the activity logger as a stream, as soon as a sample is added it is pushed to the matching ongoing RetrieveSamples() requests.

DeleteTrials()

Delete the trials matching the given request, on failure no trial is deleted.

StoredTrialInfo

Defines a information about a stored trial

message StoredTrialInfo {
string trial_id = 1;
TrialState last_state = 2;
string user_id = 3;
uint32 samples_count = 4;
TrialParams params = 5;
}
  • trial_id: Unique identifier of the trial.
  • last_state: Last known trial state.
  • user_id: The id of the user that has started the trial.
  • samples_count: The number samples that are stored for this trial.
  • params: Parameters of the trial.

StoredTrialSample

Represents a sample generated by a trial at a given tick.

message StoredTrialSample {
string user_id = 1;
string trial_id = 2;
uint64 tick_id = 3;
fixed64 timestamp = 4;
TrialState state = 5;
repeated StoredTrialActorSample actor_samples = 6;
repeated bytes payloads = 7;
}
  • user_id: The identifier of the user that has started the trial.
  • trial_id: Unique identifier of the trial.
  • tick_id: Tick of this sample.
  • timestamp: Time of the sample.
  • state: Trial state of the sample.
  • actor_samples: Sample data related to each actor.
  • payloads: Serialized payload for the actors observations, actions, rewards and messages during this sample.

StoredTrialActorSample

Represents a sample generated by an actor in a trial at a given tick, only makes sense as a part of a StoredTrialSample.

Actors are referenced by their index in the trial params TrialParams.actors field. Where it make sense, the actor index can be set to -1 to reference the trial's environment.

Payloads (ie observations data, actions data, reward user data and messages payloads) are grouped in the payloads field of StoredTrialSample and referenced by their index in this field.

message StoredTrialActorSample {
uint32 actor = 1;
optional uint32 observation = 2;
optional uint32 action = 3;
optional float reward = 4;
repeated StoredTrialActorSampleReward received_rewards = 6;
repeated StoredTrialActorSampleReward sent_rewards = 7;
repeated StoredTrialActorSampleMessage received_messages = 8;
repeated StoredTrialActorSampleMessage sent_messages = 9;
}
  • actor: The index of the actor.
  • observation: Observation received by the actor at the current tick, as an index of the observation payload in the parent StoredTrialSample.
  • action: Action performed by the actor at the current tick, as an index of the action payload in the parent StoredTrialSample
  • reward: Aggregated value of the rewards received by the actor for the current tick.
  • received_rewards: List of the rewards received by the actor for the current tick.
  • sent_rewards: List of the rewards sent by the actor for the current tick.
  • received_messages: List of the messages received by the actor between the current tick and the next.
  • sent_messages: List of the messages sent by the actor between the current tick and the next.

StoredTrialActorSampleReward

Represents a reward sent or received by an actor, only makes sense as a part of a StoredTrialActorSample.

message StoredTrialActorSampleReward {
int32 sender = 1;
int32 receiver = 2;
float reward = 4;
float confidence = 5;
optional uint32 user_data = 6;
}
  • sender: Index of the actor, -1 for the environment, ignored for sent rewards.
  • receiver: Index of the actor, -1 for the environment, received for sent rewards.
  • reward: The numerical value of the provided reward.
  • confidence: The weight of this reward in computing the final (aggregated) reward.
  • user_data: User data attached to the reward, as an index of the payload in the parent StoredTrialSample.

StoredTrialActorSampleMessage

Represents a message sent or received by an actor, only makes sense as a part of a StoredTrialActorSample.

message StoredTrialActorSampleMessage {
int32 sender = 1;
int32 receiver = 2;
uint32 payload = 3;
}
  • sender: Index of the actor, -1 for the environment, ignored for sent messages.
  • receiver: Index of the actor, -1 for the environment, received for sent messages.
  • payload: Payload of the message, as an index of the payload in the parent StoredTrialSample.

StoredTrialSampleField

Enums representing the fields available in a StoredTrialSample. Used to filter desired fields.

enum StoredTrialSampleField {
STORED_TRIAL_SAMPLE_FIELD_UNKNOWN = 0;
STORED_TRIAL_SAMPLE_FIELD_OBSERVATION = 1;
STORED_TRIAL_SAMPLE_FIELD_ACTION = 2;
STORED_TRIAL_SAMPLE_FIELD_REWARD = 3;
STORED_TRIAL_SAMPLE_FIELD_RECEIVED_REWARDS = 4;
STORED_TRIAL_SAMPLE_FIELD_SENT_REWARDS = 5;
STORED_TRIAL_SAMPLE_FIELD_RECEIVED_MESSAGES = 6;
STORED_TRIAL_SAMPLE_FIELD_SENT_MESSAGES = 7;
}

RetrieveTrialsRequest

Request for TrialDatastoreSP.RetrieveTrials().

message RetrieveTrialsRequest {
repeated string trial_ids = 1;
uint32 timeout = 2;
uint32 trials_count = 3;
string trial_handle = 4;
}
  • trial_ids: List of desired trial identifiers, if empty all trials are returned.
  • timeout: (optional - in ms) Wait for trials that might be created within this duration.
  • trials_count: (optional) The desired number of trials to be retrieved, leave empty (or set to 0) for no limit.
  • trial_handle: (optional) Leave empty for the initial request, use previously provided RetrieveTrialsReply.next_trial_handle on the next calls to retrieve the next versions.

RetrieveTrialsReply

Reply for TrialDatastoreSP.RetrieveTrials().

message RetrieveTrialsReply {
repeated StoredTrialInfo trial_infos = 1;
string next_trial_handle = 2;
}
  • version_infos: At most RetrieveVersionInfosRequest.versions_count versions.
  • next_version_handle: Opaque handle to be used to retrieve the next versions matching the request.

RetrieveSamplesRequest

Request for TrialDatastoreSP.RetrieveSamples().

message RetrieveSamplesRequest {
repeated string trial_ids = 1;
repeated string actor_names = 2;
repeated string actor_classes = 3;
repeated string actor_implementations = 4;
repeated StoredTrialSampleField selected_sample_fields = 5;
}
  • trial_ids: List of desired trial ids, if empty no data will be returned.
  • actor_names: List of desired actor names, if empty all actor samples will be returned.
  • actor_classes: List of desired actor names, if empty all actor samples will be returned.
  • actor_implementations: List of desired actor classes, if empty all actor samples will be returned.
  • selected_sample_fields: (optional) Which fields of StoredTrialSample.ActorSample should be returned, if empty all fields are returned.

RetrieveSampleReply

Part of the reply stream of TrialDatastoreSP.RetrieveSamples().

message RetrieveSampleReply {
StoredTrialSample trial_sample = 1;
}
  • trial_sample: One trial sample matching the requested trial_ids and filtered according to the desired actors and fields.

AddTrialRequest

Request for TrialDatastoreSP.AddTrial().

message AddTrialRequest {
string user_id = 1;
TrialParams trial_params = 2;
}

AddTrialReply

Reply for TrialDatastoreSP.AddTrial().

message AddTrialReply {}

AddSampleRequest

Part of the request stream of TrialDatastoreSP.AddSample().

message AddSampleRequest {
StoredTrialSample trial_sample = 1;
}
  • trial_sample: One trial sample that should match the parameters of the target trial.

AddSamplesReply

Reply for TrialDatastoreSP.AddSample().

message AddSamplesReply {}

DeleteTrialsRequest

Request for TrialDatastoreSP.DeleteTrials().

message DeleteTrialsRequest {
repeated string trial_ids = 1;
}
  • trial_ids: List of the trial ids to delete, if empty no trial is deleted.

DeleteTrialsReply

Reply for TrialDatastoreSP.DeleteTrials().

message DeleteTrialsReply {}

TrialSamplesFileHeader

Header for the trial samples file that can be exported using cogment client export.

message TrialSamplesFileHeader {
VersionInfo version_info = 1;
fixed64 export_timestamp = 2;
map<string, TrialParams> trial_params = 3;
}
  • version_info: (cogmentAPI.VersionInfo) Version information for the used Cogment CLI.
  • export_timestamp: (fixed64) The wall-clock time in nanoseconds since 00:00:00UTC January 1, 1970 (Unix Epoch time) at export.
  • trial_params: (map<string, cogmentAPI.TrialParams>) Parameters of the trials exported in the file referenced by their ID.

Version()

Called to request version data.

Metadata: None

+ + \ No newline at end of file diff --git a/docs/reference/javascript.html b/docs/reference/javascript.html index 5fe2ef4..c476eb2 100644 --- a/docs/reference/javascript.html +++ b/docs/reference/javascript.html @@ -1,25 +1,25 @@ - + - + Javascript SDK | Cogment - - - + + +
-

Javascript SDK

Repository Latest release

Installation

The simplest way to install the Javascript SDK is to just install it using npm: +

Javascript SDK

Repository Latest release

Installation

The simplest way to install the Javascript SDK is to just install it using npm: npm install @cogment/cogment-js-sdk

General usage

The spec file

The specifications of a trial type are contained in a spec file and the imported files defined in the spec. This file is typically named cogment.yaml.

For example, an actor class is defined by its required observation space and action space.

These "spaces" are defined by using protobuf message types (from the imported files). Observations and actions will simply be instances of the appropriate type.

Messages and feedback user data don't have a set type, they can be any type as long as the receiver can manage that type. The type is determined by the provided message from the originator.

They will mostly arrive as an instance of cogment.MessageBase and have fields according to their definition in your proto files.

Trial Parameters

The trial parameters can come from the default parameters provided to the Orchestrator on startup, or from the pre-trial hooks (themselves provided to the Orchestrator on startup).

The parameters are mostly indepedent of the spec file (cogment.yaml), except that the active actors listed in the parameters must have their actor class match an actor class defined in the spec file.

Below, when we refer to the trial parameters, we mean the final parameters after any pre-trial hooks.

Compiling the spec file

In order to use the specification found in the spec file within Javascript scripts, it needs to be compiled into Javascript modules. This is done by a tool called "cogment-js-sdk-generate".

CogSettings.js

All API entry points require a cogment specification object. This specification object can be determined -from the content of a project's spec file. As such, it should be generated using the cogment-js-sdk-generate tool

npx cogment-js-sdk-generate config.yaml

This will generate both a CogSettings.js file, as well as any required compiled protocol buffer files.

Imports

Whether a script implements an actor or environment, it should import both the cogment module (generic Javascript SDK for Cogment) and the cogSettings module (project specific definitions created from the spec file).

import { cogSettings } from './CogSettings';
import * as cogment from '@cogment/cogment-js-sdk'

class cogment.Context

Class to setup and run all the different aspects of trials.

constructor(userId, cogSettings)

Parameters:

  • userId: string - Identifier for the user of this context.
  • cogSettings: cogment.CogSettings - Settings module associated with trials that will be run (cogSettings namespace).

getController(endpoint)

Method to get a controller instance to manage trials (start, stop, inquire, etc).

Parameters:

  • endpoint: string - URL of the connection to the Orchestrator.

Return: Controller - An instance of the Controller class used to manage trials.

async joinTrial(trialId, endpoint, actorName)

Method for an actor to asynchronously join an existing trial. This task will normally end after the user implementation has exited.

Parameters:

  • trialId: string - The UUID of the trial to join.
  • endpoint: string - URL of the connection to the Orchestrator.
  • actorName: string - Name of the actor joining the trial.

Return: void

registerActor(impl, actorName, actorClass)

Method to register the asynchronous callback function that will run an actor for a trial.

Parameters:

  • impl: async function(ActorSession instance) - Callback function to be registered.
  • actorName: string - Name for the actor implementation being run by the given callback function.
  • actorClass: string - The actor class name that can be run by the given callback function. The possible names are specified in spec file under section actorClasses:name. If the list is empty, this implementation can run any actor class.

Return: void

class Controller

Class containing data and methods to control and manage trials.

async startTrial(trialConfig = undefined, trialIdRequested = undefined)

Method to start a new trial. The parameters of the trial will be set by the pre-trial hooks (registered in cogment.Context), and the hooks will receive the provided trial config.

Parameters:

  • trialConfig: cogment.MessageBase - Configuration for the trial. The type is specified in the spec file under the section trial:config_type. Can be undefined if no configuration is provided. This is provided to the first pre-trial hook.
  • trialIdRequested: string - The trial identifier requested for the new trial. It must be unique among all active trials and a limited set of the latest ended trials (this list of trials can be retrieved with getTrialInfo or watchTrial). If provided, the Orchestrator will try to use this trialId, otherwise, a UUID will be created.

Return: string - The newly started trial ID.

terminateTrial(trialIds, hard = false)

Method to request the end of a trial.

Parameters:

  • trialIds: string[] - The trial ID(s) to request to terminate. There must be at least one ID.
  • hard: boolean - If true, the termination will be forced and not wait for any action or observation. If false, the trial will wait for the next tick, to end gracefully (i.e. wait for the next full set of actions and response observations).

Return: void

async getTrialInfo(trialIds)

Method to get information about a trial.

Parameters:

  • trialIds: string[] - The trial ID(s) from which to request information. If no ID is provided, returns information about all trials. Note that ended trials may only appear for a short time in this list after they have ended.

Return: TrialInfo[] - List of trial information, one per trial. Can be empty if no trial matches.

async watchTrials(trialStateFilters=[])

Generator method to iterate, in real-time, through all trial states matching the filters. When called, it will first iterate over the current states matching the filters, for all trials. Afterwards, it will iterate in real-time over the matching states as they change.

Parameters:

  • trialStateFilters: cogment.TrialState[] - List of enum values from cogment.TrialState for which we are interested in receiving state changes.

Return: generator(TrialInfo instance) - A generator for the state changes that arrive. The TrialInfo received here only contains the trial ID and the state.

async getActors(trialId)

Method to get the list of configured actors in a trial.

Parameters:

  • trialId: string - The trial ID from which to request the list of actors.

Return: ActorInfo[] - List of actors configured in this trial.

async getRemoteVersions()

Method to get the versions from the remote Orchestrator.

Parameters: None

Return: {[key: string]: string} - The key of the object is the name of the component (string), and the value is the version (string).

class Session

Abstract class that manages aspects of a trial. Contains data and methods common to all sessions .

getTrialId()

Method to get the UUID of the trial managed by this session.

Parameters: None

Return: string - UUID of the trial.

getTickId()

Method to get the current tick id of the trial (i.e. time step).

Parameters: None

Return: number - The current tick id.

isTrialOver()

Method to inquire if the current trial has ended.

Parameters: None

Return: boolean - True if the trial has ended, false otherwise.

sendingDone()

Method to notify the Orchestrator that all data for the trial, from this session, has been sent. This can be called only when the session is ending. When starting the session (see ActorSession), if the autoDoneSending parameter is True, this method should not be called, and if the parameter is False, it MUST be called to end the trial properly.

Parameters: None

Return: void

class ActorSession extends Session

start(autoDoneSending=True)

Method to start the actor. This method should be called before any other method in the session.

Parameters:

  • autoDoneSending: boolean - Controls when to notify the Orchestrator that all data has been sent. If True, the session will automatically send the notification after receiving the last observation. If False, the user MUST call sendingDone to end the trial properly.

Return: void

async *eventLoop()

Generator method to iterate over all events (observations, rewards, messages) as they are received. This will block and wait for an event. +from the content of a project's spec file. As such, it should be generated using the cogment-js-sdk-generate tool

npx cogment-js-sdk-generate config.yaml

This will generate both a CogSettings.js file, as well as any required compiled protocol buffer files.

Imports

Whether a script implements an actor or environment, it should import both the cogment module (generic Javascript SDK for Cogment) and the cogSettings module (project specific definitions created from the spec file).

import { cogSettings } from './CogSettings';
import * as cogment from '@cogment/cogment-js-sdk'

class cogment.Context

Class to setup and run all the different aspects of trials.

constructor(userId, cogSettings)

Parameters:

  • userId: string - Identifier for the user of this context.
  • cogSettings: cogment.CogSettings - Settings module associated with trials that will be run (cogSettings namespace).

getController(endpoint)

Method to get a controller instance to manage trials (start, stop, inquire, etc).

Parameters:

  • endpoint: string - URL of the connection to the Orchestrator.

Return: Controller - An instance of the Controller class used to manage trials.

async joinTrial(trialId, endpoint, actorName)

Method for an actor to asynchronously join an existing trial. This task will normally end after the user implementation has exited.

Parameters:

  • trialId: string - The UUID of the trial to join.
  • endpoint: string - URL of the connection to the Orchestrator.
  • actorName: string - Name of the actor joining the trial.

Return: void

registerActor(impl, actorName, actorClass)

Method to register the asynchronous callback function that will run an actor for a trial.

Parameters:

  • impl: async function(ActorSession instance) - Callback function to be registered.
  • actorName: string - Name for the actor implementation being run by the given callback function.
  • actorClass: string - The actor class name that can be run by the given callback function. The possible names are specified in spec file under section actorClasses:name. If the list is empty, this implementation can run any actor class.

Return: void

class Controller

Class containing data and methods to control and manage trials.

async startTrial(trialConfig = undefined, trialIdRequested = undefined)

Method to start a new trial. The parameters of the trial will be set by the pre-trial hooks (registered in cogment.Context), and the hooks will receive the provided trial config.

Parameters:

  • trialConfig: cogment.MessageBase - Configuration for the trial. The type is specified in the spec file under the section trial:config_type. Can be undefined if no configuration is provided. This is provided to the first pre-trial hook.
  • trialIdRequested: string - The trial identifier requested for the new trial. It must be unique among all active trials and a limited set of the latest ended trials (this list of trials can be retrieved with getTrialInfo or watchTrial). If provided, the Orchestrator will try to use this trialId, otherwise, a UUID will be created.

Return: string - The newly started trial ID.

terminateTrial(trialIds, hard = false)

Method to request the end of a trial.

Parameters:

  • trialIds: string[] - The trial ID(s) to request to terminate. There must be at least one ID.
  • hard: boolean - If true, the termination will be forced and not wait for any action or observation. If false, the trial will wait for the next tick, to end gracefully (i.e. wait for the next full set of actions and response observations).

Return: void

async getTrialInfo(trialIds)

Method to get information about a trial.

Parameters:

  • trialIds: string[] - The trial ID(s) from which to request information. If no ID is provided, returns information about all trials. Note that ended trials may only appear for a short time in this list after they have ended.

Return: TrialInfo[] - List of trial information, one per trial. Can be empty if no trial matches.

async watchTrials(trialStateFilters=[])

Generator method to iterate, in real-time, through all trial states matching the filters. When called, it will first iterate over the current states matching the filters, for all trials. Afterwards, it will iterate in real-time over the matching states as they change.

Parameters:

  • trialStateFilters: cogment.TrialState[] - List of enum values from cogment.TrialState for which we are interested in receiving state changes.

Return: generator(TrialInfo instance) - A generator for the state changes that arrive. The TrialInfo received here only contains the trial ID and the state.

async getActors(trialId)

Method to get the list of configured actors in a trial.

Parameters:

  • trialId: string - The trial ID from which to request the list of actors.

Return: ActorInfo[] - List of actors configured in this trial.

async getRemoteVersions()

Method to get the versions from the remote Orchestrator.

Parameters: None

Return: {[key: string]: string} - The key of the object is the name of the component (string), and the value is the version (string).

class Session

Abstract class that manages aspects of a trial. Contains data and methods common to all sessions .

getTrialId()

Method to get the UUID of the trial managed by this session.

Parameters: None

Return: string - UUID of the trial.

getTickId()

Method to get the current tick id of the trial (i.e. time step).

Parameters: None

Return: number - The current tick id.

isTrialOver()

Method to inquire if the current trial has ended.

Parameters: None

Return: boolean - True if the trial has ended, false otherwise.

sendingDone()

Method to notify the Orchestrator that all data for the trial, from this session, has been sent. This can be called only when the session is ending. When starting the session (see ActorSession), if the autoDoneSending parameter is True, this method should not be called, and if the parameter is False, it MUST be called to end the trial properly.

Parameters: None

Return: void

class ActorSession extends Session

start(autoDoneSending=True)

Method to start the actor. This method should be called before any other method in the session.

Parameters:

  • autoDoneSending: boolean - Controls when to notify the Orchestrator that all data has been sent. If True, the session will automatically send the notification after receiving the last observation. If False, the user MUST call sendingDone to end the trial properly.

Return: void

async *eventLoop()

Generator method to iterate over all events (observations, rewards, messages) as they are received. This will block and wait for an event. When this generator exits, the callback function (registered with registerActor) should return to end the trial cleanly. -The generator will exit for various reasons indicating the end of the trial, a loss of communication with the orchestrator, or if the generator is sent "False".

Parameters: None

Return: AsyncGenerator<RecvEvent> - A generator for the events that arrive. The RecvEvent instances received from this generator will not contain actions. When receiving an observation in the event, the this.doAction method is normally used to "reply" (if the event type is EventType.ACTIVE).

doAction(action)

Method to send actions to the environment.

Parameters:

  • action: ActionT - An instance of the action space class specified in the corresponding section actorClasses:action:space of the spec file. If undefined, then no action space is sent (empty content) and the environment will receive a default initialized action space of the appropriate type.

Return: void

sendMessage(payload, to)

Method to send a message related to the current time step (tick id).

Parameters:

  • payload: cogment.MessageBase - The message data to be sent. The class can be any protobuf class. It is the responsibility of the receiving actor to manage the class received.
  • to: string[] - Targets of feedback. Each value could be the name of an actor in the trial, or the name of the environment (from this.envName). Or it could represent a set of actors (with wildcards); A set of actors can be represented with the wildcard character "*" for all actors (of all classes), or "actorClass.*" for all actors of a specific class (the actorClass must match one of the classes listed in the trial parameters). Note that the wildcard does not include the environment.

Return: void

enum cogment.TrialState

Enum representing the various states of trials.

  • UNKNOWN: Should not be used.
  • INITIALIZING: The trial is in the process of starting.
  • PENDING: The trial is waiting for its final parameters, before running.
  • RUNNING: The trial is running.
  • TERMINATING: The trial is in the process of terminating (either a request to terminate has been received or the last observation has been received).
  • ENDED: The trial has ended. Only a set number of ended trials will be kept (configured in the Orchestrator).

For further information on trial lifetime, check the dedicated section.

class TrialInfo

Class enclosing the details of a trial.

trialId: string - The trial ID to which the details pertain.

state: cogment.TrialState - The current state of the trial.

envName: string - The name of the environment running the trial.

tickId: number - The time step that the information relates to. Only provided from a call to getTrialInfo.

duration: number - The time (in nanoseconds) that the trial has run. Only provided from a call to getTrialInfo.

class RecvEvent

Class representing a received event (for environments and actors). It can contain any combination of data according to the receiver needs, or even be empty, but it will always have a type.

type: EventType - Type of event the enclosed data represents.

observation: ObservationT - Observation data. This can only be received by actors. undefined if not present.

actions: ActionT - Action data from actors. This can only be received by the environment. The list is empty if not present.

rewards: Reward[] - Reward values and data. This can only be received by actors. The list is empty if not present.

messages: MessageBase[] - Message data. The list is empty if not present.

enum cogment.EventType

Enum representing the type of an event.

  • EventType.NONE: Empty event. This kind of event should never be received.

  • EventType.ACTIVE: Normal event from an active trial. Most events will be of this type.

  • EventType.ENDING: Events from a trial in the process of ending. For the environment, this means that these events contain the last actions from the actors, and the trial is awaiting a final observation. For the actors, this means that the trial is ending and no action can/need to be sent in response. Note that because of network timing, there may be ACTIVE events (e.g. rewards or messages) arriving after some ENDING events, but the trial is ending regardless.

  • EventType.FINAL: Final event for the trial. This does not contain data. The event loop will exit after this event is delivered. This event can be ignored if nothing needs to be done before exiting the loop.

For further information on trial lifetime, check the dedicated section.

type ObservationT

Type containing the details of an actor's observation. This will be different depending on what the ActionSpace defined in your spec file contains

type ActionT

Type containing the details of an action from an actor. This will be different depending on what the ActionSpace defined in your spec file contains

class MessageBase

Base Class of all messages, this will contain different fields depending on what fields are in the specific message you are receiving (defined in proto files)

type Reward

type containing the details of a received reward.

tickId: number - The tick id (time step) for which the reward should be applied.

receiverName: string - Name of the receiver for the reward (the name of an actor, or wildcard string).

value: float - Value of the reward (aggregated from the sources)

sources: IRewardSource[] - List of sources that gave this reward

interface IRewardSource

senderName: string - Name of the reward sender;

value: number - Value of the reward;

confidence: number - Confidence of this reward;

userData: google.protobuf.IAny - Extra data;

- - +The generator will exit for various reasons indicating the end of the trial, a loss of communication with the orchestrator, or if the generator is sent "False".

Parameters: None

Return: AsyncGenerator<RecvEvent> - A generator for the events that arrive. The RecvEvent instances received from this generator will not contain actions. When receiving an observation in the event, the this.doAction method is normally used to "reply" (if the event type is EventType.ACTIVE).

doAction(action)

Method to send actions to the environment.

Parameters:

  • action: ActionT - An instance of the action space class specified in the corresponding section actorClasses:action:space of the spec file. If undefined, then no action space is sent (empty content) and the environment will receive a default initialized action space of the appropriate type.

Return: void

sendMessage(payload, to)

Method to send a message related to the current time step (tick id).

Parameters:

  • payload: cogment.MessageBase - The message data to be sent. The class can be any protobuf class. It is the responsibility of the receiving actor to manage the class received.
  • to: string[] - Targets of feedback. Each value could be the name of an actor in the trial, or the name of the environment (from this.envName). Or it could represent a set of actors (with wildcards); A set of actors can be represented with the wildcard character "*" for all actors (of all classes), or "actorClass.*" for all actors of a specific class (the actorClass must match one of the classes listed in the trial parameters). Note that the wildcard does not include the environment.

Return: void

enum cogment.TrialState

Enum representing the various states of trials.

  • UNKNOWN: Should not be used.
  • INITIALIZING: The trial is in the process of starting.
  • PENDING: The trial is waiting for its final parameters, before running.
  • RUNNING: The trial is running.
  • TERMINATING: The trial is in the process of terminating (either a request to terminate has been received or the last observation has been received).
  • ENDED: The trial has ended. Only a set number of ended trials will be kept (configured in the Orchestrator).

For further information on trial lifetime, check the dedicated section.

class TrialInfo

Class enclosing the details of a trial.

trialId: string - The trial ID to which the details pertain.

state: cogment.TrialState - The current state of the trial.

envName: string - The name of the environment running the trial.

tickId: number - The time step that the information relates to. Only provided from a call to getTrialInfo.

duration: number - The time (in nanoseconds) that the trial has run. Only provided from a call to getTrialInfo.

class RecvEvent

Class representing a received event (for environments and actors). It can contain any combination of data according to the receiver needs, or even be empty, but it will always have a type.

type: EventType - Type of event the enclosed data represents.

observation: ObservationT - Observation data. This can only be received by actors. undefined if not present.

actions: ActionT - Action data from actors. This can only be received by the environment. The list is empty if not present.

rewards: Reward[] - Reward values and data. This can only be received by actors. The list is empty if not present.

messages: MessageBase[] - Message data. The list is empty if not present.

enum cogment.EventType

Enum representing the type of an event.

  • EventType.NONE: Empty event. This kind of event should never be received.

  • EventType.ACTIVE: Normal event from an active trial. Most events will be of this type.

  • EventType.ENDING: Events from a trial in the process of ending. For the environment, this means that these events contain the last actions from the actors, and the trial is awaiting a final observation. For the actors, this means that the trial is ending and no action can/need to be sent in response. Note that because of network timing, there may be ACTIVE events (e.g. rewards or messages) arriving after some ENDING events, but the trial is ending regardless.

  • EventType.FINAL: Final event for the trial. This does not contain data. The event loop will exit after this event is delivered. This event can be ignored if nothing needs to be done before exiting the loop.

For further information on trial lifetime, check the dedicated section.

type ObservationT

Type containing the details of an actor's observation. This will be different depending on what the ActionSpace defined in your spec file contains

type ActionT

Type containing the details of an action from an actor. This will be different depending on what the ActionSpace defined in your spec file contains

class MessageBase

Base Class of all messages, this will contain different fields depending on what fields are in the specific message you are receiving (defined in proto files)

type Reward

type containing the details of a received reward.

tickId: number - The tick id (time step) for which the reward should be applied.

receiverName: string - Name of the receiver for the reward (the name of an actor, or wildcard string).

value: float - Value of the reward (aggregated from the sources)

sources: IRewardSource[] - List of sources that gave this reward

interface IRewardSource

senderName: string - Name of the reward sender;

value: number - Value of the reward;

confidence: number - Confidence of this reward;

userData: google.protobuf.IAny - Extra data;

+ + \ No newline at end of file diff --git a/docs/reference/parameters.html b/docs/reference/parameters.html index ce0ee45..94a10b7 100644 --- a/docs/reference/parameters.html +++ b/docs/reference/parameters.html @@ -1,20 +1,20 @@ - + - + Trial Parameters | Cogment - - - + + +
-

Trial Parameters

The trial parameters are a set of parameters that define the details of a trial. +

Trial Parameters

The trial parameters are a set of parameters that define the details of a trial. They may be generated from the default parameters provided to the Orchestrator (see Parameter File), and updated by the pre-trial hooks (see TrialParameters and register_pre_trial_hook). Or they can be provided whole to the trial start call (see start_trial).

In the parameters, are optional config messages for the trial, environment and actors. The trial config is only used by the pre-trial hooks, whereas the other configs are sent to their respective destination at the start of the trial. @@ -22,11 +22,11 @@ Another way to set the parameters dynamically is by providing them to the start trial call. The parameters of the trial start call take priority over all others, and thus when provided, the default parameters will be ignored and the pre-trial hooks will not be called.

Parameters reference

  • config: User defined configuration sent to the first trial pre-hook before the start of the trial. The type is defined in the spec file under section trial:config_type. DEFAULT: not set.
  • properties: User defined key/value properties (in a map/dictionary style) that are associated with the trial. Key names starting with a double underscore (__) are reserved for Cogment internal use. DEFAULT: empty.
  • max_steps: The maximum number of time steps (ticks) that the trial will run before requesting a soft termination at the next step. DEFAULT: 0 (infinite nb steps).
  • max_inactivity: The number of seconds of inactivity after which a trial will be hard terminated. "Activity" is defined as a message received by the Orchestrator from a user component. If 0, the trial will not be terminated because of inactivity. DEFAULT: 30 seconds.
  • nb_buffered_ticks: The number of ticks (steps) to buffer in the Orchestrator before sending the data to the datalog. This is in effect the delay between the currently running trial and the datalog data. It is also the time window for past data (e.g. rewards) to still make it in the correct normal sample of the datalog. If data is too far in the past (the tick ID is more in the past than nb_buffered_ticks) then a special out-of-sync sample will be sent to the datalog. This value must be larger than 1. DEFAULT: 2.
  • datalog_endpoint: Endpoint of the datalog service. DEFAULT: not set (data logging is disabled).
  • datalog_exclude_fields: List of fields to exclude from the data samples sent to the datalog service.
  • environment_config: User defined configuration sent to the environment at the start of the trial. The type is defined in spec file under section environment:config_type. DEFAULT: not set.
  • environment_name: The name of the environment. DEFAULT: "env".
  • environment_endpoint: Endpoint of the environment service. DEFAULT: context discovery endpoint (the Directory will be inquired).
  • environment_implementation: The name of the implementation to run the environment. This must match an implementation that is defined at the endpoint. DEFAULT: not set (an arbitrary implementation will be chosen at runtime).
  • actors: List of actor parameter sets.
    • config: User defined configuration sent to the actor at the start of the trial. The type is defined in the spec file under section actor_classes:config_type for the appropriate actor class. DEFAULT: not set.
    • name: The name of the actor (must be unique in the trial). DEFAULT: none (required parameter).
    • actor_class: The name of the actor class. This must match a value in the spec file under section actor_classes:name. DEFAULT: none (required parameter).
    • endpoint: Endpoint of the actor. This can be "cogment://client", which indicates a client actor. DEFAULT: context discovery endpoint (the Directory will be inquired).
    • implementation: The name of the implementation to run this actor. This must match an implementation that is defined at the endpoint. DEFAULT: not set (an arbitrary implementation will be chosen at runtime).
    • initial_connection_timeout: Maximum amount of time (in seconds) to wait for an actor to connect to a new trial, after which it is considered unavailable for the trial duration. If the wait is too long (see max_inactivity), the trial may be terminated. The trial may wait longer than the requested timeout. DEFAULT: 0.0 (no timeout; indefinite wait).
    • response_timeout: Maximum amount of time (in seconds) to wait for an actor to respond with an action after an observation is sent, after which it is considered unavailable. If the wait is too long, the trial may be terminated (see max_inactivity). The trial may wait longer than the requested timeout. DEFAULT: 0.0 (no timeout; indefinite wait).
    • optional: If set (true), the actor is optional. An optional actor is not necessary for a trial to continue. If an actor is required (i.e not optional), the trial will be terminated if the actor is not available. DEFAULT: false.
    • default_action: This is only relevant for optional actors (see optional). If set, and the actor is not available, the environment will receive this action (the environment will not be informed that the actor is unavailable). If not set, the environment will be informed that the actor is unavailable (the environment will not receive an action). The type is defined in the spec file under section actor_classes:action:space for the appropriate actor class. DEFAULT: not set.

Parameter file

The parameter file serves to initialize the Orchestrator default parameters. It is able to set all parameters except for the configs and actor default actions.

The file uses the YAML configuration language. It consists of one top level YAML section called trial_params. -Any other top level section will be ignored.

The layout is hierarchical, so the name of the parameters may be different than the parameter description above:

  • properties: Dictionary of user defined key/value pairs.
  • max_steps
  • max_inactivity
  • nb_buffered_ticks
  • datalog: List of parameters related to the data logger. If this section is not present, data logging is disabled.
    • endpoint
    • exclude_fields
  • environment: List of parameters for the environment
    • name
    • endpoint
    • implementation
  • actors: List of actor parameter sets. Note that as defaults, the number of actors may not be suited for all trials.
    • name
    • actor_class
    • endpoint
    • implementation
    • initial_connection_timeout
    • response_timeout
    • optional

E.g.:

trial_params:
properties:
days_to_retain: 10
training: no
with_humans: yes
params_source: default
processor: "Alpha-67+"

max_steps: 1000
max_inactivity: 30
nb_buffered_ticks: 5

datalog:
endpoint: grpc://logserver:9000
exclude_fields: [messages, actions]

environment:
name: Arena
endpoint: grpc://env:9000
implementation: simple

actors:
- name: Alice
actor_class: BigPlayer
endpoint: cogment://discover
implementation:
- name: Bob
actor_class: BigPlayer
endpoint: grpc://bp2:9000
implementation: Test
initial_connection_timeout: 10.0
- name: Carol
actor_class: SmallPlayer
endpoint: grpc://sp:9000
implementation: DQN_Hotel3
initial_connection_timeout: 5.0
optional: True
- name: Dave
actor_class: SmallPlayer
endpoint: cogment://discover/service?id=8390256
implementation: DNN_Karma3.1.17
initial_connection_timeout: 3.0
optional: True
- name: Olivia
actor_class: Referee
endpoint: cogment://client
implementation: Standard
response_timeout: 20.0

Parameters and pre-trial hooks

If no parameters were given to the trial start call, the default parameters and pre-trial hooks are used. +Any other top level section will be ignored.

The layout is hierarchical, so the name of the parameters may be different than the parameter description above:

  • properties: Dictionary of user defined key/value pairs.
  • max_steps
  • max_inactivity
  • nb_buffered_ticks
  • datalog: List of parameters related to the data logger. If this section is not present, data logging is disabled.
    • endpoint
    • exclude_fields
  • environment: List of parameters for the environment
    • name
    • endpoint
    • implementation
  • actors: List of actor parameter sets. Note that as defaults, the number of actors may not be suited for all trials.
    • name
    • actor_class
    • endpoint
    • implementation
    • initial_connection_timeout
    • response_timeout
    • optional

E.g.:

trial_params:
properties:
days_to_retain: 10
training: no
with_humans: yes
params_source: default
processor: "Alpha-67+"

max_steps: 1000
max_inactivity: 30
nb_buffered_ticks: 5

datalog:
endpoint: grpc://logserver:9000
exclude_fields: [messages, actions]

environment:
name: Arena
endpoint: grpc://env:9000
implementation: simple

actors:
- name: Alice
actor_class: BigPlayer
endpoint: cogment://discover
implementation:
- name: Bob
actor_class: BigPlayer
endpoint: grpc://bp2:9000
implementation: Test
initial_connection_timeout: 10.0
- name: Carol
actor_class: SmallPlayer
endpoint: grpc://sp:9000
implementation: DQN_Hotel3
initial_connection_timeout: 5.0
optional: True
- name: Dave
actor_class: SmallPlayer
endpoint: cogment://discover/service?id=8390256
implementation: DNN_Karma3.1.17
initial_connection_timeout: 3.0
optional: True
- name: Olivia
actor_class: Referee
endpoint: cogment://client
implementation: Standard
response_timeout: 20.0

Parameters and pre-trial hooks

If no parameters were given to the trial start call, the default parameters and pre-trial hooks are used. And if no pre-trial hooks are defined, the default parameters will be used directly to start the trial.

Pre-trial hooks are gRPC services that may be called to set up the parameters for a new trial. Multiple hooks can be defined and they will all be called in order, in a pipeline fashion (i.e. the output of one becomes the input of the next). The first hook service to be called will receive the default parameters (augmented by the trial config that may be given to the trial start call). The output of the last hook is used as final parameters to start the new trial. The response of the last hook will be waited on before the trial starts.

The hooks will be called to update or generate all the parameter data (presented here) in addition to the configurations for the environment and the actors (if needed).

Pre-trial hooks are defined on the command line (or an environment variable) when starting the Orchestrator.

Cogment endpoints

Cogment endpoints are basic URLs (scheme://host/path?query) that can have one of two schemes: grpc or cogment. The path and query are optional, but a valid endpoint must have a scheme and a host.

The context is used to determine what API service will be used to connect to the endpoint; e.g. if this is the endpoint for an environment, then the EnvironmentSP gRPC API will be used.

grpc scheme

The grpc scheme is used to access a network resource using one of the Cogment gRPC API directly, without the need of a Directory. An endpoint with this scheme is also called a grpc endpoint. -The rest of the URL is a standard HTTP address (with port) and points to the gRPC server waiting for connection. E.g.:

grpc://10.0.123.5:9000
grpc://SomeServer:9011
grpc://second.actors.base.com:9050

cogment scheme

The cogment scheme is specific to Cogment and has two possible hosts: client or discover.

client host

The client host is used in the very specific case of an actor being a "client actor". +The rest of the URL is a standard HTTP address (with port) and points to the gRPC server waiting for connection. E.g.:

grpc://10.0.123.5:9000
grpc://SomeServer:9011
grpc://second.actors.base.com:9050

cogment scheme

The cogment scheme is specific to Cogment and has two possible hosts: client or discover.

client host

The client host is used in the very specific case of an actor being a "client actor". This endpoint (i.e. exactly "cogment://client") is a special endpoint. Only actors can use this endpoint. In this case, the actor with such an endpoint will connect as a client, the Orchestrator being the server. @@ -34,16 +34,16 @@ An endpoint with this host (i.e. starting with "cogment://discover") is also called a discovery endpoint.

The directory returns an actual endpoint where to reach the service; either a grpc endpoint (e.g. grpc://10.5.134.2:9000), or for an actor, it can also be a special endpoint (e.g. cogment://client). The result should not be another discovery endpoint.

The endpoint for the directory must be a grpc endpoint and is provided beforehand (e.g. for the Orchestrator, it is an option on start).

With a context discovery endpoint there is no path in the URL, and some of the details of the service will be obtained from the context of the endpoint (i.e. where the endpoint was provided and for what). This type of endpoint is the simple form of discovery endpoints.

When there is no query, it is in its simplest form and referred as a pure context discovery endpoint: "cogment://discover". -It is the default in Cogment when no endpoint is provided by the user (where discovery endpoints are valid).

Example of context discovery endpoints:

cogment://discover
cogment://discover?tag=blue
cogment://discover?tag=red&zone=1

If these endpoints were provided for actors, they would be equivalent to these explicit discovery endpoints:

cogment://discover/actor?__actor_class=xxx&__implementation=yyy
cogment://discover/actor?__actor_class=xxx&__implementation=yyy&tag=blue
cogment://discover/actor?__actor_class=xxx&__implementation=yyy&tag=red&zone=1

Where "xxx" and "yyy" are values taken from the context (typically the trial start parameters). For each type of endpoint, the context provides the path as described below, and these properties (if available):

  • For actor contexts: properties are __actor_class and __implementation
  • For environment contexts: property is __implementation
  • For all other contexts, no properties are provided by the context

These properties are implicitly registered in the directory when starting an actor or environment service from a SDK. +It is the default in Cogment when no endpoint is provided by the user (where discovery endpoints are valid).

Example of context discovery endpoints:

cogment://discover
cogment://discover?tag=blue
cogment://discover?tag=red&zone=1

If these endpoints were provided for actors, they would be equivalent to these explicit discovery endpoints:

cogment://discover/actor?__actor_class=xxx&__implementation=yyy
cogment://discover/actor?__actor_class=xxx&__implementation=yyy&tag=blue
cogment://discover/actor?__actor_class=xxx&__implementation=yyy&tag=red&zone=1

Where "xxx" and "yyy" are values taken from the context (typically the trial start parameters). For each type of endpoint, the context provides the path as described below, and these properties (if available):

  • For actor contexts: properties are __actor_class and __implementation
  • For environment contexts: property is __implementation
  • For all other contexts, no properties are provided by the context

These properties are implicitly registered in the directory when starting an actor or environment service from a SDK. But if explicitly registering the services to the directory, these properties must be provided if a context discovery endpoint is used (otherwise the service will not be found).

An explicit discovery endpoint, as opposed to a context discovery endpoint, is a URL with a path, and needs to explicitly provide all the necessary information in the URL (the context of the endpoint will be ignored). In other words, no context property will be implicitly added to the URL query sent to the directory, the user is fully responsible to match the URL to the need (and match the properties).

Discovery path

There are two categories of path for discovery endpoints, one for generic service types and the other for specific service types.

The generic path service is used to find services of any type. -In this case, the query must be __id=XXX where XXX is a 64 bit unsigned integer representing the ID of a service registered in the directory, e.g.:

cogment://discover/service?__id=67834892
cogment://discover/service?__id=42

The specific paths are used to find a specific type of service:

  • actor: To find an actor service
  • environment: To find an environment service
  • datalog: To find a data logger service
  • prehook: To find a pre-trial hook service
  • lifecycle: To find a service offering trial life cycle management
  • actservice: To find a service offering client actor connection
  • datastore: To find a data store service
  • modelregistry: To find a model registry service
  • directory: To find a directory service

The actor, environment and datalog paths will normally be used in the trial parameters to start a new trial. +In this case, the query must be __id=XXX where XXX is a 64 bit unsigned integer representing the ID of a service registered in the directory, e.g.:

cogment://discover/service?__id=67834892
cogment://discover/service?__id=42

The specific paths are used to find a specific type of service:

  • actor: To find an actor service
  • environment: To find an environment service
  • datalog: To find a data logger service
  • prehook: To find a pre-trial hook service
  • lifecycle: To find a service offering trial life cycle management
  • actservice: To find a service offering client actor connection
  • datastore: To find a data store service
  • modelregistry: To find a model registry service
  • directory: To find a directory service

The actor, environment and datalog paths will normally be used in the trial parameters to start a new trial. They will be interpreted and managed by the Orchestrator, which will inquire the Directory.

The prehook path is for use on the command line of the Orchestrator.

The others are for use by services themselves, e.g. to find an Orchestrator to connect to.

Discovery query

Following the path in the discovery endpoint, is the optional query; properties to find a suitable service. All the properties provided in the query must match properties registered in the directory (with some exceptions, see below). -Which properties are acceptable depends on the directory (and how the services are registered in the directory).

The query in the discovery endpoint must follow these guidelines:

  • Entries are separated by the ampersand (&)
  • Property name and associated value are separated by an equal sign (=)
  • Property names and values must be composed of only these characters: A-Z, a-z, 0-9, underscore (_), dash (-), dot (.)
  • Property values are optional
  • Property names starting with a double underscore (__) are reserved. E.g __authentication-token

E.g.:

cogment://discover/actor?__implementation=d3qn
cogment://discover/environment?__implementation=fqdn3&type=fast-2x&ping=low
cogment://discover/datalog?name=high&open&color=green_blue
Reserved query properties

Some endpoint query properties are reserved for Cogment use. They may be interpreted by other services than the directory, and thus may not correspond to directory properties that participate in service discovery. +Which properties are acceptable depends on the directory (and how the services are registered in the directory).

The query in the discovery endpoint must follow these guidelines:

  • Entries are separated by the ampersand (&)
  • Property name and associated value are separated by an equal sign (=)
  • Property names and values must be composed of only these characters: A-Z, a-z, 0-9, underscore (_), dash (-), dot (.)
  • Property values are optional
  • Property names starting with a double underscore (__) are reserved. E.g __authentication-token

E.g.:

cogment://discover/actor?__implementation=d3qn
cogment://discover/environment?__implementation=fqdn3&type=fast-2x&ping=low
cogment://discover/datalog?name=high&open&color=green_blue
Reserved query properties

Some endpoint query properties are reserved for Cogment use. They may be interpreted by other services than the directory, and thus may not correspond to directory properties that participate in service discovery. Some of these names may not be used as properties to inquire from (or register in) the directory. -They may be used for special purposes that differ for each name.

  • __actor_class: This is a property name implicitly used by Cogment. It is registered in the Directory for services that were implicitly registered by Cogment or a Cogment SDK. It is also used by Cogment to inquire for context discovery endpoints.
  • __authentication-token: This query property is not a directory property. It is used to provide authentication to the directory. The value (and need) depends on the directory implementation and/or how the registration of the service is made in the directory. This is not registered as a property in the Directory.
  • __id: This query property is not a directory property. It is used to provide a service ID for inquiry to the directory for a specific service. This is not registered as a property in the Directory.
  • __implementation: This is a property name implicitly used by Cogment. It is registered in the Directory for services that were implicitly registered by Cogment or a Cogment SDK. It is also used by Cogment to inquire for context discovery endpoints.
- - +They may be used for special purposes that differ for each name.

  • __actor_class: This is a property name implicitly used by Cogment. It is registered in the Directory for services that were implicitly registered by Cogment or a Cogment SDK. It is also used by Cogment to inquire for context discovery endpoints.
  • __authentication-token: This query property is not a directory property. It is used to provide authentication to the directory. The value (and need) depends on the directory implementation and/or how the registration of the service is made in the directory. This is not registered as a property in the Directory.
  • __id: This query property is not a directory property. It is used to provide a service ID for inquiry to the directory for a specific service. This is not registered as a property in the Directory.
  • __implementation: This is a property name implicitly used by Cogment. It is registered in the Directory for services that were implicitly registered by Cogment or a Cogment SDK. It is also used by Cogment to inquire for context discovery endpoints.
+ + \ No newline at end of file diff --git a/docs/reference/python-enterprise/installation.html b/docs/reference/python-enterprise/installation.html index 6faadcd..546ab0d 100644 --- a/docs/reference/python-enterprise/installation.html +++ b/docs/reference/python-enterprise/installation.html @@ -1,21 +1,21 @@ - + - + Installation | Cogment - - - + + + - - + + + \ No newline at end of file diff --git a/docs/reference/python-enterprise/runner.html b/docs/reference/python-enterprise/runner.html index db86d04..b9f2a37 100644 --- a/docs/reference/python-enterprise/runner.html +++ b/docs/reference/python-enterprise/runner.html @@ -1,27 +1,27 @@ - + - + Runner | Cogment - - - + + +
-

Runner

Cogment Enterprise

This is part of the Cogment Enterprise, AI Redefined's commercial offering.

General usage

asyncio

The use of this module requires Cogment Python SDK >= 2.8.0. It uses Python's asyncio library and as such should be run in an asyncio.Task. -This documentation assumes some familiarity with the asyncio library of Python (see Python documentation).

E.g.

import asyncio

asyncio.run(MyMainFunction())

Logging

This module uses the cogment.enterprise logger, and the default log level is INFO. E.g. to change the log level to WARNING:

import cogment_enterprise
import logging

logging.getLogger("cogment.enterprise").setLevel(logging.WARNING)

Or set the environment variable COGMENT_ENTERPRISE_LOG_LEVEL to one of the values: off, error, warning, info, debug, trace. +

Runner

Cogment Enterprise

This is part of the Cogment Enterprise, AI Redefined's commercial offering.

General usage

asyncio

The use of this module requires Cogment Python SDK >= 2.8.0. It uses Python's asyncio library and as such should be run in an asyncio.Task. +This documentation assumes some familiarity with the asyncio library of Python (see Python documentation).

E.g.

import asyncio

asyncio.run(MyMainFunction())

Logging

This module uses the cogment.enterprise logger, and the default log level is INFO. E.g. to change the log level to WARNING:

import cogment_enterprise
import logging

logging.getLogger("cogment.enterprise").setLevel(logging.WARNING)

Or set the environment variable COGMENT_ENTERPRISE_LOG_LEVEL to one of the values: off, error, warning, info, debug, trace. The logging works the same as Cogment Python SDK logging (see Cogment Python SDK documentation).

Trial Specifications

This module is designed to work without any trial specifications (i.e. cog_settings), but is easier to use if the specification are available.

If the specifications are not provided, some internal object deserializations will not happen (e.g. sample.observation), and special serialized versions will have to be used (e.g. sample.observation_serialized). Helper functions are provided for deserializing the various defined objects in the specifications (see below).

Objects normally received as google.protobuf.Any will still be deserialized to such an object as it does not depend on the specification of the trial.

Top-level import

The main module of the Runner SDK is cogment_enterprise.runner, and most enterprise scripts will start with a cogment_enterprise.runner.TrialRunner.

Utilities and Constants

cogment_enterprise.runner.BATCH_ID_PROPERTY

This is the name of the trial property where the batch ID is stored. -Each trial started by a batch will have this property.

batch_id = trial_parameters.properties[cogment_enterprise.runner.BATCH_ID_PROPERTY]

cogment_enterprise.runner.BATCH_TRIAL_INDEX_PROPERTY

This is the name of the trial property where the index of the trial in the batch is stored. -Each trial started by a batch will have this property.

trial_index_in_batch = trial_parameters.properties[cogment_enterprise.runner.BATCH_TRIAL_INDEX_PROPERTY]

cogment_enterprise.runner.BATCH_LAST_TRIAL_PROPERTY

This is the name of the trial property that will be set on the last trial of the batch. +Each trial started by a batch will have this property.

batch_id = trial_parameters.properties[cogment_enterprise.runner.BATCH_ID_PROPERTY]

cogment_enterprise.runner.BATCH_TRIAL_INDEX_PROPERTY

This is the name of the trial property where the index of the trial in the batch is stored. +Each trial started by a batch will have this property.

trial_index_in_batch = trial_parameters.properties[cogment_enterprise.runner.BATCH_TRIAL_INDEX_PROPERTY]

cogment_enterprise.runner.BATCH_LAST_TRIAL_PROPERTY

This is the name of the trial property that will be set on the last trial of the batch. The property value is empty, it's presence indicates that this is the last trial of the batch. -Only one trial in a batch may have this property.

Note that there may not be a trial with this property if the batch was stopped prematurely.

last_trial = cogment_enterprise.runner.BATCH_LAST_TRIAL_PROPERTY in trial_parameters.properties

cogment_enterprise.runner.deserialize_action(serialized_data, actor_class, cog_settings)

Function to deserialize raw data into a Python class instance.

The data can only be deserialized by knowing the protobuf message it represents. +Only one trial in a batch may have this property.

Note that there may not be a trial with this property if the batch was stopped prematurely.

last_trial = cogment_enterprise.runner.BATCH_LAST_TRIAL_PROPERTY in trial_parameters.properties

cogment_enterprise.runner.deserialize_action(serialized_data, actor_class, cog_settings)

Function to deserialize raw data into a Python class instance.

The data can only be deserialized by knowing the protobuf message it represents. It can be done manually if one knows the protobuf message represented. This function simplifies deserialization of messages related to a Cogment project with the trial spec module cog_settings.

Parameters:

  • serialized_data: bytes - Raw data received.
  • actor_class: str - Name of the class of the actor to which this data relates. This information is necessary to find the proper message type in the spec.
  • cog_settings: module - Specification module associated with the trial from which the data relates.

Return: protobuf class instance - Action from an actor of type actor_class. The class of the action is defined as action space for the specific actor class in the section actor_classes:action:space in the spec file (e.g. cog_settings). None if serialized_data is None.

cogment_enterprise.runner.deserialize_actor_observation(serialized_data, actor_class, cog_settings)

Function to deserialize raw data into a Python class instance.

The data can only be deserialized by knowing the protobuf message it represents. It can be done manually if one knows the protobuf message represented. @@ -37,15 +37,15 @@ All trials already started will continue training.

Parameters: None

Return: None

is_running(self)

Method to inquire whether the training is done or not.

Parameters: None

Return: bool - True if the training is still running. The training has stopped running when no more samples are being retrieved and all callbacks have returned.

async wait(self, timeout)

Method to wait for the training to be done. The training will end normally when all trials of the batch have started processing and all callbacks have returned. The training can also be stopped, or encounter an error to become done.

Parameters:

  • timeout: float - Maximum time to wait in seconds.

Return: bool - False if timed out, True otherwise. If True, then is_running will also return True.

set_nb_parallel_trials(self, nb_trials)

Method to set the number of trials to train in parallel.

Parameters:

  • nb_trials: int - Number of trials to train in parallel (>0). If None, no limit will be enforced and all batch trial data will be processed as it becomes available. Default is 1 (i.e. no parallelism, only one trial at a time).

Return: None

class BatchTrialInfo

batch_id: str - ID of the batch

trial_index: int - The index of the trial in the batch. Generally the order the trials were started, and unique in the batch ([0, nb_trials[).

trial_info: cogment.DatastoreTrialInfo - The running trial information. May not always be present.

class TrainerTrialSession

Class to help train a model on a specific batch of trials.

trial_id: str - ID of the trial.

parameters: cogment.TrialParameters instance - Parameters of the trial.

model_registry: cogment.ModelRegistry instance - Common model registry for the whole batch being trained. The TrialRunner argument model_registry_endpoint is used to retrieve this model registry.

async all_samples(self)

Method to retrieve all samples from the trial.

Parameters: None

Return: generator(cogment.DatastoreSample instance) - A generator for the trial samples that arrive.

Callbacks

Use

These functions are passed to the TrialRunner.run_simple_batch or TrialRunner.run_simple_training methods and will be called at specific times to request information to the user or provide information to the user. -They can be defined and used in a number of ways.

Here we take the pre_trial_callback as an example, but the other callbacks are similar, except for parameters and return values:

async def my_pre_trial_callback(info: BatchTrialInfo):
trial_params = cogment.TrialParameters()
# ... Fill in the parameters here
return trial_params

runner = TrialRunner(1, 1, None, my_pre_trial_callback)

Sometimes it is more convenient for the callback to be a method of a class in order to re-use data between calls, or share data with other parts of the program (or other callbacks), in this case it could look like this:

class MyBatchData:
async def my_pre_trial_callback(self, info: BatchTrialInfo):
trial_params = cogment.TrialParameters()
# ... Fill in the parameters here
return trial_params

my_data = MyBatchData()
runner = TrialRunner(1, 1, None, my_data.my_pre_trial_callback)

Although rare, it may be inconvenient sometimes to use a class for sharing data, in which case the Python functools module can be used:

import functools

async def my_function(my_data, info: BatchTrialInfo):
trial_params = cogment.TrialParameters()
# ... Fill in the parameters here
return trial_params

shared_data = #...
actual_callback = functools.partial(my_function, shared_data)
runner = TrialRunner(1, 1, None, actual_callback)

Pre-Trial Callback

This function is passed to the TrialRunner.run_simple_batch method and will be called before any trial is started to define the trial parameters. -It is an asyncio coroutine.

e.g.:

async def my_pre_trial_callback(info: BatchTrialInfo) -> cogment.TrialParameters:
trial_params = cogment.TrialParameters()
# ... Fill in the parameters here
return trial_params

Parameters Received:

  • info: BatchTrialInfo instance - Partially filled info of the trial to start; it does not contain trial_info.

Expected Return: None or tuple(str, cogment.TrialParameters instance) - The first item of the tuple is the requested trial ID. If the trial ID is None, it will be automatically created using the batch ID and the trial index. The second item of the tuple is the trial parameters that must be fully populated to start the new trial. If the return value is None (instead of a tuple), the trial will not start and the batch will stop (i.e. not start any new trial, but ongoing trials will continue).

In case of exceptions: Exceptions raised by the callback will do the same as if None was returned.

Once the parameters are received by the TrialBatch, some data will be added, and some will be overwritten before starting the trial. +They can be defined and used in a number of ways.

Here we take the pre_trial_callback as an example, but the other callbacks are similar, except for parameters and return values:

async def my_pre_trial_callback(info: BatchTrialInfo):
trial_params = cogment.TrialParameters()
# ... Fill in the parameters here
return trial_params

runner = TrialRunner(1, 1, None, my_pre_trial_callback)

Sometimes it is more convenient for the callback to be a method of a class in order to re-use data between calls, or share data with other parts of the program (or other callbacks), in this case it could look like this:

class MyBatchData:
async def my_pre_trial_callback(self, info: BatchTrialInfo):
trial_params = cogment.TrialParameters()
# ... Fill in the parameters here
return trial_params

my_data = MyBatchData()
runner = TrialRunner(1, 1, None, my_data.my_pre_trial_callback)

Although rare, it may be inconvenient sometimes to use a class for sharing data, in which case the Python functools module can be used:

import functools

async def my_function(my_data, info: BatchTrialInfo):
trial_params = cogment.TrialParameters()
# ... Fill in the parameters here
return trial_params

shared_data = #...
actual_callback = functools.partial(my_function, shared_data)
runner = TrialRunner(1, 1, None, actual_callback)

Pre-Trial Callback

This function is passed to the TrialRunner.run_simple_batch method and will be called before any trial is started to define the trial parameters. +It is an asyncio coroutine.

e.g.:

async def my_pre_trial_callback(info: BatchTrialInfo) -> cogment.TrialParameters:
trial_params = cogment.TrialParameters()
# ... Fill in the parameters here
return trial_params

Parameters Received:

  • info: BatchTrialInfo instance - Partially filled info of the trial to start; it does not contain trial_info.

Expected Return: None or tuple(str, cogment.TrialParameters instance) - The first item of the tuple is the requested trial ID. If the trial ID is None, it will be automatically created using the batch ID and the trial index. The second item of the tuple is the trial parameters that must be fully populated to start the new trial. If the return value is None (instead of a tuple), the trial will not start and the batch will stop (i.e. not start any new trial, but ongoing trials will continue).

In case of exceptions: Exceptions raised by the callback will do the same as if None was returned.

Once the parameters are received by the TrialBatch, some data will be added, and some will be overwritten before starting the trial. These are the TrialParameters attributes changed:

  • properties: Some properties will be added to the existing properties (see Module Attributes). If the property names clash, the user properties will be overwritten. In general, do not start property names with an underscore to prevent such clashes.
  • datalog_endpoint: This attribute of the trial parameters will be overwritten. If the datastore_endpoint argument of TrialRunner is provided, it will be used. If datastore_endpoint was not provided, or it was None, then the directory will be used to find an appropriate datalog/datastore. The same datastore must be used by both the TrialBatch (as a datalog) and BatchTrainer (as a datastore), so the endpoint should resolve to the same datastore locally and at the Orchestrator (i.e. ideally use the same directory).
  • datalog_exclude_fields: This attribute will be reset (i.e. not excluding any fields from the datalog).

Post-Trial Callback

This function is passed to the TrialRunner.run_simple_batch method and will be called after a trial has ended normally (i.e. was not terminated). -It is an asyncio coroutine.

e.g.:

async def my_post_trial_callback(info):
# ... Do cleanup, tracking, etc

Parameters Received:

  • info: BatchTrialInfo instance - The full info of the trial that ended.

Expected Return: None

In case of exceptions: All exceptions raised by the callback will be ignored.

Sampler Callback

This function is passed to the TrialRunner.run_simple_trainer method and will be called for each sample of the trials being run in the batch. +It is an asyncio coroutine.

e.g.:

async def my_post_trial_callback(info):
# ... Do cleanup, tracking, etc

Parameters Received:

  • info: BatchTrialInfo instance - The full info of the trial that ended.

Expected Return: None

In case of exceptions: All exceptions raised by the callback will be ignored.

Sampler Callback

This function is passed to the TrialRunner.run_simple_trainer method and will be called for each sample of the trials being run in the batch. This is asynchronous with the actual running of the trials and uses the Cogment Datastore to retrieve the samples. -It is an asyncio coroutine.

e.g.:

async def my_sampler_callback(sample, trial_parameters, model_registry):
# ... Train model

Parameters Received:

  • sample: cogment.DatastoreSample instance - Trial sample received.
  • trial_parameters: cogment.TrialParameters instance - Parameters of the trial from which the sample came from.
  • model_registry: cogment.ModelRegistry instance - Common model registry for the whole batch being trained. The TrialRunner argument model_registry_endpoint is used to retrieve this model registry.

Expected Return: None or bool - If None or True, the training will continue normally. If a bool and False, the sampler callback will stop being called, and the BatchTrainer will stop.

In case of exceptions: If the callback raises an exception, the BatchTrainer will stop at the next sample.

Trial Callback

This function is passed to the TrialRunner.run_simple_trial_trainer method and will be called for each trial of the batch. +It is an asyncio coroutine.

e.g.:

async def my_sampler_callback(sample, trial_parameters, model_registry):
# ... Train model

Parameters Received:

  • sample: cogment.DatastoreSample instance - Trial sample received.
  • trial_parameters: cogment.TrialParameters instance - Parameters of the trial from which the sample came from.
  • model_registry: cogment.ModelRegistry instance - Common model registry for the whole batch being trained. The TrialRunner argument model_registry_endpoint is used to retrieve this model registry.

Expected Return: None or bool - If None or True, the training will continue normally. If a bool and False, the sampler callback will stop being called, and the BatchTrainer will stop.

In case of exceptions: If the callback raises an exception, the BatchTrainer will stop at the next sample.

Trial Callback

This function is passed to the TrialRunner.run_simple_trial_trainer method and will be called for each trial of the batch. This is asynchronous with the actual running of the trials and uses the Cogment Datastore to retrieve the trial data and samples. -It is an asyncio coroutine.

e.g.:

async def my_trial_callback(session):
async for sample in session.all_samples():
# ... process sample

Parameters Received:

  • session: TrainerTrialSession instance - The session for the trial.

Expected Return: None or bool - If None or True, continue processing the batch. If a bool and False, stop the BatchTrainer.

In case of exceptions: If the callback raises an exception, the BatchTrainer will stop immediately.

- - +It is an asyncio coroutine.

e.g.:

async def my_trial_callback(session):
async for sample in session.all_samples():
# ... process sample

Parameters Received:

  • session: TrainerTrialSession instance - The session for the trial.

Expected Return: None or bool - If None or True, continue processing the batch. If a bool and False, stop the BatchTrainer.

In case of exceptions: If the callback raises an exception, the BatchTrainer will stop immediately.

+ + \ No newline at end of file diff --git a/docs/reference/python.html b/docs/reference/python.html index dabf301..f0f93b6 100644 --- a/docs/reference/python.html +++ b/docs/reference/python.html @@ -1,27 +1,27 @@ - + - + Python SDK | Cogment - - - + + +
-

Python SDK

Repository Latest release

Installation

The simplest way to install the python SDK is to just install it using pip: pip install cogment.

To install the generator (for cog_settings.py) it is done similarly with pip: pip install cogment[generate]. If both are needed, installing the generator will install the Python SDK.

The basic requirement is Python 3.7.

General usage

asyncio

The Python SDK is designed to run concurrently and asynchronously using the Python asyncio library. As such, it should be run in an asyncio.Task.

E.g.

asyncio.run(MyMainFunction())

Logging

The Python SDK uses the cogment.sdk logger, and the default log level is INFO. E.g. to change the log level to WARNING:

import cogment
import logging

logging.getLogger("cogment.sdk").setLevel(logging.WARNING)

Or set the environment variable COGMENT_LOG_LEVEL to one of the values: off, error, warning, info, debug, trace (which match the respective Python levels logging.CRITICAL, logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG). +

Python SDK

Repository Latest release

Installation

The simplest way to install the python SDK is to just install it using pip: pip install cogment.

To install the generator (for cog_settings.py) it is done similarly with pip: pip install cogment[generate]. If both are needed, installing the generator will install the Python SDK.

The basic requirement is Python 3.7.

General usage

asyncio

The Python SDK is designed to run concurrently and asynchronously using the Python asyncio library. As such, it should be run in an asyncio.Task.

E.g.

asyncio.run(MyMainFunction())

Logging

The Python SDK uses the cogment.sdk logger, and the default log level is INFO. E.g. to change the log level to WARNING:

import cogment
import logging

logging.getLogger("cogment.sdk").setLevel(logging.WARNING)

Or set the environment variable COGMENT_LOG_LEVEL to one of the values: off, error, warning, info, debug, trace (which match the respective Python levels logging.CRITICAL, logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG). Since the Cogment Python SDK does not output any critical logs, the logging.CRITICAL level effectively turns logging off. The trace level does not match a standard Python logging level and is mostly for internal use with a level lower than logging.DEBUG.

The Cogment logger does not define a handler, and the handler management is left to the application (as is standard for a library in Python). Thus the Python logging.lastResort handler will be used if no explicit handler is defined by the application (i.e. only warnings and errors will be output to stderr, with no formatting). The application should enable a handler as required. -E.g. for a default logging setup (including a stream handler):

import cogment
import logging

logging.basicConfig()
note

Calling any of the module level functions logging.log, logging.debug, logging.info, logging.warning, logging.error, logging.critical or logging.exception, will implicitly call logging.basicConfig. +E.g. for a default logging setup (including a stream handler):

import cogment
import logging

logging.basicConfig()
note

Calling any of the module level functions logging.log, logging.debug, logging.info, logging.warning, logging.error, logging.critical or logging.exception, will implicitly call logging.basicConfig. And calling logging.basicConfig does nothing if there is a root handler already defined. -See Python documentation for logging.basicConfig

Trial Specifications

The specifications (specs) of a trial type are contained in a spec file and the imported files defined in the spec file. This file is typically named cogment.yaml.

For example, an actor class is defined by its required observation space and action space.

These "spaces" are defined by using protobuf message types (from the imported files). Observations and actions will simply be instances of the appropriate type.

Messages and feedback user data don't have a set type, they can be any type of protobuf message as long as the receiver can manage that type (i.e. the object received is an instance of google.protobuf.Any and the contained type should be checked against known types before handling). The type is determined by the provided message from the originator.

Trial Parameters

The trial parameters can come from the Controller start_trial command, from the default parameters provided to the Orchestrator on startup, or from the pre-trial hooks (themselves provided to the Orchestrator on startup).

The parameters are mostly independent of the spec file (cogment.yaml), except that the active actors listed in the parameters must have their actor class match an actor class defined in the spec file.

Below, when we refer to the trial parameters, we mean the final parameters after any pre-trial hooks.

Compiling the spec file into cog_settings.py

In order to use the specifications within python scripts, the spec file needs to be compiled into python modules. This is done by the Python SDK generator (see [#installation]).

The generator is used this way:

$ python3 -m cogment.generate --spec cogment.yaml --output ./cog_settings.py

This will create a cog_settings.py specs module in the current directory (--output ./). The generator will also compile the imported *.proto files into python modules that will be saved in the same location as the specified output file (cog_settings.py) and they will be named according to their proto names: <name>.proto is compiled to <name>_pb2.py.

The cog_settings.py Python module is required by all API entry points.

Top-level import

The main module of the Cogment SDK is cogment. But all cogment scripts need to start with a cogment.Context, which also requires the generated module cog_settings (project specific definitions created from the spec file).

If one needs to create a cogment.TrialParameters or cogment.ActorParameters from scratch, the cog_settings module is also required.

import cog_settings
import cogment

class cogment.Context

Class to setup and run all the different aspects of Cogment trials.

served_port: int - The port on which serve_all_registered is offering the various registered services. The port is 0 if no services are offered (e.g. serve_all_registered was not called yet). +See Python documentation for logging.basicConfig

Trial Specifications

The specifications (specs) of a trial type are contained in a spec file and the imported files defined in the spec file. This file is typically named cogment.yaml.

For example, an actor class is defined by its required observation space and action space.

These "spaces" are defined by using protobuf message types (from the imported files). Observations and actions will simply be instances of the appropriate type.

Messages and feedback user data don't have a set type, they can be any type of protobuf message as long as the receiver can manage that type (i.e. the object received is an instance of google.protobuf.Any and the contained type should be checked against known types before handling). The type is determined by the provided message from the originator.

Trial Parameters

The trial parameters can come from the Controller start_trial command, from the default parameters provided to the Orchestrator on startup, or from the pre-trial hooks (themselves provided to the Orchestrator on startup).

The parameters are mostly independent of the spec file (cogment.yaml), except that the active actors listed in the parameters must have their actor class match an actor class defined in the spec file.

Below, when we refer to the trial parameters, we mean the final parameters after any pre-trial hooks.

Compiling the spec file into cog_settings.py

In order to use the specifications within python scripts, the spec file needs to be compiled into python modules. This is done by the Python SDK generator (see [#installation]).

The generator is used this way:

$ python3 -m cogment.generate --spec cogment.yaml --output ./cog_settings.py

This will create a cog_settings.py specs module in the current directory (--output ./). The generator will also compile the imported *.proto files into python modules that will be saved in the same location as the specified output file (cog_settings.py) and they will be named according to their proto names: <name>.proto is compiled to <name>_pb2.py.

The cog_settings.py Python module is required by all API entry points.

Top-level import

The main module of the Cogment SDK is cogment. But all cogment scripts need to start with a cogment.Context, which also requires the generated module cog_settings (project specific definitions created from the spec file).

If one needs to create a cogment.TrialParameters or cogment.ActorParameters from scratch, the cog_settings module is also required.

import cog_settings
import cogment

class cogment.Context

Class to setup and run all the different aspects of Cogment trials.

served_port: int - The port on which serve_all_registered is offering the various registered services. The port is 0 if no services are offered (e.g. serve_all_registered was not called yet). asyncio_loop: asyncio.EventLoop instance - The Python asyncio loop used by the context (note that the actual type is specific to the platform).

__init__(self, user_id, cog_settings, asyncio_loop=None, prometheus_registry=prometheus_client.core.REGISTRY, directory_endpoint=None, directory_auth_token=None)

Parameters:

  • user_id: str - Identifier for the user of this context.
  • cog_settings: module - Specs module associated with trials that will be run, observed or inquired (see cog_settings generation). This can be None in some circumstances.
  • asyncio_loop: asyncio.EventLoop instance - The Python asyncio loop into which the Context should operate. If None, the current loop will be used.
  • prometheus_registry: prometheus_client.core.CollectorRegistry instance - Prometheus registry that'll be used by the Cogment metrics in this context. Can be set to None to completely deactivate them. The default value is Prometheus' default global registry.
  • directory_endpoint: Endpoint instance - Grpc endpoint (i.e. starting with "grpc://") to access the directory. The directory will be used to inquire discovery endpoints, and to register the services for discovery. If no endpoint is provided, a check for the environment variable COGMENT_DIRECTORY_ENDPOINT will be made and if it exists, it will be used as the URL of a basic endpoint.
  • directory_auth_token: str - Authentication token for access to the directory. This token will be registered with the services, and must match registered tokens when inquiring the directory. If no token is provided, a check for the environment variable COGMENT_DIRECTORY_AUTHENTICATION_TOKEN will be made and if it exists, it will be used as the token.

has_specs(self)

Parameters: None

Return: bool - True if the specs are known. False otherwise. The specs are known if the cog_settings argument was provided and not None. A context instantiated without specs has limited functionality and will produce objects without specs (thus also having limited functionality).

async serve_all_registered(self, served_endpoint=ServedEndpoint(), prometheus_port=None, directory_registration_host=None)

Method to start and run the communication server for the registered components (environment, actor, prehook, datalog). This coroutine will end when all activity has stopped. If a directory is defined in the Context, then this method will also register the services in the defined directory.

Parameters:

  • served_endpoint: ServedEndpoint instance - Details of the connection for the served components. If served_endpoint.port is zero (0), then the system will choose a free port; in which case the port chosen is found in the served_port attribute of the Context.
  • prometheus_port: int - TCP/IP port number for Prometheus. Set to None to disable the Prometheus metrics server.
  • directory_registration_host: str - Hostname (or IP address) of the host to register to the directory (the port is taken from the served_endpoint) for the services registered. If None, the SDK will determine the current host IP address automatically. In some circumstances, the IP address determined by the SDK may be wrong (e.g. multiple interfaces, load balancing, firewall), thus a host must be explicitly provided.

Return: None

async get_controller(self, endpoint=Endpoint())

Method to get a controller instance to manage trials (start, stop, inquire, etc).

Parameters:

  • endpoint: Endpoint instance - Details of the connection to the Orchestrator.

Return: Controller instance - An instance of the Controller class used to manage trials.

async get_datastore(self, endpoint=Endpoint())

Method to get a class instance to retrieve and manage data in a Datastore.

Parameters:

  • endpoint: Endpoint instance - Details of the connection to the Datastore.

Return: Datastore instance - An instance of the Datastore class.

async get_model_registry_v2(self, endpoint=Endpoint())

Method to get a class instance to store and retrieve models in a Model Registry

Parameters:

  • endpoint: Endpoint instance - Details of the connection to the Model Registry.

Return: ModelRegistry instance - An instance of the ModelRegistry class.

async join_trial(self, trial_id, endpoint=Endpoint(), impl_name=None, actor_name=None, actor_class=None)

Method for an actor to asynchronously join an existing trial. This task will normally end after the user implementation has exited.

Parameters:

  • trial_id: str - The UUID of the trial to join.
  • endpoint: Endpoint instance - Details of the connection to the Orchestrator.
  • impl_name: str - deprecated
  • actor_name: str - Name of the actor joining the trial. If None, actor_class will be used to find the actor to join. The name must match an active actor in the trial as found in the trial parameters in the sections trial_params:actors:name with trial_params:actors:endpoint set to "cogment://client".
  • actor_class: str - The class of actor to join the trial. If None, actor_name will be used to find the actor to join. The class must match an active actor in the trial as found in the trial parameters in the sections trial_params:actors:actor_class with trial_params:actors:endpoint set to "cogment://client".

Return: None

register_environment(self, impl, impl_name, properties={})

Method to register the asynchronous callback function that will run an environment for a trial.

Parameters:

  • impl: async function(EnvironmentSession instance) - Callback function to be registered.
  • impl_name: str - Name for the environment being run by the given callback function.
  • properties: dict{str:str} : Properties associated with the environment to be registered in the directory. These properties may be used for inquiries into the directory to find this environment.

Return: None

register_actor(self, impl, impl_name, actor_classes=[], properties={})

Method to register the asynchronous callback function that will run an actor for a trial.

Parameters:

  • impl: async func(ActorSession instance) - Callback function to be registered.
  • impl_name: str - Name for the actor implementation being run by the given callback function.
  • actor_classes: list[str] - The actor class name(s) that can be run by the given callback function. The possible names are specified in the spec file under section actor_classes:name.
  • properties: dict{str:str} : Properties associated with the actor to be registered in the directory. These properties may be used for inquiries into the directory to find this actor.

Return: None

register_pre_trial_hook(self, impl, properties={})

Method to register an asynchronous callback function that will be called before a trial is started. Only one such function can be registered. But there may be multiple hook services for an Orchestrator. They are provided to the Orchestrator at startup. All hooks registered with the Orchestrator will be called in a pipeline fashion before each new trial.

Parameters:

  • impl: async func(PrehookSession instance) - Callback function to be registered. The PrehookSession instance member data should be changed as needed for the new trial before returning from this function.
  • properties: dict{str:str} : Properties associated with the hook to be registered in the directory. These properties may be used for inquiries into the directory to find this hook.

Return: None

register_datalog(self, impl, properties={})

Method to register an asynchronous callback function that will be called for each trial to serve log requests. Only one such function can be registered. This service is addressed in the trial parameters in the datalog section.

Parameters:

  • impl: async func(DatalogSession instance) - Callback function to be registered
  • properties: dict{str:str} : Properties associated with the datalog to be registered in the directory. These properties may be used for inquiries into the directory to find this datalog.

Return: None

class Controller

Class containing data and methods to control and manage trials.

has_specs(self)

Parameters: None

Return: bool - Always True since the Controller does not rely on trial specs.

async start_trial(self, trial_config=None, trial_id_requested=None, trial_params=None)

Method to start a new trial. The config and parameter options are mutually exclusive.

Parameters:

  • trial_config: protobuf class instance - Configuration for the trial. The type is specified in the spec file under the section trial:config_type. The config will be added to the default parameters (in the Orchestrator) and sent to the pre-trial hooks (if any). The pre-trial hooks will set the trial parameters according to the config. If there is no pre-trial hooks, the config is ignored and the default parameters are used. This cannot be provided with the trial_params. <!--- If this is a bytes string, it will be passed raw to the orchestrator. --->
  • trial_id_requested: str - The trial identifier requested for the new trial. It must be unique among all active trials and a limited set of the latest ended trials (this list of trials can be retrieved with get_trial_info or watch_trial). If provided, the Orchestrator will try to use this trial_id, otherwise, a UUID will be created.
  • trial_params: TrialParameters instance - Fully defined parameters to start the new trial. This will be used as the trial parameters (I.e. the default parameters and pre-trial hooks are ignored). This cannot be provided with the trial_config.

Return: str - The newly started trial ID. An empty string if the trial was not started due to a non-unique requested ID.

async terminate_trial(self, trial_ids, hard=False)

Method to request the end of a trial.

Parameters:

  • trial_ids: list[str] - The trial ID(s) to request to terminate. There must be at least one ID.
  • hard: bool - If True, the termination will be forced and immediate, it will not wait for any action or observation. If False, the trial will wait for the end of the next step, to end gracefully (i.e. wait for the next full set of actions and response observations), and the environment will have a chance to respond to an end request (an event of type ENDING).

Return: None

async get_trial_info(self, trial_ids)

Method to get information about a trial.

Parameters:

  • trial_ids: list[str] - The trial ID(s) from which to request information. If no ID is provided, returns information about all trials. Note that ended trials may only appear for a short time in this list after they have ended.

Return: list[TrialInfo instance] - List of trial information, one per trial. Can be empty if no trial matches.

async watch_trials(self, trial_state_filters=[], full_info=False)

Generator method to iterate, in real-time, through all trials with state matching the filters. When called, it will first iterate over the trials with current state matching the filters. Afterwards, it will wait, and yield in real-time, as trial states change and match the filters.

Parameters:

  • trial_state_filters: list[cogment.TrialState] - List of enum values from cogment.TrialState for which we are interested in receiving state changes.
  • full_info: bool - If True, all the fields of the returned TrialInfo will be set. Otherwise only the trial ID and state will be set.

Return: generator(TrialInfo instance) - A generator for the relevant trial info.

async get_actors(self, trial_id)

Method to get the list of configured actors in a trial.

Parameters:

  • trial_id: str - The trial ID from which to request the list of actors.

Return: list[ActorInfo instance] - List of actors configured in this trial.

async get_remote_versions(self)

Method to get the versions from the remote Orchestrator.

Parameters: None

Return: dict - The key of the dictionary is the name of the component (str), and the value is the version (str).

class Datastore

Class containing data and methods to retrieve historical (or real-time) trial samples from a Datastore. This class can also be used to delete trials from a Datastore.

has_specs(self)

Parameters: None

Return: bool - True if the specs are known by this instance. False otherwise. Specs will be known if the top level Cogment Context has specs.

async get_trials(self, ids=[], properties={})

Method to get information about historical (or ongoing) trials in the Datastore. @@ -46,8 +46,8 @@ Some attributes (config, default_action) are immutable: changes to the instance received will not be reflected in ActorParameters, the attribute must be set with a new instance to make changes. These attributes can also return None if not set.

config: protobuf class instance - The type is specified in the spec file under the section actor_classes:config_type for the specific actor class of the actor.

config_serialized: bytes - Config in serialized (class independent) form. This can be accessed even without specs (see has_specs()).

class_name: str - This cannot be changed (it is a parameter of the constructor).

name: str

endpoint: str

implementation: str

initial_connection_timeout: float

response_timeout: float

optional: bool

default_action: protobuf class instance - The type is specified in the spec file under the section actor_classes:action:space for the specific class of the actor.

default_action_serialized: bytes - Action in serialized (class independent) form. This can be accessed even without specs (see has_specs()).

__init__(self, cog_settings, class_name, **kwargs)

Parameters:

  • cog_settings: module - Specs module associated with trials that relate to these parameters (see cog_settings generation).
  • class_name: str - The name of the actor class for the actor. This is specific to a type of trial and must match values in the spec file under section actor_classes:name.
  • **kwargs: Accepts any of the attributes (except class_name) as keyword to set their value on construction. E.g. ActorParameters(settings, class_name="some_class", name="act_name")

has_specs(self)

Parameters: None

Return: bool - True if the specs are known by this instance. False otherwise. Specs will be known if the top level Cogment Context has specs or if a non None argument cog_settings was provided.

class cogment.LogSample

Class containing a datalog sample. A sample starts and ends with the arrival of new observations from the environment. The last sample will end after all components have acknowledged the end of the trial (the state of that sample will then be TrialState.ENDED).

Note that some of the data may not be available (None) if it was excluded from the sample (see datalog parameters TrialParameters.datalog_exclude_fields).

out_of_sync: bool - False if it is a normal/full sample. True if it is an out-of-sync/partial sample. Out-of-sync samples do not follow the normal time step progression of the trial, they represent isolated data (typically a reward) for steps that have already past. Out-of-sync samples will be produced according to the trial parameter nb_buffered_ticks.

tick_id: int - The time step that the sample data relates to.

state: cogment.TrialState - The state of the trial at the end of the sample period. Undefined for out-of-sync samples.

timestamp: int - Unix style Epoch timestamp in nanoseconds (time since 00:00:00 UTC Jan 1, 1970) at the beginning of the sample period. For out-of-sync samples, this is the time the data in the sample was received.

events: str - Description of special events that happened during the time frame of the sample. For out-of-sync samples, it may contain an explanation of the data.

__init__(self, params)

Parameters:

  • params: LogParams instance - The parameters of the trial.

get_serialization_type(self)

Returns the type of serial data produced by serialize and accepted by deserialize. The type represents an ID dependent on DatalogSample defined in the low level gRPC API.

Parameters: None

Return: int - The type of the serialization string data. This is the type of string that is returned by serialize, and the only type accepted by deserialize; it is undefined behavior to try to deserialize the wrong type of data. This value is strictly larger than 1.

serialize(self)

Returns a binary string equivalent of the sample.

Parameters: None

Return: str - Serialized sample.

deserialize(self, raw_string)

Takes a serialized sample string and sets the LogSample instance.

Parameters:

  • raw_string: str - Binary string representing a serialized LogSample of the same type.

all_actor_names(self)

Generator method to iterate over all actors in the trial. This information can also be retrieved from the parameters of the trial.

Parameters: None

Return: generator(str) - A generator for the names of the actors in the trial.

get_action(self, actor)

Retrieves the action from the actor in the sample.

Parameters:

  • actor: str or int - The name or index of the actor for which to retrieve the action. The number, index and name of actors can be retrieved from the parameters of the trial.

Return: RecvAction instance - The action of the actor in the sample.

get_observation(self, actor)

Retrieve the observation destined for the actor in the sample. Can be None (specifically for out-of-sync samples).

Parameters:

  • actor: str or int - The name or index of the actor for which to retrieve the observation. The number, index and name of actors can be retrieved from the parameters of the trial.

Return: RecvObservation instance - The observation of the actor in the sample. Can be None (specifically for out-of-sync samples).

all_rewards(self)

Generator method to iterate over all the rewards in the sample.

Parameters: None

Return: generator(RecvReward instance) - A generator for the rewards in the sample.

all_messages(self)

Generator method to iterate over all the messages in the sample.

Parameters: None

Return: generator(RecvMessage instance) - A generator for the messages in the sample.

class ModelInfo

Class containing information about a model name stored in the ModelRegistry.

name: str - The model name.

properties: dict{str:str} - Custom information associated with the model name (not specific to any iteration).

class ModelIterationInfo

Class containing information specific to a model iteration stored in the Model Registry.

model_name: str - The name of the model.

iteration: int - The iteration number.

timestamp: int - When the iteration was stored in the Model Registry. Unix epoch time in nanoseconds.

hash: str - SHA 256 hash (encoded in base64 with standard 64 characters with padding) of the iteration's data.

size: int - Size (in bytes) of the iteration's data.

stored: bool - Whether the model is stored, as opposed to just being published (and therefore transient).

properties: dict{str:str} - Custom information associated with the iteration.

class LatestModel

Class making the latest model iteration, from the Model Registry, available on-demand.

name: str - The name of the model.

async get(self)

Method to return the latest iteration that has been downloaded in the background. This method may wait for the first iteration to be available. Once an iteration is available, this method will not be blocking.

Subsequent calls to this method may return different results according to the availability of new data.

Parameters: None

Return: tuple(data, ModelIterationInfo instance) - The data can either be a bytes string or a user object depending on is_deserialized(). The second tuple item is a ModelIterationInfo instance containing the information of the iteration represented by the data.

is_deserialized(self)

Method to check if the model iteration is deserialized automatically.

Parameters: None

Return: bool - True if the model is deserialized automatically in the background, in which case the data (returned by get) is a user object. This user object is derived by calling deserialize_func (parameter of ModelRegistry.track_latest_model) with the raw bytes from the Model Registry. False if the data (returned by get) is the raw bytes retrieved from the Model Registry.

is_available(self)

Method to check if an iteration is available.

Parameters: None

Returns: bool - True if an iteration is available, an thus get will not block. False otherwise.

async wait_for_available(self)

Method to wait for an iteration to be available.

Parameters: None

Returns: None

async wait_for_newer(self, iteration)

Method to wait for a newer iteration to be available. Once this method returns, the newer iteration can be retrieved with get.

Parameters:

  • iteration: int - Strict lower bound for awaited model iteration. I.e. the method will wait for a model iteration that is newer, and not equal, to this.

Returns: None

class cogment.DatastoreFields(enum.Enum)

Enum representing the various data in a DatastoreActorData instance

  • UNKNOWN: Should not be used.
  • OBSERVATION: The observation.
  • ACTION: The action.
  • REWARD: The aggregated reward.
  • RECEIVED_REWARDS: All the individual rewards received by the actor (all_received_rewards method)
  • SENT_REWARDS: All the individual rewards sent by the actor (all_sent_rewards method)
  • RECEIVED_MESSAGES: All the messages received by the actor (all_received_messages method)
  • SENT_MESSAGES: All the messages sent by the actor (all_received_messages method)

class DatastoreTrialInfo

Class containing the information of a trial stored in the Datastore.

trial_id: str - The trial id for this trial.

user_id: str - The user ID for the trial (provided on trial start).

trial_state: cogment.TrialState instance - The last (or current) state of the trial. This will change over time if not TrialState.ENDED.

sample_count: int - The number of samples currently stored for this trial. This will change over time if the trial state is not TrialState.ENDED.

parameters: cogment.TrialParameters instance - The parameters for the trial.

has_specs(self)

Parameters: None

Return: bool - True if the specs are known by this instance. False otherwise. Specs will be known if the top level Cogment Context has specs.

class DatastoreSample

Class containing the data of a trial sample (typically representing all the data during a trial tick).

trial_id: str - The id of the trial the data in the sample relates to.

trial_state: cogment.TrialState instance - The state of the trial at the end of the sample period. Note that the last sample (when trial_state is TrialState.ENDED) may have None data (e.g. observation, action, etc) if the trial ended on an error or was hard terminated.

tick_id: int - The step/tick at which the data in the sample was obtained.

timestamp: int - Unix style Epoch timestamp of the start of the step/tick (in nanoseconds since 00:00:00 UTC Jan 1, 1970).

actors_data: dict{str:DatastoreActorData instance} - Dictionary of all actors data included in the sample, indexed by actor name.

has_specs(self)

Parameters: None

Return: bool - True if the specs are known by this instance. False otherwise. Specs will be known if the top level Cogment Context has specs.

class DatastoreActorData

Class containing the data related to an actor in a sample.

name: str - Name of the actor.

observation: protobuf class instance - Observation received by the actor. The class of the observation is defined as observation space for the actor class. This is specified in section actor_classes:observation:space in the spec file for the appropriate actor class. Can be None if there is no data.

observation_serialized: bytes - Observation received by the actor in serialized (class independent) form. This can be retrieved even without specs (see has_specs()). Can be None if there is no data.

action: protobuf class instance - Action from the actor. The class of the action is defined as action space for the specific actor in the section actor_classes:action:space in the spec file for the appropriate actor class. Can be None if there is no data.

action_serialized: bytes - Action from the actor in serialized (class independent) form. This can be retrieved even without specs (see has_specs()). Can be None if there is no data.

reward: float - The aggregated reward received by the actor in the sample.

has_specs(self)

Parameters: None

Return: bool - True if the specs are known by this instance. False otherwise. Specs will be known if the top level Cogment Context has specs.

all_received_rewards(self)

Generator method to iterate over all the individual rewards received by the actor in the sample. -The aggregated reward is calculated from these.

Parameters: None

Return: generator(DatastoreReward instance) - A generator for the individual actor rewards received.

all_sent_rewards(self)

Generator method to iterate over all the individual rewards sent by the actor in the sample.

Parameters: None

Return: generator(DatastoreReward instance) - A generator for the individual actor rewards sent.

all_received_messages(self)

Generator method to iterate over all the messages received by the actor in the sample.

Parameters: None

Return: generator(DatastoreMessage instance) - A generator for the messages received.

all_sent_messages(self)

Generator method to iterate over all the messages sent by the actor in the sample.

Parameters: None

Return: generator(DatastoreMessage instance) - A generator for the messages sent.

class DatastoreReward

Class containing the data for an individual reward in the Datastore.

value: float - Value of the reward.

confidence: float - Confidence level of the reward value.

sender: str - Name of the sender of the reward.

receiver: str - Name of the receiver of the reward. The string could contain wildcard characters to represent multiple receivers intended by the sender.

user_data: google.protobuf.Any instance - Data for a user-specific reward format. Can be None if no specific data was provided. The class enclosed in google.protobuf.Any is of the type set by the sender; it is the responsibility of the receiver to manage the data received (i.e. determine the type and unpack the data).

class DatastoreMessage

Class containing the data of a message in the Datastore.

sender: str - Name of the sender of the message.

receiver: str - Name of the receiver of the message. The string could contain wildcard characters to represent multiple receivers intended by the sender.

payload: google.protobuf.Any instance - Data for a received message. The class enclosed in google.protobuf.Any is of the type set by the sender; It is the responsibility of the receiver to manage the data received (i.e. determine the type and unpack the data). Can be None if there is no data.

- - +The aggregated reward is calculated from these.

Parameters: None

Return: generator(DatastoreReward instance) - A generator for the individual actor rewards received.

all_sent_rewards(self)

Generator method to iterate over all the individual rewards sent by the actor in the sample.

Parameters: None

Return: generator(DatastoreReward instance) - A generator for the individual actor rewards sent.

all_received_messages(self)

Generator method to iterate over all the messages received by the actor in the sample.

Parameters: None

Return: generator(DatastoreMessage instance) - A generator for the messages received.

all_sent_messages(self)

Generator method to iterate over all the messages sent by the actor in the sample.

Parameters: None

Return: generator(DatastoreMessage instance) - A generator for the messages sent.

class DatastoreReward

Class containing the data for an individual reward in the Datastore.

value: float - Value of the reward.

confidence: float - Confidence level of the reward value.

sender: str - Name of the sender of the reward.

receiver: str - Name of the receiver of the reward. The string could contain wildcard characters to represent multiple receivers intended by the sender.

user_data: google.protobuf.Any instance - Data for a user-specific reward format. Can be None if no specific data was provided. The class enclosed in google.protobuf.Any is of the type set by the sender; it is the responsibility of the receiver to manage the data received (i.e. determine the type and unpack the data).

class DatastoreMessage

Class containing the data of a message in the Datastore.

sender: str - Name of the sender of the message.

receiver: str - Name of the receiver of the message. The string could contain wildcard characters to represent multiple receivers intended by the sender.

payload: google.protobuf.Any instance - Data for a received message. The class enclosed in google.protobuf.Any is of the type set by the sender; It is the responsibility of the receiver to manage the data received (i.e. determine the type and unpack the data). Can be None if there is no data.

+ + \ No newline at end of file diff --git a/docs/reference/web-proxy-api.html b/docs/reference/web-proxy-api.html new file mode 100644 index 0000000..ae5092d --- /dev/null +++ b/docs/reference/web-proxy-api.html @@ -0,0 +1,21 @@ + + + + + +Web Proxy API | Cogment + + + + + + + + + + + + + + \ No newline at end of file diff --git a/index.html b/index.html index 8ee5880..40421f8 100644 --- a/index.html +++ b/index.html @@ -1,21 +1,21 @@ - + - -Cogment | Cogment + +Cogment | Cogment - - - + + +
-

Build, train, and operate AI agents in simulated or real environments shared with humans.

Cogment is the first open source platform designed to address the challenges of continuously training humans and AI together.

Why Cogment

Continuously train AIs & humans together

Continuously train AIs &amp; humans together

  • Less data required
  • Real-time adaptation
  • Faster training
  • Fostering of trust

Orchestrate intelligence ecosystems

Orchestrate intelligence ecosystems

  • Best of human & AI capabilities
  • Human supervision when it matters
  • Hybrid AI: Compliance & high performance
  • Modular approach: reduce compute usage & faciliate validation

Iterate smoothly from sim to real

Iterate smoothly from sim to real

  • Safe and simple design and training in simulation
  • Progressive deployment to real environment
  • Real environments, digital twins, numerical simulations, etc.

Compatible with your existing tools

logo for PyTorch
logo for Open AI Gym
logo for Petting Zoo
logo for Tensorflow

They're already using Cogment

logo for Thales
logo for The Chandar Research Lab at MILA
logo for The Intelligent Robot Learning Laboratory at University of Alberta
logo for Alberta Machine Intelligence Institute

Cogment Verse is a SDK helping researchers and developers in the fields of human-in-the-loop learning (HILL) and multi-agent reinforcement learning (MARL) train and validate their agents at scale. Cogment Verse instantiates the open-source Cogment platform for environments following the OpenAI Gym mold, making it easy to get started.

Simply clone the repo and start training.

Atari Double Dunk - From Petting ZooGo - From Petting ZooAtari Montezuma's Revenge - From Open AI GymLunar Lander - From Open AI Gym

Key features

Multi-actor

Allow multiple agents and multiple human users (all "actors") to exist, train, and work together within the same environment, interacting with one another and their environment. They can be part of collaborative or competitive setups, with heterogeneous roles.

Multi-method

Train agents in various ways using Reinforcement learning (on policy, off policy, Q learning, etc.), Imitation Learning (behavior cloning), Curriculum Learning…

Tech stack agnostic

Develop tech-heterogeneous components working together regardless of the tech stacks used to develop them. Use Pytorch, Keras, or Tensorflow frameworks, with Unity, OpenAI Gym, Petting Zoo or any environments or digital twin simulations.

Multi-experience learning

Run multiple instances of the same agent in multiple and distributed trials / experiences. The accumulated data can be used in a centralized way to contribute to the training of a single agent, or in a decentralized way to train a population of specialized agents.

Implementation swapping

Swap actors in and out from one implementation of an agent to another, from a human user to another, or from a human user to a trained or untrained agent, and vice-versa. Bootstrap training with pseudo-humans or rule-based agents.

Multi-source and retroactive rewards

Multiple Reinforcement Learning (RL) agents can use any number of reward sources; environment (real or simulated), users, other agents. Delays in the evaluation are supported while maintaining live training capabilities.

Hybrid AI

Mix different kind of agents: expert systems, doctrines, search, planners, neural networks…

Optimized for minimal discontinuity between development and deployment

There is virtually no difference between developed and productionized versions of a Cogment project. Develop in an iterative way, with any part of a project being live-developed so iteration cycles between simulated and real environments can happen as quickly as possible.

- - +

Build, train, and operate AI agents in simulated or real environments shared with humans.

Cogment is the first open source platform designed to address the challenges of continuously training humans and AI together.

Why Cogment

Continuously train AIs & humans together

Continuously train AIs &amp; humans together

  • Less data required
  • Real-time adaptation
  • Faster training
  • Fostering of trust

Orchestrate intelligence ecosystems

Orchestrate intelligence ecosystems

  • Best of human & AI capabilities
  • Human supervision when it matters
  • Hybrid AI: Compliance & high performance
  • Modular approach: reduce compute usage & faciliate validation

Iterate smoothly from sim to real

Iterate smoothly from sim to real

  • Safe and simple design and training in simulation
  • Progressive deployment to real environment
  • Real environments, digital twins, numerical simulations, etc.

Compatible with your existing tools

logo for PyTorch
logo for Open AI Gym
logo for Petting Zoo
logo for Tensorflow

They're already using Cogment

logo for Thales
logo for The Chandar Research Lab at MILA
logo for The Intelligent Robot Learning Laboratory at University of Alberta
logo for Alberta Machine Intelligence Institute

Cogment Verse is a SDK helping researchers and developers in the fields of human-in-the-loop learning (HILL) and multi-agent reinforcement learning (MARL) train and validate their agents at scale. Cogment Verse instantiates the open-source Cogment platform for environments following the OpenAI Gym mold, making it easy to get started.

Simply clone the repo and start training.

Atari Double Dunk - From Petting ZooGo - From Petting ZooAtari Montezuma's Revenge - From Open AI GymLunar Lander - From Open AI Gym

Key features

Multi-actor

Allow multiple agents and multiple human users (all "actors") to exist, train, and work together within the same environment, interacting with one another and their environment. They can be part of collaborative or competitive setups, with heterogeneous roles.

Multi-method

Train agents in various ways using Reinforcement learning (on policy, off policy, Q learning, etc.), Imitation Learning (behavior cloning), Curriculum Learning…

Tech stack agnostic

Develop tech-heterogeneous components working together regardless of the tech stacks used to develop them. Use Pytorch, Keras, or Tensorflow frameworks, with Unity, OpenAI Gym, Petting Zoo or any environments or digital twin simulations.

Multi-experience learning

Run multiple instances of the same agent in multiple and distributed trials / experiences. The accumulated data can be used in a centralized way to contribute to the training of a single agent, or in a decentralized way to train a population of specialized agents.

Implementation swapping

Swap actors in and out from one implementation of an agent to another, from a human user to another, or from a human user to a trained or untrained agent, and vice-versa. Bootstrap training with pseudo-humans or rule-based agents.

Multi-source and retroactive rewards

Multiple Reinforcement Learning (RL) agents can use any number of reward sources; environment (real or simulated), users, other agents. Delays in the evaluation are supported while maintaining live training capabilities.

Hybrid AI

Mix different kind of agents: expert systems, doctrines, search, planners, neural networks…

Optimized for minimal discontinuity between development and deployment

There is virtually no difference between developed and productionized versions of a Cogment project. Develop in an iterative way, with any part of a project being live-developed so iteration cycles between simulated and real environments can happen as quickly as possible.

+ + \ No newline at end of file diff --git a/search.html b/search.html index 6c5251c..2a89aa3 100644 --- a/search.html +++ b/search.html @@ -1,21 +1,21 @@ - + - + Search the documentation | Cogment - - - + + + - - +

Search the documentation

+ + \ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml index 012fa9a..bb69e17 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1 +1 @@ -https://cogment.ai/cogment_verseweekly0.5https://cogment.ai/searchweekly0.5https://cogment.ai/docsweekly0.5https://cogment.ai/docs/community-channelsweekly0.5https://cogment.ai/docs/guide/core-conceptsweekly0.5https://cogment.ai/docs/guide/development-guideweekly0.5https://cogment.ai/docs/guide/implementation-recipesweekly0.5https://cogment.ai/docs/guide/implementation-recipes/configure-trial-from-controllerweekly0.5https://cogment.ai/docs/guide/implementation-recipes/v2-migration-guideweekly0.5https://cogment.ai/docs/guide/tutorialweekly0.5https://cogment.ai/docs/guide/tutorial/actors-in-cogmentweekly0.5https://cogment.ai/docs/guide/tutorial/advanced-tutorialsweekly0.5https://cogment.ai/docs/guide/tutorial/advanced-tutorials/directoryweekly0.5https://cogment.ai/docs/guide/tutorial/advanced-tutorials/human-playerweekly0.5https://cogment.ai/docs/guide/tutorial/advanced-tutorials/web-clientweekly0.5https://cogment.ai/docs/guide/tutorial/decision-makingweekly0.5https://cogment.ai/docs/guide/tutorial/environment-in-cogmentweekly0.5https://cogment.ai/docs/guide/tutorial/setupweekly0.5https://cogment.ai/docs/licenseweekly0.5https://cogment.ai/docs/reference/cliweekly0.5https://cogment.ai/docs/reference/cli/directory/directory-clientweekly0.5https://cogment.ai/docs/reference/cli/directory/directory-serverweekly0.5https://cogment.ai/docs/reference/cli/launchweekly0.5https://cogment.ai/docs/reference/cli/model-registryweekly0.5https://cogment.ai/docs/reference/cli/orchestratorweekly0.5https://cogment.ai/docs/reference/cli/statusweekly0.5https://cogment.ai/docs/reference/cli/trial-datastore/trial-datastore-clientweekly0.5https://cogment.ai/docs/reference/cli/trial-datastore/trial-datastore-serverweekly0.5https://cogment.ai/docs/reference/cli/web-proxyweekly0.5https://cogment.ai/docs/reference/cogment-v2-changesweekly0.5https://cogment.ai/docs/reference/cogment-yamlweekly0.5https://cogment.ai/docs/reference/grpcweekly0.5https://cogment.ai/docs/reference/javascriptweekly0.5https://cogment.ai/docs/reference/parametersweekly0.5https://cogment.ai/docs/reference/pythonweekly0.5https://cogment.ai/docs/reference/python-enterprise/installationweekly0.5https://cogment.ai/docs/reference/python-enterprise/runnerweekly0.5https://cogment.ai/weekly0.5 \ No newline at end of file +https://cogment.ai/cogment_verseweekly0.5https://cogment.ai/searchweekly0.5https://cogment.ai/docsweekly0.5https://cogment.ai/docs/community-channelsweekly0.5https://cogment.ai/docs/guide/core-conceptsweekly0.5https://cogment.ai/docs/guide/development-guideweekly0.5https://cogment.ai/docs/guide/implementation-recipesweekly0.5https://cogment.ai/docs/guide/implementation-recipes/configure-trial-from-controllerweekly0.5https://cogment.ai/docs/guide/implementation-recipes/v2-migration-guideweekly0.5https://cogment.ai/docs/guide/tutorialweekly0.5https://cogment.ai/docs/guide/tutorial/actors-in-cogmentweekly0.5https://cogment.ai/docs/guide/tutorial/advanced-tutorialsweekly0.5https://cogment.ai/docs/guide/tutorial/advanced-tutorials/directoryweekly0.5https://cogment.ai/docs/guide/tutorial/advanced-tutorials/human-playerweekly0.5https://cogment.ai/docs/guide/tutorial/advanced-tutorials/web-clientweekly0.5https://cogment.ai/docs/guide/tutorial/decision-makingweekly0.5https://cogment.ai/docs/guide/tutorial/environment-in-cogmentweekly0.5https://cogment.ai/docs/guide/tutorial/setupweekly0.5https://cogment.ai/docs/licenseweekly0.5https://cogment.ai/docs/reference/cliweekly0.5https://cogment.ai/docs/reference/cli/directory/directory-clientweekly0.5https://cogment.ai/docs/reference/cli/directory/directory-serverweekly0.5https://cogment.ai/docs/reference/cli/launchweekly0.5https://cogment.ai/docs/reference/cli/model-registryweekly0.5https://cogment.ai/docs/reference/cli/orchestratorweekly0.5https://cogment.ai/docs/reference/cli/statusweekly0.5https://cogment.ai/docs/reference/cli/trial-datastore/trial-datastore-clientweekly0.5https://cogment.ai/docs/reference/cli/trial-datastore/trial-datastore-serverweekly0.5https://cogment.ai/docs/reference/cli/web-proxyweekly0.5https://cogment.ai/docs/reference/cogment-v2-changesweekly0.5https://cogment.ai/docs/reference/cogment-yamlweekly0.5https://cogment.ai/docs/reference/grpcweekly0.5https://cogment.ai/docs/reference/javascriptweekly0.5https://cogment.ai/docs/reference/parametersweekly0.5https://cogment.ai/docs/reference/pythonweekly0.5https://cogment.ai/docs/reference/python-enterprise/installationweekly0.5https://cogment.ai/docs/reference/python-enterprise/runnerweekly0.5https://cogment.ai/docs/reference/web-proxy-apiweekly0.5https://cogment.ai/weekly0.5 \ No newline at end of file