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EAAGU,QAAQ/C,SAASE,cAAc,2BAQjDoC,IACA,IAAI7D,EAAcsD,EAAQO,EAAQ,CAAE3E,MAAO,KAE3CM,EAAQ6E,EACX,IAAGhC,MAAM5C,GAETD,EAAQ,KAEd,G","sources":["webpack:///./node_modules/@stanfordchildrens/sch-client/ts/classes/Debouncer.ts","webpack:///./node_modules/@stanfordchildrens/sch-client/ts/classes/ResizeWatcher.ts","webpack:///./node_modules/@stanfordchildrens/sch-client/ts/behaviors/bs-scrollspy.ts"],"sourcesContent":["export default class Debouncer {\r\n private controller: AbortController | null = null\r\n\r\n debounce(callback: () => void, delay: number) {\r\n if (this.controller) this.controller.abort()\r\n\r\n this.controller = new AbortController()\r\n const signal = this.controller.signal\r\n\r\n return new Promise((resolve, reject) => {\r\n const timeoutId = setTimeout(() => {\r\n if (!signal.aborted) {\r\n callback()\r\n resolve()\r\n }\r\n }, delay)\r\n\r\n signal.addEventListener('abort', () => {\r\n clearTimeout(timeoutId)\r\n reject(new DOMException('Debounced action aborted', 'AbortError'))\r\n })\r\n })\r\n }\r\n}\r\n","import ready from \"../behaviors/ready\"\r\nimport Debouncer from \"./Debouncer\"\r\n\r\ninterface ResizeWatcherOptions {\r\n delay?: number\r\n event?: string\r\n callback?: () => void\r\n}\r\n\r\nexport default class ResizeWatcher {\r\n private debouncer = new Debouncer()\r\n private initialWidth: number | undefined\r\n private initialHeight: number | undefined\r\n private _element: HTMLElement | Window | null = null\r\n private _delay: number\r\n private _callback: () => void\r\n private _event: string\r\n\r\n constructor(\r\n target: string | HTMLElement | (() => HTMLElement | null | void) = 'body',\r\n callbackOrOptions: ResizeWatcherOptions | (() => void) = () => { },\r\n options: ResizeWatcherOptions = {}\r\n ) {\r\n let callback: () => void = () => { }\r\n if (typeof callbackOrOptions === 'function') callback = callbackOrOptions\r\n else if (typeof callbackOrOptions === 'object') options = callbackOrOptions\r\n\r\n options = {\r\n delay: 250,\r\n event: 'resizeEnd',\r\n callback,\r\n ...options\r\n }\r\n\r\n this._delay = options.delay!\r\n this._event = options.event!\r\n this._callback = options.callback!\r\n\r\n ready(() => {\r\n this.getElement(target)\r\n if (!this._element) return\r\n const dimensions = this.getElementDimensions()\r\n this.initialWidth = dimensions.width\r\n this.initialHeight = dimensions.height\r\n this._element instanceof Window\r\n ? window.addEventListener('resize', this.onResize.bind(this))\r\n : this.initResizeObserver()\r\n })\r\n }\r\n\r\n private getElement(target: string | HTMLElement | (() => HTMLElement | null | void)) {\r\n if (typeof target === 'string') this._element = target === 'body' ? document.body : document.querySelector(target) as HTMLElement\r\n else if (typeof target === 'function') this._element = target() || null\r\n else if (target instanceof HTMLElement) this._element = target\r\n\r\n if (!this._element) console.error(`Element not found for target: ${target}`)\r\n }\r\n\r\n private getElementDimensions(): { width: number, height: number } {\r\n if (this._element instanceof Window) return { width: window.innerWidth, height: window.innerHeight }\r\n else if (this._element instanceof HTMLElement) {\r\n const rect = this._element.getBoundingClientRect()\r\n return { width: rect.width, height: rect.height }\r\n }\r\n return { width: 0, height: 0 }\r\n }\r\n\r\n private initResizeObserver() {\r\n if (!this._element || !(this._element instanceof HTMLElement)) return\r\n const resizeObserver = new ResizeObserver(entries => this.onResize())\r\n resizeObserver.observe(this._element)\r\n }\r\n\r\n private onResize() {\r\n this.debouncer\r\n .debounce(() => this.resizeEnd(), this._delay)\r\n .catch((err: Error) => {\r\n if (err.name !== 'AbortError')\r\n console.error('Unexpected error during debounce:', err)\r\n })\r\n }\r\n\r\n private resizeEnd() {\r\n const currentDimensions = this.getElementDimensions()\r\n const { width: currentWidth, height: currentHeight } = currentDimensions\r\n\r\n if (currentWidth !== this.initialWidth || currentHeight !== this.initialHeight) {\r\n this._callback()\r\n this.initialWidth = currentWidth\r\n this.initialHeight = currentHeight\r\n this._element?.dispatchEvent(new Event(this._event))\r\n }\r\n }\r\n\r\n set delay(newDelta: number) {\r\n this._delay = newDelta\r\n }\r\n\r\n set callback(newCallback: () => void) {\r\n this._callback = newCallback\r\n }\r\n\r\n set event(newEventName: string) {\r\n this._event = newEventName\r\n }\r\n\r\n get event() {\r\n return this._event\r\n }\r\n\r\n get element() {\r\n return this._element\r\n }\r\n\r\n public destroy() {\r\n this._element instanceof Window\r\n ? window.removeEventListener('resize', this.onResize)\r\n : this._element && new ResizeObserver(() => { }).disconnect()\r\n }\r\n}\r\n","import ready from \"./ready\"\r\nimport ResizeWatcher from \"../classes/ResizeWatcher\"\r\nimport type { default as ScrollSpy } from 'bootstrap/js/dist/scrollspy'\r\n\r\nconst scrollSpy = new Promise((resolve, reject) => ready(() => {\r\n const\r\n scrollMenu = document.getElementById(\"scrollMenu\") as HTMLElement,\r\n navbar = document.querySelector('header.navbar') as HTMLElement,\r\n adjust = () => {\r\n if (scrollMenu) scrollMenu.style.top = `${navbar.clientHeight + 18}px`\r\n }\r\n\r\n new ResizeWatcher(navbar, adjust, { delay: 20 })\r\n\r\n if (scrollMenu) {\r\n import(\"bootstrap/js/dist/scrollspy.js\").then((SS) => {\r\n const ss = new SS.default(document.querySelector(\"[data-bs-spy='scroll']\")!)\r\n function resize() {\r\n if (!scrollMenu) return\r\n const par = scrollMenu.parentElement\r\n if (par) scrollMenu.style.width = `${par.offsetWidth - parseInt(getComputedStyle(par).paddingLeft) - parseInt(getComputedStyle(par).paddingRight)}px`\r\n adjust()\r\n }\r\n\r\n resize()\r\n new ResizeWatcher(navbar, resize, { delay: 20 })\r\n\r\n resolve(ss)\r\n }).catch(reject)\r\n } else {\r\n resolve(null)\r\n }\r\n}))\r\n\r\nexport default scrollSpy\r\n"],"names":["Debouncer","controller","debounce","callback","delay","this","abort","AbortController","signal","Promise","resolve","reject","timeoutId","setTimeout","aborted","addEventListener","clearTimeout","DOMException","ResizeWatcher","target","callbackOrOptions","options","debouncer","initialWidth","initialHeight","_element","_delay","_callback","_event","event","ready","getElement","dimensions","getElementDimensions","width","height","Window","window","onResize","bind","initResizeObserver","document","body","querySelector","HTMLElement","console","error","innerWidth","innerHeight","rect","getBoundingClientRect","ResizeObserver","entries","observe","resizeEnd","catch","err","name","currentDimensions","currentWidth","currentHeight","dispatchEvent","Event","newDelta","newCallback","newEventName","element","destroy","removeEventListener","disconnect","scrollMenu","getElementById","navbar","adjust","style","top","clientHeight","then","SS","resize","par","parentElement","offsetWidth","parseInt","getComputedStyle","paddingLeft","paddingRight","ss","default"],"sourceRoot":""}