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.
 
 
 
 
 
 

15 lines
7.4 KiB

(function(_ds){var window=this;'use strict';var sW=function(a){var b=a.kp,c=a.Om,d=a.El;a=a.hn;var e='<ul class="devsite-nav-list" role="navigation" aria-label="'+_ds.Aq("Table of contents");e=e+'" scrollbars><li class="devsite-nav-item devsite-nav-heading devsite-toc-toggle" role="heading" aria-level="2"><a href="#top_of_page" class="devsite-nav-title" aria-label="'+_ds.Aq("Top of page");e=e+'" data-title="'+_ds.Aq("Top of page");e+='"><span class="devsite-nav-text">Table of contents</span></a>';c&&(e=e+'<button type="button" title="'+
_ds.Aq("Expand/collapse contents"),e+='" class="devsite-nav-show-all button-transparent material-icons"></button>');e+="</li>";for(var g=b.length,k=0;k<g;k++){var l=b[k];e+='<li class="devsite-nav-item"'+(c&&l.index<a?" visible":"")+'><a href="#'+_ds.X(l.id)+'" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-action="click" data-label="'+(c?"Embedded nav":"Right nav")+'" data-value="'+_ds.X(k)+'" track-type="navigation" track-name="'+(c?"embeddedNav":"rightNav")+
'" track-metadata-position="'+_ds.X(k)+'" track-metadata-link-destination="#'+_ds.X(l.id)+'"><span class="devsite-nav-text" tooltip>'+_ds.tq(l.text)+"</span></a>";if(_ds.uq(l.children).length){e+='<ul class="devsite-nav-list">';l=l.children;for(var m=l.length,p=0;p<m;p++){var q=l[p];e+='<li class="devsite-nav-item"'+(c&&q.index<a?" visible":"")+'><a href="#'+_ds.X(q.id)+'" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-action="click" data-label="'+(c?"Embedded nav":
"Right nav")+'" data-value="'+_ds.X(k)+"."+_ds.X(p)+'" track-type="navigation" track-name="'+(c?"embeddedNav":"rightNav")+'" track-metadata-position="'+_ds.X(k)+"."+_ds.X(p)+'" track-metadata-link-destination="#'+_ds.X(q.id)+'"><span class="devsite-nav-text" tooltip>'+_ds.tq(q.text)+"</span></a></li>"}e+="</ul>"}e+="</li>"}d&&(e=c?e+'<li class="devsite-nav-item devsite-apix-link"><a href="#try-it" class="devsite-nav-title"><span class="devsite-nav-text" tooltip>Try it</span></a></li>':e+'<button type="button" class="devsite-show-apix button-primary">Try it!</button>');
c&&(e=e+'<li class="devsite-toc-toggle"><button type="button" class="button-flat devsite-nav-more-items material-icons" track-type="navigation" track-name="embeddedNavExpand" title="'+_ds.Aq("Expand/collapse contents"),e+='" aria-hidden="true"></button></li>');return(0,_ds.V)(e+"</ul>")},uW=function(){var a=_ds.R.call(this)||this;a.h=!1;a.C=!1;a.D=new _ds.Qj;a.L=[];a.N=0;a.F=[];a.K=new _ds.Nj(function(){return tW(a)},16);a.m=null;a.H=new _ds.Ql;a.o=new Set;a.G=[];a.j=null;return a},wW=function(a){var b,
c,d;_ds.E(function(e){switch(e.h){case 1:if(!("IntersectionObserver"in _ds.Gd())){e.J(2);break}a.m&&a.m.disconnect();b=document.querySelector("devsite-header");c=152;if(!b){e.J(3);break}return _ds.u(e,window.customElements.whenDefined("devsite-header"),4);case 4:(d=parseFloat(b.getAttribute("top-row--height")||0)+parseFloat(b.getAttribute("bottom-row--height")||0))&&(c=d);case 3:a.m=new IntersectionObserver(function(g){vW(a,g)},{rootMargin:c+"px 0px 0px 0px",threshold:[0,1]});case 2:a.H.resolve(),
_ds.v(e)}})},xW=function(a){_ds.Xg(a);a.dispatchEvent(new CustomEvent("devsite-element-hidden",{bubbles:!0}));a.removeAttribute("visible");a.setAttribute("hidden","");a.h||(a=document.querySelector(".devsite-main-content"))&&a.removeAttribute("has-toc")},yW=function(a){a.dispatchEvent(new CustomEvent("devsite-element-visible",{bubbles:!0}));a.removeAttribute("hidden");a.setAttribute("visible","");if(!a.h){var b=document.querySelector(".devsite-main-content");b&&b.setAttribute("has-toc","");wW(a)}},
tW=function(a){if(!a.hasAttribute("disabled")){var b=document.querySelector("devsite-content .devsite-article-body");b?(a.h?a.classList.add("devsite-toc-embedded"):a.classList.add("devsite-toc"),zW(a,b),a.C=!0,a.h||(AW(a),BW(a))):xW(a)}},zW=function(a,b){var c,d,e,g;_ds.E(function(k){c=[];d=!1;e=Array.from(b.querySelectorAll("h2:not(.hide-from-toc):not(#contents):not(#table-of-contents), h3:not(.hide-from-toc):not(#contents):not(#table-of-contents)")).filter(function(l){return l.id&&l.dataset.text}).filter(function(l){return CW(l)});
e.forEach(function(l,m){l={id:l.id,level:l.tagName.toLowerCase(),text:l.dataset.text,children:[],index:m};"h2"===l.level?(c.push(l),d=!0):d?c[c.length-1].children.push(l):c.push(l)});if((g=_ds.Kb(a.F,c,a.Ih.bind(a)))&&a.C)return k.return();c.length?(DW(a,c),yW(a),a.h||EW(a,e)):xW(a);a.F=c;a.h||(AW(a),BW(a),a.dispatchEvent(new CustomEvent("devsite-toc-updated",{bubbles:!0})));_ds.v(k)})},vW=function(a,b){b=_ds.n(b);for(var c=b.next();!c.done;c=b.next())c=c.value,c.isIntersecting?a.o.add(c.target):
a.o.delete(c.target);if(b=a.o.values().next().value){var d="#"+b.id,e="#"+encodeURI(b.id);b=a.G.find(function(g){g=g.href;return-1!==g.indexOf(d,g.length-d.length)||-1!==g.indexOf(e,g.length-e.length)});a.j!==b&&(a.j&&a.j.classList.remove("devsite-nav-active"),b&&(b.classList.add("devsite-nav-active"),a.j=b))}},EW=function(a,b){var c,d,e;_ds.E(function(g){if(1==g.h)return _ds.u(g,a.H.promise,2);if(!a.m)return g.return();a.m.disconnect();a.o.clear();a.j&&a.j.classList.remove("devsite-nav-active");
a.j=null;c=_ds.n(b);for(d=c.next();!d.done;d=c.next())e=d.value,a.m.observe(e);_ds.v(g)})},CW=function(a){return _ds.tx.find(function(b){return!!_ds.Bh(a,b,6)})||_ds.Ah(a,"devsite-selector",null,6)||_ds.Bh(a,"devsite-dialog",3)?!1:!0},DW=function(a,b){var c=_ds.ir(sW,{kp:b,Om:a.h,El:!!document.body.querySelector("devsite-apix, .devsite-apix"),hn:5});a.G=Array.from(c.querySelectorAll(".devsite-nav-title"));_ds.Xg(a);a.h&&c.setAttribute("hidden","");a.appendChild(c);a.h&&(8<=a.getElementsByClassName("devsite-nav-item").length&&
(Array.from(a.querySelectorAll(".devsite-nav-show-all, .devsite-nav-more-items")).forEach(function(d){a.D.listen(d,"click",function(){a.hasAttribute("expanded")?a.removeAttribute("expanded"):a.setAttribute("expanded","")})}),a.setAttribute("expandable","")),setTimeout(function(){c.removeAttribute("hidden")},0))},BW=function(a){var b=a.getAttribute("offset")||0;(a=a.querySelector(".devsite-nav-list"))&&_ds.Zj(a,"transform","translate3d(0, -"+b+"px, 0)")},AW=function(a){var b=a.getAttribute("max-height")||
0;(a=a.querySelector(".devsite-nav-list"))&&_ds.Zj(a,"max-height",b+"px")};_ds.t(uW,_ds.R);_ds.f=uW.prototype;_ds.f.connectedCallback=function(){var a=this;this.h=this.hasAttribute("devsite-toc-embedded");tW(this);this.D.listen(document.body,"devsite-content-updated",function(){tW(a)})};_ds.f.disconnectedCallback=function(){xW(this);this.C=!1;_ds.Wj(this.D)};_ds.f.attributeChangedCallback=function(a){switch(a){case "offset":BW(this);break;case "max-height":AW(this)}};
_ds.f.renderUpdatedContent=function(a){a=a&&"false"===a.toLowerCase();this.F=[];_ds.Xg(this);a?(this.setAttribute("disabled",""),xW(this)):(this.removeAttribute("disabled"),yW(this),this.K.ra())};_ds.f.Ih=function(a,b){var c=!0;if(a.children.length||b.children.length)c=_ds.Kb(a.children,b.children,this.Ih.bind(this));return c&&a.id===b.id&&a.text===b.text};_ds.fa.Object.defineProperties(uW,{observedAttributes:{configurable:!0,enumerable:!0,get:function(){return["max-height","offset"]}}});
uW.prototype.renderUpdatedContent=uW.prototype.renderUpdatedContent;uW.prototype.attributeChangedCallback=uW.prototype.attributeChangedCallback;uW.prototype.disconnectedCallback=uW.prototype.disconnectedCallback;uW.prototype.connectedCallback=uW.prototype.connectedCallback;try{window.customElements.define("devsite-toc",uW)}catch(a){console.warn("devsite.app.customElement.DevsiteToc",a)};})(_ds_www);