"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[4036],{70048:function(y,l,t){t.d(l,{K:function(){return s}});var e=t(18690);function s(m){return(0,e.g)()}},5077:function(y,l,t){t.d(l,{b:function(){return x},W:function(){return H}});var e=t(31085),s=t(14041),m=t(18690),C=t(24504),M=t(72020),R=t(86892),p=t(16203),j=t(45061),L=t(39299),B=t(82779),I=t(70048),g=t(19402),K=t(22020),W=t(26679),D=t(72427),S=t(82266),A=t(38282),O=t(64947);function U(){const a=(0,D.gf)(W.l),{retry:n,...o}=(0,A.A)(async()=>await a.getCookie(),[a]),r=(0,s.useCallback)(i=>{const u=(1+3*Math.random())*6e4,c=Date.parse(i)-Date.now()-u,E=setTimeout(n,c);return()=>clearTimeout(E)},[n]);return{...o,retry:n,refresh:r}}function T({children:a}){const n=(0,S.n)(),{Progress:o}=n.getComponents(),[r]=(0,s.useState)(()=>new BroadcastChannel("techdocs-cookie-refresh")),{loading:i,error:u,value:c,retry:E,refresh:v}=U();return(0,s.useEffect)(()=>{if(!c)return()=>{};r.postMessage({action:"TECHDOCS_COOKIE_REFRESHED",payload:c});let h=v(c.expiresAt);const d=f=>{const{action:P,payload:_}=f.data;P==="TECHDOCS_COOKIE_REFRESHED"&&(h(),h=v(_.expiresAt))};return r.addEventListener("message",d),()=>{h(),r.removeEventListener("message",d)}},[c,v,r]),u?(0,e.jsx)(K.b,{error:u,children:(0,e.jsx)(O.A,{variant:"outlined",onClick:E,children:"Retry"})}):i?(0,e.jsx)(o,{}):a}const x=a=>{const{withSearch:n,withHeader:o=!0}=a;return(0,e.jsxs)(C.Y,{themeId:"documentation",children:[o&&(0,e.jsx)(j.T,{}),(0,e.jsx)(L.Z,{}),(0,e.jsx)(p.p,{withSearch:n})]})},H=a=>{const{kind:n,name:o,namespace:r}=(0,I.K)(B.Oc),{children:i,entityRef:u={kind:n,name:o,namespace:r}}=a,c=(0,m.P1)();if(!i){const h=(c?s.Children.toArray(c.props.children):[]).flatMap(d=>{var f,P;return(P=d==null||(f=d.props)===null||f===void 0?void 0:f.children)!==null&&P!==void 0?P:[]}).find(d=>!(0,g.E)(d,M.AF)&&!(0,g.E)(d,M.Wm));return(0,e.jsx)(T,{children:(0,e.jsx)(R.R,{entityRef:u,children:h||(0,e.jsx)(x,{})})})}return(0,e.jsx)(T,{children:(0,e.jsx)(R.R,{entityRef:u,children:({metadata:E,entityMetadata:v,onReady:h})=>(0,e.jsx)("div",{className:"techdocs-reader-page",children:(0,e.jsx)(C.Y,{themeId:"documentation",children:i instanceof Function?i({entityRef:u,techdocsMetadataValue:E.value,entityMetadataValue:v.value,onReady:h}):i})})})})}},84036:function(y,l,t){t.r(l),t.d(l,{TechDocsReaderLayout:function(){return e.b},TechDocsReaderPage:function(){return e.W}});var e=t(5077)},39299:function(y,l,t){t.d(l,{Z:function(){return W}});var e=t(31085),s=t(14041),m=t(58837),C=t(29365),M=t(75173),R=t(71677),p=t(37757),j=t(10394),L=t(9684),B=t(86892),I=t(72020),g=t(99730);const K=(0,m.A)(D=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:D.spacing(3,3,0),"@media print":{display:"none"}}})),W=D=>{const S=K(),[A,O]=(0,s.useState)(null),U=(0,s.useCallback)(r=>{O(r.currentTarget)},[]),T=(0,s.useCallback)(()=>{O(null)},[]),{entityMetadata:{value:x,loading:H}}=(0,B.V)(),a=(0,I.YR)(),n=a.renderComponentsByLocation(g.e.Subheader),o=a.renderComponentsByLocation(g.e.Settings);return!n&&!o||H===!1&&!x?null:(0,e.jsx)(M.A,{classes:S,...D.toolbarProps,children:(0,e.jsxs)(j.A,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[n,o?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(R.Ay,{title:"Settings",children:(0,e.jsx)(C.A,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:U,children:(0,e.jsx)(L.A,{})})}),(0,e.jsx)(p.A,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:A,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:!!A,onClose:T,keepMounted:!0,children:(0,e.jsx)("div",{children:o})})]}):null]})})}}}]);})();

//# sourceMappingURL=4036.34537ee7.chunk.js.map