mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-03 03:12:35 +02:00
1 line
No EOL
45 KiB
JavaScript
1 line
No EOL
45 KiB
JavaScript
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["6940"],{72188:function(e,t,r){r.r(t),r.d(t,{metadata:()=>n,contentTitle:()=>d,default:()=>h,assets:()=>p,toc:()=>f,frontMatter:()=>u});var n=JSON.parse('{"id":"api/plugins/plugin-sitemap","title":"\uD83D\uDCE6 plugin-sitemap","description":"This plugin creates sitemaps for your site so that search engine crawlers can crawl your site more accurately.","source":"@site/docs/api/plugins/plugin-sitemap.mdx","sourceDirName":"api/plugins","slug":"/api/plugins/@docusaurus/plugin-sitemap","permalink":"/docs/api/plugins/@docusaurus/plugin-sitemap","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/plugins/plugin-sitemap.mdx","tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1728655362000,"sidebarPosition":10,"frontMatter":{"sidebar_position":10,"slug":"/api/plugins/@docusaurus/plugin-sitemap"},"sidebar":"api","previous":{"title":"\uD83D\uDCE6 plugin-pwa","permalink":"/docs/api/plugins/@docusaurus/plugin-pwa"},"next":{"title":"\uD83D\uDCE6 plugin-vercel-analytics","permalink":"/docs/api/plugins/@docusaurus/plugin-vercel-analytics"}}'),o=r("24246"),i=r("80980"),a=r("15398"),c=r("58636"),l=r("32240"),s=r("66359");let u={sidebar_position:10,slug:"/api/plugins/@docusaurus/plugin-sitemap"},d="\uD83D\uDCE6 plugin-sitemap",p={},f=[{value:"Installation",id:"installation",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Types",id:"types",level:3},{value:"<code>CreateSitemapItemsFn</code>",id:"CreateSitemapItemsFn",level:4},{value:"Example configuration",id:"ex-config",level:3}];function b(e){let t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",li:"li",mdxAdmonitionTitle:"mdxAdmonitionTitle",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.header,{children:(0,o.jsx)(t.h1,{id:"-plugin-sitemap",children:"\uD83D\uDCE6 plugin-sitemap"})}),"\n","\n",(0,o.jsx)(t.p,{children:"This plugin creates sitemaps for your site so that search engine crawlers can crawl your site more accurately."}),"\n",(0,o.jsx)(t.admonition,{title:"production only",type:"warning",children:(0,o.jsxs)(t.p,{children:["This plugin is always inactive in development and ",(0,o.jsx)(t.strong,{children:"only active in production"})," because it works on the build output."]})}),"\n",(0,o.jsx)(t.h2,{id:"installation",children:"Installation"}),"\n",(0,o.jsxs)(a.Z,{groupId:"npm2yarn",children:[(0,o.jsx)(c.Z,{value:"npm",children:(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"npm install --save @docusaurus/plugin-sitemap\n"})})}),(0,o.jsx)(c.Z,{value:"yarn",label:"Yarn",children:(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"yarn add @docusaurus/plugin-sitemap\n"})})}),(0,o.jsx)(c.Z,{value:"pnpm",label:"pnpm",children:(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"pnpm add @docusaurus/plugin-sitemap\n"})})})]}),"\n",(0,o.jsxs)(t.admonition,{type:"tip",children:[(0,o.jsxs)(t.p,{children:["If you use the preset ",(0,o.jsx)(t.code,{children:"@docusaurus/preset-classic"}),", you don't need to install this plugin as a dependency."]}),(0,o.jsxs)(t.p,{children:["You can configure this plugin through the ",(0,o.jsx)(t.a,{href:"/docs/using-plugins#docusauruspreset-classic",children:"preset options"}),"."]})]}),"\n",(0,o.jsx)(t.h2,{id:"configuration",children:"Configuration"}),"\n",(0,o.jsx)(t.p,{children:"Accepted fields:"}),"\n",(0,o.jsx)(l.Z,{children:(0,o.jsxs)(t.table,{children:[(0,o.jsx)(t.thead,{children:(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.th,{children:"Name"}),(0,o.jsx)(t.th,{children:"Type"}),(0,o.jsx)(t.th,{children:"Default"}),(0,o.jsx)(t.th,{children:"Description"})]})}),(0,o.jsxs)(t.tbody,{children:[(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:(0,o.jsx)(t.code,{children:"lastmod"})}),(0,o.jsx)(t.td,{children:(0,o.jsx)(t.code,{children:"'date' | 'datetime' | null"})}),(0,o.jsx)(t.td,{children:(0,o.jsx)(t.code,{children:"null"})}),(0,o.jsxs)(t.td,{children:[(0,o.jsx)(t.code,{children:"date"})," is YYYY-MM-DD. ",(0,o.jsx)(t.code,{children:"datetime"})," is a ISO 8601 datetime. ",(0,o.jsx)(t.code,{children:"null"})," is disabled. See ",(0,o.jsx)(t.a,{href:"https://www.sitemaps.org/protocol.html#xmlTagDefinitions",children:"sitemap docs"}),"."]})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:(0,o.jsx)(t.code,{children:"changefreq"})}),(0,o.jsx)(t.td,{children:(0,o.jsx)(t.code,{children:"string | null"})}),(0,o.jsx)(t.td,{children:(0,o.jsx)(t.code,{children:"'weekly'"})}),(0,o.jsxs)(t.td,{children:["See ",(0,o.jsx)(t.a,{href:"https://www.sitemaps.org/protocol.html#xmlTagDefinitions",children:"sitemap docs"})]})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:(0,o.jsx)(t.code,{children:"priority"})}),(0,o.jsx)(t.td,{children:(0,o.jsx)(t.code,{children:"number | null"})}),(0,o.jsx)(t.td,{children:(0,o.jsx)(t.code,{children:"0.5"})}),(0,o.jsxs)(t.td,{children:["See ",(0,o.jsx)(t.a,{href:"https://www.sitemaps.org/protocol.html#xmlTagDefinitions",children:"sitemap docs"})]})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:(0,o.jsx)(t.code,{children:"ignorePatterns"})}),(0,o.jsx)(t.td,{children:(0,o.jsx)(t.code,{children:"string[]"})}),(0,o.jsx)(t.td,{children:(0,o.jsx)(t.code,{children:"[]"})}),(0,o.jsx)(t.td,{children:"A list of glob patterns; matching route paths will be filtered from the sitemap. Note that you may need to include the base URL in here."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:(0,o.jsx)(t.code,{children:"filename"})}),(0,o.jsx)(t.td,{children:(0,o.jsx)(t.code,{children:"string"})}),(0,o.jsx)(t.td,{children:(0,o.jsx)(t.code,{children:"sitemap.xml"})}),(0,o.jsx)(t.td,{children:"The path to the created sitemap file, relative to the output directory. Useful if you have two plugin instances outputting two files."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:(0,o.jsx)(t.code,{children:"createSitemapItems"})}),(0,o.jsx)(t.td,{children:(0,o.jsxs)("code",{children:[(0,o.jsx)(t.a,{href:"#CreateSitemapItemsFn",children:"CreateSitemapItemsFn"})," | undefined"]})}),(0,o.jsx)(t.td,{children:(0,o.jsx)(t.code,{children:"undefined"})}),(0,o.jsx)(t.td,{children:"An optional function which can be used to transform and / or filter the items in the sitemap."})]})]})]})}),"\n",(0,o.jsx)(t.h3,{id:"types",children:"Types"}),"\n",(0,o.jsx)(t.h4,{id:"CreateSitemapItemsFn",children:(0,o.jsx)(t.code,{children:"CreateSitemapItemsFn"})}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-ts",children:"type CreateSitemapItemsFn = (params: {\n siteConfig: DocusaurusConfig;\n routes: RouteConfig[];\n defaultCreateSitemapItems: CreateSitemapItemsFn;\n}) => Promise<SitemapItem[]>;\n"})}),"\n",(0,o.jsxs)(t.admonition,{type:"info",children:[(0,o.jsx)(t.p,{children:"This plugin also respects some site config:"}),(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.a,{href:"/docs/api/docusaurus-config#noIndex",children:(0,o.jsx)(t.code,{children:"noIndex"})}),": results in no sitemap generated"]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.a,{href:"/docs/api/docusaurus-config#trailingSlash",children:(0,o.jsx)(t.code,{children:"trailingSlash"})}),": determines if the URLs in the sitemap have trailing slashes"]}),"\n"]})]}),"\n",(0,o.jsxs)(t.admonition,{type:"note",children:[(0,o.jsxs)(t.mdxAdmonitionTitle,{children:["About ",(0,o.jsx)(t.code,{children:"lastmod"})]}),(0,o.jsxs)(t.p,{children:["The ",(0,o.jsx)(t.code,{children:"lastmod"})," option will only output a sitemap ",(0,o.jsx)(t.code,{children:"<lastmod>"})," tag if plugins provide ",(0,o.jsx)(t.a,{href:"/docs/api/plugin-methods/lifecycle-apis#addRoute",children:"route metadata"})," attributes ",(0,o.jsx)(t.code,{children:"sourceFilePath"})," and/or ",(0,o.jsx)(t.code,{children:"lastUpdatedAt"}),"."]}),(0,o.jsxs)(t.p,{children:["All the official content plugins provide the metadata for routes backed by a content file (Markdown, MDX or React page components), but it is possible third-party plugin authors do not provide this information, and the plugin will not be able to output a ",(0,o.jsx)(t.code,{children:"<lastmod>"})," tag for their routes."]})]}),"\n",(0,o.jsx)(t.h3,{id:"ex-config",children:"Example configuration"}),"\n",(0,o.jsx)(t.p,{children:"You can configure this plugin through preset options or plugin options."}),"\n",(0,o.jsx)(t.admonition,{type:"tip",children:(0,o.jsx)(t.p,{children:"Most Docusaurus users configure this plugin through the preset options."})}),"\n","\n",(0,o.jsx)(s.Z,{pluginName:"@docusaurus/plugin-sitemap",presetOptionName:"sitemap",code:"{\n lastmod: 'date',\n changefreq: 'weekly',\n priority: 0.5,\n ignorePatterns: ['/tags/**'],\n filename: 'sitemap.xml',\n createSitemapItems: async (params) => {\n const {defaultCreateSitemapItems, ...rest} = params;\n const items = await defaultCreateSitemapItems(rest);\n return items.filter((item) => !item.url.includes('/page/'));\n },\n}"}),"\n",(0,o.jsxs)(t.p,{children:["You can find your sitemap at ",(0,o.jsx)(t.code,{children:"/sitemap.xml"}),"."]})]})}function h(e={}){let{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(b,{...e})}):b(e)}},58636:function(e,t,r){r.d(t,{Z:()=>a});var n=r("24246");r("27378");var o=r("90496");let i="tabItem_pnkT";function a(e){var t=e.children,r=e.hidden,a=e.className;return(0,n.jsx)("div",{role:"tabpanel",className:(0,o.Z)(i,a),hidden:r,children:t})}},15398:function(e,t,r){r.d(t,{Z:()=>P});var n=r("24246"),o=r("27378"),i=r("90496"),a=r("54947"),c=r("3620"),l=r("844"),s=r("97486"),u=r("32263"),d=r("16971");function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,c=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){c=!0,n=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(c)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e){var t,r;return null!==(r=null===(t=o.Children.toArray(e).filter(function(e){return"\n"!==e}).map(function(e){var t,r;if(!e||(0,o.isValidElement)(e)&&(t=e.props)&&(void 0===t?"undefined":(r=t)&&"undefined"!=typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)=="object"&&"value"in t)return e;throw Error("Docusaurus error: Bad <Tabs> child <".concat("string"==typeof e.type?e.type:e.type.name,'>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.'))}))||void 0===t?void 0:t.filter(Boolean))&&void 0!==r?r:[]}function h(e){var t=e.value;return e.tabValues.some(function(e){return e.value===t})}var m=r("71607");let y="tabList_Qoir",g="tabItem_AQgk";function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,i;n=e,o=t,i=r[t],o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})}return e}function v(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function O(e){var t=e.className,r=e.block,o=e.selectedValue,c=e.selectValue,l=e.tabValues,s=[],u=(0,a.o5)().blockElementScrollPositionUntilNextRender,d=function(e){var t=e.currentTarget,r=l[s.indexOf(t)].value;r!==o&&(u(t),c(r))},p=function(e){var t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":var r,n=s.indexOf(e.currentTarget)+1;t=null!==(r=s[n])&&void 0!==r?r:s[0];break;case"ArrowLeft":var o,i=s.indexOf(e.currentTarget)-1;t=null!==(o=s[i])&&void 0!==o?o:s[s.length-1]}null==t||t.focus()};return(0,n.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.Z)("tabs",{"tabs--block":r},t),children:l.map(function(e){var t=e.value,r=e.label,a=e.attributes;return(0,n.jsx)("li",v(j({role:"tab",tabIndex:o===t?0:-1,"aria-selected":o===t,ref:function(e){return s.push(e)},onKeyDown:p,onClick:d},a),{className:(0,i.Z)("tabs__item",g,null==a?void 0:a.className,{"tabs__item--active":o===t}),children:null!=r?r:t}),t)})})}function x(e){var t=e.lazy,r=e.children,a=e.selectedValue,c=(Array.isArray(r)?r:[r]).filter(Boolean);if(t){var l=c.find(function(e){return e.props.value===a});return l?(0,o.cloneElement)(l,{className:(0,i.Z)("margin-top--md",l.props.className)}):null}return(0,n.jsx)("div",{className:"margin-top--md",children:c.map(function(e,t){return(0,o.cloneElement)(e,{key:t,hidden:e.props.value!==a})})})}function w(e){var t=function(e){var t,r,n,i,a,p,m,y,g,j,v,O,x,w,P=e.defaultValue,S=e.queryString,k=e.groupId;var I=(r=(t=e).values,n=t.children,(0,o.useMemo)(function(){var e=null!=r?r:b(n).map(function(e){var t=e.props;return{value:t.value,label:t.label,attributes:t.attributes,default:t.default}});return!function(e){var t=(0,u.lx)(e,function(e,t){return e.value===t.value});if(t.length>0)throw Error('Docusaurus error: Duplicate values "'.concat(t.map(function(e){return e.value}).join(", "),'" found in <Tabs>. Every value needs to be unique.'))}(e),e},[r,n])),E=f((0,o.useState)(function(){return function(e){var t,r=e.defaultValue,n=e.tabValues;if(0===n.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(r){if(!h({value:r,tabValues:n}))throw Error('Docusaurus error: The <Tabs> has a defaultValue "'.concat(r,'" but none of its children has the corresponding value. Available values are: ').concat(n.map(function(e){return e.value}).join(", "),". If you intend to show no default tab, use defaultValue={null} instead."));return r}var o=null!==(t=n.find(function(e){return e.default}))&&void 0!==t?t:n[0];if(!o)throw Error("Unexpected error: 0 tabValues");return o.value}({defaultValue:P,tabValues:I})}),2),C=E[0],N=E[1];var D=f((a=(i={queryString:void 0!==S&&S,groupId:k}).queryString,p=i.groupId,m=(0,c.k6)(),y=function(e){var t=e.queryString,r=void 0!==t&&t,n=e.groupId;if("string"==typeof r)return r;if(!1===r)return null;if(!0===r&&!n)throw 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 null!=n?n:null}({queryString:void 0!==a&&a,groupId:p}),[(0,s._X)(y),(0,o.useCallback)(function(e){if(!!y){var t,r,n=new URLSearchParams(m.location.search);n.set(y,e),m.replace((t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,i;n=e,o=t,i=r[t],o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})}return e}({},m.location),r=(r={search:n.toString()},r),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}},[y,m])]),2),A=D[0],B=D[1];var T=f((j=(g=({groupId:k}).groupId)?"docusaurus.tab.".concat(g):null,O=(v=f((0,d.Nk)(j),2))[0],x=v[1],[O,(0,o.useCallback)(function(e){if(!!j)x.set(e)},[j,x])]),2),Z=T[0],L=T[1];var _=h({value:w=null!=A?A:Z,tabValues:I})?w:null;return(0,l.Z)(function(){_&&N(_)},[_]),{selectedValue:C,selectValue:(0,o.useCallback)(function(e){if(!h({value:e,tabValues:I}))throw Error("Can't select invalid tab value=".concat(e));N(e),B(e),L(e)},[B,L,I]),tabValues:I}}(e);return(0,n.jsxs)("div",{className:(0,i.Z)("tabs-container",y),children:[(0,n.jsx)(O,j({},t,e)),(0,n.jsx)(x,j({},t,e))]})}function P(e){var t=(0,m.Z)();return(0,n.jsx)(w,v(j({},e),{children:b(e.children)}),String(t))}},56497:function(e,t,r){r.d(t,{Z:function(){return i}});var n=r(24246);r(27378);var o=r(71607);function i(e){var t=e.children,r=e.fallback;return(0,o.Z)()?(0,n.jsx)(n.Fragment,{children:null==t?void 0:t()}):null!=r?r:null}},32240:function(e,t,r){r.d(t,{Z:()=>d});var n=r("24246"),o=r("27378"),i=r("96700"),a=r("3620");let c="apiTable_e8hp";function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,c=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){c=!0,n=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(c)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var u=o.forwardRef(function(e,t){var r=e.name,c=e.children,l=function(e){for(var t=e;(0,o.isValidElement)(t);)t=s(o.Children.toArray(t.props.children),1)[0];if("string"!=typeof t)throw Error("Could not extract APITable row name from JSX tree:\n".concat(JSON.stringify(e,null,2)));return t}(c),u=r?"".concat(r,"-").concat(l):l,d="#".concat(u),p=(0,a.k6)();return(0,i.Z)().collectAnchor(u),(0,n.jsx)("tr",{id:u,tabIndex:0,ref:p.location.hash===d?t:void 0,onClick:function(e){var t,r="TD"===e.target.tagName.toUpperCase(),n=!!(null===(t=window.getSelection())||void 0===t?void 0:t.toString());r&&!n&&p.push(d)},onKeyDown:function(e){"Enter"===e.key&&p.push(d)},children:c.props.children})});function d(e){var t=e.children,r=e.name;if("table"!==t.type)throw Error("Bad usage of APITable component.\nIt is probably that your Markdown table is malformed.\nMake sure to double-check you have the appropriate number of columns for each table row.");var i=s(o.Children.toArray(t.props.children),2),a=i[0],l=i[1],d=(0,o.useRef)(null);(0,o.useEffect)(function(){var e;null===(e=d.current)||void 0===e||e.focus()},[d]);var p=o.Children.map(l.props.children,function(e){return(0,n.jsx)(u,{name:r,ref:d,children:e})});return(0,n.jsxs)("table",{className:c,children:[a,(0,n.jsx)("tbody",{children:p})]})}},66359:function(e,t,r){r.d(t,{Z:function(){return d}});var n=r(24246);r(27378);var o=r(35363),i=r(90158),a=r(77827),c=r(15398),l=r(58636),s=r(95998),u=void 0;function d(e){var t=e.code,r=e.pluginName,d=e.presetOptionName,p=(0,i.useActiveVersion)(u).path;return(0,n.jsxs)(c.Z,{groupId:"api-config-ex",children:[(0,n.jsxs)(l.Z,{value:"preset",label:(0,a.I)({message:"Preset options"}),children:[(0,n.jsx)("p",{children:(0,n.jsx)(a.Z,{id:"apiDocs.configTabs.presetOptions.description",values:{presetLink:(0,n.jsx)(o.Z,{to:"".concat(p,"/using-plugins#docusauruspreset-classic"),children:(0,n.jsx)(a.Z,{children:"preset options"})})},children:"If you use a preset, configure this plugin through the {presetLink}:"})}),(0,n.jsx)(s.Z,{language:"js",title:"docusaurus.config.js",children:"module.exports = {\n presets: [\n [\n '@docusaurus/preset-classic',\n {\n // highlight-start\n ".concat(d,": ").concat(t.replace(/\n/g,"\n "),",\n // highlight-end\n },\n ],\n ],\n};")})]}),(0,n.jsxs)(l.Z,{value:"plugin",label:(0,a.I)({message:"Plugin options"}),children:[(0,n.jsx)("p",{children:(0,n.jsx)(a.Z,{children:"If you are using a standalone plugin, provide options directly to the plugin:"})}),(0,n.jsx)(s.Z,{language:"js",title:"docusaurus.config.js",children:"module.exports = {\n plugins: [\n [\n '".concat(r,"',\n // highlight-start\n ").concat(t.replace(/\n/g,"\n "),",\n // highlight-end\n ],\n ],\n};")})]})]})}},95998:function(e,t,r){r.d(t,{Z:()=>ey});var n,o,i,a={};r.r(a),r.d(a,{ButtonExample:()=>T});var c=r("24246"),l=r("27378"),s=r("90496"),u=r("71607"),d=r("10075"),p=r("77827"),f=r("8156"),b=r("56497"),h=r("85108"),m=r("45245"),y=r("26378");function g(){var e=(0,y.L)().prism,t=(0,m.I)().colorMode,r=e.theme,n=e.darkTheme||r;return"dark"===t?n:r}var j=r("67490");let v="playgroundContainer_6Ior",O="playgroundHeader_Tvsk",x="playgroundEditor_TySg",w="playgroundPreview_mApW";function P(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,i;n=e,o=t,i=r[t],o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})}return e}function S(e){var t=e.children;return(0,c.jsx)("div",{className:(0,s.Z)(O),children:t})}function k(){return(0,c.jsx)("div",{children:"Loading..."})}function I(){return(0,c.jsx)(b.Z,{fallback:(0,c.jsx)(k,{}),children:function(){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(j.Z,{fallback:function(e){return(0,c.jsx)(h.Ac,P({},e))},children:(0,c.jsx)(d.i5,{})}),(0,c.jsx)(d.IF,{})]})}})}function E(){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(S,{children:(0,c.jsx)(p.Z,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,c.jsx)("div",{className:w,children:(0,c.jsx)(I,{})})]})}function C(){var e=(0,u.Z)();return(0,c.jsx)(d.uz,{className:x},String(e))}function N(){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(S,{children:(0,c.jsx)(p.Z,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,c.jsx)(C,{})]})}var D=function(e){return"".concat(e,";")};function A(e){var t,r,n,o,i=e.children,a=e.transformCode,l=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++){if(r=i[n],!(t.indexOf(r)>=0))Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}}return o}(e,["children","transformCode"]),s=(0,f.Z)().siteConfig.themeConfig.liveCodeBlock.playgroundPosition,u=g(),p=null!==(o=null===(n=l.metastring)||void 0===n?void 0:n.includes("noInline"))&&void 0!==o&&o;return(0,c.jsx)("div",{className:v,children:(0,c.jsx)(d.nu,(t=P({code:null==i?void 0:i.replace(/\n$/,""),noInline:p,transformCode:null!=a?a:D,theme:u},l),r=(r={children:"top"===s?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(E,{}),(0,c.jsx)(N,{})]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(N,{}),(0,c.jsx)(E,{})]})},r),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))})}function B(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,i;n=e,o=t,i=r[t],o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})}return e}function T(e){var t,r;return(0,c.jsx)("button",(t=B({type:"button"},e),r=(r={style:B({backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer"},e.style)},r),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}let Z=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,i;n=e,o=t,i=r[t],o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})}return e}({React:l},l,a);var L=r("55951"),_=r("6324"),V=r.n(_);function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function R(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,c=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){c=!0,n=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(c)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return M(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return M(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var F=RegExp("title=(?<quote>[\"'])(?<title>.*?)\\1"),q=RegExp("\\{(?<range>[\\d,-]+)\\}"),U={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}};var W=(n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,i;n=e,o=t,i=r[t],o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})}return e}({},U),o=(o={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:""}},o),Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n),H=Object.keys(U);function Y(e,t){var r=e.map(function(e){var r=W[e],n=r.start,o=r.end;return"(?:".concat(n,"\\s*(").concat(t.flatMap(function(e){var t,r;return[e.line,null===(t=e.block)||void 0===t?void 0:t.start,null===(r=e.block)||void 0===r?void 0:r.end].filter(Boolean)}).join("|"),")\\s*").concat(o,")")}).join("|");return new RegExp("^\\s*(?:".concat(r,")\\s*$"))}let z="codeBlockContainer_jDV4";function $(e){var t,r,n,o,i=e.as,a=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++){if(r=i[n],!(t.indexOf(r)>=0))Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}}return o}(e,["as"]);var l=(t={color:"--prism-color",backgroundColor:"--prism-background-color"},r={},Object.entries(g().plain).forEach(function(e){var n=R(e,2),o=n[0],i=n[1],a=t[o];a&&"string"==typeof i&&(r[a]=i)}),r);return(0,c.jsx)(i,(n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,i;n=e,o=t,i=r[t],o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})}return e}({},a),o=(o={style:l,className:(0,s.Z)(a.className,z,L.k.common.codeBlock)},o),Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n))}let G={codeBlockContent:"codeBlockContent_vx7S",codeBlockTitle:"codeBlockTitle_bdru",codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q",buttonGroup:"buttonGroup_cUGO"};function Q(e){var t=e.children,r=e.className;return(0,c.jsx)($,{as:"pre",tabIndex:0,className:(0,s.Z)(G.codeBlockStandalone,"thin-scrollbar",r),children:(0,c.jsx)("code",{className:G.codeBlockLines,children:t})})}var X=r("50923"),J={attributes:!0,characterData:!0,childList:!0,subtree:!0};function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ee(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,c=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){c=!0,n=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(c)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return K(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return K(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var et=r("7316");let er={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function en(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,i;n=e,o=t,i=r[t],o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})}return e}function eo(e){var t,r,n=e.line,o=e.classNames,i=e.showLineNumbers,a=e.getLineProps,l=e.getTokenProps;1===n.length&&"\n"===n[0].content&&(n[0].content="");var u=a({line:n,className:(0,s.Z)(o,i&&er.codeLine)}),d=n.map(function(e,t){return(0,c.jsx)("span",en({},l({token:e})),t)});return(0,c.jsxs)("span",(t=en({},u),r=(r={children:[i?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:er.codeLineNumber}),(0,c.jsx)("span",{className:er.codeLineContent,children:d})]}):d,(0,c.jsx)("br",{})]},r),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}var ei=r("44771");function ea(e){var t,r;return(0,c.jsx)("svg",(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,i;n=e,o=t,i=r[t],o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})}return e}({viewBox:"0 0 24 24"},e),r=(r={children:(0,c.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"})},r),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}function ec(e){var t,r;return(0,c.jsx)("svg",(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,i;n=e,o=t,i=r[t],o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})}return e}({viewBox:"0 0 24 24"},e),r=(r={children:(0,c.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})},r),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}let el={copyButtonCopied:"copyButtonCopied_OkN_",copyButtonIcons:"copyButtonIcons_OqsO",copyButtonIcon:"copyButtonIcon_PgCn",copyButtonSuccessIcon:"copyButtonSuccessIcon_bsQG"};function es(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function eu(e){var t,r,n=e.code,o=e.className;var i=(t=(0,l.useState)(!1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,c=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){c=!0,n=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(c)throw n}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return es(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return es(e,t)}}(t,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=i[0],u=i[1],d=(0,l.useRef)(void 0),f=(0,l.useCallback)(function(){(0,ei.Z)(n),u(!0),d.current=window.setTimeout(function(){u(!1)},1e3)},[n]);return(0,l.useEffect)(function(){return function(){return window.clearTimeout(d.current)}},[]),(0,c.jsx)("button",{type:"button","aria-label":a?(0,p.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,p.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,p.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,s.Z)("clean-btn",o,el.copyButton,a&&el.copyButtonCopied),onClick:f,children:(0,c.jsxs)("span",{className:el.copyButtonIcons,"aria-hidden":"true",children:[(0,c.jsx)(ea,{className:el.copyButtonIcon}),(0,c.jsx)(ec,{className:el.copyButtonSuccessIcon})]})})}function ed(e){var t,r;return(0,c.jsx)("svg",(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,i;n=e,o=t,i=r[t],o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})}return e}({viewBox:"0 0 24 24"},e),r=(r={children:(0,c.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"})},r),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}let ep={wordWrapButtonIcon:"wordWrapButtonIcon_MQXS",wordWrapButtonEnabled:"wordWrapButtonEnabled_TBIH"};function ef(e){var t=e.className,r=e.onClick,n=e.isEnabled,o=(0,p.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,c.jsx)("button",{type:"button",onClick:r,className:(0,s.Z)("clean-btn",t,n&&ep.wordWrapButtonEnabled),"aria-label":o,title:o,children:(0,c.jsx)(ed,{className:ep.wordWrapButtonIcon,"aria-hidden":"true"})})}function eb(e){var t,r,n,o,i,a,u,d,p,f,b,h,m,j,v,O,x,w,P,S,k,I,E=e.children,C=e.className,N=void 0===C?"":C,D=e.metastring,A=e.title,B=e.showLineNumbers,T=e.language,Z=(0,y.L)().prism,L=Z.defaultLanguage,_=Z.magicComments;var M=null==(r=null!==(I=null!=T?T:null==(t=N.split(" ").find(function(e){return e.startsWith("language-")}))?void 0:t.replace(/language-/,""))&&void 0!==I?I:L)?void 0:r.toLowerCase(),U=g();var W=(o=(n=ee((0,l.useState)(!1),2))[0],i=n[1],u=(a=ee((0,l.useState)(!1),2))[0],d=a[1],p=(0,l.useRef)(null),f=(0,l.useCallback)(function(){var e=p.current.querySelector("code");o?e.removeAttribute("style"):(e.style.whiteSpace="pre-wrap",e.style.overflowWrap="anywhere"),i(function(e){return!e})},[p,o]),b=(0,l.useCallback)(function(){var e=p.current;d(e.scrollWidth>e.clientWidth||p.current.querySelector("code").hasAttribute("style"))},[p]),h=p,m=b,v=(j=ee((0,l.useState)(),2))[0],O=j[1],x=(0,l.useCallback)(function(){var e;O(null===(e=h.current)||void 0===e?void 0:e.closest("[role=tabpanel][hidden]"))},[h,O]),(0,l.useEffect)(function(){x()},[x]),function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:J,n=(0,X.zX)(t),o=(0,X.Ql)(r);(0,l.useEffect)(function(){var t=new MutationObserver(n);return e&&t.observe(e,o),function(){return t.disconnect()}},[e,n,o])}(v,function(e){e.forEach(function(e){"attributes"===e.type&&"hidden"===e.attributeName&&(m(),x())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1}),(0,l.useEffect)(function(){b()},[o,b]),(0,l.useEffect)(function(){return window.addEventListener("resize",b,{passive:!0}),function(){window.removeEventListener("resize",b)}},[b]),{codeBlockRef:p,isEnabled:o,isCodeScrollable:u,toggle:f});var z=(null!==(S=null==(w=D)?void 0:null===(P=w.match(F))||void 0===P?void 0:P.groups.title)&&void 0!==S?S:"")||A,Q=function(e,t){var r=e.replace(/\n$/,""),n=t.language,o=t.magicComments,i=t.metastring;if(i&&q.test(i)){var a=i.match(q).groups.range;if(0===o.length)throw Error("A highlight range has been given in code block's metastring (``` ".concat(i,"), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges."));var c=o[0].className;return{lineClassNames:Object.fromEntries(V()(a).filter(function(e){return e>0}).map(function(e){return[e-1,[c]]})),code:r}}if(void 0===n)return{lineClassNames:{},code:r};for(var l=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return Y(["js","jsBlock"],t);case"jsx":case"tsx":return Y(["js","jsBlock","jsx"],t);case"html":return Y(["js","jsBlock","html"],t);case"python":case"py":case"bash":return Y(["bash"],t);case"markdown":case"md":return Y(["html","jsx","bash"],t);case"tex":case"latex":case"matlab":return Y(["tex"],t);case"lua":case"haskell":case"sql":return Y(["lua"],t);case"wasm":return Y(["wasm"],t);case"vb":case"vba":case"visual-basic":return Y(["vb","rem"],t);case"vbnet":return Y(["vbnet","rem"],t);case"batch":return Y(["rem"],t);case"basic":return Y(["rem","f90"],t);case"fsharp":return Y(["js","ml"],t);case"ocaml":case"sml":return Y(["ml"],t);case"fortran":return Y(["f90"],t);case"cobol":return Y(["cobol"],t);default:return Y(H,t)}}(n,o),s=r.split("\n"),u=Object.fromEntries(o.map(function(e){return[e.className,{start:0,range:""}]})),d=Object.fromEntries(o.filter(function(e){return e.line}).map(function(e){var t=e.className;return[e.line,t]})),p=Object.fromEntries(o.filter(function(e){return e.block}).map(function(e){var t=e.className;return[e.block.start,t]})),f=Object.fromEntries(o.filter(function(e){return e.block}).map(function(e){var t=e.className;return[e.block.end,t]})),b=0;b<s.length;){var h=s[b].match(l);if(!h){b+=1;continue}var m=h.slice(1).find(function(e){return void 0!==e});d[m]?u[d[m]].range+="".concat(b,","):p[m]?u[p[m]].start=b:f[m]&&(u[f[m]].range+="".concat(u[f[m]].start,"-").concat(b-1,",")),s.splice(b,1)}r=s.join("\n");var y={};return Object.entries(u).forEach(function(e){var t=R(e,2),r=t[0],n=t[1].range;V()(n).forEach(function(e){var t;null!==(t=y[e])&&void 0!==t||(y[e]=[]),y[e].push(r)})}),{lineClassNames:y,code:r}}(E,{metastring:D,language:M,magicComments:_}),K=Q.lineClassNames,er=Q.code;var en=null!=B?B:!!(null==(k=D)?void 0:k.includes("showLineNumbers"));return(0,c.jsxs)($,{as:"div",className:(0,s.Z)(N,M&&!N.includes("language-".concat(M))&&"language-".concat(M)),children:[z&&(0,c.jsx)("div",{className:G.codeBlockTitle,children:z}),(0,c.jsxs)("div",{className:G.codeBlockContent,children:[(0,c.jsx)(et.y$,{theme:U,code:er,language:null!=M?M:"text",children:function(e){var t=e.className,r=e.style,n=e.tokens,o=e.getLineProps,i=e.getTokenProps;return(0,c.jsx)("pre",{tabIndex:0,ref:W.codeBlockRef,className:(0,s.Z)(t,G.codeBlock,"thin-scrollbar"),style:r,children:(0,c.jsx)("code",{className:(0,s.Z)(G.codeBlockLines,en&&G.codeBlockLinesWithNumbering),children:n.map(function(e,t){return(0,c.jsx)(eo,{line:e,getLineProps:o,getTokenProps:i,classNames:K[t],showLineNumbers:en},t)})})})}}),(0,c.jsxs)("div",{className:G.buttonGroup,children:[(W.isEnabled||W.isCodeScrollable)&&(0,c.jsx)(ef,{className:G.codeButton,onClick:function(){return W.toggle()},isEnabled:W.isEnabled}),(0,c.jsx)(eu,{className:G.codeButton,code:er})]})]})]})}function eh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,i;n=e,o=t,i=r[t],o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})}return e}let em=(i=function(e){var t,r,n,o=e.children,i=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++){if(r=i[n],!(t.indexOf(r)>=0))Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}}return o}(e,["children"]),a=(0,u.Z)();var s=(t=o,l.Children.toArray(t).some(function(e){return(0,l.isValidElement)(e)})?t:Array.isArray(t)?t.join(""):t),d="string"==typeof s?eb:Q;return(0,c.jsx)(d,(r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,i;n=e,o=t,i=r[t],o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})}return e}({},i),n=(n={children:s},n),Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r),String(a))},function(e){return e.live?(0,c.jsx)(A,eh({scope:Z},e)):(0,c.jsx)(i,eh({},e))});function ey(e){return(0,c.jsx)(em,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,i;n=e,o=t,i=r[t],o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})}return e}({},e))}}}]); |