@mgdis/stencil-helpers 2.2.2 → 2.2.3
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 +312 -297
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +7 -7
- package/dist/index.umd.js.map +1 -1
- package/package.json +6 -6
package/dist/index.umd.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
(function(c,p){typeof exports=="object"&&typeof module<"u"?p(exports):typeof define=="function"&&define.amd?define(["exports"],p):(c=typeof globalThis<"u"?globalThis:c||self,p(c.StencilHelpersModule={}))})(this,function(c){"use strict";var ht=Object.defineProperty;var me=c=>{throw TypeError(c)};var yt=(c,p,m)=>p in c?ht(c,p,{enumerable:!0,configurable:!0,writable:!0,value:m}):c[p]=m;var y=(c,p,m)=>yt(c,typeof p!="symbol"?p+"":p,m),vt=(c,p,m)=>p.has(c)||me("Cannot "+m);var O=(c,p,m)=>(vt(c,p,"read from private field"),m?m.call(c):p.get(c)),Q=(c,p,m)=>p.has(c)?me("Cannot add the same private member more than once"):p instanceof WeakSet?p.add(c):p.set(c,m);var E,W;const p=(e="",t=10)=>{const s=new Uint8Array(t);crypto.getRandomValues(s);const r=Array.from(s).map(n=>n.toString(16).padStart(2,"0")).join("").slice(0,t);return e!==""?`${e}-${r}`:r},m=e=>J(e)&&/^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(e)!==null;class be{constructor(t=[]){y(this,"classes");y(this,"add",t=>{this.has(t)||this.classes.push(t)});y(this,"delete",t=>{const s=this.classes.indexOf(t);s>-1&&this.classes.splice(s,1)});y(this,"has",t=>this.classes.includes(t));y(this,"join",()=>this.classes.join(" "));this.classes=t}}const Se=e=>Array.isArray(e)&&e.every(t=>typeof t=="string"),Te=(e,t)=>t.includes(e==null?void 0:e.tagName.toLowerCase()),ke='a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button',Ae=e=>{const t=B(e),s=Z(e);return[e,...t,...s]},B=(e,t=[])=>{if(e.self!==e.top)try{const s=e.parent;return s?(t.push(s),B(s,t)):t}catch(s){return console.error("Different hosts between iframes:",s),t}return t},Z=(e,t=[])=>{if(e.frames.length>0)for(const s of Array.from(e.frames))t.push(s),Z(s,t);return t},J=e=>typeof e=="string"&&e.trim()!=="",Ee=e=>typeof e=="object"?JSON.stringify(e):`${e}`,je=e=>typeof e=="number"&&!Number.isNaN(e),Le=e=>typeof e=="string"?e.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g,""):e,Oe=async e=>e();var F={allRenderFn:!1,cmpDidLoad:!0,cmpDidUnload:!1,cmpDidUpdate:!0,cmpDidRender:!0,cmpWillLoad:!0,cmpWillUpdate:!0,cmpWillRender:!0,connectedCallback:!0,disconnectedCallback:!0,element:!0,event:!0,hasRenderFn:!0,lifecycle:!0,hostListener:!0,hostListenerTargetWindow:!0,hostListenerTargetDocument:!0,hostListenerTargetBody:!0,hostListenerTargetParent:!1,hostListenerTarget:!0,member:!0,method:!0,mode:!0,observeAttribute:!0,prop:!0,propMutable:!0,reflect:!0,scoped:!0,shadowDom:!0,slot:!0,cssAnnotations:!0,state:!0,style:!0,formAssociated:!1,svg:!0,updatable:!0,vdomAttribute:!0,vdomXlink:!0,vdomClass:!0,vdomFunctional:!0,vdomKey:!0,vdomListener:!0,vdomRef:!0,vdomPropOrAttr:!0,vdomRender:!0,vdomStyle:!0,vdomText:!0,watchCallback:!0,taskQueue:!0,hotModuleReplacement:!1,isDebug:!1,isDev:!1,isTesting:!1,hydrateServerSide:!1,hydrateClientSide:!1,lifecycleDOMEvents:!1,lazyLoad:!1,profile:!1,slotRelocation:!0,appendChildSlotFix:!1,cloneNodeFix:!1,hydratedAttribute:!1,hydratedClass:!0,scriptDataOpts:!1,scopedSlotTextContentFix:!1,shadowDomShim:!1,slotChildNodesFix:!1,invisiblePrehydration:!0,propBoolean:!0,propNumber:!0,propString:!0,constructableCSS:!0,cmpShouldUpdate:!0,devTools:!1,shadowDelegatesFocus:!0,initializeNextTick:!1,asyncLoading:!0,asyncQueue:!1,transformTagName:!1,attachStyles:!0,experimentalSlotFixes:!1},_e=Object.defineProperty,Me=(e,t)=>{for(var s in t)_e(e,s,{get:t[s],enumerable:!0})},Re="http://www.w3.org/2000/svg",Ne="http://www.w3.org/1999/xhtml",Y=(e,t)=>t in e,V="http://www.w3.org/1999/xlink",z=typeof window<"u"?window:{},x=z.document||{head:{}};z.HTMLElement;var j={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,s,r)=>e.addEventListener(t,s,r),rel:(e,t,s,r)=>e.removeEventListener(t,s,r),ce:(e,t)=>new CustomEvent(e,t)},Fe=e=>e!=null&&e!==void 0,ee=e=>(e=typeof e,e==="object"||e==="function"),xe={};Me(xe,{err:()=>te,map:()=>De,ok:()=>I,unwrap:()=>Ce,unwrapErr:()=>we});var I=e=>({isOk:!0,isErr:!1,value:e}),te=e=>({isOk:!1,isErr:!0,value:e});function De(e,t){if(e.isOk){const s=t(e.value);return s instanceof Promise?s.then(r=>I(r)):I(s)}if(e.isErr){const s=e.value;return te(s)}throw"should never get here"}var Ce=e=>{if(e.isOk)return e.value;throw e.value},we=e=>{if(e.isErr)return e.value;throw e.value},se=e=>{const t=e.__childNodes||e.childNodes;e.tagName&&e.tagName.includes("-")&&e["s-cr"]&&e.tagName!=="SLOT-FB"&&re(t,e.tagName).forEach(s=>{var r;s.nodeType===1&&s.tagName==="SLOT-FB"&&((r=Ue(s,s["s-sn"],!1))!=null&&r.length?s.hidden=!0:s.hidden=!1)});for(const s of t)s.nodeType===1&&(s.__childNodes||s.childNodes).length&&se(s)},re=(e,t,s)=>{let r=0,n=[],l;for(;r<e.length;r++)l=e[r],l["s-sr"]&&l["s-hn"]===t&&n.push(l),n=[...n,...re(l.childNodes,t)];return n},Ue=(e,t,s=!0)=>{const r=[];for((s&&e["s-sr"]||!e["s-sr"])&&r.push(e);(e=e.nextSibling)&&e["s-sn"]===t;)r.push(e);return r},ne=(e,t)=>e.nodeType===1?e.getAttribute("slot")===null&&t===""||e.getAttribute("slot")===t:e["s-sn"]===t?!0:t==="",Pe=(e,t,...s)=>{let r=null,n=null,l=null,i=!1,d=!1;const a=[],g=o=>{for(let $=0;$<o.length;$++)r=o[$],Array.isArray(r)?g(r):r!=null&&typeof r!="boolean"&&((i=!ee(r))&&(r=String(r)),i&&d?a[a.length-1].$text$+=r:a.push(i?G(null,r):r),d=i)};g(s);const u=G(e,null);return u.$attrs$=t,a.length>0&&(u.$children$=a),u.$key$=n,u.$name$=l,u},G=(e,t)=>{const s={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null};return s.$attrs$=null,s.$key$=null,s.$name$=null,s},He={},We=e=>e&&e.$tag$===He,ie=(e,t,s,r,n,l)=>{if(s!==r){let i=Y(e,t),d=t.toLowerCase();if(t==="class"){const a=e.classList,g=le(s);let u=le(r);e["s-si"]?(u.push(e["s-si"]),g.forEach(o=>{o.startsWith(e["s-si"])&&u.push(o)}),u=[...new Set(u)],a.add(...u),delete e["s-si"]):(a.remove(...g.filter(o=>o&&!u.includes(o))),a.add(...u.filter(o=>o&&!g.includes(o))))}else if(t==="style"){for(const a in s)(!r||r[a]==null)&&(a.includes("-")?e.style.removeProperty(a):e.style[a]="");for(const a in r)(!s||r[a]!==s[a])&&(a.includes("-")?e.style.setProperty(a,r[a]):e.style[a]=r[a])}else if(t!=="key")if(t==="ref")r&&r(e);else if(!e.__lookupSetter__(t)&&t[0]==="o"&&t[1]==="n"){if(t[2]==="-"?t=t.slice(3):Y(z,d)?t=d.slice(2):t=d[2]+t.slice(3),s||r){const a=t.endsWith(oe);t=t.replace(Be,""),s&&j.rel(e,t,s,a),r&&j.ael(e,t,r,a)}}else{const a=ee(r);if((i||a&&r!==null)&&!n)try{if(e.tagName.includes("-"))e[t]=r;else{const u=r??"";t==="list"?i=!1:(s==null||e[t]!=u)&&(typeof e.__lookupSetter__(t)=="function"?e[t]=u:e.setAttribute(t,u))}}catch{}let g=!1;d!==(d=d.replace(/^xlink\:?/,""))&&(t=d,g=!0),r==null||r===!1?(r!==!1||e.getAttribute(t)==="")&&(g?e.removeAttributeNS(V,t):e.removeAttribute(t)):(!i||l&4||n)&&!a&&(r=r===!0?"":r,g?e.setAttributeNS(V,t,r):e.setAttribute(t,r))}}},qe=/\s/,le=e=>(typeof e=="object"&&"baseVal"in e&&(e=e.baseVal),e?e.split(qe):[]),oe="Capture",Be=new RegExp(oe+"$"),ae=(e,t,s)=>{const r=t.$elm$.nodeType===11&&t.$elm$.host?t.$elm$.host:t.$elm$,n=e&&e.$attrs$||{},l=t.$attrs$||{};for(const i of ce(Object.keys(n)))i in l||ie(r,i,n[i],void 0,s,t.$flags$);for(const i of ce(Object.keys(l)))ie(r,i,n[i],l[i],s,t.$flags$)};function ce(e){return e.includes("ref")?[...e.filter(t=>t!=="ref"),"ref"]:e}var D,C,_,w=!1,U=!1,X=!1,b=!1,P=(e,t,s)=>{var r;const n=t.$children$[s];let l=0,i,d,a;if(w||(X=!0,n.$tag$==="slot"&&(n.$flags$|=n.$children$?2:1)),n.$text$!==null)i=n.$elm$=x.createTextNode(n.$text$);else if(n.$flags$&1)i=n.$elm$=x.createTextNode("");else{if(b||(b=n.$tag$==="svg"),i=n.$elm$=x.createElementNS(b?Re:Ne,!w&&F.slotRelocation&&n.$flags$&2?"slot-fb":n.$tag$),b&&n.$tag$==="foreignObject"&&(b=!1),ae(null,n,b),Fe(D)&&i["s-si"]!==D&&i.classList.add(i["s-si"]=D),n.$children$)for(l=0;l<n.$children$.length;++l)d=P(e,n,l),d&&i.appendChild(d);n.$tag$==="svg"?b=!1:i.tagName==="foreignObject"&&(b=!0)}return i["s-hn"]=_,n.$flags$&3&&(i["s-sr"]=!0,i["s-cr"]=C,i["s-sn"]=n.$name$||"",i["s-rf"]=(r=n.$attrs$)==null?void 0:r.ref,a=e&&e.$children$&&e.$children$[s],a&&a.$tag$===n.$tag$&&e.$elm$&&M(e.$elm$,!1),ge(C,i,t.$elm$,e==null?void 0:e.$elm$)),i},M=(e,t)=>{j.$flags$|=1;const s=Array.from(e.__childNodes||e.childNodes);e["s-sr"]&&F.experimentalSlotFixes;for(let r=s.length-1;r>=0;r--){const n=s[r];n["s-hn"]!==_&&n["s-ol"]&&(A(R(n).parentNode,n,R(n)),n["s-ol"].remove(),n["s-ol"]=void 0,n["s-sh"]=void 0,X=!0),t&&M(n,t)}j.$flags$&=-2},fe=(e,t,s,r,n,l)=>{let i=e["s-cr"]&&e["s-cr"].parentNode||e,d;for(i.shadowRoot&&i.tagName===_&&(i=i.shadowRoot);n<=l;++n)r[n]&&(d=P(null,s,n),d&&(r[n].$elm$=d,A(i,d,R(t))))},ue=(e,t,s)=>{for(let r=t;r<=s;++r){const n=e[r];if(n){const l=n.$elm$;$e(n),l&&(U=!0,l["s-ol"]?l["s-ol"].remove():M(l,!0),l.remove())}}},ze=(e,t,s,r,n=!1)=>{let l=0,i=0,d=0,a=0,g=t.length-1,u=t[0],o=t[g],$=r.length-1,f=r[0],h=r[$],k,S;for(;l<=g&&i<=$;)if(u==null)u=t[++l];else if(o==null)o=t[--g];else if(f==null)f=r[++i];else if(h==null)h=r[--$];else if(H(u,f,n))L(u,f,n),u=t[++l],f=r[++i];else if(H(o,h,n))L(o,h,n),o=t[--g],h=r[--$];else if(H(u,h,n))(u.$tag$==="slot"||h.$tag$==="slot")&&M(u.$elm$.parentNode,!1),L(u,h,n),A(e,u.$elm$,o.$elm$.nextSibling),u=t[++l],h=r[--$];else if(H(o,f,n))(u.$tag$==="slot"||h.$tag$==="slot")&&M(o.$elm$.parentNode,!1),L(o,f,n),A(e,o.$elm$,u.$elm$),o=t[--g],f=r[++i];else{for(d=-1,a=l;a<=g;++a)if(t[a]&&t[a].$key$!==null&&t[a].$key$===f.$key$){d=a;break}d>=0?(S=t[d],S.$tag$!==f.$tag$?k=P(t&&t[i],s,d):(L(S,f,n),t[d]=void 0,k=S.$elm$),f=r[++i]):(k=P(t&&t[i],s,i),f=r[++i]),k&&A(R(u.$elm$).parentNode,k,R(u.$elm$))}l>g?fe(e,r[$+1]==null?null:r[$+1].$elm$,s,r,i,$):i>$&&ue(t,l,g)},H=(e,t,s=!1)=>e.$tag$===t.$tag$?e.$tag$==="slot"?e.$name$===t.$name$:s?(s&&!e.$key$&&t.$key$&&(e.$key$=t.$key$),!0):e.$key$===t.$key$:!1,R=e=>e&&e["s-ol"]||e,L=(e,t,s=!1)=>{const r=t.$elm$=e.$elm$,n=e.$children$,l=t.$children$,i=t.$tag$,d=t.$text$;let a;d===null?(b=i==="svg"?!0:i==="foreignObject"?!1:b,i==="slot"&&!w||ae(e,t,b),n!==null&&l!==null?ze(r,n,t,l,s):l!==null?(e.$text$!==null&&(r.textContent=""),fe(r,null,t,l,0,l.length-1)):!s&&F.updatable&&n!==null&&ue(n,0,n.length-1),b&&i==="svg"&&(b=!1)):(a=r["s-cr"])?a.parentNode.textContent=d:e.$text$!==d&&(r.data=d)},T=[],de=e=>{let t,s,r;const n=e.__childNodes||e.childNodes;for(const l of n){if(l["s-sr"]&&(t=l["s-cr"])&&t.parentNode){s=t.parentNode.__childNodes||t.parentNode.childNodes;const i=l["s-sn"];for(r=s.length-1;r>=0;r--)if(t=s[r],!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==l["s-hn"])if(ne(t,i)){let d=T.find(a=>a.$nodeToRelocate$===t);U=!0,t["s-sn"]=t["s-sn"]||i,d?(d.$nodeToRelocate$["s-sh"]=l["s-hn"],d.$slotRefNode$=l):(t["s-sh"]=l["s-hn"],T.push({$slotRefNode$:l,$nodeToRelocate$:t})),t["s-sr"]&&T.map(a=>{ne(a.$nodeToRelocate$,t["s-sn"])&&(d=T.find(g=>g.$nodeToRelocate$===t),d&&!a.$slotRefNode$&&(a.$slotRefNode$=d.$slotRefNode$))})}else T.some(d=>d.$nodeToRelocate$===t)||T.push({$nodeToRelocate$:t})}l.nodeType===1&&de(l)}},$e=e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map($e)},A=(e,t,s)=>(typeof t["s-sn"]=="string"&&t["s-sr"]&&t["s-cr"]&&ge(t["s-cr"],t,e,t.parentElement),e==null?void 0:e.insertBefore(t,s));function ge(e,t,s,r){var n;let l;if(e&&typeof t["s-sn"]=="string"&&t["s-sr"]&&e.parentNode&&e.parentNode["s-sc"]&&(l=t["s-si"]||e.parentNode["s-sc"])){const i=t["s-sn"],d=t["s-hn"];if((n=s.classList)==null||n.add(l+"-s"),r&&r.classList.contains(l+"-s")){let a=(r.__childNodes||r.childNodes)[0],g=!1;for(;a;){if(a["s-sn"]!==i&&a["s-hn"]===d&&a["s-sr"]){g=!0;break}a=a.nextSibling}g||r.classList.remove(l+"-s")}}}var Ie=(e,t,s=!1)=>{var r,n,l,i,d;const a=e.$hostElement$,g=e.$cmpMeta$,u=e.$vnode$||G(null,null),o=We(t)?t:Pe(null,null,t);if(_=a.tagName,g.$attrsToReflect$&&(o.$attrs$=o.$attrs$||{},g.$attrsToReflect$.map(([$,f])=>o.$attrs$[f]=a[$])),s&&o.$attrs$)for(const $ of Object.keys(o.$attrs$))a.hasAttribute($)&&!["key","ref","style","class"].includes($)&&(o.$attrs$[$]=a[$]);o.$tag$=null,o.$flags$|=4,e.$vnode$=o,o.$elm$=u.$elm$=a.shadowRoot||a,D=a["s-sc"],w=(g.$flags$&1)!==0,C=a["s-cr"],U=!1,L(u,o,s);{if(j.$flags$|=1,X){de(o.$elm$);for(const $ of T){const f=$.$nodeToRelocate$;if(!f["s-ol"]){const h=x.createTextNode("");h["s-nr"]=f,A(f.parentNode,f["s-ol"]=h,f)}}for(const $ of T){const f=$.$nodeToRelocate$,h=$.$slotRefNode$;if(h){const k=h.parentNode;let S=h.nextSibling;{let q=(r=f["s-ol"])==null?void 0:r.previousSibling;for(;q;){let v=(n=q["s-nr"])!=null?n:null;if(v&&v["s-sn"]===f["s-sn"]&&k===v.parentNode){for(v=v.nextSibling;v===f||v!=null&&v["s-sr"];)v=v==null?void 0:v.nextSibling;if(!v||!v["s-nr"]){S=v;break}}q=q.previousSibling}}(!S&&k!==f.parentNode||f.nextSibling!==S)&&f!==S&&(!f["s-hn"]&&f["s-ol"]&&(f["s-hn"]=f["s-ol"].parentNode.nodeName),A(k,f,S),f.nodeType===1&&f.tagName!=="SLOT-FB"&&(f.hidden=(l=f["s-ih"])!=null?l:!1)),f&&typeof h["s-rf"]=="function"&&h["s-rf"](f)}else f.nodeType===1&&(s&&(f["s-ih"]=(i=f.hidden)!=null?i:!1),f.hidden=!0)}}U&&se(o.$elm$),j.$flags$&=-2,T.length=0}if(F.experimentalScopedSlotChanges&&g.$flags$&2){const $=o.$elm$.__childNodes||o.$elm$.childNodes;for(const f of $)f["s-hn"]!==_&&!f["s-sh"]&&(s&&f["s-ih"]==null&&(f["s-ih"]=(d=f.hidden)!=null?d:!1),f.hidden=!0)}C=void 0};const Ge=(e,t,s)=>{[null,void 0,"",!1].includes(s)||["innerHTML","style"].includes(t)||e.setAttribute(t,["object","function"].includes(typeof s)?"/!\\ Object props are not rendered in the code example":s)},pe=(e,t,s,r,n)=>{if(t&&typeof t=="string"){const l=document.createElement(t);Object.keys(s||{}).forEach(i=>{Ge(l,i,s[i])}),r==null||r.forEach(i=>{pe(l,i.$tag$,i.$attrs$,i.$children$,i.$text$)}),s!=null&&s.innerHTML&&(l.innerHTML=s.innerHTML),e.appendChild(l)}n&&(e.innerHTML=n)},Xe=(e,t)=>{const s={};if(typeof e!="object")throw new Error("filterArgs - args isn't an object.");for(const r in e)if(!r.startsWith("slot")){const n=e[r],l=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();(!t||!Object.keys(t).includes(r)||t[r]!==n)&&(s[l]=n)}return s},Ke=(e,t)=>{var r,n;const s=document.getElementById("storybook-root");if(s!==null)return(n=document.querySelector("[lang]"))==null||n.setAttribute("lang",((r=t.globals)==null?void 0:r.locale)||"en"),Ie({$ancestorComponent$:void 0,$flags$:0,$modeName$:void 0,$cmpMeta$:{$flags$:0,$tagName$:s.tagName},$hostElement$:s},e(t)),s.children[s.children.length-1]},Qe=({$tag$:e,$attrs$:t,$children$:s,$text$:r})=>{const n=document.createElement("div");return pe(n,e,t,s,r),n.innerHTML},N=(e,t)=>{if(!t)return;const s=t.split("/");return`${e}${s.slice(2,s.length-1).join("-")}--docs`};class Ze{constructor(t){y(this,"jsonDoc");Q(this,E,t=>this.jsonDoc.components.find(s=>s.tag===t));Q(this,W,t=>{const s=t.type.replace(/"([^"]+)"/g,"$1").replace(/\s/g,"").replace(/\(.*?\)/g,r=>r.replace(/\|/g," OR ")).split("|").map(r=>r.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"}}:s.length>1?s.includes("string")?{control:{type:"text"}}:s.every(r=>r==null?void 0:r.includes("[]"))?{control:{type:"object"}}:(s.unshift(void 0),{control:{type:"select"},options:s}):{control:{type:"object"}}});y(this,"extractArgTypes",t=>{const s=O(this,E).call(this,t),r=s==null?void 0:s.props.reduce((u,o)=>{const{control:$,options:f}=O(this,W).call(this,o);return{...u,[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:$,options:f}}},{}),n=s==null?void 0:s.events.reduce((u,o)=>({...u,[o.event]:{name:o.event,description:o.docs,table:{category:"events",type:{summary:o.detail}}}}),{}),l=s==null?void 0:s.methods.reduce((u,o)=>({...u,[o.name]:{name:o.name,description:o.docs,table:{category:"methods",type:{summary:o.signature}}}}),{}),i=s==null?void 0:s.slots.reduce((u,o)=>({...u,[o.name]:{name:o.name!==""?o.name:"default",description:o.docs,table:{category:"slots",type:{summary:void 0}}}}),{}),d=s==null?void 0:s.styles.reduce((u,o)=>({...u,[o.name]:{name:o.name,description:o.docs,table:{category:"custom properties",type:{summary:void 0}}}}),{}),a=s==null?void 0:s.dependencies.reduce((u,o)=>{const $=O(this,E).call(this,o);return{...u,[o]:{name:o,description:`<a href="./?path=/docs/${N("",$==null?void 0:$.filePath)}">View Component Documentation</a>`,table:{category:"depends on",type:{summary:void 0}}}}},{}),g=s==null?void 0:s.dependents.reduce((u,o)=>{const $=O(this,E).call(this,o);return{...u,[o]:{name:o,description:`<a href="./?path=/docs/${N("",$==null?void 0:$.filePath)}">View Component Documentation</a>`,table:{category:"used by",type:{summary:void 0}}}}},{});return{...r,...n,...l,...i,...d,...a,...g}});y(this,"extractComponentDescription",t=>{const s=O(this,E).call(this,t);return(s==null?void 0:s.readme)||(s==null?void 0:s.docs)});this.jsonDoc=t}}E=new WeakMap,W=new WeakMap;const Je=(e,t)=>{if(t)return`${e}${t}`},he=e=>{let t=e.overview?`${e.overview}
|
|
1
|
+
(function(a,p){typeof exports=="object"&&typeof module<"u"?p(exports):typeof define=="function"&&define.amd?define(["exports"],p):(a=typeof globalThis<"u"?globalThis:a||self,p(a.StencilHelpersModule={}))})(this,function(a){"use strict";var vt=Object.defineProperty;var me=a=>{throw TypeError(a)};var mt=(a,p,m)=>p in a?vt(a,p,{enumerable:!0,configurable:!0,writable:!0,value:m}):a[p]=m;var y=(a,p,m)=>mt(a,typeof p!="symbol"?p+"":p,m),bt=(a,p,m)=>p.has(a)||me("Cannot "+m);var L=(a,p,m)=>(bt(a,p,"read from private field"),m?m.call(a):p.get(a)),Q=(a,p,m)=>p.has(a)?me("Cannot add the same private member more than once"):p instanceof WeakSet?p.add(a):p.set(a,m);var E,W;const p=(e="",t=10)=>{const s=new Uint8Array(t);crypto.getRandomValues(s);const r=Array.from(s).map(n=>n.toString(16).padStart(2,"0")).join("").slice(0,t);return e!==""?`${e}-${r}`:r},m=e=>J(e)&&/^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(e)!==null;class be{constructor(t=[]){y(this,"classes");y(this,"add",t=>{this.has(t)||this.classes.push(t)});y(this,"delete",t=>{const s=this.classes.indexOf(t);s>-1&&this.classes.splice(s,1)});y(this,"has",t=>this.classes.includes(t));y(this,"join",()=>this.classes.join(" "));this.classes=t}}const Se=e=>Array.isArray(e)&&e.every(t=>typeof t=="string"),Te=(e,t)=>t.includes(e==null?void 0:e.tagName.toLowerCase()),ke='a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button',Ae=e=>{const t=B(e),s=Z(e);return[e,...t,...s]},B=(e,t=[])=>{if(e.self!==e.top)try{const s=e.parent;return s?(t.push(s),B(s,t)):t}catch(s){return console.error("Different hosts between iframes:",s),t}return t},Z=(e,t=[])=>{if(e.frames.length>0)for(const s of Array.from(e.frames))t.push(s),Z(s,t);return t},J=e=>typeof e=="string"&&e.trim()!=="",Ee=e=>typeof e=="object"?JSON.stringify(e):`${e}`,_e=e=>typeof e=="number"&&!Number.isNaN(e),je=e=>typeof e=="string"?e.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g,""):e,Le=async e=>e();var N={allRenderFn:!1,cmpDidLoad:!0,cmpDidUnload:!1,cmpDidUpdate:!0,cmpDidRender:!0,cmpWillLoad:!0,cmpWillUpdate:!0,cmpWillRender:!0,connectedCallback:!0,disconnectedCallback:!0,element:!0,event:!0,hasRenderFn:!0,lifecycle:!0,hostListener:!0,hostListenerTargetWindow:!0,hostListenerTargetDocument:!0,hostListenerTargetBody:!0,hostListenerTargetParent:!1,hostListenerTarget:!0,member:!0,method:!0,mode:!0,observeAttribute:!0,prop:!0,propMutable:!0,reflect:!0,scoped:!0,shadowDom:!0,slot:!0,cssAnnotations:!0,state:!0,style:!0,formAssociated:!1,svg:!0,updatable:!0,vdomAttribute:!0,vdomXlink:!0,vdomClass:!0,vdomFunctional:!0,vdomKey:!0,vdomListener:!0,vdomRef:!0,vdomPropOrAttr:!0,vdomRender:!0,vdomStyle:!0,vdomText:!0,watchCallback:!0,taskQueue:!0,hotModuleReplacement:!1,isDebug:!1,isDev:!1,isTesting:!1,hydrateServerSide:!1,hydrateClientSide:!1,lifecycleDOMEvents:!1,lazyLoad:!1,profile:!1,slotRelocation:!0,appendChildSlotFix:!1,cloneNodeFix:!1,hydratedAttribute:!1,hydratedClass:!0,scriptDataOpts:!1,scopedSlotTextContentFix:!1,shadowDomShim:!1,slotChildNodesFix:!1,invisiblePrehydration:!0,propBoolean:!0,propNumber:!0,propString:!0,constructableCSS:!0,cmpShouldUpdate:!0,devTools:!1,shadowDelegatesFocus:!0,initializeNextTick:!1,asyncLoading:!0,asyncQueue:!1,transformTagName:!1,attachStyles:!0,experimentalSlotFixes:!1},Oe=Object.defineProperty,Re=(e,t)=>{for(var s in t)Oe(e,s,{get:t[s],enumerable:!0})},Me="http://www.w3.org/2000/svg",Fe="http://www.w3.org/1999/xhtml",Y=(e,t)=>t in e,V="http://www.w3.org/1999/xlink",z=typeof window<"u"?window:{},x=z.document||{head:{}};z.HTMLElement;var _={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,s,r)=>e.addEventListener(t,s,r),rel:(e,t,s,r)=>e.removeEventListener(t,s,r),ce:(e,t)=>new CustomEvent(e,t)},Ne=e=>e!=null&&e!==void 0,ee=e=>(e=typeof e,e==="object"||e==="function"),xe={};Re(xe,{err:()=>te,map:()=>De,ok:()=>I,unwrap:()=>Ce,unwrapErr:()=>Ue});var I=e=>({isOk:!0,isErr:!1,value:e}),te=e=>({isOk:!1,isErr:!0,value:e});function De(e,t){if(e.isOk){const s=t(e.value);return s instanceof Promise?s.then(r=>I(r)):I(s)}if(e.isErr){const s=e.value;return te(s)}throw"should never get here"}var Ce=e=>{if(e.isOk)return e.value;throw e.value},Ue=e=>{if(e.isErr)return e.value;throw e.value},se=e=>{const t=e.__childNodes||e.childNodes;e.tagName&&e.tagName.includes("-")&&e["s-cr"]&&e.tagName!=="SLOT-FB"&&re(t,e.tagName).forEach(s=>{var r;s.nodeType===1&&s.tagName==="SLOT-FB"&&((r=we(s,s["s-sn"],!1))!=null&&r.length?s.hidden=!0:s.hidden=!1)});for(const s of t)s.nodeType===1&&(s.__childNodes||s.childNodes).length&&se(s)};function re(e,t,s){let r=0,n=[],i;for(;r<e.length;r++)i=e[r],i["s-sr"]&&i["s-hn"]===t&&s===void 0&&n.push(i),n=[...n,...re(i.childNodes,t,s)];return n}var we=(e,t,s=!0)=>{const r=[];for((s&&e["s-sr"]||!e["s-sr"])&&r.push(e);(e=e.nextSibling)&&e["s-sn"]===t;)r.push(e);return r},ne=(e,t)=>e.nodeType===1?e.getAttribute("slot")===null&&t===""||e.getAttribute("slot")===t:e["s-sn"]===t?!0:t==="",Pe=(e,t,...s)=>{let r=null,n=null,i=null,l=!1,u=!1;const f=[],d=o=>{for(let g=0;g<o.length;g++)r=o[g],Array.isArray(r)?d(r):r!=null&&typeof r!="boolean"&&((l=!ee(r))&&(r=String(r)),l&&u?f[f.length-1].$text$+=r:f.push(l?G(null,r):r),u=l)};d(s);const $=G(e,null);return $.$attrs$=t,f.length>0&&($.$children$=f),$.$key$=n,$.$name$=i,$},G=(e,t)=>{const s={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null};return s.$attrs$=null,s.$key$=null,s.$name$=null,s},He={},We=e=>e&&e.$tag$===He,ie=(e,t,s,r,n,i,l)=>{if(s!==r){let u=Y(e,t),f=t.toLowerCase();if(t==="class"){const d=e.classList,$=le(s);let o=le(r);d.remove(...$.filter(g=>g&&!o.includes(g))),d.add(...o.filter(g=>g&&!$.includes(g)))}else if(t==="style"){for(const d in s)(!r||r[d]==null)&&(d.includes("-")?e.style.removeProperty(d):e.style[d]="");for(const d in r)(!s||r[d]!==s[d])&&(d.includes("-")?e.style.setProperty(d,r[d]):e.style[d]=r[d])}else if(t!=="key")if(t==="ref")r&&r(e);else if(!e.__lookupSetter__(t)&&t[0]==="o"&&t[1]==="n"){if(t[2]==="-"?t=t.slice(3):Y(z,f)?t=f.slice(2):t=f[2]+t.slice(3),s||r){const d=t.endsWith(oe);t=t.replace(Be,""),s&&_.rel(e,t,s,d),r&&_.ael(e,t,r,d)}}else{const d=ee(r);if((u||d&&r!==null)&&!n)try{if(e.tagName.includes("-"))e[t]!==r&&(e[t]=r);else{const o=r??"";t==="list"?u=!1:(s==null||e[t]!=o)&&(typeof e.__lookupSetter__(t)=="function"?e[t]=o:e.setAttribute(t,o))}}catch{}let $=!1;f!==(f=f.replace(/^xlink\:?/,""))&&(t=f,$=!0),r==null||r===!1?(r!==!1||e.getAttribute(t)==="")&&($?e.removeAttributeNS(V,t):e.removeAttribute(t)):(!u||i&4||n)&&!d&&(r=r===!0?"":r,$?e.setAttributeNS(V,t,r):e.setAttribute(t,r))}}},qe=/\s/,le=e=>(typeof e=="object"&&e&&"baseVal"in e&&(e=e.baseVal),!e||typeof e!="string"?[]:e.split(qe)),oe="Capture",Be=new RegExp(oe+"$"),ae=(e,t,s,r)=>{const n=t.$elm$.nodeType===11&&t.$elm$.host?t.$elm$.host:t.$elm$,i=e&&e.$attrs$||{},l=t.$attrs$||{};for(const u of ce(Object.keys(i)))u in l||ie(n,u,i[u],void 0,s,t.$flags$);for(const u of ce(Object.keys(l)))ie(n,u,i[u],l[u],s,t.$flags$)};function ce(e){return e.includes("ref")?[...e.filter(t=>t!=="ref"),"ref"]:e}var D,C,O,U=!1,w=!1,X=!1,b=!1,P=(e,t,s)=>{var r;const n=t.$children$[s];let i=0,l,u,f;if(U||(X=!0,n.$tag$==="slot"&&(n.$flags$|=n.$children$?2:1)),n.$text$!==null)l=n.$elm$=x.createTextNode(n.$text$);else if(n.$flags$&1)l=n.$elm$=x.createTextNode("");else{if(b||(b=n.$tag$==="svg"),l=n.$elm$=x.createElementNS(b?Me:Fe,!U&&N.slotRelocation&&n.$flags$&2?"slot-fb":n.$tag$),b&&n.$tag$==="foreignObject"&&(b=!1),ae(null,n,b),Ne(D)&&l["s-si"]!==D&&l.classList.add(l["s-si"]=D),n.$children$)for(i=0;i<n.$children$.length;++i)u=P(e,n,i),u&&l.appendChild(u);n.$tag$==="svg"?b=!1:l.tagName==="foreignObject"&&(b=!0)}return l["s-hn"]=O,n.$flags$&3&&(l["s-sr"]=!0,l["s-cr"]=C,l["s-sn"]=n.$name$||"",l["s-rf"]=(r=n.$attrs$)==null?void 0:r.ref,f=e&&e.$children$&&e.$children$[s],f&&f.$tag$===n.$tag$&&e.$elm$&&R(e.$elm$,!1),ge(C,l,t.$elm$,e==null?void 0:e.$elm$)),l},R=(e,t)=>{_.$flags$|=1;const s=Array.from(e.__childNodes||e.childNodes);e["s-sr"]&&N.experimentalSlotFixes;for(let r=s.length-1;r>=0;r--){const n=s[r];n["s-hn"]!==O&&n["s-ol"]&&(A(M(n).parentNode,n,M(n)),n["s-ol"].remove(),n["s-ol"]=void 0,n["s-sh"]=void 0,X=!0),t&&R(n,t)}_.$flags$&=-2},fe=(e,t,s,r,n,i)=>{let l=e["s-cr"]&&e["s-cr"].parentNode||e,u;for(l.shadowRoot&&l.tagName===O&&(l=l.shadowRoot);n<=i;++n)r[n]&&(u=P(null,s,n),u&&(r[n].$elm$=u,A(l,u,M(t))))},ue=(e,t,s)=>{for(let r=t;r<=s;++r){const n=e[r];if(n){const i=n.$elm$;$e(n),i&&(w=!0,i["s-ol"]?i["s-ol"].remove():R(i,!0),i.remove())}}},ze=(e,t,s,r,n=!1)=>{let i=0,l=0,u=0,f=0,d=t.length-1,$=t[0],o=t[d],g=r.length-1,c=r[0],h=r[g],k,S;for(;i<=d&&l<=g;)if($==null)$=t[++i];else if(o==null)o=t[--d];else if(c==null)c=r[++l];else if(h==null)h=r[--g];else if(H($,c,n))j($,c,n),$=t[++i],c=r[++l];else if(H(o,h,n))j(o,h,n),o=t[--d],h=r[--g];else if(H($,h,n))($.$tag$==="slot"||h.$tag$==="slot")&&R($.$elm$.parentNode,!1),j($,h,n),A(e,$.$elm$,o.$elm$.nextSibling),$=t[++i],h=r[--g];else if(H(o,c,n))($.$tag$==="slot"||h.$tag$==="slot")&&R(o.$elm$.parentNode,!1),j(o,c,n),A(e,o.$elm$,$.$elm$),o=t[--d],c=r[++l];else{for(u=-1,f=i;f<=d;++f)if(t[f]&&t[f].$key$!==null&&t[f].$key$===c.$key$){u=f;break}u>=0?(S=t[u],S.$tag$!==c.$tag$?k=P(t&&t[l],s,u):(j(S,c,n),t[u]=void 0,k=S.$elm$),c=r[++l]):(k=P(t&&t[l],s,l),c=r[++l]),k&&A(M($.$elm$).parentNode,k,M($.$elm$))}i>d?fe(e,r[g+1]==null?null:r[g+1].$elm$,s,r,l,g):l>g&&ue(t,i,d)},H=(e,t,s=!1)=>e.$tag$===t.$tag$?e.$tag$==="slot"?e.$name$===t.$name$:s?(s&&!e.$key$&&t.$key$&&(e.$key$=t.$key$),!0):e.$key$===t.$key$:!1,M=e=>e&&e["s-ol"]||e,j=(e,t,s=!1)=>{const r=t.$elm$=e.$elm$,n=e.$children$,i=t.$children$,l=t.$tag$,u=t.$text$;let f;u===null?(b=l==="svg"?!0:l==="foreignObject"?!1:b,l==="slot"&&!U||ae(e,t,b),n!==null&&i!==null?ze(r,n,t,i,s):i!==null?(e.$text$!==null&&(r.textContent=""),fe(r,null,t,i,0,i.length-1)):!s&&N.updatable&&n!==null&&ue(n,0,n.length-1),b&&l==="svg"&&(b=!1)):(f=r["s-cr"])?f.parentNode.textContent=u:e.$text$!==u&&(r.data=u)},T=[],de=e=>{let t,s,r;const n=e.__childNodes||e.childNodes;for(const i of n){if(i["s-sr"]&&(t=i["s-cr"])&&t.parentNode){s=t.parentNode.__childNodes||t.parentNode.childNodes;const l=i["s-sn"];for(r=s.length-1;r>=0;r--)if(t=s[r],!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==i["s-hn"])if(ne(t,l)){let u=T.find(f=>f.$nodeToRelocate$===t);w=!0,t["s-sn"]=t["s-sn"]||l,u?(u.$nodeToRelocate$["s-sh"]=i["s-hn"],u.$slotRefNode$=i):(t["s-sh"]=i["s-hn"],T.push({$slotRefNode$:i,$nodeToRelocate$:t})),t["s-sr"]&&T.map(f=>{ne(f.$nodeToRelocate$,t["s-sn"])&&(u=T.find(d=>d.$nodeToRelocate$===t),u&&!f.$slotRefNode$&&(f.$slotRefNode$=u.$slotRefNode$))})}else T.some(u=>u.$nodeToRelocate$===t)||T.push({$nodeToRelocate$:t})}i.nodeType===1&&de(i)}},$e=e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map($e)},A=(e,t,s)=>(typeof t["s-sn"]=="string"&&t["s-sr"]&&t["s-cr"]&&ge(t["s-cr"],t,e,t.parentElement),e==null?void 0:e.insertBefore(t,s));function ge(e,t,s,r){var n;let i;if(e&&typeof t["s-sn"]=="string"&&t["s-sr"]&&e.parentNode&&e.parentNode["s-sc"]&&(i=t["s-si"]||e.parentNode["s-sc"])){const l=t["s-sn"],u=t["s-hn"];if((n=s.classList)==null||n.add(i+"-s"),r&&r.classList.contains(i+"-s")){let f=(r.__childNodes||r.childNodes)[0],d=!1;for(;f;){if(f["s-sn"]!==l&&f["s-hn"]===u&&f["s-sr"]){d=!0;break}f=f.nextSibling}d||r.classList.remove(i+"-s")}}}var Ie=(e,t,s=!1)=>{var r,n,i,l,u;const f=e.$hostElement$,d=e.$cmpMeta$,$=e.$vnode$||G(null,null),o=We(t)?t:Pe(null,null,t);if(O=f.tagName,d.$attrsToReflect$&&(o.$attrs$=o.$attrs$||{},d.$attrsToReflect$.map(([g,c])=>o.$attrs$[c]=f[g])),s&&o.$attrs$)for(const g of Object.keys(o.$attrs$))f.hasAttribute(g)&&!["key","ref","style","class"].includes(g)&&(o.$attrs$[g]=f[g]);o.$tag$=null,o.$flags$|=4,e.$vnode$=o,o.$elm$=$.$elm$=f.shadowRoot||f,D=f["s-sc"],U=(d.$flags$&1)!==0,C=f["s-cr"],w=!1,j($,o,s);{if(_.$flags$|=1,X){de(o.$elm$);for(const g of T){const c=g.$nodeToRelocate$;if(!c["s-ol"]){const h=x.createTextNode("");h["s-nr"]=c,A(c.parentNode,c["s-ol"]=h,c)}}for(const g of T){const c=g.$nodeToRelocate$,h=g.$slotRefNode$;if(h){const k=h.parentNode;let S=h.nextSibling;{let q=(r=c["s-ol"])==null?void 0:r.previousSibling;for(;q;){let v=(n=q["s-nr"])!=null?n:null;if(v&&v["s-sn"]===c["s-sn"]&&k===(v.__parentNode||v.parentNode)){for(v=v.nextSibling;v===c||v!=null&&v["s-sr"];)v=v==null?void 0:v.nextSibling;if(!v||!v["s-nr"]){S=v;break}}q=q.previousSibling}}const ht=c.__parentNode||c.parentNode,yt=c.__nextSibling||c.nextSibling;(!S&&k!==ht||yt!==S)&&c!==S&&(!c["s-hn"]&&c["s-ol"]&&(c["s-hn"]=c["s-ol"].parentNode.nodeName),A(k,c,S),c.nodeType===1&&c.tagName!=="SLOT-FB"&&(c.hidden=(i=c["s-ih"])!=null?i:!1)),c&&typeof h["s-rf"]=="function"&&h["s-rf"](c)}else c.nodeType===1&&(s&&(c["s-ih"]=(l=c.hidden)!=null?l:!1),c.hidden=!0)}}w&&se(o.$elm$),_.$flags$&=-2,T.length=0}if(N.experimentalScopedSlotChanges&&d.$flags$&2){const g=o.$elm$.__childNodes||o.$elm$.childNodes;for(const c of g)c["s-hn"]!==O&&!c["s-sh"]&&(s&&c["s-ih"]==null&&(c["s-ih"]=(u=c.hidden)!=null?u:!1),c.hidden=!0)}C=void 0};const Ge=(e,t,s)=>{[null,void 0,"",!1].includes(s)||["innerHTML","style"].includes(t)||e.setAttribute(t,["object","function"].includes(typeof s)?"/!\\ Object props are not rendered in the code example":s)},pe=(e,t,s,r,n)=>{if(t&&typeof t=="string"){const i=document.createElement(t);Object.keys(s||{}).forEach(l=>{Ge(i,l,s[l])}),r==null||r.forEach(l=>{pe(i,l.$tag$,l.$attrs$,l.$children$,l.$text$)}),s!=null&&s.innerHTML&&(i.innerHTML=s.innerHTML),e.appendChild(i)}n&&(e.innerHTML=n)},Xe=(e,t)=>{const s={};if(typeof e!="object")throw new Error("filterArgs - args isn't an object.");for(const r in e)if(!r.startsWith("slot")){const n=e[r],i=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();(!t||!Object.keys(t).includes(r)||t[r]!==n)&&(s[i]=n)}return s},Ke=(e,t)=>{var r,n;const s=document.getElementById("storybook-root");if(s!==null)return(n=document.querySelector("[lang]"))==null||n.setAttribute("lang",((r=t.globals)==null?void 0:r.locale)||"en"),Ie({$ancestorComponent$:void 0,$flags$:0,$modeName$:void 0,$cmpMeta$:{$flags$:0,$tagName$:s.tagName},$hostElement$:s},e(t)),s.children[s.children.length-1]},Qe=({$tag$:e,$attrs$:t,$children$:s,$text$:r})=>{const n=document.createElement("div");return pe(n,e,t,s,r),n.innerHTML},F=(e,t)=>{if(!t)return;const s=t.split("/");return`${e}${s.slice(2,s.length-1).join("-")}--docs`};class Ze{constructor(t){y(this,"jsonDoc");Q(this,E,t=>this.jsonDoc.components.find(s=>s.tag===t));Q(this,W,t=>{const s=t.type.replace(/"([^"]+)"/g,"$1").replace(/\s/g,"").replace(/\(.*?\)/g,r=>r.replace(/\|/g," OR ")).split("|").map(r=>r.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"}}:s.length>1?s.includes("string")?{control:{type:"text"}}:s.every(r=>r==null?void 0:r.includes("[]"))?{control:{type:"object"}}:(s.unshift(void 0),{control:{type:"select"},options:s}):{control:{type:"object"}}});y(this,"extractArgTypes",t=>{const s=L(this,E).call(this,t),r=s==null?void 0:s.props.reduce(($,o)=>{const{control:g,options:c}=L(this,W).call(this,o);return{...$,[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:c}}},{}),n=s==null?void 0:s.events.reduce(($,o)=>({...$,[o.event]:{name:o.event,description:o.docs,table:{category:"events",type:{summary:o.detail}}}}),{}),i=s==null?void 0:s.methods.reduce(($,o)=>({...$,[o.name]:{name:o.name,description:o.docs,table:{category:"methods",type:{summary:o.signature}}}}),{}),l=s==null?void 0:s.slots.reduce(($,o)=>({...$,[o.name]:{name:o.name!==""?o.name:"default",description:o.docs,table:{category:"slots",type:{summary:void 0}}}}),{}),u=s==null?void 0:s.styles.reduce(($,o)=>({...$,[o.name]:{name:o.name,description:o.docs,table:{category:"custom properties",type:{summary:void 0}}}}),{}),f=s==null?void 0:s.dependencies.reduce(($,o)=>{const g=L(this,E).call(this,o);return{...$,[o]:{name:o,description:`<a href="./?path=/docs/${F("",g==null?void 0:g.filePath)}">View Component Documentation</a>`,table:{category:"depends on",type:{summary:void 0}}}}},{}),d=s==null?void 0:s.dependents.reduce(($,o)=>{const g=L(this,E).call(this,o);return{...$,[o]:{name:o,description:`<a href="./?path=/docs/${F("",g==null?void 0:g.filePath)}">View Component Documentation</a>`,table:{category:"used by",type:{summary:void 0}}}}},{});return{...r,...n,...i,...l,...u,...f,...d}});y(this,"extractComponentDescription",t=>{const s=L(this,E).call(this,t);return(s==null?void 0:s.readme)||(s==null?void 0:s.docs)});this.jsonDoc=t}}E=new WeakMap,W=new WeakMap;const Je=(e,t)=>{if(t)return`${e}${t}`},he=e=>{let t=e.overview?`${e.overview}
|
|
2
2
|
|
|
3
3
|
`:"";const s=e.props.filter(({attr:n})=>n!==void 0);s.length&&(t+=`Attributes:
|
|
4
|
-
`,t+=s.map(({attr:n,docs:
|
|
4
|
+
`,t+=s.map(({attr:n,docs:i})=>`- \`${n}\`: ${i}
|
|
5
5
|
`).join(""),t+=`
|
|
6
6
|
`);const r=e.props.filter(({attr:n})=>n===void 0);return r.length&&(t+=`Properties:
|
|
7
|
-
`,t+=r.map(({name:n,docs:
|
|
7
|
+
`,t+=r.map(({name:n,docs:i})=>`- \`${n}\`: ${i}
|
|
8
8
|
`).join(""),t+=`
|
|
9
9
|
`),e.methods.length&&(t+=`Methods:
|
|
10
|
-
`,t+=e.methods.map(({name:n,docs:
|
|
10
|
+
`,t+=e.methods.map(({name:n,docs:i})=>`- \`${n}\`: ${i}
|
|
11
11
|
`).join(""),t+=`
|
|
12
12
|
`),e.events.length&&(t+=`Events:
|
|
13
|
-
`,t+=e.events.map(({event:n,docs:
|
|
13
|
+
`,t+=e.events.map(({event:n,docs:i})=>`- \`${n}\`: ${i}
|
|
14
14
|
`).join(""),t+=`
|
|
15
15
|
`),e.listeners.length&&(t+=`Listeners:
|
|
16
16
|
`,t+=e.listeners.map(({event:n})=>`- \`${n}\`
|
|
17
17
|
`).join(""),t+=`
|
|
18
18
|
`),e.slots.length&&(t+=`Slots:
|
|
19
|
-
`,t+=e.slots.map(({name:n,docs:
|
|
19
|
+
`,t+=e.slots.map(({name:n,docs:i})=>`- \`${n}\`: ${i}
|
|
20
20
|
`).join(""),t+=`
|
|
21
21
|
`),t},K=e=>`${e.docs}
|
|
22
22
|
|
|
23
|
-
Type: \`${e.type}\``,Ye=(e,t,s,r)=>({$schema:"https://json.schemastore.org/web-types",name:e,version:t,"description-markup":"markdown",contributions:{html:{elements:s.components.map(n=>{const
|
|
23
|
+
Type: \`${e.type}\``,Ye=(e,t,s,r)=>({$schema:"https://json.schemastore.org/web-types",name:e,version:t,"description-markup":"markdown",contributions:{html:{elements:s.components.map(n=>{const i=F(r,n.filePath);return{name:n.tag,description:he(n),"doc-url":i,attributes:n.props.filter(l=>l.attr).map(l=>({name:l.attr,description:K(l),"doc-url":i,value:{type:l.type,default:l.default,required:l.required}})),js:{properties:n.props.map(l=>({name:l.name,description:K(l),"doc-url":i,value:{type:l.type,default:l.default,required:l.required}})),events:n.events.map(l=>({name:l.event,description:l.docs}))},css:{properties:n.styles.map(l=>({name:l.name,description:l.docs}))}}})}}}),Ve=(e,t,s)=>[{name:"Storybook",url:F(e,s)},{name:"Sources",url:Je(t,s)}],et=e=>{if(!e.values.some(({value:t})=>t===void 0))return e.values.map(({value:t})=>({name:t}))},tt=(e,t,s)=>({version:1.1,tags:e.components.map(r=>{const n=Ve(t,s,r.filePath);return{name:r.tag,description:he(r),attributes:r.props.map(i=>({name:i.attr||i.name,description:K(i),values:et(i),references:n})),references:n}}),globalAttributes:[],valueSets:[]}),st=e=>({version:1.1,properties:e.components.flatMap(t=>t.styles.map(s=>({name:s.name,description:s.docs})))}),rt=e=>{const t={value:"2023",pattern:"yyyy"},s={value:"12",pattern:"mm"},r={value:"24",pattern:"dd"};return ve([t.value,s.value,r.value].join("-"),e,{timeZone:"UTC"}).replace(t.value,t.pattern).replace(s.value,s.pattern).replace(r.value,r.pattern)},nt=e=>e.toISOString().split("T")[0],it=(e,t,s)=>{const r=e.closest("[lang]"),n=Intl.NumberFormat.supportedLocalesOf(r==null?void 0:r.lang),i=n.length>0&&typeof n[0]=="string"?n[0]:navigator.language||s,l=i.split("-").shift();return Object.keys(t).length===0?{locale:i,messages:{lang:s}}:{locale:i,messages:t[l]||t[s]||{lang:s}}},lt=(e,t,s)=>new Intl.NumberFormat(t,{style:"currency",currency:s}).format(e),ot=(e,t,s=0)=>new Intl.NumberFormat(t,{minimumFractionDigits:s}).format(s>0?Number(e==null?void 0:e.toFixed(s)):e),at=(e,t,s=0)=>new Intl.NumberFormat(t,{style:"percent",minimumFractionDigits:s,maximumFractionDigits:s}).format(e),ct=(e,t,s,r="short",n=0)=>new Intl.NumberFormat(t,{style:"unit",unit:s,unitDisplay:r,minimumFractionDigits:n,maximumFractionDigits:n}).format(e),ye=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,ve=(e,t,s)=>typeof e!="string"||e===""||!ye.test(e)?"":new Intl.DateTimeFormat(t,s).format(new Date(e)),ft=(e,t)=>s=>it(s,e,t),ut=({disconnect:e,observe:t,takeRecords:s})=>{class r{constructor(i){y(this,"disconnect",e);y(this,"observe",t);y(this,"takeRecords",s);y(this,"cb");this.cb=i}}return[window,global].forEach(n=>{Object.defineProperty(n,"MutationObserver",{writable:!0,configurable:!0,value:r})}),r},dt=({disconnect:e,observe:t})=>{class s{constructor(n){y(this,"disconnect",e);y(this,"observe",t);y(this,"unobserve");y(this,"cb");this.cb=n}}return[window,global].forEach(r=>{Object.defineProperty(r,"ResizeObserver",{writable:!0,configurable:!0,value:s})}),s};class $t extends Event{constructor(){super(...arguments);y(this,"detail")}}const gt=()=>{class e extends $t{}return[window,global].forEach(t=>{Object.defineProperty(t,"SubmitEvent",{writable:!0,configurable:!0,value:e})}),e},pt=e=>{const t=s=>(setTimeout(s,1),e(),0);return[window,global].forEach(s=>{Object.defineProperty(s,"requestAnimationFrame",{writable:!0,configurable:!0,value:t})}),t};a.ClassList=be,a.StorybookPreview=Ze,a.allItemsAreString=Se,a.cleanString=je,a.createID=p,a.dateRegExp=ye,a.dateToString=nt,a.defineLocales=ft,a.filterArgs=Xe,a.focusableElements=ke,a.getLocaleDatePattern=rt,a.getParentWindows=B,a.getStoryHTML=Qe,a.getStorybookUrl=F,a.getWindows=Ae,a.isTagName=Te,a.isValidNumber=_e,a.isValidString=J,a.isValideID=m,a.localeCurrency=lt,a.localeDate=ve,a.localeNumber=ot,a.localePercent=at,a.localeUnit=ct,a.nextTick=Le,a.setUpRequestAnimationFrameMock=pt,a.setupMutationObserverMock=ut,a.setupResizeObserverMock=dt,a.setupSubmitEventMock=gt,a.stencilWrapper=Ke,a.toString=Ee,a.vsCodeCssGenerator=st,a.vsCodeGenerator=tt,a.webTypesGenerator=Ye,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
|
|
24
24
|
//# sourceMappingURL=index.umd.js.map
|