var __spreadArrays=this&&this.__spreadArrays||function(){for(var a=0,t=0,e=arguments.length;t<e;t++)a+=arguments[t].length;for(var i=Array(a),l=0,t=0;t<e;t++)for(var n=arguments[t],r=0,o=n.length;r<o;r++,l++)i[l]=n[r];return i};import{r as registerInstance,h}from"./index-7f9476af.js";import{R as Rt}from"./schema-dc252675.js";var defaultVerticalNavCss='a.sc-stencila-vertical-nav-default{font-family:sans-serif;font-family:var(--font-family-body,sans-serif);font-size:1rem;text-decoration:none;color:#000;color:var(--color-key,#000)}.toc.sc-stencila-vertical-nav-default{overflow-y:auto}.toc.sc-stencila-vertical-nav-default>.toc-list.sc-stencila-vertical-nav-default{overflow:hidden;position:relative}.toc.sc-stencila-vertical-nav-default>.toc-list.sc-stencila-vertical-nav-default li.sc-stencila-vertical-nav-default{list-style-type:none;line-height:1.625}.toc-list.sc-stencila-vertical-nav-default{margin:0;padding-left:.5rem}a.toc-link.sc-stencila-vertical-nav-default{height:100%;color:currentColor;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.toc-link.sc-stencila-vertical-nav-default:not(.is-active-link):hover{padding-left:.5rem}.is-collapsible.sc-stencila-vertical-nav-default{overflow:hidden;max-height:1000px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.is-collapsed.sc-stencila-vertical-nav-default{max-height:0}.is-position-fixed.sc-stencila-vertical-nav-default{top:0;padding-top:1rem;position:fixed;position:fixed!important}.is-active-link.sc-stencila-vertical-nav-default{font-weight:700}.toc-link.sc-stencila-vertical-nav-default:before{position:absolute;background-color:#f7fafc;background-color:var(--color-neutral-100,#f7fafc);display:inline-block;left:0;width:.25rem;margin-top:-1px;content:" ";height:inherit}.is-active-link.sc-stencila-vertical-nav-default:before{background-color:#4299e1;background-color:var(--color-primary-500,#4299e1)}summary.sc-stencila-vertical-nav-default{font-family:sans-serif;font-family:var(--font-family-body,sans-serif);font-size:1rem}';var verticalNavMaterialCss='a.sc-stencila-vertical-nav-material{font-family:sans-serif;font-family:var(--font-family-body,sans-serif);font-size:1rem;text-decoration:none;color:#000;color:var(--color-key,#000)}.toc.sc-stencila-vertical-nav-material{overflow-y:auto}.toc.sc-stencila-vertical-nav-material>.toc-list.sc-stencila-vertical-nav-material{overflow:hidden;position:relative}.toc.sc-stencila-vertical-nav-material>.toc-list.sc-stencila-vertical-nav-material li.sc-stencila-vertical-nav-material{list-style-type:none;line-height:1.625}.toc-list.sc-stencila-vertical-nav-material{margin:0;padding-left:.5rem}a.toc-link.sc-stencila-vertical-nav-material{height:100%;color:currentColor;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.toc-link.sc-stencila-vertical-nav-material:not(.is-active-link):hover{padding-left:.5rem}.is-collapsible.sc-stencila-vertical-nav-material{overflow:hidden;max-height:1000px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.is-collapsed.sc-stencila-vertical-nav-material{max-height:0}.is-position-fixed.sc-stencila-vertical-nav-material{top:0;padding-top:1rem;position:fixed;position:fixed!important}.is-active-link.sc-stencila-vertical-nav-material{font-weight:700}.toc-link.sc-stencila-vertical-nav-material:before{position:absolute;background-color:#f7fafc;background-color:var(--color-neutral-100,#f7fafc);display:inline-block;left:0;width:.25rem;margin-top:-1px;content:" ";height:inherit}.is-active-link.sc-stencila-vertical-nav-material:before{background-color:#4299e1;background-color:var(--color-primary-500,#4299e1)}summary.sc-stencila-vertical-nav-material{font-family:sans-serif;font-family:var(--font-family-body,sans-serif);font-size:1rem}';var parseCreativeWorks=function(a,t){if(t===void 0){t="/"}return h("ul",{class:"toc-list"},a.map((function(a){var e,i,l;return a.parts!==undefined?h("li",null,h("details",{open:true},h("summary",null,a.name),parseCreativeWorks(a.parts,((e=a.name)!==null&&e!==void 0?e:"")+"/"))):h("li",null,h("a",{class:"toc-link",href:t+((i=a.name)!==null&&i!==void 0?i:"")},a.name," (",h("code",null,t+((l=a.name)!==null&&l!==void 0?l:"")),")"))})))};var VerticalNav=function(){function a(a){registerInstance(this,a);this.collection=undefined;this._collection=this.collection}a.prototype.componentWillLoad=function(){if(this.collection!==undefined){return}var a=Array.from(document.querySelectorAll('script[type="application/ld+json"]')).reduce((function(a,t){var e={};try{e=JSON.parse(t.innerHTML)}catch(i){return a}return Rt("Collection",e)?__spreadArrays(a,[e]):a}),[]);this._collection=a[0]};a.prototype.render=function(){var a,t;return h("nav",{class:"toc"},parseCreativeWorks((t=(a=this._collection)===null||a===void 0?void 0:a.parts)!==null&&t!==void 0?t:[]))};return a}();VerticalNav.style={default:defaultVerticalNavCss,material:verticalNavMaterialCss};export{VerticalNav as stencila_vertical_nav};