From ee166c693da3f1c236464566617a0883b636af87 Mon Sep 17 00:00:00 2001 From: gh-actions Date: Wed, 8 May 2024 00:29:33 +0000 Subject: [PATCH] Deploy website - based on 9f26555668b275033fa698c0de5aaaf472970e24 --- 404.html | 22 +- assets/css/styles.7917cfde.css | 1 + assets/css/styles.aa6b4ed0.css | 25 --- assets/js/0794ba4a.12e9a489.js | 1 - assets/js/0bf034db.9148d7dc.js | 1 + assets/js/0e384e19.2421afc7.js | 1 - assets/js/118.f728f784.js | 1 - assets/js/17896441.48abe667.js | 1 + assets/js/17896441.6f4c25cb.js | 1 - assets/js/1be78505.7e34f649.js | 1 - assets/js/237.8f78abee.js | 1 + assets/js/2463bfee.8defd41d.js | 1 + assets/js/3021cf83.126e009e.js | 1 + assets/js/373758dc.c365ca98.js | 1 + assets/js/421473c5.c80d0eba.js | 1 + assets/js/4539ade8.3eeb2d0c.js | 1 - assets/js/486.f61f8262.js | 2 - assets/js/486.f61f8262.js.LICENSE.txt | 14 -- assets/js/4a782de2.d6dc3ce6.js | 1 + assets/js/518c7f92.31849ffd.js | 1 + assets/js/534bda69.c4be965c.js | 1 - assets/js/5537f8c3.e1b48379.js | 1 - assets/js/576b222c.a25e306a.js | 1 + assets/js/5e95c892.b8ccf983.js | 1 + assets/js/608.9c51bee7.js | 1 - assets/js/62eacfe5.8cd05dc4.js | 1 + assets/js/6ea2c7a4.8b876353.js | 1 + assets/js/7c110bd0.3c7fba26.js | 1 + assets/js/80e86806.b78682d1.js | 1 - assets/js/9187e980.2ca26c7f.js | 1 + assets/js/93231161.b5ae05f4.js | 1 - assets/js/935f2afb.f89a2009.js | 1 - assets/js/95e8cacb.7ff627ee.js | 1 - assets/js/a7456010.47cad1bc.js | 1 + assets/js/a7bd4aaa.fd305e17.js | 1 + assets/js/a94703ab.10863959.js | 1 + assets/js/aba21aa0.eb7bf6f2.js | 1 + assets/js/ac3a7c63.4d1744c5.js | 1 + assets/js/b81faf1d.5a973bfb.js | 1 + assets/js/b96361c1.805f062a.js | 1 + assets/js/bb881519.62fda8c4.js | 1 - assets/js/c4f5d8e4.9b641ee3.js | 1 - assets/js/c4f5d8e4.f045fc1b.js | 1 + assets/js/d589d3a7.0af9b57e.js | 1 - assets/js/d9be502e.93f8c050.js | 1 - assets/js/ddcb1508.c5f25f84.js | 1 + assets/js/dfc585ea.fffa4b9f.js | 1 - assets/js/e02376a2.6d8ac5b8.js | 1 - assets/js/efe2a42e.5dfe26f0.js | 1 - assets/js/f11c2978.5ae9a3b8.js | 1 - assets/js/f5f98f48.7ced76f9.js | 1 - assets/js/f8409a7e.c9bb6b16.js | 1 + assets/js/main.8495c6d8.js | 2 + ...CENSE.txt => main.8495c6d8.js.LICENSE.txt} | 48 ++-- assets/js/main.9bdcd132.js | 2 - assets/js/runtime~main.2cbf1b8f.js | 1 - assets/js/runtime~main.51dd2df4.js | 1 + blog/atom.xml | 10 - blog/rss.xml | 11 - docs/api/configuring-your-bot/index.html | 110 ++++++--- .../customizing-the-discord-client/index.html | 40 ++-- docs/api/extensions/index.html | 102 +++++++-- docs/api/i18n/index.html | 65 ++++-- docs/api/working-with-services/index.html | 82 +++++-- docs/getting-started/index.html | 158 +++++++++++-- docs/index.html | 61 +++-- .../acknowledging-interactions/index.html | 50 +++-- .../configuration/index.html | 37 +-- docs/interaction-library/cooldowns/index.html | 35 +-- .../creating-commands/index.html | 135 +++++++---- .../dealing-with-components/index.html | 108 ++++++--- .../filtering-and-adapting-events/index.html | 57 +++-- .../handling-errors/index.html | 62 ++++-- docs/interaction-library/overview/index.html | 131 +++++++---- .../interaction-library/privileges/index.html | 53 +++-- img/d4j.svg | 62 +++++- img/logo.svg | 30 ++- img/undraw_Around_the_world_re_n353.svg | 79 ++++++- img/undraw_Setup_re_y9w8.svg | 59 ++++- img/undraw_add_file_4gfw.svg | 55 ++++- img/undraw_building_blocks_n0nc.svg | 210 +++++++++++++++++- img/undraw_proud_coder_7ain.svg | 89 +++++++- index.html | 22 +- sitemap.xml | 2 +- 84 files changed, 1569 insertions(+), 511 deletions(-) create mode 100644 assets/css/styles.7917cfde.css delete mode 100644 assets/css/styles.aa6b4ed0.css delete mode 100644 assets/js/0794ba4a.12e9a489.js create mode 100644 assets/js/0bf034db.9148d7dc.js delete mode 100644 assets/js/0e384e19.2421afc7.js delete mode 100644 assets/js/118.f728f784.js create mode 100644 assets/js/17896441.48abe667.js delete mode 100644 assets/js/17896441.6f4c25cb.js delete mode 100644 assets/js/1be78505.7e34f649.js create mode 100644 assets/js/237.8f78abee.js create mode 100644 assets/js/2463bfee.8defd41d.js create mode 100644 assets/js/3021cf83.126e009e.js create mode 100644 assets/js/373758dc.c365ca98.js create mode 100644 assets/js/421473c5.c80d0eba.js delete mode 100644 assets/js/4539ade8.3eeb2d0c.js delete mode 100644 assets/js/486.f61f8262.js delete mode 100644 assets/js/486.f61f8262.js.LICENSE.txt create mode 100644 assets/js/4a782de2.d6dc3ce6.js create mode 100644 assets/js/518c7f92.31849ffd.js delete mode 100644 assets/js/534bda69.c4be965c.js delete mode 100644 assets/js/5537f8c3.e1b48379.js create mode 100644 assets/js/576b222c.a25e306a.js create mode 100644 assets/js/5e95c892.b8ccf983.js delete mode 100644 assets/js/608.9c51bee7.js create mode 100644 assets/js/62eacfe5.8cd05dc4.js create mode 100644 assets/js/6ea2c7a4.8b876353.js create mode 100644 assets/js/7c110bd0.3c7fba26.js delete mode 100644 assets/js/80e86806.b78682d1.js create mode 100644 assets/js/9187e980.2ca26c7f.js delete mode 100644 assets/js/93231161.b5ae05f4.js delete mode 100644 assets/js/935f2afb.f89a2009.js delete mode 100644 assets/js/95e8cacb.7ff627ee.js create mode 100644 assets/js/a7456010.47cad1bc.js create mode 100644 assets/js/a7bd4aaa.fd305e17.js create mode 100644 assets/js/a94703ab.10863959.js create mode 100644 assets/js/aba21aa0.eb7bf6f2.js create mode 100644 assets/js/ac3a7c63.4d1744c5.js create mode 100644 assets/js/b81faf1d.5a973bfb.js create mode 100644 assets/js/b96361c1.805f062a.js delete mode 100644 assets/js/bb881519.62fda8c4.js delete mode 100644 assets/js/c4f5d8e4.9b641ee3.js create mode 100644 assets/js/c4f5d8e4.f045fc1b.js delete mode 100644 assets/js/d589d3a7.0af9b57e.js delete mode 100644 assets/js/d9be502e.93f8c050.js create mode 100644 assets/js/ddcb1508.c5f25f84.js delete mode 100644 assets/js/dfc585ea.fffa4b9f.js delete mode 100644 assets/js/e02376a2.6d8ac5b8.js delete mode 100644 assets/js/efe2a42e.5dfe26f0.js delete mode 100644 assets/js/f11c2978.5ae9a3b8.js delete mode 100644 assets/js/f5f98f48.7ced76f9.js create mode 100644 assets/js/f8409a7e.c9bb6b16.js create mode 100644 assets/js/main.8495c6d8.js rename assets/js/{main.9bdcd132.js.LICENSE.txt => main.8495c6d8.js.LICENSE.txt} (63%) delete mode 100644 assets/js/main.9bdcd132.js delete mode 100644 assets/js/runtime~main.2cbf1b8f.js create mode 100644 assets/js/runtime~main.51dd2df4.js delete mode 100644 blog/atom.xml delete mode 100644 blog/rss.xml diff --git a/404.html b/404.html index 26e3ae7..999a7eb 100644 --- a/404.html +++ b/404.html @@ -1,25 +1,19 @@ - + - - - - - + +Page Not Found | Botrino -Page Not Found | Botrino - - + + + - -
-
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/assets/css/styles.7917cfde.css b/assets/css/styles.7917cfde.css new file mode 100644 index 0000000..62f4847 --- /dev/null +++ b/assets/css/styles.7917cfde.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,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)}.toggleButton_gllP,html{-webkit-tap-highlight-color:transparent}.clean-list,.containsTaskList_mC6p,.details_lb9f>summary,.dropdown__menu,.menu__list{list-style:none}: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;--docusaurus-progress-bar-color:var(--ifm-color-primary);--ifm-color-primary:#8c35e5;--ifm-color-primary-dark:#7e1de1;--ifm-color-primary-darker:#771bd4;--ifm-color-primary-darkest:#6217af;--ifm-color-primary-light:#9a4ee8;--ifm-color-primary-lighter:#a15aea;--ifm-color-primary-lightest:#b780ef;--ifm-code-font-size:95%;--docusaurus-tag-list-border:var(--ifm-color-emphasis-300);--docusaurus-announcement-bar-height:auto;--docusaurus-collapse-button-bg:#0000;--docusaurus-collapse-button-bg-hover:#0000001a;--doc-sidebar-width:300px;--doc-sidebar-hidden-width:30px}.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}*{box-sizing:border-box}html{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);-webkit-font-smoothing:antialiased;text-rendering:optimizelegibility;-webkit-text-size-adjust:100%;text-size-adjust:100%}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_Gvgb,.alert__heading,.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{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;-webkit-user-select:none;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}.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;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_BuS1>:last-child,.collapsibleContent_i85q p:last-child,.details_lb9f>summary>p: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{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,.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{bottom:0;opacity:0;transition-duration:var(--ifm-transition-fast);transition-timing-function:ease-in-out;top:0;left: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{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{display:grid;grid-gap:var(--ifm-spacing-horizontal);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}.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)}.tabs,:not(.containsTaskList_mC6p>li)>.containsTaskList_mC6p{padding-left:0}.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;text-align:center}.tabs{color:var(--ifm-tabs-color);display:flex;margin-bottom:0;overflow-x:auto}.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)}.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}#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}.docusaurus-highlight-code-line{background-color:#484d5b;display:block;margin:0 calc(var(--ifm-pre-padding)*-1);padding:0 var(--ifm-pre-padding)}.hero{background-color:#28143c}.hero__title{color:#fff;margin-top:20px}.hero__subtitle{color:#fff}.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);text-decoration:none}.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}.iconEdit_Z9Sw{margin-right:.3em;vertical-align:sub}.lastUpdated_JAkA{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}.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)}.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}.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;text-align:center}.content_knG7 a{color:inherit;text-decoration:underline}.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)}#__docusaurus-base-url-issue-banner-container,.docSidebarContainer_YfHR,.navbarSearchContainer_Bca1:empty,.sidebarLogo_isFc,.themedComponent_mlkZ,[data-theme=dark] .lightToggleIcon_pyhR,[data-theme=light] .darkToggleIcon_wfgR,html[data-announcement-bar-initially-dismissed=true] .announcementBar_mb4j{display:none}.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] .themedComponent--dark_xIcU,[data-theme=light] .themedComponent--light_NVdE,html:not([data-theme]) .themedComponent--light_NVdE{display:initial}[data-theme=dark]:root{--docusaurus-collapse-button-bg:#ffffff0d;--docusaurus-collapse-button-bg-hover:#ffffff1a}.collapseSidebarButton_PEFL{display:none;margin:0}.iconExternalLink_nPIU{margin-left:.3rem}.docMainContainer_TBSr,.docRoot_UBD9{display:flex;width:100%}.docsWrapper_hBAB{display:flex;flex:1 0 auto}.dropdownNavbarItemMobile_S0Fm{cursor:pointer}.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}.errorBoundaryFallback_VBag{color:red;padding:.55rem}.buttonGroup__atx button,.codeBlockContainer_Ckt0{background:var(--prism-background-color);color:var(--prism-color)}.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}body:not(.navigation-with-keyboard) :not(input):focus{outline:0}.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);-webkit-user-select:none;user-select:none}.hash-link:before{content:"#"}.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%}.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{left:0;position:absolute;top:0;fill:currentColor;height:inherit;opacity:inherit;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;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)}.img_ev3q{height:auto}.admonition_xJq3{margin-bottom:1em}.admonitionHeading_Gvgb{font:var(--ifm-heading-font-weight) var(--ifm-h5-font-size)/var(--ifm-heading-line-height) var(--ifm-heading-font-family)}.admonitionHeading_Gvgb:not(:last-child){margin-bottom:.3rem}.admonitionHeading_Gvgb code{text-transform:none}.admonitionIcon_Rf37{display:inline-block;margin-right:.4em;vertical-align:middle}.admonitionIcon_Rf37 svg{display:inline-block;height:1.6em;width:1.6em;fill:var(--ifm-alert-foreground-color)}.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}.heroBanner_UJJx{overflow:hidden;padding:4rem 0;position:relative;text-align:center}.buttons_pzbO{justify-content:center}.buttons_pzbO,.features_keug{align-items:center;display:flex}.features_keug{padding:2rem 0;width:100%}.featureImage_yA8i{height:200px;width:200px}@media (min-width:997px){.collapseSidebarButton_PEFL,.expandButton_TmdG{background-color:var(--docusaurus-collapse-button-bg)}.lastUpdated_JAkA{text-align:right}.tocMobile_ITEo{display:none}:root{--docusaurus-announcement-bar-height:30px}.announcementBarClose_gvF7,.announcementBarPlaceholder_vyr4{flex-basis:50px}.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_i1dp,[dir=rtl] .collapseSidebarButtonIcon_kv0_{transform:rotate(0)}.collapseSidebarButton_PEFL:focus,.collapseSidebarButton_PEFL:hover,.expandButton_TmdG:focus,.expandButton_TmdG: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_TmdG{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_i1dp{transform:rotate(180deg)}.docSidebarContainer_YfHR{border-right:1px solid var(--ifm-toc-border-color);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_DPk8{cursor:pointer;width:var(--doc-sidebar-hidden-width)}.sidebarViewport_aRkj{height:100%;max-height:100vh;position:sticky;top:0}.docMainContainer_TBSr{flex-grow:1;max-width:calc(100% - var(--doc-sidebar-width))}.docMainContainerEnhanced_lQrH{max-width:calc(100% - var(--doc-sidebar-hidden-width))}.docItemWrapperEnhanced_JWYK{max-width:calc(var(--ifm-container-width) + var(--doc-sidebar-width))!important}.navbarSearchContainer_Bca1{padding:var(--ifm-navbar-item-padding-vertical) var(--ifm-navbar-item-padding-horizontal)}.docItemCol_VOVn{max-width:75%!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}.docItemContainer_F8PC{padding:0 .3rem}.navbarSearchContainer_Bca1{position:absolute;right:var(--ifm-navbar-padding-horizontal)}}@media screen and (max-width:966px){.heroBanner_UJJx{padding:2rem}}@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 (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}}@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.aa6b4ed0.css b/assets/css/styles.aa6b4ed0.css deleted file mode 100644 index e289375..0000000 --- a/assets/css/styles.aa6b4ed0.css +++ /dev/null @@ -1,25 +0,0 @@ -.admonition-icon,code{vertical-align:middle}.row .col,img{max-width:100%}.markdown li,body{word-wrap:break-word}pre,table{overflow:auto}blockquote,pre{margin:0 0 var(--ifm-spacing-vertical)}.button,.close{-webkit-appearance:none;cursor:pointer}.breadcrumbs__link,.button{transition-timing-function:var(--ifm-transition-timing-default)}.button,.react-toggle{-webkit-user-select:none;-ms-user-select:none}.button--outline.button--active,.button--outline:active,.button--outline:hover,:root{--ifm-button-color:var(--ifm-font-color-base-inverse)}.button,.close,.menu__link,.navbar__link{cursor:pointer}.navbar--dark,:root{--ifm-navbar-link-hover-color:var(--ifm-color-primary)}.footer__items,.menu__list,.pills__item{list-style-type:none}.tabs__item,hr,img{box-sizing:content-box}.navbar__title,.text--truncate{text-overflow:ellipsis;white-space:nowrap}.button,.dropdown__link,.navbar__title,.text--truncate{white-space:nowrap}:root,html[data-theme=dark]{--ifm-color-emphasis-500:var(--ifm-color-gray-500)}.react-toggle,html{-webkit-tap-highlight-color:transparent}:root{--ra-admonition-background-color:var(--ifm-alert-background-color);--ra-admonition-border-width:var(--ifm-alert-border-width);--ra-admonition-border-color:var(--ifm-alert-border-color);--ra-admonition-border-radius:var(--ifm-alert-border-radius);--ra-admonition-color:var(--ifm-alert-color);--ra-admonition-padding-vertical:var(--ifm-alert-padding-vertical);--ra-admonition-padding-horizontal:var(--ifm-alert-padding-horizontal);--ra-color-note:var(--ifm-color-secondary);--ra-color-important:var(--ifm-color-info);--ra-color-tip:var(--ifm-color-success);--ra-color-caution:var(--ifm-color-warning);--ra-color-warning:var(--ifm-color-danger);--ra-color-text-dark:var(--ifm-color-gray-900)}.admonition{margin-bottom:1em;--ra-admonition-icon-color:var(--ra-admonition-color)}.admonition:not(.alert){--ra-admonition-background-color:var(--ifm-color-primary);background-color:var(--ra-admonition-background-color);border:var(--ra-admonition-border-width) solid var(--ra-admonition-border-color);border-radius:var(--ra-admonition-border-radius);box-sizing:border-box;color:var(--ra-admonition-color);padding:var(--ra-admonition-padding-vertical) var(--ra-admonition-padding-horizontal)}.container,.row .col{padding:0 var(--ifm-spacing-horizontal);width:100%}.admonition h5{margin-bottom:8px;margin-top:0;text-transform:uppercase}.admonition-icon{display:inline-block;margin-right:.2em}.admonition-icon svg{stroke-width:0;fill:var(--ra-admonition-icon-color);stroke:var(--ra-admonition-icon-color);display:inline-block;height:22px;width:22px}.admonition-content>:last-child,blockquote>:last-child{margin-bottom:0}.admonition-note{--ra-admonition-color:var(--ra-color-text-dark)}:root{--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-color-primary:#3578e5;--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-secondary:#ebedf0;--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-success:#00a400;--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-info:#54c7ec;--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-warning:#ffba00;--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-danger:#fa383e;--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-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:#606770;--ifm-background-color:transparent;--ifm-background-surface-color:var(--ifm-color-content-inverse);--ifm-global-border-width:1px;--ifm-global-radius:0.4rem;--ifm-hover-overlay:rgba(0,0,0,0.05);--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 rgba(0,0,0,0.1);--ifm-global-shadow-md:0 5px 40px rgba(0,0,0,0.2);--ifm-global-shadow-tl:0 12px 28px 0 rgba(0,0,0,0.2),0 2px 4px 0 rgba(0,0,0,0.1);--ifm-z-index-dropdown:2;--ifm-z-index-fixed:3;--ifm-z-index-overlay:4;--ifm-container-width:1140px;--ifm-container-width-xl:1320px;--ifm-code-background:#f6f7f8;--ifm-code-border-radius:var(--ifm-global-radius);--ifm-code-color:var(--ifm-color-emphasis-900);--ifm-code-font-size:90%;--ifm-code-padding-horizontal:0.3rem;--ifm-code-padding-vertical:0.1rem;--ifm-pre-background:var(--ifm-color-emphasis-100);--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:inherit;--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:transparent;--ifm-table-stripe-background:var(--ifm-color-emphasis-100);--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-color:#6a737d;--ifm-blockquote-font-size:var(--ifm-font-size-base);--ifm-blockquote-padding-horizontal:1rem;--ifm-blockquote-padding-vertical:1rem;--ifm-hr-border-color:var(--ifm-color-emphasis-500);--ifm-hr-border-width:1px;--ifm-hr-margin-vertical:1.5rem;--ifm-alert-background-color:inherit;--ifm-alert-border-color:inherit;--ifm-alert-border-radius:var(--ifm-global-radius);--ifm-alert-border-width:var(--ifm-global-border-width);--ifm-alert-color:var(--ifm-font-color-base-inverse);--ifm-alert-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-alert-padding-vertical:var(--ifm-spacing-vertical);--ifm-avatar-intro-margin:1rem;--ifm-avatar-intro-alignment:inherit;--ifm-avatar-photo-size-sm:2rem;--ifm-avatar-photo-size-md:3rem;--ifm-avatar-photo-size-lg:4rem;--ifm-avatar-photo-size-xl:6rem;--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.0625rem;--ifm-breadcrumb-color-active:var(--ifm-color-primary);--ifm-breadcrumb-item-background-active:var(--ifm-hover-overlay);--ifm-breadcrumb-padding-horizontal:1rem;--ifm-breadcrumb-padding-vertical:0.5rem;--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-margin: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-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:1rem;--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:1rem;--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:80vw;--ifm-pagination-border-radius:calc(var(--ifm-global-radius)*var(--ifm-pagination-size-multiplier));--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.0625rem;--ifm-pagination-padding-horizontal:calc(var(--ifm-spacing-horizontal)*1);--ifm-pagination-padding-vertical:calc(var(--ifm-spacing-vertical)*0.25);--ifm-pagination-size-multiplier:1;--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.0625rem;--ifm-tabs-color:var(--ifm-font-color-secondary);--ifm-tabs-color-active:var(--ifm-color-primary);--ifm-tabs-padding-horizontal:1rem;--ifm-tabs-padding-vertical:1rem;--ifm-tabs-spacing:0.0625rem;--ifm-scrollbar-size:7px;--ifm-scrollbar-track-background-color:#f1f1f1;--ifm-scrollbar-thumb-background-color:#888;--ifm-scrollbar-thumb-hover-background-color:#555;--ifm-color-primary:#8c35e5;--ifm-color-primary-dark:#7e1de1;--ifm-color-primary-darker:#771bd4;--ifm-color-primary-darkest:#6217af;--ifm-color-primary-light:#9a4ee8;--ifm-color-primary-lighter:#a15aea;--ifm-color-primary-lightest:#b780ef;--ifm-code-font-size:95%;--docusaurus-announcement-bar-height:auto;--collapse-button-bg-color-dark:#2e333a;--doc-sidebar-width:300px}.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:transparent}.navbar--dark,.navbar--primary{--ifm-navbar-search-input-background-color:hsla(0,0%,100%,0.1);--ifm-navbar-search-input-placeholder-color:hsla(0,0%,100%,0.5)}*{box-sizing:border-box}html{-webkit-font-smoothing:antialiased;text-rendering:optimizelegibility;-webkit-text-size-adjust:100%;text-size-adjust:100%;background-color:var(--ifm-background-color);color:var(--ifm-font-color-base);font:var(--ifm-font-size-base)/var(--ifm-line-height-base) var(--ifm-font-family-base)}body{margin:0}.container{margin:0 auto;max-width:var(--ifm-container-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}.container--fluid{max-width:inherit}.row{display:flex;flex-direction:row;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,.markdown>:first-child,.tabItem_1uMI{margin-top:0!important}.row .col{--ifm-col-width:100%;flex:1 0;margin-left:0}.row .col.col--1,.row .col.col--2,.row .col.col--3,.row .col[class*=col--]{flex:0 0 var(--ifm-col-width);max-width:var(--ifm-col-width)}.row .col.col--1{--ifm-col-width:8.33333%}.row .col.col--offset-1{margin-left:8.33333%}.row .col.col--2{--ifm-col-width:16.66667%}.row .col.col--offset-2{margin-left:16.66667%}.row .col.col--3{--ifm-col-width:25%}.row .col.col--offset-3{margin-left:25%}.row .col.col--4{--ifm-col-width:33.33333%;flex:0 0 var(--ifm-col-width);max-width:var(--ifm-col-width)}.row .col.col--offset-4{margin-left:33.33333%}.row .col.col--5{--ifm-col-width:41.66667%;flex:0 0 var(--ifm-col-width);max-width:var(--ifm-col-width)}.row .col.col--6,.row .col.col--7{flex:0 0 var(--ifm-col-width);max-width:var(--ifm-col-width)}.row .col.col--offset-5{margin-left:41.66667%}.row .col.col--6{--ifm-col-width:50%}.row .col.col--offset-6{margin-left:50%}.row .col.col--7{--ifm-col-width:58.33333%}.row .col.col--offset-7{margin-left:58.33333%}.row .col.col--8{--ifm-col-width:66.66667%;flex:0 0 var(--ifm-col-width);max-width:var(--ifm-col-width)}.row .col.col--offset-8{margin-left:66.66667%}.row .col.col--9{--ifm-col-width:75%;flex:0 0 var(--ifm-col-width);max-width:var(--ifm-col-width)}.row .col.col--10,.row .col.col--11{flex:0 0 var(--ifm-col-width);max-width:var(--ifm-col-width)}.row .col.col--offset-9{margin-left:75%}.row .col.col--10{--ifm-col-width:83.33333%}.row .col.col--offset-10{margin-left:83.33333%}.row .col.col--11{--ifm-col-width:91.66667%}.row .col.col--offset-11{margin-left:91.66667%}.row .col.col--12{--ifm-col-width:100%;flex:0 0 var(--ifm-col-width);max-width:var(--ifm-col-width)}.row .col.col--offset-12{margin-left:100%}.row--no-gutters{margin-left:0;margin-right:0}.margin-horiz--none,.margin-left--none{margin-left:0!important}.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}.row--align-center{align-items:center}.row--align-stretch{align-items:stretch}.row--align-baseline{align-items:baseline}.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 rgba(0,0,0,.1);border-radius:var(--ifm-code-border-radius);color:var(--ifm-code-color);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:transparent;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-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}.badge,strong{font-weight:var(--ifm-font-weight-bold)}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{border-style:none}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,hr:after,hr:before{content:"";display:table}.markdown:after,hr:after{clear:both}.markdown>h1{--ifm-h1-font-size:3rem;margin-bottom:calc(var(--ifm-h1-vertical-rhythm-bottom)*var(--ifm-leading));margin-top:calc(var(--ifm-h1-vertical-rhythm-top)*var(--ifm-leading))}.markdown>h2,.markdown>h3,.markdown>h4,.markdown>h5,.markdown>h6{margin-bottom:calc(var(--ifm-heading-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))}.codeBlockContainer_K1bP,.markdown>p,.markdown>pre,.markdown>ul{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}.avatar__name,ol ol,ol ul,ul ol,ul ul{margin:0}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);width:100%}.avatar__photo,.card,.navbar__title,hr{overflow:hidden}table tr{background-color:var(--ifm-table-background);border-top:var(--ifm-table-border-width) solid var(--ifm-table-border-color)}table tr:nth-child(2n){background-color:var(--ifm-table-stripe-background)}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)}a{color:var(--ifm-link-color);text-decoration:var(--ifm-link-decoration);transition:color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}a:hover{color:var(--ifm-link-hover-color);text-decoration:var(--ifm-link-hover-decoration)}.alert,.alert a{color:var(--ifm-alert-color)}.breadcrumbs__link:hover,a:not([href]){text-decoration:none}p{margin:0 0 var(--ifm-paragraph-margin-bottom)}blockquote{border-left:6px solid var(--ifm-color-emphasis-300);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}hr{border:var(--ifm-hr-border-width) solid var(--ifm-hr-border-color);margin:var(--ifm-hr-margin-vertical) 0}.alert{background-color:var(--ifm-alert-background-color);border:var(--ifm-alert-border-width) solid var(--ifm-alert-border-color);border-radius:var(--ifm-alert-border-radius);padding:var(--ifm-alert-padding-vertical) var(--ifm-alert-padding-horizontal)}.alert--primary{--ifm-alert-background-color:var(--ifm-color-primary);--ifm-alert-border-color:var(--ifm-color-primary)}.alert--secondary{--ifm-alert-background-color:var(--ifm-color-secondary);--ifm-alert-border-color:var(--ifm-color-secondary);--ifm-alert-color:var(--ifm-color-gray-900)}.alert--success{--ifm-alert-background-color:var(--ifm-color-success);--ifm-alert-border-color:var(--ifm-color-success)}.alert--info{--ifm-alert-background-color:var(--ifm-color-info);--ifm-alert-border-color:var(--ifm-color-info)}.alert--warning{--ifm-alert-background-color:var(--ifm-color-warning);--ifm-alert-border-color:var(--ifm-color-warning)}.alert--danger{--ifm-alert-background-color:var(--ifm-color-danger);--ifm-alert-border-color:var(--ifm-color-danger)}.alert a{text-decoration:underline}.alert .close{margin-right:calc(var(--ifm-alert-padding-horizontal)*-1);margin-top:calc(var(--ifm-alert-padding-vertical)*-1)}.avatar,.navbar,.navbar>.container,.navbar>.container-fluid{display:flex}.avatar__photo-link{display:block}.avatar__photo{border-radius:50%;height:var(--ifm-avatar-photo-size-md);width:var(--ifm-avatar-photo-size-md)}.avatar__photo--sm{height:var(--ifm-avatar-photo-size-sm);width:var(--ifm-avatar-photo-size-sm)}.avatar__photo--lg{height:var(--ifm-avatar-photo-size-lg);width:var(--ifm-avatar-photo-size-lg)}.avatar__photo--xl{height:var(--ifm-avatar-photo-size-xl);width:var(--ifm-avatar-photo-size-xl)}.avatar__photo+.avatar__intro{margin-left:var(--ifm-avatar-intro-margin)}.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,.menu__link--sublist:after{display:inline-block}.avatar__subtitle{margin-top:.25rem}.avatar--vertical{--ifm-avatar-intro-alignment:center;--ifm-avatar-intro-margin:0.5rem;align-items:center;flex-direction:column}.avatar--vertical .avatar__intro{margin-left:0}.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%;line-height:1;padding:var(--ifm-badge-padding-vertical) var(--ifm-badge-padding-horizontal);vertical-align:baseline}.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(:first-child){margin-left:var(--ifm-breadcrumb-spacing)}.breadcrumbs__item:not(:last-child){margin-right:var(--ifm-breadcrumb-spacing)}.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 .5rem;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{color:var(--ifm-breadcrumb-color-active)}.breadcrumbs__item--active .breadcrumbs__link,.breadcrumbs__item:not(.breadcrumbs__item--active):hover .breadcrumbs__link{background:var(--ifm-breadcrumb-item-background-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--sm{--ifm-breadcrumb-size-multiplier:0.8}.breadcrumbs--lg{--ifm-breadcrumb-size-multiplier:1.2}.button{appearance:none;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);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;vertical-align:middle}.button,.button:hover{color:var(--ifm-button-color);text-decoration:none}.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:transparent;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)}.button--primary{--ifm-button-border-color:var(--ifm-color-primary)}.button--primary:not(.button--outline){--ifm-button-background-color:var(--ifm-color-primary)}.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-border-color:var(--ifm-color-primary-darker);--ifm-button-background-color:var(--ifm-color-primary-darker);background-color:var( - --ifm-color-primary-darker - );border-color:var( - --ifm-color-primary-darker - )}.button--secondary{--ifm-button-border-color:var(--ifm-color-secondary)}.button--secondary:not(.button--outline){--ifm-button-background-color:var(--ifm-color-secondary)}.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-border-color:var(--ifm-color-secondary-darker);--ifm-button-background-color:var(--ifm-color-secondary-darker);background-color:var( - --ifm-color-secondary-darker - );border-color:var( - --ifm-color-secondary-darker - )}.button--success{--ifm-button-border-color:var(--ifm-color-success)}.button--success:not(.button--outline){--ifm-button-background-color:var(--ifm-color-success)}.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-border-color:var(--ifm-color-success-darker);--ifm-button-background-color:var(--ifm-color-success-darker);background-color:var( - --ifm-color-success-darker - );border-color:var( - --ifm-color-success-darker - )}.button--info{--ifm-button-border-color:var(--ifm-color-info)}.button--info:not(.button--outline){--ifm-button-background-color:var(--ifm-color-info)}.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-border-color:var(--ifm-color-info-darker);--ifm-button-background-color:var(--ifm-color-info-darker);background-color:var( - --ifm-color-info-darker - );border-color:var( - --ifm-color-info-darker - )}.button--warning{--ifm-button-border-color:var(--ifm-color-warning)}.button--warning:not(.button--outline){--ifm-button-background-color:var(--ifm-color-warning)}.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-border-color:var(--ifm-color-warning-darker);--ifm-button-background-color:var(--ifm-color-warning-darker);background-color:var( - --ifm-color-warning-darker - );border-color:var( - --ifm-color-warning-darker - )}.button--danger{--ifm-button-border-color:var(--ifm-color-danger)}.button--danger:not(.button--outline){--ifm-button-background-color:var(--ifm-color-danger)}.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-border-color:var(--ifm-color-danger-darker);--ifm-button-background-color:var(--ifm-color-danger-darker);background-color:var( - --ifm-color-danger-darker - );border-color:var( - --ifm-color-danger-darker - )}.button-group{display:inline-flex}.button-group>.button:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0;margin-left:var(--ifm-button-group-margin)}.button-group>.button:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.button-group>.button--active{z-index:1}.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}.card--full-height,body,html{height:100%}.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-type: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)}.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{appearance:none;background:none;border:none;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)}.dropdown__menu,.menu__link,.menu__link:hover{transition-duration:var(--ifm-transition-fast)}.close:hover{opacity:.7}.close:focus{opacity:.8}.dropdown{display:inline-flex;font-weight:var(--ifm-dropdown-font-weight);position:relative;vertical-align:top}.dropdown--hoverable:hover .dropdown__menu,.dropdown--show .dropdown__menu{opacity:1;transform:scale(1);visibility:visible}.dropdown--right .dropdown__menu{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);list-style:none;min-width:10rem;opacity:0;padding:.5rem;position:absolute;top:100%;transform:scale(.8);transition-property:opacity,transform,visibility;transition-timing-function:cubic-bezier(.24,.22,.015,1.56);visibility:hidden;z-index:var(--ifm-z-index-dropdown)}.dropdown__link{border-radius:.375rem;color:var(--ifm-dropdown-link-color);display:block;font-size:.875rem;padding:.375rem .5rem}.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:not(.dropdown--nocaret)>.navbar__link{padding-right:calc(var(--ifm-navbar-item-padding-horizontal) + 1.1em)}.dropdown:not(.dropdown--nocaret)>.navbar__link:after{border-color:currentcolor transparent;border-style:solid;border-width:.4em .4em 0;content:"";margin-left:.3em;position:absolute;top:55%;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:10rem}.footer__item,.pills__item+.pills__item{margin-top:0}.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)}.footer__items{margin-bottom:0;padding-left:0}[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{font-weight:var(--ifm-font-weight-semibold);overflow-x:hidden}.menu__list{margin:0;padding-left:0}.menu__list .menu__list{margin-left:var(--ifm-menu-link-padding-horizontal)}.menu__list-item{margin:.25rem 0}.menu__list-item--collapsed .menu__link--sublist:after{transform:rotate(90deg)}.menu__link{border-radius:.25rem;display:flex;justify-content:space-between;line-height:20px;padding:var(--ifm-menu-link-padding-vertical) calc(var(--ifm-menu-link-padding-horizontal) + 1.25rem) var(--ifm-menu-link-padding-vertical) var(--ifm-menu-link-padding-horizontal);position:relative}.menu__link,.menu__link:hover{color:var(--ifm-menu-color);transition-property:color,background;transition-timing-function:var(--ifm-transition-timing-default)}.navbar-sidebar,.navbar-sidebar__backdrop{bottom:0;opacity:0;transition-timing-function:ease-in-out;visibility:hidden;left:0;top:0}.menu__link:hover{background:var(--ifm-menu-color-background-hover);text-decoration:none}.menu__link--sublist:after{background:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem;content:" ";filter:var(--ifm-menu-link-sublist-icon-filter);height:1.25rem;position:absolute;right:var(--ifm-menu-link-padding-horizontal);top:var(--ifm-menu-link-padding-vertical);transform:rotate(180deg);transition:transform var(--ifm-transition-fast) linear;width:1.25rem}.menu__link--active,.menu__link--active:hover{color:var(--ifm-menu-color-active)}.menu__link--active:not(.menu__link--sublist){background:var(--ifm-menu-color-background-active)}.menu--responsive .menu__button{bottom:2rem;display:none;position:fixed;right:1rem;z-index:var(--ifm-z-index-fixed)}.menu--show{-ms-scroll-chaining:none;background:var(--ifm-background-surface-color);bottom:0;left:0;overscroll-behavior:contain;padding:1rem;position:fixed;right:0;top:0;z-index:var(--ifm-z-index-overlay)}.menu--show .menu__list{display:inherit;opacity:1;transition:opacity var(--ifm-transition-fast) linear}.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);width:100%}.navbar--fixed-top{position:-webkit-sticky;position:sticky;top:0;z-index:var(--ifm-z-index-fixed)}.navbar__inner{align-items:stretch;display:flex;flex-wrap:wrap;justify-content:space-between;width:100%}.navbar__brand{align-items:center;color:var(--ifm-navbar-link-color);display:flex;font-weight:700;height:2rem;margin-right:1rem;min-width:0}.navbar__brand:hover{color:inherit;text-decoration:none}.navbar__title{flex:1 1 auto}.navbar__toggle{background:none;border:none;color:inherit;cursor:pointer;display:none;margin-right:.5rem;padding:0}.navbar__item,.navbar__link{padding:var(--ifm-navbar-item-padding-vertical) var(--ifm-navbar-item-padding-horizontal)}.navbar__logo{height:100%;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__item{display:inline-block}.navbar__item.dropdown{padding:0}#nprogress,.navbar__item.dropdown .navbar__link:not([href]){pointer-events:none}.navbar__link{color:var(--ifm-navbar-link-color);font-weight:var(--ifm-font-weight-semibold);position:relative;text-decoration:none}.navbar__link--active,.navbar__link:hover{color:var(--ifm-navbar-link-hover-color);text-decoration:none}.navbar--dark{--ifm-navbar-background-color:#303846;--ifm-navbar-link-color:var(--ifm-color-white);--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-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;line-height:2rem;padding:0 .5rem 0 2.25rem;width:12.5rem}.navbar__search-input:-ms-input-placeholder{color:var(--ifm-navbar-search-input-placeholder-color)}.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);overflow:auto;position:fixed;transform:translate3d(-100%,0,0);transition-duration:.25s;transition-property:opacity,visibility,transform;width:var(--ifm-navbar-sidebar-width)}.navbar-sidebar--show .navbar-sidebar,.navbar-sidebar--show .navbar-sidebar__backdrop{opacity:1;visibility:visible}.navbar-sidebar--show .navbar-sidebar{transform:translateZ(0)}.navbar-sidebar__backdrop{background-color:rgba(0,0,0,.6);position:fixed;right:0;transition-duration:.1s;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)}.pagination__item,.pagination__link{display:inline-block}.navbar-sidebar__items{padding:.5rem}.pagination{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:not(:first-child){margin-left:var(--ifm-pagination-page-spacing)}.pagination__item:not(:last-child){margin-right:var(--ifm-pagination-page-spacing)}.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);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}.docs-wrapper,.pagination-nav{display:flex}.pagination-nav__item{display:flex;flex:1 50%;max-width:50%}.pagination-nav__item--next{text-align:right}.pagination-nav__item+.pagination-nav__item{margin-left:var(--ifm-spacing-horizontal)}.pagination-nav__link{border:1px solid var(--ifm-color-emphasis-300);border-radius:var(--ifm-pagination-nav-border-radius);flex-grow:1;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__label{font-size:var(--ifm-h4-font-size);font-weight:var(--ifm-heading-font-weight);word-break:break-word}.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,.tabs{font-weight:var(--ifm-font-weight-bold)}.pills{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{background:var(--ifm-pills-color-background-active);color:var(--ifm-pills-color-active)}.pills__item:not(.pills__item--active):hover{background-color:var(--ifm-pills-color-background-active)}.pills__item:not(:first-child){margin-left:var(--ifm-pills-spacing)}.pills__item:not(:last-child){margin-right:var(--ifm-pills-spacing)}.pills--block{display:flex;justify-content:stretch}.pills--block .pills__item{flex-grow:1;text-align:center}.tabs{color:var(--ifm-tabs-color);display:flex;margin-bottom:0;overflow-x:auto;padding-left:0}.tabs__item{border-bottom:3px solid transparent;border-radius:var(--ifm-global-radius);cursor:pointer;display:inline-flex;margin:0;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-bottom-left-radius:0;border-bottom-right-radius:0;color:var(--ifm-tabs-color-active)}.tabs__item:hover{background-color:var(--ifm-hover-overlay)}.tabs--block{justify-content:stretch}.tabs--block .tabs__item{flex-grow:1;justify-content:center}.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{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}.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--break{word-wrap:break-word!important;word-break:break-word!important}.text--no-decoration,.text--no-decoration:hover{text-decoration:none}.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)}html[data-theme=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:#18191a;--ifm-background-surface-color:#242526;--ifm-hover-overlay:hsla(0,0%,100%,0.05);--ifm-menu-link-sublist-icon-filter:invert(100%) sepia(94%) saturate(17%) hue-rotate(223deg) brightness(104%) contrast(98%);--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:#333437}.docusaurus-highlight-code-line{background-color:#484d5b;display:block;margin:0 calc(var(--ifm-pre-padding)*-1);padding:0 var(--ifm-pre-padding)}.hero{background-color:#28143c}.hero__title{color:#fff;margin-top:20px}.hero__subtitle{color:#fff}#nprogress .bar{background:#29d;height:2px;left:0;position:fixed;top:0;width:100%;z-index:5}#nprogress .peg{box-shadow:0 0 10px #29d,0 0 5px #29d;height:100%;opacity:1;position:absolute;right:0;transform:rotate(3deg) translateY(-4px);width:100px}#docusaurus-base-url-issue-banner-container,.collapseSidebarButton_1CGd,.sidebarLogo_3h0W,.themedImage_1VuW{display:none}.skipToContent_1oUP{background-color:var(--ifm-background-surface-color);border:none;border-radius:var(--ifm-global-radius);color:var(--ifm-color-emphasis-900);font:inherit;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_1oUP:focus{left:1rem}.announcementBar_3WsW{background-color:var(--ifm-color-primary);color:var(--ifm-color-black);height:var(--docusaurus-announcement-bar-height);position:relative;width:100%}.announcementBarClose_38nx{background:none;border:none;color:inherit;cursor:pointer;font-size:1.25rem;height:100%;padding:0;position:absolute;right:0;top:0;width:55px}.announcementBarContent_3EUC{font-size:85%;padding:5px 0;text-align:center;width:100%}.announcementBarCloseable_3myR{margin-right:55px}.announcementBarContent_3EUC a{color:inherit;text-decoration:underline}.toggle_71bT{align-items:center;display:flex;height:10px;justify-content:center;width:10px}.toggle_71bT:before{position:absolute}.react-toggle{cursor:pointer;position:relative;touch-action:pan-x;user-select:none}.react-toggle-screenreader-only{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;position:absolute;width:1px}.react-toggle--disabled{cursor:not-allowed}.react-toggle-track{background-color:#4d4d4d;border-radius:30px;height:24px;transition:.2s;width:50px}.react-toggle-track-check,.react-toggle-track-x{bottom:0;height:10px;margin:auto 0;top:0;position:absolute}.react-toggle-track-check{left:8px;opacity:0;transition:opacity .25s;width:14px}.react-toggle--checked .react-toggle-track-check,.react-toggle-track-x,[data-theme=dark] .react-toggle .react-toggle-track-check{opacity:1;transition:opacity .25s}.react-toggle-track-x{right:10px;width:10px}.react-toggle--checked .react-toggle-track-x,[data-theme=dark] .react-toggle .react-toggle-track-x{opacity:0}.react-toggle-thumb{background-color:#fafafa;border:1px solid #4d4d4d;border-radius:50%;height:22px;left:1px;position:absolute;top:1px;transition:.25s;width:22px}.react-toggle--checked .react-toggle-thumb,[data-theme=dark] .react-toggle .react-toggle-thumb{left:27px}.react-toggle--focus .react-toggle-thumb,.react-toggle:hover .react-toggle-thumb{box-shadow:0 0 2px 3px var(--ifm-color-primary)}.react-toggle:active:not(.react-toggle--disabled) .react-toggle-thumb{box-shadow:0 0 5px 5px var(--ifm-color-primary)}html[data-theme=dark] .themedImage--dark_hz6m,html[data-theme=light] .themedImage--light_3UqQ{display:initial}.navbarHideable_2qcr{transition:transform var(--ifm-transition-fast) ease}.navbarHidden_3yey{transform:translate3d(0,calc(var(--ifm-navbar-height)*-1),0)}.footerLogoLink_MyFc{opacity:.5;transition:opacity var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.codeBlockContent_hGly:hover>.copyButton_Ue-o,.codeBlockTitle_eoMF:hover+.codeBlockContent_hGly .copyButton_Ue-o,.copyButton_Ue-o:focus,.footerLogoLink_MyFc:hover,.hash-link:focus,:hover>.hash-link{opacity:1}body:not(.navigation-with-keyboard) :not(input):focus{outline:0}#__docusaurus{display:flex;flex-direction:column;min-height:100%}.main-wrapper{flex:1 0 auto}.tabItemActive_2DSg{animation:.5s ease-in-out 5 a}@keyframes a{0%{background-color:var(--ifm-hover-overlay)}to{background-color:transparent}}.lastUpdatedDate_1WI_{font-weight:700}.tableOfContents_35-E{max-height:calc(100vh - var(--ifm-navbar-height) - 2rem);overflow-y:auto;position:-webkit-sticky;position:sticky;top:calc(var(--ifm-navbar-height) + 2rem)}.iconEdit_2_ui{margin-right:.3em;vertical-align:sub}.docTitle_3a4h{font-size:3rem;margin-bottom:calc(var(--ifm-leading-desktop)*var(--ifm-leading))}.docItemContainer_33ec{margin:0 auto;padding:0 .5rem}.sidebarMenuIcon_fgN0{vertical-align:middle}.sidebarMenuCloseIcon_1lpH{align-items:center;display:inline-flex;font-size:1.5rem;font-weight:var(--ifm-font-weight-bold);height:24px;justify-content:center;line-height:.9;width:24px}.menu__list .menu__list{overflow-y:hidden;transition:height var(--ifm-transition-fast) linear;will-change:height}.menu__list-item--collapsed .menu__list{overflow:hidden;height:0!important}.menuLinkExternal_1OhN{align-items:center}.menuLinkExternal_1OhN:after{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='rgba(0,0,0,0.5)' d='M21 13v10H0V4h12v2H2v15h17v-8h2zm3-12H13.012l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07L24 12V1z'/%3E%3C/svg%3E") no-repeat;content:"";filter:var(--ifm-menu-link-sublist-icon-filter);height:1.15rem;margin:0 0 0 3%;min-width:1.15rem;width:1.15rem}.codeBlockContent_hGly{direction:ltr;position:relative}.codeBlockTitle_eoMF{border-bottom:1px solid var(--ifm-color-emphasis-300);border-top-left-radius:var(--ifm-global-radius);border-top-right-radius:var(--ifm-global-radius);font-size:var(--ifm-code-font-size);font-weight:500;padding:.75rem var(--ifm-pre-padding)}.codeBlock_23N8{border-radius:var(--ifm-global-radius);overflow:auto}.codeBlockWithTitle_2JqI{border-top-left-radius:0;border-top-right-radius:0}.copyButton_Ue-o{background:rgba(0,0,0,.3);border:none;border-radius:var(--ifm-global-radius);color:var(--ifm-color-white);cursor:pointer;opacity:0;padding:.4rem .5rem;position:absolute;right:calc(var(--ifm-pre-padding)/2);top:calc(var(--ifm-pre-padding)/2);transition:opacity .2s ease-in-out;-webkit-user-select:none;-ms-user-select:none;user-select:none}.codeBlockLines_39YC{float:left;font:var(--ifm-code-font-size)/var(--ifm-pre-line-height) var(--ifm-font-family-monospace);min-width:100%;padding:var(--ifm-pre-padding);white-space:pre}.anchor{display:block;position:relative;top:-.5rem}.hash-link{opacity:0;padding-left:.5rem;transition:opacity var(--ifm-transition-fast)}.enhancedAnchor_2LWZ{top:calc(var(--ifm-navbar-height)*-1 - .5rem)}.docMainContainer_3ufF,.docPage_31aa{display:flex;width:100%}.heroBanner_3P7f{overflow:hidden;padding:4rem 0;position:relative;text-align:center}.buttons_1r9m{justify-content:center}.buttons_1r9m,.features_3azU{align-items:center;display:flex}.features_3azU{padding:2rem 0;width:100%}.featureImage_ZtzX{height:200px;width:200px}@media (min-width:997px){.sidebar_15mo{display:flex;flex-direction:column;height:100%;max-height:100vh;padding-top:var(--ifm-navbar-height);position:-webkit-sticky;position:sticky;top:0;transition:opacity 50ms;width:var(--doc-sidebar-width)}.sidebarWithHideableNavbar_267A{padding-top:0}.sidebarHidden_2kNb{height:0;opacity:0;overflow:hidden;visibility:hidden}.sidebarLogo_3h0W{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_3h0W img{height:2rem;margin-right:.5rem}.menu_Bmed{flex-grow:1;padding:.5rem}.menuLinkText_2aKo{cursor:auto}.menuLinkText_2aKo:hover{background:none}.menuWithAnnouncementBar_2WvA{margin-bottom:var(--docusaurus-announcement-bar-height)}.collapseSidebarButton_1CGd{background-color:var(--ifm-button-background-color);border:1px solid var(--ifm-toc-border-color);border-radius:0;bottom:0;display:block!important;height:40px;position:-webkit-sticky;position:sticky}.collapseSidebarButtonIcon_3E-R{margin-top:4px;transform:rotate(180deg)}.expandSidebarButtonIcon_1naQ,html[dir=rtl] .collapseSidebarButtonIcon_3E-R{transform:rotate(0)}html[data-theme=dark] .collapseSidebarButton_1CGd,html[data-theme=dark] .collapsedDocSidebar_2JMH:focus,html[data-theme=dark] .collapsedDocSidebar_2JMH:hover{background-color:var(--collapse-button-bg-color-dark)}.collapsedDocSidebar_2JMH:focus,.collapsedDocSidebar_2JMH:hover,html[data-theme=dark] .collapseSidebarButton_1CGd:focus,html[data-theme=dark] .collapseSidebarButton_1CGd:hover{background-color:var(--ifm-color-emphasis-200)}.docMainContainer_3ufF{flex-grow:1;max-width:calc(100% - var(--doc-sidebar-width))}.docMainContainerEnhanced_3NYZ{max-width:none}.docSidebarContainer_3Kbt{border-right:1px solid var(--ifm-toc-border-color);-webkit-clip-path:inset(0);clip-path:inset(0);margin-top:calc(var(--ifm-navbar-height)*-1);transition:width var(--ifm-transition-fast) ease;width:var(--doc-sidebar-width);will-change:width}.docSidebarContainerHidden_3pA8{cursor:pointer;width:30px}.collapsedDocSidebar_2JMH{align-items:center;display:flex;height:100%;justify-content:center;max-height:100vh;position:-webkit-sticky;position:sticky;top:0;transition:background-color var(--ifm-transition-fast) ease}html[dir=rtl] .expandSidebarButtonIcon_1naQ{transform:rotate(180deg)}.docItemWrapperEnhanced_2vyJ{max-width:calc(var(--ifm-container-width) + var(--doc-sidebar-width))!important}}@media (min-width:997px) and (max-width:1320px){.docItemWrapper_3FMP{max-width:calc(var(--ifm-container-width) - var(--doc-sidebar-width) - var(--ifm-spacing-horizontal)*2)}.docItemWrapperEnhanced_2vyJ{max-width:calc(var(--ifm-container-width) - var(--ifm-spacing-horizontal)*2)}}@media only screen and (min-width:997px){.docItemCol_3FnS{max-width:75%!important}}@media screen and (min-width:1024px){:root{--docusaurus-announcement-bar-height:30px}}@media (min-width:1440px){.container{max-width:var(--ifm-container-width-xl)}}@media (max-width:1200px){h1{--ifm-h1-font-size:calc(1.375rem + 1.5vw)}}@media screen and (max-width:997px){.displayOnlyInLargeViewport_GrZ2{display:none!important}}@media (max-width:996px){.row .col.col.col{--ifm-col-width:100%;flex-basis:var(--ifm-col-width);margin-left:0;max-width:var(--ifm-col-width)}.footer{--ifm-footer-padding-horizontal:0}.footer__link-separator,.navbar__item{display:none}.footer__col{margin-bottom:calc(var(--ifm-spacing-vertical)*3)}.footer__link-item{display:block}.hero{padding-left:0;padding-right:0}.menu--responsive .menu__button,.navbar__toggle{display:inherit}.menu--responsive:not(.menu--show) .menu__list{display:none;opacity:0}.navbar>.container,.navbar>.container-fluid{padding:0}.navbar__search-input{width:9rem}.pills--block,.tabs--block{flex-direction:column}.pills--block .pills__item:not(:first-child){margin-top:var(--ifm-pills-spacing)}.pills--block .pills__item:not(:last-child){margin-bottom:var(--ifm-pills-spacing)}.tabs--block .tabs__item:not(:first-child){margin-top:var(--ifm-tabs-spacing)}.tabs--block .tabs__item:not(:last-child){margin-bottom:var(--ifm-tabs-spacing)}.searchWrapper_3rmH{position:absolute;right:var(--ifm-navbar-padding-horizontal)}.docSidebarContainer_3Kbt{margin-top:0}}@media only screen and (max-width:996px){.tableOfContents_35-E{display:none}.docItemContainer_33ec,.docItemContainer_gpai{padding:0 .3rem}}@media screen and (max-width:966px){.heroBanner_3P7f{padding:2rem}}@media screen and (max-width:576px){.announcementBarClose_38nx{width:35px}.announcementBarContent_3EUC{width:auto}.announcementBarCloseable_3myR{margin-right:35px}}@media print{.announcementBar_3WsW,.footer,.menu,.navbar,.pagination-nav,.table-of-contents{display:none}.tabs{page-break-inside:avoid}.codeBlockLines_39YC{white-space:pre-wrap}} \ No newline at end of file diff --git a/assets/js/0794ba4a.12e9a489.js b/assets/js/0794ba4a.12e9a489.js deleted file mode 100644 index 3593dd0..0000000 --- a/assets/js/0794ba4a.12e9a489.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[219],{3905:function(e,n,t){t.d(n,{Zo:function(){return l},kt:function(){return d}});var a=t(7294);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(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 r(e){for(var n=1;n=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var s=a.createContext({}),m=function(e){var n=a.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):r(r({},n),e)),t},l=function(e){var n=m(e.components);return a.createElement(s.Provider,{value:n},e.children)},p={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,o=e.mdxType,i=e.originalType,s=e.parentName,l=c(e,["components","mdxType","originalType","parentName"]),u=m(t),d=o,h=u["".concat(s,".").concat(d)]||u[d]||p[d]||i;return t?a.createElement(h,r(r({ref:n},l),{},{components:t})):a.createElement(h,r({ref:n},l))}));function d(e,n){var t=arguments,o=n&&n.mdxType;if("string"==typeof e||o){var i=t.length,r=new Array(i);r[0]=u;var c={};for(var s in n)hasOwnProperty.call(n,s)&&(c[s]=n[s]);c.originalType=e,c.mdxType="string"==typeof e?e:o,r[1]=c;for(var m=2;m=0&&i<=m&&o<=s&&a>=0)||(n.scrollIntoView({block:"center",behavior:"smooth"}),n.classList.add(c),setTimeout((function(){return n.classList.remove(c)}),2e3))}),150))},I=function(e){var n,t;switch(e.keyCode){case m:var a=C.indexOf(e.target)+1;t=C[a]||C[0];break;case s:var o=C.indexOf(e.target)-1;t=C[o]||C[C.length-1]}null==(n=t)||n.focus()};return a.createElement("div",{className:"tabs-container"},a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.Z)("tabs",{"tabs--block":t},d)},p.map((function(e){var n=e.value,t=e.label;return a.createElement("li",{role:"tab",tabIndex:f===n?0:-1,"aria-selected":f===n,className:(0,i.Z)("tabs__item",r,{"tabs__item--active":f===n}),key:n,ref:function(e){return C.push(e)},onKeyDown:I,onFocus:N,onClick:N},t)}))),n?(0,a.cloneElement)(y.filter((function(e){return e.props.value===f}))[0],{className:"margin-vert--md"}):a.createElement("div",{className:"margin-vert--md"},y.map((function(e,n){return(0,a.cloneElement)(e,{key:n,hidden:e.props.value!==f})}))))}},9443:function(e,n,t){var a=(0,t(7294).createContext)(void 0);n.Z=a},944:function(e,n,t){var a=t(7294),o=t(9443);n.Z=function(){var e=(0,a.useContext)(o.Z);if(null==e)throw new Error("`useUserPreferencesContext` is used outside of `Layout` Component.");return e}},9470:function(e,n,t){t.r(n),t.d(n,{frontMatter:function(){return l},metadata:function(){return p},toc:function(){return u},default:function(){return h}});var a=t(7462),o=t(3366),i=(t(7294),t(3905)),r=t(4996),c=t(1395),s=t(8215),m=["components"],l={title:"Overview"},p={unversionedId:"interaction-library/overview",id:"interaction-library/overview",isDocsHomePage:!1,title:"Overview",description:"Botrino comes with a library that allows to easily create application commands and listeners for Discord interactions. Discord recently added Application Commands as a native way to implement commands within Discord, as well as Message Components to allow for more specific and intuitive interactions with the bot.",source:"@site/docs/interaction-library/overview.md",sourceDirName:"interaction-library",slug:"/interaction-library/overview",permalink:"/docs/interaction-library/overview",editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/interaction-library/overview.md",version:"current",frontMatter:{title:"Overview"},sidebar:"someSidebar",previous:{title:"Internationalization",permalink:"/docs/api/i18n"},next:{title:"Configuration",permalink:"/docs/interaction-library/configuration"}},u=[{value:"Preamble",id:"preamble",children:[]},{value:"Features",id:"features",children:[]},{value:"Quick start",id:"quick-start",children:[{value:"Option 1: Using Botrino framework",id:"option-1-using-botrino-framework",children:[]},{value:"Option 2: Using the library alone",id:"option-2-using-the-library-alone",children:[]}]},{value:"Creating your first commands",id:"creating-your-first-commands",children:[{value:"A basic ping command",id:"a-basic-ping-command",children:[]},{value:"A command with options",id:"a-command-with-options",children:[]},{value:"A command with subcommands and subcommand groups",id:"a-command-with-subcommands-and-subcommand-groups",children:[]},{value:"A command using component interactions",id:"a-command-using-component-interactions",children:[]},{value:"A command using a pagination system based on components",id:"a-command-using-a-pagination-system-based-on-components",children:[]}]}],d={toc:u};function h(e){var n=e.components,t=(0,o.Z)(e,m);return(0,i.kt)("wrapper",(0,a.Z)({},d,t,{components:n,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Botrino comes with a library that allows to easily create application commands and listeners for Discord interactions. Discord recently added ",(0,i.kt)("a",{parentName:"p",href:"https://discord.com/developers/docs/interactions/application-commands"},"Application Commands")," as a native way to implement commands within Discord, as well as ",(0,i.kt)("a",{parentName:"p",href:"https://discord.com/developers/docs/interactions/message-components"},"Message Components")," to allow for more specific and intuitive interactions with the bot."),(0,i.kt)("h2",{id:"preamble"},"Preamble"),(0,i.kt)("p",null,"Although it is designed to be an extension of the Botrino framework, this library is completely decoupled from the framework itself. As such, it is possible to add this library to your project even if you aren't using the framework. The only difference is that you won't benefit from the automatic registration of commands, but you will be able to use all features."),(0,i.kt)("h2",{id:"features"},"Features"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Straightforward annotation-based command declaration, with full support for slash commands with subcommands/subcommand groups and context menu commands"),(0,i.kt)("li",{parentName:"ul"},"Automatic deployment of commands into the Discord application, with ability to choose whether to deploy them globally or in a specific guild during development"),(0,i.kt)("li",{parentName:"ul"},"Inject command options into fields using annotations to conveniently access the values"),(0,i.kt)("li",{parentName:"ul"},"Handle component interactions either by treating them as regular commands or by awaiting them in order to continue the execution of a parent command"),(0,i.kt)("li",{parentName:"ul"},"Automatic ACK of interaction events, configurable on a per-command basis"),(0,i.kt)("li",{parentName:"ul"},"Define privileges for each command with your own rules"),(0,i.kt)("li",{parentName:"ul"},"Cooldown per user"),(0,i.kt)("li",{parentName:"ul"},"Centralized error handling"),(0,i.kt)("li",{parentName:"ul"},"Pre-process interaction events by filtering them or adapting the locale to the target user"),(0,i.kt)("li",{parentName:"ul"},"Utilities such as pagination system using buttons")),(0,i.kt)("h2",{id:"quick-start"},"Quick start"),(0,i.kt)("div",{className:"admonition admonition-info alert alert--info"},(0,i.kt)("div",{parentName:"div",className:"admonition-heading"},(0,i.kt)("h5",{parentName:"div"},(0,i.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,i.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,i.kt)("path",{parentName:"svg",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"}))),"Prerequisites")),(0,i.kt)("div",{parentName:"div",className:"admonition-content"},(0,i.kt)("p",{parentName:"div"},"JDK 11 or newer is required. You can download the OpenJDK ",(0,i.kt)("a",{parentName:"p",href:"https://adoptopenjdk.net/?variant=openjdk11&jvmVariant=hotspot"},"here"),"."))),(0,i.kt)("p",null,"You have two ways to start a project. ",(0,i.kt)("strong",{parentName:"p"},"Choose only one of the two options.")),(0,i.kt)("h3",{id:"option-1-using-botrino-framework"},"Option 1: Using Botrino framework"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Initialize your project by following the steps in the ",(0,i.kt)("a",{parentName:"p",href:"/docs/getting-started"},"Getting Started page"),"."),(0,i.kt)("div",{parentName:"li",className:"admonition admonition-tip alert alert--success"},(0,i.kt)("div",{parentName:"div",className:"admonition-heading"},(0,i.kt)("h5",{parentName:"div"},(0,i.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,i.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"},(0,i.kt)("path",{parentName:"svg",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"}))),"tip")),(0,i.kt)("div",{parentName:"div",className:"admonition-content"},(0,i.kt)("p",{parentName:"div"},"If you decide to use the Maven archetype, the library will be already added, so you won't need to follow the next steps! Otherwise, continue reading.")))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Add the following dependency in your project. Replace ","[VERSION]"," with the latest version as shown here: ",(0,i.kt)("a",{parentName:"p",href:"https://search.maven.org/artifact/com.alex1304.botrino/botrino-interaction"},(0,i.kt)("img",{parentName:"a",src:"https://img.shields.io/maven-central/v/com.alex1304.botrino/botrino-interaction",alt:"Maven Central"}))),(0,i.kt)(c.Z,{groupId:"build-tools",defaultValue:"maven",values:[{label:"Maven",value:"maven"},{label:"Gradle",value:"gradle"}],mdxType:"Tabs"},(0,i.kt)(s.Z,{value:"maven",mdxType:"TabItem"},(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-xml"},"\n com.alex1304.botrino\n botrino-interaction\n [VERSION]\n\n"))),(0,i.kt)(s.Z,{value:"gradle",mdxType:"TabItem"},(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-groovy"},"repositories {\n mavenCentral()\n}\n\ndependencies {\n implementation 'com.alex1304.botrino:botrino-interaction:[VERSION]'\n}\n"))))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Add ",(0,i.kt)("inlineCode",{parentName:"p"},"requires botrino.interaction")," in your ",(0,i.kt)("inlineCode",{parentName:"p"},"module-info.java"),". You can actually remove ",(0,i.kt)("inlineCode",{parentName:"p"},"requires botrino.api")," since ",(0,i.kt)("inlineCode",{parentName:"p"},"botrino.interaction")," is already requiring it transitively."),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-java"},"import botrino.api.annotation.BotModule;\n\n@BotModule\nopen module com.example.myproject {\n\n requires botrino.interaction;\n}\n"))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Add the following line in the end of your ",(0,i.kt)("inlineCode",{parentName:"p"},"config.json"),":"),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-json"},' {\n // ...\n "interaction": {}\n }\n')))),(0,i.kt)("p",null,"You are now ready to add commands to your application, they will be registered automatically! You can jump directly to the ",(0,i.kt)("a",{parentName:"p",href:"#creating-your-first-commands"},"Creating your first commands")," section."),(0,i.kt)("h3",{id:"option-2-using-the-library-alone"},"Option 2: Using the library alone"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Add the following dependency in your project. Replace ","[VERSION]"," with the latest version as shown here: ",(0,i.kt)("a",{parentName:"p",href:"https://search.maven.org/artifact/com.alex1304.botrino/botrino-interaction"},(0,i.kt)("img",{parentName:"a",src:"https://img.shields.io/maven-central/v/com.alex1304.botrino/botrino-interaction",alt:"Maven Central"}))),(0,i.kt)(c.Z,{groupId:"build-tools",defaultValue:"maven",values:[{label:"Maven",value:"maven"},{label:"Gradle",value:"gradle"}],mdxType:"Tabs"},(0,i.kt)(s.Z,{value:"maven",mdxType:"TabItem"},(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-xml"},"\n com.alex1304.botrino\n botrino-interaction\n [VERSION]\n\n"))),(0,i.kt)(s.Z,{value:"gradle",mdxType:"TabItem"},(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-groovy"},"repositories {\n mavenCentral()\n}\n\ndependencies {\n implementation 'com.alex1304.botrino:botrino-interaction:[VERSION]'\n}\n"))))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Create a main method with these few lines of code:"),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-java"},"package testbot1;\n\nimport botrino.interaction.InteractionService;\nimport botrino.interaction.config.InteractionConfig;\nimport discord4j.core.DiscordClient;\n\npublic final class Main {\n\n public static void main(String[] args) {\n final var config = InteractionConfig.builder()\n // Slash commands will be deployed to this guild (recommended during dev).\n // Not specifying anything will deploy globally.\n .applicationCommandsGuildId(361255823357509645L)\n .build();\n // Login to Discord using the token passed as program argument\n final var gateway = DiscordClient.create(args[0]).login().block();\n // Initialize the interaction service\n final var interactionService = InteractionService.create(config, gateway);\n // Register your commands\n interactionService.registerChatInputCommand(new PingCommand());\n // Listen for interaction events until the bot disconnects\n interactionService.run().takeUntilOther(gateway.onDisconnect()).block();\n }\n}\n")))),(0,i.kt)("h2",{id:"creating-your-first-commands"},"Creating your first commands"),(0,i.kt)("h3",{id:"a-basic-ping-command"},"A basic ping command"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-java"},'package testbot1;\n\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport org.reactivestreams.Publisher;\n\n@ChatInputCommand(name = "ping", description = "Pings the bot to check if it is alive.")\npublic final class PingCommand implements ChatInputInteractionListener {\n\n @Override\n public Publisher run(ChatInputInteractionContext ctx) {\n return ctx.event().createFollowup("Pong !");\n }\n}\n')),(0,i.kt)("h3",{id:"a-command-with-options"},"A command with options"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-java"},'package testbot1;\n\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport botrino.interaction.grammar.ChatInputCommandGrammar;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport discord4j.core.object.command.ApplicationCommandOption;\nimport discord4j.discordjson.json.ApplicationCommandOptionData;\nimport org.reactivestreams.Publisher;\n\nimport java.util.List;\n\n@ChatInputCommand(name = "options", description = "Option testing")\npublic class OptionsCommand implements ChatInputInteractionListener {\n\n private final ChatInputCommandGrammar grammar = ChatInputCommandGrammar.of(Options.class);\n\n @Override\n public Publisher run(ChatInputInteractionContext ctx) {\n return grammar.resolve(ctx.event()).flatMap(options -> ctx.event()\n .createFollowup("Value of `my-string`: " + options.myString));\n }\n\n @Override\n public List options() {\n return grammar.toOptions();\n }\n\n private static class Options {\n @ChatInputCommandGrammar.Option(\n type = ApplicationCommandOption.Type.STRING,\n name = "my-string",\n description = "The string argument",\n required = true,\n choices = {\n @ChatInputCommandGrammar.Choice(name = "Choice 1", stringValue = "1"),\n @ChatInputCommandGrammar.Choice(name = "Choice 2", stringValue = "2"),\n @ChatInputCommandGrammar.Choice(name = "Choice 3", stringValue = "3")\n }\n )\n String myString;\n }\n}\n')),(0,i.kt)("h3",{id:"a-command-with-subcommands-and-subcommand-groups"},"A command with subcommands and subcommand groups"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-java"},'@ChatInputCommand(\n name = "nest",\n description = "Subcommand testing",\n subcommands = {\n @Subcommand(name = "sub1", description = "Subcommand 1", listener = NestCommand.Sub1.class),\n @Subcommand(name = "sub2", description = "Subcommand 2", listener = NestCommand.Sub2.class)\n },\n subcommandGroups = {\n @SubcommandGroup(name = "group1", description = "Group 1", subcommands = {\n @Subcommand(name = "sub", description = "Subcommand", listener = NestCommand.G1Sub.class)\n })\n }\n)\npublic final class NestCommand {\n\n public static final class Sub1 implements ChatInputInteractionListener {\n\n @Override\n public Publisher run(ChatInputInteractionContext ctx) {\n return ctx.event().createFollowup("sub1: pong!");\n }\n }\n\n public static final class Sub2 implements ChatInputInteractionListener {\n\n @Override\n public Publisher run(ChatInputInteractionContext ctx) {\n return ctx.event().createFollowup("sub2: pong!");\n }\n }\n\n public static final class G1Sub implements ChatInputInteractionListener {\n\n @Override\n public Publisher run(ChatInputInteractionContext ctx) {\n return ctx.event().createFollowup("group1 sub: pong!");\n }\n }\n}\n')),(0,i.kt)("h3",{id:"a-command-using-component-interactions"},"A command using component interactions"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-java"},'package testbot1;\n\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport discord4j.core.object.component.ActionRow;\nimport discord4j.core.object.component.SelectMenu;\nimport discord4j.core.object.entity.Message;\nimport discord4j.core.spec.InteractionFollowupCreateSpec;\nimport org.reactivestreams.Publisher;\nimport reactor.core.publisher.Mono;\n\nimport java.util.UUID;\n\nimport static botrino.interaction.listener.ComponentInteractionListener.selectMenu;\n\n@ChatInputCommand(name = "select", description = "Command for testing select menus")\npublic class SelectCommand implements ChatInputInteractionListener {\n\n @Override\n public Publisher run(ChatInputInteractionContext ctx) {\n final var customId = UUID.randomUUID().toString();\n return ctx.event().createFollowup("Select an option:")\n .withComponents(ActionRow.of(SelectMenu.of(customId,\n SelectMenu.Option.of("option 1", "foo"),\n SelectMenu.Option.of("option 2", "bar"),\n SelectMenu.Option.of("option 3", "baz"))))\n .map(Message::getId)\n // Wait until the select menu is interacted with and return the value clicked\n .flatMap(messageId -> ctx.awaitSelectMenuItems(customId)\n .flatMap(items -> ctx.event().createFollowup("You clicked: " + items.get(0))\n .then(ctx.event().deleteFollowup(messageId))));\n }\n}\n')),(0,i.kt)("h3",{id:"a-command-using-a-pagination-system-based-on-components"},"A command using a pagination system based on components"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-java"},'package testbot1;\n\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport botrino.interaction.util.MessagePaginator;\nimport discord4j.core.object.component.ActionRow;\nimport discord4j.core.object.component.Button;\nimport discord4j.core.spec.MessageCreateSpec;\nimport org.reactivestreams.Publisher;\nimport reactor.core.publisher.Mono;\n\n@ChatInputCommand(name = "paginate", description = "Pagination testing")\npublic final class PaginateCommand implements ChatInputInteractionListener {\n\n @Override\n public Publisher run(ChatInputInteractionContext ctx) {\n return MessagePaginator.paginate(ctx, 5, state -> Mono.just(MessageCreateSpec.create()\n .withContent("Page " + (state.getPage() + 1) + "/" + state.getPageCount())\n .withComponents(ActionRow.of(\n state.previousButton(customId -> Button.secondary(customId, "<< Previous")),\n state.nextButton(customId -> Button.secondary(customId, "Next >>")),\n state.closeButton(customId -> Button.danger(customId, "Close"))\n ))));\n }\n}\n')),(0,i.kt)("img",{src:(0,r.Z)("img/paginate.png"),alt:""}),(0,i.kt)("div",{className:"admonition admonition-tip alert alert--success"},(0,i.kt)("div",{parentName:"div",className:"admonition-heading"},(0,i.kt)("h5",{parentName:"div"},(0,i.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,i.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"},(0,i.kt)("path",{parentName:"svg",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"}))),"tip")),(0,i.kt)("div",{parentName:"div",className:"admonition-content"},(0,i.kt)("p",{parentName:"div"},"All of these features (and more !) are fully documented in the next pages."))))}h.isMDXComponent=!0},6010:function(e,n,t){function a(e){var n,t,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(n=0;n{i.r(n),i.d(n,{assets:()=>a,contentTitle:()=>s,default:()=>h,frontMatter:()=>r,metadata:()=>c,toc:()=>d});var t=i(4848),o=i(8453);const r={title:"Configuring your bot"},s=void 0,c={id:"api/configuring-your-bot",title:"Configuring your bot",description:"Standardizing the way to configure a bot is one of the primary goals of Botrino. This section will cover the",source:"@site/docs/api/configuring-your-bot.mdx",sourceDirName:"api",slug:"/api/configuring-your-bot",permalink:"/docs/api/configuring-your-bot",draft:!1,unlisted:!1,editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/api/configuring-your-bot.mdx",tags:[],version:"current",frontMatter:{title:"Configuring your bot"},sidebar:"someSidebar",previous:{title:"Working with services",permalink:"/docs/api/working-with-services"},next:{title:"Customizing the Discord client",permalink:"/docs/api/customizing-the-discord-client"}},a={},d=[{value:"The configuration JSON",id:"the-configuration-json",level:2},{value:"The ConfigContainer",id:"the-configcontainer",level:3},{value:"Built-in configuration entries",id:"built-in-configuration-entries",level:3},{value:"The bot entry",id:"the-bot-entry",level:4},{value:"Adding your own configuration entries",id:"adding-your-own-configuration-entries",level:3},{value:"Creating the configuration object",id:"creating-the-configuration-object",level:4},{value:"Adding the entry in the JSON file",id:"adding-the-entry-in-the-json-file",level:4},{value:"Using the configuration object",id:"using-the-configuration-object",level:4},{value:"Customizing the JSON source",id:"customizing-the-json-source",level:2}];function l(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,o.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.p,{children:"Standardizing the way to configure a bot is one of the primary goals of Botrino. This section will cover the\nconfiguration part more in detail, how to access the values of the configuration file in your code, and how to add your\nown configuration entries for your application."}),"\n",(0,t.jsx)(n.h2,{id:"the-configuration-json",children:"The configuration JSON"}),"\n",(0,t.jsxs)(n.p,{children:["The configuration is a JSON object, by default located in a ",(0,t.jsx)(n.code,{children:"config.json"})," in the runtime directory, each field at the\nroot of the object corresponds to one entry and maps to one class in the Java code."]}),"\n",(0,t.jsxs)(n.h3,{id:"the-configcontainer",children:["The ",(0,t.jsx)(n.code,{children:"ConfigContainer"})]}),"\n",(0,t.jsxs)(n.p,{children:["In order to access the values of the configuration in the Java code, Botrino exposes the object ",(0,t.jsx)(n.code,{children:"ConfigContainer"})," as a\nservice that you can inject in your own code. An example below:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-java",children:"package com.example.myproject;\n\nimport botrino.api.config.ConfigContainer;\nimport botrino.api.config.object.BotConfig;\nimport com.github.alex1304.rdi.finder.annotation.RdiFactory;\nimport com.github.alex1304.rdi.finder.annotation.RdiService;\n\n@RdiService\npublic final class SomeService {\n\n private final BotConfig botConfig;\n\n @RdiFactory\n public SomeService(ConfigContainer configContainer) {\n this.botConfig = configContainer.get(BotConfig.class);\n }\n}\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"ConfigContainer#get(Class)"})," method is what allows you to access the entries of the JSON config inside your code."]}),"\n",(0,t.jsx)(n.h3,{id:"built-in-configuration-entries",children:"Built-in configuration entries"}),"\n",(0,t.jsx)(n.p,{children:"Botrino comes with a few configuration entries by default. Here is the list of them below for reference."}),"\n",(0,t.jsxs)(n.h4,{id:"the-bot-entry",children:["The ",(0,t.jsx)(n.code,{children:"bot"})," entry"]}),"\n",(0,t.jsx)(n.p,{children:"This entry is where you input the bot information (token, presence, intents, etc)."}),"\n",(0,t.jsxs)(n.p,{children:["JSON structure for ",(0,t.jsx)(n.code,{children:"bot"}),":"]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Field"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required?"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"token"}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["the token of the bot, generated in the ",(0,t.jsx)(n.a,{href:"https://discord.com/developers/applications",children:"Discord Developer portal"})]}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"presence"}),(0,t.jsx)(n.td,{children:"object"}),(0,t.jsx)(n.td,{children:"the presence of the bot in Discord"}),(0,t.jsxs)(n.td,{children:["No, defaults to ",(0,t.jsx)(n.code,{children:'{"status":"online"}'})]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"enabled_intents"}),(0,t.jsx)(n.td,{children:"integer"}),(0,t.jsxs)(n.td,{children:["the ",(0,t.jsx)(n.a,{href:"https://discord.com/developers/docs/topics/gateway#gateway-intents",children:"Gateway Intents"})," to enable"]}),(0,t.jsxs)(n.td,{children:["No, defaults to ",(0,t.jsx)(n.code,{children:"32509"})," (all non-privileged intents)"]})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["JSON structure for ",(0,t.jsx)(n.code,{children:"presence"}),":"]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Field"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required?"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"status"}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:'one of "online", "idle", "do_not_disturb", "invisible"'}),(0,t.jsx)(n.td,{children:'No, defaults to "online"'})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"activity_type"}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:'one of "playing", "watching", "listening", "streaming"'}),(0,t.jsx)(n.td,{children:"No"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"activity_text"}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"the text to display in the presence activity of the bot"}),(0,t.jsx)(n.td,{children:"No"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"streaming_url"}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:['the streaming URL, only applicable if "streaming" is set as ',(0,t.jsx)(n.code,{children:"activity_text"})]}),(0,t.jsxs)(n.td,{children:["No, defaults to ",(0,t.jsx)(n.code,{children:"http://127.0.0.1"})]})]})]})]}),"\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-json",children:'{\n "bot": {\n "token": "yourTokenHere",\n "presence": {\n "status": "online",\n "activity_type": "playing",\n "activity_text": "Hello world!"\n },\n "enabled_intents": 32509\n }\n}\n'})}),"\n",(0,t.jsxs)(n.p,{children:["The corresponding class in the Java code is ",(0,t.jsx)(n.code,{children:"botrino.api.config.object.BotConfig"}),", accessed\nvia ",(0,t.jsx)(n.code,{children:"ConfigContainer.get(BotConfig.class)"}),"."]}),"\n",(0,t.jsx)(n.h3,{id:"adding-your-own-configuration-entries",children:"Adding your own configuration entries"}),"\n",(0,t.jsx)(n.p,{children:"The configuration JSON can of course be extended with more entries to include your own parameters."}),"\n",(0,t.jsx)(n.h4,{id:"creating-the-configuration-object",children:"Creating the configuration object"}),"\n",(0,t.jsx)(n.p,{children:"First step is to create a POJO like this:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-java",children:'package com.example.myproject;\n\nimport botrino.api.annotation.ConfigEntry;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\n\n@JsonDeserialize\n@ConfigEntry("my_config")\npublic final class MyConfig {\n\n private String myProperty;\n private long myValue;\n\n public String getMyProperty() {\n return myProperty;\n }\n\n @JsonProperty("my_property")\n public void setMyProperty(String myProperty) {\n this.myProperty = myProperty;\n }\n\n public long getMyValue() {\n return myValue;\n }\n\n @JsonProperty("my_value")\n public void setMyValue(long myValue) {\n this.myValue = myValue;\n }\n}\n'})}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["The ",(0,t.jsx)(n.code,{children:"@JsonDeserialize"})," annotation is to indicate that this class is intended for being constructed from a JSON input,\nprocessed by the Jackson library."]}),"\n",(0,t.jsxs)(n.li,{children:["The ",(0,t.jsx)(n.code,{children:"@ConfigEntry"})," annotation allows Botrino to recognize it as a configuration object to be registered in\nthe ",(0,t.jsx)(n.code,{children:"ConfigContainer"}),", and to indicate the name of the field in the configuration file."]}),"\n"]}),"\n",(0,t.jsx)(n.h4,{id:"adding-the-entry-in-the-json-file",children:"Adding the entry in the JSON file"}),"\n",(0,t.jsxs)(n.p,{children:["Once you've created the object, you can add the following in your ",(0,t.jsx)(n.code,{children:"config.json"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-json",metastring:"{8-11}",children:'{\n "bot": {\n ...\n },\n "i18n": {\n ...\n },\n "my_config": {\n "my_property": "hello!!!",\n "my_value": 42\n }\n}\n'})}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The name of the root field in the JSON must match with the name given in the ",(0,t.jsx)(n.code,{children:"@ConfigEntry"})," annotation."]})}),"\n",(0,t.jsx)(n.h4,{id:"using-the-configuration-object",children:"Using the configuration object"}),"\n",(0,t.jsxs)(n.p,{children:["To test this, we can create a sample service injecting the ",(0,t.jsx)(n.code,{children:"ConfigContainer"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-java",children:'package com.example.myproject;\n\nimport botrino.api.config.ConfigContainer;\nimport com.github.alex1304.rdi.finder.annotation.RdiFactory;\nimport com.github.alex1304.rdi.finder.annotation.RdiService;\nimport reactor.util.Logger;\nimport reactor.util.Loggers;\n\n@RdiService\npublic final class SampleService {\n\n private static final Logger LOGGER = Loggers.getLogger(SampleService.class);\n\n @RdiFactory\n public SampleService(ConfigContainer configContainer) {\n var myConfig = configContainer.get(MyConfig.class);\n LOGGER.info("My property = {}, my value = {}", myConfig.getMyProperty(), myConfig.getMyValue());\n }\n}\n'})}),"\n",(0,t.jsx)(n.p,{children:"When running, it should give the following output:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"00:16:42.193 [main] DEBUG botrino.api.Botrino - Discovered config entry com.example.myproject.MyConfig\n00:16:42.468 [main] INFO com.example.myproject.SampleService - My property = hello!!!, my value = 42\n"})}),"\n",(0,t.jsx)(n.h2,{id:"customizing-the-json-source",children:"Customizing the JSON source"}),"\n",(0,t.jsxs)(n.p,{children:["It is possible to override the behavior of Botrino when loading the configuration by implementing the ",(0,t.jsx)(n.code,{children:"ConfigReader"}),"\ninterface. This interface has two methods, none of them are required to be implemented:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"String loadConfigJson(Path botDirectory) throws IOException"}),': Allows to customize the way the configuration file is\nloaded. It is useful if you want to load the configuration from a file that is located at a different path or that has\na different name than "config.json". You can even ignore the ',(0,t.jsx)(n.code,{children:"botDirectory"})," parameter and load the JSON from a\ndifferent source, or directly return a hard-coded JSON string for testing purposes for example. Note that this method\nthrows ",(0,t.jsx)(n.code,{children:"IOException"})," and that the return type is not reactive: indeed, this method is ran by Botrino on the main\nthread at the very start of the program, as such it does not need to be (and shouldn't be) asynchronous. This method\nis not required to be implemented: it has a default implementation that will simply read the JSON string from a file\nnamed ",(0,t.jsx)(n.code,{children:"config.json"})," at the root of ",(0,t.jsx)(n.code,{children:"botDirectory"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"ObjectMapper createConfigObjectMapper()"}),": Allows to customize the Jackson ",(0,t.jsx)(n.code,{children:"ObjectMapper"})," instance used to parse the\nJSON string. You can for example register extra modules and deserializers. This method is not required to be\nimplemented: by default it will create an ",(0,t.jsx)(n.code,{children:"ObjectMapper"})," with only the ",(0,t.jsx)(n.code,{children:"Jdk8Module"})," registered (allows to recognize\ntypes such as ",(0,t.jsx)(n.code,{children:"java.util.Optional"}),")."]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["If no ",(0,t.jsx)(n.code,{children:"ConfigReader"})," implementation is found in your module, it will use a default one which can be recreated like this:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-java",children:'package com.example.myproject;\n\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport com.fasterxml.jackson.datatype.jdk8.Jdk8Module;\nimport reactor.core.publisher.Mono;\n\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\n\npublic final class DefaultConfigReader implements ConfigReader {\n\n @Override\n public String loadConfigJson(Path botDirectory) throws IOException {\n return Files.readString(botDirectory.resolve("config.json"));\n }\n\n @Override\n public ObjectMapper createConfigObjectMapper() {\n return new ObjectMapper().registerModule(new Jdk8Module());\n }\n}\n'})}),"\n",(0,t.jsx)(n.admonition,{type:"caution",children:(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"The implementation class must have a no-arg constructor."}),"\n",(0,t.jsxs)(n.li,{children:["If more than one implementation of ",(0,t.jsx)(n.code,{children:"ConfigReader"})," are found, it will result in an error as it is impossible to\ndetermine which one to use. If you don't want to remove the extra implementation(s), you can mark one of them with\nthe ",(0,t.jsx)(n.code,{children:"@Primary"})," annotation to lift the ambiguity. You may alternatively use the ",(0,t.jsx)(n.code,{children:"@Exclude"})," annotation if you don't want\none implementation to be picked up by Botrino."]}),"\n"]})})]})}function h(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(l,{...e})}):l(e)}},8453:(e,n,i)=>{i.d(n,{R:()=>s,x:()=>c});var t=i(6540);const o={},r=t.createContext(o);function s(e){const n=t.useContext(r);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),t.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/0e384e19.2421afc7.js b/assets/js/0e384e19.2421afc7.js deleted file mode 100644 index 3590d33..0000000 --- a/assets/js/0e384e19.2421afc7.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[671],{3905:function(e,t,n){n.d(t,{Zo:function(){return u},kt:function(){return f}});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=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=r.createContext({}),l=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},u=function(e){var t=l(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)}},d=r.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,s=e.parentName,u=c(e,["components","mdxType","originalType","parentName"]),d=l(n),f=o,m=d["".concat(s,".").concat(f)]||d[f]||p[f]||i;return n?r.createElement(m,a(a({ref:t},u),{},{components:n})):r.createElement(m,a({ref:t},u))}));function f(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 c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c.mdxType="string"==typeof e?e:o,a[1]=c;for(var l=2;l Mono.fromRunnable(\n () -> LOGGER.info("Logged in as "\n + ready.getSelf().getTag())))\n .subscribe();\n }\n}\n\n')),(0,i.kt)("p",null,"The bot is configured via a JSON configuration file with contents similar to this:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-json"},'{\n "bot": {\n "token": "yourTokenHere",\n "presence": {\n "status": "online",\n "activity_type": "playing",\n "activity_text": "Hello world!"\n },\n "enabled_intents": 32509\n }\n}\n')),(0,i.kt)("p",null,"To go further and familiarize yourself with the framework, check out the ",(0,i.kt)("a",{parentName:"p",href:"/docs/getting-started"},"Getting Started guide"),"."))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/118.f728f784.js b/assets/js/118.f728f784.js deleted file mode 100644 index 58a3e12..0000000 --- a/assets/js/118.f728f784.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[118],{4478:function(e,t,n){var r=n(7462),a=n(3366),l=n(7294),o=["width","height","className"];t.Z=function(e){var t=e.width,n=void 0===t?30:t,c=e.height,i=void 0===c?30:c,s=e.className,u=(0,a.Z)(e,o);return l.createElement("svg",(0,r.Z)({"aria-label":"Menu",className:s,width:n,height:i,viewBox:"0 0 30 30",role:"img",focusable:"false"},u),l.createElement("title",null,"Menu"),l.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M4 7h22M4 15h22M4 23h22"}))}},9118:function(e,t,n){n.d(t,{Z:function(){return Le}});var r=n(7294),a=n(6010),l=n(4973),o=n(9732),c="skipToContent_1oUP";function i(e){e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")}var s=function(){var e=(0,r.useRef)(null);return(0,o.ru)((function(){e.current&&i(e.current)})),r.createElement("div",{ref:e},r.createElement("a",{href:"#main",className:c,onClick:function(e){e.preventDefault();var t=document.querySelector("main:first-of-type")||document.querySelector(".main-wrapper");t&&i(t)}},r.createElement(l.Z,{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"},"Skip to main content")))},u=n(944),m="announcementBar_3WsW",d="announcementBarClose_38nx",f="announcementBarContent_3EUC",v="announcementBarCloseable_3myR";var h=function(){var e,t=(0,u.Z)(),n=t.isAnnouncementBarClosed,c=t.closeAnnouncementBar,i=(0,o.LU)().announcementBar;if(!i)return null;var s=i.content,h=i.backgroundColor,b=i.textColor,g=i.isCloseable;return!s||g&&n?null:r.createElement("div",{className:m,style:{backgroundColor:h,color:b},role:"banner"},r.createElement("div",{className:(0,a.Z)(f,(e={},e[v]=g,e)),dangerouslySetInnerHTML:{__html:s}}),g?r.createElement("button",{type:"button",className:d,onClick:c,"aria-label":(0,l.I)({id:"theme.AnnouncementBar.closeButtonAriaLabel",message:"Close",description:"The ARIA label for close button of announcement bar"})},r.createElement("span",{"aria-hidden":"true"},"\xd7")):null)},b=n(7462),g=function(){return null},E=n(2263),p={toggle:"toggle_71bT"},k=function(e){var t=e.icon,n=e.style;return r.createElement("span",{className:(0,a.Z)(p.toggle,p.dark),style:n},t)},Z=function(e){var t=e.icon,n=e.style;return r.createElement("span",{className:(0,a.Z)(p.toggle,p.light),style:n},t)},_=(0,r.memo)((function(e){var t=e.className,n=e.icons,l=e.checked,o=e.disabled,c=e.onChange,i=(0,r.useState)(l),s=i[0],u=i[1],m=(0,r.useState)(!1),d=m[0],f=m[1],v=(0,r.useRef)(null);return r.createElement("div",{className:(0,a.Z)("react-toggle",t,{"react-toggle--checked":s,"react-toggle--focus":d,"react-toggle--disabled":o}),role:"button",tabIndex:-1,onClick:function(e){var t=v.current;if(t)return e.target!==t?(e.preventDefault(),t.focus(),void t.click()):void u(null==t?void 0:t.checked)}},r.createElement("div",{className:"react-toggle-track"},r.createElement("div",{className:"react-toggle-track-check"},n.checked),r.createElement("div",{className:"react-toggle-track-x"},n.unchecked)),r.createElement("div",{className:"react-toggle-thumb"}),r.createElement("input",{ref:v,checked:s,type:"checkbox",className:"react-toggle-screenreader-only","aria-label":"Switch between dark and light mode",onChange:c,onFocus:function(){return f(!0)},onBlur:function(){return f(!1)}}))}));function y(e){var t=(0,o.LU)().colorMode.switchConfig,n=t.darkIcon,a=t.darkIconStyle,l=t.lightIcon,c=t.lightIconStyle,i=(0,E.Z)().isClient;return r.createElement(_,(0,b.Z)({disabled:!i,icons:{checked:r.createElement(k,{icon:n,style:a}),unchecked:r.createElement(Z,{icon:l,style:c})}},e))}var N=n(5350),w=n(5977),C=n(7898),I=function(e){var t=(0,w.TH)(),n=(0,r.useState)(e),a=n[0],l=n[1],c=(0,r.useRef)(!1),i=(0,r.useState)(0),s=i[0],u=i[1],m=(0,r.useCallback)((function(e){null!==e&&u(e.getBoundingClientRect().height)}),[]);return(0,C.Z)((function(t,n){var r=t.scrollY,a=n.scrollY;if(e)if(r=a?l(!1):r+i0&&r.createElement("div",{className:"row footer__links"},c.map((function(e,t){return r.createElement("div",{key:t,className:"col footer__col"},null!=e.title?r.createElement("div",{className:"footer__title"},e.title):null,null!=e.items&&Array.isArray(e.items)&&e.items.length>0?r.createElement("ul",{className:"footer__items"},e.items.map((function(e,t){return e.html?r.createElement("li",{key:t,className:"footer__item",dangerouslySetInnerHTML:{__html:e.html}}):r.createElement("li",{key:e.href||e.to,className:"footer__item"},r.createElement($,e))}))):null)}))),(s||n)&&r.createElement("div",{className:"footer__bottom text--center"},s&&(s.src||s.srcDark)&&r.createElement("div",{className:"margin-bottom--sm"},s.href?r.createElement(Q.Z,{href:s.href,className:J},r.createElement(ee,{alt:s.alt,sources:u})):r.createElement(ee,{alt:s.alt,sources:u})),n?r.createElement("div",{className:"footer__copyright",dangerouslySetInnerHTML:{__html:n}}):null))):null},ne=n(412),re=(0,o.WA)("theme"),ae="light",le="dark",oe=function(e){return e===le?le:ae},ce=function(e){(0,o.WA)("theme").set(oe(e))},ie=function(){var e=(0,o.LU)().colorMode,t=e.defaultMode,n=e.disableSwitch,a=e.respectPrefersColorScheme,l=(0,r.useState)(function(e){return ne.Z.canUseDOM?oe(document.documentElement.getAttribute("data-theme")):oe(e)}(t)),c=l[0],i=l[1],s=(0,r.useCallback)((function(){i(ae),ce(ae)}),[]),u=(0,r.useCallback)((function(){i(le),ce(le)}),[]);return(0,r.useEffect)((function(){document.documentElement.setAttribute("data-theme",oe(c))}),[c]),(0,r.useEffect)((function(){if(!n)try{var e=re.get();null!==e&&i(oe(e))}catch(t){console.error(t)}}),[i]),(0,r.useEffect)((function(){n&&!a||window.matchMedia("(prefers-color-scheme: dark)").addListener((function(e){var t=e.matches;i(t?le:ae)}))}),[]),{isDarkTheme:c===le,setLightTheme:s,setDarkTheme:u}},se=n(2924);var ue=function(e){var t=ie(),n=t.isDarkTheme,a=t.setLightTheme,l=t.setDarkTheme;return r.createElement(se.Z.Provider,{value:{isDarkTheme:n,setLightTheme:a,setDarkTheme:l}},e.children)};function me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=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.")}return(n=e[Symbol.iterator]()).next.bind(n)}var fe="docusaurus.tab.",ve=function(){var e=(0,r.useState)({}),t=e[0],n=e[1],a=(0,r.useCallback)((function(e,t){(0,o.WA)("docusaurus.tab."+e).set(t)}),[]);return(0,r.useEffect)((function(){try{for(var e,t={},r=de((0,o._f)());!(e=r()).done;){var a=e.value;if(a.startsWith(fe))t[a.substring(fe.length)]=(0,o.WA)(a).get()}n(t)}catch(l){console.error(l)}}),[]),{tabGroupChoices:t,setTabGroupChoices:function(e,t){n((function(n){var r;return Object.assign({},n,((r={})[e]=t,r))})),a(e,t)}}},he=(0,o.WA)("docusaurus.announcement.dismiss"),be=(0,o.WA)("docusaurus.announcement.id"),ge=function(){var e=(0,o.LU)().announcementBar,t=(0,r.useState)(!0),n=t[0],a=t[1],l=(0,r.useCallback)((function(){he.set("true"),a(!0)}),[]);return(0,r.useEffect)((function(){if(e){var t=e.id,n=be.get();"annoucement-bar"===n&&(n="announcement-bar");var r=t!==n;be.set(t),r&&he.set("false"),(r||"false"===he.get())&&a(!1)}}),[]),{isAnnouncementBarClosed:n,closeAnnouncementBar:l}},Ee=n(9443);var pe=function(e){var t=ve(),n=t.tabGroupChoices,a=t.setTabGroupChoices,l=ge(),o=l.isAnnouncementBarClosed,c=l.closeAnnouncementBar;return r.createElement(Ee.Z.Provider,{value:{tabGroupChoices:n,setTabGroupChoices:a,isAnnouncementBarClosed:o,closeAnnouncementBar:c}},e.children)};function ke(e){var t=e.children;return r.createElement(ue,null,r.createElement(pe,null,r.createElement(o.L5,null,t)))}var Ze=n(9105);function _e(e){var t=e.locale,n=e.version,a=e.tag;return r.createElement(Ze.Z,null,t&&r.createElement("meta",{name:"docusaurus_locale",content:""+t}),n&&r.createElement("meta",{name:"docusaurus_version",content:n}),a&&r.createElement("meta",{name:"docusaurus_tag",content:a}))}var ye=n(1217);function Ne(){var e=(0,E.Z)().i18n,t=e.defaultLocale,n=e.locales,a=(0,o.l5)();return r.createElement(Ze.Z,null,n.map((function(e){return r.createElement("link",{key:e,rel:"alternate",href:a.createUrl({locale:e,fullyQualified:!0}),hrefLang:e})})),r.createElement("link",{rel:"alternate",href:a.createUrl({locale:t,fullyQualified:!0}),hrefLang:"x-default"}))}function we(e){var t=e.permalink,n=(0,E.Z)().siteConfig.url,a=function(){var e=(0,E.Z)().siteConfig.url,t=(0,w.TH)().pathname;return e+(0,Y.Z)(t)}(),l=t?""+n+t:a;return r.createElement(Ze.Z,null,r.createElement("meta",{property:"og:url",content:l}),r.createElement("link",{rel:"canonical",href:l}))}function Ce(e){var t=(0,E.Z)(),n=t.siteConfig,a=n.favicon,l=n.themeConfig.metadatas,c=t.i18n,i=c.currentLocale,s=c.localeConfigs,u=e.title,m=e.description,d=e.image,f=e.keywords,v=e.searchMetadatas,h=(0,Y.Z)(a),g=(0,o.pe)(u),p=i,k=s[i].direction;return r.createElement(r.Fragment,null,r.createElement(Ze.Z,null,r.createElement("html",{lang:p,dir:k}),a&&r.createElement("link",{rel:"shortcut icon",href:h}),r.createElement("title",null,g),r.createElement("meta",{property:"og:title",content:g})),r.createElement(ye.Z,{description:m,keywords:f,image:d}),r.createElement(we,null),r.createElement(Ne,null),r.createElement(_e,(0,b.Z)({tag:o.HX,locale:i},v)),r.createElement(Ze.Z,null,l.map((function(e,t){return r.createElement("meta",(0,b.Z)({key:"metadata_"+t},e))}))))}var Ie=function(){(0,r.useEffect)((function(){var e="navigation-with-keyboard";function t(t){"keydown"===t.type&&"Tab"===t.key&&document.body.classList.add(e),"mousedown"===t.type&&document.body.classList.remove(e)}return document.addEventListener("keydown",t),document.addEventListener("mousedown",t),function(){document.body.classList.remove(e),document.removeEventListener("keydown",t),document.removeEventListener("mousedown",t)}}),[])};var Le=function(e){var t=e.children,n=e.noFooter,l=e.wrapperClassName,c=e.pageClassName;return Ie(),r.createElement(ke,null,r.createElement(Ce,e),r.createElement(s,null),r.createElement(h,null),r.createElement(q,null),r.createElement("div",{className:(0,a.Z)(o.kM.wrapper.main,l,c)},t),!n&&r.createElement(te,null))}},5537:function(e,t,n){var r=n(7462),a=n(3366),l=n(7294),o=n(6742),c=n(8465),i=n(4996),s=n(2263),u=n(9732),m=["imageClassName","titleClassName"];t.Z=function(e){var t=(0,s.Z)().isClient,n=(0,u.LU)().navbar,d=n.title,f=n.logo,v=void 0===f?{src:""}:f,h=e.imageClassName,b=e.titleClassName,g=(0,a.Z)(e,m),E=(0,i.Z)(v.href||"/"),p={light:(0,i.Z)(v.src),dark:(0,i.Z)(v.srcDark||v.src)};return l.createElement(o.Z,(0,r.Z)({to:E},g,v.target&&{target:v.target}),v.src&&l.createElement(c.Z,{key:t,className:h,sources:p,alt:v.alt||d||"Logo"}),null!=d&&l.createElement("strong",{className:b},d))}},5525:function(e,t,n){var r=n(7462),a=n(3366),l=n(7294),o=n(6010),c=n(6742),i=n(4996),s=n(5977),u=n(9732),m=["activeBasePath","activeBaseRegex","to","href","label","activeClassName","prependBaseUrlToHref"],d=["items","position","className"],f=["className"],v=["items","className","position"],h=["className"],b=["mobile"];function g(e){var t=e.activeBasePath,n=e.activeBaseRegex,o=e.to,s=e.href,u=e.label,d=e.activeClassName,f=void 0===d?"navbar__link--active":d,v=e.prependBaseUrlToHref,h=(0,a.Z)(e,m),b=(0,i.Z)(o),g=(0,i.Z)(t),E=(0,i.Z)(s,{forcePrependBaseUrl:!0});return l.createElement(c.Z,(0,r.Z)({},s?{href:v?E:s}:Object.assign({isNavLink:!0,activeClassName:f,to:b},t||n?{isActive:function(e,t){return n?new RegExp(n).test(t.pathname):t.pathname.startsWith(g)}}:null),h),u)}function E(e){var t,n=e.items,c=e.position,i=e.className,s=(0,a.Z)(e,d),u=(0,l.useRef)(null),m=(0,l.useRef)(null),v=(0,l.useState)(!1),h=v[0],b=v[1];(0,l.useEffect)((function(){var e=function(e){u.current&&!u.current.contains(e.target)&&b(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),function(){document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}}),[u]);var E=function(e,t){return void 0===t&&(t=!1),(0,o.Z)({"navbar__item navbar__link":!t,dropdown__link:t},e)};return n?l.createElement("div",{ref:u,className:(0,o.Z)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--left":"left"===c,"dropdown--right":"right"===c,"dropdown--show":h})},l.createElement(g,(0,r.Z)({className:E(i)},s,{onClick:s.to?void 0:function(e){return e.preventDefault()},onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),b(!h))}}),null!=(t=s.children)?t:s.label),l.createElement("ul",{ref:m,className:"dropdown__menu"},n.map((function(e,t){var o=e.className,c=(0,a.Z)(e,f);return l.createElement("li",{key:t},l.createElement(g,(0,r.Z)({onKeyDown:function(e){if(t===n.length-1&&"Tab"===e.key){e.preventDefault(),b(!1);var r=u.current.nextElementSibling;r&&r.focus()}},activeClassName:"dropdown__link--active",className:E(o,!0)},c)))})))):l.createElement(g,(0,r.Z)({className:E(i)},s))}function p(e){var t,n,c,i=e.items,m=e.className,d=(e.position,(0,a.Z)(e,v)),f=(0,l.useRef)(null),b=(0,s.TH)().pathname,E=(0,l.useState)((function(){var e;return null==(e=!(null!=i&&i.some((function(e){return(0,u.Mg)(e.to,b)}))))||e})),p=E[0],k=E[1],Z=function(e,t){return void 0===t&&(t=!1),(0,o.Z)("menu__link",{"menu__link--sublist":t},e)};if(!i)return l.createElement("li",{className:"menu__list-item"},l.createElement(g,(0,r.Z)({className:Z(m)},d)));var _=null!=(t=f.current)&&t.scrollHeight?(null==(n=f.current)?void 0:n.scrollHeight)+"px":void 0;return l.createElement("li",{className:(0,o.Z)("menu__list-item",{"menu__list-item--collapsed":p})},l.createElement(g,(0,r.Z)({role:"button",className:Z(m,!0)},d,{onClick:function(e){e.preventDefault(),k((function(e){return!e}))}}),null!=(c=d.children)?c:d.label),l.createElement("ul",{className:"menu__list",ref:f,style:{height:p?void 0:_}},i.map((function(e,t){var n=e.className,o=(0,a.Z)(e,h);return l.createElement("li",{className:"menu__list-item",key:t},l.createElement(g,(0,r.Z)({activeClassName:"menu__link--active",className:Z(n)},o,{onClick:d.onClick})))}))))}t.Z=function(e){var t=e.mobile,n=void 0!==t&&t,r=(0,a.Z)(e,b),o=n?p:E;return l.createElement(o,r)}},6400:function(e,t,n){n.d(t,{Z:function(){return m}});var r=n(7462),a=n(3366),l=n(7294),o=n(5525),c=n(907),i=n(6010),s=n(9732),u=["docId","activeSidebarClassName","label","docsPluginId"];function m(e){var t,n,m=e.docId,d=e.activeSidebarClassName,f=e.label,v=e.docsPluginId,h=(0,a.Z)(e,u),b=(0,c.Iw)(v),g=b.activeVersion,E=b.activeDoc,p=(0,s.J)(v).preferredVersion,k=(0,c.yW)(v),Z=null!=(t=null!=g?g:p)?t:k,_=Z.docs.find((function(e){return e.id===m}));if(!_){var y=Z.docs.map((function(e){return e.id})).join("\n- ");throw new Error("DocNavbarItem: couldn't find any doc with id="+m+" in version "+Z.name+".\nAvailable docIds=\n- "+y)}return l.createElement(o.Z,(0,r.Z)({exact:!0},h,{className:(0,i.Z)(h.className,(n={},n[d]=E&&E.sidebar===_.sidebar,n)),label:null!=f?f:_.id,to:_.path}))}},9308:function(e,t,n){n.d(t,{Z:function(){return m}});var r=n(7462),a=n(3366),l=n(7294),o=n(5525),c=n(907),i=n(9732),s=["mobile","docsPluginId","dropdownActiveClassDisabled","dropdownItemsBefore","dropdownItemsAfter"],u=function(e){return e.docs.find((function(t){return t.id===e.mainDocId}))};function m(e){var t,n,m=e.mobile,d=e.docsPluginId,f=e.dropdownActiveClassDisabled,v=e.dropdownItemsBefore,h=e.dropdownItemsAfter,b=(0,a.Z)(e,s),g=(0,c.Iw)(d),E=(0,c.gB)(d),p=(0,c.yW)(d),k=(0,i.J)(d),Z=k.preferredVersion,_=k.savePreferredVersionName;var y=null!=(t=null!=(n=g.activeVersion)?n:Z)?t:p,N=m?"Versions":y.label,w=m?void 0:u(y).path;return l.createElement(o.Z,(0,r.Z)({},b,{mobile:m,label:N,to:w,items:function(){var e=E.map((function(e){var t=(null==g?void 0:g.alternateDocVersions[e.name])||u(e);return{isNavLink:!0,label:e.label,to:t.path,isActive:function(){return e===(null==g?void 0:g.activeVersion)},onClick:function(){_(e.name)}}})),t=[].concat(v,e,h);if(!(t.length<=1))return t}(),isActive:f?function(){return!1}:void 0}))}},7250:function(e,t,n){n.d(t,{Z:function(){return u}});var r=n(7462),a=n(3366),l=n(7294),o=n(5525),c=n(907),i=n(9732),s=["label","to","docsPluginId"];function u(e){var t,n=e.label,u=e.to,m=e.docsPluginId,d=(0,a.Z)(e,s),f=(0,c.zu)(m),v=(0,i.J)(m).preferredVersion,h=(0,c.yW)(m),b=null!=(t=null!=f?f:v)?t:h,g=null!=n?n:b.label,E=null!=u?u:function(e){return e.docs.find((function(t){return t.id===e.mainDocId}))}(b).path;return l.createElement(o.Z,(0,r.Z)({},d,{label:g,to:E}))}},2924:function(e,t,n){var r=n(7294).createContext(void 0);t.Z=r},8465:function(e,t,n){n.d(t,{Z:function(){return m}});var r=n(7462),a=n(3366),l=n(7294),o=n(6010),c=n(2263),i=n(5350),s={themedImage:"themedImage_1VuW","themedImage--light":"themedImage--light_3UqQ","themedImage--dark":"themedImage--dark_hz6m"},u=["sources","className","alt"],m=function(e){var t=(0,c.Z)().isClient,n=(0,i.Z)().isDarkTheme,m=e.sources,d=e.className,f=e.alt,v=void 0===f?"":f,h=(0,a.Z)(e,u),b=t?n?["dark"]:["light"]:["light","dark"];return l.createElement(l.Fragment,null,b.map((function(e){return l.createElement("img",(0,r.Z)({key:e,src:m[e],alt:v,className:(0,o.Z)(s.themedImage,s["themedImage--"+e],d)},h))})))}},9443:function(e,t,n){var r=(0,n(7294).createContext)(void 0);t.Z=r},1839:function(e,t,n){var r=n(7294);t.Z=function(e){void 0===e&&(e=!0),(0,r.useEffect)((function(){return document.body.style.overflow=e?"hidden":"visible",function(){document.body.style.overflow="visible"}}),[e])}},7898:function(e,t,n){var r=n(7294),a=n(412),l=function(){return{scrollX:a.Z.canUseDOM?window.pageXOffset:0,scrollY:a.Z.canUseDOM?window.pageYOffset:0}};t.Z=function(e,t){void 0===t&&(t=[]);var n=(0,r.useRef)(l()),a=function(){var t=l();e&&e(t,n.current),n.current=t};(0,r.useEffect)((function(){var e={passive:!0};return a(),window.addEventListener("scroll",a,e),function(){return window.removeEventListener("scroll",a,e)}}),t)}},5350:function(e,t,n){var r=n(7294),a=n(2924);t.Z=function(){var e=(0,r.useContext)(a.Z);if(null==e)throw new Error("`useThemeContext` is used outside of `Layout` Component. See https://docusaurus.io/docs/api/themes/configuration#usethemecontext.");return e}},944:function(e,t,n){var r=n(7294),a=n(9443);t.Z=function(){var e=(0,r.useContext)(a.Z);if(null==e)throw new Error("`useUserPreferencesContext` is used outside of `Layout` Component.");return e}},3783:function(e,t,n){n.d(t,{D:function(){return l}});var r=n(7294),a=n(412),l={desktop:"desktop",mobile:"mobile"};t.Z=function(){var e=a.Z.canUseDOM;function t(){if(e)return window.innerWidth>996?l.desktop:l.mobile}var n=(0,r.useState)(t),o=n[0],c=n[1];return(0,r.useEffect)((function(){if(e)return window.addEventListener("resize",n),function(){return window.removeEventListener("resize",n)};function n(){c(t())}}),[]),o}}}]); \ No newline at end of file diff --git a/assets/js/17896441.48abe667.js b/assets/js/17896441.48abe667.js new file mode 100644 index 0000000..f8f8b46 --- /dev/null +++ b/assets/js/17896441.48abe667.js @@ -0,0 +1 @@ +(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[401],{4313:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>Zt});var s=n(6540),a=n(1003),o=n(9532),i=n(4848);const l=s.createContext(null);function c(e){let{children:t,content:n}=e;const a=function(e){return(0,s.useMemo)((()=>({metadata:e.metadata,frontMatter:e.frontMatter,assets:e.assets,contentTitle:e.contentTitle,toc:e.toc})),[e])}(n);return(0,i.jsx)(l.Provider,{value:a,children:t})}function r(){const e=(0,s.useContext)(l);if(null===e)throw new o.dV("DocProvider");return e}function d(){const{metadata:e,frontMatter:t,assets:n}=r();return(0,i.jsx)(a.be,{title:e.title,description:e.description,keywords:t.keywords,image:n.image??t.image})}var u=n(8215),m=n(4581),h=n(1312),p=n(8774);function f(e){const{permalink:t,title:n,subLabel:s,isNext:a}=e;return(0,i.jsxs)(p.A,{className:(0,u.A)("pagination-nav__link",a?"pagination-nav__link--next":"pagination-nav__link--prev"),to:t,children:[s&&(0,i.jsx)("div",{className:"pagination-nav__sublabel",children:s}),(0,i.jsx)("div",{className:"pagination-nav__label",children:n})]})}function x(e){const{previous:t,next:n}=e;return(0,i.jsxs)("nav",{className:"pagination-nav docusaurus-mt-lg","aria-label":(0,h.T)({id:"theme.docs.paginator.navAriaLabel",message:"Docs pages",description:"The ARIA label for the docs pagination"}),children:[t&&(0,i.jsx)(f,{...t,subLabel:(0,i.jsx)(h.A,{id:"theme.docs.paginator.previous",description:"The label used to navigate to the previous doc",children:"Previous"})}),n&&(0,i.jsx)(f,{...n,subLabel:(0,i.jsx)(h.A,{id:"theme.docs.paginator.next",description:"The label used to navigate to the next doc",children:"Next"}),isNext:!0})]})}function b(){const{metadata:e}=r();return(0,i.jsx)(x,{previous:e.previous,next:e.next})}var g=n(4586),j=n(4070),v=n(7559),N=n(5597),C=n(2252);const A={unreleased:function(e){let{siteTitle:t,versionMetadata:n}=e;return(0,i.jsx)(h.A,{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:(0,i.jsx)("b",{children:n.label})},children:"This is unreleased documentation for {siteTitle} {versionLabel} version."})},unmaintained:function(e){let{siteTitle:t,versionMetadata:n}=e;return(0,i.jsx)(h.A,{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:(0,i.jsx)("b",{children:n.label})},children:"This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained."})}};function k(e){const t=A[e.versionMetadata.banner];return(0,i.jsx)(t,{...e})}function y(e){let{versionLabel:t,to:n,onClick:s}=e;return(0,i.jsx)(h.A,{id:"theme.docs.versions.latestVersionSuggestionLabel",description:"The label used to tell the user to check the latest version",values:{versionLabel:t,latestVersionLink:(0,i.jsx)("b",{children:(0,i.jsx)(p.A,{to:n,onClick:s,children:(0,i.jsx)(h.A,{id:"theme.docs.versions.latestVersionLinkLabel",description:"The label used for the latest version suggestion link label",children:"latest version"})})})},children:"For up-to-date documentation, see the {latestVersionLink} ({versionLabel})."})}function L(e){let{className:t,versionMetadata:n}=e;const{siteConfig:{title:s}}=(0,g.A)(),{pluginId:a}=(0,j.vT)({failfast:!0}),{savePreferredVersionName:o}=(0,N.g1)(a),{latestDocSuggestion:l,latestVersionSuggestion:c}=(0,j.HW)(a),r=l??(d=c).docs.find((e=>e.id===d.mainDocId));var d;return(0,i.jsxs)("div",{className:(0,u.A)(t,v.G.docs.docVersionBanner,"alert alert--warning margin-bottom--md"),role:"alert",children:[(0,i.jsx)("div",{children:(0,i.jsx)(k,{siteTitle:s,versionMetadata:n})}),(0,i.jsx)("div",{className:"margin-top--md",children:(0,i.jsx)(y,{versionLabel:c.label,to:r.path,onClick:()=>o(c.name)})})]})}function _(e){let{className:t}=e;const n=(0,C.r)();return n.banner?(0,i.jsx)(L,{className:t,versionMetadata:n}):null}function B(e){let{className:t}=e;const n=(0,C.r)();return n.badge?(0,i.jsx)("span",{className:(0,u.A)(t,v.G.docs.docVersionBadge,"badge badge--secondary"),children:(0,i.jsx)(h.A,{id:"theme.docs.versionBadge.label",values:{versionLabel:n.label},children:"Version: {versionLabel}"})}):null}const w={tag:"tag_zVej",tagRegular:"tagRegular_sFm0",tagWithCount:"tagWithCount_h2kH"};function T(e){let{permalink:t,label:n,count:s}=e;return(0,i.jsxs)(p.A,{href:t,className:(0,u.A)(w.tag,s?w.tagWithCount:w.tagRegular),children:[n,s&&(0,i.jsx)("span",{children:s})]})}const E={tags:"tags_jXut",tag:"tag_QGVx"};function H(e){let{tags:t}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(h.A,{id:"theme.tags.tagsListLabel",description:"The label alongside a tag list",children:"Tags:"})}),(0,i.jsx)("ul",{className:(0,u.A)(E.tags,"padding--none","margin-left--sm"),children:t.map((e=>{let{label:t,permalink:n}=e;return(0,i.jsx)("li",{className:E.tag,children:(0,i.jsx)(T,{label:t,permalink:n})},n)}))})]})}const M={iconEdit:"iconEdit_Z9Sw"};function I(e){let{className:t,...n}=e;return(0,i.jsx)("svg",{fill:"currentColor",height:"20",width:"20",viewBox:"0 0 40 40",className:(0,u.A)(M.iconEdit,t),"aria-hidden":"true",...n,children:(0,i.jsx)("g",{children:(0,i.jsx)("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 S(e){let{editUrl:t}=e;return(0,i.jsxs)(p.A,{to:t,className:v.G.common.editThisPage,children:[(0,i.jsx)(I,{}),(0,i.jsx)(h.A,{id:"theme.common.editThisPage",description:"The link label to edit the current page",children:"Edit this page"})]})}function U(e){void 0===e&&(e={});const{i18n:{currentLocale:t}}=(0,g.A)(),n=function(){const{i18n:{currentLocale:e,localeConfigs:t}}=(0,g.A)();return t[e].calendar}();return new Intl.DateTimeFormat(t,{calendar:n,...e})}function V(e){let{lastUpdatedAt:t}=e;const n=new Date(t),s=U({day:"numeric",month:"short",year:"numeric",timeZone:"UTC"}).format(n);return(0,i.jsx)(h.A,{id:"theme.lastUpdated.atDate",description:"The words used to describe on which date a page has been last updated",values:{date:(0,i.jsx)("b",{children:(0,i.jsx)("time",{dateTime:n.toISOString(),itemProp:"dateModified",children:s})})},children:" on {date}"})}function R(e){let{lastUpdatedBy:t}=e;return(0,i.jsx)(h.A,{id:"theme.lastUpdated.byUser",description:"The words used to describe by who the page has been last updated",values:{user:(0,i.jsx)("b",{children:t})},children:" by {user}"})}function z(e){let{lastUpdatedAt:t,lastUpdatedBy:n}=e;return(0,i.jsxs)("span",{className:v.G.common.lastUpdated,children:[(0,i.jsx)(h.A,{id:"theme.lastUpdated.lastUpdatedAtBy",description:"The sentence used to display when a page has been last updated, and by who",values:{atDate:t?(0,i.jsx)(V,{lastUpdatedAt:t}):"",byUser:n?(0,i.jsx)(R,{lastUpdatedBy:n}):""},children:"Last updated{atDate}{byUser}"}),!1]})}const O={lastUpdated:"lastUpdated_JAkA"};function P(e){let{className:t,editUrl:n,lastUpdatedAt:s,lastUpdatedBy:a}=e;return(0,i.jsxs)("div",{className:(0,u.A)("row",t),children:[(0,i.jsx)("div",{className:"col",children:n&&(0,i.jsx)(S,{editUrl:n})}),(0,i.jsx)("div",{className:(0,u.A)("col",O.lastUpdated),children:(s||a)&&(0,i.jsx)(z,{lastUpdatedAt:s,lastUpdatedBy:a})})]})}function G(){const{metadata:e}=r(),{editUrl:t,lastUpdatedAt:n,lastUpdatedBy:s,tags:a}=e,o=a.length>0,l=!!(t||n||s);return o||l?(0,i.jsxs)("footer",{className:(0,u.A)(v.G.docs.docFooter,"docusaurus-mt-lg"),children:[o&&(0,i.jsx)("div",{className:(0,u.A)("row margin-top--sm",v.G.docs.docFooterTagsRow),children:(0,i.jsx)("div",{className:"col",children:(0,i.jsx)(H,{tags:a})})}),l&&(0,i.jsx)(P,{className:(0,u.A)("margin-top--sm",v.G.docs.docFooterEditMetaRow),editUrl:t,lastUpdatedAt:n,lastUpdatedBy:s})]}):null}var D=n(1422),W=n(6342);function $(e){const t=e.map((e=>({...e,parentIndex:-1,children:[]}))),n=Array(7).fill(-1);t.forEach(((e,t)=>{const s=n.slice(2,e.level);e.parentIndex=Math.max(...s),n[e.level]=t}));const s=[];return t.forEach((e=>{const{parentIndex:n,...a}=e;n>=0?t[n].children.push(a):s.push(a)})),s}function F(e){let{toc:t,minHeadingLevel:n,maxHeadingLevel:s}=e;return t.flatMap((e=>{const t=F({toc:e.children,minHeadingLevel:n,maxHeadingLevel:s});return function(e){return e.level>=n&&e.level<=s}(e)?[{...e,children:t}]:t}))}function q(e){const t=e.getBoundingClientRect();return t.top===t.bottom?q(e.parentNode):t}function Z(e,t){let{anchorTopOffset:n}=t;const s=e.find((e=>q(e).top>=n));if(s){return function(e){return e.top>0&&e.bottom{e.current=t?0:document.querySelector(".navbar").clientHeight}),[t]),e}function Y(e){const t=(0,s.useRef)(void 0),n=J();(0,s.useEffect)((()=>{if(!e)return()=>{};const{linkClassName:s,linkActiveClassName:a,minHeadingLevel:o,maxHeadingLevel:i}=e;function l(){const e=function(e){return Array.from(document.getElementsByClassName(e))}(s),l=function(e){let{minHeadingLevel:t,maxHeadingLevel:n}=e;const s=[];for(let a=t;a<=n;a+=1)s.push(`h${a}.anchor`);return Array.from(document.querySelectorAll(s.join()))}({minHeadingLevel:o,maxHeadingLevel:i}),c=Z(l,{anchorTopOffset:n.current}),r=e.find((e=>c&&c.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(a),e.classList.add(a),t.current=e):e.classList.remove(a)}(e,e===r)}))}return document.addEventListener("scroll",l),document.addEventListener("resize",l),l(),()=>{document.removeEventListener("scroll",l),document.removeEventListener("resize",l)}}),[e,n])}function K(e){let{toc:t,className:n,linkClassName:s,isChild:a}=e;return t.length?(0,i.jsx)("ul",{className:a?void 0:n,children:t.map((e=>(0,i.jsxs)("li",{children:[(0,i.jsx)(p.A,{to:`#${e.id}`,className:s??void 0,dangerouslySetInnerHTML:{__html:e.value}}),(0,i.jsx)(K,{isChild:!0,toc:e.children,className:n,linkClassName:s})]},e.id)))}):null}const Q=s.memo(K);function X(e){let{toc:t,className:n="table-of-contents table-of-contents__left-border",linkClassName:a="table-of-contents__link",linkActiveClassName:o,minHeadingLevel:l,maxHeadingLevel:c,...r}=e;const d=(0,W.p)(),u=l??d.tableOfContents.minHeadingLevel,m=c??d.tableOfContents.maxHeadingLevel,h=function(e){let{toc:t,minHeadingLevel:n,maxHeadingLevel:a}=e;return(0,s.useMemo)((()=>F({toc:$(t),minHeadingLevel:n,maxHeadingLevel:a})),[t,n,a])}({toc:t,minHeadingLevel:u,maxHeadingLevel:m});return Y((0,s.useMemo)((()=>{if(a&&o)return{linkClassName:a,linkActiveClassName:o,minHeadingLevel:u,maxHeadingLevel:m}}),[a,o,u,m])),(0,i.jsx)(Q,{toc:h,className:n,linkClassName:a,...r})}const ee={tocCollapsibleButton:"tocCollapsibleButton_TO0P",tocCollapsibleButtonExpanded:"tocCollapsibleButtonExpanded_MG3E"};function te(e){let{collapsed:t,...n}=e;return(0,i.jsx)("button",{type:"button",...n,className:(0,u.A)("clean-btn",ee.tocCollapsibleButton,!t&&ee.tocCollapsibleButtonExpanded,n.className),children:(0,i.jsx)(h.A,{id:"theme.TOCCollapsible.toggleButtonLabel",description:"The label used by the button on the collapsible TOC component",children:"On this page"})})}const ne={tocCollapsible:"tocCollapsible_ETCw",tocCollapsibleContent:"tocCollapsibleContent_vkbj",tocCollapsibleExpanded:"tocCollapsibleExpanded_sAul"};function se(e){let{toc:t,className:n,minHeadingLevel:s,maxHeadingLevel:a}=e;const{collapsed:o,toggleCollapsed:l}=(0,D.u)({initialState:!0});return(0,i.jsxs)("div",{className:(0,u.A)(ne.tocCollapsible,!o&&ne.tocCollapsibleExpanded,n),children:[(0,i.jsx)(te,{collapsed:o,onClick:l}),(0,i.jsx)(D.N,{lazy:!0,className:ne.tocCollapsibleContent,collapsed:o,children:(0,i.jsx)(X,{toc:t,minHeadingLevel:s,maxHeadingLevel:a})})]})}const ae={tocMobile:"tocMobile_ITEo"};function oe(){const{toc:e,frontMatter:t}=r();return(0,i.jsx)(se,{toc:e,minHeadingLevel:t.toc_min_heading_level,maxHeadingLevel:t.toc_max_heading_level,className:(0,u.A)(v.G.docs.docTocMobile,ae.tocMobile)})}const ie={tableOfContents:"tableOfContents_bqdL",docItemContainer:"docItemContainer_F8PC"},le="table-of-contents__link toc-highlight",ce="table-of-contents__link--active";function re(e){let{className:t,...n}=e;return(0,i.jsx)("div",{className:(0,u.A)(ie.tableOfContents,"thin-scrollbar",t),children:(0,i.jsx)(X,{...n,linkClassName:le,linkActiveClassName:ce})})}function de(){const{toc:e,frontMatter:t}=r();return(0,i.jsx)(re,{toc:e,minHeadingLevel:t.toc_min_heading_level,maxHeadingLevel:t.toc_max_heading_level,className:v.G.docs.docTocDesktop})}var ue=n(1107),me=n(8453),he=n(5260),pe=n(2303),fe=n(5293);function xe(){const{prism:e}=(0,W.p)(),{colorMode:t}=(0,fe.G)(),n=e.theme,s=e.darkTheme||n;return"dark"===t?s:n}var be=n(8426),ge=n.n(be);const je=/title=(?["'])(?.*?)\1/,ve=/\{(?<range>[\d,-]+)\}/,Ne={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},Ce={...Ne,lua:{start:"--",end:""},wasm:{start:"\\;\\;",end:""},tex:{start:"%",end:""},vb:{start:"['\u2018\u2019]",end:""},vbnet:{start:"(?:_\\s*)?['\u2018\u2019]",end:""},rem:{start:"[Rr][Ee][Mm]\\b",end:""},f90:{start:"!",end:""},ml:{start:"\\(\\*",end:"\\*\\)"},cobol:{start:"\\*>",end:""}},Ae=Object.keys(Ne);function ke(e,t){const n=e.map((e=>{const{start:n,end:s}=Ce[e];return`(?:${n}\\s*(${t.flatMap((e=>[e.line,e.block?.start,e.block?.end].filter(Boolean))).join("|")})\\s*${s})`})).join("|");return new RegExp(`^\\s*(?:${n})\\s*$`)}function ye(e,t){let n=e.replace(/\n$/,"");const{language:s,magicComments:a,metastring:o}=t;if(o&&ve.test(o)){const e=o.match(ve).groups.range;if(0===a.length)throw new Error(`A highlight range has been given in code block's metastring (\`\`\` ${o}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);const t=a[0].className,s=ge()(e).filter((e=>e>0)).map((e=>[e-1,[t]]));return{lineClassNames:Object.fromEntries(s),code:n}}if(void 0===s)return{lineClassNames:{},code:n};const i=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return ke(["js","jsBlock"],t);case"jsx":case"tsx":return ke(["js","jsBlock","jsx"],t);case"html":return ke(["js","jsBlock","html"],t);case"python":case"py":case"bash":return ke(["bash"],t);case"markdown":case"md":return ke(["html","jsx","bash"],t);case"tex":case"latex":case"matlab":return ke(["tex"],t);case"lua":case"haskell":case"sql":return ke(["lua"],t);case"wasm":return ke(["wasm"],t);case"vb":case"vba":case"visual-basic":return ke(["vb","rem"],t);case"vbnet":return ke(["vbnet","rem"],t);case"batch":return ke(["rem"],t);case"basic":return ke(["rem","f90"],t);case"fsharp":return ke(["js","ml"],t);case"ocaml":case"sml":return ke(["ml"],t);case"fortran":return ke(["f90"],t);case"cobol":return ke(["cobol"],t);default:return ke(Ae,t)}}(s,a),l=n.split("\n"),c=Object.fromEntries(a.map((e=>[e.className,{start:0,range:""}]))),r=Object.fromEntries(a.filter((e=>e.line)).map((e=>{let{className:t,line:n}=e;return[n,t]}))),d=Object.fromEntries(a.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.start,t]}))),u=Object.fromEntries(a.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.end,t]})));for(let h=0;h<l.length;){const e=l[h].match(i);if(!e){h+=1;continue}const t=e.slice(1).find((e=>void 0!==e));r[t]?c[r[t]].range+=`${h},`:d[t]?c[d[t]].start=h:u[t]&&(c[u[t]].range+=`${c[u[t]].start}-${h-1},`),l.splice(h,1)}n=l.join("\n");const m={};return Object.entries(c).forEach((e=>{let[t,{range:n}]=e;ge()(n).forEach((e=>{m[e]??=[],m[e].push(t)}))})),{lineClassNames:m,code:n}}const Le={codeBlockContainer:"codeBlockContainer_Ckt0"};function _e(e){let{as:t,...n}=e;const s=function(e){const t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={};return Object.entries(e.plain).forEach((e=>{let[s,a]=e;const o=t[s];o&&"string"==typeof a&&(n[o]=a)})),n}(xe());return(0,i.jsx)(t,{...n,style:s,className:(0,u.A)(n.className,Le.codeBlockContainer,v.G.common.codeBlock)})}const Be={codeBlockContent:"codeBlockContent_biex",codeBlockTitle:"codeBlockTitle_Ktv7",codeBlock:"codeBlock_bY9V",codeBlockStandalone:"codeBlockStandalone_MEMb",codeBlockLines:"codeBlockLines_e6Vv",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_o6Pm",buttonGroup:"buttonGroup__atx"};function we(e){let{children:t,className:n}=e;return(0,i.jsx)(_e,{as:"pre",tabIndex:0,className:(0,u.A)(Be.codeBlockStandalone,"thin-scrollbar",n),children:(0,i.jsx)("code",{className:Be.codeBlockLines,children:t})})}const Te={attributes:!0,characterData:!0,childList:!0,subtree:!0};function Ee(e,t){const[n,a]=(0,s.useState)(),i=(0,s.useCallback)((()=>{a(e.current?.closest("[role=tabpanel][hidden]"))}),[e,a]);(0,s.useEffect)((()=>{i()}),[i]),function(e,t,n){void 0===n&&(n=Te);const a=(0,o._q)(t),i=(0,o.Be)(n);(0,s.useEffect)((()=>{const t=new MutationObserver(a);return e&&t.observe(e,i),()=>t.disconnect()}),[e,a,i])}(n,(e=>{e.forEach((e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(t(),i())}))}),{attributes:!0,characterData:!1,childList:!1,subtree:!1})}var He=n(8181);const Me={codeLine:"codeLine_lJS_",codeLineNumber:"codeLineNumber_Tfdd",codeLineContent:"codeLineContent_feaV"};function Ie(e){let{line:t,classNames:n,showLineNumbers:s,getLineProps:a,getTokenProps:o}=e;1===t.length&&"\n"===t[0].content&&(t[0].content="");const l=a({line:t,className:(0,u.A)(n,s&&Me.codeLine)}),c=t.map(((e,t)=>(0,i.jsx)("span",{...o({token:e})},t)));return(0,i.jsxs)("span",{...l,children:[s?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:Me.codeLineNumber}),(0,i.jsx)("span",{className:Me.codeLineContent,children:c})]}):c,(0,i.jsx)("br",{})]})}function Se(e){return(0,i.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,i.jsx)("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 Ue(e){return(0,i.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,i.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}const Ve={copyButtonCopied:"copyButtonCopied_obH4",copyButtonIcons:"copyButtonIcons_eSgA",copyButtonIcon:"copyButtonIcon_y97N",copyButtonSuccessIcon:"copyButtonSuccessIcon_LjdS"};function Re(e){let{code:t,className:n}=e;const[a,o]=(0,s.useState)(!1),l=(0,s.useRef)(void 0),c=(0,s.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 s=document.createElement("textarea"),a=document.activeElement;s.value=e,s.setAttribute("readonly",""),s.style.contain="strict",s.style.position="absolute",s.style.left="-9999px",s.style.fontSize="12pt";const o=document.getSelection(),i=o.rangeCount>0&&o.getRangeAt(0);n.append(s),s.select(),s.selectionStart=0,s.selectionEnd=e.length;let l=!1;try{l=document.execCommand("copy")}catch{}s.remove(),i&&(o.removeAllRanges(),o.addRange(i)),a&&a.focus()}(t),o(!0),l.current=window.setTimeout((()=>{o(!1)}),1e3)}),[t]);return(0,s.useEffect)((()=>()=>window.clearTimeout(l.current)),[]),(0,i.jsx)("button",{type:"button","aria-label":a?(0,h.T)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,h.T)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,h.T)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,u.A)("clean-btn",n,Ve.copyButton,a&&Ve.copyButtonCopied),onClick:c,children:(0,i.jsxs)("span",{className:Ve.copyButtonIcons,"aria-hidden":"true",children:[(0,i.jsx)(Se,{className:Ve.copyButtonIcon}),(0,i.jsx)(Ue,{className:Ve.copyButtonSuccessIcon})]})})}function ze(e){return(0,i.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,i.jsx)("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 Oe={wordWrapButtonIcon:"wordWrapButtonIcon_Bwma",wordWrapButtonEnabled:"wordWrapButtonEnabled_EoeP"};function Pe(e){let{className:t,onClick:n,isEnabled:s}=e;const a=(0,h.T)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,i.jsx)("button",{type:"button",onClick:n,className:(0,u.A)("clean-btn",t,s&&Oe.wordWrapButtonEnabled),"aria-label":a,title:a,children:(0,i.jsx)(ze,{className:Oe.wordWrapButtonIcon,"aria-hidden":"true"})})}function Ge(e){let{children:t,className:n="",metastring:a,title:o,showLineNumbers:l,language:c}=e;const{prism:{defaultLanguage:r,magicComments:d}}=(0,W.p)(),m=function(e){return e?.toLowerCase()}(c??function(e){const t=e.split(" ").find((e=>e.startsWith("language-")));return t?.replace(/language-/,"")}(n)??r),h=xe(),p=function(){const[e,t]=(0,s.useState)(!1),[n,a]=(0,s.useState)(!1),o=(0,s.useRef)(null),i=(0,s.useCallback)((()=>{const n=o.current.querySelector("code");e?n.removeAttribute("style"):(n.style.whiteSpace="pre-wrap",n.style.overflowWrap="anywhere"),t((e=>!e))}),[o,e]),l=(0,s.useCallback)((()=>{const{scrollWidth:e,clientWidth:t}=o.current,n=e>t||o.current.querySelector("code").hasAttribute("style");a(n)}),[o]);return Ee(o,l),(0,s.useEffect)((()=>{l()}),[e,l]),(0,s.useEffect)((()=>(window.addEventListener("resize",l,{passive:!0}),()=>{window.removeEventListener("resize",l)})),[l]),{codeBlockRef:o,isEnabled:e,isCodeScrollable:n,toggle:i}}(),f=function(e){return e?.match(je)?.groups.title??""}(a)||o,{lineClassNames:x,code:b}=ye(t,{metastring:a,language:m,magicComments:d}),g=l??function(e){return Boolean(e?.includes("showLineNumbers"))}(a);return(0,i.jsxs)(_e,{as:"div",className:(0,u.A)(n,m&&!n.includes(`language-${m}`)&&`language-${m}`),children:[f&&(0,i.jsx)("div",{className:Be.codeBlockTitle,children:f}),(0,i.jsxs)("div",{className:Be.codeBlockContent,children:[(0,i.jsx)(He.f4,{theme:h,code:b,language:m??"text",children:e=>{let{className:t,style:n,tokens:s,getLineProps:a,getTokenProps:o}=e;return(0,i.jsx)("pre",{tabIndex:0,ref:p.codeBlockRef,className:(0,u.A)(t,Be.codeBlock,"thin-scrollbar"),style:n,children:(0,i.jsx)("code",{className:(0,u.A)(Be.codeBlockLines,g&&Be.codeBlockLinesWithNumbering),children:s.map(((e,t)=>(0,i.jsx)(Ie,{line:e,getLineProps:a,getTokenProps:o,classNames:x[t],showLineNumbers:g},t)))})})}}),(0,i.jsxs)("div",{className:Be.buttonGroup,children:[(p.isEnabled||p.isCodeScrollable)&&(0,i.jsx)(Pe,{className:Be.codeButton,onClick:()=>p.toggle(),isEnabled:p.isEnabled}),(0,i.jsx)(Re,{className:Be.codeButton,code:b})]})]})]})}function De(e){let{children:t,...n}=e;const a=(0,pe.A)(),o=function(e){return s.Children.toArray(e).some((e=>(0,s.isValidElement)(e)))?e:Array.isArray(e)?e.join(""):e}(t),l="string"==typeof o?Ge:we;return(0,i.jsx)(l,{...n,children:o},String(a))}function We(e){return(0,i.jsx)("code",{...e})}var $e=n(5066),Fe=n(3427);const qe={details:"details_lb9f",isBrowser:"isBrowser_bmU9",collapsibleContent:"collapsibleContent_i85q"};function Ze(e){return!!e&&("SUMMARY"===e.tagName||Ze(e.parentElement))}function Je(e,t){return!!e&&(e===t||Je(e.parentElement,t))}function Ye(e){let{summary:t,children:n,...a}=e;(0,Fe.A)().collectAnchor(a.id);const o=(0,pe.A)(),l=(0,s.useRef)(null),{collapsed:c,setCollapsed:r}=(0,D.u)({initialState:!a.open}),[d,u]=(0,s.useState)(a.open),m=s.isValidElement(t)?t:(0,i.jsx)("summary",{children:t??"Details"});return(0,i.jsxs)("details",{...a,ref:l,open:d,"data-collapsed":c,className:(0,$e.A)(qe.details,o&&qe.isBrowser,a.className),onMouseDown:e=>{Ze(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();const t=e.target;Ze(t)&&Je(t,l.current)&&(e.preventDefault(),c?(r(!1),u(!0)):r(!0))},children:[m,(0,i.jsx)(D.N,{lazy:!1,collapsed:c,disableSSRStyle:!0,onCollapseTransitionEnd:e=>{r(e),u(!e)},children:(0,i.jsx)("div",{className:qe.collapsibleContent,children:n})})]})}const Ke={details:"details_b_Ee"},Qe="alert alert--info";function Xe(e){let{...t}=e;return(0,i.jsx)(Ye,{...t,className:(0,u.A)(Qe,Ke.details,t.className)})}function et(e){const t=s.Children.toArray(e.children),n=t.find((e=>s.isValidElement(e)&&"summary"===e.type)),a=(0,i.jsx)(i.Fragment,{children:t.filter((e=>e!==n))});return(0,i.jsx)(Xe,{...e,summary:n,children:a})}function tt(e){return(0,i.jsx)(ue.A,{...e})}const nt={containsTaskList:"containsTaskList_mC6p"};function st(e){if(void 0!==e)return(0,u.A)(e,e?.includes("contains-task-list")&&nt.containsTaskList)}const at={img:"img_ev3q"};function ot(e){const{mdxAdmonitionTitle:t,rest:n}=function(e){const t=s.Children.toArray(e),n=t.find((e=>s.isValidElement(e)&&"mdxAdmonitionTitle"===e.type)),a=t.filter((e=>e!==n)),o=n?.props.children;return{mdxAdmonitionTitle:o,rest:a.length>0?(0,i.jsx)(i.Fragment,{children:a}):null}}(e.children),a=e.title??t;return{...e,...a&&{title:a},children:n}}const it={admonition:"admonition_xJq3",admonitionHeading:"admonitionHeading_Gvgb",admonitionIcon:"admonitionIcon_Rf37",admonitionContent:"admonitionContent_BuS1"};function lt(e){let{type:t,className:n,children:s}=e;return(0,i.jsx)("div",{className:(0,u.A)(v.G.common.admonition,v.G.common.admonitionType(t),it.admonition,n),children:s})}function ct(e){let{icon:t,title:n}=e;return(0,i.jsxs)("div",{className:it.admonitionHeading,children:[(0,i.jsx)("span",{className:it.admonitionIcon,children:t}),n]})}function rt(e){let{children:t}=e;return t?(0,i.jsx)("div",{className:it.admonitionContent,children:t}):null}function dt(e){const{type:t,icon:n,title:s,children:a,className:o}=e;return(0,i.jsxs)(lt,{type:t,className:o,children:[s||n?(0,i.jsx)(ct,{title:s,icon:n}):null,(0,i.jsx)(rt,{children:a})]})}function ut(e){return(0,i.jsx)("svg",{viewBox:"0 0 14 16",...e,children:(0,i.jsx)("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"})})}const mt={icon:(0,i.jsx)(ut,{}),title:(0,i.jsx)(h.A,{id:"theme.admonition.note",description:"The default label used for the Note admonition (:::note)",children:"note"})};function ht(e){return(0,i.jsx)(dt,{...mt,...e,className:(0,u.A)("alert alert--secondary",e.className),children:e.children})}function pt(e){return(0,i.jsx)("svg",{viewBox:"0 0 12 16",...e,children:(0,i.jsx)("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"})})}const ft={icon:(0,i.jsx)(pt,{}),title:(0,i.jsx)(h.A,{id:"theme.admonition.tip",description:"The default label used for the Tip admonition (:::tip)",children:"tip"})};function xt(e){return(0,i.jsx)(dt,{...ft,...e,className:(0,u.A)("alert alert--success",e.className),children:e.children})}function bt(e){return(0,i.jsx)("svg",{viewBox:"0 0 14 16",...e,children:(0,i.jsx)("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"})})}const gt={icon:(0,i.jsx)(bt,{}),title:(0,i.jsx)(h.A,{id:"theme.admonition.info",description:"The default label used for the Info admonition (:::info)",children:"info"})};function jt(e){return(0,i.jsx)(dt,{...gt,...e,className:(0,u.A)("alert alert--info",e.className),children:e.children})}function vt(e){return(0,i.jsx)("svg",{viewBox:"0 0 16 16",...e,children:(0,i.jsx)("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"})})}const Nt={icon:(0,i.jsx)(vt,{}),title:(0,i.jsx)(h.A,{id:"theme.admonition.warning",description:"The default label used for the Warning admonition (:::warning)",children:"warning"})};function Ct(e){return(0,i.jsx)("svg",{viewBox:"0 0 12 16",...e,children:(0,i.jsx)("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"})})}const At={icon:(0,i.jsx)(Ct,{}),title:(0,i.jsx)(h.A,{id:"theme.admonition.danger",description:"The default label used for the Danger admonition (:::danger)",children:"danger"})};const kt={icon:(0,i.jsx)(vt,{}),title:(0,i.jsx)(h.A,{id:"theme.admonition.caution",description:"The default label used for the Caution admonition (:::caution)",children:"caution"})};const yt={...{note:ht,tip:xt,info:jt,warning:function(e){return(0,i.jsx)(dt,{...Nt,...e,className:(0,u.A)("alert alert--warning",e.className),children:e.children})},danger:function(e){return(0,i.jsx)(dt,{...At,...e,className:(0,u.A)("alert alert--danger",e.className),children:e.children})}},...{secondary:e=>(0,i.jsx)(ht,{title:"secondary",...e}),important:e=>(0,i.jsx)(jt,{title:"important",...e}),success:e=>(0,i.jsx)(xt,{title:"success",...e}),caution:function(e){return(0,i.jsx)(dt,{...kt,...e,className:(0,u.A)("alert alert--warning",e.className),children:e.children})}}};function Lt(e){const t=ot(e),n=(s=t.type,yt[s]||(console.warn(`No admonition component found for admonition type "${s}". Using Info as fallback.`),yt.info));var s;return(0,i.jsx)(n,{...t})}var _t=n(418);const Bt={Head:he.A,details:et,Details:et,code:function(e){return function(e){return void 0!==e.children&&s.Children.toArray(e.children).every((e=>"string"==typeof e&&!e.includes("\n")))}(e)?(0,i.jsx)(We,{...e}):(0,i.jsx)(De,{...e})},a:function(e){return(0,i.jsx)(p.A,{...e})},pre:function(e){return(0,i.jsx)(i.Fragment,{children:e.children})},ul:function(e){return(0,i.jsx)("ul",{...e,className:st(e.className)})},li:function(e){return(0,Fe.A)().collectAnchor(e.id),(0,i.jsx)("li",{...e})},img:function(e){return(0,i.jsx)("img",{decoding:"async",loading:"lazy",...e,className:(t=e.className,(0,u.A)(t,at.img))});var t},h1:e=>(0,i.jsx)(tt,{as:"h1",...e}),h2:e=>(0,i.jsx)(tt,{as:"h2",...e}),h3:e=>(0,i.jsx)(tt,{as:"h3",...e}),h4:e=>(0,i.jsx)(tt,{as:"h4",...e}),h5:e=>(0,i.jsx)(tt,{as:"h5",...e}),h6:e=>(0,i.jsx)(tt,{as:"h6",...e}),admonition:Lt,mermaid:_t.A};function wt(e){let{children:t}=e;return(0,i.jsx)(me.x,{components:Bt,children:t})}function Tt(e){let{children:t}=e;const n=function(){const{metadata:e,frontMatter:t,contentTitle:n}=r();return t.hide_title||void 0!==n?null:e.title}();return(0,i.jsxs)("div",{className:(0,u.A)(v.G.docs.docMarkdown,"markdown"),children:[n&&(0,i.jsx)("header",{children:(0,i.jsx)(ue.A,{as:"h1",children:n})}),(0,i.jsx)(wt,{children:t})]})}var Et=n(4142),Ht=n(9169),Mt=n(6025);function It(e){return(0,i.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,i.jsx)("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 St={breadcrumbHomeIcon:"breadcrumbHomeIcon_YNFT"};function Ut(){const e=(0,Mt.A)("/");return(0,i.jsx)("li",{className:"breadcrumbs__item",children:(0,i.jsx)(p.A,{"aria-label":(0,h.T)({id:"theme.docs.breadcrumbs.home",message:"Home page",description:"The ARIA label for the home page in the breadcrumbs"}),className:"breadcrumbs__link",href:e,children:(0,i.jsx)(It,{className:St.breadcrumbHomeIcon})})})}const Vt={breadcrumbsContainer:"breadcrumbsContainer_Z_bl"};function Rt(e){let{children:t,href:n,isLast:s}=e;const a="breadcrumbs__link";return s?(0,i.jsx)("span",{className:a,itemProp:"name",children:t}):n?(0,i.jsx)(p.A,{className:a,href:n,itemProp:"item",children:(0,i.jsx)("span",{itemProp:"name",children:t})}):(0,i.jsx)("span",{className:a,children:t})}function zt(e){let{children:t,active:n,index:s,addMicrodata:a}=e;return(0,i.jsxs)("li",{...a&&{itemScope:!0,itemProp:"itemListElement",itemType:"https://schema.org/ListItem"},className:(0,u.A)("breadcrumbs__item",{"breadcrumbs__item--active":n}),children:[t,(0,i.jsx)("meta",{itemProp:"position",content:String(s+1)})]})}function Ot(){const e=(0,Et.OF)(),t=(0,Ht.Dt)();return e?(0,i.jsx)("nav",{className:(0,u.A)(v.G.docs.docBreadcrumbs,Vt.breadcrumbsContainer),"aria-label":(0,h.T)({id:"theme.docs.breadcrumbs.navAriaLabel",message:"Breadcrumbs",description:"The ARIA label for the breadcrumbs"}),children:(0,i.jsxs)("ul",{className:"breadcrumbs",itemScope:!0,itemType:"https://schema.org/BreadcrumbList",children:[t&&(0,i.jsx)(Ut,{}),e.map(((t,n)=>{const s=n===e.length-1,a="category"===t.type&&t.linkUnlisted?void 0:t.href;return(0,i.jsx)(zt,{active:s,index:n,addMicrodata:!!a,children:(0,i.jsx)(Rt,{href:a,isLast:s,children:t.label})},n)}))]})}):null}function Pt(){return(0,i.jsx)(h.A,{id:"theme.unlistedContent.title",description:"The unlisted content banner title",children:"Unlisted page"})}function Gt(){return(0,i.jsx)(h.A,{id:"theme.unlistedContent.message",description:"The unlisted content banner message",children:"This page is unlisted. Search engines will not index it, and only users having a direct link can access it."})}function Dt(){return(0,i.jsx)(he.A,{children:(0,i.jsx)("meta",{name:"robots",content:"noindex, nofollow"})})}function Wt(e){let{className:t}=e;return(0,i.jsx)(Lt,{type:"caution",title:(0,i.jsx)(Pt,{}),className:(0,u.A)(t,v.G.common.unlistedBanner),children:(0,i.jsx)(Gt,{})})}function $t(e){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Dt,{}),(0,i.jsx)(Wt,{...e})]})}const Ft={docItemContainer:"docItemContainer_Djhp",docItemCol:"docItemCol_VOVn"};function qt(e){let{children:t}=e;const n=function(){const{frontMatter:e,toc:t}=r(),n=(0,m.l)(),s=e.hide_table_of_contents,a=!s&&t.length>0;return{hidden:s,mobile:a?(0,i.jsx)(oe,{}):void 0,desktop:!a||"desktop"!==n&&"ssr"!==n?void 0:(0,i.jsx)(de,{})}}(),{metadata:{unlisted:s}}=r();return(0,i.jsxs)("div",{className:"row",children:[(0,i.jsxs)("div",{className:(0,u.A)("col",!n.hidden&&Ft.docItemCol),children:[s&&(0,i.jsx)($t,{}),(0,i.jsx)(_,{}),(0,i.jsxs)("div",{className:Ft.docItemContainer,children:[(0,i.jsxs)("article",{children:[(0,i.jsx)(Ot,{}),(0,i.jsx)(B,{}),n.mobile,(0,i.jsx)(Tt,{children:t}),(0,i.jsx)(G,{})]}),(0,i.jsx)(b,{})]})]}),n.desktop&&(0,i.jsx)("div",{className:"col col--3",children:n.desktop})]})}function Zt(e){const t=`docs-doc-id-${e.content.metadata.id}`,n=e.content;return(0,i.jsx)(c,{content:e.content,children:(0,i.jsxs)(a.e3,{className:t,children:[(0,i.jsx)(d,{}),(0,i.jsx)(qt,{children:(0,i.jsx)(n,{})})]})})}},8426:(e,t)=>{function n(e){let t,n=[];for(let s of e.split(",").map((e=>e.trim())))if(/^-?\d+$/.test(s))n.push(parseInt(s,10));else if(t=s.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){let[e,s,a,o]=t;if(s&&o){s=parseInt(s),o=parseInt(o);const e=s<o?1:-1;"-"!==a&&".."!==a&&"\u2025"!==a||(o+=e);for(let t=s;t!==o;t+=e)n.push(t)}}return n}t.default=n,e.exports=n},8453:(e,t,n)=>{"use strict";n.d(t,{R:()=>i,x:()=>l});var s=n(6540);const a={},o=s.createContext(a);function i(e){const t=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),s.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/17896441.6f4c25cb.js b/assets/js/17896441.6f4c25cb.js deleted file mode 100644 index 1ad64f8..0000000 --- a/assets/js/17896441.6f4c25cb.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[918],{3852:function(e,t,a){a.r(t),a.d(t,{default:function(){return V}});var n=a(7294),l=a(6742),r=a(4973);var i=function(e){var t=e.metadata;return n.createElement("nav",{className:"pagination-nav","aria-label":(0,r.I)({id:"theme.docs.paginator.navAriaLabel",message:"Docs pages navigation",description:"The ARIA label for the docs pagination"})},n.createElement("div",{className:"pagination-nav__item"},t.previous&&n.createElement(l.Z,{className:"pagination-nav__link",to:t.previous.permalink},n.createElement("div",{className:"pagination-nav__sublabel"},n.createElement(r.Z,{id:"theme.docs.paginator.previous",description:"The label used to navigate to the previous doc"},"Previous")),n.createElement("div",{className:"pagination-nav__label"},"\xab ",t.previous.title))),n.createElement("div",{className:"pagination-nav__item pagination-nav__item--next"},t.next&&n.createElement(l.Z,{className:"pagination-nav__link",to:t.next.permalink},n.createElement("div",{className:"pagination-nav__sublabel"},n.createElement(r.Z,{id:"theme.docs.paginator.next",description:"The label used to navigate to the next doc"},"Next")),n.createElement("div",{className:"pagination-nav__label"},t.next.title," \xbb"))))},s=a(2263),o=a(907),c=a(9732);function d(e){var t=e.siteTitle,a=e.versionLabel;return n.createElement(r.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:n.createElement("strong",null,a)}},"This is unreleased documentation for {siteTitle} {versionLabel} version.")}function m(e){var t=e.siteTitle,a=e.versionLabel;return n.createElement(r.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:n.createElement("strong",null,a)}},"This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained.")}function u(e){var t=e.versionLabel,a=e.to,i=e.onClick;return n.createElement(r.Z,{id:"theme.docs.versions.latestVersionSuggestionLabel",description:"The label userd to tell the user that he's browsing an unmaintained doc version",values:{versionLabel:t,latestVersionLink:n.createElement("strong",null,n.createElement(l.Z,{to:a,onClick:i},n.createElement(r.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}).")}var v=function(){var e=(0,s.Z)().siteConfig.title,t=(0,o.gA)({failfast:!0}).pluginId,a=(0,c.J)(t).savePreferredVersionName,l=(0,o.zu)(t),r=(0,o.Jo)(t),i=r.latestDocSuggestion,v=r.latestVersionSuggestion;if(!v)return n.createElement(n.Fragment,null);var p,E=null!=i?i:(p=v).docs.find((function(e){return e.id===p.mainDocId}));return n.createElement("div",{className:"alert alert--warning margin-bottom--md",role:"alert"},n.createElement("div",null,"current"===l.name?n.createElement(d,{siteTitle:e,versionLabel:l.label}):n.createElement(m,{siteTitle:e,versionLabel:l.label})),n.createElement("div",{className:"margin-top--md"},n.createElement(u,{versionLabel:v.label,to:E.path,onClick:function(){return a(v.name)}})))},p=a(1217),E="lastUpdatedDate_1WI_";function h(e){var t=e.lastUpdatedAt,a=e.formattedLastUpdatedAt;return n.createElement(r.Z,{id:"theme.lastUpdated.atDate",description:"The words used to describe on which date a page has been last updated",values:{date:n.createElement("time",{dateTime:new Date(1e3*t).toISOString(),className:E},a)}}," on {date}")}function g(e){var t=e.lastUpdatedBy;return n.createElement(r.Z,{id:"theme.lastUpdated.byUser",description:"The words used to describe by who the page has been last updated",values:{user:n.createElement("strong",null,t)}}," by {user}")}function b(e){var t=e.lastUpdatedAt,a=e.formattedLastUpdatedAt,l=e.lastUpdatedBy;return n.createElement("div",{className:"col text--right"},n.createElement("em",null,n.createElement("small",null,n.createElement(r.Z,{id:"theme.lastUpdated.lastUpdatedAtBy",description:"The sentence used to display when a page has been last updated, and by who",values:{atDate:t&&a?n.createElement(h,{lastUpdatedAt:t,formattedLastUpdatedAt:a}):"",byUser:l?n.createElement(g,{lastUpdatedBy:l}):""}},"Last updated{atDate}{byUser}"),!1)))}var f=a(6010);var _=function(e,t,a){var l=(0,n.useState)(void 0),r=l[0],i=l[1];(0,n.useEffect)((function(){function n(){var n=function(){var e=Array.from(document.getElementsByClassName("anchor")),t=e.find((function(e){return e.getBoundingClientRect().top>=a}));if(t){if(t.getBoundingClientRect().top>=a){var n=e[e.indexOf(t)-1];return null!=n?n:t}return t}return e[e.length-1]}();if(n)for(var l=0,s=!1,o=document.getElementsByClassName(e);l<o.length&&!s;){var c=o[l],d=c.href,m=decodeURIComponent(d.substring(d.indexOf("#")+1));n.id===m&&(r&&r.classList.remove(t),c.classList.add(t),i(c),s=!0),l+=1}}return document.addEventListener("scroll",n),document.addEventListener("resize",n),n(),function(){document.removeEventListener("scroll",n),document.removeEventListener("resize",n)}}))},N="tableOfContents_35-E",L="table-of-contents__link";function U(e){var t=e.toc,a=e.isChild;return t.length?n.createElement("ul",{className:a?"":"table-of-contents table-of-contents__left-border"},t.map((function(e){return n.createElement("li",{key:e.id},n.createElement("a",{href:"#"+e.id,className:L,dangerouslySetInnerHTML:{__html:e.value}}),n.createElement(U,{isChild:!0,toc:e.children}))}))):null}var T=function(e){var t=e.toc;return _(L,"table-of-contents__link--active",100),n.createElement("div",{className:(0,f.Z)(N,"thin-scrollbar")},n.createElement(U,{toc:t}))},k=a(7462),y=a(3366),w="iconEdit_2_ui",Z=["className"],A=function(e){var t=e.className,a=(0,y.Z)(e,Z);return n.createElement("svg",(0,k.Z)({fill:"currentColor",height:"1.2em",width:"1.2em",preserveAspectRatio:"xMidYMid meet",role:"img",viewBox:"0 0 40 40",className:(0,f.Z)(w,t),"aria-label":"Edit page"},a),n.createElement("g",null,n.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 C(e){var t=e.editUrl;return n.createElement("a",{href:t,target:"_blank",rel:"noreferrer noopener"},n.createElement(A,null),n.createElement(r.Z,{id:"theme.common.editThisPage",description:"The link label to edit the current page"},"Edit this page"))}var x="docTitle_3a4h",B="docItemContainer_33ec",I="docItemCol_3FnS";var V=function(e){var t,a=e.content,l=a.metadata,r=a.frontMatter,s=r.image,c=r.keywords,d=r.hide_title,m=r.hide_table_of_contents,u=l.description,E=l.title,h=l.editUrl,g=l.lastUpdatedAt,_=l.formattedLastUpdatedAt,N=l.lastUpdatedBy,L=(0,o.gA)({failfast:!0}).pluginId,U=(0,o.gB)(L),k=(0,o.zu)(L),y=U.length>1,w=r.title||E;return n.createElement(n.Fragment,null,n.createElement(p.Z,{title:w,description:u,keywords:c,image:s}),n.createElement("div",{className:"row"},n.createElement("div",{className:(0,f.Z)("col",(t={},t[I]=!m,t))},n.createElement(v,null),n.createElement("div",{className:B},n.createElement("article",null,y&&n.createElement("div",null,n.createElement("span",{className:"badge badge--secondary"},"Version: ",k.label)),!d&&n.createElement("header",null,n.createElement("h1",{className:x},E)),n.createElement("div",{className:"markdown"},n.createElement(a,null))),(h||g||N)&&n.createElement("div",{className:"margin-vert--xl"},n.createElement("div",{className:"row"},n.createElement("div",{className:"col"},h&&n.createElement(C,{editUrl:h})),(g||N)&&n.createElement(b,{lastUpdatedAt:g,formattedLastUpdatedAt:_,lastUpdatedBy:N}))),n.createElement("div",{className:"margin-vert--lg"},n.createElement(i,{metadata:l})))),!m&&a.toc&&n.createElement("div",{className:"col col--3"},n.createElement(T,{toc:a.toc}))))}}}]); \ No newline at end of file diff --git a/assets/js/1be78505.7e34f649.js b/assets/js/1be78505.7e34f649.js deleted file mode 100644 index e53cb38..0000000 --- a/assets/js/1be78505.7e34f649.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[514,608],{3905:function(e,t,n){"use strict";n.d(t,{Zo:function(){return u},kt:function(){return m}});var r=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 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 l(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){a(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 i(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 c=r.createContext({}),s=function(e){var t=r.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},u=function(e){var t=s(e.components);return r.createElement(c.Provider,{value:t},e.children)},d={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,a=e.mdxType,o=e.originalType,c=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),p=s(n),m=a,h=p["".concat(c,".").concat(m)]||p[m]||d[m]||o;return n?r.createElement(h,l(l({ref:t},u),{},{components:n})):r.createElement(h,l({ref:t},u))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,l=new Array(o);l[0]=p;var i={};for(var c in t)hasOwnProperty.call(t,c)&&(i[c]=t[c]);i.originalType=e,i.mdxType="string"==typeof e?e:a,l[1]=i;for(var s=2;s<o;s++)l[s]=n[s];return r.createElement.apply(null,l)}return r.createElement.apply(null,n)}p.displayName="MDXCreateElement"},6484:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return Ie}});var r=n(7294),a=n(3905),o=n(2263),l=n(6291),i=n(9118),c=n(7462),s=n(3366),u=n(6010),d=n(9732),p=n(944),m=n(1839),h=n(3783),f=n(7898),y=n(6742),b=n(3919),g=n(5537),v=function(e){return r.createElement("svg",(0,c.Z)({width:"20",height:"20",role:"img"},e),r.createElement("g",{fill:"#7a7a7a"},r.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"}),r.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"})))},k=n(4478),E=n(4973),C="sidebar_15mo",N="sidebarWithHideableNavbar_267A",_="sidebarHidden_2kNb",Z="sidebarLogo_3h0W",T="menu_Bmed",j="menuLinkText_2aKo",O="menuWithAnnouncementBar_2WvA",x="collapseSidebarButton_1CGd",S="collapseSidebarButtonIcon_3E-R",P="sidebarMenuIcon_fgN0",w="sidebarMenuCloseIcon_1lpH",I="menuLinkExternal_1OhN",L=["items"],B=["item","onItemClick","collapsible","activePath"],A=["item","onItemClick","activePath","collapsible"];var R=function e(t,n){return"link"===t.type?(0,d.Mg)(t.href,n):"category"===t.type&&t.items.some((function(t){return e(t,n)}))},D=(0,r.memo)((function(e){var t=e.items,n=(0,s.Z)(e,L);return t.map((function(e,t){return r.createElement(M,(0,c.Z)({key:t,item:e},n))}))}));function M(e){return"category"===e.item.type?r.createElement(F,e):r.createElement(W,e)}function F(e){var t,n,a,o=e.item,l=e.onItemClick,i=e.collapsible,d=e.activePath,p=(0,s.Z)(e,B),m=o.items,h=o.label,f=R(o,d),y=(n=f,a=(0,r.useRef)(n),(0,r.useEffect)((function(){a.current=n}),[n]),a.current),b=(0,r.useState)((function(){return!!i&&(!f&&o.collapsed)})),g=b[0],v=b[1],k=(0,r.useRef)(null),E=(0,r.useState)(void 0),C=E[0],N=E[1],_=function(e){var t;void 0===e&&(e=!0),N(e?(null==(t=k.current)?void 0:t.scrollHeight)+"px":void 0)};(0,r.useEffect)((function(){f&&!y&&g&&v(!1)}),[f,y,g]);var Z=(0,r.useCallback)((function(e){e.preventDefault(),C||_(),setTimeout((function(){return v((function(e){return!e}))}),100)}),[C]);return 0===m.length?null:r.createElement("li",{className:(0,u.Z)("menu__list-item",{"menu__list-item--collapsed":g})},r.createElement("a",(0,c.Z)({className:(0,u.Z)("menu__link",(t={"menu__link--sublist":i,"menu__link--active":i&&f},t[j]=!i,t)),onClick:i?Z:void 0,href:i?"#!":void 0},p),h),r.createElement("ul",{className:"menu__list",ref:k,style:{height:C},onTransitionEnd:function(){g||_(!1)}},r.createElement(D,{items:m,tabIndex:g?"-1":"0",onItemClick:l,collapsible:i,activePath:d})))}function W(e){var t,n=e.item,a=e.onItemClick,o=e.activePath,l=(e.collapsible,(0,s.Z)(e,A)),i=n.href,d=n.label,p=R(n,o);return r.createElement("li",{className:"menu__list-item",key:d},r.createElement(y.Z,(0,c.Z)({className:(0,u.Z)("menu__link",(t={"menu__link--active":p},t[I]=!(0,b.Z)(i),t)),to:i},(0,b.Z)(i)&&{isNavLink:!0,exact:!0,onClick:a},l),d))}function H(e){var t=e.onClick;return r.createElement("button",{type:"button",title:(0,E.I)({id:"theme.docs.sidebar.collapseButtonTitle",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),"aria-label":(0,E.I)({id:"theme.docs.sidebar.collapseButtonAriaLabel",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),className:(0,u.Z)("button button--secondary button--outline",x),onClick:t},r.createElement(v,{className:S}))}function z(e){var t=e.responsiveSidebarOpened,n=e.onClick;return r.createElement("button",{"aria-label":t?(0,E.I)({id:"theme.docs.sidebar.responsiveCloseButtonLabel",message:"Close menu",description:"The ARIA label for close button of mobile doc sidebar"}):(0,E.I)({id:"theme.docs.sidebar.responsiveOpenButtonLabel",message:"Open menu",description:"The ARIA label for open button of mobile doc sidebar"}),"aria-haspopup":"true",className:"button button--secondary button--sm menu__button",type:"button",onClick:n},t?r.createElement("span",{className:(0,u.Z)(P,w)},"\xd7"):r.createElement(k.Z,{className:P,height:24,width:24}))}var U=function(e){var t,n,a=e.path,o=e.sidebar,l=e.sidebarCollapsible,i=void 0===l||l,c=e.onCollapse,s=e.isHidden,y=function(){var e=(0,p.Z)().isAnnouncementBarClosed,t=(0,r.useState)(!e),n=t[0],a=t[1];return(0,f.Z)((function(t){var n=t.scrollY;e||a(0===n)})),n}(),b=(0,d.LU)(),v=b.navbar.hideOnScroll,k=b.hideableSidebar,E=(0,p.Z)().isAnnouncementBarClosed,j=function(){var e=(0,r.useState)(!1),t=e[0],n=e[1];(0,m.Z)(t);var a=(0,h.Z)();return(0,r.useEffect)((function(){a===h.D.desktop&&n(!1)}),[a]),{showResponsiveSidebar:t,closeResponsiveSidebar:(0,r.useCallback)((function(e){e.target.blur(),n(!1)}),[n]),toggleResponsiveSidebar:(0,r.useCallback)((function(){n((function(e){return!e}))}),[n])}}(),x=j.showResponsiveSidebar,S=j.closeResponsiveSidebar,P=j.toggleResponsiveSidebar;return r.createElement("div",{className:(0,u.Z)(C,(t={},t[N]=v,t[_]=s,t))},v&&r.createElement(g.Z,{tabIndex:-1,className:Z}),r.createElement("div",{className:(0,u.Z)("menu","menu--responsive","thin-scrollbar",T,(n={"menu--show":x},n[O]=!E&&y,n))},r.createElement(z,{responsiveSidebarOpened:x,onClick:P}),r.createElement("ul",{className:"menu__list"},r.createElement(D,{items:o,onItemClick:S,collapsible:i,activePath:a}))),k&&r.createElement(H,{onClick:c}))},$={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","at-rule","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"}}]},K={Prism:n(7410).Z,theme:$};function J(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}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)}var Y=/\r\n|\r|\n/,G=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)},X=function(e,t){var n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},q=function(e,t){var n=e.plain,r=Object.create(null),a=e.styles.reduce((function(e,n){var r=n.languages,a=n.style;return r&&!r.includes(t)||n.types.forEach((function(t){var n=V({},e[t],a);e[t]=n})),e}),r);return a.root=n,a.plain=V({},n,{backgroundColor:null}),a};function Q(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&-1===t.indexOf(r)&&(n[r]=e[r]);return n}var ee=function(e){function t(){for(var t=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];e.apply(this,n),J(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?q(e.theme,e.language):void 0;return t.themeDict=n})),J(this,"getLineProps",(function(e){var n=e.key,r=e.className,a=e.style,o=V({},Q(e,["key","className","style","line"]),{className:"token-line",style:void 0,key:void 0}),l=t.getThemeDict(t.props);return void 0!==l&&(o.style=l.plain),void 0!==a&&(o.style=void 0!==o.style?V({},o.style,a):a),void 0!==n&&(o.key=n),r&&(o.className+=" "+r),o})),J(this,"getStyleForToken",(function(e){var n=e.types,r=e.empty,a=n.length,o=t.getThemeDict(t.props);if(void 0!==o){if(1===a&&"plain"===n[0])return r?{display:"inline-block"}:void 0;if(1===a&&!r)return o[n[0]];var l=r?{display:"inline-block"}:{},i=n.map((function(e){return o[e]}));return Object.assign.apply(Object,[l].concat(i))}})),J(this,"getTokenProps",(function(e){var n=e.key,r=e.className,a=e.style,o=e.token,l=V({},Q(e,["key","className","style","token"]),{className:"token "+o.types.join(" "),children:o.content,style:t.getStyleForToken(o),key:void 0});return void 0!==a&&(l.style=void 0!==l.style?V({},l.style,a):a),void 0!==n&&(l.key=n),r&&(l.className+=" "+r),l})),J(this,"tokenize",(function(e,t,n,r){var a={code:t,grammar:n,language:r,tokens:[]};e.hooks.run("before-tokenize",a);var o=a.tokens=e.tokenize(a.code,a.grammar,a.language);return e.hooks.run("after-tokenize",a),o}))}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,r=e.code,a=e.children,o=this.getThemeDict(this.props),l=t.languages[n];return a({tokens:function(e){for(var t=[[]],n=[e],r=[0],a=[e.length],o=0,l=0,i=[],c=[i];l>-1;){for(;(o=r[l]++)<a[l];){var s=void 0,u=t[l],d=n[l][o];if("string"==typeof d?(u=l>0?u:["plain"],s=d):(u=X(u,d.type),d.alias&&(u=X(u,d.alias)),s=d.content),"string"==typeof s){var p=s.split(Y),m=p.length;i.push({types:u,content:p[0]});for(var h=1;h<m;h++)G(i),c.push(i=[]),i.push({types:u,content:p[h]})}else l++,t.push(u),n.push(s),r.push(0),a.push(s.length)}l--,t.pop(),n.pop(),r.pop(),a.pop()}return G(i),c}(void 0!==l?this.tokenize(t,r,l,n):[r]),className:"prism-code language-"+n,style:void 0!==o?o.root:{},getLineProps:this.getLineProps,getTokenProps:this.getTokenProps})},t}(r.Component),te=ee;var ne=n(7594),re=n.n(ne),ae={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},oe=n(5350),le=function(){var e=(0,d.LU)().prism,t=(0,oe.Z)().isDarkTheme,n=e.theme||ae,r=e.darkTheme||n;return t?r:n},ie="codeBlockContainer_K1bP",ce="codeBlockContent_hGly",se="codeBlockTitle_eoMF",ue="codeBlock_23N8",de="codeBlockWithTitle_2JqI",pe="copyButton_Ue-o",me="codeBlockLines_39YC",he=/{([\d,-]+)}/,fe=function(e){void 0===e&&(e=["js","jsBlock","jsx","python","html"]);var t={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},python:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},n=["highlight-next-line","highlight-start","highlight-end"].join("|"),r=e.map((function(e){return"(?:"+t[e].start+"\\s*("+n+")\\s*"+t[e].end+")"})).join("|");return new RegExp("^\\s*(?:"+r+")\\s*$")};function ye(e){var t=e.children,n=e.className,a=e.metastring,o=e.title,l=(0,d.LU)().prism,i=(0,r.useState)(!1),s=i[0],p=i[1],m=(0,r.useState)(!1),h=m[0],f=m[1];(0,r.useEffect)((function(){f(!0)}),[]);var y=(0,d.bc)(a)||o,b=(0,r.useRef)(null),g=[],v=le(),k=Array.isArray(t)?t.join(""):t;if(a&&he.test(a)){var C=a.match(he)[1];g=re()(C).filter((function(e){return e>0}))}var N=n&&n.replace(/language-/,"");!N&&l.defaultLanguage&&(N=l.defaultLanguage);var _=k.replace(/\n$/,"");if(0===g.length&&void 0!==N){for(var Z,T="",j=function(e){switch(e){case"js":case"javascript":case"ts":case"typescript":return fe(["js","jsBlock"]);case"jsx":case"tsx":return fe(["js","jsBlock","jsx"]);case"html":return fe(["js","jsBlock","html"]);case"python":case"py":return fe(["python"]);default:return fe()}}(N),O=k.replace(/\n$/,"").split("\n"),x=0;x<O.length;){var S=x+1,P=O[x].match(j);if(null!==P){switch(P.slice(1).reduce((function(e,t){return e||t}),void 0)){case"highlight-next-line":T+=S+",";break;case"highlight-start":Z=S;break;case"highlight-end":T+=Z+"-"+(S-1)+","}O.splice(x,1)}else x+=1}g=re()(T),_=O.join("\n")}var w=function(){!function(e,t){var n=(void 0===t?{}:t).target,r=void 0===n?document.body:n,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";var l=document.getSelection(),i=!1;l.rangeCount>0&&(i=l.getRangeAt(0)),r.append(a),a.select(),a.selectionStart=0,a.selectionEnd=e.length;var c=!1;try{c=document.execCommand("copy")}catch(s){}a.remove(),i&&(l.removeAllRanges(),l.addRange(i)),o&&o.focus()}(_),p(!0),setTimeout((function(){return p(!1)}),2e3)};return r.createElement(te,(0,c.Z)({},K,{key:String(h),theme:v,code:_,language:N}),(function(e){var t,n=e.className,a=e.style,o=e.tokens,l=e.getLineProps,i=e.getTokenProps;return r.createElement("div",{className:ie},y&&r.createElement("div",{style:a,className:se},y),r.createElement("div",{className:(0,u.Z)(ce,N)},r.createElement("div",{tabIndex:0,className:(0,u.Z)(n,ue,"thin-scrollbar",(t={},t[de]=y,t))},r.createElement("div",{className:me,style:a},o.map((function(e,t){1===e.length&&""===e[0].content&&(e[0].content="\n");var n=l({line:e,key:t});return g.includes(t+1)&&(n.className=n.className+" docusaurus-highlight-code-line"),r.createElement("div",(0,c.Z)({key:t},n),e.map((function(e,t){return r.createElement("span",(0,c.Z)({key:t},i({token:e,key:t})))})))})))),r.createElement("button",{ref:b,type:"button","aria-label":(0,E.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),className:(0,u.Z)(pe),onClick:w},s?r.createElement(E.Z,{id:"theme.CodeBlock.copied",description:"The copied button label on code blocks"},"Copied"):r.createElement(E.Z,{id:"theme.CodeBlock.copy",description:"The copy button label on code blocks"},"Copy"))))}))}var be="enhancedAnchor_2LWZ",ge=["id"],ve=function(e){return function(t){var n,a=t.id,o=(0,s.Z)(t,ge),l=(0,d.LU)().navbar.hideOnScroll;return a?r.createElement(e,o,r.createElement("a",{"aria-hidden":"true",tabIndex:-1,className:(0,u.Z)("anchor",(n={},n[be]=!l,n)),id:a}),o.children,r.createElement("a",{className:"hash-link",href:"#"+a,title:(0,E.I)({id:"theme.common.headingLinkTitle",message:"Direct link to heading",description:"Title for link to heading"})},"#")):r.createElement(e,o)}},ke={code:function(e){var t=e.children;return(0,r.isValidElement)(t)?t:t.includes("\n")?r.createElement(ye,e):r.createElement("code",e)},a:function(e){return r.createElement(y.Z,e)},pre:function(e){var t,n=e.children;return(0,r.isValidElement)(null==n||null==(t=n.props)?void 0:t.children)?null==n?void 0:n.props.children:r.createElement(ye,(0,r.isValidElement)(n)?null==n?void 0:n.props:{children:n})},h1:ve("h1"),h2:ve("h2"),h3:ve("h3"),h4:ve("h4"),h5:ve("h5"),h6:ve("h6")},Ee=n(4608),Ce=n(5977),Ne="docPage_31aa",_e="docMainContainer_3ufF",Ze="docMainContainerEnhanced_3NYZ",Te="docSidebarContainer_3Kbt",je="docSidebarContainerHidden_3pA8",Oe="collapsedDocSidebar_2JMH",xe="expandSidebarButtonIcon_1naQ",Se="docItemWrapperEnhanced_2vyJ",Pe="docItemWrapper_3FMP";function we(e){var t,n,l,c,s,p=e.currentDocRoute,m=e.versionMetadata,h=e.children,f=(0,o.Z)(),y=f.siteConfig,b=f.isClient,g=m.pluginId,k=m.permalinkToSidebar,C=m.docsSidebars,N=m.version,_=k[p.path],Z=C[_],T=(0,r.useState)(!1),j=T[0],O=T[1],x=(0,r.useState)(!1),S=x[0],P=x[1],w=(0,r.useCallback)((function(){S&&P(!1),O(!j)}),[S]);return r.createElement(i.Z,{key:b,wrapperClassName:d.kM.wrapper.docPages,pageClassName:d.kM.page.docPage,searchMetadatas:{version:N,tag:(0,d.os)(g,N)}},r.createElement("div",{className:Ne},Z&&r.createElement("div",{className:(0,u.Z)(Te,(t={},t[je]=j,t)),onTransitionEnd:function(e){e.currentTarget.classList.contains(Te)&&j&&P(!0)},role:"complementary"},r.createElement(U,{key:_,sidebar:Z,path:p.path,sidebarCollapsible:null==(n=null==(l=y.themeConfig)?void 0:l.sidebarCollapsible)||n,onCollapse:w,isHidden:S}),S&&r.createElement("div",{className:Oe,title:(0,E.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,E.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:w,onClick:w},r.createElement(v,{className:xe}))),r.createElement("main",{className:(0,u.Z)(_e,(c={},c[Ze]=j||!Z,c))},r.createElement("div",{className:(0,u.Z)("container padding-vert--lg",Pe,(s={},s[Se]=j,s))},r.createElement(a.Zo,{components:ke},h)))))}var Ie=function(e){var t=e.route.routes,n=e.versionMetadata,a=e.location,o=t.find((function(e){return(0,Ce.LX)(a.pathname,e)}));return o?r.createElement(we,{currentDocRoute:o,versionMetadata:n},(0,l.Z)(t)):r.createElement(Ee.default,e)}},4608:function(e,t,n){"use strict";n.r(t);var r=n(7294),a=n(9118),o=n(4973);t.default=function(){return r.createElement(a.Z,{title:"Page Not Found"},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(o.Z,{id:"theme.NotFound.title",description:"The title of the 404 page"},"Page Not Found")),r.createElement("p",null,r.createElement(o.Z,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page"},"We could not find what you were looking for.")),r.createElement("p",null,r.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."))))))}},7594:function(e,t){function n(e){let t,n=[];for(let r of e.split(",").map((e=>e.trim())))if(/^-?\d+$/.test(r))n.push(parseInt(r,10));else if(t=r.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){let[e,r,a,o]=t;if(r&&o){r=parseInt(r),o=parseInt(o);const e=r<o?1:-1;"-"!==a&&".."!==a&&"\u2025"!==a||(o+=e);for(let t=r;t!==o;t+=e)n.push(t)}}return n}t.default=n,e.exports=n}}]); \ No newline at end of file diff --git a/assets/js/237.8f78abee.js b/assets/js/237.8f78abee.js new file mode 100644 index 0000000..9bf7470 --- /dev/null +++ b/assets/js/237.8f78abee.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[237],{3363:(e,t,n)=>{n.d(t,{A:()=>a});n(6540);var i=n(8215),o=n(1312),s=n(1107),r=n(4848);function a(e){let{className:t}=e;return(0,r.jsx)("main",{className:(0,i.A)("container margin-vert--xl",t),children:(0,r.jsx)("div",{className:"row",children:(0,r.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,r.jsx)(s.A,{as:"h1",className:"hero__title",children:(0,r.jsx)(o.A,{id:"theme.NotFound.title",description:"The title of the 404 page",children:"Page Not Found"})}),(0,r.jsx)("p",{children:(0,r.jsx)(o.A,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page",children:"We could not find what you were looking for."})}),(0,r.jsx)("p",{children:(0,r.jsx)(o.A,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page",children:"Please contact the owner of the site that linked you to the original URL and let them know their link is broken."})})]})})})}},2237:(e,t,n)=>{n.r(t),n.d(t,{default:()=>d});n(6540);var i=n(1312),o=n(1003),s=n(781),r=n(3363),a=n(4848);function d(){const e=(0,i.T)({id:"theme.NotFound.title",message:"Page Not Found"});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.be,{title:e}),(0,a.jsx)(s.A,{children:(0,a.jsx)(r.A,{})})]})}}}]); \ No newline at end of file diff --git a/assets/js/2463bfee.8defd41d.js b/assets/js/2463bfee.8defd41d.js new file mode 100644 index 0000000..eda8fa4 --- /dev/null +++ b/assets/js/2463bfee.8defd41d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[510],{533:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>c,contentTitle:()=>r,default:()=>m,frontMatter:()=>a,metadata:()=>s,toc:()=>d});var i=t(4848),o=t(8453);const a={title:"Creating commands"},r=void 0,s={id:"interaction-library/creating-commands",title:"Creating commands",description:"Commands represent the main form of interaction that Discord bots have with users. Creating commands is a simple and",source:"@site/docs/interaction-library/creating-commands.mdx",sourceDirName:"interaction-library",slug:"/interaction-library/creating-commands",permalink:"/docs/interaction-library/creating-commands",draft:!1,unlisted:!1,editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/interaction-library/creating-commands.mdx",tags:[],version:"current",frontMatter:{title:"Creating commands"},sidebar:"someSidebar",previous:{title:"Configuration",permalink:"/docs/interaction-library/configuration"},next:{title:"Acknowledging interactions",permalink:"/docs/interaction-library/acknowledging-interactions"}},c={},d=[{value:"Chat input (aka "slash") commands",id:"chat-input-aka-slash-commands",level:2},{value:"Basic command",id:"basic-command",level:3},{value:"Command options",id:"command-options",level:3},{value:"Subcommands and subcommand groups",id:"subcommands-and-subcommand-groups",level:3},{value:"Context menu commands",id:"context-menu-commands",level:2},{value:"Commands as a service",id:"commands-as-a-service",level:2}];function l(n){const e={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,o.R)(),...n.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.p,{children:"Commands represent the main form of interaction that Discord bots have with users. Creating commands is a simple and\nstraightforward process, with the ability to customize different aspects of them."}),"\n",(0,i.jsx)(e.h2,{id:"chat-input-aka-slash-commands",children:'Chat input (aka "slash") commands'}),"\n",(0,i.jsx)(e.h3,{id:"basic-command",children:"Basic command"}),"\n",(0,i.jsxs)(e.p,{children:["A slash command is a command that is triggered when the user sends ",(0,i.jsx)(e.code,{children:"/command-name"}),' in chat. In the library, they are\ncalled "chat input commands".']}),"\n",(0,i.jsxs)(e.p,{children:["Here is an example of a ",(0,i.jsx)(e.code,{children:"/ping"}),' command that makes the bot reply with "Pong!":']}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-java",children:'package testbot1;\n\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport org.reactivestreams.Publisher;\n\n@ChatInputCommand(name = "ping", description = "Pings the bot to check if it is alive.")\npublic final class PingCommand implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return ctx.event().createFollowup("Pong!");\n }\n}\n'})}),"\n",(0,i.jsxs)(e.ul,{children:["\n",(0,i.jsxs)(e.li,{children:["A chat input command must have a ",(0,i.jsx)(e.code,{children:"@ChatInputCommand"})," annotation that contains the meta-information required by\nDiscord (name of the command, description, defaultPermission, etc), and must implement\nthe ",(0,i.jsx)(e.code,{children:"ChatInputInteractionListener"})," interface."]}),"\n",(0,i.jsxs)(e.li,{children:["The ",(0,i.jsx)(e.code,{children:"run"})," method accepts a ",(0,i.jsx)(e.code,{children:"ChatInputInteractionContext"})," that holds contextual information on the command being\nexecuted, such as the original ",(0,i.jsx)(e.code,{children:"ChatInputInteractionEvent"}),", the ",(0,i.jsx)(e.code,{children:"MessageChannel"})," where the interaction happened,\nthe ",(0,i.jsx)(e.code,{children:"User"})," who initiated the interaction, and a ",(0,i.jsx)(e.code,{children:"Locale"})," that may have been adapted to the target user (\nsee ",(0,i.jsx)(e.a,{href:"/docs/interaction-library/filtering-and-adapting-events",children:"Filtering and adapting events"}),")."]}),"\n",(0,i.jsxs)(e.li,{children:["Events are automatically acknowledged by default, so you can directly call ",(0,i.jsx)(e.code,{children:"createFollowup()"})," without\nusing ",(0,i.jsx)(e.code,{children:"deferReply()"})," first (",(0,i.jsx)(e.code,{children:"reply()"})," will not work unless you disable automatic acknowledgment,\nsee ",(0,i.jsx)(e.a,{href:"/docs/interaction-library/acknowledging-interactions",children:"Acknowledging Interactions"}),")"]}),"\n"]}),"\n",(0,i.jsxs)(e.admonition,{type:"info",children:[(0,i.jsxs)(e.p,{children:["If you are using the Botrino framework, you have nothing else to do, the command will be automatically recognized and\nregistered. Otherwise, you need to manually register it into the ",(0,i.jsx)(e.code,{children:"InteractionService"})," like this:"]}),(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-java",children:"interactionService.registerChatInputCommand(new PingCommand());\n"})})]}),"\n",(0,i.jsx)(e.h3,{id:"command-options",children:"Command options"}),"\n",(0,i.jsxs)(e.p,{children:["A command may accept one or many options, whether they are required or optional. The library\nprovides ",(0,i.jsx)(e.code,{children:"ChatInputCommandGrammar"})," that allows to inject the option values into a record class that is going to\nbe instantiated when the command is executed. Here is an example of a command using options:"]}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-java",children:'package testbot1;\n\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport botrino.interaction.grammar.ChatInputCommandGrammar;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport discord4j.core.object.command.ApplicationCommandOption;\nimport discord4j.discordjson.json.ApplicationCommandOptionData;\nimport org.reactivestreams.Publisher;\n\nimport java.util.List;\n\n@ChatInputCommand(name = "options", description = "Option testing")\npublic class OptionsCommand implements ChatInputInteractionListener {\n\n private final ChatInputCommandGrammar<Options> grammar = ChatInputCommandGrammar.of(Options.class);\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return grammar.resolve(ctx.event()).flatMap(options -> ctx.event()\n .createFollowup("Value of `my-string`: " + options.myString));\n }\n\n @Override\n public List<ApplicationCommandOptionData> options() {\n return grammar.toOptions();\n }\n\n private record Options(\n @ChatInputCommandGrammar.Option(\n type = ApplicationCommandOption.Type.STRING,\n name = "my-string",\n description = "The string argument",\n required = true,\n choices = {\n @ChatInputCommandGrammar.Choice(name = "Choice 1", stringValue = "1"),\n @ChatInputCommandGrammar.Choice(name = "Choice 2", stringValue = "2"),\n @ChatInputCommandGrammar.Choice(name = "Choice 3", stringValue = "3")\n }\n )\n String myString) {}\n}\n'})}),"\n",(0,i.jsxs)(e.ol,{children:["\n",(0,i.jsx)(e.li,{children:"Create a record class that declares the fields in which you want to inject the option values. It is recommended to\nuse\nan internal private record for better code readability, unless you are re-using the same record for several commands."}),"\n",(0,i.jsxs)(e.li,{children:["Use the annotation ",(0,i.jsx)(e.code,{children:"@ChatInputCommandGrammar.Option"})," on each record parameter to declare the properties of the\noption (the type,\nthe name, the description, whether they are required or not, and the array of value choices, if any)."]}),"\n",(0,i.jsxs)(e.li,{children:["Create a new ",(0,i.jsx)(e.code,{children:"ChatInputCommandGrammar"})," and pass the class to the ",(0,i.jsx)(e.code,{children:".of()"})," method. You only need to instantiate once,\nrather than on each command execution."]}),"\n",(0,i.jsxs)(e.li,{children:["In the ",(0,i.jsx)(e.code,{children:"run(ChatInputInteractionContext)"})," method, call the ",(0,i.jsx)(e.code,{children:"resolve(ChatInputInteractionEvent)"})," method which will\nread the options, instantiate the record and inject the values in the annotated fields. You can then use the record\nobject to conveniently access the values, as shown in the example above."]}),"\n",(0,i.jsxs)(e.li,{children:["Override the ",(0,i.jsx)(e.code,{children:"options()"})," method from ",(0,i.jsx)(e.code,{children:"ChatInputInteractionListener"})," and make it\nreturn ",(0,i.jsx)(e.code,{children:"ChatInputCommandGrammar#toOptions()"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(e.p,{children:["For reference, here is a table associating each ",(0,i.jsx)(e.code,{children:"ApplicationCommandOption.Type"})," with the type of the field carrying the\nannotation:"]}),"\n",(0,i.jsxs)(e.table,{children:[(0,i.jsx)(e.thead,{children:(0,i.jsxs)(e.tr,{children:[(0,i.jsx)(e.th,{children:"Option type"}),(0,i.jsx)(e.th,{children:"Type of annotated field"})]})}),(0,i.jsxs)(e.tbody,{children:[(0,i.jsxs)(e.tr,{children:[(0,i.jsx)(e.td,{children:(0,i.jsx)(e.code,{children:"STRING"})}),(0,i.jsx)(e.td,{children:(0,i.jsx)(e.code,{children:"java.lang.String"})})]}),(0,i.jsxs)(e.tr,{children:[(0,i.jsx)(e.td,{children:(0,i.jsx)(e.code,{children:"INTEGER"})}),(0,i.jsxs)(e.td,{children:[(0,i.jsx)(e.code,{children:"java.lang.Long"})," (primitive ",(0,i.jsx)(e.code,{children:"long"})," may be used only if ",(0,i.jsx)(e.code,{children:"required = true"}),")"]})]}),(0,i.jsxs)(e.tr,{children:[(0,i.jsx)(e.td,{children:(0,i.jsx)(e.code,{children:"NUMBER"})}),(0,i.jsxs)(e.td,{children:[(0,i.jsx)(e.code,{children:"java.lang.Double"})," (primitive ",(0,i.jsx)(e.code,{children:"double"})," may be used only if ",(0,i.jsx)(e.code,{children:"required = true"}),")"]})]}),(0,i.jsxs)(e.tr,{children:[(0,i.jsx)(e.td,{children:(0,i.jsx)(e.code,{children:"BOOLEAN"})}),(0,i.jsxs)(e.td,{children:[(0,i.jsx)(e.code,{children:"java.lang.Boolean"})," (primitive ",(0,i.jsx)(e.code,{children:"boolean"})," may be used only if ",(0,i.jsx)(e.code,{children:"required = true"}),")"]})]}),(0,i.jsxs)(e.tr,{children:[(0,i.jsx)(e.td,{children:(0,i.jsx)(e.code,{children:"USER"})}),(0,i.jsxs)(e.td,{children:[(0,i.jsx)(e.code,{children:"discord4j.core.object.entity.User"})," (or ",(0,i.jsx)(e.code,{children:"discord4j.core.object.entity.Member"})," if in a guild)"]})]}),(0,i.jsxs)(e.tr,{children:[(0,i.jsx)(e.td,{children:(0,i.jsx)(e.code,{children:"CHANNEL"})}),(0,i.jsx)(e.td,{children:(0,i.jsx)(e.code,{children:"discord4j.core.object.entity.channel.Channel"})})]}),(0,i.jsxs)(e.tr,{children:[(0,i.jsx)(e.td,{children:(0,i.jsx)(e.code,{children:"ROLE"})}),(0,i.jsx)(e.td,{children:(0,i.jsx)(e.code,{children:"discord4j.core.object.entity.Role"})})]}),(0,i.jsxs)(e.tr,{children:[(0,i.jsx)(e.td,{children:(0,i.jsx)(e.code,{children:"MENTIONABLE"})}),(0,i.jsx)(e.td,{children:(0,i.jsx)(e.code,{children:"discord4j.common.util.Snowflake"})})]}),(0,i.jsxs)(e.tr,{children:[(0,i.jsx)(e.td,{children:(0,i.jsx)(e.code,{children:"ATTACHMENT"})}),(0,i.jsx)(e.td,{children:(0,i.jsx)(e.code,{children:"discord4j.core.object.entity.Attachment"})})]})]})]}),"\n",(0,i.jsx)(e.admonition,{type:"caution",children:(0,i.jsxs)(e.p,{children:["Optional options will be filled with ",(0,i.jsx)(e.code,{children:"null"})," if not specified by the user, which means you cannot use primitive types\nfor ",(0,i.jsx)(e.code,{children:"INTEGER"}),", ",(0,i.jsx)(e.code,{children:"NUMBER"})," and ",(0,i.jsx)(e.code,{children:"BOOLEAN"})," if ",(0,i.jsx)(e.code,{children:"required = false"}),", otherwise you will get ",(0,i.jsx)(e.code,{children:"NullPointerException"}),"s."]})}),"\n",(0,i.jsx)(e.admonition,{type:"info",children:(0,i.jsxs)(e.p,{children:["For legacy purposes, you can use a normal class instead of a record. In that case, the class must have a no-arg\nconstructor, and the ",(0,i.jsx)(e.code,{children:"@ChatInputCommandGrammar.Option"})," annotations should be on fields declared in the class. Using\nrecords is preferred as it allows for immutability."]})}),"\n",(0,i.jsx)(e.h3,{id:"subcommands-and-subcommand-groups",children:"Subcommands and subcommand groups"}),"\n",(0,i.jsx)(e.p,{children:"Discord allows to create subcommands and subcommand groups to help in organizing the logic of a complex command. Here is\nan example of a command using subcommands and subcommand groups:"}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-java",children:'\n@ChatInputCommand(\n name = "nest",\n description = "Subcommand testing",\n subcommands = {\n @Subcommand(name = "sub1", description = "Subcommand 1", listener = NestCommand.Sub1.class),\n @Subcommand(name = "sub2", description = "Subcommand 2", listener = NestCommand.Sub2.class)\n },\n subcommandGroups = {\n @SubcommandGroup(name = "group1", description = "Group 1", subcommands = {\n @Subcommand(name = "sub", description = "Subcommand", listener = NestCommand.G1Sub.class)\n })\n }\n)\npublic final class NestCommand {\n\n public static final class Sub1 implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return ctx.event().createFollowup("sub1: pong!");\n }\n }\n\n public static final class Sub2 implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return ctx.event().createFollowup("sub2: pong!");\n }\n }\n\n public static final class G1Sub implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return ctx.event().createFollowup("group1 sub: pong!");\n }\n }\n}\n'})}),"\n",(0,i.jsx)(e.p,{children:"Here are the notable differences:"}),"\n",(0,i.jsxs)(e.ul,{children:["\n",(0,i.jsxs)(e.li,{children:["The class carrying the ",(0,i.jsx)(e.code,{children:"@ChatInputCommand"})," annotation no longer implements ",(0,i.jsx)(e.code,{children:"ChatInputInteractionListener"}),". Indeed, as\nper Discord's documentation a base command becomes unusable if subcommands are present."]}),"\n",(0,i.jsxs)(e.li,{children:["The ",(0,i.jsx)(e.code,{children:"@ChatInputCommand"})," specifies an array of ",(0,i.jsx)(e.code,{children:"@Subcommand"})," and ",(0,i.jsx)(e.code,{children:"@SubcommandGroup"})," with their own name and\ndescription."]}),"\n",(0,i.jsxs)(e.li,{children:["Subcommands specify the class implementing ",(0,i.jsx)(e.code,{children:"ChatInputInteractionListener"})," that is going to handle them. In this\nexample they are internal classes, but they can as well be external."]}),"\n"]}),"\n",(0,i.jsxs)(e.admonition,{type:"info",children:[(0,i.jsxs)(e.p,{children:["Here is how you manually register a command containing subcommands when you control the instance\nof ",(0,i.jsx)(e.code,{children:"InteractionService"}),":"]}),(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-java",children:"interactionService.registerChatInputCommand(new NestCommand(),List.\n\nof(\n new NestCommand.Sub1(),\n new NestCommand.\n\nSub2(),\n new NestCommand.\n\nG1Sub()\n));\n"})})]}),"\n",(0,i.jsx)(e.admonition,{type:"caution",children:(0,i.jsxs)(e.p,{children:["If you are using the Botrino framework, the subcommand classes must either have a public no-arg constructor or be\ndeclared as a service. If the classes are internal, they must be ",(0,i.jsx)(e.code,{children:"static"}),"."]})}),"\n",(0,i.jsx)(e.h2,{id:"context-menu-commands",children:"Context menu commands"}),"\n",(0,i.jsxs)(e.p,{children:["Discord currently support two types of context menu commands, one on messages and one on users. It works the same as\nchat input commands, but you need to use the ",(0,i.jsx)(e.code,{children:"@MessageCommand"})," and ",(0,i.jsx)(e.code,{children:"@UserCommand"})," annotations with\nthe ",(0,i.jsx)(e.code,{children:"MessageInteractionListener"})," and ",(0,i.jsx)(e.code,{children:"UserInteractionListener"})," interfaces, respectively."]}),"\n",(0,i.jsx)(e.p,{children:"Context menu commands are actually less complex than chat input ones, since there is no description, no options, no\nsubcommands... Only a name and a run method:"}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-java",children:'package testbot1;\n\nimport botrino.interaction.annotation.UserCommand;\nimport botrino.interaction.context.UserInteractionContext;\nimport botrino.interaction.listener.UserInteractionListener;\nimport org.reactivestreams.Publisher;\n\n@UserCommand("Fight")\npublic final class FightCommand implements UserInteractionListener {\n\n @Override\n public Publisher<?> run(UserInteractionContext ctx) {\n return ctx.event().createFollowup("You are fighting <@" +\n ctx.event().getTargetId().asString() + ">");\n }\n}\n'})}),"\n",(0,i.jsxs)(e.admonition,{type:"info",children:[(0,i.jsxs)(e.p,{children:["If you need to do manual registration, it happens\nvia ",(0,i.jsx)(e.code,{children:"InteractionService#registerMessageCommand(MessageInteractionListener)"}),"\nand ",(0,i.jsx)(e.code,{children:"InteractionService#registerUserCommand(MessageInteractionListener)"}),":"]}),(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-java",children:"interactionService.registerUserCommand(new FightCommand());\n"})})]}),"\n",(0,i.jsx)(e.h2,{id:"commands-as-a-service",children:"Commands as a service"}),"\n",(0,i.jsx)(e.admonition,{type:"info",children:(0,i.jsxs)(e.p,{children:["The following is only applicable if you are using the Botrino framework.\nSee ",(0,i.jsx)(e.a,{href:"/docs/api/working-with-services",children:"Working with services"}),"."]})}),"\n",(0,i.jsxs)(e.p,{children:["Classes implementing commands can themselves be declared as services without any issues. For example if you need to\naccess the ",(0,i.jsx)(e.code,{children:"ConfigContainer"})," in your command, you can do this:"]}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-java",children:'package testbot1;\n\nimport botrino.api.config.ConfigContainer;\nimport botrino.api.config.object.BotConfig;\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport com.github.alex1304.rdi.finder.annotation.RdiFactory;\nimport com.github.alex1304.rdi.finder.annotation.RdiService;\nimport discord4j.gateway.intent.IntentSet;\nimport org.reactivestreams.Publisher;\n\n@RdiService\n@ChatInputCommand(name = "intents", description = "Displays the intents enabled for this bot.")\npublic final class IntentsCommand implements ChatInputInteractionListener {\n\n private final long intents;\n\n @RdiFactory\n public IntentsCommand(ConfigContainer configContainer) {\n this.intents = configContainer.get(BotConfig.class)\n .enabledIntents()\n .orElse(IntentSet.nonPrivileged().getRawValue());\n }\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return ctx.event().createFollowup("Intents enabled: " + intents);\n }\n}\n'})}),"\n",(0,i.jsxs)(e.p,{children:["The command above accesses the values in the ",(0,i.jsx)(e.code,{children:"config.json"})," to get the gateway intents enabled for the bot. You can\nnotice the use of ",(0,i.jsx)(e.code,{children:"@RdiService"})," on top of ",(0,i.jsx)(e.code,{children:"@ChatInputCommand"}),", this works totally fine! Don't forget the ",(0,i.jsx)(e.code,{children:"@RdiFactory"}),"\nto inject the configuration container, and you're ready to run the bot and try out this command."]}),"\n",(0,i.jsx)(e.admonition,{type:"tip",children:(0,i.jsxs)(e.p,{children:["If you declare a command as a service this way, you are allowed to do anything with it like any other service, for\nexample inject it in other services, or set up ",(0,i.jsx)(e.code,{children:"@RdiFactory"})," to be\na ",(0,i.jsx)(e.a,{href:"/docs/api/working-with-services#injecting-a-service-in-a-reactive-static-factory",children:"reactive static method"})," in case the\ncommand needs to perform a reactive task in order to be initialized."]})})]})}function m(n={}){const{wrapper:e}={...(0,o.R)(),...n.components};return e?(0,i.jsx)(e,{...n,children:(0,i.jsx)(l,{...n})}):l(n)}},8453:(n,e,t)=>{t.d(e,{R:()=>r,x:()=>s});var i=t(6540);const o={},a=i.createContext(o);function r(n){const e=i.useContext(a);return i.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function s(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(o):n.components||o:r(n.components),i.createElement(a.Provider,{value:e},n.children)}}}]); \ No newline at end of file diff --git a/assets/js/3021cf83.126e009e.js b/assets/js/3021cf83.126e009e.js new file mode 100644 index 0000000..5b40f2c --- /dev/null +++ b/assets/js/3021cf83.126e009e.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[857],{6942:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>u,contentTitle:()=>c,default:()=>m,frontMatter:()=>s,metadata:()=>d,toc:()=>h});var r=t(4848),i=t(8453),o=t(6025),a=t(1470),l=t(9365);const s={title:"Getting Started"},c=void 0,d={id:"getting-started",title:"Getting Started",description:"Prerequisites",source:"@site/docs/getting-started.mdx",sourceDirName:".",slug:"/getting-started",permalink:"/docs/getting-started",draft:!1,unlisted:!1,editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/getting-started.mdx",tags:[],version:"current",frontMatter:{title:"Getting Started"},sidebar:"someSidebar",previous:{title:"Introduction",permalink:"/docs/"},next:{title:"Working with services",permalink:"/docs/api/working-with-services"}},u={},h=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"From the Maven archetype",id:"from-the-maven-archetype",level:2},{value:"From a blank project",id:"from-a-blank-project",level:2},{value:"Running your bot",id:"running-your-bot",level:2},{value:"During development",id:"during-development",level:3},{value:"In a production environment",id:"in-a-production-environment",level:3},{value:"Adding system modules to the JLink runtime image",id:"adding-system-modules-to-the-jlink-runtime-image",level:3}];function p(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["JDK >= 17. You can download the OpenJDK ",(0,r.jsx)(n.a,{href:"https://adoptium.net",children:"here"})]}),"\n",(0,r.jsxs)(n.li,{children:["Apache Maven >= 3.8.5, preferably the latest version available ",(0,r.jsx)(n.a,{href:"https://maven.apache.org/download.cgi",children:"here"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["This documentation assumes you have decent knowledge of the Java programming language. Being familiar with Discord4J and\nreactive programming is not required, although recommended. The ",(0,r.jsx)(n.a,{href:"https://wiki.discord4j.com",children:"Discord4J documentation"}),"\nprovides great guides to get started\nwith ",(0,r.jsx)(n.a,{href:"https://wiki.discord4j.com/en/latest/Reactive-(Reactor)-Tutorial/",children:"reactive programming"}),"\nand ",(0,r.jsx)(n.a,{href:"https://wiki.discord4j.com/en/latest/Lambda-Tutorial/",children:"advanced Java features"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"from-the-maven-archetype",children:"From the Maven archetype"}),"\n",(0,r.jsxs)(n.p,{children:["The recommended way to start a project with Botrino is to use the Maven archetype (replace ",(0,r.jsx)(n.code,{children:"[VERSION]"})," with the latest\nversion\navailable): ",(0,r.jsx)(n.a,{href:"https://search.maven.org/artifact/com.alex1304.botrino/botrino-api",children:(0,r.jsx)(n.img,{src:"https://img.shields.io/maven-central/v/com.alex1304.botrino/botrino-api",alt:"Maven Central"})})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"mvn archetype:generate -DarchetypeGroupId=com.alex1304.botrino -DarchetypeArtifactId=botrino-archetype -DarchetypeVersion=[VERSION]\n"})}),"\n",(0,r.jsxs)(n.p,{children:["You will be asked to enter the ",(0,r.jsx)(n.code,{children:"groupId"}),", the ",(0,r.jsx)(n.code,{children:"artifactId"}),", the ",(0,r.jsx)(n.code,{children:"version"})," and the ",(0,r.jsx)(n.code,{children:"package"})," of your project. If\nsuccessful, it should generate a project with the following contents:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"myproject\n\u251c\u2500\u2500 app\n\u2502\xa0\xa0 \u251c\u2500\u2500 pom.xml\n\u2502\xa0\xa0 \u2514\u2500\u2500 src\n\u2502\xa0\xa0 \u2514\u2500\u2500 main\n\u2502\xa0\xa0 \u251c\u2500\u2500 external-resources\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u251c\u2500\u2500 config.json\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u251c\u2500\u2500 launcher.cmd\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u2514\u2500\u2500 logback.xml\n\u2502\xa0\xa0 \u251c\u2500\u2500 java\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u251c\u2500\u2500 com\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u2502\xa0\xa0 \u2514\u2500\u2500 example\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u2502\xa0\xa0 \u2514\u2500\u2500 myproject\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u2502\xa0\xa0 \u251c\u2500\u2500 Main.java\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u2502\xa0\xa0 \u251c\u2500\u2500 PingCommand.java\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u2502\xa0\xa0 \u251c\u2500\u2500 SampleService.java\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u2502\xa0\xa0 \u2514\u2500\u2500 Strings.java\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u2514\u2500\u2500 module-info.java\n\u2502\xa0\xa0 \u2514\u2500\u2500 resources\n\u2502\xa0\xa0 \u2514\u2500\u2500 AppStrings.properties\n\u251c\u2500\u2500 delivery\n\u2502\xa0\xa0 \u2514\u2500\u2500 pom.xml\n\u251c\u2500\u2500 launcher\n\u2502\xa0\xa0 \u251c\u2500\u2500 pom.xml\n\u2502\xa0\xa0 \u2514\u2500\u2500 src\n\u2502\xa0\xa0 \u2514\u2500\u2500 main\n\u2502\xa0\xa0 \u2514\u2500\u2500 java\n\u2502\xa0\xa0 \u251c\u2500\u2500 com\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u2514\u2500\u2500 example\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u2514\u2500\u2500 myproject\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u2514\u2500\u2500 Launcher.java\n\u2502\xa0\xa0 \u2514\u2500\u2500 module-info.java\n\u2514\u2500\u2500 pom.xml\n"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["The ",(0,r.jsx)(n.code,{children:"app/"})," directory corresponds to the main module of your bot application. It already contains pre-generated classes\nwith a main method, an example command and an example service. It also shows how to externalize strings via\na ",(0,r.jsx)(n.code,{children:".properties"})," files in the root of ",(0,r.jsx)(n.code,{children:"src/main/resources"}),", and a class ",(0,r.jsx)(n.code,{children:"Strings"})," containing constants to reference\nthem. The ",(0,r.jsx)(n.code,{children:"src/main/external-resources"})," directory contains the configuration files necessary to run the bot."]}),"\n",(0,r.jsxs)(n.li,{children:["The ",(0,r.jsx)(n.code,{children:"delivery/"})," directory only contains a ",(0,r.jsx)(n.code,{children:"pom.xml"})," that is capable of generating a runtime image of the bot\napplication using the ",(0,r.jsx)(n.code,{children:"jlink"})," utility, bundled with the JDK 17."]}),"\n",(0,r.jsxs)(n.li,{children:["The ",(0,r.jsx)(n.code,{children:"launcher"})," directory contains the module used by ",(0,r.jsx)(n.code,{children:"delivery"})," to create a basic launcher for the runtime image."]}),"\n",(0,r.jsxs)(n.li,{children:["The ",(0,r.jsx)(n.code,{children:"pom.xml"})," which configures the project by importing the libraries and configuring the multi-module build."]}),"\n"]}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["The archetype will automatically include the ",(0,r.jsx)(n.a,{href:"/docs/interaction-library/overview",children:"interaction library"})," in your project\ndependencies."]})}),"\n",(0,r.jsxs)(n.p,{children:["This project is ready to be opened in your favorite IDE (Eclipse, IntelliJ...), and you can directly jump to\nthe ",(0,r.jsx)(n.a,{href:"#running-your-bot",children:"Running your bot"})," section."]}),"\n",(0,r.jsx)(n.h2,{id:"from-a-blank-project",children:"From a blank project"}),"\n",(0,r.jsx)(n.p,{children:"If you don't want the JLink runtime image, or if you want to use a build tool other than Maven, you may as well start\nfrom a blank project and import Botrino yourself. Be aware that it will require a bit more effort to set up than using\nthe archetype."}),"\n",(0,r.jsx)(n.p,{children:"Import the following dependency:"}),"\n",(0,r.jsxs)(a.A,{groupId:"build-tools",defaultValue:"maven",values:[{label:"Maven",value:"maven"},{label:"Gradle",value:"gradle"}],children:[(0,r.jsx)(l.A,{value:"maven",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-xml",children:"<dependency>\n <groupId>com.alex1304.botrino</groupId>\n <artifactId>botrino-api</artifactId>\n <version>[VERSION]</version>\n</dependency>\n"})})}),(0,r.jsx)(l.A,{value:"gradle",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-groovy",children:"repositories {\n mavenCentral()\n}\n\ndependencies {\n implementation 'com.alex1304.botrino:botrino-api:[VERSION]'\n}\n"})})})]}),"\n",(0,r.jsxs)(n.p,{children:["As usual, replace ",(0,r.jsx)(n.code,{children:"[VERSION]"})," with the latest version\navailable: ",(0,r.jsx)(n.a,{href:"https://search.maven.org/artifact/com.alex1304.botrino/botrino-api",children:(0,r.jsx)(n.img,{src:"https://img.shields.io/maven-central/v/com.alex1304.botrino/botrino-api",alt:"Maven Central"})})]}),"\n",(0,r.jsxs)(n.p,{children:["Create a ",(0,r.jsx)(n.code,{children:"module-info.java"})," annotated with ",(0,r.jsx)(n.code,{children:"@BotModule"}),", with the ",(0,r.jsx)(n.code,{children:"open"})," modifier and that requires the ",(0,r.jsx)(n.code,{children:"botrino.api"}),"\nmodule:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-java",children:"import botrino.api.annotation.BotModule;\n\n@BotModule\nopen module com.example.myproject {\n\n requires botrino.api;\n}\n"})}),"\n",(0,r.jsxs)(n.p,{children:["The module transitively requires all libraries necessary to work, including Discord4J, Reactor, Netty, RDI and Jackson,\nso you don't need to put ",(0,r.jsx)(n.code,{children:"requires"})," for those libraries."]}),"\n",(0,r.jsx)(n.admonition,{type:"caution",children:(0,r.jsx)(n.p,{children:"If you get compilation errors, remember to configure your project to use JDK 17 or above."})}),"\n",(0,r.jsxs)(n.p,{children:["Finally, add a class with a ",(0,r.jsx)(n.code,{children:"main"})," method:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-java",children:"package com.example.myproject;\n\nimport botrino.api.Botrino;\n\npublic final class Main {\n\n public static void main(String[] args) {\n Botrino.run(args);\n }\n}\n"})}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["If you want to include the interaction library in your project, refer\nto ",(0,r.jsx)(n.a,{href:"/docs/interaction-library/overview#option-1-using-botrino-framework",children:"this page"}),"."]})}),"\n",(0,r.jsx)(n.h2,{id:"running-your-bot",children:"Running your bot"}),"\n",(0,r.jsx)(n.h3,{id:"during-development",children:"During development"}),"\n",(0,r.jsx)(n.p,{children:"When you are developing your bot, you may prefer running the bot directly in your IDE rather than package your\napplication every time."}),"\n",(0,r.jsxs)(n.p,{children:["If you used the archetype, copy the contents of ",(0,r.jsx)(n.code,{children:"app/src/main/external-resources"})," in a new directory on your hard drive,\n",(0,r.jsx)(n.strong,{children:"outside of the project workspace"}),". If you aren't using the archetype, create a directory outside of your project and\nadd a ",(0,r.jsx)(n.code,{children:"config.json"})," file with the following contents (insert your bot token in the ",(0,r.jsx)(n.code,{children:'"token"'})," field, and remove\nthe ",(0,r.jsx)(n.code,{children:'"interaction"'})," field if you aren't using the interaction library):"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-json",children:'{\n "bot": {\n "token": "yourTokenHere",\n "presence": {\n "status": "online",\n "activity_type": "playing",\n "activity_text": "Hello world!"\n },\n "enabled_intents": 32509\n },\n "interaction": {}\n}\n'})}),"\n",(0,r.jsx)(n.p,{children:"Use the tabs below depending on whether you use Eclipse or IntelliJ. If you use another IDE, it should be similar enough\nso you can figure out by yourself."}),"\n",(0,r.jsxs)(a.A,{groupId:"ide",defaultValue:"intellij",values:[{label:"IntelliJ",value:"intellij"},{label:"Eclipse",value:"eclipse"}],children:[(0,r.jsxs)(l.A,{value:"intellij",children:[(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Open ",(0,r.jsx)(n.code,{children:"Run"})," > ",(0,r.jsx)(n.code,{children:"Edit Configurations..."})]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:'If you are using the archetype, it should detect a run configuration called "Main" automatically. If so, jump to step\n7, otherwise continue'}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(n.code,{children:"+"})," then ",(0,r.jsx)(n.code,{children:"Application"})]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Select Java 17 (or whatever JDK 17+ you have installed)"}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:'In the "Main class" field, enter the fully qualified name of the class containing the main method'}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:['In the "VM options" field, copy and paste the\nfollowing: ',(0,r.jsx)(n.code,{children:"--add-modules=ALL-MODULE-PATH -cp . -p $MODULE_DIR$/target/dependency:$MODULE_DIR$/target/classes"})]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:'In the "Working directory" field, enter the absolute path (or click the folder icon to browse) to the directory where\nyou copied/created the configuration files earlier'}),"\n"]}),"\n"]}),(0,r.jsx)("img",{src:(0,o.A)("img/intellij.png"),alt:""}),(0,r.jsxs)(n.ol,{start:"8",children:["\n",(0,r.jsx)(n.li,{children:'Click "OK" and run'}),"\n"]})]}),(0,r.jsxs)(l.A,{value:"eclipse",children:[(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Open ",(0,r.jsx)(n.code,{children:"Run"})," > ",(0,r.jsx)(n.code,{children:"Run Configurations..."})]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Right click ",(0,r.jsx)(n.code,{children:"Java Application"})," then click ",(0,r.jsx)(n.code,{children:"New Configuration"})]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:'In the "Project" field, select your project containing the main class'}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:'In the "Main class" field, enter the fully qualified name of the class containing the main method'}),"\n"]}),"\n"]}),(0,r.jsx)("img",{src:(0,o.A)("img/eclipse1.png"),alt:""}),(0,r.jsxs)(n.ol,{start:"5",children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:'Go to the "Dependencies" tab, highlight "Classpath Entries", then click "Advanced...", select "Add External\nFolder", "OK", and browse to the directory where you copied/created the configuration files earlier'}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:['Still in the "Dependencies" tab, find the "Add modules" dropdown and select ',(0,r.jsx)(n.code,{children:"ALL-MODULE-PATH"})]}),"\n"]}),"\n"]}),(0,r.jsx)("img",{src:(0,o.A)("img/eclipse2.png"),alt:""}),(0,r.jsxs)(n.ol,{start:"7",children:["\n",(0,r.jsx)(n.li,{children:'Click "Apply" then "Run"'}),"\n"]})]})]}),"\n",(0,r.jsx)(n.h3,{id:"in-a-production-environment",children:"In a production environment"}),"\n",(0,r.jsx)(n.p,{children:"If you aren't using the archetype, you would need to configure yourself the packaging for the production environment,\nincluding scripts to launch the bot with the correct VM arguments, etc, just like any other Java application. If you are\nusing the archetype, you can build the JLink runtime image with the following command:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"mvn package -Dtoken=<BOT_TOKEN>\n"})}),"\n",(0,r.jsxs)(n.p,{children:["The bot token property is not required, but saves you from manually editing the json file to insert the token later on.\nThis command will produce a ",(0,r.jsx)(n.code,{children:".zip"})," file found in ",(0,r.jsx)(n.code,{children:"delivery/target"})," directory. You can unzip it in your production\nenvironment, and just run ",(0,r.jsx)(n.code,{children:"./bin/<launcher name>"}),". ",(0,r.jsx)(n.code,{children:"<launcher name>"})," by default corresponds to the ",(0,r.jsx)(n.code,{children:"artifactId"})," of your\nproject."]}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["By default, the application will be attached to the current command line window, meaning the bot would disconnect if you\nclose the terminal. You can run the application with the ",(0,r.jsx)(n.code,{children:"--detached"})," flag to launch the bot in the background. You can\ncombine it with the ",(0,r.jsx)(n.code,{children:"--batch-mode"})," flag so that it won't ask you to press a key to exit."]})}),"\n",(0,r.jsx)(n.h3,{id:"adding-system-modules-to-the-jlink-runtime-image",children:"Adding system modules to the JLink runtime image"}),"\n",(0,r.jsxs)(n.p,{children:["If you build the bot using the JLink runtime image generated by the archetype, the runtime image will include the\nminimal set of Java system modules required for a Botrino application to work. If you open the parent ",(0,r.jsx)(n.code,{children:"pom.xml"})," and find\nthe ",(0,r.jsx)(n.code,{children:"maven-jlink-plugin"})," configuration, you can see the following list of system modules:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-xml",children:"<addModules>\n <addModule>java.logging</addModule>\n <addModule>jdk.unsupported</addModule>\n <addModule>java.xml</addModule>\n <addModule>java.naming</addModule>\n <addModule>java.desktop</addModule>\n <addModule>jdk.crypto.ec</addModule>\n</addModules>\n"})}),"\n",(0,r.jsxs)(n.p,{children:["If your application needs another module from the JDK, for example ",(0,r.jsx)(n.code,{children:"java.sql"}),", all you need to do is to edit this\nconfiguration and add more ",(0,r.jsx)(n.code,{children:"<addModule>"})," tags."]})]})}function m(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(p,{...e})}):p(e)}},9365:(e,n,t)=>{t.d(n,{A:()=>a});t(6540);var r=t(8215);const i={tabItem:"tabItem_Ymn6"};var o=t(4848);function a(e){let{children:n,hidden:t,className:a}=e;return(0,o.jsx)("div",{role:"tabpanel",className:(0,r.A)(i.tabItem,a),hidden:t,children:n})}},1470:(e,n,t)=>{t.d(n,{A:()=>w});var r=t(6540),i=t(8215),o=t(3104),a=t(6347),l=t(205),s=t(7485),c=t(1682),d=t(9466);function u(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(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)??[]}function h(e){const{values:n,children:t}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:t,attributes:r,default:i}}=e;return{value:n,label:t,attributes:r,default:i}}))}(t);return function(e){const n=(0,c.X)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e}),[n,t])}function p(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function m(e){let{queryString:n=!1,groupId:t}=e;const i=(0,a.W6)(),o=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)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 t??null}({queryString:n,groupId:t});return[(0,s.aZ)(o),(0,r.useCallback)((e=>{if(!o)return;const n=new URLSearchParams(i.location.search);n.set(o,e),i.replace({...i.location,search:n.toString()})}),[o,i])]}function j(e){const{defaultValue:n,queryString:t=!1,groupId:i}=e,o=h(e),[a,s]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(n){if(!p({value:n,tabValues:t}))throw new Error(`Docusaurus error: The <Tabs> has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=t.find((e=>e.default))??t[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:o}))),[c,u]=m({queryString:t,groupId:i}),[j,x]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[i,o]=(0,d.Dv)(t);return[i,(0,r.useCallback)((e=>{t&&o.set(e)}),[t,o])]}({groupId:i}),g=(()=>{const e=c??j;return p({value:e,tabValues:o})?e:null})();(0,l.A)((()=>{g&&s(g)}),[g]);return{selectedValue:a,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);s(e),u(e),x(e)}),[u,x,o]),tabValues:o}}var x=t(2303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(4848);function y(e){let{className:n,block:t,selectedValue:r,selectValue:a,tabValues:l}=e;const s=[],{blockElementScrollPositionUntilNextRender:c}=(0,o.a_)(),d=e=>{const n=e.currentTarget,t=s.indexOf(n),i=l[t].value;i!==r&&(c(n),a(i))},u=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const t=s.indexOf(e.currentTarget)+1;n=s[t]??s[0];break}case"ArrowLeft":{const t=s.indexOf(e.currentTarget)-1;n=s[t]??s[s.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.A)("tabs",{"tabs--block":t},n),children:l.map((e=>{let{value:n,label:t,attributes:o}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>s.push(e),onKeyDown:u,onClick:d,...o,className:(0,i.A)("tabs__item",g.tabItem,o?.className,{"tabs__item--active":r===n}),children:t??n},n)}))})}function v(e){let{lazy:n,children:t,selectedValue:i}=e;const o=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=o.find((e=>e.props.value===i));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:o.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==i})))})}function b(e){const n=j(e);return(0,f.jsxs)("div",{className:(0,i.A)("tabs-container",g.tabList),children:[(0,f.jsx)(y,{...n,...e}),(0,f.jsx)(v,{...n,...e})]})}function w(e){const n=(0,x.A)();return(0,f.jsx)(b,{...e,children:u(e.children)},String(n))}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>l});var r=t(6540);const i={},o=r.createContext(i);function a(e){const n=r.useContext(o);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),r.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/373758dc.c365ca98.js b/assets/js/373758dc.c365ca98.js new file mode 100644 index 0000000..4dbf448 --- /dev/null +++ b/assets/js/373758dc.c365ca98.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[603],{9720:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>o,contentTitle:()=>r,default:()=>h,frontMatter:()=>c,metadata:()=>a,toc:()=>d});var t=i(4848),s=i(8453);const c={title:"Working with services"},r=void 0,a={id:"api/working-with-services",title:"Working with services",description:"Services are certainly what contribute the most in making Botrino a so concise and easy to use framework. You will",source:"@site/docs/api/working-with-services.mdx",sourceDirName:"api",slug:"/api/working-with-services",permalink:"/docs/api/working-with-services",draft:!1,unlisted:!1,editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/api/working-with-services.mdx",tags:[],version:"current",frontMatter:{title:"Working with services"},sidebar:"someSidebar",previous:{title:"Getting Started",permalink:"/docs/getting-started"},next:{title:"Configuring your bot",permalink:"/docs/api/configuring-your-bot"}},o={},d=[{value:"What is a service?",id:"what-is-a-service",level:2},{value:"How to use services?",id:"how-to-use-services",level:2},{value:"Declaring a service",id:"declaring-a-service",level:3},{value:"Injecting a service in a constructor",id:"injecting-a-service-in-a-constructor",level:3},{value:"Injecting a service in a static factory",id:"injecting-a-service-in-a-static-factory",level:3},{value:"Injecting a service in a reactive static factory",id:"injecting-a-service-in-a-reactive-static-factory",level:3},{value:"Built-in services",id:"built-in-services",level:2},{value:"<code>GatewayDiscordClient</code>",id:"gatewaydiscordclient",level:3},{value:"<code>ConfigContainer</code>",id:"configcontainer",level:3}];function l(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.p,{children:"Services are certainly what contribute the most in making Botrino a so concise and easy to use framework. You will\nhopefully understand why after reading this page introducing services and showing how to use their power to their\nfullest extent."}),"\n",(0,t.jsx)(n.h2,{id:"what-is-a-service",children:"What is a service?"}),"\n",(0,t.jsxs)(n.p,{children:["Services are more or less the same thing\nas ",(0,t.jsx)(n.a,{href:"https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#beans",children:"beans in Spring"}),". They are Java\nobjects that are instantiated once at the start of your application, and that you can inject everywhere in your app. A\nservice can define dependencies to other services, which are resolved when the service is created."]}),"\n",(0,t.jsxs)(n.p,{children:["As such, the concept of dependency injection (DI) is also used in Botrino. Under the hood, it utilizes\nthe ",(0,t.jsx)(n.a,{href:"https://alex1304.github.io/rdi/docs/intro",children:"RDI library"})," which supports factories returning reactive types."]}),"\n",(0,t.jsx)(n.h2,{id:"how-to-use-services",children:"How to use services?"}),"\n",(0,t.jsxs)(n.p,{children:["Botrino will be able to find your services automatically in your app module, as long as your module is ",(0,t.jsx)(n.code,{children:"open"})," and is\nannotated with ",(0,t.jsx)(n.code,{children:"@BotModule"}),", as explained in the ",(0,t.jsx)(n.a,{href:"/docs/getting-started",children:"Getting Started guide"}),"."]}),"\n",(0,t.jsx)(n.h3,{id:"declaring-a-service",children:"Declaring a service"}),"\n",(0,t.jsxs)(n.p,{children:["For a class to be recognized as a service, you need to annotate it with ",(0,t.jsx)(n.code,{children:"@RdiService"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-java",children:"@RdiService\npublic class A {\n\n}\n"})}),"\n",(0,t.jsxs)(n.p,{children:["With only this code, an instance of ",(0,t.jsx)(n.code,{children:"A"})," will be created on startup. By default it assumes that a public no-arg\nconstructor exists, which is the case in the code above. But there are many ways to construct a service, and that's what\nmakes them interesting."]}),"\n",(0,t.jsx)(n.h3,{id:"injecting-a-service-in-a-constructor",children:"Injecting a service in a constructor"}),"\n",(0,t.jsxs)(n.p,{children:["Let's create another service ",(0,t.jsx)(n.code,{children:"B"}),", which injects ",(0,t.jsx)(n.code,{children:"A"})," in its constructor:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-java",children:"@RdiService\npublic class B {\n\n @RdiFactory\n public B(A a) {\n // you can use A here\n }\n}\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"@RdiFactory"})," annotation is what indicates the method to create the service, with the possibility to inject other\nservices in the arguments. In this scenario, the following will happen on startup:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Botrino will find ",(0,t.jsx)(n.code,{children:"A"})," and ",(0,t.jsx)(n.code,{children:"B"})," in your module, and register them as services"]}),"\n",(0,t.jsxs)(n.li,{children:["It will see that ",(0,t.jsx)(n.code,{children:"B"})," injects ",(0,t.jsx)(n.code,{children:"A"})," in constructor, so ",(0,t.jsx)(n.code,{children:"A"})," needs to be created first before ",(0,t.jsx)(n.code,{children:"B"})," can be created"]}),"\n",(0,t.jsx)(n.li,{children:"Services are created following the dependency tree."}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"injecting-a-service-in-a-static-factory",children:"Injecting a service in a static factory"}),"\n",(0,t.jsxs)(n.p,{children:["The method annotated with ",(0,t.jsx)(n.code,{children:"@RdiFactory"})," can as well be a static factory method instead of a constructor:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-java",children:"@RdiService\npublic class B {\n\n private final A a;\n\n private B(A a) {\n this.a = a;\n }\n\n @RdiFactory\n public static B create(A a) {\n return new B(a);\n }\n}\n"})}),"\n",(0,t.jsx)(n.admonition,{type:"caution",children:(0,t.jsxs)(n.p,{children:["The return type of the static factory must be ",(0,t.jsx)(n.code,{children:"B"})," or a subtype of ",(0,t.jsx)(n.code,{children:"B"}),"."]})}),"\n",(0,t.jsx)(n.h3,{id:"injecting-a-service-in-a-reactive-static-factory",children:"Injecting a service in a reactive static factory"}),"\n",(0,t.jsxs)(n.p,{children:["If you need to perform some reactive tasks in order to create your object, Botrino (in fact, RDI) allows you to return\na ",(0,t.jsx)(n.code,{children:"Publisher"})," of the service instead of the service itself:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-java",children:"@RdiService\npublic class B {\n\n private final A a;\n\n private B(A a) {\n this.a = a;\n }\n\n @RdiFactory\n public static Mono<B> create(A a) {\n return Mono.fromCallable(() -> new B(a));\n }\n}\n"})}),"\n",(0,t.jsxs)(n.p,{children:["In this case, if ",(0,t.jsx)(n.code,{children:"B"})," is injected somewhere else, it will first subscribe to the publisher returned by the static\nfactory, and create the service only after the instance of ",(0,t.jsx)(n.code,{children:"B"})," is emitted."]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["Check out the ",(0,t.jsx)(n.a,{href:"https://alex1304.github.io/rdi/docs/intro",children:"RDI documentation"})," for more examples and details on how\ndependency injection works."]})}),"\n",(0,t.jsx)(n.h2,{id:"built-in-services",children:"Built-in services"}),"\n",(0,t.jsx)(n.h3,{id:"gatewaydiscordclient",children:(0,t.jsx)(n.code,{children:"GatewayDiscordClient"})}),"\n",(0,t.jsxs)(n.p,{children:["Maybe you've been wondering how to access the instance of the Discord client of your bot? Well, now you have the\nanswer: ",(0,t.jsx)(n.code,{children:"GatewayDiscordClient"})," is registered as a service, which means you can inject it in your own services!"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-java",children:"@RdiService\npublic class A {\n\n @RdiFactory\n public A(GatewayDiscordClient gateway) {\n // you can use GatewayDiscordClient here\n }\n}\n"})}),"\n",(0,t.jsx)(n.h3,{id:"configcontainer",children:(0,t.jsx)(n.code,{children:"ConfigContainer"})}),"\n",(0,t.jsxs)(n.p,{children:["To access the values of the configuration file, the service ",(0,t.jsx)(n.code,{children:"ConfigContainer"})," is registered and you can inject it in\nyour own services. For example, to get the bot token:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-java",children:"@RdiService\npublic class A {\n\n @RdiFactory\n public A(ConfigContainer configContainer) {\n var botConfig = configContainer.get(BotConfig.class);\n var token = botConfig.token();\n }\n}\n"})}),"\n",(0,t.jsxs)(n.p,{children:["We will see the ",(0,t.jsx)(n.code,{children:"ConfigContainer"})," more in depth in the next section, ",(0,t.jsx)(n.a,{href:"/docs/api/configuring-your-bot",children:"Configuring your bot"}),"."]})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(l,{...e})}):l(e)}},8453:(e,n,i)=>{i.d(n,{R:()=>r,x:()=>a});var t=i(6540);const s={},c=t.createContext(s);function r(e){const n=t.useContext(c);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),t.createElement(c.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/421473c5.c80d0eba.js b/assets/js/421473c5.c80d0eba.js new file mode 100644 index 0000000..4776cf7 --- /dev/null +++ b/assets/js/421473c5.c80d0eba.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[812],{1877:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>s,default:()=>u,frontMatter:()=>r,metadata:()=>c,toc:()=>d});var o=t(4848),i=t(8453),a=t(6025);const r={title:"Dealing with components"},s=void 0,c={id:"interaction-library/dealing-with-components",title:"Dealing with components",description:"The library offers two ways to handle interactions with message components (buttons and select menus).",source:"@site/docs/interaction-library/dealing-with-components.mdx",sourceDirName:"interaction-library",slug:"/interaction-library/dealing-with-components",permalink:"/docs/interaction-library/dealing-with-components",draft:!1,unlisted:!1,editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/interaction-library/dealing-with-components.mdx",tags:[],version:"current",frontMatter:{title:"Dealing with components"},sidebar:"someSidebar",previous:{title:"Acknowledging interactions",permalink:"/docs/interaction-library/acknowledging-interactions"},next:{title:"Privileges",permalink:"/docs/interaction-library/privileges"}},l={},d=[{value:"Handling component interactions as regular commands",id:"handling-component-interactions-as-regular-commands",level:2},{value:"Waiting for component interactions inside a command",id:"waiting-for-component-interactions-inside-a-command",level:2},{value:"Pagination system with components",id:"pagination-system-with-components",level:2}];function m(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",ul:"ul",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.p,{children:"The library offers two ways to handle interactions with message components (buttons and select menus)."}),"\n",(0,o.jsx)(n.h2,{id:"handling-component-interactions-as-regular-commands",children:"Handling component interactions as regular commands"}),"\n",(0,o.jsxs)(n.p,{children:["The first way is to treat component interactions as regular commands, which consists of declaring a listener that is\ngoing to be called every time a component with a specific ",(0,o.jsx)(n.code,{children:"customId"})," is interacted with. The structure is similar\nto ",(0,o.jsx)(n.a,{href:"/docs/interaction-library/creating-commands",children:"creating commands"}),":"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-java",children:'package testbot1;\n\nimport botrino.interaction.annotation.ComponentCommand;\nimport botrino.interaction.context.ButtonInteractionContext;\nimport botrino.interaction.listener.ComponentInteractionListener;\nimport org.reactivestreams.Publisher;\n\n@ComponentCommand("clickme")\npublic final class ClickMeButtonCommand implements ComponentInteractionListener<Void> {\n\n @Override\n public Publisher<Void> run(ButtonInteractionContext ctx) {\n return ctx.event().createFollowup("Button clicked!").then();\n }\n}\n'})}),"\n",(0,o.jsxs)(n.p,{children:["The class implements ",(0,o.jsx)(n.code,{children:"ComponentInteractionListener<Void>"})," and overrides ",(0,o.jsx)(n.code,{children:"run(ButtonInteractionContext)"})," (it has\nseveral ",(0,o.jsx)(n.code,{children:"run()"})," overloads, one for each type of component, here we want a button. For select menus you're supposed to\noverride ",(0,o.jsx)(n.code,{children:"run(SelectMenuInteractionContext)"}),"). The ",(0,o.jsx)(n.code,{children:"@ComponentCommand"})," annotation specifies the customId to listen for.\nLet's make a chat input command to create the message containing the button:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-java",children:'package testbot1;\n\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport discord4j.core.object.component.ActionRow;\nimport discord4j.core.object.component.Button;\nimport org.reactivestreams.Publisher;\n\n@ChatInputCommand(name = "create-button", description = "Create a button.")\npublic final class CreateButtonCommand implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return ctx.event().createFollowup("Click the button:")\n .withComponents(ActionRow.of(\n Button.primary("clickme", "Click me!")));\n }\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:"As usual, unless you are using the Botrino framework, you need to register them manually:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-java",children:"interactionService.registerComponentCommand(new ClickMeButtonCommand());\ninteractionService.registerChatInputCommand(new CreateButtonCommand());\n"})}),"\n",(0,o.jsx)(n.p,{children:"Result:"}),"\n",(0,o.jsx)("img",{src:(0,a.A)("img/clickme.png"),alt:""}),"\n",(0,o.jsxs)(n.admonition,{type:"info",children:[(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.code,{children:"@ComponentCommand"})," annotation is in fact not required if you aren't using the Botrino framework. You may as well\noverride the ",(0,o.jsx)(n.code,{children:"customId()"})," method from ",(0,o.jsx)(n.code,{children:"ComponentInteractionListener"}),". The annotation is still required when using the\nBotrino framework, as it will only auto-register listeners containing that annotation, but if you are already\noverriding ",(0,o.jsx)(n.code,{children:"customId()"})," you can use ",(0,o.jsx)(n.code,{children:"@ComponentCommand"})," alone without the value. An example might be more clear:"]}),(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-java",children:'package testbot1;\n\nimport botrino.interaction.annotation.ComponentCommand;\nimport botrino.interaction.context.ButtonInteractionContext;\nimport botrino.interaction.listener.ComponentInteractionListener;\nimport org.reactivestreams.Publisher;\n\n@ComponentCommand // You may omit the customId here...\npublic final class ClickMeButtonCommand implements ComponentInteractionListener<Void> {\n \n @Override\n public String customId() {\n return "clickme"; // ...if you specify it here instead\n }\n\n @Override\n public Publisher<Void> run(ButtonInteractionContext ctx) {\n return ctx.event().createFollowup("Button clicked!").then();\n }\n}\n'})})]}),"\n",(0,o.jsx)(n.h2,{id:"waiting-for-component-interactions-inside-a-command",children:"Waiting for component interactions inside a command"}),"\n",(0,o.jsxs)(n.p,{children:['In many cases, you want to use components as a way to make your commands more interactive, for example if you need\nconfirmation from the user to perform an action. You would need some way to "pause" the execution of your command and\nresume when the user has given a response by clicking a button or a select menu. This is made easy with\nthe ',(0,o.jsx)(n.code,{children:"awaitButtonClick(customId)"})," and ",(0,o.jsx)(n.code,{children:"awaitSelectMenuItems(customId)"})," methods. Here's an example of a simple command\nwaiting for the user to select an item and display the value clicked:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-java",children:'package testbot1;\n\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport discord4j.core.object.component.ActionRow;\nimport discord4j.core.object.component.SelectMenu;\nimport discord4j.core.object.entity.Message;\nimport discord4j.core.spec.InteractionFollowupCreateSpec;\nimport org.reactivestreams.Publisher;\nimport reactor.core.publisher.Mono;\n\nimport java.util.UUID;\n\nimport static botrino.interaction.listener.ComponentInteractionListener.selectMenu;\n\n@ChatInputCommand(name = "select", description = "Command for testing select menus")\npublic class SelectCommand implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n final var customId = UUID.randomUUID().toString();\n return ctx.event().createFollowup("Select an option:")\n .withComponents(ActionRow.of(SelectMenu.of(customId,\n SelectMenu.Option.of("option 1", "foo"),\n SelectMenu.Option.of("option 2", "bar"),\n SelectMenu.Option.of("option 3", "baz"))))\n .map(Message::getId)\n // Wait until the select menu is interacted with and return the value clicked\n .flatMap(messageId -> ctx.awaitSelectMenuItems(customId)\n .flatMap(items -> ctx.event().createFollowup("You clicked: " + items.get(0))\n .then(ctx.event().deleteFollowup(messageId))));\n }\n}\n'})}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["Since you want to listen for one specific select menu (and not all select menus with some customId), you generate a\ncustomId that is unique for each invocation of the ",(0,o.jsx)(n.code,{children:"/select"})," command. You can easily generate a random string\nvia ",(0,o.jsx)(n.code,{children:"java.util.UUID"}),"."]}),"\n",(0,o.jsx)(n.li,{children:"A first followup is sent with the message containing the select menu."}),"\n",(0,o.jsxs)(n.li,{children:["Once the message has been sent, call ",(0,o.jsx)(n.code,{children:"awaitSelectMenuItems(customId)"})," with the same customId generated previously. It\nwill wait for the user to interact with the menu and will emit the value clicked."]}),"\n",(0,o.jsx)(n.li,{children:"The value received is then displayed via a new followup message."}),"\n"]}),"\n",(0,o.jsx)(n.admonition,{type:"warning",children:(0,o.jsxs)(n.p,{children:["If you don't make the customId unique on each run, there will be conflicts when the ",(0,o.jsx)(n.code,{children:"/select"})," command is run several\ntimes consecutively by the same user in the same channel."]})}),"\n",(0,o.jsxs)(n.p,{children:["Here is another example with ",(0,o.jsx)(n.code,{children:"awaitButtonClick(customId)"})," that asks the user to confirm when resetting a user's\nnickname:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-java",children:'package testbot1;\n\nimport botrino.interaction.annotation.UserCommand;\nimport botrino.interaction.context.UserInteractionContext;\nimport botrino.interaction.listener.UserInteractionListener;\nimport discord4j.core.object.component.ActionRow;\nimport discord4j.core.object.component.Button;\nimport discord4j.core.object.entity.Message;\nimport org.reactivestreams.Publisher;\nimport reactor.core.publisher.Mono;\n\nimport java.util.UUID;\n\nimport static botrino.interaction.listener.ComponentInteractionListener.button;\n\n@UserCommand("Reset Nickname")\npublic class ResetNickCommand implements UserInteractionListener {\n\n @Override\n public Publisher<?> run(UserInteractionContext ctx) {\n final var guildId = ctx.event().getInteraction().getGuildId().orElse(null);\n if (guildId == null) {\n return ctx.event().createFollowup("Cannot use outside of a guild");\n }\n final var yesId = UUID.randomUUID().toString();\n final var noId = UUID.randomUUID().toString();\n return ctx.event().createFollowup("Reset the nickname of that user?")\n .withComponents(ActionRow.of(\n Button.primary(yesId, "Yes"),\n Button.secondary(noId, "No")))\n .map(Message::getId)\n .flatMap(messageId -> Mono.firstWithValue(\n ctx.awaitButtonClick(yesId),\n ctx.awaitButtonClick(noId))\n .flatMap(buttonClicked -> buttonClicked.equals(yesId) ? ctx.event()\n .getClient()\n .getMemberById(guildId, ctx.event().getTargetId())\n .flatMap(member -> member.edit().withNicknameOrNull(null))\n .then(ctx.event().createFollowup("Nickname reset successful!"))\n : ctx.event().createFollowup("Action cancelled"))\n .then(ctx.event().deleteFollowup(messageId)));\n }\n}\n'})}),"\n",(0,o.jsxs)(n.p,{children:['The code is quite self-explanatory: we display two buttons, one for "yes" and one for "no". We use ',(0,o.jsx)(n.code,{children:"Mono.firstWithValue"}),"\nto only wait for the first click on either of the two buttons, and depending on which button was clicked, we execute one\nor the other action."]}),"\n",(0,o.jsx)(n.admonition,{type:"tip",children:(0,o.jsxs)(n.p,{children:["There exists a more generic method ",(0,o.jsx)(n.code,{children:"awaitComponentInteraction"})," that lets you manipulate the underlying interaction\ncontext before returning a value. It accepts a ",(0,o.jsx)(n.code,{children:"ComponentInteractionListener<R>"})," that you can construct via its static\nmethods ",(0,o.jsx)(n.code,{children:"button(String, Function)"})," and ",(0,o.jsx)(n.code,{children:"selectMenu(String, Function)"}),", each accepting the customId and a function\nreceiving a ",(0,o.jsx)(n.code,{children:"ButtonInteractionContext"})," or ",(0,o.jsx)(n.code,{children:"SelectMenuInteractionContext"})," and producing a value of any type."]})}),"\n",(0,o.jsx)(n.h2,{id:"pagination-system-with-components",children:"Pagination system with components"}),"\n",(0,o.jsxs)(n.p,{children:["Making a pagination system is one of the most obvious use cases for message components. The library provides a static\nmethod ",(0,o.jsx)(n.code,{children:"MessagePaginator::paginate"})," to build paginated messages easily. See the example below:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-java",children:'package testbot1;\n\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport botrino.interaction.util.MessagePaginator;\nimport discord4j.core.object.component.ActionRow;\nimport discord4j.core.object.component.Button;\nimport discord4j.core.spec.MessageCreateSpec;\nimport org.reactivestreams.Publisher;\nimport reactor.core.publisher.Mono;\n\n@ChatInputCommand(name = "paginate", description = "Pagination testing")\npublic final class PaginateCommand implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return MessagePaginator.paginate(ctx, 5, state -> Mono.just(MessageCreateSpec.create()\n .withContent("Page " + (state.getPage() + 1) + "/" + state.getPageCount())\n .withComponents(ActionRow.of(\n state.previousButton(customId -> Button.secondary(customId, "<< Previous")),\n state.nextButton(customId -> Button.secondary(customId, "Next >>")),\n state.closeButton(customId -> Button.danger(customId, "Close"))\n ))));\n }\n}\n'})}),"\n",(0,o.jsx)("img",{src:(0,a.A)("img/paginate.png"),alt:""}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["The ",(0,o.jsx)(n.code,{children:"paginate"})," method takes 3 arguments. The first one is the interaction context, the second one is the total number\nof pages, and the last one is a function that receives a state and produces the message to display. An overload exists\nallowing you to specify the initial page number (by default it starts at the first page)."]}),"\n",(0,o.jsxs)(n.li,{children:["The ",(0,o.jsx)(n.code,{children:"state"})," holds information on the current state of the paginator, such as the current page number and whether it is\nactive"]}),"\n",(0,o.jsx)(n.li,{children:"To render the buttons, the state exposes three methods to build previous, next and close buttons respectively. The\nstate object controls whether the buttons are enabled or disabled according to whether we are at first page (in which\ncase previous button should be disabled), at last page (in which case next button should be disabled), or if the\npaginator has already closed, in which case all buttons should be disabled."}),"\n"]}),"\n",(0,o.jsx)(n.admonition,{type:"info",children:(0,o.jsxs)(n.p,{children:["The paginator automatically closes as per the ",(0,o.jsx)(n.code,{children:"await_component_timeout_seconds"})," value defined in\nthe ",(0,o.jsx)(n.a,{href:"/docs/interaction-library/configuration",children:"configuration"}),"."]})})]})}function u(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(m,{...e})}):m(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>s});var o=t(6540);const i={},a=o.createContext(i);function r(e){const n=o.useContext(a);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),o.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/4539ade8.3eeb2d0c.js b/assets/js/4539ade8.3eeb2d0c.js deleted file mode 100644 index a3a0dd7..0000000 --- a/assets/js/4539ade8.3eeb2d0c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[281],{3905:function(e,t,n){n.d(t,{Zo:function(){return s},kt:function(){return m}});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 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 r(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){o(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,o=function(e,t){if(null==e)return{};var n,i,o={},a=Object.keys(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||(o[n]=e[n]);return o}(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)&&(o[n]=e[n])}return o}var p=i.createContext({}),c=function(e){var t=i.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):r(r({},t),e)),n},s=function(e){var t=c(e.components);return i.createElement(p.Provider,{value:t},e.children)},d={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,o=e.mdxType,a=e.originalType,p=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),u=c(n),m=o,g=u["".concat(p,".").concat(m)]||u[m]||d[m]||a;return n?i.createElement(g,r(r({ref:t},s),{},{components:n})):i.createElement(g,r({ref:t},s))}));function m(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=n.length,r=new Array(a);r[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,r[1]=l;for(var c=2;c<a;c++)r[c]=n[c];return i.createElement.apply(null,r)}return i.createElement.apply(null,n)}u.displayName="MDXCreateElement"},6334:function(e,t,n){n.r(t),n.d(t,{frontMatter:function(){return l},metadata:function(){return p},toc:function(){return c},default:function(){return d}});var i=n(7462),o=n(3366),a=(n(7294),n(3905)),r=["components"],l={title:"Configuring your bot"},p={unversionedId:"api/configuring-your-bot",id:"api/configuring-your-bot",isDocsHomePage:!1,title:"Configuring your bot",description:"Standardizing the way to configure a bot is one of the primary goals of Botrino. This section will cover the configuration part more in detail, how to access the values of the configuration file in your code, and how to add your own configuration entries for your application.",source:"@site/docs/api/configuring-your-bot.md",sourceDirName:"api",slug:"/api/configuring-your-bot",permalink:"/docs/api/configuring-your-bot",editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/api/configuring-your-bot.md",version:"current",frontMatter:{title:"Configuring your bot"},sidebar:"someSidebar",previous:{title:"Working with services",permalink:"/docs/api/working-with-services"},next:{title:"Customizing the Discord client",permalink:"/docs/api/customizing-the-discord-client"}},c=[{value:"The configuration JSON",id:"the-configuration-json",children:[{value:"The <code>ConfigContainer</code>",id:"the-configcontainer",children:[]},{value:"Built-in configuration entries",id:"built-in-configuration-entries",children:[]},{value:"Adding your own configuration entries",id:"adding-your-own-configuration-entries",children:[]}]},{value:"Customizing the JSON source",id:"customizing-the-json-source",children:[]}],s={toc:c};function d(e){var t=e.components,n=(0,o.Z)(e,r);return(0,a.kt)("wrapper",(0,i.Z)({},s,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Standardizing the way to configure a bot is one of the primary goals of Botrino. This section will cover the configuration part more in detail, how to access the values of the configuration file in your code, and how to add your own configuration entries for your application."),(0,a.kt)("h2",{id:"the-configuration-json"},"The configuration JSON"),(0,a.kt)("p",null,"The configuration is a JSON object, by default located in a ",(0,a.kt)("inlineCode",{parentName:"p"},"config.json")," in the runtime directory, each field at the root of the object corresponds to one entry and maps to one class in the Java code."),(0,a.kt)("h3",{id:"the-configcontainer"},"The ",(0,a.kt)("inlineCode",{parentName:"h3"},"ConfigContainer")),(0,a.kt)("p",null,"In order to access the values of the configuration in the Java code, Botrino exposes the object ",(0,a.kt)("inlineCode",{parentName:"p"},"ConfigContainer")," as a service that you can inject in your own code. An example below:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-java"},"package com.example.myproject;\n\nimport botrino.api.config.ConfigContainer;\nimport botrino.api.config.object.BotConfig;\nimport com.github.alex1304.rdi.finder.annotation.RdiFactory;\nimport com.github.alex1304.rdi.finder.annotation.RdiService;\n\n@RdiService\npublic final class SomeService {\n\n private final BotConfig botConfig;\n\n @RdiFactory\n public SomeService(ConfigContainer configContainer) {\n this.botConfig = configContainer.get(BotConfig.class);\n }\n}\n")),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"ConfigContainer#get(Class)")," method is what allows you to access the entries of the JSON config inside your code."),(0,a.kt)("h3",{id:"built-in-configuration-entries"},"Built-in configuration entries"),(0,a.kt)("p",null,"Botrino comes with a few configuration entries by default. Here is the list of them below for reference."),(0,a.kt)("h4",{id:"the-bot-entry"},"The ",(0,a.kt)("inlineCode",{parentName:"h4"},"bot")," entry"),(0,a.kt)("p",null,"This entry is where you input the bot information (token, presence, intents, etc)."),(0,a.kt)("p",null,"JSON structure for ",(0,a.kt)("inlineCode",{parentName:"p"},"bot"),":"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:null},"Field"),(0,a.kt)("th",{parentName:"tr",align:null},"Type"),(0,a.kt)("th",{parentName:"tr",align:null},"Description"),(0,a.kt)("th",{parentName:"tr",align:null},"Required?"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"token"),(0,a.kt)("td",{parentName:"tr",align:null},"string"),(0,a.kt)("td",{parentName:"tr",align:null},"the token of the bot, generated in the ",(0,a.kt)("a",{parentName:"td",href:"https://discord.com/developers/applications"},"Discord Developer portal")),(0,a.kt)("td",{parentName:"tr",align:null},"Yes")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"presence"),(0,a.kt)("td",{parentName:"tr",align:null},"object"),(0,a.kt)("td",{parentName:"tr",align:null},"the presence of the bot in Discord"),(0,a.kt)("td",{parentName:"tr",align:null},"No, defaults to ",(0,a.kt)("inlineCode",{parentName:"td"},'{"status":"online"}'))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"enabled_intents"),(0,a.kt)("td",{parentName:"tr",align:null},"integer"),(0,a.kt)("td",{parentName:"tr",align:null},"the ",(0,a.kt)("a",{parentName:"td",href:"https://discord.com/developers/docs/topics/gateway#gateway-intents"},"Gateway Intents")," to enable"),(0,a.kt)("td",{parentName:"tr",align:null},"No, defaults to ",(0,a.kt)("inlineCode",{parentName:"td"},"32509")," (all non-privileged intents)")))),(0,a.kt)("p",null,"JSON structure for ",(0,a.kt)("inlineCode",{parentName:"p"},"presence"),":"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:null},"Field"),(0,a.kt)("th",{parentName:"tr",align:null},"Type"),(0,a.kt)("th",{parentName:"tr",align:null},"Description"),(0,a.kt)("th",{parentName:"tr",align:null},"Required?"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"status"),(0,a.kt)("td",{parentName:"tr",align:null},"string"),(0,a.kt)("td",{parentName:"tr",align:null},'one of "online", "idle", "do_not_disturb", "invisible"'),(0,a.kt)("td",{parentName:"tr",align:null},'No, defaults to "online"')),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"activity_type"),(0,a.kt)("td",{parentName:"tr",align:null},"string"),(0,a.kt)("td",{parentName:"tr",align:null},'one of "playing", "watching", "listening", "streaming"'),(0,a.kt)("td",{parentName:"tr",align:null},"No")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"activity_text"),(0,a.kt)("td",{parentName:"tr",align:null},"string"),(0,a.kt)("td",{parentName:"tr",align:null},"the text to display in the presence activity of the bot"),(0,a.kt)("td",{parentName:"tr",align:null},"No")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"streaming_url"),(0,a.kt)("td",{parentName:"tr",align:null},"string"),(0,a.kt)("td",{parentName:"tr",align:null},'the streaming URL, only applicable if "streaming" is set as ',(0,a.kt)("inlineCode",{parentName:"td"},"activity_text")),(0,a.kt)("td",{parentName:"tr",align:null},"No, defaults to ",(0,a.kt)("inlineCode",{parentName:"td"},"http://127.0.0.1"))))),(0,a.kt)("p",null,"Example:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-json"},'{\n "bot": {\n "token": "yourTokenHere",\n "presence": {\n "status": "online",\n "activity_type": "playing",\n "activity_text": "Hello world!"\n },\n "enabled_intents": 32509\n }\n}\n')),(0,a.kt)("p",null,"The corresponding class in the Java code is ",(0,a.kt)("inlineCode",{parentName:"p"},"botrino.api.config.object.BotConfig"),", accessed via ",(0,a.kt)("inlineCode",{parentName:"p"},"ConfigContainer.get(BotConfig.class)"),"."),(0,a.kt)("h3",{id:"adding-your-own-configuration-entries"},"Adding your own configuration entries"),(0,a.kt)("p",null,"The configuration JSON can of course be extended with more entries to include your own parameters."),(0,a.kt)("h4",{id:"creating-the-configuration-object"},"Creating the configuration object"),(0,a.kt)("p",null,"First step is to create a POJO like this:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-java"},'package com.example.myproject;\n\nimport botrino.api.annotation.ConfigEntry;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\n\n@JsonDeserialize\n@ConfigEntry("my_config")\npublic final class MyConfig {\n\n private String myProperty;\n private long myValue;\n\n public String getMyProperty() {\n return myProperty;\n }\n\n @JsonProperty("my_property")\n public void setMyProperty(String myProperty) {\n this.myProperty = myProperty;\n }\n\n public long getMyValue() {\n return myValue;\n }\n\n @JsonProperty("my_value")\n public void setMyValue(long myValue) {\n this.myValue = myValue;\n }\n}\n')),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"The ",(0,a.kt)("inlineCode",{parentName:"li"},"@JsonDeserialize")," annotation is to indicate that this class is intended for being constructed from a JSON input, processed by the Jackson library."),(0,a.kt)("li",{parentName:"ul"},"The ",(0,a.kt)("inlineCode",{parentName:"li"},"@ConfigEntry")," annotation allows Botrino to recognize it as a configuration object to be registered in the ",(0,a.kt)("inlineCode",{parentName:"li"},"ConfigContainer"),", and to indicate the name of the field in the configuration file.")),(0,a.kt)("h4",{id:"adding-the-entry-in-the-json-file"},"Adding the entry in the JSON file"),(0,a.kt)("p",null,"Once you've created the object, you can add the following in your ",(0,a.kt)("inlineCode",{parentName:"p"},"config.json"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-json",metastring:"{8-11}","{8-11}":!0},'{\n "bot": {\n ...\n },\n "i18n": {\n ...\n },\n "my_config": {\n "my_property": "hello!!!",\n "my_value": 42\n }\n}\n')),(0,a.kt)("div",{className:"admonition admonition-info alert alert--info"},(0,a.kt)("div",{parentName:"div",className:"admonition-heading"},(0,a.kt)("h5",{parentName:"div"},(0,a.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,a.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,a.kt)("path",{parentName:"svg",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"}))),"info")),(0,a.kt)("div",{parentName:"div",className:"admonition-content"},(0,a.kt)("p",{parentName:"div"},"The name of the root field in the JSON must match with the name given in the ",(0,a.kt)("inlineCode",{parentName:"p"},"@ConfigEntry")," annotation."))),(0,a.kt)("h4",{id:"using-the-configuration-object"},"Using the configuration object"),(0,a.kt)("p",null,"To test this, we can create a sample service injecting the ",(0,a.kt)("inlineCode",{parentName:"p"},"ConfigContainer"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-java"},'package com.example.myproject;\n\nimport botrino.api.config.ConfigContainer;\nimport com.github.alex1304.rdi.finder.annotation.RdiFactory;\nimport com.github.alex1304.rdi.finder.annotation.RdiService;\nimport reactor.util.Logger;\nimport reactor.util.Loggers;\n\n@RdiService\npublic final class SampleService {\n\n private static final Logger LOGGER = Loggers.getLogger(SampleService.class);\n\n @RdiFactory\n public SampleService(ConfigContainer configContainer) {\n var myConfig = configContainer.get(MyConfig.class);\n LOGGER.info("My property = {}, my value = {}", myConfig.getMyProperty(), myConfig.getMyValue());\n }\n}\n')),(0,a.kt)("p",null,"When running, it should give the following output:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"00:16:42.193 [main] DEBUG botrino.api.Botrino - Discovered config entry com.example.myproject.MyConfig\n00:16:42.468 [main] INFO com.example.myproject.SampleService - My property = hello!!!, my value = 42\n")),(0,a.kt)("h2",{id:"customizing-the-json-source"},"Customizing the JSON source"),(0,a.kt)("p",null,"It is possible to override the behavior of Botrino when loading the configuration by implementing the ",(0,a.kt)("inlineCode",{parentName:"p"},"ConfigReader")," interface. This interface has two methods, none of them are required to be implemented:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"String loadConfigJson(Path botDirectory) throws IOException"),': Allows to customize the way the configuration file is loaded. It is useful if you want to load the configuration from a file that is located at a different path or that has a different name than "config.json". You can even ignore the ',(0,a.kt)("inlineCode",{parentName:"li"},"botDirectory")," parameter and load the JSON from a different source, or directly return a hard-coded JSON string for testing purposes for example. Note that this method throws ",(0,a.kt)("inlineCode",{parentName:"li"},"IOException")," and that the return type is not reactive: indeed, this method is ran by Botrino on the main thread at the very start of the program, as such it does not need to be (and shouldn't be) asynchronous. This method is not required to be implemented: it has a default implementation that will simply read the JSON string from a file named ",(0,a.kt)("inlineCode",{parentName:"li"},"config.json")," at the root of ",(0,a.kt)("inlineCode",{parentName:"li"},"botDirectory"),"."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"ObjectMapper createConfigObjectMapper()"),": Allows to customize the Jackson ",(0,a.kt)("inlineCode",{parentName:"li"},"ObjectMapper")," instance used to parse the JSON string. You can for example register extra modules and deserializers. This method is not required to be implemented: by default it will create an ",(0,a.kt)("inlineCode",{parentName:"li"},"ObjectMapper")," with only the ",(0,a.kt)("inlineCode",{parentName:"li"},"Jdk8Module")," registered (allows to recognize types such as ",(0,a.kt)("inlineCode",{parentName:"li"},"java.util.Optional"),").")),(0,a.kt)("p",null,"If no ",(0,a.kt)("inlineCode",{parentName:"p"},"ConfigReader")," implementation is found in your module, it will use a default one which can be recreated like this:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-java"},'package com.example.myproject;\n\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport com.fasterxml.jackson.datatype.jdk8.Jdk8Module;\nimport reactor.core.publisher.Mono;\n\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\n\npublic final class DefaultConfigReader implements ConfigReader {\n\n @Override\n public String loadConfigJson(Path botDirectory) throws IOException {\n return Files.readString(botDirectory.resolve("config.json"));\n }\n\n @Override\n public ObjectMapper createConfigObjectMapper() {\n return new ObjectMapper().registerModule(new Jdk8Module());\n }\n}\n')),(0,a.kt)("div",{className:"admonition admonition-caution alert alert--warning"},(0,a.kt)("div",{parentName:"div",className:"admonition-heading"},(0,a.kt)("h5",{parentName:"div"},(0,a.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,a.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},(0,a.kt)("path",{parentName:"svg",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"}))),"caution")),(0,a.kt)("div",{parentName:"div",className:"admonition-content"},(0,a.kt)("ul",{parentName:"div"},(0,a.kt)("li",{parentName:"ul"},"The implementation class must have a no-arg constructor."),(0,a.kt)("li",{parentName:"ul"},"If more than one implementation of ",(0,a.kt)("inlineCode",{parentName:"li"},"ConfigReader")," are found, it will result in an error as it is impossible to determine which one to use. If you don't want to remove the extra implementation(s), you can mark one of them with the ",(0,a.kt)("inlineCode",{parentName:"li"},"@Primary")," annotation to lift the ambiguity. You may alternatively use the ",(0,a.kt)("inlineCode",{parentName:"li"},"@Exclude")," annotation if you don't want one implementation to be picked up by Botrino.")))))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/486.f61f8262.js b/assets/js/486.f61f8262.js deleted file mode 100644 index e632455..0000000 --- a/assets/js/486.f61f8262.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see 486.f61f8262.js.LICENSE.txt */ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[486],{6742:function(e,n,t){t.d(n,{Z:function(){return l}});var r=t(3366),o=t(7294),u=t(3727),i=t(3919),a=t(412),c=(0,o.createContext)({collectLink:function(){}}),s=t(4996),f=["isNavLink","to","href","activeClassName","isActive","data-noBrokenLinkCheck","autoAddBaseUrl"];var l=function(e){var n,t,l,v=e.isNavLink,d=e.to,p=e.href,g=e.activeClassName,h=e.isActive,m=e["data-noBrokenLinkCheck"],y=e.autoAddBaseUrl,w=void 0===y||y,b=(0,r.Z)(e,f),_=(0,s.C)().withBaseUrl,P=(0,o.useContext)(c),D=d||p,A=(0,i.Z)(D),V=null==D?void 0:D.replace("pathname://",""),E=void 0!==V?(t=V,w&&function(e){return e.startsWith("/")}(t)?_(t):t):void 0,O=(0,o.useRef)(!1),x=v?u.OL:u.rU,S=a.Z.canUseIntersectionObserver;(0,o.useEffect)((function(){return!S&&A&&null!=E&&window.docusaurus.prefetch(E),function(){S&&l&&l.disconnect()}}),[E,S,A]);var j=null!==(n=null==E?void 0:E.startsWith("#"))&&void 0!==n&&n,L=!E||!A||j;return E&&A&&!j&&!m&&P.collectLink(E),L?o.createElement("a",Object.assign({href:E},D&&!A&&{target:"_blank",rel:"noopener noreferrer"},b)):o.createElement(x,Object.assign({},b,{onMouseEnter:function(){O.current||null==E||(window.docusaurus.preload(E),O.current=!0)},innerRef:function(e){var n,t;S&&e&&A&&(n=e,t=function(){null!=E&&window.docusaurus.prefetch(E)},(l=new window.IntersectionObserver((function(e){e.forEach((function(e){n===e.target&&(e.isIntersecting||e.intersectionRatio>0)&&(l.unobserve(n),l.disconnect(),t())}))}))).observe(n))},to:E||""},v&&{isActive:h,activeClassName:g}))}},4973:function(e,n,t){t.d(n,{Z:function(){return l},I:function(){return f}});var r=t(7294),o=/{\w+}/g,u="{}";function i(e,n){var t=[],i=e.replace(o,(function(e){var o=e.substr(1,e.length-2),i=null==n?void 0:n[o];if(void 0!==i){var a=r.isValidElement(i)?i:String(i);return t.push(a),u}return e}));return 0===t.length?e:t.every((function(e){return"string"==typeof e}))?i.split(u).reduce((function(e,n,r){var o;return e.concat(n).concat(null!==(o=t[r])&&void 0!==o?o:"")}),""):i.split(u).reduce((function(e,n,o){return[].concat(e,[r.createElement(r.Fragment,{key:o},n,t[o])])}),[])}function a(e){return i(e.children,e.values)}var c=t(7529);function s(e){var n,t=e.id,r=e.message;return null!==(n=c[null!=t?t:r])&&void 0!==n?n:r}function f(e,n){var t,r=e.message;return i(null!==(t=s({message:r,id:e.id}))&&void 0!==t?t:r,n)}function l(e){var n,t=e.children,o=e.id,u=e.values,i=null!==(n=s({message:t,id:o}))&&void 0!==n?n:t;return r.createElement(a,{values:u},i)}},3919:function(e,n,t){function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}t.d(n,{b:function(){return r},Z:function(){return o}})},8143:function(e,n,t){t.r(n),t.d(n,{BrowserRouter:function(){return r.VK},HashRouter:function(){return r.UT},Link:function(){return r.rU},MemoryRouter:function(){return r.VA},NavLink:function(){return r.OL},Prompt:function(){return r.NL},Redirect:function(){return r.l_},Route:function(){return r.AW},Router:function(){return r.F0},StaticRouter:function(){return r.gx},Switch:function(){return r.rs},generatePath:function(){return r.Gn},matchPath:function(){return r.LX},useHistory:function(){return r.k6},useLocation:function(){return r.TH},useParams:function(){return r.UO},useRouteMatch:function(){return r.$B},withRouter:function(){return r.EN}});var r=t(3727)},4996:function(e,n,t){t.d(n,{C:function(){return u},Z:function(){return i}});var r=t(2263),o=t(3919);function u(){var e=(0,r.Z)().siteConfig,n=(e=void 0===e?{}:e).baseUrl,t=void 0===n?"/":n,u=e.url;return{withBaseUrl:function(e,n){return function(e,n,t,r){var u=void 0===r?{}:r,i=u.forcePrependBaseUrl,a=void 0!==i&&i,c=u.absolute,s=void 0!==c&&c;if(!t)return t;if(t.startsWith("#"))return t;if((0,o.b)(t))return t;if(a)return n+t;var f=t.startsWith(n)?t:n+t.replace(/^\//,"");return s?e+f:f}(u,t,e,n)}}}function i(e,n){return void 0===n&&(n={}),(0,u().withBaseUrl)(e,n)}},8084:function(e,n,t){t.r(n),t.d(n,{default:function(){return o},useAllPluginInstancesData:function(){return u},usePluginData:function(){return i}});var r=t(2263);function o(){var e=(0,r.Z)().globalData;if(!e)throw new Error("Docusaurus global data not found");return e}function u(e){var n=o()[e];if(!n)throw new Error("Docusaurus plugin global data not found for pluginName="+e);return n}function i(e,n){void 0===n&&(n="default");var t=u(e)[n];if(!t)throw new Error("Docusaurus plugin global data not found for pluginName="+e+" and pluginId="+n);return t}},8408:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.getDocVersionSuggestions=n.getActiveDocContext=n.getActiveVersion=n.getLatestVersion=n.getActivePlugin=void 0;var r=t(8143);n.getActivePlugin=function(e,n,t){void 0===t&&(t={});var o=Object.entries(e).find((function(e){e[0];var t=e[1];return!!r.matchPath(n,{path:t.path,exact:!1,strict:!1})})),u=o?{pluginId:o[0],pluginData:o[1]}:void 0;if(!u&&t.failfast)throw new Error("Can't find active docs plugin for pathname="+n+", 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((function(e){return e.path})).join(", "));return u};n.getLatestVersion=function(e){return e.versions.find((function(e){return e.isLast}))};n.getActiveVersion=function(e,t){var o=n.getLatestVersion(e);return[].concat(e.versions.filter((function(e){return e!==o})),[o]).find((function(e){return!!r.matchPath(t,{path:e.path,exact:!1,strict:!1})}))};n.getActiveDocContext=function(e,t){var o,u,i=n.getActiveVersion(e,t),a=null==i?void 0:i.docs.find((function(e){return!!r.matchPath(t,{path:e.path,exact:!0,strict:!1})}));return{activeVersion:i,activeDoc:a,alternateDocVersions:a?(o=a.id,u={},e.versions.forEach((function(e){e.docs.forEach((function(n){n.id===o&&(u[e.name]=n)}))})),u):{}}};n.getDocVersionSuggestions=function(e,t){var r=n.getLatestVersion(e),o=n.getActiveDocContext(e,t),u=o.activeVersion!==r;return{latestDocSuggestion:u?null==o?void 0:o.alternateDocVersions[r.name]:void 0,latestVersionSuggestion:u?r:void 0}}},6730:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.useDocVersionSuggestions=n.useActiveDocContext=n.useActiveVersion=n.useLatestVersion=n.useVersions=n.useActivePluginAndVersion=n.useActivePlugin=n.useDocsData=n.useAllDocsData=void 0;var r=t(655),o=t(8143),u=r.__importStar(t(8084)),i=t(8408);n.useAllDocsData=function(){var e;return null!==(e=u.default()["docusaurus-plugin-content-docs"])&&void 0!==e?e:{}};n.useDocsData=function(e){return u.usePluginData("docusaurus-plugin-content-docs",e)};n.useActivePlugin=function(e){void 0===e&&(e={});var t=n.useAllDocsData(),r=o.useLocation().pathname;return i.getActivePlugin(t,r,e)};n.useActivePluginAndVersion=function(e){void 0===e&&(e={});var t=n.useActivePlugin(e),r=o.useLocation().pathname;if(t)return{activePlugin:t,activeVersion:i.getActiveVersion(t.pluginData,r)}};n.useVersions=function(e){return n.useDocsData(e).versions};n.useLatestVersion=function(e){var t=n.useDocsData(e);return i.getLatestVersion(t)};n.useActiveVersion=function(e){var t=n.useDocsData(e),r=o.useLocation().pathname;return i.getActiveVersion(t,r)};n.useActiveDocContext=function(e){var t=n.useDocsData(e),r=o.useLocation().pathname;return i.getActiveDocContext(t,r)};n.useDocVersionSuggestions=function(e){var t=n.useDocsData(e),r=o.useLocation().pathname;return i.getDocVersionSuggestions(t,r)}},1217:function(e,n,t){t.d(n,{Z:function(){return a}});var r=t(7294),o=t(9105),u=t(9732),i=t(4996);function a(e){var n=e.title,t=e.description,a=e.keywords,c=e.image,s=(0,u.LU)().image,f=(0,u.pe)(n),l=(0,i.Z)(c||s,{absolute:!0});return r.createElement(o.Z,null,n&&r.createElement("title",null,f),n&&r.createElement("meta",{property:"og:title",content:f}),t&&r.createElement("meta",{name:"description",content:t}),t&&r.createElement("meta",{property:"og:description",content:t}),a&&r.createElement("meta",{name:"keywords",content:Array.isArray(a)?a.join(","):a}),l&&r.createElement("meta",{property:"og:image",content:l}),l&&r.createElement("meta",{name:"twitter:image",content:l}),l&&r.createElement("meta",{name:"twitter:card",content:"summary_large_image"}))}},907:function(e,n,t){t.d(n,{Iw:function(){return r.useActiveDocContext},gA:function(){return r.useActivePlugin},zu:function(){return r.useActiveVersion},_r:function(){return r.useAllDocsData},Jo:function(){return r.useDocVersionSuggestions},zh:function(){return r.useDocsData},yW:function(){return r.useLatestVersion},gB:function(){return r.useVersions}});var r=t(6730)},9732:function(e,n,t){t.d(n,{HX:function(){return g},L5:function(){return j},kM:function(){return k},WA:function(){return s},os:function(){return h},Mg:function(){return w},_f:function(){return f},bc:function(){return p},l5:function(){return v},ru:function(){return A},J:function(){return C},LU:function(){return o},pe:function(){return b}});var r=t(2263);function o(){return(0,r.Z)().siteConfig.themeConfig}var u="localStorage";function i(e){if(void 0===e&&(e=u),"undefined"==typeof window)throw new Error("Browser storage is not available on NodeJS / Docusaurus SSR process");if("none"===e)return null;try{return window[e]}catch(t){return n=t,a||(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.",n),a=!0),null}var n}var a=!1;var c={get:function(){return null},set:function(){},del:function(){}};var s=function(e,n){if("undefined"==typeof window)return function(e){function n(){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:n,set:n,del:n}}(e);var t=i(null==n?void 0:n.persistence);return null===t?c:{get:function(){return t.getItem(e)},set:function(n){return t.setItem(e,n)},del:function(){return t.removeItem(e)}}};function f(e){void 0===e&&(e=u);var n=i(e);if(!n)return[];for(var t=[],r=0;r<n.length;r+=1){var o=n.key(r);null!==o&&t.push(o)}return t}var l=t(5977);function v(){var e=(0,r.Z)(),n=e.siteConfig,t=n.baseUrl,o=n.url,u=e.i18n,i=u.defaultLocale,a=u.currentLocale,c=(0,l.TH)().pathname,s=a===i?t:t.replace("/"+a+"/","/"),f=c.replace(t,"");return{createUrl:function(e){var n=e.locale;return""+(e.fullyQualified?o:"")+function(e){return e===i?""+s:""+s+e+"/"}(n)+f}}}var d=/title=(["'])(.*?)\1/;function p(e){var n,t;return null!==(t=null===(n=null==e?void 0:e.match(d))||void 0===n?void 0:n[2])&&void 0!==t?t:""}var g="default";function h(e,n){return"docs-"+e+"-"+n}var m=t(907),y=!!m._r,w=function(e,n){var t=function(e){return!e||(null==e?void 0:e.endsWith("/"))?e:e+"/"};return t(e)===t(n)},b=function(e){var n=(0,r.Z)().siteConfig,t=void 0===n?{}:n,o=t.title,u=t.titleDelimiter,i=void 0===u?"|":u;return e&&e.trim().length?e.trim()+" "+i+" "+o:o},_=t(7294),P=["zero","one","two","few","many","other"];function D(e){return P.filter((function(n){return e.includes(n)}))}D(["one","other"]);function A(e){var n=(0,l.TH)().pathname,t=(0,_.useRef)(n);(0,_.useEffect)((function(){n!==t.current&&(t.current=n,e())}),[n,t,e])}var V=function(e){return"docs-preferred-version-"+e},E={save:function(e,n,t){s(V(e),{persistence:n}).set(t)},read:function(e,n){return s(V(e),{persistence:n}).get()},clear:function(e,n){s(V(e),{persistence:n}).del()}};function O(e){var n=e.pluginIds,t=e.versionPersistence,r=e.allDocsData;var o={};return n.forEach((function(e){o[e]=function(e){var n=E.read(e,t);return r[e].versions.some((function(e){return e.name===n}))?{preferredVersionName:n}:(E.clear(e,t),{preferredVersionName:null})}(e)})),o}function x(){var e=(0,m._r)(),n=o().docs.versionPersistence,t=(0,_.useMemo)((function(){return Object.keys(e)}),[e]),r=(0,_.useState)((function(){return function(e){var n={};return e.forEach((function(e){n[e]={preferredVersionName:null}})),n}(t)})),u=r[0],i=r[1];return(0,_.useEffect)((function(){i(O({allDocsData:e,versionPersistence:n,pluginIds:t}))}),[e,n,t]),[u,(0,_.useMemo)((function(){return{savePreferredVersion:function(e,t){E.save(e,n,t),i((function(n){var r;return Object.assign({},n,((r={})[e]={preferredVersionName:t},r))}))}}}),[i])]}var S=(0,_.createContext)(null);function j(e){var n=e.children;return y?_.createElement(L,null,n):_.createElement(_.Fragment,null,n)}function L(e){var n=e.children,t=x();return _.createElement(S.Provider,{value:t},n)}function C(e){void 0===e&&(e="default");var n=(0,m.zh)(e),t=function(){var e=(0,_.useContext)(S);if(!e)throw new Error("Can't find docs preferred context, maybe you forgot to use the DocsPreferredVersionContextProvider ?");return e}(),r=t[0],o=t[1],u=r[e].preferredVersionName;return{preferredVersion:u?n.versions.find((function(e){return e.name===u})):null,savePreferredVersionName:(0,_.useCallback)((function(n){o.savePreferredVersion(e,n)}),[o])}}var k={page:{blogListPage:"blog-list-page",blogPostPage:"blog-post-page",blogTagsListPage:"blog-tags-list-page",blogTagsPostPage:"blog-tags-post-page",docPage:"doc-page",mdxPage:"mdx-page"},wrapper:{main:"main-wrapper",blogPages:"blog-wrapper",docPages:"docs-wrapper",mdxPages:"mdx-wrapper"}}},6010:function(e,n,t){function r(e){var n,t,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(n=0;n<e.length;n++)e[n]&&(t=r(e[n]))&&(o&&(o+=" "),o+=t);else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function o(){for(var e,n,t=0,o="";t<arguments.length;)(e=arguments[t++])&&(n=r(e))&&(o&&(o+=" "),o+=n);return o}t.d(n,{Z:function(){return o}})},655:function(e,n,t){t.r(n),t.d(n,{__extends:function(){return o},__assign:function(){return u},__rest:function(){return i},__decorate:function(){return a},__param:function(){return c},__metadata:function(){return s},__awaiter:function(){return f},__generator:function(){return l},__createBinding:function(){return v},__exportStar:function(){return d},__values:function(){return p},__read:function(){return g},__spread:function(){return h},__spreadArrays:function(){return m},__spreadArray:function(){return y},__await:function(){return w},__asyncGenerator:function(){return b},__asyncDelegator:function(){return _},__asyncValues:function(){return P},__makeTemplateObject:function(){return D},__importStar:function(){return V},__importDefault:function(){return E},__classPrivateFieldGet:function(){return O},__classPrivateFieldSet:function(){return x}});var r=function(e,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])},r(e,n)};function o(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function t(){this.constructor=e}r(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}var u=function(){return u=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},u.apply(this,arguments)};function i(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}function a(e,n,t,r){var o,u=arguments.length,i=u<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,n,t,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(u<3?o(i):u>3?o(n,t,i):o(n,t))||i);return u>3&&i&&Object.defineProperty(n,t,i),i}function c(e,n){return function(t,r){n(t,r,e)}}function s(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}function f(e,n,t,r){return new(t||(t=Promise))((function(o,u){function i(e){try{c(r.next(e))}catch(n){u(n)}}function a(e){try{c(r.throw(e))}catch(n){u(n)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(i,a)}c((r=r.apply(e,n||[])).next())}))}function l(e,n){var t,r,o,u,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(u){return function(a){return function(u){if(t)throw new TypeError("Generator is already executing.");for(;i;)try{if(t=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=n.call(e,i)}catch(a){u=[6,a],r=0}finally{t=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}}var v=Object.create?function(e,n,t,r){void 0===r&&(r=t),Object.defineProperty(e,r,{enumerable:!0,get:function(){return n[t]}})}:function(e,n,t,r){void 0===r&&(r=t),e[r]=n[t]};function d(e,n){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(n,t)||v(n,e,t)}function p(e){var n="function"==typeof Symbol&&Symbol.iterator,t=n&&e[n],r=0;if(t)return t.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var r,o,u=t.call(e),i=[];try{for(;(void 0===n||n-- >0)&&!(r=u.next()).done;)i.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(t=u.return)&&t.call(u)}finally{if(o)throw o.error}}return i}function h(){for(var e=[],n=0;n<arguments.length;n++)e=e.concat(g(arguments[n]));return e}function m(){for(var e=0,n=0,t=arguments.length;n<t;n++)e+=arguments[n].length;var r=Array(e),o=0;for(n=0;n<t;n++)for(var u=arguments[n],i=0,a=u.length;i<a;i++,o++)r[o]=u[i];return r}function y(e,n,t){if(t||2===arguments.length)for(var r,o=0,u=n.length;o<u;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}function w(e){return this instanceof w?(this.v=e,this):new w(e)}function b(e,n,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=t.apply(e,n||[]),u=[];return r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r;function i(e){o[e]&&(r[e]=function(n){return new Promise((function(t,r){u.push([e,n,t,r])>1||a(e,n)}))})}function a(e,n){try{(t=o[e](n)).value instanceof w?Promise.resolve(t.value.v).then(c,s):f(u[0][2],t)}catch(r){f(u[0][3],r)}var t}function c(e){a("next",e)}function s(e){a("throw",e)}function f(e,n){e(n),u.shift(),u.length&&a(u[0][0],u[0][1])}}function _(e){var n,t;return n={},r("next"),r("throw",(function(e){throw e})),r("return"),n[Symbol.iterator]=function(){return this},n;function r(r,o){n[r]=e[r]?function(n){return(t=!t)?{value:w(e[r](n)),done:"return"===r}:o?o(n):n}:o}}function P(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,t=e[Symbol.asyncIterator];return t?t.call(e):(e=p(e),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise((function(r,o){(function(e,n,t,r){Promise.resolve(r).then((function(n){e({value:n,done:t})}),n)})(r,o,(n=e[t](n)).done,n.value)}))}}}function D(e,n){return Object.defineProperty?Object.defineProperty(e,"raw",{value:n}):e.raw=n,e}var A=Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n};function V(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&v(n,e,t);return A(n,e),n}function E(e){return e&&e.__esModule?e:{default:e}}function O(e,n,t,r){if("a"===t&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof n?e!==n||!r:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?r:"a"===t?r.call(e):r?r.value:n.get(e)}function x(e,n,t,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof n?e!==n||!o:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,t):o?o.value=t:n.set(e,t),t}}}]); \ No newline at end of file diff --git a/assets/js/486.f61f8262.js.LICENSE.txt b/assets/js/486.f61f8262.js.LICENSE.txt deleted file mode 100644 index c18ab1d..0000000 --- a/assets/js/486.f61f8262.js.LICENSE.txt +++ /dev/null @@ -1,14 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ diff --git a/assets/js/4a782de2.d6dc3ce6.js b/assets/js/4a782de2.d6dc3ce6.js new file mode 100644 index 0000000..76e6515 --- /dev/null +++ b/assets/js/4a782de2.d6dc3ce6.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[884],{7540:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>a,default:()=>h,frontMatter:()=>r,metadata:()=>c,toc:()=>s});var i=t(4848),o=t(8453);const r={title:"Acknowledging interactions"},a=void 0,c={id:"interaction-library/acknowledging-interactions",title:"Acknowledging interactions",description:"When an interaction event is received from the gateway, the library is able to acknowledge them automatically. This",source:"@site/docs/interaction-library/acknowledging-interactions.mdx",sourceDirName:"interaction-library",slug:"/interaction-library/acknowledging-interactions",permalink:"/docs/interaction-library/acknowledging-interactions",draft:!1,unlisted:!1,editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/interaction-library/acknowledging-interactions.mdx",tags:[],version:"current",frontMatter:{title:"Acknowledging interactions"},sidebar:"someSidebar",previous:{title:"Creating commands",permalink:"/docs/interaction-library/creating-commands"},next:{title:"Dealing with components",permalink:"/docs/interaction-library/dealing-with-components"}},d={},s=[{value:"Modifying the default acknowledgment behavior",id:"modifying-the-default-acknowledgment-behavior",level:2},{value:"Overriding the acknowledgment mode on a per-command basis",id:"overriding-the-acknowledgment-mode-on-a-per-command-basis",level:2}];function l(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["When an interaction event is received from the gateway, the library is able to acknowledge them automatically. This\nallows to simplify your code a lot, as you can directly use ",(0,i.jsx)(n.code,{children:"createFollowup()"})," or ",(0,i.jsx)(n.code,{children:"editReply()"})," without worrying about\nchoosing between ",(0,i.jsx)(n.code,{children:"reply()"}),", ",(0,i.jsx)(n.code,{children:"edit()"}),", ",(0,i.jsx)(n.code,{children:"deferReply()"})," or ",(0,i.jsx)(n.code,{children:"deferEdit()"})," first. If you have a specific use case that\nrequires you to take full control over the acknowledgment process, the library gets you covered by offering a way to\ndisable automatic acknowledgment on a per-command basis."]}),"\n",(0,i.jsx)(n.h2,{id:"modifying-the-default-acknowledgment-behavior",children:"Modifying the default acknowledgment behavior"}),"\n",(0,i.jsxs)(n.p,{children:["This was partially covered in the ",(0,i.jsx)(n.a,{href:"/docs/interaction-library/configuration",children:"Configuration"})," page, the default behavior can be set via\nthe ",(0,i.jsx)(n.code,{children:"default_ack_mode"})," field of ",(0,i.jsx)(n.code,{children:"config.json"})," if you are using the Botrino framework, or\nvia ",(0,i.jsx)(n.code,{children:"InteractionConfig.Builder#defaultACKMode(String)"})," when building the configuration manually. Here's a table\ndescribing the possible values and their behavior:"]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"value"}),(0,i.jsx)(n.th,{children:"behavior"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"default"})}),(0,i.jsxs)(n.td,{children:["Equivalent to ",(0,i.jsx)(n.code,{children:"defer"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"defer"})}),(0,i.jsxs)(n.td,{children:["Automatically calls ",(0,i.jsx)(n.code,{children:"deferReply()"})," (for commands) or ",(0,i.jsx)(n.code,{children:"deferEdit()"})," (for components)."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"defer_ephemeral"})}),(0,i.jsxs)(n.td,{children:["Automatically calls ",(0,i.jsx)(n.code,{children:"deferReply().withEphemeral(true)"})," (for commands) or ",(0,i.jsx)(n.code,{children:"deferEdit().withEphemeral(true)"})," (for components)."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"none"})}),(0,i.jsx)(n.td,{children:"Does not call any acknowledgment method."})]})]})]}),"\n",(0,i.jsx)(n.h2,{id:"overriding-the-acknowledgment-mode-on-a-per-command-basis",children:"Overriding the acknowledgment mode on a per-command basis"}),"\n",(0,i.jsxs)(n.p,{children:["Let's say you have ",(0,i.jsx)(n.code,{children:"defer"})," as default behavior in your config, and you want to make a command that replies exclusively\nwith ephemeral messages. There would be no way to achieve this without overriding the acknowledgment behavior for this\nspecific command so that it can be ephemeral. This is as simple as adding an ",(0,i.jsx)(n.code,{children:"@Acknowledge"})," annotation with the desired\nmode as value:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-java",metastring:"{9}",children:'package testbot1;\n\nimport botrino.interaction.annotation.Acknowledge;\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport org.reactivestreams.Publisher;\n\n@Acknowledge(Acknowledge.Mode.DEFER_EPHEMERAL)\n@ChatInputCommand(name = "ping", description = "Pings the bot to check if it is alive.")\npublic final class PingCommand implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return ctx.event().createFollowup("Pong!").withEphemeral(true);\n }\n}\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Since this is a very simple command, you could even completely disable automatic acknowledgment and use ",(0,i.jsx)(n.code,{children:"reply()"}),"\ninstead of ",(0,i.jsx)(n.code,{children:"createFollowup()"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-java",children:'package testbot1;\n\nimport botrino.interaction.annotation.Acknowledge;\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport org.reactivestreams.Publisher;\n\n@Acknowledge(Acknowledge.Mode.NONE)\n@ChatInputCommand(name = "ping", description = "Pings the bot to check if it is alive.")\npublic final class PingCommand implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return ctx.event().reply("Pong!").withEphemeral(true);\n }\n}\n'})}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsxs)(n.p,{children:["If your command is made of subcommands or subcommand groups, the ",(0,i.jsx)(n.code,{children:"@Acknowledge"})," annotation must be used on the listener\nimplementation class of individual subcommands; putting it on the parent class alongside ",(0,i.jsx)(n.code,{children:"@ChatInputCommand"})," will have\nno effect."]})})]})}function h(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>c});var i=t(6540);const o={},r=i.createContext(o);function a(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:a(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/518c7f92.31849ffd.js b/assets/js/518c7f92.31849ffd.js new file mode 100644 index 0000000..37997a8 --- /dev/null +++ b/assets/js/518c7f92.31849ffd.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[968],{6884:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>u,contentTitle:()=>l,default:()=>h,frontMatter:()=>c,metadata:()=>d,toc:()=>m});var o=t(4848),i=t(8453),a=t(6025),r=t(1470),s=t(9365);const c={title:"Overview"},l=void 0,d={id:"interaction-library/overview",title:"Overview",description:"Botrino comes with a library that allows to easily create application commands and listeners for Discord interactions.",source:"@site/docs/interaction-library/overview.mdx",sourceDirName:"interaction-library",slug:"/interaction-library/overview",permalink:"/docs/interaction-library/overview",draft:!1,unlisted:!1,editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/interaction-library/overview.mdx",tags:[],version:"current",frontMatter:{title:"Overview"},sidebar:"someSidebar",previous:{title:"Internationalization",permalink:"/docs/api/i18n"},next:{title:"Configuration",permalink:"/docs/interaction-library/configuration"}},u={},m=[{value:"Preamble",id:"preamble",level:2},{value:"Features",id:"features",level:2},{value:"Quick start",id:"quick-start",level:2},{value:"Option 1: Using Botrino framework",id:"option-1-using-botrino-framework",level:3},{value:"Option 2: Using the library alone",id:"option-2-using-the-library-alone",level:3},{value:"Creating your first commands",id:"creating-your-first-commands",level:2},{value:"A basic ping command",id:"a-basic-ping-command",level:3},{value:"A command with options",id:"a-command-with-options",level:3},{value:"A command with subcommands and subcommand groups",id:"a-command-with-subcommands-and-subcommand-groups",level:3},{value:"A command using component interactions",id:"a-command-using-component-interactions",level:3},{value:"A command using a pagination system based on components",id:"a-command-using-a-pagination-system-based-on-components",level:3}];function p(n){const e={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...n.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(e.p,{children:["Botrino comes with a library that allows to easily create application commands and listeners for Discord interactions.\nDiscord recently added ",(0,o.jsx)(e.a,{href:"https://discord.com/developers/docs/interactions/application-commands",children:"Application Commands"})," as\na native way to implement commands within Discord, as well\nas ",(0,o.jsx)(e.a,{href:"https://discord.com/developers/docs/interactions/message-components",children:"Message Components"})," to allow for more specific\nand intuitive interactions with the bot."]}),"\n",(0,o.jsx)(e.h2,{id:"preamble",children:"Preamble"}),"\n",(0,o.jsx)(e.p,{children:"Although it is designed to be an extension of the Botrino framework, this library is completely decoupled from the\nframework itself. As such, it is possible to add this library to your project even if you aren't using the framework.\nThe only difference is that you won't benefit from the automatic registration of commands, but you will be able to use\nall features."}),"\n",(0,o.jsx)(e.h2,{id:"features",children:"Features"}),"\n",(0,o.jsxs)(e.ul,{children:["\n",(0,o.jsx)(e.li,{children:"Straightforward annotation-based command declaration, with full support for slash commands with subcommands/subcommand\ngroups and context menu commands"}),"\n",(0,o.jsx)(e.li,{children:"Automatic deployment of commands into the Discord application, with ability to choose whether to deploy them globally\nor in a specific guild during development"}),"\n",(0,o.jsx)(e.li,{children:"Inject command options into fields using annotations to conveniently access the values"}),"\n",(0,o.jsx)(e.li,{children:"Handle component interactions either by treating them as regular commands or by awaiting them in order to continue the\nexecution of a parent command"}),"\n",(0,o.jsx)(e.li,{children:"Automatic ACK of interaction events, configurable on a per-command basis"}),"\n",(0,o.jsx)(e.li,{children:"Define privileges for each command with your own rules"}),"\n",(0,o.jsx)(e.li,{children:"Cooldown per user"}),"\n",(0,o.jsx)(e.li,{children:"Centralized error handling"}),"\n",(0,o.jsx)(e.li,{children:"Pre-process interaction events by filtering them or adapting the locale to the target user"}),"\n",(0,o.jsx)(e.li,{children:"Utilities such as pagination system using buttons"}),"\n"]}),"\n",(0,o.jsx)(e.h2,{id:"quick-start",children:"Quick start"}),"\n",(0,o.jsx)(e.admonition,{title:"Prerequisites",type:"info",children:(0,o.jsxs)(e.p,{children:["JDK 17 or newer is required. You can download the\nOpenJDK ",(0,o.jsx)(e.a,{href:"https://adoptopenjdk.net/?variant=openjdk11&jvmVariant=hotspot",children:"here"}),"."]})}),"\n",(0,o.jsxs)(e.p,{children:["You have two ways to start a project. ",(0,o.jsx)(e.strong,{children:"Choose only one of the two options."})]}),"\n",(0,o.jsx)(e.h3,{id:"option-1-using-botrino-framework",children:"Option 1: Using Botrino framework"}),"\n",(0,o.jsxs)(e.ol,{children:["\n",(0,o.jsxs)(e.li,{children:["\n",(0,o.jsxs)(e.p,{children:["Initialize your project by following the steps in the ",(0,o.jsx)(e.a,{href:"/docs/getting-started",children:"Getting Started page"}),"."]}),"\n",(0,o.jsx)(e.admonition,{type:"tip",children:(0,o.jsx)(e.p,{children:"If you decide to use the Maven archetype, the library will be already added, so you won't need to follow the next\nsteps! Otherwise, continue reading."})}),"\n"]}),"\n",(0,o.jsxs)(e.li,{children:["\n",(0,o.jsxs)(e.p,{children:["Add the following dependency in your project. Replace [VERSION] with the latest version as shown\nhere: ",(0,o.jsx)(e.a,{href:"https://search.maven.org/artifact/com.alex1304.botrino/botrino-interaction",children:(0,o.jsx)(e.img,{src:"https://img.shields.io/maven-central/v/com.alex1304.botrino/botrino-interaction",alt:"Maven Central"})})]}),"\n",(0,o.jsxs)(r.A,{groupId:"build-tools",defaultValue:"maven",values:[{label:"Maven",value:"maven"},{label:"Gradle",value:"gradle"}],children:[(0,o.jsx)(s.A,{value:"maven",children:(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-xml",children:"<dependency>\n <groupId>com.alex1304.botrino</groupId>\n <artifactId>botrino-interaction</artifactId>\n <version>[VERSION]</version>\n</dependency>\n"})})}),(0,o.jsx)(s.A,{value:"gradle",children:(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-groovy",children:"repositories {\n mavenCentral()\n}\n\ndependencies {\n implementation 'com.alex1304.botrino:botrino-interaction:[VERSION]'\n}\n"})})})]}),"\n"]}),"\n",(0,o.jsxs)(e.li,{children:["\n",(0,o.jsxs)(e.p,{children:["Add ",(0,o.jsx)(e.code,{children:"requires botrino.interaction"})," in your ",(0,o.jsx)(e.code,{children:"module-info.java"}),". You can actually remove ",(0,o.jsx)(e.code,{children:"requires botrino.api"}),"\nsince ",(0,o.jsx)(e.code,{children:"botrino.interaction"})," is already requiring it transitively."]}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-java",children:"import botrino.api.annotation.BotModule;\n\n@BotModule\nopen module com.example.myproject {\n\n requires botrino.interaction;\n}\n"})}),"\n"]}),"\n",(0,o.jsxs)(e.li,{children:["\n",(0,o.jsxs)(e.p,{children:["Add the following line in the end of your ",(0,o.jsx)(e.code,{children:"config.json"}),":"]}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-json",children:' {\n // ...\n "interaction": {}\n }\n'})}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(e.p,{children:["You are now ready to add commands to your application, they will be registered automatically! You can jump directly to\nthe ",(0,o.jsx)(e.a,{href:"#creating-your-first-commands",children:"Creating your first commands"})," section."]}),"\n",(0,o.jsx)(e.h3,{id:"option-2-using-the-library-alone",children:"Option 2: Using the library alone"}),"\n",(0,o.jsxs)(e.ol,{children:["\n",(0,o.jsxs)(e.li,{children:["\n",(0,o.jsxs)(e.p,{children:["Add the following dependency in your project. Replace [VERSION] with the latest version as shown\nhere: ",(0,o.jsx)(e.a,{href:"https://search.maven.org/artifact/com.alex1304.botrino/botrino-interaction",children:(0,o.jsx)(e.img,{src:"https://img.shields.io/maven-central/v/com.alex1304.botrino/botrino-interaction",alt:"Maven Central"})})]}),"\n",(0,o.jsxs)(r.A,{groupId:"build-tools",defaultValue:"maven",values:[{label:"Maven",value:"maven"},{label:"Gradle",value:"gradle"}],children:[(0,o.jsx)(s.A,{value:"maven",children:(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-xml",children:"<dependency>\n <groupId>com.alex1304.botrino</groupId>\n <artifactId>botrino-interaction</artifactId>\n <version>[VERSION]</version>\n</dependency>\n"})})}),(0,o.jsx)(s.A,{value:"gradle",children:(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-groovy",children:"repositories {\n mavenCentral()\n}\n\ndependencies {\n implementation 'com.alex1304.botrino:botrino-interaction:[VERSION]'\n}\n"})})})]}),"\n"]}),"\n",(0,o.jsxs)(e.li,{children:["\n",(0,o.jsx)(e.p,{children:"Create a main method with these few lines of code:"}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-java",children:"package testbot1;\n\nimport botrino.interaction.InteractionService;\nimport botrino.interaction.config.InteractionConfig;\nimport discord4j.core.DiscordClient;\n\npublic final class Main {\n\n public static void main(String[] args) {\n final var config = InteractionConfig.builder()\n // Slash commands will be deployed to this guild (recommended during dev).\n // Not specifying anything will deploy globally.\n .applicationCommandsGuildId(361255823357509645L)\n .build();\n // Login to Discord using the token passed as program argument\n final var gateway = DiscordClient.create(args[0]).login().block();\n // Initialize the interaction service\n final var interactionService = InteractionService.create(config, gateway);\n // Register your commands\n interactionService.registerChatInputCommand(new PingCommand());\n // Listen for interaction events until the bot disconnects\n interactionService.run().takeUntilOther(gateway.onDisconnect()).block();\n }\n}\n"})}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(e.h2,{id:"creating-your-first-commands",children:"Creating your first commands"}),"\n",(0,o.jsx)(e.h3,{id:"a-basic-ping-command",children:"A basic ping command"}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-java",children:'package testbot1;\n\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport org.reactivestreams.Publisher;\n\n@ChatInputCommand(name = "ping", description = "Pings the bot to check if it is alive.")\npublic final class PingCommand implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return ctx.event().createFollowup("Pong !");\n }\n}\n'})}),"\n",(0,o.jsx)(e.h3,{id:"a-command-with-options",children:"A command with options"}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-java",children:'package testbot1;\n\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport botrino.interaction.grammar.ChatInputCommandGrammar;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport discord4j.core.object.command.ApplicationCommandOption;\nimport discord4j.discordjson.json.ApplicationCommandOptionData;\nimport org.reactivestreams.Publisher;\n\nimport java.util.List;\n\n@ChatInputCommand(name = "options", description = "Option testing")\npublic class OptionsCommand implements ChatInputInteractionListener {\n\n private final ChatInputCommandGrammar<Options> grammar = ChatInputCommandGrammar.of(Options.class);\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return grammar.resolve(ctx.event()).flatMap(options -> ctx.event()\n .createFollowup("Value of `my-string`: " + options.myString));\n }\n\n @Override\n public List<ApplicationCommandOptionData> options() {\n return grammar.toOptions();\n }\n\n private static class Options {\n @ChatInputCommandGrammar.Option(\n type = ApplicationCommandOption.Type.STRING,\n name = "my-string",\n description = "The string argument",\n required = true,\n choices = {\n @ChatInputCommandGrammar.Choice(name = "Choice 1", stringValue = "1"),\n @ChatInputCommandGrammar.Choice(name = "Choice 2", stringValue = "2"),\n @ChatInputCommandGrammar.Choice(name = "Choice 3", stringValue = "3")\n }\n )\n String myString;\n }\n}\n'})}),"\n",(0,o.jsx)(e.h3,{id:"a-command-with-subcommands-and-subcommand-groups",children:"A command with subcommands and subcommand groups"}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-java",children:'@ChatInputCommand(\n name = "nest",\n description = "Subcommand testing",\n subcommands = {\n @Subcommand(name = "sub1", description = "Subcommand 1", listener = NestCommand.Sub1.class),\n @Subcommand(name = "sub2", description = "Subcommand 2", listener = NestCommand.Sub2.class)\n },\n subcommandGroups = {\n @SubcommandGroup(name = "group1", description = "Group 1", subcommands = {\n @Subcommand(name = "sub", description = "Subcommand", listener = NestCommand.G1Sub.class)\n })\n }\n)\npublic final class NestCommand {\n\n public static final class Sub1 implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return ctx.event().createFollowup("sub1: pong!");\n }\n }\n\n public static final class Sub2 implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return ctx.event().createFollowup("sub2: pong!");\n }\n }\n\n public static final class G1Sub implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return ctx.event().createFollowup("group1 sub: pong!");\n }\n }\n}\n'})}),"\n",(0,o.jsx)(e.h3,{id:"a-command-using-component-interactions",children:"A command using component interactions"}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-java",children:'package testbot1;\n\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport discord4j.core.object.component.ActionRow;\nimport discord4j.core.object.component.SelectMenu;\nimport discord4j.core.object.entity.Message;\nimport discord4j.core.spec.InteractionFollowupCreateSpec;\nimport org.reactivestreams.Publisher;\nimport reactor.core.publisher.Mono;\n\nimport java.util.UUID;\n\nimport static botrino.interaction.listener.ComponentInteractionListener.selectMenu;\n\n@ChatInputCommand(name = "select", description = "Command for testing select menus")\npublic class SelectCommand implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n final var customId = UUID.randomUUID().toString();\n return ctx.event().createFollowup("Select an option:")\n .withComponents(ActionRow.of(SelectMenu.of(customId,\n SelectMenu.Option.of("option 1", "foo"),\n SelectMenu.Option.of("option 2", "bar"),\n SelectMenu.Option.of("option 3", "baz"))))\n .map(Message::getId)\n // Wait until the select menu is interacted with and return the value clicked\n .flatMap(messageId -> ctx.awaitSelectMenuItems(customId)\n .flatMap(items -> ctx.event().createFollowup("You clicked: " + items.get(0))\n .then(ctx.event().deleteFollowup(messageId))));\n }\n}\n'})}),"\n",(0,o.jsx)(e.h3,{id:"a-command-using-a-pagination-system-based-on-components",children:"A command using a pagination system based on components"}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-java",children:'package testbot1;\n\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport botrino.interaction.util.MessagePaginator;\nimport discord4j.core.object.component.ActionRow;\nimport discord4j.core.object.component.Button;\nimport discord4j.core.spec.MessageCreateSpec;\nimport org.reactivestreams.Publisher;\nimport reactor.core.publisher.Mono;\n\n@ChatInputCommand(name = "paginate", description = "Pagination testing")\npublic final class PaginateCommand implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return MessagePaginator.paginate(ctx, 5, state -> Mono.just(MessageCreateSpec.create()\n .withContent("Page " + (state.getPage() + 1) + "/" + state.getPageCount())\n .withComponents(ActionRow.of(\n state.previousButton(customId -> Button.secondary(customId, "<< Previous")),\n state.nextButton(customId -> Button.secondary(customId, "Next >>")),\n state.closeButton(customId -> Button.danger(customId, "Close"))\n ))));\n }\n}\n'})}),"\n",(0,o.jsx)("img",{src:(0,a.A)("img/paginate.png"),alt:""}),"\n",(0,o.jsx)(e.admonition,{type:"tip",children:(0,o.jsx)(e.p,{children:"All of these features (and more !) are fully documented in the next pages."})})]})}function h(n={}){const{wrapper:e}={...(0,i.R)(),...n.components};return e?(0,o.jsx)(e,{...n,children:(0,o.jsx)(p,{...n})}):p(n)}},9365:(n,e,t)=>{t.d(e,{A:()=>r});t(6540);var o=t(8215);const i={tabItem:"tabItem_Ymn6"};var a=t(4848);function r(n){let{children:e,hidden:t,className:r}=n;return(0,a.jsx)("div",{role:"tabpanel",className:(0,o.A)(i.tabItem,r),hidden:t,children:e})}},1470:(n,e,t)=>{t.d(e,{A:()=>I});var o=t(6540),i=t(8215),a=t(3104),r=t(6347),s=t(205),c=t(7485),l=t(1682),d=t(9466);function u(n){return o.Children.toArray(n).filter((n=>"\n"!==n)).map((n=>{if(!n||(0,o.isValidElement)(n)&&function(n){const{props:e}=n;return!!e&&"object"==typeof e&&"value"in e}(n))return n;throw new Error(`Docusaurus error: Bad <Tabs> child <${"string"==typeof n.type?n.type:n.type.name}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function m(n){const{values:e,children:t}=n;return(0,o.useMemo)((()=>{const n=e??function(n){return u(n).map((n=>{let{props:{value:e,label:t,attributes:o,default:i}}=n;return{value:e,label:t,attributes:o,default:i}}))}(t);return function(n){const e=(0,l.X)(n,((n,e)=>n.value===e.value));if(e.length>0)throw new Error(`Docusaurus error: Duplicate values "${e.map((n=>n.value)).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(n),n}),[e,t])}function p(n){let{value:e,tabValues:t}=n;return t.some((n=>n.value===e))}function h(n){let{queryString:e=!1,groupId:t}=n;const i=(0,r.W6)(),a=function(n){let{queryString:e=!1,groupId:t}=n;if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!t)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 t??null}({queryString:e,groupId:t});return[(0,c.aZ)(a),(0,o.useCallback)((n=>{if(!a)return;const e=new URLSearchParams(i.location.search);e.set(a,n),i.replace({...i.location,search:e.toString()})}),[a,i])]}function b(n){const{defaultValue:e,queryString:t=!1,groupId:i}=n,a=m(n),[r,c]=(0,o.useState)((()=>function(n){let{defaultValue:e,tabValues:t}=n;if(0===t.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(e){if(!p({value:e,tabValues:t}))throw new Error(`Docusaurus error: The <Tabs> has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${t.map((n=>n.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const o=t.find((n=>n.default))??t[0];if(!o)throw new Error("Unexpected error: 0 tabValues");return o.value}({defaultValue:e,tabValues:a}))),[l,u]=h({queryString:t,groupId:i}),[b,g]=function(n){let{groupId:e}=n;const t=function(n){return n?`docusaurus.tab.${n}`:null}(e),[i,a]=(0,d.Dv)(t);return[i,(0,o.useCallback)((n=>{t&&a.set(n)}),[t,a])]}({groupId:i}),v=(()=>{const n=l??b;return p({value:n,tabValues:a})?n:null})();(0,s.A)((()=>{v&&c(v)}),[v]);return{selectedValue:r,selectValue:(0,o.useCallback)((n=>{if(!p({value:n,tabValues:a}))throw new Error(`Can't select invalid tab value=${n}`);c(n),u(n),g(n)}),[u,g,a]),tabValues:a}}var g=t(2303);const v={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(4848);function x(n){let{className:e,block:t,selectedValue:o,selectValue:r,tabValues:s}=n;const c=[],{blockElementScrollPositionUntilNextRender:l}=(0,a.a_)(),d=n=>{const e=n.currentTarget,t=c.indexOf(e),i=s[t].value;i!==o&&(l(e),r(i))},u=n=>{let e=null;switch(n.key){case"Enter":d(n);break;case"ArrowRight":{const t=c.indexOf(n.currentTarget)+1;e=c[t]??c[0];break}case"ArrowLeft":{const t=c.indexOf(n.currentTarget)-1;e=c[t]??c[c.length-1];break}}e?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.A)("tabs",{"tabs--block":t},e),children:s.map((n=>{let{value:e,label:t,attributes:a}=n;return(0,f.jsx)("li",{role:"tab",tabIndex:o===e?0:-1,"aria-selected":o===e,ref:n=>c.push(n),onKeyDown:u,onClick:d,...a,className:(0,i.A)("tabs__item",v.tabItem,a?.className,{"tabs__item--active":o===e}),children:t??e},e)}))})}function j(n){let{lazy:e,children:t,selectedValue:i}=n;const a=(Array.isArray(t)?t:[t]).filter(Boolean);if(e){const n=a.find((n=>n.props.value===i));return n?(0,o.cloneElement)(n,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:a.map(((n,e)=>(0,o.cloneElement)(n,{key:e,hidden:n.props.value!==i})))})}function C(n){const e=b(n);return(0,f.jsxs)("div",{className:(0,i.A)("tabs-container",v.tabList),children:[(0,f.jsx)(x,{...e,...n}),(0,f.jsx)(j,{...e,...n})]})}function I(n){const e=(0,g.A)();return(0,f.jsx)(C,{...n,children:u(n.children)},String(e))}},8453:(n,e,t)=>{t.d(e,{R:()=>r,x:()=>s});var o=t(6540);const i={},a=o.createContext(i);function r(n){const e=o.useContext(a);return o.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function s(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(i):n.components||i:r(n.components),o.createElement(a.Provider,{value:e},n.children)}}}]); \ No newline at end of file diff --git a/assets/js/534bda69.c4be965c.js b/assets/js/534bda69.c4be965c.js deleted file mode 100644 index 1df4179..0000000 --- a/assets/js/534bda69.c4be965c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[351],{3905:function(e,t,n){n.d(t,{Zo:function(){return m},kt:function(){return d}});var o=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 o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function r(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 c(e,t){if(null==e)return{};var n,o,i=function(e,t){if(null==e)return{};var n,o,i={},a=Object.keys(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=o.createContext({}),l=function(e){var t=o.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):r(r({},t),e)),n},m=function(e){var t=l(e.components);return o.createElement(s.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},u=o.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,s=e.parentName,m=c(e,["components","mdxType","originalType","parentName"]),u=l(n),d=i,h=u["".concat(s,".").concat(d)]||u[d]||p[d]||a;return n?o.createElement(h,r(r({ref:t},m),{},{components:n})):o.createElement(h,r({ref:t},m))}));function d(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,r=new Array(a);r[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:i,r[1]=c;for(var l=2;l<a;l++)r[l]=n[l];return o.createElement.apply(null,r)}return o.createElement.apply(null,n)}u.displayName="MDXCreateElement"},3919:function(e,t,n){function o(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!o(e)}n.d(t,{b:function(){return o},Z:function(){return i}})},4996:function(e,t,n){n.d(t,{C:function(){return a},Z:function(){return r}});var o=n(2263),i=n(3919);function a(){var e=(0,o.Z)().siteConfig,t=(e=void 0===e?{}:e).baseUrl,n=void 0===t?"/":t,a=e.url;return{withBaseUrl:function(e,t){return function(e,t,n,o){var a=void 0===o?{}:o,r=a.forcePrependBaseUrl,c=void 0!==r&&r,s=a.absolute,l=void 0!==s&&s;if(!n)return n;if(n.startsWith("#"))return n;if((0,i.b)(n))return n;if(c)return t+n;var m=n.startsWith(t)?n:t+n.replace(/^\//,"");return l?e+m:m}(a,n,e,t)}}}function r(e,t){return void 0===t&&(t={}),(0,a().withBaseUrl)(e,t)}},3100:function(e,t,n){n.r(t),n.d(t,{frontMatter:function(){return s},metadata:function(){return l},toc:function(){return m},default:function(){return u}});var o=n(7462),i=n(3366),a=(n(7294),n(3905)),r=n(4996),c=["components"],s={title:"Dealing with components"},l={unversionedId:"interaction-library/dealing-with-components",id:"interaction-library/dealing-with-components",isDocsHomePage:!1,title:"Dealing with components",description:"The library offers two ways to handle interactions with message components (buttons and select menus).",source:"@site/docs/interaction-library/dealing-with-components.md",sourceDirName:"interaction-library",slug:"/interaction-library/dealing-with-components",permalink:"/docs/interaction-library/dealing-with-components",editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/interaction-library/dealing-with-components.md",version:"current",frontMatter:{title:"Dealing with components"},sidebar:"someSidebar",previous:{title:"Acknowledging interactions",permalink:"/docs/interaction-library/acknowledging-interactions"},next:{title:"Privileges",permalink:"/docs/interaction-library/privileges"}},m=[{value:"Handling component interactions as regular commands",id:"handling-component-interactions-as-regular-commands",children:[]},{value:"Waiting for component interactions inside a command",id:"waiting-for-component-interactions-inside-a-command",children:[]},{value:"Pagination system with components",id:"pagination-system-with-components",children:[]}],p={toc:m};function u(e){var t=e.components,n=(0,i.Z)(e,c);return(0,a.kt)("wrapper",(0,o.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"The library offers two ways to handle interactions with message components (buttons and select menus)."),(0,a.kt)("h2",{id:"handling-component-interactions-as-regular-commands"},"Handling component interactions as regular commands"),(0,a.kt)("p",null,"The first way is to treat component interactions as regular commands, which consists of declaring a listener that is going to be called every time a component with a specific ",(0,a.kt)("inlineCode",{parentName:"p"},"customId")," is interacted with. The structure is similar to ",(0,a.kt)("a",{parentName:"p",href:"/docs/interaction-library/creating-commands"},"creating commands"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-java"},'package testbot1;\n\nimport botrino.interaction.annotation.ComponentCommand;\nimport botrino.interaction.context.ButtonInteractionContext;\nimport botrino.interaction.listener.ComponentInteractionListener;\nimport org.reactivestreams.Publisher;\n\n@ComponentCommand("clickme")\npublic final class ClickMeButtonCommand implements ComponentInteractionListener<Void> {\n\n @Override\n public Publisher<Void> run(ButtonInteractionContext ctx) {\n return ctx.event().createFollowup("Button clicked!").then();\n }\n}\n')),(0,a.kt)("p",null,"The class implements ",(0,a.kt)("inlineCode",{parentName:"p"},"ComponentInteractionListener<Void>")," and overrides ",(0,a.kt)("inlineCode",{parentName:"p"},"run(ButtonInteractionContext)")," (it has several ",(0,a.kt)("inlineCode",{parentName:"p"},"run()")," overloads, one for each type of component, here we want a button. For select menus you're supposed to override ",(0,a.kt)("inlineCode",{parentName:"p"},"run(SelectMenuInteractionContext)"),"). The ",(0,a.kt)("inlineCode",{parentName:"p"},"@ComponentCommand")," annotation specifies the customId to listen for. Let's make a chat input command to create the message containing the button:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-java"},'package testbot1;\n\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport discord4j.core.object.component.ActionRow;\nimport discord4j.core.object.component.Button;\nimport org.reactivestreams.Publisher;\n\n@ChatInputCommand(name = "create-button", description = "Create a button.")\npublic final class CreateButtonCommand implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return ctx.event().createFollowup("Click the button:")\n .withComponents(ActionRow.of(\n Button.primary("clickme", "Click me!")));\n }\n}\n')),(0,a.kt)("p",null,"As usual, unless you are using the Botrino framework, you need to register them manually:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-java"},"interactionService.registerComponentCommand(new ClickMeButtonCommand());\ninteractionService.registerChatInputCommand(new CreateButtonCommand());\n")),(0,a.kt)("p",null,"Result:"),(0,a.kt)("img",{src:(0,r.Z)("img/clickme.png"),alt:""}),(0,a.kt)("div",{className:"admonition admonition-info alert alert--info"},(0,a.kt)("div",{parentName:"div",className:"admonition-heading"},(0,a.kt)("h5",{parentName:"div"},(0,a.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,a.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,a.kt)("path",{parentName:"svg",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"}))),"info")),(0,a.kt)("div",{parentName:"div",className:"admonition-content"},(0,a.kt)("p",{parentName:"div"},"The ",(0,a.kt)("inlineCode",{parentName:"p"},"@ComponentCommand")," annotation is in fact not required if you aren't using the Botrino framework. You may as well override the ",(0,a.kt)("inlineCode",{parentName:"p"},"customId()")," method from ",(0,a.kt)("inlineCode",{parentName:"p"},"ComponentInteractionListener"),". The annotation is still required when using the Botrino framework, as it will only auto-register listeners containing that annotation, but if you are already overriding ",(0,a.kt)("inlineCode",{parentName:"p"},"customId()")," you can use ",(0,a.kt)("inlineCode",{parentName:"p"},"@ComponentCommand")," alone without the value. An example might be more clear:"),(0,a.kt)("pre",{parentName:"div"},(0,a.kt)("code",{parentName:"pre",className:"language-java"},'package testbot1;\n\nimport botrino.interaction.annotation.ComponentCommand;\nimport botrino.interaction.context.ButtonInteractionContext;\nimport botrino.interaction.listener.ComponentInteractionListener;\nimport org.reactivestreams.Publisher;\n\n@ComponentCommand // You may omit the customId here...\npublic final class ClickMeButtonCommand implements ComponentInteractionListener<Void> {\n \n @Override\n public String customId() {\n return "clickme"; // ...if you specify it here instead\n }\n\n @Override\n public Publisher<Void> run(ButtonInteractionContext ctx) {\n return ctx.event().createFollowup("Button clicked!").then();\n }\n}\n')))),(0,a.kt)("h2",{id:"waiting-for-component-interactions-inside-a-command"},"Waiting for component interactions inside a command"),(0,a.kt)("p",null,'In many cases, you want to use components as a way to make your commands more interactive, for example if you need confirmation from the user to perform an action. You would need some way to "pause" the execution of your command and resume when the user has given a response by clicking a button or a select menu. This is made easy with the ',(0,a.kt)("inlineCode",{parentName:"p"},"awaitButtonClick(customId)")," and ",(0,a.kt)("inlineCode",{parentName:"p"},"awaitSelectMenuItems(customId)")," methods. Here's an example of a simple command waiting for the user to select an item and display the value clicked:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-java"},'package testbot1;\n\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport discord4j.core.object.component.ActionRow;\nimport discord4j.core.object.component.SelectMenu;\nimport discord4j.core.object.entity.Message;\nimport discord4j.core.spec.InteractionFollowupCreateSpec;\nimport org.reactivestreams.Publisher;\nimport reactor.core.publisher.Mono;\n\nimport java.util.UUID;\n\nimport static botrino.interaction.listener.ComponentInteractionListener.selectMenu;\n\n@ChatInputCommand(name = "select", description = "Command for testing select menus")\npublic class SelectCommand implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n final var customId = UUID.randomUUID().toString();\n return ctx.event().createFollowup("Select an option:")\n .withComponents(ActionRow.of(SelectMenu.of(customId,\n SelectMenu.Option.of("option 1", "foo"),\n SelectMenu.Option.of("option 2", "bar"),\n SelectMenu.Option.of("option 3", "baz"))))\n .map(Message::getId)\n // Wait until the select menu is interacted with and return the value clicked\n .flatMap(messageId -> ctx.awaitSelectMenuItems(customId)\n .flatMap(items -> ctx.event().createFollowup("You clicked: " + items.get(0))\n .then(ctx.event().deleteFollowup(messageId))));\n }\n}\n')),(0,a.kt)("ol",null,(0,a.kt)("li",{parentName:"ol"},"Since you want to listen for one specific select menu (and not all select menus with some customId), you generate a customId that is unique for each invocation of the ",(0,a.kt)("inlineCode",{parentName:"li"},"/select")," command. You can easily generate a random string via ",(0,a.kt)("inlineCode",{parentName:"li"},"java.util.UUID"),"."),(0,a.kt)("li",{parentName:"ol"},"A first followup is sent with the message containing the select menu."),(0,a.kt)("li",{parentName:"ol"},"Once the message has been sent, call ",(0,a.kt)("inlineCode",{parentName:"li"},"awaitSelectMenuItems(customId)")," with the same customId generated previously. It will wait for the user to interact with the menu and will emit the value clicked."),(0,a.kt)("li",{parentName:"ol"},"The value received is then displayed via a new followup message.")),(0,a.kt)("div",{className:"admonition admonition-warning alert alert--danger"},(0,a.kt)("div",{parentName:"div",className:"admonition-heading"},(0,a.kt)("h5",{parentName:"div"},(0,a.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,a.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"},(0,a.kt)("path",{parentName:"svg",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"}))),"warning")),(0,a.kt)("div",{parentName:"div",className:"admonition-content"},(0,a.kt)("p",{parentName:"div"},"If you don't make the customId unique on each run, there will be conflicts when the ",(0,a.kt)("inlineCode",{parentName:"p"},"/select")," command is run several times consecutively by the same user in the same channel."))),(0,a.kt)("p",null,"Here is another example with ",(0,a.kt)("inlineCode",{parentName:"p"},"awaitButtonClick(customId)")," that asks the user to confirm when resetting a user's nickname:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-java"},'package testbot1;\n\nimport botrino.interaction.annotation.UserCommand;\nimport botrino.interaction.context.UserInteractionContext;\nimport botrino.interaction.listener.UserInteractionListener;\nimport discord4j.core.object.component.ActionRow;\nimport discord4j.core.object.component.Button;\nimport discord4j.core.object.entity.Message;\nimport org.reactivestreams.Publisher;\nimport reactor.core.publisher.Mono;\n\nimport java.util.UUID;\n\nimport static botrino.interaction.listener.ComponentInteractionListener.button;\n\n@UserCommand("Reset Nickname")\npublic class ResetNickCommand implements UserInteractionListener {\n\n @Override\n public Publisher<?> run(UserInteractionContext ctx) {\n final var guildId = ctx.event().getInteraction().getGuildId().orElse(null);\n if (guildId == null) {\n return ctx.event().createFollowup("Cannot use outside of a guild");\n }\n final var yesId = UUID.randomUUID().toString();\n final var noId = UUID.randomUUID().toString();\n return ctx.event().createFollowup("Reset the nickname of that user?")\n .withComponents(ActionRow.of(\n Button.primary(yesId, "Yes"),\n Button.secondary(noId, "No")))\n .map(Message::getId)\n .flatMap(messageId -> Mono.firstWithValue(\n ctx.awaitButtonClick(yesId),\n ctx.awaitButtonClick(noId))\n .flatMap(buttonClicked -> buttonClicked.equals(yesId) ? ctx.event()\n .getClient()\n .getMemberById(guildId, ctx.event().getTargetId())\n .flatMap(member -> member.edit().withNicknameOrNull(null))\n .then(ctx.event().createFollowup("Nickname reset successful!"))\n : ctx.event().createFollowup("Action cancelled"))\n .then(ctx.event().deleteFollowup(messageId)));\n }\n}\n')),(0,a.kt)("p",null,'The code is quite self-explanatory: we display two buttons, one for "yes" and one for "no". We use ',(0,a.kt)("inlineCode",{parentName:"p"},"Mono.firstWithValue")," to only wait for the first click on either of the two buttons, and depending on which button was clicked, we execute one or the other action."),(0,a.kt)("div",{className:"admonition admonition-tip alert alert--success"},(0,a.kt)("div",{parentName:"div",className:"admonition-heading"},(0,a.kt)("h5",{parentName:"div"},(0,a.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,a.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"},(0,a.kt)("path",{parentName:"svg",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"}))),"tip")),(0,a.kt)("div",{parentName:"div",className:"admonition-content"},(0,a.kt)("p",{parentName:"div"},"There exists a more generic method ",(0,a.kt)("inlineCode",{parentName:"p"},"awaitComponentInteraction")," that lets you manipulate the underlying interaction context before returning a value. It accepts a ",(0,a.kt)("inlineCode",{parentName:"p"},"ComponentInteractionListener<R>")," that you can construct via its static methods ",(0,a.kt)("inlineCode",{parentName:"p"},"button(String, Function)")," and ",(0,a.kt)("inlineCode",{parentName:"p"},"selectMenu(String, Function)"),", each accepting the customId and a function receiving a ",(0,a.kt)("inlineCode",{parentName:"p"},"ButtonInteractionContext")," or ",(0,a.kt)("inlineCode",{parentName:"p"},"SelectMenuInteractionContext")," and producing a value of any type."))),(0,a.kt)("h2",{id:"pagination-system-with-components"},"Pagination system with components"),(0,a.kt)("p",null,"Making a pagination system is one of the most obvious use cases for message components. The library provides a static method ",(0,a.kt)("inlineCode",{parentName:"p"},"MessagePaginator::paginate")," to build paginated messages easily. See the example below:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-java"},'package testbot1;\n\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport botrino.interaction.util.MessagePaginator;\nimport discord4j.core.object.component.ActionRow;\nimport discord4j.core.object.component.Button;\nimport discord4j.core.spec.MessageCreateSpec;\nimport org.reactivestreams.Publisher;\nimport reactor.core.publisher.Mono;\n\n@ChatInputCommand(name = "paginate", description = "Pagination testing")\npublic final class PaginateCommand implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return MessagePaginator.paginate(ctx, 5, state -> Mono.just(MessageCreateSpec.create()\n .withContent("Page " + (state.getPage() + 1) + "/" + state.getPageCount())\n .withComponents(ActionRow.of(\n state.previousButton(customId -> Button.secondary(customId, "<< Previous")),\n state.nextButton(customId -> Button.secondary(customId, "Next >>")),\n state.closeButton(customId -> Button.danger(customId, "Close"))\n ))));\n }\n}\n')),(0,a.kt)("img",{src:(0,r.Z)("img/paginate.png"),alt:""}),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"The ",(0,a.kt)("inlineCode",{parentName:"li"},"paginate")," method takes 3 arguments. The first one is the interaction context, the second one is the total number of pages, and the last one is a function that receives a state and produces the message to display. An overload exists allowing you to specify the initial page number (by default it starts at the first page)."),(0,a.kt)("li",{parentName:"ul"},"The ",(0,a.kt)("inlineCode",{parentName:"li"},"state")," holds information on the current state of the paginator, such as the current page number and whether it is active"),(0,a.kt)("li",{parentName:"ul"},"To render the buttons, the state exposes three methods to build previous, next and close buttons respectively. The state object controls whether the buttons are enabled or disabled according to whether we are at first page (in which case previous button should be disabled), at last page (in which case next button should be disabled), or if the paginator has already closed, in which case all buttons should be disabled.")),(0,a.kt)("div",{className:"admonition admonition-info alert alert--info"},(0,a.kt)("div",{parentName:"div",className:"admonition-heading"},(0,a.kt)("h5",{parentName:"div"},(0,a.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,a.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,a.kt)("path",{parentName:"svg",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"}))),"info")),(0,a.kt)("div",{parentName:"div",className:"admonition-content"},(0,a.kt)("p",{parentName:"div"},"The paginator automatically closes as per the ",(0,a.kt)("inlineCode",{parentName:"p"},"await_component_timeout_seconds")," value defined in the ",(0,a.kt)("a",{parentName:"p",href:"/docs/interaction-library/configuration"},"configuration"),"."))))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/5537f8c3.e1b48379.js b/assets/js/5537f8c3.e1b48379.js deleted file mode 100644 index b7564a4..0000000 --- a/assets/js/5537f8c3.e1b48379.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[682],{3905:function(e,t,n){n.d(t,{Zo:function(){return d},kt:function(){return m}});var o=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 o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}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){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 c(e,t){if(null==e)return{};var n,o,i=function(e,t){if(null==e)return{};var n,o,i={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}(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)&&(i[n]=e[n])}return i}var s=o.createContext({}),l=function(e){var t=o.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},d=function(e){var t=l(e.components);return o.createElement(s.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},p=o.forwardRef((function(e,t){var n=e.components,i=e.mdxType,r=e.originalType,s=e.parentName,d=c(e,["components","mdxType","originalType","parentName"]),p=l(n),m=i,f=p["".concat(s,".").concat(m)]||p[m]||u[m]||r;return n?o.createElement(f,a(a({ref:t},d),{},{components:n})):o.createElement(f,a({ref:t},d))}));function m(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var r=n.length,a=new Array(r);a[0]=p;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c.mdxType="string"==typeof e?e:i,a[1]=c;for(var l=2;l<r;l++)a[l]=n[l];return o.createElement.apply(null,a)}return o.createElement.apply(null,n)}p.displayName="MDXCreateElement"},8849:function(e,t,n){n.r(t),n.d(t,{frontMatter:function(){return c},metadata:function(){return s},toc:function(){return l},default:function(){return u}});var o=n(7462),i=n(3366),r=(n(7294),n(3905)),a=["components"],c={title:"Customizing the Discord client"},s={unversionedId:"api/customizing-the-discord-client",id:"api/customizing-the-discord-client",isDocsHomePage:!1,title:"Customizing the Discord client",description:"When you start a project with Botrino, the Discord client is constructed for you, so you don't have anything to do in order to run the bot. However, in most cases, you will want to take full control on how the Discord client is created. This section will show you how to fully customize the Discord client and the gateway login process.",source:"@site/docs/api/customizing-the-discord-client.md",sourceDirName:"api",slug:"/api/customizing-the-discord-client",permalink:"/docs/api/customizing-the-discord-client",editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/api/customizing-the-discord-client.md",version:"current",frontMatter:{title:"Customizing the Discord client"},sidebar:"someSidebar",previous:{title:"Configuring your bot",permalink:"/docs/api/configuring-your-bot"},next:{title:"Extensions",permalink:"/docs/api/extensions"}},l=[{value:"The <code>LoginHandler</code> interface",id:"the-loginhandler-interface",children:[]}],d={toc:l};function u(e){var t=e.components,n=(0,i.Z)(e,a);return(0,r.kt)("wrapper",(0,o.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"When you start a project with Botrino, the Discord client is constructed for you, so you don't have anything to do in order to run the bot. However, in most cases, you will want to take full control on how the Discord client is created. This section will show you how to fully customize the Discord client and the gateway login process."),(0,r.kt)("h2",{id:"the-loginhandler-interface"},"The ",(0,r.kt)("inlineCode",{parentName:"h2"},"LoginHandler")," interface"),(0,r.kt)("p",null,"All you need to do is to provide one implementation of the ",(0,r.kt)("inlineCode",{parentName:"p"},"LoginHandler")," interface. It defines one method, ",(0,r.kt)("inlineCode",{parentName:"p"},"Mono<GatewayDiscordClient> login(ConfigContainer configContainer)"),", that you can override to define yourself how your bot connects to the Discord gateway. The default implementation of this method builds the Discord client with default settings, using the token, presence status, and intents from the configuration. It can be recreated like this:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-java"},"package com.example.myproject;\n\nimport botrino.api.config.object.BotConfig;\nimport discord4j.core.DiscordClient;\nimport discord4j.core.GatewayDiscordClient;\nimport discord4j.core.object.presence.Presence;\nimport discord4j.core.shard.MemberRequestFilter;\nimport discord4j.gateway.intent.IntentSet;\nimport reactor.core.publisher.Mono;\n\npublic final class DefaultLoginHandler implements LoginHandler {\n\n @Override\n public Mono<GatewayDiscordClient> login(ConfigContainer configContainer) {\n var config = configContainer.get(BotConfig.class);\n var discordClient = DiscordClient.create(config.token());\n return discordClient.gateway()\n .setInitialStatus(shard -> config.presence()\n .map(BotConfig.StatusConfig::toStatusUpdate)\n .orElseGet(Presence::online))\n .setEnabledIntents(config.enabledIntents().stream().boxed()\n .map(IntentSet::of)\n .findAny()\n .orElseGet(IntentSet::nonPrivileged))\n .setMemberRequestFilter(MemberRequestFilter.none())\n .login()\n .single();\n }\n}\n")),(0,r.kt)("div",{className:"admonition admonition-caution alert alert--warning"},(0,r.kt)("div",{parentName:"div",className:"admonition-heading"},(0,r.kt)("h5",{parentName:"div"},(0,r.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,r.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},(0,r.kt)("path",{parentName:"svg",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"}))),"caution")),(0,r.kt)("div",{parentName:"div",className:"admonition-content"},(0,r.kt)("ul",{parentName:"div"},(0,r.kt)("li",{parentName:"ul"},"The implementation class must have a no-arg constructor."),(0,r.kt)("li",{parentName:"ul"},"If more than one implementation of ",(0,r.kt)("inlineCode",{parentName:"li"},"LoginHandler")," are found, it will result in an error as it is impossible to determine which one to use. If you don't want to remove the extra implementation(s), you can mark one of them with the ",(0,r.kt)("inlineCode",{parentName:"li"},"@Primary")," annotation to lift the ambiguity. You may alternatively use the ",(0,r.kt)("inlineCode",{parentName:"li"},"@Exclude")," annotation if you don't want one implementation to be picked up by Botrino.")))))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/576b222c.a25e306a.js b/assets/js/576b222c.a25e306a.js new file mode 100644 index 0000000..ff9ffb3 --- /dev/null +++ b/assets/js/576b222c.a25e306a.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[450],{8814:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>h,frontMatter:()=>o,metadata:()=>s,toc:()=>l});var i=t(4848),r=t(8453);const o={title:"Filtering and adapting events"},a=void 0,s={id:"interaction-library/filtering-and-adapting-events",title:"Filtering and adapting events",description:"Listeners are triggered when an interaction event is received via the Discord gateway. It is possible for you to",source:"@site/docs/interaction-library/filtering-and-adapting-events.mdx",sourceDirName:"interaction-library",slug:"/interaction-library/filtering-and-adapting-events",permalink:"/docs/interaction-library/filtering-and-adapting-events",draft:!1,unlisted:!1,editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/interaction-library/filtering-and-adapting-events.mdx",tags:[],version:"current",frontMatter:{title:"Filtering and adapting events"},sidebar:"someSidebar",previous:{title:"Handling errors",permalink:"/docs/interaction-library/handling-errors"}},c={},l=[{value:"The <code>InteractionEventProcessor</code> interface",id:"the-interactioneventprocessor-interface",level:2}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:"Listeners are triggered when an interaction event is received via the Discord gateway. It is possible for you to\nintervene between the moment the event is received and the moment the listener is triggered. This allows you to drop\nsome events to prevent any command from being executed in a certain context, or to determine which locale to apply\naccording to the event received."}),"\n",(0,i.jsxs)(n.h2,{id:"the-interactioneventprocessor-interface",children:["The ",(0,i.jsx)(n.code,{children:"InteractionEventProcessor"})," interface"]}),"\n",(0,i.jsxs)(n.p,{children:["Create a class that implements ",(0,i.jsx)(n.code,{children:"InteractionEventProcessor"}),". If you are using the Botrino framework, it will\nautomatically be set into the interaction service. Otherwise, you need to set it via the builder when constructing\nyour ",(0,i.jsx)(n.code,{children:"InteractionService"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-java",children:"final var interactionService = InteractionService.builder(config, gateway)\n .setEventProcessor(new MyEventProcessor())\n .build();\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Here is an example of ",(0,i.jsx)(n.code,{children:"InteractionEventProcessor"})," implementation:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-java",children:'package testbot1;\n\nimport botrino.interaction.InteractionEventProcessor;\nimport discord4j.core.event.domain.interaction.InteractionCreateEvent;\nimport discord4j.core.object.entity.channel.GuildMessageChannel;\nimport reactor.core.publisher.Mono;\n\nimport java.util.Locale;\n\npublic final class MyEventProcessor implements InteractionEventProcessor {\n\n @Override\n public Mono<Boolean> filter(InteractionCreateEvent event) {\n return Mono.just(!event.getInteraction().getMember()\n .map(member -> member.getDisplayName().toLowerCase().contains("ignore me"))\n .orElse(true));\n }\n\n @Override\n public Mono<Locale> computeLocale(InteractionCreateEvent event) {\n return event.getInteraction().getChannel()\n .ofType(GuildMessageChannel.class)\n .flatMap(guildChannel -> {\n if (guildChannel.getName().endsWith("fr")) {\n return Mono.just(Locale.FRENCH);\n } else if (guildChannel.getName().endsWith("de")) {\n return Mono.just(Locale.GERMAN);\n } else {\n return Mono.empty();\n }\n });\n }\n}\n'})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"filter(InteractionCreateEvent)"})," allows to decide whether to keep or to drop the given ",(0,i.jsx)(n.code,{children:"InteractionCreateEvent"}),'. The\ndefault implementation will allow all events. This method can be useful if you want to implement a blacklist system to\nban some users from using your bot. In this example, we are filtering out users which username contains the string "\nignore me".']}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"computeLocale(InteractionCreateEvent)"})," allows to adapt the locale according to the event received. In order to keep\nthe default locale, you are expected to return an empty ",(0,i.jsx)(n.code,{children:"Mono"}),". The returned locale will be accessible via\nthe ",(0,i.jsx)(n.code,{children:"InteractionContext"})," (which implements ",(0,i.jsx)(n.code,{children:"botrino.api.Translator"}),", see ",(0,i.jsx)(n.a,{href:"/docs/api/i18n",children:"Internationalization"}),"). You\nwill typically store the locale in a database (either per guild or per user) and retrieve it here using the data given\nby the interaction event. In this example, we are interpreting the suffix of the channel name as the locale, with only\nFrench and German being supported. It will use the default locale defined in the ",(0,i.jsx)(n.a,{href:"/docs/interaction-library/configuration",children:"configuration"})," in\nall other cases."]}),"\n"]}),"\n",(0,i.jsx)(n.admonition,{title:"Considerations when using the Botrino framework",type:"caution",children:(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"The implementation class must have a no-arg constructor."}),"\n",(0,i.jsxs)(n.li,{children:["If more than one implementation of ",(0,i.jsx)(n.code,{children:"InteractionEventProcessor"})," are found, it will result in an error as it is\nimpossible to determine which one to use. If you don't want to remove the extra implementation(s), you can mark one of\nthem with the ",(0,i.jsx)(n.code,{children:"@Primary"})," annotation to lift the ambiguity. You may alternatively use the ",(0,i.jsx)(n.code,{children:"@Exclude"})," annotation if you\ndon't want one implementation to be picked up by Botrino."]}),"\n"]})})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>s});var i=t(6540);const r={},o=i.createContext(r);function a(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5e95c892.b8ccf983.js b/assets/js/5e95c892.b8ccf983.js new file mode 100644 index 0000000..9e8e473 --- /dev/null +++ b/assets/js/5e95c892.b8ccf983.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[647],{7121:(e,s,r)=>{r.r(s),r.d(s,{default:()=>l});r(6540);var c=r(8215),u=r(1003),a=r(7559),d=r(2831),n=r(781),t=r(4848);function l(e){return(0,t.jsx)(u.e3,{className:(0,c.A)(a.G.wrapper.docsPages),children:(0,t.jsx)(n.A,{children:(0,d.v)(e.route.routes)})})}}}]); \ No newline at end of file diff --git a/assets/js/608.9c51bee7.js b/assets/js/608.9c51bee7.js deleted file mode 100644 index 2fcbfae..0000000 --- a/assets/js/608.9c51bee7.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[608],{4608:function(e,t,n){n.r(t);var a=n(7294),o=n(9118),l=n(4973);t.default=function(){return a.createElement(o.Z,{title:"Page Not Found"},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."))))))}}}]); \ No newline at end of file diff --git a/assets/js/62eacfe5.8cd05dc4.js b/assets/js/62eacfe5.8cd05dc4.js new file mode 100644 index 0000000..5e79ff9 --- /dev/null +++ b/assets/js/62eacfe5.8cd05dc4.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[476],{4203:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>o,contentTitle:()=>a,default:()=>h,frontMatter:()=>s,metadata:()=>l,toc:()=>c});var r=t(4848),i=t(8453);const s={title:"Internationalization"},a=void 0,l={id:"api/i18n",title:"Internationalization",description:"The bot you are developing is likely to be used by people which primary language is not English. To support these users,",source:"@site/docs/api/i18n.mdx",sourceDirName:"api",slug:"/api/i18n",permalink:"/docs/api/i18n",draft:!1,unlisted:!1,editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/api/i18n.mdx",tags:[],version:"current",frontMatter:{title:"Internationalization"},sidebar:"someSidebar",previous:{title:"Extensions",permalink:"/docs/api/extensions"},next:{title:"Overview",permalink:"/docs/interaction-library/overview"}},o={},c=[{value:"The <code>Translator</code> interface",id:"the-translator-interface",level:2},{value:"Externalizing strings",id:"externalizing-strings",level:2},{value:"Using translated strings",id:"using-translated-strings",level:2}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.p,{children:"The bot you are developing is likely to be used by people which primary language is not English. To support these users,\nBotrino encourages the externalization of strings so they can be translated more conveniently."}),"\n",(0,r.jsxs)(n.h2,{id:"the-translator-interface",children:["The ",(0,r.jsx)(n.code,{children:"Translator"})," interface"]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"Translator"})," interface has one abstract method ",(0,r.jsx)(n.code,{children:"Locale getLocale()"})," which defines what is the target locale of the\ntranslator, and a default method ",(0,r.jsx)(n.code,{children:"String translate(String, String, Object...)"})," which effectively does the translation.\nBy default, the translate method does the following:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-java",children:"default String translate(String bundle, String key, Object... args) {\n return MessageFormat.format(ResourceBundle.getBundle(bundle, getLocale()).getString(key), args);\n}\n"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Strings are located in a ",(0,r.jsx)(n.code,{children:"ResourceBundle"})," which name is given. Typically, that's the name of a ",(0,r.jsx)(n.code,{children:".properties"})," file\nlocated at the root of the resources folder."]}),"\n",(0,r.jsxs)(n.li,{children:["Strings are parameterized using ",(0,r.jsx)(n.code,{children:"MessageFormat"}),", which aims at being a language-independent way to put variables in a\nstring, unlike ",(0,r.jsx)(n.code,{children:"String.format()"}),"."]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"externalizing-strings",children:"Externalizing strings"}),"\n",(0,r.jsxs)(n.p,{children:["If let's say you have a file named ",(0,r.jsx)(n.code,{children:"AppStrings.properties"})," in ",(0,r.jsx)(n.code,{children:"src/main/resources"})," with the following contents:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-properties",children:"hello=Hello {0}!\n"})}),"\n",(0,r.jsx)(n.p,{children:"You can use a translator like this:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-java",children:'var tr = Translator.to(Locale.ENGLISH);\nSystem.out.println(tr.translate("AppStrings", "hello", "Alex"));\n'})}),"\n",(0,r.jsx)(n.p,{children:"Which gives the output:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"Hello Alex!\n"})}),"\n",(0,r.jsx)(n.p,{children:"What happened here?"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["The first argument of ",(0,r.jsx)(n.code,{children:"tr.translate"})," is ",(0,r.jsx)(n.code,{children:"AppStrings"}),", so it will look for a ",(0,r.jsx)(n.code,{children:"ResourceBundle"})," named ",(0,r.jsx)(n.code,{children:"AppStrings"}),". It\nwill find the ",(0,r.jsx)(n.code,{children:"AppStrings.properties"})," and will load its content."]}),"\n",(0,r.jsxs)(n.li,{children:["The second argument says to find the string with key ",(0,r.jsx)(n.code,{children:"hello"}),", which is what we defined earlier."]}),"\n",(0,r.jsxs)(n.li,{children:["The third argument will substitute the ",(0,r.jsx)(n.code,{children:"{0}"})," of our string with the value at runtime, here ",(0,r.jsx)(n.code,{children:"Alex"}),"."]}),"\n"]}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["To learn more about resource bundles and string argument formatting, check out the Javadoc\nfor ",(0,r.jsx)(n.a,{href:"https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/ResourceBundle.html",children:(0,r.jsx)(n.code,{children:"ResourceBundle"})}),"\nand ",(0,r.jsx)(n.a,{href:"https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/text/MessageFormat.html",children:(0,r.jsx)(n.code,{children:"MessageFormat"})}),". Note\nthat since ",(0,r.jsx)(n.code,{children:"Translator.translate"})," is a default interface method and thus can be overriden, you may customize the way\ntranslations are retrieved, but this section will only document the default behavior."]})}),"\n",(0,r.jsx)(n.h2,{id:"using-translated-strings",children:"Using translated strings"}),"\n",(0,r.jsxs)(n.p,{children:["Once a string is properly externalized, it is possible to add a translation for it by duplicating the resource file and\nnaming it with the locale suffix. For example, if you have ",(0,r.jsx)(n.code,{children:"src/main/resources/AppStrings.properties"})," and want to\ntranslate it in French, you will duplicate the file and name the copy ",(0,r.jsx)(n.code,{children:"src/main/resources/AppStrings_fr.properties"}),". The\nway to name the translated files is documented in\nthe ",(0,r.jsxs)(n.a,{href:"https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/ResourceBundle.html",children:[(0,r.jsx)(n.code,{children:"ResourceBundle"})," javadoc"]}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["In your ",(0,r.jsx)(n.code,{children:"AppStrings_fr.properties"}),", you will translate the value of the ",(0,r.jsx)(n.code,{children:"hello"})," string:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-properties",children:"hello=Bonjour {0} !\n"})}),"\n",(0,r.jsx)(n.p,{children:"In your Java code, you can now specify either English or French locale and the string will adapt automatically:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-java",children:'var tr1 = Translator.to(Locale.ENGLISH);\nvar tr2 = Translator.to(Locale.FRENCH);\nSystem.out.println(tr1.translate("AppStrings", "hello", "Alex"));\nSystem.out.println(tr2.translate("AppStrings", "hello", "Alex")); // notice we use exact same arguments\n'})}),"\n",(0,r.jsx)(n.p,{children:"Which gives the output you want:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"Hello Alex!\nBonjour Alex !\n"})})]})}function h(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>l});var r=t(6540);const i={},s=r.createContext(i);function a(e){const n=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),r.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/6ea2c7a4.8b876353.js b/assets/js/6ea2c7a4.8b876353.js new file mode 100644 index 0000000..6f55b43 --- /dev/null +++ b/assets/js/6ea2c7a4.8b876353.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[36],{7676:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>h,frontMatter:()=>i,metadata:()=>l,toc:()=>s});var r=t(4848),o=t(8453);const i={title:"Handling errors"},a=void 0,l={id:"interaction-library/handling-errors",title:"Handling errors",description:"The execution of a interaction may fail for many reasons. You can handle these errors in a way that is adapted to each",source:"@site/docs/interaction-library/handling-errors.mdx",sourceDirName:"interaction-library",slug:"/interaction-library/handling-errors",permalink:"/docs/interaction-library/handling-errors",draft:!1,unlisted:!1,editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/interaction-library/handling-errors.mdx",tags:[],version:"current",frontMatter:{title:"Handling errors"},sidebar:"someSidebar",previous:{title:"Cooldowns",permalink:"/docs/interaction-library/cooldowns"},next:{title:"Filtering and adapting events",permalink:"/docs/interaction-library/filtering-and-adapting-events"}},c={},s=[{value:"Global error handler",id:"global-error-handler",level:2}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.p,{children:["The execution of a interaction may fail for many reasons. You can handle these errors in a way that is adapted to each\ntype of errors, this is done via the ",(0,r.jsx)(n.code,{children:"InteractionErrorHandler"})," interface."]}),"\n",(0,r.jsx)(n.h2,{id:"global-error-handler",children:"Global error handler"}),"\n",(0,r.jsxs)(n.p,{children:["You simply need to create a class implementing ",(0,r.jsx)(n.code,{children:"InteractionErrorHandler"}),". If you are using the Botrino framework, it\nwill automatically be set into the interaction service. Otherwise, you need to set it via the builder when constructing\nyour ",(0,r.jsx)(n.code,{children:"InteractionService"}),":"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-java",children:"final var interactionService = InteractionService.builder(config, gateway)\n .setErrorHandler(new MyErrorHandler())\n .build();\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Here is an example of ",(0,r.jsx)(n.code,{children:"InteractionErrorHandler"})," implementation:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-java",children:'package testbot1;\n\nimport botrino.api.util.DurationUtils;\nimport botrino.interaction.InteractionErrorHandler;\nimport botrino.interaction.InteractionFailedException;\nimport botrino.interaction.context.InteractionContext;\nimport botrino.interaction.cooldown.CooldownException;\nimport botrino.interaction.privilege.PrivilegeException;\nimport org.reactivestreams.Publisher;\nimport reactor.core.publisher.Mono;\n\npublic final class MyErrorHandler implements InteractionErrorHandler {\n\n @Override\n public Publisher<?> handleInteractionFailed(InteractionFailedException e, InteractionContext ctx) {\n return ctx.event().createFollowup("\\uD83D\\uDEAB " + e.getMessage()).withEphemeral(true);\n }\n\n @Override\n public Publisher<?> handlePrivilege(PrivilegeException e, InteractionContext ctx) {\n return ctx.event().createFollowup("You have insufficient privileges " +\n "to run this command.").withEphemeral(true);\n }\n\n @Override\n public Publisher<?> handleCooldown(CooldownException e, InteractionContext ctx) {\n return ctx.event().createFollowup("You are on cooldown. " +\n "Retry in " + DurationUtils.format(e.getRetryAfter())).withEphemeral(true);\n }\n\n @Override\n public Publisher<?> handleDefault(Throwable t, InteractionContext ctx) {\n return ctx.event().createFollowup("Something went wrong! Sorry for the inconvenience.")\n .withEphemeral(true)\n .onErrorResume(e -> {\n t.addSuppressed(e);\n return Mono.empty();\n }).then(Mono.error(t)); // Forward downstream for logging\n }\n}\n'})}),"\n",(0,r.jsxs)(n.p,{children:["The methods of ",(0,r.jsx)(n.code,{children:"InteractionErrorHandler"})," correspond to the most common error types. Each method exposes\nthe ",(0,r.jsx)(n.code,{children:"InteractionContext"})," in which the error happened. None of them are required to be implemented, by default they just\nforward errors downstream which will only log them at ERROR level. Currently there are four of them:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"handleInteractionFailed(InteractionFailedException, InteractionContext)"}),": allows recovering on\na ",(0,r.jsx)(n.code,{children:"InteractionFailedException"}),'. This exception represents a "normal" failure of the command, when the end user is at\nfault. This exception is generally thrown by yourself in your ',(0,r.jsx)(n.code,{children:"run()"})," method and carries a user-friendly message, so\nthe way to handle it will mostly consist of replying to the user with that message."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"handlePrivilege(PrivilegeException, CommandContext)"}),": allows recovering on a ",(0,r.jsx)(n.code,{children:"PrivilegeException"}),". It is thrown when\na user attempts to use a command with insufficient privileges. Typically, handling this exception will consist of\ntelling the user they cannot use the command. More details on privileges can be found\nin ",(0,r.jsx)(n.a,{href:"/docs/interaction-library/privileges",children:"this section"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"handleCooldown(CooldownException, CommandContext)"}),": allows recovering on a ",(0,r.jsx)(n.code,{children:"CooldownException"}),". It is thrown when a\nuser attempts to use a command past the maximum usage limit within a time interval. Generally, it will be handled by\nnotifying the user that they need to wait some time before trying the command again (the exception carries the exact\ntime left). More details on cooldowns can be found in ",(0,r.jsx)(n.a,{href:"/docs/interaction-library/cooldowns",children:"this section"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"handleDefault(Throwable, CommandContext)"}),": allows recovering on an exception type that corresponds to none of the\nabove."]}),"\n"]}),"\n",(0,r.jsx)(n.admonition,{title:"Considerations when using the Botrino framework",type:"caution",children:(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"The implementation class must have a no-arg constructor."}),"\n",(0,r.jsxs)(n.li,{children:["If more than one implementation of ",(0,r.jsx)(n.code,{children:"InteractionErrorHandler"})," are found, it will result in an error as it is impossible\nto determine which one to use. If you don't want to remove the extra implementation(s), you can mark one of them with\nthe ",(0,r.jsx)(n.code,{children:"@Primary"})," annotation to lift the ambiguity. You may alternatively use the ",(0,r.jsx)(n.code,{children:"@Exclude"})," annotation if you don't want\none implementation to be picked up by Botrino."]}),"\n"]})})]})}function h(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>l});var r=t(6540);const o={},i=r.createContext(o);function a(e){const n=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:a(e.components),r.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/7c110bd0.3c7fba26.js b/assets/js/7c110bd0.3c7fba26.js new file mode 100644 index 0000000..f9b7c4a --- /dev/null +++ b/assets/js/7c110bd0.3c7fba26.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[877],{2614:i=>{i.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"someSidebar":[{"type":"category","label":"Discover Botrino","items":[{"type":"link","label":"Introduction","href":"/docs/","docId":"intro","unlisted":false},{"type":"link","label":"Getting Started","href":"/docs/getting-started","docId":"getting-started","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Framework API","items":[{"type":"link","label":"Working with services","href":"/docs/api/working-with-services","docId":"api/working-with-services","unlisted":false},{"type":"link","label":"Configuring your bot","href":"/docs/api/configuring-your-bot","docId":"api/configuring-your-bot","unlisted":false},{"type":"link","label":"Customizing the Discord client","href":"/docs/api/customizing-the-discord-client","docId":"api/customizing-the-discord-client","unlisted":false},{"type":"link","label":"Extensions","href":"/docs/api/extensions","docId":"api/extensions","unlisted":false},{"type":"link","label":"Internationalization","href":"/docs/api/i18n","docId":"api/i18n","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Interaction library","items":[{"type":"link","label":"Overview","href":"/docs/interaction-library/overview","docId":"interaction-library/overview","unlisted":false},{"type":"link","label":"Configuration","href":"/docs/interaction-library/configuration","docId":"interaction-library/configuration","unlisted":false},{"type":"link","label":"Creating commands","href":"/docs/interaction-library/creating-commands","docId":"interaction-library/creating-commands","unlisted":false},{"type":"link","label":"Acknowledging interactions","href":"/docs/interaction-library/acknowledging-interactions","docId":"interaction-library/acknowledging-interactions","unlisted":false},{"type":"link","label":"Dealing with components","href":"/docs/interaction-library/dealing-with-components","docId":"interaction-library/dealing-with-components","unlisted":false},{"type":"link","label":"Privileges","href":"/docs/interaction-library/privileges","docId":"interaction-library/privileges","unlisted":false},{"type":"link","label":"Cooldowns","href":"/docs/interaction-library/cooldowns","docId":"interaction-library/cooldowns","unlisted":false},{"type":"link","label":"Handling errors","href":"/docs/interaction-library/handling-errors","docId":"interaction-library/handling-errors","unlisted":false},{"type":"link","label":"Filtering and adapting events","href":"/docs/interaction-library/filtering-and-adapting-events","docId":"interaction-library/filtering-and-adapting-events","unlisted":false}],"collapsed":true,"collapsible":true}]},"docs":{"api/configuring-your-bot":{"id":"api/configuring-your-bot","title":"Configuring your bot","description":"Standardizing the way to configure a bot is one of the primary goals of Botrino. This section will cover the","sidebar":"someSidebar"},"api/customizing-the-discord-client":{"id":"api/customizing-the-discord-client","title":"Customizing the Discord client","description":"When you start a project with Botrino, the Discord client is constructed for you, so you don\'t have anything to do in","sidebar":"someSidebar"},"api/extensions":{"id":"api/extensions","title":"Extensions","description":"When you start your application, Botrino automatically loads all the classes present in bot modules. According to the","sidebar":"someSidebar"},"api/i18n":{"id":"api/i18n","title":"Internationalization","description":"The bot you are developing is likely to be used by people which primary language is not English. To support these users,","sidebar":"someSidebar"},"api/working-with-services":{"id":"api/working-with-services","title":"Working with services","description":"Services are certainly what contribute the most in making Botrino a so concise and easy to use framework. You will","sidebar":"someSidebar"},"getting-started":{"id":"getting-started","title":"Getting Started","description":"Prerequisites","sidebar":"someSidebar"},"interaction-library/acknowledging-interactions":{"id":"interaction-library/acknowledging-interactions","title":"Acknowledging interactions","description":"When an interaction event is received from the gateway, the library is able to acknowledge them automatically. This","sidebar":"someSidebar"},"interaction-library/configuration":{"id":"interaction-library/configuration","title":"Configuration","description":"This page will cover the configuration part of the interaction library.","sidebar":"someSidebar"},"interaction-library/cooldowns":{"id":"interaction-library/cooldowns","title":"Cooldowns","description":"If your commands perform costly operations or can potentially be abused, you may want to set a limit on the number of","sidebar":"someSidebar"},"interaction-library/creating-commands":{"id":"interaction-library/creating-commands","title":"Creating commands","description":"Commands represent the main form of interaction that Discord bots have with users. Creating commands is a simple and","sidebar":"someSidebar"},"interaction-library/dealing-with-components":{"id":"interaction-library/dealing-with-components","title":"Dealing with components","description":"The library offers two ways to handle interactions with message components (buttons and select menus).","sidebar":"someSidebar"},"interaction-library/filtering-and-adapting-events":{"id":"interaction-library/filtering-and-adapting-events","title":"Filtering and adapting events","description":"Listeners are triggered when an interaction event is received via the Discord gateway. It is possible for you to","sidebar":"someSidebar"},"interaction-library/handling-errors":{"id":"interaction-library/handling-errors","title":"Handling errors","description":"The execution of a interaction may fail for many reasons. You can handle these errors in a way that is adapted to each","sidebar":"someSidebar"},"interaction-library/overview":{"id":"interaction-library/overview","title":"Overview","description":"Botrino comes with a library that allows to easily create application commands and listeners for Discord interactions.","sidebar":"someSidebar"},"interaction-library/privileges":{"id":"interaction-library/privileges","title":"Privileges","description":"Another common use case when making commands is to be able to restrict access to some commands that should not be used","sidebar":"someSidebar"},"intro":{"id":"intro","title":"Introduction","description":"What is Botrino?","sidebar":"someSidebar"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/80e86806.b78682d1.js b/assets/js/80e86806.b78682d1.js deleted file mode 100644 index 17065fc..0000000 --- a/assets/js/80e86806.b78682d1.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[516],{3905:function(e,t,n){n.d(t,{Zo:function(){return d},kt:function(){return 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<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 c(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({}),l=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=l(e.components);return i.createElement(s.Provider,{value:t},e.children)},p={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,d=c(e,["components","mdxType","originalType","parentName"]),u=l(n),h=a,m=u["".concat(s,".").concat(h)]||u[h]||p[h]||r;return n?i.createElement(m,o(o({ref:t},d),{},{components:n})):i.createElement(m,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]=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:a,o[1]=c;for(var l=2;l<r;l++)o[l]=n[l];return i.createElement.apply(null,o)}return i.createElement.apply(null,n)}u.displayName="MDXCreateElement"},3424:function(e,t,n){n.r(t),n.d(t,{frontMatter:function(){return c},metadata:function(){return s},toc:function(){return l},default:function(){return p}});var i=n(7462),a=n(3366),r=(n(7294),n(3905)),o=["components"],c={title:"Working with services"},s={unversionedId:"api/working-with-services",id:"api/working-with-services",isDocsHomePage:!1,title:"Working with services",description:"Services are certainly what contribute the most in making Botrino a so concise and easy to use framework. You will hopefully understand why after reading this page introducing services and showing how to use their power to their fullest extent.",source:"@site/docs/api/working-with-services.md",sourceDirName:"api",slug:"/api/working-with-services",permalink:"/docs/api/working-with-services",editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/api/working-with-services.md",version:"current",frontMatter:{title:"Working with services"},sidebar:"someSidebar",previous:{title:"Getting Started",permalink:"/docs/getting-started"},next:{title:"Configuring your bot",permalink:"/docs/api/configuring-your-bot"}},l=[{value:"What is a service?",id:"what-is-a-service",children:[]},{value:"How to use services?",id:"how-to-use-services",children:[{value:"Declaring a service",id:"declaring-a-service",children:[]},{value:"Injecting a service in a constructor",id:"injecting-a-service-in-a-constructor",children:[]},{value:"Injecting a service in a static factory",id:"injecting-a-service-in-a-static-factory",children:[]},{value:"Injecting a service in a reactive static factory",id:"injecting-a-service-in-a-reactive-static-factory",children:[]}]},{value:"Built-in services",id:"built-in-services",children:[{value:"<code>GatewayDiscordClient</code>",id:"gatewaydiscordclient",children:[]},{value:"<code>ConfigContainer</code>",id:"configcontainer",children:[]}]}],d={toc:l};function p(e){var t=e.components,n=(0,a.Z)(e,o);return(0,r.kt)("wrapper",(0,i.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"Services are certainly what contribute the most in making Botrino a so concise and easy to use framework. You will hopefully understand why after reading this page introducing services and showing how to use their power to their fullest extent."),(0,r.kt)("h2",{id:"what-is-a-service"},"What is a service?"),(0,r.kt)("p",null,"Services are more or less the same thing as ",(0,r.kt)("a",{parentName:"p",href:"https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#beans"},"beans in Spring"),". They are Java objects that are instantiated once at the start of your application, and that you can inject everywhere in your app. A service can define dependencies to other services, which are resolved when the service is created."),(0,r.kt)("p",null,"As such, the concept of dependency injection (DI) is also used in Botrino. Under the hood, it utilizes the ",(0,r.kt)("a",{parentName:"p",href:"https://alex1304.github.io/rdi/docs/intro"},"RDI library")," which supports factories returning reactive types."),(0,r.kt)("h2",{id:"how-to-use-services"},"How to use services?"),(0,r.kt)("p",null,"Botrino will be able to find your services automatically in your app module, as long as your module is ",(0,r.kt)("inlineCode",{parentName:"p"},"open")," and is annotated with ",(0,r.kt)("inlineCode",{parentName:"p"},"@BotModule"),", as explained in the ",(0,r.kt)("a",{parentName:"p",href:"/docs/getting-started"},"Getting Started guide"),"."),(0,r.kt)("h3",{id:"declaring-a-service"},"Declaring a service"),(0,r.kt)("p",null,"For a class to be recognized as a service, you need to annotate it with ",(0,r.kt)("inlineCode",{parentName:"p"},"@RdiService"),":"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-java"},"@RdiService\npublic class A {\n\n}\n")),(0,r.kt)("p",null,"With only this code, an instance of ",(0,r.kt)("inlineCode",{parentName:"p"},"A")," will be created on startup. By default it assumes that a public no-arg constructor exists, which is the case in the code above. But there are many ways to construct a service, and that's what makes them interesting."),(0,r.kt)("h3",{id:"injecting-a-service-in-a-constructor"},"Injecting a service in a constructor"),(0,r.kt)("p",null,"Let's create another service ",(0,r.kt)("inlineCode",{parentName:"p"},"B"),", which injects ",(0,r.kt)("inlineCode",{parentName:"p"},"A")," in its constructor:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-java"},"@RdiService\npublic class B {\n\n @RdiFactory\n public B(A a) {\n // you can use A here\n }\n}\n")),(0,r.kt)("p",null,"The ",(0,r.kt)("inlineCode",{parentName:"p"},"@RdiFactory")," annotation is what indicates the method to create the service, with the possibility to inject other services in the arguments. In this scenario, the following will happen on startup:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Botrino will find ",(0,r.kt)("inlineCode",{parentName:"li"},"A")," and ",(0,r.kt)("inlineCode",{parentName:"li"},"B")," in your module, and register them as services"),(0,r.kt)("li",{parentName:"ul"},"It will see that ",(0,r.kt)("inlineCode",{parentName:"li"},"B")," injects ",(0,r.kt)("inlineCode",{parentName:"li"},"A")," in constructor, so ",(0,r.kt)("inlineCode",{parentName:"li"},"A")," needs to be created first before ",(0,r.kt)("inlineCode",{parentName:"li"},"B")," can be created"),(0,r.kt)("li",{parentName:"ul"},"Services are created following the dependency tree.")),(0,r.kt)("h3",{id:"injecting-a-service-in-a-static-factory"},"Injecting a service in a static factory"),(0,r.kt)("p",null,"The method annotated with ",(0,r.kt)("inlineCode",{parentName:"p"},"@RdiFactory")," can as well be a static factory method instead of a constructor:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-java"},"@RdiService\npublic class B {\n\n private final A a;\n\n private B(A a) {\n this.a = a;\n }\n\n @RdiFactory\n public static B create(A a) {\n return new B(a);\n }\n}\n")),(0,r.kt)("div",{className:"admonition admonition-caution alert alert--warning"},(0,r.kt)("div",{parentName:"div",className:"admonition-heading"},(0,r.kt)("h5",{parentName:"div"},(0,r.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,r.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},(0,r.kt)("path",{parentName:"svg",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"}))),"caution")),(0,r.kt)("div",{parentName:"div",className:"admonition-content"},(0,r.kt)("p",{parentName:"div"},"The return type of the static factory must be ",(0,r.kt)("inlineCode",{parentName:"p"},"B")," or a subtype of ",(0,r.kt)("inlineCode",{parentName:"p"},"B"),"."))),(0,r.kt)("h3",{id:"injecting-a-service-in-a-reactive-static-factory"},"Injecting a service in a reactive static factory"),(0,r.kt)("p",null,"If you need to perform some reactive tasks in order to create your object, Botrino (in fact, RDI) allows you to return a ",(0,r.kt)("inlineCode",{parentName:"p"},"Publisher")," of the service instead of the service itself:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-java"},"@RdiService\npublic class B {\n\n private final A a;\n\n private B(A a) {\n this.a = a;\n }\n\n @RdiFactory\n public static Mono<B> create(A a) {\n return Mono.fromCallable(() -> new B(a));\n }\n}\n")),(0,r.kt)("p",null,"In this case, if ",(0,r.kt)("inlineCode",{parentName:"p"},"B")," is injected somewhere else, it will first subscribe to the publisher returned by the static factory, and create the service only after the instance of ",(0,r.kt)("inlineCode",{parentName:"p"},"B")," is emitted."),(0,r.kt)("div",{className:"admonition admonition-info alert alert--info"},(0,r.kt)("div",{parentName:"div",className:"admonition-heading"},(0,r.kt)("h5",{parentName:"div"},(0,r.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,r.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,r.kt)("path",{parentName:"svg",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"}))),"info")),(0,r.kt)("div",{parentName:"div",className:"admonition-content"},(0,r.kt)("p",{parentName:"div"},"Check out the ",(0,r.kt)("a",{parentName:"p",href:"https://alex1304.github.io/rdi/docs/intro"},"RDI documentation")," for more examples and details on how dependency injection works."))),(0,r.kt)("h2",{id:"built-in-services"},"Built-in services"),(0,r.kt)("h3",{id:"gatewaydiscordclient"},(0,r.kt)("inlineCode",{parentName:"h3"},"GatewayDiscordClient")),(0,r.kt)("p",null,"Maybe you've been wondering how to access the instance of the Discord client of your bot? Well, now you have the answer: ",(0,r.kt)("inlineCode",{parentName:"p"},"GatewayDiscordClient")," is registered as a service, which means you can inject it in your own services!"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-java"},"@RdiService\npublic class A {\n\n @RdiFactory\n public A(GatewayDiscordClient gateway) {\n // you can use GatewayDiscordClient here\n }\n}\n")),(0,r.kt)("h3",{id:"configcontainer"},(0,r.kt)("inlineCode",{parentName:"h3"},"ConfigContainer")),(0,r.kt)("p",null,"To access the values of the configuration file, the service ",(0,r.kt)("inlineCode",{parentName:"p"},"ConfigContainer")," is registered and you can inject it in your own services. For example, to get the bot token:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-java"},"@RdiService\npublic class A {\n\n @RdiFactory\n public A(ConfigContainer configContainer) {\n var botConfig = configContainer.get(BotConfig.class);\n var token = botConfig.token();\n }\n}\n")),(0,r.kt)("p",null,"We will see the ",(0,r.kt)("inlineCode",{parentName:"p"},"ConfigContainer")," more in depth in the next section, ",(0,r.kt)("a",{parentName:"p",href:"/docs/api/configuring-your-bot"},"Configuring your bot"),"."))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/9187e980.2ca26c7f.js b/assets/js/9187e980.2ca26c7f.js new file mode 100644 index 0000000..6f700e5 --- /dev/null +++ b/assets/js/9187e980.2ca26c7f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[608],{2488:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>s,default:()=>u,frontMatter:()=>r,metadata:()=>c,toc:()=>d});var o=t(4848),i=t(8453);const r={title:"Customizing the Discord client"},s=void 0,c={id:"api/customizing-the-discord-client",title:"Customizing the Discord client",description:"When you start a project with Botrino, the Discord client is constructed for you, so you don't have anything to do in",source:"@site/docs/api/customizing-the-discord-client.mdx",sourceDirName:"api",slug:"/api/customizing-the-discord-client",permalink:"/docs/api/customizing-the-discord-client",draft:!1,unlisted:!1,editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/api/customizing-the-discord-client.mdx",tags:[],version:"current",frontMatter:{title:"Customizing the Discord client"},sidebar:"someSidebar",previous:{title:"Configuring your bot",permalink:"/docs/api/configuring-your-bot"},next:{title:"Extensions",permalink:"/docs/api/extensions"}},a={},d=[{value:"The <code>LoginHandler</code> interface",id:"the-loginhandler-interface",level:2}];function l(e){const n={admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.p,{children:"When you start a project with Botrino, the Discord client is constructed for you, so you don't have anything to do in\norder to run the bot. However, in most cases, you will want to take full control on how the Discord client is created.\nThis section will show you how to fully customize the Discord client and the gateway login process."}),"\n",(0,o.jsxs)(n.h2,{id:"the-loginhandler-interface",children:["The ",(0,o.jsx)(n.code,{children:"LoginHandler"})," interface"]}),"\n",(0,o.jsxs)(n.p,{children:["All you need to do is to provide one implementation of the ",(0,o.jsx)(n.code,{children:"LoginHandler"})," interface. It defines one\nmethod, ",(0,o.jsx)(n.code,{children:"Mono<GatewayDiscordClient> login(ConfigContainer configContainer)"}),", that you can override to define yourself\nhow your bot connects to the Discord gateway. The default implementation of this method builds the Discord client with\ndefault settings, using the token, presence status, and intents from the configuration. It can be recreated like this:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-java",children:"package com.example.myproject;\n\nimport botrino.api.config.object.BotConfig;\nimport discord4j.core.DiscordClient;\nimport discord4j.core.GatewayDiscordClient;\nimport discord4j.core.object.presence.Presence;\nimport discord4j.core.shard.MemberRequestFilter;\nimport discord4j.gateway.intent.IntentSet;\nimport reactor.core.publisher.Mono;\n\npublic final class DefaultLoginHandler implements LoginHandler {\n\n @Override\n public Mono<GatewayDiscordClient> login(ConfigContainer configContainer) {\n var config = configContainer.get(BotConfig.class);\n var discordClient = DiscordClient.create(config.token());\n return discordClient.gateway()\n .setInitialStatus(shard -> config.presence()\n .map(BotConfig.StatusConfig::toStatusUpdate)\n .orElseGet(Presence::online))\n .setEnabledIntents(config.enabledIntents().stream().boxed()\n .map(IntentSet::of)\n .findAny()\n .orElseGet(IntentSet::nonPrivileged))\n .setMemberRequestFilter(MemberRequestFilter.none())\n .login()\n .single();\n }\n}\n"})}),"\n",(0,o.jsx)(n.admonition,{type:"caution",children:(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"The implementation class must have a no-arg constructor."}),"\n",(0,o.jsxs)(n.li,{children:["If more than one implementation of ",(0,o.jsx)(n.code,{children:"LoginHandler"})," are found, it will result in an error as it is impossible to\ndetermine which one to use. If you don't want to remove the extra implementation(s), you can mark one of them with\nthe ",(0,o.jsx)(n.code,{children:"@Primary"})," annotation to lift the ambiguity. You may alternatively use the ",(0,o.jsx)(n.code,{children:"@Exclude"})," annotation if you don't want\none implementation to be picked up by Botrino."]}),"\n"]})})]})}function u(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>c});var o=t(6540);const i={},r=o.createContext(i);function s(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/93231161.b5ae05f4.js b/assets/js/93231161.b5ae05f4.js deleted file mode 100644 index 45c1d7c..0000000 --- a/assets/js/93231161.b5ae05f4.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[772],{3905:function(e,t,n){n.d(t,{Zo:function(){return d},kt:function(){return s}});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 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 o(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){r(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,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(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)&&(r[n]=e[n])}return r}var c=a.createContext({}),u=function(e){var t=a.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=u(e.components);return a.createElement(c.Provider,{value:t},e.children)},m={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,r=e.mdxType,i=e.originalType,c=e.parentName,d=l(e,["components","mdxType","originalType","parentName"]),p=u(n),s=r,f=p["".concat(c,".").concat(s)]||p[s]||m[s]||i;return n?a.createElement(f,o(o({ref:t},d),{},{components:n})):a.createElement(f,o({ref:t},d))}));function s(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,o=new Array(i);o[0]=p;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l.mdxType="string"==typeof e?e:r,o[1]=l;for(var u=2;u<i;u++)o[u]=n[u];return a.createElement.apply(null,o)}return a.createElement.apply(null,n)}p.displayName="MDXCreateElement"},5839:function(e,t,n){n.r(t),n.d(t,{frontMatter:function(){return l},metadata:function(){return c},toc:function(){return u},default:function(){return m}});var a=n(7462),r=n(3366),i=(n(7294),n(3905)),o=["components"],l={title:"Configuration"},c={unversionedId:"interaction-library/configuration",id:"interaction-library/configuration",isDocsHomePage:!1,title:"Configuration",description:"This page will cover the configuration part of the interaction library.",source:"@site/docs/interaction-library/configuration.md",sourceDirName:"interaction-library",slug:"/interaction-library/configuration",permalink:"/docs/interaction-library/configuration",editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/interaction-library/configuration.md",version:"current",frontMatter:{title:"Configuration"},sidebar:"someSidebar",previous:{title:"Overview",permalink:"/docs/interaction-library/overview"},next:{title:"Creating commands",permalink:"/docs/interaction-library/creating-commands"}},u=[{value:"Configuring the library for the Botrino framework",id:"configuring-the-library-for-the-botrino-framework",children:[]},{value:"Configuring the library manually",id:"configuring-the-library-manually",children:[]}],d={toc:u};function m(e){var t=e.components,n=(0,r.Z)(e,o);return(0,i.kt)("wrapper",(0,a.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"This page will cover the configuration part of the interaction library."),(0,i.kt)("h2",{id:"configuring-the-library-for-the-botrino-framework"},"Configuring the library for the Botrino framework"),(0,i.kt)("p",null,"For the library to work with the Botrino framework, you just need to make sure that your bot module ",(0,i.kt)("inlineCode",{parentName:"p"},"requires botrino.interaction"),", and that the ",(0,i.kt)("inlineCode",{parentName:"p"},"interaction")," entry is present in your ",(0,i.kt)("inlineCode",{parentName:"p"},"config.json"),". The entry has the following structure:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-json"},'{\n "interaction": {\n "application_commands_guild_id": null,\n "default_ack_mode": "default",\n "await_component_timeout_seconds": 600\n }\n}\n')),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:null},"Field"),(0,i.kt)("th",{parentName:"tr",align:null},"Type"),(0,i.kt)("th",{parentName:"tr",align:null},"Description"),(0,i.kt)("th",{parentName:"tr",align:null},"Required?"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},"application_commands_guild_id"),(0,i.kt)("td",{parentName:"tr",align:null},"long"),(0,i.kt)("td",{parentName:"tr",align:null},"The ID of the guild in which commands will be deployed. Specifying ",(0,i.kt)("inlineCode",{parentName:"td"},"null")," or completely omitting the field will deploy them globally."),(0,i.kt)("td",{parentName:"tr",align:null},"No, default ",(0,i.kt)("inlineCode",{parentName:"td"},"null"))),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},"default_ack_mode"),(0,i.kt)("td",{parentName:"tr",align:null},"string"),(0,i.kt)("td",{parentName:"tr",align:null},"How interactions should be acknowledged by default. Possible values (case insensitive): ",(0,i.kt)("ul",null,(0,i.kt)("li",null,(0,i.kt)("inlineCode",{parentName:"td"},"default"),": equivalent to ",(0,i.kt)("inlineCode",{parentName:"td"},"defer"),"."),(0,i.kt)("li",null,(0,i.kt)("inlineCode",{parentName:"td"},"defer"),": automatically acknowledges all interactions with defer reply or defer edit as appropriate. This is the default behavior."),(0,i.kt)("li",null,(0,i.kt)("inlineCode",{parentName:"td"},"defer_ephemeral"),": similar to ",(0,i.kt)("inlineCode",{parentName:"td"},"defer")," except the EPHEMERAL flag is set, meaning the next reply/edit will only be visible to the user who initiated the interaction."),(0,i.kt)("li",null,(0,i.kt)("inlineCode",{parentName:"td"},"none"),": won't acknowledge any interaction automatically. In that case, you will be in charge of acknowledging interactions manually."))),(0,i.kt)("td",{parentName:"tr",align:null},"No, default ",(0,i.kt)("inlineCode",{parentName:"td"},"default"))),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},"await_component_timeout_seconds"),(0,i.kt)("td",{parentName:"tr",align:null},"integer"),(0,i.kt)("td",{parentName:"tr",align:null},"The time in seconds after which ",(0,i.kt)("inlineCode",{parentName:"td"},"InteractionContext::awaitComponentInteraction")," automatically times out."),(0,i.kt)("td",{parentName:"tr",align:null},"No, default ",(0,i.kt)("inlineCode",{parentName:"td"},"600"))))),(0,i.kt)("h2",{id:"configuring-the-library-manually"},"Configuring the library manually"),(0,i.kt)("p",null,"If you don't use the framework, the configuration is done via the ",(0,i.kt)("inlineCode",{parentName:"p"},"InteractionConfig")," object, which is used to construct ",(0,i.kt)("inlineCode",{parentName:"p"},"InteractionService"),":"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-java"},'// Use default values\nfinal var config = InteractionConfig.withDefaults();\n// Use custom values\nfinal var config = InteractionConfig.builder()\n .applicationCommandsGuildId(123456L)\n .defaultACKMode("default")\n .awaitComponentTimeoutSeconds(600)\n .build();\n// Login to Discord using the token passed as program argument\nfinal var gateway = DiscordClient.create(args[0]).login().block();\n// Initialize the interaction service\nfinal var interactionService = InteractionService.create(config, gateway);\n')),(0,i.kt)("p",null,"The methods available in ",(0,i.kt)("inlineCode",{parentName:"p"},"InteractionConfig::builder")," are the same as the ones in the JSON described previously."),(0,i.kt)("p",null,"Once you have the ",(0,i.kt)("inlineCode",{parentName:"p"},"InteractionService")," instance, you can register your commands and subscribe to its ",(0,i.kt)("inlineCode",{parentName:"p"},"run()")," method:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-java"},"// Register your commands\ninteractionService.registerChatInputCommand(new PingCommand());\n// Listen for interaction events until the bot disconnects\ninteractionService.run().takeUntilOther(gateway.onDisconnect()).block();\n")),(0,i.kt)("div",{className:"admonition admonition-info alert alert--info"},(0,i.kt)("div",{parentName:"div",className:"admonition-heading"},(0,i.kt)("h5",{parentName:"div"},(0,i.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,i.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,i.kt)("path",{parentName:"svg",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"}))),"info")),(0,i.kt)("div",{parentName:"div",className:"admonition-content"},(0,i.kt)("p",{parentName:"div"},"None of this is necessary when using the Botrino framework. Creation of ",(0,i.kt)("inlineCode",{parentName:"p"},"InteractionConfig")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"InteractionService"),", registration of commands and execution of the ",(0,i.kt)("inlineCode",{parentName:"p"},"run()")," method are all done automatically."))))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/935f2afb.f89a2009.js b/assets/js/935f2afb.f89a2009.js deleted file mode 100644 index 90357ab..0000000 --- a/assets/js/935f2afb.f89a2009.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[53],{1109:function(e){e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","isLast":true,"docsSidebars":{"someSidebar":[{"collapsed":true,"type":"category","label":"Discover Botrino","items":[{"type":"link","label":"Introduction","href":"/docs/"},{"type":"link","label":"Getting Started","href":"/docs/getting-started"}]},{"collapsed":true,"type":"category","label":"Framework API","items":[{"type":"link","label":"Working with services","href":"/docs/api/working-with-services"},{"type":"link","label":"Configuring your bot","href":"/docs/api/configuring-your-bot"},{"type":"link","label":"Customizing the Discord client","href":"/docs/api/customizing-the-discord-client"},{"type":"link","label":"Extensions","href":"/docs/api/extensions"},{"type":"link","label":"Internationalization","href":"/docs/api/i18n"}]},{"collapsed":true,"type":"category","label":"Interaction library","items":[{"type":"link","label":"Overview","href":"/docs/interaction-library/overview"},{"type":"link","label":"Configuration","href":"/docs/interaction-library/configuration"},{"type":"link","label":"Creating commands","href":"/docs/interaction-library/creating-commands"},{"type":"link","label":"Acknowledging interactions","href":"/docs/interaction-library/acknowledging-interactions"},{"type":"link","label":"Dealing with components","href":"/docs/interaction-library/dealing-with-components"},{"type":"link","label":"Privileges","href":"/docs/interaction-library/privileges"},{"type":"link","label":"Cooldowns","href":"/docs/interaction-library/cooldowns"},{"type":"link","label":"Handling errors","href":"/docs/interaction-library/handling-errors"},{"type":"link","label":"Filtering and adapting events","href":"/docs/interaction-library/filtering-and-adapting-events"}]}]},"permalinkToSidebar":{"/docs/api/configuring-your-bot":"someSidebar","/docs/api/customizing-the-discord-client":"someSidebar","/docs/api/extensions":"someSidebar","/docs/api/i18n":"someSidebar","/docs/api/working-with-services":"someSidebar","/docs/getting-started":"someSidebar","/docs/interaction-library/acknowledging-interactions":"someSidebar","/docs/interaction-library/configuration":"someSidebar","/docs/interaction-library/cooldowns":"someSidebar","/docs/interaction-library/creating-commands":"someSidebar","/docs/interaction-library/dealing-with-components":"someSidebar","/docs/interaction-library/filtering-and-adapting-events":"someSidebar","/docs/interaction-library/handling-errors":"someSidebar","/docs/interaction-library/overview":"someSidebar","/docs/interaction-library/privileges":"someSidebar","/docs/":"someSidebar"}}')}}]); \ No newline at end of file diff --git a/assets/js/95e8cacb.7ff627ee.js b/assets/js/95e8cacb.7ff627ee.js deleted file mode 100644 index 5c9178f..0000000 --- a/assets/js/95e8cacb.7ff627ee.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[644],{3905:function(e,t,n){n.d(t,{Zo:function(){return p},kt:function(){return 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 c=r.createContext({}),s=function(e){var t=r.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},p=function(e){var t=s(e.components);return r.createElement(c.Provider,{value:t},e.children)},d={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,c=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),m=s(n),u=i,h=m["".concat(c,".").concat(u)]||m[u]||d[u]||a;return n?r.createElement(h,o(o({ref:t},p),{},{components:n})):r.createElement(h,o({ref:t},p))}));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 c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l.mdxType="string"==typeof e?e:i,o[1]=l;for(var s=2;s<a;s++)o[s]=n[s];return r.createElement.apply(null,o)}return r.createElement.apply(null,n)}m.displayName="MDXCreateElement"},7075:function(e,t,n){n.r(t),n.d(t,{frontMatter:function(){return l},metadata:function(){return c},toc:function(){return s},default:function(){return d}});var r=n(7462),i=n(3366),a=(n(7294),n(3905)),o=["components"],l={title:"Filtering and adapting events"},c={unversionedId:"interaction-library/filtering-and-adapting-events",id:"interaction-library/filtering-and-adapting-events",isDocsHomePage:!1,title:"Filtering and adapting events",description:"Listeners are triggered when an interaction event is received via the Discord gateway. It is possible for you to intervene between the moment the event is received and the moment the listener is triggered. This allows you to drop some events to prevent any command from being executed in a certain context, or to determine which locale to apply according to the event received.",source:"@site/docs/interaction-library/filtering-and-adapting-events.md",sourceDirName:"interaction-library",slug:"/interaction-library/filtering-and-adapting-events",permalink:"/docs/interaction-library/filtering-and-adapting-events",editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/interaction-library/filtering-and-adapting-events.md",version:"current",frontMatter:{title:"Filtering and adapting events"},sidebar:"someSidebar",previous:{title:"Handling errors",permalink:"/docs/interaction-library/handling-errors"}},s=[{value:"The <code>InteractionEventProcessor</code> interface",id:"the-interactioneventprocessor-interface",children:[]}],p={toc:s};function d(e){var t=e.components,n=(0,i.Z)(e,o);return(0,a.kt)("wrapper",(0,r.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Listeners are triggered when an interaction event is received via the Discord gateway. It is possible for you to intervene between the moment the event is received and the moment the listener is triggered. This allows you to drop some events to prevent any command from being executed in a certain context, or to determine which locale to apply according to the event received."),(0,a.kt)("h2",{id:"the-interactioneventprocessor-interface"},"The ",(0,a.kt)("inlineCode",{parentName:"h2"},"InteractionEventProcessor")," interface"),(0,a.kt)("p",null,"Create a class that implements ",(0,a.kt)("inlineCode",{parentName:"p"},"InteractionEventProcessor"),". If you are using the Botrino framework, it will automatically be set into the interaction service. Otherwise, you need to set it via the builder when constructing your ",(0,a.kt)("inlineCode",{parentName:"p"},"InteractionService"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-java"},"final var interactionService = InteractionService.builder(config, gateway)\n .setEventProcessor(new MyEventProcessor())\n .build();\n")),(0,a.kt)("p",null,"Here is an example of ",(0,a.kt)("inlineCode",{parentName:"p"},"InteractionEventProcessor")," implementation:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-java"},'package testbot1;\n\nimport botrino.interaction.InteractionEventProcessor;\nimport discord4j.core.event.domain.interaction.InteractionCreateEvent;\nimport discord4j.core.object.entity.channel.GuildMessageChannel;\nimport reactor.core.publisher.Mono;\n\nimport java.util.Locale;\n\npublic final class MyEventProcessor implements InteractionEventProcessor {\n\n @Override\n public Mono<Boolean> filter(InteractionCreateEvent event) {\n return Mono.just(!event.getInteraction().getMember()\n .map(member -> member.getDisplayName().toLowerCase().contains("ignore me"))\n .orElse(true));\n }\n\n @Override\n public Mono<Locale> computeLocale(InteractionCreateEvent event) {\n return event.getInteraction().getChannel()\n .ofType(GuildMessageChannel.class)\n .flatMap(guildChannel -> {\n if (guildChannel.getName().endsWith("fr")) {\n return Mono.just(Locale.FRENCH);\n } else if (guildChannel.getName().endsWith("de")) {\n return Mono.just(Locale.GERMAN);\n } else {\n return Mono.empty();\n }\n });\n }\n}\n')),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"filter(InteractionCreateEvent)")," allows to decide whether to keep or to drop the given ",(0,a.kt)("inlineCode",{parentName:"li"},"InteractionCreateEvent"),'. The default implementation will allow all events. This method can be useful if you want to implement a blacklist system to ban some users from using your bot. In this example, we are filtering out users which username contains the string "ignore me".'),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"computeLocale(InteractionCreateEvent)")," allows to adapt the locale according to the event received. In order to keep the default locale, you are expected to return an empty ",(0,a.kt)("inlineCode",{parentName:"li"},"Mono"),". The returned locale will be accessible via the ",(0,a.kt)("inlineCode",{parentName:"li"},"InteractionContext")," (which implements ",(0,a.kt)("inlineCode",{parentName:"li"},"botrino.api.Translator"),", see ",(0,a.kt)("a",{parentName:"li",href:"/docs/api/i18n"},"Internationalization"),"). You will typically store the locale in a database (either per guild or per user) and retrieve it here using the data given by the interaction event. In this example, we are interpreting the suffix of the channel name as the locale, with only French and German being supported. It will use the default locale defined in the ",(0,a.kt)("a",{parentName:"li",href:"/docs/interaction-library/configuration"},"configuration")," in all other cases.")),(0,a.kt)("div",{className:"admonition admonition-caution alert alert--warning"},(0,a.kt)("div",{parentName:"div",className:"admonition-heading"},(0,a.kt)("h5",{parentName:"div"},(0,a.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,a.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},(0,a.kt)("path",{parentName:"svg",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"}))),"Considerations when using the Botrino framework")),(0,a.kt)("div",{parentName:"div",className:"admonition-content"},(0,a.kt)("ul",{parentName:"div"},(0,a.kt)("li",{parentName:"ul"},"The implementation class must have a no-arg constructor."),(0,a.kt)("li",{parentName:"ul"},"If more than one implementation of ",(0,a.kt)("inlineCode",{parentName:"li"},"InteractionEventProcessor")," are found, it will result in an error as it is impossible to determine which one to use. If you don't want to remove the extra implementation(s), you can mark one of them with the ",(0,a.kt)("inlineCode",{parentName:"li"},"@Primary")," annotation to lift the ambiguity. You may alternatively use the ",(0,a.kt)("inlineCode",{parentName:"li"},"@Exclude")," annotation if you don't want one implementation to be picked up by Botrino.")))))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/a7456010.47cad1bc.js b/assets/js/a7456010.47cad1bc.js new file mode 100644 index 0000000..b46b932 --- /dev/null +++ b/assets/js/a7456010.47cad1bc.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[235],{8552:s=>{s.exports=JSON.parse('{"name":"docusaurus-plugin-content-pages","id":"default"}')}}]); \ No newline at end of file diff --git a/assets/js/a7bd4aaa.fd305e17.js b/assets/js/a7bd4aaa.fd305e17.js new file mode 100644 index 0000000..286d4ce --- /dev/null +++ b/assets/js/a7bd4aaa.fd305e17.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[98],{4532:(n,e,s)=>{s.r(e),s.d(e,{default:()=>d});s(6540);var r=s(1003),o=s(2967),t=s(2252),c=s(2831),i=s(1463),u=s(4848);function a(n){const{version:e}=n;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(i.A,{version:e.version,tag:(0,o.tU)(e.pluginId,e.version)}),(0,u.jsx)(r.be,{children:e.noIndex&&(0,u.jsx)("meta",{name:"robots",content:"noindex, nofollow"})})]})}function l(n){const{version:e,route:s}=n;return(0,u.jsx)(r.e3,{className:e.className,children:(0,u.jsx)(t.n,{version:e,children:(0,c.v)(s.routes)})})}function d(n){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(a,{...n}),(0,u.jsx)(l,{...n})]})}}}]); \ No newline at end of file diff --git a/assets/js/a94703ab.10863959.js b/assets/js/a94703ab.10863959.js new file mode 100644 index 0000000..a554592 --- /dev/null +++ b/assets/js/a94703ab.10863959.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[48],{2559:(e,t,n)=>{n.r(t),n.d(t,{default:()=>be});var a=n(6540),o=n(8215),i=n(1003),s=n(7559),l=n(4142),r=n(6588),c=n(1312),d=n(3104),u=n(5062);const m={backToTopButton:"backToTopButton_sjWU",backToTopButtonShow:"backToTopButtonShow_xfvO"};var b=n(4848);function h(){const{shown:e,scrollToTop:t}=function(e){let{threshold:t}=e;const[n,o]=(0,a.useState)(!1),i=(0,a.useRef)(!1),{startScroll:s,cancelScroll:l}=(0,d.gk)();return(0,d.Mq)(((e,n)=>{let{scrollY:a}=e;const s=n?.scrollY;s&&(i.current?i.current=!1:a>=s?(l(),o(!1)):a<t?o(!1):a+window.innerHeight<document.documentElement.scrollHeight&&o(!0))})),(0,u.$)((e=>{e.location.hash&&(i.current=!0,o(!1))})),{shown:n,scrollToTop:()=>s(0)}}({threshold:300});return(0,b.jsx)("button",{"aria-label":(0,c.T)({id:"theme.BackToTopButton.buttonAriaLabel",message:"Scroll back to top",description:"The ARIA label for the back to top button"}),className:(0,o.A)("clean-btn",s.G.common.backToTopButton,m.backToTopButton,e&&m.backToTopButtonShow),type:"button",onClick:t})}var p=n(3109),x=n(6347),j=n(4581),f=n(6342),v=n(3465);function _(e){return(0,b.jsx)("svg",{width:"20",height:"20","aria-hidden":"true",...e,children:(0,b.jsxs)("g",{fill:"#7a7a7a",children:[(0,b.jsx)("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"}),(0,b.jsx)("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 A={collapseSidebarButton:"collapseSidebarButton_PEFL",collapseSidebarButtonIcon:"collapseSidebarButtonIcon_kv0_"};function g(e){let{onClick:t}=e;return(0,b.jsx)("button",{type:"button",title:(0,c.T)({id:"theme.docs.sidebar.collapseButtonTitle",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),"aria-label":(0,c.T)({id:"theme.docs.sidebar.collapseButtonAriaLabel",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),className:(0,o.A)("button button--secondary button--outline",A.collapseSidebarButton),onClick:t,children:(0,b.jsx)(_,{className:A.collapseSidebarButtonIcon})})}var k=n(5041),C=n(9532);const S=Symbol("EmptyContext"),T=a.createContext(S);function N(e){let{children:t}=e;const[n,o]=(0,a.useState)(null),i=(0,a.useMemo)((()=>({expandedItem:n,setExpandedItem:o})),[n]);return(0,b.jsx)(T.Provider,{value:i,children:t})}var I=n(1422),B=n(9169),y=n(8774),w=n(2303);function L(e){let{collapsed:t,categoryLabel:n,onClick:a}=e;return(0,b.jsx)("button",{"aria-label":t?(0,c.T)({id:"theme.DocSidebarItem.expandCategoryAriaLabel",message:"Expand sidebar category '{label}'",description:"The ARIA label to expand the sidebar category"},{label:n}):(0,c.T)({id:"theme.DocSidebarItem.collapseCategoryAriaLabel",message:"Collapse sidebar category '{label}'",description:"The ARIA label to collapse the sidebar category"},{label:n}),"aria-expanded":!t,type:"button",className:"clean-btn menu__caret",onClick:a})}function E(e){let{item:t,onItemClick:n,activePath:i,level:r,index:c,...d}=e;const{items:u,label:m,collapsible:h,className:p,href:x}=t,{docs:{sidebar:{autoCollapseCategories:j}}}=(0,f.p)(),v=function(e){const t=(0,w.A)();return(0,a.useMemo)((()=>e.href&&!e.linkUnlisted?e.href:!t&&e.collapsible?(0,l.Nr)(e):void 0),[e,t])}(t),_=(0,l.w8)(t,i),A=(0,B.ys)(x,i),{collapsed:g,setCollapsed:k}=(0,I.u)({initialState:()=>!!h&&(!_&&t.collapsed)}),{expandedItem:N,setExpandedItem:E}=function(){const e=(0,a.useContext)(T);if(e===S)throw new C.dV("DocSidebarItemsExpandedStateProvider");return e}(),M=function(e){void 0===e&&(e=!g),E(e?null:c),k(e)};return function(e){let{isActive:t,collapsed:n,updateCollapsed:o}=e;const i=(0,C.ZC)(t);(0,a.useEffect)((()=>{t&&!i&&n&&o(!1)}),[t,i,n,o])}({isActive:_,collapsed:g,updateCollapsed:M}),(0,a.useEffect)((()=>{h&&null!=N&&N!==c&&j&&k(!0)}),[h,N,c,k,j]),(0,b.jsxs)("li",{className:(0,o.A)(s.G.docs.docSidebarItemCategory,s.G.docs.docSidebarItemCategoryLevel(r),"menu__list-item",{"menu__list-item--collapsed":g},p),children:[(0,b.jsxs)("div",{className:(0,o.A)("menu__list-item-collapsible",{"menu__list-item-collapsible--active":A}),children:[(0,b.jsx)(y.A,{className:(0,o.A)("menu__link",{"menu__link--sublist":h,"menu__link--sublist-caret":!x&&h,"menu__link--active":_}),onClick:h?e=>{n?.(t),x?M(!1):(e.preventDefault(),M())}:()=>{n?.(t)},"aria-current":A?"page":void 0,role:h&&!x?"button":void 0,"aria-expanded":h&&!x?!g:void 0,href:h?v??"#":v,...d,children:m}),x&&h&&(0,b.jsx)(L,{collapsed:g,categoryLabel:m,onClick:e=>{e.preventDefault(),M()}})]}),(0,b.jsx)(I.N,{lazy:!0,as:"ul",className:"menu__list",collapsed:g,children:(0,b.jsx)(U,{items:u,tabIndex:g?-1:0,onItemClick:n,activePath:i,level:r+1})})]})}var M=n(6654),H=n(3186);const G={menuExternalLink:"menuExternalLink_NmtK"};function W(e){let{item:t,onItemClick:n,activePath:a,level:i,index:r,...c}=e;const{href:d,label:u,className:m,autoAddBaseUrl:h}=t,p=(0,l.w8)(t,a),x=(0,M.A)(d);return(0,b.jsx)("li",{className:(0,o.A)(s.G.docs.docSidebarItemLink,s.G.docs.docSidebarItemLinkLevel(i),"menu__list-item",m),children:(0,b.jsxs)(y.A,{className:(0,o.A)("menu__link",!x&&G.menuExternalLink,{"menu__link--active":p}),autoAddBaseUrl:h,"aria-current":p?"page":void 0,to:d,...x&&{onClick:n?()=>n(t):void 0},...c,children:[u,!x&&(0,b.jsx)(H.A,{})]})},u)}const P={menuHtmlItem:"menuHtmlItem_M9Kj"};function R(e){let{item:t,level:n,index:a}=e;const{value:i,defaultStyle:l,className:r}=t;return(0,b.jsx)("li",{className:(0,o.A)(s.G.docs.docSidebarItemLink,s.G.docs.docSidebarItemLinkLevel(n),l&&[P.menuHtmlItem,"menu__list-item"],r),dangerouslySetInnerHTML:{__html:i}},a)}function D(e){let{item:t,...n}=e;switch(t.type){case"category":return(0,b.jsx)(E,{item:t,...n});case"html":return(0,b.jsx)(R,{item:t,...n});default:return(0,b.jsx)(W,{item:t,...n})}}function F(e){let{items:t,...n}=e;const a=(0,l.Y)(t,n.activePath);return(0,b.jsx)(N,{children:a.map(((e,t)=>(0,b.jsx)(D,{item:e,index:t,...n},t)))})}const U=(0,a.memo)(F),V={menu:"menu_SIkG",menuWithAnnouncementBar:"menuWithAnnouncementBar_GW3s"};function Y(e){let{path:t,sidebar:n,className:i}=e;const l=function(){const{isActive:e}=(0,k.Mj)(),[t,n]=(0,a.useState)(e);return(0,d.Mq)((t=>{let{scrollY:a}=t;e&&n(0===a)}),[e]),e&&t}();return(0,b.jsx)("nav",{"aria-label":(0,c.T)({id:"theme.docs.sidebar.navAriaLabel",message:"Docs sidebar",description:"The ARIA label for the sidebar navigation"}),className:(0,o.A)("menu thin-scrollbar",V.menu,l&&V.menuWithAnnouncementBar,i),children:(0,b.jsx)("ul",{className:(0,o.A)(s.G.docs.docSidebarMenu,"menu__list"),children:(0,b.jsx)(U,{items:n,activePath:t,level:1})})})}const K="sidebar_njMd",z="sidebarWithHideableNavbar_wUlq",q="sidebarHidden_VK0M",O="sidebarLogo_isFc";function J(e){let{path:t,sidebar:n,onCollapse:a,isHidden:i}=e;const{navbar:{hideOnScroll:s},docs:{sidebar:{hideable:l}}}=(0,f.p)();return(0,b.jsxs)("div",{className:(0,o.A)(K,s&&z,i&&q),children:[s&&(0,b.jsx)(v.A,{tabIndex:-1,className:O}),(0,b.jsx)(Y,{path:t,sidebar:n}),l&&(0,b.jsx)(g,{onClick:a})]})}const Q=a.memo(J);var X=n(5600),Z=n(2069);const $=e=>{let{sidebar:t,path:n}=e;const a=(0,Z.M)();return(0,b.jsx)("ul",{className:(0,o.A)(s.G.docs.docSidebarMenu,"menu__list"),children:(0,b.jsx)(U,{items:t,activePath:n,onItemClick:e=>{"category"===e.type&&e.href&&a.toggle(),"link"===e.type&&a.toggle()},level:1})})};function ee(e){return(0,b.jsx)(X.GX,{component:$,props:e})}const te=a.memo(ee);function ne(e){const t=(0,j.l)(),n="desktop"===t||"ssr"===t,a="mobile"===t;return(0,b.jsxs)(b.Fragment,{children:[n&&(0,b.jsx)(Q,{...e}),a&&(0,b.jsx)(te,{...e})]})}const ae={expandButton:"expandButton_TmdG",expandButtonIcon:"expandButtonIcon_i1dp"};function oe(e){let{toggleSidebar:t}=e;return(0,b.jsx)("div",{className:ae.expandButton,title:(0,c.T)({id:"theme.docs.sidebar.expandButtonTitle",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),"aria-label":(0,c.T)({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,children:(0,b.jsx)(_,{className:ae.expandButtonIcon})})}const ie={docSidebarContainer:"docSidebarContainer_YfHR",docSidebarContainerHidden:"docSidebarContainerHidden_DPk8",sidebarViewport:"sidebarViewport_aRkj"};function se(e){let{children:t}=e;const n=(0,r.t)();return(0,b.jsx)(a.Fragment,{children:t},n?.name??"noSidebar")}function le(e){let{sidebar:t,hiddenSidebarContainer:n,setHiddenSidebarContainer:i}=e;const{pathname:l}=(0,x.zy)(),[r,c]=(0,a.useState)(!1),d=(0,a.useCallback)((()=>{r&&c(!1),!r&&(0,p.O)()&&c(!0),i((e=>!e))}),[i,r]);return(0,b.jsx)("aside",{className:(0,o.A)(s.G.docs.docSidebarContainer,ie.docSidebarContainer,n&&ie.docSidebarContainerHidden),onTransitionEnd:e=>{e.currentTarget.classList.contains(ie.docSidebarContainer)&&n&&c(!0)},children:(0,b.jsx)(se,{children:(0,b.jsxs)("div",{className:(0,o.A)(ie.sidebarViewport,r&&ie.sidebarViewportHidden),children:[(0,b.jsx)(ne,{sidebar:t,path:l,onCollapse:d,isHidden:r}),r&&(0,b.jsx)(oe,{toggleSidebar:d})]})})})}const re={docMainContainer:"docMainContainer_TBSr",docMainContainerEnhanced:"docMainContainerEnhanced_lQrH",docItemWrapperEnhanced:"docItemWrapperEnhanced_JWYK"};function ce(e){let{hiddenSidebarContainer:t,children:n}=e;const a=(0,r.t)();return(0,b.jsx)("main",{className:(0,o.A)(re.docMainContainer,(t||!a)&&re.docMainContainerEnhanced),children:(0,b.jsx)("div",{className:(0,o.A)("container padding-top--md padding-bottom--lg",re.docItemWrapper,t&&re.docItemWrapperEnhanced),children:n})})}const de={docRoot:"docRoot_UBD9",docsWrapper:"docsWrapper_hBAB"};function ue(e){let{children:t}=e;const n=(0,r.t)(),[o,i]=(0,a.useState)(!1);return(0,b.jsxs)("div",{className:de.docsWrapper,children:[(0,b.jsx)(h,{}),(0,b.jsxs)("div",{className:de.docRoot,children:[n&&(0,b.jsx)(le,{sidebar:n.items,hiddenSidebarContainer:o,setHiddenSidebarContainer:i}),(0,b.jsx)(ce,{hiddenSidebarContainer:o,children:t})]})]})}var me=n(3363);function be(e){const t=(0,l.B5)(e);if(!t)return(0,b.jsx)(me.A,{});const{docElement:n,sidebarName:a,sidebarItems:c}=t;return(0,b.jsx)(i.e3,{className:(0,o.A)(s.G.page.docsDocPage),children:(0,b.jsx)(r.V,{name:a,items:c,children:(0,b.jsx)(ue,{children:n})})})}},3363:(e,t,n)=>{n.d(t,{A:()=>l});n(6540);var a=n(8215),o=n(1312),i=n(1107),s=n(4848);function l(e){let{className:t}=e;return(0,s.jsx)("main",{className:(0,a.A)("container margin-vert--xl",t),children:(0,s.jsx)("div",{className:"row",children:(0,s.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,s.jsx)(i.A,{as:"h1",className:"hero__title",children:(0,s.jsx)(o.A,{id:"theme.NotFound.title",description:"The title of the 404 page",children:"Page Not Found"})}),(0,s.jsx)("p",{children:(0,s.jsx)(o.A,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page",children:"We could not find what you were looking for."})}),(0,s.jsx)("p",{children:(0,s.jsx)(o.A,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page",children:"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/assets/js/aba21aa0.eb7bf6f2.js b/assets/js/aba21aa0.eb7bf6f2.js new file mode 100644 index 0000000..8df4479 --- /dev/null +++ b/assets/js/aba21aa0.eb7bf6f2.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[742],{7093:s=>{s.exports=JSON.parse('{"name":"docusaurus-plugin-content-docs","id":"default"}')}}]); \ No newline at end of file diff --git a/assets/js/ac3a7c63.4d1744c5.js b/assets/js/ac3a7c63.4d1744c5.js new file mode 100644 index 0000000..7ec1185 --- /dev/null +++ b/assets/js/ac3a7c63.4d1744c5.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[756],{5329:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>c,contentTitle:()=>r,default:()=>h,frontMatter:()=>s,metadata:()=>a,toc:()=>d});var t=i(4848),o=i(8453);const s={title:"Extensions"},r=void 0,a={id:"api/extensions",title:"Extensions",description:"When you start your application, Botrino automatically loads all the classes present in bot modules. According to the",source:"@site/docs/api/extensions.mdx",sourceDirName:"api",slug:"/api/extensions",permalink:"/docs/api/extensions",draft:!1,unlisted:!1,editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/api/extensions.mdx",tags:[],version:"current",frontMatter:{title:"Extensions"},sidebar:"someSidebar",previous:{title:"Customizing the Discord client",permalink:"/docs/api/customizing-the-discord-client"},next:{title:"Internationalization",permalink:"/docs/api/i18n"}},c={},d=[{value:"Declaring an extension",id:"declaring-an-extension",level:2},{value:"Implementing an extension",id:"implementing-an-extension",level:2},{value:"<code>void onClassDiscovered(Class<?> clazz)</code>",id:"void-onclassdiscoveredclass-clazz",level:3},{value:"<code>void onServiceCreated(Object o)</code>",id:"void-onservicecreatedobject-o",level:3},{value:"<code>Set<ServiceDescriptor> provideExtraServices()</code>",id:"setservicedescriptor-provideextraservices",level:3},{value:"<code>Set<Class<?>> provideExtraDiscoverableClasses()</code>",id:"setclass-provideextradiscoverableclasses",level:3},{value:"<code>Mono<Void> finishAndJoin()</code>",id:"monovoid-finishandjoin",level:3},{value:"A concrete example: the interaction library",id:"a-concrete-example-the-interaction-library",level:2}];function l(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.p,{children:"When you start your application, Botrino automatically loads all the classes present in bot modules. According to the\ntype of classes that are discovered, an action will be performed on them such as registering a service or adding a\nconfiguration entry. Extensions allow you to hook into this module scanning process to add your own logic when classes\nare loaded."}),"\n",(0,t.jsx)(n.h2,{id:"declaring-an-extension",children:"Declaring an extension"}),"\n",(0,t.jsxs)(n.p,{children:["Unlike other components of the framework, extensions do not need to reside in a module annotated with ",(0,t.jsx)(n.code,{children:"@BotModule"}),".\nThink of extensions like plugins for the framework itself and not for your bot application directly. Your module does\nnot need to be ",(0,t.jsx)(n.code,{children:"open"})," either, extensions are loaded\nvia ",(0,t.jsx)(n.a,{href:"https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/ServiceLoader.html",children:(0,t.jsx)(n.code,{children:"java.util.ServiceLoader"})}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["The first step is to create a class implementing the ",(0,t.jsx)(n.code,{children:"BotrinoExtension"})," interface:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-java",children:"package com.example.myproject;\n\nimport botrino.api.extension.BotrinoExtension;\nimport com.github.alex1304.rdi.config.ServiceDescriptor;\nimport reactor.core.publisher.Mono;\n\nimport java.util.Set;\n\npublic final class MyExtension implements BotrinoExtension {\n\n @Override\n public void onClassDiscovered(Class<?> clazz) {\n // ...\n }\n\n @Override\n public void onServiceCreated(Object o) {\n // ...\n }\n\n @Override\n public Set<ServiceDescriptor> provideExtraServices() {\n // ...\n }\n\n @Override\n public Set<Class<?>> provideExtraDiscoverableClasses() {\n // ...\n }\n\n @Override\n public Mono<Void> finishAndJoin() {\n // ...\n }\n}\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Before going into the details of the methods to implement, let's register this class as a provider\nfor ",(0,t.jsx)(n.code,{children:"BotrinoExtension"}),". This is done via the ",(0,t.jsx)(n.code,{children:"module-info.java"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-java",children:"import botrino.api.extension.BotrinoExtension;\nimport com.example.extension.MyExtension;\n\nmodule com.example.extension {\n\n requires botrino.api;\n provides BotrinoExtension with MyExtension;\n}\n"})}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["You don't ",(0,t.jsx)(n.em,{children:"have"})," to create a separate module just for your extension. It is totally fine to add the ",(0,t.jsx)(n.code,{children:"provides"})," directive\ndirectly in your ",(0,t.jsx)(n.code,{children:"@BotModule"}),", this example just shows that you are not required to."]})}),"\n",(0,t.jsx)(n.h2,{id:"implementing-an-extension",children:"Implementing an extension"}),"\n",(0,t.jsxs)(n.p,{children:["Let's review each of the methods of ",(0,t.jsx)(n.code,{children:"BotrinoExtension"})," to implement."]}),"\n",(0,t.jsx)(n.h3,{id:"void-onclassdiscoveredclass-clazz",children:(0,t.jsx)(n.code,{children:"void onClassDiscovered(Class<?> clazz)"})}),"\n",(0,t.jsx)(n.p,{children:"This is a callback method invoked each time a class is discovered in a bot module. In most cases, you will check if this\nclass implements a specific interface or is annotated with a specific annotation, and do some processing when it is\nrelevant to do so."}),"\n",(0,t.jsx)(n.admonition,{type:"caution",children:(0,t.jsxs)(n.p,{children:["If you intend to create an instance of the class, it is highly recommended to skip classes annotated with ",(0,t.jsx)(n.code,{children:"@RdiService"}),"\nfrom this method, as they are supposed to be instantiated by the RDI container. That's why\nthe ",(0,t.jsx)(n.code,{children:"onServiceCreated(Object)"})," method exists."]})}),"\n",(0,t.jsx)(n.h3,{id:"void-onservicecreatedobject-o",children:(0,t.jsx)(n.code,{children:"void onServiceCreated(Object o)"})}),"\n",(0,t.jsx)(n.p,{children:"This is a callback method invoked each time a service is created. It allows to execute some action on the service object\nright after it's created."}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["As this method returns ",(0,t.jsx)(n.code,{children:"void"}),", it is not suited for performing reactive tasks. Instead, store the service object in a\nfield and perform this task in ",(0,t.jsx)(n.code,{children:"finishAndJoin()"}),"."]})}),"\n",(0,t.jsx)(n.h3,{id:"setservicedescriptor-provideextraservices",children:(0,t.jsx)(n.code,{children:"Set<ServiceDescriptor> provideExtraServices()"})}),"\n",(0,t.jsxs)(n.p,{children:["Even though the extension may not be inside a bot module, it is still possible to register services that will be exposed\nto the bot application. You can do so via this method, allowing you to provide a set\nof ",(0,t.jsx)(n.a,{href:"https://alex1304.github.io/rdi/docs/service-descriptors",children:"RDI service descriptors"}),". This method is only useful if you\nwant to provide complex services that require writing raw descriptors (for example registering a class from a\nthird-party library as a service with a custom name). For simple services maintained by yourself, you can use RDI\nannotations and make the annotated class discoverable via ",(0,t.jsx)(n.code,{children:"provideExtraDiscoverableClasses()"})," instead of doing it via\nthis method."]}),"\n",(0,t.jsx)(n.h3,{id:"setclass-provideextradiscoverableclasses",children:(0,t.jsx)(n.code,{children:"Set<Class<?>> provideExtraDiscoverableClasses()"})}),"\n",(0,t.jsxs)(n.p,{children:["With this method you can explicitly specify a set of classes that Botrino will pick up just like if they were inside a\nbot module. It is guaranteed that each class contained in the set will eventually be passed to\nthe ",(0,t.jsx)(n.code,{children:"onClassDiscovered(Class)"})," method (unless they have the ",(0,t.jsx)(n.code,{children:"@Exclude"})," annotation). As said earlier, it can be used as\nan alternative way to provide extra services, if the class contained in the set is annotated with RDI annotations. It\ncan also be used to register new configuration entries, or new things you're defining yourself in your own extension!"]}),"\n",(0,t.jsx)(n.h3,{id:"monovoid-finishandjoin",children:(0,t.jsx)(n.code,{children:"Mono<Void> finishAndJoin()"})}),"\n",(0,t.jsxs)(n.p,{children:["This is the last method that is invoked during the startup sequence. It allows you to perform a task, possibly reactive,\nbased on the classes and objects you were able to collect via previous invocations of ",(0,t.jsx)(n.code,{children:"onClassDiscovered(Class)"}),"\nand ",(0,t.jsx)(n.code,{children:"onServiceCreated(Object)"}),'. The "join" part of this method\'s name indicates the fact that the returned reactive\nsequence does not need to be a finite source: you can use it to start processes living during the entire lifetime of the\napplication, for example installing event listeners or starting a web server. The subscription to the returned ',(0,t.jsx)(n.code,{children:"Mono"})," is\nautomatically cancelled once the bot disconnects, allowing the application to shut down properly."]}),"\n",(0,t.jsx)(n.admonition,{type:"warning",children:(0,t.jsxs)(n.p,{children:["If an exception is thrown or an error is emitted via the ",(0,t.jsx)(n.code,{children:"Mono"})," from this method, the exception will propagate to the\nmain thread, which will result in the bot to forcefully disconnect and the application to be terminated."]})}),"\n",(0,t.jsx)(n.h2,{id:"a-concrete-example-the-interaction-library",children:"A concrete example: the interaction library"}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.a,{href:"/docs/interaction-library/overview",children:"interaction library"})," of Botrino provides an implementation\nof ",(0,t.jsx)(n.code,{children:"BotrinoExtension"}),", which is in charge of collecting the classes\nimplementing ",(0,t.jsx)(n.code,{children:"XxxInteractionListener"}),", ",(0,t.jsx)(n.code,{children:"InteractionErrorHandler"}),", ",(0,t.jsx)(n.code,{children:"InteractionEventProcessor"})," and so on, in order to\nregister them in the ",(0,t.jsx)(n.code,{children:"InteractionService"}),". It also exposes a new entry in ",(0,t.jsx)(n.code,{children:"config.json"})," that allows to construct\nthe ",(0,t.jsx)(n.a,{href:"/docs/interaction-library/configuration",children:"configuration"})," object."]}),"\n",(0,t.jsxs)(n.p,{children:["You can check the source code of the extension class of the interaction library on\nGitHub ",(0,t.jsx)(n.a,{href:"https://github.com/Alex1304/botrino/blob/main/interaction/src/main/java/botrino/interaction/InteractionExtension.java",children:"here"}),".\nA few things to note to understand the code:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Classes with the ",(0,t.jsx)(n.code,{children:"@RdiService"})," annotation are ignored, since we want to use the instance created by RDI in\ncase ",(0,t.jsx)(n.code,{children:"XxxInteractionListener"}),", ",(0,t.jsx)(n.code,{children:"InteractionErrorHandler"})," and ",(0,t.jsx)(n.code,{children:"InteractionEventProcessor"})," are declared as services."]}),"\n",(0,t.jsxs)(n.li,{children:["An ",(0,t.jsx)(n.code,{children:"InstanceCache"})," is used so that the same instance can be reused in case a class implements more than one interface."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"InteractionService"})," utilizes RDI annotations, so we provide it via ",(0,t.jsx)(n.code,{children:"provideExtraDiscoverableClasses()"})," and\nnot ",(0,t.jsx)(n.code,{children:"provideExtraServices()"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:["All implementations that were found are finally registered in the ",(0,t.jsx)(n.code,{children:"finishAndJoin()"})," method, which runs the interaction\nservice at the end."]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(l,{...e})}):l(e)}},8453:(e,n,i)=>{i.d(n,{R:()=>r,x:()=>a});var t=i(6540);const o={},s=t.createContext(o);function r(e){const n=t.useContext(s);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),t.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/b81faf1d.5a973bfb.js b/assets/js/b81faf1d.5a973bfb.js new file mode 100644 index 0000000..40df89c --- /dev/null +++ b/assets/js/b81faf1d.5a973bfb.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[386],{7699:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>h,frontMatter:()=>o,metadata:()=>c,toc:()=>s});var t=i(4848),r=i(8453);const o={title:"Configuration"},a=void 0,c={id:"interaction-library/configuration",title:"Configuration",description:"This page will cover the configuration part of the interaction library.",source:"@site/docs/interaction-library/configuration.mdx",sourceDirName:"interaction-library",slug:"/interaction-library/configuration",permalink:"/docs/interaction-library/configuration",draft:!1,unlisted:!1,editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/interaction-library/configuration.mdx",tags:[],version:"current",frontMatter:{title:"Configuration"},sidebar:"someSidebar",previous:{title:"Overview",permalink:"/docs/interaction-library/overview"},next:{title:"Creating commands",permalink:"/docs/interaction-library/creating-commands"}},l={},s=[{value:"Configuring the library for the Botrino framework",id:"configuring-the-library-for-the-botrino-framework",level:2},{value:"Configuring the library manually",id:"configuring-the-library-manually",level:2}];function d(e){const n={admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.p,{children:"This page will cover the configuration part of the interaction library."}),"\n",(0,t.jsx)(n.h2,{id:"configuring-the-library-for-the-botrino-framework",children:"Configuring the library for the Botrino framework"}),"\n",(0,t.jsxs)(n.p,{children:["For the library to work with the Botrino framework, you just need to make sure that your bot\nmodule ",(0,t.jsx)(n.code,{children:"requires botrino.interaction"}),", and that the ",(0,t.jsx)(n.code,{children:"interaction"})," entry is present in your ",(0,t.jsx)(n.code,{children:"config.json"}),". The entry has\nthe following structure:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-json",children:'{\n "interaction": {\n "application_commands_guild_id": null,\n "default_ack_mode": "default",\n "await_component_timeout_seconds": 600\n }\n}\n'})}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Field"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required?"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"application_commands_guild_id"}),(0,t.jsx)(n.td,{children:"long"}),(0,t.jsxs)(n.td,{children:["The ID of the guild in which commands will be deployed. Specifying ",(0,t.jsx)(n.code,{children:"null"})," or completely omitting the field will deploy them globally."]}),(0,t.jsxs)(n.td,{children:["No, default ",(0,t.jsx)(n.code,{children:"null"})]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"default_ack_mode"}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["How interactions should be acknowledged by default. Possible values (case insensitive): ",(0,t.jsxs)("ul",{children:[(0,t.jsxs)("li",{children:[(0,t.jsx)(n.code,{children:"default"}),": equivalent to ",(0,t.jsx)(n.code,{children:"defer"}),"."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)(n.code,{children:"defer"}),": automatically acknowledges all interactions with defer reply or defer edit as appropriate. This is the default behavior."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)(n.code,{children:"defer_ephemeral"}),": similar to ",(0,t.jsx)(n.code,{children:"defer"})," except the EPHEMERAL flag is set, meaning the next reply/edit will only be visible to the user who initiated the interaction."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)(n.code,{children:"none"}),": won't acknowledge any interaction automatically. In that case, you will be in charge of acknowledging interactions manually."]})]})]}),(0,t.jsxs)(n.td,{children:["No, default ",(0,t.jsx)(n.code,{children:"default"})]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"await_component_timeout_seconds"}),(0,t.jsx)(n.td,{children:"integer"}),(0,t.jsxs)(n.td,{children:["The time in seconds after which ",(0,t.jsx)(n.code,{children:"InteractionContext::awaitComponentInteraction"})," automatically times out."]}),(0,t.jsxs)(n.td,{children:["No, default ",(0,t.jsx)(n.code,{children:"600"})]})]})]})]}),"\n",(0,t.jsx)(n.h2,{id:"configuring-the-library-manually",children:"Configuring the library manually"}),"\n",(0,t.jsxs)(n.p,{children:["If you don't use the framework, the configuration is done via the ",(0,t.jsx)(n.code,{children:"InteractionConfig"})," object, which is used to\nconstruct ",(0,t.jsx)(n.code,{children:"InteractionService"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-java",children:'// Use default values\nfinal var config = InteractionConfig.withDefaults();\n// Use custom values\nfinal var config = InteractionConfig.builder()\n .applicationCommandsGuildId(123456L)\n .defaultACKMode("default")\n .awaitComponentTimeoutSeconds(600)\n .build();\n// Login to Discord using the token passed as program argument\nfinal var gateway = DiscordClient.create(args[0]).login().block();\n// Initialize the interaction service\nfinal var interactionService = InteractionService.create(config, gateway);\n'})}),"\n",(0,t.jsxs)(n.p,{children:["The methods available in ",(0,t.jsx)(n.code,{children:"InteractionConfig::builder"})," are the same as the ones in the JSON described previously."]}),"\n",(0,t.jsxs)(n.p,{children:["Once you have the ",(0,t.jsx)(n.code,{children:"InteractionService"})," instance, you can register your commands and subscribe to its ",(0,t.jsx)(n.code,{children:"run()"})," method:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-java",children:"// Register your commands\ninteractionService.registerChatInputCommand(new PingCommand());\n// Listen for interaction events until the bot disconnects\ninteractionService.run().takeUntilOther(gateway.onDisconnect()).block();\n"})}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["None of this is necessary when using the Botrino framework. Creation of ",(0,t.jsx)(n.code,{children:"InteractionConfig"})," and ",(0,t.jsx)(n.code,{children:"InteractionService"}),",\nregistration of commands and execution of the ",(0,t.jsx)(n.code,{children:"run()"})," method are all done automatically."]})})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},8453:(e,n,i)=>{i.d(n,{R:()=>a,x:()=>c});var t=i(6540);const r={},o=t.createContext(r);function a(e){const n=t.useContext(o);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),t.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/b96361c1.805f062a.js b/assets/js/b96361c1.805f062a.js new file mode 100644 index 0000000..3634314 --- /dev/null +++ b/assets/js/b96361c1.805f062a.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[534],{1741:(e,i,n)=>{n.r(i),n.d(i,{assets:()=>a,contentTitle:()=>o,default:()=>h,frontMatter:()=>s,metadata:()=>c,toc:()=>l});var r=n(4848),t=n(8453);const s={title:"Privileges"},o=void 0,c={id:"interaction-library/privileges",title:"Privileges",description:"Another common use case when making commands is to be able to restrict access to some commands that should not be used",source:"@site/docs/interaction-library/privileges.mdx",sourceDirName:"interaction-library",slug:"/interaction-library/privileges",permalink:"/docs/interaction-library/privileges",draft:!1,unlisted:!1,editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/interaction-library/privileges.mdx",tags:[],version:"current",frontMatter:{title:"Privileges"},sidebar:"someSidebar",previous:{title:"Dealing with components",permalink:"/docs/interaction-library/dealing-with-components"},next:{title:"Cooldowns",permalink:"/docs/interaction-library/cooldowns"}},a={},l=[{value:"The <code>Privilege</code> interface",id:"the-privilege-interface",level:2},{value:"Privilege presets",id:"privilege-presets",level:2},{value:"Composing privileges",id:"composing-privileges",level:2}];function d(e){const i={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",...(0,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.p,{children:"Another common use case when making commands is to be able to restrict access to some commands that should not be used\nby everyone. The Privilege API provides a way to conveniently implement these kind of restrictions."}),"\n",(0,r.jsx)(i.admonition,{type:"info",children:(0,r.jsxs)(i.p,{children:[(0,r.jsx)(i.a,{href:"https://discord.com/developers/docs/interactions/application-commands#permissions",children:"The permission system proposed by Discord"}),"\nis currently not yet supported by Discord4J. As such, using this Privilege API is the recommended approach until Discord\nnative permissions are fully supported. There is no plan to deprecate this feature for now."]})}),"\n",(0,r.jsxs)(i.h2,{id:"the-privilege-interface",children:["The ",(0,r.jsx)(i.code,{children:"Privilege"})," interface"]}),"\n",(0,r.jsxs)(i.p,{children:[(0,r.jsx)(i.code,{children:"Privilege"})," is a functional interface that is in charge of checking if access to the command is granted for a specific\ncontext. If granted, the abstract method of the interface returns a ",(0,r.jsx)(i.code,{children:"Mono"})," that completes empty, which signals that the\ncommand can be run normally. If not granted, the returned ",(0,r.jsx)(i.code,{children:"Mono"})," is expected to emit ",(0,r.jsx)(i.code,{children:"PrivilegeException"})," (or a subclass\nof this exception), possibly carrying details on the reason of the failure. In this case, the command execution will be\ncancelled."]}),"\n",(0,r.jsxs)(i.p,{children:["The ",(0,r.jsx)(i.code,{children:"InteractionListener"})," superinterface, which is extended\nby ",(0,r.jsx)(i.code,{children:"ChatInputInteractionListener"}),", ",(0,r.jsx)(i.code,{children:"UserInteractionListener"}),", ",(0,r.jsx)(i.code,{children:"MessageInteractionListener"}),"\nand ",(0,r.jsx)(i.code,{children:"ComponentInteractionListener"}),", provides a ",(0,r.jsx)(i.code,{children:"privilege()"})," method that can be overriden in your command\nimplementations."]}),"\n",(0,r.jsx)(i.p,{children:'An instance of this interface can be provided via a lambda expression. The example below defines a privilege which only\ngrants users whose username starts with "A":'}),"\n",(0,r.jsx)(i.pre,{children:(0,r.jsx)(i.code,{className:"language-java",children:'@Override\npublic Privilege privilege() {\n return ctx -> Mono.justOrEmpty(ctx.event().getMessage().getAuthor())\n .filter(author -> author.getUsername().startsWith("A"))\n .switchIfEmpty(Mono.error(PrivilegeException::new))\n .then();\n}\n'})}),"\n",(0,r.jsx)(i.admonition,{type:"info",children:(0,r.jsxs)(i.p,{children:["Handling ",(0,r.jsx)(i.code,{children:"PrivilegeException"})," (for example to display a user-friendly message) is documented on\nthe ",(0,r.jsx)(i.a,{href:"/docs/interaction-library/handling-errors",children:"Handling Errors"})," page."]})}),"\n",(0,r.jsx)(i.h2,{id:"privilege-presets",children:"Privilege presets"}),"\n",(0,r.jsxs)(i.p,{children:["In most cases, checking if access to a command is granted will simply consist of checking if the user has a particular\nrole or a particular permission in the guild. You can use one of the static methods of the ",(0,r.jsx)(i.code,{children:"Privileges"})," class instead of\nimplementing that yourself:"]}),"\n",(0,r.jsx)(i.pre,{children:(0,r.jsx)(i.code,{className:"language-java",children:"@Override\npublic Privilege privilege() {\n return Privileges.checkPermissions(perms -> perms.contains(ADMINISTRATOR));\n}\n"})}),"\n",(0,r.jsxs)(i.p,{children:["Check out\nthe ",(0,r.jsxs)(i.a,{href:"https://javadoc.io/doc/com.alex1304.botrino/botrino-interaction/latest/botrino.interaction/botrino/interaction/privilege/Privileges.html",children:["Javadoc for the ",(0,r.jsx)(i.code,{children:"Privileges"})," class"]}),"\nfor more presets like this one."]}),"\n",(0,r.jsx)(i.h2,{id:"composing-privileges",children:"Composing privileges"}),"\n",(0,r.jsxs)(i.p,{children:["You can compose several ",(0,r.jsx)(i.code,{children:"Privilege"})," instances by using the ",(0,r.jsx)(i.code,{children:"and()"})," and ",(0,r.jsx)(i.code,{children:"or()"})," methods:"]}),"\n",(0,r.jsx)(i.pre,{children:(0,r.jsx)(i.code,{className:"language-java",children:"@Override\npublic Privilege privilege() {\n return Privileges.checkRoles(roles -> !roles.isEmpty())\n .or(Privileges.guildOwner());\n}\n"})}),"\n",(0,r.jsx)(i.p,{children:'This code means "Grant if the user has at least one role OR if they are the owner of the server".'})]})}function h(e={}){const{wrapper:i}={...(0,t.R)(),...e.components};return i?(0,r.jsx)(i,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},8453:(e,i,n)=>{n.d(i,{R:()=>o,x:()=>c});var r=n(6540);const t={},s=r.createContext(t);function o(e){const i=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(i):{...i,...e}}),[i,e])}function c(e){let i;return i=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),r.createElement(s.Provider,{value:i},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/bb881519.62fda8c4.js b/assets/js/bb881519.62fda8c4.js deleted file mode 100644 index 0863c0e..0000000 --- a/assets/js/bb881519.62fda8c4.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[143],{3905:function(e,t,n){n.d(t,{Zo:function(){return c},kt:function(){return m}});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 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 o(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){r(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,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(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)&&(r[n]=e[n])}return r}var s=a.createContext({}),p=function(e){var t=a.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 a.createElement(s.Provider,{value:t},e.children)},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,r=e.mdxType,i=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),d=p(n),m=r,h=d["".concat(s,".").concat(m)]||d[m]||u[m]||i;return n?a.createElement(h,o(o({ref:t},c),{},{components:n})):a.createElement(h,o({ref:t},c))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,o=new Array(i);o[0]=d;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]=n[p];return a.createElement.apply(null,o)}return a.createElement.apply(null,n)}d.displayName="MDXCreateElement"},9076:function(e,t,n){n.r(t),n.d(t,{frontMatter:function(){return l},metadata:function(){return s},toc:function(){return p},default:function(){return u}});var a=n(7462),r=n(3366),i=(n(7294),n(3905)),o=["components"],l={title:"Internationalization"},s={unversionedId:"api/i18n",id:"api/i18n",isDocsHomePage:!1,title:"Internationalization",description:"The bot you are developing is likely to be used by people which primary language is not English. To support these users, Botrino encourages the externalization of strings so they can be translated more conveniently.",source:"@site/docs/api/i18n.md",sourceDirName:"api",slug:"/api/i18n",permalink:"/docs/api/i18n",editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/api/i18n.md",version:"current",frontMatter:{title:"Internationalization"},sidebar:"someSidebar",previous:{title:"Extensions",permalink:"/docs/api/extensions"},next:{title:"Overview",permalink:"/docs/interaction-library/overview"}},p=[{value:"The <code>Translator</code> interface",id:"the-translator-interface",children:[]},{value:"Externalizing strings",id:"externalizing-strings",children:[]},{value:"Using translated strings",id:"using-translated-strings",children:[]}],c={toc:p};function u(e){var t=e.components,n=(0,r.Z)(e,o);return(0,i.kt)("wrapper",(0,a.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"The bot you are developing is likely to be used by people which primary language is not English. To support these users, Botrino encourages the externalization of strings so they can be translated more conveniently."),(0,i.kt)("h2",{id:"the-translator-interface"},"The ",(0,i.kt)("inlineCode",{parentName:"h2"},"Translator")," interface"),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"Translator")," interface has one abstract method ",(0,i.kt)("inlineCode",{parentName:"p"},"Locale getLocale()")," which defines what is the target locale of the translator, and a default method ",(0,i.kt)("inlineCode",{parentName:"p"},"String translate(String, String, Object...)")," which effectively does the translation. By default, the translate method does the following:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-java"},"default String translate(String bundle, String key, Object... args) {\n return MessageFormat.format(ResourceBundle.getBundle(bundle, getLocale()).getString(key), args);\n}\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Strings are located in a ",(0,i.kt)("inlineCode",{parentName:"li"},"ResourceBundle")," which name is given. Typically, that's the name of a ",(0,i.kt)("inlineCode",{parentName:"li"},".properties")," file located at the root of the resources folder."),(0,i.kt)("li",{parentName:"ul"},"Strings are parameterized using ",(0,i.kt)("inlineCode",{parentName:"li"},"MessageFormat"),", which aims at being a language-independent way to put variables in a string, unlike ",(0,i.kt)("inlineCode",{parentName:"li"},"String.format()"),".")),(0,i.kt)("h2",{id:"externalizing-strings"},"Externalizing strings"),(0,i.kt)("p",null,"If let's say you have a file named ",(0,i.kt)("inlineCode",{parentName:"p"},"AppStrings.properties")," in ",(0,i.kt)("inlineCode",{parentName:"p"},"src/main/resources")," with the following contents:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-properties"},"hello=Hello {0}!\n")),(0,i.kt)("p",null,"You can use a translator like this:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-java"},'var tr = Translator.to(Locale.ENGLISH);\nSystem.out.println(tr.translate("AppStrings", "hello", "Alex"));\n')),(0,i.kt)("p",null,"Which gives the output:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"Hello Alex!\n")),(0,i.kt)("p",null,"What happened here?"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"The first argument of ",(0,i.kt)("inlineCode",{parentName:"li"},"tr.translate")," is ",(0,i.kt)("inlineCode",{parentName:"li"},"AppStrings"),", so it will look for a ",(0,i.kt)("inlineCode",{parentName:"li"},"ResourceBundle")," named ",(0,i.kt)("inlineCode",{parentName:"li"},"AppStrings"),". It will find the ",(0,i.kt)("inlineCode",{parentName:"li"},"AppStrings.properties")," and will load its content."),(0,i.kt)("li",{parentName:"ul"},"The second argument says to find the string with key ",(0,i.kt)("inlineCode",{parentName:"li"},"hello"),", which is what we defined earlier."),(0,i.kt)("li",{parentName:"ul"},"The third argument will substitute the ",(0,i.kt)("inlineCode",{parentName:"li"},"{0}")," of our string with the value at runtime, here ",(0,i.kt)("inlineCode",{parentName:"li"},"Alex"),".")),(0,i.kt)("div",{className:"admonition admonition-info alert alert--info"},(0,i.kt)("div",{parentName:"div",className:"admonition-heading"},(0,i.kt)("h5",{parentName:"div"},(0,i.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,i.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,i.kt)("path",{parentName:"svg",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"}))),"info")),(0,i.kt)("div",{parentName:"div",className:"admonition-content"},(0,i.kt)("p",{parentName:"div"},"To learn more about resource bundles and string argument formatting, check out the Javadoc for ",(0,i.kt)("a",{parentName:"p",href:"https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/ResourceBundle.html"},(0,i.kt)("inlineCode",{parentName:"a"},"ResourceBundle"))," and ",(0,i.kt)("a",{parentName:"p",href:"https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/text/MessageFormat.html"},(0,i.kt)("inlineCode",{parentName:"a"},"MessageFormat")),". Note that since ",(0,i.kt)("inlineCode",{parentName:"p"},"Translator.translate")," is a default interface method and thus can be overriden, you may customize the way translations are retrieved, but this section will only document the default behavior."))),(0,i.kt)("h2",{id:"using-translated-strings"},"Using translated strings"),(0,i.kt)("p",null,"Once a string is properly externalized, it is possible to add a translation for it by duplicating the resource file and naming it with the locale suffix. For example, if you have ",(0,i.kt)("inlineCode",{parentName:"p"},"src/main/resources/AppStrings.properties")," and want to translate it in French, you will duplicate the file and name the copy ",(0,i.kt)("inlineCode",{parentName:"p"},"src/main/resources/AppStrings_fr.properties"),". The way to name the translated files is documented in the ",(0,i.kt)("a",{parentName:"p",href:"https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/ResourceBundle.html"},(0,i.kt)("inlineCode",{parentName:"a"},"ResourceBundle")," javadoc"),"."),(0,i.kt)("p",null,"In your ",(0,i.kt)("inlineCode",{parentName:"p"},"AppStrings_fr.properties"),", you will translate the value of the ",(0,i.kt)("inlineCode",{parentName:"p"},"hello")," string:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-properties"},"hello=Bonjour {0} !\n")),(0,i.kt)("p",null,"In your Java code, you can now specify either English or French locale and the string will adapt automatically:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-java"},'var tr1 = Translator.to(Locale.ENGLISH);\nvar tr2 = Translator.to(Locale.FRENCH);\nSystem.out.println(tr1.translate("AppStrings", "hello", "Alex"));\nSystem.out.println(tr2.translate("AppStrings", "hello", "Alex")); // notice we use exact same arguments\n')),(0,i.kt)("p",null,"Which gives the output you want:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"Hello Alex!\nBonjour Alex !\n")))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/c4f5d8e4.9b641ee3.js b/assets/js/c4f5d8e4.9b641ee3.js deleted file mode 100644 index 8e3acdd..0000000 --- a/assets/js/c4f5d8e4.9b641ee3.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[195],{6252:function(e,t,a){a.r(t),a.d(t,{default:function(){return g}});var n=a(7462),r=a(7294),i=a(6010),o=a(9118),s=a(6742),l=a(2263),c=a(4996),m={heroBanner:"heroBanner_3P7f",buttons:"buttons_1r9m",features:"features_3azU",featureImage:"featureImage_ZtzX"},u=[{title:"Focused on modularity",imageUrl:"img/undraw_building_blocks_n0nc.svg",description:r.createElement(r.Fragment,null,"Botrino is a JDK 11+ framework utilizing Java modules to organize and encapsulate the components of the bot application.")},{title:"Powered by Discord4J",imageUrl:"img/d4j.svg",description:r.createElement(r.Fragment,null,r.createElement(s.Z,{href:"https://discord4j.com"},"Discord4J")," is a modern Discord API wrapper for the JVM, natively supporting the reactive programming paradigm for the best performances at scale.")},{title:"Easy setup and integration",imageUrl:"img/undraw_Setup_re_y9w8.svg",description:r.createElement(r.Fragment,null,"Botrino comes with a Maven archetype allowing you to get started with a fully working bot in just a few minutes, and automatically configures a runtime package using JLink.")},{title:"Keep your code clean",imageUrl:"img/undraw_proud_coder_7ain.svg",description:r.createElement(r.Fragment,null,"The power of the framework resides in its ability to discover and auto-load classes defined in your modules. Focus on what matters: write one class for your command or your service, Botrino does the boring stuff for you.")},{title:"Extensible",imageUrl:"img/undraw_add_file_4gfw.svg",description:r.createElement(r.Fragment,null,"You can extend the possibilities of Botrino by implementing your own extensions, by expressing what to do when a class is discovered in your module.")},{title:"Translation ready",imageUrl:"img/undraw_Around_the_world_re_n353.svg",description:r.createElement(r.Fragment,null,"Want your bot to be available in multiple languages? Botrino supports i18n out of the box, the framework incentivizes the externalization of strings so they can be translated using services such as ",r.createElement(s.Z,{to:"https://crowdin.com/",target:"_blank"},"Crowdin"),".")}];function d(e){var t=e.imageUrl,a=e.title,n=e.description,o=(0,c.Z)(t);return r.createElement("div",{className:(0,i.Z)("col col--4",m.feature)},o&&r.createElement("div",{className:"text--center"},r.createElement("img",{className:m.featureImage,src:o,alt:a})),r.createElement("h3",null,a),r.createElement("p",null,n))}var g=function(){var e=(0,l.Z)().siteConfig,t=void 0===e?{}:e;return r.createElement(o.Z,{title:"Homepage",description:t.tagline},r.createElement("header",{className:(0,i.Z)("hero hero--primary",m.heroBanner)},r.createElement("div",{className:"container"},r.createElement("img",{src:(0,c.Z)("img/logo.svg"),alt:"logo",width:"150"}),r.createElement("h1",{className:"hero__title"},t.title),r.createElement("p",{className:"hero__subtitle"},t.tagline),r.createElement("div",{className:m.buttons},r.createElement(s.Z,{className:(0,i.Z)("button button--secondary button--lg",m.getStarted),to:(0,c.Z)("docs/")},"Get Started")))),r.createElement("main",null,u&&u.length>0&&r.createElement("section",{className:m.features},r.createElement("div",{className:"container"},r.createElement("div",{className:"row"},u.map((function(e,t){return r.createElement(d,(0,n.Z)({key:t},e))})))))))}}}]); \ No newline at end of file diff --git a/assets/js/c4f5d8e4.f045fc1b.js b/assets/js/c4f5d8e4.f045fc1b.js new file mode 100644 index 0000000..fa29647 --- /dev/null +++ b/assets/js/c4f5d8e4.f045fc1b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[634],{4267:(e,t,r)=>{r.r(t),r.d(t,{default:()=>m});r(6540);function i(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=i(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}const n=function(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=i(e))&&(n&&(n+=" "),n+=t);return n};var s=r(781),o=r(8774),a=r(4586),l=r(6025);const c={heroBanner:"heroBanner_UJJx",buttons:"buttons_pzbO",features:"features_keug",featureImage:"featureImage_yA8i"};var d=r(4848);const u=[{title:"Focused on modularity",imageUrl:"img/undraw_building_blocks_n0nc.svg",description:(0,d.jsx)(d.Fragment,{children:"Botrino is a modern JDK 17+ framework utilizing Java modules to organize and encapsulate the components of the bot application."})},{title:"Powered by Discord4J",imageUrl:"img/d4j.svg",description:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(o.A,{href:"https://discord4j.com",children:"Discord4J"})," is a modern Discord API wrapper for the JVM, natively supporting the reactive programming paradigm for the best performances at scale."]})},{title:"Easy setup and integration",imageUrl:"img/undraw_Setup_re_y9w8.svg",description:(0,d.jsx)(d.Fragment,{children:"Botrino comes with a Maven archetype allowing you to get started with a fully working bot in just a few minutes, and automatically configures a runtime package using JLink."})},{title:"Keep your code clean",imageUrl:"img/undraw_proud_coder_7ain.svg",description:(0,d.jsx)(d.Fragment,{children:"The power of the framework resides in its ability to discover and auto-load classes defined in your modules. Focus on what matters: write one class for your command or your service, Botrino does the boring stuff for you."})},{title:"Extensible",imageUrl:"img/undraw_add_file_4gfw.svg",description:(0,d.jsx)(d.Fragment,{children:"You can extend the possibilities of Botrino by implementing your own extensions, by expressing what to do when a class is discovered in your module."})},{title:"Translation ready",imageUrl:"img/undraw_Around_the_world_re_n353.svg",description:(0,d.jsxs)(d.Fragment,{children:["Want your bot to be available in multiple languages? Botrino supports i18n out of the box, the framework incentivizes the externalization of strings so they can be translated using services such as ",(0,d.jsx)(o.A,{to:"https://crowdin.com/",target:"_blank",children:"Crowdin"}),"."]})}];function g(e){let{imageUrl:t,title:r,description:i}=e;const s=(0,l.A)(t);return(0,d.jsxs)("div",{className:n("col col--4",c.feature),children:[s&&(0,d.jsx)("div",{className:"text--center",children:(0,d.jsx)("img",{className:c.featureImage,src:s,alt:r})}),(0,d.jsx)("h3",{children:r}),(0,d.jsx)("p",{children:i})]})}const m=function(){const e=(0,a.A)(),{siteConfig:t={}}=e;return(0,d.jsxs)(s.A,{title:"Homepage",description:t.tagline,children:[(0,d.jsx)("header",{className:n("hero hero--primary",c.heroBanner),children:(0,d.jsxs)("div",{className:"container",children:[(0,d.jsx)("img",{src:(0,l.A)("img/logo.svg"),alt:"logo",width:"150"}),(0,d.jsx)("h1",{className:"hero__title",children:t.title}),(0,d.jsx)("p",{className:"hero__subtitle",children:t.tagline}),(0,d.jsx)("div",{className:c.buttons,children:(0,d.jsx)(o.A,{className:n("button button--secondary button--lg",c.getStarted),to:(0,l.A)("docs/"),children:"Get Started"})})]})}),(0,d.jsx)("main",{children:u&&u.length>0&&(0,d.jsx)("section",{className:c.features,children:(0,d.jsx)("div",{className:"container",children:(0,d.jsx)("div",{className:"row",children:u.map(((e,t)=>(0,d.jsx)(g,{...e},t)))})})})})]})}}}]); \ No newline at end of file diff --git a/assets/js/d589d3a7.0af9b57e.js b/assets/js/d589d3a7.0af9b57e.js deleted file mode 100644 index 22e2ea3..0000000 --- a/assets/js/d589d3a7.0af9b57e.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[162],{3905:function(e,t,n){n.d(t,{Zo:function(){return c},kt:function(){return m}});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 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){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 l(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 p=a.createContext({}),d=function(e){var t=a.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 a.createElement(p.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},s=a.forwardRef((function(e,t){var n=e.components,i=e.mdxType,r=e.originalType,p=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),s=d(n),m=i,h=s["".concat(p,".").concat(m)]||s[m]||u[m]||r;return n?a.createElement(h,o(o({ref:t},c),{},{components:n})):a.createElement(h,o({ref:t},c))}));function m(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var r=n.length,o=new Array(r);o[0]=s;var l={};for(var p in t)hasOwnProperty.call(t,p)&&(l[p]=t[p]);l.originalType=e,l.mdxType="string"==typeof e?e:i,o[1]=l;for(var d=2;d<r;d++)o[d]=n[d];return a.createElement.apply(null,o)}return a.createElement.apply(null,n)}s.displayName="MDXCreateElement"},3919:function(e,t,n){function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}n.d(t,{b:function(){return a},Z:function(){return i}})},4996:function(e,t,n){n.d(t,{C:function(){return r},Z:function(){return o}});var a=n(2263),i=n(3919);function r(){var e=(0,a.Z)().siteConfig,t=(e=void 0===e?{}:e).baseUrl,n=void 0===t?"/":t,r=e.url;return{withBaseUrl:function(e,t){return function(e,t,n,a){var r=void 0===a?{}:a,o=r.forcePrependBaseUrl,l=void 0!==o&&o,p=r.absolute,d=void 0!==p&&p;if(!n)return n;if(n.startsWith("#"))return n;if((0,i.b)(n))return n;if(l)return t+n;var c=n.startsWith(t)?n:t+n.replace(/^\//,"");return d?e+c:c}(r,n,e,t)}}}function o(e,t){return void 0===t&&(t={}),(0,r().withBaseUrl)(e,t)}},8215:function(e,t,n){var a=n(7294);t.Z=function(e){var t=e.children,n=e.hidden,i=e.className;return a.createElement("div",{role:"tabpanel",hidden:n,className:i},t)}},1395:function(e,t,n){n.d(t,{Z:function(){return c}});var a=n(7294),i=n(944),r=n(6010),o="tabItem_1uMI",l="tabItemActive_2DSg";var p=37,d=39;var c=function(e){var t=e.lazy,n=e.block,c=e.defaultValue,u=e.values,s=e.groupId,m=e.className,h=(0,i.Z)(),k=h.tabGroupChoices,f=h.setTabGroupChoices,v=(0,a.useState)(c),g=v[0],y=v[1],N=a.Children.toArray(e.children),b=[];if(null!=s){var w=k[s];null!=w&&w!==g&&u.some((function(e){return e.value===w}))&&y(w)}var C=function(e){var t=e.currentTarget,n=b.indexOf(t),a=u[n].value;y(a),null!=s&&(f(s,a),setTimeout((function(){var e,n,a,i,r,o,p,d;(e=t.getBoundingClientRect(),n=e.top,a=e.left,i=e.bottom,r=e.right,o=window,p=o.innerHeight,d=o.innerWidth,n>=0&&r<=d&&i<=p&&a>=0)||(t.scrollIntoView({block:"center",behavior:"smooth"}),t.classList.add(l),setTimeout((function(){return t.classList.remove(l)}),2e3))}),150))},j=function(e){var t,n;switch(e.keyCode){case d:var a=b.indexOf(e.target)+1;n=b[a]||b[0];break;case p:var i=b.indexOf(e.target)-1;n=b[i]||b[b.length-1]}null==(t=n)||t.focus()};return a.createElement("div",{className:"tabs-container"},a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":n},m)},u.map((function(e){var t=e.value,n=e.label;return a.createElement("li",{role:"tab",tabIndex:g===t?0:-1,"aria-selected":g===t,className:(0,r.Z)("tabs__item",o,{"tabs__item--active":g===t}),key:t,ref:function(e){return b.push(e)},onKeyDown:j,onFocus:C,onClick:C},n)}))),t?(0,a.cloneElement)(N.filter((function(e){return e.props.value===g}))[0],{className:"margin-vert--md"}):a.createElement("div",{className:"margin-vert--md"},N.map((function(e,t){return(0,a.cloneElement)(e,{key:t,hidden:e.props.value!==g})}))))}},9443:function(e,t,n){var a=(0,n(7294).createContext)(void 0);t.Z=a},944:function(e,t,n){var a=n(7294),i=n(9443);t.Z=function(){var e=(0,a.useContext)(i.Z);if(null==e)throw new Error("`useUserPreferencesContext` is used outside of `Layout` Component.");return e}},601:function(e,t,n){n.r(t),n.d(t,{frontMatter:function(){return c},metadata:function(){return u},toc:function(){return s},default:function(){return h}});var a=n(7462),i=n(3366),r=(n(7294),n(3905)),o=n(4996),l=n(1395),p=n(8215),d=["components"],c={title:"Getting Started"},u={unversionedId:"getting-started",id:"getting-started",isDocsHomePage:!1,title:"Getting Started",description:"Prerequisites",source:"@site/docs/getting-started.md",sourceDirName:".",slug:"/getting-started",permalink:"/docs/getting-started",editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/getting-started.md",version:"current",frontMatter:{title:"Getting Started"},sidebar:"someSidebar",previous:{title:"Introduction",permalink:"/docs/"},next:{title:"Working with services",permalink:"/docs/api/working-with-services"}},s=[{value:"Prerequisites",id:"prerequisites",children:[]},{value:"From the Maven archetype",id:"from-the-maven-archetype",children:[]},{value:"From a blank project",id:"from-a-blank-project",children:[]},{value:"Running your bot",id:"running-your-bot",children:[{value:"During development",id:"during-development",children:[]},{value:"In a production environment",id:"in-a-production-environment",children:[]},{value:"Adding system modules to the JLink runtime image",id:"adding-system-modules-to-the-jlink-runtime-image",children:[]}]}],m={toc:s};function h(e){var t=e.components,n=(0,i.Z)(e,d);return(0,r.kt)("wrapper",(0,a.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h2",{id:"prerequisites"},"Prerequisites"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"JDK 11 or above. You can download the OpenJDK ",(0,r.kt)("a",{parentName:"li",href:"https://adoptopenjdk.net/?variant=openjdk11&jvmVariant=hotspot"},"here")),(0,r.kt)("li",{parentName:"ul"},"Apache Maven 3, preferably the latest version available ",(0,r.kt)("a",{parentName:"li",href:"https://maven.apache.org/download.cgi"},"here"),".")),(0,r.kt)("p",null,"This documentation assumes you have decent knowledge of the Java programming language. Being familiar with Discord4J and reactive programming is not required, although recommended. The ",(0,r.kt)("a",{parentName:"p",href:"https://wiki.discord4j.com"},"Discord4J documentation")," provides great guides to get started with ",(0,r.kt)("a",{parentName:"p",href:"https://wiki.discord4j.com/en/latest/Reactive-(Reactor)-Tutorial/"},"reactive programming")," and ",(0,r.kt)("a",{parentName:"p",href:"https://wiki.discord4j.com/en/latest/Lambda-Tutorial/"},"advanced Java features"),"."),(0,r.kt)("h2",{id:"from-the-maven-archetype"},"From the Maven archetype"),(0,r.kt)("p",null,"The recommended way to start a project with Botrino is to use the Maven archetype (replace ",(0,r.kt)("inlineCode",{parentName:"p"},"[VERSION]")," with the latest version available): ",(0,r.kt)("a",{parentName:"p",href:"https://search.maven.org/artifact/com.alex1304.botrino/botrino-api"},(0,r.kt)("img",{parentName:"a",src:"https://img.shields.io/maven-central/v/com.alex1304.botrino/botrino-api",alt:"Maven Central"}))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre"},"mvn archetype:generate -DarchetypeGroupId=com.alex1304.botrino -DarchetypeArtifactId=botrino-archetype -DarchetypeVersion=[VERSION]\n")),(0,r.kt)("p",null,"You will be asked to enter the ",(0,r.kt)("inlineCode",{parentName:"p"},"groupId"),", the ",(0,r.kt)("inlineCode",{parentName:"p"},"artifactId"),", the ",(0,r.kt)("inlineCode",{parentName:"p"},"version")," and the ",(0,r.kt)("inlineCode",{parentName:"p"},"package")," of your project. If successful, it should generate a project with the following contents:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre"},"myproject\n\u251c\u2500\u2500 app\n\u2502\xa0\xa0 \u251c\u2500\u2500 pom.xml\n\u2502\xa0\xa0 \u2514\u2500\u2500 src\n\u2502\xa0\xa0 \u2514\u2500\u2500 main\n\u2502\xa0\xa0 \u251c\u2500\u2500 external-resources\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u251c\u2500\u2500 config.json\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u251c\u2500\u2500 launcher.cmd\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u2514\u2500\u2500 logback.xml\n\u2502\xa0\xa0 \u251c\u2500\u2500 java\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u251c\u2500\u2500 com\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u2502\xa0\xa0 \u2514\u2500\u2500 example\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u2502\xa0\xa0 \u2514\u2500\u2500 myproject\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u2502\xa0\xa0 \u251c\u2500\u2500 Main.java\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u2502\xa0\xa0 \u251c\u2500\u2500 PingCommand.java\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u2502\xa0\xa0 \u251c\u2500\u2500 SampleService.java\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u2502\xa0\xa0 \u2514\u2500\u2500 Strings.java\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u2514\u2500\u2500 module-info.java\n\u2502\xa0\xa0 \u2514\u2500\u2500 resources\n\u2502\xa0\xa0 \u2514\u2500\u2500 AppStrings.properties\n\u251c\u2500\u2500 delivery\n\u2502\xa0\xa0 \u2514\u2500\u2500 pom.xml\n\u251c\u2500\u2500 launcher\n\u2502\xa0\xa0 \u251c\u2500\u2500 pom.xml\n\u2502\xa0\xa0 \u2514\u2500\u2500 src\n\u2502\xa0\xa0 \u2514\u2500\u2500 main\n\u2502\xa0\xa0 \u2514\u2500\u2500 java\n\u2502\xa0\xa0 \u251c\u2500\u2500 com\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u2514\u2500\u2500 example\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u2514\u2500\u2500 myproject\n\u2502\xa0\xa0 \u2502\xa0\xa0 \u2514\u2500\u2500 Launcher.java\n\u2502\xa0\xa0 \u2514\u2500\u2500 module-info.java\n\u2514\u2500\u2500 pom.xml\n")),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"app/")," directory corresponds to the main module of your bot application. It already contains pre-generated classes with a main method, an example command and an example service. It also shows how to externalize strings via a ",(0,r.kt)("inlineCode",{parentName:"li"},".properties")," files in the root of ",(0,r.kt)("inlineCode",{parentName:"li"},"src/main/resources"),", and a class ",(0,r.kt)("inlineCode",{parentName:"li"},"Strings")," containing constants to reference them. The ",(0,r.kt)("inlineCode",{parentName:"li"},"src/main/external-resources")," directory contains the configuration files necessary to run the bot."),(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"delivery/")," directory only contains a ",(0,r.kt)("inlineCode",{parentName:"li"},"pom.xml")," that is capable of generating a runtime image of the bot application using the ",(0,r.kt)("inlineCode",{parentName:"li"},"jlink")," utility, bundled with the JDK 11."),(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"launcher")," directory contains the module used by ",(0,r.kt)("inlineCode",{parentName:"li"},"delivery")," to create a basic launcher for the runtime image."),(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"pom.xml")," which configures the project by importing the libraries and configuring the multi-module build.")),(0,r.kt)("div",{className:"admonition admonition-info alert alert--info"},(0,r.kt)("div",{parentName:"div",className:"admonition-heading"},(0,r.kt)("h5",{parentName:"div"},(0,r.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,r.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,r.kt)("path",{parentName:"svg",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"}))),"info")),(0,r.kt)("div",{parentName:"div",className:"admonition-content"},(0,r.kt)("p",{parentName:"div"},"The archetype will automatically include the ",(0,r.kt)("a",{parentName:"p",href:"/docs/interaction-library/overview"},"interaction library")," in your project dependencies."))),(0,r.kt)("p",null,"This project is ready to be opened in your favorite IDE (Eclipse, IntelliJ...), and you can directly jump to the ",(0,r.kt)("a",{parentName:"p",href:"#running-your-bot"},"Running your bot")," section."),(0,r.kt)("h2",{id:"from-a-blank-project"},"From a blank project"),(0,r.kt)("p",null,"If you don't want the JLink runtime image, or if you want to use a build tool other than Maven, you may as well start from a blank project and import Botrino yourself. Be aware that it will require a bit more effort to set up than using the archetype."),(0,r.kt)("p",null,"Import the following dependency:"),(0,r.kt)(l.Z,{groupId:"build-tools",defaultValue:"maven",values:[{label:"Maven",value:"maven"},{label:"Gradle",value:"gradle"}],mdxType:"Tabs"},(0,r.kt)(p.Z,{value:"maven",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-xml"},"<dependency>\n <groupId>com.alex1304.botrino</groupId>\n <artifactId>botrino-api</artifactId>\n <version>[VERSION]</version>\n</dependency>\n"))),(0,r.kt)(p.Z,{value:"gradle",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-groovy"},"repositories {\n mavenCentral()\n}\n\ndependencies {\n implementation 'com.alex1304.botrino:botrino-api:[VERSION]'\n}\n")))),(0,r.kt)("p",null,"As usual, replace ",(0,r.kt)("inlineCode",{parentName:"p"},"[VERSION]")," with the latest version available: ",(0,r.kt)("a",{parentName:"p",href:"https://search.maven.org/artifact/com.alex1304.botrino/botrino-api"},(0,r.kt)("img",{parentName:"a",src:"https://img.shields.io/maven-central/v/com.alex1304.botrino/botrino-api",alt:"Maven Central"}))),(0,r.kt)("p",null,"Create a ",(0,r.kt)("inlineCode",{parentName:"p"},"module-info.java")," annotated with ",(0,r.kt)("inlineCode",{parentName:"p"},"@BotModule"),", with the ",(0,r.kt)("inlineCode",{parentName:"p"},"open")," modifier and that requires the ",(0,r.kt)("inlineCode",{parentName:"p"},"botrino.api")," module:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-java"},"import botrino.api.annotation.BotModule;\n\n@BotModule\nopen module com.example.myproject {\n\n requires botrino.api;\n}\n")),(0,r.kt)("p",null,"The module transitively requires all libraries necessary to work, including Discord4J, Reactor, Netty, RDI and Jackson, so you don't need to put ",(0,r.kt)("inlineCode",{parentName:"p"},"requires")," for those libraries."),(0,r.kt)("div",{className:"admonition admonition-caution alert alert--warning"},(0,r.kt)("div",{parentName:"div",className:"admonition-heading"},(0,r.kt)("h5",{parentName:"div"},(0,r.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,r.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},(0,r.kt)("path",{parentName:"svg",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"}))),"caution")),(0,r.kt)("div",{parentName:"div",className:"admonition-content"},(0,r.kt)("p",{parentName:"div"},"If you get compilation errors, remember to configure your project to use JDK 11 or above."))),(0,r.kt)("p",null,"Finally, add a class with a ",(0,r.kt)("inlineCode",{parentName:"p"},"main")," method:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-java"},"package com.example.myproject;\n\nimport botrino.api.Botrino;\n\npublic final class Main {\n\n public static void main(String[] args) {\n Botrino.run(args);\n }\n}\n")),(0,r.kt)("div",{className:"admonition admonition-info alert alert--info"},(0,r.kt)("div",{parentName:"div",className:"admonition-heading"},(0,r.kt)("h5",{parentName:"div"},(0,r.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,r.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,r.kt)("path",{parentName:"svg",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"}))),"info")),(0,r.kt)("div",{parentName:"div",className:"admonition-content"},(0,r.kt)("p",{parentName:"div"},"If you want to include the interaction library in your project, refer to ",(0,r.kt)("a",{parentName:"p",href:"/docs/interaction-library/overview#option-1-using-botrino-framework"},"this page"),"."))),(0,r.kt)("h2",{id:"running-your-bot"},"Running your bot"),(0,r.kt)("h3",{id:"during-development"},"During development"),(0,r.kt)("p",null,"When you are developing your bot, you may prefer running the bot directly in your IDE rather than package your application every time."),(0,r.kt)("p",null,"If you used the archetype, copy the contents of ",(0,r.kt)("inlineCode",{parentName:"p"},"app/src/main/external-resources")," in a new directory on your hard drive, ",(0,r.kt)("strong",{parentName:"p"},"outside of the project workspace"),". If you aren't using the archetype, create a directory outside of your project and add a ",(0,r.kt)("inlineCode",{parentName:"p"},"config.json")," file with the following contents (insert your bot token in the ",(0,r.kt)("inlineCode",{parentName:"p"},'"token"')," field, and remove the ",(0,r.kt)("inlineCode",{parentName:"p"},'"interaction"')," field if you aren't using the interaction library):"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-json"},'{\n "bot": {\n "token": "yourTokenHere",\n "presence": {\n "status": "online",\n "activity_type": "playing",\n "activity_text": "Hello world!"\n },\n "enabled_intents": 32509\n },\n "interaction": {}\n}\n')),(0,r.kt)("p",null,"Use the tabs below depending on whether you use Eclipse or IntelliJ. If you use another IDE, it should be similar enough so you can figure out by yourself."),(0,r.kt)(l.Z,{groupId:"ide",defaultValue:"intellij",values:[{label:"IntelliJ",value:"intellij"},{label:"Eclipse",value:"eclipse"}],mdxType:"Tabs"},(0,r.kt)(p.Z,{value:"intellij",mdxType:"TabItem"},(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Open ",(0,r.kt)("inlineCode",{parentName:"p"},"Run")," > ",(0,r.kt)("inlineCode",{parentName:"p"},"Edit Configurations..."))),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},'If you are using the archetype, it should detect a run configuration called "Main" automatically. If so, jump to step 7, otherwise continue')),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Click ",(0,r.kt)("inlineCode",{parentName:"p"},"+")," then ",(0,r.kt)("inlineCode",{parentName:"p"},"Application"))),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Select Java 11 (or whatever JDK 11+ you have installed)")),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},'In the "Main class" field, enter the fully qualified name of the class containing the main method')),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},'In the "VM options" field, copy and paste the following: ',(0,r.kt)("inlineCode",{parentName:"p"},"--add-modules=ALL-MODULE-PATH -cp . -p $MODULE_DIR$/target/dependency:$MODULE_DIR$/target/classes"))),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},'In the "Working directory" field, enter the absolute path (or click the folder icon to browse) to the directory where you copied/created the configuration files earlier'))),(0,r.kt)("img",{src:(0,o.Z)("img/intellij.png"),alt:""}),(0,r.kt)("ol",{start:8},(0,r.kt)("li",{parentName:"ol"},'Click "OK" and run'))),(0,r.kt)(p.Z,{value:"eclipse",mdxType:"TabItem"},(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Open ",(0,r.kt)("inlineCode",{parentName:"p"},"Run")," > ",(0,r.kt)("inlineCode",{parentName:"p"},"Run Configurations..."))),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Right click ",(0,r.kt)("inlineCode",{parentName:"p"},"Java Application")," then click ",(0,r.kt)("inlineCode",{parentName:"p"},"New Configuration"))),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},'In the "Project" field, select your project containing the main class')),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},'In the "Main class" field, enter the fully qualified name of the class containing the main method'))),(0,r.kt)("img",{src:(0,o.Z)("img/eclipse1.png"),alt:""}),(0,r.kt)("ol",{start:5},(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},'Go to the "Dependencies" tab, highlight "Classpath Entries", then click "Advanced...", select "Add External Folder", "OK", and browse to the directory where you copied/created the configuration files earlier')),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},'Still in the "Dependencies" tab, find the "Add modules" dropdown and select ',(0,r.kt)("inlineCode",{parentName:"p"},"ALL-MODULE-PATH")))),(0,r.kt)("img",{src:(0,o.Z)("img/eclipse2.png"),alt:""}),(0,r.kt)("ol",{start:7},(0,r.kt)("li",{parentName:"ol"},'Click "Apply" then "Run"')))),(0,r.kt)("h3",{id:"in-a-production-environment"},"In a production environment"),(0,r.kt)("p",null,"If you aren't using the archetype, you would need to configure yourself the packaging for the production environment, including scripts to launch the bot with the correct VM arguments, etc, just like any other Java application. If you are using the archetype, you can build the JLink runtime image with the following command:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre"},"mvn package -Dtoken=<BOT_TOKEN>\n")),(0,r.kt)("p",null,"The bot token property is not required, but saves you from manually editing the json file to insert the token later on. This command will produce a ",(0,r.kt)("inlineCode",{parentName:"p"},".zip")," file found in ",(0,r.kt)("inlineCode",{parentName:"p"},"delivery/target")," directory. You can unzip it in your production environment, and just run ",(0,r.kt)("inlineCode",{parentName:"p"},"./bin/<launcher name>"),". ",(0,r.kt)("inlineCode",{parentName:"p"},"<launcher name>")," by default corresponds to the ",(0,r.kt)("inlineCode",{parentName:"p"},"artifactId")," of your project."),(0,r.kt)("div",{className:"admonition admonition-info alert alert--info"},(0,r.kt)("div",{parentName:"div",className:"admonition-heading"},(0,r.kt)("h5",{parentName:"div"},(0,r.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,r.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,r.kt)("path",{parentName:"svg",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"}))),"info")),(0,r.kt)("div",{parentName:"div",className:"admonition-content"},(0,r.kt)("p",{parentName:"div"},"By default, the application will be attached to the current command line window, meaning the bot would disconnect if you close the terminal. You can run the application with the ",(0,r.kt)("inlineCode",{parentName:"p"},"--detached")," flag to launch the bot in the background. You can combine it with the ",(0,r.kt)("inlineCode",{parentName:"p"},"--batch-mode")," flag so that it won't ask you to press a key to exit."))),(0,r.kt)("h3",{id:"adding-system-modules-to-the-jlink-runtime-image"},"Adding system modules to the JLink runtime image"),(0,r.kt)("p",null,"If you build the bot using the JLink runtime image generated by the archetype, the runtime image will include the minimal set of Java system modules required for a Botrino application to work. If you open the parent ",(0,r.kt)("inlineCode",{parentName:"p"},"pom.xml")," and find the ",(0,r.kt)("inlineCode",{parentName:"p"},"maven-jlink-plugin")," configuration, you can see the following list of system modules:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-xml"},"<addModules>\n <addModule>java.logging</addModule>\n <addModule>jdk.unsupported</addModule>\n <addModule>java.xml</addModule>\n <addModule>java.naming</addModule>\n <addModule>java.desktop</addModule>\n <addModule>jdk.crypto.ec</addModule>\n</addModules>\n")),(0,r.kt)("p",null,"If your application needs another module from the JDK, for example ",(0,r.kt)("inlineCode",{parentName:"p"},"java.sql"),", all you need to do is to edit this configuration and add more ",(0,r.kt)("inlineCode",{parentName:"p"},"<addModule>")," tags."))}h.isMDXComponent=!0},6010:function(e,t,n){function a(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=a(e[t]))&&(i&&(i+=" "),i+=n);else for(t in e)e[t]&&(i&&(i+=" "),i+=t);return i}function i(){for(var e,t,n=0,i="";n<arguments.length;)(e=arguments[n++])&&(t=a(e))&&(i&&(i+=" "),i+=t);return i}n.d(t,{Z:function(){return i}})}}]); \ No newline at end of file diff --git a/assets/js/d9be502e.93f8c050.js b/assets/js/d9be502e.93f8c050.js deleted file mode 100644 index 69bb124..0000000 --- a/assets/js/d9be502e.93f8c050.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[122],{3905:function(e,t,n){n.d(t,{Zo:function(){return p},kt:function(){return u}});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 s(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 l=i.createContext({}),c=function(e){var t=i.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},p=function(e){var t=c(e.components);return i.createElement(l.Provider,{value:t},e.children)},m={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,r=e.mdxType,a=e.originalType,l=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),d=c(n),u=r,h=d["".concat(l,".").concat(u)]||d[u]||m[u]||a;return n?i.createElement(h,o(o({ref:t},p),{},{components:n})):i.createElement(h,o({ref:t},p))}));function u(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,o=new Array(a);o[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,o[1]=s;for(var c=2;c<a;c++)o[c]=n[c];return i.createElement.apply(null,o)}return i.createElement.apply(null,n)}d.displayName="MDXCreateElement"},205:function(e,t,n){n.r(t),n.d(t,{frontMatter:function(){return s},metadata:function(){return l},toc:function(){return c},default:function(){return m}});var i=n(7462),r=n(3366),a=(n(7294),n(3905)),o=["components"],s={title:"Privileges"},l={unversionedId:"interaction-library/privileges",id:"interaction-library/privileges",isDocsHomePage:!1,title:"Privileges",description:"Another common use case when making commands is to be able to restrict access to some commands that should not be used by everyone. The Privilege API provides a way to conveniently implement these kind of restrictions.",source:"@site/docs/interaction-library/privileges.md",sourceDirName:"interaction-library",slug:"/interaction-library/privileges",permalink:"/docs/interaction-library/privileges",editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/interaction-library/privileges.md",version:"current",frontMatter:{title:"Privileges"},sidebar:"someSidebar",previous:{title:"Dealing with components",permalink:"/docs/interaction-library/dealing-with-components"},next:{title:"Cooldowns",permalink:"/docs/interaction-library/cooldowns"}},c=[{value:"The <code>Privilege</code> interface",id:"the-privilege-interface",children:[]},{value:"Privilege presets",id:"privilege-presets",children:[]},{value:"Composing privileges",id:"composing-privileges",children:[]}],p={toc:c};function m(e){var t=e.components,n=(0,r.Z)(e,o);return(0,a.kt)("wrapper",(0,i.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Another common use case when making commands is to be able to restrict access to some commands that should not be used by everyone. The Privilege API provides a way to conveniently implement these kind of restrictions."),(0,a.kt)("div",{className:"admonition admonition-info alert alert--info"},(0,a.kt)("div",{parentName:"div",className:"admonition-heading"},(0,a.kt)("h5",{parentName:"div"},(0,a.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,a.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,a.kt)("path",{parentName:"svg",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"}))),"info")),(0,a.kt)("div",{parentName:"div",className:"admonition-content"},(0,a.kt)("p",{parentName:"div"},(0,a.kt)("a",{parentName:"p",href:"https://discord.com/developers/docs/interactions/application-commands#permissions"},"The permission system proposed by Discord")," is currently not yet supported by Discord4J. As such, using this Privilege API is the recommended approach until Discord native permissions are fully supported. There is no plan to deprecate this feature for now."))),(0,a.kt)("h2",{id:"the-privilege-interface"},"The ",(0,a.kt)("inlineCode",{parentName:"h2"},"Privilege")," interface"),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"Privilege")," is a functional interface that is in charge of checking if access to the command is granted for a specific context. If granted, the abstract method of the interface returns a ",(0,a.kt)("inlineCode",{parentName:"p"},"Mono")," that completes empty, which signals that the command can be run normally. If not granted, the returned ",(0,a.kt)("inlineCode",{parentName:"p"},"Mono")," is expected to emit ",(0,a.kt)("inlineCode",{parentName:"p"},"PrivilegeException")," (or a subclass of this exception), possibly carrying details on the reason of the failure. In this case, the command execution will be cancelled."),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"InteractionListener")," superinterface, which is extended by ",(0,a.kt)("inlineCode",{parentName:"p"},"ChatInputInteractionListener"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"UserInteractionListener"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"MessageInteractionListener")," and ",(0,a.kt)("inlineCode",{parentName:"p"},"ComponentInteractionListener"),", provides a ",(0,a.kt)("inlineCode",{parentName:"p"},"privilege()")," method that can be overriden in your command implementations."),(0,a.kt)("p",null,'An instance of this interface can be provided via a lambda expression. The example below defines a privilege which only grants users whose username starts with "A":'),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-java"},'@Override\npublic Privilege privilege() {\n return ctx -> Mono.justOrEmpty(ctx.event().getMessage().getAuthor())\n .filter(author -> author.getUsername().startsWith("A"))\n .switchIfEmpty(Mono.error(PrivilegeException::new))\n .then();\n}\n')),(0,a.kt)("div",{className:"admonition admonition-info alert alert--info"},(0,a.kt)("div",{parentName:"div",className:"admonition-heading"},(0,a.kt)("h5",{parentName:"div"},(0,a.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,a.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,a.kt)("path",{parentName:"svg",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"}))),"info")),(0,a.kt)("div",{parentName:"div",className:"admonition-content"},(0,a.kt)("p",{parentName:"div"},"Handling ",(0,a.kt)("inlineCode",{parentName:"p"},"PrivilegeException")," (for example to display a user-friendly message) is documented on the ",(0,a.kt)("a",{parentName:"p",href:"/docs/interaction-library/handling-errors"},"Handling Errors")," page."))),(0,a.kt)("h2",{id:"privilege-presets"},"Privilege presets"),(0,a.kt)("p",null,"In most cases, checking if access to a command is granted will simply consist of checking if the user has a particular role or a particular permission in the guild. You can use one of the static methods of the ",(0,a.kt)("inlineCode",{parentName:"p"},"Privileges")," class instead of implementing that yourself:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-java"},"@Override\npublic Privilege privilege() {\n return Privileges.checkPermissions(perms -> perms.contains(ADMINISTRATOR));\n}\n")),(0,a.kt)("p",null,"Check out the ",(0,a.kt)("a",{parentName:"p",href:"https://javadoc.io/doc/com.alex1304.botrino/botrino-interaction/latest/botrino.interaction/botrino/interaction/privilege/Privileges.html"},"Javadoc for the ",(0,a.kt)("inlineCode",{parentName:"a"},"Privileges")," class")," for more presets like this one."),(0,a.kt)("h2",{id:"composing-privileges"},"Composing privileges"),(0,a.kt)("p",null,"You can compose several ",(0,a.kt)("inlineCode",{parentName:"p"},"Privilege")," instances by using the ",(0,a.kt)("inlineCode",{parentName:"p"},"and()")," and ",(0,a.kt)("inlineCode",{parentName:"p"},"or()")," methods:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-java"},"@Override\npublic Privilege privilege() {\n return Privileges.checkRoles(roles -> !roles.isEmpty())\n .or(Privileges.guildOwner());\n}\n")),(0,a.kt)("p",null,'This code means "Grant if the user has at least one role OR if they are the owner of the server".'))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/ddcb1508.c5f25f84.js b/assets/js/ddcb1508.c5f25f84.js new file mode 100644 index 0000000..edf6be7 --- /dev/null +++ b/assets/js/ddcb1508.c5f25f84.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[902],{8867:(e,o,n)=>{n.r(o),n.d(o,{assets:()=>c,contentTitle:()=>a,default:()=>m,frontMatter:()=>r,metadata:()=>s,toc:()=>d});var t=n(4848),i=n(8453);const r={title:"Cooldowns"},a=void 0,s={id:"interaction-library/cooldowns",title:"Cooldowns",description:"If your commands perform costly operations or can potentially be abused, you may want to set a limit on the number of",source:"@site/docs/interaction-library/cooldowns.mdx",sourceDirName:"interaction-library",slug:"/interaction-library/cooldowns",permalink:"/docs/interaction-library/cooldowns",draft:!1,unlisted:!1,editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/interaction-library/cooldowns.mdx",tags:[],version:"current",frontMatter:{title:"Cooldowns"},sidebar:"someSidebar",previous:{title:"Privileges",permalink:"/docs/interaction-library/privileges"},next:{title:"Handling errors",permalink:"/docs/interaction-library/handling-errors"}},c={},d=[{value:"Set a cooldown to a command",id:"set-a-cooldown-to-a-command",level:2},{value:"Handling cooldowns",id:"handling-cooldowns",level:2}];function l(e){const o={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.p,{children:"If your commands perform costly operations or can potentially be abused, you may want to set a limit on the number of\ntimes the command can be used. The Cooldown API will allow you to deal with these situations without hassle."}),"\n",(0,t.jsx)(o.h2,{id:"set-a-cooldown-to-a-command",children:"Set a cooldown to a command"}),"\n",(0,t.jsxs)(o.p,{children:["Override the ",(0,t.jsx)(o.code,{children:"cooldown()"})," method from ",(0,t.jsx)(o.code,{children:"InteractionListener"}),", and specify the cooldown\nusing ",(0,t.jsx)(o.code,{children:"Cooldown.of(int, Duration)"}),":"]}),"\n",(0,t.jsx)(o.pre,{children:(0,t.jsx)(o.code,{className:"language-java",children:"@Override\npublic Cooldown cooldown() {\n return Cooldown.of(1, Duration.ofMinutes(1));\n}\n"})}),"\n",(0,t.jsxs)(o.p,{children:["The integer represents the maximum number of times the command can be executed within a timeframe, and the duration\nrepresents the timeframe itself. Therefore, this example corresponds to a cooldown of ",(0,t.jsx)(o.strong,{children:"once per minute"}),"."]}),"\n",(0,t.jsx)(o.admonition,{type:"info",children:(0,t.jsxs)(o.p,{children:["Cooldowns are applied ",(0,t.jsx)(o.strong,{children:"per user"}),". Two different users using the same command will always have their own separate usage\nlimits."]})}),"\n",(0,t.jsx)(o.h2,{id:"handling-cooldowns",children:"Handling cooldowns"}),"\n",(0,t.jsxs)(o.p,{children:["When a user reaches the maximum number of permits and attempts to use the command again, the command will fail with\na ",(0,t.jsx)(o.code,{children:"CooldownException"}),". You can handle this exception via the command error handler, which will be covered in\nthe ",(0,t.jsx)(o.a,{href:"/docs/interaction-library/handling-errors",children:"next section"}),"."]})]})}function m(e={}){const{wrapper:o}={...(0,i.R)(),...e.components};return o?(0,t.jsx)(o,{...e,children:(0,t.jsx)(l,{...e})}):l(e)}},8453:(e,o,n)=>{n.d(o,{R:()=>a,x:()=>s});var t=n(6540);const i={},r=t.createContext(i);function a(e){const o=t.useContext(r);return t.useMemo((function(){return"function"==typeof e?e(o):{...o,...e}}),[o,e])}function s(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),t.createElement(r.Provider,{value:o},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/dfc585ea.fffa4b9f.js b/assets/js/dfc585ea.fffa4b9f.js deleted file mode 100644 index c92c5a5..0000000 --- a/assets/js/dfc585ea.fffa4b9f.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[879],{3905:function(e,t,n){n.d(t,{Zo:function(){return m},kt:function(){return 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 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){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 l(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 c=a.createContext({}),d=function(e){var t=a.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},m=function(e){var t=d(e.components);return a.createElement(c.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},s=a.forwardRef((function(e,t){var n=e.components,i=e.mdxType,r=e.originalType,c=e.parentName,m=l(e,["components","mdxType","originalType","parentName"]),s=d(n),u=i,g=s["".concat(c,".").concat(u)]||s[u]||p[u]||r;return n?a.createElement(g,o(o({ref:t},m),{},{components:n})):a.createElement(g,o({ref:t},m))}));function u(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var r=n.length,o=new Array(r);o[0]=s;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l.mdxType="string"==typeof e?e:i,o[1]=l;for(var d=2;d<r;d++)o[d]=n[d];return a.createElement.apply(null,o)}return a.createElement.apply(null,n)}s.displayName="MDXCreateElement"},9216:function(e,t,n){n.r(t),n.d(t,{frontMatter:function(){return l},metadata:function(){return c},toc:function(){return d},default:function(){return p}});var a=n(7462),i=n(3366),r=(n(7294),n(3905)),o=["components"],l={title:"Acknowledging interactions"},c={unversionedId:"interaction-library/acknowledging-interactions",id:"interaction-library/acknowledging-interactions",isDocsHomePage:!1,title:"Acknowledging interactions",description:"When an interaction event is received from the gateway, the library is able to acknowledge them automatically. This allows to simplify your code a lot, as you can directly use createFollowup() or editReply() without worrying about choosing between reply(), edit(), deferReply() or deferEdit() first. If you have a specific use case that requires you to take full control over the acknowledgment process, the library gets you covered by offering a way to disable automatic acknowledgment on a per-command basis.",source:"@site/docs/interaction-library/acknowledging-interactions.md",sourceDirName:"interaction-library",slug:"/interaction-library/acknowledging-interactions",permalink:"/docs/interaction-library/acknowledging-interactions",editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/interaction-library/acknowledging-interactions.md",version:"current",frontMatter:{title:"Acknowledging interactions"},sidebar:"someSidebar",previous:{title:"Creating commands",permalink:"/docs/interaction-library/creating-commands"},next:{title:"Dealing with components",permalink:"/docs/interaction-library/dealing-with-components"}},d=[{value:"Modifying the default acknowledgment behavior",id:"modifying-the-default-acknowledgment-behavior",children:[]},{value:"Overriding the acknowledgment mode on a per-command basis",id:"overriding-the-acknowledgment-mode-on-a-per-command-basis",children:[]}],m={toc:d};function p(e){var t=e.components,n=(0,i.Z)(e,o);return(0,r.kt)("wrapper",(0,a.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"When an interaction event is received from the gateway, the library is able to acknowledge them automatically. This allows to simplify your code a lot, as you can directly use ",(0,r.kt)("inlineCode",{parentName:"p"},"createFollowup()")," or ",(0,r.kt)("inlineCode",{parentName:"p"},"editReply()")," without worrying about choosing between ",(0,r.kt)("inlineCode",{parentName:"p"},"reply()"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"edit()"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"deferReply()")," or ",(0,r.kt)("inlineCode",{parentName:"p"},"deferEdit()")," first. If you have a specific use case that requires you to take full control over the acknowledgment process, the library gets you covered by offering a way to disable automatic acknowledgment on a per-command basis."),(0,r.kt)("h2",{id:"modifying-the-default-acknowledgment-behavior"},"Modifying the default acknowledgment behavior"),(0,r.kt)("p",null,"This was partially covered in the ",(0,r.kt)("a",{parentName:"p",href:"/docs/interaction-library/configuration"},"Configuration")," page, the default behavior can be set via the ",(0,r.kt)("inlineCode",{parentName:"p"},"default_ack_mode")," field of ",(0,r.kt)("inlineCode",{parentName:"p"},"config.json")," if you are using the Botrino framework, or via ",(0,r.kt)("inlineCode",{parentName:"p"},"InteractionConfig.Builder#defaultACKMode(String)")," when building the configuration manually. Here's a table describing the possible values and their behavior:"),(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},"value"),(0,r.kt)("th",{parentName:"tr",align:null},"behavior"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"default")),(0,r.kt)("td",{parentName:"tr",align:null},"Equivalent to ",(0,r.kt)("inlineCode",{parentName:"td"},"defer"),".")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"defer")),(0,r.kt)("td",{parentName:"tr",align:null},"Automatically calls ",(0,r.kt)("inlineCode",{parentName:"td"},"deferReply()")," (for commands) or ",(0,r.kt)("inlineCode",{parentName:"td"},"deferEdit()")," (for components).")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"defer_ephemeral")),(0,r.kt)("td",{parentName:"tr",align:null},"Automatically calls ",(0,r.kt)("inlineCode",{parentName:"td"},"deferReply().withEphemeral(true)")," (for commands) or ",(0,r.kt)("inlineCode",{parentName:"td"},"deferEdit().withEphemeral(true)")," (for components).")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"none")),(0,r.kt)("td",{parentName:"tr",align:null},"Does not call any acknowledgment method.")))),(0,r.kt)("h2",{id:"overriding-the-acknowledgment-mode-on-a-per-command-basis"},"Overriding the acknowledgment mode on a per-command basis"),(0,r.kt)("p",null,"Let's say you have ",(0,r.kt)("inlineCode",{parentName:"p"},"defer")," as default behavior in your config, and you want to make a command that replies exclusively with ephemeral messages. There would be no way to achieve this without overriding the acknowledgment behavior for this specific command so that it can be ephemeral. This is as simple as adding an ",(0,r.kt)("inlineCode",{parentName:"p"},"@Acknowledge")," annotation with the desired mode as value:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-java",metastring:"{9}","{9}":!0},'package testbot1;\n\nimport botrino.interaction.annotation.Acknowledge;\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport org.reactivestreams.Publisher;\n\n@Acknowledge(Acknowledge.Mode.DEFER_EPHEMERAL)\n@ChatInputCommand(name = "ping", description = "Pings the bot to check if it is alive.")\npublic final class PingCommand implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return ctx.event().createFollowup("Pong!").withEphemeral(true);\n }\n}\n')),(0,r.kt)("p",null,"Since this is a very simple command, you could even completely disable automatic acknowledgment and use ",(0,r.kt)("inlineCode",{parentName:"p"},"reply()")," instead of ",(0,r.kt)("inlineCode",{parentName:"p"},"createFollowup()"),":"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-java"},'package testbot1;\n\nimport botrino.interaction.annotation.Acknowledge;\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport org.reactivestreams.Publisher;\n\n@Acknowledge(Acknowledge.Mode.NONE)\n@ChatInputCommand(name = "ping", description = "Pings the bot to check if it is alive.")\npublic final class PingCommand implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return ctx.event().reply("Pong!").withEphemeral(true);\n }\n}\n')),(0,r.kt)("div",{className:"admonition admonition-warning alert alert--danger"},(0,r.kt)("div",{parentName:"div",className:"admonition-heading"},(0,r.kt)("h5",{parentName:"div"},(0,r.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,r.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"},(0,r.kt)("path",{parentName:"svg",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"}))),"warning")),(0,r.kt)("div",{parentName:"div",className:"admonition-content"},(0,r.kt)("p",{parentName:"div"},"If your command is made of subcommands or subcommand groups, the ",(0,r.kt)("inlineCode",{parentName:"p"},"@Acknowledge")," annotation must be used on the listener implementation class of individual subcommands; putting it on the parent class alongside ",(0,r.kt)("inlineCode",{parentName:"p"},"@ChatInputCommand")," will have no effect."))))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/e02376a2.6d8ac5b8.js b/assets/js/e02376a2.6d8ac5b8.js deleted file mode 100644 index 8b0d48a..0000000 --- a/assets/js/e02376a2.6d8ac5b8.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[113],{3905:function(e,n,t){t.d(n,{Zo:function(){return d},kt:function(){return u}});var o=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 a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function i(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?a(Object(t),!0).forEach((function(n){r(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):a(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,o,r=function(e,n){if(null==e)return{};var t,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)t=a[o],n.indexOf(t)>=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)t=a[o],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var c=o.createContext({}),s=function(e){var n=o.useContext(c),t=n;return e&&(t="function"==typeof e?e(n):i(i({},n),e)),t},d=function(e){var n=s(e.components);return o.createElement(c.Provider,{value:n},e.children)},m={inlineCode:"code",wrapper:function(e){var n=e.children;return o.createElement(o.Fragment,{},n)}},p=o.forwardRef((function(e,n){var t=e.components,r=e.mdxType,a=e.originalType,c=e.parentName,d=l(e,["components","mdxType","originalType","parentName"]),p=s(t),u=r,f=p["".concat(c,".").concat(u)]||p[u]||m[u]||a;return t?o.createElement(f,i(i({ref:n},d),{},{components:t})):o.createElement(f,i({ref:n},d))}));function u(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var a=t.length,i=new Array(a);i[0]=p;var l={};for(var c in n)hasOwnProperty.call(n,c)&&(l[c]=n[c]);l.originalType=e,l.mdxType="string"==typeof e?e:r,i[1]=l;for(var s=2;s<a;s++)i[s]=t[s];return o.createElement.apply(null,i)}return o.createElement.apply(null,t)}p.displayName="MDXCreateElement"},1914:function(e,n,t){t.r(n),t.d(n,{frontMatter:function(){return l},metadata:function(){return c},toc:function(){return s},default:function(){return m}});var o=t(7462),r=t(3366),a=(t(7294),t(3905)),i=["components"],l={title:"Cooldowns"},c={unversionedId:"interaction-library/cooldowns",id:"interaction-library/cooldowns",isDocsHomePage:!1,title:"Cooldowns",description:"If your commands perform costly operations or can potentially be abused, you may want to set a limit on the number of times the command can be used. The Cooldown API will allow you to deal with these situations without hassle.",source:"@site/docs/interaction-library/cooldowns.md",sourceDirName:"interaction-library",slug:"/interaction-library/cooldowns",permalink:"/docs/interaction-library/cooldowns",editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/interaction-library/cooldowns.md",version:"current",frontMatter:{title:"Cooldowns"},sidebar:"someSidebar",previous:{title:"Privileges",permalink:"/docs/interaction-library/privileges"},next:{title:"Handling errors",permalink:"/docs/interaction-library/handling-errors"}},s=[{value:"Set a cooldown to a command",id:"set-a-cooldown-to-a-command",children:[]},{value:"Handling cooldowns",id:"handling-cooldowns",children:[]}],d={toc:s};function m(e){var n=e.components,t=(0,r.Z)(e,i);return(0,a.kt)("wrapper",(0,o.Z)({},d,t,{components:n,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"If your commands perform costly operations or can potentially be abused, you may want to set a limit on the number of times the command can be used. The Cooldown API will allow you to deal with these situations without hassle."),(0,a.kt)("h2",{id:"set-a-cooldown-to-a-command"},"Set a cooldown to a command"),(0,a.kt)("p",null,"Override the ",(0,a.kt)("inlineCode",{parentName:"p"},"cooldown()")," method from ",(0,a.kt)("inlineCode",{parentName:"p"},"InteractionListener"),", and specify the cooldown using ",(0,a.kt)("inlineCode",{parentName:"p"},"Cooldown.of(int, Duration)"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-java"},"@Override\npublic Cooldown cooldown() {\n return Cooldown.of(1, Duration.ofMinutes(1));\n}\n")),(0,a.kt)("p",null,"The integer represents the maximum number of times the command can be executed within a timeframe, and the duration represents the timeframe itself. Therefore, this example corresponds to a cooldown of ",(0,a.kt)("strong",{parentName:"p"},"once per minute"),"."),(0,a.kt)("div",{className:"admonition admonition-info alert alert--info"},(0,a.kt)("div",{parentName:"div",className:"admonition-heading"},(0,a.kt)("h5",{parentName:"div"},(0,a.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,a.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,a.kt)("path",{parentName:"svg",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"}))),"info")),(0,a.kt)("div",{parentName:"div",className:"admonition-content"},(0,a.kt)("p",{parentName:"div"},"Cooldowns are applied ",(0,a.kt)("strong",{parentName:"p"},"per user"),". Two different users using the same command will always have their own separate usage limits."))),(0,a.kt)("h2",{id:"handling-cooldowns"},"Handling cooldowns"),(0,a.kt)("p",null,"When a user reaches the maximum number of permits and attempts to use the command again, the command will fail with a ",(0,a.kt)("inlineCode",{parentName:"p"},"CooldownException"),". You can handle this exception via the command error handler, which will be covered in the ",(0,a.kt)("a",{parentName:"p",href:"/docs/interaction-library/handling-errors"},"next section"),"."))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/efe2a42e.5dfe26f0.js b/assets/js/efe2a42e.5dfe26f0.js deleted file mode 100644 index 4964e0e..0000000 --- a/assets/js/efe2a42e.5dfe26f0.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[863],{3905:function(e,t,n){n.d(t,{Zo:function(){return d},kt:function(){return 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 o(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 r(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){a(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,i,a=function(e,t){if(null==e)return{};var n,i,a={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=i.createContext({}),c=function(e){var t=i.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):r(r({},t),e)),n},d=function(e){var t=c(e.components);return i.createElement(l.Provider,{value:t},e.children)},p={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,o=e.originalType,l=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),m=c(n),h=a,v=m["".concat(l,".").concat(h)]||m[h]||p[h]||o;return n?i.createElement(v,r(r({ref:t},d),{},{components:n})):i.createElement(v,r({ref:t},d))}));function h(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,r=new Array(o);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:a,r[1]=s;for(var c=2;c<o;c++)r[c]=n[c];return i.createElement.apply(null,r)}return i.createElement.apply(null,n)}m.displayName="MDXCreateElement"},3159:function(e,t,n){n.r(t),n.d(t,{frontMatter:function(){return s},metadata:function(){return l},toc:function(){return c},default:function(){return p}});var i=n(7462),a=n(3366),o=(n(7294),n(3905)),r=["components"],s={title:"Extensions"},l={unversionedId:"api/extensions",id:"api/extensions",isDocsHomePage:!1,title:"Extensions",description:"When you start your application, Botrino automatically loads all the classes present in bot modules. According to the type of classes that are discovered, an action will be performed on them such as registering a service or adding a configuration entry. Extensions allow you to hook into this module scanning process to add your own logic when classes are loaded.",source:"@site/docs/api/extensions.md",sourceDirName:"api",slug:"/api/extensions",permalink:"/docs/api/extensions",editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/api/extensions.md",version:"current",frontMatter:{title:"Extensions"},sidebar:"someSidebar",previous:{title:"Customizing the Discord client",permalink:"/docs/api/customizing-the-discord-client"},next:{title:"Internationalization",permalink:"/docs/api/i18n"}},c=[{value:"Declaring an extension",id:"declaring-an-extension",children:[]},{value:"Implementing an extension",id:"implementing-an-extension",children:[{value:"<code>void onClassDiscovered(Class<?> clazz)</code>",id:"void-onclassdiscoveredclass-clazz",children:[]},{value:"<code>void onServiceCreated(Object o)</code>",id:"void-onservicecreatedobject-o",children:[]},{value:"<code>Set<ServiceDescriptor> provideExtraServices()</code>",id:"setservicedescriptor-provideextraservices",children:[]},{value:"<code>Set<Class<?>> provideExtraDiscoverableClasses()</code>",id:"setclass-provideextradiscoverableclasses",children:[]},{value:"<code>Mono<Void> finishAndJoin()</code>",id:"monovoid-finishandjoin",children:[]}]},{value:"A concrete example: the interaction library",id:"a-concrete-example-the-interaction-library",children:[]}],d={toc:c};function p(e){var t=e.components,n=(0,a.Z)(e,r);return(0,o.kt)("wrapper",(0,i.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("p",null,"When you start your application, Botrino automatically loads all the classes present in bot modules. According to the type of classes that are discovered, an action will be performed on them such as registering a service or adding a configuration entry. Extensions allow you to hook into this module scanning process to add your own logic when classes are loaded."),(0,o.kt)("h2",{id:"declaring-an-extension"},"Declaring an extension"),(0,o.kt)("p",null,"Unlike other components of the framework, extensions do not need to reside in a module annotated with ",(0,o.kt)("inlineCode",{parentName:"p"},"@BotModule"),". Think of extensions like plugins for the framework itself and not for your bot application directly. Your module does not need to be ",(0,o.kt)("inlineCode",{parentName:"p"},"open")," either, extensions are loaded via ",(0,o.kt)("a",{parentName:"p",href:"https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/ServiceLoader.html"},(0,o.kt)("inlineCode",{parentName:"a"},"java.util.ServiceLoader")),"."),(0,o.kt)("p",null,"The first step is to create a class implementing the ",(0,o.kt)("inlineCode",{parentName:"p"},"BotrinoExtension")," interface:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-java"},"package com.example.myproject;\n\nimport botrino.api.extension.BotrinoExtension;\nimport com.github.alex1304.rdi.config.ServiceDescriptor;\nimport reactor.core.publisher.Mono;\n\nimport java.util.Set;\n\npublic final class MyExtension implements BotrinoExtension {\n\n @Override\n public void onClassDiscovered(Class<?> clazz) {\n // ...\n }\n\n @Override\n public void onServiceCreated(Object o) {\n // ...\n }\n\n @Override\n public Set<ServiceDescriptor> provideExtraServices() {\n // ...\n }\n\n @Override\n public Set<Class<?>> provideExtraDiscoverableClasses() {\n // ...\n }\n\n @Override\n public Mono<Void> finishAndJoin() {\n // ...\n }\n}\n")),(0,o.kt)("p",null,"Before going into the details of the methods to implement, let's register this class as a provider for ",(0,o.kt)("inlineCode",{parentName:"p"},"BotrinoExtension"),". This is done via the ",(0,o.kt)("inlineCode",{parentName:"p"},"module-info.java"),":"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-java"},"import botrino.api.extension.BotrinoExtension;\nimport com.example.extension.MyExtension;\n\nmodule com.example.extension {\n\n requires botrino.api;\n provides BotrinoExtension with MyExtension;\n}\n")),(0,o.kt)("div",{className:"admonition admonition-info alert alert--info"},(0,o.kt)("div",{parentName:"div",className:"admonition-heading"},(0,o.kt)("h5",{parentName:"div"},(0,o.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,o.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,o.kt)("path",{parentName:"svg",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"}))),"info")),(0,o.kt)("div",{parentName:"div",className:"admonition-content"},(0,o.kt)("p",{parentName:"div"},"You don't ",(0,o.kt)("em",{parentName:"p"},"have")," to create a separate module just for your extension. It is totally fine to add the ",(0,o.kt)("inlineCode",{parentName:"p"},"provides")," directive directly in your ",(0,o.kt)("inlineCode",{parentName:"p"},"@BotModule"),", this example just shows that you are not required to."))),(0,o.kt)("h2",{id:"implementing-an-extension"},"Implementing an extension"),(0,o.kt)("p",null,"Let's review each of the methods of ",(0,o.kt)("inlineCode",{parentName:"p"},"BotrinoExtension")," to implement."),(0,o.kt)("h3",{id:"void-onclassdiscoveredclass-clazz"},(0,o.kt)("inlineCode",{parentName:"h3"},"void onClassDiscovered(Class<?> clazz)")),(0,o.kt)("p",null,"This is a callback method invoked each time a class is discovered in a bot module. In most cases, you will check if this class implements a specific interface or is annotated with a specific annotation, and do some processing when it is relevant to do so."),(0,o.kt)("div",{className:"admonition admonition-caution alert alert--warning"},(0,o.kt)("div",{parentName:"div",className:"admonition-heading"},(0,o.kt)("h5",{parentName:"div"},(0,o.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,o.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},(0,o.kt)("path",{parentName:"svg",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"}))),"caution")),(0,o.kt)("div",{parentName:"div",className:"admonition-content"},(0,o.kt)("p",{parentName:"div"},"If you intend to create an instance of the class, it is highly recommended to skip classes annotated with ",(0,o.kt)("inlineCode",{parentName:"p"},"@RdiService")," from this method, as they are supposed to be instantiated by the RDI container. That's why the ",(0,o.kt)("inlineCode",{parentName:"p"},"onServiceCreated(Object)")," method exists."))),(0,o.kt)("h3",{id:"void-onservicecreatedobject-o"},(0,o.kt)("inlineCode",{parentName:"h3"},"void onServiceCreated(Object o)")),(0,o.kt)("p",null,"This is a callback method invoked each time a service is created. It allows to execute some action on the service object right after it's created."),(0,o.kt)("div",{className:"admonition admonition-info alert alert--info"},(0,o.kt)("div",{parentName:"div",className:"admonition-heading"},(0,o.kt)("h5",{parentName:"div"},(0,o.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,o.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,o.kt)("path",{parentName:"svg",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"}))),"info")),(0,o.kt)("div",{parentName:"div",className:"admonition-content"},(0,o.kt)("p",{parentName:"div"},"As this method returns ",(0,o.kt)("inlineCode",{parentName:"p"},"void"),", it is not suited for performing reactive tasks. Instead, store the service object in a field and perform this task in ",(0,o.kt)("inlineCode",{parentName:"p"},"finishAndJoin()"),"."))),(0,o.kt)("h3",{id:"setservicedescriptor-provideextraservices"},(0,o.kt)("inlineCode",{parentName:"h3"},"Set<ServiceDescriptor> provideExtraServices()")),(0,o.kt)("p",null,"Even though the extension may not be inside a bot module, it is still possible to register services that will be exposed to the bot application. You can do so via this method, allowing you to provide a set of ",(0,o.kt)("a",{parentName:"p",href:"https://alex1304.github.io/rdi/docs/service-descriptors"},"RDI service descriptors"),". This method is only useful if you want to provide complex services that require writing raw descriptors (for example registering a class from a third-party library as a service with a custom name). For simple services maintained by yourself, you can use RDI annotations and make the annotated class discoverable via ",(0,o.kt)("inlineCode",{parentName:"p"},"provideExtraDiscoverableClasses()")," instead of doing it via this method."),(0,o.kt)("h3",{id:"setclass-provideextradiscoverableclasses"},(0,o.kt)("inlineCode",{parentName:"h3"},"Set<Class<?>> provideExtraDiscoverableClasses()")),(0,o.kt)("p",null,"With this method you can explicitly specify a set of classes that Botrino will pick up just like if they were inside a bot module. It is guaranteed that each class contained in the set will eventually be passed to the ",(0,o.kt)("inlineCode",{parentName:"p"},"onClassDiscovered(Class)")," method (unless they have the ",(0,o.kt)("inlineCode",{parentName:"p"},"@Exclude")," annotation). As said earlier, it can be used as an alternative way to provide extra services, if the class contained in the set is annotated with RDI annotations. It can also be used to register new configuration entries, or new things you're defining yourself in your own extension!"),(0,o.kt)("h3",{id:"monovoid-finishandjoin"},(0,o.kt)("inlineCode",{parentName:"h3"},"Mono<Void> finishAndJoin()")),(0,o.kt)("p",null,"This is the last method that is invoked during the startup sequence. It allows you to perform a task, possibly reactive, based on the classes and objects you were able to collect via previous invocations of ",(0,o.kt)("inlineCode",{parentName:"p"},"onClassDiscovered(Class)")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"onServiceCreated(Object)"),'. The "join" part of this method\'s name indicates the fact that the returned reactive sequence does not need to be a finite source: you can use it to start processes living during the entire lifetime of the application, for example installing event listeners or starting a web server. The subscription to the returned ',(0,o.kt)("inlineCode",{parentName:"p"},"Mono")," is automatically cancelled once the bot disconnects, allowing the application to shut down properly."),(0,o.kt)("div",{className:"admonition admonition-warning alert alert--danger"},(0,o.kt)("div",{parentName:"div",className:"admonition-heading"},(0,o.kt)("h5",{parentName:"div"},(0,o.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,o.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"},(0,o.kt)("path",{parentName:"svg",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"}))),"warning")),(0,o.kt)("div",{parentName:"div",className:"admonition-content"},(0,o.kt)("p",{parentName:"div"},"If an exception is thrown or an error is emitted via the ",(0,o.kt)("inlineCode",{parentName:"p"},"Mono")," from this method, the exception will propagate to the main thread, which will result in the bot to forcefully disconnect and the application to be terminated."))),(0,o.kt)("h2",{id:"a-concrete-example-the-interaction-library"},"A concrete example: the interaction library"),(0,o.kt)("p",null,"The ",(0,o.kt)("a",{parentName:"p",href:"/docs/interaction-library/overview"},"interaction library")," of Botrino provides an implementation of ",(0,o.kt)("inlineCode",{parentName:"p"},"BotrinoExtension"),", which is in charge of collecting the classes implementing ",(0,o.kt)("inlineCode",{parentName:"p"},"XxxInteractionListener"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"InteractionErrorHandler"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"InteractionEventProcessor")," and so on, in order to register them in the ",(0,o.kt)("inlineCode",{parentName:"p"},"InteractionService"),". It also exposes a new entry in ",(0,o.kt)("inlineCode",{parentName:"p"},"config.json")," that allows to construct the ",(0,o.kt)("a",{parentName:"p",href:"/docs/interaction-library/configuration"},"configuration")," object."),(0,o.kt)("p",null,"You can check the source code of the extension class of the interaction library on GitHub ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/Alex1304/botrino/blob/main/interaction/src/main/java/botrino/interaction/InteractionExtension.java"},"here"),". A few things to note to understand the code:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"Classes with the ",(0,o.kt)("inlineCode",{parentName:"li"},"@RdiService")," annotation are ignored, since we want to use the instance created by RDI in case ",(0,o.kt)("inlineCode",{parentName:"li"},"XxxInteractionListener"),", ",(0,o.kt)("inlineCode",{parentName:"li"},"InteractionErrorHandler")," and ",(0,o.kt)("inlineCode",{parentName:"li"},"InteractionEventProcessor")," are declared as services."),(0,o.kt)("li",{parentName:"ul"},"An ",(0,o.kt)("inlineCode",{parentName:"li"},"InstanceCache")," is used so that the same instance can be reused in case a class implements more than one interface."),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"InteractionService")," utilizes RDI annotations, so we provide it via ",(0,o.kt)("inlineCode",{parentName:"li"},"provideExtraDiscoverableClasses()")," and not ",(0,o.kt)("inlineCode",{parentName:"li"},"provideExtraServices()"),"."),(0,o.kt)("li",{parentName:"ul"},"All implementations that were found are finally registered in the ",(0,o.kt)("inlineCode",{parentName:"li"},"finishAndJoin()")," method, which runs the interaction service at the end.")))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/f11c2978.5ae9a3b8.js b/assets/js/f11c2978.5ae9a3b8.js deleted file mode 100644 index a225cf2..0000000 --- a/assets/js/f11c2978.5ae9a3b8.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[180],{3905:function(e,n,t){t.d(n,{Zo:function(){return p},kt:function(){return u}});var r=t(7294);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?i(Object(t),!0).forEach((function(n){o(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(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,r,o=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var c=r.createContext({}),s=function(e){var n=r.useContext(c),t=n;return e&&(t="function"==typeof e?e(n):a(a({},n),e)),t},p=function(e){var n=s(e.components);return r.createElement(c.Provider,{value:n},e.children)},d={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},m=r.forwardRef((function(e,n){var t=e.components,o=e.mdxType,i=e.originalType,c=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),m=s(t),u=o,h=m["".concat(c,".").concat(u)]||m[u]||d[u]||i;return t?r.createElement(h,a(a({ref:n},p),{},{components:t})):r.createElement(h,a({ref:n},p))}));function u(e,n){var t=arguments,o=n&&n.mdxType;if("string"==typeof e||o){var i=t.length,a=new Array(i);a[0]=m;var l={};for(var c in n)hasOwnProperty.call(n,c)&&(l[c]=n[c]);l.originalType=e,l.mdxType="string"==typeof e?e:o,a[1]=l;for(var s=2;s<i;s++)a[s]=t[s];return r.createElement.apply(null,a)}return r.createElement.apply(null,t)}m.displayName="MDXCreateElement"},4285:function(e,n,t){t.r(n),t.d(n,{frontMatter:function(){return l},metadata:function(){return c},toc:function(){return s},default:function(){return d}});var r=t(7462),o=t(3366),i=(t(7294),t(3905)),a=["components"],l={title:"Handling errors"},c={unversionedId:"interaction-library/handling-errors",id:"interaction-library/handling-errors",isDocsHomePage:!1,title:"Handling errors",description:"The execution of a interaction may fail for many reasons. You can handle these errors in a way that is adapted to each type of errors, this is done via the InteractionErrorHandler interface.",source:"@site/docs/interaction-library/handling-errors.md",sourceDirName:"interaction-library",slug:"/interaction-library/handling-errors",permalink:"/docs/interaction-library/handling-errors",editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/interaction-library/handling-errors.md",version:"current",frontMatter:{title:"Handling errors"},sidebar:"someSidebar",previous:{title:"Cooldowns",permalink:"/docs/interaction-library/cooldowns"},next:{title:"Filtering and adapting events",permalink:"/docs/interaction-library/filtering-and-adapting-events"}},s=[{value:"Global error handler",id:"global-error-handler",children:[]}],p={toc:s};function d(e){var n=e.components,t=(0,o.Z)(e,a);return(0,i.kt)("wrapper",(0,r.Z)({},p,t,{components:n,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"The execution of a interaction may fail for many reasons. You can handle these errors in a way that is adapted to each type of errors, this is done via the ",(0,i.kt)("inlineCode",{parentName:"p"},"InteractionErrorHandler")," interface."),(0,i.kt)("h2",{id:"global-error-handler"},"Global error handler"),(0,i.kt)("p",null,"You simply need to create a class implementing ",(0,i.kt)("inlineCode",{parentName:"p"},"InteractionErrorHandler"),". If you are using the Botrino framework, it will automatically be set into the interaction service. Otherwise, you need to set it via the builder when constructing your ",(0,i.kt)("inlineCode",{parentName:"p"},"InteractionService"),":"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-java"},"final var interactionService = InteractionService.builder(config, gateway)\n .setErrorHandler(new MyErrorHandler())\n .build();\n")),(0,i.kt)("p",null,"Here is an example of ",(0,i.kt)("inlineCode",{parentName:"p"},"InteractionErrorHandler")," implementation:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-java"},'package testbot1;\n\nimport botrino.api.util.DurationUtils;\nimport botrino.interaction.InteractionErrorHandler;\nimport botrino.interaction.InteractionFailedException;\nimport botrino.interaction.context.InteractionContext;\nimport botrino.interaction.cooldown.CooldownException;\nimport botrino.interaction.privilege.PrivilegeException;\nimport org.reactivestreams.Publisher;\nimport reactor.core.publisher.Mono;\n\npublic final class MyErrorHandler implements InteractionErrorHandler {\n\n @Override\n public Publisher<?> handleInteractionFailed(InteractionFailedException e, InteractionContext ctx) {\n return ctx.event().createFollowup("\\uD83D\\uDEAB " + e.getMessage()).withEphemeral(true);\n }\n\n @Override\n public Publisher<?> handlePrivilege(PrivilegeException e, InteractionContext ctx) {\n return ctx.event().createFollowup("You have insufficient privileges " +\n "to run this command.").withEphemeral(true);\n }\n\n @Override\n public Publisher<?> handleCooldown(CooldownException e, InteractionContext ctx) {\n return ctx.event().createFollowup("You are on cooldown. " +\n "Retry in " + DurationUtils.format(e.getRetryAfter())).withEphemeral(true);\n }\n\n @Override\n public Publisher<?> handleDefault(Throwable t, InteractionContext ctx) {\n return ctx.event().createFollowup("Something went wrong! Sorry for the inconvenience.")\n .withEphemeral(true)\n .onErrorResume(e -> {\n t.addSuppressed(e);\n return Mono.empty();\n }).then(Mono.error(t)); // Forward downstream for logging\n }\n}\n')),(0,i.kt)("p",null,"The methods of ",(0,i.kt)("inlineCode",{parentName:"p"},"InteractionErrorHandler")," correspond to the most common error types. Each method exposes the ",(0,i.kt)("inlineCode",{parentName:"p"},"InteractionContext")," in which the error happened. None of them are required to be implemented, by default they just forward errors downstream which will only log them at ERROR level. Currently there are four of them:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"handleInteractionFailed(InteractionFailedException, InteractionContext)"),": allows recovering on a ",(0,i.kt)("inlineCode",{parentName:"li"},"InteractionFailedException"),'. This exception represents a "normal" failure of the command, when the end user is at fault. This exception is generally thrown by yourself in your ',(0,i.kt)("inlineCode",{parentName:"li"},"run()")," method and carries a user-friendly message, so the way to handle it will mostly consist of replying to the user with that message."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"handlePrivilege(PrivilegeException, CommandContext)"),": allows recovering on a ",(0,i.kt)("inlineCode",{parentName:"li"},"PrivilegeException"),". It is thrown when a user attempts to use a command with insufficient privileges. Typically, handling this exception will consist of telling the user they cannot use the command. More details on privileges can be found in ",(0,i.kt)("a",{parentName:"li",href:"/docs/interaction-library/privileges"},"this section"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"handleCooldown(CooldownException, CommandContext)"),": allows recovering on a ",(0,i.kt)("inlineCode",{parentName:"li"},"CooldownException"),". It is thrown when a user attempts to use a command past the maximum usage limit within a time interval. Generally, it will be handled by notifying the user that they need to wait some time before trying the command again (the exception carries the exact time left). More details on cooldowns can be found in ",(0,i.kt)("a",{parentName:"li",href:"/docs/interaction-library/cooldowns"},"this section"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"handleDefault(Throwable, CommandContext)"),": allows recovering on an exception type that corresponds to none of the above.")),(0,i.kt)("div",{className:"admonition admonition-caution alert alert--warning"},(0,i.kt)("div",{parentName:"div",className:"admonition-heading"},(0,i.kt)("h5",{parentName:"div"},(0,i.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,i.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},(0,i.kt)("path",{parentName:"svg",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"}))),"Considerations when using the Botrino framework")),(0,i.kt)("div",{parentName:"div",className:"admonition-content"},(0,i.kt)("ul",{parentName:"div"},(0,i.kt)("li",{parentName:"ul"},"The implementation class must have a no-arg constructor."),(0,i.kt)("li",{parentName:"ul"},"If more than one implementation of ",(0,i.kt)("inlineCode",{parentName:"li"},"InteractionErrorHandler")," are found, it will result in an error as it is impossible to determine which one to use. If you don't want to remove the extra implementation(s), you can mark one of them with the ",(0,i.kt)("inlineCode",{parentName:"li"},"@Primary")," annotation to lift the ambiguity. You may alternatively use the ",(0,i.kt)("inlineCode",{parentName:"li"},"@Exclude")," annotation if you don't want one implementation to be picked up by Botrino.")))))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/f5f98f48.7ced76f9.js b/assets/js/f5f98f48.7ced76f9.js deleted file mode 100644 index 8642e5b..0000000 --- a/assets/js/f5f98f48.7ced76f9.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[412],{3905:function(e,n,t){t.d(n,{Zo:function(){return c},kt:function(){return u}});var a=t(7294);function i(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 r(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){i(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 m(e,n){if(null==e)return{};var t,a,i=function(e,n){if(null==e)return{};var t,a,i={},o=Object.keys(e);for(a=0;a<o.length;a++)t=o[a],n.indexOf(t)>=0||(i[t]=e[t]);return i}(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)&&(i[t]=e[t])}return i}var s=a.createContext({}),l=function(e){var n=a.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):r(r({},n),e)),t},c=function(e){var n=l(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)}},p=a.forwardRef((function(e,n){var t=e.components,i=e.mdxType,o=e.originalType,s=e.parentName,c=m(e,["components","mdxType","originalType","parentName"]),p=l(t),u=i,h=p["".concat(s,".").concat(u)]||p[u]||d[u]||o;return t?a.createElement(h,r(r({ref:n},c),{},{components:t})):a.createElement(h,r({ref:n},c))}));function u(e,n){var t=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var o=t.length,r=new Array(o);r[0]=p;var m={};for(var s in n)hasOwnProperty.call(n,s)&&(m[s]=n[s]);m.originalType=e,m.mdxType="string"==typeof e?e:i,r[1]=m;for(var l=2;l<o;l++)r[l]=t[l];return a.createElement.apply(null,r)}return a.createElement.apply(null,t)}p.displayName="MDXCreateElement"},1420:function(e,n,t){t.r(n),t.d(n,{frontMatter:function(){return m},metadata:function(){return s},toc:function(){return l},default:function(){return d}});var a=t(7462),i=t(3366),o=(t(7294),t(3905)),r=["components"],m={title:"Creating commands"},s={unversionedId:"interaction-library/creating-commands",id:"interaction-library/creating-commands",isDocsHomePage:!1,title:"Creating commands",description:"Commands represent the main form of interaction that Discord bots have with users. Creating commands is a simple and straightforward process, with the ability to customize different aspects of them.",source:"@site/docs/interaction-library/creating-commands.md",sourceDirName:"interaction-library",slug:"/interaction-library/creating-commands",permalink:"/docs/interaction-library/creating-commands",editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/interaction-library/creating-commands.md",version:"current",frontMatter:{title:"Creating commands"},sidebar:"someSidebar",previous:{title:"Configuration",permalink:"/docs/interaction-library/configuration"},next:{title:"Acknowledging interactions",permalink:"/docs/interaction-library/acknowledging-interactions"}},l=[{value:"Chat input (aka "slash") commands",id:"chat-input-aka-slash-commands",children:[{value:"Basic command",id:"basic-command",children:[]},{value:"Command options",id:"command-options",children:[]},{value:"Subcommands and subcommand groups",id:"subcommands-and-subcommand-groups",children:[]}]},{value:"Context menu commands",id:"context-menu-commands",children:[]},{value:"Commands as a service",id:"commands-as-a-service",children:[]}],c={toc:l};function d(e){var n=e.components,t=(0,i.Z)(e,r);return(0,o.kt)("wrapper",(0,a.Z)({},c,t,{components:n,mdxType:"MDXLayout"}),(0,o.kt)("p",null,"Commands represent the main form of interaction that Discord bots have with users. Creating commands is a simple and straightforward process, with the ability to customize different aspects of them."),(0,o.kt)("h2",{id:"chat-input-aka-slash-commands"},'Chat input (aka "slash") commands'),(0,o.kt)("h3",{id:"basic-command"},"Basic command"),(0,o.kt)("p",null,"A slash command is a command that is triggered when the user sends ",(0,o.kt)("inlineCode",{parentName:"p"},"/command-name"),' in chat. In the library, they are called "chat input commands".'),(0,o.kt)("p",null,"Here is an example of a ",(0,o.kt)("inlineCode",{parentName:"p"},"/ping"),' command that makes the bot reply with "Pong!":'),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-java"},'package testbot1;\n\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport org.reactivestreams.Publisher;\n\n@ChatInputCommand(name = "ping", description = "Pings the bot to check if it is alive.")\npublic final class PingCommand implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return ctx.event().createFollowup("Pong!");\n }\n}\n')),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"A chat input command must have a ",(0,o.kt)("inlineCode",{parentName:"li"},"@ChatInputCommand")," annotation that contains the meta-information required by Discord (name of the command, description, defaultPermission, etc), and must implement the ",(0,o.kt)("inlineCode",{parentName:"li"},"ChatInputInteractionListener")," interface."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("inlineCode",{parentName:"li"},"run")," method accepts a ",(0,o.kt)("inlineCode",{parentName:"li"},"ChatInputInteractionContext")," that holds contextual information on the command being executed, such as the original ",(0,o.kt)("inlineCode",{parentName:"li"},"ChatInputInteractionEvent"),", the ",(0,o.kt)("inlineCode",{parentName:"li"},"MessageChannel")," where the interaction happened, the ",(0,o.kt)("inlineCode",{parentName:"li"},"User")," who initiated the interaction, and a ",(0,o.kt)("inlineCode",{parentName:"li"},"Locale")," that may have been adapted to the target user (see ",(0,o.kt)("a",{parentName:"li",href:"/docs/interaction-library/filtering-and-adapting-events"},"Filtering and adapting events"),")."),(0,o.kt)("li",{parentName:"ul"},"Events are automatically acknowledged by default, so you can directly call ",(0,o.kt)("inlineCode",{parentName:"li"},"createFollowup()")," without using ",(0,o.kt)("inlineCode",{parentName:"li"},"deferReply()")," first (",(0,o.kt)("inlineCode",{parentName:"li"},"reply()")," will not work unless you disable automatic acknowledgment, see ",(0,o.kt)("a",{parentName:"li",href:"/docs/interaction-library/acknowledging-interactions"},"Acknowledging Interactions"),")")),(0,o.kt)("div",{className:"admonition admonition-info alert alert--info"},(0,o.kt)("div",{parentName:"div",className:"admonition-heading"},(0,o.kt)("h5",{parentName:"div"},(0,o.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,o.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,o.kt)("path",{parentName:"svg",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"}))),"info")),(0,o.kt)("div",{parentName:"div",className:"admonition-content"},(0,o.kt)("p",{parentName:"div"},"If you are using the Botrino framework, you have nothing else to do, the command will be automatically recognized and registered. Otherwise, you need to manually register it into the ",(0,o.kt)("inlineCode",{parentName:"p"},"InteractionService")," like this:"),(0,o.kt)("pre",{parentName:"div"},(0,o.kt)("code",{parentName:"pre",className:"language-java"},"interactionService.registerChatInputCommand(new PingCommand());\n")))),(0,o.kt)("h3",{id:"command-options"},"Command options"),(0,o.kt)("p",null,"A command may accept one or many options, whether they are required or optional. The library provides ",(0,o.kt)("inlineCode",{parentName:"p"},"ChatInputCommandGrammar")," that allows to inject the option values into the fields of a class that is going to be instantiated when the command is executed. Here is an example of a command using options:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-java"},'package testbot1;\n\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport botrino.interaction.grammar.ChatInputCommandGrammar;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport discord4j.core.object.command.ApplicationCommandOption;\nimport discord4j.discordjson.json.ApplicationCommandOptionData;\nimport org.reactivestreams.Publisher;\n\nimport java.util.List;\n\n@ChatInputCommand(name = "options", description = "Option testing")\npublic class OptionsCommand implements ChatInputInteractionListener {\n\n private final ChatInputCommandGrammar<Options> grammar = ChatInputCommandGrammar.of(Options.class);\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return grammar.resolve(ctx.event()).flatMap(options -> ctx.event()\n .createFollowup("Value of `my-string`: " + options.myString));\n }\n\n @Override\n public List<ApplicationCommandOptionData> options() {\n return grammar.toOptions();\n }\n\n private static class Options {\n @ChatInputCommandGrammar.Option(\n type = ApplicationCommandOption.Type.STRING,\n name = "my-string",\n description = "The string argument",\n required = true,\n choices = {\n @ChatInputCommandGrammar.Choice(name = "Choice 1", stringValue = "1"),\n @ChatInputCommandGrammar.Choice(name = "Choice 2", stringValue = "2"),\n @ChatInputCommandGrammar.Choice(name = "Choice 3", stringValue = "3")\n }\n )\n String myString;\n }\n}\n')),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},"Create a new class that declares the fields in which you want to inject the option values. It is recommended to use an internal class for better code readability, unless you are re-using the same class for several commands. The class must have a no-arg contructor, and must be declared ",(0,o.kt)("inlineCode",{parentName:"li"},"static")," if internal. The fields may be ",(0,o.kt)("inlineCode",{parentName:"li"},"private"),", but you can also omit the access modifier to avoid IDE warnings about the field never being assigned a value."),(0,o.kt)("li",{parentName:"ol"},"Use the annotation ",(0,o.kt)("inlineCode",{parentName:"li"},"@ChatInputCommandGrammar.Option")," on the field to declare the properties of the option (the type, the name, the description, whether they are required or not, and the array of value choices, if any)."),(0,o.kt)("li",{parentName:"ol"},"Create a new ",(0,o.kt)("inlineCode",{parentName:"li"},"ChatInputCommandGrammar")," and pass the class to the ",(0,o.kt)("inlineCode",{parentName:"li"},".of()")," method. You only need to instantiate once, rather than on each command execution."),(0,o.kt)("li",{parentName:"ol"},"In the ",(0,o.kt)("inlineCode",{parentName:"li"},"run(ChatInputInteractionContext)")," method, call the ",(0,o.kt)("inlineCode",{parentName:"li"},"resolve(ChatInputInteractionEvent)")," method which will read the options, instantiate the class and inject the values in the annotated fields. You can then use the object to conveniently access the values, as show in the example above."),(0,o.kt)("li",{parentName:"ol"},"Override the ",(0,o.kt)("inlineCode",{parentName:"li"},"options()")," method from ",(0,o.kt)("inlineCode",{parentName:"li"},"ChatInputInteractionListener")," and make it return ",(0,o.kt)("inlineCode",{parentName:"li"},"ChatInputCommandGrammar#toOptions()"),".")),(0,o.kt)("p",null,"For reference, here is a table associating each ",(0,o.kt)("inlineCode",{parentName:"p"},"ApplicationCommandOption.Type")," with the type of the field carrying the annotation:"),(0,o.kt)("table",null,(0,o.kt)("thead",{parentName:"table"},(0,o.kt)("tr",{parentName:"thead"},(0,o.kt)("th",{parentName:"tr",align:null},"Option type"),(0,o.kt)("th",{parentName:"tr",align:null},"Type of annotated field"))),(0,o.kt)("tbody",{parentName:"table"},(0,o.kt)("tr",{parentName:"tbody"},(0,o.kt)("td",{parentName:"tr",align:null},(0,o.kt)("inlineCode",{parentName:"td"},"STRING")),(0,o.kt)("td",{parentName:"tr",align:null},(0,o.kt)("inlineCode",{parentName:"td"},"java.lang.String"))),(0,o.kt)("tr",{parentName:"tbody"},(0,o.kt)("td",{parentName:"tr",align:null},(0,o.kt)("inlineCode",{parentName:"td"},"INTEGER")),(0,o.kt)("td",{parentName:"tr",align:null},(0,o.kt)("inlineCode",{parentName:"td"},"java.lang.Long")," (primitive ",(0,o.kt)("inlineCode",{parentName:"td"},"long")," may be used only if ",(0,o.kt)("inlineCode",{parentName:"td"},"required = true"),")")),(0,o.kt)("tr",{parentName:"tbody"},(0,o.kt)("td",{parentName:"tr",align:null},(0,o.kt)("inlineCode",{parentName:"td"},"NUMBER")),(0,o.kt)("td",{parentName:"tr",align:null},(0,o.kt)("inlineCode",{parentName:"td"},"java.lang.Double")," (primitive ",(0,o.kt)("inlineCode",{parentName:"td"},"double")," may be used only if ",(0,o.kt)("inlineCode",{parentName:"td"},"required = true"),")")),(0,o.kt)("tr",{parentName:"tbody"},(0,o.kt)("td",{parentName:"tr",align:null},(0,o.kt)("inlineCode",{parentName:"td"},"BOOLEAN")),(0,o.kt)("td",{parentName:"tr",align:null},(0,o.kt)("inlineCode",{parentName:"td"},"java.lang.Boolean")," (primitive ",(0,o.kt)("inlineCode",{parentName:"td"},"boolean")," may be used only if ",(0,o.kt)("inlineCode",{parentName:"td"},"required = true"),")")),(0,o.kt)("tr",{parentName:"tbody"},(0,o.kt)("td",{parentName:"tr",align:null},(0,o.kt)("inlineCode",{parentName:"td"},"USER")),(0,o.kt)("td",{parentName:"tr",align:null},(0,o.kt)("inlineCode",{parentName:"td"},"discord4j.core.object.entity.User")," (or ",(0,o.kt)("inlineCode",{parentName:"td"},"discord4j.core.object.entity.Member")," if in a guild)")),(0,o.kt)("tr",{parentName:"tbody"},(0,o.kt)("td",{parentName:"tr",align:null},(0,o.kt)("inlineCode",{parentName:"td"},"CHANNEL")),(0,o.kt)("td",{parentName:"tr",align:null},(0,o.kt)("inlineCode",{parentName:"td"},"discord4j.core.object.entity.channel.Channel"))),(0,o.kt)("tr",{parentName:"tbody"},(0,o.kt)("td",{parentName:"tr",align:null},(0,o.kt)("inlineCode",{parentName:"td"},"ROLE")),(0,o.kt)("td",{parentName:"tr",align:null},(0,o.kt)("inlineCode",{parentName:"td"},"discord4j.core.object.entity.Role"))),(0,o.kt)("tr",{parentName:"tbody"},(0,o.kt)("td",{parentName:"tr",align:null},(0,o.kt)("inlineCode",{parentName:"td"},"MENTIONABLE")),(0,o.kt)("td",{parentName:"tr",align:null},(0,o.kt)("inlineCode",{parentName:"td"},"discord4j.common.util.Snowflake"))))),(0,o.kt)("div",{className:"admonition admonition-caution alert alert--warning"},(0,o.kt)("div",{parentName:"div",className:"admonition-heading"},(0,o.kt)("h5",{parentName:"div"},(0,o.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,o.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},(0,o.kt)("path",{parentName:"svg",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"}))),"caution")),(0,o.kt)("div",{parentName:"div",className:"admonition-content"},(0,o.kt)("p",{parentName:"div"},"Optional options will be filled with ",(0,o.kt)("inlineCode",{parentName:"p"},"null")," if not specified by the user, which means you cannot use primitive types for ",(0,o.kt)("inlineCode",{parentName:"p"},"INTEGER"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"NUMBER")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"BOOLEAN")," if ",(0,o.kt)("inlineCode",{parentName:"p"},"required = false"),", otherwise you will get ",(0,o.kt)("inlineCode",{parentName:"p"},"NullPointerException"),"s."))),(0,o.kt)("h3",{id:"subcommands-and-subcommand-groups"},"Subcommands and subcommand groups"),(0,o.kt)("p",null,"Discord allows to create subcommands and subcommand groups to help in organizing the logic of a complex command. Here is an example of a command using subcommands and subcommand groups:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-java"},'@ChatInputCommand(\n name = "nest",\n description = "Subcommand testing",\n subcommands = {\n @Subcommand(name = "sub1", description = "Subcommand 1", listener = NestCommand.Sub1.class),\n @Subcommand(name = "sub2", description = "Subcommand 2", listener = NestCommand.Sub2.class)\n },\n subcommandGroups = {\n @SubcommandGroup(name = "group1", description = "Group 1", subcommands = {\n @Subcommand(name = "sub", description = "Subcommand", listener = NestCommand.G1Sub.class)\n })\n }\n)\npublic final class NestCommand {\n\n public static final class Sub1 implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return ctx.event().createFollowup("sub1: pong!");\n }\n }\n\n public static final class Sub2 implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return ctx.event().createFollowup("sub2: pong!");\n }\n }\n\n public static final class G1Sub implements ChatInputInteractionListener {\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return ctx.event().createFollowup("group1 sub: pong!");\n }\n }\n}\n')),(0,o.kt)("p",null,"Here are the notable differences:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"The class carrying the ",(0,o.kt)("inlineCode",{parentName:"li"},"@ChatInputCommand")," annotation no longer implements ",(0,o.kt)("inlineCode",{parentName:"li"},"ChatInputInteractionListener"),". Indeed, as per Discord's documentation a base command becomes unusable if subcommands are present."),(0,o.kt)("li",{parentName:"ul"},"The ",(0,o.kt)("inlineCode",{parentName:"li"},"@ChatInputCommand")," specifies an array of ",(0,o.kt)("inlineCode",{parentName:"li"},"@Subcommand")," and ",(0,o.kt)("inlineCode",{parentName:"li"},"@SubcommandGroup")," with their own name and description."),(0,o.kt)("li",{parentName:"ul"},"Subcommands specify the class implementing ",(0,o.kt)("inlineCode",{parentName:"li"},"ChatInputInteractionListener")," that is going to handle them. In this example they are internal classes, but they can as well be external.")),(0,o.kt)("div",{className:"admonition admonition-info alert alert--info"},(0,o.kt)("div",{parentName:"div",className:"admonition-heading"},(0,o.kt)("h5",{parentName:"div"},(0,o.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,o.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,o.kt)("path",{parentName:"svg",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"}))),"info")),(0,o.kt)("div",{parentName:"div",className:"admonition-content"},(0,o.kt)("p",{parentName:"div"},"Here is how you manually register a command containing subcommands when you control the instance of ",(0,o.kt)("inlineCode",{parentName:"p"},"InteractionService"),":"),(0,o.kt)("pre",{parentName:"div"},(0,o.kt)("code",{parentName:"pre",className:"language-java"},"interactionService.registerChatInputCommand(new NestCommand(), List.of(\n new NestCommand.Sub1(),\n new NestCommand.Sub2(),\n new NestCommand.G1Sub()\n));\n")))),(0,o.kt)("div",{className:"admonition admonition-caution alert alert--warning"},(0,o.kt)("div",{parentName:"div",className:"admonition-heading"},(0,o.kt)("h5",{parentName:"div"},(0,o.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,o.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},(0,o.kt)("path",{parentName:"svg",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"}))),"caution")),(0,o.kt)("div",{parentName:"div",className:"admonition-content"},(0,o.kt)("p",{parentName:"div"},"If you are using the Botrino framework, the subcommand classes must either have a public no-arg constructor or be declared as a service. If the classes are internal, they must be ",(0,o.kt)("inlineCode",{parentName:"p"},"static"),"."))),(0,o.kt)("h2",{id:"context-menu-commands"},"Context menu commands"),(0,o.kt)("p",null,"Discord currently support two types of context menu commands, one on messages and one on users. It works the same as chat input commands, but you need to use the ",(0,o.kt)("inlineCode",{parentName:"p"},"@MessageCommand")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"@UserCommand")," annotations with the ",(0,o.kt)("inlineCode",{parentName:"p"},"MessageInteractionListener")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"UserInteractionListener")," interfaces, respectively."),(0,o.kt)("p",null,"Context menu commands are actually less complex than chat input ones, since there is no description, no options, no subcommands... Only a name and a run method:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-java"},'package testbot1;\n\nimport botrino.interaction.annotation.UserCommand;\nimport botrino.interaction.context.UserInteractionContext;\nimport botrino.interaction.listener.UserInteractionListener;\nimport org.reactivestreams.Publisher;\n\n@UserCommand("Fight")\npublic final class FightCommand implements UserInteractionListener {\n\n @Override\n public Publisher<?> run(UserInteractionContext ctx) {\n return ctx.event().createFollowup("You are fighting <@" +\n ctx.event().getTargetId().asString() + ">");\n }\n}\n')),(0,o.kt)("div",{className:"admonition admonition-info alert alert--info"},(0,o.kt)("div",{parentName:"div",className:"admonition-heading"},(0,o.kt)("h5",{parentName:"div"},(0,o.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,o.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,o.kt)("path",{parentName:"svg",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"}))),"info")),(0,o.kt)("div",{parentName:"div",className:"admonition-content"},(0,o.kt)("p",{parentName:"div"},"If you need to do manual registration, it happens via ",(0,o.kt)("inlineCode",{parentName:"p"},"InteractionService#registerMessageCommand(MessageInteractionListener)")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"InteractionService#registerUserCommand(MessageInteractionListener)"),":"),(0,o.kt)("pre",{parentName:"div"},(0,o.kt)("code",{parentName:"pre",className:"language-java"},"interactionService.registerUserCommand(new FightCommand());\n")))),(0,o.kt)("h2",{id:"commands-as-a-service"},"Commands as a service"),(0,o.kt)("div",{className:"admonition admonition-info alert alert--info"},(0,o.kt)("div",{parentName:"div",className:"admonition-heading"},(0,o.kt)("h5",{parentName:"div"},(0,o.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,o.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,o.kt)("path",{parentName:"svg",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"}))),"info")),(0,o.kt)("div",{parentName:"div",className:"admonition-content"},(0,o.kt)("p",{parentName:"div"},"The following is only applicable if you are using the Botrino framework. See ",(0,o.kt)("a",{parentName:"p",href:"/docs/api/working-with-services"},"Working with services"),"."))),(0,o.kt)("p",null,"Classes implementing commands can themselves be declared as services without any issues. For example if you need to access the ",(0,o.kt)("inlineCode",{parentName:"p"},"ConfigContainer")," in your command, you can do this:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-java"},'package testbot1;\n\nimport botrino.api.config.ConfigContainer;\nimport botrino.api.config.object.BotConfig;\nimport botrino.interaction.annotation.ChatInputCommand;\nimport botrino.interaction.context.ChatInputInteractionContext;\nimport botrino.interaction.listener.ChatInputInteractionListener;\nimport com.github.alex1304.rdi.finder.annotation.RdiFactory;\nimport com.github.alex1304.rdi.finder.annotation.RdiService;\nimport discord4j.gateway.intent.IntentSet;\nimport org.reactivestreams.Publisher;\n\n@RdiService\n@ChatInputCommand(name = "intents", description = "Displays the intents enabled for this bot.")\npublic final class IntentsCommand implements ChatInputInteractionListener {\n\n private final long intents;\n\n @RdiFactory\n public IntentsCommand(ConfigContainer configContainer) {\n this.intents = configContainer.get(BotConfig.class)\n .enabledIntents()\n .orElse(IntentSet.nonPrivileged().getRawValue());\n }\n\n @Override\n public Publisher<?> run(ChatInputInteractionContext ctx) {\n return ctx.event().createFollowup("Intents enabled: " + intents);\n }\n}\n')),(0,o.kt)("p",null,"The command above accesses the values in the ",(0,o.kt)("inlineCode",{parentName:"p"},"config.json")," to get the gateway intents enabled for the bot. You can notice the use of ",(0,o.kt)("inlineCode",{parentName:"p"},"@RdiService")," on top of ",(0,o.kt)("inlineCode",{parentName:"p"},"@ChatInputCommand"),", this works totally fine! Don't forget the ",(0,o.kt)("inlineCode",{parentName:"p"},"@RdiFactory")," to inject the configuration container, and you're ready to run the bot and try out this command."),(0,o.kt)("div",{className:"admonition admonition-tip alert alert--success"},(0,o.kt)("div",{parentName:"div",className:"admonition-heading"},(0,o.kt)("h5",{parentName:"div"},(0,o.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,o.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"},(0,o.kt)("path",{parentName:"svg",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"}))),"tip")),(0,o.kt)("div",{parentName:"div",className:"admonition-content"},(0,o.kt)("p",{parentName:"div"},"If you declare a command as a service this way, you are allowed to do anything with it like any other service, for example inject it in other services, or set up ",(0,o.kt)("inlineCode",{parentName:"p"},"@RdiFactory")," to be a ",(0,o.kt)("a",{parentName:"p",href:"/docs/api/working-with-services#injecting-a-service-in-a-reactive-static-factory"},"reactive static method")," in case the command needs to perform a reactive task in order to be initialized."))))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/f8409a7e.c9bb6b16.js b/assets/js/f8409a7e.c9bb6b16.js new file mode 100644 index 0000000..c1ffbbc --- /dev/null +++ b/assets/js/f8409a7e.c9bb6b16.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[903],{4304:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>s,default:()=>u,frontMatter:()=>a,metadata:()=>c,toc:()=>d});var o=n(4848),i=n(8453),r=n(6025);const a={title:"Introduction",slug:"/"},s=void 0,c={id:"intro",title:"Introduction",description:"What is Botrino?",source:"@site/docs/intro.mdx",sourceDirName:".",slug:"/",permalink:"/docs/",draft:!1,unlisted:!1,editUrl:"https://github.com/Alex1304/botrino/edit/main/website/docs/intro.mdx",tags:[],version:"current",frontMatter:{title:"Introduction",slug:"/"},sidebar:"someSidebar",next:{title:"Getting Started",permalink:"/docs/getting-started"}},l={},d=[{value:"What is Botrino?",id:"what-is-botrino",level:2},{value:"Motivations",id:"motivations",level:2},{value:"Overview",id:"overview",level:2}];function h(e){const t={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("img",{style:{float:"right",padding:"5%"},src:(0,r.A)("img/logo.svg"),width:"20%",alt:""}),"\n",(0,o.jsx)(t.h2,{id:"what-is-botrino",children:"What is Botrino?"}),"\n",(0,o.jsxs)(t.p,{children:["Botrino is a Java framework that provides guidelines and a set of tools to build Discord bots in a more convenient way.\nPretty much in the same spirit as ",(0,o.jsx)(t.a,{href:"https://spring.io/projects/spring-boot",children:"Spring Boot"}),", it allows to easily setup\nstandalone bot applications that are ready to run, embedding a few third-party libraries such\nas ",(0,o.jsx)(t.a,{href:"https://github.com/FasterXML/jackson-core",children:"Jackson"})," for JSON-based\nconfiguration, ",(0,o.jsx)(t.a,{href:"https://alex1304.github.io/rdi/docs/intro",children:"RDI"})," for a reactive IoC container,\nand ",(0,o.jsx)(t.a,{href:"https://discord4j.com",children:"Discord4J"})," for the interface with\nthe ",(0,o.jsx)(t.a,{href:"https://discord.com/developers/docs/intro",children:"Discord Bot API"}),"."]}),"\n",(0,o.jsx)(t.h2,{id:"motivations",children:"Motivations"}),"\n",(0,o.jsx)(t.p,{children:"Starting the development of a Discord bot follows most of the time the same pattern: you create a project, import your\nfavorite Discord client library, export a configuration file or an environment variable with the bot token, and design a\nwhole structure for your commands and your logic, before you can actually start to implement them. When working with\nJava, this structure is even more important otherwise you may adopt bad practices and end up with a bot that is\ndifficult to maintain."}),"\n",(0,o.jsx)(t.p,{children:"This is how came the idea of this project: have something that can handle for you all the initial workflow of setting up\na project with a solid structure, at the only cost of letting the framework choose some libraries for you, so that you\ncan focus on what matters. Botrino is born."}),"\n",(0,o.jsxs)(t.p,{children:["It also aims at providing a ",(0,o.jsx)(t.a,{href:"/docs/interaction-library/overview",children:"library for Discord's Interaction API"})," that integrates\nwell with the structure of Botrino, while still being decoupled from it."]}),"\n",(0,o.jsx)(t.h2,{id:"overview",children:"Overview"}),"\n",(0,o.jsxs)(t.p,{children:["Botrino utilizes Java modules, introduced in the JDK 9 and released in the JDK 11 as a LTS version. The classes of your\napplication will reside in one or more modules with the following ",(0,o.jsx)(t.code,{children:"module-info.java"})," structure:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-java",children:"import botrino.api.annotation.BotModule;\n\n@BotModule\nopen module com.example.myproject {\n\n requires botrino.api;\n}\n"})}),"\n",(0,o.jsxs)(t.p,{children:["The annotation as well as the ",(0,o.jsx)(t.code,{children:"open"})," modifier will allow Botrino to automatically scan through all the classes present\nin the module, in order to automatically register configuration entries, commands, services, etc."]}),"\n",(0,o.jsxs)(t.p,{children:["Inside your module, you can create services\nusing ",(0,o.jsx)(t.a,{href:"https://alex1304.github.io/rdi/docs/annotation-based-configuration",children:"RDI annotations"})," that are automatically\nloaded on startup:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-java",children:'package com.example.myproject;\n\nimport com.github.alex1304.rdi.finder.annotation.RdiFactory;\nimport com.github.alex1304.rdi.finder.annotation.RdiService;\nimport discord4j.core.GatewayDiscordClient;\nimport discord4j.core.event.domain.lifecycle.ReadyEvent;\nimport reactor.core.publisher.Mono;\nimport reactor.util.Logger;\nimport reactor.util.Loggers;\n\n@RdiService\npublic final class SampleService {\n\n private static final Logger LOGGER = Loggers.getLogger(SampleService.class);\n\n // We can inject other services, here we are injecting\n // the GatewayDiscordClient provided by Botrino\n @RdiFactory\n public SampleService(GatewayDiscordClient gateway) {\n gateway.on(ReadyEvent.class, ready -> Mono.fromRunnable(\n () -> LOGGER.info("Logged in as "\n + ready.getSelf().getTag())))\n .subscribe();\n }\n}\n\n'})}),"\n",(0,o.jsx)(t.p,{children:"The bot is configured via a JSON configuration file with contents similar to this:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-json",children:'{\n "bot": {\n "token": "yourTokenHere",\n "presence": {\n "status": "online",\n "activity_type": "playing",\n "activity_text": "Hello world!"\n },\n "enabled_intents": 32509\n }\n}\n'})}),"\n",(0,o.jsxs)(t.p,{children:["To go further and familiarize yourself with the framework, check out the ",(0,o.jsx)(t.a,{href:"/docs/getting-started",children:"Getting Started guide"}),"."]})]})}function u(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(h,{...e})}):h(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>a,x:()=>s});var o=n(6540);const i={},r=o.createContext(i);function a(e){const t=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),o.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/main.8495c6d8.js b/assets/js/main.8495c6d8.js new file mode 100644 index 0000000..1a499a8 --- /dev/null +++ b/assets/js/main.8495c6d8.js @@ -0,0 +1,2 @@ +/*! For license information please see main.8495c6d8.js.LICENSE.txt */ +(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[792],{8328:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});n(6540);var r=n(3259),a=n.n(r),o=n(4054);const i={"0bf034db":[()=>n.e(340).then(n.bind(n,6408)),"@site/docs/api/configuring-your-bot.mdx",6408],17896441:[()=>Promise.all([n.e(869),n.e(401)]).then(n.bind(n,4313)),"@theme/DocItem",4313],"2463bfee":[()=>n.e(510).then(n.bind(n,533)),"@site/docs/interaction-library/creating-commands.mdx",533],"3021cf83":[()=>Promise.all([n.e(869),n.e(857)]).then(n.bind(n,6942)),"@site/docs/getting-started.mdx",6942],"373758dc":[()=>n.e(603).then(n.bind(n,9720)),"@site/docs/api/working-with-services.mdx",9720],"421473c5":[()=>n.e(812).then(n.bind(n,1877)),"@site/docs/interaction-library/dealing-with-components.mdx",1877],"4a782de2":[()=>n.e(884).then(n.bind(n,7540)),"@site/docs/interaction-library/acknowledging-interactions.mdx",7540],"518c7f92":[()=>Promise.all([n.e(869),n.e(968)]).then(n.bind(n,6884)),"@site/docs/interaction-library/overview.mdx",6884],"576b222c":[()=>n.e(450).then(n.bind(n,8814)),"@site/docs/interaction-library/filtering-and-adapting-events.mdx",8814],"5e95c892":[()=>n.e(647).then(n.bind(n,7121)),"@theme/DocsRoot",7121],"5e9f5e1a":[()=>Promise.resolve().then(n.bind(n,4784)),"@generated/docusaurus.config",4784],"62eacfe5":[()=>n.e(476).then(n.bind(n,4203)),"@site/docs/api/i18n.mdx",4203],"6ea2c7a4":[()=>n.e(36).then(n.bind(n,7676)),"@site/docs/interaction-library/handling-errors.mdx",7676],"7c110bd0":[()=>n.e(877).then(n.t.bind(n,2614,19)),"@generated/docusaurus-plugin-content-docs/default/p/docs-b5f.json",2614],"9187e980":[()=>n.e(608).then(n.bind(n,2488)),"@site/docs/api/customizing-the-discord-client.mdx",2488],a7456010:[()=>n.e(235).then(n.t.bind(n,8552,19)),"@generated/docusaurus-plugin-content-pages/default/__plugin.json",8552],a7bd4aaa:[()=>n.e(98).then(n.bind(n,4532)),"@theme/DocVersionRoot",4532],a94703ab:[()=>Promise.all([n.e(869),n.e(48)]).then(n.bind(n,2559)),"@theme/DocRoot",2559],aba21aa0:[()=>n.e(742).then(n.t.bind(n,7093,19)),"@generated/docusaurus-plugin-content-docs/default/__plugin.json",7093],ac3a7c63:[()=>n.e(756).then(n.bind(n,5329)),"@site/docs/api/extensions.mdx",5329],b81faf1d:[()=>n.e(386).then(n.bind(n,7699)),"@site/docs/interaction-library/configuration.mdx",7699],b96361c1:[()=>n.e(534).then(n.bind(n,1741)),"@site/docs/interaction-library/privileges.mdx",1741],c4f5d8e4:[()=>Promise.all([n.e(869),n.e(634)]).then(n.bind(n,4267)),"@site/src/pages/index.js",4267],ddcb1508:[()=>n.e(902).then(n.bind(n,8867)),"@site/docs/interaction-library/cooldowns.mdx",8867],f8409a7e:[()=>n.e(903).then(n.bind(n,4304)),"@site/docs/intro.mdx",4304]};var l=n(4848);function s(e){let{error:t,retry:n,pastDelay:r}=e;return t?(0,l.jsxs)("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%"},children:[(0,l.jsx)("p",{children:String(t)}),(0,l.jsx)("div",{children:(0,l.jsx)("button",{type:"button",onClick:n,children:"Retry"})})]}):r?(0,l.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:(0,l.jsx)("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",children:(0,l.jsxs)("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1)",strokeWidth:"2",children:[(0,l.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,l.jsx)("animate",{attributeName:"r",begin:"1.5s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-opacity",begin:"1.5s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-width",begin:"1.5s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,l.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,l.jsx)("animate",{attributeName:"r",begin:"3s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-opacity",begin:"3s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-width",begin:"3s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,l.jsx)("circle",{cx:"22",cy:"22",r:"8",children:(0,l.jsx)("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"6;1;2;3;4;5;6",calcMode:"linear",repeatCount:"indefinite"})})]})})}):null}var u=n(6921),c=n(3102);function d(e,t){if("*"===e)return a()({loading:s,loader:()=>n.e(237).then(n.bind(n,2237)),modules:["@theme/NotFound"],webpack:()=>[2237],render(e,t){const n=e.default;return(0,l.jsx)(c.W,{value:{plugin:{name:"native",id:"default"}},children:(0,l.jsx)(n,{...t})})}});const r=o[`${e}-${t}`],d={},f=[],p=[],g=(0,u.A)(r);return Object.entries(g).forEach((e=>{let[t,n]=e;const r=i[n];r&&(d[t]=r[0],f.push(r[1]),p.push(r[2]))})),a().Map({loading:s,loader:d,modules:f,webpack:()=>p,render(t,n){const a=JSON.parse(JSON.stringify(r));Object.entries(t).forEach((t=>{let[n,r]=t;const o=r.default;if(!o)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 o&&"function"!=typeof o||Object.keys(r).filter((e=>"default"!==e)).forEach((e=>{o[e]=r[e]}));let i=a;const l=n.split(".");l.slice(0,-1).forEach((e=>{i=i[e]})),i[l[l.length-1]]=o}));const o=a.__comp;delete a.__comp;const i=a.__context;delete a.__context;const s=a.__props;return delete a.__props,(0,l.jsx)(c.W,{value:i,children:(0,l.jsx)(o,{...a,...s,...n})})}})}const f=[{path:"/docs",component:d("/docs","587"),routes:[{path:"/docs",component:d("/docs","9d1"),routes:[{path:"/docs",component:d("/docs","55d"),routes:[{path:"/docs/",component:d("/docs/","5c4"),exact:!0,sidebar:"someSidebar"},{path:"/docs/api/configuring-your-bot",component:d("/docs/api/configuring-your-bot","290"),exact:!0,sidebar:"someSidebar"},{path:"/docs/api/customizing-the-discord-client",component:d("/docs/api/customizing-the-discord-client","641"),exact:!0,sidebar:"someSidebar"},{path:"/docs/api/extensions",component:d("/docs/api/extensions","205"),exact:!0,sidebar:"someSidebar"},{path:"/docs/api/i18n",component:d("/docs/api/i18n","e20"),exact:!0,sidebar:"someSidebar"},{path:"/docs/api/working-with-services",component:d("/docs/api/working-with-services","c21"),exact:!0,sidebar:"someSidebar"},{path:"/docs/getting-started",component:d("/docs/getting-started","05e"),exact:!0,sidebar:"someSidebar"},{path:"/docs/interaction-library/acknowledging-interactions",component:d("/docs/interaction-library/acknowledging-interactions","2b8"),exact:!0,sidebar:"someSidebar"},{path:"/docs/interaction-library/configuration",component:d("/docs/interaction-library/configuration","6f0"),exact:!0,sidebar:"someSidebar"},{path:"/docs/interaction-library/cooldowns",component:d("/docs/interaction-library/cooldowns","496"),exact:!0,sidebar:"someSidebar"},{path:"/docs/interaction-library/creating-commands",component:d("/docs/interaction-library/creating-commands","181"),exact:!0,sidebar:"someSidebar"},{path:"/docs/interaction-library/dealing-with-components",component:d("/docs/interaction-library/dealing-with-components","208"),exact:!0,sidebar:"someSidebar"},{path:"/docs/interaction-library/filtering-and-adapting-events",component:d("/docs/interaction-library/filtering-and-adapting-events","f7b"),exact:!0,sidebar:"someSidebar"},{path:"/docs/interaction-library/handling-errors",component:d("/docs/interaction-library/handling-errors","6f0"),exact:!0,sidebar:"someSidebar"},{path:"/docs/interaction-library/overview",component:d("/docs/interaction-library/overview","4c1"),exact:!0,sidebar:"someSidebar"},{path:"/docs/interaction-library/privileges",component:d("/docs/interaction-library/privileges","919"),exact:!0,sidebar:"someSidebar"}]}]}]},{path:"/",component:d("/","2e1"),exact:!0},{path:"*",component:d("*")}]},6125:(e,t,n)=>{"use strict";n.d(t,{o:()=>o,x:()=>i});var r=n(6540),a=n(4848);const o=r.createContext(!1);function i(e){let{children:t}=e;const[n,i]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{i(!0)}),[]),(0,a.jsx)(o.Provider,{value:n,children:t})}},8536:(e,t,n)=>{"use strict";var r=n(6540),a=n(5338),o=n(4625),i=n(545),l=n(8193);const s=[n(7651),n(1911),n(119),n(6134),n(6294),n(1043)];var u=n(8328),c=n(6347),d=n(2831),f=n(4848);function p(e){let{children:t}=e;return(0,f.jsx)(f.Fragment,{children:t})}var g=n(5260),h=n(4586),m=n(6025),y=n(6342),b=n(1003),v=n(2131),w=n(4090),k=n(2967),x=n(440),S=n(1463);function E(){const{i18n:{currentLocale:e,defaultLocale:t,localeConfigs:n}}=(0,h.A)(),r=(0,v.o)(),a=n[e].htmlLang,o=e=>e.replace("-","_");return(0,f.jsxs)(g.A,{children:[Object.entries(n).map((e=>{let[t,{htmlLang:n}]=e;return(0,f.jsx)("link",{rel:"alternate",href:r.createUrl({locale:t,fullyQualified:!0}),hrefLang:n},t)})),(0,f.jsx)("link",{rel:"alternate",href:r.createUrl({locale:t,fullyQualified:!0}),hrefLang:"x-default"}),(0,f.jsx)("meta",{property:"og:locale",content:o(a)}),Object.values(n).filter((e=>a!==e.htmlLang)).map((e=>(0,f.jsx)("meta",{property:"og:locale:alternate",content:o(e.htmlLang)},`meta-og-${e.htmlLang}`)))]})}function _(e){let{permalink:t}=e;const{siteConfig:{url:n}}=(0,h.A)(),r=function(){const{siteConfig:{url:e,baseUrl:t,trailingSlash:n}}=(0,h.A)(),{pathname:r}=(0,c.zy)();return e+(0,x.applyTrailingSlash)((0,m.A)(r),{trailingSlash:n,baseUrl:t})}(),a=t?`${n}${t}`:r;return(0,f.jsxs)(g.A,{children:[(0,f.jsx)("meta",{property:"og:url",content:a}),(0,f.jsx)("link",{rel:"canonical",href:a})]})}function C(){const{i18n:{currentLocale:e}}=(0,h.A)(),{metadata:t,image:n}=(0,y.p)();return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(g.A,{children:[(0,f.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,f.jsx)("body",{className:w.w})]}),n&&(0,f.jsx)(b.be,{image:n}),(0,f.jsx)(_,{}),(0,f.jsx)(E,{}),(0,f.jsx)(S.A,{tag:k.Cy,locale:e}),(0,f.jsx)(g.A,{children:t.map(((e,t)=>(0,f.jsx)("meta",{...e},t)))})]})}const A=new Map;var T=n(6125),N=n(6988),j=n(205);function L(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 P=function(e){let{children:t,location:n,previousLocation:r}=e;return(0,j.A)((()=>{r!==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:r}),L("onRouteDidUpdate",{previousLocation:r,location:n}))}),[r,n]),t};function O(e){const t=Array.from(new Set([e,decodeURI(e)])).map((e=>(0,d.u)(u.A,e))).flat();return Promise.all(t.map((e=>e.route.component.preload?.())))}class R extends r.Component{previousLocation;routeUpdateCleanupCb;constructor(e){super(e),this.previousLocation=null,this.routeUpdateCleanupCb=l.A.canUseDOM?L("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=L("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(0,f.jsx)(P,{previousLocation:this.previousLocation,location:t,children:(0,f.jsx)(c.qh,{location:t,render:()=>e})})}}const I=R,F="__docusaurus-base-url-issue-banner-container",M="__docusaurus-base-url-issue-banner",D="__docusaurus-base-url-issue-banner-suggestion-container";function z(e){return`\ndocument.addEventListener('DOMContentLoaded', function maybeInsertBanner() {\n var shouldInsert = typeof window['docusaurus'] === 'undefined';\n shouldInsert && insertBanner();\n});\n\nfunction insertBanner() {\n var bannerContainer = document.createElement('div');\n bannerContainer.id = '${F}';\n var bannerHtml = ${JSON.stringify(function(e){return`\n<div id="${M}" 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="${D}" style="font-weight: bold; color: green;"></span></p>\n</div>\n`}(e)).replace(/</g,"\\<")};\n bannerContainer.innerHTML = bannerHtml;\n document.body.prepend(bannerContainer);\n var suggestionContainer = document.getElementById('${D}');\n var actualHomePagePath = window.location.pathname;\n var suggestedBaseUrl = actualHomePagePath.substr(-1) === '/'\n ? actualHomePagePath\n : actualHomePagePath + '/';\n suggestionContainer.innerHTML = suggestedBaseUrl;\n}\n`}function B(){const{siteConfig:{baseUrl:e}}=(0,h.A)();return(0,f.jsx)(f.Fragment,{children:!l.A.canUseDOM&&(0,f.jsx)(g.A,{children:(0,f.jsx)("script",{children:z(e)})})})}function $(){const{siteConfig:{baseUrl:e,baseUrlIssueBanner:t}}=(0,h.A)(),{pathname:n}=(0,c.zy)();return t&&n===e?(0,f.jsx)(B,{}):null}function U(){const{siteConfig:{favicon:e,title:t,noIndex:n},i18n:{currentLocale:r,localeConfigs:a}}=(0,h.A)(),o=(0,m.A)(e),{htmlLang:i,direction:l}=a[r];return(0,f.jsxs)(g.A,{children:[(0,f.jsx)("html",{lang:i,dir:l}),(0,f.jsx)("title",{children:t}),(0,f.jsx)("meta",{property:"og:title",content:t}),(0,f.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0"}),n&&(0,f.jsx)("meta",{name:"robots",content:"noindex, nofollow"}),e&&(0,f.jsx)("link",{rel:"icon",href:o})]})}var H=n(7489),V=n(2303);function W(){const e=(0,V.A)();return(0,f.jsx)(g.A,{children:(0,f.jsx)("html",{"data-has-hydrated":e})})}const q=(0,d.v)(u.A);function G(){const e=function(e){if(A.has(e.pathname))return{...e,pathname:A.get(e.pathname)};if((0,d.u)(u.A,e.pathname).some((e=>{let{route:t}=e;return!0===t.exact})))return A.set(e.pathname,e.pathname),e;const t=e.pathname.trim().replace(/(?:\/index)?\.html$/,"")||"/";return A.set(e.pathname,t),{...e,pathname:t}}((0,c.zy)());return(0,f.jsx)(I,{location:e,children:q})}function Y(){return(0,f.jsx)(H.A,{children:(0,f.jsx)(N.l,{children:(0,f.jsxs)(T.x,{children:[(0,f.jsxs)(p,{children:[(0,f.jsx)(U,{}),(0,f.jsx)(C,{}),(0,f.jsx)($,{}),(0,f.jsx)(G,{})]}),(0,f.jsx)(W,{})]})})})}var Q=n(4054);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 Z=n(6921);const X=new Set,J=new Set,ee=()=>navigator.connection?.effectiveType.includes("2g")||navigator.connection?.saveData,te={prefetch:e=>{if(!(e=>!ee()&&!J.has(e)&&!X.has(e))(e))return!1;X.add(e);const t=(0,d.u)(u.A,e).flatMap((e=>{return t=e.route.path,Object.entries(Q).filter((e=>{let[n]=e;return n.replace(/-[^-]+$/,"")===t})).flatMap((e=>{let[,t]=e;return Object.values((0,Z.A)(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=>!ee()&&!J.has(e))(e)&&(J.add(e),O(e))},ne=Object.freeze(te),re=Boolean(!0);if(l.A.canUseDOM){window.docusaurus=ne;const e=document.getElementById("__docusaurus"),t=(0,f.jsx)(i.vd,{children:(0,f.jsx)(o.Kd,{children:(0,f.jsx)(Y,{})})}),n=(e,t)=>{console.error("Docusaurus React Root onRecoverableError:",e,t)},l=()=>{if(window.docusaurusRoot)window.docusaurusRoot.render(t);else if(re)window.docusaurusRoot=a.hydrateRoot(e,t,{onRecoverableError:n});else{const r=a.createRoot(e,{onRecoverableError:n});r.render(t),window.docusaurusRoot=r}};O(window.location.pathname).then((()=>{(0,r.startTransition)(l)}))}},6988:(e,t,n)=>{"use strict";n.d(t,{o:()=>d,l:()=>f});var r=n(6540),a=n(4784);const o=JSON.parse('{"docusaurus-plugin-content-docs":{"default":{"path":"/docs","versions":[{"name":"current","label":"Next","isLast":true,"path":"/docs","mainDocId":"intro","docs":[{"id":"api/configuring-your-bot","path":"/docs/api/configuring-your-bot","sidebar":"someSidebar"},{"id":"api/customizing-the-discord-client","path":"/docs/api/customizing-the-discord-client","sidebar":"someSidebar"},{"id":"api/extensions","path":"/docs/api/extensions","sidebar":"someSidebar"},{"id":"api/i18n","path":"/docs/api/i18n","sidebar":"someSidebar"},{"id":"api/working-with-services","path":"/docs/api/working-with-services","sidebar":"someSidebar"},{"id":"getting-started","path":"/docs/getting-started","sidebar":"someSidebar"},{"id":"interaction-library/acknowledging-interactions","path":"/docs/interaction-library/acknowledging-interactions","sidebar":"someSidebar"},{"id":"interaction-library/configuration","path":"/docs/interaction-library/configuration","sidebar":"someSidebar"},{"id":"interaction-library/cooldowns","path":"/docs/interaction-library/cooldowns","sidebar":"someSidebar"},{"id":"interaction-library/creating-commands","path":"/docs/interaction-library/creating-commands","sidebar":"someSidebar"},{"id":"interaction-library/dealing-with-components","path":"/docs/interaction-library/dealing-with-components","sidebar":"someSidebar"},{"id":"interaction-library/filtering-and-adapting-events","path":"/docs/interaction-library/filtering-and-adapting-events","sidebar":"someSidebar"},{"id":"interaction-library/handling-errors","path":"/docs/interaction-library/handling-errors","sidebar":"someSidebar"},{"id":"interaction-library/overview","path":"/docs/interaction-library/overview","sidebar":"someSidebar"},{"id":"interaction-library/privileges","path":"/docs/interaction-library/privileges","sidebar":"someSidebar"},{"id":"intro","path":"/docs/","sidebar":"someSidebar"}],"draftIds":[],"sidebars":{"someSidebar":{"link":{"path":"/docs/","label":"intro"}}}}],"breadcrumbs":true}},"docusaurus-plugin-google-gtag":{"default":{"trackingID":["G-45YBPVQ8K9"],"anonymizeIP":false,"id":"default"}}}'),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(2654);const s=JSON.parse('{"docusaurusVersion":"3.3.2","siteVersion":"0.0.0","pluginVersions":{"docusaurus-plugin-content-docs":{"type":"package","name":"@docusaurus/plugin-content-docs","version":"3.3.2"},"docusaurus-plugin-content-blog":{"type":"package","name":"@docusaurus/plugin-content-blog","version":"3.3.2"},"docusaurus-plugin-content-pages":{"type":"package","name":"@docusaurus/plugin-content-pages","version":"3.3.2"},"docusaurus-plugin-google-analytics":{"type":"package","name":"@docusaurus/plugin-google-analytics","version":"3.3.2"},"docusaurus-plugin-google-gtag":{"type":"package","name":"@docusaurus/plugin-google-gtag","version":"3.3.2"},"docusaurus-plugin-sitemap":{"type":"package","name":"@docusaurus/plugin-sitemap","version":"3.3.2"},"docusaurus-theme-classic":{"type":"package","name":"@docusaurus/theme-classic","version":"3.3.2"}}}');var u=n(4848);const c={siteConfig:a.default,siteMetadata:s,globalData:o,i18n:i,codeTranslations:l},d=r.createContext(c);function f(e){let{children:t}=e;return(0,u.jsx)(d.Provider,{value:c,children:t})}},7489:(e,t,n)=>{"use strict";n.d(t,{A:()=>h});var r=n(6540),a=n(8193),o=n(5260),i=n(440),l=n(781),s=n(3102),u=n(4848);function c(e){let{error:t,tryAgain:n}=e;return(0,u.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",minHeight:"100vh",width:"100%",maxWidth:"80ch",fontSize:"20px",margin:"0 auto",padding:"1rem"},children:[(0,u.jsx)("h1",{style:{fontSize:"3rem"},children:"This page crashed"}),(0,u.jsx)("button",{type:"button",onClick:n,style:{margin:"1rem 0",fontSize:"2rem",cursor:"pointer",borderRadius:20,padding:"1rem"},children:"Try again"}),(0,u.jsx)(d,{error:t})]})}function d(e){let{error:t}=e;const n=(0,i.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return(0,u.jsx)("p",{style:{whiteSpace:"pre-wrap"},children:n})}function f(e){let{children:t}=e;return(0,u.jsx)(s.W,{value:{plugin:{name:"docusaurus-core-error-boundary",id:"default"}},children:t})}function p(e){let{error:t,tryAgain:n}=e;return(0,u.jsx)(f,{children:(0,u.jsxs)(h,{fallback:()=>(0,u.jsx)(c,{error:t,tryAgain:n}),children:[(0,u.jsx)(o.A,{children:(0,u.jsx)("title",{children:"Page Error"})}),(0,u.jsx)(l.A,{children:(0,u.jsx)(c,{error:t,tryAgain:n})})]})})}const g=e=>(0,u.jsx)(p,{...e});class h extends r.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){a.A.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??g)(e)}return e??null}}},8193:(e,t,n)=>{"use strict";n.d(t,{A:()=>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}},5260:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});n(6540);var r=n(545),a=n(4848);function o(e){return(0,a.jsx)(r.mg,{...e})}},8774:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var r=n(6540),a=n(4625),o=n(440),i=n(4586),l=n(6654),s=n(8193),u=n(3427),c=n(6025),d=n(4848);function f(e,t){let{isNavLink:n,to:f,href:p,activeClassName:g,isActive:h,"data-noBrokenLinkCheck":m,autoAddBaseUrl:y=!0,...b}=e;const{siteConfig:{trailingSlash:v,baseUrl:w}}=(0,i.A)(),{withBaseUrl:k}=(0,c.h)(),x=(0,u.A)(),S=(0,r.useRef)(null);(0,r.useImperativeHandle)(t,(()=>S.current));const E=f||p;const _=(0,l.A)(E),C=E?.replace("pathname://","");let A=void 0!==C?(T=C,y&&(e=>e.startsWith("/"))(T)?k(T):T):void 0;var T;A&&_&&(A=(0,o.applyTrailingSlash)(A,{trailingSlash:v,baseUrl:w}));const N=(0,r.useRef)(!1),j=n?a.k2:a.N_,L=s.A.canUseIntersectionObserver,P=(0,r.useRef)(),O=()=>{N.current||null==A||(window.docusaurus.preload(A),N.current=!0)};(0,r.useEffect)((()=>(!L&&_&&null!=A&&window.docusaurus.prefetch(A),()=>{L&&P.current&&P.current.disconnect()})),[P,A,L,_]);const R=A?.startsWith("#")??!1,I=!b.target||"_self"===b.target,F=!A||!_||!I||R;return m||!R&&F||x.collectLink(A),b.id&&x.collectAnchor(b.id),F?(0,d.jsx)("a",{ref:S,href:A,...E&&!_&&{target:"_blank",rel:"noopener noreferrer"},...b}):(0,d.jsx)(j,{...b,onMouseEnter:O,onTouchStart:O,innerRef:e=>{S.current=e,L&&e&&_&&(P.current=new window.IntersectionObserver((t=>{t.forEach((t=>{e===t.target&&(t.isIntersecting||t.intersectionRatio>0)&&(P.current.unobserve(e),P.current.disconnect(),null!=A&&window.docusaurus.prefetch(A))}))})),P.current.observe(e))},to:A,...n&&{isActive:h,activeClassName:g}})}const p=r.forwardRef(f)},418:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=()=>null},1312:(e,t,n)=>{"use strict";n.d(t,{A:()=>u,T:()=>s});var r=n(6540),a=n(4848);function o(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 i=n(2654);function l(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 i[t??n]??n??t}function s(e,t){let{message:n,id:r}=e;return o(l({message:n,id:r}),t)}function u(e){let{children:t,id:n,values:r}=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 i=l({message:t,id:n});return(0,a.jsx)(a.Fragment,{children:o(i,r)})}},7065:(e,t,n)=>{"use strict";n.d(t,{W:()=>r});const r="default"},6654:(e,t,n)=>{"use strict";function r(e){return/^(?:\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,{A:()=>a,z:()=>r})},6025:(e,t,n)=>{"use strict";n.d(t,{A:()=>l,h:()=>i});var r=n(6540),a=n(4586),o=n(6654);function i(){const{siteConfig:{baseUrl:e,url:t}}=(0,a.A)(),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.z)(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)}},3427:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(6540);n(4848);const a=r.createContext({collectAnchor:()=>{},collectLink:()=>{}}),o=()=>(0,r.useContext)(a);function i(){return o()}},4586:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(6540),a=n(6988);function o(){return(0,r.useContext)(a.o)}},2303:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(6540),a=n(6125);function o(){return(0,r.useContext)(a.o)}},205:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(6540);const a=n(8193).A.canUseDOM?r.useLayoutEffect:r.useEffect},6921:(e,t,n)=>{"use strict";n.d(t,{A:()=>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}},3102:(e,t,n)=>{"use strict";n.d(t,{W:()=>i,o:()=>o});var r=n(6540),a=n(4848);const o=r.createContext(null);function i(e){let{children:t,value:n}=e;const i=r.useContext(o),l=(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:i,value:n})),[i,n]);return(0,a.jsx)(o.Provider,{value:l,children:t})}},4070:(e,t,n)=>{"use strict";n.d(t,{zK:()=>h,vT:()=>f,Gy:()=>c,HW:()=>m,ht:()=>d,r7:()=>g,jh:()=>p});var r=n(6347),a=n(4586),o=n(7065);function i(e,t){void 0===t&&(t={});const n=function(){const{globalData:e}=(0,a.A)();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=function(e,t){const n=l(e);return[...e.versions.filter((e=>e!==n)),n].find((e=>!!(0,r.B6)(t,{path:e.path,exact:!1,strict:!1})))}(e,t),a=n?.docs.find((e=>!!(0,r.B6)(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={},c=()=>i("docusaurus-plugin-content-docs")??u,d=e=>{try{return function(e,t,n){void 0===t&&(t=o.W),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})}catch(t){throw new Error("You are using a feature of the Docusaurus docs plugin, but this plugin does not seem to be enabled"+("Default"===e?"":` (pluginId=${e}`),{cause:t})}};function f(e){void 0===e&&(e={});const t=c(),{pathname:n}=(0,r.zy)();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.B6)(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 p(e){return d(e).versions}function g(e){const t=d(e);return l(t)}function h(e){const t=d(e),{pathname:n}=(0,r.zy)();return s(t,n)}function m(e){const t=d(e),{pathname:n}=(0,r.zy)();return function(e,t){const n=l(e);return{latestDocSuggestion:s(e,t).alternateDocVersions[n.name],latestVersionSuggestion:n}}(t,n)}},7651:(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"))}}},1911:(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||setTimeout((()=>{window.gtag("set","page_path",t.pathname+t.search+t.hash),window.gtag("event","page_view")}))}}},6294:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var r=n(5947),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()}}},6134:(e,t,n)=>{"use strict";n.r(t);var r=n(8181),a=n(4784);!function(e){const{themeConfig:{prism:t}}=a.default,{additionalLanguages:r}=t;globalThis.Prism=e,r.forEach((e=>{"php"===e&&n(9700),n(5089)(`./prism-${e}`)})),delete globalThis.Prism}(r.My)},1107:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});n(6540);var r=n(8215),a=n(1312),o=n(6342),i=n(8774),l=n(3427);const s={anchorWithStickyNavbar:"anchorWithStickyNavbar_LWe7",anchorWithHideOnScrollNavbar:"anchorWithHideOnScrollNavbar_WYt5"};var u=n(4848);function c(e){let{as:t,id:n,...c}=e;const d=(0,l.A)(),{navbar:{hideOnScroll:f}}=(0,o.p)();if("h1"===t||!n)return(0,u.jsx)(t,{...c,id:void 0});d.collectAnchor(n);const p=(0,a.T)({id:"theme.common.headingLinkTitle",message:"Direct link to {heading}",description:"Title for link to heading"},{heading:"string"==typeof c.children?c.children:n});return(0,u.jsxs)(t,{...c,className:(0,r.A)("anchor",f?s.anchorWithHideOnScrollNavbar:s.anchorWithStickyNavbar,c.className),id:n,children:[c.children,(0,u.jsx)(i.A,{className:"hash-link",to:`#${n}`,"aria-label":p,title:p,children:"\u200b"})]})}},3186:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});n(6540);const r={iconExternalLink:"iconExternalLink_nPIU"};var a=n(4848);function o(e){let{width:t=13.5,height:n=13.5}=e;return(0,a.jsx)("svg",{width:t,height:n,"aria-hidden":"true",viewBox:"0 0 24 24",className:r.iconExternalLink,children:(0,a.jsx)("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"})})}},781:(e,t,n)=>{"use strict";n.d(t,{A:()=>pt});var r=n(6540),a=n(8215),o=n(7489),i=n(1003),l=n(6347),s=n(1312),u=n(5062),c=n(4848);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,l.W6)(),n=(0,r.useCallback)((e=>{e.preventDefault();const t=document.querySelector("main:first-of-type")??document.getElementById(d);t&&f(t)}),[]);return(0,u.$)((n=>{let{location:r}=n;e.current&&!r.hash&&"PUSH"===t&&f(e.current)})),{containerRef:e,onClick:n}}const g=(0,s.T)({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??g,{containerRef:n,onClick:r}=p();return(0,c.jsx)("div",{ref:n,role:"region","aria-label":g,children:(0,c.jsx)("a",{...e,href:`#${d}`,onClick:r,children:t})})}var m=n(7559),y=n(4090);const b={skipToContent:"skipToContent_fXgn"};function v(){return(0,c.jsx)(h,{className:b.skipToContent})}var w=n(6342),k=n(5041);function x(e){let{width:t=21,height:n=21,color:r="currentColor",strokeWidth:a=1.2,className:o,...i}=e;return(0,c.jsx)("svg",{viewBox:"0 0 15 15",width:t,height:n,...i,children:(0,c.jsx)("g",{stroke:r,strokeWidth:a,children:(0,c.jsx)("path",{d:"M.75.75l13.5 13.5M14.25.75L.75 14.25"})})})}const S={closeButton:"closeButton_CVFx"};function E(e){return(0,c.jsx)("button",{type:"button","aria-label":(0,s.T)({id:"theme.AnnouncementBar.closeButtonAriaLabel",message:"Close",description:"The ARIA label for close button of announcement bar"}),...e,className:(0,a.A)("clean-btn close",S.closeButton,e.className),children:(0,c.jsx)(x,{width:14,height:14,strokeWidth:3.1})})}const _={content:"content_knG7"};function C(e){const{announcementBar:t}=(0,w.p)(),{content:n}=t;return(0,c.jsx)("div",{...e,className:(0,a.A)(_.content,e.className),dangerouslySetInnerHTML:{__html:n}})}const A={announcementBar:"announcementBar_mb4j",announcementBarPlaceholder:"announcementBarPlaceholder_vyr4",announcementBarClose:"announcementBarClose_gvF7",announcementBarContent:"announcementBarContent_xLdY"};function T(){const{announcementBar:e}=(0,w.p)(),{isActive:t,close:n}=(0,k.Mj)();if(!t)return null;const{backgroundColor:r,textColor:a,isCloseable:o}=e;return(0,c.jsxs)("div",{className:A.announcementBar,style:{backgroundColor:r,color:a},role:"banner",children:[o&&(0,c.jsx)("div",{className:A.announcementBarPlaceholder}),(0,c.jsx)(C,{className:A.announcementBarContent}),o&&(0,c.jsx)(E,{onClick:n,className:A.announcementBarClose})]})}var N=n(2069),j=n(3104);var L=n(9532),P=n(5600);const O=r.createContext(null);function R(e){let{children:t}=e;const n=function(){const e=(0,N.M)(),t=(0,P.YL)(),[n,a]=(0,r.useState)(!1),o=null!==t.component,i=(0,L.ZC)(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(0,c.jsx)(O.Provider,{value:n,children:t})}function I(e){if(e.component){const t=e.component;return(0,c.jsx)(t,{...e.props})}}function F(){const e=(0,r.useContext)(O);if(!e)throw new L.dV("NavbarSecondaryMenuDisplayProvider");const[t,n]=e,a=(0,r.useCallback)((()=>n(!1)),[n]),o=(0,P.YL)();return(0,r.useMemo)((()=>({shown:t,hide:a,content:I(o)})),[a,o,t])}function M(e){let{header:t,primaryMenu:n,secondaryMenu:r}=e;const{shown:o}=F();return(0,c.jsxs)("div",{className:"navbar-sidebar",children:[t,(0,c.jsxs)("div",{className:(0,a.A)("navbar-sidebar__items",{"navbar-sidebar__items--show-secondary":o}),children:[(0,c.jsx)("div",{className:"navbar-sidebar__item menu",children:n}),(0,c.jsx)("div",{className:"navbar-sidebar__item menu",children:r})]})]})}var D=n(5293),z=n(2303);function B(e){return(0,c.jsx)("svg",{viewBox:"0 0 24 24",width:24,height:24,...e,children:(0,c.jsx)("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 $(e){return(0,c.jsx)("svg",{viewBox:"0 0 24 24",width:24,height:24,...e,children:(0,c.jsx)("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 U={toggle:"toggle_vylO",toggleButton:"toggleButton_gllP",darkToggleIcon:"darkToggleIcon_wfgR",lightToggleIcon:"lightToggleIcon_pyhR",toggleButtonDisabled:"toggleButtonDisabled_aARS"};function H(e){let{className:t,buttonClassName:n,value:r,onChange:o}=e;const i=(0,z.A)(),l=(0,s.T)({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"===r?(0,s.T)({message:"dark mode",id:"theme.colorToggle.ariaLabel.mode.dark",description:"The name for the dark color mode"}):(0,s.T)({message:"light mode",id:"theme.colorToggle.ariaLabel.mode.light",description:"The name for the light color mode"})});return(0,c.jsx)("div",{className:(0,a.A)(U.toggle,t),children:(0,c.jsxs)("button",{className:(0,a.A)("clean-btn",U.toggleButton,!i&&U.toggleButtonDisabled,n),type:"button",onClick:()=>o("dark"===r?"light":"dark"),disabled:!i,title:l,"aria-label":l,"aria-live":"polite",children:[(0,c.jsx)(B,{className:(0,a.A)(U.toggleIcon,U.lightToggleIcon)}),(0,c.jsx)($,{className:(0,a.A)(U.toggleIcon,U.darkToggleIcon)})]})})}const V=r.memo(H),W={darkNavbarColorModeToggle:"darkNavbarColorModeToggle_X3D1"};function q(e){let{className:t}=e;const n=(0,w.p)().navbar.style,r=(0,w.p)().colorMode.disableSwitch,{colorMode:a,setColorMode:o}=(0,D.G)();return r?null:(0,c.jsx)(V,{className:t,buttonClassName:"dark"===n?W.darkNavbarColorModeToggle:void 0,value:a,onChange:o})}var G=n(3465);function Y(){return(0,c.jsx)(G.A,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:"navbar__title text--truncate"})}function Q(){const e=(0,N.M)();return(0,c.jsx)("button",{type:"button","aria-label":(0,s.T)({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(),children:(0,c.jsx)(x,{color:"var(--ifm-color-emphasis-600)"})})}function K(){return(0,c.jsxs)("div",{className:"navbar-sidebar__brand",children:[(0,c.jsx)(Y,{}),(0,c.jsx)(q,{className:"margin-right--md"}),(0,c.jsx)(Q,{})]})}var Z=n(8774),X=n(6025),J=n(6654);function ee(e,t){return void 0!==e&&void 0!==t&&new RegExp(e,"gi").test(t)}var te=n(3186);function ne(e){let{activeBasePath:t,activeBaseRegex:n,to:r,href:a,label:o,html:i,isDropdownLink:l,prependBaseUrlToHref:s,...u}=e;const d=(0,X.A)(r),f=(0,X.A)(t),p=(0,X.A)(a,{forcePrependBaseUrl:!0}),g=o&&a&&!(0,J.A)(a),h=i?{dangerouslySetInnerHTML:{__html:i}}:{children:(0,c.jsxs)(c.Fragment,{children:[o,g&&(0,c.jsx)(te.A,{...l&&{width:12,height:12}})]})};return a?(0,c.jsx)(Z.A,{href:s?p:a,...u,...h}):(0,c.jsx)(Z.A,{to:d,isNavLink:!0,...(t||n)&&{isActive:(e,t)=>n?ee(n,t.pathname):t.pathname.startsWith(f)},...u,...h})}function re(e){let{className:t,isDropdownItem:n=!1,...r}=e;const o=(0,c.jsx)(ne,{className:(0,a.A)(n?"dropdown__link":"navbar__item navbar__link",t),isDropdownLink:n,...r});return n?(0,c.jsx)("li",{children:o}):o}function ae(e){let{className:t,isDropdownItem:n,...r}=e;return(0,c.jsx)("li",{className:"menu__list-item",children:(0,c.jsx)(ne,{className:(0,a.A)("menu__link",t),...r})})}function oe(e){let{mobile:t=!1,position:n,...r}=e;const a=t?ae:re;return(0,c.jsx)(a,{...r,activeClassName:r.activeClassName??(t?"menu__link--active":"navbar__link--active")})}var ie=n(1422),le=n(9169),se=n(4586);const ue={dropdownNavbarItemMobile:"dropdownNavbarItemMobile_S0Fm"};function ce(e,t){return e.some((e=>function(e,t){return!!(0,le.ys)(e.to,t)||!!ee(e.activeBaseRegex,t)||!(!e.activeBasePath||!t.startsWith(e.activeBasePath))}(e,t)))}function de(e){let{items:t,position:n,className:o,onClick:i,...l}=e;const s=(0,r.useRef)(null),[u,d]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{const e=e=>{s.current&&!s.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)}}),[s]),(0,c.jsxs)("div",{ref:s,className:(0,a.A)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--right":"right"===n,"dropdown--show":u}),children:[(0,c.jsx)(ne,{"aria-haspopup":"true","aria-expanded":u,role:"button",href:l.to?void 0:"#",className:(0,a.A)("navbar__link",o),...l,onClick:l.to?void 0:e=>e.preventDefault(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),d(!u))},children:l.children??l.label}),(0,c.jsx)("ul",{className:"dropdown__menu",children:t.map(((e,t)=>(0,r.createElement)(_e,{isDropdownItem:!0,activeClassName:"dropdown__link--active",...e,key:t})))})]})}function fe(e){let{items:t,className:n,position:o,onClick:i,...s}=e;const u=function(){const{siteConfig:{baseUrl:e}}=(0,se.A)(),{pathname:t}=(0,l.zy)();return t.replace(e,"/")}(),d=ce(t,u),{collapsed:f,toggleCollapsed:p,setCollapsed:g}=(0,ie.u)({initialState:()=>!d});return(0,r.useEffect)((()=>{d&&g(!d)}),[u,d,g]),(0,c.jsxs)("li",{className:(0,a.A)("menu__list-item",{"menu__list-item--collapsed":f}),children:[(0,c.jsx)(ne,{role:"button",className:(0,a.A)(ue.dropdownNavbarItemMobile,"menu__link menu__link--sublist menu__link--sublist-caret",n),...s,onClick:e=>{e.preventDefault(),p()},children:s.children??s.label}),(0,c.jsx)(ie.N,{lazy:!0,as:"ul",className:"menu__list",collapsed:f,children:t.map(((e,t)=>(0,r.createElement)(_e,{mobile:!0,isDropdownItem:!0,onClick:i,activeClassName:"menu__link--active",...e,key:t})))})]})}function pe(e){let{mobile:t=!1,...n}=e;const r=t?fe:de;return(0,c.jsx)(r,{...n})}var ge=n(2131);function he(e){let{width:t=20,height:n=20,...r}=e;return(0,c.jsx)("svg",{viewBox:"0 0 24 24",width:t,height:n,"aria-hidden":!0,...r,children:(0,c.jsx)("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 me="iconLanguage_nlXk";var ye=n(418);const be={navbarSearchContainer:"navbarSearchContainer_Bca1"};function ve(e){let{children:t,className:n}=e;return(0,c.jsx)("div",{className:(0,a.A)(n,be.navbarSearchContainer),children:t})}var we=n(4070),ke=n(4142);var xe=n(5597);const Se=e=>e.docs.find((t=>t.id===e.mainDocId));const Ee={default:oe,localeDropdown:function(e){let{mobile:t,dropdownItemsBefore:n,dropdownItemsAfter:r,queryString:a="",...o}=e;const{i18n:{currentLocale:i,locales:u,localeConfigs:d}}=(0,se.A)(),f=(0,ge.o)(),{search:p,hash:g}=(0,l.zy)(),h=[...n,...u.map((e=>{const n=`${`pathname://${f.createUrl({locale:e,fullyQualified:!1})}`}${p}${g}${a}`;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":""}})),...r],m=t?(0,s.T)({message:"Languages",id:"theme.navbar.mobileLanguageDropdown.label",description:"The label for the mobile language switcher dropdown"}):d[i].label;return(0,c.jsx)(pe,{...o,mobile:t,label:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(he,{className:me}),m]}),items:h})},search:function(e){let{mobile:t,className:n}=e;return t?null:(0,c.jsx)(ve,{className:n,children:(0,c.jsx)(ye.A,{})})},dropdown:pe,html:function(e){let{value:t,className:n,mobile:r=!1,isDropdownItem:o=!1}=e;const i=o?"li":"div";return(0,c.jsx)(i,{className:(0,a.A)({navbar__item:!r&&!o,"menu__list-item":r},n),dangerouslySetInnerHTML:{__html:t}})},doc:function(e){let{docId:t,label:n,docsPluginId:r,...a}=e;const{activeDoc:o}=(0,we.zK)(r),i=(0,ke.QB)(t,r),l=o?.path===i?.path;return null===i||i.unlisted&&!l?null:(0,c.jsx)(oe,{exact:!0,...a,isActive:()=>l||!!o?.sidebar&&o.sidebar===i.sidebar,label:n??i.id,to:i.path})},docSidebar:function(e){let{sidebarId:t,label:n,docsPluginId:r,...a}=e;const{activeDoc:o}=(0,we.zK)(r),i=(0,ke.fW)(t,r).link;if(!i)throw new Error(`DocSidebarNavbarItem: Sidebar with ID "${t}" doesn't have anything to be linked to.`);return(0,c.jsx)(oe,{exact:!0,...a,isActive:()=>o?.sidebar===t,label:n??i.label,to:i.path})},docsVersion:function(e){let{label:t,to:n,docsPluginId:r,...a}=e;const o=(0,ke.Vd)(r)[0],i=t??o.label,l=n??(e=>e.docs.find((t=>t.id===e.mainDocId)))(o).path;return(0,c.jsx)(oe,{...a,label:i,to:l})},docsVersionDropdown:function(e){let{mobile:t,docsPluginId:n,dropdownActiveClassDisabled:r,dropdownItemsBefore:a,dropdownItemsAfter:o,...i}=e;const{search:u,hash:d}=(0,l.zy)(),f=(0,we.zK)(n),p=(0,we.jh)(n),{savePreferredVersionName:g}=(0,xe.g1)(n),h=[...a,...p.map((e=>{const t=f.alternateDocVersions[e.name]??Se(e);return{label:e.label,to:`${t.path}${u}${d}`,isActive:()=>e===f.activeVersion,onClick:()=>g(e.name)}})),...o],m=(0,ke.Vd)(n)[0],y=t&&h.length>1?(0,s.T)({id:"theme.navbar.mobileVersionsDropdown.label",message:"Versions",description:"The label for the navbar versions dropdown on mobile view"}):m.label,b=t&&h.length>1?void 0:Se(m).path;return h.length<=1?(0,c.jsx)(oe,{...i,mobile:t,label:y,to:b,isActive:r?()=>!1:void 0}):(0,c.jsx)(pe,{...i,mobile:t,label:y,to:b,items:h,isActive:r?()=>!1:void 0})}};function _e(e){let{type:t,...n}=e;const r=function(e,t){return e&&"default"!==e?e:"items"in t?"dropdown":"default"}(t,n),a=Ee[r];if(!a)throw new Error(`No NavbarItem component found for type "${t}".`);return(0,c.jsx)(a,{...n})}function Ce(){const e=(0,N.M)(),t=(0,w.p)().navbar.items;return(0,c.jsx)("ul",{className:"menu__list",children:t.map(((t,n)=>(0,r.createElement)(_e,{mobile:!0,...t,onClick:()=>e.toggle(),key:n})))})}function Ae(e){return(0,c.jsx)("button",{...e,type:"button",className:"clean-btn navbar-sidebar__back",children:(0,c.jsx)(s.A,{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)",children:"\u2190 Back to main menu"})})}function Te(){const e=0===(0,w.p)().navbar.items.length,t=F();return(0,c.jsxs)(c.Fragment,{children:[!e&&(0,c.jsx)(Ae,{onClick:()=>t.hide()}),t.content]})}function Ne(){const e=(0,N.M)();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?(0,c.jsx)(M,{header:(0,c.jsx)(K,{}),primaryMenu:(0,c.jsx)(Ce,{}),secondaryMenu:(0,c.jsx)(Te,{})}):null}const je={navbarHideable:"navbarHideable_m1mJ",navbarHidden:"navbarHidden_jGov"};function Le(e){return(0,c.jsx)("div",{role:"presentation",...e,className:(0,a.A)("navbar-sidebar__backdrop",e.className)})}function Pe(e){let{children:t}=e;const{navbar:{hideOnScroll:n,style:o}}=(0,w.p)(),i=(0,N.M)(),{navbarRef:l,isNavbarVisible:d}=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,j.Mq)(((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,u=window.innerHeight;l&&i>=l?n(!1):i+u<s&&n(!0)})),(0,u.$)((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(0,c.jsxs)("nav",{ref:l,"aria-label":(0,s.T)({id:"theme.NavBar.navAriaLabel",message:"Main",description:"The ARIA label for the main navigation"}),className:(0,a.A)("navbar","navbar--fixed-top",n&&[je.navbarHideable,!d&&je.navbarHidden],{"navbar--dark":"dark"===o,"navbar--primary":"primary"===o,"navbar-sidebar--show":i.shown}),children:[t,(0,c.jsx)(Le,{onClick:i.toggle}),(0,c.jsx)(Ne,{})]})}var Oe=n(440);const Re={errorBoundaryError:"errorBoundaryError_a6uf",errorBoundaryFallback:"errorBoundaryFallback_VBag"};function Ie(e){return(0,c.jsx)("button",{type:"button",...e,children:(0,c.jsx)(s.A,{id:"theme.ErrorPageContent.tryAgain",description:"The label of the button to try again rendering when the React error boundary captures an error",children:"Try again"})})}function Fe(e){let{error:t}=e;const n=(0,Oe.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return(0,c.jsx)("p",{className:Re.errorBoundaryError,children:n})}class Me extends r.Component{componentDidCatch(e,t){throw this.props.onError(e,t)}render(){return this.props.children}}const De="right";function ze(e){let{width:t=30,height:n=30,className:r,...a}=e;return(0,c.jsx)("svg",{className:r,width:t,height:n,viewBox:"0 0 30 30","aria-hidden":"true",...a,children:(0,c.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M4 7h22M4 15h22M4 23h22"})})}function Be(){const{toggle:e,shown:t}=(0,N.M)();return(0,c.jsx)("button",{onClick:e,"aria-label":(0,s.T)({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",children:(0,c.jsx)(ze,{})})}const $e={colorModeToggle:"colorModeToggle_DEke"};function Ue(e){let{items:t}=e;return(0,c.jsx)(c.Fragment,{children:t.map(((e,t)=>(0,c.jsx)(Me,{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}),children:(0,c.jsx)(_e,{...e})},t)))})}function He(e){let{left:t,right:n}=e;return(0,c.jsxs)("div",{className:"navbar__inner",children:[(0,c.jsx)("div",{className:"navbar__items",children:t}),(0,c.jsx)("div",{className:"navbar__items navbar__items--right",children:n})]})}function Ve(){const e=(0,N.M)(),t=(0,w.p)().navbar.items,[n,r]=function(e){function t(e){return"left"===(e.position??De)}return[e.filter(t),e.filter((e=>!t(e)))]}(t),a=t.find((e=>"search"===e.type));return(0,c.jsx)(He,{left:(0,c.jsxs)(c.Fragment,{children:[!e.disabled&&(0,c.jsx)(Be,{}),(0,c.jsx)(Y,{}),(0,c.jsx)(Ue,{items:n})]}),right:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Ue,{items:r}),(0,c.jsx)(q,{className:$e.colorModeToggle}),!a&&(0,c.jsx)(ve,{children:(0,c.jsx)(ye.A,{})})]})})}function We(){return(0,c.jsx)(Pe,{children:(0,c.jsx)(Ve,{})})}function qe(e){let{item:t}=e;const{to:n,href:r,label:a,prependBaseUrlToHref:o,...i}=t,l=(0,X.A)(n),s=(0,X.A)(r,{forcePrependBaseUrl:!0});return(0,c.jsxs)(Z.A,{className:"footer__link-item",...r?{href:o?s:r}:{to:l},...i,children:[a,r&&!(0,J.A)(r)&&(0,c.jsx)(te.A,{})]})}function Ge(e){let{item:t}=e;return t.html?(0,c.jsx)("li",{className:"footer__item",dangerouslySetInnerHTML:{__html:t.html}}):(0,c.jsx)("li",{className:"footer__item",children:(0,c.jsx)(qe,{item:t})},t.href??t.to)}function Ye(e){let{column:t}=e;return(0,c.jsxs)("div",{className:"col footer__col",children:[(0,c.jsx)("div",{className:"footer__title",children:t.title}),(0,c.jsx)("ul",{className:"footer__items clean-list",children:t.items.map(((e,t)=>(0,c.jsx)(Ge,{item:e},t)))})]})}function Qe(e){let{columns:t}=e;return(0,c.jsx)("div",{className:"row footer__links",children:t.map(((e,t)=>(0,c.jsx)(Ye,{column:e},t)))})}function Ke(){return(0,c.jsx)("span",{className:"footer__link-separator",children:"\xb7"})}function Ze(e){let{item:t}=e;return t.html?(0,c.jsx)("span",{className:"footer__link-item",dangerouslySetInnerHTML:{__html:t.html}}):(0,c.jsx)(qe,{item:t})}function Xe(e){let{links:t}=e;return(0,c.jsx)("div",{className:"footer__links text--center",children:(0,c.jsx)("div",{className:"footer__links",children:t.map(((e,n)=>(0,c.jsxs)(r.Fragment,{children:[(0,c.jsx)(Ze,{item:e}),t.length!==n+1&&(0,c.jsx)(Ke,{})]},n)))})})}function Je(e){let{links:t}=e;return function(e){return"title"in e[0]}(t)?(0,c.jsx)(Qe,{columns:t}):(0,c.jsx)(Xe,{links:t})}var et=n(1122);const tt={footerLogoLink:"footerLogoLink_BH7S"};function nt(e){let{logo:t}=e;const{withBaseUrl:n}=(0,X.h)(),r={light:n(t.src),dark:n(t.srcDark??t.src)};return(0,c.jsx)(et.A,{className:(0,a.A)("footer__logo",t.className),alt:t.alt,sources:r,width:t.width,height:t.height,style:t.style})}function rt(e){let{logo:t}=e;return t.href?(0,c.jsx)(Z.A,{href:t.href,className:tt.footerLogoLink,target:t.target,children:(0,c.jsx)(nt,{logo:t})}):(0,c.jsx)(nt,{logo:t})}function at(e){let{copyright:t}=e;return(0,c.jsx)("div",{className:"footer__copyright",dangerouslySetInnerHTML:{__html:t}})}function ot(e){let{style:t,links:n,logo:r,copyright:o}=e;return(0,c.jsx)("footer",{className:(0,a.A)("footer",{"footer--dark":"dark"===t}),children:(0,c.jsxs)("div",{className:"container container-fluid",children:[n,(r||o)&&(0,c.jsxs)("div",{className:"footer__bottom text--center",children:[r&&(0,c.jsx)("div",{className:"margin-bottom--sm",children:r}),o]})]})})}function it(){const{footer:e}=(0,w.p)();if(!e)return null;const{copyright:t,links:n,logo:r,style:a}=e;return(0,c.jsx)(ot,{style:a,links:n&&n.length>0&&(0,c.jsx)(Je,{links:n}),logo:r&&(0,c.jsx)(rt,{logo:r}),copyright:t&&(0,c.jsx)(at,{copyright:t})})}const lt=r.memo(it),st=(0,L.fM)([D.a,k.oq,j.Tv,xe.VQ,i.Jx,function(e){let{children:t}=e;return(0,c.jsx)(P.y_,{children:(0,c.jsx)(N.e,{children:(0,c.jsx)(R,{children:t})})})}]);function ut(e){let{children:t}=e;return(0,c.jsx)(st,{children:t})}var ct=n(1107);function dt(e){let{error:t,tryAgain:n}=e;return(0,c.jsx)("main",{className:"container margin-vert--xl",children:(0,c.jsx)("div",{className:"row",children:(0,c.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,c.jsx)(ct.A,{as:"h1",className:"hero__title",children:(0,c.jsx)(s.A,{id:"theme.ErrorPageContent.title",description:"The title of the fallback page when the page crashed",children:"This page crashed."})}),(0,c.jsx)("div",{className:"margin-vert--lg",children:(0,c.jsx)(Ie,{onClick:n,className:"button button--primary shadow--lw"})}),(0,c.jsx)("hr",{}),(0,c.jsx)("div",{className:"margin-vert--md",children:(0,c.jsx)(Fe,{error:t})})]})})})}const ft={mainWrapper:"mainWrapper_z2l0"};function pt(e){const{children:t,noFooter:n,wrapperClassName:r,title:l,description:s}=e;return(0,y.J)(),(0,c.jsxs)(ut,{children:[(0,c.jsx)(i.be,{title:l,description:s}),(0,c.jsx)(v,{}),(0,c.jsx)(T,{}),(0,c.jsx)(We,{}),(0,c.jsx)("div",{id:d,className:(0,a.A)(m.G.wrapper.main,ft.mainWrapper,r),children:(0,c.jsx)(o.A,{fallback:e=>(0,c.jsx)(dt,{...e}),children:t})}),!n&&(0,c.jsx)(lt,{})]})}},3465:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});n(6540);var r=n(8774),a=n(6025),o=n(4586),i=n(6342),l=n(1122),s=n(4848);function u(e){let{logo:t,alt:n,imageClassName:r}=e;const o={light:(0,a.A)(t.src),dark:(0,a.A)(t.srcDark||t.src)},i=(0,s.jsx)(l.A,{className:t.className,sources:o,height:t.height,width:t.width,alt:n,style:t.style});return r?(0,s.jsx)("div",{className:r,children:i}):i}function c(e){const{siteConfig:{title:t}}=(0,o.A)(),{navbar:{title:n,logo:l}}=(0,i.p)(),{imageClassName:c,titleClassName:d,...f}=e,p=(0,a.A)(l?.href||"/"),g=n?"":t,h=l?.alt??g;return(0,s.jsxs)(r.A,{to:p,...f,...l?.target&&{target:l.target},children:[l&&(0,s.jsx)(u,{logo:l,alt:h,imageClassName:c}),null!=n&&(0,s.jsx)("b",{className:d,children:n})]})}},1463:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});n(6540);var r=n(5260),a=n(4848);function o(e){let{locale:t,version:n,tag:o}=e;const i=t;return(0,a.jsxs)(r.A,{children:[t&&(0,a.jsx)("meta",{name:"docusaurus_locale",content:t}),n&&(0,a.jsx)("meta",{name:"docusaurus_version",content:n}),o&&(0,a.jsx)("meta",{name:"docusaurus_tag",content:o}),i&&(0,a.jsx)("meta",{name:"docsearch:language",content:i}),n&&(0,a.jsx)("meta",{name:"docsearch:version",content:n}),o&&(0,a.jsx)("meta",{name:"docsearch:docusaurus_tag",content:o})]})}},1122:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(6540),a=n(5066),o=n(2303),i=n(5293);const l={themedComponent:"themedComponent_mlkZ","themedComponent--light":"themedComponent--light_NVdE","themedComponent--dark":"themedComponent--dark_xIcU"};var s=n(4848);function u(e){let{className:t,children:n}=e;const u=(0,o.A)(),{colorMode:c}=(0,i.G)();return(0,s.jsx)(s.Fragment,{children:(u?"dark"===c?["dark"]:["light"]:["light","dark"]).map((e=>{const o=n({theme:e,className:(0,a.A)(t,l.themedComponent,l[`themedComponent--${e}`])});return(0,s.jsx)(r.Fragment,{children:o},e)}))})}function c(e){const{sources:t,className:n,alt:r,...a}=e;return(0,s.jsx)(u,{className:n,children:e=>{let{theme:n,className:o}=e;return(0,s.jsx)("img",{src:t[n],alt:r,className:o,...a})}})}},1422:(e,t,n)=>{"use strict";n.d(t,{N:()=>y,u:()=>u});var r=n(6540),a=n(8193),o=n(205),i=n(3109),l=n(4848);const s="ease-in-out";function u(e){let{initialState:t}=e;const[n,a]=(0,r.useState)(t??!1),o=(0,r.useCallback)((()=>{a((e=>!e))}),[]);return{collapsed:n,setCollapsed:a,toggleCollapsed:o}}const c={display:"none",overflow:"hidden",height:"0px"},d={display:"block",overflow:"visible",height:"auto"};function f(e,t){const n=t?c:d;e.style.display=n.display,e.style.overflow=n.overflow,e.style.height=n.height}function p(e){let{collapsibleRef:t,collapsed:n,animation:a}=e;const o=(0,r.useRef)(!1);(0,r.useEffect)((()=>{const e=t.current;function r(){const t=e.scrollHeight,n=a?.duration??function(e){if((0,i.O)())return 1;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}(t);return{transition:`height ${n}ms ${a?.easing??s}`,height:`${t}px`}}function l(){const t=r();e.style.transition=t.transition,e.style.height=t.height}if(!o.current)return f(e,n),void(o.current=!0);return e.style.willChange="height",function(){const t=requestAnimationFrame((()=>{n?(l(),requestAnimationFrame((()=>{e.style.height=c.height,e.style.overflow=c.overflow}))):(e.style.display="block",requestAnimationFrame((()=>{l()})))}));return()=>cancelAnimationFrame(t)}()}),[t,n,a])}function g(e){if(!a.A.canUseDOM)return e?c:d}function h(e){let{as:t="div",collapsed:n,children:a,animation:o,onCollapseTransitionEnd:i,className:s,disableSSRStyle:u}=e;const c=(0,r.useRef)(null);return p({collapsibleRef:c,collapsed:n,animation:o}),(0,l.jsx)(t,{ref:c,style:u?void 0:g(n),onTransitionEnd:e=>{"height"===e.propertyName&&(f(c.current,n),i?.(n))},className:s,children:a})}function m(e){let{collapsed:t,...n}=e;const[a,i]=(0,r.useState)(!t),[s,u]=(0,r.useState)(t);return(0,o.A)((()=>{t||i(!0)}),[t]),(0,o.A)((()=>{a&&u(t)}),[a,t]),a?(0,l.jsx)(h,{...n,collapsed:s}):null}function y(e){let{lazy:t,...n}=e;const r=t?m:h;return(0,l.jsx)(r,{...n})}},5041:(e,t,n)=>{"use strict";n.d(t,{Mj:()=>h,oq:()=>g});var r=n(6540),a=n(2303),o=n(9466),i=n(9532),l=n(6342),s=n(4848);const u=(0,o.Wf)("docusaurus.announcement.dismiss"),c=(0,o.Wf)("docusaurus.announcement.id"),d=()=>"true"===u.get(),f=e=>u.set(String(e)),p=r.createContext(null);function g(e){let{children:t}=e;const n=function(){const{announcementBar:e}=(0,l.p)(),t=(0,a.A)(),[n,o]=(0,r.useState)((()=>!!t&&d()));(0,r.useEffect)((()=>{o(d())}),[]);const i=(0,r.useCallback)((()=>{f(!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&&f(!1),!r&&d()||o(!1)}),[e]),(0,r.useMemo)((()=>({isActive:!!e&&!n,close:i})),[e,n,i])}();return(0,s.jsx)(p.Provider,{value:n,children:t})}function h(){const e=(0,r.useContext)(p);if(!e)throw new i.dV("AnnouncementBarProvider");return e}},5293:(e,t,n)=>{"use strict";n.d(t,{G:()=>y,a:()=>m});var r=n(6540),a=n(8193),o=n(9532),i=n(9466),l=n(6342),s=n(4848);const u=r.createContext(void 0),c="theme",d=(0,i.Wf)(c),f={light:"light",dark:"dark"},p=e=>e===f.dark?f.dark:f.light,g=e=>a.A.canUseDOM?p(document.documentElement.getAttribute("data-theme")):p(e),h=e=>{d.set(p(e))};function m(e){let{children:t}=e;const n=function(){const{colorMode:{defaultMode:e,disableSwitch:t,respectPrefersColorScheme:n}}=(0,l.p)(),[a,o]=(0,r.useState)(g(e));(0,r.useEffect)((()=>{t&&d.del()}),[t]);const i=(0,r.useCallback)((function(t,r){void 0===r&&(r={});const{persist:a=!0}=r;t?(o(t),a&&h(t)):(o(n?window.matchMedia("(prefers-color-scheme: dark)").matches?f.dark:f.light:e),d.del())}),[n,e]);(0,r.useEffect)((()=>{document.documentElement.setAttribute("data-theme",p(a))}),[a]),(0,r.useEffect)((()=>{if(t)return;const e=e=>{if(e.key!==c)return;const t=d.get();null!==t&&i(p(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===f.dark},setLightTheme(){i(f.light)},setDarkTheme(){i(f.dark)}})),[a,i])}();return(0,s.jsx)(u.Provider,{value:n,children:t})}function y(){const e=(0,r.useContext)(u);if(null==e)throw new o.dV("ColorModeProvider","Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.");return e}},5597:(e,t,n)=>{"use strict";n.d(t,{VQ:()=>y,g1:()=>v});var r=n(6540),a=n(4070),o=n(7065),i=n(6342),l=n(4142),s=n(9532),u=n(9466),c=n(4848);const d=e=>`docs-preferred-version-${e}`,f={save:(e,t,n)=>{(0,u.Wf)(d(e),{persistence:t}).set(n)},read:(e,t)=>(0,u.Wf)(d(e),{persistence:t}).get(),clear:(e,t)=>{(0,u.Wf)(d(e),{persistence:t}).del()}},p=e=>Object.fromEntries(e.map((e=>[e,{preferredVersionName:null}])));const g=r.createContext(null);function h(){const e=(0,a.Gy)(),t=(0,i.p)().docs.versionPersistence,n=(0,r.useMemo)((()=>Object.keys(e)),[e]),[o,l]=(0,r.useState)((()=>p(n)));(0,r.useEffect)((()=>{l(function(e){let{pluginIds:t,versionPersistence:n,allDocsData:r}=e;function a(e){const t=f.read(e,n);return r[e].versions.some((e=>e.name===t))?{preferredVersionName:t}:(f.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){f.save(e,t,n),l((t=>({...t,[e]:{preferredVersionName:n}})))}})),[t])]}function m(e){let{children:t}=e;const n=h();return(0,c.jsx)(g.Provider,{value:n,children:t})}function y(e){let{children:t}=e;return l.C5?(0,c.jsx)(m,{children:t}):(0,c.jsx)(c.Fragment,{children:t})}function b(){const e=(0,r.useContext)(g);if(!e)throw new s.dV("DocsPreferredVersionContextProvider");return e}function v(e){void 0===e&&(e=o.W);const t=(0,a.ht)(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])}}},6588:(e,t,n)=>{"use strict";n.d(t,{V:()=>s,t:()=>u});var r=n(6540),a=n(9532),o=n(4848);const i=Symbol("EmptyContext"),l=r.createContext(i);function s(e){let{children:t,name:n,items:a}=e;const i=(0,r.useMemo)((()=>n&&a?{name:n,items:a}:null),[n,a]);return(0,o.jsx)(l.Provider,{value:i,children:t})}function u(){const e=(0,r.useContext)(l);if(e===i)throw new a.dV("DocsSidebarProvider");return e}},2252:(e,t,n)=>{"use strict";n.d(t,{n:()=>l,r:()=>s});var r=n(6540),a=n(9532),o=n(4848);const i=r.createContext(null);function l(e){let{children:t,version:n}=e;return(0,o.jsx)(i.Provider,{value:n,children:t})}function s(){const e=(0,r.useContext)(i);if(null===e)throw new a.dV("DocsVersionProvider");return e}},2069:(e,t,n)=>{"use strict";n.d(t,{M:()=>p,e:()=>f});var r=n(6540),a=n(5600),o=n(4581),i=n(7485),l=n(6342),s=n(9532),u=n(4848);const c=r.createContext(void 0);function d(){const e=function(){const e=(0,a.YL)(),{items:t}=(0,l.p)().navbar;return 0===t.length&&!e.component}(),t=(0,o.l)(),n=!e&&"mobile"===t,[s,u]=(0,r.useState)(!1);(0,i.$Z)((()=>{if(s)return u(!1),!1}));const c=(0,r.useCallback)((()=>{u((e=>!e))}),[]);return(0,r.useEffect)((()=>{"desktop"===t&&u(!1)}),[t]),(0,r.useMemo)((()=>({disabled:e,shouldRender:n,toggle:c,shown:s})),[e,n,c,s])}function f(e){let{children:t}=e;const n=d();return(0,u.jsx)(c.Provider,{value:n,children:t})}function p(){const e=r.useContext(c);if(void 0===e)throw new s.dV("NavbarMobileSidebarProvider");return e}},5600:(e,t,n)=>{"use strict";n.d(t,{GX:()=>u,YL:()=>s,y_:()=>l});var r=n(6540),a=n(9532),o=n(4848);const i=r.createContext(null);function l(e){let{children:t}=e;const n=(0,r.useState)({component:null,props:null});return(0,o.jsx)(i.Provider,{value:n,children:t})}function s(){const e=(0,r.useContext)(i);if(!e)throw new a.dV("NavbarSecondaryMenuContentProvider");return e[0]}function u(e){let{component:t,props:n}=e;const o=(0,r.useContext)(i);if(!o)throw new a.dV("NavbarSecondaryMenuContentProvider");const[,l]=o,s=(0,a.Be)(n);return(0,r.useEffect)((()=>{l({component:t,props:s})}),[l,t,s]),(0,r.useEffect)((()=>()=>l({component:null,props:null})),[l]),null}},4090:(e,t,n)=>{"use strict";n.d(t,{w:()=>a,J:()=>o});var r=n(6540);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)}}),[])}},4581:(e,t,n)=>{"use strict";n.d(t,{l:()=>l});var r=n(6540),a=n(8193);const o={desktop:"desktop",mobile:"mobile",ssr:"ssr"},i=996;function l(e){let{desktopBreakpoint:t=i}=void 0===e?{}:e;const[n,l]=(0,r.useState)((()=>"ssr"));return(0,r.useEffect)((()=>{function e(){l(function(e){if(!a.A.canUseDOM)throw new Error("getWindowSize() should only be called after React hydration");return window.innerWidth>e?o.desktop:o.mobile}(t))}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[t]),n}},7559:(e,t,n)=>{"use strict";n.d(t,{G:()=>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",unlistedBanner:"theme-unlisted-banner",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:{blogFooterTagsRow:"theme-blog-footer-tags-row",blogFooterEditMetaRow:"theme-blog-footer-edit-meta-row"},pages:{pageFooterEditMetaRow:"theme-pages-footer-edit-meta-row"}}},3109:(e,t,n)=>{"use strict";function r(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}n.d(t,{O:()=>r})},4142:(e,t,n)=>{"use strict";n.d(t,{B5:()=>E,C5:()=>f,Nr:()=>p,OF:()=>w,QB:()=>S,Vd:()=>k,Y:()=>b,fW:()=>x,w8:()=>m});var r=n(6540),a=n(6347),o=n(2831),i=n(4070),l=n(5597),s=n(2252),u=n(6588),c=n(1682),d=n(9169);const f=!!i.Gy;function p(e){return"link"!==e.type||e.unlisted?"category"===e.type?function(e){if(e.href&&!e.linkUnlisted)return e.href;for(const t of e.items){const e=p(t);if(e)return e}}(e):void 0:e.href}const g=(e,t)=>void 0!==e&&(0,d.ys)(e,t),h=(e,t)=>e.some((e=>m(e,t)));function m(e,t){return"link"===e.type?g(e.href,t):"category"===e.type&&(g(e.href,t)||h(e.items,t))}function y(e,t){switch(e.type){case"category":return m(e,t)||e.items.some((e=>y(e,t)));case"link":return!e.unlisted||m(e,t);default:return!0}}function b(e,t){return(0,r.useMemo)((()=>e.filter((e=>y(e,t)))),[e,t])}function v(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,d.ys)(o.href,n)||e(o.items))||"link"===o.type&&(0,d.ys)(o.href,n)){return r&&"category"!==o.type||a.unshift(o),!0}return!1}(t),a}function w(){const e=(0,u.t)(),{pathname:t}=(0,a.zy)(),n=(0,i.vT)()?.pluginData.breadcrumbs;return!1!==n&&e?v({sidebarItems:e.items,pathname:t}):null}function k(e){const{activeVersion:t}=(0,i.zK)(e),{preferredVersion:n}=(0,l.g1)(e),a=(0,i.r7)(e);return(0,r.useMemo)((()=>(0,c.s)([t,n,a].filter(Boolean))),[t,n,a])}function x(e,t){const n=k(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 S(e,t){const n=k(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.s)(t.map((e=>e.id))).join("\n- ")}`)}return r}),[e,n])}function E(e){let{route:t}=e;const n=(0,a.zy)(),r=(0,s.r)(),i=t.routes,l=i.find((e=>(0,a.B6)(n.pathname,e)));if(!l)return null;const u=l.sidebar,c=u?r.docsSidebars[u]:void 0;return{docElement:(0,o.v)(i),sidebarName:u,sidebarItems:c}}},7485:(e,t,n)=>{"use strict";n.d(t,{$Z:()=>i,aZ:()=>s});var r=n(6540),a=n(6347),o=n(9532);function i(e){!function(e){const t=(0,a.W6)(),n=(0,o._q)(e);(0,r.useEffect)((()=>t.block(((e,t)=>n(e,t)))),[t,n])}(((t,n)=>{if("POP"===n)return e(t,n)}))}function l(e){const t=(0,a.W6)();return(0,r.useSyncExternalStore)(t.listen,(()=>e(t)),(()=>e(t)))}function s(e){return l((t=>null===e?null:new URLSearchParams(t.location.search).get(e)))}},1682:(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,{X:()=>r,s:()=>a})},1003:(e,t,n)=>{"use strict";n.d(t,{e3:()=>p,be:()=>d,Jx:()=>g});var r=n(6540),a=n(5066),o=n(5260),i=n(3102);function l(){const e=r.useContext(i.o);if(!e)throw new Error("Unexpected: no Docusaurus route context found");return e}var s=n(6025),u=n(4586);var c=n(4848);function d(e){let{title:t,description:n,keywords:r,image:a,children:i}=e;const l=function(e){const{siteConfig:t}=(0,u.A)(),{title:n,titleDelimiter:r}=t;return e?.trim().length?`${e.trim()} ${r} ${n}`:n}(t),{withBaseUrl:d}=(0,s.h)(),f=a?d(a,{absolute:!0}):void 0;return(0,c.jsxs)(o.A,{children:[t&&(0,c.jsx)("title",{children:l}),t&&(0,c.jsx)("meta",{property:"og:title",content:l}),n&&(0,c.jsx)("meta",{name:"description",content:n}),n&&(0,c.jsx)("meta",{property:"og:description",content:n}),r&&(0,c.jsx)("meta",{name:"keywords",content:Array.isArray(r)?r.join(","):r}),f&&(0,c.jsx)("meta",{property:"og:image",content:f}),f&&(0,c.jsx)("meta",{name:"twitter:image",content:f}),i]})}const f=r.createContext(void 0);function p(e){let{className:t,children:n}=e;const i=r.useContext(f),l=(0,a.A)(i,t);return(0,c.jsxs)(f.Provider,{value:l,children:[(0,c.jsx)(o.A,{children:(0,c.jsx)("html",{className:l})}),n]})}function g(e){let{children:t}=e;const n=l(),r=`plugin-${n.plugin.name.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi,"")}`;const o=`plugin-id-${n.plugin.id}`;return(0,c.jsx)(p,{className:(0,a.A)(r,o),children:t})}},9532:(e,t,n)=>{"use strict";n.d(t,{Be:()=>u,ZC:()=>l,_q:()=>i,dV:()=>s,fM:()=>c});var r=n(6540),a=n(205),o=n(4848);function i(e){const t=(0,r.useRef)(e);return(0,a.A)((()=>{t.current=e}),[e]),(0,r.useCallback)((function(){return t.current(...arguments)}),[])}function l(e){const t=(0,r.useRef)();return(0,a.A)((()=>{t.current=e})),t.current}class s 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 u(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(0,o.jsx)(o.Fragment,{children:e.reduceRight(((e,t)=>(0,o.jsx)(t,{children:e})),n)})}}},9169:(e,t,n)=>{"use strict";n.d(t,{Dt:()=>l,ys:()=>i});var r=n(6540),a=n(8328),o=n(4586);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.A)().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.A,baseUrl:e})),[e])}},3104:(e,t,n)=>{"use strict";n.d(t,{Mq:()=>p,Tv:()=>c,a_:()=>g,gk:()=>h});var r=n(6540),a=n(8193),o=n(2303),i=n(205),l=n(9532),s=n(4848);const u=r.createContext(void 0);function c(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(0,s.jsx)(u.Provider,{value:n,children:t})}function d(){const e=(0,r.useContext)(u);if(null==e)throw new l.dV("ScrollControllerProvider");return e}const f=()=>a.A.canUseDOM?{scrollX:window.pageXOffset,scrollY:window.pageYOffset}:null;function p(e,t){void 0===t&&(t=[]);const{scrollEventsEnabledRef:n}=d(),a=(0,r.useRef)(f()),o=(0,l._q)(e);(0,r.useEffect)((()=>{const e=()=>{if(!n.current)return;const e=f();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 g(){const e=d(),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,i.A)((()=>{queueMicrotask((()=>n.current?.()))})),{blockElementScrollPositionUntilNextRender:a}}function h(){const e=(0,r.useRef)(null),t=(0,o.A)()&&"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?.()}}},2967:(e,t,n)=>{"use strict";n.d(t,{Cy:()=>r,tU:()=>a});n(4586);const r="default";function a(e,t){return`docs-${e}-${t}`}},9466:(e,t,n)=>{"use strict";n.d(t,{Dv:()=>c,Wf:()=>u});var r=n(6540);const a="localStorage";function o(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 i(e){if(void 0===e&&(e=a),"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,l||(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),l=!0),null}var t}let l=!1;const s={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=i(t?.persistence);return null===n?s:{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),o({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),o({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 c(e,t){const n=(0,r.useRef)((()=>null===e?s:u(e,t))).current(),a=(0,r.useCallback)((e=>"undefined"==typeof window?()=>{}:n.listen(e)),[n]);return[(0,r.useSyncExternalStore)(a,(()=>"undefined"==typeof window?null:n.get()),(()=>null)),n]}},2131:(e,t,n)=>{"use strict";n.d(t,{o:()=>i});var r=n(4586),a=n(6347),o=n(440);function i(){const{siteConfig:{baseUrl:e,url:t,trailingSlash:n},i18n:{defaultLocale:i,currentLocale:l}}=(0,r.A)(),{pathname:s}=(0,a.zy)(),u=(0,o.applyTrailingSlash)(s,{trailingSlash:n,baseUrl:e}),c=l===i?e:e.replace(`/${l}/`,"/"),d=u.replace(e,"");return{createUrl:function(e){let{locale:n,fullyQualified:r}=e;return`${r?t:""}${function(e){return e===i?`${c}`:`${c}${e}/`}(n)}${d}`}}}},5062:(e,t,n)=>{"use strict";n.d(t,{$:()=>i});var r=n(6540),a=n(6347),o=n(9532);function i(e){const t=(0,a.zy)(),n=(0,o.ZC)(t),i=(0,o._q)(e);(0,r.useEffect)((()=>{n&&t!==n&&i({location:t,previousLocation:n})}),[i,t,n])}},6342:(e,t,n)=>{"use strict";n.d(t,{p:()=>a});var r=n(4586);function a(){return(0,r.A)().siteConfig.themeConfig}},2983:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeTrailingSlash=t.addLeadingSlash=t.addTrailingSlash=void 0;const r=n(2566);function a(e){return e.endsWith("/")?e:`${e}/`}function o(e){return(0,r.removeSuffix)(e,"/")}t.addTrailingSlash=a,t.default=function(e,t){const{trailingSlash:n,baseUrl:r}=t;if(e.startsWith("#"))return e;if(void 0===n)return e;const[i]=e.split(/[#?]/),l="/"===i||i===r?i:(s=i,n?a(s):o(s));var s;return e.replace(i,l)},t.addLeadingSlash=function(e){return(0,r.addPrefix)(e,"/")},t.removeTrailingSlash=o},253:(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]}},440: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.removePrefix=t.addSuffix=t.removeSuffix=t.addPrefix=t.removeTrailingSlash=t.addLeadingSlash=t.addTrailingSlash=t.applyTrailingSlash=t.blogPostContainerID=void 0,t.blogPostContainerID="__blog-post-container";var a=n(2983);Object.defineProperty(t,"applyTrailingSlash",{enumerable:!0,get:function(){return r(a).default}}),Object.defineProperty(t,"addTrailingSlash",{enumerable:!0,get:function(){return a.addTrailingSlash}}),Object.defineProperty(t,"addLeadingSlash",{enumerable:!0,get:function(){return a.addLeadingSlash}}),Object.defineProperty(t,"removeTrailingSlash",{enumerable:!0,get:function(){return a.removeTrailingSlash}});var o=n(2566);Object.defineProperty(t,"addPrefix",{enumerable:!0,get:function(){return o.addPrefix}}),Object.defineProperty(t,"removeSuffix",{enumerable:!0,get:function(){return o.removeSuffix}}),Object.defineProperty(t,"addSuffix",{enumerable:!0,get:function(){return o.addSuffix}}),Object.defineProperty(t,"removePrefix",{enumerable:!0,get:function(){return o.removePrefix}});var i=n(253);Object.defineProperty(t,"getErrorCausalChain",{enumerable:!0,get:function(){return i.getErrorCausalChain}})},2566:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removePrefix=t.addSuffix=t.removeSuffix=t.addPrefix=void 0,t.addPrefix=function(e,t){return e.startsWith(t)?e:`${t}${e}`},t.removeSuffix=function(e,t){return""===t?e:e.endsWith(t)?e.slice(0,-t.length):e},t.addSuffix=function(e,t){return e.endsWith(t)?e:`${e}${t}`},t.removePrefix=function(e,t){return e.startsWith(t)?e.slice(t.length):e}},1513:(e,t,n)=>{"use strict";n.d(t,{zR:()=>w,TM:()=>C,yJ:()=>p,sC:()=>T,AO:()=>f});var r=n(8168);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),u=l||s;if(e&&a(e)?i=r:r.length&&(i.pop(),i=i.concat(r)),!i.length)return"/";if(i.length){var c=i[i.length-1];n="."===c||".."===c||""===c}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(!u)for(;d--;d)i.unshift("..");!u||""===i[0]||i[0]&&a(i[0])||i.unshift("");var g=i.join("/");return n&&"/"!==g.substr(-1)&&(g+="/"),g};var l=n(1561);function s(e){return"/"===e.charAt(0)?e:"/"+e}function u(e){return"/"===e.charAt(0)?e.substr(1):e}function c(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.A)({},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 g(){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 m(e,t){t(window.confirm(e))}var y="popstate",b="hashchange";function v(){try{return window.history.state||{}}catch(e){return{}}}function w(e){void 0===e&&(e={}),h||(0,l.A)(!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,u=i.forceRefresh,w=void 0!==u&&u,k=i.getUserConfirmation,x=void 0===k?m:k,S=i.keyLength,E=void 0===S?6:S,_=e.basename?d(s(e.basename)):"";function C(e){var t=e||{},n=t.key,r=t.state,a=window.location,o=a.pathname+a.search+a.hash;return _&&(o=c(o,_)),p(o,r,n)}function A(){return Math.random().toString(36).substr(2,E)}var T=g();function N(e){(0,r.A)($,e),$.length=n.length,T.notifyListeners($.location,$.action)}function j(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||O(C(e.state))}function L(){O(C(v()))}var P=!1;function O(e){if(P)P=!1,N();else{T.confirmTransitionTo(e,"POP",x,(function(t){t?N({action:"POP",location:e}):function(e){var t=$.location,n=I.indexOf(t.key);-1===n&&(n=0);var r=I.indexOf(e.key);-1===r&&(r=0);var a=n-r;a&&(P=!0,M(a))}(e)}))}}var R=C(v()),I=[R.key];function F(e){return _+f(e)}function M(e){n.go(e)}var D=0;function z(e){1===(D+=e)&&1===e?(window.addEventListener(y,j),o&&window.addEventListener(b,L)):0===D&&(window.removeEventListener(y,j),o&&window.removeEventListener(b,L))}var B=!1;var $={length:n.length,action:"POP",location:R,createHref:F,push:function(e,t){var r="PUSH",o=p(e,t,A(),$.location);T.confirmTransitionTo(o,r,x,(function(e){if(e){var t=F(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=I.indexOf($.location.key),u=I.slice(0,s+1);u.push(o.key),I=u,N({action:r,location:o})}else window.location.href=t}}))},replace:function(e,t){var r="REPLACE",o=p(e,t,A(),$.location);T.confirmTransitionTo(o,r,x,(function(e){if(e){var t=F(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=I.indexOf($.location.key);-1!==s&&(I[s]=o.key),N({action:r,location:o})}else window.location.replace(t)}}))},go:M,goBack:function(){M(-1)},goForward:function(){M(1)},block:function(e){void 0===e&&(e=!1);var t=T.setPrompt(e);return B||(z(1),B=!0),function(){return B&&(B=!1,z(-1)),t()}},listen:function(e){var t=T.appendListener(e);return z(1),function(){z(-1),t()}}};return $}var k="hashchange",x={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+u(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:u,decodePath:s},slash:{encodePath:s,decodePath:s}};function S(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function E(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function _(e){window.location.replace(S(window.location.href)+"#"+e)}function C(e){void 0===e&&(e={}),h||(0,l.A)(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),a=n.getUserConfirmation,o=void 0===a?m:a,i=n.hashType,u=void 0===i?"slash":i,y=e.basename?d(s(e.basename)):"",b=x[u],v=b.encodePath,w=b.decodePath;function C(){var e=w(E());return y&&(e=c(e,y)),p(e)}var A=g();function T(e){(0,r.A)(B,e),B.length=t.length,A.notifyListeners(B.location,B.action)}var N=!1,j=null;function L(){var e,t,n=E(),r=v(n);if(n!==r)_(r);else{var a=C(),i=B.location;if(!N&&(t=a,(e=i).pathname===t.pathname&&e.search===t.search&&e.hash===t.hash))return;if(j===f(a))return;j=null,function(e){if(N)N=!1,T();else{var t="POP";A.confirmTransitionTo(e,t,o,(function(n){n?T({action:t,location:e}):function(e){var t=B.location,n=I.lastIndexOf(f(t));-1===n&&(n=0);var r=I.lastIndexOf(f(e));-1===r&&(r=0);var a=n-r;a&&(N=!0,F(a))}(e)}))}}(a)}}var P=E(),O=v(P);P!==O&&_(O);var R=C(),I=[f(R)];function F(e){t.go(e)}var M=0;function D(e){1===(M+=e)&&1===e?window.addEventListener(k,L):0===M&&window.removeEventListener(k,L)}var z=!1;var B={length:t.length,action:"POP",location:R,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&(n=S(window.location.href)),n+"#"+v(y+f(e))},push:function(e,t){var n="PUSH",r=p(e,void 0,void 0,B.location);A.confirmTransitionTo(r,n,o,(function(e){if(e){var t=f(r),a=v(y+t);if(E()!==a){j=t,function(e){window.location.hash=e}(a);var o=I.lastIndexOf(f(B.location)),i=I.slice(0,o+1);i.push(t),I=i,T({action:n,location:r})}else T()}}))},replace:function(e,t){var n="REPLACE",r=p(e,void 0,void 0,B.location);A.confirmTransitionTo(r,n,o,(function(e){if(e){var t=f(r),a=v(y+t);E()!==a&&(j=t,_(a));var o=I.indexOf(f(B.location));-1!==o&&(I[o]=t),T({action:n,location:r})}}))},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||(D(1),z=!0),function(){return z&&(z=!1,D(-1)),t()}},listen:function(e){var t=A.appendListener(e);return D(1),function(){D(-1),t()}}};return B}function A(e,t,n){return Math.min(Math.max(e,t),n)}function T(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,u=void 0===s?6:s,c=g();function d(e){(0,r.A)(w,e),w.length=w.entries.length,c.notifyListeners(w.location,w.action)}function h(){return Math.random().toString(36).substr(2,u)}var m=A(l,0,o.length-1),y=o.map((function(e){return p(e,void 0,"string"==typeof e?h():e.key||h())})),b=f;function v(e){var t=A(w.index+e,0,w.entries.length-1),r=w.entries[t];c.confirmTransitionTo(r,"POP",n,(function(e){e?d({action:"POP",location:r,index:t}):d()}))}var w={length:y.length,action:"POP",location:y[m],index:m,entries:y,createHref:b,push:function(e,t){var r="PUSH",a=p(e,t,h(),w.location);c.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);c.confirmTransitionTo(a,r,n,(function(e){e&&(w.entries[w.index]=a,d({action:r,location:a}))}))},go:v,goBack:function(){v(-1)},goForward:function(){v(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),c.setPrompt(e)},listen:function(e){return c.appendListener(e)}};return w}},4146:(e,t,n)=>{"use strict";var r=n(4363),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 u=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,g=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(g){var a=p(n);a&&a!==g&&e(t,a,r)}var i=c(n);d&&(i=i.concat(d(n)));for(var l=s(t),h=s(n),m=0;m<i.length;++m){var y=i[m];if(!(o[y]||r&&r[y]||h&&h[y]||l&&l[y])){var b=f(n,y);try{u(t,y,b)}catch(v){}}}}return t}},311: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 u=[n,r,a,o,i,l],c=0;(s=new Error(t.replace(/%s/g,(function(){return u[c++]})))).name="Invariant Violation"}throw s.framesToPop=1,s}}},4634:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},119:(e,t,n)=>{"use strict";n.r(t)},1043:(e,t,n)=>{"use strict";n.r(t)},5947: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),u=o.querySelector(r.barSelector),c=r.speed,d=r.easing;return o.offsetWidth,l((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),s(u,i(e,c,d)),1===e?(s(o,{transition:"none",opacity:1}),o.offsetWidth,setTimeout((function(){s(o,{transition:"all "+c+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),c)}),c)):setTimeout(t,c)})),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");c(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),u=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),u!=document.body&&c(u,"nprogress-custom-parent"),u.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 u(e,t){return("string"==typeof e?e:f(e)).indexOf(" "+t+" ")>=0}function c(e,t){var n=f(e),r=n+t;u(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=f(e);u(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)},5538:()=>{!function(e){var t={pattern:/((?:^|[^\\$])(?:\\{2})*)\$(?:\w+|\{[^{}]*\})/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:null}}};e.languages.groovy=e.languages.extend("clike",{string:{pattern:/'''(?:[^\\]|\\[\s\S])*?'''|'(?:\\.|[^\\'\r\n])*'/,greedy:!0},keyword:/\b(?:abstract|as|assert|boolean|break|byte|case|catch|char|class|const|continue|def|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|in|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/,number:/\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i,operator:{pattern:/(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,lookbehind:!0},punctuation:/\.+|[{}[\];(),:$]/}),e.languages.insertBefore("groovy","string",{shebang:{pattern:/#!.+/,alias:"comment",greedy:!0},"interpolation-string":{pattern:/"""(?:[^\\]|\\[\s\S])*?"""|(["/])(?:\\.|(?!\1)[^\\\r\n])*\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}}}),e.languages.insertBefore("groovy","punctuation",{"spock-block":/\b(?:and|cleanup|expect|given|setup|then|when|where):/}),e.languages.insertBefore("groovy","function",{annotation:{pattern:/(^|[^.])@\w+/,lookbehind:!0,alias:"punctuation"}}),t.inside.expression.inside=e.languages.groovy}(Prism)},6976:()=>{!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)},9700:()=>{!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 u=l[s];if("string"==typeof u||u.content&&"string"==typeof u.content){var c=o[a],d=n.tokenStack[c],f="string"==typeof u?u:u.content,p=t(r,c),g=f.indexOf(p);if(g>-1){++a;var h=f.substring(0,g),m=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),y=f.substring(g+p.length),b=[];h&&b.push.apply(b,i([h])),b.push(m),y&&b.push.apply(b,i([y])),"string"==typeof u?l.splice.apply(l,[s,1].concat(b)):u.content=b}}else u.content&&i(u.content)}return l}(n.tokens)}}}})}(Prism)},1781:()=>{Prism.languages.properties={comment:/^[ \t]*[#!].*$/m,value:{pattern:/(^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?: *[=:] *(?! )| ))(?:\\(?:\r\n|[\s\S])|[^\\\r\n])+/m,lookbehind:!0,alias:"attr-value"},key:{pattern:/^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?= *[=:]| )/m,alias:"attr-name"},punctuation:/[=:]/}},5089:(e,t,n)=>{var r={"./prism-groovy":5538,"./prism-java":6976,"./prism-properties":1781};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=5089},2694:(e,t,n)=>{"use strict";var r=n(6925);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}},5556:(e,t,n)=>{e.exports=n(2694)()},6925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},2551:(e,t,n)=>{"use strict";var r=n(6540),a=n(9982);function o(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 i=new Set,l={};function s(e,t){u(e,t),u(e+"Capture",t)}function u(e,t){for(l[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),d=Object.prototype.hasOwnProperty,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={},g={};function h(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 m={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){m[e]=new h(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];m[t]=new h(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){m[e]=new h(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){m[e]=new h(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){m[e]=new h(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){m[e]=new h(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){m[e]=new h(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){m[e]=new h(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){m[e]=new h(e,5,!1,e.toLowerCase(),null,!1,!1)}));var y=/[\-:]([a-z])/g;function b(e){return e[1].toUpperCase()}function v(e,t,n,r){var a=m.hasOwnProperty(t)?m[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!!d.call(g,e)||!d.call(p,e)&&(f.test(e)?g[e]=!0:(p[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(y,b);m[t]=new h(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(y,b);m[t]=new h(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(y,b);m[t]=new h(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){m[e]=new h(e,1,!1,e.toLowerCase(),null,!1,!1)})),m.xlinkHref=new h("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){m[e]=new h(e,1,!1,e.toLowerCase(),null,!0,!0)}));var w=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,k=Symbol.for("react.element"),x=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),C=Symbol.for("react.provider"),A=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),P=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var O=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var R=Symbol.iterator;function I(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=R&&e[R]||e["@@iterator"])?e:null}var F,M=Object.assign;function D(e){if(void 0===F)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);F=t&&t[1]||""}return"\n"+F+e}var z=!1;function B(e,t){if(!e||z)return"";z=!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(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&"string"==typeof u.stack){for(var a=u.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]){var s="\n"+a[i].replace(" at new "," at ");return e.displayName&&s.includes("<anonymous>")&&(s=s.replace("<anonymous>",e.displayName)),s}}while(1<=i&&0<=l);break}}}finally{z=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?D(e):""}function $(e){switch(e.tag){case 5:return D(e.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("SuspenseList");case 0:case 2:case 15:return e=B(e.type,!1);case 11:return e=B(e.type.render,!1);case 1:return e=B(e.type,!0);default:return""}}function U(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 S:return"Fragment";case x:return"Portal";case _:return"Profiler";case E:return"StrictMode";case N:return"Suspense";case j:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case A:return(e.displayName||"Context")+".Consumer";case C:return(e._context.displayName||"Context")+".Provider";case T:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case L:return null!==(t=e.displayName||null)?t:U(e.type)||"Memo";case P:t=e._payload,e=e._init;try{return U(e(t))}catch(n){}}return null}function H(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return U(t);case 8:return t===E?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function V(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function W(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function q(e){e._valueTracker||(e._valueTracker=function(e){var t=W(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 G(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=W(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Y(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 Q(e,t){var n=t.checked;return M({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function K(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=V(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 Z(e,t){null!=(t=t.checked)&&v(e,"checked",t,!1)}function X(e,t){Z(e,t);var n=V(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")?ee(e,t.type,n):t.hasOwnProperty("defaultValue")&&ee(e,t.type,V(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function J(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 ee(e,t,n){"number"===t&&Y(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var te=Array.isArray;function ne(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=""+V(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 re(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(o(91));return M({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ae(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(o(92));if(te(n)){if(1<n.length)throw Error(o(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:V(n)}}function oe(e,t){var n=V(t.value),r=V(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 ie(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function le(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 se(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?le(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ue,ce,de=(ce=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ue=ue||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ue.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 ce(e,t)}))}:ce);function fe(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 pe={animationIterationCount:!0,aspectRatio:!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},ge=["Webkit","ms","Moz","O"];function he(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||pe.hasOwnProperty(e)&&pe[e]?(""+t).trim():t+"px"}function me(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),a=he(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}Object.keys(pe).forEach((function(e){ge.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),pe[t]=pe[e]}))}));var ye=M({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 be(e,t){if(t){if(ye[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(o(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(o(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(o(62))}}function ve(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}}var we=null;function ke(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var xe=null,Se=null,Ee=null;function _e(e){if(e=va(e)){if("function"!=typeof xe)throw Error(o(280));var t=e.stateNode;t&&(t=ka(t),xe(e.stateNode,e.type,t))}}function Ce(e){Se?Ee?Ee.push(e):Ee=[e]:Se=e}function Ae(){if(Se){var e=Se,t=Ee;if(Ee=Se=null,_e(e),t)for(e=0;e<t.length;e++)_e(t[e])}}function Te(e,t){return e(t)}function Ne(){}var je=!1;function Le(e,t,n){if(je)return e(t,n);je=!0;try{return Te(e,t,n)}finally{je=!1,(null!==Se||null!==Ee)&&(Ne(),Ae())}}function Pe(e,t){var n=e.stateNode;if(null===n)return null;var r=ka(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(o(231,t,typeof n));return n}var Oe=!1;if(c)try{var Re={};Object.defineProperty(Re,"passive",{get:function(){Oe=!0}}),window.addEventListener("test",Re,Re),window.removeEventListener("test",Re,Re)}catch(ce){Oe=!1}function Ie(e,t,n,r,a,o,i,l,s){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var Fe=!1,Me=null,De=!1,ze=null,Be={onError:function(e){Fe=!0,Me=e}};function $e(e,t,n,r,a,o,i,l,s){Fe=!1,Me=null,Ie.apply(Be,arguments)}function Ue(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function He(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 Ve(e){if(Ue(e)!==e)throw Error(o(188))}function We(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ue(e)))throw Error(o(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(null===a)break;var i=a.alternate;if(null===i){if(null!==(r=a.return)){n=r;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===n)return Ve(a),e;if(i===r)return Ve(a),t;i=i.sibling}throw Error(o(188))}if(n.return!==r.return)n=a,r=i;else{for(var l=!1,s=a.child;s;){if(s===n){l=!0,n=a,r=i;break}if(s===r){l=!0,r=a,n=i;break}s=s.sibling}if(!l){for(s=i.child;s;){if(s===n){l=!0,n=i,r=a;break}if(s===r){l=!0,r=i,n=a;break}s=s.sibling}if(!l)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(3!==n.tag)throw Error(o(188));return n.stateNode.current===n?e:t}(e))?qe(e):null}function qe(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=qe(e);if(null!==t)return t;e=e.sibling}return null}var Ge=a.unstable_scheduleCallback,Ye=a.unstable_cancelCallback,Qe=a.unstable_shouldYield,Ke=a.unstable_requestPaint,Ze=a.unstable_now,Xe=a.unstable_getCurrentPriorityLevel,Je=a.unstable_ImmediatePriority,et=a.unstable_UserBlockingPriority,tt=a.unstable_NormalPriority,nt=a.unstable_LowPriority,rt=a.unstable_IdlePriority,at=null,ot=null;var it=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(lt(e)/st|0)|0},lt=Math.log,st=Math.LN2;var ut=64,ct=4194304;function dt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ft(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,a=e.suspendedLanes,o=e.pingedLanes,i=268435455&n;if(0!==i){var l=i&~a;0!==l?r=dt(l):0!==(o&=i)&&(r=dt(o))}else 0!==(i=n&~a)?r=dt(i):0!==o&&(r=dt(o));if(0===r)return 0;if(0!==t&&t!==r&&!(t&a)&&((a=r&-r)>=(o=t&-t)||16===a&&4194240&o))return t;if(4&r&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)a=1<<(n=31-it(t)),r|=e[n],t&=~a;return r}function pt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function gt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function ht(){var e=ut;return!(4194240&(ut<<=1))&&(ut=64),e}function mt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function yt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-it(t)]=n}function bt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-it(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}var vt=0;function wt(e){return 1<(e&=-e)?4<e?268435455&e?16:536870912:4:1}var kt,xt,St,Et,_t,Ct=!1,At=[],Tt=null,Nt=null,jt=null,Lt=new Map,Pt=new Map,Ot=[],Rt="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 It(e,t){switch(e){case"focusin":case"focusout":Tt=null;break;case"dragenter":case"dragleave":Nt=null;break;case"mouseover":case"mouseout":jt=null;break;case"pointerover":case"pointerout":Lt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pt.delete(t.pointerId)}}function Ft(e,t,n,r,a,o){return null===e||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[a]},null!==t&&(null!==(t=va(t))&&xt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==a&&-1===t.indexOf(a)&&t.push(a),e)}function Mt(e){var t=ba(e.target);if(null!==t){var n=Ue(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=He(n)))return e.blockedOn=t,void _t(e.priority,(function(){St(n)}))}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Dt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Qt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=va(n))&&xt(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);we=r,n.target.dispatchEvent(r),we=null,t.shift()}return!0}function zt(e,t,n){Dt(e)&&n.delete(t)}function Bt(){Ct=!1,null!==Tt&&Dt(Tt)&&(Tt=null),null!==Nt&&Dt(Nt)&&(Nt=null),null!==jt&&Dt(jt)&&(jt=null),Lt.forEach(zt),Pt.forEach(zt)}function $t(e,t){e.blockedOn===t&&(e.blockedOn=null,Ct||(Ct=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Bt)))}function Ut(e){function t(t){return $t(t,e)}if(0<At.length){$t(At[0],e);for(var n=1;n<At.length;n++){var r=At[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==Tt&&$t(Tt,e),null!==Nt&&$t(Nt,e),null!==jt&&$t(jt,e),Lt.forEach(t),Pt.forEach(t),n=0;n<Ot.length;n++)(r=Ot[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Ot.length&&null===(n=Ot[0]).blockedOn;)Mt(n),null===n.blockedOn&&Ot.shift()}var Ht=w.ReactCurrentBatchConfig,Vt=!0;function Wt(e,t,n,r){var a=vt,o=Ht.transition;Ht.transition=null;try{vt=1,Gt(e,t,n,r)}finally{vt=a,Ht.transition=o}}function qt(e,t,n,r){var a=vt,o=Ht.transition;Ht.transition=null;try{vt=4,Gt(e,t,n,r)}finally{vt=a,Ht.transition=o}}function Gt(e,t,n,r){if(Vt){var a=Qt(e,t,n,r);if(null===a)Vr(e,t,r,Yt,n),It(e,r);else if(function(e,t,n,r,a){switch(t){case"focusin":return Tt=Ft(Tt,e,t,n,r,a),!0;case"dragenter":return Nt=Ft(Nt,e,t,n,r,a),!0;case"mouseover":return jt=Ft(jt,e,t,n,r,a),!0;case"pointerover":var o=a.pointerId;return Lt.set(o,Ft(Lt.get(o)||null,e,t,n,r,a)),!0;case"gotpointercapture":return o=a.pointerId,Pt.set(o,Ft(Pt.get(o)||null,e,t,n,r,a)),!0}return!1}(a,e,t,n,r))r.stopPropagation();else if(It(e,r),4&t&&-1<Rt.indexOf(e)){for(;null!==a;){var o=va(a);if(null!==o&&kt(o),null===(o=Qt(e,t,n,r))&&Vr(e,t,r,Yt,n),o===a)break;a=o}null!==a&&r.stopPropagation()}else Vr(e,t,r,null,n)}}var Yt=null;function Qt(e,t,n,r){if(Yt=null,null!==(e=ba(e=ke(r))))if(null===(t=Ue(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=He(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Yt=e,null}function Kt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Xe()){case Je:return 1;case et:return 4;case tt:case nt:return 16;case rt:return 536870912;default:return 16}default:return 16}}var Zt=null,Xt=null,Jt=null;function en(){if(Jt)return Jt;var e,t,n=Xt,r=n.length,a="value"in Zt?Zt.value:Zt.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 Jt=a.slice(e,1<t?1-t:void 0)}function tn(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 nn(){return!0}function rn(){return!1}function an(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)?nn:rn,this.isPropagationStopped=rn,this}return M(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=nn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=nn)},persist:function(){},isPersistent:nn}),t}var on,ln,sn,un={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cn=an(un),dn=M({},un,{view:0,detail:0}),fn=an(dn),pn=M({},dn,{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!==sn&&(sn&&"mousemove"===e.type?(on=e.screenX-sn.screenX,ln=e.screenY-sn.screenY):ln=on=0,sn=e),on)},movementY:function(e){return"movementY"in e?e.movementY:ln}}),gn=an(pn),hn=an(M({},pn,{dataTransfer:0})),mn=an(M({},dn,{relatedTarget:0})),yn=an(M({},un,{animationName:0,elapsedTime:0,pseudoElement:0})),bn=M({},un,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),vn=an(bn),wn=an(M({},un,{data:0})),kn={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"},Sn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function En(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Sn[e])&&!!t[e]}function _n(){return En}var Cn=M({},dn,{key:function(e){if(e.key){var t=kn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tn(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?tn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),An=an(Cn),Tn=an(M({},pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Nn=an(M({},dn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_n})),jn=an(M({},un,{propertyName:0,elapsedTime:0,pseudoElement:0})),Ln=M({},pn,{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}),Pn=an(Ln),On=[9,13,27,32],Rn=c&&"CompositionEvent"in window,In=null;c&&"documentMode"in document&&(In=document.documentMode);var Fn=c&&"TextEvent"in window&&!In,Mn=c&&(!Rn||In&&8<In&&11>=In),Dn=String.fromCharCode(32),zn=!1;function Bn(e,t){switch(e){case"keyup":return-1!==On.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $n(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Un=!1;var Hn={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?!!Hn[e.type]:"textarea"===t}function Wn(e,t,n,r){Ce(r),0<(t=qr(t,"onChange")).length&&(n=new cn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var qn=null,Gn=null;function Yn(e){Dr(e,0)}function Qn(e){if(G(wa(e)))return e}function Kn(e,t){if("change"===e)return t}var Zn=!1;if(c){var Xn;if(c){var Jn="oninput"in document;if(!Jn){var er=document.createElement("div");er.setAttribute("oninput","return;"),Jn="function"==typeof er.oninput}Xn=Jn}else Xn=!1;Zn=Xn&&(!document.documentMode||9<document.documentMode)}function tr(){qn&&(qn.detachEvent("onpropertychange",nr),Gn=qn=null)}function nr(e){if("value"===e.propertyName&&Qn(Gn)){var t=[];Wn(t,Gn,e,ke(e)),Le(Yn,t)}}function rr(e,t,n){"focusin"===e?(tr(),Gn=n,(qn=t).attachEvent("onpropertychange",nr)):"focusout"===e&&tr()}function ar(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Qn(Gn)}function or(e,t){if("click"===e)return Qn(t)}function ir(e,t){if("input"===e||"change"===e)return Qn(t)}var lr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function sr(e,t){if(lr(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++){var a=n[r];if(!d.call(t,a)||!lr(e[a],t[a]))return!1}return!0}function ur(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cr(e,t){var n,r=ur(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=ur(r)}}function dr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?dr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function fr(){for(var e=window,t=Y();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=Y((e=t.contentWindow).document)}return t}function pr(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)}function gr(e){var t=fr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&dr(n.ownerDocument.documentElement,n)){if(null!==r&&pr(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var a=n.textContent.length,o=Math.min(r.start,a);r=void 0===r.end?o:Math.min(r.end,a),!e.extend&&o>r&&(a=r,r=o,o=a),a=cr(n,o);var i=cr(n,r);a&&i&&(1!==e.rangeCount||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&((t=t.createRange()).setStart(a.node,a.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var hr=c&&"documentMode"in document&&11>=document.documentMode,mr=null,yr=null,br=null,vr=!1;function wr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;vr||null==mr||mr!==Y(r)||("selectionStart"in(r=mr)&&pr(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},br&&sr(br,r)||(br=r,0<(r=qr(yr,"onSelect")).length&&(t=new cn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=mr)))}function kr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var xr={animationend:kr("Animation","AnimationEnd"),animationiteration:kr("Animation","AnimationIteration"),animationstart:kr("Animation","AnimationStart"),transitionend:kr("Transition","TransitionEnd")},Sr={},Er={};function _r(e){if(Sr[e])return Sr[e];if(!xr[e])return e;var t,n=xr[e];for(t in n)if(n.hasOwnProperty(t)&&t in Er)return Sr[e]=n[t];return e}c&&(Er=document.createElement("div").style,"AnimationEvent"in window||(delete xr.animationend.animation,delete xr.animationiteration.animation,delete xr.animationstart.animation),"TransitionEvent"in window||delete xr.transitionend.transition);var Cr=_r("animationend"),Ar=_r("animationiteration"),Tr=_r("animationstart"),Nr=_r("transitionend"),jr=new Map,Lr="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Pr(e,t){jr.set(e,t),s(t,[e])}for(var Or=0;Or<Lr.length;Or++){var Rr=Lr[Or];Pr(Rr.toLowerCase(),"on"+(Rr[0].toUpperCase()+Rr.slice(1)))}Pr(Cr,"onAnimationEnd"),Pr(Ar,"onAnimationIteration"),Pr(Tr,"onAnimationStart"),Pr("dblclick","onDoubleClick"),Pr("focusin","onFocus"),Pr("focusout","onBlur"),Pr(Nr,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ir="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Fr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ir));function Mr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,a,i,l,s,u){if($e.apply(this,arguments),Fe){if(!Fe)throw Error(o(198));var c=Me;Fe=!1,Me=null,De||(De=!0,ze=c)}}(r,t,void 0,e),e.currentTarget=null}function Dr(e,t){t=!!(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,u=l.currentTarget;if(l=l.listener,s!==o&&a.isPropagationStopped())break e;Mr(a,l,u),o=s}else for(i=0;i<r.length;i++){if(s=(l=r[i]).instance,u=l.currentTarget,l=l.listener,s!==o&&a.isPropagationStopped())break e;Mr(a,l,u),o=s}}}if(De)throw e=ze,De=!1,ze=null,e}function zr(e,t){var n=t[ha];void 0===n&&(n=t[ha]=new Set);var r=e+"__bubble";n.has(r)||(Hr(t,e,2,!1),n.add(r))}function Br(e,t,n){var r=0;t&&(r|=4),Hr(n,e,r,t)}var $r="_reactListening"+Math.random().toString(36).slice(2);function Ur(e){if(!e[$r]){e[$r]=!0,i.forEach((function(t){"selectionchange"!==t&&(Fr.has(t)||Br(t,!1,e),Br(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[$r]||(t[$r]=!0,Br("selectionchange",!1,t))}}function Hr(e,t,n,r){switch(Kt(t)){case 1:var a=Wt;break;case 4:a=qt;break;default:a=Gt}n=a.bind(null,t,n,e),a=void 0,!Oe||"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 Vr(e,t,n,r,a){var o=r;if(!(1&t||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=ba(l)))return;if(5===(s=i.tag)||6===s){r=o=i;continue e}l=l.parentNode}}r=r.return}Le((function(){var r=o,a=ke(n),i=[];e:{var l=jr.get(e);if(void 0!==l){var s=cn,u=e;switch(e){case"keypress":if(0===tn(n))break e;case"keydown":case"keyup":s=An;break;case"focusin":u="focus",s=mn;break;case"focusout":u="blur",s=mn;break;case"beforeblur":case"afterblur":s=mn;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=hn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":s=Nn;break;case Cr:case Ar:case Tr:s=yn;break;case Nr:s=jn;break;case"scroll":s=fn;break;case"wheel":s=Pn;break;case"copy":case"cut":case"paste":s=vn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":s=Tn}var c=!!(4&t),d=!c&&"scroll"===e,f=c?null!==l?l+"Capture":null:l;c=[];for(var p,g=r;null!==g;){var h=(p=g).stateNode;if(5===p.tag&&null!==h&&(p=h,null!==f&&(null!=(h=Pe(g,f))&&c.push(Wr(g,h,p)))),d)break;g=g.return}0<c.length&&(l=new s(l,u,null,n,a),i.push({event:l,listeners:c}))}}if(!(7&t)){if(s="mouseout"===e||"pointerout"===e,(!(l="mouseover"===e||"pointerover"===e)||n===we||!(u=n.relatedTarget||n.fromElement)||!ba(u)&&!u[ga])&&(s||l)&&(l=a.window===a?a:(l=a.ownerDocument)?l.defaultView||l.parentWindow:window,s?(s=r,null!==(u=(u=n.relatedTarget||n.toElement)?ba(u):null)&&(u!==(d=Ue(u))||5!==u.tag&&6!==u.tag)&&(u=null)):(s=null,u=r),s!==u)){if(c=gn,h="onMouseLeave",f="onMouseEnter",g="mouse","pointerout"!==e&&"pointerover"!==e||(c=Tn,h="onPointerLeave",f="onPointerEnter",g="pointer"),d=null==s?l:wa(s),p=null==u?l:wa(u),(l=new c(h,g+"leave",s,n,a)).target=d,l.relatedTarget=p,h=null,ba(a)===r&&((c=new c(f,g+"enter",u,n,a)).target=p,c.relatedTarget=d,h=c),d=h,s&&u)e:{for(f=u,g=0,p=c=s;p;p=Gr(p))g++;for(p=0,h=f;h;h=Gr(h))p++;for(;0<g-p;)c=Gr(c),g--;for(;0<p-g;)f=Gr(f),p--;for(;g--;){if(c===f||null!==f&&c===f.alternate)break e;c=Gr(c),f=Gr(f)}c=null}else c=null;null!==s&&Yr(i,l,s,c,!1),null!==u&&null!==d&&Yr(i,d,u,c,!0)}if("select"===(s=(l=r?wa(r):window).nodeName&&l.nodeName.toLowerCase())||"input"===s&&"file"===l.type)var m=Kn;else if(Vn(l))if(Zn)m=ir;else{m=ar;var y=rr}else(s=l.nodeName)&&"input"===s.toLowerCase()&&("checkbox"===l.type||"radio"===l.type)&&(m=or);switch(m&&(m=m(e,r))?Wn(i,m,n,a):(y&&y(e,l,r),"focusout"===e&&(y=l._wrapperState)&&y.controlled&&"number"===l.type&&ee(l,"number",l.value)),y=r?wa(r):window,e){case"focusin":(Vn(y)||"true"===y.contentEditable)&&(mr=y,yr=r,br=null);break;case"focusout":br=yr=mr=null;break;case"mousedown":vr=!0;break;case"contextmenu":case"mouseup":case"dragend":vr=!1,wr(i,n,a);break;case"selectionchange":if(hr)break;case"keydown":case"keyup":wr(i,n,a)}var b;if(Rn)e:{switch(e){case"compositionstart":var v="onCompositionStart";break e;case"compositionend":v="onCompositionEnd";break e;case"compositionupdate":v="onCompositionUpdate";break e}v=void 0}else Un?Bn(e,n)&&(v="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(v="onCompositionStart");v&&(Mn&&"ko"!==n.locale&&(Un||"onCompositionStart"!==v?"onCompositionEnd"===v&&Un&&(b=en()):(Xt="value"in(Zt=a)?Zt.value:Zt.textContent,Un=!0)),0<(y=qr(r,v)).length&&(v=new wn(v,e,null,n,a),i.push({event:v,listeners:y}),b?v.data=b:null!==(b=$n(n))&&(v.data=b))),(b=Fn?function(e,t){switch(e){case"compositionend":return $n(t);case"keypress":return 32!==t.which?null:(zn=!0,Dn);case"textInput":return(e=t.data)===Dn&&zn?null:e;default:return null}}(e,n):function(e,t){if(Un)return"compositionend"===e||!Rn&&Bn(e,t)?(e=en(),Jt=Xt=Zt=null,Un=!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 Mn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=qr(r,"onBeforeInput")).length&&(a=new wn("onBeforeInput","beforeinput",null,n,a),i.push({event:a,listeners:r}),a.data=b))}Dr(i,t)}))}function Wr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qr(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=Pe(e,n))&&r.unshift(Wr(e,o,a)),null!=(o=Pe(e,t))&&r.push(Wr(e,o,a))),e=e.return}return r}function Gr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Yr(e,t,n,r,a){for(var o=t._reactName,i=[];null!==n&&n!==r;){var l=n,s=l.alternate,u=l.stateNode;if(null!==s&&s===r)break;5===l.tag&&null!==u&&(l=u,a?null!=(s=Pe(n,o))&&i.unshift(Wr(n,s,l)):a||null!=(s=Pe(n,o))&&i.push(Wr(n,s,l))),n=n.return}0!==i.length&&e.push({event:t,listeners:i})}var Qr=/\r\n?/g,Kr=/\u0000|\uFFFD/g;function Zr(e){return("string"==typeof e?e:""+e).replace(Qr,"\n").replace(Kr,"")}function Xr(e,t,n){if(t=Zr(t),Zr(e)!==t&&n)throw Error(o(425))}function Jr(){}var ea=null,ta=null;function na(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ra="function"==typeof setTimeout?setTimeout:void 0,aa="function"==typeof clearTimeout?clearTimeout:void 0,oa="function"==typeof Promise?Promise:void 0,ia="function"==typeof queueMicrotask?queueMicrotask:void 0!==oa?function(e){return oa.resolve(null).then(e).catch(la)}:ra;function la(e){setTimeout((function(){throw e}))}function sa(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&8===a.nodeType)if("/$"===(n=a.data)){if(0===r)return e.removeChild(a),void Ut(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=a}while(n);Ut(t)}function ua(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function ca(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 da=Math.random().toString(36).slice(2),fa="__reactFiber$"+da,pa="__reactProps$"+da,ga="__reactContainer$"+da,ha="__reactEvents$"+da,ma="__reactListeners$"+da,ya="__reactHandles$"+da;function ba(e){var t=e[fa];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ga]||n[fa]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=ca(e);null!==e;){if(n=e[fa])return n;e=ca(e)}return t}n=(e=n).parentNode}return null}function va(e){return!(e=e[fa]||e[ga])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function wa(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(o(33))}function ka(e){return e[pa]||null}var xa=[],Sa=-1;function Ea(e){return{current:e}}function _a(e){0>Sa||(e.current=xa[Sa],xa[Sa]=null,Sa--)}function Ca(e,t){Sa++,xa[Sa]=e.current,e.current=t}var Aa={},Ta=Ea(Aa),Na=Ea(!1),ja=Aa;function La(e,t){var n=e.type.contextTypes;if(!n)return Aa;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 Pa(e){return null!=(e=e.childContextTypes)}function Oa(){_a(Na),_a(Ta)}function Ra(e,t,n){if(Ta.current!==Aa)throw Error(o(168));Ca(Ta,t),Ca(Na,n)}function Ia(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var a in r=r.getChildContext())if(!(a in t))throw Error(o(108,H(e)||"Unknown",a));return M({},n,r)}function Fa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Aa,ja=Ta.current,Ca(Ta,e),Ca(Na,Na.current),!0}function Ma(e,t,n){var r=e.stateNode;if(!r)throw Error(o(169));n?(e=Ia(e,t,ja),r.__reactInternalMemoizedMergedChildContext=e,_a(Na),_a(Ta),Ca(Ta,e)):_a(Na),Ca(Na,n)}var Da=null,za=!1,Ba=!1;function $a(e){null===Da?Da=[e]:Da.push(e)}function Ua(){if(!Ba&&null!==Da){Ba=!0;var e=0,t=vt;try{var n=Da;for(vt=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}Da=null,za=!1}catch(a){throw null!==Da&&(Da=Da.slice(e+1)),Ge(Je,Ua),a}finally{vt=t,Ba=!1}}return null}var Ha=[],Va=0,Wa=null,qa=0,Ga=[],Ya=0,Qa=null,Ka=1,Za="";function Xa(e,t){Ha[Va++]=qa,Ha[Va++]=Wa,Wa=e,qa=t}function Ja(e,t,n){Ga[Ya++]=Ka,Ga[Ya++]=Za,Ga[Ya++]=Qa,Qa=e;var r=Ka;e=Za;var a=32-it(r)-1;r&=~(1<<a),n+=1;var o=32-it(t)+a;if(30<o){var i=a-a%5;o=(r&(1<<i)-1).toString(32),r>>=i,a-=i,Ka=1<<32-it(t)+a|n<<a|r,Za=o+e}else Ka=1<<o|n<<a|r,Za=e}function eo(e){null!==e.return&&(Xa(e,1),Ja(e,1,0))}function to(e){for(;e===Wa;)Wa=Ha[--Va],Ha[Va]=null,qa=Ha[--Va],Ha[Va]=null;for(;e===Qa;)Qa=Ga[--Ya],Ga[Ya]=null,Za=Ga[--Ya],Ga[Ya]=null,Ka=Ga[--Ya],Ga[Ya]=null}var no=null,ro=null,ao=!1,oo=null;function io(e,t){var n=Lu(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function lo(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,no=e,ro=ua(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,no=e,ro=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Qa?{id:Ka,overflow:Za}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=Lu(18,null,null,0)).stateNode=t,n.return=e,e.child=n,no=e,ro=null,!0);default:return!1}}function so(e){return!(!(1&e.mode)||128&e.flags)}function uo(e){if(ao){var t=ro;if(t){var n=t;if(!lo(e,t)){if(so(e))throw Error(o(418));t=ua(n.nextSibling);var r=no;t&&lo(e,t)?io(r,n):(e.flags=-4097&e.flags|2,ao=!1,no=e)}}else{if(so(e))throw Error(o(418));e.flags=-4097&e.flags|2,ao=!1,no=e}}}function co(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;no=e}function fo(e){if(e!==no)return!1;if(!ao)return co(e),ao=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!na(e.type,e.memoizedProps)),t&&(t=ro)){if(so(e))throw po(),Error(o(418));for(;t;)io(e,t),t=ua(t.nextSibling)}if(co(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(o(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){ro=ua(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}ro=null}}else ro=no?ua(e.stateNode.nextSibling):null;return!0}function po(){for(var e=ro;e;)e=ua(e.nextSibling)}function go(){ro=no=null,ao=!1}function ho(e){null===oo?oo=[e]:oo.push(e)}var mo=w.ReactCurrentBatchConfig;function yo(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(o(309));var r=n.stateNode}if(!r)throw Error(o(147,e));var a=r,i=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===i?t.ref:(t=function(e){var t=a.refs;null===e?delete t[i]:t[i]=e},t._stringRef=i,t)}if("string"!=typeof e)throw Error(o(284));if(!n._owner)throw Error(o(290,e))}return e}function bo(e,t){throw e=Object.prototype.toString.call(t),Error(o(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function vo(e){return(0,e._init)(e._payload)}function wo(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}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=Ou(e,t)).index=0,e.sibling=null,e}function i(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):(t.flags|=1048576,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=Mu(n,e.mode,r)).return=e,t):((t=a(t,n)).return=e,t)}function u(e,t,n,r){var o=n.type;return o===S?d(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===o||"object"==typeof o&&null!==o&&o.$$typeof===P&&vo(o)===t.type)?((r=a(t,n.props)).ref=yo(e,t,n),r.return=e,r):((r=Ru(n.type,n.key,n.props,null,e.mode,r)).ref=yo(e,t,n),r.return=e,r)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Du(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=Iu(n,e.mode,r,o)).return=e,t):((t=a(t,n)).return=e,t)}function f(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=Mu(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case k:return(n=Ru(t.type,t.key,t.props,null,e.mode,n)).ref=yo(e,null,t),n.return=e,n;case x:return(t=Du(t,e.mode,n)).return=e,t;case P:return f(e,(0,t._init)(t._payload),n)}if(te(t)||I(t))return(t=Iu(t,e.mode,n,null)).return=e,t;bo(e,t)}return null}function p(e,t,n,r){var a=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==a?null:s(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case k:return n.key===a?u(e,t,n,r):null;case x:return n.key===a?c(e,t,n,r):null;case P:return p(e,t,(a=n._init)(n._payload),r)}if(te(n)||I(n))return null!==a?null:d(e,t,n,r,null);bo(e,n)}return null}function g(e,t,n,r,a){if("string"==typeof r&&""!==r||"number"==typeof r)return s(t,e=e.get(n)||null,""+r,a);if("object"==typeof r&&null!==r){switch(r.$$typeof){case k:return u(t,e=e.get(null===r.key?n:r.key)||null,r,a);case x:return c(t,e=e.get(null===r.key?n:r.key)||null,r,a);case P:return g(e,t,n,(0,r._init)(r._payload),a)}if(te(r)||I(r))return d(t,e=e.get(n)||null,r,a,null);bo(t,r)}return null}function h(a,o,l,s){for(var u=null,c=null,d=o,h=o=0,m=null;null!==d&&h<l.length;h++){d.index>h?(m=d,d=null):m=d.sibling;var y=p(a,d,l[h],s);if(null===y){null===d&&(d=m);break}e&&d&&null===y.alternate&&t(a,d),o=i(y,o,h),null===c?u=y:c.sibling=y,c=y,d=m}if(h===l.length)return n(a,d),ao&&Xa(a,h),u;if(null===d){for(;h<l.length;h++)null!==(d=f(a,l[h],s))&&(o=i(d,o,h),null===c?u=d:c.sibling=d,c=d);return ao&&Xa(a,h),u}for(d=r(a,d);h<l.length;h++)null!==(m=g(d,a,h,l[h],s))&&(e&&null!==m.alternate&&d.delete(null===m.key?h:m.key),o=i(m,o,h),null===c?u=m:c.sibling=m,c=m);return e&&d.forEach((function(e){return t(a,e)})),ao&&Xa(a,h),u}function m(a,l,s,u){var c=I(s);if("function"!=typeof c)throw Error(o(150));if(null==(s=c.call(s)))throw Error(o(151));for(var d=c=null,h=l,m=l=0,y=null,b=s.next();null!==h&&!b.done;m++,b=s.next()){h.index>m?(y=h,h=null):y=h.sibling;var v=p(a,h,b.value,u);if(null===v){null===h&&(h=y);break}e&&h&&null===v.alternate&&t(a,h),l=i(v,l,m),null===d?c=v:d.sibling=v,d=v,h=y}if(b.done)return n(a,h),ao&&Xa(a,m),c;if(null===h){for(;!b.done;m++,b=s.next())null!==(b=f(a,b.value,u))&&(l=i(b,l,m),null===d?c=b:d.sibling=b,d=b);return ao&&Xa(a,m),c}for(h=r(a,h);!b.done;m++,b=s.next())null!==(b=g(h,a,m,b.value,u))&&(e&&null!==b.alternate&&h.delete(null===b.key?m:b.key),l=i(b,l,m),null===d?c=b:d.sibling=b,d=b);return e&&h.forEach((function(e){return t(a,e)})),ao&&Xa(a,m),c}return function e(r,o,i,s){if("object"==typeof i&&null!==i&&i.type===S&&null===i.key&&(i=i.props.children),"object"==typeof i&&null!==i){switch(i.$$typeof){case k:e:{for(var u=i.key,c=o;null!==c;){if(c.key===u){if((u=i.type)===S){if(7===c.tag){n(r,c.sibling),(o=a(c,i.props.children)).return=r,r=o;break e}}else if(c.elementType===u||"object"==typeof u&&null!==u&&u.$$typeof===P&&vo(u)===c.type){n(r,c.sibling),(o=a(c,i.props)).ref=yo(r,c,i),o.return=r,r=o;break e}n(r,c);break}t(r,c),c=c.sibling}i.type===S?((o=Iu(i.props.children,r.mode,s,i.key)).return=r,r=o):((s=Ru(i.type,i.key,i.props,null,r.mode,s)).ref=yo(r,o,i),s.return=r,r=s)}return l(r);case x:e:{for(c=i.key;null!==o;){if(o.key===c){if(4===o.tag&&o.stateNode.containerInfo===i.containerInfo&&o.stateNode.implementation===i.implementation){n(r,o.sibling),(o=a(o,i.children||[])).return=r,r=o;break e}n(r,o);break}t(r,o),o=o.sibling}(o=Du(i,r.mode,s)).return=r,r=o}return l(r);case P:return e(r,o,(c=i._init)(i._payload),s)}if(te(i))return h(r,o,i,s);if(I(i))return m(r,o,i,s);bo(r,i)}return"string"==typeof i&&""!==i||"number"==typeof i?(i=""+i,null!==o&&6===o.tag?(n(r,o.sibling),(o=a(o,i)).return=r,r=o):(n(r,o),(o=Mu(i,r.mode,s)).return=r,r=o),l(r)):n(r,o)}}var ko=wo(!0),xo=wo(!1),So=Ea(null),Eo=null,_o=null,Co=null;function Ao(){Co=_o=Eo=null}function To(e){var t=So.current;_a(So),e._currentValue=t}function No(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function jo(e,t){Eo=e,Co=_o=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(!!(e.lanes&t)&&(vl=!0),e.firstContext=null)}function Lo(e){var t=e._currentValue;if(Co!==e)if(e={context:e,memoizedValue:t,next:null},null===_o){if(null===Eo)throw Error(o(308));_o=e,Eo.dependencies={lanes:0,firstContext:e}}else _o=_o.next=e;return t}var Po=null;function Oo(e){null===Po?Po=[e]:Po.push(e)}function Ro(e,t,n,r){var a=t.interleaved;return null===a?(n.next=n,Oo(t)):(n.next=a.next,a.next=n),t.interleaved=n,Io(e,r)}function Io(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}var Fo=!1;function Mo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Do(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 zo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Bo(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&Ts){var a=r.pending;return null===a?t.next=t:(t.next=a.next,a.next=t),r.pending=t,Io(e,n)}return null===(a=r.interleaved)?(t.next=t,Oo(r)):(t.next=a.next,a.next=t),r.interleaved=t,Io(e,n)}function $o(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,bt(e,n)}}function Uo(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 Ho(e,t,n,r){var a=e.updateQueue;Fo=!1;var o=a.firstBaseUpdate,i=a.lastBaseUpdate,l=a.shared.pending;if(null!==l){a.shared.pending=null;var s=l,u=s.next;s.next=null,null===i?o=u:i.next=u,i=s;var c=e.alternate;null!==c&&((l=(c=c.updateQueue).lastBaseUpdate)!==i&&(null===l?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=s))}if(null!==o){var d=a.baseState;for(i=0,c=u=s=null,l=o;;){var f=l.lane,p=l.eventTime;if((r&f)===f){null!==c&&(c=c.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,h=l;switch(f=t,p=n,h.tag){case 1:if("function"==typeof(g=h.payload)){d=g.call(p,d,f);break e}d=g;break e;case 3:g.flags=-65537&g.flags|128;case 0:if(null==(f="function"==typeof(g=h.payload)?g.call(p,d,f):g))break e;d=M({},d,f);break e;case 2:Fo=!0}}null!==l.callback&&0!==l.lane&&(e.flags|=64,null===(f=a.effects)?a.effects=[l]:f.push(l))}else p={eventTime:p,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},null===c?(u=c=p,s=d):c=c.next=p,i|=f;if(null===(l=l.next)){if(null===(l=a.shared.pending))break;l=(f=l).next,f.next=null,a.lastBaseUpdate=f,a.shared.pending=null}}if(null===c&&(s=d),a.baseState=s,a.firstBaseUpdate=u,a.lastBaseUpdate=c,null!==(t=a.shared.interleaved)){a=t;do{i|=a.lane,a=a.next}while(a!==t)}else null===o&&(a.shared.lanes=0);Fs|=i,e.lanes=i,e.memoizedState=d}}function Vo(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(o(191,a));a.call(r)}}}var Wo={},qo=Ea(Wo),Go=Ea(Wo),Yo=Ea(Wo);function Qo(e){if(e===Wo)throw Error(o(174));return e}function Ko(e,t){switch(Ca(Yo,t),Ca(Go,e),Ca(qo,Wo),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:se(null,"");break;default:t=se(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}_a(qo),Ca(qo,t)}function Zo(){_a(qo),_a(Go),_a(Yo)}function Xo(e){Qo(Yo.current);var t=Qo(qo.current),n=se(t,e.type);t!==n&&(Ca(Go,e),Ca(qo,n))}function Jo(e){Go.current===e&&(_a(qo),_a(Go))}var ei=Ea(0);function ti(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(128&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 ni=[];function ri(){for(var e=0;e<ni.length;e++)ni[e]._workInProgressVersionPrimary=null;ni.length=0}var ai=w.ReactCurrentDispatcher,oi=w.ReactCurrentBatchConfig,ii=0,li=null,si=null,ui=null,ci=!1,di=!1,fi=0,pi=0;function gi(){throw Error(o(321))}function hi(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!lr(e[n],t[n]))return!1;return!0}function mi(e,t,n,r,a,i){if(ii=i,li=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ai.current=null===e||null===e.memoizedState?Ji:el,e=n(r,a),di){i=0;do{if(di=!1,fi=0,25<=i)throw Error(o(301));i+=1,ui=si=null,t.updateQueue=null,ai.current=tl,e=n(r,a)}while(di)}if(ai.current=Xi,t=null!==si&&null!==si.next,ii=0,ui=si=li=null,ci=!1,t)throw Error(o(300));return e}function yi(){var e=0!==fi;return fi=0,e}function bi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ui?li.memoizedState=ui=e:ui=ui.next=e,ui}function vi(){if(null===si){var e=li.alternate;e=null!==e?e.memoizedState:null}else e=si.next;var t=null===ui?li.memoizedState:ui.next;if(null!==t)ui=t,si=e;else{if(null===e)throw Error(o(310));e={memoizedState:(si=e).memoizedState,baseState:si.baseState,baseQueue:si.baseQueue,queue:si.queue,next:null},null===ui?li.memoizedState=ui=e:ui=ui.next=e}return ui}function wi(e,t){return"function"==typeof t?t(e):t}function ki(e){var t=vi(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=si,a=r.baseQueue,i=n.pending;if(null!==i){if(null!==a){var l=a.next;a.next=i.next,i.next=l}r.baseQueue=a=i,n.pending=null}if(null!==a){i=a.next,r=r.baseState;var s=l=null,u=null,c=i;do{var d=c.lane;if((ii&d)===d)null!==u&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var f={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};null===u?(s=u=f,l=r):u=u.next=f,li.lanes|=d,Fs|=d}c=c.next}while(null!==c&&c!==i);null===u?l=r:u.next=s,lr(r,t.memoizedState)||(vl=!0),t.memoizedState=r,t.baseState=l,t.baseQueue=u,n.lastRenderedState=r}if(null!==(e=n.interleaved)){a=e;do{i=a.lane,li.lanes|=i,Fs|=i,a=a.next}while(a!==e)}else null===a&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function xi(e){var t=vi(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,i=t.memoizedState;if(null!==a){n.pending=null;var l=a=a.next;do{i=e(i,l.action),l=l.next}while(l!==a);lr(i,t.memoizedState)||(vl=!0),t.memoizedState=i,null===t.baseQueue&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Si(){}function Ei(e,t){var n=li,r=vi(),a=t(),i=!lr(r.memoizedState,a);if(i&&(r.memoizedState=a,vl=!0),r=r.queue,Fi(Ai.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||null!==ui&&1&ui.memoizedState.tag){if(n.flags|=2048,Li(9,Ci.bind(null,n,r,a,t),void 0,null),null===Ns)throw Error(o(349));30&ii||_i(n,t,a)}return a}function _i(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=li.updateQueue)?(t={lastEffect:null,stores:null},li.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Ci(e,t,n,r){t.value=n,t.getSnapshot=r,Ti(t)&&Ni(e)}function Ai(e,t,n){return n((function(){Ti(t)&&Ni(e)}))}function Ti(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!lr(e,n)}catch(r){return!0}}function Ni(e){var t=Io(e,1);null!==t&&nu(t,e,1,-1)}function ji(e){var t=bi();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:wi,lastRenderedState:e},t.queue=e,e=e.dispatch=Yi.bind(null,li,e),[t.memoizedState,e]}function Li(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=li.updateQueue)?(t={lastEffect:null,stores:null},li.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 Pi(){return vi().memoizedState}function Oi(e,t,n,r){var a=bi();li.flags|=e,a.memoizedState=Li(1|t,n,void 0,void 0===r?null:r)}function Ri(e,t,n,r){var a=vi();r=void 0===r?null:r;var o=void 0;if(null!==si){var i=si.memoizedState;if(o=i.destroy,null!==r&&hi(r,i.deps))return void(a.memoizedState=Li(t,n,o,r))}li.flags|=e,a.memoizedState=Li(1|t,n,o,r)}function Ii(e,t){return Oi(8390656,8,e,t)}function Fi(e,t){return Ri(2048,8,e,t)}function Mi(e,t){return Ri(4,2,e,t)}function Di(e,t){return Ri(4,4,e,t)}function zi(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 Bi(e,t,n){return n=null!=n?n.concat([e]):null,Ri(4,4,zi.bind(null,t,e),n)}function $i(){}function Ui(e,t){var n=vi();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&hi(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Hi(e,t){var n=vi();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&hi(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Vi(e,t,n){return 21&ii?(lr(n,t)||(n=ht(),li.lanes|=n,Fs|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,vl=!0),e.memoizedState=n)}function Wi(e,t){var n=vt;vt=0!==n&&4>n?n:4,e(!0);var r=oi.transition;oi.transition={};try{e(!1),t()}finally{vt=n,oi.transition=r}}function qi(){return vi().memoizedState}function Gi(e,t,n){var r=tu(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Qi(e))Ki(t,n);else if(null!==(n=Ro(e,t,n,r))){nu(n,e,r,eu()),Zi(n,t,r)}}function Yi(e,t,n){var r=tu(e),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Qi(e))Ki(t,a);else{var o=e.alternate;if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var i=t.lastRenderedState,l=o(i,n);if(a.hasEagerState=!0,a.eagerState=l,lr(l,i)){var s=t.interleaved;return null===s?(a.next=a,Oo(t)):(a.next=s.next,s.next=a),void(t.interleaved=a)}}catch(u){}null!==(n=Ro(e,t,a,r))&&(nu(n,e,r,a=eu()),Zi(n,t,r))}}function Qi(e){var t=e.alternate;return e===li||null!==t&&t===li}function Ki(e,t){di=ci=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Zi(e,t,n){if(4194240&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,bt(e,n)}}var Xi={readContext:Lo,useCallback:gi,useContext:gi,useEffect:gi,useImperativeHandle:gi,useInsertionEffect:gi,useLayoutEffect:gi,useMemo:gi,useReducer:gi,useRef:gi,useState:gi,useDebugValue:gi,useDeferredValue:gi,useTransition:gi,useMutableSource:gi,useSyncExternalStore:gi,useId:gi,unstable_isNewReconciler:!1},Ji={readContext:Lo,useCallback:function(e,t){return bi().memoizedState=[e,void 0===t?null:t],e},useContext:Lo,useEffect:Ii,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Oi(4194308,4,zi.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Oi(4194308,4,e,t)},useInsertionEffect:function(e,t){return Oi(4,2,e,t)},useMemo:function(e,t){var n=bi();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=bi();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Gi.bind(null,li,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},bi().memoizedState=e},useState:ji,useDebugValue:$i,useDeferredValue:function(e){return bi().memoizedState=e},useTransition:function(){var e=ji(!1),t=e[0];return e=Wi.bind(null,e[1]),bi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=li,a=bi();if(ao){if(void 0===n)throw Error(o(407));n=n()}else{if(n=t(),null===Ns)throw Error(o(349));30&ii||_i(r,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,Ii(Ai.bind(null,r,i,e),[e]),r.flags|=2048,Li(9,Ci.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=bi(),t=Ns.identifierPrefix;if(ao){var n=Za;t=":"+t+"R"+(n=(Ka&~(1<<32-it(Ka)-1)).toString(32)+n),0<(n=fi++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=pi++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},el={readContext:Lo,useCallback:Ui,useContext:Lo,useEffect:Fi,useImperativeHandle:Bi,useInsertionEffect:Mi,useLayoutEffect:Di,useMemo:Hi,useReducer:ki,useRef:Pi,useState:function(){return ki(wi)},useDebugValue:$i,useDeferredValue:function(e){return Vi(vi(),si.memoizedState,e)},useTransition:function(){return[ki(wi)[0],vi().memoizedState]},useMutableSource:Si,useSyncExternalStore:Ei,useId:qi,unstable_isNewReconciler:!1},tl={readContext:Lo,useCallback:Ui,useContext:Lo,useEffect:Fi,useImperativeHandle:Bi,useInsertionEffect:Mi,useLayoutEffect:Di,useMemo:Hi,useReducer:xi,useRef:Pi,useState:function(){return xi(wi)},useDebugValue:$i,useDeferredValue:function(e){var t=vi();return null===si?t.memoizedState=e:Vi(t,si.memoizedState,e)},useTransition:function(){return[xi(wi)[0],vi().memoizedState]},useMutableSource:Si,useSyncExternalStore:Ei,useId:qi,unstable_isNewReconciler:!1};function nl(e,t){if(e&&e.defaultProps){for(var n in t=M({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function rl(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:M({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var al={isMounted:function(e){return!!(e=e._reactInternals)&&Ue(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=eu(),a=tu(e),o=zo(r,a);o.payload=t,null!=n&&(o.callback=n),null!==(t=Bo(e,o,a))&&(nu(t,e,a,r),$o(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=eu(),a=tu(e),o=zo(r,a);o.tag=1,o.payload=t,null!=n&&(o.callback=n),null!==(t=Bo(e,o,a))&&(nu(t,e,a,r),$o(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=eu(),r=tu(e),a=zo(n,r);a.tag=2,null!=t&&(a.callback=t),null!==(t=Bo(e,a,r))&&(nu(t,e,r,n),$o(t,e,r))}};function ol(e,t,n,r,a,o,i){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,i):!t.prototype||!t.prototype.isPureReactComponent||(!sr(n,r)||!sr(a,o))}function il(e,t,n){var r=!1,a=Aa,o=t.contextType;return"object"==typeof o&&null!==o?o=Lo(o):(a=Pa(t)?ja:Ta.current,o=(r=null!=(r=t.contextTypes))?La(e,a):Aa),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=al,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=o),t}function ll(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&&al.enqueueReplaceState(t,t.state,null)}function sl(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},Mo(e);var o=t.contextType;"object"==typeof o&&null!==o?a.context=Lo(o):(o=Pa(t)?ja:Ta.current,a.context=La(e,o)),a.state=e.memoizedState,"function"==typeof(o=t.getDerivedStateFromProps)&&(rl(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&&al.enqueueReplaceState(a,a.state,null),Ho(e,n,a,r),a.state=e.memoizedState),"function"==typeof a.componentDidMount&&(e.flags|=4194308)}function ul(e,t){try{var n="",r=t;do{n+=$(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,digest:null}}function cl(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function dl(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}var fl="function"==typeof WeakMap?WeakMap:Map;function pl(e,t,n){(n=zo(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Vs||(Vs=!0,Ws=r),dl(0,t)},n}function gl(e,t,n){(n=zo(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var a=t.value;n.payload=function(){return r(a)},n.callback=function(){dl(0,t)}}var o=e.stateNode;return null!==o&&"function"==typeof o.componentDidCatch&&(n.callback=function(){dl(0,t),"function"!=typeof r&&(null===qs?qs=new Set([this]):qs.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function hl(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new fl;var a=new Set;r.set(t,a)}else void 0===(a=r.get(t))&&(a=new Set,r.set(t,a));a.has(n)||(a.add(n),e=_u.bind(null,e,t,n),t.then(e,e))}function ml(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function yl(e,t,n,r,a){return 1&e.mode?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=zo(-1,1)).tag=2,Bo(n,t,1))),n.lanes|=1),e)}var bl=w.ReactCurrentOwner,vl=!1;function wl(e,t,n,r){t.child=null===e?xo(t,null,n,r):ko(t,e.child,n,r)}function kl(e,t,n,r,a){n=n.render;var o=t.ref;return jo(t,a),r=mi(e,t,n,r,o,a),n=yi(),null===e||vl?(ao&&n&&eo(t),t.flags|=1,wl(e,t,r,a),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Vl(e,t,a))}function xl(e,t,n,r,a){if(null===e){var o=n.type;return"function"!=typeof o||Pu(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Ru(n.type,null,r,t,t.mode,a)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,Sl(e,t,o,r,a))}if(o=e.child,!(e.lanes&a)){var i=o.memoizedProps;if((n=null!==(n=n.compare)?n:sr)(i,r)&&e.ref===t.ref)return Vl(e,t,a)}return t.flags|=1,(e=Ou(o,r)).ref=t.ref,e.return=t,t.child=e}function Sl(e,t,n,r,a){if(null!==e){var o=e.memoizedProps;if(sr(o,r)&&e.ref===t.ref){if(vl=!1,t.pendingProps=r=o,!(e.lanes&a))return t.lanes=e.lanes,Vl(e,t,a);131072&e.flags&&(vl=!0)}}return Cl(e,t,n,r,a)}function El(e,t,n){var r=t.pendingProps,a=r.children,o=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(1&t.mode){if(!(1073741824&n))return e=null!==o?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ca(Os,Ps),Ps|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==o?o.baseLanes:n,Ca(Os,Ps),Ps|=r}else t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ca(Os,Ps),Ps|=n;else null!==o?(r=o.baseLanes|n,t.memoizedState=null):r=n,Ca(Os,Ps),Ps|=r;return wl(e,t,a,n),t.child}function _l(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Cl(e,t,n,r,a){var o=Pa(n)?ja:Ta.current;return o=La(t,o),jo(t,a),n=mi(e,t,n,r,o,a),r=yi(),null===e||vl?(ao&&r&&eo(t),t.flags|=1,wl(e,t,n,a),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Vl(e,t,a))}function Al(e,t,n,r,a){if(Pa(n)){var o=!0;Fa(t)}else o=!1;if(jo(t,a),null===t.stateNode)Hl(e,t),il(t,n,r),sl(t,n,r,a),r=!0;else if(null===e){var i=t.stateNode,l=t.memoizedProps;i.props=l;var s=i.context,u=n.contextType;"object"==typeof u&&null!==u?u=Lo(u):u=La(t,u=Pa(n)?ja:Ta.current);var c=n.getDerivedStateFromProps,d="function"==typeof c||"function"==typeof i.getSnapshotBeforeUpdate;d||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(l!==r||s!==u)&&ll(t,i,r,u),Fo=!1;var f=t.memoizedState;i.state=f,Ho(t,r,i,a),s=t.memoizedState,l!==r||f!==s||Na.current||Fo?("function"==typeof c&&(rl(t,n,c,r),s=t.memoizedState),(l=Fo||ol(t,n,l,r,f,s,u))?(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|=4194308)):("function"==typeof i.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=s),i.props=r,i.state=s,i.context=u,r=l):("function"==typeof i.componentDidMount&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Do(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:nl(t.type,l),i.props=u,d=t.pendingProps,f=i.context,"object"==typeof(s=n.contextType)&&null!==s?s=Lo(s):s=La(t,s=Pa(n)?ja:Ta.current);var p=n.getDerivedStateFromProps;(c="function"==typeof p||"function"==typeof i.getSnapshotBeforeUpdate)||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(l!==d||f!==s)&&ll(t,i,r,s),Fo=!1,f=t.memoizedState,i.state=f,Ho(t,r,i,a);var g=t.memoizedState;l!==d||f!==g||Na.current||Fo?("function"==typeof p&&(rl(t,n,p,r),g=t.memoizedState),(u=Fo||ol(t,n,u,r,f,g,s)||!1)?(c||"function"!=typeof i.UNSAFE_componentWillUpdate&&"function"!=typeof i.componentWillUpdate||("function"==typeof i.componentWillUpdate&&i.componentWillUpdate(r,g,s),"function"==typeof i.UNSAFE_componentWillUpdate&&i.UNSAFE_componentWillUpdate(r,g,s)),"function"==typeof i.componentDidUpdate&&(t.flags|=4),"function"==typeof i.getSnapshotBeforeUpdate&&(t.flags|=1024)):("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|=1024),t.memoizedProps=r,t.memoizedState=g),i.props=r,i.state=g,i.context=s,r=u):("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|=1024),r=!1)}return Tl(e,t,n,r,o,a)}function Tl(e,t,n,r,a,o){_l(e,t);var i=!!(128&t.flags);if(!r&&!i)return a&&Ma(t,n,!1),Vl(e,t,o);r=t.stateNode,bl.current=t;var l=i&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&i?(t.child=ko(t,e.child,null,o),t.child=ko(t,null,l,o)):wl(e,t,l,o),t.memoizedState=r.state,a&&Ma(t,n,!0),t.child}function Nl(e){var t=e.stateNode;t.pendingContext?Ra(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Ra(0,t.context,!1),Ko(e,t.containerInfo)}function jl(e,t,n,r,a){return go(),ho(a),t.flags|=256,wl(e,t,n,r),t.child}var Ll,Pl,Ol,Rl,Il={dehydrated:null,treeContext:null,retryLane:0};function Fl(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ml(e,t,n){var r,a=t.pendingProps,i=ei.current,l=!1,s=!!(128&t.flags);if((r=s)||(r=(null===e||null!==e.memoizedState)&&!!(2&i)),r?(l=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(i|=1),Ca(ei,1&i),null===e)return uo(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(1&t.mode?"$!"===e.data?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=a.children,e=a.fallback,l?(a=t.mode,l=t.child,s={mode:"hidden",children:s},1&a||null===l?l=Fu(s,a,0,null):(l.childLanes=0,l.pendingProps=s),e=Iu(e,a,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=Fl(n),t.memoizedState=Il,e):Dl(t,s));if(null!==(i=e.memoizedState)&&null!==(r=i.dehydrated))return function(e,t,n,r,a,i,l){if(n)return 256&t.flags?(t.flags&=-257,zl(e,t,l,r=cl(Error(o(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(i=r.fallback,a=t.mode,r=Fu({mode:"visible",children:r.children},a,0,null),(i=Iu(i,a,l,null)).flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,1&t.mode&&ko(t,e.child,null,l),t.child.memoizedState=Fl(l),t.memoizedState=Il,i);if(!(1&t.mode))return zl(e,t,l,null);if("$!"===a.data){if(r=a.nextSibling&&a.nextSibling.dataset)var s=r.dgst;return r=s,zl(e,t,l,r=cl(i=Error(o(419)),r,void 0))}if(s=!!(l&e.childLanes),vl||s){if(null!==(r=Ns)){switch(l&-l){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}0!==(a=a&(r.suspendedLanes|l)?0:a)&&a!==i.retryLane&&(i.retryLane=a,Io(e,a),nu(r,e,a,-1))}return hu(),zl(e,t,l,r=cl(Error(o(421))))}return"$?"===a.data?(t.flags|=128,t.child=e.child,t=Au.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,ro=ua(a.nextSibling),no=t,ao=!0,oo=null,null!==e&&(Ga[Ya++]=Ka,Ga[Ya++]=Za,Ga[Ya++]=Qa,Ka=e.id,Za=e.overflow,Qa=t),t=Dl(t,r.children),t.flags|=4096,t)}(e,t,s,a,r,i,n);if(l){l=a.fallback,s=t.mode,r=(i=e.child).sibling;var u={mode:"hidden",children:a.children};return 1&s||t.child===i?(a=Ou(i,u)).subtreeFlags=14680064&i.subtreeFlags:((a=t.child).childLanes=0,a.pendingProps=u,t.deletions=null),null!==r?l=Ou(r,l):(l=Iu(l,s,n,null)).flags|=2,l.return=t,a.return=t,a.sibling=l,t.child=a,a=l,l=t.child,s=null===(s=e.child.memoizedState)?Fl(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},l.memoizedState=s,l.childLanes=e.childLanes&~n,t.memoizedState=Il,a}return e=(l=e.child).sibling,a=Ou(l,{mode:"visible",children:a.children}),!(1&t.mode)&&(a.lanes=n),a.return=t,a.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=a,t.memoizedState=null,a}function Dl(e,t){return(t=Fu({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function zl(e,t,n,r){return null!==r&&ho(r),ko(t,e.child,null,n),(e=Dl(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Bl(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),No(e.return,t,n)}function $l(e,t,n,r,a){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=a)}function Ul(e,t,n){var r=t.pendingProps,a=r.revealOrder,o=r.tail;if(wl(e,t,r.children,n),2&(r=ei.current))r=1&r|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Bl(e,n,t);else if(19===e.tag)Bl(e,n,t);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(Ca(ei,r),1&t.mode)switch(a){case"forwards":for(n=t.child,a=null;null!==n;)null!==(e=n.alternate)&&null===ti(e)&&(a=n),n=n.sibling;null===(n=a)?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),$l(t,!1,a,n,o);break;case"backwards":for(n=null,a=t.child,t.child=null;null!==a;){if(null!==(e=a.alternate)&&null===ti(e)){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}$l(t,!0,n,null,o);break;case"together":$l(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function Hl(e,t){!(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Vl(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Fs|=t.lanes,!(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(n=Ou(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Ou(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Wl(e,t){if(!ao)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 ql(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;null!==a;)n|=a.lanes|a.childLanes,r|=14680064&a.subtreeFlags,r|=14680064&a.flags,a.return=e,a=a.sibling;else for(a=e.child;null!==a;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Gl(e,t,n){var r=t.pendingProps;switch(to(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ql(t),null;case 1:case 17:return Pa(t.type)&&Oa(),ql(t),null;case 3:return r=t.stateNode,Zo(),_a(Na),_a(Ta),ri(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(fo(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==oo&&(iu(oo),oo=null))),Pl(e,t),ql(t),null;case 5:Jo(t);var a=Qo(Yo.current);if(n=t.type,null!==e&&null!=t.stateNode)Ol(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(o(166));return ql(t),null}if(e=Qo(qo.current),fo(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[fa]=t,r[pa]=i,e=!!(1&t.mode),n){case"dialog":zr("cancel",r),zr("close",r);break;case"iframe":case"object":case"embed":zr("load",r);break;case"video":case"audio":for(a=0;a<Ir.length;a++)zr(Ir[a],r);break;case"source":zr("error",r);break;case"img":case"image":case"link":zr("error",r),zr("load",r);break;case"details":zr("toggle",r);break;case"input":K(r,i),zr("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},zr("invalid",r);break;case"textarea":ae(r,i),zr("invalid",r)}for(var s in be(n,i),a=null,i)if(i.hasOwnProperty(s)){var u=i[s];"children"===s?"string"==typeof u?r.textContent!==u&&(!0!==i.suppressHydrationWarning&&Xr(r.textContent,u,e),a=["children",u]):"number"==typeof u&&r.textContent!==""+u&&(!0!==i.suppressHydrationWarning&&Xr(r.textContent,u,e),a=["children",""+u]):l.hasOwnProperty(s)&&null!=u&&"onScroll"===s&&zr("scroll",r)}switch(n){case"input":q(r),J(r,i,!0);break;case"textarea":q(r),ie(r);break;case"select":case"option":break;default:"function"==typeof i.onClick&&(r.onclick=Jr)}r=a,t.updateQueue=r,null!==r&&(t.flags|=4)}else{s=9===a.nodeType?a:a.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=le(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=s.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),"select"===n&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[fa]=t,e[pa]=r,Ll(e,t,!1,!1),t.stateNode=e;e:{switch(s=ve(n,r),n){case"dialog":zr("cancel",e),zr("close",e),a=r;break;case"iframe":case"object":case"embed":zr("load",e),a=r;break;case"video":case"audio":for(a=0;a<Ir.length;a++)zr(Ir[a],e);a=r;break;case"source":zr("error",e),a=r;break;case"img":case"image":case"link":zr("error",e),zr("load",e),a=r;break;case"details":zr("toggle",e),a=r;break;case"input":K(e,r),a=Q(e,r),zr("invalid",e);break;case"option":default:a=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=M({},r,{value:void 0}),zr("invalid",e);break;case"textarea":ae(e,r),a=re(e,r),zr("invalid",e)}for(i in be(n,a),u=a)if(u.hasOwnProperty(i)){var c=u[i];"style"===i?me(e,c):"dangerouslySetInnerHTML"===i?null!=(c=c?c.__html:void 0)&&de(e,c):"children"===i?"string"==typeof c?("textarea"!==n||""!==c)&&fe(e,c):"number"==typeof c&&fe(e,""+c):"suppressContentEditableWarning"!==i&&"suppressHydrationWarning"!==i&&"autoFocus"!==i&&(l.hasOwnProperty(i)?null!=c&&"onScroll"===i&&zr("scroll",e):null!=c&&v(e,i,c,s))}switch(n){case"input":q(e),J(e,r,!1);break;case"textarea":q(e),ie(e);break;case"option":null!=r.value&&e.setAttribute("value",""+V(r.value));break;case"select":e.multiple=!!r.multiple,null!=(i=r.value)?ne(e,!!r.multiple,i,!1):null!=r.defaultValue&&ne(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof a.onClick&&(e.onclick=Jr)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return ql(t),null;case 6:if(e&&null!=t.stateNode)Rl(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(o(166));if(n=Qo(Yo.current),Qo(qo.current),fo(t)){if(r=t.stateNode,n=t.memoizedProps,r[fa]=t,(i=r.nodeValue!==n)&&null!==(e=no))switch(e.tag){case 3:Xr(r.nodeValue,n,!!(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Xr(r.nodeValue,n,!!(1&e.mode))}i&&(t.flags|=4)}else(r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[fa]=t,t.stateNode=r}return ql(t),null;case 13:if(_a(ei),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(ao&&null!==ro&&1&t.mode&&!(128&t.flags))po(),go(),t.flags|=98560,i=!1;else if(i=fo(t),null!==r&&null!==r.dehydrated){if(null===e){if(!i)throw Error(o(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(o(317));i[fa]=t}else go(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;ql(t),i=!1}else null!==oo&&(iu(oo),oo=null),i=!0;if(!i)return 65536&t.flags?t:null}return 128&t.flags?(t.lanes=n,t):((r=null!==r)!==(null!==e&&null!==e.memoizedState)&&r&&(t.child.flags|=8192,1&t.mode&&(null===e||1&ei.current?0===Rs&&(Rs=3):hu())),null!==t.updateQueue&&(t.flags|=4),ql(t),null);case 4:return Zo(),Pl(e,t),null===e&&Ur(t.stateNode.containerInfo),ql(t),null;case 10:return To(t.type._context),ql(t),null;case 19:if(_a(ei),null===(i=t.memoizedState))return ql(t),null;if(r=!!(128&t.flags),null===(s=i.rendering))if(r)Wl(i,!1);else{if(0!==Rs||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(s=ti(e))){for(t.flags|=128,Wl(i,!1),null!==(r=s.updateQueue)&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;null!==n;)e=r,(i=n).flags&=14680066,null===(s=i.alternate)?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ca(ei,1&ei.current|2),t.child}e=e.sibling}null!==i.tail&&Ze()>Us&&(t.flags|=128,r=!0,Wl(i,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=ti(s))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Wl(i,!0),null===i.tail&&"hidden"===i.tailMode&&!s.alternate&&!ao)return ql(t),null}else 2*Ze()-i.renderingStartTime>Us&&1073741824!==n&&(t.flags|=128,r=!0,Wl(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(null!==(n=i.last)?n.sibling=s:t.child=s,i.last=s)}return null!==i.tail?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ze(),t.sibling=null,n=ei.current,Ca(ei,r?1&n|2:1&n),t):(ql(t),null);case 22:case 23:return du(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&1&t.mode?!!(1073741824&Ps)&&(ql(t),6&t.subtreeFlags&&(t.flags|=8192)):ql(t),null;case 24:case 25:return null}throw Error(o(156,t.tag))}function Yl(e,t){switch(to(t),t.tag){case 1:return Pa(t.type)&&Oa(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Zo(),_a(Na),_a(Ta),ri(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 5:return Jo(t),null;case 13:if(_a(ei),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));go()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return _a(ei),null;case 4:return Zo(),null;case 10:return To(t.type._context),null;case 22:case 23:return du(),null;default:return null}}Ll=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}},Pl=function(){},Ol=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,Qo(qo.current);var o,i=null;switch(n){case"input":a=Q(e,a),r=Q(e,r),i=[];break;case"select":a=M({},a,{value:void 0}),r=M({},r,{value:void 0}),i=[];break;case"textarea":a=re(e,a),r=re(e,r),i=[];break;default:"function"!=typeof a.onClick&&"function"==typeof r.onClick&&(e.onclick=Jr)}for(c in be(n,r),n=null,a)if(!r.hasOwnProperty(c)&&a.hasOwnProperty(c)&&null!=a[c])if("style"===c){var s=a[c];for(o in s)s.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(l.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var u=r[c];if(s=null!=a?a[c]:void 0,r.hasOwnProperty(c)&&u!==s&&(null!=u||null!=s))if("style"===c)if(s){for(o in s)!s.hasOwnProperty(o)||u&&u.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in u)u.hasOwnProperty(o)&&s[o]!==u[o]&&(n||(n={}),n[o]=u[o])}else n||(i||(i=[]),i.push(c,n)),n=u;else"dangerouslySetInnerHTML"===c?(u=u?u.__html:void 0,s=s?s.__html:void 0,null!=u&&s!==u&&(i=i||[]).push(c,u)):"children"===c?"string"!=typeof u&&"number"!=typeof u||(i=i||[]).push(c,""+u):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(l.hasOwnProperty(c)?(null!=u&&"onScroll"===c&&zr("scroll",e),i||s===u||(i=[])):(i=i||[]).push(c,u))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}},Rl=function(e,t,n,r){n!==r&&(t.flags|=4)};var Ql=!1,Kl=!1,Zl="function"==typeof WeakSet?WeakSet:Set,Xl=null;function Jl(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(r){Eu(e,t,r)}else n.current=null}function es(e,t,n){try{n()}catch(r){Eu(e,t,r)}}var ts=!1;function ns(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var a=r=r.next;do{if((a.tag&e)===e){var o=a.destroy;a.destroy=void 0,void 0!==o&&es(t,n,o)}a=a.next}while(a!==r)}}function rs(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function as(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function os(e){var t=e.alternate;null!==t&&(e.alternate=null,os(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[fa],delete t[pa],delete t[ha],delete t[ma],delete t[ya])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function is(e){return 5===e.tag||3===e.tag||4===e.tag}function ls(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||is(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function ss(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,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(ss(e,t,n),e=e.sibling;null!==e;)ss(e,t,n),e=e.sibling}function us(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(us(e,t,n),e=e.sibling;null!==e;)us(e,t,n),e=e.sibling}var cs=null,ds=!1;function fs(e,t,n){for(n=n.child;null!==n;)ps(e,t,n),n=n.sibling}function ps(e,t,n){if(ot&&"function"==typeof ot.onCommitFiberUnmount)try{ot.onCommitFiberUnmount(at,n)}catch(l){}switch(n.tag){case 5:Kl||Jl(n,t);case 6:var r=cs,a=ds;cs=null,fs(e,t,n),ds=a,null!==(cs=r)&&(ds?(e=cs,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):cs.removeChild(n.stateNode));break;case 18:null!==cs&&(ds?(e=cs,n=n.stateNode,8===e.nodeType?sa(e.parentNode,n):1===e.nodeType&&sa(e,n),Ut(e)):sa(cs,n.stateNode));break;case 4:r=cs,a=ds,cs=n.stateNode.containerInfo,ds=!0,fs(e,t,n),cs=r,ds=a;break;case 0:case 11:case 14:case 15:if(!Kl&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){a=r=r.next;do{var o=a,i=o.destroy;o=o.tag,void 0!==i&&(2&o||4&o)&&es(n,t,i),a=a.next}while(a!==r)}fs(e,t,n);break;case 1:if(!Kl&&(Jl(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Eu(n,t,l)}fs(e,t,n);break;case 21:fs(e,t,n);break;case 22:1&n.mode?(Kl=(r=Kl)||null!==n.memoizedState,fs(e,t,n),Kl=r):fs(e,t,n);break;default:fs(e,t,n)}}function gs(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Zl),t.forEach((function(t){var r=Tu.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function hs(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var a=n[r];try{var i=e,l=t,s=l;e:for(;null!==s;){switch(s.tag){case 5:cs=s.stateNode,ds=!1;break e;case 3:case 4:cs=s.stateNode.containerInfo,ds=!0;break e}s=s.return}if(null===cs)throw Error(o(160));ps(i,l,a),cs=null,ds=!1;var u=a.alternate;null!==u&&(u.return=null),a.return=null}catch(c){Eu(a,t,c)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)ms(t,e),t=t.sibling}function ms(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(hs(t,e),ys(e),4&r){try{ns(3,e,e.return),rs(3,e)}catch(m){Eu(e,e.return,m)}try{ns(5,e,e.return)}catch(m){Eu(e,e.return,m)}}break;case 1:hs(t,e),ys(e),512&r&&null!==n&&Jl(n,n.return);break;case 5:if(hs(t,e),ys(e),512&r&&null!==n&&Jl(n,n.return),32&e.flags){var a=e.stateNode;try{fe(a,"")}catch(m){Eu(e,e.return,m)}}if(4&r&&null!=(a=e.stateNode)){var i=e.memoizedProps,l=null!==n?n.memoizedProps:i,s=e.type,u=e.updateQueue;if(e.updateQueue=null,null!==u)try{"input"===s&&"radio"===i.type&&null!=i.name&&Z(a,i),ve(s,l);var c=ve(s,i);for(l=0;l<u.length;l+=2){var d=u[l],f=u[l+1];"style"===d?me(a,f):"dangerouslySetInnerHTML"===d?de(a,f):"children"===d?fe(a,f):v(a,d,f,c)}switch(s){case"input":X(a,i);break;case"textarea":oe(a,i);break;case"select":var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var g=i.value;null!=g?ne(a,!!i.multiple,g,!1):p!==!!i.multiple&&(null!=i.defaultValue?ne(a,!!i.multiple,i.defaultValue,!0):ne(a,!!i.multiple,i.multiple?[]:"",!1))}a[pa]=i}catch(m){Eu(e,e.return,m)}}break;case 6:if(hs(t,e),ys(e),4&r){if(null===e.stateNode)throw Error(o(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(m){Eu(e,e.return,m)}}break;case 3:if(hs(t,e),ys(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{Ut(t.containerInfo)}catch(m){Eu(e,e.return,m)}break;case 4:default:hs(t,e),ys(e);break;case 13:hs(t,e),ys(e),8192&(a=e.child).flags&&(i=null!==a.memoizedState,a.stateNode.isHidden=i,!i||null!==a.alternate&&null!==a.alternate.memoizedState||($s=Ze())),4&r&&gs(e);break;case 22:if(d=null!==n&&null!==n.memoizedState,1&e.mode?(Kl=(c=Kl)||d,hs(t,e),Kl=c):hs(t,e),ys(e),8192&r){if(c=null!==e.memoizedState,(e.stateNode.isHidden=c)&&!d&&1&e.mode)for(Xl=e,d=e.child;null!==d;){for(f=Xl=d;null!==Xl;){switch(g=(p=Xl).child,p.tag){case 0:case 11:case 14:case 15:ns(4,p,p.return);break;case 1:Jl(p,p.return);var h=p.stateNode;if("function"==typeof h.componentWillUnmount){r=p,n=p.return;try{t=r,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(m){Eu(r,n,m)}}break;case 5:Jl(p,p.return);break;case 22:if(null!==p.memoizedState){ks(f);continue}}null!==g?(g.return=p,Xl=g):ks(f)}d=d.sibling}e:for(d=null,f=e;;){if(5===f.tag){if(null===d){d=f;try{a=f.stateNode,c?"function"==typeof(i=a.style).setProperty?i.setProperty("display","none","important"):i.display="none":(s=f.stateNode,l=null!=(u=f.memoizedProps.style)&&u.hasOwnProperty("display")?u.display:null,s.style.display=he("display",l))}catch(m){Eu(e,e.return,m)}}}else if(6===f.tag){if(null===d)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(m){Eu(e,e.return,m)}}else if((22!==f.tag&&23!==f.tag||null===f.memoizedState||f===e)&&null!==f.child){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;null===f.sibling;){if(null===f.return||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:hs(t,e),ys(e),4&r&&gs(e);case 21:}}function ys(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(is(n)){var r=n;break e}n=n.return}throw Error(o(160))}switch(r.tag){case 5:var a=r.stateNode;32&r.flags&&(fe(a,""),r.flags&=-33),us(e,ls(e),a);break;case 3:case 4:var i=r.stateNode.containerInfo;ss(e,ls(e),i);break;default:throw Error(o(161))}}catch(l){Eu(e,e.return,l)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function bs(e,t,n){Xl=e,vs(e,t,n)}function vs(e,t,n){for(var r=!!(1&e.mode);null!==Xl;){var a=Xl,o=a.child;if(22===a.tag&&r){var i=null!==a.memoizedState||Ql;if(!i){var l=a.alternate,s=null!==l&&null!==l.memoizedState||Kl;l=Ql;var u=Kl;if(Ql=i,(Kl=s)&&!u)for(Xl=a;null!==Xl;)s=(i=Xl).child,22===i.tag&&null!==i.memoizedState?xs(a):null!==s?(s.return=i,Xl=s):xs(a);for(;null!==o;)Xl=o,vs(o,t,n),o=o.sibling;Xl=a,Ql=l,Kl=u}ws(e)}else 8772&a.subtreeFlags&&null!==o?(o.return=a,Xl=o):ws(e)}}function ws(e){for(;null!==Xl;){var t=Xl;if(8772&t.flags){var n=t.alternate;try{if(8772&t.flags)switch(t.tag){case 0:case 11:case 15:Kl||rs(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!Kl)if(null===n)r.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:nl(t.type,n.memoizedProps);r.componentDidUpdate(a,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;null!==i&&Vo(t,i,r);break;case 3:var l=t.updateQueue;if(null!==l){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}Vo(t,l,n)}break;case 5:var s=t.stateNode;if(null===n&&4&t.flags){n=s;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var c=t.alternate;if(null!==c){var d=c.memoizedState;if(null!==d){var f=d.dehydrated;null!==f&&Ut(f)}}}break;default:throw Error(o(163))}Kl||512&t.flags&&as(t)}catch(p){Eu(t,t.return,p)}}if(t===e){Xl=null;break}if(null!==(n=t.sibling)){n.return=t.return,Xl=n;break}Xl=t.return}}function ks(e){for(;null!==Xl;){var t=Xl;if(t===e){Xl=null;break}var n=t.sibling;if(null!==n){n.return=t.return,Xl=n;break}Xl=t.return}}function xs(e){for(;null!==Xl;){var t=Xl;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{rs(4,t)}catch(s){Eu(t,n,s)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var a=t.return;try{r.componentDidMount()}catch(s){Eu(t,a,s)}}var o=t.return;try{as(t)}catch(s){Eu(t,o,s)}break;case 5:var i=t.return;try{as(t)}catch(s){Eu(t,i,s)}}}catch(s){Eu(t,t.return,s)}if(t===e){Xl=null;break}var l=t.sibling;if(null!==l){l.return=t.return,Xl=l;break}Xl=t.return}}var Ss,Es=Math.ceil,_s=w.ReactCurrentDispatcher,Cs=w.ReactCurrentOwner,As=w.ReactCurrentBatchConfig,Ts=0,Ns=null,js=null,Ls=0,Ps=0,Os=Ea(0),Rs=0,Is=null,Fs=0,Ms=0,Ds=0,zs=null,Bs=null,$s=0,Us=1/0,Hs=null,Vs=!1,Ws=null,qs=null,Gs=!1,Ys=null,Qs=0,Ks=0,Zs=null,Xs=-1,Js=0;function eu(){return 6&Ts?Ze():-1!==Xs?Xs:Xs=Ze()}function tu(e){return 1&e.mode?2&Ts&&0!==Ls?Ls&-Ls:null!==mo.transition?(0===Js&&(Js=ht()),Js):0!==(e=vt)?e:e=void 0===(e=window.event)?16:Kt(e.type):1}function nu(e,t,n,r){if(50<Ks)throw Ks=0,Zs=null,Error(o(185));yt(e,n,r),2&Ts&&e===Ns||(e===Ns&&(!(2&Ts)&&(Ms|=n),4===Rs&&lu(e,Ls)),ru(e,r),1===n&&0===Ts&&!(1&t.mode)&&(Us=Ze()+500,za&&Ua()))}function ru(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,o=e.pendingLanes;0<o;){var i=31-it(o),l=1<<i,s=a[i];-1===s?l&n&&!(l&r)||(a[i]=pt(l,t)):s<=t&&(e.expiredLanes|=l),o&=~l}}(e,t);var r=ft(e,e===Ns?Ls:0);if(0===r)null!==n&&Ye(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&Ye(n),1===t)0===e.tag?function(e){za=!0,$a(e)}(su.bind(null,e)):$a(su.bind(null,e)),ia((function(){!(6&Ts)&&Ua()})),n=null;else{switch(wt(r)){case 1:n=Je;break;case 4:n=et;break;case 16:default:n=tt;break;case 536870912:n=rt}n=Nu(n,au.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function au(e,t){if(Xs=-1,Js=0,6&Ts)throw Error(o(327));var n=e.callbackNode;if(xu()&&e.callbackNode!==n)return null;var r=ft(e,e===Ns?Ls:0);if(0===r)return null;if(30&r||r&e.expiredLanes||t)t=mu(e,r);else{t=r;var a=Ts;Ts|=2;var i=gu();for(Ns===e&&Ls===t||(Hs=null,Us=Ze()+500,fu(e,t));;)try{bu();break}catch(s){pu(e,s)}Ao(),_s.current=i,Ts=a,null!==js?t=0:(Ns=null,Ls=0,t=Rs)}if(0!==t){if(2===t&&(0!==(a=gt(e))&&(r=a,t=ou(e,a))),1===t)throw n=Is,fu(e,0),lu(e,r),ru(e,Ze()),n;if(6===t)lu(e,r);else{if(a=e.current.alternate,!(30&r||function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var a=n[r],o=a.getSnapshot;a=a.value;try{if(!lr(o(),a))return!1}catch(l){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(a)||(t=mu(e,r),2===t&&(i=gt(e),0!==i&&(r=i,t=ou(e,i))),1!==t)))throw n=Is,fu(e,0),lu(e,r),ru(e,Ze()),n;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(o(345));case 2:case 5:ku(e,Bs,Hs);break;case 3:if(lu(e,r),(130023424&r)===r&&10<(t=$s+500-Ze())){if(0!==ft(e,0))break;if(((a=e.suspendedLanes)&r)!==r){eu(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=ra(ku.bind(null,e,Bs,Hs),t);break}ku(e,Bs,Hs);break;case 4:if(lu(e,r),(4194240&r)===r)break;for(t=e.eventTimes,a=-1;0<r;){var l=31-it(r);i=1<<l,(l=t[l])>a&&(a=l),r&=~i}if(r=a,10<(r=(120>(r=Ze()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Es(r/1960))-r)){e.timeoutHandle=ra(ku.bind(null,e,Bs,Hs),r);break}ku(e,Bs,Hs);break;default:throw Error(o(329))}}}return ru(e,Ze()),e.callbackNode===n?au.bind(null,e):null}function ou(e,t){var n=zs;return e.current.memoizedState.isDehydrated&&(fu(e,t).flags|=256),2!==(e=mu(e,t))&&(t=Bs,Bs=n,null!==t&&iu(t)),e}function iu(e){null===Bs?Bs=e:Bs.push.apply(Bs,e)}function lu(e,t){for(t&=~Ds,t&=~Ms,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-it(t),r=1<<n;e[n]=-1,t&=~r}}function su(e){if(6&Ts)throw Error(o(327));xu();var t=ft(e,0);if(!(1&t))return ru(e,Ze()),null;var n=mu(e,t);if(0!==e.tag&&2===n){var r=gt(e);0!==r&&(t=r,n=ou(e,r))}if(1===n)throw n=Is,fu(e,0),lu(e,t),ru(e,Ze()),n;if(6===n)throw Error(o(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ku(e,Bs,Hs),ru(e,Ze()),null}function uu(e,t){var n=Ts;Ts|=1;try{return e(t)}finally{0===(Ts=n)&&(Us=Ze()+500,za&&Ua())}}function cu(e){null!==Ys&&0===Ys.tag&&!(6&Ts)&&xu();var t=Ts;Ts|=1;var n=As.transition,r=vt;try{if(As.transition=null,vt=1,e)return e()}finally{vt=r,As.transition=n,!(6&(Ts=t))&&Ua()}}function du(){Ps=Os.current,_a(Os)}function fu(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,aa(n)),null!==js)for(n=js.return;null!==n;){var r=n;switch(to(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&Oa();break;case 3:Zo(),_a(Na),_a(Ta),ri();break;case 5:Jo(r);break;case 4:Zo();break;case 13:case 19:_a(ei);break;case 10:To(r.type._context);break;case 22:case 23:du()}n=n.return}if(Ns=e,js=e=Ou(e.current,null),Ls=Ps=t,Rs=0,Is=null,Ds=Ms=Fs=0,Bs=zs=null,null!==Po){for(t=0;t<Po.length;t++)if(null!==(r=(n=Po[t]).interleaved)){n.interleaved=null;var a=r.next,o=n.pending;if(null!==o){var i=o.next;o.next=a,r.next=i}n.pending=r}Po=null}return e}function pu(e,t){for(;;){var n=js;try{if(Ao(),ai.current=Xi,ci){for(var r=li.memoizedState;null!==r;){var a=r.queue;null!==a&&(a.pending=null),r=r.next}ci=!1}if(ii=0,ui=si=li=null,di=!1,fi=0,Cs.current=null,null===n||null===n.return){Rs=1,Is=t,js=null;break}e:{var i=e,l=n.return,s=n,u=t;if(t=Ls,s.flags|=32768,null!==u&&"object"==typeof u&&"function"==typeof u.then){var c=u,d=s,f=d.tag;if(!(1&d.mode||0!==f&&11!==f&&15!==f)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var g=ml(l);if(null!==g){g.flags&=-257,yl(g,l,s,0,t),1&g.mode&&hl(i,c,t),u=c;var h=(t=g).updateQueue;if(null===h){var m=new Set;m.add(u),t.updateQueue=m}else h.add(u);break e}if(!(1&t)){hl(i,c,t),hu();break e}u=Error(o(426))}else if(ao&&1&s.mode){var y=ml(l);if(null!==y){!(65536&y.flags)&&(y.flags|=256),yl(y,l,s,0,t),ho(ul(u,s));break e}}i=u=ul(u,s),4!==Rs&&(Rs=2),null===zs?zs=[i]:zs.push(i),i=l;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t,Uo(i,pl(0,u,t));break e;case 1:s=u;var b=i.type,v=i.stateNode;if(!(128&i.flags||"function"!=typeof b.getDerivedStateFromError&&(null===v||"function"!=typeof v.componentDidCatch||null!==qs&&qs.has(v)))){i.flags|=65536,t&=-t,i.lanes|=t,Uo(i,gl(i,s,t));break e}}i=i.return}while(null!==i)}wu(n)}catch(w){t=w,js===n&&null!==n&&(js=n=n.return);continue}break}}function gu(){var e=_s.current;return _s.current=Xi,null===e?Xi:e}function hu(){0!==Rs&&3!==Rs&&2!==Rs||(Rs=4),null===Ns||!(268435455&Fs)&&!(268435455&Ms)||lu(Ns,Ls)}function mu(e,t){var n=Ts;Ts|=2;var r=gu();for(Ns===e&&Ls===t||(Hs=null,fu(e,t));;)try{yu();break}catch(a){pu(e,a)}if(Ao(),Ts=n,_s.current=r,null!==js)throw Error(o(261));return Ns=null,Ls=0,Rs}function yu(){for(;null!==js;)vu(js)}function bu(){for(;null!==js&&!Qe();)vu(js)}function vu(e){var t=Ss(e.alternate,e,Ps);e.memoizedProps=e.pendingProps,null===t?wu(e):js=t,Cs.current=null}function wu(e){var t=e;do{var n=t.alternate;if(e=t.return,32768&t.flags){if(null!==(n=Yl(n,t)))return n.flags&=32767,void(js=n);if(null===e)return Rs=6,void(js=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}else if(null!==(n=Gl(n,t,Ps)))return void(js=n);if(null!==(t=t.sibling))return void(js=t);js=t=e}while(null!==t);0===Rs&&(Rs=5)}function ku(e,t,n){var r=vt,a=As.transition;try{As.transition=null,vt=1,function(e,t,n,r){do{xu()}while(null!==Ys);if(6&Ts)throw Error(o(327));n=e.finishedWork;var a=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(o(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var a=31-it(n),o=1<<a;t[a]=0,r[a]=-1,e[a]=-1,n&=~o}}(e,i),e===Ns&&(js=Ns=null,Ls=0),!(2064&n.subtreeFlags)&&!(2064&n.flags)||Gs||(Gs=!0,Nu(tt,(function(){return xu(),null}))),i=!!(15990&n.flags),!!(15990&n.subtreeFlags)||i){i=As.transition,As.transition=null;var l=vt;vt=1;var s=Ts;Ts|=4,Cs.current=null,function(e,t){if(ea=Vt,pr(e=fr())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var a=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch(k){n=null;break e}var l=0,s=-1,u=-1,c=0,d=0,f=e,p=null;t:for(;;){for(var g;f!==n||0!==a&&3!==f.nodeType||(s=l+a),f!==i||0!==r&&3!==f.nodeType||(u=l+r),3===f.nodeType&&(l+=f.nodeValue.length),null!==(g=f.firstChild);)p=f,f=g;for(;;){if(f===e)break t;if(p===n&&++c===a&&(s=l),p===i&&++d===r&&(u=l),null!==(g=f.nextSibling))break;p=(f=p).parentNode}f=g}n=-1===s||-1===u?null:{start:s,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(ta={focusedElem:e,selectionRange:n},Vt=!1,Xl=t;null!==Xl;)if(e=(t=Xl).child,1028&t.subtreeFlags&&null!==e)e.return=t,Xl=e;else for(;null!==Xl;){t=Xl;try{var h=t.alternate;if(1024&t.flags)switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==h){var m=h.memoizedProps,y=h.memoizedState,b=t.stateNode,v=b.getSnapshotBeforeUpdate(t.elementType===t.type?m:nl(t.type,m),y);b.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=t.stateNode.containerInfo;1===w.nodeType?w.textContent="":9===w.nodeType&&w.documentElement&&w.removeChild(w.documentElement);break;default:throw Error(o(163))}}catch(k){Eu(t,t.return,k)}if(null!==(e=t.sibling)){e.return=t.return,Xl=e;break}Xl=t.return}h=ts,ts=!1}(e,n),ms(n,e),gr(ta),Vt=!!ea,ta=ea=null,e.current=n,bs(n,e,a),Ke(),Ts=s,vt=l,As.transition=i}else e.current=n;if(Gs&&(Gs=!1,Ys=e,Qs=a),i=e.pendingLanes,0===i&&(qs=null),function(e){if(ot&&"function"==typeof ot.onCommitFiberRoot)try{ot.onCommitFiberRoot(at,e,void 0,!(128&~e.current.flags))}catch(t){}}(n.stateNode),ru(e,Ze()),null!==t)for(r=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],r(a.value,{componentStack:a.stack,digest:a.digest});if(Vs)throw Vs=!1,e=Ws,Ws=null,e;!!(1&Qs)&&0!==e.tag&&xu(),i=e.pendingLanes,1&i?e===Zs?Ks++:(Ks=0,Zs=e):Ks=0,Ua()}(e,t,n,r)}finally{As.transition=a,vt=r}return null}function xu(){if(null!==Ys){var e=wt(Qs),t=As.transition,n=vt;try{if(As.transition=null,vt=16>e?16:e,null===Ys)var r=!1;else{if(e=Ys,Ys=null,Qs=0,6&Ts)throw Error(o(331));var a=Ts;for(Ts|=4,Xl=e.current;null!==Xl;){var i=Xl,l=i.child;if(16&Xl.flags){var s=i.deletions;if(null!==s){for(var u=0;u<s.length;u++){var c=s[u];for(Xl=c;null!==Xl;){var d=Xl;switch(d.tag){case 0:case 11:case 15:ns(8,d,i)}var f=d.child;if(null!==f)f.return=d,Xl=f;else for(;null!==Xl;){var p=(d=Xl).sibling,g=d.return;if(os(d),d===c){Xl=null;break}if(null!==p){p.return=g,Xl=p;break}Xl=g}}}var h=i.alternate;if(null!==h){var m=h.child;if(null!==m){h.child=null;do{var y=m.sibling;m.sibling=null,m=y}while(null!==m)}}Xl=i}}if(2064&i.subtreeFlags&&null!==l)l.return=i,Xl=l;else e:for(;null!==Xl;){if(2048&(i=Xl).flags)switch(i.tag){case 0:case 11:case 15:ns(9,i,i.return)}var b=i.sibling;if(null!==b){b.return=i.return,Xl=b;break e}Xl=i.return}}var v=e.current;for(Xl=v;null!==Xl;){var w=(l=Xl).child;if(2064&l.subtreeFlags&&null!==w)w.return=l,Xl=w;else e:for(l=v;null!==Xl;){if(2048&(s=Xl).flags)try{switch(s.tag){case 0:case 11:case 15:rs(9,s)}}catch(x){Eu(s,s.return,x)}if(s===l){Xl=null;break e}var k=s.sibling;if(null!==k){k.return=s.return,Xl=k;break e}Xl=s.return}}if(Ts=a,Ua(),ot&&"function"==typeof ot.onPostCommitFiberRoot)try{ot.onPostCommitFiberRoot(at,e)}catch(x){}r=!0}return r}finally{vt=n,As.transition=t}}return!1}function Su(e,t,n){e=Bo(e,t=pl(0,t=ul(n,t),1),1),t=eu(),null!==e&&(yt(e,1,t),ru(e,t))}function Eu(e,t,n){if(3===e.tag)Su(e,e,n);else for(;null!==t;){if(3===t.tag){Su(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===qs||!qs.has(r))){t=Bo(t,e=gl(t,e=ul(n,e),1),1),e=eu(),null!==t&&(yt(t,1,e),ru(t,e));break}}t=t.return}}function _u(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=eu(),e.pingedLanes|=e.suspendedLanes&n,Ns===e&&(Ls&n)===n&&(4===Rs||3===Rs&&(130023424&Ls)===Ls&&500>Ze()-$s?fu(e,0):Ds|=n),ru(e,t)}function Cu(e,t){0===t&&(1&e.mode?(t=ct,!(130023424&(ct<<=1))&&(ct=4194304)):t=1);var n=eu();null!==(e=Io(e,t))&&(yt(e,t,n),ru(e,n))}function Au(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Cu(e,n)}function Tu(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;null!==a&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(o(314))}null!==r&&r.delete(t),Cu(e,n)}function Nu(e,t){return Ge(e,t)}function ju(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.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Lu(e,t,n,r){return new ju(e,t,n,r)}function Pu(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Ou(e,t){var n=e.alternate;return null===n?((n=Lu(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.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,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 Ru(e,t,n,r,a,i){var l=2;if(r=e,"function"==typeof e)Pu(e)&&(l=1);else if("string"==typeof e)l=5;else e:switch(e){case S:return Iu(n.children,a,i,t);case E:l=8,a|=8;break;case _:return(e=Lu(12,n,t,2|a)).elementType=_,e.lanes=i,e;case N:return(e=Lu(13,n,t,a)).elementType=N,e.lanes=i,e;case j:return(e=Lu(19,n,t,a)).elementType=j,e.lanes=i,e;case O:return Fu(n,a,i,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case C:l=10;break e;case A:l=9;break e;case T:l=11;break e;case L:l=14;break e;case P:l=16,r=null;break e}throw Error(o(130,null==e?e:typeof e,""))}return(t=Lu(l,n,t,a)).elementType=e,t.type=r,t.lanes=i,t}function Iu(e,t,n,r){return(e=Lu(7,e,r,t)).lanes=n,e}function Fu(e,t,n,r){return(e=Lu(22,e,r,t)).elementType=O,e.lanes=n,e.stateNode={isHidden:!1},e}function Mu(e,t,n){return(e=Lu(6,e,null,t)).lanes=n,e}function Du(e,t,n){return(t=Lu(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function zu(e,t,n,r,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=mt(0),this.expirationTimes=mt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mt(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function Bu(e,t,n,r,a,o,i,l,s){return e=new zu(e,t,n,l,s),1===t?(t=1,!0===o&&(t|=8)):t=0,o=Lu(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Mo(o),e}function $u(e){if(!e)return Aa;e:{if(Ue(e=e._reactInternals)!==e||1!==e.tag)throw Error(o(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Pa(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(o(171))}if(1===e.tag){var n=e.type;if(Pa(n))return Ia(e,n,t)}return t}function Uu(e,t,n,r,a,o,i,l,s){return(e=Bu(n,r,!0,e,0,o,0,l,s)).context=$u(null),n=e.current,(o=zo(r=eu(),a=tu(n))).callback=null!=t?t:null,Bo(n,o,a),e.current.lanes=a,yt(e,a,r),ru(e,r),e}function Hu(e,t,n,r){var a=t.current,o=eu(),i=tu(a);return n=$u(n),null===t.context?t.context=n:t.pendingContext=n,(t=zo(o,i)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Bo(a,t,i))&&(nu(e,a,i,o),$o(e,a,i)),i}function Vu(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Wu(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function qu(e,t){Wu(e,t),(e=e.alternate)&&Wu(e,t)}Ss=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||Na.current)vl=!0;else{if(!(e.lanes&n||128&t.flags))return vl=!1,function(e,t,n){switch(t.tag){case 3:Nl(t),go();break;case 5:Xo(t);break;case 1:Pa(t.type)&&Fa(t);break;case 4:Ko(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,a=t.memoizedProps.value;Ca(So,r._currentValue),r._currentValue=a;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(Ca(ei,1&ei.current),t.flags|=128,null):n&t.child.childLanes?Ml(e,t,n):(Ca(ei,1&ei.current),null!==(e=Vl(e,t,n))?e.sibling:null);Ca(ei,1&ei.current);break;case 19:if(r=!!(n&t.childLanes),128&e.flags){if(r)return Ul(e,t,n);t.flags|=128}if(null!==(a=t.memoizedState)&&(a.rendering=null,a.tail=null,a.lastEffect=null),Ca(ei,ei.current),r)break;return null;case 22:case 23:return t.lanes=0,El(e,t,n)}return Vl(e,t,n)}(e,t,n);vl=!!(131072&e.flags)}else vl=!1,ao&&1048576&t.flags&&Ja(t,qa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Hl(e,t),e=t.pendingProps;var a=La(t,Ta.current);jo(t,n),a=mi(null,t,r,e,a,n);var i=yi();return t.flags|=1,"object"==typeof a&&null!==a&&"function"==typeof a.render&&void 0===a.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Pa(r)?(i=!0,Fa(t)):i=!1,t.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,Mo(t),a.updater=al,t.stateNode=a,a._reactInternals=t,sl(t,r,e,n),t=Tl(null,t,r,!0,i,n)):(t.tag=0,ao&&i&&eo(t),wl(null,t,a,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Hl(e,t),e=t.pendingProps,r=(a=r._init)(r._payload),t.type=r,a=t.tag=function(e){if("function"==typeof e)return Pu(e)?1:0;if(null!=e){if((e=e.$$typeof)===T)return 11;if(e===L)return 14}return 2}(r),e=nl(r,e),a){case 0:t=Cl(null,t,r,e,n);break e;case 1:t=Al(null,t,r,e,n);break e;case 11:t=kl(null,t,r,e,n);break e;case 14:t=xl(null,t,r,nl(r.type,e),n);break e}throw Error(o(306,r,""))}return t;case 0:return r=t.type,a=t.pendingProps,Cl(e,t,r,a=t.elementType===r?a:nl(r,a),n);case 1:return r=t.type,a=t.pendingProps,Al(e,t,r,a=t.elementType===r?a:nl(r,a),n);case 3:e:{if(Nl(t),null===e)throw Error(o(387));r=t.pendingProps,a=(i=t.memoizedState).element,Do(e,t),Ho(t,r,null,n);var l=t.memoizedState;if(r=l.element,i.isDehydrated){if(i={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,256&t.flags){t=jl(e,t,r,n,a=ul(Error(o(423)),t));break e}if(r!==a){t=jl(e,t,r,n,a=ul(Error(o(424)),t));break e}for(ro=ua(t.stateNode.containerInfo.firstChild),no=t,ao=!0,oo=null,n=xo(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(go(),r===a){t=Vl(e,t,n);break e}wl(e,t,r,n)}t=t.child}return t;case 5:return Xo(t),null===e&&uo(t),r=t.type,a=t.pendingProps,i=null!==e?e.memoizedProps:null,l=a.children,na(r,a)?l=null:null!==i&&na(r,i)&&(t.flags|=32),_l(e,t),wl(e,t,l,n),t.child;case 6:return null===e&&uo(t),null;case 13:return Ml(e,t,n);case 4:return Ko(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=ko(t,null,r,n):wl(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,kl(e,t,r,a=t.elementType===r?a:nl(r,a),n);case 7:return wl(e,t,t.pendingProps,n),t.child;case 8:case 12:return wl(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,a=t.pendingProps,i=t.memoizedProps,l=a.value,Ca(So,r._currentValue),r._currentValue=l,null!==i)if(lr(i.value,l)){if(i.children===a.children&&!Na.current){t=Vl(e,t,n);break e}}else for(null!==(i=t.child)&&(i.return=t);null!==i;){var s=i.dependencies;if(null!==s){l=i.child;for(var u=s.firstContext;null!==u;){if(u.context===r){if(1===i.tag){(u=zo(-1,n&-n)).tag=2;var c=i.updateQueue;if(null!==c){var d=(c=c.shared).pending;null===d?u.next=u:(u.next=d.next,d.next=u),c.pending=u}}i.lanes|=n,null!==(u=i.alternate)&&(u.lanes|=n),No(i.return,n,t),s.lanes|=n;break}u=u.next}}else if(10===i.tag)l=i.type===t.type?null:i.child;else if(18===i.tag){if(null===(l=i.return))throw Error(o(341));l.lanes|=n,null!==(s=l.alternate)&&(s.lanes|=n),No(l,n,t),l=i.sibling}else l=i.child;if(null!==l)l.return=i;else for(l=i;null!==l;){if(l===t){l=null;break}if(null!==(i=l.sibling)){i.return=l.return,l=i;break}l=l.return}i=l}wl(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,jo(t,n),r=r(a=Lo(a)),t.flags|=1,wl(e,t,r,n),t.child;case 14:return a=nl(r=t.type,t.pendingProps),xl(e,t,r,a=nl(r.type,a),n);case 15:return Sl(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:nl(r,a),Hl(e,t),t.tag=1,Pa(r)?(e=!0,Fa(t)):e=!1,jo(t,n),il(t,r,a),sl(t,r,a,n),Tl(null,t,r,!0,e,n);case 19:return Ul(e,t,n);case 22:return El(e,t,n)}throw Error(o(156,t.tag))};var Gu="function"==typeof reportError?reportError:function(e){console.error(e)};function Yu(e){this._internalRoot=e}function Qu(e){this._internalRoot=e}function Ku(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Zu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Xu(){}function Ju(e,t,n,r,a){var o=n._reactRootContainer;if(o){var i=o;if("function"==typeof a){var l=a;a=function(){var e=Vu(i);l.call(e)}}Hu(t,i,e,a)}else i=function(e,t,n,r,a){if(a){if("function"==typeof r){var o=r;r=function(){var e=Vu(i);o.call(e)}}var i=Uu(t,r,e,0,null,!1,0,"",Xu);return e._reactRootContainer=i,e[ga]=i.current,Ur(8===e.nodeType?e.parentNode:e),cu(),i}for(;a=e.lastChild;)e.removeChild(a);if("function"==typeof r){var l=r;r=function(){var e=Vu(s);l.call(e)}}var s=Bu(e,0,!1,null,0,!1,0,"",Xu);return e._reactRootContainer=s,e[ga]=s.current,Ur(8===e.nodeType?e.parentNode:e),cu((function(){Hu(t,s,n,r)})),s}(n,t,e,a,r);return Vu(i)}Qu.prototype.render=Yu.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(o(409));Hu(e,t,null,null)},Qu.prototype.unmount=Yu.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;cu((function(){Hu(null,e,null,null)})),t[ga]=null}},Qu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Et();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ot.length&&0!==t&&t<Ot[n].priority;n++);Ot.splice(n,0,e),0===n&&Mt(e)}},kt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=dt(t.pendingLanes);0!==n&&(bt(t,1|n),ru(t,Ze()),!(6&Ts)&&(Us=Ze()+500,Ua()))}break;case 13:cu((function(){var t=Io(e,1);if(null!==t){var n=eu();nu(t,e,1,n)}})),qu(e,1)}},xt=function(e){if(13===e.tag){var t=Io(e,134217728);if(null!==t)nu(t,e,134217728,eu());qu(e,134217728)}},St=function(e){if(13===e.tag){var t=tu(e),n=Io(e,t);if(null!==n)nu(n,e,t,eu());qu(e,t)}},Et=function(){return vt},_t=function(e,t){var n=vt;try{return vt=e,t()}finally{vt=n}},xe=function(e,t,n){switch(t){case"input":if(X(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=ka(r);if(!a)throw Error(o(90));G(r),X(r,a)}}}break;case"textarea":oe(e,n);break;case"select":null!=(t=n.value)&&ne(e,!!n.multiple,t,!1)}},Te=uu,Ne=cu;var ec={usingClientEntryPoint:!1,Events:[va,wa,ka,Ce,Ae,uu]},tc={findFiberByHostInstance:ba,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},nc={bundleType:tc.bundleType,version:tc.version,rendererPackageName:tc.rendererPackageName,rendererConfig:tc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:w.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=We(e))?null:e.stateNode},findFiberByHostInstance:tc.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rc.isDisabled&&rc.supportsFiber)try{at=rc.inject(nc),ot=rc}catch(ce){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ec,t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Ku(t))throw Error(o(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:x,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.createRoot=function(e,t){if(!Ku(e))throw Error(o(299));var n=!1,r="",a=Gu;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(a=t.onRecoverableError)),t=Bu(e,1,!1,null,0,n,0,r,a),e[ga]=t.current,Ur(8===e.nodeType?e.parentNode:e),new Yu(t)},t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(o(188));throw e=Object.keys(e).join(","),Error(o(268,e))}return e=null===(e=We(t))?null:e.stateNode},t.flushSync=function(e){return cu(e)},t.hydrate=function(e,t,n){if(!Zu(t))throw Error(o(200));return Ju(null,e,t,!0,n)},t.hydrateRoot=function(e,t,n){if(!Ku(e))throw Error(o(405));var r=null!=n&&n.hydratedSources||null,a=!1,i="",l=Gu;if(null!=n&&(!0===n.unstable_strictMode&&(a=!0),void 0!==n.identifierPrefix&&(i=n.identifierPrefix),void 0!==n.onRecoverableError&&(l=n.onRecoverableError)),t=Uu(t,null,e,1,null!=n?n:null,a,0,i,l),e[ga]=t.current,Ur(e),r)for(e=0;e<r.length;e++)a=(a=(n=r[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new Qu(t)},t.render=function(e,t,n){if(!Zu(t))throw Error(o(200));return Ju(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!Zu(e))throw Error(o(40));return!!e._reactRootContainer&&(cu((function(){Ju(null,null,e,!1,(function(){e._reactRootContainer=null,e[ga]=null}))})),!0)},t.unstable_batchedUpdates=uu,t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Zu(n))throw Error(o(200));if(null==e||void 0===e._reactInternals)throw Error(o(38));return Ju(e,t,n,!1,r)},t.version="18.3.1-next-f1338f8080-20240426"},5338:(e,t,n)=>{"use strict";var r=n(961);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},961:(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(2551)},115: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,u,c;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(c=e.entries();!(s=c.next()).done;)if(!i.has(s.value[0]))return!1;for(c=e.entries();!(s=c.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(c=e.entries();!(s=c.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=(u=Object.keys(e)).length)!==Object.keys(i).length)return!1;for(s=l;0!=s--;)if(!Object.prototype.hasOwnProperty.call(i,u[s]))return!1;if(t&&e instanceof Element)return!1;for(s=l;0!=s--;)if(("_owner"!==u[s]&&"__v"!==u[s]&&"__o"!==u[s]||!e.$$typeof)&&!o(e[u[s]],i[u[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}}},545:(e,t,n)=>{"use strict";n.d(t,{mg:()=>J,vd:()=>W});var r=n(6540),a=n(5556),o=n.n(a),i=n(115),l=n.n(i),s=n(311),u=n.n(s),c=n(2833),d=n.n(c);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,g(e,t)}function g(e,t){return g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},g(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 m={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title",FRAGMENT:"Symbol(react.fragment)"},y={rel:["amphtml","canonical","alternate"]},b={type:["application/ld+json"]},v={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(m).map((function(e){return m[e]})),k={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},x=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},E=function(e){var t=S(e,m.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},_=function(e){return S(e,"onChangeClientState")||function(){}},C=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)}),{})},A=function(e,t){return t.filter((function(e){return void 0!==e[m.BASE]})).map((function(e){return e[m.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}),[])},T=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 u=e[n].toLowerCase();return r[n]||(r[n]={}),a[n]||(a[n]={}),!r[n][u]&&(a[n][u]=!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()},N=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},j=function(e){return Array.isArray(e)?e.join(""):e},L=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=[m.NOSCRIPT,m.SCRIPT,m.STYLE],R=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,"'")},I=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}),"")},F=function(e,t){return void 0===t&&(t={}),Object.keys(e).reduce((function(t,n){return t[k[n]||n]=e[n],t}),t)},M=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)}))},D=function(e,t,n){switch(e){case m.TITLE:return{toComponent:function(){return n=t.titleAttributes,(a={key:e=t.title})["data-rh"]=!0,o=F(n,a),[r.createElement(m.TITLE,o,e)];var e,n,a,o},toString:function(){return function(e,t,n,r){var a=I(n),o=j(t);return a?"<"+e+' data-rh="true" '+a+">"+R(o,r)+"</"+e+">":"<"+e+' data-rh="true">'+R(o,r)+"</"+e+">"}(e,t.title,t.titleAttributes,n)}};case"bodyAttributes":case"htmlAttributes":return{toComponent:function(){return F(t)},toString:function(){return I(t)}};default:return{toComponent:function(){return M(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+'="'+R(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)}}}},z=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,u=e.titleAttributes,c=e.linkTags,d=e.metaTags,f=e.scriptTags,p={toComponent:function(){},toString:function(){return""}};if(e.prioritizeSeoTags){var g=function(e){var t=e.linkTags,n=e.scriptTags,r=e.encode,a=L(e.metaTags,v),o=L(t,y),i=L(n,b);return{priorityMethods:{toComponent:function(){return[].concat(M(m.META,a.priority),M(m.LINK,o.priority),M(m.SCRIPT,i.priority))},toString:function(){return D(m.META,a.priority,r)+" "+D(m.LINK,o.priority,r)+" "+D(m.SCRIPT,i.priority,r)}},metaTags:a.default,linkTags:o.default,scriptTags:i.default}}(e);p=g.priorityMethods,c=g.linkTags,d=g.metaTags,f=g.scriptTags}return{priority:p,base:D(m.BASE,t,r),bodyAttributes:D("bodyAttributes",n,r),htmlAttributes:D("htmlAttributes",a,r),link:D(m.LINK,c,r),meta:D(m.META,d,r),noscript:D(m.NOSCRIPT,o,r),script:D(m.SCRIPT,f,r),style:D(m.STYLE,i,r),title:D(m.TITLE,{title:s,titleAttributes:u},r)}},B=[],$=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?B:n.instances},add:function(e){(n.canUseDOM?B:n.instances).push(e)},remove:function(e){var t=(n.canUseDOM?B:n.instances).indexOf(e);(n.canUseDOM?B:n.instances).splice(t,1)}}},this.context=e,this.canUseDOM=t,t||(e.helmet=z({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))},U=r.createContext({}),H=o().shape({setHelmet:o().func,helmetInstances:o().shape({get:o().func,add:o().func,remove:o().func})}),V="undefined"!=typeof document,W=function(e){function t(n){var r;return(r=e.call(this,n)||this).helmetData=new $(r.props.context,t.canUseDOM),r}return p(t,e),t.prototype.render=function(){return r.createElement(U.Provider,{value:this.helmetData.value},this.props.children)},t}(r.Component);W.canUseDOM=V,W.propTypes={context:o().shape({helmet:o().shape()}),children:o().node.isRequired},W.defaultProps={context:{}},W.displayName="HelmetProvider";var q=function(e,t){var n,r=document.head||document.querySelector(m.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}},G=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],u=t[s]||"";n.getAttribute(s)!==u&&n.setAttribute(s,u),-1===a.indexOf(s)&&a.push(s);var c=o.indexOf(s);-1!==c&&o.splice(c,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(","))}},Y=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,u=e.styleTags,c=e.title,d=e.titleAttributes;G(m.BODY,e.bodyAttributes),G(m.HTML,r),function(e,t){void 0!==e&&document.title!==e&&(document.title=j(e)),G(m.TITLE,t)}(c,d);var f={baseTag:q(m.BASE,n),linkTags:q(m.LINK,a),metaTags:q(m.META,o),noscriptTags:q(m.NOSCRIPT,i),scriptTags:q(m.SCRIPT,s),styleTags:q(m.STYLE,u)},p={},g={};Object.keys(f).forEach((function(e){var t=f[e],n=t.newTags,r=t.oldTags;n.length&&(p[e]=n),r.length&&(g[e]=f[e].oldTags)})),t&&t(),l(e,p,g)},Q=null,K=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:A(["href"],e),bodyAttributes:C("bodyAttributes",e),defer:S(e,"defer"),encode:S(e,"encodeSpecialCharacters"),htmlAttributes:C("htmlAttributes",e),linkTags:T(m.LINK,["rel","href"],e),metaTags:T(m.META,["name","charset","http-equiv","property","itemprop"],e),noscriptTags:T(m.NOSCRIPT,["innerHTML"],e),onChangeClientState:_(e),scriptTags:T(m.SCRIPT,["src","innerHTML"],e),styleTags:T(m.STYLE,["cssText"],e),title:E(e),titleAttributes:C("titleAttributes",e),prioritizeSeoTags:N(e,"prioritizeSeoTags")});W.canUseDOM?(t=o,Q&&cancelAnimationFrame(Q),t.defer?Q=requestAnimationFrame((function(){Y(t,(function(){Q=null}))})):(Y(t),Q=null)):z&&(a=z(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);K.propTypes={context:H.isRequired},K.displayName="HelmetDispatcher";var Z=["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 m.SCRIPT:case m.NOSCRIPT:return{innerHTML:t};case m.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 m.TITLE:return f({},a,((t={})[r.type]=i,t.titleAttributes=f({},o),t));case m.BODY:return f({},a,{bodyAttributes:f({},o)});case m.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 u()(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."),u()(!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,Z),l=Object.keys(i).reduce((function(e,t){return e[x[t]||t]=i[t],e}),{}),s=e.type;switch("symbol"==typeof s?s=s.toString():n.warnOnInvalidChildren(e,o),s){case m.FRAGMENT:t=n.mapChildrenToProps(o,t);break;case m.LINK:case m.META:case m.NOSCRIPT:case m.SCRIPT:case m.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 $||(o=new $(o.context,o.instances)),o?r.createElement(K,f({},a,{context:o.value,helmetData:void 0})):r.createElement(U.Consumer,null,(function(e){return r.createElement(K,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"},2799:(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,u=n?Symbol.for("react.context"):60110,c=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,g=n?Symbol.for("react.suspense_list"):60120,h=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,y=n?Symbol.for("react.block"):60121,b=n?Symbol.for("react.fundamental"):60117,v=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 c:case d:case o:case l:case i:case p:return e;default:switch(e=e&&e.$$typeof){case u:case f:case m:case h:case s:return e;default:return t}}case a:return t}}}function x(e){return k(e)===d}t.AsyncMode=c,t.ConcurrentMode=d,t.ContextConsumer=u,t.ContextProvider=s,t.Element=r,t.ForwardRef=f,t.Fragment=o,t.Lazy=m,t.Memo=h,t.Portal=a,t.Profiler=l,t.StrictMode=i,t.Suspense=p,t.isAsyncMode=function(e){return x(e)||k(e)===c},t.isConcurrentMode=x,t.isContextConsumer=function(e){return k(e)===u},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)===m},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===g||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===h||e.$$typeof===s||e.$$typeof===u||e.$$typeof===f||e.$$typeof===b||e.$$typeof===v||e.$$typeof===w||e.$$typeof===y)},t.typeOf=k},4363:(e,t,n)=>{"use strict";e.exports=n(2799)},3259:(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(6540),s=[],u=[];var c=l.createContext(null);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 g(e,t){var d,f;if(!t.loading)throw new Error("react-loadable requires a `loading` component");var g=i({loader:null,loading:null,delay:200,timeout:null,render:p,webpack:null,modules:null},t),h=null;function m(){return h||(h=e(g.loader)),h.promise}return s.push(m),"function"==typeof g.webpack&&u.push((function(){if((0,g.webpack)().every((function(e){return void 0!==e&&void 0!==n.m[e]})))return m()})),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(g.loader),r._loadModule()})),m(),r.state={error:h.error,pastDelay:!1,timedOut:!1,loading:h.loading,loaded:h.loaded},r}r(n,t),n.preload=function(){return m()};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&&Array.isArray(g.modules)&&g.modules.forEach((function(t){e.context.report(t)})),h.loading){var t=function(t){e._mounted&&e.setState(t)};"number"==typeof g.delay&&(0===g.delay?this.setState({pastDelay:!0}):this._delay=setTimeout((function(){t({pastDelay:!0})}),g.delay)),"number"==typeof g.timeout&&(this._timeout=setTimeout((function(){t({timedOut:!0})}),g.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(g.loading,{isLoading:this.state.loading,pastDelay:this.state.pastDelay,timedOut:this.state.timedOut,error:this.state.error,retry:this.retry}):this.state.loaded?g.render(this.state.loaded,this.props):null},n}(l.Component),o(d,"contextType",c),f}function h(e){return g(d,e)}h.Map=function(e){if("function"!=typeof e.render)throw new Error("LoadableMap requires a `render(loaded, props)` function");return g(f,e)};var m=function(e){function t(){return e.apply(this,arguments)||this}return r(t,e),t.prototype.render=function(){return l.createElement(c.Provider,{value:{report:this.props.report}},l.Children.only(this.props.children))},t}(l.Component);function y(e){for(var t=[];e.length;){var n=e.pop();t.push(n())}return Promise.all(t).then((function(){if(e.length)return y(e)}))}h.Capture=m,h.preloadAll=function(){return new Promise((function(e,t){y(s).then(e,t)}))},h.preloadReady=function(){return new Promise((function(e,t){y(u).then(e,e)}))},e.exports=h},2831:(e,t,n)=>{"use strict";n.d(t,{u:()=>i,v:()=>l});var r=n(6347),a=n(8168),o=n(6540);function i(e,t,n){return void 0===n&&(n=[]),e.some((function(e){var a=e.path?(0,r.B6)(t,e):n.length?n[n.length-1].match:r.Ix.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.dO,n,e.map((function(e,n){return o.createElement(r.qh,{key:e.key||n,path:e.path,exact:e.exact,strict:e.strict,render:function(n){return e.render?e.render((0,a.A)({},n,{},t,{route:e})):o.createElement(e.component,(0,a.A)({},n,t,{route:e}))}})}))):null}},4625:(e,t,n)=>{"use strict";n.d(t,{Kd:()=>c,N_:()=>m,k2:()=>v});var r=n(6347),a=n(2892),o=n(6540),i=n(1513),l=n(8168),s=n(8587),u=n(1561),c=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.zR)(t.props),t}return(0,a.A)(t,e),t.prototype.render=function(){return o.createElement(r.Ix,{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.yJ)(e,null,null,t):e},p=function(e){return e},g=o.forwardRef;void 0===g&&(g=p);var h=g((function(e,t){var n=e.innerRef,r=e.navigate,a=e.onClick,i=(0,s.A)(e,["innerRef","navigate","onClick"]),u=i.target,c=(0,l.A)({},i,{onClick:function(e){try{a&&a(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||u&&"_self"!==u||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return c.ref=p!==g&&t||n,o.createElement("a",c)}));var m=g((function(e,t){var n=e.component,a=void 0===n?h:n,c=e.replace,m=e.to,y=e.innerRef,b=(0,s.A)(e,["component","replace","to","innerRef"]);return o.createElement(r.XZ.Consumer,null,(function(e){e||(0,u.A)(!1);var n=e.history,r=f(d(m,e.location),e.location),s=r?n.createHref(r):"",h=(0,l.A)({},b,{href:s,navigate:function(){var t=d(m,e.location),r=(0,i.AO)(e.location)===(0,i.AO)(f(t));(c||r?n.replace:n.push)(t)}});return p!==g?h.ref=t||y:h.innerRef=y,o.createElement(a,h)}))})),y=function(e){return e},b=o.forwardRef;void 0===b&&(b=y);var v=b((function(e,t){var n=e["aria-current"],a=void 0===n?"page":n,i=e.activeClassName,c=void 0===i?"active":i,p=e.activeStyle,g=e.className,h=e.exact,v=e.isActive,w=e.location,k=e.sensitive,x=e.strict,S=e.style,E=e.to,_=e.innerRef,C=(0,s.A)(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return o.createElement(r.XZ.Consumer,null,(function(e){e||(0,u.A)(!1);var n=w||e.location,i=f(d(E,n),n),s=i.pathname,A=s&&s.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),T=A?(0,r.B6)(n.pathname,{path:A,exact:h,sensitive:k,strict:x}):null,N=!!(v?v(T,n):T),j="function"==typeof g?g(N):g,L="function"==typeof S?S(N):S;N&&(j=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(" ")}(j,c),L=(0,l.A)({},L,p));var P=(0,l.A)({"aria-current":N&&a||null,className:j,style:L,to:i},C);return y!==b?P.ref=t||_:P.innerRef=_,o.createElement(m,P)}))}))},6347:(e,t,n)=>{"use strict";n.d(t,{B6:()=>S,Ix:()=>v,W6:()=>P,XZ:()=>b,dO:()=>j,qh:()=>E,zy:()=>O});var r=n(2892),a=n(6540),o=n(5556),i=n.n(o),l=n(1513),s=n(1561),u=n(8168),c=n(8505),d=n.n(c),f=(n(4363),n(8587)),p=(n(4146),1073741823),g="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 g[e]=(g[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.A)(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 u=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|e.observedBits)&n&&e.setState({value:e.getValue()})},e}(0,r.A)(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 u.contextTypes=((o={})[l]=i().object,o),{Provider:s,Consumer:u}},m=function(e){var t=h();return t.displayName=e,t},y=m("Router-History"),b=m("Router"),v=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.A)(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(b.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 w={},k=1e4,x=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,u=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 x<k&&(r[e]=o,x++),o}(n,{end:o,strict:l,sensitive:u}),a=r.regexp,i=r.keys,s=a.exec(e);if(!s)return null;var c=s[0],f=s.slice(1),p=e===c;return o&&!p?null:{path:n,url:"/"===n&&""===c?"/":c,isExact:p,params:i.reduce((function(e,t,n){return e[t.name]=f[n],e}),{})}}),null)}var E=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.A)(t,e),t.prototype.render=function(){var e=this;return a.createElement(b.Consumer,null,(function(t){t||(0,s.A)(!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,u.A)({},t,{location:n,match:r}),i=e.props,l=i.children,c=i.component,d=i.render;return Array.isArray(l)&&function(e){return 0===a.Children.count(e)}(l)&&(l=null),a.createElement(b.Provider,{value:o},o.match?l?"function"==typeof l?l(o):l:c?a.createElement(c,o):d?d(o):null:"function"==typeof l?l(o):null)}))},t}(a.Component);function _(e){return"/"===e.charAt(0)?e:"/"+e}function C(e,t){if(!e)return t;var n=_(e);return 0!==t.pathname.indexOf(n)?t:(0,u.A)({},t,{pathname:t.pathname.substr(n.length)})}function A(e){return"string"==typeof e?e:(0,l.AO)(e)}function T(e){return function(){(0,s.A)(!1)}}function N(){}a.Component;var j=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.A)(t,e),t.prototype.render=function(){var e=this;return a.createElement(b.Consumer,null,(function(t){t||(0,s.A)(!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,u.A)({},e.props,{path:i})):t.match}})),r?a.cloneElement(n,{location:o,computedMatch:r}):null}))},t}(a.Component);var L=a.useContext;function P(){return L(y)}function O(){return L(b).location}},8505:(e,t,n)=>{var r=n(4634);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="",c=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 g=e[i],h=n[2],m=n[3],y=n[4],b=n[5],v=n[6],w=n[7];l&&(r.push(l),l="");var k=null!=h&&null!=g&&g!==h,x="+"===v||"*"===v,S="?"===v||"*"===v,E=n[2]||c,_=y||b;r.push({name:m||o++,prefix:h||"",delimiter:E,optional:S,repeat:x,partial:k,asterisk:!!w,pattern:_?u(_):w?".*":"[^"+s(E)+"]+?"})}}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,u=0;u<e.length;u++){var c=e[u];if("string"!=typeof c){var d,f=l[c.name];if(null==f){if(c.optional){c.partial&&(o+=c.prefix);continue}throw new TypeError('Expected "'+c.name+'" to be defined')}if(r(f)){if(!c.repeat)throw new TypeError('Expected "'+c.name+'" to not repeat, but received `'+JSON.stringify(f)+"`");if(0===f.length){if(c.optional)continue;throw new TypeError('Expected "'+c.name+'" to not be empty')}for(var p=0;p<f.length;p++){if(d=s(f[p]),!n[u].test(d))throw new TypeError('Expected all "'+c.name+'" to match "'+c.pattern+'", but received `'+JSON.stringify(d)+"`");o+=(0===p?c.prefix:c.delimiter)+d}}else{if(d=c.asterisk?encodeURI(f).replace(/[?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})):s(f),!n[u].test(d))throw new TypeError('Expected "'+c.name+'" to match "'+c.pattern+'", but received "'+d+'"');o+=c.prefix+d}}else o+=c}return o}}function s(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function u(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function c(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 u=e[l];if("string"==typeof u)i+=s(u);else{var f=s(u.prefix),p="(?:"+u.pattern+")";t.push(u),u.repeat&&(p+="(?:"+f+p+")*"),i+=p=u.optional?u.partial?f+"("+p+")?":"(?:"+f+"("+p+"))?":f+"("+p+")"}}var g=s(n.delimiter||"/"),h=i.slice(-g.length)===g;return a||(i=(h?i.slice(0,-g.length):i)+"(?:"+g+"(?=$))?"),i+=o?"$":a&&h?"":"(?="+g+"|$)",c(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 c(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 c(new RegExp("(?:"+r.join("|")+")",d(n)),t)}(e,t,n):function(e,t,n){return f(o(e,n),t,n)}(e,t,n)}},1020:(e,t,n)=>{"use strict";var r=n(6540),a=Symbol.for("react.element"),o=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,n){var r,o={},u=null,c=null;for(r in void 0!==n&&(u=""+n),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(c=t.ref),t)i.call(t,r)&&!s.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:a,type:e,key:u,ref:c,props:o,_owner:l.current}}t.Fragment=o,t.jsx=u,t.jsxs=u},5287:(e,t)=>{"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.iterator;var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,m={};function y(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||g}function b(){}function v(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=y.prototype;var w=v.prototype=new b;w.constructor=v,h(w,y.prototype),w.isPureReactComponent=!0;var k=Array.isArray,x=Object.prototype.hasOwnProperty,S={current:null},E={key:!0,ref:!0,__self:!0,__source:!0};function _(e,t,r){var a,o={},i=null,l=null;if(null!=t)for(a in void 0!==t.ref&&(l=t.ref),void 0!==t.key&&(i=""+t.key),t)x.call(t,a)&&!E.hasOwnProperty(a)&&(o[a]=t[a]);var s=arguments.length-2;if(1===s)o.children=r;else if(1<s){for(var u=Array(s),c=0;c<s;c++)u[c]=arguments[c+2];o.children=u}if(e&&e.defaultProps)for(a in s=e.defaultProps)void 0===o[a]&&(o[a]=s[a]);return{$$typeof:n,type:e,key:i,ref:l,props:o,_owner:S.current}}function C(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var A=/\/+/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 N(e,t,a,o,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 n:case r:s=!0}}if(s)return i=i(s=e),e=""===o?"."+T(s,0):o,k(i)?(a="",null!=e&&(a=e.replace(A,"$&/")+"/"),N(i,t,a,"",(function(e){return e}))):null!=i&&(C(i)&&(i=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(i,a+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(A,"$&/")+"/")+e)),t.push(i)),1;if(s=0,o=""===o?".":o+":",k(e))for(var u=0;u<e.length;u++){var c=o+T(l=e[u],u);s+=N(l,t,a,c,i)}else if(c=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"==typeof c)for(e=c.call(e),u=0;!(l=e.next()).done;)s+=N(l=l.value,t,a,c=o+T(l,u++),i);else if("object"===l)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function j(e,t,n){if(null==e)return e;var r=[],a=0;return N(e,r,"","",(function(e){return t.call(n,e,a++)})),r}function L(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var P={current:null},O={transition:null},R={ReactCurrentDispatcher:P,ReactCurrentBatchConfig:O,ReactCurrentOwner:S};function I(){throw Error("act(...) is not supported in production builds of React.")}t.Children={map:j,forEach:function(e,t,n){j(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return j(e,(function(){t++})),t},toArray:function(e){return j(e,(function(e){return e}))||[]},only:function(e){if(!C(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=y,t.Fragment=a,t.Profiler=i,t.PureComponent=v,t.StrictMode=o,t.Suspense=c,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=R,t.act=I,t.cloneElement=function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var a=h({},e.props),o=e.key,i=e.ref,l=e._owner;if(null!=t){if(void 0!==t.ref&&(i=t.ref,l=S.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(u in t)x.call(t,u)&&!E.hasOwnProperty(u)&&(a[u]=void 0===t[u]&&void 0!==s?s[u]:t[u])}var u=arguments.length-2;if(1===u)a.children=r;else if(1<u){s=Array(u);for(var c=0;c<u;c++)s[c]=arguments[c+2];a.children=s}return{$$typeof:n,type:e.type,key:o,ref:i,props:a,_owner:l}},t.createContext=function(e){return(e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:l,_context:e},e.Consumer=e},t.createElement=_,t.createFactory=function(e){var t=_.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:u,render:e}},t.isValidElement=C,t.lazy=function(e){return{$$typeof:f,_payload:{_status:-1,_result:e},_init:L}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=O.transition;O.transition={};try{e()}finally{O.transition=t}},t.unstable_act=I,t.useCallback=function(e,t){return P.current.useCallback(e,t)},t.useContext=function(e){return P.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return P.current.useDeferredValue(e)},t.useEffect=function(e,t){return P.current.useEffect(e,t)},t.useId=function(){return P.current.useId()},t.useImperativeHandle=function(e,t,n){return P.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return P.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return P.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return P.current.useMemo(e,t)},t.useReducer=function(e,t,n){return P.current.useReducer(e,t,n)},t.useRef=function(e){return P.current.useRef(e)},t.useState=function(e){return P.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return P.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return P.current.useTransition()},t.version="18.3.1"},6540:(e,t,n)=>{"use strict";e.exports=n(5287)},4848:(e,t,n)=>{"use strict";e.exports=n(1020)},7463:(e,t)=>{"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,a=e[r];if(!(0<o(a,t)))break e;e[r]=t,e[n]=a,n=r}}function r(e){return 0===e.length?null:e[0]}function a(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length,i=a>>>1;r<i;){var l=2*(r+1)-1,s=e[l],u=l+1,c=e[u];if(0>o(s,n))u<a&&0>o(c,s)?(e[r]=c,e[u]=n,r=u):(e[r]=s,e[l]=n,r=l);else{if(!(u<a&&0>o(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}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}}var u=[],c=[],d=1,f=null,p=3,g=!1,h=!1,m=!1,y="function"==typeof setTimeout?setTimeout:null,b="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function w(e){for(var t=r(c);null!==t;){if(null===t.callback)a(c);else{if(!(t.startTime<=e))break;a(c),t.sortIndex=t.expirationTime,n(u,t)}t=r(c)}}function k(e){if(m=!1,w(e),!h)if(null!==r(u))h=!0,O(x);else{var t=r(c);null!==t&&R(k,t.startTime-e)}}function x(e,n){h=!1,m&&(m=!1,b(C),C=-1),g=!0;var o=p;try{for(w(n),f=r(u);null!==f&&(!(f.expirationTime>n)||e&&!N());){var i=f.callback;if("function"==typeof i){f.callback=null,p=f.priorityLevel;var l=i(f.expirationTime<=n);n=t.unstable_now(),"function"==typeof l?f.callback=l:f===r(u)&&a(u),w(n)}else a(u);f=r(u)}if(null!==f)var s=!0;else{var d=r(c);null!==d&&R(k,d.startTime-n),s=!1}return s}finally{f=null,p=o,g=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,E=!1,_=null,C=-1,A=5,T=-1;function N(){return!(t.unstable_now()-T<A)}function j(){if(null!==_){var e=t.unstable_now();T=e;var n=!0;try{n=_(!0,e)}finally{n?S():(E=!1,_=null)}}else E=!1}if("function"==typeof v)S=function(){v(j)};else if("undefined"!=typeof MessageChannel){var L=new MessageChannel,P=L.port2;L.port1.onmessage=j,S=function(){P.postMessage(null)}}else S=function(){y(j,0)};function O(e){_=e,E||(E=!0,S())}function R(e,n){C=y((function(){e(t.unstable_now())}),n)}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(){h||g||(h=!0,O(x))},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"):A=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return r(u)},t.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},t.unstable_scheduleCallback=function(e,a,o){var i=t.unstable_now();switch("object"==typeof o&&null!==o?o="number"==typeof(o=o.delay)&&0<o?i+o:i:o=i,e){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return e={id:d++,callback:a,priorityLevel:e,startTime:o,expirationTime:l=o+l,sortIndex:-1},o>i?(e.sortIndex=o,n(c,e),null===r(u)&&e===r(c)&&(m?(b(C),C=-1):m=!0,R(k,o-i))):(e.sortIndex=l,n(u,e),h||g||(h=!0,O(x))),e},t.unstable_shouldYield=N,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}},9982:(e,t,n)=>{"use strict";e.exports=n(7463)},2833: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 u=o[s];if(!l(u))return!1;var c=e[u],d=t[u];if(!1===(a=n?n.call(r,c,d,u):void 0)||void 0===a&&c!==d)return!1}return!0}},4784:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={title:"Botrino",tagline:"A simple yet powerful framework to develop, configure and run Discord bots based on Discord4J.",url:"https://botrino.alex1304.com",baseUrl:"/",onBrokenLinks:"throw",onBrokenMarkdownLinks:"warn",favicon:"img/favicon.ico",organizationName:"Alex1304",projectName:"botrino",themeConfig:{colorMode:{defaultMode:"dark",disableSwitch:!1,respectPrefersColorScheme:!1},navbar:{title:"Botrino",logo:{alt:"Botrino Logo",src:"img/logo.svg"},items:[{to:"docs/",activeBasePath:"docs",label:"Docs",position:"left"},{href:"https://github.com/Alex1304/botrino",label:"GitHub",position:"right"}],hideOnScroll:!1},footer:{style:"dark",links:[{title:"Docs",items:[{label:"Introduction",to:"docs/"},{label:"Getting Started",to:"docs/getting-started"}]},{title:"More",items:[{label:"GitHub",href:"https://github.com/Alex1304/botrino"}]}],copyright:"Copyright \xa9 2024 Alexandre Miranda (Alex1304). Built with Docusaurus."},prism:{theme:{plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},additionalLanguages:["java","groovy","properties"],magicComments:[{className:"theme-code-block-highlighted-line",line:"highlight-next-line",block:{start:"highlight-start",end:"highlight-end"}}]},docs:{versionPersistence:"localStorage",sidebar:{hideable:!1,autoCollapseCategories:!1}},metadata:[],tableOfContents:{minHeadingLevel:2,maxHeadingLevel:3}},presets:[["@docusaurus/preset-classic",{docs:{sidebarPath:"/home/runner/work/botrino/botrino/website/sidebars.js",editUrl:"https://github.com/Alex1304/botrino/edit/main/website/"},googleAnalytics:{trackingID:"G-45YBPVQ8K9"},gtag:{trackingID:"G-45YBPVQ8K9"},theme:{customCss:"/home/runner/work/botrino/botrino/website/src/css/custom.css"}}]],baseUrlIssueBanner:!0,i18n:{defaultLocale:"en",path:"i18n",locales:["en"],localeConfigs:{}},onBrokenAnchors:"warn",onDuplicateRoutes:"warn",staticDirectories:["static"],customFields:{},plugins:[],themes:[],scripts:[],headTags:[],stylesheets:[],clientModules:[],titleDelimiter:"|",noIndex:!1,markdown:{format:"mdx",mermaid:!1,mdx1Compat:{comments:!0,admonitions:!0,headingIds:!0},anchors:{maintainCase:!1}}}},8168:(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,{A:()=>r})},2892:(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,{A:()=>a})},8587:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}n.d(t,{A:()=>r})},8215:(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)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=r(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}n.d(t,{A:()=>a});const a=function(){for(var e,t,n=0,a="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=r(e))&&(a&&(a+=" "),a+=t);return a}},5066:(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)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=r(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}n.d(t,{A:()=>a});const a=function(){for(var e,t,n=0,a="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=r(e))&&(a&&(a+=" "),a+=t);return a}},8181:(e,t,n)=>{"use strict";n.d(t,{f4:()=>J,My:()=>C});var r=n(6540);function a(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=a(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}const o=function(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=a(e))&&(r&&(r+=" "),r+=t);return r};var i,l,s,u,c,d=Object.create,f=Object.defineProperty,p=Object.defineProperties,g=Object.getOwnPropertyDescriptor,h=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertyNames,y=Object.getOwnPropertySymbols,b=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,k=(e,t,n)=>t in e?f(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,x=(e,t)=>{for(var n in t||(t={}))v.call(t,n)&&k(e,n,t[n]);if(y)for(var n of y(t))w.call(t,n)&&k(e,n,t[n]);return e},S=(e,t)=>p(e,h(t)),E=(e,t)=>{var n={};for(var r in e)v.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&y)for(var r of y(e))t.indexOf(r)<0&&w.call(e,r)&&(n[r]=e[r]);return n},_=(i={"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,t){var n=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 u=a[e];return a[e]=i,r.languages.DFS(r.languages,(function(t,n){n===u&&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],u=r.util.type(s);"Object"!==u||o[i(s)]?"Array"!==u||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};if(r.hooks.run("before-tokenize",o),!o.grammar)throw new Error('The language "'+o.language+'" has no grammar.');return 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){for(var t=[],n=e.head.next;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,c,d){for(var f in n)if(n.hasOwnProperty(f)&&n[f]){var p=n[f];p=Array.isArray(p)?p:[p];for(var g=0;g<p.length;++g){if(d&&d.cause==f+","+g)return;var h=p[g],m=h.inside,y=!!h.lookbehind,b=!!h.greedy,v=h.alias;if(b&&!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,x=l.next,S=c;x!==t.tail&&!(d&&S>=d.reach);S+=x.value.length,x=x.next){var E=x.value;if(t.length>e.length)return;if(!(E instanceof a)){var _,C=1;if(b){if(!(_=o(k,S,e,y))||_.index>=e.length)break;var A=_.index,T=_.index+_[0].length,N=S;for(N+=x.value.length;A>=N;)N+=(x=x.next).value.length;if(S=N-=x.value.length,x.value instanceof a)continue;for(var j=x;j!==t.tail&&(N<T||"string"==typeof j.value);j=j.next)C++,N+=j.value.length;C--,E=e.slice(S,N),_.index-=S}else if(!(_=o(k,0,E,y)))continue;A=_.index;var L=_[0],P=E.slice(0,A),O=E.slice(A+L.length),R=S+E.length;d&&R>d.reach&&(d.reach=R);var I=x.prev;if(P&&(I=s(t,I,P),S+=P.length),u(t,I,C),x=s(t,I,new a(f,m?r.tokenize(L,m):L,v,L)),O&&s(t,x,O),C>1){var F={cause:f+","+g,reach:R};i(e,t,n,x.prev,S,F),d&&F.reach>d.reach&&(d.reach=F.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 u(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}();t.exports=n,n.default=n}},function(){return l||(0,i[m(i)[0]])((l={exports:{}}).exports,l),l.exports}),C=((e,t,n)=>(n=null!=e?d(b(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of m(t))v.call(e,a)||a===n||f(e,a,{get:()=>t[a],enumerable:!(r=g(t,a))||r.enumerable});return e})(!t&&e&&e.__esModule?n:f(n,"default",{value:e,enumerable:!0}),e)))(_());C.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]},C.languages.markup.tag.inside["attr-value"].inside.entity=C.languages.markup.entity,C.languages.markup.doctype.inside["internal-subset"].inside=C.languages.markup,C.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(C.languages.markup.tag,"addInlined",{value:function(e,t){var n;(t=((n=((n={})["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:C.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}))["language-"+t]={pattern:/[\s\S]+/,inside:C.languages[t]},{}))[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:n},C.languages.insertBefore("markup","cdata",t)}}),Object.defineProperty(C.languages.markup.tag,"addAttribute",{value:function(e,t){C.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:C.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),C.languages.html=C.languages.markup,C.languages.mathml=C.languages.markup,C.languages.svg=C.languages.markup,C.languages.xml=C.languages.extend("markup",{}),C.languages.ssml=C.languages.xml,C.languages.atom=C.languages.xml,C.languages.rss=C.languages.xml,function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r="(?:[^\\\\-]|"+n.source+")",a=(r=RegExp(r+"-"+r),{pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"});e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":t,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":a}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":a}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}}(C),C.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:/[{}[\];(),.:]/},C.languages.javascript=C.languages.extend("clike",{"class-name":[C.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}|\?\?=?|\?\.?|[~:]/}),C.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,C.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:C.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:C.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:C.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:C.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:C.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),C.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:C.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"}}),C.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),C.languages.markup&&(C.languages.markup.tag.addInlined("script","javascript"),C.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")),C.languages.js=C.languages.javascript,C.languages.actionscript=C.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),C.languages.actionscript["class-name"].alias="function",delete C.languages.actionscript.parameter,delete C.languages.actionscript["literal-property"],C.languages.markup&&C.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:C.languages.markup}}),u=/#(?!\{).+/,c={pattern:/#\{[^}]+\}/,alias:"variable"},(s=C).languages.coffeescript=s.languages.extend("javascript",{comment:u,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:c}}],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"}}),s.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:u,interpolation:c}}}),s.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:s.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:c}}]}),s.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete s.languages.coffeescript["template-string"],s.languages.coffee=s.languages.coffeescript,function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(t,"addSupport",{value:function(t,n){(t="string"==typeof t?[t]:t).forEach((function(t){var r=function(e){e.inside||(e.inside={}),e.inside.rest=n},a="doc-comment";if(o=e.languages[t]){var o,i=o[a];if((i=i||(o=e.languages.insertBefore(t,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[a])instanceof RegExp&&(i=o[a]={pattern:i}),Array.isArray(i))for(var l=0,s=i.length;l<s;l++)i[l]instanceof RegExp&&(i[l]={pattern:i[l]}),r(i[l]);else r(i)}}))}}),t.addSupport(["java","javascript","php"],t)}(C),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;(t=(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,e.languages.markup))&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))}(C),function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,n=(t=(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("\\[(?:[^[\\]\"']|"+t.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":[t,{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}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),{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|RebeccaPurple|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:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,number:n})}(C),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}(C),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,i=(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,o=t[n];"code"!==o.type?e(o.content):(a=o.content[1],o=o.content[3],a&&o&&"code-language"===a.type&&"code-block"===o.type&&"string"==typeof a.content&&(a=a.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),a="language-"+(a=(/[a-z][\w-]*/i.exec(a)||[""])[0].toLowerCase()),o.alias?"string"==typeof o.alias?o.alias=[o.alias,a]:o.alias.push(a):o.alias=[a]))}}(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];if(o=/language-(.+)/.exec(o)){n=o[1];break}}var u,c=e.languages[n];c?t.content=e.highlight(t.content.replace(i,"").replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,(function(e,t){var n;return"#"===(t=t.toLowerCase())[0]?(n="x"===t[1]?parseInt(t.slice(2),16):Number(t.slice(1)),s(n)):l[t]||e})),c,n):n&&"none"!==n&&e.plugins.autoloader&&(u="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random()),t.attributes.id=u,e.plugins.autoloader.loadLanguages(n,(function(){var t=document.getElementById(u);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))})))}})),RegExp(e.languages.markup.tag.pattern.source,"gi")),l={amp:"&",lt:"<",gt:">",quot:'"'},s=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(C),C.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:C.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+/},C.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"])&&"("===c(1).content){n+=2;var o=f(/^\($/,/^\)$/);if(-1===o)continue;for(;n<o;n++){var i=c(0);"variable"===i.type&&(p(i,"variable-input"),a.push(i.content))}n=o+1}if(d(["punctuation","property-query"])&&"{"===c(0).content&&(n++,p(c(0),"property-mutation"),0<a.length)){var l=f(/^\{$/,/^\}$/);if(-1!==l)for(var s=n;s<l;s++){var u=t[s];"variable"===u.type&&0<=a.indexOf(u.content)&&p(u,"variable-input")}}}}function c(e){return t[n+e]}function d(e,t){t=t||0;for(var n=0;n<e.length;n++){var r=c(n+t);if(!r||r.type!==e[n])return}return 1}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)}})),C.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(t,n,r){return t={code:t,grammar:n,language:r},e.hooks.run("before-tokenize",t),t.tokens=e.tokenize(t.code,t.grammar),e.hooks.run("after-tokenize",t),t.tokens}function s(t,n,i){var s=e.tokenize(t,{interpolation:{pattern:RegExp(o),lookbehind:!0}}),u=0,c={},d=(s=l(s.map((function(e){if("string"==typeof e)return e;var n,r;for(e=e.content;-1!==t.indexOf((r=u++,n="___"+i.toUpperCase()+"_"+r+"___")););return c[n]=e,n})).join(""),n,i),Object.keys(c));return u=0,function t(n){for(var o=0;o<n.length;o++){if(u>=d.length)return;var i,s,f,p,g,h,m,y=n[o];"string"==typeof y||"string"==typeof y.content?(i=d[u],-1!==(m=(h="string"==typeof y?y:y.content).indexOf(i))&&(++u,s=h.substring(0,m),g=c[i],f=void 0,(p={})["interpolation-punctuation"]=a,3===(p=e.tokenize(g,p)).length&&((f=[1,1]).push.apply(f,l(p[1],e.languages.javascript,"javascript")),p.splice.apply(p,f)),f=new e.Token("interpolation",p,r.alias,g),p=h.substring(m+i.length),g=[],s&&g.push(s),g.push(f),p&&(t(h=[p]),g.push.apply(g,h)),"string"==typeof y?(n.splice.apply(n,[o,1].concat(g)),o+=g.length-1):y.content=g)):(m=y.content,Array.isArray(m)?t(m):t([m]))}}(s),new e.Token(i,s,"language-"+i,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 u={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function c(e){return"string"==typeof e?e:Array.isArray(e)?e.map(c).join(""):c(e.content)}e.hooks.add("after-tokenize",(function(t){t.language in u&&function t(n){for(var r=0,a=n.length;r<a;r++){var o,i,l,u=n[r];"string"!=typeof u&&(o=u.content,Array.isArray(o)?"template-string"===u.type?(u=o[1],3===o.length&&"string"!=typeof u&&"embedded-code"===u.type&&(i=c(u),u=u.alias,u=Array.isArray(u)?u[0]:u,l=e.languages[u])&&(o[1]=s(i,l,u))):t(o):"string"!=typeof o&&t([o]))}}(t.tokens)}))}(C),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}(C),function(e){var t=e.languages.javascript,n=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:t,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,(function(){return n}))),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:t.string,number:t.number,boolean:t.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:t,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)}(C),function(e){e.languages.flow=e.languages.extend("javascript",{}),e.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),e.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(C),C.languages.n4js=C.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),C.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),C.languages.n4jsd=C.languages.n4js,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];a=(o="RegExp"===e.util.type(o)?e.languages.javascript[a]={pattern:o}:o).inside||{};(o.inside=a)["maybe-class-name"]=/^[A-Z][\s\S]*/}}(C),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)}function i(t){for(var n=[],r=0;r<t.length;r++){var a=t[r],o=!1;"string"!=typeof a&&("tag"===a.type&&a.content[0]&&"tag"===a.content[0].type?"</"===a.content[0].content[0].content?0<n.length&&n[n.length-1].tagName===l(a.content[0].content[1])&&n.pop():"/>"!==a.content[a.content.length-1].content&&n.push({tagName:l(a.content[0].content[1]),openedBraces:0}):0<n.length&&"punctuation"===a.type&&"{"===a.content?n[n.length-1].openedBraces++:0<n.length&&0<n[n.length-1].openedBraces&&"punctuation"===a.type&&"}"===a.content?n[n.length-1].openedBraces--:o=!0),(o||"string"==typeof a)&&0<n.length&&0===n[n.length-1].openedBraces&&(o=l(a),r<t.length-1&&("string"==typeof t[r+1]||"plain-text"===t[r+1].type)&&(o+=l(t[r+1]),t.splice(r+1,1)),0<r&&("string"==typeof t[r-1]||"plain-text"===t[r-1].type)&&(o=l(t[r-1])+o,t.splice(r-1,1),r--),t[r]=new e.Token("plain-text",o,null,o)),a.content&&"string"!=typeof a.content&&i(a.content)}}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 l=function(e){return e?"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(l).join(""):""};e.hooks.add("after-tokenize",(function(e){"jsx"!==e.language&&"tsx"!==e.language||i(e.tokens)}))}(C),function(e){var t=e.util.clone(e.languages.typescript);(t=(e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"],e.languages.tsx.tag)).pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+t.pattern.source+")",t.pattern.flags),t.lookbehind=!0}(C),C.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:/[{}[\]();,.:\\]/},C.languages.swift["string-literal"].forEach((function(e){e.inside.interpolation.inside=C.languages.swift})),function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin}(C),C.languages.c=C.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|[?:~]|[-+*/%&|^!=<>]=?/}),C.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),C.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},C.languages.c.string],char:C.languages.c.char,comment:C.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:C.languages.c}}}}),C.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 C.languages.c.boolean,C.languages.objectivec=C.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 C.languages.objectivec["class-name"],C.languages.objc=C.languages.objectivec,C.languages.reason=C.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/}),C.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 C.languages.reason.function,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,(function(){return t}));t=t.replace(/<self>/g,(function(){return/[^\s\S]/.source})),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(C),C.languages.go=C.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/}),C.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete C.languages.go["class-name"],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"])}(C),C.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:/[{}[\];(),.:]/},C.languages.python["string-interpolation"].inside.interpolation.inside.rest=C.languages.python,C.languages.py=C.languages.python;((e,t)=>{for(var n in t)f(e,n,{get:t[n],enumerable:!0})})({},{dracula:()=>A,duotoneDark:()=>T,duotoneLight:()=>N,github:()=>j,jettwaveDark:()=>H,jettwaveLight:()=>V,nightOwl:()=>L,nightOwlLight:()=>P,oceanicNext:()=>I,okaidia:()=>F,oneDark:()=>W,oneLight:()=>q,palenight:()=>M,shadesOfPurple:()=>D,synthwave84:()=>z,ultramin:()=>B,vsDark:()=>$,vsLight:()=>U});var A={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)"}}]},T={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"}}]},N={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{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:"#896724"}}]},j={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"}}]},L={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},P={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},O="#c5a5c5",R="#8dc891",I={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:O}},{types:["attr-value"],style:{color:R}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:"#999999"}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:"#5a9bcf"}},{types:["boolean"],style:{color:"#ff8b50"}},{types:["tag"],style:{color:"#fc929e"}},{types:["string"],style:{color:R}},{types:["punctuation"],style:{color:R}},{types:["selector","char","builtin","inserted"],style:{color:"#D8DEE9"}},{types:["function"],style:{color:"#79b6f2"}},{types:["operator","entity","url","variable"],style:{color:"#d7deea"}},{types:["keyword"],style:{color:O}},{types:["atrule","class-name"],style:{color:"#FAC863"}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},F={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},M={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},D={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},z={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},B={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},$={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},U={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},H={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},V={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},W={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{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:"hsl(220, 14%, 71%)"}}]},q={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{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:"hsl(230, 8%, 24%)"}}]},G=(e,t)=>{const{plain:n}=e,r=e.styles.reduce(((e,n)=>{const{languages:r,style:a}=n;return r&&!r.includes(t)||n.types.forEach((t=>{const n=x(x({},e[t]),a);e[t]=n})),e}),{});return r.root=n,r.plain=S(x({},n),{backgroundColor:void 0}),r},Y=/\r\n|\r|\n/,Q=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)},K=(e,t)=>{const n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},Z=e=>{const t=[[]],n=[e],r=[0],a=[e.length];let o=0,i=0,l=[];const s=[l];for(;i>-1;){for(;(o=r[i]++)<a[i];){let e,u=t[i];const c=n[i][o];if("string"==typeof c?(u=i>0?u:["plain"],e=c):(u=K(u,c.type),c.alias&&(u=K(u,c.alias)),e=c.content),"string"!=typeof e){i++,t.push(u),n.push(e),r.push(0),a.push(e.length);continue}const d=e.split(Y),f=d.length;l.push({types:u,content:d[0]});for(let t=1;t<f;t++)Q(l),s.push(l=[]),l.push({types:u,content:d[t]})}i--,t.pop(),n.pop(),r.pop(),a.pop()}return Q(l),s},X=({children:e,language:t,code:n,theme:a,prism:i})=>{const l=t.toLowerCase(),s=((e,t)=>{const[n,a]=(0,r.useState)(G(t,e)),o=(0,r.useRef)(),i=(0,r.useRef)();return(0,r.useEffect)((()=>{t===o.current&&e===i.current||(o.current=t,i.current=e,a(G(t,e)))}),[e,t]),n})(l,a),u=(e=>(0,r.useCallback)((t=>{var n=t,{className:r,style:a,line:i}=n,l=E(n,["className","style","line"]);const s=S(x({},l),{className:o("token-line",r)});return"object"==typeof e&&"plain"in e&&(s.style=e.plain),"object"==typeof a&&(s.style=x(x({},s.style||{}),a)),s}),[e]))(s),c=(e=>{const t=(0,r.useCallback)((({types:t,empty:n})=>{if(null!=e)return 1===t.length&&"plain"===t[0]?null!=n?{display:"inline-block"}:void 0:1===t.length&&null!=n?e[t[0]]:Object.assign(null!=n?{display:"inline-block"}:{},...t.map((t=>e[t])))}),[e]);return(0,r.useCallback)((e=>{var n=e,{token:r,className:a,style:i}=n,l=E(n,["token","className","style"]);const s=S(x({},l),{className:o("token",...r.types,a),children:r.content,style:t(r)});return null!=i&&(s.style=x(x({},s.style||{}),i)),s}),[t])})(s),d=(({prism:e,code:t,grammar:n,language:a})=>{const o=(0,r.useRef)(e);return(0,r.useMemo)((()=>{if(null==n)return Z([t]);const e={code:t,grammar:n,language:a,tokens:[]};return o.current.hooks.run("before-tokenize",e),e.tokens=o.current.tokenize(t,n),o.current.hooks.run("after-tokenize",e),Z(e.tokens)}),[t,n,a])})({prism:i,language:l,code:n,grammar:i.languages[l]});return e({tokens:d,className:`prism-code language-${l}`,style:null!=s?s.root:{},getLineProps:u,getTokenProps:c})},J=e=>(0,r.createElement)(X,S(x({},e),{prism:e.prism||C,theme:e.theme||$,code:e.code,language:e.language}))},1561:(e,t,n)=>{"use strict";n.d(t,{A:()=>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)}}},2654:e=>{"use strict";e.exports={}},4054:e=>{"use strict";e.exports=JSON.parse('{"/docs-587":{"__comp":"5e95c892","__context":{"plugin":"aba21aa0"}},"/docs-9d1":{"__comp":"a7bd4aaa","__props":"7c110bd0"},"/docs-55d":{"__comp":"a94703ab"},"/docs/-5c4":{"__comp":"17896441","content":"f8409a7e"},"/docs/api/configuring-your-bot-290":{"__comp":"17896441","content":"0bf034db"},"/docs/api/customizing-the-discord-client-641":{"__comp":"17896441","content":"9187e980"},"/docs/api/extensions-205":{"__comp":"17896441","content":"ac3a7c63"},"/docs/api/i18n-e20":{"__comp":"17896441","content":"62eacfe5"},"/docs/api/working-with-services-c21":{"__comp":"17896441","content":"373758dc"},"/docs/getting-started-05e":{"__comp":"17896441","content":"3021cf83"},"/docs/interaction-library/acknowledging-interactions-2b8":{"__comp":"17896441","content":"4a782de2"},"/docs/interaction-library/configuration-6f0":{"__comp":"17896441","content":"b81faf1d"},"/docs/interaction-library/cooldowns-496":{"__comp":"17896441","content":"ddcb1508"},"/docs/interaction-library/creating-commands-181":{"__comp":"17896441","content":"2463bfee"},"/docs/interaction-library/dealing-with-components-208":{"__comp":"17896441","content":"421473c5"},"/docs/interaction-library/filtering-and-adapting-events-f7b":{"__comp":"17896441","content":"576b222c"},"/docs/interaction-library/handling-errors-6f0":{"__comp":"17896441","content":"6ea2c7a4"},"/docs/interaction-library/overview-4c1":{"__comp":"17896441","content":"518c7f92"},"/docs/interaction-library/privileges-919":{"__comp":"17896441","content":"b96361c1"},"/-2e1":{"__comp":"c4f5d8e4","__context":{"plugin":"a7456010"},"config":"5e9f5e1a"}}')}},e=>{e.O(0,[869],(()=>{return t=8536,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/assets/js/main.9bdcd132.js.LICENSE.txt b/assets/js/main.8495c6d8.js.LICENSE.txt similarity index 63% rename from assets/js/main.9bdcd132.js.LICENSE.txt rename to assets/js/main.8495c6d8.js.LICENSE.txt index 8039c42..91dc894 100644 --- a/assets/js/main.9bdcd132.js.LICENSE.txt +++ b/assets/js/main.8495c6d8.js.LICENSE.txt @@ -1,14 +1,22 @@ -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ - /* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress * @license MIT */ -/** @license React v0.19.1 - * scheduler.production.min.js +/*! Bundled license information: + +prismjs/prism.js: + (** + * Prism: Lightweight, robust, elegant syntax highlighting + * + * @license MIT <https://opensource.org/licenses/MIT> + * @author Lea Verou <https://lea.verou.me> + * @namespace + * @public + *) +*/ + +/** + * @license React + * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * @@ -16,8 +24,9 @@ object-assign * LICENSE file in the root directory of this source tree. */ -/** @license React v16.13.1 - * react-is.production.min.js +/** + * @license React + * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * @@ -25,8 +34,9 @@ object-assign * LICENSE file in the root directory of this source tree. */ -/** @license React v16.14.0 - * react-dom.production.min.js +/** + * @license React + * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * @@ -34,8 +44,18 @@ object-assign * LICENSE file in the root directory of this source tree. */ -/** @license React v16.14.0 - * react.production.min.js +/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/** @license React v16.13.1 + * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * diff --git a/assets/js/main.9bdcd132.js b/assets/js/main.9bdcd132.js deleted file mode 100644 index e608b53..0000000 --- a/assets/js/main.9bdcd132.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see main.9bdcd132.js.LICENSE.txt */ -(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[179],{9782:function(e,t,n){"use strict";n.r(t),t.default={title:"Botrino",tagline:"A simple yet powerful framework to develop, configure and run Discord bots based on Discord4J.",url:"https://botrino.alex1304.com",baseUrl:"/",onBrokenLinks:"throw",onBrokenMarkdownLinks:"warn",favicon:"img/favicon.ico",organizationName:"Alex1304",projectName:"botrino",themeConfig:{colorMode:{defaultMode:"dark",disableSwitch:!1,respectPrefersColorScheme:!1,switchConfig:{darkIcon:"\ud83c\udf1c",darkIconStyle:{},lightIcon:"\ud83c\udf1e",lightIconStyle:{}}},navbar:{title:"Botrino",logo:{alt:"Botrino Logo",src:"img/logo.svg"},items:[{to:"docs/",activeBasePath:"docs",label:"Docs",position:"left"},{href:"https://github.com/Alex1304/botrino",label:"GitHub",position:"right"}],hideOnScroll:!1},footer:{style:"dark",links:[{title:"Docs",items:[{label:"Introduction",to:"docs/"},{label:"Getting Started",to:"docs/getting-started"}]},{title:"More",items:[{label:"GitHub",href:"https://github.com/Alex1304/botrino"}]}],copyright:"Copyright \xa9 2022 Alexandre Miranda (Alex1304). Built with Docusaurus."},prism:{theme:{plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},additionalLanguages:["java","groovy","properties"]},googleAnalytics:{trackingID:"G-45YBPVQ8K9"},gtag:{trackingID:"G-45YBPVQ8K9"},docs:{versionPersistence:"localStorage"},metadatas:[],hideableSidebar:!1},presets:[["@docusaurus/preset-classic",{docs:{sidebarPath:"/home/runner/work/botrino/botrino/website/sidebars.js",editUrl:"https://github.com/Alex1304/botrino/edit/main/website/"},theme:{customCss:"/home/runner/work/botrino/botrino/website/src/css/custom.css"}}]],baseUrlIssueBanner:!0,i18n:{defaultLocale:"en",locales:["en"],localeConfigs:{}},onDuplicateRoutes:"warn",customFields:{},plugins:[],themes:[],titleDelimiter:"|",noIndex:!1}},8845:function(e,t,n){"use strict";var r=n(7294),a=n(3935),i=n(3727),o=n(2203),l=n.n(o),u=function(e){var t=e.error,n=e.retry,a=e.pastDelay;return t?r.createElement("div",{style:{align:"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,t.message),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},s=JSON.parse('{"/-deb":{"component":"c4f5d8e4","config":"5e9f5e1a"},"/docs-1bd":{"component":"1be78505","versionMetadata":"935f2afb"},"/docs/-8fd":{"component":"17896441","content":"0e384e19"},"/docs/api/configuring-your-bot-faf":{"component":"17896441","content":"4539ade8"},"/docs/api/customizing-the-discord-client-53a":{"component":"17896441","content":"5537f8c3"},"/docs/api/extensions-67e":{"component":"17896441","content":"efe2a42e"},"/docs/api/i18n-468":{"component":"17896441","content":"bb881519"},"/docs/api/working-with-services-b40":{"component":"17896441","content":"80e86806"},"/docs/getting-started-ef6":{"component":"17896441","content":"d589d3a7"},"/docs/interaction-library/acknowledging-interactions-2ac":{"component":"17896441","content":"dfc585ea"},"/docs/interaction-library/configuration-195":{"component":"17896441","content":"93231161"},"/docs/interaction-library/cooldowns-1c8":{"component":"17896441","content":"e02376a2"},"/docs/interaction-library/creating-commands-c8d":{"component":"17896441","content":"f5f98f48"},"/docs/interaction-library/dealing-with-components-6e2":{"component":"17896441","content":"534bda69"},"/docs/interaction-library/filtering-and-adapting-events-f5b":{"component":"17896441","content":"95e8cacb"},"/docs/interaction-library/handling-errors-909":{"component":"17896441","content":"f11c2978"},"/docs/interaction-library/overview-d80":{"component":"17896441","content":"0794ba4a"},"/docs/interaction-library/privileges-821":{"component":"17896441","content":"d9be502e"}}'),c={"0794ba4a":[function(){return Promise.all([n.e(532),n.e(219)]).then(n.bind(n,9470))},"@site/docs/interaction-library/overview.md",9470],"0e384e19":[function(){return n.e(671).then(n.bind(n,426))},"@site/docs/intro.md",426],17896441:[function(){return Promise.all([n.e(532),n.e(486),n.e(918)]).then(n.bind(n,3852))},"@theme/DocItem",3852],"1be78505":[function(){return Promise.all([n.e(532),n.e(486),n.e(118),n.e(514)]).then(n.bind(n,6484))},"@theme/DocPage",6484],"4539ade8":[function(){return n.e(281).then(n.bind(n,6334))},"@site/docs/api/configuring-your-bot.md",6334],"534bda69":[function(){return n.e(351).then(n.bind(n,3100))},"@site/docs/interaction-library/dealing-with-components.md",3100],"5537f8c3":[function(){return n.e(682).then(n.bind(n,8849))},"@site/docs/api/customizing-the-discord-client.md",8849],"5e9f5e1a":[function(){return Promise.resolve().then(n.bind(n,9782))},"@generated/docusaurus.config",9782],"80e86806":[function(){return n.e(516).then(n.bind(n,3424))},"@site/docs/api/working-with-services.md",3424],93231161:[function(){return n.e(772).then(n.bind(n,5839))},"@site/docs/interaction-library/configuration.md",5839],"935f2afb":[function(){return n.e(53).then(n.t.bind(n,1109,19))},"~docs/default/version-current-metadata-prop-751.json",1109],"95e8cacb":[function(){return n.e(644).then(n.bind(n,7075))},"@site/docs/interaction-library/filtering-and-adapting-events.md",7075],bb881519:[function(){return n.e(143).then(n.bind(n,9076))},"@site/docs/api/i18n.md",9076],c4f5d8e4:[function(){return Promise.all([n.e(532),n.e(486),n.e(118),n.e(195)]).then(n.bind(n,6252))},"@site/src/pages/index.js",6252],d589d3a7:[function(){return Promise.all([n.e(532),n.e(162)]).then(n.bind(n,601))},"@site/docs/getting-started.md",601],d9be502e:[function(){return n.e(122).then(n.bind(n,205))},"@site/docs/interaction-library/privileges.md",205],dfc585ea:[function(){return n.e(879).then(n.bind(n,9216))},"@site/docs/interaction-library/acknowledging-interactions.md",9216],e02376a2:[function(){return n.e(113).then(n.bind(n,1914))},"@site/docs/interaction-library/cooldowns.md",1914],efe2a42e:[function(){return n.e(863).then(n.bind(n,3159))},"@site/docs/api/extensions.md",3159],f11c2978:[function(){return n.e(180).then(n.bind(n,4285))},"@site/docs/interaction-library/handling-errors.md",4285],f5f98f48:[function(){return n.e(412).then(n.bind(n,1420))},"@site/docs/interaction-library/creating-commands.md",1420]};var f=function(e){var t={};return function e(n,r){Object.keys(n).forEach((function(a){var i=n[a],o=r?r+"."+a:a;"object"===typeof i&&!!i&&Object.keys(i).length?e(i,o):t[o]=i}))}(e),t};var d=function(e,t){if("*"===e)return l()({loading:u,loader:function(){return Promise.all([n.e(532),n.e(486),n.e(118),n.e(608)]).then(n.bind(n,4608))}});var a=s[e+"-"+t],i=[],o=[],d={},p=f(a);return Object.keys(p).forEach((function(e){var t=c[p[e]];t&&(d[e]=t[0],i.push(t[1]),o.push(t[2]))})),l().Map({loading:u,loader:d,modules:i,webpack:function(){return o},render:function(e,t){var n=JSON.parse(JSON.stringify(a));Object.keys(e).forEach((function(t){for(var r=n,a=t.split("."),i=0;i<a.length-1;i+=1)r=r[a[i]];r[a[a.length-1]]=e[t].default;var o=Object.keys(e[t]).filter((function(e){return"default"!==e}));o&&o.length&&o.forEach((function(n){r[a[a.length-1]][n]=e[t][n]}))}));var i=n.component;return delete n.component,r.createElement(i,Object.assign({},n,t))}})},p=[{path:"/",component:d("/","deb"),exact:!0},{path:"/docs",component:d("/docs","1bd"),routes:[{path:"/docs/",component:d("/docs/","8fd"),exact:!0},{path:"/docs/api/configuring-your-bot",component:d("/docs/api/configuring-your-bot","faf"),exact:!0},{path:"/docs/api/customizing-the-discord-client",component:d("/docs/api/customizing-the-discord-client","53a"),exact:!0},{path:"/docs/api/extensions",component:d("/docs/api/extensions","67e"),exact:!0},{path:"/docs/api/i18n",component:d("/docs/api/i18n","468"),exact:!0},{path:"/docs/api/working-with-services",component:d("/docs/api/working-with-services","b40"),exact:!0},{path:"/docs/getting-started",component:d("/docs/getting-started","ef6"),exact:!0},{path:"/docs/interaction-library/acknowledging-interactions",component:d("/docs/interaction-library/acknowledging-interactions","2ac"),exact:!0},{path:"/docs/interaction-library/configuration",component:d("/docs/interaction-library/configuration","195"),exact:!0},{path:"/docs/interaction-library/cooldowns",component:d("/docs/interaction-library/cooldowns","1c8"),exact:!0},{path:"/docs/interaction-library/creating-commands",component:d("/docs/interaction-library/creating-commands","c8d"),exact:!0},{path:"/docs/interaction-library/dealing-with-components",component:d("/docs/interaction-library/dealing-with-components","6e2"),exact:!0},{path:"/docs/interaction-library/filtering-and-adapting-events",component:d("/docs/interaction-library/filtering-and-adapting-events","f5b"),exact:!0},{path:"/docs/interaction-library/handling-errors",component:d("/docs/interaction-library/handling-errors","909"),exact:!0},{path:"/docs/interaction-library/overview",component:d("/docs/interaction-library/overview","d80"),exact:!0},{path:"/docs/interaction-library/privileges",component:d("/docs/interaction-library/privileges","821"),exact:!0}]},{path:"*",component:d("*")}],m=n(412),g=n(9782),h=JSON.parse('{"docusaurus-plugin-content-docs":{"default":{"path":"/docs","versions":[{"name":"current","label":"Next","isLast":true,"path":"/docs","mainDocId":"intro","docs":[{"id":"api/configuring-your-bot","path":"/docs/api/configuring-your-bot","sidebar":"someSidebar"},{"id":"api/customizing-the-discord-client","path":"/docs/api/customizing-the-discord-client","sidebar":"someSidebar"},{"id":"api/extensions","path":"/docs/api/extensions","sidebar":"someSidebar"},{"id":"api/i18n","path":"/docs/api/i18n","sidebar":"someSidebar"},{"id":"api/working-with-services","path":"/docs/api/working-with-services","sidebar":"someSidebar"},{"id":"getting-started","path":"/docs/getting-started","sidebar":"someSidebar"},{"id":"interaction-library/acknowledging-interactions","path":"/docs/interaction-library/acknowledging-interactions","sidebar":"someSidebar"},{"id":"interaction-library/configuration","path":"/docs/interaction-library/configuration","sidebar":"someSidebar"},{"id":"interaction-library/cooldowns","path":"/docs/interaction-library/cooldowns","sidebar":"someSidebar"},{"id":"interaction-library/creating-commands","path":"/docs/interaction-library/creating-commands","sidebar":"someSidebar"},{"id":"interaction-library/dealing-with-components","path":"/docs/interaction-library/dealing-with-components","sidebar":"someSidebar"},{"id":"interaction-library/filtering-and-adapting-events","path":"/docs/interaction-library/filtering-and-adapting-events","sidebar":"someSidebar"},{"id":"interaction-library/handling-errors","path":"/docs/interaction-library/handling-errors","sidebar":"someSidebar"},{"id":"interaction-library/overview","path":"/docs/interaction-library/overview","sidebar":"someSidebar"},{"id":"interaction-library/privileges","path":"/docs/interaction-library/privileges","sidebar":"someSidebar"},{"id":"intro","path":"/docs/","sidebar":"someSidebar"}]}]}}}'),b=JSON.parse('{"defaultLocale":"en","locales":["en"],"currentLocale":"en","localeConfigs":{"en":{"label":"en","direction":"ltr"}}}'),y=n(7529),v=JSON.parse('{"docusaurusVersion":"2.0.0-beta.ff31de0ff","siteVersion":"0.0.0","pluginVersions":{"docusaurus-plugin-content-docs":{"type":"package","name":"@docusaurus/plugin-content-docs","version":"2.0.0-beta.ff31de0ff"},"docusaurus-plugin-content-blog":{"type":"package","name":"@docusaurus/plugin-content-blog","version":"2.0.0-beta.ff31de0ff"},"docusaurus-plugin-content-pages":{"type":"package","name":"@docusaurus/plugin-content-pages","version":"2.0.0-beta.ff31de0ff"},"docusaurus-plugin-google-analytics":{"type":"package","name":"@docusaurus/plugin-google-analytics","version":"2.0.0-beta.ff31de0ff"},"docusaurus-plugin-google-gtag":{"type":"package","name":"@docusaurus/plugin-google-gtag","version":"2.0.0-beta.ff31de0ff"},"docusaurus-plugin-sitemap":{"type":"package","name":"@docusaurus/plugin-sitemap","version":"2.0.0-beta.ff31de0ff"},"docusaurus-theme-classic":{"type":"package","name":"@docusaurus/theme-classic","version":"2.0.0-beta.ff31de0ff"}}}'),w=n(6291),k=n(4748),E=n(4578),S=n(5977),T=n(4865),x=n.n(T),C=[n(7771),n(7771),n(7771),n(5032),n(1678),n(2497),n(5345),n(2295)];function _(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];C.forEach((function(t){var r,a,i=null!==(a=null===(r=null==t?void 0:t.default)||void 0===r?void 0:r[e])&&void 0!==a?a:t[e];i&&i.apply(void 0,n)}))}var O={onRouteUpdate:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];_.apply(void 0,["onRouteUpdate"].concat(t))},onRouteUpdateDelayed:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];_.apply(void 0,["onRouteUpdateDelayed"].concat(t))}},P=O,A=n(8790);function N(e,t){var n=(0,A.f)(e,t);return Promise.all(n.map((function(e){var t=e.route.component;if(t&&t.preload)return t.preload()})))}var R={};var I=function(e){if(R[e.pathname])return Object.assign({},e,{pathname:R[e.pathname]});var t=e.pathname||"/";return""===(t=t.trim().replace(/\/index\.html$/,""))&&(t="/"),R[e.pathname]=t,Object.assign({},e,{pathname:t})};x().configure({showSpinner:!1});var L=function(e){function t(t){var n;return(n=e.call(this,t)||this).previousLocation=null,n.progressBarTimeout=null,n.state={nextRouteHasLoaded:!0},n}(0,E.Z)(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e,t){var n=this,r=e.location!==this.props.location,a=this.props,i=a.routes,o=a.delay,l=void 0===o?1e3:o;if(r){var u=I(e.location);return this.startProgressBar(l),this.previousLocation=I(this.props.location),this.setState({nextRouteHasLoaded:!1}),N(i,u.pathname).then((function(){P.onRouteUpdate({previousLocation:n.previousLocation,location:u}),n.previousLocation=null,n.setState({nextRouteHasLoaded:!0},n.stopProgressBar);var e=u.hash;if(e){var t=decodeURIComponent(e.substring(1)),r=document.getElementById(t);r&&r.scrollIntoView()}else window.scrollTo(0,0)})).catch((function(e){return console.warn(e)})),!1}return!!t.nextRouteHasLoaded},n.clearProgressBarTimeout=function(){this.progressBarTimeout&&(clearTimeout(this.progressBarTimeout),this.progressBarTimeout=null)},n.startProgressBar=function(e){var t=this;this.clearProgressBarTimeout(),this.progressBarTimeout=setTimeout((function(){P.onRouteUpdateDelayed({location:I(t.props.location)}),x().start()}),e)},n.stopProgressBar=function(){this.clearProgressBarTimeout(),x().done()},n.render=function(){var e=this.props,t=e.children,n=e.location;return r.createElement(S.AW,{location:I(n),render:function(){return t}})},t}(r.Component),D=(0,S.EN)(L),F=n(9105),M=n(2263),B="docusaurus-base-url-issue-banner-container",U="docusaurus-base-url-issue-banner-suggestion-container",z="__DOCUSAURUS_INSERT_BASEURL_BANNER";function j(e){return"\nwindow['"+z+"'] = true;\n\ndocument.addEventListener('DOMContentLoaded', maybeInsertBanner);\n\nfunction maybeInsertBanner() {\n var shouldInsert = window['"+z+"'];\n shouldInsert && insertBanner();\n}\n\nfunction insertBanner() {\n var bannerContainer = document.getElementById('"+B+"');\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="'+U+'" style="font-weight: bold; color: green;"></span></p>\n</div>\n'}(e)).replace(/</g,"\\<")+";\n bannerContainer.innerHTML = bannerHtml;\n var suggestionContainer = document.getElementById('"+U+"');\n var actualHomePagePath = window.location.pathname;\n var suggestedBaseUrl = actualHomePagePath.substr(-1) === '/'\n ? actualHomePagePath\n : actualHomePagePath + '/';\n suggestionContainer.innerHTML = suggestedBaseUrl;\n}\n"}function $(){var e=(0,M.Z)().siteConfig.baseUrl;return(0,r.useLayoutEffect)((function(){window[z]=!1}),[]),r.createElement(r.Fragment,null,!m.Z.canUseDOM&&r.createElement(F.Z,null,r.createElement("script",null,j(e))),r.createElement("div",{id:B}))}function H(){var e=(0,M.Z)().siteConfig,t=e.baseUrl,n=e.baseUrlIssueBanner,a=(0,S.TH)().pathname;return n&&a===t?r.createElement($,null):null}var G=function(e){var t=e.children;return r.createElement(r.Fragment,null,t)};var W=function(){var e=(0,r.useState)(!1),t=e[0],n=e[1];return(0,r.useEffect)((function(){n(!0)}),[]),r.createElement(k.Z.Provider,{value:{siteConfig:g.default,siteMetadata:v,globalData:h,i18n:b,codeTranslations:y,isClient:t}},r.createElement(G,null,r.createElement(H,null),r.createElement(D,{routes:p},(0,w.Z)(p))))};var V=function(e){if("undefined"==typeof document)return!1;var t=document.createElement("link");try{if(t.relList&&"function"==typeof t.relList.supports)return t.relList.supports(e)}catch(n){return!1}return!1}("prefetch")?function(e){return new Promise((function(t,n){if("undefined"!=typeof document){var r=document.createElement("link");r.setAttribute("rel","prefetch"),r.setAttribute("href",e),r.onload=t,r.onerror=n,(document.getElementsByTagName("head")[0]||document.getElementsByName("script")[0].parentNode).appendChild(r)}else n()}))}:function(e){return new Promise((function(t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.withCredentials=!0,r.onload=function(){200===r.status?t():n()},r.send(null)}))},Z={};var q=function(e){return new Promise((function(t){Z[e]?t():V(e).then((function(){t(),Z[e]=!0})).catch((function(){}))}))},K={},Y={},Q=function(){return!(!("connection"in navigator)||-1===(navigator.connection.effectiveType||"").indexOf("2g")||!navigator.connection.saveData)},X=function(e){return Array.prototype.concat.apply([],e)},J={prefetch:function(e){if(!function(e){return!Q()&&!Y[e]&&!K[e]}(e))return!1;K[e]=!0;var t=(0,A.f)(p,e);return X(t.map((function(e){return t=e.route.path,X(Object.entries(s).filter((function(e){return e[0].replace(/(-[^-]+)$/,"")===t})).map((function(e){var t=e[1];return Object.values(f(t))})));var t}))).forEach((function(e){var t=n.gca(e);t&&!/undefined/.test(t)&&q(t)})),!0},preload:function(e){return!!function(e){return!Q()&&!Y[e]}(e)&&(Y[e]=!0,N(p,e),!0)}};if(m.Z.canUseDOM){window.docusaurus=J;var ee=a.hydrate;N(p,window.location.pathname).then((function(){ee(r.createElement(i.VK,null,r.createElement(W,null)),document.getElementById("__docusaurus"))}))}},412:function(e,t){"use strict";var n=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:n,canUseEventListeners:n&&!(!window.addEventListener&&!window.attachEvent),canUseIntersectionObserver:n&&"IntersectionObserver"in window,canUseViewport:n&&!!window.screen};t.Z=r},9105:function(e,t,n){"use strict";n.d(t,{Z:function(){return he}});var r,a,i,o,l=n(7294),u=n(5697),s=n.n(u),c=n(3524),f=n.n(c),d=n(9590),p=n.n(d),m=n(7418),g=n.n(m),h="bodyAttributes",b="htmlAttributes",y="titleAttributes",v={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"},w=(Object.keys(v).map((function(e){return v[e]})),"charset"),k="cssText",E="href",S="http-equiv",T="innerHTML",x="itemprop",C="name",_="property",O="rel",P="src",A="target",N={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},R="defaultTitle",I="defer",L="encodeSpecialCharacters",D="onChangeClientState",F="titleTemplate",M=Object.keys(N).reduce((function(e,t){return e[N[t]]=t,e}),{}),B=[v.NOSCRIPT,v.SCRIPT,v.STYLE],U="data-react-helmet",z="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},j=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},$=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}}(),H=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},G=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},W=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},V=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!1===t?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},Z=function(e){var t=X(e,v.TITLE),n=X(e,F);if(n&&t)return n.replace(/%s/g,(function(){return Array.isArray(t)?t.join(""):t}));var r=X(e,R);return t||r||void 0},q=function(e){return X(e,D)||function(){}},K=function(e,t){return t.filter((function(t){return void 0!==t[e]})).map((function(t){return t[e]})).reduce((function(e,t){return H({},e,t)}),{})},Y=function(e,t){return t.filter((function(e){return void 0!==e[v.BASE]})).map((function(e){return e[v.BASE]})).reverse().reduce((function(t,n){if(!t.length)for(var r=Object.keys(n),a=0;a<r.length;a++){var i=r[a].toLowerCase();if(-1!==e.indexOf(i)&&n[i])return t.concat(n)}return t}),[])},Q=function(e,t,n){var r={};return n.filter((function(t){return!!Array.isArray(t[e])||(void 0!==t[e]&&re("Helmet: "+e+' should be of type "Array". Instead found type "'+z(t[e])+'"'),!1)})).map((function(t){return t[e]})).reverse().reduce((function(e,n){var a={};n.filter((function(e){for(var n=void 0,i=Object.keys(e),o=0;o<i.length;o++){var l=i[o],u=l.toLowerCase();-1===t.indexOf(u)||n===O&&"canonical"===e[n].toLowerCase()||u===O&&"stylesheet"===e[u].toLowerCase()||(n=u),-1===t.indexOf(l)||l!==T&&l!==k&&l!==x||(n=l)}if(!n||!e[n])return!1;var s=e[n].toLowerCase();return r[n]||(r[n]={}),a[n]||(a[n]={}),!r[n][s]&&(a[n][s]=!0,!0)})).reverse().forEach((function(t){return e.push(t)}));for(var i=Object.keys(a),o=0;o<i.length;o++){var l=i[o],u=g()({},r[l],a[l]);r[l]=u}return e}),[]).reverse()},X=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.hasOwnProperty(t))return r[t]}return null},J=(r=Date.now(),function(e){var t=Date.now();t-r>16?(r=t,e(t)):setTimeout((function(){J(e)}),0)}),ee=function(e){return clearTimeout(e)},te="undefined"!=typeof window?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||J:n.g.requestAnimationFrame||J,ne="undefined"!=typeof window?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||ee:n.g.cancelAnimationFrame||ee,re=function(e){return console&&"function"==typeof console.warn&&console.warn(e)},ae=null,ie=function(e,t){var n=e.baseTag,r=e.bodyAttributes,a=e.htmlAttributes,i=e.linkTags,o=e.metaTags,l=e.noscriptTags,u=e.onChangeClientState,s=e.scriptTags,c=e.styleTags,f=e.title,d=e.titleAttributes;ue(v.BODY,r),ue(v.HTML,a),le(f,d);var p={baseTag:se(v.BASE,n),linkTags:se(v.LINK,i),metaTags:se(v.META,o),noscriptTags:se(v.NOSCRIPT,l),scriptTags:se(v.SCRIPT,s),styleTags:se(v.STYLE,c)},m={},g={};Object.keys(p).forEach((function(e){var t=p[e],n=t.newTags,r=t.oldTags;n.length&&(m[e]=n),r.length&&(g[e]=p[e].oldTags)})),t&&t(),u(e,m,g)},oe=function(e){return Array.isArray(e)?e.join(""):e},le=function(e,t){void 0!==e&&document.title!==e&&(document.title=oe(e)),ue(v.TITLE,t)},ue=function(e,t){var n=document.getElementsByTagName(e)[0];if(n){for(var r=n.getAttribute(U),a=r?r.split(","):[],i=[].concat(a),o=Object.keys(t),l=0;l<o.length;l++){var u=o[l],s=t[u]||"";n.getAttribute(u)!==s&&n.setAttribute(u,s),-1===a.indexOf(u)&&a.push(u);var c=i.indexOf(u);-1!==c&&i.splice(c,1)}for(var f=i.length-1;f>=0;f--)n.removeAttribute(i[f]);a.length===i.length?n.removeAttribute(U):n.getAttribute(U)!==o.join(",")&&n.setAttribute(U,o.join(","))}},se=function(e,t){var n=document.head||document.querySelector(v.HEAD),r=n.querySelectorAll(e+"["+"data-react-helmet]"),a=Array.prototype.slice.call(r),i=[],o=void 0;return t&&t.length&&t.forEach((function(t){var n=document.createElement(e);for(var r in t)if(t.hasOwnProperty(r))if(r===T)n.innerHTML=t.innerHTML;else if(r===k)n.styleSheet?n.styleSheet.cssText=t.cssText:n.appendChild(document.createTextNode(t.cssText));else{var l=void 0===t[r]?"":t[r];n.setAttribute(r,l)}n.setAttribute(U,"true"),a.some((function(e,t){return o=t,n.isEqualNode(e)}))?a.splice(o,1):i.push(n)})),a.forEach((function(e){return e.parentNode.removeChild(e)})),i.forEach((function(e){return n.appendChild(e)})),{oldTags:a,newTags:i}},ce=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}),"")},fe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((function(t,n){return t[N[n]||n]=e[n],t}),t)},de=function(e,t,n){switch(e){case v.TITLE:return{toComponent:function(){return e=t.title,n=t.titleAttributes,(r={key:e})[U]=!0,a=fe(n,r),[l.createElement(v.TITLE,a,e)];var e,n,r,a},toString:function(){return function(e,t,n,r){var a=ce(n),i=oe(t);return a?"<"+e+' data-react-helmet="true" '+a+">"+V(i,r)+"</"+e+">":"<"+e+' data-react-helmet="true">'+V(i,r)+"</"+e+">"}(e,t.title,t.titleAttributes,n)}};case h:case b:return{toComponent:function(){return fe(t)},toString:function(){return ce(t)}};default:return{toComponent:function(){return function(e,t){return t.map((function(t,n){var r,a=((r={key:n})[U]=!0,r);return Object.keys(t).forEach((function(e){var n=N[e]||e;if(n===T||n===k){var r=t.innerHTML||t.cssText;a.dangerouslySetInnerHTML={__html:r}}else a[n]=t[e]})),l.createElement(e,a)}))}(e,t)},toString:function(){return function(e,t,n){return t.reduce((function(t,r){var a=Object.keys(r).filter((function(e){return!(e===T||e===k)})).reduce((function(e,t){var a=void 0===r[t]?t:t+'="'+V(r[t],n)+'"';return e?e+" "+a:a}),""),i=r.innerHTML||r.cssText||"",o=-1===B.indexOf(e);return t+"<"+e+' data-react-helmet="true" '+a+(o?"/>":">"+i+"</"+e+">")}),"")}(e,t,n)}}}},pe=function(e){var t=e.baseTag,n=e.bodyAttributes,r=e.encode,a=e.htmlAttributes,i=e.linkTags,o=e.metaTags,l=e.noscriptTags,u=e.scriptTags,s=e.styleTags,c=e.title,f=void 0===c?"":c,d=e.titleAttributes;return{base:de(v.BASE,t,r),bodyAttributes:de(h,n,r),htmlAttributes:de(b,a,r),link:de(v.LINK,i,r),meta:de(v.META,o,r),noscript:de(v.NOSCRIPT,l,r),script:de(v.SCRIPT,u,r),style:de(v.STYLE,s,r),title:de(v.TITLE,{title:f,titleAttributes:d},r)}},me=f()((function(e){return{baseTag:Y([E,A],e),bodyAttributes:K(h,e),defer:X(e,I),encode:X(e,L),htmlAttributes:K(b,e),linkTags:Q(v.LINK,[O,E],e),metaTags:Q(v.META,[C,w,S,_,x],e),noscriptTags:Q(v.NOSCRIPT,[T],e),onChangeClientState:q(e),scriptTags:Q(v.SCRIPT,[P,T],e),styleTags:Q(v.STYLE,[k],e),title:Z(e),titleAttributes:K(y,e)}}),(function(e){ae&&ne(ae),e.defer?ae=te((function(){ie(e,(function(){ae=null}))})):(ie(e),ae=null)}),pe)((function(){return null})),ge=(a=me,o=i=function(e){function t(){return j(this,t),W(this,e.apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.shouldComponentUpdate=function(e){return!p()(this.props,e)},t.prototype.mapNestedChildrenToProps=function(e,t){if(!t)return null;switch(e.type){case v.SCRIPT:case v.NOSCRIPT:return{innerHTML:t};case v.STYLE:return{cssText:t}}throw new Error("<"+e.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},t.prototype.flattenArrayTypeChildren=function(e){var t,n=e.child,r=e.arrayTypeChildren,a=e.newChildProps,i=e.nestedChildren;return H({},r,((t={})[n.type]=[].concat(r[n.type]||[],[H({},a,this.mapNestedChildrenToProps(n,i))]),t))},t.prototype.mapObjectTypeChildren=function(e){var t,n,r=e.child,a=e.newProps,i=e.newChildProps,o=e.nestedChildren;switch(r.type){case v.TITLE:return H({},a,((t={})[r.type]=o,t.titleAttributes=H({},i),t));case v.BODY:return H({},a,{bodyAttributes:H({},i)});case v.HTML:return H({},a,{htmlAttributes:H({},i)})}return H({},a,((n={})[r.type]=H({},i),n))},t.prototype.mapArrayTypeChildrenToProps=function(e,t){var n=H({},t);return Object.keys(e).forEach((function(t){var r;n=H({},n,((r={})[t]=e[t],r))})),n},t.prototype.warnOnInvalidChildren=function(e,t){return!0},t.prototype.mapChildrenToProps=function(e,t){var n=this,r={};return l.Children.forEach(e,(function(e){if(e&&e.props){var a=e.props,i=a.children,o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((function(t,n){return t[M[n]||n]=e[n],t}),t)}(G(a,["children"]));switch(n.warnOnInvalidChildren(e,i),e.type){case v.LINK:case v.META:case v.NOSCRIPT:case v.SCRIPT:case v.STYLE:r=n.flattenArrayTypeChildren({child:e,arrayTypeChildren:r,newChildProps:o,nestedChildren:i});break;default:t=n.mapObjectTypeChildren({child:e,newProps:t,newChildProps:o,nestedChildren:i})}}})),t=this.mapArrayTypeChildrenToProps(r,t)},t.prototype.render=function(){var e=this.props,t=e.children,n=G(e,["children"]),r=H({},n);return t&&(r=this.mapChildrenToProps(t,r)),l.createElement(a,r)},$(t,null,[{key:"canUseDOM",set:function(e){a.canUseDOM=e}}]),t}(l.Component),i.propTypes={base:s().object,bodyAttributes:s().object,children:s().oneOfType([s().arrayOf(s().node),s().node]),defaultTitle:s().string,defer:s().bool,encodeSpecialCharacters:s().bool,htmlAttributes:s().object,link:s().arrayOf(s().object),meta:s().arrayOf(s().object),noscript:s().arrayOf(s().object),onChangeClientState:s().func,script:s().arrayOf(s().object),style:s().arrayOf(s().object),title:s().string,titleAttributes:s().object,titleTemplate:s().string},i.defaultProps={defer:!0,encodeSpecialCharacters:!0},i.peek=a.peek,i.rewind=function(){var e=a.rewind();return e||(e=pe({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),e},o);ge.renderStatic=ge.rewind;var he=function(e){return l.createElement(ge,Object.assign({},e))}},4748:function(e,t,n){"use strict";var r=n(7294);t.Z=r.createContext(null)},6291:function(e,t,n){"use strict";var r=n(8790);t.Z=r.H},2263:function(e,t,n){"use strict";var r=n(7294),a=n(4748);t.Z=function(){var e=(0,r.useContext)(a.Z);if(null===e)throw new Error("Docusaurus context not provided");return e}},5032:function(e,t,n){"use strict";n.r(t);var r=n(412);t.default=r.Z.canUseDOM?{onRouteUpdate:function(e){var t=e.location;window.ga("set","page",t.pathname),window.ga("send","pageview")}}:null},1678:function(e,t,n){"use strict";n.r(t);var r=n(412),a=n(9782);t.default=function(){if(!r.Z.canUseDOM)return null;var e=a.default.themeConfig.gtag.trackingID;return{onRouteUpdate:function(t){var n=t.location;window.gtag("config",e,{page_path:n.pathname,page_title:document.title}),window.gtag("event","page_view",{page_title:document.title,page_location:n.href,page_path:n.pathname})}}}()},2203:function(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 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(){return o=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},o.apply(this,arguments)}var l=n(7294),u=n(5697),s=[],c=[];function f(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 d(e){var t={loading:!1,loaded:{},error:null},n=[];try{Object.keys(e).forEach((function(r){var a=f(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 f,d;if(!t.loading)throw new Error("react-loadable requires a `loading` component");var m=o({loader:null,loading:null,delay:200,timeout:null,render:p,webpack:null,modules:null},t),g=null;function h(){return g||(g=e(m.loader)),g.promise}return s.push(h),"function"==typeof m.webpack&&c.push((function(){if((0,m.webpack)().every((function(e){return void 0!==e&&void 0!==n.m[e]})))return h()})),d=f=function(t){function n(n){var r;return i(a(a(r=t.call(this,n)||this)),"retry",(function(){r.setState({error:null,loading:!0,timedOut:!1}),g=e(m.loader),r._loadModule()})),h(),r.state={error:g.error,pastDelay:!1,timedOut:!1,loading:g.loading,loaded:g.loaded},r}r(n,t),n.preload=function(){return h()};var o=n.prototype;return o.UNSAFE_componentWillMount=function(){this._loadModule()},o.componentDidMount=function(){this._mounted=!0},o._loadModule=function(){var e=this;if(this.context.loadable&&Array.isArray(m.modules)&&m.modules.forEach((function(t){e.context.loadable.report(t)})),g.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:g.error,loaded:g.loaded,loading:g.loading}),e._clearTimeouts()};g.promise.then((function(){return n(),null})).catch((function(e){return n(),null}))}},o.componentWillUnmount=function(){this._mounted=!1,this._clearTimeouts()},o._clearTimeouts=function(){clearTimeout(this._delay),clearTimeout(this._timeout)},o.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),i(f,"contextTypes",{loadable:u.shape({report:u.func.isRequired})}),d}function g(e){return m(f,e)}g.Map=function(e){if("function"!=typeof e.render)throw new Error("LoadableMap requires a `render(loaded, props)` function");return m(d,e)};var h=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)}))}i(h,"propTypes",{report:u.func.isRequired}),i(h,"childContextTypes",{loadable:u.shape({report:u.func.isRequired}).isRequired}),g.Capture=h,g.preloadAll=function(){return new Promise((function(e,t){b(s).then(e,t)}))},g.preloadReady=function(){return new Promise((function(e,t){b(c).then(e,e)}))},e.exports=g},5345:function(e,t,n){"use strict";n.r(t);var r=n(7410),a=n(412),i=n(9782);(function(e){if(a.Z.canUseDOM){var t=i.default.themeConfig.prism,r=(t=void 0===t?{}:t).additionalLanguages,o=void 0===r?[]:r;window.Prism=e,o.forEach((function(e){n(4901)("./prism-"+e)})),delete window.Prism}})(r.Z)},71:function(e,t,n){"use strict";n.d(t,{lX:function(){return S},q_:function(){return P},ob:function(){return g},PP:function(){return N},Ep:function(){return m},Hp:function(){return h}});var r=n(7462);function a(e){return"/"===e.charAt(0)}function i(e,t){for(var n=t,r=n+1,a=e.length;r<a;n+=1,r+=1)e[n]=e[r];e.pop()}var o=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],o=t&&t.split("/")||[],l=e&&a(e),u=t&&a(t),s=l||u;if(e&&a(e)?o=r:r.length&&(o.pop(),o=o.concat(r)),!o.length)return"/";if(o.length){var c=o[o.length-1];n="."===c||".."===c||""===c}else n=!1;for(var f=0,d=o.length;d>=0;d--){var p=o[d];"."===p?i(o,d):".."===p?(i(o,d),f++):f&&(i(o,d),f--)}if(!s)for(;f--;f)o.unshift("..");!s||""===o[0]||o[0]&&a(o[0])||o.unshift("");var m=o.join("/");return n&&"/"!==m.substr(-1)&&(m+="/"),m};function l(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var u=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=l(t),a=l(n);return r!==t||a!==n?e(r,a):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1},s=n(2177);function c(e){return"/"===e.charAt(0)?e:"/"+e}function f(e){return"/"===e.charAt(0)?e.substr(1):e}function d(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 p(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function m(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 g(e,t,n,a){var i;"string"==typeof e?(i=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var i=t.indexOf("?");return-1!==i&&(n=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),i.state=t):(void 0===(i=(0,r.Z)({},e)).pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==t&&void 0===i.state&&(i.state=t));try{i.pathname=decodeURI(i.pathname)}catch(l){throw l instanceof URIError?new URIError('Pathname "'+i.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):l}return n&&(i.key=n),a?i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=o(i.pathname,a.pathname)):i.pathname=a.pathname:i.pathname||(i.pathname="/"),i}function h(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&u(e.state,t.state)}function b(){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 i="function"==typeof e?e(t,n):e;"string"==typeof i?"function"==typeof r?r(i,a):a(!0):a(!1!==i)}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 y=!("undefined"==typeof window||!window.document||!window.document.createElement);function v(e,t){t(window.confirm(e))}var w="popstate",k="hashchange";function E(){try{return window.history.state||{}}catch(e){return{}}}function S(e){void 0===e&&(e={}),y||(0,s.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,i=!(-1===window.navigator.userAgent.indexOf("Trident")),o=e,l=o.forceRefresh,u=void 0!==l&&l,f=o.getUserConfirmation,h=void 0===f?v:f,S=o.keyLength,T=void 0===S?6:S,x=e.basename?p(c(e.basename)):"";function C(e){var t=e||{},n=t.key,r=t.state,a=window.location,i=a.pathname+a.search+a.hash;return x&&(i=d(i,x)),g(i,r,n)}function _(){return Math.random().toString(36).substr(2,T)}var O=b();function P(e){(0,r.Z)(j,e),j.length=n.length,O.notifyListeners(j.location,j.action)}function A(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||I(C(e.state))}function N(){I(C(E()))}var R=!1;function I(e){if(R)R=!1,P();else{O.confirmTransitionTo(e,"POP",h,(function(t){t?P({action:"POP",location:e}):function(e){var t=j.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&&(R=!0,M(a))}(e)}))}}var L=C(E()),D=[L.key];function F(e){return x+m(e)}function M(e){n.go(e)}var B=0;function U(e){1===(B+=e)&&1===e?(window.addEventListener(w,A),i&&window.addEventListener(k,N)):0===B&&(window.removeEventListener(w,A),i&&window.removeEventListener(k,N))}var z=!1;var j={length:n.length,action:"POP",location:L,createHref:F,push:function(e,t){var r="PUSH",i=g(e,t,_(),j.location);O.confirmTransitionTo(i,r,h,(function(e){if(e){var t=F(i),o=i.key,l=i.state;if(a)if(n.pushState({key:o,state:l},null,t),u)window.location.href=t;else{var s=D.indexOf(j.location.key),c=D.slice(0,s+1);c.push(i.key),D=c,P({action:r,location:i})}else window.location.href=t}}))},replace:function(e,t){var r="REPLACE",i=g(e,t,_(),j.location);O.confirmTransitionTo(i,r,h,(function(e){if(e){var t=F(i),o=i.key,l=i.state;if(a)if(n.replaceState({key:o,state:l},null,t),u)window.location.replace(t);else{var s=D.indexOf(j.location.key);-1!==s&&(D[s]=i.key),P({action:r,location:i})}else window.location.replace(t)}}))},go:M,goBack:function(){M(-1)},goForward:function(){M(1)},block:function(e){void 0===e&&(e=!1);var t=O.setPrompt(e);return z||(U(1),z=!0),function(){return z&&(z=!1,U(-1)),t()}},listen:function(e){var t=O.appendListener(e);return U(1),function(){U(-1),t()}}};return j}var T="hashchange",x={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+f(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:f,decodePath:c},slash:{encodePath:c,decodePath:c}};function C(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function _(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function O(e){window.location.replace(C(window.location.href)+"#"+e)}function P(e){void 0===e&&(e={}),y||(0,s.Z)(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),a=n.getUserConfirmation,i=void 0===a?v:a,o=n.hashType,l=void 0===o?"slash":o,u=e.basename?p(c(e.basename)):"",f=x[l],h=f.encodePath,w=f.decodePath;function k(){var e=w(_());return u&&(e=d(e,u)),g(e)}var E=b();function S(e){(0,r.Z)(z,e),z.length=t.length,E.notifyListeners(z.location,z.action)}var P=!1,A=null;function N(){var e,t,n=_(),r=h(n);if(n!==r)O(r);else{var a=k(),o=z.location;if(!P&&(t=a,(e=o).pathname===t.pathname&&e.search===t.search&&e.hash===t.hash))return;if(A===m(a))return;A=null,function(e){if(P)P=!1,S();else{var t="POP";E.confirmTransitionTo(e,t,i,(function(n){n?S({action:t,location:e}):function(e){var t=z.location,n=D.lastIndexOf(m(t));-1===n&&(n=0);var r=D.lastIndexOf(m(e));-1===r&&(r=0);var a=n-r;a&&(P=!0,F(a))}(e)}))}}(a)}}var R=_(),I=h(R);R!==I&&O(I);var L=k(),D=[m(L)];function F(e){t.go(e)}var M=0;function B(e){1===(M+=e)&&1===e?window.addEventListener(T,N):0===M&&window.removeEventListener(T,N)}var U=!1;var z={length:t.length,action:"POP",location:L,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&(n=C(window.location.href)),n+"#"+h(u+m(e))},push:function(e,t){var n="PUSH",r=g(e,void 0,void 0,z.location);E.confirmTransitionTo(r,n,i,(function(e){if(e){var t=m(r),a=h(u+t);if(_()!==a){A=t,function(e){window.location.hash=e}(a);var i=D.lastIndexOf(m(z.location)),o=D.slice(0,i+1);o.push(t),D=o,S({action:n,location:r})}else S()}}))},replace:function(e,t){var n="REPLACE",r=g(e,void 0,void 0,z.location);E.confirmTransitionTo(r,n,i,(function(e){if(e){var t=m(r),a=h(u+t);_()!==a&&(A=t,O(a));var i=D.indexOf(m(z.location));-1!==i&&(D[i]=t),S({action:n,location:r})}}))},go:F,goBack:function(){F(-1)},goForward:function(){F(1)},block:function(e){void 0===e&&(e=!1);var t=E.setPrompt(e);return U||(B(1),U=!0),function(){return U&&(U=!1,B(-1)),t()}},listen:function(e){var t=E.appendListener(e);return B(1),function(){B(-1),t()}}};return z}function A(e,t,n){return Math.min(Math.max(e,t),n)}function N(e){void 0===e&&(e={});var t=e,n=t.getUserConfirmation,a=t.initialEntries,i=void 0===a?["/"]:a,o=t.initialIndex,l=void 0===o?0:o,u=t.keyLength,s=void 0===u?6:u,c=b();function f(e){(0,r.Z)(w,e),w.length=w.entries.length,c.notifyListeners(w.location,w.action)}function d(){return Math.random().toString(36).substr(2,s)}var p=A(l,0,i.length-1),h=i.map((function(e){return g(e,void 0,"string"==typeof e?d():e.key||d())})),y=m;function v(e){var t=A(w.index+e,0,w.entries.length-1),r=w.entries[t];c.confirmTransitionTo(r,"POP",n,(function(e){e?f({action:"POP",location:r,index:t}):f()}))}var w={length:h.length,action:"POP",location:h[p],index:p,entries:h,createHref:y,push:function(e,t){var r="PUSH",a=g(e,t,d(),w.location);c.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),f({action:r,location:a,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",a=g(e,t,d(),w.location);c.confirmTransitionTo(a,r,n,(function(e){e&&(w.entries[w.index]=a,f({action:r,location:a}))}))},go:v,goBack:function(){v(-1)},goForward:function(){v(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),c.setPrompt(e)},listen:function(e){return c.appendListener(e)}};return w}},8679:function(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},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function u(e){return r.isMemo(e)?o:l[e.$$typeof]||a}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=o;var s=Object.defineProperty,c=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,d=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 o=c(n);f&&(o=o.concat(f(n)));for(var l=u(t),g=u(n),h=0;h<o.length;++h){var b=o[h];if(!(i[b]||r&&r[b]||g&&g[b]||l&&l[b])){var y=d(n,b);try{s(t,b,y)}catch(v){}}}}return t}},2497:function(e,t,n){"use strict";n.r(t)},7771:function(e,t,n){"use strict";n.r(t)},2295:function(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 i(e){return 100*(-1+e)}function o(e,t,n){var a;return(a="translate3d"===r.positionUsing?{transform:"translate3d("+i(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+i(e)+"%,0)"}:{"margin-left":i(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 i=n.render(!t),s=i.querySelector(r.barSelector),c=r.speed,f=r.easing;return i.offsetWidth,l((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),u(s,o(e,c,f)),1===e?(u(i,{transition:"none",opacity:1}),i.offsetWidth,setTimeout((function(){u(i,{transition:"all "+c+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),c)}),c)):setTimeout(t,c)})),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");c(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var a,o=t.querySelector(r.barSelector),l=e?"-100":i(n.status||0),s=document.querySelector(r.parent);return u(o,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),r.showSpinner||(a=t.querySelector(r.spinnerSelector))&&p(a),s!=document.body&&c(s,"nprogress-custom-parent"),s.appendChild(t),t},n.remove=function(){f(document.documentElement,"nprogress-busy"),f(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()}}(),u=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,i=t.charAt(0).toUpperCase()+t.slice(1);a--;)if((r=e[a]+i)in n)return r;return t}function a(e){return e=n(e),t[e]||(t[e]=r(e))}function i(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)&&i(e,n,r);else i(e,a[1],a[2])}}();function s(e,t){return("string"==typeof e?e:d(e)).indexOf(" "+t+" ")>=0}function c(e,t){var n=d(e),r=n+t;s(n,t)||(e.className=r.substring(1))}function f(e,t){var n,r=d(e);s(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function d(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:function(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,i){for(var o,l,u=a(e),s=1;s<arguments.length;s++){for(var c in o=Object(arguments[s]))n.call(o,c)&&(u[c]=o[c]);if(t){l=t(o);for(var f=0;f<l.length;f++)r.call(o,l[f])&&(u[l[f]]=o[l[f]])}}return u}},7410:function(e,t){"use strict";var n,r,a,i=(n=0,r={util:{encode:function(e){return e instanceof a?new a(e.type,r.util.encode(e.content),e.alias):"Array"===r.util.type(e)?e.map(r.util.encode):e.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function(e,t){var n=r.util.type(e);switch(t=t||{},n){case"Object":if(t[r.util.objId(e)])return t[r.util.objId(e)];var a={};for(var i in t[r.util.objId(e)]=a,e)e.hasOwnProperty(i)&&(a[i]=r.util.clone(e[i],t));return a;case"Array":return t[r.util.objId(e)]?t[r.util.objId(e)]:(a=[],t[r.util.objId(e)]=a,e.forEach((function(e,n){a[n]=r.util.clone(e,t)})),a)}return e}},languages:{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 i=(a=a||r.languages)[e];if(2==arguments.length){for(var o in n=arguments[1])n.hasOwnProperty(o)&&(i[o]=n[o]);return i}var l={};for(var u in i)if(i.hasOwnProperty(u)){if(u==t)for(var o in n)n.hasOwnProperty(o)&&(l[o]=n[o]);l[u]=i[u]}return r.languages.DFS(r.languages,(function(t,n){n===a[e]&&t!=e&&(this[t]=l)})),a[e]=l},DFS:function(e,t,n,a){for(var i in a=a||{},e)e.hasOwnProperty(i)&&(t.call(e,i,e[i],n||i),"Object"!==r.util.type(e[i])||a[r.util.objId(e[i])]?"Array"!==r.util.type(e[i])||a[r.util.objId(e[i])]||(a[r.util.objId(e[i])]=!0,r.languages.DFS(e[i],t,i,a)):(a[r.util.objId(e[i])]=!0,r.languages.DFS(e[i],t,null,a)))}},plugins:{},highlight:function(e,t,n){var i={code:e,grammar:t,language:n};return r.hooks.run("before-tokenize",i),i.tokens=r.tokenize(i.code,i.grammar),r.hooks.run("after-tokenize",i),a.stringify(r.util.encode(i.tokens),i.language)},matchGrammar:function(e,t,n,a,i,o,l){var u=r.Token;for(var s in n)if(n.hasOwnProperty(s)&&n[s]){if(s==l)return;var c=n[s];c="Array"===r.util.type(c)?c:[c];for(var f=0;f<c.length;++f){var d=c[f],p=d.inside,m=!!d.lookbehind,g=!!d.greedy,h=0,b=d.alias;if(g&&!d.pattern.global){var y=d.pattern.toString().match(/[imuy]*$/)[0];d.pattern=RegExp(d.pattern.source,y+"g")}d=d.pattern||d;for(var v=a,w=i;v<t.length;w+=t[v].length,++v){var k=t[v];if(t.length>e.length)return;if(!(k instanceof u)){if(g&&v!=t.length-1){if(d.lastIndex=w,!(_=d.exec(e)))break;for(var E=_.index+(m?_[1].length:0),S=_.index+_[0].length,T=v,x=w,C=t.length;T<C&&(x<S||!t[T].type&&!t[T-1].greedy);++T)E>=(x+=t[T].length)&&(++v,w=x);if(t[v]instanceof u)continue;O=T-v,k=e.slice(w,x),_.index-=w}else{d.lastIndex=0;var _=d.exec(k),O=1}if(_){m&&(h=_[1]?_[1].length:0),S=(E=_.index+h)+(_=_[0].slice(h)).length;var P=k.slice(0,E),A=k.slice(S),N=[v,O];P&&(++v,w+=P.length,N.push(P));var R=new u(s,p?r.tokenize(_,p):_,b,_,g);if(N.push(R),A&&N.push(A),Array.prototype.splice.apply(t,N),1!=O&&r.matchGrammar(e,t,n,v,w,!0,s),o)break}else if(o)break}}}}},hooks:{add:function(){},run:function(e,t){}},tokenize:function(e,t,n){var a=[e],i=t.rest;if(i){for(var o in i)t[o]=i[o];delete t.rest}return r.matchGrammar(e,a,t,0,0,!1),a}},(a=r.Token=function(e,t,n,r,a){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length,this.greedy=!!a}).stringify=function(e,t,n){if("string"==typeof e)return e;if("Array"===r.util.type(e))return e.map((function(n){return a.stringify(n,t,e)})).join("");var i={type:e.type,content:a.stringify(e.content,t,n),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:n};if(e.alias){var o="Array"===r.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(i.classes,o)}var l=Object.keys(i.attributes).map((function(e){return e+'="'+(i.attributes[e]||"").replace(/"/g,""")+'"'})).join(" ");return"<"+i.tag+' class="'+i.classes.join(" ")+'"'+(l?" "+l:"")+">"+i.content+"</"+i.tag+">"},r);i.languages.markup={comment:/<!--[\s\S]*?-->/,prolog:/<\?[\s\S]+?\?>/,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/,name:/[^\s<>'"]+/}},cdata:/<!\[CDATA\[[\s\S]*?]]>/i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"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]},i.languages.markup.tag.inside["attr-value"].inside.entity=i.languages.markup.entity,i.languages.markup.doctype.inside["internal-subset"].inside=i.languages.markup,i.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(i.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:i.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:i.languages[t]};var a={};a[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},i.languages.insertBefore("markup","cdata",a)}}),i.languages.html=i.languages.markup,i.languages.mathml=i.languages.markup,i.languages.svg=i.languages.markup,i.languages.xml=i.languages.extend("markup",{}),i.languages.ssml=i.languages.xml,i.languages.atom=i.languages.xml,i.languages.rss=i.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}|x[0-9a-fA-F]{1,2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})/};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]|\$\([^)]+\)|\$(?!\()|`[^`]+`|(?!\2)[^\\`$])*\2/,lookbehind:!0,greedy:!0,inside:r}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|aptitude|apt-cache|apt-get|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|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|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|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|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;|&]|[<>]\()(?:if|then|else|elif|fi|for|while|in|case|esac|function|select|do|done|until)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|break|cd|continue|eval|exec|exit|export|getopts|hash|pwd|readonly|return|shift|test|times|trap|umask|unset|alias|bind|builtin|caller|command|declare|echo|enable|help|let|local|logout|mapfile|printf|read|readarray|source|type|typeset|ulimit|unalias|set|shopt)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:true|false)(?=$|[)\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"],i=r.variable[1].inside,o=0;o<a.length;o++)i[a[o]]=e.languages.bash[a[o]];e.languages.shell=e.languages.bash}(i),i.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|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},i.languages.c=i.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,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(?:__attribute__|_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,function:/[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|[?:~]|[-+*/%&|^!=<>]=?/}),i.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},i.languages.c.string],comment:i.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:i.languages.c}}},constant:/\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/}),delete i.languages.c.boolean,function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char8_t|char16_t|char32_t|class|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|co_await|co_return|co_yield|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|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|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/;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,/\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:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:true|false)\b/}),e.languages.insertBefore("cpp","string",{"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),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","operator",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(i),function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;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:RegExp("[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),string:{pattern:t,greedy:!0},property:/(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,important:/!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),e.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/(^|["'\s])style\s*=\s*(?:"[^"]*"|'[^']*')/i,lookbehind:!0,inside:{"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{style:{pattern:/(["'])[\s\S]+(?=["']$)/,lookbehind:!0,alias:"language-css",inside:e.languages.css},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},"attr-name":/^style/i}}},n.tag))}(i),function(e){var t,n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css.selector={pattern:e.languages.css.selector,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]+\b)/,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]{1,2}){3,4}\b/i,alias:"color"},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(?:rgb|hsl)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:rgb|hsl)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})}(i),i.languages.javascript=i.languages.extend("clike",{"class-name":[i.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|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:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),i.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,i.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:i.languages.regex},"regex-flags":/[a-z]+$/,"regex-delimiter":/^\/|\/$/}},"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:i.languages.javascript},{pattern:/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,inside:i.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:i.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:i.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),i.languages.insertBefore("javascript","string",{"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:i.languages.javascript}},string:/[\s\S]+/}}}),i.languages.markup&&i.languages.markup.tag.addInlined("script","javascript"),i.languages.js=i.languages.javascript,function(e){var t=e.util.clone(e.languages.javascript);e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=/<\/?(?:[\w.:-]+(?:\s+(?:[\w.:$-]+(?:=(?:"(?:\\[^]|[^\\"])*"|'(?:\\[^]|[^\\'])*'|[^\s{'">=]+|\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}))?|\{\s*\.{3}\s*[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*\s*\}))*\s*\/?)?>/i,e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/i,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[^]|[^\\"])*"|'(?:\\[^]|[^\\'])*'|[^\s'">]+)/i,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.insertBefore("inside","attr-name",{spread:{pattern:/\{\s*\.{3}\s*[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*\s*\}/,inside:{punctuation:/\.{3}|[{}.]/,"attr-value":/\w+/}}},e.languages.jsx.tag),e.languages.insertBefore("inside","attr-value",{script:{pattern:/=(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\})/i,inside:{"script-punctuation":{pattern:/^=(?={)/,alias:"punctuation"},rest:e.languages.jsx},alias:"language-javascript"}},e.languages.jsx.tag);var n=function(e){return e?"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(n).join(""):""},r=function(t){for(var a=[],i=0;i<t.length;i++){var o=t[i],l=!1;if("string"!=typeof o&&("tag"===o.type&&o.content[0]&&"tag"===o.content[0].type?"</"===o.content[0].content[0].content?a.length>0&&a[a.length-1].tagName===n(o.content[0].content[1])&&a.pop():"/>"===o.content[o.content.length-1].content||a.push({tagName:n(o.content[0].content[1]),openedBraces:0}):a.length>0&&"punctuation"===o.type&&"{"===o.content?a[a.length-1].openedBraces++:a.length>0&&a[a.length-1].openedBraces>0&&"punctuation"===o.type&&"}"===o.content?a[a.length-1].openedBraces--:l=!0),(l||"string"==typeof o)&&a.length>0&&0===a[a.length-1].openedBraces){var u=n(o);i<t.length-1&&("string"==typeof t[i+1]||"plain-text"===t[i+1].type)&&(u+=n(t[i+1]),t.splice(i+1,1)),i>0&&("string"==typeof t[i-1]||"plain-text"===t[i-1].type)&&(u=n(t[i-1])+u,t.splice(i-1,1),i--),t[i]=new e.Token("plain-text",u,null,u)}o.content&&"string"!=typeof o.content&&r(o.content)}};e.hooks.add("after-tokenize",(function(e){"jsx"!==e.language&&"tsx"!==e.language||r(e.tokens)}))}(i),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(?:(?:(?:Uint|Int)(?:8|16|32)|Uint8Clamped|Float(?:32|64))?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|(?:Weak)?(?:Set|Map)|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|for|finally|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|location|navigator|performance|(?:local|session)Storage|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],i=e.languages.javascript[a];"RegExp"===e.util.type(i)&&(i=e.languages.javascript[a]={pattern:i});var o=i.inside||{};i.inside=o,o["maybe-class-name"]=/^[A-Z][\s\S]*/}}(i),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}(i),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})}(i),i.languages.git={comment:/^#.*/m,deleted:/^[-\u2013].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/m,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/m}},coord:/^@@.*@@$/m,"commit-sha1":/^commit \w{40}$/m},i.languages.go=i.languages.extend("clike",{string:{pattern:/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,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(?:_|iota|nil|true|false)\b/,number:/(?:\b0x[a-f\d]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[-+]?\d+)?)i?/i,operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:bool|byte|complex(?:64|128)|error|float(?:32|64)|rune|string|u?int(?:8|16|32|64)?|uintptr|append|cap|close|complex|copy|delete|imag|len|make|new|panic|print(?:ln)?|real|recover)\b/}),delete i.languages.go["class-name"],i.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:i.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:true|false)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*)[a-zA-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[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}/,punctuation:/[!(){}\[\]:=,]/,constant:/\b(?!ID\b)[A-Z][A-Z_\d]*\b/},function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,a,i){if(n.language===r){var o=n.tokenStack=[];n.code=n.code.replace(a,(function(e){if("function"==typeof i&&!i(e))return e;for(var a,l=o.length;-1!==n.code.indexOf(a=t(r,l));)++l;return o[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,i=Object.keys(n.tokenStack);!function o(l){for(var u=0;u<l.length&&!(a>=i.length);u++){var s=l[u];if("string"==typeof s||s.content&&"string"==typeof s.content){var c=i[a],f=n.tokenStack[c],d="string"==typeof s?s:s.content,p=t(r,c),m=d.indexOf(p);if(m>-1){++a;var g=d.substring(0,m),h=new e.Token(r,e.tokenize(f,n.grammar),"language-"+r,f),b=d.substring(m+p.length),y=[];g&&y.push.apply(y,o([g])),y.push(h),b&&y.push.apply(y,o([b])),"string"==typeof s?l.splice.apply(l,[u,1].concat(y)):s.content=y}}else s.content&&o(s.content)}return l}(n.tokens)}}}})}(i),function(e){e.languages.handlebars={comment:/\{\{![\s\S]*?\}\}/,delimiter:{pattern:/^\{\{\{?|\}\}\}?$/i,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][+-]?\d+)?/,boolean:/\b(?:true|false)\b/,block:{pattern:/^(\s*(?:~\s*)?)[#\/]\S+?(?=\s*(?:~\s*)?$|\s)/i,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")}))}(i),i.languages.json={property:{pattern:/"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,greedy:!0},string:{pattern:/"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:true|false)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},i.languages.webmanifest=i.languages.json,i.languages.less=i.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*:)/i,operator:/[+\-*\/]/}),i.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}}),i.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:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,symbol:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,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/,{pattern:/(\()(?:addsuffix|abspath|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(?:s|list)?)(?=[ \t])/,lookbehind:!0}],operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/},function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?!\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})),i=/\|?[ \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:/^---|---$/,"font-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+a+i+"(?:"+a+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+a+i+")(?:"+a+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+a+")"+i+"$"),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:/``.+?``|`[^`\r\n]+`/,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:/~~?/}},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"].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 i=a.content[1],o=a.content[3];if(i&&o&&"code-language"===i.type&&"code-block"===o.type&&"string"==typeof i.content){var l=i.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),u="language-"+(l=(/[a-z][\w-]*/i.exec(l)||[""])[0].toLowerCase());o.alias?"string"==typeof o.alias?o.alias=[o.alias,u]:o.alias.push(u):o.alias=[u]}}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 i=t.classes[r],o=/language-(.+)/.exec(i);if(o){n=o[1];break}}var l=e.languages[n];if(l){var u=t.content.replace(/</g,"<").replace(/&/g,"&");t.content=e.highlight(u,l,n)}else if(n&&"none"!==n&&e.plugins.autoloader){var s="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());t.attributes.id=s,e.plugins.autoloader.loadLanguages(n,(function(){var t=document.getElementById(s);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))}))}}})),e.languages.md=e.languages.markdown}(i),i.languages.objectivec=i.languages.extend("c",{string:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|@"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,keyword:/\b(?:asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while|in|self|super)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete i.languages.objectivec["class-name"],i.languages.objc=i.languages.objectivec,i.languages.ocaml={comment:/\(\*[\s\S]*?\*\)/,string:[{pattern:/"(?:\\.|[^\\\r\n"])*"/,greedy:!0},{pattern:/(['`])(?:\\(?:\d+|x[\da-f]+|.)|(?!\1)[^\\\r\n])\1/i,greedy:!0}],number:/\b(?:0x[\da-f][\da-f_]+|(?:0[bo])?\d[\d_]*(?:\.[\d_]*)?(?:e[+-]?[\d_]+)?)/i,directive:{pattern:/\B#\w+/,alias:"important"},label:{pattern:/\B~\w+/,alias:"function"},"type-variable":{pattern:/\B'\w+/,alias:"function"},variant:{pattern:/`\w+/,alias:"variable"},module:{pattern:/\b[A-Z]\w+/,alias:"variable"},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:/:=|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,punctuation:/[(){}\[\]|.,:;]|\b_\b/},i.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},"string-interpolation":{pattern:/(?:f|rf|fr)(?:("""|''')[\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]|rb|br)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|rb|br)?("|')(?:\\.|(?!\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:/(^\s*)@\w+(?:\.\w+)*/im,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|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(?:True|False|None)\b/,number:/(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},i.languages.python["string-interpolation"].inside.interpolation.inside.rest=i.languages.python,i.languages.py=i.languages.python,i.languages.reason=i.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(?:mod|land|lor|lxor|lsl|lsr|asr)\b/}),i.languages.insertBefore("reason","class-name",{character:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,alias:"string"},constructor:{pattern:/\b[A-Z]\w*\b(?!\s*\.)/,alias:"variable"},label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete i.languages.reason.function,function(e){e.languages.sass=e.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0}}),e.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,inside:{atrule:/(?:@[\w-]+|[+=])/m}}}),delete e.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,n=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|or|not)\b/,{pattern:/(\s+)-(?=\s)/,lookbehind:!0}];e.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,inside:{punctuation:/:/,variable:t,operator:n}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,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]+)*)*/,lookbehind:!0}})}(i),i.languages.scss=i.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|[^}][^:{}]*[:{][^}]+))/m,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),i.languages.insertBefore("scss","atrule",{keyword:[/@(?:if|else(?: if)?|forward|for|each|while|import|use|extend|debug|warn|mixin|include|function|return|content)\b/i,{pattern:/( +)(?:from|through)(?= )/,lookbehind:!0}]}),i.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),i.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|with|show|hide)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:true|false)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|or|not)(?=\s)/,lookbehind:!0}}),i.languages.scss.atrule.inside.rest=i.languages.scss,i.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},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(?:_INSERT|COL)?|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(?:S|ING)?|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(?:TRUE|FALSE|NULL)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|IN|LIKE|NOT|OR|IS|DIV|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},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:/url\((["']?).*?\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+)(?:(?:if|else|for|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(?:rgb|hsl)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:rgb|hsl)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(?:true|false)\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:/(^\s*)@.+/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]*)(?:if|else|for|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:/[{}()\[\];:.]/}}(i),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},keyword:/\b(?:abstract|as|asserts|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|undefined|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/}),delete e.languages.typescript.parameter;var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{"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}(i),function(e){var t=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend("jsx",t);var n=e.languages.tsx.tag;n.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+n.pattern.source+")",n.pattern.flags),n.lookbehind=!0}(i),i.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|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|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!#$%&'*+\-./:<=>?@\\^_`|~]+/i,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:/[()]/},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})),i=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(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+"|"+i+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\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:o(/true|false/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(i),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?: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}(i),t.Z=i},485:function(){Prism.languages.groovy=Prism.languages.extend("clike",{string:[{pattern:/("""|''')(?:[^\\]|\\[\s\S])*?\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/,greedy:!0},{pattern:/(["'/])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0}],keyword:/\b(?:as|def|in|abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/,number:/\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i,operator:{pattern:/(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,lookbehind:!0},punctuation:/\.+|[{}[\];(),:$]/}),Prism.languages.insertBefore("groovy","string",{shebang:{pattern:/#!.+/,alias:"comment"}}),Prism.languages.insertBefore("groovy","punctuation",{"spock-block":/\b(?:setup|given|when|then|and|cleanup|expect|where):/}),Prism.languages.insertBefore("groovy","function",{annotation:{pattern:/(^|[^.])@\w+/,lookbehind:!0,alias:"punctuation"}}),Prism.hooks.add("wrap",(function(e){if("groovy"===e.language&&"string"===e.type){var t=e.content[0];if("'"!=t){var n=/([^\\])(?:\$(?:\{.*?\}|[\w.]+))/;"$"===t&&(n=/([^\$])(?:\$(?:\{.*?\}|[\w.]+))/),e.content=e.content.replace(/</g,"<").replace(/&/g,"&"),e.content=Prism.highlight(e.content,{expression:{pattern:n,lookbehind:!0,inside:Prism.languages.groovy}}),e.classes.push("/"===t?"regex":"gstring")}}}))},2503:function(){!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|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=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(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",{"class-name":[r,{pattern:RegExp(n+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.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}}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"}}),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:/[?&|]/}},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)},5820:function(){Prism.languages.properties={comment:/^[ \t]*[#!].*$/m,"attr-value":{pattern:/(^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?: *[=:] *(?! )| ))(?:\\(?:\r\n|[\s\S])|[^\\\r\n])+/m,lookbehind:!0},"attr-name":/^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?= *[=:]| )/m,punctuation:/[=:]/}},4901:function(e,t,n){var r={"./prism-groovy":485,"./prism-java":2503,"./prism-properties":5820};function a(e){var t=i(e);return n(t)}function i(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=i,e.exports=a,a.id=4901},2703:function(e,t,n){"use strict";var r=n(414);function a(){}function i(){}i.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,i,o){if(o!==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,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:i,resetWarningCache:a};return n.PropTypes=n,n}},5697:function(e,t,n){e.exports=n(2703)()},414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4448:function(e,t,n){"use strict";var r=n(7294),a=n(7418),i=n(3840);function o(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(o(227));function l(e,t,n,r,a,i,o,l,u){var s=Array.prototype.slice.call(arguments,3);try{t.apply(n,s)}catch(c){this.onError(c)}}var u=!1,s=null,c=!1,f=null,d={onError:function(e){u=!0,s=e}};function p(e,t,n,r,a,i,o,c,f){u=!1,s=null,l.apply(d,arguments)}var m=null,g=null,h=null;function b(e,t,n){var r=e.type||"unknown-event";e.currentTarget=h(n),function(e,t,n,r,a,i,l,d,m){if(p.apply(this,arguments),u){if(!u)throw Error(o(198));var g=s;u=!1,s=null,c||(c=!0,f=g)}}(r,t,void 0,e),e.currentTarget=null}var y=null,v={};function w(){if(y)for(var e in v){var t=v[e],n=y.indexOf(e);if(!(-1<n))throw Error(o(96,e));if(!E[n]){if(!t.extractEvents)throw Error(o(97,e));for(var r in E[n]=t,n=t.eventTypes){var a=void 0,i=n[r],l=t,u=r;if(S.hasOwnProperty(u))throw Error(o(99,u));S[u]=i;var s=i.phasedRegistrationNames;if(s){for(a in s)s.hasOwnProperty(a)&&k(s[a],l,u);a=!0}else i.registrationName?(k(i.registrationName,l,u),a=!0):a=!1;if(!a)throw Error(o(98,r,e))}}}}function k(e,t,n){if(T[e])throw Error(o(100,e));T[e]=t,x[e]=t.eventTypes[n].dependencies}var E=[],S={},T={},x={};function C(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var r=e[t];if(!v.hasOwnProperty(t)||v[t]!==r){if(v[t])throw Error(o(102,t));v[t]=r,n=!0}}n&&w()}var _=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),O=null,P=null,A=null;function N(e){if(e=g(e)){if("function"!=typeof O)throw Error(o(280));var t=e.stateNode;t&&(t=m(t),O(e.stateNode,e.type,t))}}function R(e){P?A?A.push(e):A=[e]:P=e}function I(){if(P){var e=P,t=A;if(A=P=null,N(e),t)for(e=0;e<t.length;e++)N(t[e])}}function L(e,t){return e(t)}function D(e,t,n,r,a){return e(t,n,r,a)}function F(){}var M=L,B=!1,U=!1;function z(){null===P&&null===A||(F(),I())}function j(e,t,n){if(U)return e(t,n);U=!0;try{return M(e,t,n)}finally{U=!1,z()}}var $=/^[: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]*$/,H=Object.prototype.hasOwnProperty,G={},W={};function V(e,t,n,r,a,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=i}var Z={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){Z[e]=new V(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];Z[t]=new V(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){Z[e]=new V(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){Z[e]=new V(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){Z[e]=new V(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){Z[e]=new V(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){Z[e]=new V(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){Z[e]=new V(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){Z[e]=new V(e,5,!1,e.toLowerCase(),null,!1)}));var q=/[\-:]([a-z])/g;function K(e){return e[1].toUpperCase()}"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(q,K);Z[t]=new V(t,1,!1,e,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(q,K);Z[t]=new V(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(q,K);Z[t]=new V(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){Z[e]=new V(e,1,!1,e.toLowerCase(),null,!1)})),Z.xlinkHref=new V("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){Z[e]=new V(e,1,!1,e.toLowerCase(),null,!0)}));var Y=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Q(e,t,n,r){var a=Z.hasOwnProperty(t)?Z[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!!H.call(W,e)||!H.call(G,e)&&($.test(e)?W[e]=!0:(G[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))))}Y.hasOwnProperty("ReactCurrentDispatcher")||(Y.ReactCurrentDispatcher={current:null}),Y.hasOwnProperty("ReactCurrentBatchConfig")||(Y.ReactCurrentBatchConfig={suspense:null});var X=/^(.*)[\\\/]/,J="function"==typeof Symbol&&Symbol.for,ee=J?Symbol.for("react.element"):60103,te=J?Symbol.for("react.portal"):60106,ne=J?Symbol.for("react.fragment"):60107,re=J?Symbol.for("react.strict_mode"):60108,ae=J?Symbol.for("react.profiler"):60114,ie=J?Symbol.for("react.provider"):60109,oe=J?Symbol.for("react.context"):60110,le=J?Symbol.for("react.concurrent_mode"):60111,ue=J?Symbol.for("react.forward_ref"):60112,se=J?Symbol.for("react.suspense"):60113,ce=J?Symbol.for("react.suspense_list"):60120,fe=J?Symbol.for("react.memo"):60115,de=J?Symbol.for("react.lazy"):60116,pe=J?Symbol.for("react.block"):60121,me="function"==typeof Symbol&&Symbol.iterator;function ge(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=me&&e[me]||e["@@iterator"])?e:null}function he(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 ne:return"Fragment";case te:return"Portal";case ae:return"Profiler";case re:return"StrictMode";case se:return"Suspense";case ce:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case oe:return"Context.Consumer";case ie:return"Context.Provider";case ue:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case fe:return he(e.type);case pe:return he(e.render);case de:if(e=1===e._status?e._result:null)return he(e)}return null}function be(e){var t="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var n="";break e;default:var r=e._debugOwner,a=e._debugSource,i=he(e.type);n=null,r&&(n=he(r.type)),r=i,i="",a?i=" (at "+a.fileName.replace(X,"")+":"+a.lineNumber+")":n&&(i=" (created by "+n+")"),n="\n in "+(r||"Unknown")+i}t+=n,e=e.return}while(e);return t}function ye(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function ve(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function we(e){e._valueTracker||(e._valueTracker=function(e){var t=ve(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,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(e){r=""+e,i.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 ke(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ve(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Ee(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 Se(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=ye(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)&&Q(e,"checked",t,!1)}function xe(e,t){Te(e,t);var n=ye(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")?_e(e,t.type,n):t.hasOwnProperty("defaultValue")&&_e(e,t.type,ye(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Ce(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 _e(e,t,n){"number"===t&&e.ownerDocument.activeElement===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 Pe(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=""+ye(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 Ae(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(o(91));return a({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ne(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(o(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(o(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:ye(n)}}function Re(e,t){var n=ye(t.value),r=ye(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 Ie(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var Le="http://www.w3.org/1999/xhtml",De="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 Me(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 Be,Ue,ze=(Ue=function(e,t){if(e.namespaceURI!==De||"innerHTML"in e)e.innerHTML=t;else{for((Be=Be||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Be.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 Ue(e,t)}))}:Ue);function je(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function $e(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var He={animationend:$e("Animation","AnimationEnd"),animationiteration:$e("Animation","AnimationIteration"),animationstart:$e("Animation","AnimationStart"),transitionend:$e("Transition","TransitionEnd")},Ge={},We={};function Ve(e){if(Ge[e])return Ge[e];if(!He[e])return e;var t,n=He[e];for(t in n)if(n.hasOwnProperty(t)&&t in We)return Ge[e]=n[t];return e}_&&(We=document.createElement("div").style,"AnimationEvent"in window||(delete He.animationend.animation,delete He.animationiteration.animation,delete He.animationstart.animation),"TransitionEvent"in window||delete He.transitionend.transition);var Ze=Ve("animationend"),qe=Ve("animationiteration"),Ke=Ve("animationstart"),Ye=Ve("transitionend"),Qe="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Xe=new("function"==typeof WeakMap?WeakMap:Map);function Je(e){var t=Xe.get(e);return void 0===t&&(t=new Map,Xe.set(e,t)),t}function et(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).effectTag)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function tt(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 nt(e){if(et(e)!==e)throw Error(o(188))}function rt(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=et(e)))throw Error(o(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(null===a)break;var i=a.alternate;if(null===i){if(null!==(r=a.return)){n=r;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===n)return nt(a),e;if(i===r)return nt(a),t;i=i.sibling}throw Error(o(188))}if(n.return!==r.return)n=a,r=i;else{for(var l=!1,u=a.child;u;){if(u===n){l=!0,n=a,r=i;break}if(u===r){l=!0,r=a,n=i;break}u=u.sibling}if(!l){for(u=i.child;u;){if(u===n){l=!0,n=i,r=a;break}if(u===r){l=!0,r=i,n=a;break}u=u.sibling}if(!l)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(3!==n.tag)throw Error(o(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 at(e,t){if(null==t)throw Error(o(30));return null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function it(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var ot=null;function lt(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var r=0;r<t.length&&!e.isPropagationStopped();r++)b(e,t[r],n[r]);else t&&b(e,t,n);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function ut(e){if(null!==e&&(ot=at(ot,e)),e=ot,ot=null,e){if(it(e,lt),ot)throw Error(o(95));if(c)throw e=f,c=!1,f=null,e}}function st(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function ct(e){if(!_)return!1;var t=(e="on"+e)in document;return t||((t=document.createElement("div")).setAttribute(e,"return;"),t="function"==typeof t[e]),t}var ft=[];function dt(e){e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>ft.length&&ft.push(e)}function pt(e,t,n,r){if(ft.length){var a=ft.pop();return a.topLevelType=e,a.eventSystemFlags=r,a.nativeEvent=t,a.targetInst=n,a}return{topLevelType:e,eventSystemFlags:r,nativeEvent:t,targetInst:n,ancestors:[]}}function mt(e){var t=e.targetInst,n=t;do{if(!n){e.ancestors.push(n);break}var r=n;if(3===r.tag)r=r.stateNode.containerInfo;else{for(;r.return;)r=r.return;r=3!==r.tag?null:r.stateNode.containerInfo}if(!r)break;5!==(t=n.tag)&&6!==t||e.ancestors.push(n),n=Nn(r)}while(n);for(n=0;n<e.ancestors.length;n++){t=e.ancestors[n];var a=st(e.nativeEvent);r=e.topLevelType;var i=e.nativeEvent,o=e.eventSystemFlags;0===n&&(o|=64);for(var l=null,u=0;u<E.length;u++){var s=E[u];s&&(s=s.extractEvents(r,t,i,a,o))&&(l=at(l,s))}ut(l)}}function gt(e,t,n){if(!n.has(e)){switch(e){case"scroll":Kt(t,"scroll",!0);break;case"focus":case"blur":Kt(t,"focus",!0),Kt(t,"blur",!0),n.set("blur",null),n.set("focus",null);break;case"cancel":case"close":ct(e)&&Kt(t,e,!0);break;case"invalid":case"submit":case"reset":break;default:-1===Qe.indexOf(e)&&qt(e,t)}n.set(e,null)}}var ht,bt,yt,vt=!1,wt=[],kt=null,Et=null,St=null,Tt=new Map,xt=new Map,Ct=[],_t="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" "),Ot="focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");function Pt(e,t,n,r,a){return{blockedOn:e,topLevelType:t,eventSystemFlags:32|n,nativeEvent:a,container:r}}function At(e,t){switch(e){case"focus":case"blur":kt=null;break;case"dragenter":case"dragleave":Et=null;break;case"mouseover":case"mouseout":St=null;break;case"pointerover":case"pointerout":Tt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":xt.delete(t.pointerId)}}function Nt(e,t,n,r,a,i){return null===e||e.nativeEvent!==i?(e=Pt(t,n,r,a,i),null!==t&&(null!==(t=Rn(t))&&bt(t)),e):(e.eventSystemFlags|=r,e)}function Rt(e){var t=Nn(e.target);if(null!==t){var n=et(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=tt(n)))return e.blockedOn=t,void i.unstable_runWithPriority(e.priority,(function(){yt(n)}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function It(e){if(null!==e.blockedOn)return!1;var t=Jt(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);if(null!==t){var n=Rn(t);return null!==n&&bt(n),e.blockedOn=t,!1}return!0}function Lt(e,t,n){It(e)&&n.delete(t)}function Dt(){for(vt=!1;0<wt.length;){var e=wt[0];if(null!==e.blockedOn){null!==(e=Rn(e.blockedOn))&&ht(e);break}var t=Jt(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);null!==t?e.blockedOn=t:wt.shift()}null!==kt&&It(kt)&&(kt=null),null!==Et&&It(Et)&&(Et=null),null!==St&&It(St)&&(St=null),Tt.forEach(Lt),xt.forEach(Lt)}function Ft(e,t){e.blockedOn===t&&(e.blockedOn=null,vt||(vt=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Dt)))}function Mt(e){function t(t){return Ft(t,e)}if(0<wt.length){Ft(wt[0],e);for(var n=1;n<wt.length;n++){var r=wt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==kt&&Ft(kt,e),null!==Et&&Ft(Et,e),null!==St&&Ft(St,e),Tt.forEach(t),xt.forEach(t),n=0;n<Ct.length;n++)(r=Ct[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Ct.length&&null===(n=Ct[0]).blockedOn;)Rt(n),null===n.blockedOn&&Ct.shift()}var Bt={},Ut=new Map,zt=new Map,jt=["abort","abort",Ze,"animationEnd",qe,"animationIteration",Ke,"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",Ye,"transitionEnd","waiting","waiting"];function $t(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],a=e[n+1],i="on"+(a[0].toUpperCase()+a.slice(1));i={phasedRegistrationNames:{bubbled:i,captured:i+"Capture"},dependencies:[r],eventPriority:t},zt.set(r,t),Ut.set(r,i),Bt[a]=i}}$t("blur blur cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focus focus 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),$t("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),$t(jt,2);for(var Ht="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),Gt=0;Gt<Ht.length;Gt++)zt.set(Ht[Gt],0);var Wt=i.unstable_UserBlockingPriority,Vt=i.unstable_runWithPriority,Zt=!0;function qt(e,t){Kt(t,e,!1)}function Kt(e,t,n){var r=zt.get(t);switch(void 0===r?2:r){case 0:r=Yt.bind(null,t,1,e);break;case 1:r=Qt.bind(null,t,1,e);break;default:r=Xt.bind(null,t,1,e)}n?e.addEventListener(t,r,!0):e.addEventListener(t,r,!1)}function Yt(e,t,n,r){B||F();var a=Xt,i=B;B=!0;try{D(a,e,t,n,r)}finally{(B=i)||z()}}function Qt(e,t,n,r){Vt(Wt,Xt.bind(null,e,t,n,r))}function Xt(e,t,n,r){if(Zt)if(0<wt.length&&-1<_t.indexOf(e))e=Pt(null,e,t,n,r),wt.push(e);else{var a=Jt(e,t,n,r);if(null===a)At(e,r);else if(-1<_t.indexOf(e))e=Pt(a,e,t,n,r),wt.push(e);else if(!function(e,t,n,r,a){switch(t){case"focus":return kt=Nt(kt,e,t,n,r,a),!0;case"dragenter":return Et=Nt(Et,e,t,n,r,a),!0;case"mouseover":return St=Nt(St,e,t,n,r,a),!0;case"pointerover":var i=a.pointerId;return Tt.set(i,Nt(Tt.get(i)||null,e,t,n,r,a)),!0;case"gotpointercapture":return i=a.pointerId,xt.set(i,Nt(xt.get(i)||null,e,t,n,r,a)),!0}return!1}(a,e,t,n,r)){At(e,r),e=pt(e,r,null,t);try{j(mt,e)}finally{dt(e)}}}}function Jt(e,t,n,r){if(null!==(n=Nn(n=st(r)))){var a=et(n);if(null===a)n=null;else{var i=a.tag;if(13===i){if(null!==(n=tt(a)))return n;n=null}else if(3===i){if(a.stateNode.hydrate)return 3===a.tag?a.stateNode.containerInfo:null;n=null}else a!==n&&(n=null)}}e=pt(e,r,n,t);try{j(mt,e)}finally{dt(e)}return null}var en={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},tn=["Webkit","ms","Moz","O"];function nn(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||en.hasOwnProperty(e)&&en[e]?(""+t).trim():t+"px"}function rn(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),a=nn(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}Object.keys(en).forEach((function(e){tn.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),en[t]=en[e]}))}));var an=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 on(e,t){if(t){if(an[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(o(137,e,""));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(o(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(o(62,""))}}function ln(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}}var un=Le;function sn(e,t){var n=Je(e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument);t=x[t];for(var r=0;r<t.length;r++)gt(t[r],e,n)}function cn(){}function fn(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 dn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pn(e,t){var n,r=dn(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=dn(r)}}function mn(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?mn(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function gn(){for(var e=window,t=fn();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=fn((e=t.contentWindow).document)}return t}function hn(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 bn="$?",yn="$!",vn=null,wn=null;function kn(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function En(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 Sn="function"==typeof setTimeout?setTimeout:void 0,Tn="function"==typeof clearTimeout?clearTimeout:void 0;function xn(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function Cn(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||n===yn||n===bn){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var _n=Math.random().toString(36).slice(2),On="__reactInternalInstance$"+_n,Pn="__reactEventHandlers$"+_n,An="__reactContainere$"+_n;function Nn(e){var t=e[On];if(t)return t;for(var n=e.parentNode;n;){if(t=n[An]||n[On]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Cn(e);null!==e;){if(n=e[On])return n;e=Cn(e)}return t}n=(e=n).parentNode}return null}function Rn(e){return!(e=e[On]||e[An])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function In(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(o(33))}function Ln(e){return e[Pn]||null}function Dn(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function Fn(e,t){var n=e.stateNode;if(!n)return null;var r=m(n);if(!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(o(231,t,typeof n));return n}function Mn(e,t,n){(t=Fn(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=at(n._dispatchListeners,t),n._dispatchInstances=at(n._dispatchInstances,e))}function Bn(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,n=[];t;)n.push(t),t=Dn(t);for(t=n.length;0<t--;)Mn(n[t],"captured",e);for(t=0;t<n.length;t++)Mn(n[t],"bubbled",e)}}function Un(e,t,n){e&&n&&n.dispatchConfig.registrationName&&(t=Fn(e,n.dispatchConfig.registrationName))&&(n._dispatchListeners=at(n._dispatchListeners,t),n._dispatchInstances=at(n._dispatchInstances,e))}function zn(e){e&&e.dispatchConfig.registrationName&&Un(e._targetInst,null,e)}function jn(e){it(e,Bn)}var $n=null,Hn=null,Gn=null;function Wn(){if(Gn)return Gn;var e,t,n=Hn,r=n.length,a="value"in $n?$n.value:$n.textContent,i=a.length;for(e=0;e<r&&n[e]===a[e];e++);var o=r-e;for(t=1;t<=o&&n[r-t]===a[i-t];t++);return Gn=a.slice(e,1<t?1-t:void 0)}function Vn(){return!0}function Zn(){return!1}function qn(e,t,n,r){for(var a in this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n,e=this.constructor.Interface)e.hasOwnProperty(a)&&((t=e[a])?this[a]=t(n):"target"===a?this.target=r:this[a]=n[a]);return this.isDefaultPrevented=(null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue)?Vn:Zn,this.isPropagationStopped=Zn,this}function Kn(e,t,n,r){if(this.eventPool.length){var a=this.eventPool.pop();return this.call(a,e,t,n,r),a}return new this(e,t,n,r)}function Yn(e){if(!(e instanceof this))throw Error(o(279));e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function Qn(e){e.eventPool=[],e.getPooled=Kn,e.release=Yn}a(qn.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Vn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Vn)},persist:function(){this.isPersistent=Vn},isPersistent:Zn,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=Zn,this._dispatchInstances=this._dispatchListeners=null}}),qn.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},qn.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var i=new t;return a(i,n.prototype),n.prototype=i,n.prototype.constructor=n,n.Interface=a({},r.Interface,e),n.extend=r.extend,Qn(n),n},Qn(qn);var Xn=qn.extend({data:null}),Jn=qn.extend({data:null}),er=[9,13,27,32],tr=_&&"CompositionEvent"in window,nr=null;_&&"documentMode"in document&&(nr=document.documentMode);var rr=_&&"TextEvent"in window&&!nr,ar=_&&(!tr||nr&&8<nr&&11>=nr),ir=String.fromCharCode(32),or={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},lr=!1;function ur(e,t){switch(e){case"keyup":return-1!==er.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function sr(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var cr=!1;var fr={eventTypes:or,extractEvents:function(e,t,n,r){var a;if(tr)e:{switch(e){case"compositionstart":var i=or.compositionStart;break e;case"compositionend":i=or.compositionEnd;break e;case"compositionupdate":i=or.compositionUpdate;break e}i=void 0}else cr?ur(e,n)&&(i=or.compositionEnd):"keydown"===e&&229===n.keyCode&&(i=or.compositionStart);return i?(ar&&"ko"!==n.locale&&(cr||i!==or.compositionStart?i===or.compositionEnd&&cr&&(a=Wn()):(Hn="value"in($n=r)?$n.value:$n.textContent,cr=!0)),i=Xn.getPooled(i,t,n,r),a?i.data=a:null!==(a=sr(n))&&(i.data=a),jn(i),a=i):a=null,(e=rr?function(e,t){switch(e){case"compositionend":return sr(t);case"keypress":return 32!==t.which?null:(lr=!0,ir);case"textInput":return(e=t.data)===ir&&lr?null:e;default:return null}}(e,n):function(e,t){if(cr)return"compositionend"===e||!tr&&ur(e,t)?(e=Wn(),Gn=Hn=$n=null,cr=!1,e):null;switch(e){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 ar&&"ko"!==t.locale?null:t.data}}(e,n))?((t=Jn.getPooled(or.beforeInput,t,n,r)).data=e,jn(t)):t=null,null===a?t:null===t?a:[a,t]}},dr={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 pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!dr[e.type]:"textarea"===t}var mr={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function gr(e,t,n){return(e=qn.getPooled(mr.change,e,t,n)).type="change",R(n),jn(e),e}var hr=null,br=null;function yr(e){ut(e)}function vr(e){if(ke(In(e)))return e}function wr(e,t){if("change"===e)return t}var kr=!1;function Er(){hr&&(hr.detachEvent("onpropertychange",Sr),br=hr=null)}function Sr(e){if("value"===e.propertyName&&vr(br))if(e=gr(br,e,st(e)),B)ut(e);else{B=!0;try{L(yr,e)}finally{B=!1,z()}}}function Tr(e,t,n){"focus"===e?(Er(),br=n,(hr=t).attachEvent("onpropertychange",Sr)):"blur"===e&&Er()}function xr(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return vr(br)}function Cr(e,t){if("click"===e)return vr(t)}function _r(e,t){if("input"===e||"change"===e)return vr(t)}_&&(kr=ct("input")&&(!document.documentMode||9<document.documentMode));var Or={eventTypes:mr,_isInputEventSupported:kr,extractEvents:function(e,t,n,r){var a=t?In(t):window,i=a.nodeName&&a.nodeName.toLowerCase();if("select"===i||"input"===i&&"file"===a.type)var o=wr;else if(pr(a))if(kr)o=_r;else{o=xr;var l=Tr}else(i=a.nodeName)&&"input"===i.toLowerCase()&&("checkbox"===a.type||"radio"===a.type)&&(o=Cr);if(o&&(o=o(e,t)))return gr(o,n,r);l&&l(e,a,t),"blur"===e&&(e=a._wrapperState)&&e.controlled&&"number"===a.type&&_e(a,"number",a.value)}},Pr=qn.extend({view:null,detail:null}),Ar={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Nr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Ar[e])&&!!t[e]}function Rr(){return Nr}var Ir=0,Lr=0,Dr=!1,Fr=!1,Mr=Pr.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:Rr,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},movementX:function(e){if("movementX"in e)return e.movementX;var t=Ir;return Ir=e.screenX,Dr?"mousemove"===e.type?e.screenX-t:0:(Dr=!0,0)},movementY:function(e){if("movementY"in e)return e.movementY;var t=Lr;return Lr=e.screenY,Fr?"mousemove"===e.type?e.screenY-t:0:(Fr=!0,0)}}),Br=Mr.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),Ur={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},zr={eventTypes:Ur,extractEvents:function(e,t,n,r,a){var i="mouseover"===e||"pointerover"===e,o="mouseout"===e||"pointerout"===e;if(i&&0==(32&a)&&(n.relatedTarget||n.fromElement)||!o&&!i)return null;(i=r.window===r?r:(i=r.ownerDocument)?i.defaultView||i.parentWindow:window,o)?(o=t,null!==(t=(t=n.relatedTarget||n.toElement)?Nn(t):null)&&(t!==et(t)||5!==t.tag&&6!==t.tag)&&(t=null)):o=null;if(o===t)return null;if("mouseout"===e||"mouseover"===e)var l=Mr,u=Ur.mouseLeave,s=Ur.mouseEnter,c="mouse";else"pointerout"!==e&&"pointerover"!==e||(l=Br,u=Ur.pointerLeave,s=Ur.pointerEnter,c="pointer");if(e=null==o?i:In(o),i=null==t?i:In(t),(u=l.getPooled(u,o,n,r)).type=c+"leave",u.target=e,u.relatedTarget=i,(n=l.getPooled(s,t,n,r)).type=c+"enter",n.target=i,n.relatedTarget=e,c=t,(r=o)&&c)e:{for(s=c,o=0,e=l=r;e;e=Dn(e))o++;for(e=0,t=s;t;t=Dn(t))e++;for(;0<o-e;)l=Dn(l),o--;for(;0<e-o;)s=Dn(s),e--;for(;o--;){if(l===s||l===s.alternate)break e;l=Dn(l),s=Dn(s)}l=null}else l=null;for(s=l,l=[];r&&r!==s&&(null===(o=r.alternate)||o!==s);)l.push(r),r=Dn(r);for(r=[];c&&c!==s&&(null===(o=c.alternate)||o!==s);)r.push(c),c=Dn(c);for(c=0;c<l.length;c++)Un(l[c],"bubbled",u);for(c=r.length;0<c--;)Un(r[c],"captured",n);return 0==(64&a)?[u]:[u,n]}};var jr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},$r=Object.prototype.hasOwnProperty;function Hr(e,t){if(jr(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(!$r.call(t,n[r])||!jr(e[n[r]],t[n[r]]))return!1;return!0}var Gr=_&&"documentMode"in document&&11>=document.documentMode,Wr={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Vr=null,Zr=null,qr=null,Kr=!1;function Yr(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return Kr||null==Vr||Vr!==fn(n)?null:("selectionStart"in(n=Vr)&&hn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},qr&&Hr(qr,n)?null:(qr=n,(e=qn.getPooled(Wr.select,Zr,e,t)).type="select",e.target=Vr,jn(e),e))}var Qr={eventTypes:Wr,extractEvents:function(e,t,n,r,a,i){if(!(i=!(a=i||(r.window===r?r.document:9===r.nodeType?r:r.ownerDocument)))){e:{a=Je(a),i=x.onSelect;for(var o=0;o<i.length;o++)if(!a.has(i[o])){a=!1;break e}a=!0}i=!a}if(i)return null;switch(a=t?In(t):window,e){case"focus":(pr(a)||"true"===a.contentEditable)&&(Vr=a,Zr=t,qr=null);break;case"blur":qr=Zr=Vr=null;break;case"mousedown":Kr=!0;break;case"contextmenu":case"mouseup":case"dragend":return Kr=!1,Yr(n,r);case"selectionchange":if(Gr)break;case"keydown":case"keyup":return Yr(n,r)}return null}},Xr=qn.extend({animationName:null,elapsedTime:null,pseudoElement:null}),Jr=qn.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ea=Pr.extend({relatedTarget:null});function ta(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}var na={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ra={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"},aa=Pr.extend({key:function(e){if(e.key){var t=na[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=ta(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?ra[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Rr,charCode:function(e){return"keypress"===e.type?ta(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?ta(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),ia=Mr.extend({dataTransfer:null}),oa=Pr.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Rr}),la=qn.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),ua=Mr.extend({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:null,deltaMode:null}),sa={eventTypes:Bt,extractEvents:function(e,t,n,r){var a=Ut.get(e);if(!a)return null;switch(e){case"keypress":if(0===ta(n))return null;case"keydown":case"keyup":e=aa;break;case"blur":case"focus":e=ea;break;case"click":if(2===n.button)return null;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":e=Mr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":e=ia;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":e=oa;break;case Ze:case qe:case Ke:e=Xr;break;case Ye:e=la;break;case"scroll":e=Pr;break;case"wheel":e=ua;break;case"copy":case"cut":case"paste":e=Jr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":e=Br;break;default:e=qn}return jn(t=e.getPooled(a,t,n,r)),t}};if(y)throw Error(o(101));y=Array.prototype.slice.call("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),w(),m=Ln,g=Rn,h=In,C({SimpleEventPlugin:sa,EnterLeaveEventPlugin:zr,ChangeEventPlugin:Or,SelectEventPlugin:Qr,BeforeInputEventPlugin:fr});var ca=[],fa=-1;function da(e){0>fa||(e.current=ca[fa],ca[fa]=null,fa--)}function pa(e,t){fa++,ca[fa]=e.current,e.current=t}var ma={},ga={current:ma},ha={current:!1},ba=ma;function ya(e,t){var n=e.type.contextTypes;if(!n)return ma;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a,i={};for(a in n)i[a]=t[a];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function va(e){return null!=(e=e.childContextTypes)}function wa(){da(ha),da(ga)}function ka(e,t,n){if(ga.current!==ma)throw Error(o(168));pa(ga,t),pa(ha,n)}function Ea(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in e))throw Error(o(108,he(t)||"Unknown",i));return a({},n,{},r)}function Sa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ma,ba=ga.current,pa(ga,e),pa(ha,ha.current),!0}function Ta(e,t,n){var r=e.stateNode;if(!r)throw Error(o(169));n?(e=Ea(e,t,ba),r.__reactInternalMemoizedMergedChildContext=e,da(ha),da(ga),pa(ga,e)):da(ha),pa(ha,n)}var xa=i.unstable_runWithPriority,Ca=i.unstable_scheduleCallback,_a=i.unstable_cancelCallback,Oa=i.unstable_requestPaint,Pa=i.unstable_now,Aa=i.unstable_getCurrentPriorityLevel,Na=i.unstable_ImmediatePriority,Ra=i.unstable_UserBlockingPriority,Ia=i.unstable_NormalPriority,La=i.unstable_LowPriority,Da=i.unstable_IdlePriority,Fa={},Ma=i.unstable_shouldYield,Ba=void 0!==Oa?Oa:function(){},Ua=null,za=null,ja=!1,$a=Pa(),Ha=1e4>$a?Pa:function(){return Pa()-$a};function Ga(){switch(Aa()){case Na:return 99;case Ra:return 98;case Ia:return 97;case La:return 96;case Da:return 95;default:throw Error(o(332))}}function Wa(e){switch(e){case 99:return Na;case 98:return Ra;case 97:return Ia;case 96:return La;case 95:return Da;default:throw Error(o(332))}}function Va(e,t){return e=Wa(e),xa(e,t)}function Za(e,t,n){return e=Wa(e),Ca(e,t,n)}function qa(e){return null===Ua?(Ua=[e],za=Ca(Na,Ya)):Ua.push(e),Fa}function Ka(){if(null!==za){var e=za;za=null,_a(e)}Ya()}function Ya(){if(!ja&&null!==Ua){ja=!0;var e=0;try{var t=Ua;Va(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),Ua=null}catch(n){throw null!==Ua&&(Ua=Ua.slice(e+1)),Ca(Na,Ka),n}finally{ja=!1}}}function Qa(e,t,n){return 1073741821-(1+((1073741821-e+t/10)/(n/=10)|0))*n}function Xa(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}var Ja={current:null},ei=null,ti=null,ni=null;function ri(){ni=ti=ei=null}function ai(e){var t=Ja.current;da(Ja),e.type._context._currentValue=t}function ii(e,t){for(;null!==e;){var n=e.alternate;if(e.childExpirationTime<t)e.childExpirationTime=t,null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t);else{if(!(null!==n&&n.childExpirationTime<t))break;n.childExpirationTime=t}e=e.return}}function oi(e,t){ei=e,ni=ti=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(e.expirationTime>=t&&(Lo=!0),e.firstContext=null)}function li(e,t){if(ni!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(ni=e,t=1073741823),t={context:e,observedBits:t,next:null},null===ti){if(null===ei)throw Error(o(308));ti=t,ei.dependencies={expirationTime:0,firstContext:t,responders:null}}else ti=ti.next=t;return e._currentValue}var ui=!1;function si(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function ci(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function fi(e,t){return(e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null}).next=e}function di(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 pi(e,t){var n=e.alternate;null!==n&&ci(n,e),null===(n=(e=e.updateQueue).baseQueue)?(e.baseQueue=t.next=t,t.next=t):(t.next=n.next,n.next=t)}function mi(e,t,n,r){var i=e.updateQueue;ui=!1;var o=i.baseQueue,l=i.shared.pending;if(null!==l){if(null!==o){var u=o.next;o.next=l.next,l.next=u}o=l,i.shared.pending=null,null!==(u=e.alternate)&&(null!==(u=u.updateQueue)&&(u.baseQueue=l))}if(null!==o){u=o.next;var s=i.baseState,c=0,f=null,d=null,p=null;if(null!==u)for(var m=u;;){if((l=m.expirationTime)<r){var g={expirationTime:m.expirationTime,suspenseConfig:m.suspenseConfig,tag:m.tag,payload:m.payload,callback:m.callback,next:null};null===p?(d=p=g,f=s):p=p.next=g,l>c&&(c=l)}else{null!==p&&(p=p.next={expirationTime:1073741823,suspenseConfig:m.suspenseConfig,tag:m.tag,payload:m.payload,callback:m.callback,next:null}),pu(l,m.suspenseConfig);e:{var h=e,b=m;switch(l=t,g=n,b.tag){case 1:if("function"==typeof(h=b.payload)){s=h.call(g,s,l);break e}s=h;break e;case 3:h.effectTag=-4097&h.effectTag|64;case 0:if(null==(l="function"==typeof(h=b.payload)?h.call(g,s,l):h))break e;s=a({},s,l);break e;case 2:ui=!0}}null!==m.callback&&(e.effectTag|=32,null===(l=i.effects)?i.effects=[m]:l.push(m))}if(null===(m=m.next)||m===u){if(null===(l=i.shared.pending))break;m=o.next=l.next,l.next=u,i.baseQueue=o=l,i.shared.pending=null}}null===p?f=s:p.next=d,i.baseState=f,i.baseQueue=p,mu(c),e.expirationTime=c,e.memoizedState=s}}function gi(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=a,a=n,"function"!=typeof r)throw Error(o(191,r));r.call(a)}}}var hi=Y.ReactCurrentBatchConfig,bi=(new r.Component).refs;function yi(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:a({},t,n),e.memoizedState=n,0===e.expirationTime&&(e.updateQueue.baseState=n)}var vi={isMounted:function(e){return!!(e=e._reactInternalFiber)&&et(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternalFiber;var r=eu(),a=hi.suspense;(a=fi(r=tu(r,e,a),a)).payload=t,null!=n&&(a.callback=n),di(e,a),nu(e,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternalFiber;var r=eu(),a=hi.suspense;(a=fi(r=tu(r,e,a),a)).tag=1,a.payload=t,null!=n&&(a.callback=n),di(e,a),nu(e,r)},enqueueForceUpdate:function(e,t){e=e._reactInternalFiber;var n=eu(),r=hi.suspense;(r=fi(n=tu(n,e,r),r)).tag=2,null!=t&&(r.callback=t),di(e,r),nu(e,n)}};function wi(e,t,n,r,a,i,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,i,o):!t.prototype||!t.prototype.isPureReactComponent||(!Hr(n,r)||!Hr(a,i))}function ki(e,t,n){var r=!1,a=ma,i=t.contextType;return"object"==typeof i&&null!==i?i=li(i):(a=va(t)?ba:ga.current,i=(r=null!=(r=t.contextTypes))?ya(e,a):ma),t=new t(n,i),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=vi,e.stateNode=t,t._reactInternalFiber=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),t}function Ei(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&&vi.enqueueReplaceState(t,t.state,null)}function Si(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs=bi,si(e);var i=t.contextType;"object"==typeof i&&null!==i?a.context=li(i):(i=va(t)?ba:ga.current,a.context=ya(e,i)),mi(e,n,a,r),a.state=e.memoizedState,"function"==typeof(i=t.getDerivedStateFromProps)&&(yi(e,t,i,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&&vi.enqueueReplaceState(a,a.state,null),mi(e,n,a,r),a.state=e.memoizedState),"function"==typeof a.componentDidMount&&(e.effectTag|=4)}var Ti=Array.isArray;function xi(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(o(309));var r=n.stateNode}if(!r)throw Error(o(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===bi&&(t=r.refs={}),null===e?delete t[a]:t[a]=e},t._stringRef=a,t)}if("string"!=typeof e)throw Error(o(284));if(!n._owner)throw Error(o(290,e))}return e}function Ci(e,t){if("textarea"!==e.type)throw Error(o(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,""))}function _i(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.effectTag=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=Lu(e,t)).index=0,e.sibling=null,e}function i(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.effectTag=2,n):r:(t.effectTag=2,n):n}function l(t){return e&&null===t.alternate&&(t.effectTag=2),t}function u(e,t,n,r){return null===t||6!==t.tag?((t=Mu(n,e.mode,r)).return=e,t):((t=a(t,n)).return=e,t)}function s(e,t,n,r){return null!==t&&t.elementType===n.type?((r=a(t,n.props)).ref=xi(e,t,n),r.return=e,r):((r=Du(n.type,n.key,n.props,null,e.mode,r)).ref=xi(e,t,n),r.return=e,r)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Bu(n,e.mode,r)).return=e,t):((t=a(t,n.children||[])).return=e,t)}function f(e,t,n,r,i){return null===t||7!==t.tag?((t=Fu(n,e.mode,r,i)).return=e,t):((t=a(t,n)).return=e,t)}function d(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=Mu(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case ee:return(n=Du(t.type,t.key,t.props,null,e.mode,n)).ref=xi(e,null,t),n.return=e,n;case te:return(t=Bu(t,e.mode,n)).return=e,t}if(Ti(t)||ge(t))return(t=Fu(t,e.mode,n,null)).return=e,t;Ci(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:u(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case ee:return n.key===a?n.type===ne?f(e,t,n.props.children,r,a):s(e,t,n,r):null;case te:return n.key===a?c(e,t,n,r):null}if(Ti(n)||ge(n))return null!==a?null:f(e,t,n,r,null);Ci(e,n)}return null}function m(e,t,n,r,a){if("string"==typeof r||"number"==typeof r)return u(t,e=e.get(n)||null,""+r,a);if("object"==typeof r&&null!==r){switch(r.$$typeof){case ee:return e=e.get(null===r.key?n:r.key)||null,r.type===ne?f(t,e,r.props.children,a,r.key):s(t,e,r,a);case te:return c(t,e=e.get(null===r.key?n:r.key)||null,r,a)}if(Ti(r)||ge(r))return f(t,e=e.get(n)||null,r,a,null);Ci(t,r)}return null}function g(a,o,l,u){for(var s=null,c=null,f=o,g=o=0,h=null;null!==f&&g<l.length;g++){f.index>g?(h=f,f=null):h=f.sibling;var b=p(a,f,l[g],u);if(null===b){null===f&&(f=h);break}e&&f&&null===b.alternate&&t(a,f),o=i(b,o,g),null===c?s=b:c.sibling=b,c=b,f=h}if(g===l.length)return n(a,f),s;if(null===f){for(;g<l.length;g++)null!==(f=d(a,l[g],u))&&(o=i(f,o,g),null===c?s=f:c.sibling=f,c=f);return s}for(f=r(a,f);g<l.length;g++)null!==(h=m(f,a,g,l[g],u))&&(e&&null!==h.alternate&&f.delete(null===h.key?g:h.key),o=i(h,o,g),null===c?s=h:c.sibling=h,c=h);return e&&f.forEach((function(e){return t(a,e)})),s}function h(a,l,u,s){var c=ge(u);if("function"!=typeof c)throw Error(o(150));if(null==(u=c.call(u)))throw Error(o(151));for(var f=c=null,g=l,h=l=0,b=null,y=u.next();null!==g&&!y.done;h++,y=u.next()){g.index>h?(b=g,g=null):b=g.sibling;var v=p(a,g,y.value,s);if(null===v){null===g&&(g=b);break}e&&g&&null===v.alternate&&t(a,g),l=i(v,l,h),null===f?c=v:f.sibling=v,f=v,g=b}if(y.done)return n(a,g),c;if(null===g){for(;!y.done;h++,y=u.next())null!==(y=d(a,y.value,s))&&(l=i(y,l,h),null===f?c=y:f.sibling=y,f=y);return c}for(g=r(a,g);!y.done;h++,y=u.next())null!==(y=m(g,a,h,y.value,s))&&(e&&null!==y.alternate&&g.delete(null===y.key?h:y.key),l=i(y,l,h),null===f?c=y:f.sibling=y,f=y);return e&&g.forEach((function(e){return t(a,e)})),c}return function(e,r,i,u){var s="object"==typeof i&&null!==i&&i.type===ne&&null===i.key;s&&(i=i.props.children);var c="object"==typeof i&&null!==i;if(c)switch(i.$$typeof){case ee:e:{for(c=i.key,s=r;null!==s;){if(s.key===c){if(7===s.tag){if(i.type===ne){n(e,s.sibling),(r=a(s,i.props.children)).return=e,e=r;break e}}else if(s.elementType===i.type){n(e,s.sibling),(r=a(s,i.props)).ref=xi(e,s,i),r.return=e,e=r;break e}n(e,s);break}t(e,s),s=s.sibling}i.type===ne?((r=Fu(i.props.children,e.mode,u,i.key)).return=e,e=r):((u=Du(i.type,i.key,i.props,null,e.mode,u)).ref=xi(e,r,i),u.return=e,e=u)}return l(e);case te:e:{for(s=i.key;null!==r;){if(r.key===s){if(4===r.tag&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),(r=a(r,i.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Bu(i,e.mode,u)).return=e,e=r}return l(e)}if("string"==typeof i||"number"==typeof i)return i=""+i,null!==r&&6===r.tag?(n(e,r.sibling),(r=a(r,i)).return=e,e=r):(n(e,r),(r=Mu(i,e.mode,u)).return=e,e=r),l(e);if(Ti(i))return g(e,r,i,u);if(ge(i))return h(e,r,i,u);if(c&&Ci(e,i),void 0===i&&!s)switch(e.tag){case 1:case 0:throw e=e.type,Error(o(152,e.displayName||e.name||"Component"))}return n(e,r)}}var Oi=_i(!0),Pi=_i(!1),Ai={},Ni={current:Ai},Ri={current:Ai},Ii={current:Ai};function Li(e){if(e===Ai)throw Error(o(174));return e}function Di(e,t){switch(pa(Ii,t),pa(Ri,e),pa(Ni,Ai),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)}da(Ni),pa(Ni,t)}function Fi(){da(Ni),da(Ri),da(Ii)}function Mi(e){Li(Ii.current);var t=Li(Ni.current),n=Me(t,e.type);t!==n&&(pa(Ri,e),pa(Ni,n))}function Bi(e){Ri.current===e&&(da(Ni),da(Ri))}var Ui={current:0};function zi(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||n.data===bn||n.data===yn))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.effectTag))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}function ji(e,t){return{responder:e,props:t}}var $i=Y.ReactCurrentDispatcher,Hi=Y.ReactCurrentBatchConfig,Gi=0,Wi=null,Vi=null,Zi=null,qi=!1;function Ki(){throw Error(o(321))}function Yi(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!jr(e[n],t[n]))return!1;return!0}function Qi(e,t,n,r,a,i){if(Gi=i,Wi=t,t.memoizedState=null,t.updateQueue=null,t.expirationTime=0,$i.current=null===e||null===e.memoizedState?ko:Eo,e=n(r,a),t.expirationTime===Gi){i=0;do{if(t.expirationTime=0,!(25>i))throw Error(o(301));i+=1,Zi=Vi=null,t.updateQueue=null,$i.current=So,e=n(r,a)}while(t.expirationTime===Gi)}if($i.current=wo,t=null!==Vi&&null!==Vi.next,Gi=0,Zi=Vi=Wi=null,qi=!1,t)throw Error(o(300));return e}function Xi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Zi?Wi.memoizedState=Zi=e:Zi=Zi.next=e,Zi}function Ji(){if(null===Vi){var e=Wi.alternate;e=null!==e?e.memoizedState:null}else e=Vi.next;var t=null===Zi?Wi.memoizedState:Zi.next;if(null!==t)Zi=t,Vi=e;else{if(null===e)throw Error(o(310));e={memoizedState:(Vi=e).memoizedState,baseState:Vi.baseState,baseQueue:Vi.baseQueue,queue:Vi.queue,next:null},null===Zi?Wi.memoizedState=Zi=e:Zi=Zi.next=e}return Zi}function eo(e,t){return"function"==typeof t?t(e):t}function to(e){var t=Ji(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=Vi,a=r.baseQueue,i=n.pending;if(null!==i){if(null!==a){var l=a.next;a.next=i.next,i.next=l}r.baseQueue=a=i,n.pending=null}if(null!==a){a=a.next,r=r.baseState;var u=l=i=null,s=a;do{var c=s.expirationTime;if(c<Gi){var f={expirationTime:s.expirationTime,suspenseConfig:s.suspenseConfig,action:s.action,eagerReducer:s.eagerReducer,eagerState:s.eagerState,next:null};null===u?(l=u=f,i=r):u=u.next=f,c>Wi.expirationTime&&(Wi.expirationTime=c,mu(c))}else null!==u&&(u=u.next={expirationTime:1073741823,suspenseConfig:s.suspenseConfig,action:s.action,eagerReducer:s.eagerReducer,eagerState:s.eagerState,next:null}),pu(c,s.suspenseConfig),r=s.eagerReducer===e?s.eagerState:e(r,s.action);s=s.next}while(null!==s&&s!==a);null===u?i=r:u.next=l,jr(r,t.memoizedState)||(Lo=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=u,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function no(e){var t=Ji(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,i=t.memoizedState;if(null!==a){n.pending=null;var l=a=a.next;do{i=e(i,l.action),l=l.next}while(l!==a);jr(i,t.memoizedState)||(Lo=!0),t.memoizedState=i,null===t.baseQueue&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function ro(e){var t=Xi();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:eo,lastRenderedState:e}).dispatch=vo.bind(null,Wi,e),[t.memoizedState,e]}function ao(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=Wi.updateQueue)?(t={lastEffect:null},Wi.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 io(){return Ji().memoizedState}function oo(e,t,n,r){var a=Xi();Wi.effectTag|=e,a.memoizedState=ao(1|t,n,void 0,void 0===r?null:r)}function lo(e,t,n,r){var a=Ji();r=void 0===r?null:r;var i=void 0;if(null!==Vi){var o=Vi.memoizedState;if(i=o.destroy,null!==r&&Yi(r,o.deps))return void ao(t,n,i,r)}Wi.effectTag|=e,a.memoizedState=ao(1|t,n,i,r)}function uo(e,t){return oo(516,4,e,t)}function so(e,t){return lo(516,4,e,t)}function co(e,t){return lo(4,2,e,t)}function fo(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 po(e,t,n){return n=null!=n?n.concat([e]):null,lo(4,2,fo.bind(null,t,e),n)}function mo(){}function go(e,t){return Xi().memoizedState=[e,void 0===t?null:t],e}function ho(e,t){var n=Ji();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Yi(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function bo(e,t){var n=Ji();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Yi(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function yo(e,t,n){var r=Ga();Va(98>r?98:r,(function(){e(!0)})),Va(97<r?97:r,(function(){var r=Hi.suspense;Hi.suspense=void 0===t?null:t;try{e(!1),n()}finally{Hi.suspense=r}}))}function vo(e,t,n){var r=eu(),a=hi.suspense;a={expirationTime:r=tu(r,e,a),suspenseConfig:a,action:n,eagerReducer:null,eagerState:null,next:null};var i=t.pending;if(null===i?a.next=a:(a.next=i.next,i.next=a),t.pending=a,i=e.alternate,e===Wi||null!==i&&i===Wi)qi=!0,a.expirationTime=Gi,Wi.expirationTime=Gi;else{if(0===e.expirationTime&&(null===i||0===i.expirationTime)&&null!==(i=t.lastRenderedReducer))try{var o=t.lastRenderedState,l=i(o,n);if(a.eagerReducer=i,a.eagerState=l,jr(l,o))return}catch(u){}nu(e,r)}}var wo={readContext:li,useCallback:Ki,useContext:Ki,useEffect:Ki,useImperativeHandle:Ki,useLayoutEffect:Ki,useMemo:Ki,useReducer:Ki,useRef:Ki,useState:Ki,useDebugValue:Ki,useResponder:Ki,useDeferredValue:Ki,useTransition:Ki},ko={readContext:li,useCallback:go,useContext:li,useEffect:uo,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,oo(4,2,fo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return oo(4,2,e,t)},useMemo:function(e,t){var n=Xi();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Xi();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=vo.bind(null,Wi,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Xi().memoizedState=e},useState:ro,useDebugValue:mo,useResponder:ji,useDeferredValue:function(e,t){var n=ro(e),r=n[0],a=n[1];return uo((function(){var n=Hi.suspense;Hi.suspense=void 0===t?null:t;try{a(e)}finally{Hi.suspense=n}}),[e,t]),r},useTransition:function(e){var t=ro(!1),n=t[0];return t=t[1],[go(yo.bind(null,t,e),[t,e]),n]}},Eo={readContext:li,useCallback:ho,useContext:li,useEffect:so,useImperativeHandle:po,useLayoutEffect:co,useMemo:bo,useReducer:to,useRef:io,useState:function(){return to(eo)},useDebugValue:mo,useResponder:ji,useDeferredValue:function(e,t){var n=to(eo),r=n[0],a=n[1];return so((function(){var n=Hi.suspense;Hi.suspense=void 0===t?null:t;try{a(e)}finally{Hi.suspense=n}}),[e,t]),r},useTransition:function(e){var t=to(eo),n=t[0];return t=t[1],[ho(yo.bind(null,t,e),[t,e]),n]}},So={readContext:li,useCallback:ho,useContext:li,useEffect:so,useImperativeHandle:po,useLayoutEffect:co,useMemo:bo,useReducer:no,useRef:io,useState:function(){return no(eo)},useDebugValue:mo,useResponder:ji,useDeferredValue:function(e,t){var n=no(eo),r=n[0],a=n[1];return so((function(){var n=Hi.suspense;Hi.suspense=void 0===t?null:t;try{a(e)}finally{Hi.suspense=n}}),[e,t]),r},useTransition:function(e){var t=no(eo),n=t[0];return t=t[1],[ho(yo.bind(null,t,e),[t,e]),n]}},To=null,xo=null,Co=!1;function _o(e,t){var n=Ru(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Oo(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 Po(e){if(Co){var t=xo;if(t){var n=t;if(!Oo(e,t)){if(!(t=xn(n.nextSibling))||!Oo(e,t))return e.effectTag=-1025&e.effectTag|2,Co=!1,void(To=e);_o(To,n)}To=e,xo=xn(t.firstChild)}else e.effectTag=-1025&e.effectTag|2,Co=!1,To=e}}function Ao(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;To=e}function No(e){if(e!==To)return!1;if(!Co)return Ao(e),Co=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!En(t,e.memoizedProps))for(t=xo;t;)_o(e,t),t=xn(t.nextSibling);if(Ao(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(o(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){xo=xn(e.nextSibling);break e}t--}else"$"!==n&&n!==yn&&n!==bn||t++}e=e.nextSibling}xo=null}}else xo=To?xn(e.stateNode.nextSibling):null;return!0}function Ro(){xo=To=null,Co=!1}var Io=Y.ReactCurrentOwner,Lo=!1;function Do(e,t,n,r){t.child=null===e?Pi(t,null,n,r):Oi(t,e.child,n,r)}function Fo(e,t,n,r,a){n=n.render;var i=t.ref;return oi(t,a),r=Qi(e,t,n,r,i,a),null===e||Lo?(t.effectTag|=1,Do(e,t,r,a),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=a&&(e.expirationTime=0),Xo(e,t,a))}function Mo(e,t,n,r,a,i){if(null===e){var o=n.type;return"function"!=typeof o||Iu(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Du(n.type,null,r,null,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,Bo(e,t,o,r,a,i))}return o=e.child,a<i&&(a=o.memoizedProps,(n=null!==(n=n.compare)?n:Hr)(a,r)&&e.ref===t.ref)?Xo(e,t,i):(t.effectTag|=1,(e=Lu(o,r)).ref=t.ref,e.return=t,t.child=e)}function Bo(e,t,n,r,a,i){return null!==e&&Hr(e.memoizedProps,r)&&e.ref===t.ref&&(Lo=!1,a<i)?(t.expirationTime=e.expirationTime,Xo(e,t,i)):zo(e,t,n,r,i)}function Uo(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.effectTag|=128)}function zo(e,t,n,r,a){var i=va(n)?ba:ga.current;return i=ya(t,i),oi(t,a),n=Qi(e,t,n,r,i,a),null===e||Lo?(t.effectTag|=1,Do(e,t,n,a),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=a&&(e.expirationTime=0),Xo(e,t,a))}function jo(e,t,n,r,a){if(va(n)){var i=!0;Sa(t)}else i=!1;if(oi(t,a),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),ki(t,n,r),Si(t,n,r,a),r=!0;else if(null===e){var o=t.stateNode,l=t.memoizedProps;o.props=l;var u=o.context,s=n.contextType;"object"==typeof s&&null!==s?s=li(s):s=ya(t,s=va(n)?ba:ga.current);var c=n.getDerivedStateFromProps,f="function"==typeof c||"function"==typeof o.getSnapshotBeforeUpdate;f||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(l!==r||u!==s)&&Ei(t,o,r,s),ui=!1;var d=t.memoizedState;o.state=d,mi(t,r,o,a),u=t.memoizedState,l!==r||d!==u||ha.current||ui?("function"==typeof c&&(yi(t,n,c,r),u=t.memoizedState),(l=ui||wi(t,n,l,r,d,u,s))?(f||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount&&(t.effectTag|=4)):("function"==typeof o.componentDidMount&&(t.effectTag|=4),t.memoizedProps=r,t.memoizedState=u),o.props=r,o.state=u,o.context=s,r=l):("function"==typeof o.componentDidMount&&(t.effectTag|=4),r=!1)}else o=t.stateNode,ci(e,t),l=t.memoizedProps,o.props=t.type===t.elementType?l:Xa(t.type,l),u=o.context,"object"==typeof(s=n.contextType)&&null!==s?s=li(s):s=ya(t,s=va(n)?ba:ga.current),(f="function"==typeof(c=n.getDerivedStateFromProps)||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(l!==r||u!==s)&&Ei(t,o,r,s),ui=!1,u=t.memoizedState,o.state=u,mi(t,r,o,a),d=t.memoizedState,l!==r||u!==d||ha.current||ui?("function"==typeof c&&(yi(t,n,c,r),d=t.memoizedState),(c=ui||wi(t,n,l,r,u,d,s))?(f||"function"!=typeof o.UNSAFE_componentWillUpdate&&"function"!=typeof o.componentWillUpdate||("function"==typeof o.componentWillUpdate&&o.componentWillUpdate(r,d,s),"function"==typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,d,s)),"function"==typeof o.componentDidUpdate&&(t.effectTag|=4),"function"==typeof o.getSnapshotBeforeUpdate&&(t.effectTag|=256)):("function"!=typeof o.componentDidUpdate||l===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=4),"function"!=typeof o.getSnapshotBeforeUpdate||l===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=256),t.memoizedProps=r,t.memoizedState=d),o.props=r,o.state=d,o.context=s,r=c):("function"!=typeof o.componentDidUpdate||l===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=4),"function"!=typeof o.getSnapshotBeforeUpdate||l===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=256),r=!1);return $o(e,t,n,r,i,a)}function $o(e,t,n,r,a,i){Uo(e,t);var o=0!=(64&t.effectTag);if(!r&&!o)return a&&Ta(t,n,!1),Xo(e,t,i);r=t.stateNode,Io.current=t;var l=o&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.effectTag|=1,null!==e&&o?(t.child=Oi(t,e.child,null,i),t.child=Oi(t,null,l,i)):Do(e,t,l,i),t.memoizedState=r.state,a&&Ta(t,n,!0),t.child}function Ho(e){var t=e.stateNode;t.pendingContext?ka(0,t.pendingContext,t.pendingContext!==t.context):t.context&&ka(0,t.context,!1),Di(e,t.containerInfo)}var Go,Wo,Vo,Zo={dehydrated:null,retryTime:0};function qo(e,t,n){var r,a=t.mode,i=t.pendingProps,o=Ui.current,l=!1;if((r=0!=(64&t.effectTag))||(r=0!=(2&o)&&(null===e||null!==e.memoizedState)),r?(l=!0,t.effectTag&=-65):null!==e&&null===e.memoizedState||void 0===i.fallback||!0===i.unstable_avoidThisFallback||(o|=1),pa(Ui,1&o),null===e){if(void 0!==i.fallback&&Po(t),l){if(l=i.fallback,(i=Fu(null,a,0,null)).return=t,0==(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,i.child=e;null!==e;)e.return=i,e=e.sibling;return(n=Fu(l,a,n,null)).return=t,i.sibling=n,t.memoizedState=Zo,t.child=i,n}return a=i.children,t.memoizedState=null,t.child=Pi(t,null,a,n)}if(null!==e.memoizedState){if(a=(e=e.child).sibling,l){if(i=i.fallback,(n=Lu(e,e.pendingProps)).return=t,0==(2&t.mode)&&(l=null!==t.memoizedState?t.child.child:t.child)!==e.child)for(n.child=l;null!==l;)l.return=n,l=l.sibling;return(a=Lu(a,i)).return=t,n.sibling=a,n.childExpirationTime=0,t.memoizedState=Zo,t.child=n,a}return n=Oi(t,e.child,i.children,n),t.memoizedState=null,t.child=n}if(e=e.child,l){if(l=i.fallback,(i=Fu(null,a,0,null)).return=t,i.child=e,null!==e&&(e.return=i),0==(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,i.child=e;null!==e;)e.return=i,e=e.sibling;return(n=Fu(l,a,n,null)).return=t,i.sibling=n,n.effectTag|=2,i.childExpirationTime=0,t.memoizedState=Zo,t.child=i,n}return t.memoizedState=null,t.child=Oi(t,e,i.children,n)}function Ko(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t),ii(e.return,t)}function Yo(e,t,n,r,a,i){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailExpiration:0,tailMode:a,lastEffect:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailExpiration=0,o.tailMode=a,o.lastEffect=i)}function Qo(e,t,n){var r=t.pendingProps,a=r.revealOrder,i=r.tail;if(Do(e,t,r.children,n),0!=(2&(r=Ui.current)))r=1&r|2,t.effectTag|=64;else{if(null!==e&&0!=(64&e.effectTag))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Ko(e,n);else if(19===e.tag)Ko(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(pa(Ui,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===zi(e)&&(a=n),n=n.sibling;null===(n=a)?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),Yo(t,!1,a,n,i,t.lastEffect);break;case"backwards":for(n=null,a=t.child,t.child=null;null!==a;){if(null!==(e=a.alternate)&&null===zi(e)){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}Yo(t,!0,n,null,i,t.lastEffect);break;case"together":Yo(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function Xo(e,t,n){null!==e&&(t.dependencies=e.dependencies);var r=t.expirationTime;if(0!==r&&mu(r),t.childExpirationTime<n)return null;if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(n=Lu(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Lu(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Jo(e,t){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 el(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 va(t.type)&&wa(),null;case 3:return Fi(),da(ha),da(ga),(n=t.stateNode).pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||!No(t)||(t.effectTag|=4),null;case 5:Bi(t),n=Li(Ii.current);var i=t.type;if(null!==e&&null!=t.stateNode)Wo(e,t,i,r,n),e.ref!==t.ref&&(t.effectTag|=128);else{if(!r){if(null===t.stateNode)throw Error(o(166));return null}if(e=Li(Ni.current),No(t)){r=t.stateNode,i=t.type;var l=t.memoizedProps;switch(r[On]=t,r[Pn]=l,i){case"iframe":case"object":case"embed":qt("load",r);break;case"video":case"audio":for(e=0;e<Qe.length;e++)qt(Qe[e],r);break;case"source":qt("error",r);break;case"img":case"image":case"link":qt("error",r),qt("load",r);break;case"form":qt("reset",r),qt("submit",r);break;case"details":qt("toggle",r);break;case"input":Se(r,l),qt("invalid",r),sn(n,"onChange");break;case"select":r._wrapperState={wasMultiple:!!l.multiple},qt("invalid",r),sn(n,"onChange");break;case"textarea":Ne(r,l),qt("invalid",r),sn(n,"onChange")}for(var u in on(i,l),e=null,l)if(l.hasOwnProperty(u)){var s=l[u];"children"===u?"string"==typeof s?r.textContent!==s&&(e=["children",s]):"number"==typeof s&&r.textContent!==""+s&&(e=["children",""+s]):T.hasOwnProperty(u)&&null!=s&&sn(n,u)}switch(i){case"input":we(r),Ce(r,l,!0);break;case"textarea":we(r),Ie(r);break;case"select":case"option":break;default:"function"==typeof l.onClick&&(r.onclick=cn)}n=e,t.updateQueue=n,null!==n&&(t.effectTag|=4)}else{switch(u=9===n.nodeType?n:n.ownerDocument,e===un&&(e=Fe(i)),e===un?"script"===i?((e=u.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=u.createElement(i,{is:r.is}):(e=u.createElement(i),"select"===i&&(u=e,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):e=u.createElementNS(e,i),e[On]=t,e[Pn]=r,Go(e,t),t.stateNode=e,u=ln(i,r),i){case"iframe":case"object":case"embed":qt("load",e),s=r;break;case"video":case"audio":for(s=0;s<Qe.length;s++)qt(Qe[s],e);s=r;break;case"source":qt("error",e),s=r;break;case"img":case"image":case"link":qt("error",e),qt("load",e),s=r;break;case"form":qt("reset",e),qt("submit",e),s=r;break;case"details":qt("toggle",e),s=r;break;case"input":Se(e,r),s=Ee(e,r),qt("invalid",e),sn(n,"onChange");break;case"option":s=Oe(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=a({},r,{value:void 0}),qt("invalid",e),sn(n,"onChange");break;case"textarea":Ne(e,r),s=Ae(e,r),qt("invalid",e),sn(n,"onChange");break;default:s=r}on(i,s);var c=s;for(l in c)if(c.hasOwnProperty(l)){var f=c[l];"style"===l?rn(e,f):"dangerouslySetInnerHTML"===l?null!=(f=f?f.__html:void 0)&&ze(e,f):"children"===l?"string"==typeof f?("textarea"!==i||""!==f)&&je(e,f):"number"==typeof f&&je(e,""+f):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(T.hasOwnProperty(l)?null!=f&&sn(n,l):null!=f&&Q(e,l,f,u))}switch(i){case"input":we(e),Ce(e,r,!1);break;case"textarea":we(e),Ie(e);break;case"option":null!=r.value&&e.setAttribute("value",""+ye(r.value));break;case"select":e.multiple=!!r.multiple,null!=(n=r.value)?Pe(e,!!r.multiple,n,!1):null!=r.defaultValue&&Pe(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof s.onClick&&(e.onclick=cn)}kn(i,r)&&(t.effectTag|=4)}null!==t.ref&&(t.effectTag|=128)}return null;case 6:if(e&&null!=t.stateNode)Vo(0,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(o(166));n=Li(Ii.current),Li(Ni.current),No(t)?(n=t.stateNode,r=t.memoizedProps,n[On]=t,n.nodeValue!==r&&(t.effectTag|=4)):((n=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[On]=t,t.stateNode=n)}return null;case 13:return da(Ui),r=t.memoizedState,0!=(64&t.effectTag)?(t.expirationTime=n,t):(n=null!==r,r=!1,null===e?void 0!==t.memoizedProps.fallback&&No(t):(r=null!==(i=e.memoizedState),n||null===i||null!==(i=e.child.sibling)&&(null!==(l=t.firstEffect)?(t.firstEffect=i,i.nextEffect=l):(t.firstEffect=t.lastEffect=i,i.nextEffect=null),i.effectTag=8)),n&&!r&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&Ui.current)?Dl===Ol&&(Dl=Pl):(Dl!==Ol&&Dl!==Pl||(Dl=Al),0!==zl&&null!==Rl&&(ju(Rl,Ll),$u(Rl,zl)))),(n||r)&&(t.effectTag|=4),null);case 4:return Fi(),null;case 10:return ai(t),null;case 19:if(da(Ui),null===(r=t.memoizedState))return null;if(i=0!=(64&t.effectTag),null===(l=r.rendering)){if(i)Jo(r,!1);else if(Dl!==Ol||null!==e&&0!=(64&e.effectTag))for(l=t.child;null!==l;){if(null!==(e=zi(l))){for(t.effectTag|=64,Jo(r,!1),null!==(i=e.updateQueue)&&(t.updateQueue=i,t.effectTag|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=t.child;null!==r;)l=n,(i=r).effectTag&=2,i.nextEffect=null,i.firstEffect=null,i.lastEffect=null,null===(e=i.alternate)?(i.childExpirationTime=0,i.expirationTime=l,i.child=null,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null):(i.childExpirationTime=e.childExpirationTime,i.expirationTime=e.expirationTime,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,l=e.dependencies,i.dependencies=null===l?null:{expirationTime:l.expirationTime,firstContext:l.firstContext,responders:l.responders}),r=r.sibling;return pa(Ui,1&Ui.current|2),t.child}l=l.sibling}}else{if(!i)if(null!==(e=zi(l))){if(t.effectTag|=64,i=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.effectTag|=4),Jo(r,!0),null===r.tail&&"hidden"===r.tailMode&&!l.alternate)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*Ha()-r.renderingStartTime>r.tailExpiration&&1<n&&(t.effectTag|=64,i=!0,Jo(r,!1),t.expirationTime=t.childExpirationTime=n-1);r.isBackwards?(l.sibling=t.child,t.child=l):(null!==(n=r.last)?n.sibling=l:t.child=l,r.last=l)}return null!==r.tail?(0===r.tailExpiration&&(r.tailExpiration=Ha()+500),n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=Ha(),n.sibling=null,t=Ui.current,pa(Ui,i?1&t|2:1&t),n):null}throw Error(o(156,t.tag))}function tl(e){switch(e.tag){case 1:va(e.type)&&wa();var t=e.effectTag;return 4096&t?(e.effectTag=-4097&t|64,e):null;case 3:if(Fi(),da(ha),da(ga),0!=(64&(t=e.effectTag)))throw Error(o(285));return e.effectTag=-4097&t|64,e;case 5:return Bi(e),null;case 13:return da(Ui),4096&(t=e.effectTag)?(e.effectTag=-4097&t|64,e):null;case 19:return da(Ui),null;case 4:return Fi(),null;case 10:return ai(e),null;default:return null}}function nl(e,t){return{value:e,source:t,stack:be(t)}}Go=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}},Wo=function(e,t,n,r,i){var o=e.memoizedProps;if(o!==r){var l,u,s=t.stateNode;switch(Li(Ni.current),e=null,n){case"input":o=Ee(s,o),r=Ee(s,r),e=[];break;case"option":o=Oe(s,o),r=Oe(s,r),e=[];break;case"select":o=a({},o,{value:void 0}),r=a({},r,{value:void 0}),e=[];break;case"textarea":o=Ae(s,o),r=Ae(s,r),e=[];break;default:"function"!=typeof o.onClick&&"function"==typeof r.onClick&&(s.onclick=cn)}for(l in on(n,r),n=null,o)if(!r.hasOwnProperty(l)&&o.hasOwnProperty(l)&&null!=o[l])if("style"===l)for(u in s=o[l])s.hasOwnProperty(u)&&(n||(n={}),n[u]="");else"dangerouslySetInnerHTML"!==l&&"children"!==l&&"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(T.hasOwnProperty(l)?e||(e=[]):(e=e||[]).push(l,null));for(l in r){var c=r[l];if(s=null!=o?o[l]:void 0,r.hasOwnProperty(l)&&c!==s&&(null!=c||null!=s))if("style"===l)if(s){for(u in s)!s.hasOwnProperty(u)||c&&c.hasOwnProperty(u)||(n||(n={}),n[u]="");for(u in c)c.hasOwnProperty(u)&&s[u]!==c[u]&&(n||(n={}),n[u]=c[u])}else n||(e||(e=[]),e.push(l,n)),n=c;else"dangerouslySetInnerHTML"===l?(c=c?c.__html:void 0,s=s?s.__html:void 0,null!=c&&s!==c&&(e=e||[]).push(l,c)):"children"===l?s===c||"string"!=typeof c&&"number"!=typeof c||(e=e||[]).push(l,""+c):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&(T.hasOwnProperty(l)?(null!=c&&sn(i,l),e||s===c||(e=[])):(e=e||[]).push(l,c))}n&&(e=e||[]).push("style",n),i=e,(t.updateQueue=i)&&(t.effectTag|=4)}},Vo=function(e,t,n,r){n!==r&&(t.effectTag|=4)};var rl="function"==typeof WeakSet?WeakSet:Set;function al(e,t){var n=t.source,r=t.stack;null===r&&null!==n&&(r=be(n)),null!==n&&he(n.type),t=t.value,null!==e&&1===e.tag&&he(e.type);try{console.error(t)}catch(a){setTimeout((function(){throw a}))}}function il(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(n){Cu(e,n)}else t.current=null}function ol(e,t){switch(t.tag){case 0:case 11:case 15:case 22:case 3:case 5:case 6:case 4:case 17:return;case 1:if(256&t.effectTag&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:Xa(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return}throw Error(o(163))}function ll(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.destroy;n.destroy=void 0,void 0!==r&&r()}n=n.next}while(n!==t)}}function ul(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function sl(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:return void ul(3,n);case 1:if(e=n.stateNode,4&n.effectTag)if(null===t)e.componentDidMount();else{var r=n.elementType===n.type?t.memoizedProps:Xa(n.type,t.memoizedProps);e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate)}return void(null!==(t=n.updateQueue)&&gi(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}gi(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.effectTag&&kn(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:case 19:case 17:case 20:case 21:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&Mt(n)))))}throw Error(o(163))}function cl(e,t,n){switch("function"==typeof Au&&Au(t),t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var r=e.next;Va(97<n?97:n,(function(){var e=r;do{var n=e.destroy;if(void 0!==n){var a=t;try{n()}catch(i){Cu(a,i)}}e=e.next}while(e!==r)}))}break;case 1:il(t),"function"==typeof(n=t.stateNode).componentWillUnmount&&function(e,t){try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(n){Cu(e,n)}}(t,n);break;case 5:il(t);break;case 4:hl(e,t,n)}}function fl(e){var t=e.alternate;e.return=null,e.child=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.alternate=null,e.firstEffect=null,e.lastEffect=null,e.pendingProps=null,e.memoizedProps=null,e.stateNode=null,null!==t&&fl(t)}function dl(e){return 5===e.tag||3===e.tag||4===e.tag}function pl(e){e:{for(var t=e.return;null!==t;){if(dl(t)){var n=t;break e}t=t.return}throw Error(o(160))}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(o(161))}16&n.effectTag&&(je(t,""),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||dl(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.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}r?ml(e,n,t):gl(e,n,t)}function ml(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=cn));else if(4!==r&&null!==(e=e.child))for(ml(e,t,n),e=e.sibling;null!==e;)ml(e,t,n),e=e.sibling}function gl(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(gl(e,t,n),e=e.sibling;null!==e;)gl(e,t,n),e=e.sibling}function hl(e,t,n){for(var r,a,i=t,l=!1;;){if(!l){l=i.return;e:for(;;){if(null===l)throw Error(o(160));switch(r=l.stateNode,l.tag){case 5:a=!1;break e;case 3:case 4:r=r.containerInfo,a=!0;break e}l=l.return}l=!0}if(5===i.tag||6===i.tag){e:for(var u=e,s=i,c=n,f=s;;)if(cl(u,f,c),null!==f.child&&4!==f.tag)f.child.return=f,f=f.child;else{if(f===s)break e;for(;null===f.sibling;){if(null===f.return||f.return===s)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}a?(u=r,s=i.stateNode,8===u.nodeType?u.parentNode.removeChild(s):u.removeChild(s)):r.removeChild(i.stateNode)}else if(4===i.tag){if(null!==i.child){r=i.stateNode.containerInfo,a=!0,i.child.return=i,i=i.child;continue}}else if(cl(e,i,n),null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;4===(i=i.return).tag&&(l=!1)}i.sibling.return=i.return,i=i.sibling}}function bl(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:return void ll(3,t);case 1:case 12:case 17:return;case 5:var n=t.stateNode;if(null!=n){var r=t.memoizedProps,a=null!==e?e.memoizedProps:r;e=t.type;var i=t.updateQueue;if(t.updateQueue=null,null!==i){for(n[Pn]=r,"input"===e&&"radio"===r.type&&null!=r.name&&Te(n,r),ln(e,a),t=ln(e,r),a=0;a<i.length;a+=2){var l=i[a],u=i[a+1];"style"===l?rn(n,u):"dangerouslySetInnerHTML"===l?ze(n,u):"children"===l?je(n,u):Q(n,l,u,t)}switch(e){case"input":xe(n,r);break;case"textarea":Re(n,r);break;case"select":t=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(e=r.value)?Pe(n,!!r.multiple,e,!1):t!==!!r.multiple&&(null!=r.defaultValue?Pe(n,!!r.multiple,r.defaultValue,!0):Pe(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(o(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((t=t.stateNode).hydrate&&(t.hydrate=!1,Mt(t.containerInfo)));case 13:if(n=t,null===t.memoizedState?r=!1:(r=!0,n=t.child,$l=Ha()),null!==n)e:for(e=n;;){if(5===e.tag)i=e.stateNode,r?"function"==typeof(i=i.style).setProperty?i.setProperty("display","none","important"):i.display="none":(i=e.stateNode,a=null!=(a=e.memoizedProps.style)&&a.hasOwnProperty("display")?a.display:null,i.style.display=nn("display",a));else if(6===e.tag)e.stateNode.nodeValue=r?"":e.memoizedProps;else{if(13===e.tag&&null!==e.memoizedState&&null===e.memoizedState.dehydrated){(i=e.child.sibling).return=e,e=i;continue}if(null!==e.child){e.child.return=e,e=e.child;continue}}if(e===n)break;for(;null===e.sibling;){if(null===e.return||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}return void yl(t);case 19:return void yl(t)}throw Error(o(163))}function yl(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new rl),t.forEach((function(t){var r=Ou.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}var vl="function"==typeof WeakMap?WeakMap:Map;function wl(e,t,n){(n=fi(n,null)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Gl||(Gl=!0,Wl=r),al(e,t)},n}function kl(e,t,n){(n=fi(n,null)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var a=t.value;n.payload=function(){return al(e,t),r(a)}}var i=e.stateNode;return null!==i&&"function"==typeof i.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===Vl?Vl=new Set([this]):Vl.add(this),al(e,t));var n=t.stack;this.componentDidCatch(t.value,{componentStack:null!==n?n:""})}),n}var El,Sl=Math.ceil,Tl=Y.ReactCurrentDispatcher,xl=Y.ReactCurrentOwner,Cl=16,_l=32,Ol=0,Pl=3,Al=4,Nl=0,Rl=null,Il=null,Ll=0,Dl=Ol,Fl=null,Ml=1073741823,Bl=1073741823,Ul=null,zl=0,jl=!1,$l=0,Hl=null,Gl=!1,Wl=null,Vl=null,Zl=!1,ql=null,Kl=90,Yl=null,Ql=0,Xl=null,Jl=0;function eu(){return 0!=(48&Nl)?1073741821-(Ha()/10|0):0!==Jl?Jl:Jl=1073741821-(Ha()/10|0)}function tu(e,t,n){if(0==(2&(t=t.mode)))return 1073741823;var r=Ga();if(0==(4&t))return 99===r?1073741823:1073741822;if(0!=(Nl&Cl))return Ll;if(null!==n)e=Qa(e,0|n.timeoutMs||5e3,250);else switch(r){case 99:e=1073741823;break;case 98:e=Qa(e,150,100);break;case 97:case 96:e=Qa(e,5e3,250);break;case 95:e=2;break;default:throw Error(o(326))}return null!==Rl&&e===Ll&&--e,e}function nu(e,t){if(50<Ql)throw Ql=0,Xl=null,Error(o(185));if(null!==(e=ru(e,t))){var n=Ga();1073741823===t?0!=(8&Nl)&&0==(48&Nl)?lu(e):(iu(e),0===Nl&&Ka()):iu(e),0==(4&Nl)||98!==n&&99!==n||(null===Yl?Yl=new Map([[e,t]]):(void 0===(n=Yl.get(e))||n>t)&&Yl.set(e,t))}}function ru(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t);var r=e.return,a=null;if(null===r&&3===e.tag)a=e.stateNode;else for(;null!==r;){if(n=r.alternate,r.childExpirationTime<t&&(r.childExpirationTime=t),null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t),null===r.return&&3===r.tag){a=r.stateNode;break}r=r.return}return null!==a&&(Rl===a&&(mu(t),Dl===Al&&ju(a,Ll)),$u(a,t)),a}function au(e){var t=e.lastExpiredTime;if(0!==t)return t;if(!zu(e,t=e.firstPendingTime))return t;var n=e.lastPingedTime;return 2>=(e=n>(e=e.nextKnownPendingLevel)?n:e)&&t!==e?0:e}function iu(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=qa(lu.bind(null,e));else{var t=au(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=eu();if(1073741823===t?r=99:1===t||2===t?r=95:r=0>=(r=10*(1073741821-t)-10*(1073741821-r))?99:250>=r?98:5250>=r?97:95,null!==n){var a=e.callbackPriority;if(e.callbackExpirationTime===t&&a>=r)return;n!==Fa&&_a(n)}e.callbackExpirationTime=t,e.callbackPriority=r,t=1073741823===t?qa(lu.bind(null,e)):Za(r,ou.bind(null,e),{timeout:10*(1073741821-t)-Ha()}),e.callbackNode=t}}}function ou(e,t){if(Jl=0,t)return Hu(e,t=eu()),iu(e),null;var n=au(e);if(0!==n){if(t=e.callbackNode,0!=(48&Nl))throw Error(o(327));if(Su(),e===Rl&&n===Ll||cu(e,n),null!==Il){var r=Nl;Nl|=Cl;for(var a=du();;)try{hu();break}catch(u){fu(e,u)}if(ri(),Nl=r,Tl.current=a,1===Dl)throw t=Fl,cu(e,n),ju(e,n),iu(e),t;if(null===Il)switch(a=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,r=Dl,Rl=null,r){case Ol:case 1:throw Error(o(345));case 2:Hu(e,2<n?2:n);break;case Pl:if(ju(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=vu(a)),1073741823===Ml&&10<(a=$l+500-Ha())){if(jl){var i=e.lastPingedTime;if(0===i||i>=n){e.lastPingedTime=n,cu(e,n);break}}if(0!==(i=au(e))&&i!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}e.timeoutHandle=Sn(wu.bind(null,e),a);break}wu(e);break;case Al:if(ju(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=vu(a)),jl&&(0===(a=e.lastPingedTime)||a>=n)){e.lastPingedTime=n,cu(e,n);break}if(0!==(a=au(e))&&a!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}if(1073741823!==Bl?r=10*(1073741821-Bl)-Ha():1073741823===Ml?r=0:(r=10*(1073741821-Ml)-5e3,0>(r=(a=Ha())-r)&&(r=0),(n=10*(1073741821-n)-a)<(r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Sl(r/1960))-r)&&(r=n)),10<r){e.timeoutHandle=Sn(wu.bind(null,e),r);break}wu(e);break;case 5:if(1073741823!==Ml&&null!==Ul){i=Ml;var l=Ul;if(0>=(r=0|l.busyMinDurationMs)?r=0:(a=0|l.busyDelayMs,r=(i=Ha()-(10*(1073741821-i)-(0|l.timeoutMs||5e3)))<=a?0:a+r-i),10<r){ju(e,n),e.timeoutHandle=Sn(wu.bind(null,e),r);break}}wu(e);break;default:throw Error(o(329))}if(iu(e),e.callbackNode===t)return ou.bind(null,e)}}return null}function lu(e){var t=e.lastExpiredTime;if(t=0!==t?t:1073741823,0!=(48&Nl))throw Error(o(327));if(Su(),e===Rl&&t===Ll||cu(e,t),null!==Il){var n=Nl;Nl|=Cl;for(var r=du();;)try{gu();break}catch(a){fu(e,a)}if(ri(),Nl=n,Tl.current=r,1===Dl)throw n=Fl,cu(e,t),ju(e,t),iu(e),n;if(null!==Il)throw Error(o(261));e.finishedWork=e.current.alternate,e.finishedExpirationTime=t,Rl=null,wu(e),iu(e)}return null}function uu(e,t){var n=Nl;Nl|=1;try{return e(t)}finally{0===(Nl=n)&&Ka()}}function su(e,t){var n=Nl;Nl&=-2,Nl|=8;try{return e(t)}finally{0===(Nl=n)&&Ka()}}function cu(e,t){e.finishedWork=null,e.finishedExpirationTime=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,Tn(n)),null!==Il)for(n=Il.return;null!==n;){var r=n;switch(r.tag){case 1:null!=(r=r.type.childContextTypes)&&wa();break;case 3:Fi(),da(ha),da(ga);break;case 5:Bi(r);break;case 4:Fi();break;case 13:case 19:da(Ui);break;case 10:ai(r)}n=n.return}Rl=e,Il=Lu(e.current,null),Ll=t,Dl=Ol,Fl=null,Bl=Ml=1073741823,Ul=null,zl=0,jl=!1}function fu(e,t){for(;;){try{if(ri(),$i.current=wo,qi)for(var n=Wi.memoizedState;null!==n;){var r=n.queue;null!==r&&(r.pending=null),n=n.next}if(Gi=0,Zi=Vi=Wi=null,qi=!1,null===Il||null===Il.return)return Dl=1,Fl=t,Il=null;e:{var a=e,i=Il.return,o=Il,l=t;if(t=Ll,o.effectTag|=2048,o.firstEffect=o.lastEffect=null,null!==l&&"object"==typeof l&&"function"==typeof l.then){var u=l;if(0==(2&o.mode)){var s=o.alternate;s?(o.updateQueue=s.updateQueue,o.memoizedState=s.memoizedState,o.expirationTime=s.expirationTime):(o.updateQueue=null,o.memoizedState=null)}var c=0!=(1&Ui.current),f=i;do{var d;if(d=13===f.tag){var p=f.memoizedState;if(null!==p)d=null!==p.dehydrated;else{var m=f.memoizedProps;d=void 0!==m.fallback&&(!0!==m.unstable_avoidThisFallback||!c)}}if(d){var g=f.updateQueue;if(null===g){var h=new Set;h.add(u),f.updateQueue=h}else g.add(u);if(0==(2&f.mode)){if(f.effectTag|=64,o.effectTag&=-2981,1===o.tag)if(null===o.alternate)o.tag=17;else{var b=fi(1073741823,null);b.tag=2,di(o,b)}o.expirationTime=1073741823;break e}l=void 0,o=t;var y=a.pingCache;if(null===y?(y=a.pingCache=new vl,l=new Set,y.set(u,l)):void 0===(l=y.get(u))&&(l=new Set,y.set(u,l)),!l.has(o)){l.add(o);var v=_u.bind(null,a,u,o);u.then(v,v)}f.effectTag|=4096,f.expirationTime=t;break e}f=f.return}while(null!==f);l=Error((he(o.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."+be(o))}5!==Dl&&(Dl=2),l=nl(l,o),f=i;do{switch(f.tag){case 3:u=l,f.effectTag|=4096,f.expirationTime=t,pi(f,wl(f,u,t));break e;case 1:u=l;var w=f.type,k=f.stateNode;if(0==(64&f.effectTag)&&("function"==typeof w.getDerivedStateFromError||null!==k&&"function"==typeof k.componentDidCatch&&(null===Vl||!Vl.has(k)))){f.effectTag|=4096,f.expirationTime=t,pi(f,kl(f,u,t));break e}}f=f.return}while(null!==f)}Il=yu(Il)}catch(E){t=E;continue}break}}function du(){var e=Tl.current;return Tl.current=wo,null===e?wo:e}function pu(e,t){e<Ml&&2<e&&(Ml=e),null!==t&&e<Bl&&2<e&&(Bl=e,Ul=t)}function mu(e){e>zl&&(zl=e)}function gu(){for(;null!==Il;)Il=bu(Il)}function hu(){for(;null!==Il&&!Ma();)Il=bu(Il)}function bu(e){var t=El(e.alternate,e,Ll);return e.memoizedProps=e.pendingProps,null===t&&(t=yu(e)),xl.current=null,t}function yu(e){Il=e;do{var t=Il.alternate;if(e=Il.return,0==(2048&Il.effectTag)){if(t=el(t,Il,Ll),1===Ll||1!==Il.childExpirationTime){for(var n=0,r=Il.child;null!==r;){var a=r.expirationTime,i=r.childExpirationTime;a>n&&(n=a),i>n&&(n=i),r=r.sibling}Il.childExpirationTime=n}if(null!==t)return t;null!==e&&0==(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=Il.firstEffect),null!==Il.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=Il.firstEffect),e.lastEffect=Il.lastEffect),1<Il.effectTag&&(null!==e.lastEffect?e.lastEffect.nextEffect=Il:e.firstEffect=Il,e.lastEffect=Il))}else{if(null!==(t=tl(Il)))return t.effectTag&=2047,t;null!==e&&(e.firstEffect=e.lastEffect=null,e.effectTag|=2048)}if(null!==(t=Il.sibling))return t;Il=e}while(null!==Il);return Dl===Ol&&(Dl=5),null}function vu(e){var t=e.expirationTime;return t>(e=e.childExpirationTime)?t:e}function wu(e){var t=Ga();return Va(99,ku.bind(null,e,t)),null}function ku(e,t){do{Su()}while(null!==ql);if(0!=(48&Nl))throw Error(o(327));var n=e.finishedWork,r=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw Error(o(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var a=vu(n);if(e.firstPendingTime=a,r<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:r<=e.firstSuspendedTime&&(e.firstSuspendedTime=r-1),r<=e.lastPingedTime&&(e.lastPingedTime=0),r<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===Rl&&(Il=Rl=null,Ll=0),1<n.effectTag?null!==n.lastEffect?(n.lastEffect.nextEffect=n,a=n.firstEffect):a=n:a=n.firstEffect,null!==a){var i=Nl;Nl|=_l,xl.current=null,vn=Zt;var l=gn();if(hn(l)){if("selectionStart"in l)var u={start:l.selectionStart,end:l.selectionEnd};else e:{var s=(u=(u=l.ownerDocument)&&u.defaultView||window).getSelection&&u.getSelection();if(s&&0!==s.rangeCount){u=s.anchorNode;var c=s.anchorOffset,f=s.focusNode;s=s.focusOffset;try{u.nodeType,f.nodeType}catch(C){u=null;break e}var d=0,p=-1,m=-1,g=0,h=0,b=l,y=null;t:for(;;){for(var v;b!==u||0!==c&&3!==b.nodeType||(p=d+c),b!==f||0!==s&&3!==b.nodeType||(m=d+s),3===b.nodeType&&(d+=b.nodeValue.length),null!==(v=b.firstChild);)y=b,b=v;for(;;){if(b===l)break t;if(y===u&&++g===c&&(p=d),y===f&&++h===s&&(m=d),null!==(v=b.nextSibling))break;y=(b=y).parentNode}b=v}u=-1===p||-1===m?null:{start:p,end:m}}else u=null}u=u||{start:0,end:0}}else u=null;wn={activeElementDetached:null,focusedElem:l,selectionRange:u},Zt=!1,Hl=a;do{try{Eu()}catch(C){if(null===Hl)throw Error(o(330));Cu(Hl,C),Hl=Hl.nextEffect}}while(null!==Hl);Hl=a;do{try{for(l=e,u=t;null!==Hl;){var w=Hl.effectTag;if(16&w&&je(Hl.stateNode,""),128&w){var k=Hl.alternate;if(null!==k){var E=k.ref;null!==E&&("function"==typeof E?E(null):E.current=null)}}switch(1038&w){case 2:pl(Hl),Hl.effectTag&=-3;break;case 6:pl(Hl),Hl.effectTag&=-3,bl(Hl.alternate,Hl);break;case 1024:Hl.effectTag&=-1025;break;case 1028:Hl.effectTag&=-1025,bl(Hl.alternate,Hl);break;case 4:bl(Hl.alternate,Hl);break;case 8:hl(l,c=Hl,u),fl(c)}Hl=Hl.nextEffect}}catch(C){if(null===Hl)throw Error(o(330));Cu(Hl,C),Hl=Hl.nextEffect}}while(null!==Hl);if(E=wn,k=gn(),w=E.focusedElem,u=E.selectionRange,k!==w&&w&&w.ownerDocument&&mn(w.ownerDocument.documentElement,w)){null!==u&&hn(w)&&(k=u.start,void 0===(E=u.end)&&(E=k),"selectionStart"in w?(w.selectionStart=k,w.selectionEnd=Math.min(E,w.value.length)):(E=(k=w.ownerDocument||document)&&k.defaultView||window).getSelection&&(E=E.getSelection(),c=w.textContent.length,l=Math.min(u.start,c),u=void 0===u.end?l:Math.min(u.end,c),!E.extend&&l>u&&(c=u,u=l,l=c),c=pn(w,l),f=pn(w,u),c&&f&&(1!==E.rangeCount||E.anchorNode!==c.node||E.anchorOffset!==c.offset||E.focusNode!==f.node||E.focusOffset!==f.offset)&&((k=k.createRange()).setStart(c.node,c.offset),E.removeAllRanges(),l>u?(E.addRange(k),E.extend(f.node,f.offset)):(k.setEnd(f.node,f.offset),E.addRange(k))))),k=[];for(E=w;E=E.parentNode;)1===E.nodeType&&k.push({element:E,left:E.scrollLeft,top:E.scrollTop});for("function"==typeof w.focus&&w.focus(),w=0;w<k.length;w++)(E=k[w]).element.scrollLeft=E.left,E.element.scrollTop=E.top}Zt=!!vn,wn=vn=null,e.current=n,Hl=a;do{try{for(w=e;null!==Hl;){var S=Hl.effectTag;if(36&S&&sl(w,Hl.alternate,Hl),128&S){k=void 0;var T=Hl.ref;if(null!==T){var x=Hl.stateNode;Hl.tag,k=x,"function"==typeof T?T(k):T.current=k}}Hl=Hl.nextEffect}}catch(C){if(null===Hl)throw Error(o(330));Cu(Hl,C),Hl=Hl.nextEffect}}while(null!==Hl);Hl=null,Ba(),Nl=i}else e.current=n;if(Zl)Zl=!1,ql=e,Kl=t;else for(Hl=a;null!==Hl;)t=Hl.nextEffect,Hl.nextEffect=null,Hl=t;if(0===(t=e.firstPendingTime)&&(Vl=null),1073741823===t?e===Xl?Ql++:(Ql=0,Xl=e):Ql=0,"function"==typeof Pu&&Pu(n.stateNode,r),iu(e),Gl)throw Gl=!1,e=Wl,Wl=null,e;return 0!=(8&Nl)||Ka(),null}function Eu(){for(;null!==Hl;){var e=Hl.effectTag;0!=(256&e)&&ol(Hl.alternate,Hl),0==(512&e)||Zl||(Zl=!0,Za(97,(function(){return Su(),null}))),Hl=Hl.nextEffect}}function Su(){if(90!==Kl){var e=97<Kl?97:Kl;return Kl=90,Va(e,Tu)}}function Tu(){if(null===ql)return!1;var e=ql;if(ql=null,0!=(48&Nl))throw Error(o(331));var t=Nl;for(Nl|=_l,e=e.current.firstEffect;null!==e;){try{var n=e;if(0!=(512&n.effectTag))switch(n.tag){case 0:case 11:case 15:case 22:ll(5,n),ul(5,n)}}catch(r){if(null===e)throw Error(o(330));Cu(e,r)}n=e.nextEffect,e.nextEffect=null,e=n}return Nl=t,Ka(),!0}function xu(e,t,n){di(e,t=wl(e,t=nl(n,t),1073741823)),null!==(e=ru(e,1073741823))&&iu(e)}function Cu(e,t){if(3===e.tag)xu(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){xu(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Vl||!Vl.has(r))){di(n,e=kl(n,e=nl(t,e),1073741823)),null!==(n=ru(n,1073741823))&&iu(n);break}}n=n.return}}function _u(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),Rl===e&&Ll===n?Dl===Al||Dl===Pl&&1073741823===Ml&&Ha()-$l<500?cu(e,Ll):jl=!0:zu(e,n)&&(0!==(t=e.lastPingedTime)&&t<n||(e.lastPingedTime=n,iu(e)))}function Ou(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(t=tu(t=eu(),e,null)),null!==(e=ru(e,t))&&iu(e)}El=function(e,t,n){var r=t.expirationTime;if(null!==e){var a=t.pendingProps;if(e.memoizedProps!==a||ha.current)Lo=!0;else{if(r<n){switch(Lo=!1,t.tag){case 3:Ho(t),Ro();break;case 5:if(Mi(t),4&t.mode&&1!==n&&a.hidden)return t.expirationTime=t.childExpirationTime=1,null;break;case 1:va(t.type)&&Sa(t);break;case 4:Di(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value,a=t.type._context,pa(Ja,a._currentValue),a._currentValue=r;break;case 13:if(null!==t.memoizedState)return 0!==(r=t.child.childExpirationTime)&&r>=n?qo(e,t,n):(pa(Ui,1&Ui.current),null!==(t=Xo(e,t,n))?t.sibling:null);pa(Ui,1&Ui.current);break;case 19:if(r=t.childExpirationTime>=n,0!=(64&e.effectTag)){if(r)return Qo(e,t,n);t.effectTag|=64}if(null!==(a=t.memoizedState)&&(a.rendering=null,a.tail=null),pa(Ui,Ui.current),!r)return null}return Xo(e,t,n)}Lo=!1}}else Lo=!1;switch(t.expirationTime=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,a=ya(t,ga.current),oi(t,n),a=Qi(null,t,r,e,a,n),t.effectTag|=1,"object"==typeof a&&null!==a&&"function"==typeof a.render&&void 0===a.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,va(r)){var i=!0;Sa(t)}else i=!1;t.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,si(t);var l=r.getDerivedStateFromProps;"function"==typeof l&&yi(t,r,l,e),a.updater=vi,t.stateNode=a,a._reactInternalFiber=t,Si(t,r,e,n),t=$o(null,t,r,!0,i,n)}else t.tag=0,Do(null,t,a,n),t=t.child;return t;case 16:e:{if(a=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,function(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),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)}))}}(a),1!==a._status)throw a._result;switch(a=a._result,t.type=a,i=t.tag=function(e){if("function"==typeof e)return Iu(e)?1:0;if(null!=e){if((e=e.$$typeof)===ue)return 11;if(e===fe)return 14}return 2}(a),e=Xa(a,e),i){case 0:t=zo(null,t,a,e,n);break e;case 1:t=jo(null,t,a,e,n);break e;case 11:t=Fo(null,t,a,e,n);break e;case 14:t=Mo(null,t,a,Xa(a.type,e),r,n);break e}throw Error(o(306,a,""))}return t;case 0:return r=t.type,a=t.pendingProps,zo(e,t,r,a=t.elementType===r?a:Xa(r,a),n);case 1:return r=t.type,a=t.pendingProps,jo(e,t,r,a=t.elementType===r?a:Xa(r,a),n);case 3:if(Ho(t),r=t.updateQueue,null===e||null===r)throw Error(o(282));if(r=t.pendingProps,a=null!==(a=t.memoizedState)?a.element:null,ci(e,t),mi(t,r,null,n),(r=t.memoizedState.element)===a)Ro(),t=Xo(e,t,n);else{if((a=t.stateNode.hydrate)&&(xo=xn(t.stateNode.containerInfo.firstChild),To=t,a=Co=!0),a)for(n=Pi(t,null,r,n),t.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else Do(e,t,r,n),Ro();t=t.child}return t;case 5:return Mi(t),null===e&&Po(t),r=t.type,a=t.pendingProps,i=null!==e?e.memoizedProps:null,l=a.children,En(r,a)?l=null:null!==i&&En(r,i)&&(t.effectTag|=16),Uo(e,t),4&t.mode&&1!==n&&a.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(Do(e,t,l,n),t=t.child),t;case 6:return null===e&&Po(t),null;case 13:return qo(e,t,n);case 4:return Di(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Oi(t,null,r,n):Do(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,Fo(e,t,r,a=t.elementType===r?a:Xa(r,a),n);case 7:return Do(e,t,t.pendingProps,n),t.child;case 8:case 12:return Do(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,a=t.pendingProps,l=t.memoizedProps,i=a.value;var u=t.type._context;if(pa(Ja,u._currentValue),u._currentValue=i,null!==l)if(u=l.value,0===(i=jr(u,i)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(u,i):1073741823))){if(l.children===a.children&&!ha.current){t=Xo(e,t,n);break e}}else for(null!==(u=t.child)&&(u.return=t);null!==u;){var s=u.dependencies;if(null!==s){l=u.child;for(var c=s.firstContext;null!==c;){if(c.context===r&&0!=(c.observedBits&i)){1===u.tag&&((c=fi(n,null)).tag=2,di(u,c)),u.expirationTime<n&&(u.expirationTime=n),null!==(c=u.alternate)&&c.expirationTime<n&&(c.expirationTime=n),ii(u.return,n),s.expirationTime<n&&(s.expirationTime=n);break}c=c.next}}else l=10===u.tag&&u.type===t.type?null:u.child;if(null!==l)l.return=u;else for(l=u;null!==l;){if(l===t){l=null;break}if(null!==(u=l.sibling)){u.return=l.return,l=u;break}l=l.return}u=l}Do(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=(i=t.pendingProps).children,oi(t,n),r=r(a=li(a,i.unstable_observedBits)),t.effectTag|=1,Do(e,t,r,n),t.child;case 14:return i=Xa(a=t.type,t.pendingProps),Mo(e,t,a,i=Xa(a.type,i),r,n);case 15:return Bo(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Xa(r,a),null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),t.tag=1,va(r)?(e=!0,Sa(t)):e=!1,oi(t,n),ki(t,r,a),Si(t,r,a,n),$o(null,t,r,!0,e,n);case 19:return Qo(e,t,n)}throw Error(o(156,t.tag))};var Pu=null,Au=null;function Nu(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.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function Ru(e,t,n,r){return new Nu(e,t,n,r)}function Iu(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Lu(e,t){var n=e.alternate;return null===n?((n=Ru(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.effectTag=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childExpirationTime=e.childExpirationTime,n.expirationTime=e.expirationTime,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{expirationTime:t.expirationTime,firstContext:t.firstContext,responders:t.responders},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Du(e,t,n,r,a,i){var l=2;if(r=e,"function"==typeof e)Iu(e)&&(l=1);else if("string"==typeof e)l=5;else e:switch(e){case ne:return Fu(n.children,a,i,t);case le:l=8,a|=7;break;case re:l=8,a|=1;break;case ae:return(e=Ru(12,n,t,8|a)).elementType=ae,e.type=ae,e.expirationTime=i,e;case se:return(e=Ru(13,n,t,a)).type=se,e.elementType=se,e.expirationTime=i,e;case ce:return(e=Ru(19,n,t,a)).elementType=ce,e.expirationTime=i,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case ie:l=10;break e;case oe:l=9;break e;case ue:l=11;break e;case fe:l=14;break e;case de:l=16,r=null;break e;case pe:l=22;break e}throw Error(o(130,null==e?e:typeof e,""))}return(t=Ru(l,n,t,a)).elementType=e,t.type=r,t.expirationTime=i,t}function Fu(e,t,n,r){return(e=Ru(7,e,r,t)).expirationTime=n,e}function Mu(e,t,n){return(e=Ru(6,e,null,t)).expirationTime=n,e}function Bu(e,t,n){return(t=Ru(4,null!==e.children?e.children:[],e.key,t)).expirationTime=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Uu(e,t,n){this.tag=t,this.current=null,this.containerInfo=e,this.pingCache=this.pendingChildren=null,this.finishedExpirationTime=0,this.finishedWork=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=90,this.lastExpiredTime=this.lastPingedTime=this.nextKnownPendingLevel=this.lastSuspendedTime=this.firstSuspendedTime=this.firstPendingTime=0}function zu(e,t){var n=e.firstSuspendedTime;return e=e.lastSuspendedTime,0!==n&&n>=t&&e<=t}function ju(e,t){var n=e.firstSuspendedTime,r=e.lastSuspendedTime;n<t&&(e.firstSuspendedTime=t),(r>t||0===n)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function $u(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var n=e.firstSuspendedTime;0!==n&&(t>=n?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function Hu(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function Gu(e,t,n,r){var a=t.current,i=eu(),l=hi.suspense;i=tu(i,a,l);e:if(n){t:{if(et(n=n._reactInternalFiber)!==n||1!==n.tag)throw Error(o(170));var u=n;do{switch(u.tag){case 3:u=u.stateNode.context;break t;case 1:if(va(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break t}}u=u.return}while(null!==u);throw Error(o(171))}if(1===n.tag){var s=n.type;if(va(s)){n=Ea(n,s,u);break e}}n=u}else n=ma;return null===t.context?t.context=n:t.pendingContext=n,(t=fi(i,l)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),di(a,t),nu(a,i),i}function Wu(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Vu(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime<t&&(e.retryTime=t)}function Zu(e,t){Vu(e,t),(e=e.alternate)&&Vu(e,t)}function qu(e,t,n){var r=new Uu(e,t,n=null!=n&&!0===n.hydrate),a=Ru(3,null,null,2===t?7:1===t?3:0);r.current=a,a.stateNode=r,si(a),e[An]=r.current,n&&0!==t&&function(e,t){var n=Je(t);_t.forEach((function(e){gt(e,t,n)})),Ot.forEach((function(e){gt(e,t,n)}))}(0,9===e.nodeType?e:e.ownerDocument),this._internalRoot=r}function Ku(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Yu(e,t,n,r,a){var i=n._reactRootContainer;if(i){var o=i._internalRoot;if("function"==typeof a){var l=a;a=function(){var e=Wu(o);l.call(e)}}Gu(t,o,e,a)}else{if(i=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 qu(e,0,t?{hydrate:!0}:void 0)}(n,r),o=i._internalRoot,"function"==typeof a){var u=a;a=function(){var e=Wu(o);u.call(e)}}su((function(){Gu(t,o,e,a)}))}return Wu(o)}function Qu(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:te,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function Xu(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Ku(t))throw Error(o(200));return Qu(e,t,null,n)}qu.prototype.render=function(e){Gu(e,this._internalRoot,null,null)},qu.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;Gu(null,e,null,(function(){t[An]=null}))},ht=function(e){if(13===e.tag){var t=Qa(eu(),150,100);nu(e,t),Zu(e,t)}},bt=function(e){13===e.tag&&(nu(e,3),Zu(e,3))},yt=function(e){if(13===e.tag){var t=eu();nu(e,t=tu(t,e,null)),Zu(e,t)}},O=function(e,t,n){switch(t){case"input":if(xe(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=Ln(r);if(!a)throw Error(o(90));ke(r),xe(r,a)}}}break;case"textarea":Re(e,n);break;case"select":null!=(t=n.value)&&Pe(e,!!n.multiple,t,!1)}},L=uu,D=function(e,t,n,r,a){var i=Nl;Nl|=4;try{return Va(98,e.bind(null,t,n,r,a))}finally{0===(Nl=i)&&Ka()}},F=function(){0==(49&Nl)&&(function(){if(null!==Yl){var e=Yl;Yl=null,e.forEach((function(e,t){Hu(t,e),iu(t)})),Ka()}}(),Su())},M=function(e,t){var n=Nl;Nl|=2;try{return e(t)}finally{0===(Nl=n)&&Ka()}};var Ju={Events:[Rn,In,Ln,C,S,jn,function(e){it(e,zn)},R,I,Xt,ut,Su,{current:!1}]};!function(e){var t=e.findFiberByHostInstance;(function(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var n=t.inject(e);Pu=function(e){try{t.onCommitFiberRoot(n,e,void 0,64==(64&e.current.effectTag))}catch(r){}},Au=function(e){try{t.onCommitFiberUnmount(n,e)}catch(r){}}}catch(r){}})(a({},e,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Y.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=rt(e))?null:e.stateNode},findFiberByHostInstance:function(e){return t?t(e):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null}))}({findFiberByHostInstance:Nn,bundleType:0,version:"16.14.0",rendererPackageName:"react-dom"}),t.hydrate=function(e,t,n){if(!Ku(t))throw Error(o(200));return Yu(null,e,t,!0,n)}},3935:function(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:function(e){var t="undefined"!=typeof Element,n="function"==typeof Map,r="function"==typeof Set,a="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function i(e,o){if(e===o)return!0;if(e&&o&&"object"==typeof e&&"object"==typeof o){if(e.constructor!==o.constructor)return!1;var l,u,s,c;if(Array.isArray(e)){if((l=e.length)!=o.length)return!1;for(u=l;0!=u--;)if(!i(e[u],o[u]))return!1;return!0}if(n&&e instanceof Map&&o instanceof Map){if(e.size!==o.size)return!1;for(c=e.entries();!(u=c.next()).done;)if(!o.has(u.value[0]))return!1;for(c=e.entries();!(u=c.next()).done;)if(!i(u.value[1],o.get(u.value[0])))return!1;return!0}if(r&&e instanceof Set&&o instanceof Set){if(e.size!==o.size)return!1;for(c=e.entries();!(u=c.next()).done;)if(!o.has(u.value[0]))return!1;return!0}if(a&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(o)){if((l=e.length)!=o.length)return!1;for(u=l;0!=u--;)if(e[u]!==o[u])return!1;return!0}if(e.constructor===RegExp)return e.source===o.source&&e.flags===o.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===o.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===o.toString();if((l=(s=Object.keys(e)).length)!==Object.keys(o).length)return!1;for(u=l;0!=u--;)if(!Object.prototype.hasOwnProperty.call(o,s[u]))return!1;if(t&&e instanceof Element)return!1;for(u=l;0!=u--;)if(("_owner"!==s[u]&&"__v"!==s[u]&&"__o"!==s[u]||!e.$$typeof)&&!i(e[s[u]],o[s[u]]))return!1;return!0}return e!=e&&o!=o}e.exports=function(e,t){try{return i(e,t)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}},9921:function(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,i=n?Symbol.for("react.fragment"):60107,o=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,u=n?Symbol.for("react.provider"):60109,s=n?Symbol.for("react.context"):60110,c=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,h=n?Symbol.for("react.lazy"):60116,b=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,v=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 c:case f:case i:case l:case o:case p:return e;default:switch(e=e&&e.$$typeof){case s:case d:case h:case g:case u:return e;default:return t}}case a:return t}}}function E(e){return k(e)===f}t.AsyncMode=c,t.ConcurrentMode=f,t.ContextConsumer=s,t.ContextProvider=u,t.Element=r,t.ForwardRef=d,t.Fragment=i,t.Lazy=h,t.Memo=g,t.Portal=a,t.Profiler=l,t.StrictMode=o,t.Suspense=p,t.isAsyncMode=function(e){return E(e)||k(e)===c},t.isConcurrentMode=E,t.isContextConsumer=function(e){return k(e)===s},t.isContextProvider=function(e){return k(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return k(e)===d},t.isFragment=function(e){return k(e)===i},t.isLazy=function(e){return k(e)===h},t.isMemo=function(e){return k(e)===g},t.isPortal=function(e){return k(e)===a},t.isProfiler=function(e){return k(e)===l},t.isStrictMode=function(e){return k(e)===o},t.isSuspense=function(e){return k(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===f||e===l||e===o||e===p||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===g||e.$$typeof===u||e.$$typeof===s||e.$$typeof===d||e.$$typeof===y||e.$$typeof===v||e.$$typeof===w||e.$$typeof===b)},t.typeOf=k},9864:function(e,t,n){"use strict";e.exports=n(9921)},8790:function(e,t,n){"use strict";n.d(t,{f:function(){return o},H:function(){return l}});var r=n(5977),a=n(7462),i=n(7294);function o(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&&o(e.routes,t,n)),a})),n}function l(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),e?i.createElement(r.rs,n,e.map((function(e,n){return i.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})):i.createElement(e.component,(0,a.Z)({},n,t,{route:e}))}})}))):null}},3727:function(e,t,n){"use strict";n.d(t,{VA:function(){return r.VA},NL:function(){return r.NL},l_:function(){return r.l_},AW:function(){return r.AW},F0:function(){return r.F0},gx:function(){return r.gx},rs:function(){return r.rs},Gn:function(){return r.Gn},LX:function(){return r.LX},k6:function(){return r.k6},TH:function(){return r.TH},UO:function(){return r.UO},$B:function(){return r.$B},EN:function(){return r.EN},VK:function(){return c},UT:function(){return f},rU:function(){return b},OL:function(){return w}});var r=n(5977),a=n(4578),i=n(7294),o=n(71),l=(n(5697),n(7462)),u=n(3366),s=n(2177),c=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,o.lX)(t.props),t}return(0,a.Z)(t,e),t.prototype.render=function(){return i.createElement(r.F0,{history:this.history,children:this.props.children})},t}(i.Component);var f=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,o.q_)(t.props),t}return(0,a.Z)(t,e),t.prototype.render=function(){return i.createElement(r.F0,{history:this.history,children:this.props.children})},t}(i.Component);var d=function(e,t){return"function"==typeof e?e(t):e},p=function(e,t){return"string"==typeof e?(0,o.ob)(e,null,null,t):e},m=function(e){return e},g=i.forwardRef;void 0===g&&(g=m);var h=g((function(e,t){var n=e.innerRef,r=e.navigate,a=e.onClick,o=(0,u.Z)(e,["innerRef","navigate","onClick"]),s=o.target,c=(0,l.Z)({},o,{onClick:function(e){try{a&&a(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||s&&"_self"!==s||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return c.ref=m!==g&&t||n,i.createElement("a",c)}));var b=g((function(e,t){var n=e.component,a=void 0===n?h:n,o=e.replace,c=e.to,f=e.innerRef,b=(0,u.Z)(e,["component","replace","to","innerRef"]);return i.createElement(r.s6.Consumer,null,(function(e){e||(0,s.Z)(!1);var n=e.history,r=p(d(c,e.location),e.location),u=r?n.createHref(r):"",h=(0,l.Z)({},b,{href:u,navigate:function(){var t=d(c,e.location);(o?n.replace:n.push)(t)}});return m!==g?h.ref=t||f:h.innerRef=f,i.createElement(a,h)}))})),y=function(e){return e},v=i.forwardRef;void 0===v&&(v=y);var w=v((function(e,t){var n=e["aria-current"],a=void 0===n?"page":n,o=e.activeClassName,c=void 0===o?"active":o,f=e.activeStyle,m=e.className,g=e.exact,h=e.isActive,w=e.location,k=e.sensitive,E=e.strict,S=e.style,T=e.to,x=e.innerRef,C=(0,u.Z)(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return i.createElement(r.s6.Consumer,null,(function(e){e||(0,s.Z)(!1);var n=w||e.location,o=p(d(T,n),n),u=o.pathname,_=u&&u.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),O=_?(0,r.LX)(n.pathname,{path:_,exact:g,sensitive:k,strict:E}):null,P=!!(h?h(O,n):O),A=P?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(" ")}(m,c):m,N=P?(0,l.Z)({},S,{},f):S,R=(0,l.Z)({"aria-current":P&&a||null,className:A,style:N,to:o},C);return y!==v?R.ref=t||x:R.innerRef=x,i.createElement(b,R)}))}))},5977:function(e,t,n){"use strict";n.d(t,{VA:function(){return x},NL:function(){return _},l_:function(){return N},AW:function(){return D},F0:function(){return T},gx:function(){return j},rs:function(){return $},s6:function(){return S},Gn:function(){return A},LX:function(){return L},k6:function(){return W},TH:function(){return V},UO:function(){return Z},$B:function(){return q},EN:function(){return H}});var r=n(4578),a=n(7294),i=n(5697),o=n.n(i),l=n(71),u=1073741823,s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:{};function c(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 f=a.createContext||function(e,t){var n,i,l="__create-react-context-"+function(){var e="__global_unique_id__";return s[e]=(s[e]||0)+1}()+"__",f=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).emitter=c(t.props.value),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;((i=r)===(o=a)?0!==i||1/i==1/o:i!=i&&o!=o)?n=0:(n="function"==typeof t?t(r,a):u,0!==(n|=0)&&this.emitter.set(e.value,n))}var i,o},a.render=function(){return this.props.children},n}(a.Component);f.childContextTypes=((n={})[l]=o().object.isRequired,n);var d=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?u:t},a.componentDidMount=function(){this.context[l]&&this.context[l].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?u: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 d.contextTypes=((i={})[l]=o().object,i),{Provider:f,Consumer:d}},d=f,p=n(2177),m=n(7462),g=n(9658),h=n.n(g),b=(n(9864),n(3366)),y=n(8679),v=n.n(y),w=function(e){var t=d();return t.displayName=e,t},k=w("Router-History"),E=function(e){var t=d();return t.displayName=e,t},S=E("Router"),T=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._isMounted?n.setState({location: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(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return a.createElement(S.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},a.createElement(k.Provider,{children:this.props.children||null,value:this.props.history}))},t}(a.Component);var x=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,l.PP)(t.props),t}return(0,r.Z)(t,e),t.prototype.render=function(){return a.createElement(T,{history:this.history,children:this.props.children})},t}(a.Component);var C=function(e){function t(){return e.apply(this,arguments)||this}(0,r.Z)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(e){this.props.onUpdate&&this.props.onUpdate.call(this,this,e)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},t}(a.Component);function _(e){var t=e.message,n=e.when,r=void 0===n||n;return a.createElement(S.Consumer,null,(function(e){if(e||(0,p.Z)(!1),!r||e.staticContext)return null;var n=e.history.block;return a.createElement(C,{onMount:function(e){e.release=n(t)},onUpdate:function(e,r){r.message!==t&&(e.release(),e.release=n(t))},onUnmount:function(e){e.release()},message:t})}))}var O={},P=0;function A(e,t){return void 0===e&&(e="/"),void 0===t&&(t={}),"/"===e?e:function(e){if(O[e])return O[e];var t=h().compile(e);return P<1e4&&(O[e]=t,P++),t}(e)(t,{pretty:!0})}function N(e){var t=e.computedMatch,n=e.to,r=e.push,i=void 0!==r&&r;return a.createElement(S.Consumer,null,(function(e){e||(0,p.Z)(!1);var r=e.history,o=e.staticContext,u=i?r.push:r.replace,s=(0,l.ob)(t?"string"==typeof n?A(n,t.params):(0,m.Z)({},n,{pathname:A(n.pathname,t.params)}):n);return o?(u(s),null):a.createElement(C,{onMount:function(){u(s)},onUpdate:function(e,t){var n=(0,l.ob)(t.to);(0,l.Hp)(n,(0,m.Z)({},s,{key:n.key}))||u(s)},to:n})}))}var R={},I=0;function L(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,a=n.exact,i=void 0!==a&&a,o=n.strict,l=void 0!==o&&o,u=n.sensitive,s=void 0!==u&&u;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=R[n]||(R[n]={});if(r[e])return r[e];var a=[],i={regexp:h()(e,a,t),keys:a};return I<1e4&&(r[e]=i,I++),i}(n,{end:i,strict:l,sensitive:s}),a=r.regexp,o=r.keys,u=a.exec(e);if(!u)return null;var c=u[0],f=u.slice(1),d=e===c;return i&&!d?null:{path:n,url:"/"===n&&""===c?"/":c,isExact:d,params:o.reduce((function(e,t,n){return e[t.name]=f[n],e}),{})}}),null)}var D=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(S.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?L(n.pathname,e.props):t.match,i=(0,m.Z)({},t,{location:n,match:r}),o=e.props,l=o.children,u=o.component,s=o.render;return Array.isArray(l)&&0===l.length&&(l=null),a.createElement(S.Provider,{value:i},i.match?l?"function"==typeof l?l(i):l:u?a.createElement(u,i):s?s(i):null:"function"==typeof l?l(i):null)}))},t}(a.Component);function F(e){return"/"===e.charAt(0)?e:"/"+e}function M(e,t){if(!e)return t;var n=F(e);return 0!==t.pathname.indexOf(n)?t:(0,m.Z)({},t,{pathname:t.pathname.substr(n.length)})}function B(e){return"string"==typeof e?e:(0,l.Ep)(e)}function U(e){return function(){(0,p.Z)(!1)}}function z(){}var j=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).handlePush=function(e){return t.navigateTo(e,"PUSH")},t.handleReplace=function(e){return t.navigateTo(e,"REPLACE")},t.handleListen=function(){return z},t.handleBlock=function(){return z},t}(0,r.Z)(t,e);var n=t.prototype;return n.navigateTo=function(e,t){var n=this.props,r=n.basename,a=void 0===r?"":r,i=n.context,o=void 0===i?{}:i;o.action=t,o.location=function(e,t){return e?(0,m.Z)({},t,{pathname:F(e)+t.pathname}):t}(a,(0,l.ob)(e)),o.url=B(o.location)},n.render=function(){var e=this.props,t=e.basename,n=void 0===t?"":t,r=e.context,i=void 0===r?{}:r,o=e.location,u=void 0===o?"/":o,s=(0,b.Z)(e,["basename","context","location"]),c={createHref:function(e){return F(n+B(e))},action:"POP",location:M(n,(0,l.ob)(u)),push:this.handlePush,replace:this.handleReplace,go:U(),goBack:U(),goForward:U(),listen:this.handleListen,block:this.handleBlock};return a.createElement(T,(0,m.Z)({},s,{history:c,staticContext:i}))},t}(a.Component);var $=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(S.Consumer,null,(function(t){t||(0,p.Z)(!1);var n,r,i=e.props.location||t.location;return a.Children.forEach(e.props.children,(function(e){if(null==r&&a.isValidElement(e)){n=e;var o=e.props.path||e.props.from;r=o?L(i.pathname,(0,m.Z)({},e.props,{path:o})):t.match}})),r?a.cloneElement(n,{location:i,computedMatch:r}):null}))},t}(a.Component);function H(e){var t="withRouter("+(e.displayName||e.name)+")",n=function(t){var n=t.wrappedComponentRef,r=(0,b.Z)(t,["wrappedComponentRef"]);return a.createElement(S.Consumer,null,(function(t){return t||(0,p.Z)(!1),a.createElement(e,(0,m.Z)({},r,t,{ref:n}))}))};return n.displayName=t,n.WrappedComponent=e,v()(n,e)}var G=a.useContext;function W(){return G(k)}function V(){return G(S).location}function Z(){var e=G(S).match;return e?e.params:{}}function q(e){var t=V(),n=G(S).match;return e?L(t.pathname,e):n}},6585:function(e){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},9658:function(e,t,n){var r=n(6585);e.exports=p,e.exports.parse=i,e.exports.compile=function(e,t){return l(i(e,t),t)},e.exports.tokensToFunction=l,e.exports.tokensToRegExp=d;var a=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function i(e,t){for(var n,r=[],i=0,o=0,l="",c=t&&t.delimiter||"/";null!=(n=a.exec(e));){var f=n[0],d=n[1],p=n.index;if(l+=e.slice(o,p),o=p+f.length,d)l+=d[1];else{var m=e[o],g=n[2],h=n[3],b=n[4],y=n[5],v=n[6],w=n[7];l&&(r.push(l),l="");var k=null!=g&&null!=m&&m!==g,E="+"===v||"*"===v,S="?"===v||"*"===v,T=n[2]||c,x=b||y;r.push({name:h||i++,prefix:g||"",delimiter:T,optional:S,repeat:E,partial:k,asterisk:!!w,pattern:x?s(x):w?".*":"[^"+u(T)+"]+?"})}}return o<e.length&&(l+=e.substr(o)),l&&r.push(l),r}function o(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+")$",f(t)));return function(t,a){for(var i="",l=t||{},u=(a||{}).pretty?o:encodeURIComponent,s=0;s<e.length;s++){var c=e[s];if("string"!=typeof c){var f,d=l[c.name];if(null==d){if(c.optional){c.partial&&(i+=c.prefix);continue}throw new TypeError('Expected "'+c.name+'" to be defined')}if(r(d)){if(!c.repeat)throw new TypeError('Expected "'+c.name+'" to not repeat, but received `'+JSON.stringify(d)+"`");if(0===d.length){if(c.optional)continue;throw new TypeError('Expected "'+c.name+'" to not be empty')}for(var p=0;p<d.length;p++){if(f=u(d[p]),!n[s].test(f))throw new TypeError('Expected all "'+c.name+'" to match "'+c.pattern+'", but received `'+JSON.stringify(f)+"`");i+=(0===p?c.prefix:c.delimiter)+f}}else{if(f=c.asterisk?encodeURI(d).replace(/[?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})):u(d),!n[s].test(f))throw new TypeError('Expected "'+c.name+'" to match "'+c.pattern+'", but received "'+f+'"');i+=c.prefix+f}}else i+=c}return i}}function u(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function s(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function c(e,t){return e.keys=t,e}function f(e){return e&&e.sensitive?"":"i"}function d(e,t,n){r(t)||(n=t||n,t=[]);for(var a=(n=n||{}).strict,i=!1!==n.end,o="",l=0;l<e.length;l++){var s=e[l];if("string"==typeof s)o+=u(s);else{var d=u(s.prefix),p="(?:"+s.pattern+")";t.push(s),s.repeat&&(p+="(?:"+d+p+")*"),o+=p=s.optional?s.partial?d+"("+p+")?":"(?:"+d+"("+p+"))?":d+"("+p+")"}}var m=u(n.delimiter||"/"),g=o.slice(-m.length)===m;return a||(o=(g?o.slice(0,-m.length):o)+"(?:"+m+"(?=$))?"),o+=i?"$":a&&g?"":"(?="+m+"|$)",c(new RegExp("^"+o,f(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 c(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 c(new RegExp("(?:"+r.join("|")+")",f(n)),t)}(e,t,n):function(e,t,n){return d(i(e,n),t,n)}(e,t,n)}},3524:function(e,t,n){"use strict";var r,a=n(7294),i=(r=a)&&"object"==typeof r&&"default"in r?r.default:r;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}var l=!("undefined"==typeof window||!window.document||!window.document.createElement);e.exports=function(e,t,n){if("function"!=typeof e)throw new Error("Expected reducePropsToState to be a function.");if("function"!=typeof t)throw new Error("Expected handleStateChangeOnClient to be a function.");if(void 0!==n&&"function"!=typeof n)throw new Error("Expected mapStateOnServer to either be undefined or a function.");return function(r){if("function"!=typeof r)throw new Error("Expected WrappedComponent to be a React component.");var u,s=[];function c(){u=e(s.map((function(e){return e.props}))),f.canUseDOM?t(u):n&&(u=n(u))}var f=function(e){var t,n;function a(){return e.apply(this,arguments)||this}n=e,(t=a).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,a.peek=function(){return u},a.rewind=function(){if(a.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var e=u;return u=void 0,s=[],e};var o=a.prototype;return o.UNSAFE_componentWillMount=function(){s.push(this),c()},o.componentDidUpdate=function(){c()},o.componentWillUnmount=function(){var e=s.indexOf(this);s.splice(e,1),c()},o.render=function(){return i.createElement(r,this.props)},a}(a.PureComponent);return o(f,"displayName","SideEffect("+function(e){return e.displayName||e.name||"Component"}(r)+")"),o(f,"canUseDOM",l),f}}},2408:function(e,t,n){"use strict";var r=n(7418),a="function"==typeof Symbol&&Symbol.for,i=a?Symbol.for("react.element"):60103,o=a?Symbol.for("react.portal"):60106,l=a?Symbol.for("react.fragment"):60107,u=a?Symbol.for("react.strict_mode"):60108,s=a?Symbol.for("react.profiler"):60114,c=a?Symbol.for("react.provider"):60109,f=a?Symbol.for("react.context"):60110,d=a?Symbol.for("react.forward_ref"):60112,p=a?Symbol.for("react.suspense"):60113,m=a?Symbol.for("react.memo"):60115,g=a?Symbol.for("react.lazy"):60116,h="function"==typeof Symbol&&Symbol.iterator;function b(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 y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v={};function w(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||y}function k(){}function E(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||y}w.prototype.isReactComponent={},w.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(b(85));this.updater.enqueueSetState(this,e,t,"setState")},w.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},k.prototype=w.prototype;var S=E.prototype=new k;S.constructor=E,r(S,w.prototype),S.isPureReactComponent=!0;var T={current:null},x=Object.prototype.hasOwnProperty,C={key:!0,ref:!0,__self:!0,__source:!0};function _(e,t,n){var r,a={},o=null,l=null;if(null!=t)for(r in void 0!==t.ref&&(l=t.ref),void 0!==t.key&&(o=""+t.key),t)x.call(t,r)&&!C.hasOwnProperty(r)&&(a[r]=t[r]);var u=arguments.length-2;if(1===u)a.children=n;else if(1<u){for(var s=Array(u),c=0;c<u;c++)s[c]=arguments[c+2];a.children=s}if(e&&e.defaultProps)for(r in u=e.defaultProps)void 0===a[r]&&(a[r]=u[r]);return{$$typeof:i,type:e,key:o,ref:l,props:a,_owner:T.current}}function O(e){return"object"==typeof e&&null!==e&&e.$$typeof===i}var P=/\/+/g,A=[];function N(e,t,n,r){if(A.length){var a=A.pop();return a.result=e,a.keyPrefix=t,a.func=n,a.context=r,a.count=0,a}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function R(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>A.length&&A.push(e)}function I(e,t,n,r){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var l=!1;if(null===e)l=!0;else switch(a){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case i:case o:l=!0}}if(l)return n(r,e,""===t?"."+D(e,0):t),1;if(l=0,t=""===t?".":t+":",Array.isArray(e))for(var u=0;u<e.length;u++){var s=t+D(a=e[u],u);l+=I(a,s,n,r)}else if(null===e||"object"!=typeof e?s=null:s="function"==typeof(s=h&&e[h]||e["@@iterator"])?s:null,"function"==typeof s)for(e=s.call(e),u=0;!(a=e.next()).done;)l+=I(a=a.value,s=t+D(a,u++),n,r);else if("object"===a)throw n=""+e,Error(b(31,"[object Object]"===n?"object with keys {"+Object.keys(e).join(", ")+"}":n,""));return l}function L(e,t,n){return null==e?0:I(e,"",t,n)}function D(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 F(e,t){e.func.call(e.context,t,e.count++)}function M(e,t,n){var r=e.result,a=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?B(e,r,n,(function(e){return e})):null!=e&&(O(e)&&(e=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,a+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(P,"$&/")+"/")+n)),r.push(e))}function B(e,t,n,r,a){var i="";null!=n&&(i=(""+n).replace(P,"$&/")+"/"),L(e,M,t=N(t,i,r,a)),R(t)}var U={current:null};function z(){var e=U.current;if(null===e)throw Error(b(321));return e}var j={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:T,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:function(e,t,n){if(null==e)return e;var r=[];return B(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;L(e,F,t=N(null,null,t,n)),R(t)},count:function(e){return L(e,(function(){return null}),null)},toArray:function(e){var t=[];return B(e,t,null,(function(e){return e})),t},only:function(e){if(!O(e))throw Error(b(143));return e}},t.Component=w,t.Fragment=l,t.Profiler=s,t.PureComponent=E,t.StrictMode=u,t.Suspense=p,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=j,t.cloneElement=function(e,t,n){if(null==e)throw Error(b(267,e));var a=r({},e.props),o=e.key,l=e.ref,u=e._owner;if(null!=t){if(void 0!==t.ref&&(l=t.ref,u=T.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(c in t)x.call(t,c)&&!C.hasOwnProperty(c)&&(a[c]=void 0===t[c]&&void 0!==s?s[c]:t[c])}var c=arguments.length-2;if(1===c)a.children=n;else if(1<c){s=Array(c);for(var f=0;f<c;f++)s[f]=arguments[f+2];a.children=s}return{$$typeof:i,type:e.type,key:o,ref:l,props:a,_owner:u}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:f,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:c,_context:e},e.Consumer=e},t.createElement=_,t.createFactory=function(e){var t=_.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:d,render:e}},t.isValidElement=O,t.lazy=function(e){return{$$typeof:g,_ctor:e,_status:-1,_result:null}},t.memo=function(e,t){return{$$typeof:m,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return z().useCallback(e,t)},t.useContext=function(e,t){return z().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return z().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return z().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return z().useLayoutEffect(e,t)},t.useMemo=function(e,t){return z().useMemo(e,t)},t.useReducer=function(e,t,n){return z().useReducer(e,t,n)},t.useRef=function(e){return z().useRef(e)},t.useState=function(e){return z().useState(e)},t.version="16.14.0"},7294:function(e,t,n){"use strict";e.exports=n(2408)},53:function(e,t){"use strict";var n,r,a,i,o;if("undefined"==typeof window||"function"!=typeof MessageChannel){var l=null,u=null,s=function(){if(null!==l)try{var e=t.unstable_now();l(!0,e),l=null}catch(n){throw setTimeout(s,0),n}},c=Date.now();t.unstable_now=function(){return Date.now()-c},n=function(e){null!==l?setTimeout(n,0,e):(l=e,setTimeout(s,0))},r=function(e,t){u=setTimeout(e,t)},a=function(){clearTimeout(u)},i=function(){return!1},o=t.unstable_forceFrameRate=function(){}}else{var f=window.performance,d=window.Date,p=window.setTimeout,m=window.clearTimeout;if("undefined"!=typeof console){var g=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://fb.me/react-polyfills"),"function"!=typeof g&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof f&&"function"==typeof f.now)t.unstable_now=function(){return f.now()};else{var h=d.now();t.unstable_now=function(){return d.now()-h}}var b=!1,y=null,v=-1,w=5,k=0;i=function(){return t.unstable_now()>=k},o=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):w=0<e?Math.floor(1e3/e):5};var E=new MessageChannel,S=E.port2;E.port1.onmessage=function(){if(null!==y){var e=t.unstable_now();k=e+w;try{y(!0,e)?S.postMessage(null):(b=!1,y=null)}catch(n){throw S.postMessage(null),n}}else b=!1},n=function(e){y=e,b||(b=!0,S.postMessage(null))},r=function(e,n){v=p((function(){e(t.unstable_now())}),n)},a=function(){m(v),v=-1}}function T(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,a=e[r];if(!(void 0!==a&&0<_(a,t)))break e;e[r]=t,e[n]=a,n=r}}function x(e){return void 0===(e=e[0])?null:e}function C(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 i=2*(r+1)-1,o=e[i],l=i+1,u=e[l];if(void 0!==o&&0>_(o,n))void 0!==u&&0>_(u,o)?(e[r]=u,e[l]=n,r=l):(e[r]=o,e[i]=n,r=i);else{if(!(void 0!==u&&0>_(u,n)))break e;e[r]=u,e[l]=n,r=l}}}return t}return null}function _(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var O=[],P=[],A=1,N=null,R=3,I=!1,L=!1,D=!1;function F(e){for(var t=x(P);null!==t;){if(null===t.callback)C(P);else{if(!(t.startTime<=e))break;C(P),t.sortIndex=t.expirationTime,T(O,t)}t=x(P)}}function M(e){if(D=!1,F(e),!L)if(null!==x(O))L=!0,n(B);else{var t=x(P);null!==t&&r(M,t.startTime-e)}}function B(e,n){L=!1,D&&(D=!1,a()),I=!0;var o=R;try{for(F(n),N=x(O);null!==N&&(!(N.expirationTime>n)||e&&!i());){var l=N.callback;if(null!==l){N.callback=null,R=N.priorityLevel;var u=l(N.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?N.callback=u:N===x(O)&&C(O),F(n)}else C(O);N=x(O)}if(null!==N)var s=!0;else{var c=x(P);null!==c&&r(M,c.startTime-n),s=!1}return s}finally{N=null,R=o,I=!1}}function U(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var z=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(){L||I||(L=!0,n(B))},t.unstable_getCurrentPriorityLevel=function(){return R},t.unstable_getFirstCallbackNode=function(){return x(O)},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=z,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,i,o){var l=t.unstable_now();if("object"==typeof o&&null!==o){var u=o.delay;u="number"==typeof u&&0<u?l+u:l,o="number"==typeof o.timeout?o.timeout:U(e)}else o=U(e),u=l;return e={id:A++,callback:i,priorityLevel:e,startTime:u,expirationTime:o=u+o,sortIndex:-1},u>l?(e.sortIndex=u,T(P,e),null===x(O)&&e===x(P)&&(D?a():D=!0,r(M,u-l))):(e.sortIndex=o,T(O,e),L||I||(L=!0,n(B))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();F(e);var n=x(O);return n!==N&&null!==N&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime<N.expirationTime||i()},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:function(e,t,n){"use strict";e.exports=n(53)},2177:function(e,t){"use strict";var n="Invariant failed";t.Z=function(e,t){if(!e)throw new Error(n)}},7462:function(e,t,n){"use strict";function r(){return 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},r.apply(this,arguments)}n.d(t,{Z:function(){return r}})},4578:function(e,t,n){"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}n.d(t,{Z:function(){return r}})},3366:function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}n.d(t,{Z:function(){return r}})},7529:function(e){"use strict";e.exports={}}},function(e){e.O(0,[532],(function(){return t=8845,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/assets/js/runtime~main.2cbf1b8f.js b/assets/js/runtime~main.2cbf1b8f.js deleted file mode 100644 index 88eda6b..0000000 --- a/assets/js/runtime~main.2cbf1b8f.js +++ /dev/null @@ -1 +0,0 @@ -!function(){"use strict";var e,t,n,r,o,f={},c={};function u(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={exports:{}};return f[e].call(n.exports,n,n.exports,u),n.exports}u.m=f,e=[],u.O=function(t,n,r,o){if(!n){var f=1/0;for(d=0;d<e.length;d++){n=e[d][0],r=e[d][1],o=e[d][2];for(var c=!0,a=0;a<n.length;a++)(!1&o||f>=o)&&Object.keys(u.O).every((function(e){return u.O[e](n[a])}))?n.splice(a--,1):(c=!1,o<f&&(f=o));if(c){e.splice(d--,1);var i=r();void 0!==i&&(t=i)}}return t}o=o||0;for(var d=e.length;d>0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[n,r,o]},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},u.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 o=Object.create(null);u.r(o);var f={};t=t||[null,n({}),n([]),n(n)];for(var c=2&r&&e;"object"==typeof c&&!~t.indexOf(c);c=n(c))Object.getOwnPropertyNames(c).forEach((function(t){f[t]=function(){return e[t]}}));return f.default=function(){return e},u.d(o,f),o},u.d=function(e,t){for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},u.f={},u.e=function(e){return Promise.all(Object.keys(u.f).reduce((function(t,n){return u.f[n](e,t),t}),[]))},u.u=function(e){return"assets/js/"+({53:"935f2afb",113:"e02376a2",122:"d9be502e",143:"bb881519",162:"d589d3a7",180:"f11c2978",195:"c4f5d8e4",219:"0794ba4a",281:"4539ade8",351:"534bda69",412:"f5f98f48",514:"1be78505",516:"80e86806",644:"95e8cacb",671:"0e384e19",682:"5537f8c3",772:"93231161",863:"efe2a42e",879:"dfc585ea",918:"17896441"}[e]||e)+"."+{53:"f89a2009",113:"6d8ac5b8",118:"f728f784",122:"93f8c050",143:"62fda8c4",162:"0af9b57e",180:"5ae9a3b8",195:"9b641ee3",219:"12e9a489",281:"3eeb2d0c",351:"c4be965c",412:"7ced76f9",486:"f61f8262",514:"7e34f649",516:"b78682d1",608:"9c51bee7",644:"7ff627ee",671:"2421afc7",682:"e1b48379",772:"b5ae05f4",863:"5dfe26f0",879:"fffa4b9f",918:"6f4c25cb"}[e]+".js"},u.miniCssF=function(e){return"assets/css/styles.aa6b4ed0.css"},u.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},o="docs:",u.l=function(e,t,n,f){if(r[e])r[e].push(t);else{var c,a;if(void 0!==n)for(var i=document.getElementsByTagName("script"),d=0;d<i.length;d++){var s=i[d];if(s.getAttribute("src")==e||s.getAttribute("data-webpack")==o+n){c=s;break}}c||(a=!0,(c=document.createElement("script")).charset="utf-8",c.timeout=120,u.nc&&c.setAttribute("nonce",u.nc),c.setAttribute("data-webpack",o+n),c.src=e),r[e]=[t];var l=function(t,n){c.onerror=c.onload=null,clearTimeout(b);var o=r[e];if(delete r[e],c.parentNode&&c.parentNode.removeChild(c),o&&o.forEach((function(e){return e(n)})),t)return t(n)},b=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),a&&document.head.appendChild(c)}},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.p="/",u.gca=function(e){return e={17896441:"918",93231161:"772","935f2afb":"53",e02376a2:"113",d9be502e:"122",bb881519:"143",d589d3a7:"162",f11c2978:"180",c4f5d8e4:"195","0794ba4a":"219","4539ade8":"281","534bda69":"351",f5f98f48:"412","1be78505":"514","80e86806":"516","95e8cacb":"644","0e384e19":"671","5537f8c3":"682",efe2a42e:"863",dfc585ea:"879"}[e]||e,u.p+u.u(e)},function(){var e={303:0,532:0};u.f.j=function(t,n){var r=u.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else if(/^(303|532)$/.test(t))e[t]=0;else{var o=new Promise((function(n,o){r=e[t]=[n,o]}));n.push(r[2]=o);var f=u.p+u.u(t),c=new Error;u.l(f,(function(n){if(u.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),f=n&&n.target&&n.target.src;c.message="Loading chunk "+t+" failed.\n("+o+": "+f+")",c.name="ChunkLoadError",c.type=o,c.request=f,r[1](c)}}),"chunk-"+t,t)}},u.O.j=function(t){return 0===e[t]};var t=function(t,n){var r,o,f=n[0],c=n[1],a=n[2],i=0;if(f.some((function(t){return 0!==e[t]}))){for(r in c)u.o(c,r)&&(u.m[r]=c[r]);if(a)var d=a(u)}for(t&&t(n);i<f.length;i++)o=f[i],u.o(e,o)&&e[o]&&e[o][0](),e[f[i]]=0;return u.O(d)},n=self.webpackChunkdocs=self.webpackChunkdocs||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}()}(); \ No newline at end of file diff --git a/assets/js/runtime~main.51dd2df4.js b/assets/js/runtime~main.51dd2df4.js new file mode 100644 index 0000000..ccec158 --- /dev/null +++ b/assets/js/runtime~main.51dd2df4.js @@ -0,0 +1 @@ +(()=>{"use strict";var e,t,r,a,o,c={},n={};function f(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return c[e].call(r.exports,r,r.exports,f),r.exports}f.m=c,e=[],f.O=(t,r,a,o)=>{if(!r){var c=1/0;for(i=0;i<e.length;i++){r=e[i][0],a=e[i][1],o=e[i][2];for(var n=!0,d=0;d<r.length;d++)(!1&o||c>=o)&&Object.keys(f.O).every((e=>f.O[e](r[d])))?r.splice(d--,1):(n=!1,o<c&&(c=o));if(n){e.splice(i--,1);var b=a();void 0!==b&&(t=b)}}return t}o=o||0;for(var i=e.length;i>0&&e[i-1][2]>o;i--)e[i]=e[i-1];e[i]=[r,a,o]},f.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return f.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,f.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var o=Object.create(null);f.r(o);var c={};t=t||[null,r({}),r([]),r(r)];for(var n=2&a&&e;"object"==typeof n&&!~t.indexOf(n);n=r(n))Object.getOwnPropertyNames(n).forEach((t=>c[t]=()=>e[t]));return c.default=()=>e,f.d(o,c),o},f.d=(e,t)=>{for(var r in t)f.o(t,r)&&!f.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},f.f={},f.e=e=>Promise.all(Object.keys(f.f).reduce(((t,r)=>(f.f[r](e,t),t)),[])),f.u=e=>"assets/js/"+({36:"6ea2c7a4",48:"a94703ab",98:"a7bd4aaa",235:"a7456010",340:"0bf034db",386:"b81faf1d",401:"17896441",450:"576b222c",476:"62eacfe5",510:"2463bfee",534:"b96361c1",603:"373758dc",608:"9187e980",634:"c4f5d8e4",647:"5e95c892",742:"aba21aa0",756:"ac3a7c63",812:"421473c5",857:"3021cf83",877:"7c110bd0",884:"4a782de2",902:"ddcb1508",903:"f8409a7e",968:"518c7f92"}[e]||e)+"."+{36:"8b876353",48:"10863959",98:"fd305e17",235:"47cad1bc",237:"8f78abee",340:"9148d7dc",386:"5a973bfb",401:"48abe667",450:"a25e306a",476:"8cd05dc4",510:"8defd41d",534:"805f062a",603:"c365ca98",608:"2ca26c7f",634:"f045fc1b",647:"b8ccf983",742:"eb7bf6f2",756:"4d1744c5",812:"c80d0eba",857:"126e009e",877:"3c7fba26",884:"d6dc3ce6",902:"c5f25f84",903:"c9bb6b16",968:"31849ffd"}[e]+".js",f.miniCssF=e=>{},f.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),f.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},o="docs:",f.l=(e,t,r,c)=>{if(a[e])a[e].push(t);else{var n,d;if(void 0!==r)for(var b=document.getElementsByTagName("script"),i=0;i<b.length;i++){var u=b[i];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==o+r){n=u;break}}n||(d=!0,(n=document.createElement("script")).charset="utf-8",n.timeout=120,f.nc&&n.setAttribute("nonce",f.nc),n.setAttribute("data-webpack",o+r),n.src=e),a[e]=[t];var l=(t,r)=>{n.onerror=n.onload=null,clearTimeout(s);var o=a[e];if(delete a[e],n.parentNode&&n.parentNode.removeChild(n),o&&o.forEach((e=>e(r))),t)return t(r)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:n}),12e4);n.onerror=l.bind(null,n.onerror),n.onload=l.bind(null,n.onload),d&&document.head.appendChild(n)}},f.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.p="/",f.gca=function(e){return e={17896441:"401","6ea2c7a4":"36",a94703ab:"48",a7bd4aaa:"98",a7456010:"235","0bf034db":"340",b81faf1d:"386","576b222c":"450","62eacfe5":"476","2463bfee":"510",b96361c1:"534","373758dc":"603","9187e980":"608",c4f5d8e4:"634","5e95c892":"647",aba21aa0:"742",ac3a7c63:"756","421473c5":"812","3021cf83":"857","7c110bd0":"877","4a782de2":"884",ddcb1508:"902",f8409a7e:"903","518c7f92":"968"}[e]||e,f.p+f.u(e)},(()=>{var e={354:0,869:0};f.f.j=(t,r)=>{var a=f.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else if(/^(354|869)$/.test(t))e[t]=0;else{var o=new Promise(((r,o)=>a=e[t]=[r,o]));r.push(a[2]=o);var c=f.p+f.u(t),n=new Error;f.l(c,(r=>{if(f.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var o=r&&("load"===r.type?"missing":r.type),c=r&&r.target&&r.target.src;n.message="Loading chunk "+t+" failed.\n("+o+": "+c+")",n.name="ChunkLoadError",n.type=o,n.request=c,a[1](n)}}),"chunk-"+t,t)}},f.O.j=t=>0===e[t];var t=(t,r)=>{var a,o,c=r[0],n=r[1],d=r[2],b=0;if(c.some((t=>0!==e[t]))){for(a in n)f.o(n,a)&&(f.m[a]=n[a]);if(d)var i=d(f)}for(t&&t(r);b<c.length;b++)o=c[b],f.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return f.O(i)},r=self.webpackChunkdocs=self.webpackChunkdocs||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})()})(); \ No newline at end of file diff --git a/blog/atom.xml b/blog/atom.xml deleted file mode 100644 index 12074c4..0000000 --- a/blog/atom.xml +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<feed xmlns="http://www.w3.org/2005/Atom"> - <id>https://botrino.alex1304.com/blog</id> - <title>Botrino Blog - 2015-10-25T23:29:00.000Z - https://github.com/jpmonette/feed - - Botrino Blog - https://botrino.alex1304.com/img/favicon.ico - \ No newline at end of file diff --git a/blog/rss.xml b/blog/rss.xml deleted file mode 100644 index 02f0523..0000000 --- a/blog/rss.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - Botrino Blog - https://botrino.alex1304.com/blog - Botrino Blog - Sun, 25 Oct 2015 23:29:00 GMT - https://validator.w3.org/feed/docs/rss2.html - https://github.com/jpmonette/feed - - \ No newline at end of file diff --git a/docs/api/configuring-your-bot/index.html b/docs/api/configuring-your-bot/index.html index b3124cd..6080327 100644 --- a/docs/api/configuring-your-bot/index.html +++ b/docs/api/configuring-your-bot/index.html @@ -1,45 +1,87 @@ - + - - - - - + +Configuring your bot | Botrino -Configuring your bot | Botrino - - + + + - -
-

Configuring your bot

Standardizing the way to configure a bot is one of the primary goals of Botrino. This section will cover the configuration part more in detail, how to access the values of the configuration file in your code, and how to add your own configuration entries for your application.

The configuration JSON#

The configuration is a JSON object, by default located in a config.json in the runtime directory, each field at the root of the object corresponds to one entry and maps to one class in the Java code.

The ConfigContainer#

In order to access the values of the configuration in the Java code, Botrino exposes the object ConfigContainer as a service that you can inject in your own code. An example below:

package com.example.myproject;
-
import botrino.api.config.ConfigContainer;
import botrino.api.config.object.BotConfig;
import com.github.alex1304.rdi.finder.annotation.RdiFactory;
import com.github.alex1304.rdi.finder.annotation.RdiService;
-
@RdiService
public final class SomeService {
-
private final BotConfig botConfig;
-
@RdiFactory
public SomeService(ConfigContainer configContainer) {
this.botConfig = configContainer.get(BotConfig.class);
}
}

The ConfigContainer#get(Class) method is what allows you to access the entries of the JSON config inside your code.

Built-in configuration entries#

Botrino comes with a few configuration entries by default. Here is the list of them below for reference.

The bot entry#

This entry is where you input the bot information (token, presence, intents, etc).

JSON structure for bot:

FieldTypeDescriptionRequired?
tokenstringthe token of the bot, generated in the Discord Developer portalYes
presenceobjectthe presence of the bot in DiscordNo, defaults to {"status":"online"}
enabled_intentsintegerthe Gateway Intents to enableNo, defaults to 32509 (all non-privileged intents)

JSON structure for presence:

FieldTypeDescriptionRequired?
statusstringone of "online", "idle", "do_not_disturb", "invisible"No, defaults to "online"
activity_typestringone of "playing", "watching", "listening", "streaming"No
activity_textstringthe text to display in the presence activity of the botNo
streaming_urlstringthe streaming URL, only applicable if "streaming" is set as activity_textNo, defaults to http://127.0.0.1

Example:

{
"bot": {
"token": "yourTokenHere",
"presence": {
"status": "online",
"activity_type": "playing",
"activity_text": "Hello world!"
},
"enabled_intents": 32509
}
}

The corresponding class in the Java code is botrino.api.config.object.BotConfig, accessed via ConfigContainer.get(BotConfig.class).

Adding your own configuration entries#

The configuration JSON can of course be extended with more entries to include your own parameters.

Creating the configuration object#

First step is to create a POJO like this:

package com.example.myproject;
-
import botrino.api.annotation.ConfigEntry;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
@JsonDeserialize
@ConfigEntry("my_config")
public final class MyConfig {
-
private String myProperty;
private long myValue;
-
public String getMyProperty() {
return myProperty;
}
-
@JsonProperty("my_property")
public void setMyProperty(String myProperty) {
this.myProperty = myProperty;
}
-
public long getMyValue() {
return myValue;
}
-
@JsonProperty("my_value")
public void setMyValue(long myValue) {
this.myValue = myValue;
}
}
  • The @JsonDeserialize annotation is to indicate that this class is intended for being constructed from a JSON input, processed by the Jackson library.
  • The @ConfigEntry annotation allows Botrino to recognize it as a configuration object to be registered in the ConfigContainer, and to indicate the name of the field in the configuration file.

Adding the entry in the JSON file#

Once you've created the object, you can add the following in your config.json:

{
"bot": {
...
},
"i18n": {
...
},
"my_config": {
"my_property": "hello!!!",
"my_value": 42
}
}
info

The name of the root field in the JSON must match with the name given in the @ConfigEntry annotation.

Using the configuration object#

To test this, we can create a sample service injecting the ConfigContainer:

package com.example.myproject;
-
import botrino.api.config.ConfigContainer;
import com.github.alex1304.rdi.finder.annotation.RdiFactory;
import com.github.alex1304.rdi.finder.annotation.RdiService;
import reactor.util.Logger;
import reactor.util.Loggers;
-
@RdiService
public final class SampleService {
-
private static final Logger LOGGER = Loggers.getLogger(SampleService.class);
-
@RdiFactory
public SampleService(ConfigContainer configContainer) {
var myConfig = configContainer.get(MyConfig.class);
LOGGER.info("My property = {}, my value = {}", myConfig.getMyProperty(), myConfig.getMyValue());
}
}

When running, it should give the following output:

00:16:42.193 [main] DEBUG botrino.api.Botrino - Discovered config entry com.example.myproject.MyConfig
00:16:42.468 [main] INFO com.example.myproject.SampleService - My property = hello!!!, my value = 42

Customizing the JSON source#

It is possible to override the behavior of Botrino when loading the configuration by implementing the ConfigReader interface. This interface has two methods, none of them are required to be implemented:

  • String loadConfigJson(Path botDirectory) throws IOException: Allows to customize the way the configuration file is loaded. It is useful if you want to load the configuration from a file that is located at a different path or that has a different name than "config.json". You can even ignore the botDirectory parameter and load the JSON from a different source, or directly return a hard-coded JSON string for testing purposes for example. Note that this method throws IOException and that the return type is not reactive: indeed, this method is ran by Botrino on the main thread at the very start of the program, as such it does not need to be (and shouldn't be) asynchronous. This method is not required to be implemented: it has a default implementation that will simply read the JSON string from a file named config.json at the root of botDirectory.
  • ObjectMapper createConfigObjectMapper(): Allows to customize the Jackson ObjectMapper instance used to parse the JSON string. You can for example register extra modules and deserializers. This method is not required to be implemented: by default it will create an ObjectMapper with only the Jdk8Module registered (allows to recognize types such as java.util.Optional).

If no ConfigReader implementation is found in your module, it will use a default one which can be recreated like this:

package com.example.myproject;
-
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
import reactor.core.publisher.Mono;
-
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
-
public final class DefaultConfigReader implements ConfigReader {
-
@Override
public String loadConfigJson(Path botDirectory) throws IOException {
return Files.readString(botDirectory.resolve("config.json"));
}
-
@Override
public ObjectMapper createConfigObjectMapper() {
return new ObjectMapper().registerModule(new Jdk8Module());
}
}
caution
  • The implementation class must have a no-arg constructor.
  • If more than one implementation of ConfigReader are found, it will result in an error as it is impossible to determine which one to use. If you don't want to remove the extra implementation(s), you can mark one of them with the @Primary annotation to lift the ambiguity. You may alternatively use the @Exclude annotation if you don't want one implementation to be picked up by Botrino.
- - + +

Configuring your bot

Standardizing the way to configure a bot is one of the primary goals of Botrino. This section will cover the +configuration part more in detail, how to access the values of the configuration file in your code, and how to add your +own configuration entries for your application.

+

The configuration JSON​

+

The configuration is a JSON object, by default located in a config.json in the runtime directory, each field at the +root of the object corresponds to one entry and maps to one class in the Java code.

+

The ConfigContainer​

+

In order to access the values of the configuration in the Java code, Botrino exposes the object ConfigContainer as a +service that you can inject in your own code. An example below:

+
package com.example.myproject;

import botrino.api.config.ConfigContainer;
import botrino.api.config.object.BotConfig;
import com.github.alex1304.rdi.finder.annotation.RdiFactory;
import com.github.alex1304.rdi.finder.annotation.RdiService;

@RdiService
public final class SomeService {

private final BotConfig botConfig;

@RdiFactory
public SomeService(ConfigContainer configContainer) {
this.botConfig = configContainer.get(BotConfig.class);
}
}
+

The ConfigContainer#get(Class) method is what allows you to access the entries of the JSON config inside your code.

+

Built-in configuration entries​

+

Botrino comes with a few configuration entries by default. Here is the list of them below for reference.

+

The bot entry​

+

This entry is where you input the bot information (token, presence, intents, etc).

+

JSON structure for bot:

+
FieldTypeDescriptionRequired?
tokenstringthe token of the bot, generated in the Discord Developer portalYes
presenceobjectthe presence of the bot in DiscordNo, defaults to {"status":"online"}
enabled_intentsintegerthe Gateway Intents to enableNo, defaults to 32509 (all non-privileged intents)
+

JSON structure for presence:

+
FieldTypeDescriptionRequired?
statusstringone of "online", "idle", "do_not_disturb", "invisible"No, defaults to "online"
activity_typestringone of "playing", "watching", "listening", "streaming"No
activity_textstringthe text to display in the presence activity of the botNo
streaming_urlstringthe streaming URL, only applicable if "streaming" is set as activity_textNo, defaults to http://127.0.0.1
+

Example:

+
{
"bot": {
"token": "yourTokenHere",
"presence": {
"status": "online",
"activity_type": "playing",
"activity_text": "Hello world!"
},
"enabled_intents": 32509
}
}
+

The corresponding class in the Java code is botrino.api.config.object.BotConfig, accessed +via ConfigContainer.get(BotConfig.class).

+

Adding your own configuration entries​

+

The configuration JSON can of course be extended with more entries to include your own parameters.

+

Creating the configuration object​

+

First step is to create a POJO like this:

+
package com.example.myproject;

import botrino.api.annotation.ConfigEntry;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

@JsonDeserialize
@ConfigEntry("my_config")
public final class MyConfig {

private String myProperty;
private long myValue;

public String getMyProperty() {
return myProperty;
}

@JsonProperty("my_property")
public void setMyProperty(String myProperty) {
this.myProperty = myProperty;
}

public long getMyValue() {
return myValue;
}

@JsonProperty("my_value")
public void setMyValue(long myValue) {
this.myValue = myValue;
}
}
+
    +
  • The @JsonDeserialize annotation is to indicate that this class is intended for being constructed from a JSON input, +processed by the Jackson library.
  • +
  • The @ConfigEntry annotation allows Botrino to recognize it as a configuration object to be registered in +the ConfigContainer, and to indicate the name of the field in the configuration file.
  • +
+

Adding the entry in the JSON file​

+

Once you've created the object, you can add the following in your config.json:

+
{
"bot": {
...
},
"i18n": {
...
},
"my_config": {
"my_property": "hello!!!",
"my_value": 42
}
}
+
info

The name of the root field in the JSON must match with the name given in the @ConfigEntry annotation.

+

Using the configuration object​

+

To test this, we can create a sample service injecting the ConfigContainer:

+
package com.example.myproject;

import botrino.api.config.ConfigContainer;
import com.github.alex1304.rdi.finder.annotation.RdiFactory;
import com.github.alex1304.rdi.finder.annotation.RdiService;
import reactor.util.Logger;
import reactor.util.Loggers;

@RdiService
public final class SampleService {

private static final Logger LOGGER = Loggers.getLogger(SampleService.class);

@RdiFactory
public SampleService(ConfigContainer configContainer) {
var myConfig = configContainer.get(MyConfig.class);
LOGGER.info("My property = {}, my value = {}", myConfig.getMyProperty(), myConfig.getMyValue());
}
}
+

When running, it should give the following output:

+
00:16:42.193 [main] DEBUG botrino.api.Botrino - Discovered config entry com.example.myproject.MyConfig
00:16:42.468 [main] INFO com.example.myproject.SampleService - My property = hello!!!, my value = 42
+

Customizing the JSON source​

+

It is possible to override the behavior of Botrino when loading the configuration by implementing the ConfigReader +interface. This interface has two methods, none of them are required to be implemented:

+
    +
  • String loadConfigJson(Path botDirectory) throws IOException: Allows to customize the way the configuration file is +loaded. It is useful if you want to load the configuration from a file that is located at a different path or that has +a different name than "config.json". You can even ignore the botDirectory parameter and load the JSON from a +different source, or directly return a hard-coded JSON string for testing purposes for example. Note that this method +throws IOException and that the return type is not reactive: indeed, this method is ran by Botrino on the main +thread at the very start of the program, as such it does not need to be (and shouldn't be) asynchronous. This method +is not required to be implemented: it has a default implementation that will simply read the JSON string from a file +named config.json at the root of botDirectory.
  • +
  • ObjectMapper createConfigObjectMapper(): Allows to customize the Jackson ObjectMapper instance used to parse the +JSON string. You can for example register extra modules and deserializers. This method is not required to be +implemented: by default it will create an ObjectMapper with only the Jdk8Module registered (allows to recognize +types such as java.util.Optional).
  • +
+

If no ConfigReader implementation is found in your module, it will use a default one which can be recreated like this:

+
package com.example.myproject;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
import reactor.core.publisher.Mono;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;

public final class DefaultConfigReader implements ConfigReader {

@Override
public String loadConfigJson(Path botDirectory) throws IOException {
return Files.readString(botDirectory.resolve("config.json"));
}

@Override
public ObjectMapper createConfigObjectMapper() {
return new ObjectMapper().registerModule(new Jdk8Module());
}
}
+
caution
    +
  • The implementation class must have a no-arg constructor.
  • +
  • If more than one implementation of ConfigReader are found, it will result in an error as it is impossible to +determine which one to use. If you don't want to remove the extra implementation(s), you can mark one of them with +the @Primary annotation to lift the ambiguity. You may alternatively use the @Exclude annotation if you don't want +one implementation to be picked up by Botrino.
  • +
\ No newline at end of file diff --git a/docs/api/customizing-the-discord-client/index.html b/docs/api/customizing-the-discord-client/index.html index 833306e..f540ab8 100644 --- a/docs/api/customizing-the-discord-client/index.html +++ b/docs/api/customizing-the-discord-client/index.html @@ -1,28 +1,34 @@ - + - - - - - + +Customizing the Discord client | Botrino -Customizing the Discord client | Botrino - - + + + - -
-

Customizing the Discord client

When you start a project with Botrino, the Discord client is constructed for you, so you don't have anything to do in order to run the bot. However, in most cases, you will want to take full control on how the Discord client is created. This section will show you how to fully customize the Discord client and the gateway login process.

The LoginHandler interface#

All you need to do is to provide one implementation of the LoginHandler interface. It defines one method, Mono<GatewayDiscordClient> login(ConfigContainer configContainer), that you can override to define yourself how your bot connects to the Discord gateway. The default implementation of this method builds the Discord client with default settings, using the token, presence status, and intents from the configuration. It can be recreated like this:

package com.example.myproject;
-
import botrino.api.config.object.BotConfig;
import discord4j.core.DiscordClient;
import discord4j.core.GatewayDiscordClient;
import discord4j.core.object.presence.Presence;
import discord4j.core.shard.MemberRequestFilter;
import discord4j.gateway.intent.IntentSet;
import reactor.core.publisher.Mono;
-
public final class DefaultLoginHandler implements LoginHandler {
-
@Override
public Mono<GatewayDiscordClient> login(ConfigContainer configContainer) {
var config = configContainer.get(BotConfig.class);
var discordClient = DiscordClient.create(config.token());
return discordClient.gateway()
.setInitialStatus(shard -> config.presence()
.map(BotConfig.StatusConfig::toStatusUpdate)
.orElseGet(Presence::online))
.setEnabledIntents(config.enabledIntents().stream().boxed()
.map(IntentSet::of)
.findAny()
.orElseGet(IntentSet::nonPrivileged))
.setMemberRequestFilter(MemberRequestFilter.none())
.login()
.single();
}
}
caution
  • The implementation class must have a no-arg constructor.
  • If more than one implementation of LoginHandler are found, it will result in an error as it is impossible to determine which one to use. If you don't want to remove the extra implementation(s), you can mark one of them with the @Primary annotation to lift the ambiguity. You may alternatively use the @Exclude annotation if you don't want one implementation to be picked up by Botrino.
- - + +

Customizing the Discord client

When you start a project with Botrino, the Discord client is constructed for you, so you don't have anything to do in +order to run the bot. However, in most cases, you will want to take full control on how the Discord client is created. +This section will show you how to fully customize the Discord client and the gateway login process.

+

The LoginHandler interface​

+

All you need to do is to provide one implementation of the LoginHandler interface. It defines one +method, Mono<GatewayDiscordClient> login(ConfigContainer configContainer), that you can override to define yourself +how your bot connects to the Discord gateway. The default implementation of this method builds the Discord client with +default settings, using the token, presence status, and intents from the configuration. It can be recreated like this:

+
package com.example.myproject;

import botrino.api.config.object.BotConfig;
import discord4j.core.DiscordClient;
import discord4j.core.GatewayDiscordClient;
import discord4j.core.object.presence.Presence;
import discord4j.core.shard.MemberRequestFilter;
import discord4j.gateway.intent.IntentSet;
import reactor.core.publisher.Mono;

public final class DefaultLoginHandler implements LoginHandler {

@Override
public Mono<GatewayDiscordClient> login(ConfigContainer configContainer) {
var config = configContainer.get(BotConfig.class);
var discordClient = DiscordClient.create(config.token());
return discordClient.gateway()
.setInitialStatus(shard -> config.presence()
.map(BotConfig.StatusConfig::toStatusUpdate)
.orElseGet(Presence::online))
.setEnabledIntents(config.enabledIntents().stream().boxed()
.map(IntentSet::of)
.findAny()
.orElseGet(IntentSet::nonPrivileged))
.setMemberRequestFilter(MemberRequestFilter.none())
.login()
.single();
}
}
+
caution
    +
  • The implementation class must have a no-arg constructor.
  • +
  • If more than one implementation of LoginHandler are found, it will result in an error as it is impossible to +determine which one to use. If you don't want to remove the extra implementation(s), you can mark one of them with +the @Primary annotation to lift the ambiguity. You may alternatively use the @Exclude annotation if you don't want +one implementation to be picked up by Botrino.
  • +
\ No newline at end of file diff --git a/docs/api/extensions/index.html b/docs/api/extensions/index.html index 13f4dc1..1a7d870 100644 --- a/docs/api/extensions/index.html +++ b/docs/api/extensions/index.html @@ -1,35 +1,89 @@ - + - - - - - + +Extensions | Botrino -Extensions | Botrino - - + + + - -
-

Extensions

When you start your application, Botrino automatically loads all the classes present in bot modules. According to the type of classes that are discovered, an action will be performed on them such as registering a service or adding a configuration entry. Extensions allow you to hook into this module scanning process to add your own logic when classes are loaded.

Declaring an extension#

Unlike other components of the framework, extensions do not need to reside in a module annotated with @BotModule. Think of extensions like plugins for the framework itself and not for your bot application directly. Your module does not need to be open either, extensions are loaded via java.util.ServiceLoader.

The first step is to create a class implementing the BotrinoExtension interface:

package com.example.myproject;
-
import botrino.api.extension.BotrinoExtension;
import com.github.alex1304.rdi.config.ServiceDescriptor;
import reactor.core.publisher.Mono;
-
import java.util.Set;
-
public final class MyExtension implements BotrinoExtension {
-
@Override
public void onClassDiscovered(Class<?> clazz) {
// ...
}
-
@Override
public void onServiceCreated(Object o) {
// ...
}
-
@Override
public Set<ServiceDescriptor> provideExtraServices() {
// ...
}
-
@Override
public Set<Class<?>> provideExtraDiscoverableClasses() {
// ...
}
-
@Override
public Mono<Void> finishAndJoin() {
// ...
}
}

Before going into the details of the methods to implement, let's register this class as a provider for BotrinoExtension. This is done via the module-info.java:

import botrino.api.extension.BotrinoExtension;
import com.example.extension.MyExtension;
-
module com.example.extension {
-
requires botrino.api;
provides BotrinoExtension with MyExtension;
}
info

You don't have to create a separate module just for your extension. It is totally fine to add the provides directive directly in your @BotModule, this example just shows that you are not required to.

Implementing an extension#

Let's review each of the methods of BotrinoExtension to implement.

void onClassDiscovered(Class<?> clazz)#

This is a callback method invoked each time a class is discovered in a bot module. In most cases, you will check if this class implements a specific interface or is annotated with a specific annotation, and do some processing when it is relevant to do so.

caution

If you intend to create an instance of the class, it is highly recommended to skip classes annotated with @RdiService from this method, as they are supposed to be instantiated by the RDI container. That's why the onServiceCreated(Object) method exists.

void onServiceCreated(Object o)#

This is a callback method invoked each time a service is created. It allows to execute some action on the service object right after it's created.

info

As this method returns void, it is not suited for performing reactive tasks. Instead, store the service object in a field and perform this task in finishAndJoin().

Set<ServiceDescriptor> provideExtraServices()#

Even though the extension may not be inside a bot module, it is still possible to register services that will be exposed to the bot application. You can do so via this method, allowing you to provide a set of RDI service descriptors. This method is only useful if you want to provide complex services that require writing raw descriptors (for example registering a class from a third-party library as a service with a custom name). For simple services maintained by yourself, you can use RDI annotations and make the annotated class discoverable via provideExtraDiscoverableClasses() instead of doing it via this method.

Set<Class<?>> provideExtraDiscoverableClasses()#

With this method you can explicitly specify a set of classes that Botrino will pick up just like if they were inside a bot module. It is guaranteed that each class contained in the set will eventually be passed to the onClassDiscovered(Class) method (unless they have the @Exclude annotation). As said earlier, it can be used as an alternative way to provide extra services, if the class contained in the set is annotated with RDI annotations. It can also be used to register new configuration entries, or new things you're defining yourself in your own extension!

Mono<Void> finishAndJoin()#

This is the last method that is invoked during the startup sequence. It allows you to perform a task, possibly reactive, based on the classes and objects you were able to collect via previous invocations of onClassDiscovered(Class) and onServiceCreated(Object). The "join" part of this method's name indicates the fact that the returned reactive sequence does not need to be a finite source: you can use it to start processes living during the entire lifetime of the application, for example installing event listeners or starting a web server. The subscription to the returned Mono is automatically cancelled once the bot disconnects, allowing the application to shut down properly.

warning

If an exception is thrown or an error is emitted via the Mono from this method, the exception will propagate to the main thread, which will result in the bot to forcefully disconnect and the application to be terminated.

A concrete example: the interaction library#

The interaction library of Botrino provides an implementation of BotrinoExtension, which is in charge of collecting the classes implementing XxxInteractionListener, InteractionErrorHandler, InteractionEventProcessor and so on, in order to register them in the InteractionService. It also exposes a new entry in config.json that allows to construct the configuration object.

You can check the source code of the extension class of the interaction library on GitHub here. A few things to note to understand the code:

  • Classes with the @RdiService annotation are ignored, since we want to use the instance created by RDI in case XxxInteractionListener, InteractionErrorHandler and InteractionEventProcessor are declared as services.
  • An InstanceCache is used so that the same instance can be reused in case a class implements more than one interface.
  • InteractionService utilizes RDI annotations, so we provide it via provideExtraDiscoverableClasses() and not provideExtraServices().
  • All implementations that were found are finally registered in the finishAndJoin() method, which runs the interaction service at the end.
- - + +

Extensions

When you start your application, Botrino automatically loads all the classes present in bot modules. According to the +type of classes that are discovered, an action will be performed on them such as registering a service or adding a +configuration entry. Extensions allow you to hook into this module scanning process to add your own logic when classes +are loaded.

+

Declaring an extension​

+

Unlike other components of the framework, extensions do not need to reside in a module annotated with @BotModule. +Think of extensions like plugins for the framework itself and not for your bot application directly. Your module does +not need to be open either, extensions are loaded +via java.util.ServiceLoader.

+

The first step is to create a class implementing the BotrinoExtension interface:

+
package com.example.myproject;

import botrino.api.extension.BotrinoExtension;
import com.github.alex1304.rdi.config.ServiceDescriptor;
import reactor.core.publisher.Mono;

import java.util.Set;

public final class MyExtension implements BotrinoExtension {

@Override
public void onClassDiscovered(Class<?> clazz) {
// ...
}

@Override
public void onServiceCreated(Object o) {
// ...
}

@Override
public Set<ServiceDescriptor> provideExtraServices() {
// ...
}

@Override
public Set<Class<?>> provideExtraDiscoverableClasses() {
// ...
}

@Override
public Mono<Void> finishAndJoin() {
// ...
}
}
+

Before going into the details of the methods to implement, let's register this class as a provider +for BotrinoExtension. This is done via the module-info.java:

+
import botrino.api.extension.BotrinoExtension;
import com.example.extension.MyExtension;

module com.example.extension {

requires botrino.api;
provides BotrinoExtension with MyExtension;
}
+
info

You don't have to create a separate module just for your extension. It is totally fine to add the provides directive +directly in your @BotModule, this example just shows that you are not required to.

+

Implementing an extension​

+

Let's review each of the methods of BotrinoExtension to implement.

+

void onClassDiscovered(Class<?> clazz)​

+

This is a callback method invoked each time a class is discovered in a bot module. In most cases, you will check if this +class implements a specific interface or is annotated with a specific annotation, and do some processing when it is +relevant to do so.

+
caution

If you intend to create an instance of the class, it is highly recommended to skip classes annotated with @RdiService +from this method, as they are supposed to be instantiated by the RDI container. That's why +the onServiceCreated(Object) method exists.

+

void onServiceCreated(Object o)​

+

This is a callback method invoked each time a service is created. It allows to execute some action on the service object +right after it's created.

+
info

As this method returns void, it is not suited for performing reactive tasks. Instead, store the service object in a +field and perform this task in finishAndJoin().

+

Set<ServiceDescriptor> provideExtraServices()​

+

Even though the extension may not be inside a bot module, it is still possible to register services that will be exposed +to the bot application. You can do so via this method, allowing you to provide a set +of RDI service descriptors. This method is only useful if you +want to provide complex services that require writing raw descriptors (for example registering a class from a +third-party library as a service with a custom name). For simple services maintained by yourself, you can use RDI +annotations and make the annotated class discoverable via provideExtraDiscoverableClasses() instead of doing it via +this method.

+

Set<Class<?>> provideExtraDiscoverableClasses()​

+

With this method you can explicitly specify a set of classes that Botrino will pick up just like if they were inside a +bot module. It is guaranteed that each class contained in the set will eventually be passed to +the onClassDiscovered(Class) method (unless they have the @Exclude annotation). As said earlier, it can be used as +an alternative way to provide extra services, if the class contained in the set is annotated with RDI annotations. It +can also be used to register new configuration entries, or new things you're defining yourself in your own extension!

+

Mono<Void> finishAndJoin()​

+

This is the last method that is invoked during the startup sequence. It allows you to perform a task, possibly reactive, +based on the classes and objects you were able to collect via previous invocations of onClassDiscovered(Class) +and onServiceCreated(Object). The "join" part of this method's name indicates the fact that the returned reactive +sequence does not need to be a finite source: you can use it to start processes living during the entire lifetime of the +application, for example installing event listeners or starting a web server. The subscription to the returned Mono is +automatically cancelled once the bot disconnects, allowing the application to shut down properly.

+
warning

If an exception is thrown or an error is emitted via the Mono from this method, the exception will propagate to the +main thread, which will result in the bot to forcefully disconnect and the application to be terminated.

+

A concrete example: the interaction library​

+

The interaction library of Botrino provides an implementation +of BotrinoExtension, which is in charge of collecting the classes +implementing XxxInteractionListener, InteractionErrorHandler, InteractionEventProcessor and so on, in order to +register them in the InteractionService. It also exposes a new entry in config.json that allows to construct +the configuration object.

+

You can check the source code of the extension class of the interaction library on +GitHub here. +A few things to note to understand the code:

+
    +
  • Classes with the @RdiService annotation are ignored, since we want to use the instance created by RDI in +case XxxInteractionListener, InteractionErrorHandler and InteractionEventProcessor are declared as services.
  • +
  • An InstanceCache is used so that the same instance can be reused in case a class implements more than one interface.
  • +
  • InteractionService utilizes RDI annotations, so we provide it via provideExtraDiscoverableClasses() and +not provideExtraServices().
  • +
  • All implementations that were found are finally registered in the finishAndJoin() method, which runs the interaction +service at the end.
  • +
\ No newline at end of file diff --git a/docs/api/i18n/index.html b/docs/api/i18n/index.html index 1948ee5..5c64d2a 100644 --- a/docs/api/i18n/index.html +++ b/docs/api/i18n/index.html @@ -1,25 +1,62 @@ - + - - - - - + +Internationalization | Botrino -Internationalization | Botrino - - + + + - -
-

Internationalization

The bot you are developing is likely to be used by people which primary language is not English. To support these users, Botrino encourages the externalization of strings so they can be translated more conveniently.

The Translator interface#

The Translator interface has one abstract method Locale getLocale() which defines what is the target locale of the translator, and a default method String translate(String, String, Object...) which effectively does the translation. By default, the translate method does the following:

default String translate(String bundle, String key, Object... args) {
return MessageFormat.format(ResourceBundle.getBundle(bundle, getLocale()).getString(key), args);
}
  • Strings are located in a ResourceBundle which name is given. Typically, that's the name of a .properties file located at the root of the resources folder.
  • Strings are parameterized using MessageFormat, which aims at being a language-independent way to put variables in a string, unlike String.format().

Externalizing strings#

If let's say you have a file named AppStrings.properties in src/main/resources with the following contents:

hello=Hello {0}!

You can use a translator like this:

var tr = Translator.to(Locale.ENGLISH);
System.out.println(tr.translate("AppStrings", "hello", "Alex"));

Which gives the output:

Hello Alex!

What happened here?

  • The first argument of tr.translate is AppStrings, so it will look for a ResourceBundle named AppStrings. It will find the AppStrings.properties and will load its content.
  • The second argument says to find the string with key hello, which is what we defined earlier.
  • The third argument will substitute the {0} of our string with the value at runtime, here Alex.
info

To learn more about resource bundles and string argument formatting, check out the Javadoc for ResourceBundle and MessageFormat. Note that since Translator.translate is a default interface method and thus can be overriden, you may customize the way translations are retrieved, but this section will only document the default behavior.

Using translated strings#

Once a string is properly externalized, it is possible to add a translation for it by duplicating the resource file and naming it with the locale suffix. For example, if you have src/main/resources/AppStrings.properties and want to translate it in French, you will duplicate the file and name the copy src/main/resources/AppStrings_fr.properties. The way to name the translated files is documented in the ResourceBundle javadoc.

In your AppStrings_fr.properties, you will translate the value of the hello string:

hello=Bonjour {0} !

In your Java code, you can now specify either English or French locale and the string will adapt automatically:

var tr1 = Translator.to(Locale.ENGLISH);
var tr2 = Translator.to(Locale.FRENCH);
System.out.println(tr1.translate("AppStrings", "hello", "Alex"));
System.out.println(tr2.translate("AppStrings", "hello", "Alex")); // notice we use exact same arguments

Which gives the output you want:

Hello Alex!
Bonjour Alex !
- - + +

Internationalization

The bot you are developing is likely to be used by people which primary language is not English. To support these users, +Botrino encourages the externalization of strings so they can be translated more conveniently.

+

The Translator interface​

+

The Translator interface has one abstract method Locale getLocale() which defines what is the target locale of the +translator, and a default method String translate(String, String, Object...) which effectively does the translation. +By default, the translate method does the following:

+
default String translate(String bundle, String key, Object... args) {
return MessageFormat.format(ResourceBundle.getBundle(bundle, getLocale()).getString(key), args);
}
+
    +
  • Strings are located in a ResourceBundle which name is given. Typically, that's the name of a .properties file +located at the root of the resources folder.
  • +
  • Strings are parameterized using MessageFormat, which aims at being a language-independent way to put variables in a +string, unlike String.format().
  • +
+

Externalizing strings​

+

If let's say you have a file named AppStrings.properties in src/main/resources with the following contents:

+
hello=Hello {0}!
+

You can use a translator like this:

+
var tr = Translator.to(Locale.ENGLISH);
System.out.println(tr.translate("AppStrings", "hello", "Alex"));
+

Which gives the output:

+
Hello Alex!
+

What happened here?

+
    +
  • The first argument of tr.translate is AppStrings, so it will look for a ResourceBundle named AppStrings. It +will find the AppStrings.properties and will load its content.
  • +
  • The second argument says to find the string with key hello, which is what we defined earlier.
  • +
  • The third argument will substitute the {0} of our string with the value at runtime, here Alex.
  • +
+
info

To learn more about resource bundles and string argument formatting, check out the Javadoc +for ResourceBundle +and MessageFormat. Note +that since Translator.translate is a default interface method and thus can be overriden, you may customize the way +translations are retrieved, but this section will only document the default behavior.

+

Using translated strings​

+

Once a string is properly externalized, it is possible to add a translation for it by duplicating the resource file and +naming it with the locale suffix. For example, if you have src/main/resources/AppStrings.properties and want to +translate it in French, you will duplicate the file and name the copy src/main/resources/AppStrings_fr.properties. The +way to name the translated files is documented in +the ResourceBundle javadoc.

+

In your AppStrings_fr.properties, you will translate the value of the hello string:

+
hello=Bonjour {0} !
+

In your Java code, you can now specify either English or French locale and the string will adapt automatically:

+
var tr1 = Translator.to(Locale.ENGLISH);
var tr2 = Translator.to(Locale.FRENCH);
System.out.println(tr1.translate("AppStrings", "hello", "Alex"));
System.out.println(tr2.translate("AppStrings", "hello", "Alex")); // notice we use exact same arguments
+

Which gives the output you want:

+
Hello Alex!
Bonjour Alex !
\ No newline at end of file diff --git a/docs/api/working-with-services/index.html b/docs/api/working-with-services/index.html index 32438cd..93d63ed 100644 --- a/docs/api/working-with-services/index.html +++ b/docs/api/working-with-services/index.html @@ -1,35 +1,69 @@ - + - - - - - + +Working with services | Botrino -Working with services | Botrino - - + + + - -
-

Working with services

Services are certainly what contribute the most in making Botrino a so concise and easy to use framework. You will hopefully understand why after reading this page introducing services and showing how to use their power to their fullest extent.

What is a service?#

Services are more or less the same thing as beans in Spring. They are Java objects that are instantiated once at the start of your application, and that you can inject everywhere in your app. A service can define dependencies to other services, which are resolved when the service is created.

As such, the concept of dependency injection (DI) is also used in Botrino. Under the hood, it utilizes the RDI library which supports factories returning reactive types.

How to use services?#

Botrino will be able to find your services automatically in your app module, as long as your module is open and is annotated with @BotModule, as explained in the Getting Started guide.

Declaring a service#

For a class to be recognized as a service, you need to annotate it with @RdiService:

@RdiService
public class A {
-
}

With only this code, an instance of A will be created on startup. By default it assumes that a public no-arg constructor exists, which is the case in the code above. But there are many ways to construct a service, and that's what makes them interesting.

Injecting a service in a constructor#

Let's create another service B, which injects A in its constructor:

@RdiService
public class B {
-
@RdiFactory
public B(A a) {
// you can use A here
}
}

The @RdiFactory annotation is what indicates the method to create the service, with the possibility to inject other services in the arguments. In this scenario, the following will happen on startup:

  • Botrino will find A and B in your module, and register them as services
  • It will see that B injects A in constructor, so A needs to be created first before B can be created
  • Services are created following the dependency tree.

Injecting a service in a static factory#

The method annotated with @RdiFactory can as well be a static factory method instead of a constructor:

@RdiService
public class B {
-
private final A a;
-
private B(A a) {
this.a = a;
}
-
@RdiFactory
public static B create(A a) {
return new B(a);
}
}
caution

The return type of the static factory must be B or a subtype of B.

Injecting a service in a reactive static factory#

If you need to perform some reactive tasks in order to create your object, Botrino (in fact, RDI) allows you to return a Publisher of the service instead of the service itself:

@RdiService
public class B {
-
private final A a;
-
private B(A a) {
this.a = a;
}
-
@RdiFactory
public static Mono<B> create(A a) {
return Mono.fromCallable(() -> new B(a));
}
}

In this case, if B is injected somewhere else, it will first subscribe to the publisher returned by the static factory, and create the service only after the instance of B is emitted.

info

Check out the RDI documentation for more examples and details on how dependency injection works.

Built-in services#

GatewayDiscordClient#

Maybe you've been wondering how to access the instance of the Discord client of your bot? Well, now you have the answer: GatewayDiscordClient is registered as a service, which means you can inject it in your own services!

@RdiService
public class A {
-
@RdiFactory
public A(GatewayDiscordClient gateway) {
// you can use GatewayDiscordClient here
}
}

ConfigContainer#

To access the values of the configuration file, the service ConfigContainer is registered and you can inject it in your own services. For example, to get the bot token:

@RdiService
public class A {
-
@RdiFactory
public A(ConfigContainer configContainer) {
var botConfig = configContainer.get(BotConfig.class);
var token = botConfig.token();
}
}

We will see the ConfigContainer more in depth in the next section, Configuring your bot.

- - + +

Working with services

Services are certainly what contribute the most in making Botrino a so concise and easy to use framework. You will +hopefully understand why after reading this page introducing services and showing how to use their power to their +fullest extent.

+

What is a service?​

+

Services are more or less the same thing +as beans in Spring. They are Java +objects that are instantiated once at the start of your application, and that you can inject everywhere in your app. A +service can define dependencies to other services, which are resolved when the service is created.

+

As such, the concept of dependency injection (DI) is also used in Botrino. Under the hood, it utilizes +the RDI library which supports factories returning reactive types.

+

How to use services?​

+

Botrino will be able to find your services automatically in your app module, as long as your module is open and is +annotated with @BotModule, as explained in the Getting Started guide.

+

Declaring a service​

+

For a class to be recognized as a service, you need to annotate it with @RdiService:

+
@RdiService
public class A {

}
+

With only this code, an instance of A will be created on startup. By default it assumes that a public no-arg +constructor exists, which is the case in the code above. But there are many ways to construct a service, and that's what +makes them interesting.

+

Injecting a service in a constructor​

+

Let's create another service B, which injects A in its constructor:

+
@RdiService
public class B {

@RdiFactory
public B(A a) {
// you can use A here
}
}
+

The @RdiFactory annotation is what indicates the method to create the service, with the possibility to inject other +services in the arguments. In this scenario, the following will happen on startup:

+
    +
  • Botrino will find A and B in your module, and register them as services
  • +
  • It will see that B injects A in constructor, so A needs to be created first before B can be created
  • +
  • Services are created following the dependency tree.
  • +
+

Injecting a service in a static factory​

+

The method annotated with @RdiFactory can as well be a static factory method instead of a constructor:

+
@RdiService
public class B {

private final A a;

private B(A a) {
this.a = a;
}

@RdiFactory
public static B create(A a) {
return new B(a);
}
}
+
caution

The return type of the static factory must be B or a subtype of B.

+

Injecting a service in a reactive static factory​

+

If you need to perform some reactive tasks in order to create your object, Botrino (in fact, RDI) allows you to return +a Publisher of the service instead of the service itself:

+
@RdiService
public class B {

private final A a;

private B(A a) {
this.a = a;
}

@RdiFactory
public static Mono<B> create(A a) {
return Mono.fromCallable(() -> new B(a));
}
}
+

In this case, if B is injected somewhere else, it will first subscribe to the publisher returned by the static +factory, and create the service only after the instance of B is emitted.

+
info

Check out the RDI documentation for more examples and details on how +dependency injection works.

+

Built-in services​

+

GatewayDiscordClient​

+

Maybe you've been wondering how to access the instance of the Discord client of your bot? Well, now you have the +answer: GatewayDiscordClient is registered as a service, which means you can inject it in your own services!

+
@RdiService
public class A {

@RdiFactory
public A(GatewayDiscordClient gateway) {
// you can use GatewayDiscordClient here
}
}
+

ConfigContainer​

+

To access the values of the configuration file, the service ConfigContainer is registered and you can inject it in +your own services. For example, to get the bot token:

+
@RdiService
public class A {

@RdiFactory
public A(ConfigContainer configContainer) {
var botConfig = configContainer.get(BotConfig.class);
var token = botConfig.token();
}
}
+

We will see the ConfigContainer more in depth in the next section, Configuring your bot.

\ No newline at end of file diff --git a/docs/getting-started/index.html b/docs/getting-started/index.html index a438051..3c7bd19 100644 --- a/docs/getting-started/index.html +++ b/docs/getting-started/index.html @@ -1,31 +1,149 @@ - + - - - - - + +Getting Started | Botrino -Getting Started | Botrino - - + + + - -
-

Getting Started

Prerequisites#

  • JDK 11 or above. You can download the OpenJDK here
  • Apache Maven 3, preferably the latest version available here.

This documentation assumes you have decent knowledge of the Java programming language. Being familiar with Discord4J and reactive programming is not required, although recommended. The Discord4J documentation provides great guides to get started with reactive programming and advanced Java features.

From the Maven archetype#

The recommended way to start a project with Botrino is to use the Maven archetype (replace [VERSION] with the latest version available): Maven Central

mvn archetype:generate -DarchetypeGroupId=com.alex1304.botrino -DarchetypeArtifactId=botrino-archetype -DarchetypeVersion=[VERSION]

You will be asked to enter the groupId, the artifactId, the version and the package of your project. If successful, it should generate a project with the following contents:

myproject
├── app
│   ├── pom.xml
│   └── src
│   └── main
│   ├── external-resources
│   │   ├── config.json
│   │   ├── launcher.cmd
│   │   └── logback.xml
│   ├── java
│   │   ├── com
│   │   │   └── example
│   │   │   └── myproject
│   │   │   ├── Main.java
│   │   │   ├── PingCommand.java
│   │   │   ├── SampleService.java
│   │   │   └── Strings.java
│   │   └── module-info.java
│   └── resources
│   └── AppStrings.properties
├── delivery
│   └── pom.xml
├── launcher
│   ├── pom.xml
│   └── src
│   └── main
│   └── java
│   ├── com
│   │   └── example
│   │   └── myproject
│   │   └── Launcher.java
│   └── module-info.java
└── pom.xml
  • The app/ directory corresponds to the main module of your bot application. It already contains pre-generated classes with a main method, an example command and an example service. It also shows how to externalize strings via a .properties files in the root of src/main/resources, and a class Strings containing constants to reference them. The src/main/external-resources directory contains the configuration files necessary to run the bot.
  • The delivery/ directory only contains a pom.xml that is capable of generating a runtime image of the bot application using the jlink utility, bundled with the JDK 11.
  • The launcher directory contains the module used by delivery to create a basic launcher for the runtime image.
  • The pom.xml which configures the project by importing the libraries and configuring the multi-module build.
info

The archetype will automatically include the interaction library in your project dependencies.

This project is ready to be opened in your favorite IDE (Eclipse, IntelliJ...), and you can directly jump to the Running your bot section.

From a blank project#

If you don't want the JLink runtime image, or if you want to use a build tool other than Maven, you may as well start from a blank project and import Botrino yourself. Be aware that it will require a bit more effort to set up than using the archetype.

Import the following dependency:

<dependency>
<groupId>com.alex1304.botrino</groupId>
<artifactId>botrino-api</artifactId>
<version>[VERSION]</version>
</dependency>

As usual, replace [VERSION] with the latest version available: Maven Central

Create a module-info.java annotated with @BotModule, with the open modifier and that requires the botrino.api module:

import botrino.api.annotation.BotModule;
-
@BotModule
open module com.example.myproject {
-
requires botrino.api;
}

The module transitively requires all libraries necessary to work, including Discord4J, Reactor, Netty, RDI and Jackson, so you don't need to put requires for those libraries.

caution

If you get compilation errors, remember to configure your project to use JDK 11 or above.

Finally, add a class with a main method:

package com.example.myproject;
-
import botrino.api.Botrino;
-
public final class Main {
-
public static void main(String[] args) {
Botrino.run(args);
}
}
info

If you want to include the interaction library in your project, refer to this page.

Running your bot#

During development#

When you are developing your bot, you may prefer running the bot directly in your IDE rather than package your application every time.

If you used the archetype, copy the contents of app/src/main/external-resources in a new directory on your hard drive, outside of the project workspace. If you aren't using the archetype, create a directory outside of your project and add a config.json file with the following contents (insert your bot token in the "token" field, and remove the "interaction" field if you aren't using the interaction library):

{
"bot": {
"token": "yourTokenHere",
"presence": {
"status": "online",
"activity_type": "playing",
"activity_text": "Hello world!"
},
"enabled_intents": 32509
},
"interaction": {}
}

Use the tabs below depending on whether you use Eclipse or IntelliJ. If you use another IDE, it should be similar enough so you can figure out by yourself.

  1. Open Run > Edit Configurations...

  2. If you are using the archetype, it should detect a run configuration called "Main" automatically. If so, jump to step 7, otherwise continue

  3. Click + then Application

  4. Select Java 11 (or whatever JDK 11+ you have installed)

  5. In the "Main class" field, enter the fully qualified name of the class containing the main method

  6. In the "VM options" field, copy and paste the following: --add-modules=ALL-MODULE-PATH -cp . -p $MODULE_DIR$/target/dependency:$MODULE_DIR$/target/classes

  7. In the "Working directory" field, enter the absolute path (or click the folder icon to browse) to the directory where you copied/created the configuration files earlier

  1. Click "OK" and run

In a production environment#

If you aren't using the archetype, you would need to configure yourself the packaging for the production environment, including scripts to launch the bot with the correct VM arguments, etc, just like any other Java application. If you are using the archetype, you can build the JLink runtime image with the following command:

mvn package -Dtoken=<BOT_TOKEN>

The bot token property is not required, but saves you from manually editing the json file to insert the token later on. This command will produce a .zip file found in delivery/target directory. You can unzip it in your production environment, and just run ./bin/<launcher name>. <launcher name> by default corresponds to the artifactId of your project.

info

By default, the application will be attached to the current command line window, meaning the bot would disconnect if you close the terminal. You can run the application with the --detached flag to launch the bot in the background. You can combine it with the --batch-mode flag so that it won't ask you to press a key to exit.

Adding system modules to the JLink runtime image#

If you build the bot using the JLink runtime image generated by the archetype, the runtime image will include the minimal set of Java system modules required for a Botrino application to work. If you open the parent pom.xml and find the maven-jlink-plugin configuration, you can see the following list of system modules:

<addModules>
<addModule>java.logging</addModule>
<addModule>jdk.unsupported</addModule>
<addModule>java.xml</addModule>
<addModule>java.naming</addModule>
<addModule>java.desktop</addModule>
<addModule>jdk.crypto.ec</addModule>
</addModules>

If your application needs another module from the JDK, for example java.sql, all you need to do is to edit this configuration and add more <addModule> tags.

- - + +

Getting Started

Prerequisites​

+
    +
  • JDK >= 17. You can download the OpenJDK here
  • +
  • Apache Maven >= 3.8.5, preferably the latest version available here.
  • +
+

This documentation assumes you have decent knowledge of the Java programming language. Being familiar with Discord4J and +reactive programming is not required, although recommended. The Discord4J documentation +provides great guides to get started +with reactive programming +and advanced Java features.

+

From the Maven archetype​

+

The recommended way to start a project with Botrino is to use the Maven archetype (replace [VERSION] with the latest +version +available): Maven Central

+
mvn archetype:generate -DarchetypeGroupId=com.alex1304.botrino -DarchetypeArtifactId=botrino-archetype -DarchetypeVersion=[VERSION]
+

You will be asked to enter the groupId, the artifactId, the version and the package of your project. If +successful, it should generate a project with the following contents:

+
myproject
├── app
│   ├── pom.xml
│   └── src
│   └── main
│   ├── external-resources
│   │   ├── config.json
│   │   ├── launcher.cmd
│   │   └── logback.xml
│   ├── java
│   │   ├── com
│   │   │   └── example
│   │   │   └── myproject
│   │   │   ├── Main.java
│   │   │   ├── PingCommand.java
│   │   │   ├── SampleService.java
│   │   │   └── Strings.java
│   │   └── module-info.java
│   └── resources
│   └── AppStrings.properties
├── delivery
│   └── pom.xml
├── launcher
│   ├── pom.xml
│   └── src
│   └── main
│   └── java
│   ├── com
│   │   └── example
│   │   └── myproject
│   │   └── Launcher.java
│   └── module-info.java
└── pom.xml
+
    +
  • The app/ directory corresponds to the main module of your bot application. It already contains pre-generated classes +with a main method, an example command and an example service. It also shows how to externalize strings via +a .properties files in the root of src/main/resources, and a class Strings containing constants to reference +them. The src/main/external-resources directory contains the configuration files necessary to run the bot.
  • +
  • The delivery/ directory only contains a pom.xml that is capable of generating a runtime image of the bot +application using the jlink utility, bundled with the JDK 17.
  • +
  • The launcher directory contains the module used by delivery to create a basic launcher for the runtime image.
  • +
  • The pom.xml which configures the project by importing the libraries and configuring the multi-module build.
  • +
+
info

The archetype will automatically include the interaction library in your project +dependencies.

+

This project is ready to be opened in your favorite IDE (Eclipse, IntelliJ...), and you can directly jump to +the Running your bot section.

+

From a blank project​

+

If you don't want the JLink runtime image, or if you want to use a build tool other than Maven, you may as well start +from a blank project and import Botrino yourself. Be aware that it will require a bit more effort to set up than using +the archetype.

+

Import the following dependency:

+
<dependency>
<groupId>com.alex1304.botrino</groupId>
<artifactId>botrino-api</artifactId>
<version>[VERSION]</version>
</dependency>
+

As usual, replace [VERSION] with the latest version +available: Maven Central

+

Create a module-info.java annotated with @BotModule, with the open modifier and that requires the botrino.api +module:

+
import botrino.api.annotation.BotModule;

@BotModule
open module com.example.myproject {

requires botrino.api;
}
+

The module transitively requires all libraries necessary to work, including Discord4J, Reactor, Netty, RDI and Jackson, +so you don't need to put requires for those libraries.

+
caution

If you get compilation errors, remember to configure your project to use JDK 17 or above.

+

Finally, add a class with a main method:

+
package com.example.myproject;

import botrino.api.Botrino;

public final class Main {

public static void main(String[] args) {
Botrino.run(args);
}
}
+
info

If you want to include the interaction library in your project, refer +to this page.

+

Running your bot​

+

During development​

+

When you are developing your bot, you may prefer running the bot directly in your IDE rather than package your +application every time.

+

If you used the archetype, copy the contents of app/src/main/external-resources in a new directory on your hard drive, +outside of the project workspace. If you aren't using the archetype, create a directory outside of your project and +add a config.json file with the following contents (insert your bot token in the "token" field, and remove +the "interaction" field if you aren't using the interaction library):

+
{
"bot": {
"token": "yourTokenHere",
"presence": {
"status": "online",
"activity_type": "playing",
"activity_text": "Hello world!"
},
"enabled_intents": 32509
},
"interaction": {}
}
+

Use the tabs below depending on whether you use Eclipse or IntelliJ. If you use another IDE, it should be similar enough +so you can figure out by yourself.

+
    +
  1. +

    Open Run > Edit Configurations...

    +
  2. +
  3. +

    If you are using the archetype, it should detect a run configuration called "Main" automatically. If so, jump to step +7, otherwise continue

    +
  4. +
  5. +

    Click + then Application

    +
  6. +
  7. +

    Select Java 17 (or whatever JDK 17+ you have installed)

    +
  8. +
  9. +

    In the "Main class" field, enter the fully qualified name of the class containing the main method

    +
  10. +
  11. +

    In the "VM options" field, copy and paste the +following: --add-modules=ALL-MODULE-PATH -cp . -p $MODULE_DIR$/target/dependency:$MODULE_DIR$/target/classes

    +
  12. +
  13. +

    In the "Working directory" field, enter the absolute path (or click the folder icon to browse) to the directory where +you copied/created the configuration files earlier

    +
  14. +
    +
  1. Click "OK" and run
  2. +
+

In a production environment​

+

If you aren't using the archetype, you would need to configure yourself the packaging for the production environment, +including scripts to launch the bot with the correct VM arguments, etc, just like any other Java application. If you are +using the archetype, you can build the JLink runtime image with the following command:

+
mvn package -Dtoken=<BOT_TOKEN>
+

The bot token property is not required, but saves you from manually editing the json file to insert the token later on. +This command will produce a .zip file found in delivery/target directory. You can unzip it in your production +environment, and just run ./bin/<launcher name>. <launcher name> by default corresponds to the artifactId of your +project.

+
info

By default, the application will be attached to the current command line window, meaning the bot would disconnect if you +close the terminal. You can run the application with the --detached flag to launch the bot in the background. You can +combine it with the --batch-mode flag so that it won't ask you to press a key to exit.

+ +

If you build the bot using the JLink runtime image generated by the archetype, the runtime image will include the +minimal set of Java system modules required for a Botrino application to work. If you open the parent pom.xml and find +the maven-jlink-plugin configuration, you can see the following list of system modules:

+
<addModules>
<addModule>java.logging</addModule>
<addModule>jdk.unsupported</addModule>
<addModule>java.xml</addModule>
<addModule>java.naming</addModule>
<addModule>java.desktop</addModule>
<addModule>jdk.crypto.ec</addModule>
</addModules>
+

If your application needs another module from the JDK, for example java.sql, all you need to do is to edit this +configuration and add more <addModule> tags.

\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index e8de2aa..a11b01d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,32 +1,51 @@ - + - - - - - + +Introduction | Botrino -Introduction | Botrino - - + + + - -
-

Introduction

What is Botrino?#

Botrino is a Java framework that provides guidelines and a set of tools to build Discord bots in a more convenient way. Pretty much in the same spirit as Spring Boot, it allows to easily setup standalone bot applications that are ready to run, embedding a few third-party libraries such as Jackson for JSON-based configuration, RDI for a reactive IoC container, and Discord4J for the interface with the Discord Bot API.

Motivations#

Starting the development of a Discord bot follows most of the time the same pattern: you create a project, import your favorite Discord client library, export a configuration file or an environment variable with the bot token, and design a whole structure for your commands and your logic, before you can actually start to implement them. When working with Java, this structure is even more important otherwise you may adopt bad practices and end up with a bot that is difficult to maintain.

This is how came the idea of this project: have something that can handle for you all the initial workflow of setting up a project with a solid structure, at the only cost of letting the framework choose some libraries for you, so that you can focus on what matters. Botrino is born.

It also aims at providing a library for Discord's Interaction API that integrates well with the structure of Botrino, while still being decoupled from it.

Overview#

Botrino utilizes Java modules, introduced in the JDK 9 and released in the JDK 11 as a LTS version. The classes of your application will reside in one or more modules with the following module-info.java structure:

import botrino.api.annotation.BotModule;
-
@BotModule
open module com.example.myproject {
-
requires botrino.api;
}

The annotation as well as the open modifier will allow Botrino to automatically scan through all the classes present in the module, in order to automatically register configuration entries, commands, services, etc.

Inside your module, you can create services using RDI annotations that are automatically loaded on startup:

package com.example.myproject;
-
import com.github.alex1304.rdi.finder.annotation.RdiFactory;
import com.github.alex1304.rdi.finder.annotation.RdiService;
import discord4j.core.GatewayDiscordClient;
import discord4j.core.event.domain.lifecycle.ReadyEvent;
import reactor.core.publisher.Mono;
import reactor.util.Logger;
import reactor.util.Loggers;
-
@RdiService
public final class SampleService {
-
private static final Logger LOGGER = Loggers.getLogger(SampleService.class);
-
// We can inject other services, here we are injecting
// the GatewayDiscordClient provided by Botrino
@RdiFactory
public SampleService(GatewayDiscordClient gateway) {
gateway.on(ReadyEvent.class, ready -> Mono.fromRunnable(
() -> LOGGER.info("Logged in as "
+ ready.getSelf().getTag())))
.subscribe();
}
}
-

The bot is configured via a JSON configuration file with contents similar to this:

{
"bot": {
"token": "yourTokenHere",
"presence": {
"status": "online",
"activity_type": "playing",
"activity_text": "Hello world!"
},
"enabled_intents": 32509
}
}

To go further and familiarize yourself with the framework, check out the Getting Started guide.

- - + +

Introduction

+

What is Botrino?​

+

Botrino is a Java framework that provides guidelines and a set of tools to build Discord bots in a more convenient way. +Pretty much in the same spirit as Spring Boot, it allows to easily setup +standalone bot applications that are ready to run, embedding a few third-party libraries such +as Jackson for JSON-based +configuration, RDI for a reactive IoC container, +and Discord4J for the interface with +the Discord Bot API.

+

Motivations​

+

Starting the development of a Discord bot follows most of the time the same pattern: you create a project, import your +favorite Discord client library, export a configuration file or an environment variable with the bot token, and design a +whole structure for your commands and your logic, before you can actually start to implement them. When working with +Java, this structure is even more important otherwise you may adopt bad practices and end up with a bot that is +difficult to maintain.

+

This is how came the idea of this project: have something that can handle for you all the initial workflow of setting up +a project with a solid structure, at the only cost of letting the framework choose some libraries for you, so that you +can focus on what matters. Botrino is born.

+

It also aims at providing a library for Discord's Interaction API that integrates +well with the structure of Botrino, while still being decoupled from it.

+

Overview​

+

Botrino utilizes Java modules, introduced in the JDK 9 and released in the JDK 11 as a LTS version. The classes of your +application will reside in one or more modules with the following module-info.java structure:

+
import botrino.api.annotation.BotModule;

@BotModule
open module com.example.myproject {

requires botrino.api;
}
+

The annotation as well as the open modifier will allow Botrino to automatically scan through all the classes present +in the module, in order to automatically register configuration entries, commands, services, etc.

+

Inside your module, you can create services +using RDI annotations that are automatically +loaded on startup:

+
package com.example.myproject;

import com.github.alex1304.rdi.finder.annotation.RdiFactory;
import com.github.alex1304.rdi.finder.annotation.RdiService;
import discord4j.core.GatewayDiscordClient;
import discord4j.core.event.domain.lifecycle.ReadyEvent;
import reactor.core.publisher.Mono;
import reactor.util.Logger;
import reactor.util.Loggers;

@RdiService
public final class SampleService {

private static final Logger LOGGER = Loggers.getLogger(SampleService.class);

// We can inject other services, here we are injecting
// the GatewayDiscordClient provided by Botrino
@RdiFactory
public SampleService(GatewayDiscordClient gateway) {
gateway.on(ReadyEvent.class, ready -> Mono.fromRunnable(
() -> LOGGER.info("Logged in as "
+ ready.getSelf().getTag())))
.subscribe();
}
}

+

The bot is configured via a JSON configuration file with contents similar to this:

+
{
"bot": {
"token": "yourTokenHere",
"presence": {
"status": "online",
"activity_type": "playing",
"activity_text": "Hello world!"
},
"enabled_intents": 32509
}
}
+

To go further and familiarize yourself with the framework, check out the Getting Started guide.

\ No newline at end of file diff --git a/docs/interaction-library/acknowledging-interactions/index.html b/docs/interaction-library/acknowledging-interactions/index.html index fc5d520..56372fd 100644 --- a/docs/interaction-library/acknowledging-interactions/index.html +++ b/docs/interaction-library/acknowledging-interactions/index.html @@ -1,31 +1,41 @@ - + - - - - - + +Acknowledging interactions | Botrino -Acknowledging interactions | Botrino - - + + + - -
-

Acknowledging interactions

When an interaction event is received from the gateway, the library is able to acknowledge them automatically. This allows to simplify your code a lot, as you can directly use createFollowup() or editReply() without worrying about choosing between reply(), edit(), deferReply() or deferEdit() first. If you have a specific use case that requires you to take full control over the acknowledgment process, the library gets you covered by offering a way to disable automatic acknowledgment on a per-command basis.

Modifying the default acknowledgment behavior#

This was partially covered in the Configuration page, the default behavior can be set via the default_ack_mode field of config.json if you are using the Botrino framework, or via InteractionConfig.Builder#defaultACKMode(String) when building the configuration manually. Here's a table describing the possible values and their behavior:

valuebehavior
defaultEquivalent to defer.
deferAutomatically calls deferReply() (for commands) or deferEdit() (for components).
defer_ephemeralAutomatically calls deferReply().withEphemeral(true) (for commands) or deferEdit().withEphemeral(true) (for components).
noneDoes not call any acknowledgment method.

Overriding the acknowledgment mode on a per-command basis#

Let's say you have defer as default behavior in your config, and you want to make a command that replies exclusively with ephemeral messages. There would be no way to achieve this without overriding the acknowledgment behavior for this specific command so that it can be ephemeral. This is as simple as adding an @Acknowledge annotation with the desired mode as value:

package testbot1;
-
import botrino.interaction.annotation.Acknowledge;
import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.listener.ChatInputInteractionListener;
import botrino.interaction.context.ChatInputInteractionContext;
import org.reactivestreams.Publisher;
-
@Acknowledge(Acknowledge.Mode.DEFER_EPHEMERAL)
@ChatInputCommand(name = "ping", description = "Pings the bot to check if it is alive.")
public final class PingCommand implements ChatInputInteractionListener {
-
@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().createFollowup("Pong!").withEphemeral(true);
}
}

Since this is a very simple command, you could even completely disable automatic acknowledgment and use reply() instead of createFollowup():

package testbot1;
-
import botrino.interaction.annotation.Acknowledge;
import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.listener.ChatInputInteractionListener;
import botrino.interaction.context.ChatInputInteractionContext;
import org.reactivestreams.Publisher;
-
@Acknowledge(Acknowledge.Mode.NONE)
@ChatInputCommand(name = "ping", description = "Pings the bot to check if it is alive.")
public final class PingCommand implements ChatInputInteractionListener {
-
@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().reply("Pong!").withEphemeral(true);
}
}
warning

If your command is made of subcommands or subcommand groups, the @Acknowledge annotation must be used on the listener implementation class of individual subcommands; putting it on the parent class alongside @ChatInputCommand will have no effect.

- - + +

Acknowledging interactions

When an interaction event is received from the gateway, the library is able to acknowledge them automatically. This +allows to simplify your code a lot, as you can directly use createFollowup() or editReply() without worrying about +choosing between reply(), edit(), deferReply() or deferEdit() first. If you have a specific use case that +requires you to take full control over the acknowledgment process, the library gets you covered by offering a way to +disable automatic acknowledgment on a per-command basis.

+

Modifying the default acknowledgment behavior​

+

This was partially covered in the Configuration page, the default behavior can be set via +the default_ack_mode field of config.json if you are using the Botrino framework, or +via InteractionConfig.Builder#defaultACKMode(String) when building the configuration manually. Here's a table +describing the possible values and their behavior:

+
valuebehavior
defaultEquivalent to defer.
deferAutomatically calls deferReply() (for commands) or deferEdit() (for components).
defer_ephemeralAutomatically calls deferReply().withEphemeral(true) (for commands) or deferEdit().withEphemeral(true) (for components).
noneDoes not call any acknowledgment method.
+

Overriding the acknowledgment mode on a per-command basis​

+

Let's say you have defer as default behavior in your config, and you want to make a command that replies exclusively +with ephemeral messages. There would be no way to achieve this without overriding the acknowledgment behavior for this +specific command so that it can be ephemeral. This is as simple as adding an @Acknowledge annotation with the desired +mode as value:

+
package testbot1;

import botrino.interaction.annotation.Acknowledge;
import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.listener.ChatInputInteractionListener;
import botrino.interaction.context.ChatInputInteractionContext;
import org.reactivestreams.Publisher;

@Acknowledge(Acknowledge.Mode.DEFER_EPHEMERAL)
@ChatInputCommand(name = "ping", description = "Pings the bot to check if it is alive.")
public final class PingCommand implements ChatInputInteractionListener {

@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().createFollowup("Pong!").withEphemeral(true);
}
}
+

Since this is a very simple command, you could even completely disable automatic acknowledgment and use reply() +instead of createFollowup():

+
package testbot1;

import botrino.interaction.annotation.Acknowledge;
import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.listener.ChatInputInteractionListener;
import botrino.interaction.context.ChatInputInteractionContext;
import org.reactivestreams.Publisher;

@Acknowledge(Acknowledge.Mode.NONE)
@ChatInputCommand(name = "ping", description = "Pings the bot to check if it is alive.")
public final class PingCommand implements ChatInputInteractionListener {

@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().reply("Pong!").withEphemeral(true);
}
}
+
warning

If your command is made of subcommands or subcommand groups, the @Acknowledge annotation must be used on the listener +implementation class of individual subcommands; putting it on the parent class alongside @ChatInputCommand will have +no effect.

\ No newline at end of file diff --git a/docs/interaction-library/configuration/index.html b/docs/interaction-library/configuration/index.html index fcaa8a1..e453694 100644 --- a/docs/interaction-library/configuration/index.html +++ b/docs/interaction-library/configuration/index.html @@ -1,25 +1,34 @@ - + - - - - - + +Configuration | Botrino -Configuration | Botrino - - + + + - -
-

Configuration

This page will cover the configuration part of the interaction library.

Configuring the library for the Botrino framework#

For the library to work with the Botrino framework, you just need to make sure that your bot module requires botrino.interaction, and that the interaction entry is present in your config.json. The entry has the following structure:

{
"interaction": {
"application_commands_guild_id": null,
"default_ack_mode": "default",
"await_component_timeout_seconds": 600
}
}
FieldTypeDescriptionRequired?
application_commands_guild_idlongThe ID of the guild in which commands will be deployed. Specifying null or completely omitting the field will deploy them globally.No, default null
default_ack_modestringHow interactions should be acknowledged by default. Possible values (case insensitive):
  • default: equivalent to defer.
  • defer: automatically acknowledges all interactions with defer reply or defer edit as appropriate. This is the default behavior.
  • defer_ephemeral: similar to defer except the EPHEMERAL flag is set, meaning the next reply/edit will only be visible to the user who initiated the interaction.
  • none: won't acknowledge any interaction automatically. In that case, you will be in charge of acknowledging interactions manually.
No, default default
await_component_timeout_secondsintegerThe time in seconds after which InteractionContext::awaitComponentInteraction automatically times out.No, default 600

Configuring the library manually#

If you don't use the framework, the configuration is done via the InteractionConfig object, which is used to construct InteractionService:

// Use default values
final var config = InteractionConfig.withDefaults();
// Use custom values
final var config = InteractionConfig.builder()
.applicationCommandsGuildId(123456L)
.defaultACKMode("default")
.awaitComponentTimeoutSeconds(600)
.build();
// Login to Discord using the token passed as program argument
final var gateway = DiscordClient.create(args[0]).login().block();
// Initialize the interaction service
final var interactionService = InteractionService.create(config, gateway);

The methods available in InteractionConfig::builder are the same as the ones in the JSON described previously.

Once you have the InteractionService instance, you can register your commands and subscribe to its run() method:

// Register your commands
interactionService.registerChatInputCommand(new PingCommand());
// Listen for interaction events until the bot disconnects
interactionService.run().takeUntilOther(gateway.onDisconnect()).block();
info

None of this is necessary when using the Botrino framework. Creation of InteractionConfig and InteractionService, registration of commands and execution of the run() method are all done automatically.

- - + +

Configuration

This page will cover the configuration part of the interaction library.

+

Configuring the library for the Botrino framework​

+

For the library to work with the Botrino framework, you just need to make sure that your bot +module requires botrino.interaction, and that the interaction entry is present in your config.json. The entry has +the following structure:

+
{
"interaction": {
"application_commands_guild_id": null,
"default_ack_mode": "default",
"await_component_timeout_seconds": 600
}
}
+
FieldTypeDescriptionRequired?
application_commands_guild_idlongThe ID of the guild in which commands will be deployed. Specifying null or completely omitting the field will deploy them globally.No, default null
default_ack_modestringHow interactions should be acknowledged by default. Possible values (case insensitive):
  • default: equivalent to defer.
  • defer: automatically acknowledges all interactions with defer reply or defer edit as appropriate. This is the default behavior.
  • defer_ephemeral: similar to defer except the EPHEMERAL flag is set, meaning the next reply/edit will only be visible to the user who initiated the interaction.
  • none: won't acknowledge any interaction automatically. In that case, you will be in charge of acknowledging interactions manually.
No, default default
await_component_timeout_secondsintegerThe time in seconds after which InteractionContext::awaitComponentInteraction automatically times out.No, default 600
+

Configuring the library manually​

+

If you don't use the framework, the configuration is done via the InteractionConfig object, which is used to +construct InteractionService:

+
// Use default values
final var config = InteractionConfig.withDefaults();
// Use custom values
final var config = InteractionConfig.builder()
.applicationCommandsGuildId(123456L)
.defaultACKMode("default")
.awaitComponentTimeoutSeconds(600)
.build();
// Login to Discord using the token passed as program argument
final var gateway = DiscordClient.create(args[0]).login().block();
// Initialize the interaction service
final var interactionService = InteractionService.create(config, gateway);
+

The methods available in InteractionConfig::builder are the same as the ones in the JSON described previously.

+

Once you have the InteractionService instance, you can register your commands and subscribe to its run() method:

+
// Register your commands
interactionService.registerChatInputCommand(new PingCommand());
// Listen for interaction events until the bot disconnects
interactionService.run().takeUntilOther(gateway.onDisconnect()).block();
+
info

None of this is necessary when using the Botrino framework. Creation of InteractionConfig and InteractionService, +registration of commands and execution of the run() method are all done automatically.

\ No newline at end of file diff --git a/docs/interaction-library/cooldowns/index.html b/docs/interaction-library/cooldowns/index.html index 50ecd1f..24ed550 100644 --- a/docs/interaction-library/cooldowns/index.html +++ b/docs/interaction-library/cooldowns/index.html @@ -1,25 +1,32 @@ - + - - - - - + +Cooldowns | Botrino -Cooldowns | Botrino - - + + + - -
-

Cooldowns

If your commands perform costly operations or can potentially be abused, you may want to set a limit on the number of times the command can be used. The Cooldown API will allow you to deal with these situations without hassle.

Set a cooldown to a command#

Override the cooldown() method from InteractionListener, and specify the cooldown using Cooldown.of(int, Duration):

@Override
public Cooldown cooldown() {
return Cooldown.of(1, Duration.ofMinutes(1));
}

The integer represents the maximum number of times the command can be executed within a timeframe, and the duration represents the timeframe itself. Therefore, this example corresponds to a cooldown of once per minute.

info

Cooldowns are applied per user. Two different users using the same command will always have their own separate usage limits.

Handling cooldowns#

When a user reaches the maximum number of permits and attempts to use the command again, the command will fail with a CooldownException. You can handle this exception via the command error handler, which will be covered in the next section.

- - + +

Cooldowns

If your commands perform costly operations or can potentially be abused, you may want to set a limit on the number of +times the command can be used. The Cooldown API will allow you to deal with these situations without hassle.

+

Set a cooldown to a command​

+

Override the cooldown() method from InteractionListener, and specify the cooldown +using Cooldown.of(int, Duration):

+
@Override
public Cooldown cooldown() {
return Cooldown.of(1, Duration.ofMinutes(1));
}
+

The integer represents the maximum number of times the command can be executed within a timeframe, and the duration +represents the timeframe itself. Therefore, this example corresponds to a cooldown of once per minute.

+
info

Cooldowns are applied per user. Two different users using the same command will always have their own separate usage +limits.

+

Handling cooldowns​

+

When a user reaches the maximum number of permits and attempts to use the command again, the command will fail with +a CooldownException. You can handle this exception via the command error handler, which will be covered in +the next section.

\ No newline at end of file diff --git a/docs/interaction-library/creating-commands/index.html b/docs/interaction-library/creating-commands/index.html index 1d039f7..6685320 100644 --- a/docs/interaction-library/creating-commands/index.html +++ b/docs/interaction-library/creating-commands/index.html @@ -1,49 +1,108 @@ - + - - - - - + +Creating commands | Botrino -Creating commands | Botrino - - + + + - -
-

Creating commands

Commands represent the main form of interaction that Discord bots have with users. Creating commands is a simple and straightforward process, with the ability to customize different aspects of them.

Chat input (aka "slash") commands#

Basic command#

A slash command is a command that is triggered when the user sends /command-name in chat. In the library, they are called "chat input commands".

Here is an example of a /ping command that makes the bot reply with "Pong!":

package testbot1;
-
import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.listener.ChatInputInteractionListener;
import botrino.interaction.context.ChatInputInteractionContext;
import org.reactivestreams.Publisher;
-
@ChatInputCommand(name = "ping", description = "Pings the bot to check if it is alive.")
public final class PingCommand implements ChatInputInteractionListener {
-
@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().createFollowup("Pong!");
}
}
  • A chat input command must have a @ChatInputCommand annotation that contains the meta-information required by Discord (name of the command, description, defaultPermission, etc), and must implement the ChatInputInteractionListener interface.
  • The run method accepts a ChatInputInteractionContext that holds contextual information on the command being executed, such as the original ChatInputInteractionEvent, the MessageChannel where the interaction happened, the User who initiated the interaction, and a Locale that may have been adapted to the target user (see Filtering and adapting events).
  • Events are automatically acknowledged by default, so you can directly call createFollowup() without using deferReply() first (reply() will not work unless you disable automatic acknowledgment, see Acknowledging Interactions)
info

If you are using the Botrino framework, you have nothing else to do, the command will be automatically recognized and registered. Otherwise, you need to manually register it into the InteractionService like this:

interactionService.registerChatInputCommand(new PingCommand());

Command options#

A command may accept one or many options, whether they are required or optional. The library provides ChatInputCommandGrammar that allows to inject the option values into the fields of a class that is going to be instantiated when the command is executed. Here is an example of a command using options:

package testbot1;
-
import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.context.ChatInputInteractionContext;
import botrino.interaction.grammar.ChatInputCommandGrammar;
import botrino.interaction.listener.ChatInputInteractionListener;
import discord4j.core.object.command.ApplicationCommandOption;
import discord4j.discordjson.json.ApplicationCommandOptionData;
import org.reactivestreams.Publisher;
-
import java.util.List;
-
@ChatInputCommand(name = "options", description = "Option testing")
public class OptionsCommand implements ChatInputInteractionListener {
-
private final ChatInputCommandGrammar<Options> grammar = ChatInputCommandGrammar.of(Options.class);
-
@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return grammar.resolve(ctx.event()).flatMap(options -> ctx.event()
.createFollowup("Value of `my-string`: " + options.myString));
}
-
@Override
public List<ApplicationCommandOptionData> options() {
return grammar.toOptions();
}
-
private static class Options {
@ChatInputCommandGrammar.Option(
type = ApplicationCommandOption.Type.STRING,
name = "my-string",
description = "The string argument",
required = true,
choices = {
@ChatInputCommandGrammar.Choice(name = "Choice 1", stringValue = "1"),
@ChatInputCommandGrammar.Choice(name = "Choice 2", stringValue = "2"),
@ChatInputCommandGrammar.Choice(name = "Choice 3", stringValue = "3")
}
)
String myString;
}
}
  1. Create a new class that declares the fields in which you want to inject the option values. It is recommended to use an internal class for better code readability, unless you are re-using the same class for several commands. The class must have a no-arg contructor, and must be declared static if internal. The fields may be private, but you can also omit the access modifier to avoid IDE warnings about the field never being assigned a value.
  2. Use the annotation @ChatInputCommandGrammar.Option on the field to declare the properties of the option (the type, the name, the description, whether they are required or not, and the array of value choices, if any).
  3. Create a new ChatInputCommandGrammar and pass the class to the .of() method. You only need to instantiate once, rather than on each command execution.
  4. In the run(ChatInputInteractionContext) method, call the resolve(ChatInputInteractionEvent) method which will read the options, instantiate the class and inject the values in the annotated fields. You can then use the object to conveniently access the values, as show in the example above.
  5. Override the options() method from ChatInputInteractionListener and make it return ChatInputCommandGrammar#toOptions().

For reference, here is a table associating each ApplicationCommandOption.Type with the type of the field carrying the annotation:

Option typeType of annotated field
STRINGjava.lang.String
INTEGERjava.lang.Long (primitive long may be used only if required = true)
NUMBERjava.lang.Double (primitive double may be used only if required = true)
BOOLEANjava.lang.Boolean (primitive boolean may be used only if required = true)
USERdiscord4j.core.object.entity.User (or discord4j.core.object.entity.Member if in a guild)
CHANNELdiscord4j.core.object.entity.channel.Channel
ROLEdiscord4j.core.object.entity.Role
MENTIONABLEdiscord4j.common.util.Snowflake
caution

Optional options will be filled with null if not specified by the user, which means you cannot use primitive types for INTEGER, NUMBER and BOOLEAN if required = false, otherwise you will get NullPointerExceptions.

Subcommands and subcommand groups#

Discord allows to create subcommands and subcommand groups to help in organizing the logic of a complex command. Here is an example of a command using subcommands and subcommand groups:

@ChatInputCommand(
name = "nest",
description = "Subcommand testing",
subcommands = {
@Subcommand(name = "sub1", description = "Subcommand 1", listener = NestCommand.Sub1.class),
@Subcommand(name = "sub2", description = "Subcommand 2", listener = NestCommand.Sub2.class)
},
subcommandGroups = {
@SubcommandGroup(name = "group1", description = "Group 1", subcommands = {
@Subcommand(name = "sub", description = "Subcommand", listener = NestCommand.G1Sub.class)
})
}
)
public final class NestCommand {
-
public static final class Sub1 implements ChatInputInteractionListener {
-
@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().createFollowup("sub1: pong!");
}
}
-
public static final class Sub2 implements ChatInputInteractionListener {
-
@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().createFollowup("sub2: pong!");
}
}
-
public static final class G1Sub implements ChatInputInteractionListener {
-
@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().createFollowup("group1 sub: pong!");
}
}
}

Here are the notable differences:

  • The class carrying the @ChatInputCommand annotation no longer implements ChatInputInteractionListener. Indeed, as per Discord's documentation a base command becomes unusable if subcommands are present.
  • The @ChatInputCommand specifies an array of @Subcommand and @SubcommandGroup with their own name and description.
  • Subcommands specify the class implementing ChatInputInteractionListener that is going to handle them. In this example they are internal classes, but they can as well be external.
info

Here is how you manually register a command containing subcommands when you control the instance of InteractionService:

interactionService.registerChatInputCommand(new NestCommand(), List.of(
new NestCommand.Sub1(),
new NestCommand.Sub2(),
new NestCommand.G1Sub()
));
caution

If you are using the Botrino framework, the subcommand classes must either have a public no-arg constructor or be declared as a service. If the classes are internal, they must be static.

Context menu commands#

Discord currently support two types of context menu commands, one on messages and one on users. It works the same as chat input commands, but you need to use the @MessageCommand and @UserCommand annotations with the MessageInteractionListener and UserInteractionListener interfaces, respectively.

Context menu commands are actually less complex than chat input ones, since there is no description, no options, no subcommands... Only a name and a run method:

package testbot1;
-
import botrino.interaction.annotation.UserCommand;
import botrino.interaction.context.UserInteractionContext;
import botrino.interaction.listener.UserInteractionListener;
import org.reactivestreams.Publisher;
-
@UserCommand("Fight")
public final class FightCommand implements UserInteractionListener {
-
@Override
public Publisher<?> run(UserInteractionContext ctx) {
return ctx.event().createFollowup("You are fighting <@" +
ctx.event().getTargetId().asString() + ">");
}
}
info

If you need to do manual registration, it happens via InteractionService#registerMessageCommand(MessageInteractionListener) and InteractionService#registerUserCommand(MessageInteractionListener):

interactionService.registerUserCommand(new FightCommand());

Commands as a service#

info

The following is only applicable if you are using the Botrino framework. See Working with services.

Classes implementing commands can themselves be declared as services without any issues. For example if you need to access the ConfigContainer in your command, you can do this:

package testbot1;
-
import botrino.api.config.ConfigContainer;
import botrino.api.config.object.BotConfig;
import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.context.ChatInputInteractionContext;
import botrino.interaction.listener.ChatInputInteractionListener;
import com.github.alex1304.rdi.finder.annotation.RdiFactory;
import com.github.alex1304.rdi.finder.annotation.RdiService;
import discord4j.gateway.intent.IntentSet;
import org.reactivestreams.Publisher;
-
@RdiService
@ChatInputCommand(name = "intents", description = "Displays the intents enabled for this bot.")
public final class IntentsCommand implements ChatInputInteractionListener {
-
private final long intents;
-
@RdiFactory
public IntentsCommand(ConfigContainer configContainer) {
this.intents = configContainer.get(BotConfig.class)
.enabledIntents()
.orElse(IntentSet.nonPrivileged().getRawValue());
}
-
@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().createFollowup("Intents enabled: " + intents);
}
}

The command above accesses the values in the config.json to get the gateway intents enabled for the bot. You can notice the use of @RdiService on top of @ChatInputCommand, this works totally fine! Don't forget the @RdiFactory to inject the configuration container, and you're ready to run the bot and try out this command.

tip

If you declare a command as a service this way, you are allowed to do anything with it like any other service, for example inject it in other services, or set up @RdiFactory to be a reactive static method in case the command needs to perform a reactive task in order to be initialized.

- - + +

Creating commands

Commands represent the main form of interaction that Discord bots have with users. Creating commands is a simple and +straightforward process, with the ability to customize different aspects of them.

+

Chat input (aka "slash") commands​

+

Basic command​

+

A slash command is a command that is triggered when the user sends /command-name in chat. In the library, they are +called "chat input commands".

+

Here is an example of a /ping command that makes the bot reply with "Pong!":

+
package testbot1;

import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.listener.ChatInputInteractionListener;
import botrino.interaction.context.ChatInputInteractionContext;
import org.reactivestreams.Publisher;

@ChatInputCommand(name = "ping", description = "Pings the bot to check if it is alive.")
public final class PingCommand implements ChatInputInteractionListener {

@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().createFollowup("Pong!");
}
}
+
    +
  • A chat input command must have a @ChatInputCommand annotation that contains the meta-information required by +Discord (name of the command, description, defaultPermission, etc), and must implement +the ChatInputInteractionListener interface.
  • +
  • The run method accepts a ChatInputInteractionContext that holds contextual information on the command being +executed, such as the original ChatInputInteractionEvent, the MessageChannel where the interaction happened, +the User who initiated the interaction, and a Locale that may have been adapted to the target user ( +see Filtering and adapting events).
  • +
  • Events are automatically acknowledged by default, so you can directly call createFollowup() without +using deferReply() first (reply() will not work unless you disable automatic acknowledgment, +see Acknowledging Interactions)
  • +
+
info

If you are using the Botrino framework, you have nothing else to do, the command will be automatically recognized and +registered. Otherwise, you need to manually register it into the InteractionService like this:

interactionService.registerChatInputCommand(new PingCommand());
+

Command options​

+

A command may accept one or many options, whether they are required or optional. The library +provides ChatInputCommandGrammar that allows to inject the option values into a record class that is going to +be instantiated when the command is executed. Here is an example of a command using options:

+
package testbot1;

import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.context.ChatInputInteractionContext;
import botrino.interaction.grammar.ChatInputCommandGrammar;
import botrino.interaction.listener.ChatInputInteractionListener;
import discord4j.core.object.command.ApplicationCommandOption;
import discord4j.discordjson.json.ApplicationCommandOptionData;
import org.reactivestreams.Publisher;

import java.util.List;

@ChatInputCommand(name = "options", description = "Option testing")
public class OptionsCommand implements ChatInputInteractionListener {

private final ChatInputCommandGrammar<Options> grammar = ChatInputCommandGrammar.of(Options.class);

@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return grammar.resolve(ctx.event()).flatMap(options -> ctx.event()
.createFollowup("Value of `my-string`: " + options.myString));
}

@Override
public List<ApplicationCommandOptionData> options() {
return grammar.toOptions();
}

private record Options(
@ChatInputCommandGrammar.Option(
type = ApplicationCommandOption.Type.STRING,
name = "my-string",
description = "The string argument",
required = true,
choices = {
@ChatInputCommandGrammar.Choice(name = "Choice 1", stringValue = "1"),
@ChatInputCommandGrammar.Choice(name = "Choice 2", stringValue = "2"),
@ChatInputCommandGrammar.Choice(name = "Choice 3", stringValue = "3")
}
)
String myString) {}
}
+
    +
  1. Create a record class that declares the fields in which you want to inject the option values. It is recommended to +use +an internal private record for better code readability, unless you are re-using the same record for several commands.
  2. +
  3. Use the annotation @ChatInputCommandGrammar.Option on each record parameter to declare the properties of the +option (the type, +the name, the description, whether they are required or not, and the array of value choices, if any).
  4. +
  5. Create a new ChatInputCommandGrammar and pass the class to the .of() method. You only need to instantiate once, +rather than on each command execution.
  6. +
  7. In the run(ChatInputInteractionContext) method, call the resolve(ChatInputInteractionEvent) method which will +read the options, instantiate the record and inject the values in the annotated fields. You can then use the record +object to conveniently access the values, as shown in the example above.
  8. +
  9. Override the options() method from ChatInputInteractionListener and make it +return ChatInputCommandGrammar#toOptions().
  10. +
+

For reference, here is a table associating each ApplicationCommandOption.Type with the type of the field carrying the +annotation:

+
Option typeType of annotated field
STRINGjava.lang.String
INTEGERjava.lang.Long (primitive long may be used only if required = true)
NUMBERjava.lang.Double (primitive double may be used only if required = true)
BOOLEANjava.lang.Boolean (primitive boolean may be used only if required = true)
USERdiscord4j.core.object.entity.User (or discord4j.core.object.entity.Member if in a guild)
CHANNELdiscord4j.core.object.entity.channel.Channel
ROLEdiscord4j.core.object.entity.Role
MENTIONABLEdiscord4j.common.util.Snowflake
ATTACHMENTdiscord4j.core.object.entity.Attachment
+
caution

Optional options will be filled with null if not specified by the user, which means you cannot use primitive types +for INTEGER, NUMBER and BOOLEAN if required = false, otherwise you will get NullPointerExceptions.

+
info

For legacy purposes, you can use a normal class instead of a record. In that case, the class must have a no-arg +constructor, and the @ChatInputCommandGrammar.Option annotations should be on fields declared in the class. Using +records is preferred as it allows for immutability.

+

Subcommands and subcommand groups​

+

Discord allows to create subcommands and subcommand groups to help in organizing the logic of a complex command. Here is +an example of a command using subcommands and subcommand groups:

+

@ChatInputCommand(
name = "nest",
description = "Subcommand testing",
subcommands = {
@Subcommand(name = "sub1", description = "Subcommand 1", listener = NestCommand.Sub1.class),
@Subcommand(name = "sub2", description = "Subcommand 2", listener = NestCommand.Sub2.class)
},
subcommandGroups = {
@SubcommandGroup(name = "group1", description = "Group 1", subcommands = {
@Subcommand(name = "sub", description = "Subcommand", listener = NestCommand.G1Sub.class)
})
}
)
public final class NestCommand {

public static final class Sub1 implements ChatInputInteractionListener {

@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().createFollowup("sub1: pong!");
}
}

public static final class Sub2 implements ChatInputInteractionListener {

@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().createFollowup("sub2: pong!");
}
}

public static final class G1Sub implements ChatInputInteractionListener {

@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().createFollowup("group1 sub: pong!");
}
}
}
+

Here are the notable differences:

+
    +
  • The class carrying the @ChatInputCommand annotation no longer implements ChatInputInteractionListener. Indeed, as +per Discord's documentation a base command becomes unusable if subcommands are present.
  • +
  • The @ChatInputCommand specifies an array of @Subcommand and @SubcommandGroup with their own name and +description.
  • +
  • Subcommands specify the class implementing ChatInputInteractionListener that is going to handle them. In this +example they are internal classes, but they can as well be external.
  • +
+
info

Here is how you manually register a command containing subcommands when you control the instance +of InteractionService:

interactionService.registerChatInputCommand(new NestCommand(),List.

of(
new NestCommand.Sub1(),
new NestCommand.

Sub2(),
new NestCommand.

G1Sub()
));
+
caution

If you are using the Botrino framework, the subcommand classes must either have a public no-arg constructor or be +declared as a service. If the classes are internal, they must be static.

+

Context menu commands​

+

Discord currently support two types of context menu commands, one on messages and one on users. It works the same as +chat input commands, but you need to use the @MessageCommand and @UserCommand annotations with +the MessageInteractionListener and UserInteractionListener interfaces, respectively.

+

Context menu commands are actually less complex than chat input ones, since there is no description, no options, no +subcommands... Only a name and a run method:

+
package testbot1;

import botrino.interaction.annotation.UserCommand;
import botrino.interaction.context.UserInteractionContext;
import botrino.interaction.listener.UserInteractionListener;
import org.reactivestreams.Publisher;

@UserCommand("Fight")
public final class FightCommand implements UserInteractionListener {

@Override
public Publisher<?> run(UserInteractionContext ctx) {
return ctx.event().createFollowup("You are fighting <@" +
ctx.event().getTargetId().asString() + ">");
}
}
+
info

If you need to do manual registration, it happens +via InteractionService#registerMessageCommand(MessageInteractionListener) +and InteractionService#registerUserCommand(MessageInteractionListener):

interactionService.registerUserCommand(new FightCommand());
+

Commands as a service​

+
info

The following is only applicable if you are using the Botrino framework. +See Working with services.

+

Classes implementing commands can themselves be declared as services without any issues. For example if you need to +access the ConfigContainer in your command, you can do this:

+
package testbot1;

import botrino.api.config.ConfigContainer;
import botrino.api.config.object.BotConfig;
import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.context.ChatInputInteractionContext;
import botrino.interaction.listener.ChatInputInteractionListener;
import com.github.alex1304.rdi.finder.annotation.RdiFactory;
import com.github.alex1304.rdi.finder.annotation.RdiService;
import discord4j.gateway.intent.IntentSet;
import org.reactivestreams.Publisher;

@RdiService
@ChatInputCommand(name = "intents", description = "Displays the intents enabled for this bot.")
public final class IntentsCommand implements ChatInputInteractionListener {

private final long intents;

@RdiFactory
public IntentsCommand(ConfigContainer configContainer) {
this.intents = configContainer.get(BotConfig.class)
.enabledIntents()
.orElse(IntentSet.nonPrivileged().getRawValue());
}

@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().createFollowup("Intents enabled: " + intents);
}
}
+

The command above accesses the values in the config.json to get the gateway intents enabled for the bot. You can +notice the use of @RdiService on top of @ChatInputCommand, this works totally fine! Don't forget the @RdiFactory +to inject the configuration container, and you're ready to run the bot and try out this command.

+
tip

If you declare a command as a service this way, you are allowed to do anything with it like any other service, for +example inject it in other services, or set up @RdiFactory to be +a reactive static method in case the +command needs to perform a reactive task in order to be initialized.

\ No newline at end of file diff --git a/docs/interaction-library/dealing-with-components/index.html b/docs/interaction-library/dealing-with-components/index.html index 27ecef3..1093245 100644 --- a/docs/interaction-library/dealing-with-components/index.html +++ b/docs/interaction-library/dealing-with-components/index.html @@ -1,47 +1,83 @@ - + - - - - - + +Dealing with components | Botrino -Dealing with components | Botrino - - + + + - -
-

Dealing with components

The library offers two ways to handle interactions with message components (buttons and select menus).

Handling component interactions as regular commands#

The first way is to treat component interactions as regular commands, which consists of declaring a listener that is going to be called every time a component with a specific customId is interacted with. The structure is similar to creating commands:

package testbot1;
-
import botrino.interaction.annotation.ComponentCommand;
import botrino.interaction.context.ButtonInteractionContext;
import botrino.interaction.listener.ComponentInteractionListener;
import org.reactivestreams.Publisher;
-
@ComponentCommand("clickme")
public final class ClickMeButtonCommand implements ComponentInteractionListener<Void> {
-
@Override
public Publisher<Void> run(ButtonInteractionContext ctx) {
return ctx.event().createFollowup("Button clicked!").then();
}
}

The class implements ComponentInteractionListener<Void> and overrides run(ButtonInteractionContext) (it has several run() overloads, one for each type of component, here we want a button. For select menus you're supposed to override run(SelectMenuInteractionContext)). The @ComponentCommand annotation specifies the customId to listen for. Let's make a chat input command to create the message containing the button:

package testbot1;
-
import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.context.ChatInputInteractionContext;
import botrino.interaction.listener.ChatInputInteractionListener;
import discord4j.core.object.component.ActionRow;
import discord4j.core.object.component.Button;
import org.reactivestreams.Publisher;
-
@ChatInputCommand(name = "create-button", description = "Create a button.")
public final class CreateButtonCommand implements ChatInputInteractionListener {
-
@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().createFollowup("Click the button:")
.withComponents(ActionRow.of(
Button.primary("clickme", "Click me!")));
}
}

As usual, unless you are using the Botrino framework, you need to register them manually:

interactionService.registerComponentCommand(new ClickMeButtonCommand());
interactionService.registerChatInputCommand(new CreateButtonCommand());

Result:

info

The @ComponentCommand annotation is in fact not required if you aren't using the Botrino framework. You may as well override the customId() method from ComponentInteractionListener. The annotation is still required when using the Botrino framework, as it will only auto-register listeners containing that annotation, but if you are already overriding customId() you can use @ComponentCommand alone without the value. An example might be more clear:

package testbot1;
-
import botrino.interaction.annotation.ComponentCommand;
import botrino.interaction.context.ButtonInteractionContext;
import botrino.interaction.listener.ComponentInteractionListener;
import org.reactivestreams.Publisher;
-
@ComponentCommand // You may omit the customId here...
public final class ClickMeButtonCommand implements ComponentInteractionListener<Void> {
@Override
public String customId() {
return "clickme"; // ...if you specify it here instead
}
-
@Override
public Publisher<Void> run(ButtonInteractionContext ctx) {
return ctx.event().createFollowup("Button clicked!").then();
}
}

Waiting for component interactions inside a command#

In many cases, you want to use components as a way to make your commands more interactive, for example if you need confirmation from the user to perform an action. You would need some way to "pause" the execution of your command and resume when the user has given a response by clicking a button or a select menu. This is made easy with the awaitButtonClick(customId) and awaitSelectMenuItems(customId) methods. Here's an example of a simple command waiting for the user to select an item and display the value clicked:

package testbot1;
-
import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.context.ChatInputInteractionContext;
import botrino.interaction.listener.ChatInputInteractionListener;
import discord4j.core.object.component.ActionRow;
import discord4j.core.object.component.SelectMenu;
import discord4j.core.object.entity.Message;
import discord4j.core.spec.InteractionFollowupCreateSpec;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Mono;
-
import java.util.UUID;
-
import static botrino.interaction.listener.ComponentInteractionListener.selectMenu;
-
@ChatInputCommand(name = "select", description = "Command for testing select menus")
public class SelectCommand implements ChatInputInteractionListener {
-
@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
final var customId = UUID.randomUUID().toString();
return ctx.event().createFollowup("Select an option:")
.withComponents(ActionRow.of(SelectMenu.of(customId,
SelectMenu.Option.of("option 1", "foo"),
SelectMenu.Option.of("option 2", "bar"),
SelectMenu.Option.of("option 3", "baz"))))
.map(Message::getId)
// Wait until the select menu is interacted with and return the value clicked
.flatMap(messageId -> ctx.awaitSelectMenuItems(customId)
.flatMap(items -> ctx.event().createFollowup("You clicked: " + items.get(0))
.then(ctx.event().deleteFollowup(messageId))));
}
}
  1. Since you want to listen for one specific select menu (and not all select menus with some customId), you generate a customId that is unique for each invocation of the /select command. You can easily generate a random string via java.util.UUID.
  2. A first followup is sent with the message containing the select menu.
  3. Once the message has been sent, call awaitSelectMenuItems(customId) with the same customId generated previously. It will wait for the user to interact with the menu and will emit the value clicked.
  4. The value received is then displayed via a new followup message.
warning

If you don't make the customId unique on each run, there will be conflicts when the /select command is run several times consecutively by the same user in the same channel.

Here is another example with awaitButtonClick(customId) that asks the user to confirm when resetting a user's nickname:

package testbot1;
-
import botrino.interaction.annotation.UserCommand;
import botrino.interaction.context.UserInteractionContext;
import botrino.interaction.listener.UserInteractionListener;
import discord4j.core.object.component.ActionRow;
import discord4j.core.object.component.Button;
import discord4j.core.object.entity.Message;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Mono;
-
import java.util.UUID;
-
import static botrino.interaction.listener.ComponentInteractionListener.button;
-
@UserCommand("Reset Nickname")
public class ResetNickCommand implements UserInteractionListener {
-
@Override
public Publisher<?> run(UserInteractionContext ctx) {
final var guildId = ctx.event().getInteraction().getGuildId().orElse(null);
if (guildId == null) {
return ctx.event().createFollowup("Cannot use outside of a guild");
}
final var yesId = UUID.randomUUID().toString();
final var noId = UUID.randomUUID().toString();
return ctx.event().createFollowup("Reset the nickname of that user?")
.withComponents(ActionRow.of(
Button.primary(yesId, "Yes"),
Button.secondary(noId, "No")))
.map(Message::getId)
.flatMap(messageId -> Mono.firstWithValue(
ctx.awaitButtonClick(yesId),
ctx.awaitButtonClick(noId))
.flatMap(buttonClicked -> buttonClicked.equals(yesId) ? ctx.event()
.getClient()
.getMemberById(guildId, ctx.event().getTargetId())
.flatMap(member -> member.edit().withNicknameOrNull(null))
.then(ctx.event().createFollowup("Nickname reset successful!"))
: ctx.event().createFollowup("Action cancelled"))
.then(ctx.event().deleteFollowup(messageId)));
}
}

The code is quite self-explanatory: we display two buttons, one for "yes" and one for "no". We use Mono.firstWithValue to only wait for the first click on either of the two buttons, and depending on which button was clicked, we execute one or the other action.

tip

There exists a more generic method awaitComponentInteraction that lets you manipulate the underlying interaction context before returning a value. It accepts a ComponentInteractionListener<R> that you can construct via its static methods button(String, Function) and selectMenu(String, Function), each accepting the customId and a function receiving a ButtonInteractionContext or SelectMenuInteractionContext and producing a value of any type.

Pagination system with components#

Making a pagination system is one of the most obvious use cases for message components. The library provides a static method MessagePaginator::paginate to build paginated messages easily. See the example below:

package testbot1;
-
import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.context.ChatInputInteractionContext;
import botrino.interaction.listener.ChatInputInteractionListener;
import botrino.interaction.util.MessagePaginator;
import discord4j.core.object.component.ActionRow;
import discord4j.core.object.component.Button;
import discord4j.core.spec.MessageCreateSpec;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Mono;
-
@ChatInputCommand(name = "paginate", description = "Pagination testing")
public final class PaginateCommand implements ChatInputInteractionListener {
-
@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return MessagePaginator.paginate(ctx, 5, state -> Mono.just(MessageCreateSpec.create()
.withContent("Page " + (state.getPage() + 1) + "/" + state.getPageCount())
.withComponents(ActionRow.of(
state.previousButton(customId -> Button.secondary(customId, "<< Previous")),
state.nextButton(customId -> Button.secondary(customId, "Next >>")),
state.closeButton(customId -> Button.danger(customId, "Close"))
))));
}
}
  • The paginate method takes 3 arguments. The first one is the interaction context, the second one is the total number of pages, and the last one is a function that receives a state and produces the message to display. An overload exists allowing you to specify the initial page number (by default it starts at the first page).
  • The state holds information on the current state of the paginator, such as the current page number and whether it is active
  • To render the buttons, the state exposes three methods to build previous, next and close buttons respectively. The state object controls whether the buttons are enabled or disabled according to whether we are at first page (in which case previous button should be disabled), at last page (in which case next button should be disabled), or if the paginator has already closed, in which case all buttons should be disabled.
info

The paginator automatically closes as per the await_component_timeout_seconds value defined in the configuration.

- - + +

Dealing with components

The library offers two ways to handle interactions with message components (buttons and select menus).

+

Handling component interactions as regular commands​

+

The first way is to treat component interactions as regular commands, which consists of declaring a listener that is +going to be called every time a component with a specific customId is interacted with. The structure is similar +to creating commands:

+
package testbot1;

import botrino.interaction.annotation.ComponentCommand;
import botrino.interaction.context.ButtonInteractionContext;
import botrino.interaction.listener.ComponentInteractionListener;
import org.reactivestreams.Publisher;

@ComponentCommand("clickme")
public final class ClickMeButtonCommand implements ComponentInteractionListener<Void> {

@Override
public Publisher<Void> run(ButtonInteractionContext ctx) {
return ctx.event().createFollowup("Button clicked!").then();
}
}
+

The class implements ComponentInteractionListener<Void> and overrides run(ButtonInteractionContext) (it has +several run() overloads, one for each type of component, here we want a button. For select menus you're supposed to +override run(SelectMenuInteractionContext)). The @ComponentCommand annotation specifies the customId to listen for. +Let's make a chat input command to create the message containing the button:

+
package testbot1;

import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.context.ChatInputInteractionContext;
import botrino.interaction.listener.ChatInputInteractionListener;
import discord4j.core.object.component.ActionRow;
import discord4j.core.object.component.Button;
import org.reactivestreams.Publisher;

@ChatInputCommand(name = "create-button", description = "Create a button.")
public final class CreateButtonCommand implements ChatInputInteractionListener {

@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().createFollowup("Click the button:")
.withComponents(ActionRow.of(
Button.primary("clickme", "Click me!")));
}
}
+

As usual, unless you are using the Botrino framework, you need to register them manually:

+
interactionService.registerComponentCommand(new ClickMeButtonCommand());
interactionService.registerChatInputCommand(new CreateButtonCommand());
+

Result:

+ +
info

The @ComponentCommand annotation is in fact not required if you aren't using the Botrino framework. You may as well +override the customId() method from ComponentInteractionListener. The annotation is still required when using the +Botrino framework, as it will only auto-register listeners containing that annotation, but if you are already +overriding customId() you can use @ComponentCommand alone without the value. An example might be more clear:

package testbot1;

import botrino.interaction.annotation.ComponentCommand;
import botrino.interaction.context.ButtonInteractionContext;
import botrino.interaction.listener.ComponentInteractionListener;
import org.reactivestreams.Publisher;

@ComponentCommand // You may omit the customId here...
public final class ClickMeButtonCommand implements ComponentInteractionListener<Void> {

@Override
public String customId() {
return "clickme"; // ...if you specify it here instead
}

@Override
public Publisher<Void> run(ButtonInteractionContext ctx) {
return ctx.event().createFollowup("Button clicked!").then();
}
}
+

Waiting for component interactions inside a command​

+

In many cases, you want to use components as a way to make your commands more interactive, for example if you need +confirmation from the user to perform an action. You would need some way to "pause" the execution of your command and +resume when the user has given a response by clicking a button or a select menu. This is made easy with +the awaitButtonClick(customId) and awaitSelectMenuItems(customId) methods. Here's an example of a simple command +waiting for the user to select an item and display the value clicked:

+
package testbot1;

import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.context.ChatInputInteractionContext;
import botrino.interaction.listener.ChatInputInteractionListener;
import discord4j.core.object.component.ActionRow;
import discord4j.core.object.component.SelectMenu;
import discord4j.core.object.entity.Message;
import discord4j.core.spec.InteractionFollowupCreateSpec;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Mono;

import java.util.UUID;

import static botrino.interaction.listener.ComponentInteractionListener.selectMenu;

@ChatInputCommand(name = "select", description = "Command for testing select menus")
public class SelectCommand implements ChatInputInteractionListener {

@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
final var customId = UUID.randomUUID().toString();
return ctx.event().createFollowup("Select an option:")
.withComponents(ActionRow.of(SelectMenu.of(customId,
SelectMenu.Option.of("option 1", "foo"),
SelectMenu.Option.of("option 2", "bar"),
SelectMenu.Option.of("option 3", "baz"))))
.map(Message::getId)
// Wait until the select menu is interacted with and return the value clicked
.flatMap(messageId -> ctx.awaitSelectMenuItems(customId)
.flatMap(items -> ctx.event().createFollowup("You clicked: " + items.get(0))
.then(ctx.event().deleteFollowup(messageId))));
}
}
+
    +
  1. Since you want to listen for one specific select menu (and not all select menus with some customId), you generate a +customId that is unique for each invocation of the /select command. You can easily generate a random string +via java.util.UUID.
  2. +
  3. A first followup is sent with the message containing the select menu.
  4. +
  5. Once the message has been sent, call awaitSelectMenuItems(customId) with the same customId generated previously. It +will wait for the user to interact with the menu and will emit the value clicked.
  6. +
  7. The value received is then displayed via a new followup message.
  8. +
+
warning

If you don't make the customId unique on each run, there will be conflicts when the /select command is run several +times consecutively by the same user in the same channel.

+

Here is another example with awaitButtonClick(customId) that asks the user to confirm when resetting a user's +nickname:

+
package testbot1;

import botrino.interaction.annotation.UserCommand;
import botrino.interaction.context.UserInteractionContext;
import botrino.interaction.listener.UserInteractionListener;
import discord4j.core.object.component.ActionRow;
import discord4j.core.object.component.Button;
import discord4j.core.object.entity.Message;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Mono;

import java.util.UUID;

import static botrino.interaction.listener.ComponentInteractionListener.button;

@UserCommand("Reset Nickname")
public class ResetNickCommand implements UserInteractionListener {

@Override
public Publisher<?> run(UserInteractionContext ctx) {
final var guildId = ctx.event().getInteraction().getGuildId().orElse(null);
if (guildId == null) {
return ctx.event().createFollowup("Cannot use outside of a guild");
}
final var yesId = UUID.randomUUID().toString();
final var noId = UUID.randomUUID().toString();
return ctx.event().createFollowup("Reset the nickname of that user?")
.withComponents(ActionRow.of(
Button.primary(yesId, "Yes"),
Button.secondary(noId, "No")))
.map(Message::getId)
.flatMap(messageId -> Mono.firstWithValue(
ctx.awaitButtonClick(yesId),
ctx.awaitButtonClick(noId))
.flatMap(buttonClicked -> buttonClicked.equals(yesId) ? ctx.event()
.getClient()
.getMemberById(guildId, ctx.event().getTargetId())
.flatMap(member -> member.edit().withNicknameOrNull(null))
.then(ctx.event().createFollowup("Nickname reset successful!"))
: ctx.event().createFollowup("Action cancelled"))
.then(ctx.event().deleteFollowup(messageId)));
}
}
+

The code is quite self-explanatory: we display two buttons, one for "yes" and one for "no". We use Mono.firstWithValue +to only wait for the first click on either of the two buttons, and depending on which button was clicked, we execute one +or the other action.

+
tip

There exists a more generic method awaitComponentInteraction that lets you manipulate the underlying interaction +context before returning a value. It accepts a ComponentInteractionListener<R> that you can construct via its static +methods button(String, Function) and selectMenu(String, Function), each accepting the customId and a function +receiving a ButtonInteractionContext or SelectMenuInteractionContext and producing a value of any type.

+

Pagination system with components​

+

Making a pagination system is one of the most obvious use cases for message components. The library provides a static +method MessagePaginator::paginate to build paginated messages easily. See the example below:

+
package testbot1;

import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.context.ChatInputInteractionContext;
import botrino.interaction.listener.ChatInputInteractionListener;
import botrino.interaction.util.MessagePaginator;
import discord4j.core.object.component.ActionRow;
import discord4j.core.object.component.Button;
import discord4j.core.spec.MessageCreateSpec;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Mono;

@ChatInputCommand(name = "paginate", description = "Pagination testing")
public final class PaginateCommand implements ChatInputInteractionListener {

@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return MessagePaginator.paginate(ctx, 5, state -> Mono.just(MessageCreateSpec.create()
.withContent("Page " + (state.getPage() + 1) + "/" + state.getPageCount())
.withComponents(ActionRow.of(
state.previousButton(customId -> Button.secondary(customId, "<< Previous")),
state.nextButton(customId -> Button.secondary(customId, "Next >>")),
state.closeButton(customId -> Button.danger(customId, "Close"))
))));
}
}
+ +
    +
  • The paginate method takes 3 arguments. The first one is the interaction context, the second one is the total number +of pages, and the last one is a function that receives a state and produces the message to display. An overload exists +allowing you to specify the initial page number (by default it starts at the first page).
  • +
  • The state holds information on the current state of the paginator, such as the current page number and whether it is +active
  • +
  • To render the buttons, the state exposes three methods to build previous, next and close buttons respectively. The +state object controls whether the buttons are enabled or disabled according to whether we are at first page (in which +case previous button should be disabled), at last page (in which case next button should be disabled), or if the +paginator has already closed, in which case all buttons should be disabled.
  • +
+
info

The paginator automatically closes as per the await_component_timeout_seconds value defined in +the configuration.

\ No newline at end of file diff --git a/docs/interaction-library/filtering-and-adapting-events/index.html b/docs/interaction-library/filtering-and-adapting-events/index.html index c886e47..5d4706c 100644 --- a/docs/interaction-library/filtering-and-adapting-events/index.html +++ b/docs/interaction-library/filtering-and-adapting-events/index.html @@ -1,30 +1,49 @@ - + - - - - - + +Filtering and adapting events | Botrino -Filtering and adapting events | Botrino - - + + + - -
-

Filtering and adapting events

Listeners are triggered when an interaction event is received via the Discord gateway. It is possible for you to intervene between the moment the event is received and the moment the listener is triggered. This allows you to drop some events to prevent any command from being executed in a certain context, or to determine which locale to apply according to the event received.

The InteractionEventProcessor interface#

Create a class that implements InteractionEventProcessor. If you are using the Botrino framework, it will automatically be set into the interaction service. Otherwise, you need to set it via the builder when constructing your InteractionService:

final var interactionService = InteractionService.builder(config, gateway)
.setEventProcessor(new MyEventProcessor())
.build();

Here is an example of InteractionEventProcessor implementation:

package testbot1;
-
import botrino.interaction.InteractionEventProcessor;
import discord4j.core.event.domain.interaction.InteractionCreateEvent;
import discord4j.core.object.entity.channel.GuildMessageChannel;
import reactor.core.publisher.Mono;
-
import java.util.Locale;
-
public final class MyEventProcessor implements InteractionEventProcessor {
-
@Override
public Mono<Boolean> filter(InteractionCreateEvent event) {
return Mono.just(!event.getInteraction().getMember()
.map(member -> member.getDisplayName().toLowerCase().contains("ignore me"))
.orElse(true));
}
-
@Override
public Mono<Locale> computeLocale(InteractionCreateEvent event) {
return event.getInteraction().getChannel()
.ofType(GuildMessageChannel.class)
.flatMap(guildChannel -> {
if (guildChannel.getName().endsWith("fr")) {
return Mono.just(Locale.FRENCH);
} else if (guildChannel.getName().endsWith("de")) {
return Mono.just(Locale.GERMAN);
} else {
return Mono.empty();
}
});
}
}
  • filter(InteractionCreateEvent) allows to decide whether to keep or to drop the given InteractionCreateEvent. The default implementation will allow all events. This method can be useful if you want to implement a blacklist system to ban some users from using your bot. In this example, we are filtering out users which username contains the string "ignore me".
  • computeLocale(InteractionCreateEvent) allows to adapt the locale according to the event received. In order to keep the default locale, you are expected to return an empty Mono. The returned locale will be accessible via the InteractionContext (which implements botrino.api.Translator, see Internationalization). You will typically store the locale in a database (either per guild or per user) and retrieve it here using the data given by the interaction event. In this example, we are interpreting the suffix of the channel name as the locale, with only French and German being supported. It will use the default locale defined in the configuration in all other cases.
Considerations when using the Botrino framework
  • The implementation class must have a no-arg constructor.
  • If more than one implementation of InteractionEventProcessor are found, it will result in an error as it is impossible to determine which one to use. If you don't want to remove the extra implementation(s), you can mark one of them with the @Primary annotation to lift the ambiguity. You may alternatively use the @Exclude annotation if you don't want one implementation to be picked up by Botrino.
- - + +

Filtering and adapting events

Listeners are triggered when an interaction event is received via the Discord gateway. It is possible for you to +intervene between the moment the event is received and the moment the listener is triggered. This allows you to drop +some events to prevent any command from being executed in a certain context, or to determine which locale to apply +according to the event received.

+

The InteractionEventProcessor interface​

+

Create a class that implements InteractionEventProcessor. If you are using the Botrino framework, it will +automatically be set into the interaction service. Otherwise, you need to set it via the builder when constructing +your InteractionService:

+
final var interactionService = InteractionService.builder(config, gateway)
.setEventProcessor(new MyEventProcessor())
.build();
+

Here is an example of InteractionEventProcessor implementation:

+
package testbot1;

import botrino.interaction.InteractionEventProcessor;
import discord4j.core.event.domain.interaction.InteractionCreateEvent;
import discord4j.core.object.entity.channel.GuildMessageChannel;
import reactor.core.publisher.Mono;

import java.util.Locale;

public final class MyEventProcessor implements InteractionEventProcessor {

@Override
public Mono<Boolean> filter(InteractionCreateEvent event) {
return Mono.just(!event.getInteraction().getMember()
.map(member -> member.getDisplayName().toLowerCase().contains("ignore me"))
.orElse(true));
}

@Override
public Mono<Locale> computeLocale(InteractionCreateEvent event) {
return event.getInteraction().getChannel()
.ofType(GuildMessageChannel.class)
.flatMap(guildChannel -> {
if (guildChannel.getName().endsWith("fr")) {
return Mono.just(Locale.FRENCH);
} else if (guildChannel.getName().endsWith("de")) {
return Mono.just(Locale.GERMAN);
} else {
return Mono.empty();
}
});
}
}
+
    +
  • filter(InteractionCreateEvent) allows to decide whether to keep or to drop the given InteractionCreateEvent. The +default implementation will allow all events. This method can be useful if you want to implement a blacklist system to +ban some users from using your bot. In this example, we are filtering out users which username contains the string " +ignore me".
  • +
  • computeLocale(InteractionCreateEvent) allows to adapt the locale according to the event received. In order to keep +the default locale, you are expected to return an empty Mono. The returned locale will be accessible via +the InteractionContext (which implements botrino.api.Translator, see Internationalization). You +will typically store the locale in a database (either per guild or per user) and retrieve it here using the data given +by the interaction event. In this example, we are interpreting the suffix of the channel name as the locale, with only +French and German being supported. It will use the default locale defined in the configuration in +all other cases.
  • +
+
Considerations when using the Botrino framework
    +
  • The implementation class must have a no-arg constructor.
  • +
  • If more than one implementation of InteractionEventProcessor are found, it will result in an error as it is +impossible to determine which one to use. If you don't want to remove the extra implementation(s), you can mark one of +them with the @Primary annotation to lift the ambiguity. You may alternatively use the @Exclude annotation if you +don't want one implementation to be picked up by Botrino.
  • +
\ No newline at end of file diff --git a/docs/interaction-library/handling-errors/index.html b/docs/interaction-library/handling-errors/index.html index 607f728..14daac6 100644 --- a/docs/interaction-library/handling-errors/index.html +++ b/docs/interaction-library/handling-errors/index.html @@ -1,31 +1,53 @@ - + - - - - - + +Handling errors | Botrino -Handling errors | Botrino - - + + + - -
-

Handling errors

The execution of a interaction may fail for many reasons. You can handle these errors in a way that is adapted to each type of errors, this is done via the InteractionErrorHandler interface.

Global error handler#

You simply need to create a class implementing InteractionErrorHandler. If you are using the Botrino framework, it will automatically be set into the interaction service. Otherwise, you need to set it via the builder when constructing your InteractionService:

final var interactionService = InteractionService.builder(config, gateway)
.setErrorHandler(new MyErrorHandler())
.build();

Here is an example of InteractionErrorHandler implementation:

package testbot1;
-
import botrino.api.util.DurationUtils;
import botrino.interaction.InteractionErrorHandler;
import botrino.interaction.InteractionFailedException;
import botrino.interaction.context.InteractionContext;
import botrino.interaction.cooldown.CooldownException;
import botrino.interaction.privilege.PrivilegeException;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Mono;
-
public final class MyErrorHandler implements InteractionErrorHandler {
-
@Override
public Publisher<?> handleInteractionFailed(InteractionFailedException e, InteractionContext ctx) {
return ctx.event().createFollowup("\uD83D\uDEAB " + e.getMessage()).withEphemeral(true);
}
-
@Override
public Publisher<?> handlePrivilege(PrivilegeException e, InteractionContext ctx) {
return ctx.event().createFollowup("You have insufficient privileges " +
"to run this command.").withEphemeral(true);
}
-
@Override
public Publisher<?> handleCooldown(CooldownException e, InteractionContext ctx) {
return ctx.event().createFollowup("You are on cooldown. " +
"Retry in " + DurationUtils.format(e.getRetryAfter())).withEphemeral(true);
}
-
@Override
public Publisher<?> handleDefault(Throwable t, InteractionContext ctx) {
return ctx.event().createFollowup("Something went wrong! Sorry for the inconvenience.")
.withEphemeral(true)
.onErrorResume(e -> {
t.addSuppressed(e);
return Mono.empty();
}).then(Mono.error(t)); // Forward downstream for logging
}
}

The methods of InteractionErrorHandler correspond to the most common error types. Each method exposes the InteractionContext in which the error happened. None of them are required to be implemented, by default they just forward errors downstream which will only log them at ERROR level. Currently there are four of them:

  • handleInteractionFailed(InteractionFailedException, InteractionContext): allows recovering on a InteractionFailedException. This exception represents a "normal" failure of the command, when the end user is at fault. This exception is generally thrown by yourself in your run() method and carries a user-friendly message, so the way to handle it will mostly consist of replying to the user with that message.
  • handlePrivilege(PrivilegeException, CommandContext): allows recovering on a PrivilegeException. It is thrown when a user attempts to use a command with insufficient privileges. Typically, handling this exception will consist of telling the user they cannot use the command. More details on privileges can be found in this section.
  • handleCooldown(CooldownException, CommandContext): allows recovering on a CooldownException. It is thrown when a user attempts to use a command past the maximum usage limit within a time interval. Generally, it will be handled by notifying the user that they need to wait some time before trying the command again (the exception carries the exact time left). More details on cooldowns can be found in this section.
  • handleDefault(Throwable, CommandContext): allows recovering on an exception type that corresponds to none of the above.
Considerations when using the Botrino framework
  • The implementation class must have a no-arg constructor.
  • If more than one implementation of InteractionErrorHandler are found, it will result in an error as it is impossible to determine which one to use. If you don't want to remove the extra implementation(s), you can mark one of them with the @Primary annotation to lift the ambiguity. You may alternatively use the @Exclude annotation if you don't want one implementation to be picked up by Botrino.
- - + +

Handling errors

The execution of a interaction may fail for many reasons. You can handle these errors in a way that is adapted to each +type of errors, this is done via the InteractionErrorHandler interface.

+

Global error handler​

+

You simply need to create a class implementing InteractionErrorHandler. If you are using the Botrino framework, it +will automatically be set into the interaction service. Otherwise, you need to set it via the builder when constructing +your InteractionService:

+
final var interactionService = InteractionService.builder(config, gateway)
.setErrorHandler(new MyErrorHandler())
.build();
+

Here is an example of InteractionErrorHandler implementation:

+
package testbot1;

import botrino.api.util.DurationUtils;
import botrino.interaction.InteractionErrorHandler;
import botrino.interaction.InteractionFailedException;
import botrino.interaction.context.InteractionContext;
import botrino.interaction.cooldown.CooldownException;
import botrino.interaction.privilege.PrivilegeException;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Mono;

public final class MyErrorHandler implements InteractionErrorHandler {

@Override
public Publisher<?> handleInteractionFailed(InteractionFailedException e, InteractionContext ctx) {
return ctx.event().createFollowup("\uD83D\uDEAB " + e.getMessage()).withEphemeral(true);
}

@Override
public Publisher<?> handlePrivilege(PrivilegeException e, InteractionContext ctx) {
return ctx.event().createFollowup("You have insufficient privileges " +
"to run this command.").withEphemeral(true);
}

@Override
public Publisher<?> handleCooldown(CooldownException e, InteractionContext ctx) {
return ctx.event().createFollowup("You are on cooldown. " +
"Retry in " + DurationUtils.format(e.getRetryAfter())).withEphemeral(true);
}

@Override
public Publisher<?> handleDefault(Throwable t, InteractionContext ctx) {
return ctx.event().createFollowup("Something went wrong! Sorry for the inconvenience.")
.withEphemeral(true)
.onErrorResume(e -> {
t.addSuppressed(e);
return Mono.empty();
}).then(Mono.error(t)); // Forward downstream for logging
}
}
+

The methods of InteractionErrorHandler correspond to the most common error types. Each method exposes +the InteractionContext in which the error happened. None of them are required to be implemented, by default they just +forward errors downstream which will only log them at ERROR level. Currently there are four of them:

+
    +
  • handleInteractionFailed(InteractionFailedException, InteractionContext): allows recovering on +a InteractionFailedException. This exception represents a "normal" failure of the command, when the end user is at +fault. This exception is generally thrown by yourself in your run() method and carries a user-friendly message, so +the way to handle it will mostly consist of replying to the user with that message.
  • +
  • handlePrivilege(PrivilegeException, CommandContext): allows recovering on a PrivilegeException. It is thrown when +a user attempts to use a command with insufficient privileges. Typically, handling this exception will consist of +telling the user they cannot use the command. More details on privileges can be found +in this section.
  • +
  • handleCooldown(CooldownException, CommandContext): allows recovering on a CooldownException. It is thrown when a +user attempts to use a command past the maximum usage limit within a time interval. Generally, it will be handled by +notifying the user that they need to wait some time before trying the command again (the exception carries the exact +time left). More details on cooldowns can be found in this section.
  • +
  • handleDefault(Throwable, CommandContext): allows recovering on an exception type that corresponds to none of the +above.
  • +
+
Considerations when using the Botrino framework
    +
  • The implementation class must have a no-arg constructor.
  • +
  • If more than one implementation of InteractionErrorHandler are found, it will result in an error as it is impossible +to determine which one to use. If you don't want to remove the extra implementation(s), you can mark one of them with +the @Primary annotation to lift the ambiguity. You may alternatively use the @Exclude annotation if you don't want +one implementation to be picked up by Botrino.
  • +
\ No newline at end of file diff --git a/docs/interaction-library/overview/index.html b/docs/interaction-library/overview/index.html index adcfe0a..1cc70ee 100644 --- a/docs/interaction-library/overview/index.html +++ b/docs/interaction-library/overview/index.html @@ -1,56 +1,97 @@ - + - - - - - + +Overview | Botrino -Overview | Botrino - - + + + - -
-

Overview

Botrino comes with a library that allows to easily create application commands and listeners for Discord interactions. Discord recently added Application Commands as a native way to implement commands within Discord, as well as Message Components to allow for more specific and intuitive interactions with the bot.

Preamble#

Although it is designed to be an extension of the Botrino framework, this library is completely decoupled from the framework itself. As such, it is possible to add this library to your project even if you aren't using the framework. The only difference is that you won't benefit from the automatic registration of commands, but you will be able to use all features.

Features#

  • Straightforward annotation-based command declaration, with full support for slash commands with subcommands/subcommand groups and context menu commands
  • Automatic deployment of commands into the Discord application, with ability to choose whether to deploy them globally or in a specific guild during development
  • Inject command options into fields using annotations to conveniently access the values
  • Handle component interactions either by treating them as regular commands or by awaiting them in order to continue the execution of a parent command
  • Automatic ACK of interaction events, configurable on a per-command basis
  • Define privileges for each command with your own rules
  • Cooldown per user
  • Centralized error handling
  • Pre-process interaction events by filtering them or adapting the locale to the target user
  • Utilities such as pagination system using buttons

Quick start#

Prerequisites

JDK 11 or newer is required. You can download the OpenJDK here.

You have two ways to start a project. Choose only one of the two options.

Option 1: Using Botrino framework#

  1. Initialize your project by following the steps in the Getting Started page.

    tip

    If you decide to use the Maven archetype, the library will be already added, so you won't need to follow the next steps! Otherwise, continue reading.

  2. Add the following dependency in your project. Replace [VERSION] with the latest version as shown here: Maven Central

    <dependency>
    <groupId>com.alex1304.botrino</groupId>
    <artifactId>botrino-interaction</artifactId>
    <version>[VERSION]</version>
    </dependency>
  3. Add requires botrino.interaction in your module-info.java. You can actually remove requires botrino.api since botrino.interaction is already requiring it transitively.

    import botrino.api.annotation.BotModule;
    -
    @BotModule
    open module com.example.myproject {
    -
    requires botrino.interaction;
    }
  4. Add the following line in the end of your config.json:

    {
    // ...
    "interaction": {}
    }

You are now ready to add commands to your application, they will be registered automatically! You can jump directly to the Creating your first commands section.

Option 2: Using the library alone#

  1. Add the following dependency in your project. Replace [VERSION] with the latest version as shown here: Maven Central

    <dependency>
    <groupId>com.alex1304.botrino</groupId>
    <artifactId>botrino-interaction</artifactId>
    <version>[VERSION]</version>
    </dependency>
  2. Create a main method with these few lines of code:

    package testbot1;
    -
    import botrino.interaction.InteractionService;
    import botrino.interaction.config.InteractionConfig;
    import discord4j.core.DiscordClient;
    -
    public final class Main {
    -
    public static void main(String[] args) {
    final var config = InteractionConfig.builder()
    // Slash commands will be deployed to this guild (recommended during dev).
    // Not specifying anything will deploy globally.
    .applicationCommandsGuildId(361255823357509645L)
    .build();
    // Login to Discord using the token passed as program argument
    final var gateway = DiscordClient.create(args[0]).login().block();
    // Initialize the interaction service
    final var interactionService = InteractionService.create(config, gateway);
    // Register your commands
    interactionService.registerChatInputCommand(new PingCommand());
    // Listen for interaction events until the bot disconnects
    interactionService.run().takeUntilOther(gateway.onDisconnect()).block();
    }
    }

Creating your first commands#

A basic ping command#

package testbot1;
-
import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.listener.ChatInputInteractionListener;
import botrino.interaction.context.ChatInputInteractionContext;
import org.reactivestreams.Publisher;
-
@ChatInputCommand(name = "ping", description = "Pings the bot to check if it is alive.")
public final class PingCommand implements ChatInputInteractionListener {
-
@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().createFollowup("Pong !");
}
}

A command with options#

package testbot1;
-
import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.context.ChatInputInteractionContext;
import botrino.interaction.grammar.ChatInputCommandGrammar;
import botrino.interaction.listener.ChatInputInteractionListener;
import discord4j.core.object.command.ApplicationCommandOption;
import discord4j.discordjson.json.ApplicationCommandOptionData;
import org.reactivestreams.Publisher;
-
import java.util.List;
-
@ChatInputCommand(name = "options", description = "Option testing")
public class OptionsCommand implements ChatInputInteractionListener {
-
private final ChatInputCommandGrammar<Options> grammar = ChatInputCommandGrammar.of(Options.class);
-
@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return grammar.resolve(ctx.event()).flatMap(options -> ctx.event()
.createFollowup("Value of `my-string`: " + options.myString));
}
-
@Override
public List<ApplicationCommandOptionData> options() {
return grammar.toOptions();
}
-
private static class Options {
@ChatInputCommandGrammar.Option(
type = ApplicationCommandOption.Type.STRING,
name = "my-string",
description = "The string argument",
required = true,
choices = {
@ChatInputCommandGrammar.Choice(name = "Choice 1", stringValue = "1"),
@ChatInputCommandGrammar.Choice(name = "Choice 2", stringValue = "2"),
@ChatInputCommandGrammar.Choice(name = "Choice 3", stringValue = "3")
}
)
String myString;
}
}

A command with subcommands and subcommand groups#

@ChatInputCommand(
name = "nest",
description = "Subcommand testing",
subcommands = {
@Subcommand(name = "sub1", description = "Subcommand 1", listener = NestCommand.Sub1.class),
@Subcommand(name = "sub2", description = "Subcommand 2", listener = NestCommand.Sub2.class)
},
subcommandGroups = {
@SubcommandGroup(name = "group1", description = "Group 1", subcommands = {
@Subcommand(name = "sub", description = "Subcommand", listener = NestCommand.G1Sub.class)
})
}
)
public final class NestCommand {
-
public static final class Sub1 implements ChatInputInteractionListener {
-
@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().createFollowup("sub1: pong!");
}
}
-
public static final class Sub2 implements ChatInputInteractionListener {
-
@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().createFollowup("sub2: pong!");
}
}
-
public static final class G1Sub implements ChatInputInteractionListener {
-
@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().createFollowup("group1 sub: pong!");
}
}
}

A command using component interactions#

package testbot1;
-
import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.context.ChatInputInteractionContext;
import botrino.interaction.listener.ChatInputInteractionListener;
import discord4j.core.object.component.ActionRow;
import discord4j.core.object.component.SelectMenu;
import discord4j.core.object.entity.Message;
import discord4j.core.spec.InteractionFollowupCreateSpec;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Mono;
-
import java.util.UUID;
-
import static botrino.interaction.listener.ComponentInteractionListener.selectMenu;
-
@ChatInputCommand(name = "select", description = "Command for testing select menus")
public class SelectCommand implements ChatInputInteractionListener {
-
@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
final var customId = UUID.randomUUID().toString();
return ctx.event().createFollowup("Select an option:")
.withComponents(ActionRow.of(SelectMenu.of(customId,
SelectMenu.Option.of("option 1", "foo"),
SelectMenu.Option.of("option 2", "bar"),
SelectMenu.Option.of("option 3", "baz"))))
.map(Message::getId)
// Wait until the select menu is interacted with and return the value clicked
.flatMap(messageId -> ctx.awaitSelectMenuItems(customId)
.flatMap(items -> ctx.event().createFollowup("You clicked: " + items.get(0))
.then(ctx.event().deleteFollowup(messageId))));
}
}

A command using a pagination system based on components#

package testbot1;
-
import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.context.ChatInputInteractionContext;
import botrino.interaction.listener.ChatInputInteractionListener;
import botrino.interaction.util.MessagePaginator;
import discord4j.core.object.component.ActionRow;
import discord4j.core.object.component.Button;
import discord4j.core.spec.MessageCreateSpec;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Mono;
-
@ChatInputCommand(name = "paginate", description = "Pagination testing")
public final class PaginateCommand implements ChatInputInteractionListener {
-
@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return MessagePaginator.paginate(ctx, 5, state -> Mono.just(MessageCreateSpec.create()
.withContent("Page " + (state.getPage() + 1) + "/" + state.getPageCount())
.withComponents(ActionRow.of(
state.previousButton(customId -> Button.secondary(customId, "<< Previous")),
state.nextButton(customId -> Button.secondary(customId, "Next >>")),
state.closeButton(customId -> Button.danger(customId, "Close"))
))));
}
}
tip

All of these features (and more !) are fully documented in the next pages.

- - + +

Overview

Botrino comes with a library that allows to easily create application commands and listeners for Discord interactions. +Discord recently added Application Commands as +a native way to implement commands within Discord, as well +as Message Components to allow for more specific +and intuitive interactions with the bot.

+

Preamble​

+

Although it is designed to be an extension of the Botrino framework, this library is completely decoupled from the +framework itself. As such, it is possible to add this library to your project even if you aren't using the framework. +The only difference is that you won't benefit from the automatic registration of commands, but you will be able to use +all features.

+

Features​

+
    +
  • Straightforward annotation-based command declaration, with full support for slash commands with subcommands/subcommand +groups and context menu commands
  • +
  • Automatic deployment of commands into the Discord application, with ability to choose whether to deploy them globally +or in a specific guild during development
  • +
  • Inject command options into fields using annotations to conveniently access the values
  • +
  • Handle component interactions either by treating them as regular commands or by awaiting them in order to continue the +execution of a parent command
  • +
  • Automatic ACK of interaction events, configurable on a per-command basis
  • +
  • Define privileges for each command with your own rules
  • +
  • Cooldown per user
  • +
  • Centralized error handling
  • +
  • Pre-process interaction events by filtering them or adapting the locale to the target user
  • +
  • Utilities such as pagination system using buttons
  • +
+

Quick start​

+
Prerequisites

JDK 17 or newer is required. You can download the +OpenJDK here.

+

You have two ways to start a project. Choose only one of the two options.

+

Option 1: Using Botrino framework​

+
    +
  1. +

    Initialize your project by following the steps in the Getting Started page.

    +
    tip

    If you decide to use the Maven archetype, the library will be already added, so you won't need to follow the next +steps! Otherwise, continue reading.

    +
  2. +
  3. +

    Add the following dependency in your project. Replace [VERSION] with the latest version as shown +here: Maven Central

    +
    <dependency>
    <groupId>com.alex1304.botrino</groupId>
    <artifactId>botrino-interaction</artifactId>
    <version>[VERSION]</version>
    </dependency>
    +
  4. +
  5. +

    Add requires botrino.interaction in your module-info.java. You can actually remove requires botrino.api +since botrino.interaction is already requiring it transitively.

    +
    import botrino.api.annotation.BotModule;

    @BotModule
    open module com.example.myproject {

    requires botrino.interaction;
    }
    +
  6. +
  7. +

    Add the following line in the end of your config.json:

    +
        {
    // ...
    "interaction": {}
    }
    +
  8. +
+

You are now ready to add commands to your application, they will be registered automatically! You can jump directly to +the Creating your first commands section.

+

Option 2: Using the library alone​

+
    +
  1. +

    Add the following dependency in your project. Replace [VERSION] with the latest version as shown +here: Maven Central

    +
    <dependency>
    <groupId>com.alex1304.botrino</groupId>
    <artifactId>botrino-interaction</artifactId>
    <version>[VERSION]</version>
    </dependency>
    +
  2. +
  3. +

    Create a main method with these few lines of code:

    +
    package testbot1;

    import botrino.interaction.InteractionService;
    import botrino.interaction.config.InteractionConfig;
    import discord4j.core.DiscordClient;

    public final class Main {

    public static void main(String[] args) {
    final var config = InteractionConfig.builder()
    // Slash commands will be deployed to this guild (recommended during dev).
    // Not specifying anything will deploy globally.
    .applicationCommandsGuildId(361255823357509645L)
    .build();
    // Login to Discord using the token passed as program argument
    final var gateway = DiscordClient.create(args[0]).login().block();
    // Initialize the interaction service
    final var interactionService = InteractionService.create(config, gateway);
    // Register your commands
    interactionService.registerChatInputCommand(new PingCommand());
    // Listen for interaction events until the bot disconnects
    interactionService.run().takeUntilOther(gateway.onDisconnect()).block();
    }
    }
    +
  4. +
+

Creating your first commands​

+

A basic ping command​

+
package testbot1;

import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.listener.ChatInputInteractionListener;
import botrino.interaction.context.ChatInputInteractionContext;
import org.reactivestreams.Publisher;

@ChatInputCommand(name = "ping", description = "Pings the bot to check if it is alive.")
public final class PingCommand implements ChatInputInteractionListener {

@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().createFollowup("Pong !");
}
}
+

A command with options​

+
package testbot1;

import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.context.ChatInputInteractionContext;
import botrino.interaction.grammar.ChatInputCommandGrammar;
import botrino.interaction.listener.ChatInputInteractionListener;
import discord4j.core.object.command.ApplicationCommandOption;
import discord4j.discordjson.json.ApplicationCommandOptionData;
import org.reactivestreams.Publisher;

import java.util.List;

@ChatInputCommand(name = "options", description = "Option testing")
public class OptionsCommand implements ChatInputInteractionListener {

private final ChatInputCommandGrammar<Options> grammar = ChatInputCommandGrammar.of(Options.class);

@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return grammar.resolve(ctx.event()).flatMap(options -> ctx.event()
.createFollowup("Value of `my-string`: " + options.myString));
}

@Override
public List<ApplicationCommandOptionData> options() {
return grammar.toOptions();
}

private static class Options {
@ChatInputCommandGrammar.Option(
type = ApplicationCommandOption.Type.STRING,
name = "my-string",
description = "The string argument",
required = true,
choices = {
@ChatInputCommandGrammar.Choice(name = "Choice 1", stringValue = "1"),
@ChatInputCommandGrammar.Choice(name = "Choice 2", stringValue = "2"),
@ChatInputCommandGrammar.Choice(name = "Choice 3", stringValue = "3")
}
)
String myString;
}
}
+

A command with subcommands and subcommand groups​

+
@ChatInputCommand(
name = "nest",
description = "Subcommand testing",
subcommands = {
@Subcommand(name = "sub1", description = "Subcommand 1", listener = NestCommand.Sub1.class),
@Subcommand(name = "sub2", description = "Subcommand 2", listener = NestCommand.Sub2.class)
},
subcommandGroups = {
@SubcommandGroup(name = "group1", description = "Group 1", subcommands = {
@Subcommand(name = "sub", description = "Subcommand", listener = NestCommand.G1Sub.class)
})
}
)
public final class NestCommand {

public static final class Sub1 implements ChatInputInteractionListener {

@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().createFollowup("sub1: pong!");
}
}

public static final class Sub2 implements ChatInputInteractionListener {

@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().createFollowup("sub2: pong!");
}
}

public static final class G1Sub implements ChatInputInteractionListener {

@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return ctx.event().createFollowup("group1 sub: pong!");
}
}
}
+

A command using component interactions​

+
package testbot1;

import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.context.ChatInputInteractionContext;
import botrino.interaction.listener.ChatInputInteractionListener;
import discord4j.core.object.component.ActionRow;
import discord4j.core.object.component.SelectMenu;
import discord4j.core.object.entity.Message;
import discord4j.core.spec.InteractionFollowupCreateSpec;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Mono;

import java.util.UUID;

import static botrino.interaction.listener.ComponentInteractionListener.selectMenu;

@ChatInputCommand(name = "select", description = "Command for testing select menus")
public class SelectCommand implements ChatInputInteractionListener {

@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
final var customId = UUID.randomUUID().toString();
return ctx.event().createFollowup("Select an option:")
.withComponents(ActionRow.of(SelectMenu.of(customId,
SelectMenu.Option.of("option 1", "foo"),
SelectMenu.Option.of("option 2", "bar"),
SelectMenu.Option.of("option 3", "baz"))))
.map(Message::getId)
// Wait until the select menu is interacted with and return the value clicked
.flatMap(messageId -> ctx.awaitSelectMenuItems(customId)
.flatMap(items -> ctx.event().createFollowup("You clicked: " + items.get(0))
.then(ctx.event().deleteFollowup(messageId))));
}
}
+

A command using a pagination system based on components​

+
package testbot1;

import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.context.ChatInputInteractionContext;
import botrino.interaction.listener.ChatInputInteractionListener;
import botrino.interaction.util.MessagePaginator;
import discord4j.core.object.component.ActionRow;
import discord4j.core.object.component.Button;
import discord4j.core.spec.MessageCreateSpec;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Mono;

@ChatInputCommand(name = "paginate", description = "Pagination testing")
public final class PaginateCommand implements ChatInputInteractionListener {

@Override
public Publisher<?> run(ChatInputInteractionContext ctx) {
return MessagePaginator.paginate(ctx, 5, state -> Mono.just(MessageCreateSpec.create()
.withContent("Page " + (state.getPage() + 1) + "/" + state.getPageCount())
.withComponents(ActionRow.of(
state.previousButton(customId -> Button.secondary(customId, "<< Previous")),
state.nextButton(customId -> Button.secondary(customId, "Next >>")),
state.closeButton(customId -> Button.danger(customId, "Close"))
))));
}
}
+ +
tip

All of these features (and more !) are fully documented in the next pages.

\ No newline at end of file diff --git a/docs/interaction-library/privileges/index.html b/docs/interaction-library/privileges/index.html index 4022d9c..ec34ec2 100644 --- a/docs/interaction-library/privileges/index.html +++ b/docs/interaction-library/privileges/index.html @@ -1,25 +1,50 @@ - + - - - - - + +Privileges | Botrino -Privileges | Botrino - - + + + - -
-

Privileges

Another common use case when making commands is to be able to restrict access to some commands that should not be used by everyone. The Privilege API provides a way to conveniently implement these kind of restrictions.

info

The permission system proposed by Discord is currently not yet supported by Discord4J. As such, using this Privilege API is the recommended approach until Discord native permissions are fully supported. There is no plan to deprecate this feature for now.

The Privilege interface#

Privilege is a functional interface that is in charge of checking if access to the command is granted for a specific context. If granted, the abstract method of the interface returns a Mono that completes empty, which signals that the command can be run normally. If not granted, the returned Mono is expected to emit PrivilegeException (or a subclass of this exception), possibly carrying details on the reason of the failure. In this case, the command execution will be cancelled.

The InteractionListener superinterface, which is extended by ChatInputInteractionListener, UserInteractionListener, MessageInteractionListener and ComponentInteractionListener, provides a privilege() method that can be overriden in your command implementations.

An instance of this interface can be provided via a lambda expression. The example below defines a privilege which only grants users whose username starts with "A":

@Override
public Privilege privilege() {
return ctx -> Mono.justOrEmpty(ctx.event().getMessage().getAuthor())
.filter(author -> author.getUsername().startsWith("A"))
.switchIfEmpty(Mono.error(PrivilegeException::new))
.then();
}
info

Handling PrivilegeException (for example to display a user-friendly message) is documented on the Handling Errors page.

Privilege presets#

In most cases, checking if access to a command is granted will simply consist of checking if the user has a particular role or a particular permission in the guild. You can use one of the static methods of the Privileges class instead of implementing that yourself:

@Override
public Privilege privilege() {
return Privileges.checkPermissions(perms -> perms.contains(ADMINISTRATOR));
}

Check out the Javadoc for the Privileges class for more presets like this one.

Composing privileges#

You can compose several Privilege instances by using the and() and or() methods:

@Override
public Privilege privilege() {
return Privileges.checkRoles(roles -> !roles.isEmpty())
.or(Privileges.guildOwner());
}

This code means "Grant if the user has at least one role OR if they are the owner of the server".

- - + +

Privileges

Another common use case when making commands is to be able to restrict access to some commands that should not be used +by everyone. The Privilege API provides a way to conveniently implement these kind of restrictions.

+
info

The permission system proposed by Discord +is currently not yet supported by Discord4J. As such, using this Privilege API is the recommended approach until Discord +native permissions are fully supported. There is no plan to deprecate this feature for now.

+

The Privilege interface​

+

Privilege is a functional interface that is in charge of checking if access to the command is granted for a specific +context. If granted, the abstract method of the interface returns a Mono that completes empty, which signals that the +command can be run normally. If not granted, the returned Mono is expected to emit PrivilegeException (or a subclass +of this exception), possibly carrying details on the reason of the failure. In this case, the command execution will be +cancelled.

+

The InteractionListener superinterface, which is extended +by ChatInputInteractionListener, UserInteractionListener, MessageInteractionListener +and ComponentInteractionListener, provides a privilege() method that can be overriden in your command +implementations.

+

An instance of this interface can be provided via a lambda expression. The example below defines a privilege which only +grants users whose username starts with "A":

+
@Override
public Privilege privilege() {
return ctx -> Mono.justOrEmpty(ctx.event().getMessage().getAuthor())
.filter(author -> author.getUsername().startsWith("A"))
.switchIfEmpty(Mono.error(PrivilegeException::new))
.then();
}
+
info

Handling PrivilegeException (for example to display a user-friendly message) is documented on +the Handling Errors page.

+

Privilege presets​

+

In most cases, checking if access to a command is granted will simply consist of checking if the user has a particular +role or a particular permission in the guild. You can use one of the static methods of the Privileges class instead of +implementing that yourself:

+
@Override
public Privilege privilege() {
return Privileges.checkPermissions(perms -> perms.contains(ADMINISTRATOR));
}
+

Check out +the Javadoc for the Privileges class +for more presets like this one.

+

Composing privileges​

+

You can compose several Privilege instances by using the and() and or() methods:

+
@Override
public Privilege privilege() {
return Privileges.checkRoles(roles -> !roles.isEmpty())
.or(Privileges.guildOwner());
}
+

This code means "Grant if the user has at least one role OR if they are the owner of the server".

\ No newline at end of file diff --git a/img/d4j.svg b/img/d4j.svg index f1a2dbf..9621500 100644 --- a/img/d4j.svg +++ b/img/d4j.svg @@ -1,3 +1,63 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/img/logo.svg b/img/logo.svg index cb5f360..4803683 100644 --- a/img/logo.svg +++ b/img/logo.svg @@ -1,3 +1,31 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/img/undraw_Around_the_world_re_n353.svg b/img/undraw_Around_the_world_re_n353.svg index 64daeed..5398b7e 100644 --- a/img/undraw_Around_the_world_re_n353.svg +++ b/img/undraw_Around_the_world_re_n353.svg @@ -1 +1,78 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/img/undraw_Setup_re_y9w8.svg b/img/undraw_Setup_re_y9w8.svg index 8499d90..f0f3c96 100644 --- a/img/undraw_Setup_re_y9w8.svg +++ b/img/undraw_Setup_re_y9w8.svg @@ -1 +1,58 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/img/undraw_add_file_4gfw.svg b/img/undraw_add_file_4gfw.svg index 063e831..fe3e81c 100644 --- a/img/undraw_add_file_4gfw.svg +++ b/img/undraw_add_file_4gfw.svg @@ -1 +1,54 @@ -add_file \ No newline at end of file + + add_file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/img/undraw_building_blocks_n0nc.svg b/img/undraw_building_blocks_n0nc.svg index c04396e..c97fc97 100644 --- a/img/undraw_building_blocks_n0nc.svg +++ b/img/undraw_building_blocks_n0nc.svg @@ -1 +1,209 @@ -building_blocks \ No newline at end of file + + + + + + + + + + building_blocks + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/img/undraw_proud_coder_7ain.svg b/img/undraw_proud_coder_7ain.svg index 681668c..d160222 100644 --- a/img/undraw_proud_coder_7ain.svg +++ b/img/undraw_proud_coder_7ain.svg @@ -1 +1,88 @@ -proud_coder \ No newline at end of file + + proud_coder + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/index.html b/index.html index ef42038..d815384 100644 --- a/index.html +++ b/index.html @@ -1,25 +1,19 @@ - + - - - - - + +Homepage | Botrino -Homepage | Botrino - - + + + - -
-
logo

Botrino

A simple yet powerful framework to develop, configure and run Discord bots based on Discord4J.

Focused on modularity

Focused on modularity

Botrino is a JDK 11+ framework utilizing Java modules to organize and encapsulate the components of the bot application.

Powered by Discord4J

Powered by Discord4J

Discord4J is a modern Discord API wrapper for the JVM, natively supporting the reactive programming paradigm for the best performances at scale.

Easy setup and integration

Easy setup and integration

Botrino comes with a Maven archetype allowing you to get started with a fully working bot in just a few minutes, and automatically configures a runtime package using JLink.

Keep your code clean

Keep your code clean

The power of the framework resides in its ability to discover and auto-load classes defined in your modules. Focus on what matters: write one class for your command or your service, Botrino does the boring stuff for you.

Extensible

Extensible

You can extend the possibilities of Botrino by implementing your own extensions, by expressing what to do when a class is discovered in your module.

Translation ready

Translation ready

Want your bot to be available in multiple languages? Botrino supports i18n out of the box, the framework incentivizes the externalization of strings so they can be translated using services such as Crowdin.

- - + +
logo

Botrino

A simple yet powerful framework to develop, configure and run Discord bots based on Discord4J.

Focused on modularity

Focused on modularity

Botrino is a modern JDK 17+ framework utilizing Java modules to organize and encapsulate the components of the bot application.

Powered by Discord4J

Powered by Discord4J

Discord4J is a modern Discord API wrapper for the JVM, natively supporting the reactive programming paradigm for the best performances at scale.

Easy setup and integration

Easy setup and integration

Botrino comes with a Maven archetype allowing you to get started with a fully working bot in just a few minutes, and automatically configures a runtime package using JLink.

Keep your code clean

Keep your code clean

The power of the framework resides in its ability to discover and auto-load classes defined in your modules. Focus on what matters: write one class for your command or your service, Botrino does the boring stuff for you.

Extensible

Extensible

You can extend the possibilities of Botrino by implementing your own extensions, by expressing what to do when a class is discovered in your module.

Translation ready

Translation ready

Want your bot to be available in multiple languages? Botrino supports i18n out of the box, the framework incentivizes the externalization of strings so they can be translated using services such as Crowdin.

\ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml index b4405ff..4366bf2 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1 +1 @@ -https://botrino.alex1304.com/weekly0.5https://botrino.alex1304.com/docs/weekly0.5https://botrino.alex1304.com/docs/api/configuring-your-botweekly0.5https://botrino.alex1304.com/docs/api/customizing-the-discord-clientweekly0.5https://botrino.alex1304.com/docs/api/extensionsweekly0.5https://botrino.alex1304.com/docs/api/i18nweekly0.5https://botrino.alex1304.com/docs/api/working-with-servicesweekly0.5https://botrino.alex1304.com/docs/getting-startedweekly0.5https://botrino.alex1304.com/docs/interaction-library/acknowledging-interactionsweekly0.5https://botrino.alex1304.com/docs/interaction-library/configurationweekly0.5https://botrino.alex1304.com/docs/interaction-library/cooldownsweekly0.5https://botrino.alex1304.com/docs/interaction-library/creating-commandsweekly0.5https://botrino.alex1304.com/docs/interaction-library/dealing-with-componentsweekly0.5https://botrino.alex1304.com/docs/interaction-library/filtering-and-adapting-eventsweekly0.5https://botrino.alex1304.com/docs/interaction-library/handling-errorsweekly0.5https://botrino.alex1304.com/docs/interaction-library/overviewweekly0.5https://botrino.alex1304.com/docs/interaction-library/privilegesweekly0.5 \ No newline at end of file +https://botrino.alex1304.com/docs/weekly0.5https://botrino.alex1304.com/docs/api/configuring-your-botweekly0.5https://botrino.alex1304.com/docs/api/customizing-the-discord-clientweekly0.5https://botrino.alex1304.com/docs/api/extensionsweekly0.5https://botrino.alex1304.com/docs/api/i18nweekly0.5https://botrino.alex1304.com/docs/api/working-with-servicesweekly0.5https://botrino.alex1304.com/docs/getting-startedweekly0.5https://botrino.alex1304.com/docs/interaction-library/acknowledging-interactionsweekly0.5https://botrino.alex1304.com/docs/interaction-library/configurationweekly0.5https://botrino.alex1304.com/docs/interaction-library/cooldownsweekly0.5https://botrino.alex1304.com/docs/interaction-library/creating-commandsweekly0.5https://botrino.alex1304.com/docs/interaction-library/dealing-with-componentsweekly0.5https://botrino.alex1304.com/docs/interaction-library/filtering-and-adapting-eventsweekly0.5https://botrino.alex1304.com/docs/interaction-library/handling-errorsweekly0.5https://botrino.alex1304.com/docs/interaction-library/overviewweekly0.5https://botrino.alex1304.com/docs/interaction-library/privilegesweekly0.5https://botrino.alex1304.com/weekly0.5 \ No newline at end of file