@mgdis/stencil-helpers 3.2.4 → 3.2.6
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/dist/index.es.js +605 -622
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +12 -12
- package/dist/index.umd.js.map +1 -1
- package/package.json +6 -6
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(d,R){typeof exports=="object"&&typeof module<"u"?R(exports):typeof define=="function"&&define.amd?define(["exports"],R):(d=typeof globalThis<"u"?globalThis:d||self,R(d.StencilHelpersModule={}))})(this,(function(d){"use strict";class R{classes;constructor(t=[]){this.classes=t}add=t=>{this.has(t)||this.classes.push(t)};delete=t=>{const r=this.classes.indexOf(t);r>-1&&this.classes.splice(r,1)};has=t=>this.classes.includes(t);join=()=>this.classes.join(" ")}const z=e=>typeof e=="object"&&!Array.isArray(e)&&e!==null,oe=(e,t,r)=>{if(!z(e)||typeof t!="string")return r;const[n,...i]=t.split(".");return i.length?oe(e[n],i.join("."),r):e[n]??r},He=e=>Array.isArray(e)&&e.every(t=>typeof t=="string"),le=e=>typeof e=="string"&&e.trim()!=="",Be=e=>typeof e=="object"?JSON.stringify(e):String(e),Ge=e=>typeof e=="string"?e.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g,""):e,qe=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,r)=>(r>0?"-":"")+t.toLowerCase()).replace(/[^a-z0-9-]+/g,"-").replace(/--+/g,"-").replace(/(?:^-)|(?:-$)/g,""),Je=(e="",t=10)=>{const r=new Uint8Array(t);crypto.getRandomValues(r);const s=Array.from(r).map(n=>n.toString(16).padStart(2,"0")).join("").slice(0,t);return e!==""?`${e}-${s}`:s},Ke=e=>le(e)&&/^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(e)!==null,Xe=e=>{let t;return typeof e=="string"?t=e:e&&typeof e=="object"&&(z(e)||Array.isArray(e))?t=JSON.stringify(e):e!=null&&typeof e!="boolean"&&typeof e!="object"&&(t=String(e)),t&&qe(t)},Ye=async e=>{if(e)return e()},Qe={FIRST:"first",NEXT:"next",PREVIOUS:"previous",LAST:"last"},ce=10;class fe{items=[];total;top=ce;next;baseIndex=1;constructor(t){if(z(t))Array.isArray(t.items)&&(this.items=t.items),typeof t.top=="number"&&(this.top=t.top),this.total=typeof t.total=="number"?t.total:this.items.length,this.next=t.next;else throw new Error("Page - init must match IPage type.")}getIndexFromCursor=(t="first",r)=>{if(!Array.isArray(this.items)||!this.items.length)return null;const n=this.items.length-this.baseIndex;let i,a=0;if(["previous","next"].includes(t)&&r){const c=this.items.findIndex(l=>JSON.stringify(l)===JSON.stringify(r));if(c===-1)return 0;a=c}return t==="first"?i=0:t==="last"?i=n:t==="previous"?i=JSON.stringify(this.items[a])===JSON.stringify(this.items[0])?n:a-this.baseIndex:t==="next"?i=JSON.stringify(this.items[a])===JSON.stringify(this.items[n])?0:a+this.baseIndex:i=0,i}}class Ve{items=[];#e=ce;#t;#r;constructor(t,r){Array.isArray(t)&&(this.items=t),r&&(["string","function"].includes(typeof r.next)||z(r.next)&&URL.canParse(r.next))&&(this.#t=r.next),typeof r?.top=="number"&&(this.#e=r.top),typeof r?.total=="number"&&(this.#r=r.total)}getPage=(t=0,r)=>{const s=typeof r=="function"?this.items.filter(r):this.items;let n;return this.#t?n=this.#t:s.length>t+this.#e&&(n=()=>this.getPage(t+this.#e,r)),new fe({items:s.slice(t,t+this.#e),total:this.#r,top:this.#e,next:n})}}const et=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,tt=e=>e.toISOString().split("T")[0],rt=(e,t)=>t.includes(e?.tagName.toLowerCase()),st='a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button',nt=e=>typeof e=="number"&&!Number.isNaN(e),it=e=>{const t=G(e),r=ue(e);return[e,...t,...r]},G=(e,t=[])=>{if(e.self!==e.top)try{const r=e.parent;return r?(t.push(r),G(r,t)):t}catch(r){return console.error("Different hosts between iframes:",r),t}return t},ue=(e,t=[])=>{if(e.frames.length>0)for(const r of Array.from(e.frames))t.push(r),ue(r,t);return t};var at=Object.defineProperty,ot=(e,t)=>{for(var r in t)at(e,r,{get:t[r],enumerable:!0})},lt=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),ct={};ot(ct,{err:()=>pe,map:()=>ft,ok:()=>q,unwrap:()=>ut,unwrapErr:()=>pt});var q=e=>({isOk:!0,isErr:!1,value:e}),pe=e=>({isOk:!1,isErr:!0,value:e});function ft(e,t){if(e.isOk){const r=t(e.value);return r instanceof Promise?r.then(s=>q(s)):q(r)}if(e.isErr){const r=e.value;return pe(r)}throw"should never get here"}var ut=e=>{if(e.isOk)return e.value;throw e.value},pt=e=>{if(e.isErr)return e.value;throw e.value},J=e=>{const t=lt(e);return new RegExp(`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${t}))(${t}\\b)`,"g")};J("::slotted"),J(":host"),J(":host-context");const ge=(e,t)=>{if(!t)return;const r=t.split("/");return`${e}${r.slice(2,r.length-1).join("-")}--docs`},gt=(e,t)=>{if(t)return`${e}${t}`},de=e=>{let t=e.overview?`${e.overview}
|
|
2
2
|
|
|
3
3
|
`:"";const r=e.props.filter(({attr:n})=>n!==void 0);r.length&&(t+=`Attributes:
|
|
4
4
|
`,t+=r.map(({attr:n,docs:i})=>`- \`${n}\`: ${i}
|
|
@@ -18,21 +18,21 @@
|
|
|
18
18
|
`),e.slots.length&&(t+=`Slots:
|
|
19
19
|
`,t+=e.slots.map(({name:n,docs:i})=>`- \`${n}\`: ${i}
|
|
20
20
|
`).join(""),t+=`
|
|
21
|
-
`),t},
|
|
21
|
+
`),t},K=e=>`${e.docs}
|
|
22
22
|
|
|
23
|
-
Type: \`${e.type}\``,
|
|
23
|
+
Type: \`${e.type}\``,dt=(e,t,r,s)=>({$schema:"https://json.schemastore.org/web-types",name:e,version:t,"description-markup":"markdown",contributions:{html:{elements:r.components.map(n=>{const i=ge(s,n.filePath);return{name:n.tag,description:de(n),"doc-url":i,attributes:n.props.filter(a=>a.attr).map(a=>({name:a.attr,description:K(a),"doc-url":i,value:{type:a.type,default:a.default,required:a.required}})),js:{properties:n.props.map(a=>({name:a.name,description:K(a),"doc-url":i,value:{type:a.type,default:a.default,required:a.required}})),events:n.events.map(a=>({name:a.event,description:a.docs}))},css:{properties:n.styles.map(a=>({name:a.name,description:a.docs}))}}})}}}),$t=(e,t,r)=>[{name:"Storybook",url:ge(e,r)},{name:"Sources",url:gt(t,r)}],ht=e=>{if(!e.values.some(({value:t})=>t===void 0))return e.values.map(({value:t})=>({name:t}))},_t=(e,t,r)=>({version:1.1,tags:e.components.map(s=>{const n=$t(t,r,s.filePath);return{name:s.tag,description:de(s),attributes:s.props.map(i=>({name:i.attr??i.name,description:K(i),values:ht(i),references:n})),references:n}}),globalAttributes:[],valueSets:[]}),yt=e=>({version:1.1,properties:e.components.flatMap(t=>t.styles.map(r=>({name:r.name,description:r.docs})))}),bt=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,mt=e=>{const t={value:"2023",pattern:"yyyy"},r={value:"12",pattern:"mm"},s={value:"24",pattern:"dd"};return $e([t.value,r.value,s.value].join("-"),e,{timeZone:"UTC"}).replace(t.value,t.pattern).replace(r.value,r.pattern).replace(s.value,s.pattern)},vt=(e,t,r)=>{const s=e.closest("[lang]"),n=Intl.NumberFormat.supportedLocalesOf(s?.lang),i=n.length>0&&typeof n[0]=="string"?n[0]:navigator.language||r,a=i.split("-").shift();return Object.keys(t).length===0?{locale:i,messages:{lang:r}}:{locale:i,messages:t[a]??t[r]??{lang:r}}},wt=(e,t,r)=>new Intl.NumberFormat(t,{style:"currency",currency:r}).format(e),St=(e,t,r=0)=>new Intl.NumberFormat(t,{minimumFractionDigits:r}).format(Number(e)),Et=(e,t,r=0)=>new Intl.NumberFormat(t,{style:"percent",minimumFractionDigits:r,maximumFractionDigits:r}).format(e),Ot=(e,t,r,s="short",n=0)=>new Intl.NumberFormat(t,{style:"unit",unit:r,unitDisplay:s,minimumFractionDigits:n,maximumFractionDigits:n}).format(e),$e=(e,t,r)=>typeof e!="string"||e===""||!bt.test(e)?"":new Intl.DateTimeFormat(t,r).format(new Date(e)),xt=(e,t)=>r=>vt(r,e,t);var I={updatable:!0,slotRelocation:!0,experimentalSlotFixes:!1},kt=Object.defineProperty,At=(e,t)=>{for(var r in t)kt(e,r,{get:t[r],enumerable:!0})},jt="http://www.w3.org/2000/svg",Tt="http://www.w3.org/1999/xhtml",he=(e,t)=>t in e,_e="http://www.w3.org/1999/xlink",O=typeof window<"u"?window:{},A={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,r,s)=>e.addEventListener(t,r,s),rel:(e,t,r,s)=>e.removeEventListener(t,r,s),ce:(e,t)=>new CustomEvent(e,t)},Rt=e=>e!=null&&e!==void 0,ye=e=>(e=typeof e,e==="object"||e==="function"),zt=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),It={};At(It,{err:()=>be,map:()=>Nt,ok:()=>X,unwrap:()=>Mt,unwrapErr:()=>Dt});var X=e=>({isOk:!0,isErr:!1,value:e}),be=e=>({isOk:!1,isErr:!0,value:e});function Nt(e,t){if(e.isOk){const r=t(e.value);return r instanceof Promise?r.then(s=>X(s)):X(r)}if(e.isErr){const r=e.value;return be(r)}throw"should never get here"}var Mt=e=>{if(e.isOk)return e.value;throw e.value},Dt=e=>{if(e.isErr)return e.value;throw e.value},me=e=>{const t=Se(e,"childNodes");e.tagName&&e.tagName.includes("-")&&e["s-cr"]&&e.tagName!=="SLOT-FB"&&ve(t,e.tagName).forEach(s=>{s.nodeType===1&&s.tagName==="SLOT-FB"&&(Ct(s,Y(s),!1).length?s.hidden=!0:s.hidden=!1)});let r=0;for(r=0;r<t.length;r++){const s=t[r];s.nodeType===1&&Se(s,"childNodes").length&&me(s)}},Lt=e=>{const t=[];for(let r=0;r<e.length;r++){const s=e[r]["s-nr"]||void 0;s&&s.isConnected&&t.push(s)}return t};function ve(e,t,r){let s=0,n=[],i;for(;s<e.length;s++)i=e[s],i["s-sr"]&&(!t||i["s-hn"]===t)&&r===void 0&&n.push(i),n=[...n,...ve(i.childNodes,t,r)];return n}var Ct=(e,t,r=!0)=>{const s=[];(r&&e["s-sr"]||!e["s-sr"])&&s.push(e);let n=e;for(;n=n.nextSibling;)Y(n)===t&&(r||!n["s-sr"])&&s.push(n);return s},we=(e,t)=>e.nodeType===1?e.getAttribute("slot")===null&&t===""||e.getAttribute("slot")===t:e["s-sn"]===t?!0:t==="",Y=e=>typeof e["s-sn"]=="string"?e["s-sn"]:e.nodeType===1&&e.getAttribute("slot")||void 0;function Ft(e){if(e.assignedElements||e.assignedNodes||!e["s-sr"])return;const t=r=>(function(s){const n=[],i=this["s-sn"];s?.flatten&&console.error(`
|
|
24
24
|
Flattening is not supported for Stencil non-shadow slots.
|
|
25
25
|
You can use \`.childNodes\` to nested slot fallback content.
|
|
26
26
|
If you have a particular use case, please open an issue on the Stencil repo.
|
|
27
|
-
`);const a=this["s-cr"].parentElement;return(a.__childNodes?a.childNodes:Jt(a.childNodes)).forEach(l=>{i===oe(l)&&n.push(l)}),r?n.filter(l=>l.nodeType===1):n}).bind(e);e.assignedElements=t(!0),e.assignedNodes=t(!1)}function Ne(e,t){if("__"+t in e){const r=e["__"+t];return typeof r!="function"?r:r.bind(e)}else return typeof e[t]!="function"?e[t]:e[t].bind(e)}var Yt=(e,t,...r)=>{let s=null,n=null,i=null,a=!1,c=!1;const l=[],g=o=>{for(let d=0;d<o.length;d++)s=o[d],Array.isArray(s)?g(s):s!=null&&typeof s!="boolean"&&((a=!ke(s))&&(s=String(s)),a&&c?l[l.length-1].$text$+=s:l.push(a?le(null,s):s),c=a)};g(r);const p=le(e,null);return p.$attrs$=t,l.length>0&&(p.$children$=l),p.$key$=n,p.$name$=i,p},le=(e,t)=>{const r={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null};return r.$attrs$=null,r.$key$=null,r.$name$=null,r},Qt={},Vt=e=>e&&e.$tag$===Qt,ce=e=>{const t=Zt(e);return new RegExp(`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${t}))(${t}\\b)`,"g")};ce("::slotted"),ce(":host"),ce(":host-context");var Ie=(e,t,r,s,n,i,a)=>{if(r===s)return;let c=Oe(e,t),l=t.toLowerCase();if(t==="class"){const g=e.classList,p=ze(r);let o=ze(s);g.remove(...p.filter(d=>d&&!o.includes(d))),g.add(...o.filter(d=>d&&!p.includes(d)))}else if(t==="style"){for(const g in r)(!s||s[g]==null)&&(g.includes("-")?e.style.removeProperty(g):e.style[g]="");for(const g in s)(!r||s[g]!==r[g])&&(g.includes("-")?e.style.setProperty(g,s[g]):e.style[g]=s[g])}else if(t!=="key")if(t==="ref")s&&s(e);else if(!e.__lookupSetter__(t)&&t[0]==="o"&&t[1]==="n"){if(t[2]==="-"?t=t.slice(3):Oe(T,l)?t=l.slice(2):t=l[2]+t.slice(3),r||s){const g=t.endsWith(Me);t=t.replace(tr,""),r&&z.rel(e,t,r,g),s&&z.ael(e,t,s,g)}}else{const g=ke(s);if((c||g&&s!==null)&&!n)try{if(e.tagName.includes("-"))e[t]!==s&&(e[t]=s);else{const o=s??"";t==="list"?c=!1:(r==null||e[t]!=o)&&(typeof e.__lookupSetter__(t)=="function"?e[t]=o:e.setAttribute(t,o))}}catch{}let p=!1;l!==(l=l.replace(/^xlink\:?/,""))&&(t=l,p=!0),s==null||s===!1?(s!==!1||e.getAttribute(t)==="")&&(p?e.removeAttributeNS(xe,t):e.removeAttribute(t)):(!c||i&4||n)&&!g&&e.nodeType===1&&(s=s===!0?"":s,p?e.setAttributeNS(xe,t,s):e.setAttribute(t,s))}},er=/\s/,ze=e=>(typeof e=="object"&&e&&"baseVal"in e&&(e=e.baseVal),!e||typeof e!="string"?[]:e.split(er)),Me="Capture",tr=new RegExp(Me+"$"),fe=(e,t,r,s)=>{const n=t.$elm$.nodeType===11&&t.$elm$.host?t.$elm$.host:t.$elm$,i=e&&e.$attrs$||{},a=t.$attrs$||{};for(const c of Le(Object.keys(i)))c in a||Ie(n,c,i[c],void 0,r,t.$flags$);for(const c of Le(Object.keys(a)))Ie(n,c,i[c],a[c],r,t.$flags$)};function Le(e){return e.includes("ref")?[...e.filter(t=>t!=="ref"),"ref"]:e}var J,K,W,ue=!1,X=!1,ge=!1,w=!1,Y=(e,t,r)=>{var s;const n=t.$children$[r];let i=0,a,c,l;if(ue||(ge=!0,n.$tag$==="slot"&&(n.$flags$|=n.$children$?2:1)),n.$text$!==null)a=n.$elm$=T.document.createTextNode(n.$text$);else if(n.$flags$&1)a=n.$elm$=T.document.createTextNode(""),fe(null,n,w);else{if(w||(w=n.$tag$==="svg"),!T.document)throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component.");if(a=n.$elm$=T.document.createElementNS(w?Wt:Ut,!ue&&q.slotRelocation&&n.$flags$&2?"slot-fb":n.$tag$),w&&n.$tag$==="foreignObject"&&(w=!1),fe(null,n,w),Dt(J)&&a["s-si"]!==J&&a.classList.add(a["s-si"]=J),n.$children$)for(i=0;i<n.$children$.length;++i)c=Y(e,n,i),c&&a.appendChild(c);n.$tag$==="svg"?w=!1:a.tagName==="foreignObject"&&(w=!0)}return a["s-hn"]=W,n.$flags$&3&&(a["s-sr"]=!0,a["s-cr"]=K,a["s-sn"]=n.$name$||"",a["s-rf"]=(s=n.$attrs$)==null?void 0:s.ref,Xt(a),l=e&&e.$children$&&e.$children$[r],l&&l.$tag$===n.$tag$&&e.$elm$&&U(e.$elm$,!1),Ue(K,a,t.$elm$,e==null?void 0:e.$elm$)),a},U=(e,t)=>{z.$flags$|=1;const r=Array.from(e.__childNodes||e.childNodes);e["s-sr"]&&q.experimentalSlotFixes;for(let s=r.length-1;s>=0;s--){const n=r[s];n["s-hn"]!==W&&n["s-ol"]&&(R(D(n).parentNode,n,D(n)),n["s-ol"].remove(),n["s-ol"]=void 0,n["s-sh"]=void 0,ge=!0),t&&U(n,t)}z.$flags$&=-2},Ce=(e,t,r,s,n,i)=>{let a=e["s-cr"]&&e["s-cr"].parentNode||e,c;for(a.shadowRoot&&a.tagName===W&&(a=a.shadowRoot);n<=i;++n)s[n]&&(c=Y(null,r,n),c&&(s[n].$elm$=c,R(a,c,D(t))))},Fe=(e,t,r)=>{for(let s=t;s<=r;++s){const n=e[s];if(n){const i=n.$elm$;We(n),i&&(X=!0,i["s-ol"]?i["s-ol"].remove():U(i,!0),i.remove())}}},rr=(e,t,r,s,n=!1)=>{let i=0,a=0,c=0,l=0,g=t.length-1,p=t[0],o=t[g],d=s.length-1,$=s[0],u=s[d],v,m;for(;i<=g&&a<=d;)if(p==null)p=t[++i];else if(o==null)o=t[--g];else if($==null)$=s[++a];else if(u==null)u=s[--d];else if(Q(p,$,n))M(p,$,n),p=t[++i],$=s[++a];else if(Q(o,u,n))M(o,u,n),o=t[--g],u=s[--d];else if(Q(p,u,n))(p.$tag$==="slot"||u.$tag$==="slot")&&U(p.$elm$.parentNode,!1),M(p,u,n),R(e,p.$elm$,o.$elm$.nextSibling),p=t[++i],u=s[--d];else if(Q(o,$,n))(p.$tag$==="slot"||u.$tag$==="slot")&&U(o.$elm$.parentNode,!1),M(o,$,n),R(e,o.$elm$,p.$elm$),o=t[--g],$=s[++a];else{for(c=-1,l=i;l<=g;++l)if(t[l]&&t[l].$key$!==null&&t[l].$key$===$.$key$){c=l;break}c>=0?(m=t[c],m.$tag$!==$.$tag$?v=Y(t&&t[a],r,c):(M(m,$,n),t[c]=void 0,v=m.$elm$),$=s[++a]):(v=Y(t&&t[a],r,a),$=s[++a]),v&&R(D(p.$elm$).parentNode,v,D(p.$elm$))}i>g?Ce(e,s[d+1]==null?null:s[d+1].$elm$,r,s,a,d):a>d&&Fe(t,i,g)},Q=(e,t,r=!1)=>e.$tag$===t.$tag$?e.$tag$==="slot"?e.$name$===t.$name$:r?(r&&!e.$key$&&t.$key$&&(e.$key$=t.$key$),!0):e.$key$===t.$key$:!1,D=e=>e&&e["s-ol"]||e,M=(e,t,r=!1)=>{const s=t.$elm$=e.$elm$,n=e.$children$,i=t.$children$,a=t.$tag$,c=t.$text$;let l;c===null?(w=a==="svg"?!0:a==="foreignObject"?!1:w,fe(e,t,w),n!==null&&i!==null?rr(s,n,t,i,r):i!==null?(e.$text$!==null&&(s.textContent=""),Ce(s,null,t,i,0,i.length-1)):!r&&q.updatable&&n!==null&&Fe(n,0,n.length-1),w&&a==="svg"&&(w=!1)):(l=s["s-cr"])?l.parentNode.textContent=c:e.$text$!==c&&(s.data=c)},x=[],Pe=e=>{let t,r,s;const n=e.__childNodes||e.childNodes;for(const i of n){if(i["s-sr"]&&(t=i["s-cr"])&&t.parentNode){r=t.parentNode.__childNodes||t.parentNode.childNodes;const a=i["s-sn"];for(s=r.length-1;s>=0;s--)if(t=r[s],!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==i["s-hn"])if(Re(t,a)){let c=x.find(l=>l.$nodeToRelocate$===t);X=!0,t["s-sn"]=t["s-sn"]||a,c?(c.$nodeToRelocate$["s-sh"]=i["s-hn"],c.$slotRefNode$=i):(t["s-sh"]=i["s-hn"],x.push({$slotRefNode$:i,$nodeToRelocate$:t})),t["s-sr"]&&x.map(l=>{Re(l.$nodeToRelocate$,t["s-sn"])&&(c=x.find(g=>g.$nodeToRelocate$===t),c&&!l.$slotRefNode$&&(l.$slotRefNode$=c.$slotRefNode$))})}else x.some(c=>c.$nodeToRelocate$===t)||x.push({$nodeToRelocate$:t})}i.nodeType===1&&Pe(i)}},We=e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map(We)},R=(e,t,r)=>(typeof t["s-sn"]=="string"&&t["s-sr"]&&t["s-cr"]&&Ue(t["s-cr"],t,e,t.parentElement),e==null?void 0:e.insertBefore(t,r));function Ue(e,t,r,s){var n,i;let a;if(e&&typeof t["s-sn"]=="string"&&t["s-sr"]&&e.parentNode&&e.parentNode["s-sc"]&&(a=t["s-si"]||e.parentNode["s-sc"])){const c=t["s-sn"],l=t["s-hn"];if((n=r.classList)==null||n.add(a+"-s"),s&&((i=s.classList)!=null&&i.contains(a+"-s"))){let g=(s.__childNodes||s.childNodes)[0],p=!1;for(;g;){if(g["s-sn"]!==c&&g["s-hn"]===l&&g["s-sr"]){p=!0;break}g=g.nextSibling}p||s.classList.remove(a+"-s")}}}var sr=(e,t,r=!1)=>{var s,n,i,a,c;const l=e.$hostElement$,g=e.$cmpMeta$,p=e.$vnode$||le(null,null),d=Vt(t)?t:Yt(null,null,t);if(W=l.tagName,g.$attrsToReflect$&&(d.$attrs$=d.$attrs$||{},g.$attrsToReflect$.map(([$,u])=>d.$attrs$[u]=l[$])),r&&d.$attrs$)for(const $ of Object.keys(d.$attrs$))l.hasAttribute($)&&!["key","ref","style","class"].includes($)&&(d.$attrs$[$]=l[$]);d.$tag$=null,d.$flags$|=4,e.$vnode$=d,d.$elm$=p.$elm$=l.shadowRoot||l,J=l["s-sc"],ue=!!(g.$flags$&1)&&!(g.$flags$&128),K=l["s-cr"],X=!1,M(p,d,r);{if(z.$flags$|=1,ge){Pe(d.$elm$);for(const $ of x){const u=$.$nodeToRelocate$;if(!u["s-ol"]&&T.document){const v=T.document.createTextNode("");v["s-nr"]=u,R(u.parentNode,u["s-ol"]=v,u)}}for(const $ of x){const u=$.$nodeToRelocate$,v=$.$slotRefNode$;if(v){const m=v.parentNode;let O=v.nextSibling;{let I=(s=u["s-ol"])==null?void 0:s.previousSibling;for(;I;){let y=(n=I["s-nr"])!=null?n:null;if(y&&y["s-sn"]===u["s-sn"]&&m===(y.__parentNode||y.parentNode)){for(y=y.nextSibling;y===u||y!=null&&y["s-sr"];)y=y==null?void 0:y.nextSibling;if(!y||!y["s-nr"]){O=y;break}}I=I.previousSibling}}const C=u.__parentNode||u.parentNode,Ye=u.__nextSibling||u.nextSibling;(!O&&m!==C||Ye!==O)&&u!==O&&(!u["s-hn"]&&u["s-ol"]&&(u["s-hn"]=u["s-ol"].parentNode.nodeName),R(m,u,O),u.nodeType===1&&u.tagName!=="SLOT-FB"&&(u.hidden=(i=u["s-ih"])!=null?i:!1)),u&&typeof v["s-rf"]=="function"&&v["s-rf"](v)}else u.nodeType===1&&(r&&(u["s-ih"]=(a=u.hidden)!=null?a:!1),u.hidden=!0)}}X&&je(d.$elm$),z.$flags$&=-2,x.length=0}if(q.experimentalScopedSlotChanges&&g.$flags$&2){const $=d.$elm$.__childNodes||d.$elm$.childNodes;for(const u of $)u["s-hn"]!==W&&!u["s-sh"]&&(r&&u["s-ih"]==null&&(u["s-ih"]=(c=u.hidden)!=null?c:!1),u.hidden=!0)}K=void 0};const pe={content_wrap:0,ignore:[],ignore_with:"_!i-£___£%_",strict:!1,tab_size:2,tag_wrap:0,tag_wrap_width:80,trim:[]},k="__!i-£___£%__",A="!i-£___£%_",De=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],Ze={checked_html:!1,config:{...pe},ignored:!1},Z=()=>Ze,H=e=>Object.assign(Ze,e),de=e=>(H({checked_html:!0}),/<(?:[A-Za-z]+[A-Za-z0-9]*)(?:\s+.*?)*?\/{0,1}>/.test(e)||/<(?<Element>(?:[A-Za-z]+[A-Za-z0-9]*:)?(?:[A-Za-z]+[A-Za-z0-9]*))(?:\s+.*?)*?>(?:.|\n)*?<\/{1}\k<Element>>/.test(e)||/<(?<Element>(?:[a-z][a-z0-9._]*:)?[a-z][a-z0-9._]*-[a-z0-9._-]+)(?:\s+.*?)*?>(?:.|\n)*?<\/{1}\k<Element>>/.test(e)),He=(e,t)=>{if(!e||!t)throw new Error("Both 'current' and 'updates' must be passed-in to mergeObjects()");let r;if(Array.isArray(e))r=structuredClone(e).concat(t);else if(typeof e=="object"){r={...e};for(let s of Object.keys(t))typeof t[s]!="object"?r[s]=t[s]:r[s]=He(r[s]||{},t[s])}return r},nr=(e,t)=>{const r=He(e,t);return H({config:r}),r},ir=e=>(e=e.replace(/<[\w:\-]+([^>]*[^\/])>/g,(t,r)=>t.replace(r,s=>s.replace(/\n/g,A+"nl!").replace(/\r/g,A+"cr!").replace(/\s/g,A+"ws!"))),e),ar=e=>e.replace(/\n/g,k+"nl!").replace(/\r/g,k+"cr!").replace(/\s/g,k+"ws!"),or=e=>{const t=/\s*<([a-zA-Z0-9:-]+)[^>]*>\n\s*<\/\1>(?=\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n)(\n[ ]*\S[^\n]*\n)|<([a-zA-Z0-9:-]+)[^>]*>(?=\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n)(\n[ ]*\S[^\n]*\n\s*)<\/\3>/g;return e.replace(t,(r,s,n,i,a)=>{const c=n||a;if(!c)return r;const l=c.replace(/\n/g,k+"nl!").replace(/\r/g,k+"cr!").replace(/\s/g,k+"ws!");return r.replace(c,l)})},lr=e=>{const t=/<([A-Za-z][A-Za-z0-9]*|[a-z][a-z0-9._]*-[a-z0-9._-]+)((?:\s+[A-Za-z0-9_-]+="[^"]*"|\s*[a-z]*)*)>/g;return e=e.replace(t,(r,s,n)=>r.replace(n,i=>i.replace(/</g,A+"lt!").replace(/>/g,A+"gt!"))),e},cr=(e,t)=>{for(let r=0;r<t.length;r++){const s=new RegExp(`(<${t[r]}[^>]*>)\\s+`,"g"),n=new RegExp(`\\s+(</${t[r]}>)`,"g");e=e.replace(s,"$1").replace(n,"$1")}return e},fr=e=>(e=e.replace(/<[\w:\-]+([^>]*[^\/])>/g,(t,r)=>t.replace(r,s=>s.replace(new RegExp(A+"nl!","g"),`
|
|
28
|
-
`).replace(new RegExp(
|
|
29
|
-
`).replace(new RegExp(
|
|
30
|
-
`);return
|
|
27
|
+
`);const a=this["s-cr"].parentElement;return(a.__childNodes?a.childNodes:Lt(a.childNodes)).forEach(l=>{i===Y(l)&&n.push(l)}),r?n.filter(l=>l.nodeType===1):n}).bind(e);e.assignedElements=t(!0),e.assignedNodes=t(!1)}function Se(e,t){if("__"+t in e){const r=e["__"+t];return typeof r!="function"?r:r.bind(e)}else return typeof e[t]!="function"?e[t]:e[t].bind(e)}var Pt=(e,t,...r)=>{let s=null,n=null,i=null,a=!1,c=!1;const l=[],u=o=>{for(let g=0;g<o.length;g++)s=o[g],Array.isArray(s)?u(s):s!=null&&typeof s!="boolean"&&((a=!ye(s))&&(s=String(s)),a&&c?l[l.length-1].$text$+=s:l.push(a?Q(null,s):s),c=a)};u(r);const p=Q(e,null);return p.$attrs$=t,l.length>0&&(p.$children$=l),p.$key$=n,p.$name$=i,p},Q=(e,t)=>{const r={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null};return r.$attrs$=null,r.$key$=null,r.$name$=null,r},Wt={},Ut=e=>e&&e.$tag$===Wt,V=e=>{const t=zt(e);return new RegExp(`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${t}))(${t}\\b)`,"g")};V("::slotted"),V(":host"),V(":host-context");var Ee=(e,t,r,s,n,i,a)=>{if(r===s)return;let c=he(e,t),l=t.toLowerCase();if(t==="class"){const u=e.classList,p=Oe(r);let o=Oe(s);u.remove(...p.filter(g=>g&&!o.includes(g))),u.add(...o.filter(g=>g&&!p.includes(g)))}else if(t==="style"){for(const u in r)(!s||s[u]==null)&&(u.includes("-")?e.style.removeProperty(u):e.style[u]="");for(const u in s)(!r||s[u]!==r[u])&&(u.includes("-")?e.style.setProperty(u,s[u]):e.style[u]=s[u])}else if(t!=="key")if(t==="ref")s&&s(e);else if(!e.__lookupSetter__(t)&&t[0]==="o"&&t[1]==="n"){if(t[2]==="-"?t=t.slice(3):he(O,l)?t=l.slice(2):t=l[2]+t.slice(3),r||s){const u=t.endsWith(xe);t=t.replace(Ht,""),r&&A.rel(e,t,r,u),s&&A.ael(e,t,s,u)}}else{const u=ye(s);if((c||u&&s!==null)&&!n)try{if(e.tagName.includes("-"))e[t]!==s&&(e[t]=s);else{const o=s??"";t==="list"?c=!1:(r==null||e[t]!=o)&&(typeof e.__lookupSetter__(t)=="function"?e[t]=o:e.setAttribute(t,o))}}catch{}let p=!1;l!==(l=l.replace(/^xlink\:?/,""))&&(t=l,p=!0),s==null||s===!1?(s!==!1||e.getAttribute(t)==="")&&(p?e.removeAttributeNS(_e,t):e.removeAttribute(t)):(!c||i&4||n)&&!u&&e.nodeType===1&&(s=s===!0?"":s,p?e.setAttributeNS(_e,t,s):e.setAttribute(t,s))}},Zt=/\s/,Oe=e=>(typeof e=="object"&&e&&"baseVal"in e&&(e=e.baseVal),!e||typeof e!="string"?[]:e.split(Zt)),xe="Capture",Ht=new RegExp(xe+"$"),ee=(e,t,r,s)=>{const n=t.$elm$.nodeType===11&&t.$elm$.host?t.$elm$.host:t.$elm$,i=e&&e.$attrs$||{},a=t.$attrs$||{};for(const c of ke(Object.keys(i)))c in a||Ee(n,c,i[c],void 0,r,t.$flags$);for(const c of ke(Object.keys(a)))Ee(n,c,i[c],a[c],r,t.$flags$)};function ke(e){return e.includes("ref")?[...e.filter(t=>t!=="ref"),"ref"]:e}var P,W,N,te=!1,U=!1,re=!1,b=!1,Z=(e,t,r)=>{var s;const n=t.$children$[r];let i=0,a,c,l;if(te||(re=!0,n.$tag$==="slot"&&(n.$flags$|=n.$children$?2:1)),n.$text$!==null)a=n.$elm$=O.document.createTextNode(n.$text$);else if(n.$flags$&1)a=n.$elm$=O.document.createTextNode(""),ee(null,n,b);else{if(b||(b=n.$tag$==="svg"),!O.document)throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component.");if(a=n.$elm$=O.document.createElementNS(b?jt:Tt,!te&&I.slotRelocation&&n.$flags$&2?"slot-fb":n.$tag$),b&&n.$tag$==="foreignObject"&&(b=!1),ee(null,n,b),Rt(P)&&a["s-si"]!==P&&a.classList.add(a["s-si"]=P),n.$children$)for(i=0;i<n.$children$.length;++i)c=Z(e,n,i),c&&a.appendChild(c);n.$tag$==="svg"?b=!1:a.tagName==="foreignObject"&&(b=!0)}return a["s-hn"]=N,n.$flags$&3&&(a["s-sr"]=!0,a["s-cr"]=W,a["s-sn"]=n.$name$||"",a["s-rf"]=(s=n.$attrs$)==null?void 0:s.ref,Ft(a),l=e&&e.$children$&&e.$children$[r],l&&l.$tag$===n.$tag$&&e.$elm$&&M(e.$elm$,!1),ze(W,a,t.$elm$,e?.$elm$)),a},M=(e,t)=>{A.$flags$|=1;const r=Array.from(e.__childNodes||e.childNodes);e["s-sr"]&&I.experimentalSlotFixes;for(let s=r.length-1;s>=0;s--){const n=r[s];n["s-hn"]!==N&&n["s-ol"]&&(x(D(n).parentNode,n,D(n)),n["s-ol"].remove(),n["s-ol"]=void 0,n["s-sh"]=void 0,re=!0),t&&M(n,t)}A.$flags$&=-2},Ae=(e,t,r,s,n,i)=>{let a=e["s-cr"]&&e["s-cr"].parentNode||e,c;for(a.shadowRoot&&a.tagName===N&&(a=a.shadowRoot);n<=i;++n)s[n]&&(c=Z(null,r,n),c&&(s[n].$elm$=c,x(a,c,D(t))))},je=(e,t,r)=>{for(let s=t;s<=r;++s){const n=e[s];if(n){const i=n.$elm$;Re(n),i&&(U=!0,i["s-ol"]?i["s-ol"].remove():M(i,!0),i.remove())}}},Bt=(e,t,r,s,n=!1)=>{let i=0,a=0,c=0,l=0,u=t.length-1,p=t[0],o=t[u],g=s.length-1,$=s[0],f=s[g],_,y;for(;i<=u&&a<=g;)if(p==null)p=t[++i];else if(o==null)o=t[--u];else if($==null)$=s[++a];else if(f==null)f=s[--g];else if(H(p,$,n))j(p,$,n),p=t[++i],$=s[++a];else if(H(o,f,n))j(o,f,n),o=t[--u],f=s[--g];else if(H(p,f,n))(p.$tag$==="slot"||f.$tag$==="slot")&&M(p.$elm$.parentNode,!1),j(p,f,n),x(e,p.$elm$,o.$elm$.nextSibling),p=t[++i],f=s[--g];else if(H(o,$,n))(p.$tag$==="slot"||f.$tag$==="slot")&&M(o.$elm$.parentNode,!1),j(o,$,n),x(e,o.$elm$,p.$elm$),o=t[--u],$=s[++a];else{for(c=-1,l=i;l<=u;++l)if(t[l]&&t[l].$key$!==null&&t[l].$key$===$.$key$){c=l;break}c>=0?(y=t[c],y.$tag$!==$.$tag$?_=Z(t&&t[a],r,c):(j(y,$,n),t[c]=void 0,_=y.$elm$),$=s[++a]):(_=Z(t&&t[a],r,a),$=s[++a]),_&&x(D(p.$elm$).parentNode,_,D(p.$elm$))}i>u?Ae(e,s[g+1]==null?null:s[g+1].$elm$,r,s,a,g):a>g&&je(t,i,u)},H=(e,t,r=!1)=>e.$tag$===t.$tag$?e.$tag$==="slot"?e.$name$===t.$name$:r?(r&&!e.$key$&&t.$key$&&(e.$key$=t.$key$),!0):e.$key$===t.$key$:!1,D=e=>e&&e["s-ol"]||e,j=(e,t,r=!1)=>{const s=t.$elm$=e.$elm$,n=e.$children$,i=t.$children$,a=t.$tag$,c=t.$text$;let l;c===null?(b=a==="svg"?!0:a==="foreignObject"?!1:b,ee(e,t,b),n!==null&&i!==null?Bt(s,n,t,i,r):i!==null?(e.$text$!==null&&(s.textContent=""),Ae(s,null,t,i,0,i.length-1)):!r&&I.updatable&&n!==null&&je(n,0,n.length-1),b&&a==="svg"&&(b=!1)):(l=s["s-cr"])?l.parentNode.textContent=c:e.$text$!==c&&(s.data=c)},v=[],Te=e=>{let t,r,s;const n=e.__childNodes||e.childNodes;for(const i of n){if(i["s-sr"]&&(t=i["s-cr"])&&t.parentNode){r=t.parentNode.__childNodes||t.parentNode.childNodes;const a=i["s-sn"];for(s=r.length-1;s>=0;s--)if(t=r[s],!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==i["s-hn"])if(we(t,a)){let c=v.find(l=>l.$nodeToRelocate$===t);U=!0,t["s-sn"]=t["s-sn"]||a,c?(c.$nodeToRelocate$["s-sh"]=i["s-hn"],c.$slotRefNode$=i):(t["s-sh"]=i["s-hn"],v.push({$slotRefNode$:i,$nodeToRelocate$:t})),t["s-sr"]&&v.map(l=>{we(l.$nodeToRelocate$,t["s-sn"])&&(c=v.find(u=>u.$nodeToRelocate$===t),c&&!l.$slotRefNode$&&(l.$slotRefNode$=c.$slotRefNode$))})}else v.some(c=>c.$nodeToRelocate$===t)||v.push({$nodeToRelocate$:t})}i.nodeType===1&&Te(i)}},Re=e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map(Re)},x=(e,t,r)=>(typeof t["s-sn"]=="string"&&t["s-sr"]&&t["s-cr"]&&ze(t["s-cr"],t,e,t.parentElement),e?.insertBefore(t,r));function ze(e,t,r,s){var n,i;let a;if(e&&typeof t["s-sn"]=="string"&&t["s-sr"]&&e.parentNode&&e.parentNode["s-sc"]&&(a=t["s-si"]||e.parentNode["s-sc"])){const c=t["s-sn"],l=t["s-hn"];if((n=r.classList)==null||n.add(a+"-s"),s&&((i=s.classList)!=null&&i.contains(a+"-s"))){let u=(s.__childNodes||s.childNodes)[0],p=!1;for(;u;){if(u["s-sn"]!==c&&u["s-hn"]===l&&u["s-sr"]){p=!0;break}u=u.nextSibling}p||s.classList.remove(a+"-s")}}}var Gt=(e,t,r=!1)=>{var s,n,i,a,c;const l=e.$hostElement$,u=e.$cmpMeta$,p=e.$vnode$||Q(null,null),g=Ut(t)?t:Pt(null,null,t);if(N=l.tagName,u.$attrsToReflect$&&(g.$attrs$=g.$attrs$||{},u.$attrsToReflect$.forEach(([$,f])=>{I.serializer&&e.$serializerValues$.has($)?g.$attrs$[f]=e.$serializerValues$.get($):g.$attrs$[f]=l[$]})),r&&g.$attrs$)for(const $ of Object.keys(g.$attrs$))l.hasAttribute($)&&!["key","ref","style","class"].includes($)&&(g.$attrs$[$]=l[$]);g.$tag$=null,g.$flags$|=4,e.$vnode$=g,g.$elm$=p.$elm$=l.shadowRoot||l,P=l["s-sc"],te=!!(u.$flags$&1)&&!(u.$flags$&128),W=l["s-cr"],U=!1,j(p,g,r);{if(A.$flags$|=1,re){Te(g.$elm$);for(const $ of v){const f=$.$nodeToRelocate$;if(!f["s-ol"]&&O.document){const _=O.document.createTextNode("");_["s-nr"]=f,x(f.parentNode,f["s-ol"]=_,f)}}for(const $ of v){const f=$.$nodeToRelocate$,_=$.$slotRefNode$;if(_){const y=_.parentNode;let E=_.nextSibling;{let k=(s=f["s-ol"])==null?void 0:s.previousSibling;for(;k;){let h=(n=k["s-nr"])!=null?n:null;if(h&&h["s-sn"]===f["s-sn"]&&y===(h.__parentNode||h.parentNode)){for(h=h.nextSibling;h===f||h?.["s-sr"];)h=h?.nextSibling;if(!h||!h["s-nr"]){E=h;break}}k=k.previousSibling}}const T=f.__parentNode||f.parentNode,Ue=f.__nextSibling||f.nextSibling;(!E&&y!==T||Ue!==E)&&f!==E&&(!f["s-hn"]&&f["s-ol"]&&(f["s-hn"]=f["s-ol"].parentNode.nodeName),x(y,f,E),f.nodeType===1&&f.tagName!=="SLOT-FB"&&(f.hidden=(i=f["s-ih"])!=null?i:!1)),f&&typeof _["s-rf"]=="function"&&_["s-rf"](_)}else f.nodeType===1&&(r&&(f["s-ih"]=(a=f.hidden)!=null?a:!1),f.hidden=!0)}}U&&me(g.$elm$),A.$flags$&=-2,v.length=0}if(I.experimentalScopedSlotChanges&&u.$flags$&2){const $=g.$elm$.__childNodes||g.$elm$.childNodes;for(const f of $)f["s-hn"]!==N&&!f["s-sh"]&&(r&&f["s-ih"]==null&&(f["s-ih"]=(c=f.hidden)!=null?c:!1),f.hidden=!0)}W=void 0};const se={content_wrap:0,ignore:[],ignore_with:"_!i-£___£%_",strict:!1,tab_size:2,tag_wrap:0,tag_wrap_width:80,trim:[]},w="__!i-£___£%__",S="!i-£___£%_",Ie=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],Ne={checked_html:!1,config:{...se},ignored:!1},L=()=>Ne,C=e=>Object.assign(Ne,e),ne=e=>(C({checked_html:!0}),/<(?:[A-Za-z]+[A-Za-z0-9]*)(?:\s+.*?)*?\/{0,1}>/.test(e)||/<(?<Element>(?:[A-Za-z]+[A-Za-z0-9]*:)?(?:[A-Za-z]+[A-Za-z0-9]*))(?:\s+.*?)*?>(?:.|\n)*?<\/{1}\k<Element>>/.test(e)||/<(?<Element>(?:[a-z][a-z0-9._]*:)?[a-z][a-z0-9._]*-[a-z0-9._-]+)(?:\s+.*?)*?>(?:.|\n)*?<\/{1}\k<Element>>/.test(e)),Me=(e,t)=>{if(!e||!t)throw new Error("Both 'current' and 'updates' must be passed-in to mergeObjects()");let r;if(Array.isArray(e))r=structuredClone(e).concat(t);else if(typeof e=="object"){r={...e};for(let s of Object.keys(t))typeof t[s]!="object"?r[s]=t[s]:r[s]=Me(r[s]||{},t[s])}return r},qt=(e,t)=>{const r=Me(e,t);return C({config:r}),r},Jt=e=>(e=e.replace(/<[\w:\-]+([^>]*[^\/])>/g,(t,r)=>t.replace(r,s=>s.replace(/\n/g,S+"nl!").replace(/\r/g,S+"cr!").replace(/\s/g,S+"ws!"))),e),Kt=e=>e.replace(/\n/g,w+"nl!").replace(/\r/g,w+"cr!").replace(/\s/g,w+"ws!"),Xt=e=>{const t=/\s*<([a-zA-Z0-9:-]+)[^>]*>\n\s*<\/\1>(?=\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n)(\n[ ]*\S[^\n]*\n)|<([a-zA-Z0-9:-]+)[^>]*>(?=\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n)(\n[ ]*\S[^\n]*\n\s*)<\/\3>/g;return e.replace(t,(r,s,n,i,a)=>{const c=n||a;if(!c)return r;const l=c.replace(/\n/g,w+"nl!").replace(/\r/g,w+"cr!").replace(/\s/g,w+"ws!");return r.replace(c,l)})},Yt=e=>{const t=/<([A-Za-z][A-Za-z0-9]*|[a-z][a-z0-9._]*-[a-z0-9._-]+)((?:\s+[A-Za-z0-9_-]+="[^"]*"|\s*[a-z]*)*)>/g;return e=e.replace(t,(r,s,n)=>r.replace(n,i=>i.replace(/</g,S+"lt!").replace(/>/g,S+"gt!"))),e},Qt=(e,t)=>{for(let r=0;r<t.length;r++){const s=new RegExp(`(<${t[r]}[^>]*>)\\s+`,"g"),n=new RegExp(`\\s+(</${t[r]}>)`,"g");e=e.replace(s,"$1").replace(n,"$1")}return e},Vt=e=>(e=e.replace(/<[\w:\-]+([^>]*[^\/])>/g,(t,r)=>t.replace(r,s=>s.replace(new RegExp(S+"nl!","g"),`
|
|
28
|
+
`).replace(new RegExp(S+"cr!","g"),"\r").replace(new RegExp(S+"ws!","g")," "))),e),er=e=>(e=e.replace(/.*__!i-£___£%__[a-z]{2}!.*/g,t=>t.replace(/__!i-£___£%__[a-z]{2}!/g,r=>r.replace(new RegExp(w+"nl!","g"),`
|
|
29
|
+
`).replace(new RegExp(w+"cr!","g"),"\r").replace(new RegExp(w+"ws!","g")," "))),e),De=S.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),tr=new RegExp(De+"lt!","g"),rr=new RegExp(De+"gt!","g"),sr=e=>{const t=/<([\w:\-]+)([^>]*)>/g;return e.replace(t,(r,s,n)=>{const i=n.replace(tr,"<").replace(rr,">");return`<${s}${i}>`})},nr=e=>{if(typeof e!="object")throw new Error("Config must be an object.");const t={...se};if(!(Object.hasOwn(e,"content_wrap")||Object.hasOwn(e,"ignore")||Object.hasOwn(e,"ignore_with")||Object.hasOwn(e,"strict")||Object.hasOwn(e,"tab_size")||Object.hasOwn(e,"tag_wrap")||Object.hasOwn(e,"tag_wrap_width")||Object.hasOwn(e,"trim")))return C({config:t}),t;let s=e.tab_size;if(s){if(typeof s!="number")throw new Error(`tab_size must be a number, not ${typeof e.tab_size}.`);if(!Number.isSafeInteger(s))throw new Error(`Tab size ${s} is not safe. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger for more info.`);if(s=Math.floor(s),s<1||s>16)throw new Error("Tab size out of range. Expecting 1 to 16.");e.tab_size=s}if(Object.hasOwn(e,"content_wrap")&&typeof e.content_wrap!="number")throw new Error(`content_wrap config must be a number, not ${typeof e.tag_wrap_width}.`);if(Object.hasOwn(e,"ignore")&&(!Array.isArray(e.ignore)||!e.ignore?.every(n=>typeof n=="string")))throw new Error("Ignore config must be an array of strings.");if(Object.hasOwn(e,"ignore_with")&&typeof e.ignore_with!="string")throw new Error(`Ignore_with config must be a string, not ${typeof e.ignore_with}.`);if(Object.hasOwn(e,"strict")&&typeof e.strict!="boolean")throw new Error(`Strict config must be a boolean, not ${typeof e.strict}.`);if(Object.hasOwn(e,"tag_wrap")&&typeof e.tag_wrap=="boolean"&&(console.warn("tag_wrap as a boolean is deprecated, and will not be supported in v0.9.0+. Use `tag_wrap: <number>` instead; where <number> is the max character width acceptable before wrapping attributes."),e.tag_wrap_width?e.tag_wrap=e.tag_wrap_width:e.tag_wrap=t.tag_wrap_width),Object.hasOwn(e,"tag_wrap")&&typeof e.tag_wrap!="number")throw new Error(`tag_wrap config must be a number, not ${typeof e.tag_wrap}.`);if(Object.hasOwn(e,"tag_wrap_width")&&console.warn("tag_wrap_width is deprecated, and will not be supported in v0.9.0+. Use `tag_wrap: <number>` instead; where <number> is the max character width acceptable before wrapping attributes."),Object.hasOwn(e,"tag_wrap_width")&&typeof e.tag_wrap_width!="number")throw new Error(`tag_wrap_width config must be a number, not ${typeof e.tag_wrap_width}.`);if(Object.hasOwn(e,"trim")&&(!Array.isArray(e.trim)||!e.trim?.every(n=>typeof n=="string")))throw new Error("Trim config must be an array of strings.");return qt(t,e)},ir=(e,t,r)=>{const s=e.trim().split(/\s+/);if(s.length===0||s.length===1&&s[0]==="")return"";const n=[];let i="";const a=r;s.forEach(l=>{if(l==="")return;if(l.length>=t){i!==""&&n.push(n.length===0?r+i:a+i),n.push(n.length===0?r+l:a+l),i="";return}const u=i===""?l:i+" "+l;u.length<=t?i=u:(i!==""&&n.push(n.length===0?r+i:a+i),i=l)}),i!==""&&n.push(n.length===0?r+i:a+i);const c=n.join(`
|
|
30
|
+
`);return Kt(c)};function Le(e,t){C({ignored:!0});let r=e;const s=new Map;let n=0;const i="___HTMLFY_SPECIAL_IGNORE_MARKER_";for(const a of t.ignore){const c=a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),l=new RegExp(`<${c}[^>]*>.*?</${c}>`,"gs");let u;const p=[];for(;(u=l.exec(r))!==null;){const o=`${i}${n++}___`;s.set(o,u[0]),p.push({start:u.index,end:l.lastIndex,marker:o})}for(let o=p.length-1;o>=0;o--){const g=p[o];r=r.substring(0,g.start)+g.marker+r.substring(g.end)}}return{html_with_markers:r,extracted_map:s}}function Ce(e,t){C({ignored:!1});let r=e;for(const[s,n]of t)r=r.split(s).join(n);return r}const ar=e=>{const{checked_html:t}=L();return!t&&!ne(e)?e:e.replace(/<([a-zA-Z\-0-9:]+)[^>]*>/g,(r,s)=>Ie.indexOf(s)>-1?`${r.substring(0,r.length-1)} />`.replace(/\/\s\//g,"/"):r.replace(/[\s]?\/>/g,`></${s}>`))},or=(e,t=!1)=>(e=e.replace(/<textarea[^>]*>((.|\n)*?)<\/textarea>/g,(r,s)=>r.replace(s,n=>n.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\n/g," ").replace(/\r/g," ").replace(/\s/g," "))),t&&(e=e.replace(/<textarea[^>]*>((.|\n)*?)<\/textarea>/g,(r,s)=>(r=r.replace(s,n=>n.replace(/\n|\t/g,"").replace(/[a-z]+="\s*"/ig,"").replace(/>\s+</g,"><").replace(/\s+/g," ")),r=r.replace(/\s+/g," ").replace(/\s>/g,">").replace(/>\s/g,">").replace(/\s</g,"<").replace(/class=["']\s/g,n=>n.replace(/\s/g,"")).replace(/(class=.*)\s(["'])/g,"$1$2"),r))),e);let Fe;const lr=(e,t)=>{let r=!1;const{checked_html:s,ignored:n}=L();if(!s&&!ne(e))return e;const i=L().config,a=i.ignore.length>0;if(!n&&a){const{html_with_markers:c,extracted_map:l}=Le(e,i);e=c,Fe=l,r=!0}return e=or(e),e=e.replace(/\n|\t/g,""),e=e.replace(/>\s+</g,"><"),e=e.replace(/ {2,}/g," "),e=e.replace(/ >/g,">"),e=e.replace(/ </g,"<"),e=e.replace(/> /g,">"),e=e.replace(/<\s*\//g,"</"),e=e.replace(/ = /g,"="),e=e.replace(/([a-zA-Z0-9_-]+)=(['"])(.*?)\2/g,(c,l,u,p)=>{const o=p.trim();return`${l}=${u}${o}${u}`}),e=e.trim(),r&&(e=Ce(e,Fe)),e},F={line:[]};let Pe;const cr=e=>{F.line=[];let t=-1;const r=/(<[^>]+>)|([^<]+)/g;return e=e.replace(r,(s,n,i)=>(n?F.line.push({type:"tag",value:s}):i&&i.trim().length>0&&F.line.push({type:"text",value:s}),t++,`
|
|
31
31
|
[#-# : ${t} : ${s} : #-#]
|
|
32
|
-
`)),e},
|
|
33
|
-
`;for(const
|
|
34
|
-
`}const
|
|
35
|
-
`);return r>0&&(o=
|
|
32
|
+
`)),e},fr=e=>{e=ar(e);const{config:t}=L();return t.trim.length>0&&(e=Qt(e,t.trim)),e=lr(e),e=cr(e),e},ur=e=>{const t=" ".repeat(e.tab_size),r=e.tag_wrap,s=e.content_wrap,i=`-${e.ignore_with}`,a=e.strict;let c="";const l=[],u=/<[A-Za-z]+\b[^>]*(?:.|\n)*?\/?>/g,p=/\s{1}[A-Za-z-]+(?:=".*?")?/g;F.line.forEach((g,$)=>{let f=g.value;const _=f.startsWith(i+"lt--")||f.startsWith(i+"gt--")||f.startsWith(i+"nl--")||f.startsWith(i+"cr--")||f.startsWith(i+"ws--")||f.startsWith(i+"tab--");let y=0;const E=F.line[$-1],T=E?.value??"";c+="0",$===0&&y++,f.trim().startsWith("</")&&y++,T.trim().startsWith("<!doctype")&&y++,T.trim().startsWith("<!--")&&y++,T.trim().endsWith("/>")&&y++,T.trim().startsWith("</")&&y++,E?.type==="text"&&y++;const k=Math.max(0,c.length-y);if(c=c.substring(0,k),g.type==="text"&&/^[!,;\.]/.test(f))if(f.length===1){l[l.length-1]=l.at(-1)+f;return}else l[l.length-1]=l.at(-1)+f.charAt(0),f=f.slice(1).trim();const h=t.repeat(k);if(_)l.push(f);else{if(a&&f.trim().startsWith("<!--"))return;let m=f;if(g.type==="text"&&s>0&&m.length>=s)m=ir(m,s,h);else if(r>0&&m.length>r&&u.test(m)){u.lastIndex=0,p.lastIndex=0;const B=m.split(p).filter(Boolean);if(B.length>=2){const Sr=m.matchAll(p),Er=h+t;let ae=h+B[0]+`
|
|
33
|
+
`;for(const jr of Sr){const Tr=jr[0].trim();ae+=Er+Tr+`
|
|
34
|
+
`}const Ze=B[0].match(/<([A-Za-z_:-]+)/),Or=Ze?Ze[1]:"",xr=Ie.includes(Or),kr=B[1].trim(),Ar=h+(a&&xr?" ":"");ae+=Ar+kr,m=ae}else m=h+m}else m=h+m;l.push(m)}});let o=l.join(`
|
|
35
|
+
`);return r>0&&(o=Jt(o)),s>0&&/\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n/.test(o)&&(o=Xt(o)),o=o.replace(/<(?<Element>.+).*>[^<]*?[^><\/\s][^<]*?<\/{1}\k<Element>|<script[^>]*>\s+<\/script>|<(\w+)>\s+<\/(\w+)|<(?:([\w:\._-]+)|([\w:\._-]+)[^>]*[^\/])>\s+<\/([\w:\._-]+)>/g,g=>g.replace(/\n|\t|\s{2,}/g,"")),s>0&&(o=er(o)),r>0&&(o=Vt(o)),a&&(o=o.replace(/\s\/>|\/>/g,">")),o.startsWith(`
|
|
36
36
|
`)&&(o=o.substring(1)),o.endsWith(`
|
|
37
|
-
`)&&(o=o.substring(0,o.length-1)),o},
|
|
37
|
+
`)&&(o=o.substring(0,o.length-1)),o},pr=(e,t)=>{let r=!1;const{checked_html:s,ignored:n}=L();if(!s&&!ne(e))return e;const i=t?nr(t):{...se},a=i.ignore.length>0;if(!n&&a){const{html_with_markers:c,extracted_map:l}=Le(e,i);e=c,Pe=l,r=!0}return e=Yt(e),e=fr(e),e=ur(i),e=sr(e),r&&(e=Ce(e,Pe)),e},gr=(e,t,r)=>{[null,void 0,"",!1].includes(r)||["innerHTML","style",""].includes(t)||e.setAttribute(t,["object","function"].includes(typeof r)?"⚠️ Property must be set through a script or a framework-specific syntax.":r)},We=(e,t,r,s,n)=>{if(t&&typeof t=="string"){const i=document.createElement(t);Object.keys(r||{}).forEach(a=>{gr(i,a,r[a])}),s?.forEach(a=>{We(i,a.$tag$,a.$attrs$,a.$children$,a.$text$)}),r?.innerHTML&&(i.innerHTML=r.innerHTML),e.appendChild(i)}n&&(e.innerHTML=n)},dr=(e,t,r=[])=>{const s={};if(typeof e!="object")throw new Error("filterArgs - args isn't an object.");for(const n in e)if(!r.includes(n)){const i=e[n],a=n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();(!t||!Object.keys(t).includes(n)||t[n]!==i)&&(s[a]=i)}return s},$r=(e,t)=>{const r=document.getElementById("storybook-root");if(r!==null)return document.querySelector("[lang]")?.setAttribute("lang",t.globals?.locale||"en"),Gt({$cmpMeta$:{$flags$:0,$tagName$:r.tagName},$hostElement$:r},e(t)),r.children[r.children.length-1]},hr=({$tag$:e,$attrs$:t,$children$:r,$text$:s})=>{const n=document.createElement("div");return We(n,e,t,r,s),pr(n.innerHTML,{tag_wrap:40,content_wrap:120}).replace(/="true"/g,"")},ie=(e,t)=>{if(!t)return;const r=t.split("/");return`${e}${r.slice(2,r.length-1).join("-")}--docs`};class _r{jsonDoc;constructor(t){this.jsonDoc=t}#e=t=>this.jsonDoc.components.find(r=>r.tag===t);#t=t=>{const r=t.type.replace(/"([^"]+)"/g,"$1").replace(/\s/g,"").replace(/\(.*?\)/g,s=>s.replace(/\|/g," OR ")).split("|").map(s=>s.trim().replace(/ OR /g,"|"));return t.type==="string"?{control:{type:"text"}}:t.type==="number"?{control:{type:"number"}}:t.type==="boolean"?{control:{type:"boolean"}}:t.type.startsWith("{")&&t.type.endsWith("}")?{control:{type:"object"}}:r.length>1?r.includes("string")?{control:{type:"text"}}:r.every(s=>s?.includes("[]"))?{control:{type:"object"}}:(r.unshift(void 0),{control:{type:"select"},options:r}):{control:{type:"object"}}};extractArgTypes=t=>{const r=this.#e(t),s=r?.props.reduce((p,o)=>{const{control:g,options:$}=this.#t(o);return{...p,[o.name]:{name:o.attr||o.name,description:o.docs,type:{required:o.required},table:{category:"props",type:{summary:o.type},defaultValue:{summary:o.default}},control:g,options:$}}},{}),n=r?.events.reduce((p,o)=>({...p,[o.event]:{name:o.event,description:o.docs,table:{category:"events",type:{summary:o.detail}}}}),{}),i=r?.methods.reduce((p,o)=>({...p,[o.name]:{name:o.name,description:o.docs,table:{category:"methods",type:{summary:o.signature}}}}),{}),a=r?.slots.reduce((p,o)=>({...p,[o.name]:{name:o.name!==""?o.name:"default",description:o.docs,table:{category:"slots",type:{summary:void 0}}}}),{}),c=r?.styles.reduce((p,o)=>({...p,[o.name]:{name:o.name,description:o.docs,table:{category:"custom properties",type:{summary:void 0}}}}),{}),l=r?.dependencies.reduce((p,o)=>{const g=this.#e(o);return g?{...p,[o]:{name:o,description:`<a href="./?path=/docs/${ie("",g?.filePath)}">View Component Documentation</a>`,table:{category:"depends on",type:{summary:void 0}}}}:p},{}),u=r?.dependents.reduce((p,o)=>{const g=this.#e(o);return g?{...p,[o]:{name:o,description:`<a href="./?path=/docs/${ie("",g?.filePath)}">View Component Documentation</a>`,table:{category:"used by",type:{summary:void 0}}}}:p},{});return{...s,...n,...i,...a,...c,...l,...u}};extractComponentDescription=t=>{const r=this.#e(t);return r?.readme||r?.docs}}const yr=({disconnect:e,observe:t,takeRecords:r})=>{class s{disconnect=e;observe=t;takeRecords=r;cb;constructor(i){this.cb=i}}return[window,global].forEach(n=>{Object.defineProperty(n,"MutationObserver",{writable:!0,configurable:!0,value:s})}),s},br=({disconnect:e,observe:t})=>{class r{disconnect=e;observe=t;unobserve;cb;constructor(n){this.cb=n}}return[window,global].forEach(s=>{Object.defineProperty(s,"ResizeObserver",{writable:!0,configurable:!0,value:r})}),r};class mr extends Event{detail}const vr=()=>{class e extends mr{}return[window,global].forEach(t=>{Object.defineProperty(t,"SubmitEvent",{writable:!0,configurable:!0,value:e})}),e},wr=e=>{const t=r=>(setTimeout(r,1),e(),0);return[window,global].forEach(r=>{Object.defineProperty(r,"requestAnimationFrame",{writable:!0,configurable:!0,value:t})}),t};d.ClassList=R,d.Cursor=Qe,d.Page=fe,d.Paginate=Ve,d.StorybookPreview=_r,d.allItemsAreString=He,d.cleanString=Ge,d.createID=Je,d.dateRegExp=et,d.dateToString=tt,d.defineLocales=xt,d.filterArgs=dr,d.focusableElements=st,d.formatID=Xe,d.getLocaleDatePattern=mt,d.getObjectValueFromKey=oe,d.getParentWindows=G,d.getStoryHTML=hr,d.getStorybookUrl=ie,d.getWindows=it,d.isObject=z,d.isTagName=rt,d.isValidNumber=nt,d.isValidString=le,d.isValideID=Ke,d.localeCurrency=wt,d.localeDate=$e,d.localeNumber=St,d.localePercent=Et,d.localeUnit=Ot,d.nextTick=Ye,d.setUpRequestAnimationFrameMock=wr,d.setupMutationObserverMock=yr,d.setupResizeObserverMock=br,d.setupSubmitEventMock=vr,d.stencilWrapper=$r,d.toString=Be,d.vsCodeCssGenerator=yt,d.vsCodeGenerator=_t,d.webTypesGenerator=dt,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
|
|
38
38
|
//# sourceMappingURL=index.umd.js.map
|