forked from github/docs
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
code-menu-67595c3a6d0c.js
2 lines (2 loc) · 6.57 KB
/
code-menu-67595c3a6d0c.js
1
2
"use strict";(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([["code-menu"],{38974:(t,e,o)=>{o(25999)},76006:(t,e,o)=>{let n;o.d(e,{Lj:()=>p,Ih:()=>C,P4:()=>u,nW:()=>P,fA:()=>A,GO:()=>v});let r=new WeakSet,a=new WeakMap;function s(t=document){if(a.has(t))return a.get(t);let e=!1,o=new MutationObserver(t=>{for(let e of t)if("attributes"===e.type&&e.target instanceof Element)d(e.target);else if("childList"===e.type&&e.addedNodes.length)for(let t of e.addedNodes)t instanceof Element&&l(t)});o.observe(t,{childList:!0,subtree:!0,attributeFilter:["data-action"]});let n={get closed(){return e},unsubscribe(){e=!0,a.delete(t),o.disconnect()}};return a.set(t,n),n}function l(t){for(let e of t.querySelectorAll("[data-action]"))d(e);t instanceof Element&&t.hasAttribute("data-action")&&d(t)}function i(t){let e=t.currentTarget;for(let o of c(e))if(t.type===o.type){let n=e.closest(o.tag);r.has(n)&&"function"==typeof n[o.method]&&n[o.method](t);let a=e.getRootNode();if(a instanceof ShadowRoot&&r.has(a.host)&&a.host.matches(o.tag)){let e=a.host;"function"==typeof e[o.method]&&e[o.method](t)}}}function*c(t){for(let e of(t.getAttribute("data-action")||"").trim().split(/\s+/)){let t=e.lastIndexOf(":"),o=Math.max(0,e.lastIndexOf("#"))||e.length;yield{type:e.slice(0,t),tag:e.slice(t+1,o),method:e.slice(o+1)||"handleEvent"}}}function d(t){for(let e of c(t))t.addEventListener(e.type,i)}function u(t,e){let o=t.tagName.toLowerCase();if(t.shadowRoot){for(let n of t.shadowRoot.querySelectorAll(`[data-target~="${o}.${e}"]`))if(!n.closest(o))return n}for(let n of t.querySelectorAll(`[data-target~="${o}.${e}"]`))if(n.closest(o)===t)return n}let f=t=>String("symbol"==typeof t?t.description:t).replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/--/g,"-").replace(/^-|-$/,"").toLowerCase(),b=(t,e="property")=>{let o=f(t);if(!o.includes("-"))throw new DOMException(`${e}: ${String(t)} is not a valid ${e} name`,"SyntaxError");return o},h="attr";function p(t,e){w(t,h).add(e)}let g=new WeakSet;function m(t,e){if(g.has(t))return;g.add(t);let o=Object.getPrototypeOf(t),n=o?.constructor?.attrPrefix??"data-";for(let r of(e||(e=w(o,h)),e)){let e=t[r],o=b(`${n}${r}`),a={configurable:!0,get(){return this.getAttribute(o)||""},set(t){this.setAttribute(o,t||"")}};"number"==typeof e?a={configurable:!0,get(){return Number(this.getAttribute(o)||0)},set(t){this.setAttribute(o,t)}}:"boolean"==typeof e&&(a={configurable:!0,get(){return this.hasAttribute(o)},set(t){this.toggleAttribute(o,t)}}),Object.defineProperty(t,r,a),r in t&&!t.hasAttribute(o)&&a.set.call(t,e)}}let y=Symbol.for("catalyst");let CatalystDelegate=class CatalystDelegate{constructor(t){let e=this,o=t.prototype.connectedCallback;t.prototype.connectedCallback=function(){e.connectedCallback(this,o)};let n=t.prototype.disconnectedCallback;t.prototype.disconnectedCallback=function(){e.disconnectedCallback(this,n)};let r=t.prototype.attributeChangedCallback;t.prototype.attributeChangedCallback=function(t,o,n){e.attributeChangedCallback(this,t,o,n,r)};let a=t.observedAttributes||[];Object.defineProperty(t,"observedAttributes",{configurable:!0,get(){return e.observedAttributes(this,a)},set(t){a=t}}),function(t){let e=t.observedAttributes||[],o=t.attrPrefix??"data-",n=t=>b(`${o}${t}`);Object.defineProperty(t,"observedAttributes",{configurable:!0,get:()=>[...w(t.prototype,h)].map(n).concat(e),set(t){e=t}})}(t),function(t){let e=f(t.name).replace(/-element$/,"");try{window.customElements.define(e,t),window[t.name]=customElements.get(e)}catch(t){if(!(t instanceof DOMException&&"NotSupportedError"===t.name))throw t}}(t)}observedAttributes(t,e){return e}connectedCallback(t,e){var o,n;t.toggleAttribute("data-catalyst",!0),customElements.upgrade(t),!function(t){for(let e of t.querySelectorAll("template[data-shadowroot]"))e.parentElement===t&&t.attachShadow({mode:"closed"===e.getAttribute("data-shadowroot")?"closed":"open"}).append(e.content.cloneNode(!0))}(t),m(t),r.add(t),t.shadowRoot&&(l(n=t.shadowRoot),s(n)),l(t),s(t.ownerDocument),e?.call(t),t.shadowRoot&&(l(o=t.shadowRoot),s(o))}disconnectedCallback(t,e){e?.call(t)}attributeChangedCallback(t,e,o,n,r){m(t),"data-catalyst"!==e&&r&&r.call(t,e,o,n)}};function w(t,e){if(!Object.prototype.hasOwnProperty.call(t,y)){let e=t[y],o=t[y]=new Map;if(e)for(let[t,n]of e)o.set(t,new Set(n))}let o=t[y];return o.has(e)||o.set(e,new Set),o.get(e)}function A(t,e){w(t,"target").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return u(this,e)}})}function v(t,e){w(t,"targets").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return function(t,e){let o=t.tagName.toLowerCase(),n=[];if(t.shadowRoot)for(let r of t.shadowRoot.querySelectorAll(`[data-targets~="${o}.${e}"]`))r.closest(o)||n.push(r);for(let r of t.querySelectorAll(`[data-targets~="${o}.${e}"]`))r.closest(o)===t&&n.push(r);return n}(this,e)}})}function C(t){new CatalystDelegate(t)}let S=new Map,k=new Promise(t=>{"loading"!==document.readyState?t():document.addEventListener("readystatechange",()=>t(),{once:!0})}),E=new Promise(t=>{let e=new AbortController;e.signal.addEventListener("abort",()=>t());let o={once:!0,passive:!0,signal:e.signal},n=()=>e.abort();document.addEventListener("mousedown",n,o),document.addEventListener("touchstart",n,o),document.addEventListener("keydown",n,o),document.addEventListener("pointerdown",n,o)}),O={ready:()=>k,firstInteraction:()=>E,visible:t=>new Promise(e=>{let o=new IntersectionObserver(t=>{for(let n of t)if(n.isIntersecting){e(),o.disconnect();return}},{rootMargin:"0px 0px 256px 0px",threshold:.01});for(let e of document.querySelectorAll(t))o.observe(e)})},$=new WeakMap;function L(t){cancelAnimationFrame($.get(t)||0),$.set(t,requestAnimationFrame(()=>{for(let e of S.keys()){let o=t.matches(e)?t:t.querySelector(e);if(customElements.get(e)||o){let n=o?.getAttribute("data-load-on")||"ready",r=n in O?O[n]:O.ready;for(let t of S.get(e)||[])r(e).then(t);S.delete(e),$.delete(t)}}}))}function P(t,e){S.has(t)||S.set(t,new Set),S.get(t).add(e),L(document.body),n||(n=new MutationObserver(t=>{if(S.size)for(let e of t)for(let t of e.addedNodes)t instanceof Element&&L(t)})).observe(document,{subtree:!0,childList:!0})}},15205:(t,e,o)=>{function n(...t){return JSON.stringify(t,(t,e)=>"object"==typeof e?e:String(e))}function r(t,e={}){let{hash:o=n,cache:r=new Map}=e;return function(...e){let n=o.apply(this,e);if(r.has(n))return r.get(n);let a=t.apply(this,e);return a instanceof Promise&&(a=a.catch(t=>{throw r.delete(n),t})),r.set(n,a),a}}o.d(e,{Z:()=>r})}},t=>{var e=e=>t(t.s=e);t.O(0,["vendors-node_modules_github_selector-observer_dist_index_esm_js","app_assets_modules_github_repositories_get-repo-element_ts"],()=>e(38974)),t.O()}]);
//# sourceMappingURL=code-menu-3d0e8fd73f18.js.map