You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

18 lines
6.7 KiB

(function(_ds){var window=this;/*
Copyright The Closure Library Authors.
SPDX-License-Identifier: Apache-2.0
*/
'use strict';var mO=function(a,b){jO()&&(b=kO()?"translate3d("+b+"px,0px,0px)":"translate("+b+"px,0px)",_ds.Zj(a,lO(),b))},pO=function(){var a=_ds.R.call(this)||this;a.H=-1;a.h=new _ds.Qj;a.G=new _ds.Qj;a.C=0;a.K=new MutationObserver(function(){return nO(a)});a.N=new _ds.Nj(function(){nO(a);oO(a)},15);a.L=0;a.m=0;a.o=0;a.j=0;a.D=!1;return a},rO=function(a){a.h.listen(a,"devsite-search-toggle",function(b){b=b.Z;_ds.Bh(b.target,"devsite-top-logo-row-middle")&&(b.detail.active?a.setAttribute("search-active",
""):a.removeAttribute("search-active"))});a.h.listen(document.body,"devsite-sitemask-hidden",function(){return document.body.removeAttribute("devsite-book-nav--open")});a.h.listen(window,"resize",function(){return qO(a)});a.h.listen(document.body,["devsite-page-loaded","devsite-content-updated"],function(){qO(a)});a.h.listen(a,"click",function(b){b.defaultPrevented||"devsite-hamburger-menu"!=b.target.getAttribute("id")||(b.preventDefault(),b.stopPropagation(),document.body.setAttribute("devsite-book-nav--open",
""),a.dispatchEvent(new CustomEvent("devsite-sitemask-show",{bubbles:!0})))})},qO=function(a){window.requestAnimationFrame(function(){return a.N.ra()})},sO=function(a,b){return(a=a.querySelector(b))?a.getBoundingClientRect().height:0},nO=function(a){a.L=sO(a,".devsite-top-logo-row-wrapper-wrapper");a.m=sO(a,".devsite-collapsible-section");a.o=sO(a,".devsite-doc-set-nav-row");a.setAttribute("top-row--height",a.L);a.setAttribute("bottom-row--height",a.m);a.setAttribute("bottom-tabs--height",a.o);tO(a)},
uO=function(a){if(!a.querySelector(".devsite-search-background")&&(a=a.querySelector(".devsite-top-logo-row-middle"))){var b=document.createElement("div");b.classList.add("devsite-search-background");b.style.opacity=1;a.appendChild(b)}},tO=function(a){var b=a.querySelector(".devsite-collapsible-section");a.j>=a.m&&!a.hasAttribute("bottom-row--hidden")?a.setAttribute("bottom-row--hidden",""):a.j<a.m-a.o&&a.hasAttribute("bottom-row--hidden")&&a.removeAttribute("bottom-row--hidden");b&&a.j!==a.H&&(_ds.Zj(b,
"transform","translate3d(0, -"+a.j+"px, 0)"),oO(a),a.H=a.j)},vO=function(a){var b=a.querySelector(".devsite-top-logo-row-middle"),c=a.querySelector("devsite-search"),d=a.querySelector(".devsite-search-background");if(b&&c&&d){_ds.Wj(a.G);a.C&&window.cancelAnimationFrame(a.C);c.removeAttribute("transition");a.removeAttribute("search-expanded");var e=new _ds.xg(b.offsetWidth,b.offsetHeight);b=new _ds.xg(c.offsetWidth,c.offsetHeight);var g=_ds.tk(c,"margin"),k="rtl"===document.documentElement.getAttribute("dir")?
1:-1,l=(e.width-g.left-g.right)/b.width;e=(e.width-(b.width+g.left+g.right))*k;var m=(g=a.hasAttribute("search-active"))?e:0,p=g?l:1;_ds.Zj(d,{opacity:1,width:b.width+"px",height:b.height+"px"});mO(c,a.hasAttribute("search-active")?0:e);_ds.Uj(a.G,d,_ds.ex,function(){var q=a.querySelector("devsite-search"),r=a.querySelector(".devsite-search-background");r&&(r.style.opacity=0);q&&(q.removeAttribute("transition"),mO(q,0),a.hasAttribute("search-active")?a.setAttribute("search-expanded",""):a.removeAttribute("search-expanded"))});
a.C=window.requestAnimationFrame(function(){c.setAttribute("transition","");if(jO()){var q=kO()?"scale3d("+p+",1,1)":"scale("+p+",1)";_ds.Zj(d,lO(),q)}mO(c,m)})}},wO=function(a,b){var c,d,e,g;_ds.E(function(k){if(1==k.h){if(!a.hasAttribute("billboard"))return k.return();c=a.querySelector("devsite-search");d=a.querySelector("devsite-search input.devsite-search-query");e=a.querySelector(".devsite-header-billboard-search devsite-search");g=e.querySelector("input.devsite-search-query");if(!b)return e.removeAttribute("disabled"),
document.activeElement===d&&g.focus(),c.setAttribute("disabled",""),k.J(0);c.removeAttribute("disabled");return document.activeElement!==g?k.J(3):_ds.u(k,_ds.Oi(),4)}3!=k.h&&d.focus();e.setAttribute("disabled","");_ds.v(k)})},oO=function(a){0===a.m?a.setAttribute("no-lower-row",""):a.removeAttribute("no-lower-row");a.querySelector(".devsite-header-billboard")?a.setAttribute("billboard",""):a.removeAttribute("billboard")},xO=function(a,b){for(var c=0;c<b.attributes.length;++c){var d=b.attributes.item(c);
a.hasAttribute(d.name)||b.removeAttribute(d.name)}for(c=0;c<a.attributes.length;++c)d=a.attributes.item(c),b.setAttribute(d.name,d.value)},yO=function(a,b,c){b=b.querySelector(c);c=a.querySelector(c);b&&c&&(a.D=!0,_ds.Hl(a,c,b))};var jO=_ds.Rb(function(){return!_ds.Og||0<=_ds.Bc(_ds.ty,9)}),kO=_ds.Rb(function(){return _ds.Qg||_ds.pr||_ds.bk&&0<=_ds.Bc(_ds.ty,10)||_ds.Og&&0<=_ds.Bc(_ds.ty,10)}),lO=_ds.Rb(function(){return _ds.Og&&9==_ds.Ge?"-ms-transform":"transform"});_ds.t(pO,_ds.R);pO.prototype.attributeChangedCallback=function(a,b,c){switch(a){case "offset":this.j=parseFloat(this.getAttribute("offset"))||0;tO(this);break;case "search-active":vO(this);break;case "bottom-row--hidden":a=null!==c,b=this.querySelector("devsite-search input.devsite-search-query"),c=this.querySelector(".devsite-header-billboard-search devsite-search input.devsite-search-query"),b&&c&&(a?b.value=c.value:c.value=b.value),wO(this,a)}};
pO.prototype.connectedCallback=function(){rO(this);uO(this);oO(this);nO(this);this.K.observe(this,{childList:!0,subtree:!0});tO(this);var a=_ds.zi();this.F=_ds.mi(_ds.oi(a.href),"authuser")};pO.prototype.disconnectedCallback=function(){_ds.Wj(this.h);this.K.disconnect()};
pO.prototype.updateContent=function(a){this.D=!1;if(a){yO(this,a,".devsite-header-upper-tabs");yO(this,a,".devsite-collapsible-section");yO(this,a,".devsite-product-name-wrapper");yO(this,a,"devsite-language-selector");yO(this,a,"devsite-shell-activate-button");var b=a.querySelector("devsite-search"),c=this.querySelector("devsite-search");b&&c&&xO(b,c);c=a.querySelector("devsite-user");b=this.querySelector("devsite-user");c&&b&&(xO(c,b),c=_ds.zi(),c=_ds.mi(_ds.oi(c.href),"authuser"),c!==this.F&&(this.F=
c,b.refresh()));_ds.Hl(this,this.querySelector("cloudx-additional-tabs"),a.querySelector("cloudx-additional-tabs"),this.querySelector(".devsite-top-logo-row-middle"));_ds.Hl(this,this.querySelector(".devsite-header-link"),a.querySelector(".devsite-header-link"),this.querySelector("devsite-language-selector"))}!this.D&&a&&(_ds.Xg(this),this.appendChild(a));uO(this);qO(this)};
_ds.fa.Object.defineProperties(pO,{observedAttributes:{configurable:!0,enumerable:!0,get:function(){return["offset","search-active","bottom-row--hidden"]}}});pO.prototype.updateContent=pO.prototype.updateContent;pO.prototype.disconnectedCallback=pO.prototype.disconnectedCallback;pO.prototype.connectedCallback=pO.prototype.connectedCallback;pO.prototype.attributeChangedCallback=pO.prototype.attributeChangedCallback;try{window.customElements.define("devsite-header",pO)}catch(a){console.warn("devsite.app.customElement.DevsiteHeader",a)};})(_ds_www);