@ulu/frontend 0.1.0-beta.38 → 0.1.0-beta.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Change Log
2
2
 
3
+ ## Version 0.1.0-beta.39
4
+
5
+ - **js/ui/scrollpoint.js**
6
+ - Fix attribute name for state to have ulu prefix (ie. data-scrollpoint-state is now data-ulu-scrollpoint-state)
7
+
3
8
  ## Version 0.1.0-beta.38
4
9
 
5
10
  - **scss/**
@@ -68,4 +68,4 @@ var aa=Object.defineProperty;var sa=(n,e,t)=>e in n?aa(n,e,{enumerable:!0,config
68
68
  `}getClass(e,t){const{namespace:r}=this.options;return t?`${r}--${e}`:e?`${r}__${e}`:r}createControlButton(e){const t=document.createElement("button");return t.classList.add(this.getClass("control-button")),t.classList.add(this.getClass(`control-button--${e}`)),t.classList.add(...this.options.buttonClasses),t.setAttribute("data-slider-control",e),t.setAttribute("type","button"),t.innerHTML=this.getControlContent(e),t}createControls(e){const t=document.createElement("ul"),r=document.createElement("li"),o=document.createElement("li"),i=this.createControlButton("previous"),a=this.createControlButton("next");return t.classList.add(this.getClass("controls")),r.appendChild(i),o.appendChild(a),t.appendChild(r),t.appendChild(o),i.addEventListener("click",this.previous.bind(this)),a.addEventListener("click",this.next.bind(this)),e.appendChild(t),{controls:t,previousItem:r,nextItem:o,previous:i,next:a}}createNav(e){const t=document.createElement("ul"),r=this.slides.map(this.createNavButton.bind(this)),o=r.map(i=>{const a=document.createElement("li");return a.appendChild(i),t.appendChild(a),a});return t.classList.add(this.getClass("nav")),e.appendChild(t),{nav:t,navButtons:r,navItems:o}}createNavButton(e,t){const r=document.createElement("button");return r.classList.add(this.getClass("nav-button")),r.setAttribute("type","button"),r.innerHTML=this.getNavContent(e),e.navButton=r,r.addEventListener("click",this.goto.bind(this,t)),r}getControlContent(e){const t=this.options[e==="next"?"iconClassNext":"iconClassPrevious"];return`
69
69
  <span class="${this.options.classAccessiblyHidden}">${e}</span>
70
70
  <span class="${this.getClass("control-icon")} ${t}" aria-hidden="true"></span>
71
- `}getNavContent(e){return`<span class="${this.options.classAccessiblyHidden}">Item ${e.number}</span>`}emit(e,t){this.options.events[e]&&this.options.events[e].apply(this,t)}};z(Ve,"instances",[]),z(Ve,"defaults",{classAccessiblyHidden:"hidden-visually",namespace:"Slider",events:{},transition:!0,transitionFade:!1,transitionDuration:700,transitionDurationExit:400,transitionTimingFunction:"ease-in-out",buttonClasses:["button","button--icon"],iconClassPrevious:we("iconClassPrevious"),iconClassNext:we("iconClassNext")});let at=Ve;const $u=Object.freeze(Object.defineProperty({__proto__:null,Slider:at,init:Fu,initializer:Qe,setupSlider:Io},Symbol.toStringTag,{value:"Module"}));var Do={exports:{}};(function(n,e){(function(t,r){n.exports=r()})(window,function(){return function(t){var r={};function o(i){if(r[i])return r[i].exports;var a=r[i]={i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,o),a.l=!0,a.exports}return o.m=t,o.c=r,o.d=function(i,a,s){o.o(i,a)||Object.defineProperty(i,a,{enumerable:!0,get:s})},o.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},o.t=function(i,a){if(1&a&&(i=o(i)),8&a||4&a&&typeof i=="object"&&i&&i.__esModule)return i;var s=Object.create(null);if(o.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:i}),2&a&&typeof i!="string")for(var l in i)o.d(s,l,(function(u){return i[u]}).bind(null,l));return s},o.n=function(i){var a=i&&i.__esModule?function(){return i.default}:function(){return i};return o.d(a,"a",a),a},o.o=function(i,a){return Object.prototype.hasOwnProperty.call(i,a)},o.p="",o(o.s=0)}([function(t,r,o){o.r(r),o.d(r,"AriaTablist",function(){return P});var i=35,a=36,s=37,l=38,u=39,m=40,f=46,d=13,h=32,v={37:-1,38:-1,39:1,40:1},p=function(){function T(w){this.tabs=w.tabs,this.panels=w.panels,this.options=w.options,this.open=this.open.bind(w),this.close=this.close.bind(w),this.delete=this.delete.bind(w),this.destroy=this.destroy.bind(w),w.tablist.ariaTablist=this}return T.prototype.open=function(w,c){this.checkMultiple(),this.activateTabWithTimer.apply(this,[w,c,!0])},T.prototype.close=function(w,c){this.checkMultiple(),this.deactivateTab.apply(this,[w,c,!0]),this.makeFocusable()},T.prototype.delete=function(w){this.determineDeletable.call(this,w)},T.prototype.destroy=function(){this.destroy.call(this)},T}(),b=function(T){for(var w in T===void 0&&(T={}),this.delay=0,this.deletable=!1,this.focusableTabs=!1,this.focusablePanels=!0,this.arrowActivation=!1,this.allArrows=!1,this.tabSelector='[role="tab"]',this.tabindex=0,T)T.hasOwnProperty(w)&&T[w]!==void 0&&(this[w]=T[w])};function _(T){T&&typeof T.preventDefault=="function"&&T.preventDefault()}function g(T,w){return T.getAttribute&&T.getAttribute(w)||""}function y(T,w,c){T&&g(T,w)!==c&&T.setAttribute&&T.setAttribute(w,c)}function E(T,w){T&&w&&T.removeAttribute&&w.split(" ").forEach(function(c){return c&&T.removeAttribute(c)})}var C=0,A=function(){function T(w,c){if(this.tabs=[],this.panels=[],w&&w.nodeType===1){var x=w.ariaTablist;x&&typeof x.destroy=="function"&&x.destroy(),C+=1,this.tablist=w,this.options=new b(c),this.api=new p(this),this.init()}}return T.prototype.checkMultiple=function(){this.multiple=g(this.tablist,"aria-multiselectable")==="true"},T.prototype.triggerOptionCallback=function(w,c){if(c===void 0&&(c=[]),this.options&&typeof this.options[w]=="function")return this.options[w].apply(this.api,c)},T.prototype.makeFocusable=function(){for(var w=""+(this.options.tabindex||0),c=0,x=this.tabs.length;c<x;c+=1)if(g(this.tabs[c],"tabindex")===w)return;y(this.tabs[0],"tabindex",w)},T.prototype.setCoreAttributes=function(w,c,x){var O=this.options.tabindex||"0";this.options.focusableTabs&&y(w,"tabindex",O),this.options.focusablePanels&&y(c,"tabindex",O),w.id||y(w,"id","aria-tablist-"+C+"-tab-"+x),c.id||y(c,"id","aria-tablist-"+C+"-panel-"+x),y(w,"role","tab"),y(c,"role","tabpanel"),y(w,"aria-controls",c.id),y(c,"aria-labelledby",w.id)},T.prototype.getTabPanel=function(w){var c=typeof w=="number"?this.tabs[w]:w;if(!c||c.nodeType!==1)return null;var x=typeof w=="number"?this.panels[w]:null;if(x)return x;var O=g(c,"aria-controls");return O||(O=g(c,"data-controls")),O&&(x=document.getElementById(O)),x||(O&&E(c,"aria-controls"),c.id&&(x=document.querySelector('[aria-labelledby="'+c.id+'"]')),x||(x=document.querySelector('[data-labelledby="'+c.id+'"]'))),x},T.prototype.generateArrays=function(w){this.tabs.splice(0),this.panels.splice(0);var c=this.tablist.querySelectorAll(this.options.tabSelector);w&&!c.length&&(c=this.tablist.childNodes);for(var x=0,O=c.length;x<O;x+=1){var M=c[x];if(M&&M.nodeType===1&&!(this.panels.indexOf(M)>-1)){var L=this.getTabPanel(M);L?(this.tabs.push(M),this.panels.push(L),this.setCoreAttributes(M,L,x),M._ariaTablistTabIndex=this.tabs.length-1):g(M,"role")==="tab"&&E(M,"role")}}},T.prototype.elementIsTab=function(w){return!!(w&&this.tabs.indexOf(w)>-1)},T.prototype.addListenersToTab=function(w){var c=this.tabs[w];c.addEventListener("keydown",this.tabKeydownEvent),c.addEventListener("keyup",this.tabKeyupEvent),c.addEventListener("click",this.tabClickEvent)},T.prototype.tabClickEvent=function(w){var c=w.target;do{if(this.elementIsTab(c))return this.checkMultiple(),_(w),this.activateTabWithTimer(c,!1);c=c.parentElement||c.parentNode}while(c!==null&&c.nodeType===1)},T.prototype.tabKeydownEvent=function(w){if(this.elementIsTab(w.target))switch(w.keyCode){case i:_(w),this.focusLastTab();break;case a:_(w),this.focusFirstTab();break;case l:case m:case s:case u:this.processArrowPress(w);break;case h:case d:_(w)}},T.prototype.tabKeyupEvent=function(w){var c=w.target;if(this.elementIsTab(c))switch(w.keyCode){case f:this.determineDeletable(c);break;case d:case h:this.checkMultiple(),_(w),this.activateTabWithTimer(c)}},T.prototype.processArrowPress=function(w){var c=w.keyCode;(this.options.allArrows||(g(this.tablist,"aria-orientation")==="vertical"?c===l||c===m:c===s||c===u))&&this.switchTabOnArrowPress(w)},T.prototype.switchTabOnArrowPress=function(w){var c=w.keyCode,x=v[c],O=w.target._ariaTablistTabIndex;if(x&&typeof O=="number"){_(w);var M=(c===s||c===u)&&(document.dir==="rtl"||this.tablist.dir==="rtl");M&&this.tablist.dir!=="ltr"&&(x*=-1);var L=O+x;this.tabs[L]?this.focusTab(L):c===s||c===l?M?this.focusFirstTab():this.focusLastTab():c!==u&&c!=m||(M?this.focusLastTab():this.focusFirstTab())}},T.prototype.getTab=function(w){return typeof w=="number"&&this.elementIsTab(this.tabs[w])?this.tabs[w]:this.elementIsTab(w)?w:null},T.prototype.activateTabWithTimer=function(w,c,x){var O=this;this.tabTimer&&clearTimeout(this.tabTimer);var M=typeof this.options.delay=="number"?this.options.delay:0;this.tabTimer=setTimeout(function(){O.activateTab(w,c,x)},M)},T.prototype.activateTab=function(w,c,x){c===void 0&&(c=!0),x===void 0&&(x=!1);var O=this.getTab(w);if(O&&c&&O.focus(),O&&(x||g(O,"aria-disabled")!=="true")){var M=g(O,"aria-selected")==="true";if(this.multiple&&M&&!x)return this.deactivateTab(O),void this.makeFocusable();this.multiple||this.deactivateTabs([O]);var L=this.options.tabindex||"0";y(O,"tabindex",L),y(O,"aria-selected","true");var D=this.getTabPanel(w);if(D){var B=g(D,"hidden")==="hidden";E(D,"hidden aria-hidden"),this.multiple&&(y(D,"aria-expanded","true"),y(O,"aria-expanded","true")),this.options.focusablePanels&&y(D,"tabindex",L),B&&this.triggerOptionCallback("onOpen",[D,O])}}},T.prototype.deactivateTab=function(w,c,x){c===void 0&&(c=!1),x===void 0&&(x=!1);var O=this.getTab(w);if(O&&(c&&O.focus(),y(O,"tabindex",this.options.focusableTabs?this.options.tabindex||"0":"-1"),x||g(O,"aria-disabled")!=="true")){y(O,"aria-selected","false");var M=this.getTabPanel(w);if(M){var L=g(M,"hidden")==="hidden";E(M,"tabindex"),y(M,"hidden","hidden"),y(M,"aria-hidden","true"),this.multiple?(y(O,"aria-expanded","false"),y(M,"aria-expanded","false")):(E(M,"aria-expanded"),E(O,"aria-expanded")),L||this.triggerOptionCallback("onClose",[M,O])}}},T.prototype.deactivateTabs=function(w){var c=this;w===void 0&&(w=[]);var x=Array.isArray(w);this.tabs.forEach(function(O){x&&w.indexOf(O)!==-1||c.deactivateTab(O,!1,!0)})},T.prototype.focusTab=function(w){var c=this.getTab(w),x=this.options.arrowActivation;if(c){if(x&&g(c,"aria-selected")!=="true")return void this.activateTabWithTimer(c);c.focus()}},T.prototype.focusFirstTab=function(){this.focusTab(0)},T.prototype.focusLastTab=function(){this.focusTab(this.tabs.length-1)},T.prototype.determineDeletable=function(w){if(this.options.deletable){var c=this.getTab(w);if(c&&g(c,"data-deletable")!=="false"){this.checkMultiple(),this.deleteTab(c),this.generateArrays();var x=c._ariaTablistTabIndex,O=x-1>-1?x-1:0;this.multiple||g(c,"aria-selected")!=="true"?this.tabs[O]&&this.tabs[O].focus():this.activateTab(O),this.makeFocusable(),this.triggerOptionCallback("onDelete",[c])}}},T.prototype.deleteTab=function(w){var c=this.getTabPanel(w);w.parentElement.removeChild(w),c&&c.parentElement.removeChild(c)},T.prototype.destroy=function(){var w=this,c="aria-expanded aria-hidden hidden role tabindex";this.tabs.forEach(function(x,O){x.removeEventListener("keydown",w.tabKeydownEvent),x.removeEventListener("keyup",w.tabKeyupEvent),x.removeEventListener("click",w.tabClickEvent),E(w.panels[O],c),E(x,c),delete x._ariaTablistTabIndex}),this.tablist&&(delete this.tablist.ariaTablist,E(this.tablist,"role")),this.panels.splice(0),this.tabs.splice(0),this.tablist=null},T.prototype.init=function(){var w=this;this.checkMultiple(),this.generateArrays(!0),this.tabKeydownEvent=this.tabKeydownEvent.bind(this),this.tabClickEvent=this.tabClickEvent.bind(this),this.tabKeyupEvent=this.tabKeyupEvent.bind(this);var c=[];this.tabs.forEach(function(x,O){w.addListenersToTab(O),!(g(x,"aria-selected")==="true"||g(x,"data-selected")==="true")||!w.multiple&&c.length||c.push(x)}),y(this.tablist,"role","tablist"),this.tabs.length&&(this.multiple||c.length||c.push(this.tabs[0]),this.deactivateTabs(c),c.forEach(function(x){return w.activateTab(x,!1,!0)}),this.makeFocusable()),this.triggerOptionCallback("onReady",[this.tablist])},T}();function P(T,w){return new A(T,w).api}r.default=P}])})})(Do);var Nu=Do.exports;const qu=co(Nu),fi=[],Lo=new J({type:"tabs",baseAttribute:"data-ulu-tablist"});function Hu(){const n=()=>{Lo.init({events:["pageModified"],withData:!0,setup({element:e,data:t,initialize:r}){Ro(e,t),r()}}),fi.forEach(Bu)};document.readyState==="complete"?n():window.addEventListener("load",n)}function Ro(n,e={}){const t=Object.assign({},e);t.vertical&&(t.allArrows=!0);const r={element:n,options:e};return r.ariaTablist=qu(n,{onOpen(...o){o.unshift(r),Wu.apply(null,o)},...t}),fi.push(r),t.equalHeights&&ju(n),r}function Bu({options:n,ariaTablist:e}){if(n.openByUrlHash){const{hash:t}=window.location;if(t&&t.length>1){const r=t.substring(1);e.tabs.forEach(o=>{r===o.id&&e.open(o)})}}}function Wu({options:n},e,t){n.openByUrlHash&&window.history&&window.history.replaceState(null,"",`#${t.id}`)}function ju(n){const t=[...n.children].map(s=>document.querySelector(`[aria-labelledby="${s.id}"]`)),i=[...t[0].parentElement.querySelectorAll("img")].map(s=>a(s));function a(s){return new Promise(l=>{s.complete?l(s):(s.onload=l,s.onerror=l)})}Promise.all(i).then(()=>{const s=t.map(u=>{let m=u.offsetHeight;return u.hidden&&(u.hidden=!1,m=u.offsetHeight,u.setAttribute("hidden","hidden")),m}),l=Math.max(...s);t.forEach(u=>u.style.minHeight=`${l}px`)})}const Vu=Object.freeze(Object.defineProperty({__proto__:null,init:Hu,initializer:Lo,instances:fi,setup:Ro},Symbol.toStringTag,{value:"Module"})),Fo=new J({type:"proxy-click",baseAttribute:"data-ulu-proxy-click"}),$o={selector:"[data-ulu-proxy-click-source]",selectorPreventBase:"input, select, textarea, button, a, [tabindex='-1']",selectorPrevent:"",mousedownDurationPrevent:250};let Gr={...$o};function zu(n){Gr=Object.assign({},Gr,n)}function Ku(){Fo.init({withData:!0,events:["pageModified"],setup({element:n,data:e,initialize:t}){No(n,e),t()}})}function No(n,e){const t=Object.assign({},Gr,e),r=n.querySelector(t.selector);r?qo(n,r,t):console.error("Unable to locate proxy click source",t.selector)}function qo(n,e,t){const{selectorPreventBase:r,selectorPrevent:o}=t,i=`${r}${o?`, ${o}`:""}`;let a,s;n.addEventListener("mousedown",({target:l,timeStamp:u})=>{s=!1,l.matches(i)||(s=!0,a=u)}),n.addEventListener("mouseup",({timeStamp:l})=>{s&&l-a<t.mousedownDurationPrevent&&e.click()}),n.style.cursor="pointer"}const Gu=Object.freeze(Object.defineProperty({__proto__:null,attachHandlers:qo,defaults:$o,init:Ku,initializer:Fo,setDefaults:zu,setupProxy:No},Symbol.toStringTag,{value:"Module"})),Pt=new J({type:"scrollpoint",baseAttribute:"data-ulu-scrollpoint"});function Uu(){Pt.init({withData:!0,events:["pageModified"],setup({element:n,data:e,initialize:t}){const r=Object.assign({},e);new kt(n,r),t()}})}const Rt=class Rt{constructor(e,t){const r=Object.assign({},Rt.defaults,t);if(!e){re(this,"Missing required element");return}r.rootSelector&&(r.root=document.querySelector(r.rootSelector),delete r.rootSelector),this.options=r,this.observer=null,this.lastPosition=null,this.isActive=!1,this.element=e,this.syncedElements=[e,...r.syncElements.map(o=>getElement(o))],this.classes={enter:this.getClassname("enter"),enterForward:this.getClassname("enter--from-forward"),enterReverse:this.getClassname("enter--from-reverse"),exit:this.getClassname("exit"),exitForward:this.getClassname("exit--from-forward"),exitReverse:this.getClassname("exit--from-reverse")},this.setupObserver(),r.debug&&Pt.log(this)}getClassname(e){return this.options.classPrefix+"-"+e}getObserverOptions(){const{root:e,marginStart:t,marginEnd:r,threshold:o,horizontal:i}=this.options,a=i?`0px ${t} 0px ${r}`:`${t} 0px ${r} 0px`;return{root:e,rootMargin:a,threshold:o}}onObserve(e){const t=this.getScrollY(),{lastPosition:r,isActive:o,options:i}=this,a=r===null?null:r<t;e.forEach(s=>{const{isIntersecting:l}=s;l&&!o?this.setState(!0,a):!l&&o&&i.exit&&(a&&i.exitForward||!a&&i.exitReverse)&&this.setState(!1,a)}),this.lastPosition=t}setupObserver(){const e=r=>{this.onObserve(r)},t=this.getObserverOptions();this.options.debug&&Pt.log("IntersectionObserver (options)",t),this.observer=new IntersectionObserver(e,t),this.observer.observe(this.element)}getScrollY(){const{root:e}=this.options;return e===null||e===document?window.scrollY:e.scrollTop}setState(e,t){const{element:r}=this,o={isActive:e,isForward:t,element:r,instance:this},{setClasses:i,setAttribute:a,onChange:s}=this.options;i&&this.updateClasses(e,t),a&&this.updateStateAttribute(e,t),s&&s(o),this.isActive=e}getAllClasses(){return Object.values(this.classes)}updateClasses(e,t){const{classes:r}=this,o=this.getAllClasses(),i=[r.enter,t?r.enterForward:r.enterReverse],a=[r.exit,t?r.exitForward:r.exitReverse];this.syncedElements.forEach(s=>{s.classList.remove(...o),e?s.classList.add(...i):s.classList.add(...a)})}updateStateAttribute(e,t){const r=e?"enter":"exit",o=t?"forward":"reverse";this.syncedElements.forEach(i=>{i.setAttribute(this.options.attributeName,`${r}-${o}`)})}destroy(){this.observer.disconnect(),this.observer=null,this.options.setClasses&&this.element.classList.remove(...this.getAllClasses()),this.options.setAttribute&&this.element.removeAttribute(this.options.attributeName)}};z(Rt,"defaults",{root:null,rootSelector:null,debug:!1,horizontal:!1,marginStart:"-25%",marginEnd:"-55%",threshold:[0,1],exit:!0,exitForward:!0,exitReverse:!0,setClasses:!1,classPrefix:"scrollpoint",setAttribute:!0,attributeName:"data-scrollpoint-state",syncElements:[],onChange(e){}});let kt=Rt;const Zu=Object.freeze(Object.defineProperty({__proto__:null,Scrollpoint:kt,init:Uu,initializer:Pt},Symbol.toStringTag,{value:"Module"}));function Xu(n){const e=window.open();e.document.write(n),e.print(),e.close()}function Ju(n){var e=n.innerHTML;Xu(e)}const Yu=new J({type:"print",baseAttribute:"data-ulu-print"}),Qu={element:null};function ec(){Yu.init({withData:!0,events:["pageModified"],setup({element:n,data:e,initialize:t}){tc(n,e),t()}})}function tc(n,e){const t=Object.assign({},Qu,e);n.addEventListener("click",()=>{if(t.element){const r=$i(t.element);r?Ju(r):console.error("Unable to find element to print",n,t)}else window.print()})}const nc=Object.freeze(Object.defineProperty({__proto__:null,init:ec},Symbol.toStringTag,{value:"Module"})),It={opened:"data-ulu-print-details-opened"},rc=n=>`[${It[n]}]`,ic={selector:"details:not([open])"};function oc(n){const e=Object.assign({},ic,n);document.addEventListener(Q("beforePrint"),()=>{document.querySelectorAll(e.selector).forEach(t=>{t.open||(t.setAttribute(It.opened,!0),t.open=!0)})}),document.addEventListener(Q("afterPrint"),()=>{document.querySelectorAll(rc("opened")).forEach(t=>{t.removeAttribute(It.opened),t.open=!1})})}const ac=Object.freeze(Object.defineProperty({__proto__:null,attrs:It,init:oc},Symbol.toStringTag,{value:"Module"})),Bt=new J({type:"scroll-slider",baseAttribute:"data-ulu-scroll-slider"}),sc=Bt.attributeSelector("track"),lc=Bt.attributeSelector("control-context"),uc=[],cc={amount:Zi()};function fc(){Bt.init({withData:!0,events:["pageModified"],setup({element:n,data:e,initialize:t}){dc(n,e),t()}})}function dc(n,e){const t=Object.assign({},cc,e),r={track:n.querySelector(sc),controls:n.querySelector(lc)};uc.push(new Ot(r,t))}const pc=Object.freeze(Object.defineProperty({__proto__:null,init:fc,initializer:Bt},Symbol.toStringTag,{value:"Module"})),te=new J({type:"theme-toggle",baseAttribute:"data-ulu-theme-toggle"}),vc=te.attributeSelector("label"),hc=te.attributeSelector("icon"),Ho=te.getAttribute("remote"),Ur=te.getAttribute("init"),_i=te.getAttribute("state"),mc=n=>document.querySelectorAll(`[${Ho}="${n}"]`),Ei=n=>document.querySelectorAll(`[${Ho}="${n}"]:not([${Ur}])`),Bo=["target"],bc=$t(Bo),wi=(n,e)=>n?e():null,di={themes:{light:{label:"Light",value:"light",iconClass:"fas fa-moon",targetClass:"theme-light",mediaQuery:"(prefers-color-scheme: light)"},dark:{label:"Dark",iconClass:"fas fa-sun",targetClass:"theme-dark",mediaQuery:"(prefers-color-scheme: dark)"}},target:"body",group:null,onChange(n){},initialState:"light",checkMediaQuery:!1,savePreference:!1,storagePrefix:"ulu-theme-",debug:!1};let Si={...di};function gc(n){Si=Object.assign({},Si,n)}function xc(){te.init({events:["pageModified"],withData:!0,setup({element:n,data:e,initialize:t}){Wo(n,e),t()}})}function Wo(n,e){const t=Object.assign({},di,e);if(!bc(t)){console.error(`Missing a required option: ${Bo.join(", ")}`);return}const r=t.group,o={toggle:n,options:t},i=yc(t);if(!i){console.error("Unable to resolve initial key");return}Jt(i,o),n.addEventListener("click",s),l(),document.addEventListener(Q("pageModified"),l);function a(f){const h=Xr(t.target)[0].dataset.uluThemeToggleState,v=Ec(h,t);if(!v){console.error("Issue getting next theme key");return}Jt(v,{...o,event:f})}function s(f){a(f)}function l(){if(!r)return;Ei(r).forEach(d=>{d.addEventListener("click",s),te.initializeElement(d)})}function u(){if(!r)return;Ei(r).forEach(d=>{d.removeEventListener("click",s),d.removeAttribute(Ur,"")})}function m(){n.removeEventListener("click",s),n.removeAttribute(Ur,""),u(),document.removeEventListener(Q("pageModified"),l)}return{destroy:m,toggle:n,options:t,toggleState:a,setState(f){Jt(f,o)}}}function Jt(n,e){if(!n){console.error("Missing key");return}const{toggle:t,options:r}=e,{themes:o,group:i}=r,a={targets:Xr(r.target),toggles:[t,...i?mc(i):[]]};if(!a.targets.length||!a.toggles.length){console.error("Issue setting state, couldn't find needed elements",a);return}const s=o[n],l=wc(n,o),u={...e,key:n,elements:a,theme:s,otherThemes:l};r.debug&&te.log("Set state context",u);const m=Oi(l,"targetClass"),f=Oi(l,"iconClass");a.targets.forEach(d=>{d.setAttribute(_i,n),d.classList.remove(...m),d.classList.add(...gt(s.targetClass))}),a.toggles.forEach(d=>{const h=d.querySelector(vc),v=d.querySelector(hc);h&&(h.textContent=s.label),v&&(v.classList.remove(...f),v.classList.add(...gt(s.iconClass))),d.setAttribute(_i,n)}),r.onChange&&r.onChange(u),r.savePreference&&localStorage.setItem(jo(r),n)}function yc(n){const{savePreference:e,checkMediaQuery:t,themes:r,initialState:o}=n,i=jo(n),a=wi(e,()=>localStorage.getItem(i)),s=wi(t,()=>_c(r)),l=a||s||o;return n.debug&&(te.log("Preference Saved",a),te.log("Media Query Preference",s),te.log("Initial State:",o)),l||te.logError("Failed to resolve initial theme (pass 'initialState' to options)"),l}function _c(n){const e=Object.entries(n).find(([t,r])=>{if(r.mediaQuery)return window.matchMedia(r.mediaQuery).matches});return e?e[0]:null}function Ec(n,e){const{themes:t}=e,r=Object.keys(t),o=r.findIndex(a=>a===n),i=o===-1?0:(o+1)%r.length;return r[i]}function wc(n,e){return Object.entries(e).filter(([r])=>r!==n).map(([r,o])=>o)}function Oi(n,e){return n.reduce((t,r)=>t.concat(gt(r[e])),[])}function jo(n){const{storagePrefix:e,group:t}=n;return t?`${e}${t}`:e}const Sc=Object.freeze(Object.defineProperty({__proto__:null,defaults:di,init:xc,initializer:te,setDefaults:gc,setupToggle:Wo},Symbol.toStringTag,{value:"Module"})),Wt=new J({type:"details-group",baseAttribute:"data-ulu-details-group"}),Yt=Wt.getAttribute("child-init"),Oc={onlyOneOpen:!0,childSelector:":scope > details"};function Cc(){Wt.init({withData:!0,events:["pageModified"],setup({element:n,data:e,initialize:t}){Vo(n,e),t()}})}function Vo(n,e){const t=Object.assign({},Oc,e);try{o()}catch(s){console.error(s)}function r(){return n.querySelectorAll(t.childSelector)}function o(){r().forEach(s=>{s.hasAttribute(Yt)||(s.setAttribute(Yt,""),s.addEventListener("toggle",i))})}function i({target:s}){t.onlyOneOpen&&s.open&&r().forEach(l=>{l!==s&&l.open&&(l.open=!1)})}function a(){r().forEach(s=>{s.removeEventListener("toggle",i),s.removeAttribute(Yt)}),n.removeAttribute(Wt.getAttribute("init"))}return{destroy:a,element:n,setupChildren:o}}const Tc=Object.freeze(Object.defineProperty({__proto__:null,init:Cc,initializer:Wt,setupGroup:Vo},Symbol.toStringTag,{value:"Module"})),zo=Object.freeze(Object.defineProperty({__proto__:null,breakpoints:Ca,collapsible:Ma,detailsGroup:Tc,dialog:$a,flipcard:za,grid:Ga,get index(){return zo},modalBuilder:Ba,overflowScroller:Xa,overflowScrollerPager:Ua,page:ga,popover:Vs,print:nc,printDetails:ac,proxyClick:Gu,resizer:Pa,scrollSlider:pc,scrollpoint:Zu,slider:$u,tabs:Vu,themeToggle:Sc,tooltip:Zs},Symbol.toStringTag,{value:"Module"})),Ft=class Ft{constructor(e,t){this.options=Object.assign({},Ft.defaults,t),this.data=e,this.blob=new Blob([e],{type:this.options.type}),this.url=URL.createObjectURL(this.blob)}destroy(){return URL.revokeObjectURL(this.url)}getUrl(){return this.url}createLink(e){const t=document.createElement("a"),r=document.createTextNode(e);return t.setAttribute("download",this.options.filename),t.setAttribute("href",this.url),t.appendChild(r),t}static isBrowserSupported(){return"FileReader"in window}};z(Ft,"defaults",{filename:"filesave-file.txt",type:"text/plain;charset=utf-8"});let Zr=Ft;const Ac=Object.freeze(Object.defineProperty({__proto__:null,FileSave:Zr},Symbol.toStringTag,{value:"Module"}));function Mc(){Ti({iconClassClose:"fas fa-xmark",iconClassDragX:"fas fa-solid fa-grip-lines-vertical",iconClassPrevious:"fas fa-solid fa-chevron-left",iconClassNext:"fas fa-solid fa-chevron-right"})}const Pc=Object.freeze(Object.defineProperty({__proto__:null,configureIcons:Mc},Symbol.toStringTag,{value:"Module"})),Ko=Object.freeze(Object.defineProperty({__proto__:null,classLogger:wa,dom:ma,fileSave:Ac,floatingUi:$s,fontAwesome:Pc,id:Aa,get index(){return Ko},pauseYoutubeVideo:Ia},Symbol.toStringTag,{value:"Module"})),kc=Object.freeze(Object.defineProperty({__proto__:null,events:ha,settings:fa,ui:zo,utils:Ko},Symbol.toStringTag,{value:"Module"}));typeof window<"u"&&(window.ULU=kc);
71
+ `}getNavContent(e){return`<span class="${this.options.classAccessiblyHidden}">Item ${e.number}</span>`}emit(e,t){this.options.events[e]&&this.options.events[e].apply(this,t)}};z(Ve,"instances",[]),z(Ve,"defaults",{classAccessiblyHidden:"hidden-visually",namespace:"Slider",events:{},transition:!0,transitionFade:!1,transitionDuration:700,transitionDurationExit:400,transitionTimingFunction:"ease-in-out",buttonClasses:["button","button--icon"],iconClassPrevious:we("iconClassPrevious"),iconClassNext:we("iconClassNext")});let at=Ve;const $u=Object.freeze(Object.defineProperty({__proto__:null,Slider:at,init:Fu,initializer:Qe,setupSlider:Io},Symbol.toStringTag,{value:"Module"}));var Do={exports:{}};(function(n,e){(function(t,r){n.exports=r()})(window,function(){return function(t){var r={};function o(i){if(r[i])return r[i].exports;var a=r[i]={i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,o),a.l=!0,a.exports}return o.m=t,o.c=r,o.d=function(i,a,s){o.o(i,a)||Object.defineProperty(i,a,{enumerable:!0,get:s})},o.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},o.t=function(i,a){if(1&a&&(i=o(i)),8&a||4&a&&typeof i=="object"&&i&&i.__esModule)return i;var s=Object.create(null);if(o.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:i}),2&a&&typeof i!="string")for(var l in i)o.d(s,l,(function(u){return i[u]}).bind(null,l));return s},o.n=function(i){var a=i&&i.__esModule?function(){return i.default}:function(){return i};return o.d(a,"a",a),a},o.o=function(i,a){return Object.prototype.hasOwnProperty.call(i,a)},o.p="",o(o.s=0)}([function(t,r,o){o.r(r),o.d(r,"AriaTablist",function(){return P});var i=35,a=36,s=37,l=38,u=39,m=40,f=46,d=13,h=32,v={37:-1,38:-1,39:1,40:1},p=function(){function T(w){this.tabs=w.tabs,this.panels=w.panels,this.options=w.options,this.open=this.open.bind(w),this.close=this.close.bind(w),this.delete=this.delete.bind(w),this.destroy=this.destroy.bind(w),w.tablist.ariaTablist=this}return T.prototype.open=function(w,c){this.checkMultiple(),this.activateTabWithTimer.apply(this,[w,c,!0])},T.prototype.close=function(w,c){this.checkMultiple(),this.deactivateTab.apply(this,[w,c,!0]),this.makeFocusable()},T.prototype.delete=function(w){this.determineDeletable.call(this,w)},T.prototype.destroy=function(){this.destroy.call(this)},T}(),b=function(T){for(var w in T===void 0&&(T={}),this.delay=0,this.deletable=!1,this.focusableTabs=!1,this.focusablePanels=!0,this.arrowActivation=!1,this.allArrows=!1,this.tabSelector='[role="tab"]',this.tabindex=0,T)T.hasOwnProperty(w)&&T[w]!==void 0&&(this[w]=T[w])};function _(T){T&&typeof T.preventDefault=="function"&&T.preventDefault()}function g(T,w){return T.getAttribute&&T.getAttribute(w)||""}function y(T,w,c){T&&g(T,w)!==c&&T.setAttribute&&T.setAttribute(w,c)}function E(T,w){T&&w&&T.removeAttribute&&w.split(" ").forEach(function(c){return c&&T.removeAttribute(c)})}var C=0,A=function(){function T(w,c){if(this.tabs=[],this.panels=[],w&&w.nodeType===1){var x=w.ariaTablist;x&&typeof x.destroy=="function"&&x.destroy(),C+=1,this.tablist=w,this.options=new b(c),this.api=new p(this),this.init()}}return T.prototype.checkMultiple=function(){this.multiple=g(this.tablist,"aria-multiselectable")==="true"},T.prototype.triggerOptionCallback=function(w,c){if(c===void 0&&(c=[]),this.options&&typeof this.options[w]=="function")return this.options[w].apply(this.api,c)},T.prototype.makeFocusable=function(){for(var w=""+(this.options.tabindex||0),c=0,x=this.tabs.length;c<x;c+=1)if(g(this.tabs[c],"tabindex")===w)return;y(this.tabs[0],"tabindex",w)},T.prototype.setCoreAttributes=function(w,c,x){var O=this.options.tabindex||"0";this.options.focusableTabs&&y(w,"tabindex",O),this.options.focusablePanels&&y(c,"tabindex",O),w.id||y(w,"id","aria-tablist-"+C+"-tab-"+x),c.id||y(c,"id","aria-tablist-"+C+"-panel-"+x),y(w,"role","tab"),y(c,"role","tabpanel"),y(w,"aria-controls",c.id),y(c,"aria-labelledby",w.id)},T.prototype.getTabPanel=function(w){var c=typeof w=="number"?this.tabs[w]:w;if(!c||c.nodeType!==1)return null;var x=typeof w=="number"?this.panels[w]:null;if(x)return x;var O=g(c,"aria-controls");return O||(O=g(c,"data-controls")),O&&(x=document.getElementById(O)),x||(O&&E(c,"aria-controls"),c.id&&(x=document.querySelector('[aria-labelledby="'+c.id+'"]')),x||(x=document.querySelector('[data-labelledby="'+c.id+'"]'))),x},T.prototype.generateArrays=function(w){this.tabs.splice(0),this.panels.splice(0);var c=this.tablist.querySelectorAll(this.options.tabSelector);w&&!c.length&&(c=this.tablist.childNodes);for(var x=0,O=c.length;x<O;x+=1){var M=c[x];if(M&&M.nodeType===1&&!(this.panels.indexOf(M)>-1)){var L=this.getTabPanel(M);L?(this.tabs.push(M),this.panels.push(L),this.setCoreAttributes(M,L,x),M._ariaTablistTabIndex=this.tabs.length-1):g(M,"role")==="tab"&&E(M,"role")}}},T.prototype.elementIsTab=function(w){return!!(w&&this.tabs.indexOf(w)>-1)},T.prototype.addListenersToTab=function(w){var c=this.tabs[w];c.addEventListener("keydown",this.tabKeydownEvent),c.addEventListener("keyup",this.tabKeyupEvent),c.addEventListener("click",this.tabClickEvent)},T.prototype.tabClickEvent=function(w){var c=w.target;do{if(this.elementIsTab(c))return this.checkMultiple(),_(w),this.activateTabWithTimer(c,!1);c=c.parentElement||c.parentNode}while(c!==null&&c.nodeType===1)},T.prototype.tabKeydownEvent=function(w){if(this.elementIsTab(w.target))switch(w.keyCode){case i:_(w),this.focusLastTab();break;case a:_(w),this.focusFirstTab();break;case l:case m:case s:case u:this.processArrowPress(w);break;case h:case d:_(w)}},T.prototype.tabKeyupEvent=function(w){var c=w.target;if(this.elementIsTab(c))switch(w.keyCode){case f:this.determineDeletable(c);break;case d:case h:this.checkMultiple(),_(w),this.activateTabWithTimer(c)}},T.prototype.processArrowPress=function(w){var c=w.keyCode;(this.options.allArrows||(g(this.tablist,"aria-orientation")==="vertical"?c===l||c===m:c===s||c===u))&&this.switchTabOnArrowPress(w)},T.prototype.switchTabOnArrowPress=function(w){var c=w.keyCode,x=v[c],O=w.target._ariaTablistTabIndex;if(x&&typeof O=="number"){_(w);var M=(c===s||c===u)&&(document.dir==="rtl"||this.tablist.dir==="rtl");M&&this.tablist.dir!=="ltr"&&(x*=-1);var L=O+x;this.tabs[L]?this.focusTab(L):c===s||c===l?M?this.focusFirstTab():this.focusLastTab():c!==u&&c!=m||(M?this.focusLastTab():this.focusFirstTab())}},T.prototype.getTab=function(w){return typeof w=="number"&&this.elementIsTab(this.tabs[w])?this.tabs[w]:this.elementIsTab(w)?w:null},T.prototype.activateTabWithTimer=function(w,c,x){var O=this;this.tabTimer&&clearTimeout(this.tabTimer);var M=typeof this.options.delay=="number"?this.options.delay:0;this.tabTimer=setTimeout(function(){O.activateTab(w,c,x)},M)},T.prototype.activateTab=function(w,c,x){c===void 0&&(c=!0),x===void 0&&(x=!1);var O=this.getTab(w);if(O&&c&&O.focus(),O&&(x||g(O,"aria-disabled")!=="true")){var M=g(O,"aria-selected")==="true";if(this.multiple&&M&&!x)return this.deactivateTab(O),void this.makeFocusable();this.multiple||this.deactivateTabs([O]);var L=this.options.tabindex||"0";y(O,"tabindex",L),y(O,"aria-selected","true");var D=this.getTabPanel(w);if(D){var B=g(D,"hidden")==="hidden";E(D,"hidden aria-hidden"),this.multiple&&(y(D,"aria-expanded","true"),y(O,"aria-expanded","true")),this.options.focusablePanels&&y(D,"tabindex",L),B&&this.triggerOptionCallback("onOpen",[D,O])}}},T.prototype.deactivateTab=function(w,c,x){c===void 0&&(c=!1),x===void 0&&(x=!1);var O=this.getTab(w);if(O&&(c&&O.focus(),y(O,"tabindex",this.options.focusableTabs?this.options.tabindex||"0":"-1"),x||g(O,"aria-disabled")!=="true")){y(O,"aria-selected","false");var M=this.getTabPanel(w);if(M){var L=g(M,"hidden")==="hidden";E(M,"tabindex"),y(M,"hidden","hidden"),y(M,"aria-hidden","true"),this.multiple?(y(O,"aria-expanded","false"),y(M,"aria-expanded","false")):(E(M,"aria-expanded"),E(O,"aria-expanded")),L||this.triggerOptionCallback("onClose",[M,O])}}},T.prototype.deactivateTabs=function(w){var c=this;w===void 0&&(w=[]);var x=Array.isArray(w);this.tabs.forEach(function(O){x&&w.indexOf(O)!==-1||c.deactivateTab(O,!1,!0)})},T.prototype.focusTab=function(w){var c=this.getTab(w),x=this.options.arrowActivation;if(c){if(x&&g(c,"aria-selected")!=="true")return void this.activateTabWithTimer(c);c.focus()}},T.prototype.focusFirstTab=function(){this.focusTab(0)},T.prototype.focusLastTab=function(){this.focusTab(this.tabs.length-1)},T.prototype.determineDeletable=function(w){if(this.options.deletable){var c=this.getTab(w);if(c&&g(c,"data-deletable")!=="false"){this.checkMultiple(),this.deleteTab(c),this.generateArrays();var x=c._ariaTablistTabIndex,O=x-1>-1?x-1:0;this.multiple||g(c,"aria-selected")!=="true"?this.tabs[O]&&this.tabs[O].focus():this.activateTab(O),this.makeFocusable(),this.triggerOptionCallback("onDelete",[c])}}},T.prototype.deleteTab=function(w){var c=this.getTabPanel(w);w.parentElement.removeChild(w),c&&c.parentElement.removeChild(c)},T.prototype.destroy=function(){var w=this,c="aria-expanded aria-hidden hidden role tabindex";this.tabs.forEach(function(x,O){x.removeEventListener("keydown",w.tabKeydownEvent),x.removeEventListener("keyup",w.tabKeyupEvent),x.removeEventListener("click",w.tabClickEvent),E(w.panels[O],c),E(x,c),delete x._ariaTablistTabIndex}),this.tablist&&(delete this.tablist.ariaTablist,E(this.tablist,"role")),this.panels.splice(0),this.tabs.splice(0),this.tablist=null},T.prototype.init=function(){var w=this;this.checkMultiple(),this.generateArrays(!0),this.tabKeydownEvent=this.tabKeydownEvent.bind(this),this.tabClickEvent=this.tabClickEvent.bind(this),this.tabKeyupEvent=this.tabKeyupEvent.bind(this);var c=[];this.tabs.forEach(function(x,O){w.addListenersToTab(O),!(g(x,"aria-selected")==="true"||g(x,"data-selected")==="true")||!w.multiple&&c.length||c.push(x)}),y(this.tablist,"role","tablist"),this.tabs.length&&(this.multiple||c.length||c.push(this.tabs[0]),this.deactivateTabs(c),c.forEach(function(x){return w.activateTab(x,!1,!0)}),this.makeFocusable()),this.triggerOptionCallback("onReady",[this.tablist])},T}();function P(T,w){return new A(T,w).api}r.default=P}])})})(Do);var Nu=Do.exports;const qu=co(Nu),fi=[],Lo=new J({type:"tabs",baseAttribute:"data-ulu-tablist"});function Hu(){const n=()=>{Lo.init({events:["pageModified"],withData:!0,setup({element:e,data:t,initialize:r}){Ro(e,t),r()}}),fi.forEach(Bu)};document.readyState==="complete"?n():window.addEventListener("load",n)}function Ro(n,e={}){const t=Object.assign({},e);t.vertical&&(t.allArrows=!0);const r={element:n,options:e};return r.ariaTablist=qu(n,{onOpen(...o){o.unshift(r),Wu.apply(null,o)},...t}),fi.push(r),t.equalHeights&&ju(n),r}function Bu({options:n,ariaTablist:e}){if(n.openByUrlHash){const{hash:t}=window.location;if(t&&t.length>1){const r=t.substring(1);e.tabs.forEach(o=>{r===o.id&&e.open(o)})}}}function Wu({options:n},e,t){n.openByUrlHash&&window.history&&window.history.replaceState(null,"",`#${t.id}`)}function ju(n){const t=[...n.children].map(s=>document.querySelector(`[aria-labelledby="${s.id}"]`)),i=[...t[0].parentElement.querySelectorAll("img")].map(s=>a(s));function a(s){return new Promise(l=>{s.complete?l(s):(s.onload=l,s.onerror=l)})}Promise.all(i).then(()=>{const s=t.map(u=>{let m=u.offsetHeight;return u.hidden&&(u.hidden=!1,m=u.offsetHeight,u.setAttribute("hidden","hidden")),m}),l=Math.max(...s);t.forEach(u=>u.style.minHeight=`${l}px`)})}const Vu=Object.freeze(Object.defineProperty({__proto__:null,init:Hu,initializer:Lo,instances:fi,setup:Ro},Symbol.toStringTag,{value:"Module"})),Fo=new J({type:"proxy-click",baseAttribute:"data-ulu-proxy-click"}),$o={selector:"[data-ulu-proxy-click-source]",selectorPreventBase:"input, select, textarea, button, a, [tabindex='-1']",selectorPrevent:"",mousedownDurationPrevent:250};let Gr={...$o};function zu(n){Gr=Object.assign({},Gr,n)}function Ku(){Fo.init({withData:!0,events:["pageModified"],setup({element:n,data:e,initialize:t}){No(n,e),t()}})}function No(n,e){const t=Object.assign({},Gr,e),r=n.querySelector(t.selector);r?qo(n,r,t):console.error("Unable to locate proxy click source",t.selector)}function qo(n,e,t){const{selectorPreventBase:r,selectorPrevent:o}=t,i=`${r}${o?`, ${o}`:""}`;let a,s;n.addEventListener("mousedown",({target:l,timeStamp:u})=>{s=!1,l.matches(i)||(s=!0,a=u)}),n.addEventListener("mouseup",({timeStamp:l})=>{s&&l-a<t.mousedownDurationPrevent&&e.click()}),n.style.cursor="pointer"}const Gu=Object.freeze(Object.defineProperty({__proto__:null,attachHandlers:qo,defaults:$o,init:Ku,initializer:Fo,setDefaults:zu,setupProxy:No},Symbol.toStringTag,{value:"Module"})),Pt=new J({type:"scrollpoint",baseAttribute:"data-ulu-scrollpoint"});function Uu(){Pt.init({withData:!0,events:["pageModified"],setup({element:n,data:e,initialize:t}){const r=Object.assign({},e);new kt(n,r),t()}})}const Rt=class Rt{constructor(e,t){const r=Object.assign({},Rt.defaults,t);if(!e){re(this,"Missing required element");return}r.rootSelector&&(r.root=document.querySelector(r.rootSelector),delete r.rootSelector),this.options=r,this.observer=null,this.lastPosition=null,this.isActive=!1,this.element=e,this.syncedElements=[e,...r.syncElements.map(o=>getElement(o))],this.classes={enter:this.getClassname("enter"),enterForward:this.getClassname("enter--from-forward"),enterReverse:this.getClassname("enter--from-reverse"),exit:this.getClassname("exit"),exitForward:this.getClassname("exit--from-forward"),exitReverse:this.getClassname("exit--from-reverse")},this.setupObserver(),r.debug&&Pt.log(this)}getClassname(e){return this.options.classPrefix+"-"+e}getObserverOptions(){const{root:e,marginStart:t,marginEnd:r,threshold:o,horizontal:i}=this.options,a=i?`0px ${t} 0px ${r}`:`${t} 0px ${r} 0px`;return{root:e,rootMargin:a,threshold:o}}onObserve(e){const t=this.getScrollY(),{lastPosition:r,isActive:o,options:i}=this,a=r===null?null:r<t;e.forEach(s=>{const{isIntersecting:l}=s;l&&!o?this.setState(!0,a):!l&&o&&i.exit&&(a&&i.exitForward||!a&&i.exitReverse)&&this.setState(!1,a)}),this.lastPosition=t}setupObserver(){const e=r=>{this.onObserve(r)},t=this.getObserverOptions();this.options.debug&&Pt.log("IntersectionObserver (options)",t),this.observer=new IntersectionObserver(e,t),this.observer.observe(this.element)}getScrollY(){const{root:e}=this.options;return e===null||e===document?window.scrollY:e.scrollTop}setState(e,t){const{element:r}=this,o={isActive:e,isForward:t,element:r,instance:this},{setClasses:i,setAttribute:a,onChange:s}=this.options;i&&this.updateClasses(e,t),a&&this.updateStateAttribute(e,t),s&&s(o),this.isActive=e}getAllClasses(){return Object.values(this.classes)}updateClasses(e,t){const{classes:r}=this,o=this.getAllClasses(),i=[r.enter,t?r.enterForward:r.enterReverse],a=[r.exit,t?r.exitForward:r.exitReverse];this.syncedElements.forEach(s=>{s.classList.remove(...o),e?s.classList.add(...i):s.classList.add(...a)})}updateStateAttribute(e,t){const r=e?"enter":"exit",o=t?"forward":"reverse";this.syncedElements.forEach(i=>{i.setAttribute(this.options.attributeName,`${r}-${o}`)})}destroy(){this.observer.disconnect(),this.observer=null,this.options.setClasses&&this.element.classList.remove(...this.getAllClasses()),this.options.setAttribute&&this.element.removeAttribute(this.options.attributeName)}};z(Rt,"defaults",{root:null,rootSelector:null,debug:!1,horizontal:!1,marginStart:"-25%",marginEnd:"-55%",threshold:[0,1],exit:!0,exitForward:!0,exitReverse:!0,setClasses:!1,classPrefix:"scrollpoint",setAttribute:!0,attributeName:"data-ulu-scrollpoint-state",syncElements:[],onChange(e){}});let kt=Rt;const Zu=Object.freeze(Object.defineProperty({__proto__:null,Scrollpoint:kt,init:Uu,initializer:Pt},Symbol.toStringTag,{value:"Module"}));function Xu(n){const e=window.open();e.document.write(n),e.print(),e.close()}function Ju(n){var e=n.innerHTML;Xu(e)}const Yu=new J({type:"print",baseAttribute:"data-ulu-print"}),Qu={element:null};function ec(){Yu.init({withData:!0,events:["pageModified"],setup({element:n,data:e,initialize:t}){tc(n,e),t()}})}function tc(n,e){const t=Object.assign({},Qu,e);n.addEventListener("click",()=>{if(t.element){const r=$i(t.element);r?Ju(r):console.error("Unable to find element to print",n,t)}else window.print()})}const nc=Object.freeze(Object.defineProperty({__proto__:null,init:ec},Symbol.toStringTag,{value:"Module"})),It={opened:"data-ulu-print-details-opened"},rc=n=>`[${It[n]}]`,ic={selector:"details:not([open])"};function oc(n){const e=Object.assign({},ic,n);document.addEventListener(Q("beforePrint"),()=>{document.querySelectorAll(e.selector).forEach(t=>{t.open||(t.setAttribute(It.opened,!0),t.open=!0)})}),document.addEventListener(Q("afterPrint"),()=>{document.querySelectorAll(rc("opened")).forEach(t=>{t.removeAttribute(It.opened),t.open=!1})})}const ac=Object.freeze(Object.defineProperty({__proto__:null,attrs:It,init:oc},Symbol.toStringTag,{value:"Module"})),Bt=new J({type:"scroll-slider",baseAttribute:"data-ulu-scroll-slider"}),sc=Bt.attributeSelector("track"),lc=Bt.attributeSelector("control-context"),uc=[],cc={amount:Zi()};function fc(){Bt.init({withData:!0,events:["pageModified"],setup({element:n,data:e,initialize:t}){dc(n,e),t()}})}function dc(n,e){const t=Object.assign({},cc,e),r={track:n.querySelector(sc),controls:n.querySelector(lc)};uc.push(new Ot(r,t))}const pc=Object.freeze(Object.defineProperty({__proto__:null,init:fc,initializer:Bt},Symbol.toStringTag,{value:"Module"})),te=new J({type:"theme-toggle",baseAttribute:"data-ulu-theme-toggle"}),vc=te.attributeSelector("label"),hc=te.attributeSelector("icon"),Ho=te.getAttribute("remote"),Ur=te.getAttribute("init"),_i=te.getAttribute("state"),mc=n=>document.querySelectorAll(`[${Ho}="${n}"]`),Ei=n=>document.querySelectorAll(`[${Ho}="${n}"]:not([${Ur}])`),Bo=["target"],bc=$t(Bo),wi=(n,e)=>n?e():null,di={themes:{light:{label:"Light",value:"light",iconClass:"fas fa-moon",targetClass:"theme-light",mediaQuery:"(prefers-color-scheme: light)"},dark:{label:"Dark",iconClass:"fas fa-sun",targetClass:"theme-dark",mediaQuery:"(prefers-color-scheme: dark)"}},target:"body",group:null,onChange(n){},initialState:"light",checkMediaQuery:!1,savePreference:!1,storagePrefix:"ulu-theme-",debug:!1};let Si={...di};function gc(n){Si=Object.assign({},Si,n)}function xc(){te.init({events:["pageModified"],withData:!0,setup({element:n,data:e,initialize:t}){Wo(n,e),t()}})}function Wo(n,e){const t=Object.assign({},di,e);if(!bc(t)){console.error(`Missing a required option: ${Bo.join(", ")}`);return}const r=t.group,o={toggle:n,options:t},i=yc(t);if(!i){console.error("Unable to resolve initial key");return}Jt(i,o),n.addEventListener("click",s),l(),document.addEventListener(Q("pageModified"),l);function a(f){const h=Xr(t.target)[0].dataset.uluThemeToggleState,v=Ec(h,t);if(!v){console.error("Issue getting next theme key");return}Jt(v,{...o,event:f})}function s(f){a(f)}function l(){if(!r)return;Ei(r).forEach(d=>{d.addEventListener("click",s),te.initializeElement(d)})}function u(){if(!r)return;Ei(r).forEach(d=>{d.removeEventListener("click",s),d.removeAttribute(Ur,"")})}function m(){n.removeEventListener("click",s),n.removeAttribute(Ur,""),u(),document.removeEventListener(Q("pageModified"),l)}return{destroy:m,toggle:n,options:t,toggleState:a,setState(f){Jt(f,o)}}}function Jt(n,e){if(!n){console.error("Missing key");return}const{toggle:t,options:r}=e,{themes:o,group:i}=r,a={targets:Xr(r.target),toggles:[t,...i?mc(i):[]]};if(!a.targets.length||!a.toggles.length){console.error("Issue setting state, couldn't find needed elements",a);return}const s=o[n],l=wc(n,o),u={...e,key:n,elements:a,theme:s,otherThemes:l};r.debug&&te.log("Set state context",u);const m=Oi(l,"targetClass"),f=Oi(l,"iconClass");a.targets.forEach(d=>{d.setAttribute(_i,n),d.classList.remove(...m),d.classList.add(...gt(s.targetClass))}),a.toggles.forEach(d=>{const h=d.querySelector(vc),v=d.querySelector(hc);h&&(h.textContent=s.label),v&&(v.classList.remove(...f),v.classList.add(...gt(s.iconClass))),d.setAttribute(_i,n)}),r.onChange&&r.onChange(u),r.savePreference&&localStorage.setItem(jo(r),n)}function yc(n){const{savePreference:e,checkMediaQuery:t,themes:r,initialState:o}=n,i=jo(n),a=wi(e,()=>localStorage.getItem(i)),s=wi(t,()=>_c(r)),l=a||s||o;return n.debug&&(te.log("Preference Saved",a),te.log("Media Query Preference",s),te.log("Initial State:",o)),l||te.logError("Failed to resolve initial theme (pass 'initialState' to options)"),l}function _c(n){const e=Object.entries(n).find(([t,r])=>{if(r.mediaQuery)return window.matchMedia(r.mediaQuery).matches});return e?e[0]:null}function Ec(n,e){const{themes:t}=e,r=Object.keys(t),o=r.findIndex(a=>a===n),i=o===-1?0:(o+1)%r.length;return r[i]}function wc(n,e){return Object.entries(e).filter(([r])=>r!==n).map(([r,o])=>o)}function Oi(n,e){return n.reduce((t,r)=>t.concat(gt(r[e])),[])}function jo(n){const{storagePrefix:e,group:t}=n;return t?`${e}${t}`:e}const Sc=Object.freeze(Object.defineProperty({__proto__:null,defaults:di,init:xc,initializer:te,setDefaults:gc,setupToggle:Wo},Symbol.toStringTag,{value:"Module"})),Wt=new J({type:"details-group",baseAttribute:"data-ulu-details-group"}),Yt=Wt.getAttribute("child-init"),Oc={onlyOneOpen:!0,childSelector:":scope > details"};function Cc(){Wt.init({withData:!0,events:["pageModified"],setup({element:n,data:e,initialize:t}){Vo(n,e),t()}})}function Vo(n,e){const t=Object.assign({},Oc,e);try{o()}catch(s){console.error(s)}function r(){return n.querySelectorAll(t.childSelector)}function o(){r().forEach(s=>{s.hasAttribute(Yt)||(s.setAttribute(Yt,""),s.addEventListener("toggle",i))})}function i({target:s}){t.onlyOneOpen&&s.open&&r().forEach(l=>{l!==s&&l.open&&(l.open=!1)})}function a(){r().forEach(s=>{s.removeEventListener("toggle",i),s.removeAttribute(Yt)}),n.removeAttribute(Wt.getAttribute("init"))}return{destroy:a,element:n,setupChildren:o}}const Tc=Object.freeze(Object.defineProperty({__proto__:null,init:Cc,initializer:Wt,setupGroup:Vo},Symbol.toStringTag,{value:"Module"})),zo=Object.freeze(Object.defineProperty({__proto__:null,breakpoints:Ca,collapsible:Ma,detailsGroup:Tc,dialog:$a,flipcard:za,grid:Ga,get index(){return zo},modalBuilder:Ba,overflowScroller:Xa,overflowScrollerPager:Ua,page:ga,popover:Vs,print:nc,printDetails:ac,proxyClick:Gu,resizer:Pa,scrollSlider:pc,scrollpoint:Zu,slider:$u,tabs:Vu,themeToggle:Sc,tooltip:Zs},Symbol.toStringTag,{value:"Module"})),Ft=class Ft{constructor(e,t){this.options=Object.assign({},Ft.defaults,t),this.data=e,this.blob=new Blob([e],{type:this.options.type}),this.url=URL.createObjectURL(this.blob)}destroy(){return URL.revokeObjectURL(this.url)}getUrl(){return this.url}createLink(e){const t=document.createElement("a"),r=document.createTextNode(e);return t.setAttribute("download",this.options.filename),t.setAttribute("href",this.url),t.appendChild(r),t}static isBrowserSupported(){return"FileReader"in window}};z(Ft,"defaults",{filename:"filesave-file.txt",type:"text/plain;charset=utf-8"});let Zr=Ft;const Ac=Object.freeze(Object.defineProperty({__proto__:null,FileSave:Zr},Symbol.toStringTag,{value:"Module"}));function Mc(){Ti({iconClassClose:"fas fa-xmark",iconClassDragX:"fas fa-solid fa-grip-lines-vertical",iconClassPrevious:"fas fa-solid fa-chevron-left",iconClassNext:"fas fa-solid fa-chevron-right"})}const Pc=Object.freeze(Object.defineProperty({__proto__:null,configureIcons:Mc},Symbol.toStringTag,{value:"Module"})),Ko=Object.freeze(Object.defineProperty({__proto__:null,classLogger:wa,dom:ma,fileSave:Ac,floatingUi:$s,fontAwesome:Pc,id:Aa,get index(){return Ko},pauseYoutubeVideo:Ia},Symbol.toStringTag,{value:"Module"})),kc=Object.freeze(Object.defineProperty({__proto__:null,events:ha,settings:fa,ui:zo,utils:Ko},Symbol.toStringTag,{value:"Module"}));typeof window<"u"&&(window.ULU=kc);
@@ -105,7 +105,7 @@ export class Scrollpoint {
105
105
  /**
106
106
  * Attribute name to set state info in
107
107
  */
108
- attributeName: "data-scrollpoint-state",
108
+ attributeName: "data-ulu-scrollpoint-state",
109
109
  /**
110
110
  * Group multiple points, one active at a time (scroll menus)
111
111
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ulu/frontend",
3
- "version": "0.1.0-beta.38",
3
+ "version": "0.1.0-beta.39",
4
4
  "description": "Modular Sass Theming Library",
5
5
  "browser": "js/index.js",
6
6
  "main": "index.js",