PageSourceSearch

https://www.recorder.ca/wp-content/themes/postmedia-master/build/components/accordion/index.js?ver=1790879686

js recorder.ca collected 2026-10-02 05:43:03 UTC 6,606 bytes, 1 lines download raw bytes

1(()=>{var t={1442:function(t){var e;"undefined"!=typeof self&&self,e=()=>(()=>{"use strict";var t={d:(e,s)=>{for(var r in s)t.o(s,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:s[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{default:()=>l});class s extends HTMLElement{constructor(){super()}static get observedAttributes(){return["expand-all","collapse-all"]}attributeChangedCallback(t="",e="",s=""){e!==s&&(this.update(),"yes"!==s||"collapse-all"!==t&&"expand-all"!==t||this.dispatchEvent(new CustomEvent(t,{bubbles:!0})))}update(){const t=this.querySelectorAll("rt-accordion-item");if(!t.length)return;const e="yes"===this.getAttribute("expand-all")?"expand-all":"yes"===this.getAttribute("collapse-all")?"collapse-all":"";e&&t.forEach(t=>{"expand-all"===e?t.setAttribute("expanded",""):t.removeAttribute("expanded")})}}class r extends HTMLElement{constructor(){super(),this.setAttribute("aria-expanded","false"),"yes"===this.getAttribute("open-by-default")&&(this.setAttribute("expanded",""),this.setAttribute("aria-expanded","true"))}disconnectedCallback(){this.removeAttribute("open-by-default")}static get observedAttributes(){return["expanded"]}attributeChangedCallback(t,e,s){"expanded"===t&&(this.hasAttribute("expanded")?this.open():this.close(),this.removeAttribute("open-by-default"))}open(){const t=this.querySelector("rt-accordion-content"),e=this.querySelector("rt-accordion-handle");t&&(this.dispatchEvent(new CustomEvent("before-open",{bubbles:!0})),t.style.height=`${t.scrollHeight}px`,this.setAttribute("aria-expanded","true"),e?.setAttribute("aria-expanded","true"),t.setAttribute("aria-hidden","false"),this.hasAttribute("open-by-default")&&"no"===this.getAttribute("open-by-default")&&this.removeAttribute("open-by-default"),this.hasAttribute("expanded")||this.setAttribute("expanded",""),this.dispatchEvent(new CustomEvent("open",{bubbles:!0})))}close(){const t=this.querySelector("rt-accordion-content"),e=this.querySelector("rt-accordion-handle");t&&(this.dispatchEvent(new CustomEvent("before-close",{bubbles:!0})),t.style.height=`${t.scrollHeight}px`,t.offsetHeight,t.style.height="0px",this.setAttribute("aria-expanded","false"),e?.setAttribute("aria-expanded","false"),t.setAttribute("aria-hidden","true"),this.hasAttribute("open-by-default")&&"yes"===this.getAttribute("open-by-default")&&this.removeAttribute("open-by-default"),this.hasAttribute("expanded")&&this.removeAttribute("expanded"),this.dispatchEvent(new CustomEvent("close",{bubbles:!0})))}}class n extends HTMLElement{button=null;accordionItem=null;constructor(){super(),this.button=this.querySelector("button"),this.button?.addEventListener("click",()=>this.toggle()),this.accordionItem=this.closest("rt-accordion-item"),this.setAttribute("role","button"),"yes"===this.accordionItem?.getAttribute("open-by-default")?(this.setAttribute("aria-expanded","true"),this.button?.setAttribute("aria-expanded","true")):(this.setAttribute("aria-expanded","false"),this.button?.setAttribute("aria-expanded","false"))}disconnectedCallback(){this.button?.removeEventListener("click",()=>this.toggle())}toggle(){this.accordionItem?.toggleAttribute("expanded"),this.accordionItem?.hasAttribute("expanded")?(this.button?.setAttribute("aria-expanded","true"),this.accordionItem?.setAttribute("aria-expanded","true")):(this.button?.setAttribute("aria-expanded","false"),this.accordionItem?.setAttribute("aria-expanded","false"))}}class i extends HTMLElement{constructor(){super();const t=this.closest("rt-accordion-item");t?.hasAttribute("open-by-default")?this.setAttribute("aria-hidden","false"):this.setAttribute("aria-hidden","true")}}class o extends HTMLElement{button=null;constructor(){super(),this.setAttribute("role","button"),this.button=this.querySelector("button"),this.button?.addEventListener("click",()=>this.expandAll())}disconnectedCallback(){this.button?.removeEventListener("click",()=>
1this.expandAll())}expandAll(){const t=this.closest("rt-accordion");t?.setAttribute("expand-all","yes"),t?.removeAttribute("collapse-all")}}class a extends HTMLElement{button=null;constructor(){super(),this.setAttribute("role","button"),this.button=this.querySelector("button"),this.button?.addEventListener("click",()=>this.collapseAll())}disconnectedCallback(){this.button?.removeEventListener("click",()=>this.collapseAll())}collapseAll(){const t=this.closest("rt-accordion");t?.removeAttribute("expand-all"),t?.setAttribute("collapse-all","yes")}}customElements.define("rt-accordion",s),customElements.define("rt-accordion-item",r),customElements.define("rt-accordion-handle",n),customElements.define("rt-accordion-content",i),customElements.define("rt-accordion-expand-all",o),customElements.define("rt-accordion-collapse-all",a);const l={accordion:s,item:r,handle:n,content:i,expandAll:o,collapseAll:a};return e})(),t.exports=e()}},e={};function s(r){var n=e[r];if(void 0!==n)return n.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,s),i.exports}s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var r in e)s.o(e,r)&&!s.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";s(1442);class t extends HTMLElement{accordionElements=[];constructor(){super(),this.isSingleOpenEnabled="false"!==this.getAttribute("single-open"),this.accordionElements=Array.from(this.querySelectorAll("rt-accordion")),this.accordionElements.forEach(t=>{this.isSingleOpenEnabled&&t.addEventListener("before-open",t=>this.closeSiblingAccordionItems(t)),t.addEventListener("open",t=>this.onToggle(t)),t.addEventListener("close",t=>this.onToggle(t)),this.syncAllInert(t)})}closeSiblingAccordionItems(t){if(!this.isSingleOpenEnabled)return;const e=t.target;if(!e||"RT-ACCORDION-ITEM"!==e.tagName)return;const s=e.closest("rt-accordion");s&&this.contains(s)&&Array.from(s.querySelectorAll("rt-accordion-item")).filter(t=>s===t.closest("rt-accordion")).forEach(t=>{t!==e&&t.close()})}syncAllInert(t){Array.from(t.querySelectorAll("rt-accordion-item")).forEach(t=>this.syncItemInert(t))}onToggle(t){const e=t.target;e&&"RT-ACCORDION-ITEM"===e.tagName&&this.syncItemInert(e)}syncItemInert(t){const e=t.querySelector("rt-accordion-content");if(!e)return;const s=t.hasAttribute("expanded");e.toggleAttribute("inert",!s)}}customElements.get("pm-accordion")||customElements.define("pm-accordion",t)})()})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.