🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@headless-primitives/carousel

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@headless-primitives/carousel - npm Package Compare versions

Comparing version
1.0.0
to
1.1.0
+13
-1
dist/index.js

@@ -1089,2 +1089,12 @@ //#region ../../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.js

}
_abortController = null;
get signal() {
return (!this._abortController || this._abortController.signal.aborted) && (this._abortController = new AbortController()), this._abortController.signal;
}
connectedCallback() {
super.connectedCallback(), (!this._abortController || this._abortController.signal.aborted) && (this._abortController = new AbortController());
}
disconnectedCallback() {
super.disconnectedCallback(), this._abortController?.abort(), this._abortController = null;
}
};

@@ -1141,3 +1151,5 @@ function X(e) {

this._sync(), requestAnimationFrame(() => {
this._updateItems(), this._items.length === 0 && setTimeout(() => this._updateItems(), 50);
this._updateItems(), this._items.length === 0 && requestAnimationFrame(() => {
requestAnimationFrame(() => this._updateItems());
});
});

@@ -1144,0 +1156,0 @@ }), this.autoplay && this.start(), this.addEventListener("keydown", (e) => {

+1
-1
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.HeadlessPrimitivesCarousel={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=globalThis,n=t.ShadowRoot&&(t.ShadyCSS===void 0||t.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,r=Symbol(),i=new WeakMap,a=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(n&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=i.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&i.set(t,e))}return e}toString(){return this.cssText}},o=e=>new a(typeof e==`string`?e:e+``,void 0,r),s=(e,r)=>{if(n)e.adoptedStyleSheets=r.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let n of r){let r=document.createElement(`style`),i=t.litNonce;i!==void 0&&r.setAttribute(`nonce`,i),r.textContent=n.cssText,e.appendChild(r)}},c=n?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return o(t)})(e):e,{is:l,defineProperty:u,getOwnPropertyDescriptor:d,getOwnPropertyNames:ee,getOwnPropertySymbols:te,getPrototypeOf:ne}=Object,f=globalThis,re=f.trustedTypes,ie=re?re.emptyScript:``,ae=f.reactiveElementPolyfillSupport,p=(e,t)=>e,m={toAttribute(e,t){switch(t){case Boolean:e=e?ie:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},oe=(e,t)=>!l(e,t),se={attribute:!0,type:String,converter:m,reflect:!1,useDefault:!1,hasChanged:oe};Symbol.metadata??=Symbol(`metadata`),f.litPropertyMetadata??=new WeakMap;var h=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=se){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&u(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=d(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??se}static _$Ei(){if(this.hasOwnProperty(p(`elementProperties`)))return;let e=ne(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(p(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(p(`properties`))){let e=this.properties,t=[...ee(e),...te(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(c(e))}else e!==void 0&&t.push(c(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?m:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?m:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??oe)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};h.elementStyles=[],h.shadowRootOptions={mode:`open`},h[p(`elementProperties`)]=new Map,h[p(`finalized`)]=new Map,ae?.({ReactiveElement:h}),(f.reactiveElementVersions??=[]).push(`2.1.2`);var ce=globalThis,le=e=>e,g=ce.trustedTypes,ue=g?g.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,de=`$lit$`,_=`lit$${Math.random().toFixed(9).slice(2)}$`,fe=`?`+_,pe=`<${fe}>`,v=document,y=()=>v.createComment(``),b=e=>e===null||typeof e!=`object`&&typeof e!=`function`,me=Array.isArray,he=e=>me(e)||typeof e?.[Symbol.iterator]==`function`,ge=`[
\f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_e=/-->/g,ve=/>/g,S=RegExp(`>|${ge}(?:([^\\s"'>=/]+)(${ge}*=${ge}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),ye=/'/g,be=/"/g,xe=/^(?:script|style|textarea|title)$/i,C=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),w=Symbol.for(`lit-noChange`),T=Symbol.for(`lit-nothing`),Se=new WeakMap,E=v.createTreeWalker(v,129);function Ce(e,t){if(!me(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return ue===void 0?t:ue.createHTML(t)}var we=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=x;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===x?c[1]===`!--`?o=_e:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=S):(xe.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=S):o=ve:o===S?c[0]===`>`?(o=i??x,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?S:c[3]===`"`?be:ye):o===be||o===ye?o=S:o===_e||o===ve?o=x:(o=S,i=void 0);let d=o===S&&e[t+1].startsWith(`/>`)?` `:``;a+=o===x?n+pe:l>=0?(r.push(s),n.slice(0,l)+de+n.slice(l)+_+d):n+_+(l===-2?t:d)}return[Ce(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},Te=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=we(t,n);if(this.el=e.createElement(l,r),E.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=E.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(de)){let t=u[o++],n=i.getAttribute(e).split(_),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?Oe:r[1]===`?`?ke:r[1]===`@`?Ae:O}),i.removeAttribute(e)}else e.startsWith(_)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(xe.test(i.tagName)){let e=i.textContent.split(_),t=e.length-1;if(t>0){i.textContent=g?g.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],y()),E.nextNode(),c.push({type:2,index:++a});i.append(e[t],y())}}}else if(i.nodeType===8)if(i.data===fe)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(_,e+1))!==-1;)c.push({type:7,index:a}),e+=_.length-1}a++}}static createElement(e,t){let n=v.createElement(`template`);return n.innerHTML=e,n}};function D(e,t,n=e,r){if(t===w)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=b(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=D(e,i._$AS(e,t.values),i,r)),t}var Ee=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??v).importNode(t,!0);E.currentNode=r;let i=E.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new De(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new je(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=E.nextNode(),a++)}return E.currentNode=v,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},De=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=T,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=D(this,e,t),b(e)?e===T||e==null||e===``?(this._$AH!==T&&this._$AR(),this._$AH=T):e!==this._$AH&&e!==w&&this._(e):e._$litType$===void 0?e.nodeType===void 0?he(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==T&&b(this._$AH)?this._$AA.nextSibling.data=e:this.T(v.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=Te.createElement(Ce(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new Ee(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=Se.get(e.strings);return t===void 0&&Se.set(e.strings,t=new Te(e)),t}k(t){me(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(y()),this.O(y()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=le(e).nextSibling;le(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},O=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=T,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=T}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=D(this,e,t,0),a=!b(e)||e!==this._$AH&&e!==w,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=D(this,r[n+o],t,o),s===w&&(s=this._$AH[o]),a||=!b(s)||s!==this._$AH[o],s===T?e=T:e!==T&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===T?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},Oe=class extends O{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===T?void 0:e}},ke=class extends O{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==T)}},Ae=class extends O{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=D(this,e,t,0)??T)===w)return;let n=this._$AH,r=e===T&&n!==T||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==T&&(n===T||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},je=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){D(this,e)}},Me=ce.litHtmlPolyfillSupport;Me?.(Te,De),(ce.litHtmlVersions??=[]).push(`3.3.2`);var Ne=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new De(t.insertBefore(y(),e),e,void 0,n??{})}return i._$AI(e),i},Pe=globalThis,k=class extends h{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ne(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return w}};k._$litElement$=!0,k.finalized=!0,Pe.litElementHydrateSupport?.({LitElement:k});var Fe=Pe.litElementPolyfillSupport;Fe?.({LitElement:k}),(Pe.litElementVersions??=[]).push(`4.2.2`);var Ie={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:oe},Le=(e=Ie,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function A(e){return(t,n)=>typeof n==`object`?Le(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}var j=globalThis,Re=j.ShadowRoot&&(j.ShadyCSS===void 0||j.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,ze=Symbol(),Be=new WeakMap,Ve=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==ze)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(Re&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=Be.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Be.set(t,e))}return e}toString(){return this.cssText}},He=e=>new Ve(typeof e==`string`?e:e+``,void 0,ze),Ue=(e,t)=>{if(Re)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let n of t){let t=document.createElement(`style`),r=j.litNonce;r!==void 0&&t.setAttribute(`nonce`,r),t.textContent=n.cssText,e.appendChild(t)}},We=Re?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return He(t)})(e):e,{is:Ge,defineProperty:Ke,getOwnPropertyDescriptor:qe,getOwnPropertyNames:Je,getOwnPropertySymbols:Ye,getPrototypeOf:Xe}=Object,M=globalThis,Ze=M.trustedTypes,Qe=Ze?Ze.emptyScript:``,$e=M.reactiveElementPolyfillSupport,N=(e,t)=>e,et={toAttribute(e,t){switch(t){case Boolean:e=e?Qe:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},tt=(e,t)=>!Ge(e,t),nt={attribute:!0,type:String,converter:et,reflect:!1,useDefault:!1,hasChanged:tt};Symbol.metadata??=Symbol(`metadata`),M.litPropertyMetadata??=new WeakMap;var P=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=nt){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&Ke(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=qe(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??nt}static _$Ei(){if(this.hasOwnProperty(N(`elementProperties`)))return;let e=Xe(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(N(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(N(`properties`))){let e=this.properties,t=[...Je(e),...Ye(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(We(e))}else e!==void 0&&t.push(We(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ue(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?et:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?et:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??tt)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};P.elementStyles=[],P.shadowRootOptions={mode:`open`},P[N(`elementProperties`)]=new Map,P[N(`finalized`)]=new Map,$e?.({ReactiveElement:P}),(M.reactiveElementVersions??=[]).push(`2.1.2`);var rt=globalThis,it=e=>e,F=rt.trustedTypes,at=F?F.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,ot=`$lit$`,I=`lit$${Math.random().toFixed(9).slice(2)}$`,st=`?`+I,ct=`<${st}>`,L=document,R=()=>L.createComment(``),z=e=>e===null||typeof e!=`object`&&typeof e!=`function`,lt=Array.isArray,ut=e=>lt(e)||typeof e?.[Symbol.iterator]==`function`,dt=`[
\f\r]`,B=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ft=/-->/g,pt=/>/g,V=RegExp(`>|${dt}(?:([^\\s"'>=/]+)(${dt}*=${dt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),mt=/'/g,ht=/"/g,gt=/^(?:script|style|textarea|title)$/i,H=Symbol.for(`lit-noChange`),U=Symbol.for(`lit-nothing`),_t=new WeakMap,W=L.createTreeWalker(L,129);function vt(e,t){if(!lt(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return at===void 0?t:at.createHTML(t)}var yt=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=B;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===B?c[1]===`!--`?o=ft:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=V):(gt.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=V):o=pt:o===V?c[0]===`>`?(o=i??B,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?V:c[3]===`"`?ht:mt):o===ht||o===mt?o=V:o===ft||o===pt?o=B:(o=V,i=void 0);let d=o===V&&e[t+1].startsWith(`/>`)?` `:``;a+=o===B?n+ct:l>=0?(r.push(s),n.slice(0,l)+ot+n.slice(l)+I+d):n+I+(l===-2?t:d)}return[vt(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},bt=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=yt(t,n);if(this.el=e.createElement(l,r),W.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=W.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(ot)){let t=u[o++],n=i.getAttribute(e).split(I),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?Ct:r[1]===`?`?wt:r[1]===`@`?Tt:K}),i.removeAttribute(e)}else e.startsWith(I)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(gt.test(i.tagName)){let e=i.textContent.split(I),t=e.length-1;if(t>0){i.textContent=F?F.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],R()),W.nextNode(),c.push({type:2,index:++a});i.append(e[t],R())}}}else if(i.nodeType===8)if(i.data===st)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(I,e+1))!==-1;)c.push({type:7,index:a}),e+=I.length-1}a++}}static createElement(e,t){let n=L.createElement(`template`);return n.innerHTML=e,n}};function G(e,t,n=e,r){if(t===H)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=z(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=G(e,i._$AS(e,t.values),i,r)),t}var xt=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??L).importNode(t,!0);W.currentNode=r;let i=W.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new St(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new Et(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=W.nextNode(),a++)}return W.currentNode=L,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},St=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=U,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=G(this,e,t),z(e)?e===U||e==null||e===``?(this._$AH!==U&&this._$AR(),this._$AH=U):e!==this._$AH&&e!==H&&this._(e):e._$litType$===void 0?e.nodeType===void 0?ut(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==U&&z(this._$AH)?this._$AA.nextSibling.data=e:this.T(L.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=bt.createElement(vt(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new xt(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=_t.get(e.strings);return t===void 0&&_t.set(e.strings,t=new bt(e)),t}k(t){lt(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(R()),this.O(R()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=it(e).nextSibling;it(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},K=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=U,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=U}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=G(this,e,t,0),a=!z(e)||e!==this._$AH&&e!==H,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=G(this,r[n+o],t,o),s===H&&(s=this._$AH[o]),a||=!z(s)||s!==this._$AH[o],s===U?e=U:e!==U&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===U?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},Ct=class extends K{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===U?void 0:e}},wt=class extends K{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==U)}},Tt=class extends K{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=G(this,e,t,0)??U)===H)return;let n=this._$AH,r=e===U&&n!==U||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==U&&(n===U||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Et=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){G(this,e)}},Dt=rt.litHtmlPolyfillSupport;Dt?.(bt,St),(rt.litHtmlVersions??=[]).push(`3.3.2`);var Ot=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new St(t.insertBefore(R(),e),e,void 0,n??{})}return i._$AI(e),i},kt=globalThis,q=class extends P{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ot(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return H}};q._$litElement$=!0,q.finalized=!0,kt.litElementHydrateSupport?.({LitElement:q});var At=kt.litElementPolyfillSupport;At?.({LitElement:q}),(kt.litElementVersions??=[]).push(`4.2.2`);var J=[];for(let e=0;e<256;++e)J.push((e+256).toString(16).slice(1));function jt(e,t=0){return(J[e[t+0]]+J[e[t+1]]+J[e[t+2]]+J[e[t+3]]+`-`+J[e[t+4]]+J[e[t+5]]+`-`+J[e[t+6]]+J[e[t+7]]+`-`+J[e[t+8]]+J[e[t+9]]+`-`+J[e[t+10]]+J[e[t+11]]+J[e[t+12]]+J[e[t+13]]+J[e[t+14]]+J[e[t+15]]).toLowerCase()}var Mt,Nt=new Uint8Array(16);function Pt(){if(!Mt){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);Mt=crypto.getRandomValues.bind(crypto)}return Mt(Nt)}var Ft={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function It(e,t,n){e||={};let r=e.random??e.rng?.()??Pt();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return jt(r)}function Lt(e,t,n){return Ft.randomUUID&&!t&&!e?Ft.randomUUID():It(e,t,n)}function Rt(e=`hp`){return`${e}-${Lt()}`}var Y=class extends q{createRenderRoot(){return this}emit(e,t){let n=new CustomEvent(`hp-${e}`,{detail:t,bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(n),n}_hpId=Rt();get hpId(){return this._hpId}};function X(e){return function(t){typeof window<`u`&&(customElements.get(e)||customElements.define(e,t))}}function Z(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var Q=class extends Y{orientation=`horizontal`;loop=!1;interval=5e3;_autoplayTimer=null;_activeIndex=0;_autoplay=!1;_label=`Carousel`;get _items(){return Array.from(this.querySelector(`hp-carousel-content`)?.querySelectorAll(`hp-carousel-item`)??[])}get _dots(){return Array.from(this.querySelectorAll(`hp-carousel-dot`))}get autoplay(){return this._autoplay}set autoplay(e){this._autoplay=e,e&&this.isConnected?this.start():this.stop()}get label(){return this._label}set label(e){this._label=e,this._sync()}get activeIndex(){return this._activeIndex}set activeIndex(e){this._activeIndex=e,this._updateItems(),this._sync(),this.emit(`change`,{activeIndex:e})}connectedCallback(){super.connectedCallback(),this.setAttribute(`data-hp-component`,`carousel`),this.role=`region`,this.setAttribute(`aria-roledescription`,`carousel`),this._sync(),requestAnimationFrame(()=>{this._sync(),requestAnimationFrame(()=>{this._updateItems(),this._items.length===0&&setTimeout(()=>this._updateItems(),50)})}),this.autoplay&&this.start(),this.addEventListener(`keydown`,e=>{this.orientation===`horizontal`?(e.key===`ArrowRight`&&this.next(),e.key===`ArrowLeft`&&this.previous()):(e.key===`ArrowDown`&&this.next(),e.key===`ArrowUp`&&this.previous())})}disconnectedCallback(){super.disconnectedCallback(),this.stop()}_sync(){this.setAttribute(`aria-label`,this.label)}_updateItems(){this._items?.forEach((e,t)=>{t===this.activeIndex?(e.setAttribute(`data-state`,`active`),e.setAttribute(`aria-hidden`,`false`)):(e.setAttribute(`data-state`,`inactive`),e.setAttribute(`aria-hidden`,`true`))}),this._dots?.forEach((e,t)=>{e.setAttribute(`data-state`,t===this.activeIndex?`active`:`inactive`),e.setAttribute(`aria-pressed`,t===this.activeIndex?`true`:`false`)})}next(){let e=this.activeIndex+1;e<this._items.length?this.activeIndex=e:this.loop&&(this.activeIndex=0)}previous(){let e=this.activeIndex-1;e>=0?this.activeIndex=e:this.loop&&(this.activeIndex=this._items.length-1)}goTo(e){e>=0&&e<this._items.length&&(this.activeIndex=e)}start(){this._autoplayTimer||=setInterval(()=>this.next(),this.interval)}stop(){this._autoplayTimer&&=(clearInterval(this._autoplayTimer),null)}render(){return C`<slot></slot>`}};Z([A({type:String,reflect:!0})],Q.prototype,`orientation`,void 0),Z([A({type:Boolean,reflect:!0})],Q.prototype,`loop`,void 0),Z([A({type:Number,reflect:!0})],Q.prototype,`interval`,void 0),Z([A({type:Boolean,reflect:!0})],Q.prototype,`autoplay`,null),Z([A({type:String,reflect:!0})],Q.prototype,`label`,null),Q=Z([X(`hp-carousel`)],Q);var zt=class extends Y{connectedCallback(){super.connectedCallback(),this.setAttribute(`data-hp-component`,`carousel-content`),this.setAttribute(`aria-live`,`polite`)}render(){return C`<slot></slot>`}};zt=Z([X(`hp-carousel-content`)],zt);var Bt=class extends Y{connectedCallback(){super.connectedCallback(),this.setAttribute(`data-hp-component`,`carousel-item`),this.role=`group`,this.setAttribute(`aria-roledescription`,`slide`),this.setAttribute(`data-state`,`inactive`)}render(){return C`<slot></slot>`}};Bt=Z([X(`hp-carousel-item`)],Bt);var Vt=class extends Y{connectedCallback(){super.connectedCallback(),this.setAttribute(`data-hp-component`,`carousel-previous`),this.role=`button`,this.tabIndex=0,this.setAttribute(`aria-label`,`Previous slide`),this.addEventListener(`click`,()=>{this.closest(`hp-carousel`)?.previous()}),this.addEventListener(`keydown`,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.closest(`hp-carousel`)?.previous())})}render(){return C`<slot></slot>`}};Vt=Z([X(`hp-carousel-previous`)],Vt);var Ht=class extends Y{connectedCallback(){super.connectedCallback(),this.setAttribute(`data-hp-component`,`carousel-next`),this.role=`button`,this.tabIndex=0,this.setAttribute(`aria-label`,`Next slide`),this.addEventListener(`click`,()=>{this.closest(`hp-carousel`)?.next()}),this.addEventListener(`keydown`,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.closest(`hp-carousel`)?.next())})}render(){return C`<slot></slot>`}};Ht=Z([X(`hp-carousel-next`)],Ht);var $=class extends Y{index=0;connectedCallback(){super.connectedCallback(),this.setAttribute(`data-hp-component`,`carousel-dot`),this.setAttribute(`data-state`,`inactive`),this.role=`button`,this.tabIndex=0,this.setAttribute(`aria-label`,`Go to slide ${this.index+1}`),this.addEventListener(`click`,()=>{this.closest(`hp-carousel`)?.goTo(this.index)}),this.addEventListener(`keydown`,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.closest(`hp-carousel`)?.goTo(this.index))})}render(){return C`<slot></slot>`}};Z([A({type:Number,reflect:!0})],$.prototype,`index`,void 0),$=Z([X(`hp-carousel-dot`)],$),Object.defineProperty(e,`HpCarousel`,{enumerable:!0,get:function(){return Q}}),Object.defineProperty(e,`HpCarouselContent`,{enumerable:!0,get:function(){return zt}}),Object.defineProperty(e,`HpCarouselDot`,{enumerable:!0,get:function(){return $}}),Object.defineProperty(e,`HpCarouselItem`,{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(e,`HpCarouselNext`,{enumerable:!0,get:function(){return Ht}}),Object.defineProperty(e,`HpCarouselPrevious`,{enumerable:!0,get:function(){return Vt}})});
\f\r]`,B=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ft=/-->/g,pt=/>/g,V=RegExp(`>|${dt}(?:([^\\s"'>=/]+)(${dt}*=${dt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),mt=/'/g,ht=/"/g,gt=/^(?:script|style|textarea|title)$/i,H=Symbol.for(`lit-noChange`),U=Symbol.for(`lit-nothing`),_t=new WeakMap,W=L.createTreeWalker(L,129);function vt(e,t){if(!lt(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return at===void 0?t:at.createHTML(t)}var yt=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=B;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===B?c[1]===`!--`?o=ft:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=V):(gt.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=V):o=pt:o===V?c[0]===`>`?(o=i??B,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?V:c[3]===`"`?ht:mt):o===ht||o===mt?o=V:o===ft||o===pt?o=B:(o=V,i=void 0);let d=o===V&&e[t+1].startsWith(`/>`)?` `:``;a+=o===B?n+ct:l>=0?(r.push(s),n.slice(0,l)+ot+n.slice(l)+I+d):n+I+(l===-2?t:d)}return[vt(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},bt=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=yt(t,n);if(this.el=e.createElement(l,r),W.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=W.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(ot)){let t=u[o++],n=i.getAttribute(e).split(I),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?Ct:r[1]===`?`?wt:r[1]===`@`?Tt:K}),i.removeAttribute(e)}else e.startsWith(I)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(gt.test(i.tagName)){let e=i.textContent.split(I),t=e.length-1;if(t>0){i.textContent=F?F.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],R()),W.nextNode(),c.push({type:2,index:++a});i.append(e[t],R())}}}else if(i.nodeType===8)if(i.data===st)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(I,e+1))!==-1;)c.push({type:7,index:a}),e+=I.length-1}a++}}static createElement(e,t){let n=L.createElement(`template`);return n.innerHTML=e,n}};function G(e,t,n=e,r){if(t===H)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=z(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=G(e,i._$AS(e,t.values),i,r)),t}var xt=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??L).importNode(t,!0);W.currentNode=r;let i=W.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new St(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new Et(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=W.nextNode(),a++)}return W.currentNode=L,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},St=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=U,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=G(this,e,t),z(e)?e===U||e==null||e===``?(this._$AH!==U&&this._$AR(),this._$AH=U):e!==this._$AH&&e!==H&&this._(e):e._$litType$===void 0?e.nodeType===void 0?ut(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==U&&z(this._$AH)?this._$AA.nextSibling.data=e:this.T(L.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=bt.createElement(vt(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new xt(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=_t.get(e.strings);return t===void 0&&_t.set(e.strings,t=new bt(e)),t}k(t){lt(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(R()),this.O(R()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=it(e).nextSibling;it(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},K=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=U,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=U}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=G(this,e,t,0),a=!z(e)||e!==this._$AH&&e!==H,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=G(this,r[n+o],t,o),s===H&&(s=this._$AH[o]),a||=!z(s)||s!==this._$AH[o],s===U?e=U:e!==U&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===U?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},Ct=class extends K{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===U?void 0:e}},wt=class extends K{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==U)}},Tt=class extends K{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=G(this,e,t,0)??U)===H)return;let n=this._$AH,r=e===U&&n!==U||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==U&&(n===U||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Et=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){G(this,e)}},Dt=rt.litHtmlPolyfillSupport;Dt?.(bt,St),(rt.litHtmlVersions??=[]).push(`3.3.2`);var Ot=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new St(t.insertBefore(R(),e),e,void 0,n??{})}return i._$AI(e),i},kt=globalThis,q=class extends P{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ot(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return H}};q._$litElement$=!0,q.finalized=!0,kt.litElementHydrateSupport?.({LitElement:q});var At=kt.litElementPolyfillSupport;At?.({LitElement:q}),(kt.litElementVersions??=[]).push(`4.2.2`);var J=[];for(let e=0;e<256;++e)J.push((e+256).toString(16).slice(1));function jt(e,t=0){return(J[e[t+0]]+J[e[t+1]]+J[e[t+2]]+J[e[t+3]]+`-`+J[e[t+4]]+J[e[t+5]]+`-`+J[e[t+6]]+J[e[t+7]]+`-`+J[e[t+8]]+J[e[t+9]]+`-`+J[e[t+10]]+J[e[t+11]]+J[e[t+12]]+J[e[t+13]]+J[e[t+14]]+J[e[t+15]]).toLowerCase()}var Mt,Nt=new Uint8Array(16);function Pt(){if(!Mt){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);Mt=crypto.getRandomValues.bind(crypto)}return Mt(Nt)}var Ft={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function It(e,t,n){e||={};let r=e.random??e.rng?.()??Pt();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return jt(r)}function Lt(e,t,n){return Ft.randomUUID&&!t&&!e?Ft.randomUUID():It(e,t,n)}function Rt(e=`hp`){return`${e}-${Lt()}`}var Y=class extends q{createRenderRoot(){return this}emit(e,t){let n=new CustomEvent(`hp-${e}`,{detail:t,bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(n),n}_hpId=Rt();get hpId(){return this._hpId}_abortController=null;get signal(){return(!this._abortController||this._abortController.signal.aborted)&&(this._abortController=new AbortController),this._abortController.signal}connectedCallback(){super.connectedCallback(),(!this._abortController||this._abortController.signal.aborted)&&(this._abortController=new AbortController)}disconnectedCallback(){super.disconnectedCallback(),this._abortController?.abort(),this._abortController=null}};function X(e){return function(t){typeof window<`u`&&(customElements.get(e)||customElements.define(e,t))}}function Z(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var Q=class extends Y{orientation=`horizontal`;loop=!1;interval=5e3;_autoplayTimer=null;_activeIndex=0;_autoplay=!1;_label=`Carousel`;get _items(){return Array.from(this.querySelector(`hp-carousel-content`)?.querySelectorAll(`hp-carousel-item`)??[])}get _dots(){return Array.from(this.querySelectorAll(`hp-carousel-dot`))}get autoplay(){return this._autoplay}set autoplay(e){this._autoplay=e,e&&this.isConnected?this.start():this.stop()}get label(){return this._label}set label(e){this._label=e,this._sync()}get activeIndex(){return this._activeIndex}set activeIndex(e){this._activeIndex=e,this._updateItems(),this._sync(),this.emit(`change`,{activeIndex:e})}connectedCallback(){super.connectedCallback(),this.setAttribute(`data-hp-component`,`carousel`),this.role=`region`,this.setAttribute(`aria-roledescription`,`carousel`),this._sync(),requestAnimationFrame(()=>{this._sync(),requestAnimationFrame(()=>{this._updateItems(),this._items.length===0&&requestAnimationFrame(()=>{requestAnimationFrame(()=>this._updateItems())})})}),this.autoplay&&this.start(),this.addEventListener(`keydown`,e=>{this.orientation===`horizontal`?(e.key===`ArrowRight`&&this.next(),e.key===`ArrowLeft`&&this.previous()):(e.key===`ArrowDown`&&this.next(),e.key===`ArrowUp`&&this.previous())})}disconnectedCallback(){super.disconnectedCallback(),this.stop()}_sync(){this.setAttribute(`aria-label`,this.label)}_updateItems(){this._items?.forEach((e,t)=>{t===this.activeIndex?(e.setAttribute(`data-state`,`active`),e.setAttribute(`aria-hidden`,`false`)):(e.setAttribute(`data-state`,`inactive`),e.setAttribute(`aria-hidden`,`true`))}),this._dots?.forEach((e,t)=>{e.setAttribute(`data-state`,t===this.activeIndex?`active`:`inactive`),e.setAttribute(`aria-pressed`,t===this.activeIndex?`true`:`false`)})}next(){let e=this.activeIndex+1;e<this._items.length?this.activeIndex=e:this.loop&&(this.activeIndex=0)}previous(){let e=this.activeIndex-1;e>=0?this.activeIndex=e:this.loop&&(this.activeIndex=this._items.length-1)}goTo(e){e>=0&&e<this._items.length&&(this.activeIndex=e)}start(){this._autoplayTimer||=setInterval(()=>this.next(),this.interval)}stop(){this._autoplayTimer&&=(clearInterval(this._autoplayTimer),null)}render(){return C`<slot></slot>`}};Z([A({type:String,reflect:!0})],Q.prototype,`orientation`,void 0),Z([A({type:Boolean,reflect:!0})],Q.prototype,`loop`,void 0),Z([A({type:Number,reflect:!0})],Q.prototype,`interval`,void 0),Z([A({type:Boolean,reflect:!0})],Q.prototype,`autoplay`,null),Z([A({type:String,reflect:!0})],Q.prototype,`label`,null),Q=Z([X(`hp-carousel`)],Q);var zt=class extends Y{connectedCallback(){super.connectedCallback(),this.setAttribute(`data-hp-component`,`carousel-content`),this.setAttribute(`aria-live`,`polite`)}render(){return C`<slot></slot>`}};zt=Z([X(`hp-carousel-content`)],zt);var Bt=class extends Y{connectedCallback(){super.connectedCallback(),this.setAttribute(`data-hp-component`,`carousel-item`),this.role=`group`,this.setAttribute(`aria-roledescription`,`slide`),this.setAttribute(`data-state`,`inactive`)}render(){return C`<slot></slot>`}};Bt=Z([X(`hp-carousel-item`)],Bt);var Vt=class extends Y{connectedCallback(){super.connectedCallback(),this.setAttribute(`data-hp-component`,`carousel-previous`),this.role=`button`,this.tabIndex=0,this.setAttribute(`aria-label`,`Previous slide`),this.addEventListener(`click`,()=>{this.closest(`hp-carousel`)?.previous()}),this.addEventListener(`keydown`,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.closest(`hp-carousel`)?.previous())})}render(){return C`<slot></slot>`}};Vt=Z([X(`hp-carousel-previous`)],Vt);var Ht=class extends Y{connectedCallback(){super.connectedCallback(),this.setAttribute(`data-hp-component`,`carousel-next`),this.role=`button`,this.tabIndex=0,this.setAttribute(`aria-label`,`Next slide`),this.addEventListener(`click`,()=>{this.closest(`hp-carousel`)?.next()}),this.addEventListener(`keydown`,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.closest(`hp-carousel`)?.next())})}render(){return C`<slot></slot>`}};Ht=Z([X(`hp-carousel-next`)],Ht);var $=class extends Y{index=0;connectedCallback(){super.connectedCallback(),this.setAttribute(`data-hp-component`,`carousel-dot`),this.setAttribute(`data-state`,`inactive`),this.role=`button`,this.tabIndex=0,this.setAttribute(`aria-label`,`Go to slide ${this.index+1}`),this.addEventListener(`click`,()=>{this.closest(`hp-carousel`)?.goTo(this.index)}),this.addEventListener(`keydown`,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.closest(`hp-carousel`)?.goTo(this.index))})}render(){return C`<slot></slot>`}};Z([A({type:Number,reflect:!0})],$.prototype,`index`,void 0),$=Z([X(`hp-carousel-dot`)],$),Object.defineProperty(e,`HpCarousel`,{enumerable:!0,get:function(){return Q}}),Object.defineProperty(e,`HpCarouselContent`,{enumerable:!0,get:function(){return zt}}),Object.defineProperty(e,`HpCarouselDot`,{enumerable:!0,get:function(){return $}}),Object.defineProperty(e,`HpCarouselItem`,{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(e,`HpCarouselNext`,{enumerable:!0,get:function(){return Ht}}),Object.defineProperty(e,`HpCarouselPrevious`,{enumerable:!0,get:function(){return Vt}})});
{
"name": "@headless-primitives/carousel",
"version": "1.0.0",
"version": "1.1.0",
"description": "Headless Carousel primitive for Lit",

@@ -24,3 +24,3 @@ "files": [

"lit": "^3.3.2",
"@headless-primitives/utils": "1.0.0"
"@headless-primitives/utils": "1.1.0"
},

@@ -27,0 +27,0 @@ "peerDependencies": {