docusaurus/assets/js/f60bb54b.ef0d30bc.js
2025-04-30 10:51:05 +00:00

4 lines
No EOL
30 KiB
JavaScript

"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["86216"],{13313:function(e,n,t){t.d(n,{Z:()=>s});let s="/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport type {SidebarsConfig} from '@docusaurus/plugin-content-docs';\n\nconst sidebars: SidebarsConfig = {\n docs: [\n 'introduction',\n {\n type: 'category',\n label: 'Getting Started',\n link: {\n type: 'generated-index',\n },\n collapsed: false,\n items: [\n 'installation',\n 'configuration',\n 'playground',\n 'typescript-support',\n ],\n },\n {\n type: 'category',\n label: 'Guides',\n link: {\n type: 'generated-index',\n title: 'Docusaurus Guides',\n description:\n \"Let's learn about the most important Docusaurus concepts!\",\n keywords: ['guides'],\n image: '/img/docusaurus.png',\n },\n items: [\n 'guides/creating-pages',\n {\n type: 'category',\n label: 'Docs',\n link: {\n type: 'doc',\n id: 'guides/docs/introduction',\n },\n items: [\n 'guides/docs/create-doc',\n {\n type: 'category',\n label: 'Sidebar',\n link: {\n type: 'doc',\n id: 'guides/docs/sidebar/index',\n },\n items: [\n 'guides/docs/sidebar/items',\n 'guides/docs/sidebar/autogenerated',\n 'guides/docs/sidebar/multiple-sidebars',\n ],\n },\n 'guides/docs/versioning',\n 'guides/docs/multi-instance',\n ],\n },\n 'blog',\n {\n type: 'category',\n label: 'Markdown Features',\n link: {\n type: 'doc',\n id: 'guides/markdown-features/introduction',\n },\n items: [\n 'guides/markdown-features/react',\n 'guides/markdown-features/tabs',\n 'guides/markdown-features/code-blocks',\n 'guides/markdown-features/admonitions',\n 'guides/markdown-features/toc',\n 'guides/markdown-features/assets',\n 'guides/markdown-features/links',\n 'guides/markdown-features/plugins',\n 'guides/markdown-features/math-equations',\n 'guides/markdown-features/diagrams',\n 'guides/markdown-features/head-metadata',\n ],\n },\n 'styling-layout',\n 'swizzling',\n 'static-assets',\n 'search',\n 'browser-support',\n 'seo',\n 'using-plugins',\n 'deployment',\n {\n type: 'category',\n label: 'Internationalization',\n link: {type: 'doc', id: 'i18n/introduction'},\n items: [\n {\n type: 'doc',\n id: 'i18n/tutorial',\n label: 'Tutorial',\n },\n {\n type: 'doc',\n id: 'i18n/git',\n label: 'Using Git',\n },\n {\n type: 'doc',\n id: 'i18n/crowdin',\n label: 'Using Crowdin',\n },\n ],\n },\n 'guides/whats-next',\n ],\n },\n {\n type: 'category',\n label: 'Advanced Guides',\n link: {type: 'doc', id: 'advanced/index'},\n items: [\n 'advanced/architecture',\n 'advanced/plugins',\n 'advanced/routing',\n 'advanced/ssg',\n 'advanced/client',\n ],\n },\n {\n type: 'category',\n label: 'Upgrading',\n link: {\n type: 'doc',\n id: 'migration/index',\n },\n items: [\n 'migration/v3',\n // TODO do we want to keep upgrade docs for older Docusaurus versions?\n // It contains links to docs of current version :/\n {\n type: 'category',\n label: 'To Docusaurus v2',\n items: [\n 'migration/v2/migration-overview',\n 'migration/v2/migration-automated',\n 'migration/v2/migration-manual',\n 'migration/v2/migration-versioned-sites',\n 'migration/v2/migration-translated-sites',\n ],\n },\n ],\n },\n ],\n api: [\n 'cli',\n 'docusaurus-core',\n {\n type: 'autogenerated',\n dirName: 'api',\n },\n ],\n};\n\nexport default sidebars;\n"},67014:function(e,n,t){t.r(n),t.d(n,{frontMatter:()=>l,default:()=>m,contentTitle:()=>c,assets:()=>d,toc:()=>u,metadata:()=>s});var s=JSON.parse('{"id":"guides/docs/sidebar/index","title":"Sidebar","description":"Creating a sidebar is useful to:","source":"@site/docs/guides/docs/sidebar/index.mdx","sourceDirName":"guides/docs/sidebar","slug":"/sidebar","permalink":"/docs/sidebar","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/guides/docs/sidebar/index.mdx","tags":[],"version":"current","lastUpdatedBy":"Shreedhar Bhat","lastUpdatedAt":1746010071000,"frontMatter":{"slug":"/sidebar"},"sidebar":"docs","previous":{"title":"Create a doc","permalink":"/docs/create-doc"},"next":{"title":"Sidebar items","permalink":"/docs/sidebar/items"}}'),r=t(85893),i=t(80980),a=t(86762),o=t(27817);let l={slug:"/sidebar"},c="Sidebar",d={},u=[{value:"Default sidebar",id:"default-sidebar",level:2},{value:"Sidebar object",id:"sidebar-object",level:2},{value:"Theme configuration",id:"theme-configuration",level:2},{value:"Hideable sidebar",id:"hideable-sidebar",level:3},{value:"Auto-collapse sidebar categories",id:"auto-collapse-sidebar-categories",level:3},{value:"Passing custom props",id:"passing-custom-props",level:2},{value:"Sidebar Breadcrumbs",id:"sidebar-breadcrumbs",level:2},{value:"Complex sidebars example",id:"complex-sidebars-example",level:2}];function h(e){let n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"sidebar",children:"Sidebar"})}),"\n",(0,r.jsx)(n.p,{children:"Creating a sidebar is useful to:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Group multiple ",(0,r.jsx)(n.strong,{children:"related documents"})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Display a sidebar"})," on each of those documents"]}),"\n",(0,r.jsxs)(n.li,{children:["Provide ",(0,r.jsx)(n.strong,{children:"paginated navigation"}),", with next/previous button"]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"To use sidebars on your Docusaurus site:"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["Define a sidebars file that exports a dictionary of ",(0,r.jsx)(n.a,{href:"#sidebar-object",children:"sidebar objects"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:["Pass its path to the ",(0,r.jsx)(n.code,{children:"@docusaurus/plugin-docs"})," plugin directly or via ",(0,r.jsx)(n.code,{children:"@docusaurus/preset-classic"}),"."]}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n presets: [\n [\n '@docusaurus/preset-classic',\n {\n docs: {\n // highlight-next-line\n sidebarPath: './sidebars.js',\n },\n },\n ],\n ],\n};\n"})}),"\n",(0,r.jsx)(n.admonition,{title:"Node.js runtime",type:"important",children:(0,r.jsx)(n.p,{children:"The sidebars file is run with Node.js. You can't use or import browsers APIs, React or JSX in it."})}),"\n",(0,r.jsx)(n.p,{children:"This section serves as an overview of miscellaneous features of the doc sidebar. In the following sections, we will more systematically introduce the following concepts:"}),"\n","\n",(0,r.jsx)(a.Z,{}),"\n",(0,r.jsx)(n.h2,{id:"default-sidebar",children:"Default sidebar"}),"\n",(0,r.jsxs)(n.p,{children:["If the ",(0,r.jsx)(n.code,{children:"sidebarPath"})," is unspecified, Docusaurus ",(0,r.jsx)(n.a,{href:"/docs/sidebar/autogenerated",children:"automatically generates a sidebar"})," for you, by using the filesystem structure of the ",(0,r.jsx)(n.code,{children:"docs"})," folder:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",metastring:'title="sidebars.js"',children:"export default {\n mySidebar: [\n {\n type: 'autogenerated',\n dirName: '.', // generate sidebar from the docs folder (or versioned_docs/<version>)\n },\n ],\n};\n"})}),"\n",(0,r.jsx)(n.p,{children:"You can also define your sidebars explicitly."}),"\n",(0,r.jsx)(n.h2,{id:"sidebar-object",children:"Sidebar object"}),"\n",(0,r.jsx)(n.p,{children:"A sidebar is a hierarchy of categories, doc links, and other hyperlinks."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type Sidebar =\n // Normal syntax\n | SidebarItem[]\n // Shorthand syntax\n | {[categoryLabel: string]: SidebarItem[]};\n"})}),"\n",(0,r.jsx)(n.p,{children:"For example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",metastring:'title="sidebars.js"',children:"export default {\n mySidebar: [\n {\n type: 'category',\n label: 'Getting Started',\n items: [\n {\n type: 'doc',\n id: 'doc1',\n },\n ],\n },\n {\n type: 'category',\n label: 'Docusaurus',\n items: [\n {\n type: 'doc',\n id: 'doc2',\n },\n {\n type: 'doc',\n id: 'doc3',\n },\n ],\n },\n {\n type: 'link',\n label: 'Learn more',\n href: 'https://example.com',\n },\n ],\n};\n"})}),"\n",(0,r.jsxs)(n.p,{children:["This is a sidebars file that exports one sidebar, called ",(0,r.jsx)(n.code,{children:"mySidebar"}),". It has three top-level items: two categories and one external link. Within each category, there are a few doc links."]}),"\n",(0,r.jsxs)(n.p,{children:["A sidebars file can contain ",(0,r.jsx)(n.a,{href:"/docs/sidebar/multiple-sidebars",children:(0,r.jsx)(n.strong,{children:"multiple sidebar objects"})}),", identified by their object keys."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type SidebarsFile = {\n [sidebarID: string]: Sidebar;\n};\n"})}),"\n",(0,r.jsx)(n.h2,{id:"theme-configuration",children:"Theme configuration"}),"\n",(0,r.jsx)(n.h3,{id:"hideable-sidebar",children:"Hideable sidebar"}),"\n",(0,r.jsxs)(n.p,{children:["By enabling the ",(0,r.jsx)(n.code,{children:"themeConfig.docs.sidebar.hideable"})," option, you can make the entire sidebar hideable, allowing users to better focus on the content. This is especially useful when content is consumed on medium-sized screens (e.g. tablets)."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n // highlight-start\n docs: {\n sidebar: {\n hideable: true,\n },\n },\n // highlight-end\n },\n};\n"})}),"\n",(0,r.jsx)(n.h3,{id:"auto-collapse-sidebar-categories",children:"Auto-collapse sidebar categories"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"themeConfig.docs.sidebar.autoCollapseCategories"})," option would collapse all sibling categories when expanding one category. This saves the user from having too many categories open and helps them focus on the selected section."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n // highlight-start\n docs: {\n sidebar: {\n autoCollapseCategories: true,\n },\n },\n // highlight-end\n },\n};\n"})}),"\n",(0,r.jsx)(n.h2,{id:"passing-custom-props",children:"Passing custom props"}),"\n",(0,r.jsxs)(n.p,{children:["To pass in custom props to a sidebar item, add the optional ",(0,r.jsx)(n.code,{children:"customProps"})," object to any of the items. This is useful to apply site customizations by swizzling React components rendering sidebar items."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"{\n type: 'doc',\n id: 'doc1',\n // highlight-start\n customProps: {\n badges: ['new', 'green'],\n featured: true,\n },\n // highlight-end\n};\n"})}),"\n",(0,r.jsx)(n.h2,{id:"sidebar-breadcrumbs",children:"Sidebar Breadcrumbs"}),"\n",(0,r.jsx)(n.p,{children:'By default, breadcrumbs are rendered at the top, using the "sidebar path" of the current page.'}),"\n",(0,r.jsx)(n.p,{children:"This behavior can be disabled with plugin options:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n presets: [\n [\n '@docusaurus/preset-classic',\n {\n docs: {\n // highlight-next-line\n breadcrumbs: false,\n },\n },\n ],\n ],\n};\n"})}),"\n",(0,r.jsx)(n.h2,{id:"complex-sidebars-example",children:"Complex sidebars example"}),"\n",(0,r.jsx)(n.p,{children:"A real-world example from the Docusaurus site:"}),"\n","\n",(0,r.jsx)(o.Z,{language:"js",title:"sidebars.js",children:t(13313).Z.split("\n").map(e=>!["//","/*","*"].some(n=>e.trim().startsWith(n))&&e).filter(Boolean).join("\n")})]})}function m(e={}){let{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},86762:function(e,n,t){t.d(n,{Z:()=>j});var s=t(85893);t(67294);var r=t(90496),i=t(85921),a=t(35363),o=t(11660),l=t(82095),c=t(77827),d=t(57922);let u={cardContainer:"cardContainer_Uewx",cardTitle:"cardTitle_dwRT",cardDescription:"cardDescription_mCBT"};function h(e){let{className:n,href:t,children:i}=e;return(0,s.jsx)(a.Z,{href:t,className:(0,r.Z)("card padding--lg",u.cardContainer,n),children:i})}function m(e){let{className:n,href:t,icon:i,title:a,description:o}=e;return(0,s.jsxs)(h,{href:t,className:n,children:[(0,s.jsxs)(d.Z,{as:"h2",className:(0,r.Z)("text--truncate",u.cardTitle),title:a,children:[i," ",a]}),o&&(0,s.jsx)("p",{className:(0,r.Z)("text--truncate",u.cardDescription),title:o,children:o})]})}function p(e){let{item:n}=e,t=(0,i.LM)(n),r=function(){let{selectMessage:e}=(0,o.c)();return n=>e(n,(0,c.I)({message:"1 item|{count} items",id:"theme.docs.DocCard.categoryDescription.plurals",description:"The default description for a category card in the generated index about how many items this category includes"},{count:n}))}();return t?(0,s.jsx)(m,{className:n.className,href:t,icon:"\uD83D\uDDC3\uFE0F",title:n.label,description:n.description??r(n.items.length)}):null}function g(e){let{item:n}=e,t=(0,l.Z)(n.href)?"\uD83D\uDCC4\uFE0F":"\uD83D\uDD17",r=(0,i.xz)(n.docId??void 0);return(0,s.jsx)(m,{className:n.className,href:n.href,icon:t,title:n.label,description:n.description??r?.description})}function b(e){let{item:n}=e;switch(n.type){case"link":return(0,s.jsx)(g,{item:n});case"category":return(0,s.jsx)(p,{item:n});default:throw Error(`unknown item type ${JSON.stringify(n)}`)}}function f(e){let{className:n}=e,t=(0,i.Ok)();return(0,s.jsx)(j,{items:t,className:n})}function x(e){let{item:n}=e;return(0,s.jsx)("article",{className:(0,r.Z)("docCardListItem_hvcp","col col--6"),children:(0,s.jsx)(b,{item:n})})}function j(e){let{items:n,className:t}=e;if(!n)return(0,s.jsx)(f,{...e});let a=(0,i.MN)(n);return(0,s.jsx)("section",{className:(0,r.Z)("row",t),children:a.map((e,n)=>(0,s.jsx)(x,{item:e},n))})}},11660:function(e,n,t){t.d(n,{c:()=>l});var s=t(67294),r=t(8156);let i=["zero","one","two","few","many","other"];function a(e){return i.filter(n=>e.includes(n))}let o={locale:"en",pluralForms:a(["one","other"]),select:e=>1===e?"one":"other"};function l(){let e=function(){let{i18n:{currentLocale:e}}=(0,r.Z)();return(0,s.useMemo)(()=>{try{let n=new Intl.PluralRules(e);return{locale:e,pluralForms:a(n.resolvedOptions().pluralCategories),select:e=>n.select(e)}}catch(n){return console.error(`Failed to use Intl.PluralRules for locale "${e}".
Docusaurus will fallback to the default (English) implementation.
Error: ${n.message}
`),o}},[e])}();return{selectMessage:(n,t)=>(function(e,n,t){let s=e.split("|");if(1===s.length)return s[0];s.length>t.pluralForms.length&&console.error(`For locale=${t.locale}, a maximum of ${t.pluralForms.length} plural forms are expected (${t.pluralForms.join(",")}), but the message contains ${s.length}: ${e}`);let r=t.select(n);return s[Math.min(t.pluralForms.indexOf(r),s.length-1)]})(t,n,e)}}},56497:function(e,n,t){t.d(n,{Z:()=>i});var s=t(85893);t(67294);var r=t(71607);function i(e){let{children:n,fallback:t}=e;return(0,r.Z)()?(0,s.jsx)(s.Fragment,{children:n?.()}):t??null}},27817:function(e,n,t){t.d(n,{Z:()=>eg});var s={};t.r(s),t.d(s,{ButtonExample:()=>eu});var r=t(85893),i=t(67294),a=t(71607),o=t(90496),l=t(45245),c=t(26378);function d(){let{prism:e}=(0,c.L)(),{colorMode:n}=(0,l.I)(),t=e.theme,s=e.darkTheme||t;return"dark"===n?s:t}var u=t(55951),h=t(6324),m=t.n(h),p=t(50923);let g=/title=(?<quote>["'])(?<title>.*?)\1/,b=/\{(?<range>[\d,-]+)\}/,f={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},x={...f,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:""}},j=Object.keys(f);function y(e,n){let t=e.map(e=>{let{start:t,end:s}=x[e];return`(?:${t}\\s*(${n.flatMap(e=>[e.line,e.block?.start,e.block?.end].filter(Boolean)).join("|")})\\s*${s})`}).join("|");return RegExp(`^\\s*(?:${t})\\s*$`)}let v=(0,i.createContext)(null);function k(e){let{metadata:n,wordWrap:t,children:s}=e,a=(0,i.useMemo)(()=>({metadata:n,wordWrap:t}),[n,t]);return(0,r.jsx)(v.Provider,{value:a,children:s})}function w(){let e=(0,i.useContext)(v);if(null===e)throw new p.i6("CodeBlockContextProvider");return e}function N(e){let{as:n,...t}=e,s=function(e){let n={color:"--prism-color",backgroundColor:"--prism-background-color"},t={};return Object.entries(e.plain).forEach(e=>{let[s,r]=e,i=n[s];i&&"string"==typeof r&&(t[i]=r)}),t}(d());return(0,r.jsx)(n,{...t,style:s,className:(0,o.Z)(t.className,"codeBlockContainer_jDV4",u.k.common.codeBlock)})}let C={codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q"};function B(e){let{children:n,className:t}=e;return(0,r.jsx)(N,{as:"pre",tabIndex:0,className:(0,o.Z)(C.codeBlockStandalone,"thin-scrollbar",t),children:(0,r.jsx)("code",{className:C.codeBlockLines,children:n})})}let L={attributes:!0,characterData:!0,childList:!0,subtree:!0};function S(e){let{children:n}=e;return n}var I=t(7316);function Z(e){let{line:n,token:t,...s}=e;return(0,r.jsx)("span",{...s})}let T={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function E(e){let{line:n,classNames:t,showLineNumbers:s,getLineProps:i,getTokenProps:a}=e,l=function(e){let n=1===e.length&&"\n"===e[0].content?e[0]:void 0;return n?[{...n,content:""}]:e}(n),c=i({line:l,className:(0,o.Z)(t,s&&T.codeLine)}),d=l.map((e,n)=>{let t=a({token:e});return(0,r.jsx)(Z,{...t,line:l,token:e,children:t.children},n)});return(0,r.jsxs)("span",{...c,children:[s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:T.codeLineNumber}),(0,r.jsx)("span",{className:T.codeLineContent,children:d})]}):d,(0,r.jsx)("br",{})]})}let _=i.forwardRef((e,n)=>(0,r.jsx)("pre",{ref:n,tabIndex:0,...e,className:(0,o.Z)(e.className,C.codeBlock,"thin-scrollbar")}));function D(e){let{metadata:n}=w();return(0,r.jsx)("code",{...e,className:(0,o.Z)(e.className,C.codeBlockLines,void 0!==n.lineNumbersStart&&C.codeBlockLinesWithNumbering),style:{...e.style,counterReset:void 0===n.lineNumbersStart?void 0:`line-count ${n.lineNumbersStart-1}`}})}function F(e){let{className:n}=e,{metadata:t,wordWrap:s}=w(),i=d(),{code:a,language:l,lineNumbersStart:c,lineClassNames:u}=t;return(0,r.jsx)(I.y$,{theme:i,code:a,language:l,children:e=>{let{className:t,style:i,tokens:a,getLineProps:l,getTokenProps:d}=e;return(0,r.jsx)(_,{ref:s.codeBlockRef,className:(0,o.Z)(n,t),style:i,children:(0,r.jsx)(D,{children:a.map((e,n)=>(0,r.jsx)(E,{line:e,getLineProps:l,getTokenProps:d,classNames:u[n],showLineNumbers:void 0!==c},n))})})}})}var $=t(56497),A=t(44771),M=t(77827);function P(e){let{className:n,...t}=e;return(0,r.jsx)("button",{type:"button",...t,className:(0,o.Z)("clean-btn",n)})}function R(e){return(0,r.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,r.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 W(e){return(0,r.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,r.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}let z={copyButtonCopied:"copyButtonCopied_wDuR",copyButtonIcons:"copyButtonIcons_gMWc",copyButtonIcon:"copyButtonIcon_GXfb",copyButtonSuccessIcon:"copyButtonSuccessIcon_ktUX"};function O(e){let{className:n}=e,{copyCode:t,isCopied:s}=function(){let{metadata:{code:e}}=w(),[n,t]=(0,i.useState)(!1),s=(0,i.useRef)(void 0),r=(0,i.useCallback)(()=>{(0,A.Z)(e),t(!0),s.current=window.setTimeout(()=>{t(!1)},1e3)},[e]);return(0,i.useEffect)(()=>()=>window.clearTimeout(s.current),[]),{copyCode:r,isCopied:n}}();return(0,r.jsx)(P,{"aria-label":s?(0,M.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,M.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,M.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,o.Z)(n,z.copyButton,s&&z.copyButtonCopied),onClick:t,children:(0,r.jsxs)("span",{className:z.copyButtonIcons,"aria-hidden":"true",children:[(0,r.jsx)(R,{className:z.copyButtonIcon}),(0,r.jsx)(W,{className:z.copyButtonSuccessIcon})]})})}function H(e){return(0,r.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,r.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"})})}let G={wordWrapButtonIcon:"wordWrapButtonIcon___5r",wordWrapButtonEnabled:"wordWrapButtonEnabled_nam_"};function U(e){let{className:n}=e,{wordWrap:t}=w();if(!(t.isEnabled||t.isCodeScrollable))return!1;let s=(0,M.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,r.jsx)(P,{onClick:()=>t.toggle(),className:(0,o.Z)(n,t.isEnabled&&G.wordWrapButtonEnabled),"aria-label":s,title:s,children:(0,r.jsx)(H,{className:G.wordWrapButtonIcon,"aria-hidden":"true"})})}function V(e){let{className:n}=e;return(0,r.jsx)($.Z,{children:()=>(0,r.jsxs)("div",{className:(0,o.Z)(n,"buttonGroup_KXnS"),children:[(0,r.jsx)(U,{}),(0,r.jsx)(O,{})]})})}let q={codeBlockContent:"codeBlockContent_cKMj",codeBlockTitle:"codeBlockTitle_U6Q0"};function X(e){let{className:n}=e,{metadata:t}=w();return(0,r.jsxs)(N,{as:"div",className:(0,o.Z)(n,t.className),children:[t.title&&(0,r.jsx)("div",{className:q.codeBlockTitle,children:(0,r.jsx)(S,{children:t.title})}),(0,r.jsxs)("div",{className:q.codeBlockContent,children:[(0,r.jsx)(F,{}),(0,r.jsx)(V,{})]})]})}function J(e){let n=function(e){let{prism:n}=(0,c.L)();return function(e){var n,t,s;let r=(t=(n={language:e.language,defaultLanguage:e.defaultLanguage,className:e.className}).language??function(e){if(!e)return;let n=e.split(" ").find(e=>e.startsWith("language-"));return n?.replace(/language-/,"")}(n.className)??n.defaultLanguage,t?.toLowerCase()??"text"),{lineClassNames:i,code:a}=function(e,n){let t=e.replace(/\r?\n$/,"");return function(e,n){let{metastring:t,magicComments:s}=n;if(t&&b.test(t)){let n=t.match(b).groups.range;if(0===s.length)throw Error(`A highlight range has been given in code block's metastring (\`\`\` ${t}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);let r=s[0].className;return{lineClassNames:Object.fromEntries(m()(n).filter(e=>e>0).map(e=>[e-1,[r]])),code:e}}return null}(t,{...n})??function(e,n){let{language:t,magicComments:s}=n;if(void 0===t)return{lineClassNames:{},code:e};let r=function(e,n){switch(e){case"js":case"javascript":case"ts":case"typescript":return y(["js","jsBlock"],n);case"jsx":case"tsx":return y(["js","jsBlock","jsx"],n);case"html":return y(["js","jsBlock","html"],n);case"python":case"py":case"bash":return y(["bash"],n);case"markdown":case"md":return y(["html","jsx","bash"],n);case"tex":case"latex":case"matlab":return y(["tex"],n);case"lua":case"haskell":return y(["lua"],n);case"sql":return y(["lua","jsBlock"],n);case"wasm":return y(["wasm"],n);case"vb":case"vba":case"visual-basic":return y(["vb","rem"],n);case"vbnet":return y(["vbnet","rem"],n);case"batch":return y(["rem"],n);case"basic":return y(["rem","f90"],n);case"fsharp":return y(["js","ml"],n);case"ocaml":case"sml":return y(["ml"],n);case"fortran":return y(["f90"],n);case"cobol":return y(["cobol"],n);default:return y(j,n)}}(t,s),i=e.split(/\r?\n/),a=Object.fromEntries(s.map(e=>[e.className,{start:0,range:""}])),o=Object.fromEntries(s.filter(e=>e.line).map(e=>{let{className:n,line:t}=e;return[t,n]})),l=Object.fromEntries(s.filter(e=>e.block).map(e=>{let{className:n,block:t}=e;return[t.start,n]})),c=Object.fromEntries(s.filter(e=>e.block).map(e=>{let{className:n,block:t}=e;return[t.end,n]}));for(let e=0;e<i.length;){let n=i[e].match(r);if(!n){e+=1;continue}let t=n.slice(1).find(e=>void 0!==e);o[t]?a[o[t]].range+=`${e},`:l[t]?a[l[t]].start=e:c[t]&&(a[c[t]].range+=`${a[c[t]].start}-${e-1},`),i.splice(e,1)}let d={};return Object.entries(a).forEach(e=>{let[n,{range:t}]=e;m()(t).forEach(e=>{d[e]??=[],d[e].push(n)})}),{code:i.join("\n"),lineClassNames:d}}(t,{...n})}(e.code,{metastring:e.metastring,magicComments:e.magicComments,language:r}),l=function(e){let{className:n,language:t}=e;return(0,o.Z)(n,t&&!n?.includes(`language-${t}`)&&`language-${t}`)}({className:e.className,language:r}),c=(s=e.metastring,(s?.match(g)?.groups.title??"")||e.title),d=function(e){let{showLineNumbers:n,metastring:t}=e;if("boolean"==typeof n)return n?1:void 0;if("number"==typeof n)return n;let s=t?.split(" ").find(e=>e.startsWith("showLineNumbers"));if(s)return s.startsWith("showLineNumbers=")?parseInt(s.replace("showLineNumbers=",""),10):1}({showLineNumbers:e.showLineNumbers,metastring:e.metastring});return{codeInput:e.code,code:a,className:l,language:r,title:c,lineNumbersStart:d,lineClassNames:i}}({code:e.children,className:e.className,metastring:e.metastring,magicComments:n.magicComments,defaultLanguage:n.defaultLanguage,language:e.language,title:e.title,showLineNumbers:e.showLineNumbers})}(e),t=function(){let[e,n]=(0,i.useState)(!1),[t,s]=(0,i.useState)(!1),r=(0,i.useRef)(null),a=(0,i.useCallback)(()=>{let t=r.current.querySelector("code");e?t.removeAttribute("style"):(t.style.whiteSpace="pre-wrap",t.style.overflowWrap="anywhere"),n(e=>!e)},[r,e]),o=(0,i.useCallback)(()=>{let{scrollWidth:e,clientWidth:n}=r.current;s(e>n||r.current.querySelector("code").hasAttribute("style"))},[r]),[l,c]=(0,i.useState)(),d=(0,i.useCallback)(()=>{c(r.current?.closest("[role=tabpanel][hidden]"))},[r,c]);return(0,i.useEffect)(()=>{d()},[d]),!function(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:L,s=(0,p.zX)(n),r=(0,p.Ql)(t);(0,i.useEffect)(()=>{let n=new MutationObserver(s);return e&&n.observe(e,r),()=>n.disconnect()},[e,s,r])}(l,e=>{e.forEach(e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(o(),d())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1}),(0,i.useEffect)(()=>{o()},[e,o]),(0,i.useEffect)(()=>(window.addEventListener("resize",o,{passive:!0}),()=>{window.removeEventListener("resize",o)}),[o]),{codeBlockRef:r,isEnabled:e,isCodeScrollable:t,toggle:a}}();return(0,r.jsx)(k,{metadata:n,wordWrap:t,children:(0,r.jsx)(X,{})})}function Q(e){let{children:n,...t}=e,s=(0,a.Z)(),o=i.Children.toArray(n).some(e=>(0,i.isValidElement)(e))?n:Array.isArray(n)?n.join(""):n;return(0,r.jsx)("string"==typeof o?J:B,{...t,children:o},String(s))}var Y=t(10075);let K=e=>`${e};`;function ee(e){let{code:n,children:t,...s}=e,i=d(),a=s.metastring?.includes("noInline")??!1;return(0,r.jsx)(Y.nu,{noInline:a,theme:i,...s,code:n?.replace(/\n$/,""),transformCode:s.transformCode??K,children:t})}function en(e){let{children:n}=e;return(0,r.jsx)("div",{className:"playgroundContainer_TDLX",children:n})}var et=t(85108),es=t(67490);function er(e){let{children:n}=e;return(0,r.jsx)("div",{className:(0,o.Z)("playgroundHeader_h_Hu"),children:n})}function ei(){return(0,r.jsx)("div",{children:"Loading..."})}function ea(){return(0,r.jsx)($.Z,{fallback:(0,r.jsx)(ei,{}),children:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(es.Z,{fallback:e=>(0,r.jsx)(et.Ac,{...e}),children:(0,r.jsx)(Y.i5,{})}),(0,r.jsx)(Y.IF,{})]})})}function eo(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(er,{children:(0,r.jsx)(M.Z,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,r.jsx)("div",{className:"playgroundPreview_u2xE",children:(0,r.jsx)(ea,{})})]})}function el(){let e=(0,a.Z)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(er,{children:(0,r.jsx)(M.Z,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,r.jsx)(Y.uz,{className:"playgroundEditor_uqZ4"},String(e))]})}function ec(){let{playgroundPosition:e}=(0,c.L)().liveCodeBlock;return(0,r.jsx)(r.Fragment,{children:"top"===e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eo,{}),(0,r.jsx)(el,{})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(el,{}),(0,r.jsx)(eo,{})]})})}function ed(e){let{children:n,transformCode:t,...s}=e;return(0,r.jsx)(en,{children:(0,r.jsx)(ee,{code:n,...s,children:(0,r.jsx)(ec,{})})})}function eu(e){return(0,r.jsx)("button",{type:"button",...e,style:{backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer",...e.style}})}let eh={React:i,...i,...s};function em(e){return(0,r.jsx)(ed,{scope:eh,...e})}function ep(e){return e.live?(0,r.jsx)(em,{...e}):(0,r.jsx)(Q,{...e})}function eg(e){return(0,r.jsx)(ep,{...e})}}}]);