Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cpelements/cp-documentation

Package Overview
Dependencies
Maintainers
4
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cpelements/cp-documentation - npm Package Compare versions

Comparing version 0.1.35 to 0.1.36

4

dist/cp-documentation.js
import PFElement from '../../../@patternfly/pfelement/dist/pfelement.js';
/*!
* PatternFly Elements: PfeDocumentation 0.1.34
* PatternFly Elements: PfeDocumentation 0.1.35
* @license

@@ -58,3 +58,3 @@ * Copyright 2020 Red Hat, Inc.

static get version() {
return "0.1.34";
return "0.1.35";
}

@@ -61,0 +61,0 @@

import e from"../../../@patternfly/pfelement/dist/pfelement.js";
/*!
* PatternFly Elements: PfeDocumentation 0.1.34
* PatternFly Elements: PfeDocumentation 0.1.35
* @license

@@ -26,3 +26,3 @@ * Copyright 2020 Red Hat, Inc.

*/
Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(Element.prototype.matches.call(t,e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null});const t={characterData:!0,subtree:!0,childList:!0};class o extends e{static get version(){return"0.1.34"}get html(){return'<style>:host{display:block}:host([hidden]){display:none}:host([pfe-c-non-prod]) abbr[style],:host([pfe-c-non-prod]) address[style],:host([pfe-c-non-prod]) article[style],:host([pfe-c-non-prod]) aside[style],:host([pfe-c-non-prod]) b[style],:host([pfe-c-non-prod]) blockquote[style],:host([pfe-c-non-prod]) body[style],:host([pfe-c-non-prod]) canvas[style],:host([pfe-c-non-prod]) caption[style],:host([pfe-c-non-prod]) cite[style],:host([pfe-c-non-prod]) code[style],:host([pfe-c-non-prod]) dd[style],:host([pfe-c-non-prod]) del[style],:host([pfe-c-non-prod]) details[style],:host([pfe-c-non-prod]) dfn[style],:host([pfe-c-non-prod]) div[style],:host([pfe-c-non-prod]) dl[style],:host([pfe-c-non-prod]) dt[style],:host([pfe-c-non-prod]) em[style],:host([pfe-c-non-prod]) fieldset[style],:host([pfe-c-non-prod]) figcaption[style],:host([pfe-c-non-prod]) figure[style],:host([pfe-c-non-prod]) footer[style],:host([pfe-c-non-prod]) form[style],:host([pfe-c-non-prod]) h1[style],:host([pfe-c-non-prod]) h2[style],:host([pfe-c-non-prod]) h3[style],:host([pfe-c-non-prod]) h4[style],:host([pfe-c-non-prod]) h5[style],:host([pfe-c-non-prod]) h6[style],:host([pfe-c-non-prod]) header[style],:host([pfe-c-non-prod]) hgroup[style],:host([pfe-c-non-prod]) html[style],:host([pfe-c-non-prod]) i[style],:host([pfe-c-non-prod]) iframe[style],:host([pfe-c-non-prod]) ins[style],:host([pfe-c-non-prod]) kbd[style],:host([pfe-c-non-prod]) label[style],:host([pfe-c-non-prod]) legend[style],:host([pfe-c-non-prod]) li[style],:host([pfe-c-non-prod]) mark[style],:host([pfe-c-non-prod]) menu[style],:host([pfe-c-non-prod]) nav[style],:host([pfe-c-non-prod]) object[style],:host([pfe-c-non-prod]) ol[style],:host([pfe-c-non-prod]) p[style],:host([pfe-c-non-prod]) pre[style],:host([pfe-c-non-prod]) q[style],:host([pfe-c-non-prod]) samp[style],:host([pfe-c-non-prod]) section[style],:host([pfe-c-non-prod]) small[style],:host([pfe-c-non-prod]) span[style],:host([pfe-c-non-prod]) strong[style],:host([pfe-c-non-prod]) sub[style],:host([pfe-c-non-prod]) summary[style],:host([pfe-c-non-prod]) sup[style],:host([pfe-c-non-prod]) table[style],:host([pfe-c-non-prod]) tbody[style],:host([pfe-c-non-prod]) td[style],:host([pfe-c-non-prod]) tfoot[style],:host([pfe-c-non-prod]) th[style],:host([pfe-c-non-prod]) thead[style],:host([pfe-c-non-prod]) time[style],:host([pfe-c-non-prod]) tr[style],:host([pfe-c-non-prod]) ul[style],:host([pfe-c-non-prod]) var[style]{border:2px solid #c9190b}:host([pfe-c-non-prod]) abbr[style]:before,:host([pfe-c-non-prod]) address[style]:before,:host([pfe-c-non-prod]) article[style]:before,:host([pfe-c-non-prod]) aside[style]:before,:host([pfe-c-non-prod]) b[style]:before,:host([pfe-c-non-prod]) blockquote[style]:before,:host([pfe-c-non-prod]) body[style]:before,:host([pfe-c-non-prod]) canvas[style]:before,:host([pfe-c-non-prod]) caption[style]:before,:host([pfe-c-non-prod]) cite[style]:before,:host([pfe-c-non-prod]) code[style]:before,:host([pfe-c-non-prod]) dd[style]:before,:host([pfe-c-non-prod]) del[style]:before,:host([pfe-c-non-prod]) details[style]:before,:host([pfe-c-non-prod]) dfn[style]:before,:host([pfe-c-non-prod]) div[style]:before,:host([pfe-c-non-prod]) dl[style]:before,:host([pfe-c-non-prod]) dt[style]:before,:host([pfe-c-non-prod]) em[style]:before,:host([pfe-c-non-prod]) fieldset[style]:before,:host([pfe-c-non-prod]) figcaption[style]:before,:host([pfe-c-non-prod]) figure[style]:before,:host([pfe-c-non-prod]) footer[style]:before,:host([pfe-c-non-prod]) form[style]:before,:host([pfe-c-non-prod]) h1[style]:before,:host([pfe-c-non-prod]) h2[style]:before,:host([pfe-c-non-prod]) h3[style]:before,:host([pfe-c-non-prod]) h4[style]:before,:host([pfe-c-non-prod]) h5[style]:before,:host([pfe-c-non-prod]) h6[style]:before,:host([pfe-c-non-prod]) header[style]:before,:host([pfe-c-non-prod]) hgroup[style]:before,:host([pfe-c-non-prod]) html[style]:before,:host([pfe-c-non-prod]) i[style]:before,:host([pfe-c-non-prod]) iframe[style]:before,:host([pfe-c-non-prod]) ins[style]:before,:host([pfe-c-non-prod]) kbd[style]:before,:host([pfe-c-non-prod]) label[style]:before,:host([pfe-c-non-prod]) legend[style]:before,:host([pfe-c-non-prod]) li[style]:before,:host([pfe-c-non-prod]) mark[style]:before,:host([pfe-c-non-prod]) menu[style]:before,:host([pfe-c-non-prod]) nav[style]:before,:host([pfe-c-non-prod]) object[style]:before,:host([pfe-c-non-prod]) ol[style]:before,:host([pfe-c-non-prod]) p[style]:before,:host([pfe-c-non-prod]) pre[style]:before,:host([pfe-c-non-prod]) q[style]:before,:host([pfe-c-non-prod]) samp[style]:before,:host([pfe-c-non-prod]) section[style]:before,:host([pfe-c-non-prod]) small[style]:before,:host([pfe-c-non-prod]) span[style]:before,:host([pfe-c-non-prod]) strong[style]:before,:host([pfe-c-non-prod]) sub[style]:before,:host([pfe-c-non-prod]) summary[style]:before,:host([pfe-c-non-prod]) sup[style]:before,:host([pfe-c-non-prod]) table[style]:before,:host([pfe-c-non-prod]) tbody[style]:before,:host([pfe-c-non-prod]) td[style]:before,:host([pfe-c-non-prod]) tfoot[style]:before,:host([pfe-c-non-prod]) th[style]:before,:host([pfe-c-non-prod]) thead[style]:before,:host([pfe-c-non-prod]) time[style]:before,:host([pfe-c-non-prod]) tr[style]:before,:host([pfe-c-non-prod]) ul[style]:before,:host([pfe-c-non-prod]) var[style]:before{display:block;min-width:320px;max-width:100vw;padding:.5em 1em;background:#fee;content:"WARNING: This -moz-element has inline styles which can easily break layout on mobile or other contexts. The inline style is " attr(style);content:"WARNING: This element has inline styles which can easily break layout on mobile or other contexts. The inline style is " attr(style)}.warning-message{display:block;min-width:320px;max-width:100vw;padding:.5em 1em;background:#fee}\n/*# sourceMappingURL=cp-documentation.min.css.map */\n</style><div id="wrapper" class="rhdocs"></div>'}static get tag(){return"cp-documentation"}static get properties(){return{}}static get slots(){return{}}get templateUrl(){return"cp-documentation.html"}get styleUrl(){return"cp-documentation.scss"}static get events(){return{}}static get PfeType(){return e.PfeTypes.Container}static get observedAttributes(){return["pfe-loaded","pfe-endpoint","pfe-css"]}constructor(){super(o,{type:o.PfeType}),this._processLightDom=this._processLightDom.bind(this),this._addStyleSheet=this._addStyleSheet.bind(this),this._loadCss=this._loadCss.bind(this),this.loadData=this.loadData.bind(this),this.getData=this.getData.bind(this),this._navigationHandler=this._navigationHandler.bind(this),this._loadChildModules=this._loadChildModules.bind(this),this._addIncludedInGuides=this._addIncludedInGuides.bind(this),this._observer=new MutationObserver(this._processLightDom),this._contentData={},this._contentType=null}connectedCallback(){if(super.connectedCallback(),this.hasAttribute("pfe-css"))this._loadCss();else{let e="/webassets/avalon/j/public_modules/node_modules/@cpelements/cp-documentation/dist/rhdocs.min.css";for(let t=0;t<document.styleSheets.length;t++){const o=document.styleSheets[t];if(o.href&&o.href.includes("rhdocs.")){e=o.ownerNode.getAttribute("href");break}}this._addStyleSheet(e)}if("object"==typeof drupalSettings&&drupalSettings.red_hat_fcc)"string"==typeof drupalSettings.red_hat_fcc.content_metadata?this._contentData=JSON.parse(drupalSettings.red_hat_fcc.content_metadata):"object"==typeof drupalSettings.red_hat_fcc.content_metadata&&(this._contentData=drupalSettings.red_hat_fcc.content_metadata),this._contentType=this._contentData.content_type,"assembly"===this._contentData.content_type&&this._loadChildModules();else if(window.location.host.includes("access.")&&".redhat.com"===window.location.host.substring(-11)){this._contentType=document.querySelector(".rhdocs__header--assembly")?"assembly":"module";const e=window.location.pathname.split("/"),t=e[e.length-1];let o=null;if(this._isDevelopment())o="pantheon.corp.qa.redhat.com";else if("object"==typeof window.portal)switch(window.portal.host){case"https://access.dev.redhat.com":o="pantheon.corp.dev.redhat.com";break;case"https://access.qa.redhat.com":o="pantheon.corp.qa.redhat.com";break;case"https://access.stage.redhat.com":o="pantheon.corp.stage.redhat.com";break;default:o="api.docs.redhat.com"}if(o&&this._contentType&&t){let e=`https://${o}/api/${this._contentType}/variant.json/${t}`;fetch(e).then(e=>e.json()).then(e=>{200===e.status&&"object"==typeof e[this._contentType]&&(this._contentData=e[this._contentType],"assembly"===this._contentType&&this._loadChildModules())}).catch(e=>console.error(e))}}document.querySelector(".rh-docs__sidebar")&&this.classList.add("pfe-documentation--next-to-sidebar"),this._processLightDom(),this._observer.observe(this,t),this.addEventListener(o.events.change,this._changeHandler),this.addEventListener(o.events.loaded,this._loadedHandler);const e=this.querySelector("#rhdocs-preamble");e&&!e.textContent.trim()&&e.remove(),window.location.hash&&window.addEventListener("load",this._navigationHandler),this.parentElement.classList.contains("rh-docs__content-wrapper")&&document.getElementById("rhdocs-header-external")&&this.classList.add("cp-documentation--has-external-header"),window.addEventListener("hashchange",this._navigationHandler)}disconnectedCallback(){this.removeEventListener(o.events.change,this._changeHandler),this.removeEventListener(o.events.loaded,this._loadedHandler)}attributeChangedCallback(e,t,o){switch(super.attributeChangedCallback(e,t,o),e){case"pfe-endpoint":this.loadData()}}_portalEnvironmentFix(e){return e=(e=(e=(e=(e=e.replace("http://","https://")).replace("pantheon2-dev.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.dev.redhat.com")).replace("pantheon2-qa.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.qa.redhat.com")).replace("pantheon2-stage.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.stage.redhat.com")).replace("pantheon2-proxy.ext.us-west.aws.prod.paas.redhat.com","api.docs.redhat.com"),(window.location.host.includes("wruvalca")||window.location.host.includes(".foo."))&&(e=e.substring(e.indexOf("/api"))),e}_isDevelopment(){return window.location.host.includes("local")||window.location.host.includes("docksal")||window.location.host.includes(".foo.")}_navigationHandler(){let e=this.shadowRoot.getElementById(window.location.hash.substring(1));e&&window.scrollTo(window.scrollX,e.offsetTop)}_createRelatedContentWrapper(e){"string"!=typeof e&&(e="topic");const t=document.createElement("details"),o=document.createElement("summary"),n=document.createElement("div");return t.classList.add("related-topic-content__wrapper"),"guide"===e&&(t.classList.add("related-topic-content__wrapper--for-guide"),t.setAttribute("open","")),o.classList.add("related-topic-content__title"),n.classList.add("related-topic-content__inner-wrapper"),o.innerText=`Content related to this ${e}`,t.append(o),t.append(n),[t,n]}_createPrintButton(){const e=document.createElement("button");e.innerText="Print",e.classList.add("rhdocs__print-button");const t=document.createElement("pfe-icon");return t.setAttribute("icon","web-print"),t.setAttribute("pfe-size","sm"),e.prepend(t),e.addEventListener("click",()=>{window.print()}),e}_processLightDom(e){window.ShadyCSS&&this._observer.disconnect(),this._isDevelopment()&&console.log(`${this.tag}: Processing Light Dom`,e);const o=this.shadowRoot.getElementById("wrapper"),n=this.shadowRoot.getElementById("content"),s=document.createElement("div");this.childNodes.forEach(e=>{const t=e.cloneNode(!0);s.append(t)});const r=s.querySelectorAll("._additional-resources");for(let e=0;e<r.length;e++){let t=r[e];const o=document.createElement("aside");if(o.setAttribute("class",t.getAttribute("class")),o.innerHTML=t.innerHTML,t.parentElement.replaceChild(o,t),t=o,"assembly"===this._contentType){const o=t.closest("section, article");if(o){const n=t.querySelector("h2"),s=e===r.length-1&&n?"guide":"topic",d=this._createRelatedContentWrapper(s);"guide"===s?(d[1].append(t),o.append(d[0])):(t.replaceWith(d[0]),d[1].append(t))}}}let d=s.querySelector(".rhdocs__header__secondary-wrapper");if(!s.querySelector("#rhdocs-header-external")&&document.getElementById("rhdocs-header-external")&&(d=document.querySelector("#rhdocs-header-external .rhdocs__header__secondary-wrapper")),d&&!d.querySelector(".rhdocs-print-button")){const e=document.createElement("li");e.classList.add("rh-docs-details-item"),e.classList.add("rhdocs-print-button"),e.append(this._createPrintButton()),d.append(e)}n?o.replaceChild(s,n):o.append(s),s.setAttribute("id","content"),window.ShadyCSS&&this._observer.observe(this,t)}_addStyleSheet(e){if(!this.shadowRoot.querySelector(`link[href='${e}']`)){const t=document.createElement("link");t.setAttribute("id","pfe-css"),t.setAttribute("href",e),t.setAttribute("rel","stylesheet"),this.shadowRoot.prepend(t)}}_loadCss(){this.hasAttribute("pfe-css")&&this._addStyleSheet(this.getAttribute("pfe-css"))}loadData(){const e=this.getAttribute("pfe-endpoint");e&&fetch(this._portalEnvironmentFix(e)).then(e=>e.json()).then(e=>{"object"==typeof e.module&&(this.setAttribute("pfe-loaded",""),this._contentData=e.module,this._contentData.body&&(this.innerHTML=this._contentData.body))}).catch(e=>console.error(`${this.tag}: ${e}`))}getData(){return Object.keys(this._contentData).length?this._contentData:null}_addIncludedInGuides(e){let t=this._contentData.variantToModuleMap[e.variant_uuid];if(this._contentData.moduleToVariantMap[t].length>1)console.error(`${this.tag}: The same module is used twice in this assembly, included in guides could not be added.`);else if(t){const o=this.shadowRoot.querySelector(`[pantheon-module-id="${t}"]`);if(o){const t=window.location.pathname.split("/"),n=[];for(let o=0;o<e.included_in_guides.length;o++){const s=e.included_in_guides[o];if(s.uuid!==this._contentData.uuid){const e=document.createElement("a");t[t.length-1]=s.uuid,e.setAttribute("href",`/${t.join("/")}`),e.innerText=s.title,n.push(e)}}let s=null;if(n.length>1){s=document.createElement("ul");for(let e=0;e<s.length;e++){const t=s[e],o=document.createElement("li");o.append(t),s.append(o)}}else s=n[0];const r=parseInt(o.querySelector("h1, h2, h3, h4, h5, h6").tagName.substring(1));let d=r>5?6:r+1;const a=document.createElement("aside");a.classList.add("included-in-guides");const c=document.createElement(`h${d}`);c.classList.add("included-in-guides__title"),c.innerText="Guides Including this topic",a.append(c),a.append(s);let l=o.querySelector(".related-topic-content__wrapper");if(l)l.querySelector(".related-topic-content__inner-wrapper").append(a);else{const e=this._createRelatedContentWrapper();l=e[0],e[1].append(a),o.append(l)}}}}_loadChildModules(){for(let e=0;e<this._contentData.modules_included.length;e++){const t=this._contentData.modules_included[e];if(void 0===this._contentData.moduleToVariantMap&&(this._contentData.moduleToVariantMap={},this._contentData.variantToModuleMap={}),void 0===this._contentData.moduleToVariantMap[t.module_uuid]&&(this._contentData.moduleToVariantMap[t.module_uuid]=[]),this._contentData.variantToModuleMap[t.canonical_uuid]=t.module_uuid,this._contentData.moduleToVariantMap[t.module_uuid].push(t),t.url){let e=this._portalEnvironmentFix(t.url);fetch(e).then(e=>e.json()).then(e=>{void 0===this._contentData.loadedModules&&(this._contentData.loadedModules={}),this._contentData.loadedModules[e.module.variant_uuid]=e.module,void 0!==e.module.included_in_guides&&e.module.included_in_guides.length>1&&this._addIncludedInGuides(e.module)}).catch(e=>console.error(e))}}}_changeHandler(e){this.emitEvent(o.events.change,{detail:{}})}_loadedHandler(e){this.emitEvent(o.events.loaded,{detail:{}})}}e.create(o);export default o;
Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(Element.prototype.matches.call(t,e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null});const t={characterData:!0,subtree:!0,childList:!0};class o extends e{static get version(){return"0.1.35"}get html(){return'<style>:host{display:block}:host([hidden]){display:none}:host([pfe-c-non-prod]) abbr[style],:host([pfe-c-non-prod]) address[style],:host([pfe-c-non-prod]) article[style],:host([pfe-c-non-prod]) aside[style],:host([pfe-c-non-prod]) b[style],:host([pfe-c-non-prod]) blockquote[style],:host([pfe-c-non-prod]) body[style],:host([pfe-c-non-prod]) canvas[style],:host([pfe-c-non-prod]) caption[style],:host([pfe-c-non-prod]) cite[style],:host([pfe-c-non-prod]) code[style],:host([pfe-c-non-prod]) dd[style],:host([pfe-c-non-prod]) del[style],:host([pfe-c-non-prod]) details[style],:host([pfe-c-non-prod]) dfn[style],:host([pfe-c-non-prod]) div[style],:host([pfe-c-non-prod]) dl[style],:host([pfe-c-non-prod]) dt[style],:host([pfe-c-non-prod]) em[style],:host([pfe-c-non-prod]) fieldset[style],:host([pfe-c-non-prod]) figcaption[style],:host([pfe-c-non-prod]) figure[style],:host([pfe-c-non-prod]) footer[style],:host([pfe-c-non-prod]) form[style],:host([pfe-c-non-prod]) h1[style],:host([pfe-c-non-prod]) h2[style],:host([pfe-c-non-prod]) h3[style],:host([pfe-c-non-prod]) h4[style],:host([pfe-c-non-prod]) h5[style],:host([pfe-c-non-prod]) h6[style],:host([pfe-c-non-prod]) header[style],:host([pfe-c-non-prod]) hgroup[style],:host([pfe-c-non-prod]) html[style],:host([pfe-c-non-prod]) i[style],:host([pfe-c-non-prod]) iframe[style],:host([pfe-c-non-prod]) ins[style],:host([pfe-c-non-prod]) kbd[style],:host([pfe-c-non-prod]) label[style],:host([pfe-c-non-prod]) legend[style],:host([pfe-c-non-prod]) li[style],:host([pfe-c-non-prod]) mark[style],:host([pfe-c-non-prod]) menu[style],:host([pfe-c-non-prod]) nav[style],:host([pfe-c-non-prod]) object[style],:host([pfe-c-non-prod]) ol[style],:host([pfe-c-non-prod]) p[style],:host([pfe-c-non-prod]) pre[style],:host([pfe-c-non-prod]) q[style],:host([pfe-c-non-prod]) samp[style],:host([pfe-c-non-prod]) section[style],:host([pfe-c-non-prod]) small[style],:host([pfe-c-non-prod]) span[style],:host([pfe-c-non-prod]) strong[style],:host([pfe-c-non-prod]) sub[style],:host([pfe-c-non-prod]) summary[style],:host([pfe-c-non-prod]) sup[style],:host([pfe-c-non-prod]) table[style],:host([pfe-c-non-prod]) tbody[style],:host([pfe-c-non-prod]) td[style],:host([pfe-c-non-prod]) tfoot[style],:host([pfe-c-non-prod]) th[style],:host([pfe-c-non-prod]) thead[style],:host([pfe-c-non-prod]) time[style],:host([pfe-c-non-prod]) tr[style],:host([pfe-c-non-prod]) ul[style],:host([pfe-c-non-prod]) var[style]{border:2px solid #c9190b}:host([pfe-c-non-prod]) abbr[style]:before,:host([pfe-c-non-prod]) address[style]:before,:host([pfe-c-non-prod]) article[style]:before,:host([pfe-c-non-prod]) aside[style]:before,:host([pfe-c-non-prod]) b[style]:before,:host([pfe-c-non-prod]) blockquote[style]:before,:host([pfe-c-non-prod]) body[style]:before,:host([pfe-c-non-prod]) canvas[style]:before,:host([pfe-c-non-prod]) caption[style]:before,:host([pfe-c-non-prod]) cite[style]:before,:host([pfe-c-non-prod]) code[style]:before,:host([pfe-c-non-prod]) dd[style]:before,:host([pfe-c-non-prod]) del[style]:before,:host([pfe-c-non-prod]) details[style]:before,:host([pfe-c-non-prod]) dfn[style]:before,:host([pfe-c-non-prod]) div[style]:before,:host([pfe-c-non-prod]) dl[style]:before,:host([pfe-c-non-prod]) dt[style]:before,:host([pfe-c-non-prod]) em[style]:before,:host([pfe-c-non-prod]) fieldset[style]:before,:host([pfe-c-non-prod]) figcaption[style]:before,:host([pfe-c-non-prod]) figure[style]:before,:host([pfe-c-non-prod]) footer[style]:before,:host([pfe-c-non-prod]) form[style]:before,:host([pfe-c-non-prod]) h1[style]:before,:host([pfe-c-non-prod]) h2[style]:before,:host([pfe-c-non-prod]) h3[style]:before,:host([pfe-c-non-prod]) h4[style]:before,:host([pfe-c-non-prod]) h5[style]:before,:host([pfe-c-non-prod]) h6[style]:before,:host([pfe-c-non-prod]) header[style]:before,:host([pfe-c-non-prod]) hgroup[style]:before,:host([pfe-c-non-prod]) html[style]:before,:host([pfe-c-non-prod]) i[style]:before,:host([pfe-c-non-prod]) iframe[style]:before,:host([pfe-c-non-prod]) ins[style]:before,:host([pfe-c-non-prod]) kbd[style]:before,:host([pfe-c-non-prod]) label[style]:before,:host([pfe-c-non-prod]) legend[style]:before,:host([pfe-c-non-prod]) li[style]:before,:host([pfe-c-non-prod]) mark[style]:before,:host([pfe-c-non-prod]) menu[style]:before,:host([pfe-c-non-prod]) nav[style]:before,:host([pfe-c-non-prod]) object[style]:before,:host([pfe-c-non-prod]) ol[style]:before,:host([pfe-c-non-prod]) p[style]:before,:host([pfe-c-non-prod]) pre[style]:before,:host([pfe-c-non-prod]) q[style]:before,:host([pfe-c-non-prod]) samp[style]:before,:host([pfe-c-non-prod]) section[style]:before,:host([pfe-c-non-prod]) small[style]:before,:host([pfe-c-non-prod]) span[style]:before,:host([pfe-c-non-prod]) strong[style]:before,:host([pfe-c-non-prod]) sub[style]:before,:host([pfe-c-non-prod]) summary[style]:before,:host([pfe-c-non-prod]) sup[style]:before,:host([pfe-c-non-prod]) table[style]:before,:host([pfe-c-non-prod]) tbody[style]:before,:host([pfe-c-non-prod]) td[style]:before,:host([pfe-c-non-prod]) tfoot[style]:before,:host([pfe-c-non-prod]) th[style]:before,:host([pfe-c-non-prod]) thead[style]:before,:host([pfe-c-non-prod]) time[style]:before,:host([pfe-c-non-prod]) tr[style]:before,:host([pfe-c-non-prod]) ul[style]:before,:host([pfe-c-non-prod]) var[style]:before{display:block;min-width:320px;max-width:100vw;padding:.5em 1em;background:#fee;content:"WARNING: This -moz-element has inline styles which can easily break layout on mobile or other contexts. The inline style is " attr(style);content:"WARNING: This element has inline styles which can easily break layout on mobile or other contexts. The inline style is " attr(style)}.warning-message{display:block;min-width:320px;max-width:100vw;padding:.5em 1em;background:#fee}\n/*# sourceMappingURL=cp-documentation.min.css.map */\n</style><div id="wrapper" class="rhdocs"></div>'}static get tag(){return"cp-documentation"}static get properties(){return{}}static get slots(){return{}}get templateUrl(){return"cp-documentation.html"}get styleUrl(){return"cp-documentation.scss"}static get events(){return{}}static get PfeType(){return e.PfeTypes.Container}static get observedAttributes(){return["pfe-loaded","pfe-endpoint","pfe-css"]}constructor(){super(o,{type:o.PfeType}),this._processLightDom=this._processLightDom.bind(this),this._addStyleSheet=this._addStyleSheet.bind(this),this._loadCss=this._loadCss.bind(this),this.loadData=this.loadData.bind(this),this.getData=this.getData.bind(this),this._navigationHandler=this._navigationHandler.bind(this),this._loadChildModules=this._loadChildModules.bind(this),this._addIncludedInGuides=this._addIncludedInGuides.bind(this),this._observer=new MutationObserver(this._processLightDom),this._contentData={},this._contentType=null}connectedCallback(){if(super.connectedCallback(),this.hasAttribute("pfe-css"))this._loadCss();else{let e="/webassets/avalon/j/public_modules/node_modules/@cpelements/cp-documentation/dist/rhdocs.min.css";for(let t=0;t<document.styleSheets.length;t++){const o=document.styleSheets[t];if(o.href&&o.href.includes("rhdocs.")){e=o.ownerNode.getAttribute("href");break}}this._addStyleSheet(e)}if("object"==typeof drupalSettings&&drupalSettings.red_hat_fcc)"string"==typeof drupalSettings.red_hat_fcc.content_metadata?this._contentData=JSON.parse(drupalSettings.red_hat_fcc.content_metadata):"object"==typeof drupalSettings.red_hat_fcc.content_metadata&&(this._contentData=drupalSettings.red_hat_fcc.content_metadata),this._contentType=this._contentData.content_type,"assembly"===this._contentData.content_type&&this._loadChildModules();else if(window.location.host.includes("access.")&&".redhat.com"===window.location.host.substring(-11)){this._contentType=document.querySelector(".rhdocs__header--assembly")?"assembly":"module";const e=window.location.pathname.split("/"),t=e[e.length-1];let o=null;if(this._isDevelopment())o="pantheon.corp.qa.redhat.com";else if("object"==typeof window.portal)switch(window.portal.host){case"https://access.dev.redhat.com":o="pantheon.corp.dev.redhat.com";break;case"https://access.qa.redhat.com":o="pantheon.corp.qa.redhat.com";break;case"https://access.stage.redhat.com":o="pantheon.corp.stage.redhat.com";break;default:o="api.docs.redhat.com"}if(o&&this._contentType&&t){let e=`https://${o}/api/${this._contentType}/variant.json/${t}`;fetch(e).then(e=>e.json()).then(e=>{200===e.status&&"object"==typeof e[this._contentType]&&(this._contentData=e[this._contentType],"assembly"===this._contentType&&this._loadChildModules())}).catch(e=>console.error(e))}}document.querySelector(".rh-docs__sidebar")&&this.classList.add("pfe-documentation--next-to-sidebar"),this._processLightDom(),this._observer.observe(this,t),this.addEventListener(o.events.change,this._changeHandler),this.addEventListener(o.events.loaded,this._loadedHandler);const e=this.querySelector("#rhdocs-preamble");e&&!e.textContent.trim()&&e.remove(),window.location.hash&&window.addEventListener("load",this._navigationHandler),this.parentElement.classList.contains("rh-docs__content-wrapper")&&document.getElementById("rhdocs-header-external")&&this.classList.add("cp-documentation--has-external-header"),window.addEventListener("hashchange",this._navigationHandler)}disconnectedCallback(){this.removeEventListener(o.events.change,this._changeHandler),this.removeEventListener(o.events.loaded,this._loadedHandler)}attributeChangedCallback(e,t,o){switch(super.attributeChangedCallback(e,t,o),e){case"pfe-endpoint":this.loadData()}}_portalEnvironmentFix(e){return e=(e=(e=(e=(e=e.replace("http://","https://")).replace("pantheon2-dev.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.dev.redhat.com")).replace("pantheon2-qa.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.qa.redhat.com")).replace("pantheon2-stage.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.stage.redhat.com")).replace("pantheon2-proxy.ext.us-west.aws.prod.paas.redhat.com","api.docs.redhat.com"),(window.location.host.includes("wruvalca")||window.location.host.includes(".foo."))&&(e=e.substring(e.indexOf("/api"))),e}_isDevelopment(){return window.location.host.includes("local")||window.location.host.includes("docksal")||window.location.host.includes(".foo.")}_navigationHandler(){let e=this.shadowRoot.getElementById(window.location.hash.substring(1));e&&window.scrollTo(window.scrollX,e.offsetTop)}_createRelatedContentWrapper(e){"string"!=typeof e&&(e="topic");const t=document.createElement("details"),o=document.createElement("summary"),n=document.createElement("div");return t.classList.add("related-topic-content__wrapper"),"guide"===e&&(t.classList.add("related-topic-content__wrapper--for-guide"),t.setAttribute("open","")),o.classList.add("related-topic-content__title"),n.classList.add("related-topic-content__inner-wrapper"),o.innerText=`Content related to this ${e}`,t.append(o),t.append(n),[t,n]}_createPrintButton(){const e=document.createElement("button");e.innerText="Print",e.classList.add("rhdocs__print-button");const t=document.createElement("pfe-icon");return t.setAttribute("icon","web-print"),t.setAttribute("pfe-size","sm"),e.prepend(t),e.addEventListener("click",()=>{window.print()}),e}_processLightDom(e){window.ShadyCSS&&this._observer.disconnect(),this._isDevelopment()&&console.log(`${this.tag}: Processing Light Dom`,e);const o=this.shadowRoot.getElementById("wrapper"),n=this.shadowRoot.getElementById("content"),s=document.createElement("div");this.childNodes.forEach(e=>{const t=e.cloneNode(!0);s.append(t)});const r=s.querySelectorAll("._additional-resources");for(let e=0;e<r.length;e++){let t=r[e];const o=document.createElement("aside");if(o.setAttribute("class",t.getAttribute("class")),o.innerHTML=t.innerHTML,t.parentElement.replaceChild(o,t),t=o,"assembly"===this._contentType){const o=t.closest("section, article");if(o){const n=t.querySelector("h2"),s=e===r.length-1&&n?"guide":"topic",d=this._createRelatedContentWrapper(s);"guide"===s?(d[1].append(t),o.append(d[0])):(t.replaceWith(d[0]),d[1].append(t))}}}let d=s.querySelector(".rhdocs__header__secondary-wrapper");if(!s.querySelector("#rhdocs-header-external")&&document.getElementById("rhdocs-header-external")&&(d=document.querySelector("#rhdocs-header-external .rhdocs__header__secondary-wrapper")),d&&!d.querySelector(".rhdocs-print-button")){const e=document.createElement("li");e.classList.add("rh-docs-details-item"),e.classList.add("rhdocs-print-button"),e.append(this._createPrintButton()),d.append(e)}n?o.replaceChild(s,n):o.append(s),s.setAttribute("id","content"),window.ShadyCSS&&this._observer.observe(this,t)}_addStyleSheet(e){if(!this.shadowRoot.querySelector(`link[href='${e}']`)){const t=document.createElement("link");t.setAttribute("id","pfe-css"),t.setAttribute("href",e),t.setAttribute("rel","stylesheet"),this.shadowRoot.prepend(t)}}_loadCss(){this.hasAttribute("pfe-css")&&this._addStyleSheet(this.getAttribute("pfe-css"))}loadData(){const e=this.getAttribute("pfe-endpoint");e&&fetch(this._portalEnvironmentFix(e)).then(e=>e.json()).then(e=>{"object"==typeof e.module&&(this.setAttribute("pfe-loaded",""),this._contentData=e.module,this._contentData.body&&(this.innerHTML=this._contentData.body))}).catch(e=>console.error(`${this.tag}: ${e}`))}getData(){return Object.keys(this._contentData).length?this._contentData:null}_addIncludedInGuides(e){let t=this._contentData.variantToModuleMap[e.variant_uuid];if(this._contentData.moduleToVariantMap[t].length>1)console.error(`${this.tag}: The same module is used twice in this assembly, included in guides could not be added.`);else if(t){const o=this.shadowRoot.querySelector(`[pantheon-module-id="${t}"]`);if(o){const t=window.location.pathname.split("/"),n=[];for(let o=0;o<e.included_in_guides.length;o++){const s=e.included_in_guides[o];if(s.uuid!==this._contentData.uuid){const e=document.createElement("a");t[t.length-1]=s.uuid,e.setAttribute("href",`/${t.join("/")}`),e.innerText=s.title,n.push(e)}}let s=null;if(n.length>1){s=document.createElement("ul");for(let e=0;e<s.length;e++){const t=s[e],o=document.createElement("li");o.append(t),s.append(o)}}else s=n[0];const r=parseInt(o.querySelector("h1, h2, h3, h4, h5, h6").tagName.substring(1));let d=r>5?6:r+1;const a=document.createElement("aside");a.classList.add("included-in-guides");const c=document.createElement(`h${d}`);c.classList.add("included-in-guides__title"),c.innerText="Guides Including this topic",a.append(c),a.append(s);let l=o.querySelector(".related-topic-content__wrapper");if(l)l.querySelector(".related-topic-content__inner-wrapper").append(a);else{const e=this._createRelatedContentWrapper();l=e[0],e[1].append(a),o.append(l)}}}}_loadChildModules(){for(let e=0;e<this._contentData.modules_included.length;e++){const t=this._contentData.modules_included[e];if(void 0===this._contentData.moduleToVariantMap&&(this._contentData.moduleToVariantMap={},this._contentData.variantToModuleMap={}),void 0===this._contentData.moduleToVariantMap[t.module_uuid]&&(this._contentData.moduleToVariantMap[t.module_uuid]=[]),this._contentData.variantToModuleMap[t.canonical_uuid]=t.module_uuid,this._contentData.moduleToVariantMap[t.module_uuid].push(t),t.url){let e=this._portalEnvironmentFix(t.url);fetch(e).then(e=>e.json()).then(e=>{void 0===this._contentData.loadedModules&&(this._contentData.loadedModules={}),this._contentData.loadedModules[e.module.variant_uuid]=e.module,void 0!==e.module.included_in_guides&&e.module.included_in_guides.length>1&&this._addIncludedInGuides(e.module)}).catch(e=>console.error(e))}}}_changeHandler(e){this.emitEvent(o.events.change,{detail:{}})}_loadedHandler(e){this.emitEvent(o.events.loaded,{detail:{}})}}e.create(o);export default o;
//# sourceMappingURL=cp-documentation.min.js.map

@@ -89,3 +89,3 @@ (function (global, factory) {

/*!
* PatternFly Elements: PfeDocumentation 0.1.34
* PatternFly Elements: PfeDocumentation 0.1.35
* @license

@@ -160,3 +160,3 @@ * Copyright 2020 Red Hat, Inc.

get: function get$$1() {
return "0.1.34";
return "0.1.35";
}

@@ -163,0 +163,0 @@ }, {

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("../../../@patternfly/pfelement/dist/pfelement.umd.min.js")):"function"==typeof define&&define.amd?define(["../../../@patternfly/pfelement/dist/pfelement.umd.min.js"],t):e.PfeDocumentation=t(e.PFElement)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var l="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},t=function(e,t,o){return t&&n(e.prototype,t),o&&n(e,o),e};function n(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function p(e,t,o){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,t);if(void 0===n){var s=Object.getPrototypeOf(e);return null===s?void 0:p(s,t,o)}if("value"in n)return n.value;var r=n.get;return void 0!==r?r.call(o):void 0}Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(Element.prototype.matches.call(t,e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null});var u={characterData:!0,subtree:!0,childList:!0},o=(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)}(i,e),t(i,[{key:"html",get:function(){return'<style>:host{display:block}:host([hidden]){display:none}:host([pfe-c-non-prod]) abbr[style],:host([pfe-c-non-prod]) address[style],:host([pfe-c-non-prod]) article[style],:host([pfe-c-non-prod]) aside[style],:host([pfe-c-non-prod]) b[style],:host([pfe-c-non-prod]) blockquote[style],:host([pfe-c-non-prod]) body[style],:host([pfe-c-non-prod]) canvas[style],:host([pfe-c-non-prod]) caption[style],:host([pfe-c-non-prod]) cite[style],:host([pfe-c-non-prod]) code[style],:host([pfe-c-non-prod]) dd[style],:host([pfe-c-non-prod]) del[style],:host([pfe-c-non-prod]) details[style],:host([pfe-c-non-prod]) dfn[style],:host([pfe-c-non-prod]) div[style],:host([pfe-c-non-prod]) dl[style],:host([pfe-c-non-prod]) dt[style],:host([pfe-c-non-prod]) em[style],:host([pfe-c-non-prod]) fieldset[style],:host([pfe-c-non-prod]) figcaption[style],:host([pfe-c-non-prod]) figure[style],:host([pfe-c-non-prod]) footer[style],:host([pfe-c-non-prod]) form[style],:host([pfe-c-non-prod]) h1[style],:host([pfe-c-non-prod]) h2[style],:host([pfe-c-non-prod]) h3[style],:host([pfe-c-non-prod]) h4[style],:host([pfe-c-non-prod]) h5[style],:host([pfe-c-non-prod]) h6[style],:host([pfe-c-non-prod]) header[style],:host([pfe-c-non-prod]) hgroup[style],:host([pfe-c-non-prod]) html[style],:host([pfe-c-non-prod]) i[style],:host([pfe-c-non-prod]) iframe[style],:host([pfe-c-non-prod]) ins[style],:host([pfe-c-non-prod]) kbd[style],:host([pfe-c-non-prod]) label[style],:host([pfe-c-non-prod]) legend[style],:host([pfe-c-non-prod]) li[style],:host([pfe-c-non-prod]) mark[style],:host([pfe-c-non-prod]) menu[style],:host([pfe-c-non-prod]) nav[style],:host([pfe-c-non-prod]) object[style],:host([pfe-c-non-prod]) ol[style],:host([pfe-c-non-prod]) p[style],:host([pfe-c-non-prod]) pre[style],:host([pfe-c-non-prod]) q[style],:host([pfe-c-non-prod]) samp[style],:host([pfe-c-non-prod]) section[style],:host([pfe-c-non-prod]) small[style],:host([pfe-c-non-prod]) span[style],:host([pfe-c-non-prod]) strong[style],:host([pfe-c-non-prod]) sub[style],:host([pfe-c-non-prod]) summary[style],:host([pfe-c-non-prod]) sup[style],:host([pfe-c-non-prod]) table[style],:host([pfe-c-non-prod]) tbody[style],:host([pfe-c-non-prod]) td[style],:host([pfe-c-non-prod]) tfoot[style],:host([pfe-c-non-prod]) th[style],:host([pfe-c-non-prod]) thead[style],:host([pfe-c-non-prod]) time[style],:host([pfe-c-non-prod]) tr[style],:host([pfe-c-non-prod]) ul[style],:host([pfe-c-non-prod]) var[style]{border:2px solid #c9190b}:host([pfe-c-non-prod]) abbr[style]:before,:host([pfe-c-non-prod]) address[style]:before,:host([pfe-c-non-prod]) article[style]:before,:host([pfe-c-non-prod]) aside[style]:before,:host([pfe-c-non-prod]) b[style]:before,:host([pfe-c-non-prod]) blockquote[style]:before,:host([pfe-c-non-prod]) body[style]:before,:host([pfe-c-non-prod]) canvas[style]:before,:host([pfe-c-non-prod]) caption[style]:before,:host([pfe-c-non-prod]) cite[style]:before,:host([pfe-c-non-prod]) code[style]:before,:host([pfe-c-non-prod]) dd[style]:before,:host([pfe-c-non-prod]) del[style]:before,:host([pfe-c-non-prod]) details[style]:before,:host([pfe-c-non-prod]) dfn[style]:before,:host([pfe-c-non-prod]) div[style]:before,:host([pfe-c-non-prod]) dl[style]:before,:host([pfe-c-non-prod]) dt[style]:before,:host([pfe-c-non-prod]) em[style]:before,:host([pfe-c-non-prod]) fieldset[style]:before,:host([pfe-c-non-prod]) figcaption[style]:before,:host([pfe-c-non-prod]) figure[style]:before,:host([pfe-c-non-prod]) footer[style]:before,:host([pfe-c-non-prod]) form[style]:before,:host([pfe-c-non-prod]) h1[style]:before,:host([pfe-c-non-prod]) h2[style]:before,:host([pfe-c-non-prod]) h3[style]:before,:host([pfe-c-non-prod]) h4[style]:before,:host([pfe-c-non-prod]) h5[style]:before,:host([pfe-c-non-prod]) h6[style]:before,:host([pfe-c-non-prod]) header[style]:before,:host([pfe-c-non-prod]) hgroup[style]:before,:host([pfe-c-non-prod]) html[style]:before,:host([pfe-c-non-prod]) i[style]:before,:host([pfe-c-non-prod]) iframe[style]:before,:host([pfe-c-non-prod]) ins[style]:before,:host([pfe-c-non-prod]) kbd[style]:before,:host([pfe-c-non-prod]) label[style]:before,:host([pfe-c-non-prod]) legend[style]:before,:host([pfe-c-non-prod]) li[style]:before,:host([pfe-c-non-prod]) mark[style]:before,:host([pfe-c-non-prod]) menu[style]:before,:host([pfe-c-non-prod]) nav[style]:before,:host([pfe-c-non-prod]) object[style]:before,:host([pfe-c-non-prod]) ol[style]:before,:host([pfe-c-non-prod]) p[style]:before,:host([pfe-c-non-prod]) pre[style]:before,:host([pfe-c-non-prod]) q[style]:before,:host([pfe-c-non-prod]) samp[style]:before,:host([pfe-c-non-prod]) section[style]:before,:host([pfe-c-non-prod]) small[style]:before,:host([pfe-c-non-prod]) span[style]:before,:host([pfe-c-non-prod]) strong[style]:before,:host([pfe-c-non-prod]) sub[style]:before,:host([pfe-c-non-prod]) summary[style]:before,:host([pfe-c-non-prod]) sup[style]:before,:host([pfe-c-non-prod]) table[style]:before,:host([pfe-c-non-prod]) tbody[style]:before,:host([pfe-c-non-prod]) td[style]:before,:host([pfe-c-non-prod]) tfoot[style]:before,:host([pfe-c-non-prod]) th[style]:before,:host([pfe-c-non-prod]) thead[style]:before,:host([pfe-c-non-prod]) time[style]:before,:host([pfe-c-non-prod]) tr[style]:before,:host([pfe-c-non-prod]) ul[style]:before,:host([pfe-c-non-prod]) var[style]:before{display:block;min-width:320px;max-width:100vw;padding:.5em 1em;background:#fee;content:"WARNING: This -moz-element has inline styles which can easily break layout on mobile or other contexts. The inline style is " attr(style);content:"WARNING: This element has inline styles which can easily break layout on mobile or other contexts. The inline style is " attr(style)}.warning-message{display:block;min-width:320px;max-width:100vw;padding:.5em 1em;background:#fee}\n/*# sourceMappingURL=cp-documentation.min.css.map */\n</style><div id="wrapper" class="rhdocs"></div>'}},{key:"templateUrl",get:function(){return"cp-documentation.html"}},{key:"styleUrl",get:function(){return"cp-documentation.scss"}}],[{key:"version",get:function(){return"0.1.34"}},{key:"tag",get:function(){return"cp-documentation"}},{key:"properties",get:function(){return{}}},{key:"slots",get:function(){return{}}},{key:"events",get:function(){return{}}},{key:"PfeType",get:function(){return e.PfeTypes.Container}},{key:"observedAttributes",get:function(){return["pfe-loaded","pfe-endpoint","pfe-css"]}}]),t(i,[{key:"connectedCallback",value:function(){var t=this;if(p(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"connectedCallback",this).call(this),this.hasAttribute("pfe-css"))this._loadCss();else{for(var e="/webassets/avalon/j/public_modules/node_modules/@cpelements/cp-documentation/dist/rhdocs.min.css",o=0;o<document.styleSheets.length;o++){var n=document.styleSheets[o];if(n.href&&n.href.includes("rhdocs.")){e=n.ownerNode.getAttribute("href");break}}this._addStyleSheet(e)}if("object"===("undefined"==typeof drupalSettings?"undefined":l(drupalSettings))&&drupalSettings.red_hat_fcc)"string"==typeof drupalSettings.red_hat_fcc.content_metadata?this._contentData=JSON.parse(drupalSettings.red_hat_fcc.content_metadata):"object"===l(drupalSettings.red_hat_fcc.content_metadata)&&(this._contentData=drupalSettings.red_hat_fcc.content_metadata),this._contentType=this._contentData.content_type,"assembly"===this._contentData.content_type&&this._loadChildModules();else if(window.location.host.includes("access.")&&".redhat.com"===window.location.host.substring(-11)){this._contentType=document.querySelector(".rhdocs__header--assembly")?"assembly":"module";var s=window.location.pathname.split("/"),r=s[s.length-1],a=null;if(this._isDevelopment())a="pantheon.corp.qa.redhat.com";else if("object"===l(window.portal))switch(window.portal.host){case"https://access.dev.redhat.com":a="pantheon.corp.dev.redhat.com";break;case"https://access.qa.redhat.com":a="pantheon.corp.qa.redhat.com";break;case"https://access.stage.redhat.com":a="pantheon.corp.stage.redhat.com";break;default:a="api.docs.redhat.com"}if(a&&this._contentType&&r){var d="https://"+a+"/api/"+this._contentType+"/variant.json/"+r;fetch(d).then(function(e){return e.json()}).then(function(e){200===e.status&&"object"===l(e[t._contentType])&&(t._contentData=e[t._contentType],"assembly"===t._contentType&&t._loadChildModules())}).catch(function(e){return console.error(e)})}}document.querySelector(".rh-docs__sidebar")&&this.classList.add("pfe-documentation--next-to-sidebar"),this._processLightDom(),this._observer.observe(this,u),this.addEventListener(i.events.change,this._changeHandler),this.addEventListener(i.events.loaded,this._loadedHandler);var c=this.querySelector("#rhdocs-preamble");c&&!c.textContent.trim()&&c.remove(),window.location.hash&&window.addEventListener("load",this._navigationHandler),this.parentElement.classList.contains("rh-docs__content-wrapper")&&document.getElementById("rhdocs-header-external")&&this.classList.add("cp-documentation--has-external-header"),window.addEventListener("hashchange",this._navigationHandler)}},{key:"disconnectedCallback",value:function(){this.removeEventListener(i.events.change,this._changeHandler),this.removeEventListener(i.events.loaded,this._loadedHandler)}},{key:"attributeChangedCallback",value:function(e,t,o){switch(p(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"attributeChangedCallback",this).call(this,e,t,o),e){case"pfe-endpoint":this.loadData()}}},{key:"_portalEnvironmentFix",value:function(e){return e=(e=(e=(e=(e=e.replace("http://","https://")).replace("pantheon2-dev.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.dev.redhat.com")).replace("pantheon2-qa.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.qa.redhat.com")).replace("pantheon2-stage.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.stage.redhat.com")).replace("pantheon2-proxy.ext.us-west.aws.prod.paas.redhat.com","api.docs.redhat.com"),(window.location.host.includes("wruvalca")||window.location.host.includes(".foo."))&&(e=e.substring(e.indexOf("/api"))),e}},{key:"_isDevelopment",value:function(){return window.location.host.includes("local")||window.location.host.includes("docksal")||window.location.host.includes(".foo.")}},{key:"_navigationHandler",value:function(){var e=this.shadowRoot.getElementById(window.location.hash.substring(1));e&&window.scrollTo(window.scrollX,e.offsetTop)}},{key:"_createRelatedContentWrapper",value:function(e){"string"!=typeof e&&(e="topic");var t=document.createElement("details"),o=document.createElement("summary"),n=document.createElement("div");return t.classList.add("related-topic-content__wrapper"),"guide"===e&&(t.classList.add("related-topic-content__wrapper--for-guide"),t.setAttribute("open","")),o.classList.add("related-topic-content__title"),n.classList.add("related-topic-content__inner-wrapper"),o.innerText="Content related to this "+e,t.append(o),t.append(n),[t,n]}},{key:"_createPrintButton",value:function(){var e=document.createElement("button");e.innerText="Print",e.classList.add("rhdocs__print-button");var t=document.createElement("pfe-icon");return t.setAttribute("icon","web-print"),t.setAttribute("pfe-size","sm"),e.prepend(t),e.addEventListener("click",function(){window.print()}),e}},{key:"_processLightDom",value:function(e){window.ShadyCSS&&this._observer.disconnect(),this._isDevelopment()&&console.log(this.tag+": Processing Light Dom",e);var t=this.shadowRoot.getElementById("wrapper"),o=this.shadowRoot.getElementById("content"),n=document.createElement("div");this.childNodes.forEach(function(e){var t=e.cloneNode(!0);n.append(t)});for(var s=n.querySelectorAll("._additional-resources"),r=0;r<s.length;r++){var a=s[r],d=document.createElement("aside");if(d.setAttribute("class",a.getAttribute("class")),d.innerHTML=a.innerHTML,a.parentElement.replaceChild(d,a),a=d,"assembly"===this._contentType){var c=a.closest("section, article");if(c){var l=a.querySelector("h2"),p=r===s.length-1&&l?"guide":"topic",i=this._createRelatedContentWrapper(p);"guide"==p?(i[1].append(a),c.append(i[0])):(a.replaceWith(i[0]),i[1].append(a))}}}var h=n.querySelector(".rhdocs__header__secondary-wrapper");if(!n.querySelector("#rhdocs-header-external")&&document.getElementById("rhdocs-header-external")&&(h=document.querySelector("#rhdocs-header-external .rhdocs__header__secondary-wrapper")),h&&!h.querySelector(".rhdocs-print-button")){var f=document.createElement("li");f.classList.add("rh-docs-details-item"),f.classList.add("rhdocs-print-button"),f.append(this._createPrintButton()),h.append(f)}o?t.replaceChild(n,o):t.append(n),n.setAttribute("id","content"),window.ShadyCSS&&this._observer.observe(this,u)}},{key:"_addStyleSheet",value:function(e){if(!this.shadowRoot.querySelector("link[href='"+e+"']")){var t=document.createElement("link");t.setAttribute("id","pfe-css"),t.setAttribute("href",e),t.setAttribute("rel","stylesheet"),this.shadowRoot.prepend(t)}}},{key:"_loadCss",value:function(){this.hasAttribute("pfe-css")&&this._addStyleSheet(this.getAttribute("pfe-css"))}},{key:"loadData",value:function(){var t=this,e=this.getAttribute("pfe-endpoint");e&&fetch(this._portalEnvironmentFix(e)).then(function(e){return e.json()}).then(function(e){"object"===l(e.module)&&(t.setAttribute("pfe-loaded",""),t._contentData=e.module,t._contentData.body&&(t.innerHTML=t._contentData.body))}).catch(function(e){return console.error(t.tag+": "+e)})}},{key:"getData",value:function(){return Object.keys(this._contentData).length?this._contentData:null}},{key:"_addIncludedInGuides",value:function(e){var t=this._contentData.variantToModuleMap[e.variant_uuid];if(1<this._contentData.moduleToVariantMap[t].length)console.error(this.tag+": The same module is used twice in this assembly, included in guides could not be added.");else if(t){var o=this.shadowRoot.querySelector('[pantheon-module-id="'+t+'"]');if(o){for(var n=window.location.pathname.split("/"),s=[],r=0;r<e.included_in_guides.length;r++){var a=e.included_in_guides[r];if(a.uuid!==this._contentData.uuid){var d=document.createElement("a");n[n.length-1]=a.uuid,d.setAttribute("href","/"+n.join("/")),d.innerText=a.title,s.push(d)}}var c=null;if(1<s.length){c=document.createElement("ul");for(var l=0;l<c.length;l++){var p=c[l],i=document.createElement("li");i.append(p),c.append(i)}}else c=s[0];var h=parseInt(o.querySelector("h1, h2, h3, h4, h5, h6").tagName.substring(1)),f=5<h?6:h+1,u=document.createElement("aside");u.classList.add("included-in-guides");var y=document.createElement("h"+f);y.classList.add("included-in-guides__title"),y.innerText="Guides Including this topic",u.append(y),u.append(c);var m=o.querySelector(".related-topic-content__wrapper");if(m)m.querySelector(".related-topic-content__inner-wrapper").append(u);else{var b=this._createRelatedContentWrapper();m=b[0],b[1].append(u),o.append(m)}}}}},{key:"_loadChildModules",value:function(){for(var t=this,e=0;e<this._contentData.modules_included.length;e++){var o=this._contentData.modules_included[e];if(void 0===this._contentData.moduleToVariantMap&&(this._contentData.moduleToVariantMap={},this._contentData.variantToModuleMap={}),void 0===this._contentData.moduleToVariantMap[o.module_uuid]&&(this._contentData.moduleToVariantMap[o.module_uuid]=[]),this._contentData.variantToModuleMap[o.canonical_uuid]=o.module_uuid,this._contentData.moduleToVariantMap[o.module_uuid].push(o),o.url){var n=this._portalEnvironmentFix(o.url);fetch(n).then(function(e){return e.json()}).then(function(e){void 0===t._contentData.loadedModules&&(t._contentData.loadedModules={}),t._contentData.loadedModules[e.module.variant_uuid]=e.module,void 0!==e.module.included_in_guides&&1<e.module.included_in_guides.length&&t._addIncludedInGuides(e.module)}).catch(function(e){return console.error(e)})}}}},{key:"_changeHandler",value:function(e){this.emitEvent(i.events.change,{detail:{}})}},{key:"_loadedHandler",value:function(e){this.emitEvent(i.events.loaded,{detail:{}})}}]),i);function i(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);var e=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}(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,i,{type:i.PfeType}));return e._processLightDom=e._processLightDom.bind(e),e._addStyleSheet=e._addStyleSheet.bind(e),e._loadCss=e._loadCss.bind(e),e.loadData=e.loadData.bind(e),e.getData=e.getData.bind(e),e._navigationHandler=e._navigationHandler.bind(e),e._loadChildModules=e._loadChildModules.bind(e),e._addIncludedInGuides=e._addIncludedInGuides.bind(e),e._observer=new MutationObserver(e._processLightDom),e._contentData={},e._contentType=null,e}return e.create(o),o});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("../../../@patternfly/pfelement/dist/pfelement.umd.min.js")):"function"==typeof define&&define.amd?define(["../../../@patternfly/pfelement/dist/pfelement.umd.min.js"],t):e.PfeDocumentation=t(e.PFElement)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var l="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},t=function(e,t,o){return t&&n(e.prototype,t),o&&n(e,o),e};function n(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function p(e,t,o){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,t);if(void 0===n){var s=Object.getPrototypeOf(e);return null===s?void 0:p(s,t,o)}if("value"in n)return n.value;var r=n.get;return void 0!==r?r.call(o):void 0}Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(Element.prototype.matches.call(t,e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null});var u={characterData:!0,subtree:!0,childList:!0},o=(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)}(i,e),t(i,[{key:"html",get:function(){return'<style>:host{display:block}:host([hidden]){display:none}:host([pfe-c-non-prod]) abbr[style],:host([pfe-c-non-prod]) address[style],:host([pfe-c-non-prod]) article[style],:host([pfe-c-non-prod]) aside[style],:host([pfe-c-non-prod]) b[style],:host([pfe-c-non-prod]) blockquote[style],:host([pfe-c-non-prod]) body[style],:host([pfe-c-non-prod]) canvas[style],:host([pfe-c-non-prod]) caption[style],:host([pfe-c-non-prod]) cite[style],:host([pfe-c-non-prod]) code[style],:host([pfe-c-non-prod]) dd[style],:host([pfe-c-non-prod]) del[style],:host([pfe-c-non-prod]) details[style],:host([pfe-c-non-prod]) dfn[style],:host([pfe-c-non-prod]) div[style],:host([pfe-c-non-prod]) dl[style],:host([pfe-c-non-prod]) dt[style],:host([pfe-c-non-prod]) em[style],:host([pfe-c-non-prod]) fieldset[style],:host([pfe-c-non-prod]) figcaption[style],:host([pfe-c-non-prod]) figure[style],:host([pfe-c-non-prod]) footer[style],:host([pfe-c-non-prod]) form[style],:host([pfe-c-non-prod]) h1[style],:host([pfe-c-non-prod]) h2[style],:host([pfe-c-non-prod]) h3[style],:host([pfe-c-non-prod]) h4[style],:host([pfe-c-non-prod]) h5[style],:host([pfe-c-non-prod]) h6[style],:host([pfe-c-non-prod]) header[style],:host([pfe-c-non-prod]) hgroup[style],:host([pfe-c-non-prod]) html[style],:host([pfe-c-non-prod]) i[style],:host([pfe-c-non-prod]) iframe[style],:host([pfe-c-non-prod]) ins[style],:host([pfe-c-non-prod]) kbd[style],:host([pfe-c-non-prod]) label[style],:host([pfe-c-non-prod]) legend[style],:host([pfe-c-non-prod]) li[style],:host([pfe-c-non-prod]) mark[style],:host([pfe-c-non-prod]) menu[style],:host([pfe-c-non-prod]) nav[style],:host([pfe-c-non-prod]) object[style],:host([pfe-c-non-prod]) ol[style],:host([pfe-c-non-prod]) p[style],:host([pfe-c-non-prod]) pre[style],:host([pfe-c-non-prod]) q[style],:host([pfe-c-non-prod]) samp[style],:host([pfe-c-non-prod]) section[style],:host([pfe-c-non-prod]) small[style],:host([pfe-c-non-prod]) span[style],:host([pfe-c-non-prod]) strong[style],:host([pfe-c-non-prod]) sub[style],:host([pfe-c-non-prod]) summary[style],:host([pfe-c-non-prod]) sup[style],:host([pfe-c-non-prod]) table[style],:host([pfe-c-non-prod]) tbody[style],:host([pfe-c-non-prod]) td[style],:host([pfe-c-non-prod]) tfoot[style],:host([pfe-c-non-prod]) th[style],:host([pfe-c-non-prod]) thead[style],:host([pfe-c-non-prod]) time[style],:host([pfe-c-non-prod]) tr[style],:host([pfe-c-non-prod]) ul[style],:host([pfe-c-non-prod]) var[style]{border:2px solid #c9190b}:host([pfe-c-non-prod]) abbr[style]:before,:host([pfe-c-non-prod]) address[style]:before,:host([pfe-c-non-prod]) article[style]:before,:host([pfe-c-non-prod]) aside[style]:before,:host([pfe-c-non-prod]) b[style]:before,:host([pfe-c-non-prod]) blockquote[style]:before,:host([pfe-c-non-prod]) body[style]:before,:host([pfe-c-non-prod]) canvas[style]:before,:host([pfe-c-non-prod]) caption[style]:before,:host([pfe-c-non-prod]) cite[style]:before,:host([pfe-c-non-prod]) code[style]:before,:host([pfe-c-non-prod]) dd[style]:before,:host([pfe-c-non-prod]) del[style]:before,:host([pfe-c-non-prod]) details[style]:before,:host([pfe-c-non-prod]) dfn[style]:before,:host([pfe-c-non-prod]) div[style]:before,:host([pfe-c-non-prod]) dl[style]:before,:host([pfe-c-non-prod]) dt[style]:before,:host([pfe-c-non-prod]) em[style]:before,:host([pfe-c-non-prod]) fieldset[style]:before,:host([pfe-c-non-prod]) figcaption[style]:before,:host([pfe-c-non-prod]) figure[style]:before,:host([pfe-c-non-prod]) footer[style]:before,:host([pfe-c-non-prod]) form[style]:before,:host([pfe-c-non-prod]) h1[style]:before,:host([pfe-c-non-prod]) h2[style]:before,:host([pfe-c-non-prod]) h3[style]:before,:host([pfe-c-non-prod]) h4[style]:before,:host([pfe-c-non-prod]) h5[style]:before,:host([pfe-c-non-prod]) h6[style]:before,:host([pfe-c-non-prod]) header[style]:before,:host([pfe-c-non-prod]) hgroup[style]:before,:host([pfe-c-non-prod]) html[style]:before,:host([pfe-c-non-prod]) i[style]:before,:host([pfe-c-non-prod]) iframe[style]:before,:host([pfe-c-non-prod]) ins[style]:before,:host([pfe-c-non-prod]) kbd[style]:before,:host([pfe-c-non-prod]) label[style]:before,:host([pfe-c-non-prod]) legend[style]:before,:host([pfe-c-non-prod]) li[style]:before,:host([pfe-c-non-prod]) mark[style]:before,:host([pfe-c-non-prod]) menu[style]:before,:host([pfe-c-non-prod]) nav[style]:before,:host([pfe-c-non-prod]) object[style]:before,:host([pfe-c-non-prod]) ol[style]:before,:host([pfe-c-non-prod]) p[style]:before,:host([pfe-c-non-prod]) pre[style]:before,:host([pfe-c-non-prod]) q[style]:before,:host([pfe-c-non-prod]) samp[style]:before,:host([pfe-c-non-prod]) section[style]:before,:host([pfe-c-non-prod]) small[style]:before,:host([pfe-c-non-prod]) span[style]:before,:host([pfe-c-non-prod]) strong[style]:before,:host([pfe-c-non-prod]) sub[style]:before,:host([pfe-c-non-prod]) summary[style]:before,:host([pfe-c-non-prod]) sup[style]:before,:host([pfe-c-non-prod]) table[style]:before,:host([pfe-c-non-prod]) tbody[style]:before,:host([pfe-c-non-prod]) td[style]:before,:host([pfe-c-non-prod]) tfoot[style]:before,:host([pfe-c-non-prod]) th[style]:before,:host([pfe-c-non-prod]) thead[style]:before,:host([pfe-c-non-prod]) time[style]:before,:host([pfe-c-non-prod]) tr[style]:before,:host([pfe-c-non-prod]) ul[style]:before,:host([pfe-c-non-prod]) var[style]:before{display:block;min-width:320px;max-width:100vw;padding:.5em 1em;background:#fee;content:"WARNING: This -moz-element has inline styles which can easily break layout on mobile or other contexts. The inline style is " attr(style);content:"WARNING: This element has inline styles which can easily break layout on mobile or other contexts. The inline style is " attr(style)}.warning-message{display:block;min-width:320px;max-width:100vw;padding:.5em 1em;background:#fee}\n/*# sourceMappingURL=cp-documentation.min.css.map */\n</style><div id="wrapper" class="rhdocs"></div>'}},{key:"templateUrl",get:function(){return"cp-documentation.html"}},{key:"styleUrl",get:function(){return"cp-documentation.scss"}}],[{key:"version",get:function(){return"0.1.35"}},{key:"tag",get:function(){return"cp-documentation"}},{key:"properties",get:function(){return{}}},{key:"slots",get:function(){return{}}},{key:"events",get:function(){return{}}},{key:"PfeType",get:function(){return e.PfeTypes.Container}},{key:"observedAttributes",get:function(){return["pfe-loaded","pfe-endpoint","pfe-css"]}}]),t(i,[{key:"connectedCallback",value:function(){var t=this;if(p(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"connectedCallback",this).call(this),this.hasAttribute("pfe-css"))this._loadCss();else{for(var e="/webassets/avalon/j/public_modules/node_modules/@cpelements/cp-documentation/dist/rhdocs.min.css",o=0;o<document.styleSheets.length;o++){var n=document.styleSheets[o];if(n.href&&n.href.includes("rhdocs.")){e=n.ownerNode.getAttribute("href");break}}this._addStyleSheet(e)}if("object"===("undefined"==typeof drupalSettings?"undefined":l(drupalSettings))&&drupalSettings.red_hat_fcc)"string"==typeof drupalSettings.red_hat_fcc.content_metadata?this._contentData=JSON.parse(drupalSettings.red_hat_fcc.content_metadata):"object"===l(drupalSettings.red_hat_fcc.content_metadata)&&(this._contentData=drupalSettings.red_hat_fcc.content_metadata),this._contentType=this._contentData.content_type,"assembly"===this._contentData.content_type&&this._loadChildModules();else if(window.location.host.includes("access.")&&".redhat.com"===window.location.host.substring(-11)){this._contentType=document.querySelector(".rhdocs__header--assembly")?"assembly":"module";var s=window.location.pathname.split("/"),r=s[s.length-1],a=null;if(this._isDevelopment())a="pantheon.corp.qa.redhat.com";else if("object"===l(window.portal))switch(window.portal.host){case"https://access.dev.redhat.com":a="pantheon.corp.dev.redhat.com";break;case"https://access.qa.redhat.com":a="pantheon.corp.qa.redhat.com";break;case"https://access.stage.redhat.com":a="pantheon.corp.stage.redhat.com";break;default:a="api.docs.redhat.com"}if(a&&this._contentType&&r){var d="https://"+a+"/api/"+this._contentType+"/variant.json/"+r;fetch(d).then(function(e){return e.json()}).then(function(e){200===e.status&&"object"===l(e[t._contentType])&&(t._contentData=e[t._contentType],"assembly"===t._contentType&&t._loadChildModules())}).catch(function(e){return console.error(e)})}}document.querySelector(".rh-docs__sidebar")&&this.classList.add("pfe-documentation--next-to-sidebar"),this._processLightDom(),this._observer.observe(this,u),this.addEventListener(i.events.change,this._changeHandler),this.addEventListener(i.events.loaded,this._loadedHandler);var c=this.querySelector("#rhdocs-preamble");c&&!c.textContent.trim()&&c.remove(),window.location.hash&&window.addEventListener("load",this._navigationHandler),this.parentElement.classList.contains("rh-docs__content-wrapper")&&document.getElementById("rhdocs-header-external")&&this.classList.add("cp-documentation--has-external-header"),window.addEventListener("hashchange",this._navigationHandler)}},{key:"disconnectedCallback",value:function(){this.removeEventListener(i.events.change,this._changeHandler),this.removeEventListener(i.events.loaded,this._loadedHandler)}},{key:"attributeChangedCallback",value:function(e,t,o){switch(p(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"attributeChangedCallback",this).call(this,e,t,o),e){case"pfe-endpoint":this.loadData()}}},{key:"_portalEnvironmentFix",value:function(e){return e=(e=(e=(e=(e=e.replace("http://","https://")).replace("pantheon2-dev.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.dev.redhat.com")).replace("pantheon2-qa.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.qa.redhat.com")).replace("pantheon2-stage.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.stage.redhat.com")).replace("pantheon2-proxy.ext.us-west.aws.prod.paas.redhat.com","api.docs.redhat.com"),(window.location.host.includes("wruvalca")||window.location.host.includes(".foo."))&&(e=e.substring(e.indexOf("/api"))),e}},{key:"_isDevelopment",value:function(){return window.location.host.includes("local")||window.location.host.includes("docksal")||window.location.host.includes(".foo.")}},{key:"_navigationHandler",value:function(){var e=this.shadowRoot.getElementById(window.location.hash.substring(1));e&&window.scrollTo(window.scrollX,e.offsetTop)}},{key:"_createRelatedContentWrapper",value:function(e){"string"!=typeof e&&(e="topic");var t=document.createElement("details"),o=document.createElement("summary"),n=document.createElement("div");return t.classList.add("related-topic-content__wrapper"),"guide"===e&&(t.classList.add("related-topic-content__wrapper--for-guide"),t.setAttribute("open","")),o.classList.add("related-topic-content__title"),n.classList.add("related-topic-content__inner-wrapper"),o.innerText="Content related to this "+e,t.append(o),t.append(n),[t,n]}},{key:"_createPrintButton",value:function(){var e=document.createElement("button");e.innerText="Print",e.classList.add("rhdocs__print-button");var t=document.createElement("pfe-icon");return t.setAttribute("icon","web-print"),t.setAttribute("pfe-size","sm"),e.prepend(t),e.addEventListener("click",function(){window.print()}),e}},{key:"_processLightDom",value:function(e){window.ShadyCSS&&this._observer.disconnect(),this._isDevelopment()&&console.log(this.tag+": Processing Light Dom",e);var t=this.shadowRoot.getElementById("wrapper"),o=this.shadowRoot.getElementById("content"),n=document.createElement("div");this.childNodes.forEach(function(e){var t=e.cloneNode(!0);n.append(t)});for(var s=n.querySelectorAll("._additional-resources"),r=0;r<s.length;r++){var a=s[r],d=document.createElement("aside");if(d.setAttribute("class",a.getAttribute("class")),d.innerHTML=a.innerHTML,a.parentElement.replaceChild(d,a),a=d,"assembly"===this._contentType){var c=a.closest("section, article");if(c){var l=a.querySelector("h2"),p=r===s.length-1&&l?"guide":"topic",i=this._createRelatedContentWrapper(p);"guide"==p?(i[1].append(a),c.append(i[0])):(a.replaceWith(i[0]),i[1].append(a))}}}var h=n.querySelector(".rhdocs__header__secondary-wrapper");if(!n.querySelector("#rhdocs-header-external")&&document.getElementById("rhdocs-header-external")&&(h=document.querySelector("#rhdocs-header-external .rhdocs__header__secondary-wrapper")),h&&!h.querySelector(".rhdocs-print-button")){var f=document.createElement("li");f.classList.add("rh-docs-details-item"),f.classList.add("rhdocs-print-button"),f.append(this._createPrintButton()),h.append(f)}o?t.replaceChild(n,o):t.append(n),n.setAttribute("id","content"),window.ShadyCSS&&this._observer.observe(this,u)}},{key:"_addStyleSheet",value:function(e){if(!this.shadowRoot.querySelector("link[href='"+e+"']")){var t=document.createElement("link");t.setAttribute("id","pfe-css"),t.setAttribute("href",e),t.setAttribute("rel","stylesheet"),this.shadowRoot.prepend(t)}}},{key:"_loadCss",value:function(){this.hasAttribute("pfe-css")&&this._addStyleSheet(this.getAttribute("pfe-css"))}},{key:"loadData",value:function(){var t=this,e=this.getAttribute("pfe-endpoint");e&&fetch(this._portalEnvironmentFix(e)).then(function(e){return e.json()}).then(function(e){"object"===l(e.module)&&(t.setAttribute("pfe-loaded",""),t._contentData=e.module,t._contentData.body&&(t.innerHTML=t._contentData.body))}).catch(function(e){return console.error(t.tag+": "+e)})}},{key:"getData",value:function(){return Object.keys(this._contentData).length?this._contentData:null}},{key:"_addIncludedInGuides",value:function(e){var t=this._contentData.variantToModuleMap[e.variant_uuid];if(1<this._contentData.moduleToVariantMap[t].length)console.error(this.tag+": The same module is used twice in this assembly, included in guides could not be added.");else if(t){var o=this.shadowRoot.querySelector('[pantheon-module-id="'+t+'"]');if(o){for(var n=window.location.pathname.split("/"),s=[],r=0;r<e.included_in_guides.length;r++){var a=e.included_in_guides[r];if(a.uuid!==this._contentData.uuid){var d=document.createElement("a");n[n.length-1]=a.uuid,d.setAttribute("href","/"+n.join("/")),d.innerText=a.title,s.push(d)}}var c=null;if(1<s.length){c=document.createElement("ul");for(var l=0;l<c.length;l++){var p=c[l],i=document.createElement("li");i.append(p),c.append(i)}}else c=s[0];var h=parseInt(o.querySelector("h1, h2, h3, h4, h5, h6").tagName.substring(1)),f=5<h?6:h+1,u=document.createElement("aside");u.classList.add("included-in-guides");var y=document.createElement("h"+f);y.classList.add("included-in-guides__title"),y.innerText="Guides Including this topic",u.append(y),u.append(c);var m=o.querySelector(".related-topic-content__wrapper");if(m)m.querySelector(".related-topic-content__inner-wrapper").append(u);else{var b=this._createRelatedContentWrapper();m=b[0],b[1].append(u),o.append(m)}}}}},{key:"_loadChildModules",value:function(){for(var t=this,e=0;e<this._contentData.modules_included.length;e++){var o=this._contentData.modules_included[e];if(void 0===this._contentData.moduleToVariantMap&&(this._contentData.moduleToVariantMap={},this._contentData.variantToModuleMap={}),void 0===this._contentData.moduleToVariantMap[o.module_uuid]&&(this._contentData.moduleToVariantMap[o.module_uuid]=[]),this._contentData.variantToModuleMap[o.canonical_uuid]=o.module_uuid,this._contentData.moduleToVariantMap[o.module_uuid].push(o),o.url){var n=this._portalEnvironmentFix(o.url);fetch(n).then(function(e){return e.json()}).then(function(e){void 0===t._contentData.loadedModules&&(t._contentData.loadedModules={}),t._contentData.loadedModules[e.module.variant_uuid]=e.module,void 0!==e.module.included_in_guides&&1<e.module.included_in_guides.length&&t._addIncludedInGuides(e.module)}).catch(function(e){return console.error(e)})}}}},{key:"_changeHandler",value:function(e){this.emitEvent(i.events.change,{detail:{}})}},{key:"_loadedHandler",value:function(e){this.emitEvent(i.events.loaded,{detail:{}})}}]),i);function i(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);var e=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}(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,i,{type:i.PfeType}));return e._processLightDom=e._processLightDom.bind(e),e._addStyleSheet=e._addStyleSheet.bind(e),e._loadCss=e._loadCss.bind(e),e.loadData=e.loadData.bind(e),e.getData=e.getData.bind(e),e._navigationHandler=e._navigationHandler.bind(e),e._loadChildModules=e._loadChildModules.bind(e),e._addIncludedInGuides=e._addIncludedInGuides.bind(e),e._observer=new MutationObserver(e._processLightDom),e._contentData={},e._contentType=null,e}return e.create(o),o});
//# sourceMappingURL=cp-documentation.umd.min.js.map
{
"name": "@cpelements/cp-documentation",
"description": "Documentation element for PatternFly Elements",
"version": "0.1.35",
"version": "0.1.36",
"pfelement": {

@@ -6,0 +6,0 @@ "className": "PfeDocumentation",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc