@birdapi/velinstyle 0.9.0 → 1.1.0
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/README.de.md +15 -11
- package/README.md +15 -11
- package/cli/cli-manifest.json +1 -1
- package/cli/docgen/extract-a11y.js +4 -2
- package/cli/index.js +4 -2
- package/components/index.js +2 -0
- package/components/runtime/component-loaders.js +2 -0
- package/components/velin-data-table.js +361 -0
- package/components/velin-form-summary.js +348 -0
- package/core/a11y/component-contracts.json +18 -1
- package/core/highlight/languages/go.js +28 -0
- package/core/highlight/languages/python.js +29 -0
- package/core/highlight/languages/rust.js +32 -0
- package/core/highlight/languages/yaml.js +23 -0
- package/core/highlight/registry.js +13 -2
- package/core/meta/build.js +1 -1
- package/core/search/worker-client.js +2 -3
- package/dist/chunks/attributes-353XDOAX.js +391 -0
- package/dist/chunks/attributes-ADOKLKA7.js +391 -0
- package/dist/chunks/chunk-ERF5YVP4.js +253 -0
- package/dist/chunks/chunk-IEHKRARD.js +109 -0
- package/dist/chunks/chunk-QVHYL3R4.js +111 -0
- package/dist/chunks/go-HZ6XTFCK.js +31 -0
- package/dist/chunks/highlight-IBDX4XWS.js +37 -0
- package/dist/chunks/python-BMPKDKNO.js +32 -0
- package/dist/chunks/runtime-entry.js +1 -1
- package/dist/chunks/rust-2BWKI2MN.js +35 -0
- package/dist/chunks/velin-code-block-ITCLIC6T.js +132 -0
- package/dist/chunks/velin-data-table-KK7IDGTP.js +302 -0
- package/dist/chunks/velin-form-summary-XRQ7COQH.js +273 -0
- package/dist/chunks/velin-lightbox-NXA3U2FM.js +149 -0
- package/dist/chunks/velin-search-FDHEMCSO.js +557 -0
- package/dist/chunks/worker-client-MPT7PNQ4.js +47 -0
- package/dist/chunks/yaml-O67LEQYT.js +26 -0
- package/dist/llms.txt +2 -2
- package/dist/search-index.json +28 -2
- package/dist/velin-agent.json +31 -5
- package/dist/velinstyle-components.iife.js +745 -7
- package/dist/velinstyle-components.js +746 -5
- package/dist/velinstyle-components.min.js +85 -85
- package/dist/velinstyle.css +141 -19
- package/dist/velinstyle.d.ts +2 -0
- package/dist/velinstyle.min.css +1 -1
- package/package.json +8 -2
- package/src/base/wc-placeholder.css +7 -0
- package/src/components/data-table.css +93 -0
- package/src/components/form-validation.css +40 -0
- package/src/velinstyle.css +1 -0
- package/dist/llms.test.txt +0 -40
- package/dist/search-index.test.json +0 -1773
- package/dist/velin-agent.test.json +0 -684
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wl(i,e){return _l(i)||xl(i,e)||El(i,e)||Al()}function El(i,e){if(i){if(typeof i=="string")return io(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?io(i,e):void 0}}function I(i){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return dr(i,e,r)}}function Ol(i){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return ur(i,t)}}function y(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nt;if(ro&&ro(i,null),!q(e))return i;let r=e.length;for(;r--;){let n=e[r];if(typeof n=="string"){let o=t(n);o!==n&&(kl(e)||(e[r]=o),n=o)}i[n]=!0}return i}function Dl(i){for(let e=0;e<i.length;e++)T(i,e)||(i[e]=null);return i}function K(i){let e=Pe(null);for(let r of vo(i)){var t=wl(r,2);let n=t[0],o=t[1];T(i,n)&&(q(o)?e[n]=Dl(o):o&&typeof o=="object"&&o.constructor===Object?e[n]=K(o):e[n]=o)}return e}function Nl(i){switch(typeof i){case"string":return i;case"number":return Ml(i);case"boolean":return Il(i);case"bigint":return ao?ao(i):"0";case"symbol":return lo?lo(i):"Symbol()";case"undefined":return rt(i);case"function":case"object":{if(i===null)return rt(i);let e=i,t=Se(e,"toString");if(typeof t=="function"){let r=t(e);return typeof r=="string"?r:rt(r)}return rt(i)}default:return rt(i)}}function Se(i,e){for(;i!==null;){let r=Tl(i,e);if(r){if(r.get)return I(r.get);if(typeof r.value=="function")return I(r.value)}i=Sl(i)}function t(){return null}return t}function Hl(i){try{return z(i,""),!0}catch{return!1}}function go(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Yl(),e=f=>go(f);if(e.version="3.4.5",e.removed=[],!i||!i.document||i.document.nodeType!==Fe.document||!i.Element)return e.isSupported=!1,e;let t=i.document,r=t,n=r.currentScript,o=i.DocumentFragment,a=i.HTMLTemplateElement,c=i.Node,d=i.Element,m=i.NodeFilter,b=i.NamedNodeMap,_=b===void 0?i.NamedNodeMap||i.MozNamedAttrMap:b,g=i.HTMLFormElement,F=i.DOMParser,w=i.trustedTypes,A=d.prototype,E=Se(A,"cloneNode"),re=Se(A,"remove"),de=Se(A,"nextSibling"),Cn=Se(A,"childNodes"),ne=Se(A,"parentNode"),Et=c&&c.prototype?Se(c.prototype,"nodeType"):null;if(typeof a=="function"){let f=t.createElement("template");f.content&&f.content.ownerDocument&&(t=f.content.ownerDocument)}let H,we="",ue=t,Bi=ue.implementation,Rn=ue.createNodeIterator,il=ue.createDocumentFragment,rl=ue.getElementsByTagName,nl=r.importNode,P=fo();e.isSupported=typeof vo=="function"&&typeof ne=="function"&&Bi&&Bi.createHTMLDocument!==void 0;let kt=Fl,St=Pl,Tt=ql,ol=Ul,sl=Bl,al=jl,Mn=Kl,ll=Gl,In=mo,D=null,On=y({},[...co,...sr,...ar,...lr,...uo]),$=null,Dn=y({},[...ho,...cr,...po,...Ht]),L=Object.seal(Pe(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Je=null,Lt=null,ve=Object.seal(Pe(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Nn=!0,ji=!0,Hn=!1,$n=!0,be=!1,Qe=!0,Ee=!1,Ki=!1,Wi=!1,Me=!1,Ct=!1,Rt=!1,zn=!0,Fn=!1,Pn="user-content-",Gi=!0,et=!1,Ie={},oe=null,Yi=y({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),qn=null,Un=y({},["audio","video","img","source","image","track"]),Vi=null,Bn=y({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Mt="http://www.w3.org/1998/Math/MathML",It="http://www.w3.org/2000/svg",se="http://www.w3.org/1999/xhtml",Oe=se,Xi=!1,Zi=null,cl=y({},[Mt,It,se],or),Ji=y({},["mi","mo","mn","ms","mtext"]),Qi=y({},["annotation-xml"]),dl=y({},["title","style","font","a","script"]),tt=null,ul=["application/xhtml+xml","text/html"],hl="text/html",O=null,De=null,pl=t.createElement("form"),jn=function(s){return s instanceof RegExp||s instanceof Function},er=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(De&&De===s)return;(!s||typeof s!="object")&&(s={}),s=K(s),tt=ul.indexOf(s.PARSER_MEDIA_TYPE)===-1?hl:s.PARSER_MEDIA_TYPE,O=tt==="application/xhtml+xml"?or:nt,D=T(s,"ALLOWED_TAGS")&&q(s.ALLOWED_TAGS)?y({},s.ALLOWED_TAGS,O):On,$=T(s,"ALLOWED_ATTR")&&q(s.ALLOWED_ATTR)?y({},s.ALLOWED_ATTR,O):Dn,Zi=T(s,"ALLOWED_NAMESPACES")&&q(s.ALLOWED_NAMESPACES)?y({},s.ALLOWED_NAMESPACES,or):cl,Vi=T(s,"ADD_URI_SAFE_ATTR")&&q(s.ADD_URI_SAFE_ATTR)?y(K(Bn),s.ADD_URI_SAFE_ATTR,O):Bn,qn=T(s,"ADD_DATA_URI_TAGS")&&q(s.ADD_DATA_URI_TAGS)?y(K(Un),s.ADD_DATA_URI_TAGS,O):Un,oe=T(s,"FORBID_CONTENTS")&&q(s.FORBID_CONTENTS)?y({},s.FORBID_CONTENTS,O):Yi,Je=T(s,"FORBID_TAGS")&&q(s.FORBID_TAGS)?y({},s.FORBID_TAGS,O):K({}),Lt=T(s,"FORBID_ATTR")&&q(s.FORBID_ATTR)?y({},s.FORBID_ATTR,O):K({}),Ie=T(s,"USE_PROFILES")?s.USE_PROFILES&&typeof s.USE_PROFILES=="object"?K(s.USE_PROFILES):s.USE_PROFILES:!1,Nn=s.ALLOW_ARIA_ATTR!==!1,ji=s.ALLOW_DATA_ATTR!==!1,Hn=s.ALLOW_UNKNOWN_PROTOCOLS||!1,$n=s.ALLOW_SELF_CLOSE_IN_ATTR!==!1,be=s.SAFE_FOR_TEMPLATES||!1,Qe=s.SAFE_FOR_XML!==!1,Ee=s.WHOLE_DOCUMENT||!1,Me=s.RETURN_DOM||!1,Ct=s.RETURN_DOM_FRAGMENT||!1,Rt=s.RETURN_TRUSTED_TYPE||!1,Wi=s.FORCE_BODY||!1,zn=s.SANITIZE_DOM!==!1,Fn=s.SANITIZE_NAMED_PROPS||!1,Gi=s.KEEP_CONTENT!==!1,et=s.IN_PLACE||!1,In=Hl(s.ALLOWED_URI_REGEXP)?s.ALLOWED_URI_REGEXP:mo,Oe=typeof s.NAMESPACE=="string"?s.NAMESPACE:se,Ji=T(s,"MATHML_TEXT_INTEGRATION_POINTS")&&s.MATHML_TEXT_INTEGRATION_POINTS&&typeof s.MATHML_TEXT_INTEGRATION_POINTS=="object"?K(s.MATHML_TEXT_INTEGRATION_POINTS):y({},["mi","mo","mn","ms","mtext"]),Qi=T(s,"HTML_INTEGRATION_POINTS")&&s.HTML_INTEGRATION_POINTS&&typeof s.HTML_INTEGRATION_POINTS=="object"?K(s.HTML_INTEGRATION_POINTS):y({},["annotation-xml"]);let l=T(s,"CUSTOM_ELEMENT_HANDLING")&&s.CUSTOM_ELEMENT_HANDLING&&typeof s.CUSTOM_ELEMENT_HANDLING=="object"?K(s.CUSTOM_ELEMENT_HANDLING):Pe(null);if(L=Pe(null),T(l,"tagNameCheck")&&jn(l.tagNameCheck)&&(L.tagNameCheck=l.tagNameCheck),T(l,"attributeNameCheck")&&jn(l.attributeNameCheck)&&(L.attributeNameCheck=l.attributeNameCheck),T(l,"allowCustomizedBuiltInElements")&&typeof l.allowCustomizedBuiltInElements=="boolean"&&(L.allowCustomizedBuiltInElements=l.allowCustomizedBuiltInElements),be&&(ji=!1),Ct&&(Me=!0),Ie&&(D=y({},uo),$=Pe(null),Ie.html===!0&&(y(D,co),y($,ho)),Ie.svg===!0&&(y(D,sr),y($,cr),y($,Ht)),Ie.svgFilters===!0&&(y(D,ar),y($,cr),y($,Ht)),Ie.mathMl===!0&&(y(D,lr),y($,po),y($,Ht))),ve.tagCheck=null,ve.attributeCheck=null,T(s,"ADD_TAGS")&&(typeof s.ADD_TAGS=="function"?ve.tagCheck=s.ADD_TAGS:q(s.ADD_TAGS)&&(D===On&&(D=K(D)),y(D,s.ADD_TAGS,O))),T(s,"ADD_ATTR")&&(typeof s.ADD_ATTR=="function"?ve.attributeCheck=s.ADD_ATTR:q(s.ADD_ATTR)&&($===Dn&&($=K($)),y($,s.ADD_ATTR,O))),T(s,"ADD_URI_SAFE_ATTR")&&q(s.ADD_URI_SAFE_ATTR)&&y(Vi,s.ADD_URI_SAFE_ATTR,O),T(s,"FORBID_CONTENTS")&&q(s.FORBID_CONTENTS)&&(oe===Yi&&(oe=K(oe)),y(oe,s.FORBID_CONTENTS,O)),T(s,"ADD_FORBID_CONTENTS")&&q(s.ADD_FORBID_CONTENTS)&&(oe===Yi&&(oe=K(oe)),y(oe,s.ADD_FORBID_CONTENTS,O)),Gi&&(D["#text"]=!0),Ee&&y(D,["html","head","body"]),D.table&&(y(D,["tbody"]),delete Je.tbody),s.TRUSTED_TYPES_POLICY){if(typeof s.TRUSTED_TYPES_POLICY.createHTML!="function")throw Nt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof s.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Nt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');H=s.TRUSTED_TYPES_POLICY,we=H.createHTML("")}else H===void 0&&(H=Vl(w,n)),H!==null&&typeof we=="string"&&(we=H.createHTML(""));U&&U(s),De=s},Kn=y({},[...sr,...ar,...$l]),Wn=y({},[...lr,...zl]),ml=function(s){let l=ne(s);(!l||!l.tagName)&&(l={namespaceURI:Oe,tagName:"template"});let h=nt(s.tagName),x=nt(l.tagName);return Zi[s.namespaceURI]?s.namespaceURI===It?l.namespaceURI===se?h==="svg":l.namespaceURI===Mt?h==="svg"&&(x==="annotation-xml"||Ji[x]):!!Kn[h]:s.namespaceURI===Mt?l.namespaceURI===se?h==="math":l.namespaceURI===It?h==="math"&&Qi[x]:!!Wn[h]:s.namespaceURI===se?l.namespaceURI===It&&!Qi[x]||l.namespaceURI===Mt&&!Ji[x]?!1:!Wn[h]&&(dl[h]||!Kn[h]):!!(tt==="application/xhtml+xml"&&Zi[s.namespaceURI]):!1},X=function(s){$e(e.removed,{element:s});try{ne(s).removeChild(s)}catch{re(s)}},ke=function(s,l){try{$e(e.removed,{attribute:l.getAttributeNode(s),from:l})}catch{$e(e.removed,{attribute:null,from:l})}if(l.removeAttribute(s),s==="is")if(Me||Ct)try{X(l)}catch{}else try{l.setAttribute(s,"")}catch{}},Gn=function(s){let l=null,h=null;if(Wi)s="<remove></remove>"+s;else{let M=oo(s,/^[\r\n\t ]+/);h=M&&M[0]}tt==="application/xhtml+xml"&&Oe===se&&(s='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+s+"</body></html>");let x=H?H.createHTML(s):s;if(Oe===se)try{l=new F().parseFromString(x,tt)}catch{}if(!l||!l.documentElement){l=Bi.createDocument(Oe,"template",null);try{l.documentElement.innerHTML=Xi?we:x}catch{}}let R=l.body||l.documentElement;return s&&h&&R.insertBefore(t.createTextNode(h),R.childNodes[0]||null),Oe===se?rl.call(l,Ee?"html":"body")[0]:Ee?l.documentElement:R},Yn=function(s){return Rn.call(s.ownerDocument||s,s,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},Vn=function(s){s.normalize();let l=Rn.call(s.ownerDocument||s,s,m.SHOW_TEXT|m.SHOW_COMMENT|m.SHOW_CDATA_SECTION|m.SHOW_PROCESSING_INSTRUCTION,null),h=l.nextNode();for(;h;){let x=h.data;He([kt,St,Tt],R=>{x=ze(x,R," ")}),h.data=x,h=l.nextNode()}},tr=function(s){return s instanceof g&&(typeof s.nodeName!="string"||typeof s.textContent!="string"||typeof s.removeChild!="function"||!(s.attributes instanceof _)||typeof s.removeAttribute!="function"||typeof s.setAttribute!="function"||typeof s.namespaceURI!="string"||typeof s.insertBefore!="function"||typeof s.hasChildNodes!="function")},Ot=function(s){if(!Et||typeof s!="object"||s===null)return!1;try{return typeof Et(s)=="number"}catch{return!1}};function he(f,s,l){He(f,h=>{h.call(e,s,l,De)})}let Xn=function(s){let l=null;if(he(P.beforeSanitizeElements,s,null),tr(s))return X(s),!0;let h=O(s.nodeName);if(he(P.uponSanitizeElement,s,{tagName:h,allowedTags:D}),Qe&&s.hasChildNodes()&&!Ot(s.firstElementChild)&&z(/<[/\w!]/g,s.innerHTML)&&z(/<[/\w!]/g,s.textContent)||Qe&&s.namespaceURI===se&&h==="style"&&Ot(s.firstElementChild)||s.nodeType===Fe.progressingInstruction||Qe&&s.nodeType===Fe.comment&&z(/<[/\w]/g,s.data))return X(s),!0;if(Je[h]||!(ve.tagCheck instanceof Function&&ve.tagCheck(h))&&!D[h]){if(!Je[h]&&Jn(h)&&(L.tagNameCheck instanceof RegExp&&z(L.tagNameCheck,h)||L.tagNameCheck instanceof Function&&L.tagNameCheck(h)))return!1;if(Gi&&!oe[h]){let x=ne(s)||s.parentNode,R=Cn(s)||s.childNodes;if(R&&x){let M=R.length;for(let B=M-1;B>=0;--B){let ge=E(R[B],!0);x.insertBefore(ge,de(s))}}}return X(s),!0}return s instanceof d&&!ml(s)||(h==="noscript"||h==="noembed"||h==="noframes")&&z(/<\/no(script|embed|frames)/i,s.innerHTML)?(X(s),!0):(be&&s.nodeType===Fe.text&&(l=s.textContent,He([kt,St,Tt],x=>{l=ze(l,x," ")}),s.textContent!==l&&($e(e.removed,{element:s.cloneNode()}),s.textContent=l)),he(P.afterSanitizeElements,s,null),!1)},Zn=function(s,l,h){if(Lt[l]||zn&&(l==="id"||l==="name")&&(h in t||h in pl))return!1;let x=$[l]||ve.attributeCheck instanceof Function&&ve.attributeCheck(l,s);if(!(ji&&!Lt[l]&&z(ol,l))){if(!(Nn&&z(sl,l))){if(!x||Lt[l]){if(!(Jn(s)&&(L.tagNameCheck instanceof RegExp&&z(L.tagNameCheck,s)||L.tagNameCheck instanceof Function&&L.tagNameCheck(s))&&(L.attributeNameCheck instanceof RegExp&&z(L.attributeNameCheck,l)||L.attributeNameCheck instanceof Function&&L.attributeNameCheck(l,s))||l==="is"&&L.allowCustomizedBuiltInElements&&(L.tagNameCheck instanceof RegExp&&z(L.tagNameCheck,h)||L.tagNameCheck instanceof Function&&L.tagNameCheck(h))))return!1}else if(!Vi[l]){if(!z(In,ze(h,Mn,""))){if(!((l==="src"||l==="xlink:href"||l==="href")&&s!=="script"&&so(h,"data:")===0&&qn[s])){if(!(Hn&&!z(al,ze(h,Mn,"")))){if(h)return!1}}}}}}return!0},fl=y({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Jn=function(s){return!fl[nt(s)]&&z(ll,s)},Qn=function(s){he(P.beforeSanitizeAttributes,s,null);let l=s.attributes;if(!l||tr(s))return;let h={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:$,forceKeepAttr:void 0},x=l.length;for(;x--;){let R=l[x],M=R.name,B=R.namespaceURI,ge=R.value,pe=O(M),rr=ge,N=M==="value"?rr:Rl(rr);if(h.attrName=pe,h.attrValue=N,h.keepAttr=!0,h.forceKeepAttr=void 0,he(P.uponSanitizeAttribute,s,h),N=h.attrValue,Fn&&(pe==="id"||pe==="name")&&so(N,Pn)!==0&&(ke(M,s),N=Pn+N),Qe&&z(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,N)){ke(M,s);continue}if(pe==="attributename"&&oo(N,"href")){ke(M,s);continue}if(h.forceKeepAttr)continue;if(!h.keepAttr){ke(M,s);continue}if(!$n&&z(/\/>/i,N)){ke(M,s);continue}be&&He([kt,St,Tt],to=>{N=ze(N,to," ")});let eo=O(s.nodeName);if(!Zn(eo,pe,N)){ke(M,s);continue}if(H&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!B)switch(w.getAttributeType(eo,pe)){case"TrustedHTML":{N=H.createHTML(N);break}case"TrustedScriptURL":{N=H.createScriptURL(N);break}}if(N!==rr)try{B?s.setAttributeNS(B,M,N):s.setAttribute(M,N),tr(s)?X(s):no(e.removed)}catch{ke(M,s)}}he(P.afterSanitizeAttributes,s,null)},ir=function(s){let l=null,h=Yn(s);for(he(P.beforeSanitizeShadowDOM,s,null);l=h.nextNode();)he(P.uponSanitizeShadowNode,l,null),Xn(l),Qn(l),l.content instanceof o&&ir(l.content);he(P.afterSanitizeShadowDOM,s,null)},Dt=function(s){if(s.nodeType===Fe.element&&s.shadowRoot instanceof o){let x=s.shadowRoot;Dt(x),ir(x)}let l=s.childNodes;if(!l)return;let h=[];He(l,x=>{$e(h,x)});for(let x of h)Dt(x)};return e.sanitize=function(f){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=null,h=null,x=null,R=null;if(Xi=!f,Xi&&(f="<!-->"),typeof f!="string"&&!Ot(f)&&(f=Nl(f),typeof f!="string"))throw Nt("dirty is not a string, aborting");if(!e.isSupported)return f;if(Ki||er(s),e.removed=[],typeof f=="string"&&(et=!1),et){let ge=f.nodeName;if(typeof ge=="string"){let pe=O(ge);if(!D[pe]||Je[pe])throw Nt("root node is forbidden and cannot be sanitized in-place")}Dt(f)}else if(Ot(f))l=Gn("<!---->"),h=l.ownerDocument.importNode(f,!0),h.nodeType===Fe.element&&h.nodeName==="BODY"||h.nodeName==="HTML"?l=h:l.appendChild(h),Dt(h);else{if(!Me&&!be&&!Ee&&f.indexOf("<")===-1)return H&&Rt?H.createHTML(f):f;if(l=Gn(f),!l)return Me?null:Rt?we:""}l&&Wi&&X(l.firstChild);let M=Yn(et?f:l);for(;x=M.nextNode();)Xn(x),Qn(x),x.content instanceof o&&ir(x.content);if(et)return be&&Vn(f),f;if(Me){if(be&&Vn(l),Ct)for(R=il.call(l.ownerDocument);l.firstChild;)R.appendChild(l.firstChild);else R=l;return($.shadowroot||$.shadowrootmode)&&(R=nl.call(r,R,!0)),R}let B=Ee?l.outerHTML:l.innerHTML;return Ee&&D["!doctype"]&&l.ownerDocument&&l.ownerDocument.doctype&&l.ownerDocument.doctype.name&&z(Wl,l.ownerDocument.doctype.name)&&(B="<!DOCTYPE "+l.ownerDocument.doctype.name+`>
|
|
3
|
-
`+B),be&&He([kt,St,Tt],ge=>{B=ze(B,ge," ")}),H&&Rt?H.createHTML(B):B},e.setConfig=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};er(f),Ki=!0},e.clearConfig=function(){De=null,Ki=!1},e.isValidAttribute=function(f,s,l){De||er({});let h=O(f),x=O(s);return Zn(h,x,l)},e.addHook=function(f,s){typeof s=="function"&&$e(P[f],s)},e.removeHook=function(f,s){if(s!==void 0){let l=Ll(P[f],s);return l===-1?void 0:Cl(P[f],l,1)[0]}return no(P[f])},e.removeHooks=function(f){P[f]=[]},e.removeAllHooks=function(){P=fo()},e}var vo,ro,kl,Sl,Tl,U,V,Pe,bo,dr,ur,He,Ll,no,$e,Cl,q,nt,or,oo,ze,so,Rl,Ml,Il,ao,lo,T,rt,z,Nt,co,sr,ar,$l,lr,zl,uo,ho,cr,po,Ht,Fl,Pl,ql,Ul,Bl,mo,jl,Kl,Wl,Gl,Fe,Yl,Vl,fo,C,yo=u(()=>{vo=Object.entries,ro=Object.setPrototypeOf,kl=Object.isFrozen,Sl=Object.getPrototypeOf,Tl=Object.getOwnPropertyDescriptor,U=Object.freeze,V=Object.seal,Pe=Object.create,bo=typeof Reflect<"u"&&Reflect,dr=bo.apply,ur=bo.construct;U||(U=function(e){return e});V||(V=function(e){return e});dr||(dr=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];return e.apply(t,n)});ur||(ur=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return new e(...r)});He=I(Array.prototype.forEach),Ll=I(Array.prototype.lastIndexOf),no=I(Array.prototype.pop),$e=I(Array.prototype.push),Cl=I(Array.prototype.splice),q=Array.isArray,nt=I(String.prototype.toLowerCase),or=I(String.prototype.toString),oo=I(String.prototype.match),ze=I(String.prototype.replace),so=I(String.prototype.indexOf),Rl=I(String.prototype.trim),Ml=I(Number.prototype.toString),Il=I(Boolean.prototype.toString),ao=typeof BigInt>"u"?null:I(BigInt.prototype.toString),lo=typeof Symbol>"u"?null:I(Symbol.prototype.toString),T=I(Object.prototype.hasOwnProperty),rt=I(Object.prototype.toString),z=I(RegExp.prototype.test),Nt=Ol(TypeError);co=U(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),sr=U(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ar=U(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),$l=U(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),lr=U(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),zl=U(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),uo=U(["#text"]),ho=U(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),cr=U(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),po=U(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ht=U(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Fl=V(/{{[\w\W]*|^[\w\W]*}}/g),Pl=V(/<%[\w\W]*|^[\w\W]*%>/g),ql=V(/\${[\w\W]*/g),Ul=V(/^data-[\-\w.\u00B7-\uFFFF]+$/),Bl=V(/^aria-[\-\w]+$/),mo=V(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),jl=V(/^(?:\w+script|data):/i),Kl=V(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Wl=V(/^html$/i),Gl=V(/^[a-z][.\w]*(-[.\w]+)+$/i),Fe={element:1,text:3,progressingInstruction:7,comment:8,document:9},Yl=function(){return typeof window>"u"?null:window},Vl=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(r=t.getAttribute(n));let o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},fo=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};C=go()});var _o={};v(_o,{addHook:()=>Ql,clearConfig:()=>nc,clearWindow:()=>lc,default:()=>Xl,isSupported:()=>Jl,isValidAttribute:()=>oc,removeAllHooks:()=>ic,removeHook:()=>ec,removeHooks:()=>tc,removed:()=>ac,sanitize:()=>Zl,setConfig:()=>rc,version:()=>sc});function lc(){}var Xl,Zl,Jl,Ql,ec,tc,ic,rc,nc,oc,sc,ac,xo=u(()=>{yo();Xl=C,Zl=C.sanitize.bind(C),Jl=C.isSupported,Ql=C.addHook.bind(C),ec=C.removeHook.bind(C),tc=C.removeHooks.bind(C),ic=C.removeAllHooks.bind(C),rc=C.setConfig.bind(C),nc=C.clearConfig.bind(C),oc=C.isValidAttribute.bind(C),sc=C.version,ac=C.removed});function p(i){return typeof i!="string"?"":i.replace(dc,e=>cc[e])}function hr(i){return typeof i!="string"?"":i.replace(uc,"")}function me(i){return p(hr(i))}function Te(i,e){if(typeof i!="string")return"";let t=i.trim();if(!t||/^\s*javascript:/i.test(t)||/^\s*vbscript:/i.test(t)||pc.test(t)||/^data:/i.test(t)&&!Ao.test(t))return"";try{let r=new URL(t,e||(typeof location<"u"?location.href:"https://example.invalid/"));return!hc.has(r.protocol)||r.protocol==="data:"&&!Ao.test(r.href)?"":r.href}catch{return t.startsWith("#")||t.startsWith("/")?t:""}}function wo(i,e){if(typeof i!="string")return"#";let t=i.trim();return t?t.startsWith("#")||t.startsWith("/")&&!t.startsWith("//")?t:/^https?:\/\//i.test(t)?Te(t,e)||"#":/^\s*javascript:/i.test(t)||/^\s*vbscript:/i.test(t)?"#":t:"#"}function Eo(i){let e=String(i||"text").toLowerCase();return mc.has(e)?e:"text"}async function fc(){if(ot)return ot;try{let i=await Promise.resolve().then(()=>(xo(),_o));ot=i.default||i}catch{ot=null}return ot}async function ko(i){if(typeof i!="string")return"";let e=await fc();return e?.sanitize?e.sanitize(i,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:vc,ADD_ATTR:bc,FORBID_TAGS:["script","foreignObject","iframe","object","embed"],FORBID_ATTR:["onload","onerror","onclick","onmouseover"]}):i.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/\s+on\w+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/<foreignObject[\s\S]*?<\/foreignObject>/gi,"")}function So(){return $t||(typeof window<"u"&&window.trustedTypes?.createPolicy&&($t=window.trustedTypes.createPolicy("velinstyle",{createHTML:i=>p(i)})),$t)}function gc(i){let e=So(),t=p(hr(i));return e?.createHTML?e.createHTML(t):t}var cc,dc,uc,hc,pc,Ao,mc,ot,vc,bc,$t,k=u(()=>{cc={"&":"&","<":"<",">":">",'"':""","'":"'"},dc=/[&<>"']/g,uc=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g,hc=new Set(["http:","https:","data:","mailto:","tel:"]),pc=/^data:(?:text\/html|image\/svg\+xml|application\/xml)/i,Ao=/^data:image\/(png|jpeg|jpg|gif|webp|avif);base64,/i,mc=new Set(["text","password","email","search","tel","url","number"]);ot=null;vc=["svg","g","path","circle","rect","line","polyline","polygon","ellipse","defs","use","symbol","title","desc","clipPath","mask","linearGradient","radialGradient","stop","pattern","text","tspan"],bc=["viewBox","xmlns","fill","stroke","stroke-width","stroke-linecap","stroke-linejoin","d","cx","cy","r","rx","ry","x","y","width","height","x1","y1","x2","y2","points","transform","opacity","class","id","href","xlink:href","aria-hidden","aria-label","aria-labelledby","role","focusable","clip-path","mask","offset","stop-color","stop-opacity","gradientUnits","gradientTransform","spreadMethod","fx","fy","patternUnits","patternContentUnits","preserveAspectRatio"];$t=null});var Lo={};v(Lo,{default:()=>To});var yc,zt,To,pr=u(()=>{j();k();yc=`
|
|
1
|
+
var Hl=Object.defineProperty;var d=(i,e)=>()=>(i&&(e=i(i=0)),e);var f=(i,e)=>{for(var t in e)Hl(i,t,{get:e[t],enumerable:!0})};function ql(i){if(i.hasAttribute("disabled")||i.getAttribute("aria-hidden")==="true"||i.closest("[inert]"))return!1;let e=i.ownerDocument.defaultView?.getComputedStyle(i);return e&&(e.visibility==="hidden"||e.display==="none")?!1:i.getClientRects().length>0}function ce(i){return[...i.querySelectorAll(Pl)].filter(ql)}function Y(i,e){if(e.key!=="Tab")return;let t=ce(i);if(t.length===0)return;let r=t[0],n=t[t.length-1],o=i.getRootNode().activeElement;e.shiftKey&&o===r?(e.preventDefault(),n.focus()):!e.shiftKey&&o===n&&(e.preventDefault(),r.focus())}function X(i,e,t){let r=e.indexOf(t.target);if(r===-1)return;let n;switch(t.key){case"ArrowDown":case"ArrowRight":t.preventDefault(),n=(r+1)%e.length;break;case"ArrowUp":case"ArrowLeft":t.preventDefault(),n=(r-1+e.length)%e.length;break;case"Home":t.preventDefault(),n=0;break;case"End":t.preventDefault(),n=e.length-1;break;default:return}e.forEach((o,a)=>{o.setAttribute("tabindex",a===n?"0":"-1")}),e[n].focus()}function Q(){return document.activeElement}function ee(i){i&&typeof i.focus=="function"&&i.focus()}function Bl(){let i=new Set;for(let e of $e)for(let t of e.siblings)i.add(t);return i}function te(i){let e=i instanceof HTMLElement?i:null;if(!e)return;let t=new Set;for(let r of document.body.children)r===e||r.contains(e)||r.hasAttribute("inert")||(r.setAttribute("inert",""),t.add(r));$e.push({host:e,siblings:t}),rt===0&&(sr=document.body.style.overflow,document.body.style.overflow="hidden"),rt+=1}function ie(i){let e=-1;if(i instanceof HTMLElement?e=$e.findLastIndex(n=>n.host===i):$e.length&&(e=$e.length-1),e===-1)return;let{siblings:t}=$e.splice(e,1)[0],r=Bl();for(let n of t)r.has(n)||n.removeAttribute("inert");rt=Math.max(0,rt-1),rt===0&&(document.body.style.overflow=sr,sr="")}var Pl,$e,rt,sr,K=d(()=>{Pl=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])',"summary","details"].join(", ");$e=[],rt=0,sr=""});function bo(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=Array(e);t<e;t++)r[t]=i[t];return r}function Ul(i){if(Array.isArray(i))return i}function jl(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var r,n,o,a,l=[],u=!0,m=!1;try{if(o=(t=t.call(i)).next,e!==0)for(;!(u=(r=o.call(t)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(v){m=!0,n=v}finally{try{if(!u&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(m)throw n}}return l}}function Kl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wl(i,e){return Ul(i)||jl(i,e)||Gl(i,e)||Kl()}function Gl(i,e){if(i){if(typeof i=="string")return bo(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?bo(i,e):void 0}}function M(i){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return hr(i,e,r)}}function ic(i){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return pr(i,t)}}function _(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ot;if(vo&&vo(i,null),!B(e))return i;let r=e.length;for(;r--;){let n=e[r];if(typeof n=="string"){let o=t(n);o!==n&&(Vl(e)||(e[r]=o),n=o)}i[n]=!0}return i}function rc(i){for(let e=0;e<i.length;e++)T(i,e)||(i[e]=null);return i}function W(i){let e=Be(null);for(let r of Co(i)){var t=Wl(r,2);let n=t[0],o=t[1];T(i,n)&&(B(o)?e[n]=rc(o):o&&typeof o=="object"&&o.constructor===Object?e[n]=W(o):e[n]=o)}return e}function nc(i){switch(typeof i){case"string":return i;case"number":return ec(i);case"boolean":return tc(i);case"bigint":return xo?xo(i):"0";case"symbol":return Ao?Ao(i):"Symbol()";case"undefined":return nt(i);case"function":case"object":{if(i===null)return nt(i);let e=i,t=Le(e,"toString");if(typeof t=="function"){let r=t(e);return typeof r=="string"?r:nt(r)}return nt(i)}default:return nt(i)}}function Le(i,e){for(;i!==null;){let r=Xl(i,e);if(r){if(r.get)return M(r.get);if(typeof r.value=="function")return M(r.value)}i=Yl(i)}function t(){return null}return t}function oc(i){try{return P(i,""),!0}catch{return!1}}function Io(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:vc(),e=b=>Io(b);if(e.version="3.4.5",e.removed=[],!i||!i.document||i.document.nodeType!==qe.document||!i.Element)return e.isSupported=!1,e;let t=i.document,r=t,n=r.currentScript,o=i.DocumentFragment,a=i.HTMLTemplateElement,l=i.Node,u=i.Element,m=i.NodeFilter,v=i.NamedNodeMap,y=v===void 0?i.NamedNodeMap||i.MozNamedAttrMap:v,g=i.HTMLFormElement,N=i.DOMParser,w=i.trustedTypes,A=u.prototype,E=Le(A,"cloneNode"),oe=Le(A,"remove"),ue=Le(A,"nextSibling"),Bn=Le(A,"childNodes"),se=Le(A,"parentNode"),Et=l&&l.prototype?Le(l.prototype,"nodeType"):null;if(typeof a=="function"){let b=t.createElement("template");b.content&&b.content.ownerDocument&&(t=b.content.ownerDocument)}let z,ke="",he=t,Ki=he.implementation,Un=he.createNodeIterator,kl=he.createDocumentFragment,Sl=he.getElementsByTagName,Tl=r.importNode,q=Lo();e.isSupported=typeof Co=="function"&&typeof se=="function"&&Ki&&Ki.createHTMLDocument!==void 0;let kt=lc,St=cc,Tt=dc,Ll=uc,Cl=hc,Rl=pc,jn=mc,Il=bc,Kn=To,F=null,Wn=_({},[...wo,...lr,...cr,...dr,...Eo]),H=null,Gn=_({},[...ko,...ur,...So,...Ft]),L=Object.seal(Be(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Qe=null,Lt=null,ve=Object.seal(Be(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Vn=!0,Wi=!0,Yn=!1,Xn=!0,ge=!1,et=!0,Se=!1,Gi=!1,Vi=!1,De=!1,Ct=!1,Rt=!1,Zn=!0,Jn=!1,Qn="user-content-",Yi=!0,tt=!1,Oe={},ae=null,Xi=_({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),eo=null,to=_({},["audio","video","img","source","image","track"]),Zi=null,io=_({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),It="http://www.w3.org/1998/Math/MathML",Mt="http://www.w3.org/2000/svg",le="http://www.w3.org/1999/xhtml",Ne=le,Ji=!1,Qi=null,Ml=_({},[It,Mt,le],ar),er=_({},["mi","mo","mn","ms","mtext"]),tr=_({},["annotation-xml"]),Dl=_({},["title","style","font","a","script"]),it=null,Ol=["application/xhtml+xml","text/html"],Nl="text/html",D=null,Fe=null,Fl=t.createElement("form"),ro=function(s){return s instanceof RegExp||s instanceof Function},ir=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Fe&&Fe===s)return;(!s||typeof s!="object")&&(s={}),s=W(s),it=Ol.indexOf(s.PARSER_MEDIA_TYPE)===-1?Nl:s.PARSER_MEDIA_TYPE,D=it==="application/xhtml+xml"?ar:ot,F=T(s,"ALLOWED_TAGS")&&B(s.ALLOWED_TAGS)?_({},s.ALLOWED_TAGS,D):Wn,H=T(s,"ALLOWED_ATTR")&&B(s.ALLOWED_ATTR)?_({},s.ALLOWED_ATTR,D):Gn,Qi=T(s,"ALLOWED_NAMESPACES")&&B(s.ALLOWED_NAMESPACES)?_({},s.ALLOWED_NAMESPACES,ar):Ml,Zi=T(s,"ADD_URI_SAFE_ATTR")&&B(s.ADD_URI_SAFE_ATTR)?_(W(io),s.ADD_URI_SAFE_ATTR,D):io,eo=T(s,"ADD_DATA_URI_TAGS")&&B(s.ADD_DATA_URI_TAGS)?_(W(to),s.ADD_DATA_URI_TAGS,D):to,ae=T(s,"FORBID_CONTENTS")&&B(s.FORBID_CONTENTS)?_({},s.FORBID_CONTENTS,D):Xi,Qe=T(s,"FORBID_TAGS")&&B(s.FORBID_TAGS)?_({},s.FORBID_TAGS,D):W({}),Lt=T(s,"FORBID_ATTR")&&B(s.FORBID_ATTR)?_({},s.FORBID_ATTR,D):W({}),Oe=T(s,"USE_PROFILES")?s.USE_PROFILES&&typeof s.USE_PROFILES=="object"?W(s.USE_PROFILES):s.USE_PROFILES:!1,Vn=s.ALLOW_ARIA_ATTR!==!1,Wi=s.ALLOW_DATA_ATTR!==!1,Yn=s.ALLOW_UNKNOWN_PROTOCOLS||!1,Xn=s.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ge=s.SAFE_FOR_TEMPLATES||!1,et=s.SAFE_FOR_XML!==!1,Se=s.WHOLE_DOCUMENT||!1,De=s.RETURN_DOM||!1,Ct=s.RETURN_DOM_FRAGMENT||!1,Rt=s.RETURN_TRUSTED_TYPE||!1,Vi=s.FORCE_BODY||!1,Zn=s.SANITIZE_DOM!==!1,Jn=s.SANITIZE_NAMED_PROPS||!1,Yi=s.KEEP_CONTENT!==!1,tt=s.IN_PLACE||!1,Kn=oc(s.ALLOWED_URI_REGEXP)?s.ALLOWED_URI_REGEXP:To,Ne=typeof s.NAMESPACE=="string"?s.NAMESPACE:le,er=T(s,"MATHML_TEXT_INTEGRATION_POINTS")&&s.MATHML_TEXT_INTEGRATION_POINTS&&typeof s.MATHML_TEXT_INTEGRATION_POINTS=="object"?W(s.MATHML_TEXT_INTEGRATION_POINTS):_({},["mi","mo","mn","ms","mtext"]),tr=T(s,"HTML_INTEGRATION_POINTS")&&s.HTML_INTEGRATION_POINTS&&typeof s.HTML_INTEGRATION_POINTS=="object"?W(s.HTML_INTEGRATION_POINTS):_({},["annotation-xml"]);let c=T(s,"CUSTOM_ELEMENT_HANDLING")&&s.CUSTOM_ELEMENT_HANDLING&&typeof s.CUSTOM_ELEMENT_HANDLING=="object"?W(s.CUSTOM_ELEMENT_HANDLING):Be(null);if(L=Be(null),T(c,"tagNameCheck")&&ro(c.tagNameCheck)&&(L.tagNameCheck=c.tagNameCheck),T(c,"attributeNameCheck")&&ro(c.attributeNameCheck)&&(L.attributeNameCheck=c.attributeNameCheck),T(c,"allowCustomizedBuiltInElements")&&typeof c.allowCustomizedBuiltInElements=="boolean"&&(L.allowCustomizedBuiltInElements=c.allowCustomizedBuiltInElements),ge&&(Wi=!1),Ct&&(De=!0),Oe&&(F=_({},Eo),H=Be(null),Oe.html===!0&&(_(F,wo),_(H,ko)),Oe.svg===!0&&(_(F,lr),_(H,ur),_(H,Ft)),Oe.svgFilters===!0&&(_(F,cr),_(H,ur),_(H,Ft)),Oe.mathMl===!0&&(_(F,dr),_(H,So),_(H,Ft))),ve.tagCheck=null,ve.attributeCheck=null,T(s,"ADD_TAGS")&&(typeof s.ADD_TAGS=="function"?ve.tagCheck=s.ADD_TAGS:B(s.ADD_TAGS)&&(F===Wn&&(F=W(F)),_(F,s.ADD_TAGS,D))),T(s,"ADD_ATTR")&&(typeof s.ADD_ATTR=="function"?ve.attributeCheck=s.ADD_ATTR:B(s.ADD_ATTR)&&(H===Gn&&(H=W(H)),_(H,s.ADD_ATTR,D))),T(s,"ADD_URI_SAFE_ATTR")&&B(s.ADD_URI_SAFE_ATTR)&&_(Zi,s.ADD_URI_SAFE_ATTR,D),T(s,"FORBID_CONTENTS")&&B(s.FORBID_CONTENTS)&&(ae===Xi&&(ae=W(ae)),_(ae,s.FORBID_CONTENTS,D)),T(s,"ADD_FORBID_CONTENTS")&&B(s.ADD_FORBID_CONTENTS)&&(ae===Xi&&(ae=W(ae)),_(ae,s.ADD_FORBID_CONTENTS,D)),Yi&&(F["#text"]=!0),Se&&_(F,["html","head","body"]),F.table&&(_(F,["tbody"]),delete Qe.tbody),s.TRUSTED_TYPES_POLICY){if(typeof s.TRUSTED_TYPES_POLICY.createHTML!="function")throw Nt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof s.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Nt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');z=s.TRUSTED_TYPES_POLICY,ke=z.createHTML("")}else z===void 0&&(z=gc(w,n)),z!==null&&typeof ke=="string"&&(ke=z.createHTML(""));U&&U(s),Fe=s},no=_({},[...lr,...cr,...sc]),oo=_({},[...dr,...ac]),$l=function(s){let c=se(s);(!c||!c.tagName)&&(c={namespaceURI:Ne,tagName:"template"});let h=ot(s.tagName),x=ot(c.tagName);return Qi[s.namespaceURI]?s.namespaceURI===Mt?c.namespaceURI===le?h==="svg":c.namespaceURI===It?h==="svg"&&(x==="annotation-xml"||er[x]):!!no[h]:s.namespaceURI===It?c.namespaceURI===le?h==="math":c.namespaceURI===Mt?h==="math"&&tr[x]:!!oo[h]:s.namespaceURI===le?c.namespaceURI===Mt&&!tr[x]||c.namespaceURI===It&&!er[x]?!1:!oo[h]&&(Dl[h]||!no[h]):!!(it==="application/xhtml+xml"&&Qi[s.namespaceURI]):!1},J=function(s){He(e.removed,{element:s});try{se(s).removeChild(s)}catch{oe(s)}},Te=function(s,c){try{He(e.removed,{attribute:c.getAttributeNode(s),from:c})}catch{He(e.removed,{attribute:null,from:c})}if(c.removeAttribute(s),s==="is")if(De||Ct)try{J(c)}catch{}else try{c.setAttribute(s,"")}catch{}},so=function(s){let c=null,h=null;if(Vi)s="<remove></remove>"+s;else{let I=yo(s,/^[\r\n\t ]+/);h=I&&I[0]}it==="application/xhtml+xml"&&Ne===le&&(s='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+s+"</body></html>");let x=z?z.createHTML(s):s;if(Ne===le)try{c=new N().parseFromString(x,it)}catch{}if(!c||!c.documentElement){c=Ki.createDocument(Ne,"template",null);try{c.documentElement.innerHTML=Ji?ke:x}catch{}}let R=c.body||c.documentElement;return s&&h&&R.insertBefore(t.createTextNode(h),R.childNodes[0]||null),Ne===le?Sl.call(c,Se?"html":"body")[0]:Se?c.documentElement:R},ao=function(s){return Un.call(s.ownerDocument||s,s,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},lo=function(s){s.normalize();let c=Un.call(s.ownerDocument||s,s,m.SHOW_TEXT|m.SHOW_COMMENT|m.SHOW_CDATA_SECTION|m.SHOW_PROCESSING_INSTRUCTION,null),h=c.nextNode();for(;h;){let x=h.data;ze([kt,St,Tt],R=>{x=Pe(x,R," ")}),h.data=x,h=c.nextNode()}},rr=function(s){return s instanceof g&&(typeof s.nodeName!="string"||typeof s.textContent!="string"||typeof s.removeChild!="function"||!(s.attributes instanceof y)||typeof s.removeAttribute!="function"||typeof s.setAttribute!="function"||typeof s.namespaceURI!="string"||typeof s.insertBefore!="function"||typeof s.hasChildNodes!="function")},Dt=function(s){if(!Et||typeof s!="object"||s===null)return!1;try{return typeof Et(s)=="number"}catch{return!1}};function pe(b,s,c){ze(b,h=>{h.call(e,s,c,Fe)})}let co=function(s){let c=null;if(pe(q.beforeSanitizeElements,s,null),rr(s))return J(s),!0;let h=D(s.nodeName);if(pe(q.uponSanitizeElement,s,{tagName:h,allowedTags:F}),et&&s.hasChildNodes()&&!Dt(s.firstElementChild)&&P(/<[/\w!]/g,s.innerHTML)&&P(/<[/\w!]/g,s.textContent)||et&&s.namespaceURI===le&&h==="style"&&Dt(s.firstElementChild)||s.nodeType===qe.progressingInstruction||et&&s.nodeType===qe.comment&&P(/<[/\w]/g,s.data))return J(s),!0;if(Qe[h]||!(ve.tagCheck instanceof Function&&ve.tagCheck(h))&&!F[h]){if(!Qe[h]&&ho(h)&&(L.tagNameCheck instanceof RegExp&&P(L.tagNameCheck,h)||L.tagNameCheck instanceof Function&&L.tagNameCheck(h)))return!1;if(Yi&&!ae[h]){let x=se(s)||s.parentNode,R=Bn(s)||s.childNodes;if(R&&x){let I=R.length;for(let j=I-1;j>=0;--j){let ye=E(R[j],!0);x.insertBefore(ye,ue(s))}}}return J(s),!0}return s instanceof u&&!$l(s)||(h==="noscript"||h==="noembed"||h==="noframes")&&P(/<\/no(script|embed|frames)/i,s.innerHTML)?(J(s),!0):(ge&&s.nodeType===qe.text&&(c=s.textContent,ze([kt,St,Tt],x=>{c=Pe(c,x," ")}),s.textContent!==c&&(He(e.removed,{element:s.cloneNode()}),s.textContent=c)),pe(q.afterSanitizeElements,s,null),!1)},uo=function(s,c,h){if(Lt[c]||Zn&&(c==="id"||c==="name")&&(h in t||h in Fl))return!1;let x=H[c]||ve.attributeCheck instanceof Function&&ve.attributeCheck(c,s);if(!(Wi&&!Lt[c]&&P(Ll,c))){if(!(Vn&&P(Cl,c))){if(!x||Lt[c]){if(!(ho(s)&&(L.tagNameCheck instanceof RegExp&&P(L.tagNameCheck,s)||L.tagNameCheck instanceof Function&&L.tagNameCheck(s))&&(L.attributeNameCheck instanceof RegExp&&P(L.attributeNameCheck,c)||L.attributeNameCheck instanceof Function&&L.attributeNameCheck(c,s))||c==="is"&&L.allowCustomizedBuiltInElements&&(L.tagNameCheck instanceof RegExp&&P(L.tagNameCheck,h)||L.tagNameCheck instanceof Function&&L.tagNameCheck(h))))return!1}else if(!Zi[c]){if(!P(Kn,Pe(h,jn,""))){if(!((c==="src"||c==="xlink:href"||c==="href")&&s!=="script"&&_o(h,"data:")===0&&eo[s])){if(!(Yn&&!P(Rl,Pe(h,jn,"")))){if(h)return!1}}}}}}return!0},zl=_({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ho=function(s){return!zl[ot(s)]&&P(Il,s)},po=function(s){pe(q.beforeSanitizeAttributes,s,null);let c=s.attributes;if(!c||rr(s))return;let h={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:H,forceKeepAttr:void 0},x=c.length;for(;x--;){let R=c[x],I=R.name,j=R.namespaceURI,ye=R.value,me=D(I),or=ye,$=I==="value"?or:Ql(or);if(h.attrName=me,h.attrValue=$,h.keepAttr=!0,h.forceKeepAttr=void 0,pe(q.uponSanitizeAttribute,s,h),$=h.attrValue,Jn&&(me==="id"||me==="name")&&_o($,Qn)!==0&&(Te(I,s),$=Qn+$),et&&P(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,$)){Te(I,s);continue}if(me==="attributename"&&yo($,"href")){Te(I,s);continue}if(h.forceKeepAttr)continue;if(!h.keepAttr){Te(I,s);continue}if(!Xn&&P(/\/>/i,$)){Te(I,s);continue}ge&&ze([kt,St,Tt],fo=>{$=Pe($,fo," ")});let mo=D(s.nodeName);if(!uo(mo,me,$)){Te(I,s);continue}if(z&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!j)switch(w.getAttributeType(mo,me)){case"TrustedHTML":{$=z.createHTML($);break}case"TrustedScriptURL":{$=z.createScriptURL($);break}}if($!==or)try{j?s.setAttributeNS(j,I,$):s.setAttribute(I,$),rr(s)?J(s):go(e.removed)}catch{Te(I,s)}}pe(q.afterSanitizeAttributes,s,null)},nr=function(s){let c=null,h=ao(s);for(pe(q.beforeSanitizeShadowDOM,s,null);c=h.nextNode();)pe(q.uponSanitizeShadowNode,c,null),co(c),po(c),c.content instanceof o&&nr(c.content);pe(q.afterSanitizeShadowDOM,s,null)},Ot=function(s){if(s.nodeType===qe.element&&s.shadowRoot instanceof o){let x=s.shadowRoot;Ot(x),nr(x)}let c=s.childNodes;if(!c)return;let h=[];ze(c,x=>{He(h,x)});for(let x of h)Ot(x)};return e.sanitize=function(b){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=null,h=null,x=null,R=null;if(Ji=!b,Ji&&(b="<!-->"),typeof b!="string"&&!Dt(b)&&(b=nc(b),typeof b!="string"))throw Nt("dirty is not a string, aborting");if(!e.isSupported)return b;if(Gi||ir(s),e.removed=[],typeof b=="string"&&(tt=!1),tt){let ye=b.nodeName;if(typeof ye=="string"){let me=D(ye);if(!F[me]||Qe[me])throw Nt("root node is forbidden and cannot be sanitized in-place")}Ot(b)}else if(Dt(b))c=so("<!---->"),h=c.ownerDocument.importNode(b,!0),h.nodeType===qe.element&&h.nodeName==="BODY"||h.nodeName==="HTML"?c=h:c.appendChild(h),Ot(h);else{if(!De&&!ge&&!Se&&b.indexOf("<")===-1)return z&&Rt?z.createHTML(b):b;if(c=so(b),!c)return De?null:Rt?ke:""}c&&Vi&&J(c.firstChild);let I=ao(tt?b:c);for(;x=I.nextNode();)co(x),po(x),x.content instanceof o&&nr(x.content);if(tt)return ge&&lo(b),b;if(De){if(ge&&lo(c),Ct)for(R=kl.call(c.ownerDocument);c.firstChild;)R.appendChild(c.firstChild);else R=c;return(H.shadowroot||H.shadowrootmode)&&(R=Tl.call(r,R,!0)),R}let j=Se?c.outerHTML:c.innerHTML;return Se&&F["!doctype"]&&c.ownerDocument&&c.ownerDocument.doctype&&c.ownerDocument.doctype.name&&P(fc,c.ownerDocument.doctype.name)&&(j="<!DOCTYPE "+c.ownerDocument.doctype.name+`>
|
|
3
|
+
`+j),ge&&ze([kt,St,Tt],ye=>{j=Pe(j,ye," ")}),z&&Rt?z.createHTML(j):j},e.setConfig=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ir(b),Gi=!0},e.clearConfig=function(){Fe=null,Gi=!1},e.isValidAttribute=function(b,s,c){Fe||ir({});let h=D(b),x=D(s);return uo(h,x,c)},e.addHook=function(b,s){typeof s=="function"&&He(q[b],s)},e.removeHook=function(b,s){if(s!==void 0){let c=Zl(q[b],s);return c===-1?void 0:Jl(q[b],c,1)[0]}return go(q[b])},e.removeHooks=function(b){q[b]=[]},e.removeAllHooks=function(){q=Lo()},e}var Co,vo,Vl,Yl,Xl,U,Z,Be,Ro,hr,pr,ze,Zl,go,He,Jl,B,ot,ar,yo,Pe,_o,Ql,ec,tc,xo,Ao,T,nt,P,Nt,wo,lr,cr,sc,dr,ac,Eo,ko,ur,So,Ft,lc,cc,dc,uc,hc,To,pc,mc,fc,bc,qe,vc,gc,Lo,C,Mo=d(()=>{Co=Object.entries,vo=Object.setPrototypeOf,Vl=Object.isFrozen,Yl=Object.getPrototypeOf,Xl=Object.getOwnPropertyDescriptor,U=Object.freeze,Z=Object.seal,Be=Object.create,Ro=typeof Reflect<"u"&&Reflect,hr=Ro.apply,pr=Ro.construct;U||(U=function(e){return e});Z||(Z=function(e){return e});hr||(hr=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];return e.apply(t,n)});pr||(pr=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return new e(...r)});ze=M(Array.prototype.forEach),Zl=M(Array.prototype.lastIndexOf),go=M(Array.prototype.pop),He=M(Array.prototype.push),Jl=M(Array.prototype.splice),B=Array.isArray,ot=M(String.prototype.toLowerCase),ar=M(String.prototype.toString),yo=M(String.prototype.match),Pe=M(String.prototype.replace),_o=M(String.prototype.indexOf),Ql=M(String.prototype.trim),ec=M(Number.prototype.toString),tc=M(Boolean.prototype.toString),xo=typeof BigInt>"u"?null:M(BigInt.prototype.toString),Ao=typeof Symbol>"u"?null:M(Symbol.prototype.toString),T=M(Object.prototype.hasOwnProperty),nt=M(Object.prototype.toString),P=M(RegExp.prototype.test),Nt=ic(TypeError);wo=U(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),lr=U(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),cr=U(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),sc=U(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),dr=U(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ac=U(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Eo=U(["#text"]),ko=U(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),ur=U(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),So=U(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ft=U(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),lc=Z(/{{[\w\W]*|^[\w\W]*}}/g),cc=Z(/<%[\w\W]*|^[\w\W]*%>/g),dc=Z(/\${[\w\W]*/g),uc=Z(/^data-[\-\w.\u00B7-\uFFFF]+$/),hc=Z(/^aria-[\-\w]+$/),To=Z(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),pc=Z(/^(?:\w+script|data):/i),mc=Z(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),fc=Z(/^html$/i),bc=Z(/^[a-z][.\w]*(-[.\w]+)+$/i),qe={element:1,text:3,progressingInstruction:7,comment:8,document:9},vc=function(){return typeof window>"u"?null:window},gc=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(r=t.getAttribute(n));let o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},Lo=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};C=Io()});var Do={};f(Do,{addHook:()=>Ac,clearConfig:()=>Tc,clearWindow:()=>Ic,default:()=>yc,isSupported:()=>xc,isValidAttribute:()=>Lc,removeAllHooks:()=>kc,removeHook:()=>wc,removeHooks:()=>Ec,removed:()=>Rc,sanitize:()=>_c,setConfig:()=>Sc,version:()=>Cc});function Ic(){}var yc,_c,xc,Ac,wc,Ec,kc,Sc,Tc,Lc,Cc,Rc,Oo=d(()=>{Mo();yc=C,_c=C.sanitize.bind(C),xc=C.isSupported,Ac=C.addHook.bind(C),wc=C.removeHook.bind(C),Ec=C.removeHooks.bind(C),kc=C.removeAllHooks.bind(C),Sc=C.setConfig.bind(C),Tc=C.clearConfig.bind(C),Lc=C.isValidAttribute.bind(C),Cc=C.version,Rc=C.removed});function p(i){return typeof i!="string"?"":i.replace(Dc,e=>Mc[e])}function mr(i){return typeof i!="string"?"":i.replace(Oc,"")}function fe(i){return p(mr(i))}function Ce(i,e){if(typeof i!="string")return"";let t=i.trim();if(!t||/^\s*javascript:/i.test(t)||/^\s*vbscript:/i.test(t)||Fc.test(t)||/^data:/i.test(t)&&!No.test(t))return"";try{let r=new URL(t,e||(typeof location<"u"?location.href:"https://example.invalid/"));return!Nc.has(r.protocol)||r.protocol==="data:"&&!No.test(r.href)?"":r.href}catch{return t.startsWith("#")||t.startsWith("/")?t:""}}function Fo(i,e){if(typeof i!="string")return"#";let t=i.trim();return t?t.startsWith("#")||t.startsWith("/")&&!t.startsWith("//")?t:/^https?:\/\//i.test(t)?Ce(t,e)||"#":/^\s*javascript:/i.test(t)||/^\s*vbscript:/i.test(t)?"#":t:"#"}function $o(i){let e=String(i||"text").toLowerCase();return $c.has(e)?e:"text"}async function zc(){if(st)return st;try{let i=await Promise.resolve().then(()=>(Oo(),Do));st=i.default||i}catch{st=null}return st}async function zo(i){if(typeof i!="string")return"";let e=await zc();return e?.sanitize?e.sanitize(i,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:Hc,ADD_ATTR:Pc,FORBID_TAGS:["script","foreignObject","iframe","object","embed"],FORBID_ATTR:["onload","onerror","onclick","onmouseover"]}):i.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/\s+on\w+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/<foreignObject[\s\S]*?<\/foreignObject>/gi,"")}function Ho(){return $t||(typeof window<"u"&&window.trustedTypes?.createPolicy&&($t=window.trustedTypes.createPolicy("velinstyle",{createHTML:i=>p(i)})),$t)}function qc(i){let e=Ho(),t=p(mr(i));return e?.createHTML?e.createHTML(t):t}var Mc,Dc,Oc,Nc,Fc,No,$c,st,Hc,Pc,$t,k=d(()=>{Mc={"&":"&","<":"<",">":">",'"':""","'":"'"},Dc=/[&<>"']/g,Oc=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g,Nc=new Set(["http:","https:","data:","mailto:","tel:"]),Fc=/^data:(?:text\/html|image\/svg\+xml|application\/xml)/i,No=/^data:image\/(png|jpeg|jpg|gif|webp|avif);base64,/i,$c=new Set(["text","password","email","search","tel","url","number"]);st=null;Hc=["svg","g","path","circle","rect","line","polyline","polygon","ellipse","defs","use","symbol","title","desc","clipPath","mask","linearGradient","radialGradient","stop","pattern","text","tspan"],Pc=["viewBox","xmlns","fill","stroke","stroke-width","stroke-linecap","stroke-linejoin","d","cx","cy","r","rx","ry","x","y","width","height","x1","y1","x2","y2","points","transform","opacity","class","id","href","xlink:href","aria-hidden","aria-label","aria-labelledby","role","focusable","clip-path","mask","offset","stop-color","stop-opacity","gradientUnits","gradientTransform","spreadMethod","fx","fy","patternUnits","patternContentUnits","preserveAspectRatio"];$t=null});var qo={};f(qo,{default:()=>Po});var Bc,zt,Po,fr=d(()=>{K();k();Bc=`
|
|
4
4
|
:host {
|
|
5
5
|
display: contents;
|
|
6
6
|
}
|
|
@@ -83,7 +83,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
83
83
|
.overlay, .dialog { transition: none; }
|
|
84
84
|
}
|
|
85
85
|
`,zt=class extends HTMLElement{static get observedAttributes(){return["open"]}constructor(){super(),this.attachShadow({mode:"open",delegatesFocus:!0}),this._previouslyFocused=null,this._onKeydown=this._onKeydown.bind(this)}connectedCallback(){let e=(this.getAttribute("title")||"").trim(),t=p(e),r=e?'aria-labelledby="velin-modal-title"':`aria-label="${p(this.getAttribute("aria-label")||"Dialog")}"`;this.shadowRoot.innerHTML=`
|
|
86
|
-
<style>${
|
|
86
|
+
<style>${Bc}</style>
|
|
87
87
|
<div class="overlay" part="overlay">
|
|
88
88
|
<div class="dialog" role="dialog" aria-modal="true" ${r} part="dialog">
|
|
89
89
|
<div class="header" part="header">
|
|
@@ -94,7 +94,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
94
94
|
<div class="footer" part="footer"><slot name="footer"></slot></div>
|
|
95
95
|
</div>
|
|
96
96
|
</div>
|
|
97
|
-
`,this.shadowRoot.querySelector(".close-btn").addEventListener("click",()=>this.close()),this.shadowRoot.querySelector(".overlay").addEventListener("click",n=>{n.target===n.currentTarget&&this.close()})}attributeChangedCallback(e,t,r){e==="open"&&(r!==null?this._open():this._close())}open(){this.setAttribute("open","")}close(){this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}_open(){this._previouslyFocused=
|
|
97
|
+
`,this.shadowRoot.querySelector(".close-btn").addEventListener("click",()=>this.close()),this.shadowRoot.querySelector(".overlay").addEventListener("click",n=>{n.target===n.currentTarget&&this.close()})}attributeChangedCallback(e,t,r){e==="open"&&(r!==null?this._open():this._close())}open(){this.setAttribute("open","")}close(){this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}_open(){this._previouslyFocused=Q(),te(this),document.addEventListener("keydown",this._onKeydown),document.body.style.overflow="hidden",requestAnimationFrame(()=>{let e=ce(this.shadowRoot);e.length>0&&e[0].focus()})}_close(){document.removeEventListener("keydown",this._onKeydown),document.body.style.overflow="",ie(),ee(this._previouslyFocused)}_onKeydown(e){if(e.key==="Escape"){this.close();return}Y(this.shadowRoot,e)}disconnectedCallback(){document.removeEventListener("keydown",this._onKeydown),document.body.style.overflow=""}};customElements.define("velin-modal",zt);Po=zt});var Uo={};f(Uo,{default:()=>Bo});var Uc,Ht,Bo,br=d(()=>{K();Uc=`
|
|
98
98
|
:host {
|
|
99
99
|
display: inline-block;
|
|
100
100
|
position: relative;
|
|
@@ -144,13 +144,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
144
144
|
@media (prefers-reduced-motion: reduce) {
|
|
145
145
|
.menu { transition: none; }
|
|
146
146
|
}
|
|
147
|
-
`,
|
|
148
|
-
<style>${
|
|
147
|
+
`,Ht=class extends HTMLElement{static get observedAttributes(){return["open"]}constructor(){super(),this.attachShadow({mode:"open",delegatesFocus:!0}),this._onDocClick=this._onDocClick.bind(this),this._onKeydown=this._onKeydown.bind(this),this._typeahead="",this._typeaheadTimer=null}connectedCallback(){let e=this.getAttribute("align")||"start";this.shadowRoot.innerHTML=`
|
|
148
|
+
<style>${Uc}</style>
|
|
149
149
|
<slot name="trigger"></slot>
|
|
150
150
|
<div class="menu ${e==="end"?"menu-end":""}" role="menu" part="menu">
|
|
151
151
|
<slot></slot>
|
|
152
152
|
</div>
|
|
153
|
-
`;let t=this.shadowRoot.querySelector('slot[name="trigger"]'),r=this.shadowRoot.querySelector("slot:not([name])");t.addEventListener("click",()=>this.toggle()),t.addEventListener("slotchange",()=>{let n=t.assignedElements()[0];if(n){n.setAttribute("aria-haspopup","menu"),n.setAttribute("aria-expanded",this.hasAttribute("open")?"true":"false");let o=this._menuId||(this._menuId=`velin-dropdown-menu-${Math.random().toString(36).slice(2,9)}`);n.setAttribute("aria-controls",o),this.shadowRoot.querySelector(".menu")?.setAttribute("id",o)}}),r?.addEventListener("slotchange",()=>this._normalizeMenuItems()),this._normalizeMenuItems(),this.addEventListener("keydown",this._onKeydown)}_normalizeMenuItems(){this._getMenuItems().forEach((t,r)=>{t.hasAttribute("role")||t.setAttribute("role","menuitem"),t.setAttribute("tabindex",r===0?"0":"-1")})}toggle(){this.hasAttribute("open")?this.close():this.open()}open(){this.setAttribute("open","");let e=this.querySelector('[slot="trigger"]');e&&e.setAttribute("aria-expanded","true"),document.addEventListener("click",this._onDocClick,!0),requestAnimationFrame(()=>{let t=this._getMenuItems();t.length>0&&t[0].focus()})}close(){this.removeAttribute("open");let e=this.querySelector('[slot="trigger"]');e&&e.setAttribute("aria-expanded","false"),document.removeEventListener("click",this._onDocClick,!0),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}_getMenuItems(){let e=this.shadowRoot.querySelector("slot:not([name])");return e?e.assignedElements().filter(t=>!t.hasAttribute("disabled")):[]}_onDocClick(e){this.contains(e.target)||this.close()}_onKeydown(e){if(e.key==="Escape"){this.close();let r=this.querySelector('[slot="trigger"]');r&&r.focus();return}let t=this._getMenuItems();if(t.length!==0){if(e.key.length===1&&/[a-z0-9]/i.test(e.key)){clearTimeout(this._typeaheadTimer),this._typeahead+=e.key.toLowerCase(),this._typeaheadTimer=setTimeout(()=>{this._typeahead=""},500);let r=t.find(n=>(n.textContent?.trim().toLowerCase()||"").startsWith(this._typeahead));r&&(e.preventDefault(),t.forEach(n=>n.setAttribute("tabindex",n===r?"0":"-1")),r.focus());return}
|
|
153
|
+
`;let t=this.shadowRoot.querySelector('slot[name="trigger"]'),r=this.shadowRoot.querySelector("slot:not([name])");t.addEventListener("click",()=>this.toggle()),t.addEventListener("slotchange",()=>{let n=t.assignedElements()[0];if(n){n.setAttribute("aria-haspopup","menu"),n.setAttribute("aria-expanded",this.hasAttribute("open")?"true":"false");let o=this._menuId||(this._menuId=`velin-dropdown-menu-${Math.random().toString(36).slice(2,9)}`);n.setAttribute("aria-controls",o),this.shadowRoot.querySelector(".menu")?.setAttribute("id",o)}}),r?.addEventListener("slotchange",()=>this._normalizeMenuItems()),this._normalizeMenuItems(),this.addEventListener("keydown",this._onKeydown)}_normalizeMenuItems(){this._getMenuItems().forEach((t,r)=>{t.hasAttribute("role")||t.setAttribute("role","menuitem"),t.setAttribute("tabindex",r===0?"0":"-1")})}toggle(){this.hasAttribute("open")?this.close():this.open()}open(){this.setAttribute("open","");let e=this.querySelector('[slot="trigger"]');e&&e.setAttribute("aria-expanded","true"),document.addEventListener("click",this._onDocClick,!0),requestAnimationFrame(()=>{let t=this._getMenuItems();t.length>0&&t[0].focus()})}close(){this.removeAttribute("open");let e=this.querySelector('[slot="trigger"]');e&&e.setAttribute("aria-expanded","false"),document.removeEventListener("click",this._onDocClick,!0),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}_getMenuItems(){let e=this.shadowRoot.querySelector("slot:not([name])");return e?e.assignedElements().filter(t=>!t.hasAttribute("disabled")):[]}_onDocClick(e){this.contains(e.target)||this.close()}_onKeydown(e){if(e.key==="Escape"){this.close();let r=this.querySelector('[slot="trigger"]');r&&r.focus();return}let t=this._getMenuItems();if(t.length!==0){if(e.key.length===1&&/[a-z0-9]/i.test(e.key)){clearTimeout(this._typeaheadTimer),this._typeahead+=e.key.toLowerCase(),this._typeaheadTimer=setTimeout(()=>{this._typeahead=""},500);let r=t.find(n=>(n.textContent?.trim().toLowerCase()||"").startsWith(this._typeahead));r&&(e.preventDefault(),t.forEach(n=>n.setAttribute("tabindex",n===r?"0":"-1")),r.focus());return}X(this,t,e)}}disconnectedCallback(){document.removeEventListener("click",this._onDocClick,!0)}};customElements.define("velin-dropdown",Ht);Bo=Ht});var Ko={};f(Ko,{default:()=>jo});var jc,Pt,jo,vr=d(()=>{jc=`
|
|
154
154
|
:host {
|
|
155
155
|
display: block;
|
|
156
156
|
border: 1px solid var(--velin-color-border, #ddd);
|
|
@@ -191,9 +191,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
191
191
|
border-block-start: 1px solid var(--velin-color-border, #e2e8f0);
|
|
192
192
|
}
|
|
193
193
|
`,Pt=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this._onToggle=this._onToggle.bind(this)}connectedCallback(){this.shadowRoot.innerHTML=`
|
|
194
|
-
<style>${
|
|
194
|
+
<style>${jc}</style>
|
|
195
195
|
<slot></slot>
|
|
196
|
-
`,this._exclusive=this.hasAttribute("exclusive"),this._wireDetails(),this.addEventListener("toggle",this._onToggle,!0),this.addEventListener("keydown",this._onKeydown.bind(this))}_wireDetails(){let e=0;for(let t of this.querySelectorAll("details")){let r=t.querySelector("summary"),n=t.querySelector(":scope > :not(summary)"),o=n?.id||`velin-accordion-panel-${++e}`;n&&!n.id&&(n.id=o),r&&n&&r.setAttribute("aria-controls",o)}}_onToggle(e){if(!this._exclusive)return;let t=e.target;if(!t.open)return;[...this.querySelectorAll("details")].forEach(n=>{n!==t&&n.open&&(n.open=!1)})}_onKeydown(e){let t=[...this.querySelectorAll("summary")],r=t.indexOf(e.target);if(r===-1)return;let n;switch(e.key){case"ArrowDown":e.preventDefault(),n=(r+1)%t.length;break;case"ArrowUp":e.preventDefault(),n=(r-1+t.length)%t.length;break;case"Home":e.preventDefault(),n=0;break;case"End":e.preventDefault(),n=t.length-1;break;default:return}t[n].focus()}disconnectedCallback(){this.removeEventListener("toggle",this._onToggle,!0)}};customElements.define("velin-accordion",Pt);
|
|
196
|
+
`,this._exclusive=this.hasAttribute("exclusive"),this._wireDetails(),this.addEventListener("toggle",this._onToggle,!0),this.addEventListener("keydown",this._onKeydown.bind(this))}_wireDetails(){let e=0;for(let t of this.querySelectorAll("details")){let r=t.querySelector("summary"),n=t.querySelector(":scope > :not(summary)"),o=n?.id||`velin-accordion-panel-${++e}`;n&&!n.id&&(n.id=o),r&&n&&r.setAttribute("aria-controls",o)}}_onToggle(e){if(!this._exclusive)return;let t=e.target;if(!t.open)return;[...this.querySelectorAll("details")].forEach(n=>{n!==t&&n.open&&(n.open=!1)})}_onKeydown(e){let t=[...this.querySelectorAll("summary")],r=t.indexOf(e.target);if(r===-1)return;let n;switch(e.key){case"ArrowDown":e.preventDefault(),n=(r+1)%t.length;break;case"ArrowUp":e.preventDefault(),n=(r-1+t.length)%t.length;break;case"Home":e.preventDefault(),n=0;break;case"End":e.preventDefault(),n=t.length-1;break;default:return}t[n].focus()}disconnectedCallback(){this.removeEventListener("toggle",this._onToggle,!0)}};customElements.define("velin-accordion",Pt);jo=Pt});var Go={};f(Go,{default:()=>Wo});var Kc,qt,Wo,gr=d(()=>{K();Kc=`
|
|
197
197
|
:host {
|
|
198
198
|
display: block;
|
|
199
199
|
}
|
|
@@ -236,14 +236,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
236
236
|
display: none;
|
|
237
237
|
}
|
|
238
238
|
`,qt=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open",delegatesFocus:!0}),this._onTabClick=this._onTabClick.bind(this),this._onKeydown=this._onKeydown.bind(this)}connectedCallback(){this.shadowRoot.innerHTML=`
|
|
239
|
-
<style>${
|
|
239
|
+
<style>${Kc}</style>
|
|
240
240
|
<div class="tablist" role="tablist" part="tablist">
|
|
241
241
|
<slot name="tab"></slot>
|
|
242
242
|
</div>
|
|
243
243
|
<div class="panels" part="panels">
|
|
244
244
|
<slot name="panel"></slot>
|
|
245
245
|
</div>
|
|
246
|
-
`,this.addEventListener("click",this._onTabClick),this.addEventListener("keydown",this._onKeydown),requestAnimationFrame(()=>this._initTabs())}_initTabs(){let e=this._getTabs(),t=this._getPanels();e.forEach((n,o)=>{n.setAttribute("role","tab"),n.setAttribute("slot","tab"),n.id||(n.id=`velin-tab-${o}`);let a=t[o];a&&(a.setAttribute("role","tabpanel"),a.setAttribute("slot","panel"),a.id||(a.id=`velin-panel-${o}`),n.setAttribute("aria-controls",a.id),a.setAttribute("aria-labelledby",n.id))});let r=e.find(n=>n.getAttribute("aria-selected")==="true")||e[0];r&&this._selectTab(r)}_getTabs(){return[...this.querySelectorAll('[role="tab"], [slot="tab"]')]}_getPanels(){return[...this.querySelectorAll('[role="tabpanel"], [slot="panel"]')]}_onTabClick(e){let t=e.target.closest('[role="tab"]');t&&this.contains(t)&&this._selectTab(t)}_selectTab(e){let t=this._getTabs(),r=this._getPanels();t.forEach((n,o)=>{let a=n===e;n.setAttribute("aria-selected",String(a)),n.setAttribute("tabindex",a?"0":"-1"),r[o]&&(r[o].hidden=!a)}),this.dispatchEvent(new CustomEvent("velin-tab-change",{bubbles:!0,detail:{tab:e}}))}_onKeydown(e){let t=this._getTabs();if(t.includes(e.target)&&(
|
|
246
|
+
`,this.addEventListener("click",this._onTabClick),this.addEventListener("keydown",this._onKeydown),requestAnimationFrame(()=>this._initTabs())}_initTabs(){let e=this._getTabs(),t=this._getPanels();e.forEach((n,o)=>{n.setAttribute("role","tab"),n.setAttribute("slot","tab"),n.id||(n.id=`velin-tab-${o}`);let a=t[o];a&&(a.setAttribute("role","tabpanel"),a.setAttribute("slot","panel"),a.id||(a.id=`velin-panel-${o}`),n.setAttribute("aria-controls",a.id),a.setAttribute("aria-labelledby",n.id))});let r=e.find(n=>n.getAttribute("aria-selected")==="true")||e[0];r&&this._selectTab(r)}_getTabs(){return[...this.querySelectorAll('[role="tab"], [slot="tab"]')]}_getPanels(){return[...this.querySelectorAll('[role="tabpanel"], [slot="panel"]')]}_onTabClick(e){let t=e.target.closest('[role="tab"]');t&&this.contains(t)&&this._selectTab(t)}_selectTab(e){let t=this._getTabs(),r=this._getPanels();t.forEach((n,o)=>{let a=n===e;n.setAttribute("aria-selected",String(a)),n.setAttribute("tabindex",a?"0":"-1"),r[o]&&(r[o].hidden=!a)}),this.dispatchEvent(new CustomEvent("velin-tab-change",{bubbles:!0,detail:{tab:e}}))}_onKeydown(e){let t=this._getTabs();if(t.includes(e.target)&&(X(this,t,e),e.key==="ArrowRight"||e.key==="ArrowLeft"||e.key==="Home"||e.key==="End")){let r=t.find(n=>n.getAttribute("tabindex")==="0");r&&this._selectTab(r)}}disconnectedCallback(){this.removeEventListener("click",this._onTabClick),this.removeEventListener("keydown",this._onKeydown)}};customElements.define("velin-tabs",qt);Wo=qt});var Yo={};f(Yo,{default:()=>Vo});var Wc,Bt,Vo,yr=d(()=>{k();Wc=`
|
|
247
247
|
:host {
|
|
248
248
|
position: fixed;
|
|
249
249
|
z-index: var(--velin-z-toast, 600);
|
|
@@ -305,10 +305,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
305
305
|
@media (prefers-reduced-motion: reduce) {
|
|
306
306
|
.toast, .toast--out { animation: none; }
|
|
307
307
|
}
|
|
308
|
-
`,
|
|
308
|
+
`,Bt=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this._container=null}connectedCallback(){this.shadowRoot.innerHTML=`<style>${Wc}</style>`,this._container=this.shadowRoot,this.setAttribute("role","status"),this.setAttribute("aria-live","polite"),this.setAttribute("aria-atomic","true")}show({message:e,type:t="info",duration:r=5e3}={}){let n=t==="error"||t==="danger";this.setAttribute("role",n?"alert":"status"),this.setAttribute("aria-live",n?"assertive":"polite");let o=document.createElement("div");return o.className=`toast toast--${t}`,o.setAttribute("role",n?"alert":"status"),o.innerHTML=`
|
|
309
309
|
<div class="toast-content">${p(e)}</div>
|
|
310
310
|
<button class="toast-close" aria-label="Close">×</button>
|
|
311
|
-
`,o.querySelector(".toast-close").addEventListener("click",()=>{this._dismiss(o)}),this._container.appendChild(o),r>0&&setTimeout(()=>this._dismiss(o),r),o}_dismiss(e){!e||!e.parentNode||(e.classList.add("toast--out"),e.addEventListener("animationend",()=>e.remove(),{once:!0}),setTimeout(()=>e.remove(),300))}};customElements.define("velin-toast",
|
|
311
|
+
`,o.querySelector(".toast-close").addEventListener("click",()=>{this._dismiss(o)}),this._container.appendChild(o),r>0&&setTimeout(()=>this._dismiss(o),r),o}_dismiss(e){!e||!e.parentNode||(e.classList.add("toast--out"),e.addEventListener("animationend",()=>e.remove(),{once:!0}),setTimeout(()=>e.remove(),300))}};customElements.define("velin-toast",Bt);Vo=Bt});var Zo={};f(Zo,{default:()=>Xo});function Gc(i,e){let t=jt[i];return e&&t?.[e]?t[e]:Ut[i]}var Ut,jt,_r,Kt,Xo,xr=d(()=>{k();Ut={lucide:"https://unpkg.com/lucide-static@latest/icons/{name}.svg",heroicons:"https://unpkg.com/heroicons@2/24/outline/{name}.svg",bootstrap:"https://unpkg.com/bootstrap-icons@latest/icons/{name}.svg",material:"https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsoutlined/{name}/default/24px.svg",fontawesome:"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/svgs/solid/{name}.svg"},jt={fontawesome:{regular:"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/svgs/regular/{name}.svg",solid:"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/svgs/solid/{name}.svg",brands:"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/svgs/brands/{name}.svg"},heroicons:{outline:"https://unpkg.com/heroicons@2/24/outline/{name}.svg",solid:"https://unpkg.com/heroicons@2/24/solid/{name}.svg",mini:"https://unpkg.com/heroicons@2/20/solid/{name}.svg"}};_r=new Map,Kt=class extends HTMLElement{static get observedAttributes(){return["name","size","label","provider","variant","sprite"]}constructor(){super(),this._rendered=!1}connectedCallback(){this._render()}attributeChangedCallback(){this._rendered&&this._render()}_render(){let e=this.getAttribute("name"),t=this.getAttribute("size")||"24",r=this._resolveA11y(),n=this.getAttribute("provider"),o=this.getAttribute("variant");if(!e){this.innerHTML="";return}if(n&&(Ut[n]||jt[n])){this._renderFromCDN(e,t,r,n,o);return}this._renderFromSprite(e,t,r)}_resolveA11y(){let e=(this.getAttribute("label")||this.getAttribute("aria-label")||"").trim();return e?{label:e,hidden:!1}:{label:"",hidden:this.getAttribute("aria-hidden")!=="false"}}_renderFromSprite(e,t,r){let n="http://www.w3.org/2000/svg",o=document.createElementNS(n,"svg");o.setAttribute("width",t),o.setAttribute("height",t),o.setAttribute("viewBox","0 0 24 24"),o.setAttribute("fill","none"),o.setAttribute("stroke","currentColor"),o.setAttribute("stroke-width","2"),o.setAttribute("stroke-linecap","round"),o.setAttribute("stroke-linejoin","round"),this._applyStyle(o);let a=document.createElementNS(n,"use"),l=this.getAttribute("sprite"),u=document.getElementById(e),m=u&&u.tagName&&u.tagName.toLowerCase()==="symbol",v;l===""||l==null&&m?v=`#${e}`:v=`${Ce(l||"/dist/velin-icons.svg")||"/dist/velin-icons.svg"}#${e}`,a.setAttribute("href",v),o.appendChild(a),this._applyA11y(o,r),this.innerHTML="",this.appendChild(o),this._rendered=!0}async _renderFromCDN(e,t,r,n,o){let a=`${n}:${o||"default"}:${e}`;if(_r.has(a)){this._injectSVG(_r.get(a),t,r);return}let l=Gc(n,o);if(!l){this._renderFromSprite(e,t,r);return}let u=Ce(l.replace("{name}",e));if(!u){this._renderFromSprite(e,t,r);return}try{let m=await fetch(u);if(!m.ok)throw new Error(`${m.status}`);let v=await m.text();if(!v.includes("<svg"))throw new Error("Not SVG");let y=await zo(v);_r.set(a,y),this._injectSVG(y,t,r)}catch{this._renderFromSprite(e,t,r)}}_stripForeignA11y(e){e.removeAttribute("role"),e.removeAttribute("aria-label"),e.removeAttribute("aria-labelledby"),e.removeAttribute("aria-hidden"),e.querySelector("title")?.remove(),e.querySelector("desc")?.remove()}_injectSVG(e,t,r){let a=new DOMParser().parseFromString(e,"image/svg+xml").querySelector("svg");if(!a){this.innerHTML="";return}this._stripForeignA11y(a),a.setAttribute("width",t),a.setAttribute("height",t),a.getAttribute("viewBox")||a.setAttribute("viewBox","0 0 24 24"),this._applyStyle(a),this._applyA11y(a,r),this.innerHTML="",this.appendChild(document.importNode(a,!0)),this._rendered=!0}_applyStyle(e){e.style.display="inline-block",e.style.verticalAlign="middle",e.style.flexShrink="0"}_applyA11y(e,t){let{label:r,hidden:n}=t,o=e.querySelector("use");r?(e.setAttribute("role","img"),e.setAttribute("aria-label",r),e.removeAttribute("aria-hidden"),e.removeAttribute("focusable"),o&&o.removeAttribute("aria-hidden")):n&&(e.setAttribute("role","presentation"),e.setAttribute("aria-hidden","true"),e.setAttribute("focusable","false"),e.removeAttribute("aria-label"),o&&(o.setAttribute("aria-hidden","true"),o.setAttribute("focusable","false")))}static get providers(){return Object.keys(Ut)}static registerProvider(e,t,r){Ut[e]=t,r&&jt[e]&&Object.assign(jt[e],r)}};customElements.define("velin-icon",Kt);Xo=Kt});var Qo={};f(Qo,{default:()=>Jo});var Vc,Wt,Jo,Ar=d(()=>{K();k();Vc=`
|
|
312
312
|
:host { display: contents; }
|
|
313
313
|
.overlay {
|
|
314
314
|
position: fixed;
|
|
@@ -354,7 +354,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
354
354
|
.body { flex: 1; padding: var(--velin-space-5, 1.25rem); overflow-y: auto; }
|
|
355
355
|
@media (prefers-reduced-motion: reduce) { .overlay, .drawer { transition: none; } }
|
|
356
356
|
`,Wt=class extends HTMLElement{static get observedAttributes(){return["open"]}constructor(){super(),this.attachShadow({mode:"open",delegatesFocus:!0}),this._prev=null,this._onKey=this._onKey.bind(this)}connectedCallback(){let e=this.getAttribute("title")||"",t=p(e),r="velin-drawer-title";this.shadowRoot.innerHTML=`
|
|
357
|
-
<style>${
|
|
357
|
+
<style>${Vc}</style>
|
|
358
358
|
<div class="overlay" part="overlay"></div>
|
|
359
359
|
<div class="drawer" role="dialog" aria-modal="true" aria-labelledby="${r}" part="drawer">
|
|
360
360
|
<div class="header" part="header">
|
|
@@ -363,7 +363,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
363
363
|
</div>
|
|
364
364
|
<div class="body" part="body"><slot></slot></div>
|
|
365
365
|
</div>
|
|
366
|
-
`,this.shadowRoot.querySelector(".close-btn").addEventListener("click",()=>this.close()),this.shadowRoot.querySelector(".overlay").addEventListener("click",()=>this.close())}attributeChangedCallback(e){e==="open"&&(this.hasAttribute("open")?this._open():this._close())}open(){this.setAttribute("open","")}close(){this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}_open(){this._prev=
|
|
366
|
+
`,this.shadowRoot.querySelector(".close-btn").addEventListener("click",()=>this.close()),this.shadowRoot.querySelector(".overlay").addEventListener("click",()=>this.close())}attributeChangedCallback(e){e==="open"&&(this.hasAttribute("open")?this._open():this._close())}open(){this.setAttribute("open","")}close(){this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}_open(){this._prev=Q(),te(this),document.addEventListener("keydown",this._onKey),document.body.style.overflow="hidden",requestAnimationFrame(()=>{let e=ce(this.shadowRoot);e.length&&e[0].focus()})}_close(){document.removeEventListener("keydown",this._onKey),document.body.style.overflow="",ie(),ee(this._prev)}_onKey(e){if(e.key==="Escape"){this.close();return}Y(this.shadowRoot,e)}disconnectedCallback(){document.removeEventListener("keydown",this._onKey),document.body.style.overflow=""}};customElements.define("velin-drawer",Wt);Jo=Wt});var ts={};f(ts,{default:()=>es});function Zc(i,e){if(!i||Xc.has(i)||wr.has(i))return;if(document.querySelector(`link[data-velin-theme-css="${i}"]`)){wr.add(i);return}let r=document.createElement("link");r.rel="stylesheet",r.href=`${e.replace(/\/$/,"")}/${i}.min.css`,r.setAttribute("data-velin-theme-css",i),document.head.appendChild(r),wr.add(i)}var Yc,Xc,wr,Jc,Gt,es,Er=d(()=>{Yc=[{slug:"",label:"Default (Light)"},{slug:"dark",label:"Dark"},{slug:"brutalist",label:"Brutalist"},{slug:"corporate",label:"Corporate"},{slug:"earth",label:"Earth"},{slug:"forest",label:"Forest"},{slug:"midnight",label:"Midnight"},{slug:"neon",label:"Neon"},{slug:"nordic",label:"Nordic"},{slug:"ocean",label:"Ocean"},{slug:"pastel",label:"Pastel"},{slug:"retro",label:"Retro"},{slug:"sharp",label:"Sharp"},{slug:"soft",label:"Soft"},{slug:"sunset",label:"Sunset"}],Xc=new Set(["","dark"]),wr=new Set;Jc=`
|
|
367
367
|
:host { display: inline-flex; position: relative; }
|
|
368
368
|
.group {
|
|
369
369
|
display: inline-flex; align-items: stretch;
|
|
@@ -443,7 +443,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
443
443
|
border: 1px solid var(--velin-color-border, #ddd);
|
|
444
444
|
}
|
|
445
445
|
`,Gt=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this._onDocClick=this._onDocClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this)}connectedCallback(){this.shadowRoot.innerHTML=`
|
|
446
|
-
<style>${
|
|
446
|
+
<style>${Jc}</style>
|
|
447
447
|
<div class="group" part="group">
|
|
448
448
|
<button class="toggle" part="button" aria-label="Toggle dark mode" aria-pressed="false">
|
|
449
449
|
<svg class="sun" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true" focusable="false">
|
|
@@ -463,14 +463,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
463
463
|
</button>
|
|
464
464
|
</div>
|
|
465
465
|
<ul class="menu" role="menu" aria-label="Theme selection" hidden></ul>
|
|
466
|
-
`,this._target=document.querySelector(this.getAttribute("target")||"html"),this._themesBase=this.getAttribute("themes-base")||"dist/themes",this._menu=this.shadowRoot.querySelector(".menu"),this._toggleBtn=this.shadowRoot.querySelector(".toggle"),this._pickerBtn=this.shadowRoot.querySelector(".picker"),this._renderMenu(),this._initPreference(),this._syncTogglePressed(),this._toggleBtn.addEventListener("click",()=>this._toggleDarkMode()),this._pickerBtn.addEventListener("click",t=>{t.stopPropagation(),this._toggleMenu()}),document.addEventListener("click",this._onDocClick),this.shadowRoot.addEventListener("keydown",this._onKeyDown),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>this._applyFromPreference()),window.addEventListener("storage",t=>{t.key==="velin-theme"&&this._readStorage()})}disconnectedCallback(){document.removeEventListener("click",this._onDocClick)}_renderMenu(){this._menu.innerHTML=
|
|
466
|
+
`,this._target=document.querySelector(this.getAttribute("target")||"html"),this._themesBase=this.getAttribute("themes-base")||"dist/themes",this._menu=this.shadowRoot.querySelector(".menu"),this._toggleBtn=this.shadowRoot.querySelector(".toggle"),this._pickerBtn=this.shadowRoot.querySelector(".picker"),this._renderMenu(),this._initPreference(),this._syncTogglePressed(),this._toggleBtn.addEventListener("click",()=>this._toggleDarkMode()),this._pickerBtn.addEventListener("click",t=>{t.stopPropagation(),this._toggleMenu()}),document.addEventListener("click",this._onDocClick),this.shadowRoot.addEventListener("keydown",this._onKeyDown),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>this._applyFromPreference()),window.addEventListener("storage",t=>{t.key==="velin-theme"&&this._readStorage()})}disconnectedCallback(){document.removeEventListener("click",this._onDocClick)}_renderMenu(){this._menu.innerHTML=Yc.map(e=>`
|
|
467
467
|
<li role="none">
|
|
468
468
|
<button type="button" role="menuitem" data-theme="${e.slug}">
|
|
469
469
|
<span class="swatch" aria-hidden="true" data-theme-swatch="${e.slug}"></span>
|
|
470
470
|
${e.label}
|
|
471
471
|
</button>
|
|
472
472
|
</li>
|
|
473
|
-
`).join(""),this._menu.removeAttribute("hidden"),this._menu.querySelectorAll("button[data-theme]").forEach(e=>{e.addEventListener("click",()=>{let t=e.getAttribute("data-theme");this._applyTheme(t,{persist:!0}),this._closeMenu()})})}_toggleMenu(){this.hasAttribute("menu-open")?this._closeMenu():this._openMenu()}_openMenu(){this.setAttribute("menu-open",""),this._pickerBtn.setAttribute("aria-expanded","true"),this._highlightActive();let e=this._menu.querySelector("button[data-theme]");e&&e.focus()}_closeMenu(){this.removeAttribute("menu-open"),this._pickerBtn.setAttribute("aria-expanded","false")}_onDocClick(e){this.hasAttribute("menu-open")&&(e.composedPath().includes(this)||this._closeMenu())}_onKeyDown(e){if(this.hasAttribute("menu-open")){if(e.key==="Escape"){e.preventDefault(),this._closeMenu(),this._pickerBtn.focus();return}if(e.key==="ArrowDown"||e.key==="ArrowUp"){e.preventDefault();let t=Array.from(this._menu.querySelectorAll("button[data-theme]")),r=t.indexOf(this.shadowRoot.activeElement);(e.key==="ArrowDown"?t[(r+1)%t.length]:t[(r-1+t.length)%t.length])?.focus()}}}_highlightActive(){let e=this._currentSlug();this._menu.querySelectorAll("button[data-theme]").forEach(t=>{t.getAttribute("data-theme")===e?t.setAttribute("aria-current","true"):t.removeAttribute("aria-current")})}_currentSlug(){if(!this._target)return"";let e=this._target.getAttribute("data-velin-theme");return!e||e==="light"?"":e}_initPreference(){let e=localStorage.getItem("velin-theme");if(e){this._applyTheme(e,{persist:!1});return}this._applyFromPreference()}_readStorage(){let e=localStorage.getItem("velin-theme");this._applyTheme(e||"",{persist:!1})}_applyFromPreference(){if(localStorage.getItem("velin-theme"))return;let e=window.matchMedia("(prefers-color-scheme: dark)").matches;this._applyTheme(e?"dark":"",{persist:!1})}_applyTheme(e,{persist:t}){let r=!e||e==="light"?"":e;this._target&&(r?(this._target.setAttribute("data-velin-theme",r),this.setAttribute("theme",r==="dark"?"dark":r),
|
|
473
|
+
`).join(""),this._menu.removeAttribute("hidden"),this._menu.querySelectorAll("button[data-theme]").forEach(e=>{e.addEventListener("click",()=>{let t=e.getAttribute("data-theme");this._applyTheme(t,{persist:!0}),this._closeMenu()})})}_toggleMenu(){this.hasAttribute("menu-open")?this._closeMenu():this._openMenu()}_openMenu(){this.setAttribute("menu-open",""),this._pickerBtn.setAttribute("aria-expanded","true"),this._highlightActive();let e=this._menu.querySelector("button[data-theme]");e&&e.focus()}_closeMenu(){this.removeAttribute("menu-open"),this._pickerBtn.setAttribute("aria-expanded","false")}_onDocClick(e){this.hasAttribute("menu-open")&&(e.composedPath().includes(this)||this._closeMenu())}_onKeyDown(e){if(this.hasAttribute("menu-open")){if(e.key==="Escape"){e.preventDefault(),this._closeMenu(),this._pickerBtn.focus();return}if(e.key==="ArrowDown"||e.key==="ArrowUp"){e.preventDefault();let t=Array.from(this._menu.querySelectorAll("button[data-theme]")),r=t.indexOf(this.shadowRoot.activeElement);(e.key==="ArrowDown"?t[(r+1)%t.length]:t[(r-1+t.length)%t.length])?.focus()}}}_highlightActive(){let e=this._currentSlug();this._menu.querySelectorAll("button[data-theme]").forEach(t=>{t.getAttribute("data-theme")===e?t.setAttribute("aria-current","true"):t.removeAttribute("aria-current")})}_currentSlug(){if(!this._target)return"";let e=this._target.getAttribute("data-velin-theme");return!e||e==="light"?"":e}_initPreference(){let e=localStorage.getItem("velin-theme");if(e){this._applyTheme(e,{persist:!1});return}this._applyFromPreference()}_readStorage(){let e=localStorage.getItem("velin-theme");this._applyTheme(e||"",{persist:!1})}_applyFromPreference(){if(localStorage.getItem("velin-theme"))return;let e=window.matchMedia("(prefers-color-scheme: dark)").matches;this._applyTheme(e?"dark":"",{persist:!1})}_applyTheme(e,{persist:t}){let r=!e||e==="light"?"":e;this._target&&(r?(this._target.setAttribute("data-velin-theme",r),this.setAttribute("theme",r==="dark"?"dark":r),Zc(r,this._themesBase)):(this._target.removeAttribute("data-velin-theme"),this.removeAttribute("theme")),t&&(r?localStorage.setItem("velin-theme",r):localStorage.removeItem("velin-theme")),this._highlightActive(),this.dispatchEvent(new CustomEvent("velin-theme-change",{bubbles:!0,detail:{theme:r||"light",dark:r==="dark",slug:r}})))}_syncTogglePressed(){let e=this._currentSlug()==="dark";this._toggleBtn?.setAttribute("aria-pressed",e?"true":"false")}_toggleDarkMode(){let t=this._currentSlug()==="dark"?"":"dark";this._applyTheme(t,{persist:!0}),this._syncTogglePressed()}};customElements.define("velin-theme-toggle",Gt);es=Gt});var rs={};f(rs,{default:()=>is});var Qc,ed,Vt,is,kr=d(()=>{k();K();Qc=`
|
|
474
474
|
:host { position: relative; display: inline-block; }
|
|
475
475
|
.popover {
|
|
476
476
|
position: absolute; z-index: var(--velin-z-dropdown, 200);
|
|
@@ -495,14 +495,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
495
495
|
border-bottom: 1px solid var(--velin-color-border, #ddd);
|
|
496
496
|
}
|
|
497
497
|
@media (prefers-reduced-motion: reduce) { .popover { transition: none; } }
|
|
498
|
-
`,
|
|
499
|
-
<style>${
|
|
498
|
+
`,ed=0,Vt=class extends HTMLElement{static get observedAttributes(){return["open"]}constructor(){super(),this.attachShadow({mode:"open"}),this._popoverId=`velin-popover-${++ed}`,this._onOutside=this._onOutside.bind(this),this._onKey=this._onKey.bind(this),this._prevFocus=null,this._isDialog=!1}connectedCallback(){let e=this.getAttribute("placement")||"bottom",t=this.getAttribute("trigger")||"click",r=this.getAttribute("title")||"",n=t==="hover"?"tooltip":"dialog";this._isDialog=n==="dialog";let o=r?`${this._popoverId}-title`:"";this.shadowRoot.innerHTML=`
|
|
499
|
+
<style>${Qc}</style>
|
|
500
500
|
<slot name="trigger"></slot>
|
|
501
501
|
<div class="popover popover--${e}" id="${this._popoverId}" role="${n}" part="popover"${o?` aria-labelledby="${o}"`:""}>
|
|
502
502
|
${r?`<div class="popover__title" id="${o}" part="title">${p(r)}</div>`:""}
|
|
503
503
|
<slot></slot>
|
|
504
504
|
</div>
|
|
505
|
-
`;let a=this.shadowRoot.querySelector(".popover");if(!r&&a){let
|
|
505
|
+
`;let a=this.shadowRoot.querySelector(".popover");if(!r&&a){let u=this.getAttribute("aria-label")||(n==="tooltip"?"Tooltip":"Popover");a.setAttribute("aria-label",u)}this.shadowRoot.querySelector('slot[name="trigger"]').addEventListener("slotchange",()=>this._wireTrigger(t)),this._wireTrigger(t)}_ensureTriggerInteractive(e){let t=e.tagName;t!=="BUTTON"&&t!=="A"&&e.getAttribute("role")!=="button"&&(e.setAttribute("role","button"),e.hasAttribute("tabindex")||e.setAttribute("tabindex","0"))}_onTriggerKey(e){if(e.key==="Escape"){this.close();return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.toggle())}_wireTrigger(e){let t=this.shadowRoot.querySelector('slot[name="trigger"]')?.assignedElements()[0];if(!t)return;this._ensureTriggerInteractive(t);let r=e==="hover";t.setAttribute("aria-haspopup",r?"true":"dialog"),t.setAttribute("aria-expanded",this.hasAttribute("open")?"true":"false"),this._isDialog&&t.setAttribute("aria-controls",this._popoverId),t.removeEventListener("keydown",this._onTriggerKeyBound),this._onTriggerKeyBound=this._onTriggerKeyBound||this._onTriggerKey.bind(this),t.addEventListener("keydown",this._onTriggerKeyBound),e==="click"?t.onclick=()=>this.toggle():e==="hover"?(this.onmouseenter=()=>this.open(),this.onmouseleave=()=>this.close(),this.onfocusin=()=>this.open(),this.onfocusout=n=>{this.contains(n.relatedTarget)||this.close()}):e==="focus"&&(t.onfocusin=()=>this.open(),t.onfocusout=()=>this.close())}open(){this.setAttribute("open","");let e=this.querySelector('[slot="trigger"]');e&&e.setAttribute("aria-expanded","true"),document.addEventListener("click",this._onOutside,!0),document.addEventListener("keydown",this._onKey),this._isDialog&&(this._prevFocus=Q(),requestAnimationFrame(()=>{let t=ce(this.shadowRoot.querySelector(".popover"));t.length?t[0].focus():this.shadowRoot.querySelector(".popover")?.focus()}))}close(){this.removeAttribute("open");let e=this.querySelector('[slot="trigger"]');e&&e.setAttribute("aria-expanded","false"),document.removeEventListener("click",this._onOutside,!0),document.removeEventListener("keydown",this._onKey),this._isDialog&&this._prevFocus&&(ee(this._prevFocus),this._prevFocus=null)}toggle(){this.hasAttribute("open")?this.close():this.open()}_onOutside(e){this.contains(e.target)||this.close()}_onKey(e){if(e.key==="Escape"){this.close();let t=this.querySelector('[slot="trigger"]');t&&t.focus();return}this._isDialog&&this.hasAttribute("open")&&Y(this.shadowRoot.querySelector(".popover"),e)}disconnectedCallback(){document.removeEventListener("click",this._onOutside,!0),document.removeEventListener("keydown",this._onKey)}};customElements.define("velin-popover",Vt);is=Vt});var os={};f(os,{default:()=>ns});var td,Yt,ns,Sr=d(()=>{k();td=`
|
|
506
506
|
:host { display: inline-flex; }
|
|
507
507
|
button {
|
|
508
508
|
display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem;
|
|
@@ -522,8 +522,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
522
522
|
button[data-copied] .copy-icon { display: none; }
|
|
523
523
|
button[data-copied] .check { display: block; }
|
|
524
524
|
@media (prefers-reduced-motion: reduce) { button { transition: none; } }
|
|
525
|
-
`,
|
|
526
|
-
<style>${
|
|
525
|
+
`,Yt=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){let e=p(this.getAttribute("label")||"");this.shadowRoot.innerHTML=`
|
|
526
|
+
<style>${td}</style>
|
|
527
527
|
<button part="button" aria-label="Copy">
|
|
528
528
|
<svg class="copy-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
529
529
|
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/>
|
|
@@ -533,7 +533,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
533
533
|
</svg>
|
|
534
534
|
${e?`<span>${e}</span>`:""}
|
|
535
535
|
</button>
|
|
536
|
-
`,this.shadowRoot.querySelector("button").addEventListener("click",()=>this._copy())}_getCopyText(){return this.getAttribute("value")||this.getAttribute("text")||this.dataset.source||""}async _copy(){let e=this._getCopyText();if(!e)return;try{await navigator.clipboard.writeText(e)}catch{let r=document.createElement("textarea");r.value=e,r.style.cssText="position:fixed;opacity:0",document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove()}let t=this.shadowRoot.querySelector("button");t.setAttribute("data-copied",""),t.setAttribute("aria-label","Copied"),this.dispatchEvent(new CustomEvent("velin-copied",{bubbles:!0,detail:{value:e}})),setTimeout(()=>{t.removeAttribute("data-copied"),t.setAttribute("aria-label","Copy")},2e3)}};customElements.get("velin-copy")||customElements.define("velin-copy",
|
|
536
|
+
`,this.shadowRoot.querySelector("button").addEventListener("click",()=>this._copy())}_getCopyText(){return this.getAttribute("value")||this.getAttribute("text")||this.dataset.source||""}async _copy(){let e=this._getCopyText();if(!e)return;try{await navigator.clipboard.writeText(e)}catch{let r=document.createElement("textarea");r.value=e,r.style.cssText="position:fixed;opacity:0",document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove()}let t=this.shadowRoot.querySelector("button");t.setAttribute("data-copied",""),t.setAttribute("aria-label","Copied"),this.dispatchEvent(new CustomEvent("velin-copied",{bubbles:!0,detail:{value:e}})),setTimeout(()=>{t.removeAttribute("data-copied"),t.setAttribute("aria-label","Copy")},2e3)}};customElements.get("velin-copy")||customElements.define("velin-copy",Yt);ns=Yt});var as={};f(as,{default:()=>ss});var id,Xt,ss,Tr=d(()=>{id=`
|
|
537
537
|
:host { position: fixed; inset-block-end: var(--velin-scroll-top-bottom, var(--velin-space-4, 1rem)); inset-inline-end: var(--velin-scroll-top-end, var(--velin-space-4, 1rem)); z-index: var(--velin-z-fixed, 300); }
|
|
538
538
|
button {
|
|
539
539
|
display: inline-flex; align-items: center; justify-content: center;
|
|
@@ -550,13 +550,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
550
550
|
svg { width: 1.25rem; height: 1.25rem; }
|
|
551
551
|
@media (prefers-reduced-motion: reduce) { button { transition: none; } }
|
|
552
552
|
`,Xt=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this._onScroll=this._onScroll.bind(this)}connectedCallback(){let e=parseInt(this.getAttribute("threshold")||"300",10);this._threshold=e,this.shadowRoot.innerHTML=`
|
|
553
|
-
<style>${
|
|
553
|
+
<style>${id}</style>
|
|
554
554
|
<button part="button" aria-label="Scroll to top">
|
|
555
555
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">
|
|
556
556
|
<line x1="12" y1="19" x2="12" y2="5"/><polyline points="5 12 12 5 19 12"/>
|
|
557
557
|
</svg>
|
|
558
558
|
</button>
|
|
559
|
-
`,this.shadowRoot.querySelector("button").addEventListener("click",()=>{let t=window.matchMedia("(prefers-reduced-motion: reduce)").matches;window.scrollTo({top:0,behavior:t?"auto":"smooth"})}),window.addEventListener("scroll",this._onScroll,{passive:!0}),this._onScroll()}_onScroll(){window.scrollY>this._threshold?this.setAttribute("visible",""):this.removeAttribute("visible")}disconnectedCallback(){window.removeEventListener("scroll",this._onScroll)}};customElements.define("velin-scroll-top",Xt);
|
|
559
|
+
`,this.shadowRoot.querySelector("button").addEventListener("click",()=>{let t=window.matchMedia("(prefers-reduced-motion: reduce)").matches;window.scrollTo({top:0,behavior:t?"auto":"smooth"})}),window.addEventListener("scroll",this._onScroll,{passive:!0}),this._onScroll()}_onScroll(){window.scrollY>this._threshold?this.setAttribute("visible",""):this.removeAttribute("visible")}disconnectedCallback(){window.removeEventListener("scroll",this._onScroll)}};customElements.define("velin-scroll-top",Xt);ss=Xt});var cs={};f(cs,{default:()=>ls});var rd,Zt,ls,Lr=d(()=>{rd=`
|
|
560
560
|
:host { display: block; position: relative; overflow: hidden; }
|
|
561
561
|
.track {
|
|
562
562
|
display: flex; transition: transform 400ms ease;
|
|
@@ -608,7 +608,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
608
608
|
.dot:focus-visible { outline: 2px solid var(--velin-color-focus, #2563eb); outline-offset: 2px; }
|
|
609
609
|
@media (prefers-reduced-motion: reduce) { .track { transition: none; } }
|
|
610
610
|
`,Zt=class extends HTMLElement{static get observedAttributes(){return["autoplay","interval"]}constructor(){super(),this.attachShadow({mode:"open"}),this._index=0,this._timer=null,this._startX=0,this._autoplayPaused=!1}connectedCallback(){this.shadowRoot.innerHTML=`
|
|
611
|
-
<style>${
|
|
611
|
+
<style>${rd}</style>
|
|
612
612
|
<div class="track" role="group" aria-roledescription="carousel" part="track"><slot></slot></div>
|
|
613
613
|
<div class="controls" part="controls">
|
|
614
614
|
<button class="prev" aria-label="Previous slide" part="prev">
|
|
@@ -619,7 +619,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
619
619
|
</button>
|
|
620
620
|
</div>
|
|
621
621
|
<div class="indicators" role="group" aria-label="Slide indicators" part="indicators"></div>
|
|
622
|
-
`,this.shadowRoot.querySelector(".prev").addEventListener("click",()=>this.prev()),this.shadowRoot.querySelector(".next").addEventListener("click",()=>this.next());let e=this.shadowRoot.querySelector(".track");e.addEventListener("touchstart",r=>{this._startX=r.touches[0].clientX},{passive:!0}),e.addEventListener("touchend",r=>{let n=this._startX-r.changedTouches[0].clientX;Math.abs(n)>50&&(n>0?this.next():this.prev())}),this.addEventListener("mouseenter",()=>this._pause()),this.addEventListener("mouseleave",()=>this._resume()),this.addEventListener("focusin",()=>this._pause()),this.addEventListener("focusout",()=>this._resume()),this.addEventListener("keydown",r=>{r.key==="ArrowLeft"?(this.prev(),r.preventDefault()):r.key==="ArrowRight"?(this.next(),r.preventDefault()):r.key==="Home"?(this.goTo(0),r.preventDefault()):r.key==="End"&&(this.goTo(this._count-1),r.preventDefault())}),this.hasAttribute("role")||this.setAttribute("role","region"),this.setAttribute("aria-roledescription","carousel"),this.shadowRoot.querySelector("slot").addEventListener("slotchange",()=>{this._buildDots(),this._update()}),this.hasAttribute("autoplay")&&this._startAutoplay()}get _slides(){return this.shadowRoot.querySelector("slot").assignedElements()}get _count(){return this._slides.length}prev(){this._index=(this._index-1+this._count)%this._count,this._update(),this._emit()}next(){this._index=(this._index+1)%this._count,this._update(),this._emit()}goTo(e){this._index=Math.max(0,Math.min(e,this._count-1)),this._update(),this._emit()}_update(){let e=this.shadowRoot.querySelector(".track");e.style.transform=`translateX(-${this._index*100}%)`,this._slides.forEach((t,r)=>{t.setAttribute("aria-hidden",r!==this._index?"true":"false"),t.inert=r!==this._index,t.setAttribute("aria-roledescription","slide"),t.setAttribute("aria-label",`Slide ${r+1} of ${this._count}`)}),this.shadowRoot.querySelectorAll(".dot").forEach((t,r)=>{t.setAttribute("aria-current",r===this._index?"true":"false")})}_buildDots(){let e=this.shadowRoot.querySelector(".indicators");if(e.innerHTML="",this._slides.forEach((t,r)=>{let n=document.createElement("button");n.type="button",n.className="dot",n.setAttribute("aria-label",`Go to slide ${r+1}`),n.addEventListener("click",()=>this.goTo(r)),e.appendChild(n)}),this.hasAttribute("autoplay")){let t=document.createElement("button");t.type="button",t.className="pause-btn",t.setAttribute("aria-pressed","false"),t.setAttribute("aria-label","Pause automatic slide show"),t.textContent="Pause",t.addEventListener("click",()=>this._toggleAutoplayPause(t)),e.appendChild(t)}this._update()}_toggleAutoplayPause(e){this._autoplayPaused=!this._autoplayPaused,this._autoplayPaused?(this._pause(),e.setAttribute("aria-pressed","true"),e.setAttribute("aria-label","Resume automatic slide show"),e.textContent="Play"):(this._resume(),e.setAttribute("aria-pressed","false"),e.setAttribute("aria-label","Pause automatic slide show"),e.textContent="Pause")}_emit(){this.dispatchEvent(new CustomEvent("velin-slide-change",{bubbles:!0,detail:{index:this._index}}))}_startAutoplay(){let e=parseInt(this.getAttribute("interval")||"5000",10);this._timer=setInterval(()=>this.next(),e)}_pause(){this._timer&&(clearInterval(this._timer),this._timer=null)}_resume(){this.hasAttribute("autoplay")&&!this._timer&&!this._autoplayPaused&&this._startAutoplay()}disconnectedCallback(){this._pause()}};customElements.define("velin-carousel",Zt);
|
|
622
|
+
`,this.shadowRoot.querySelector(".prev").addEventListener("click",()=>this.prev()),this.shadowRoot.querySelector(".next").addEventListener("click",()=>this.next());let e=this.shadowRoot.querySelector(".track");e.addEventListener("touchstart",r=>{this._startX=r.touches[0].clientX},{passive:!0}),e.addEventListener("touchend",r=>{let n=this._startX-r.changedTouches[0].clientX;Math.abs(n)>50&&(n>0?this.next():this.prev())}),this.addEventListener("mouseenter",()=>this._pause()),this.addEventListener("mouseleave",()=>this._resume()),this.addEventListener("focusin",()=>this._pause()),this.addEventListener("focusout",()=>this._resume()),this.addEventListener("keydown",r=>{r.key==="ArrowLeft"?(this.prev(),r.preventDefault()):r.key==="ArrowRight"?(this.next(),r.preventDefault()):r.key==="Home"?(this.goTo(0),r.preventDefault()):r.key==="End"&&(this.goTo(this._count-1),r.preventDefault())}),this.hasAttribute("role")||this.setAttribute("role","region"),this.setAttribute("aria-roledescription","carousel"),this.shadowRoot.querySelector("slot").addEventListener("slotchange",()=>{this._buildDots(),this._update()}),this.hasAttribute("autoplay")&&this._startAutoplay()}get _slides(){return this.shadowRoot.querySelector("slot").assignedElements()}get _count(){return this._slides.length}prev(){this._index=(this._index-1+this._count)%this._count,this._update(),this._emit()}next(){this._index=(this._index+1)%this._count,this._update(),this._emit()}goTo(e){this._index=Math.max(0,Math.min(e,this._count-1)),this._update(),this._emit()}_update(){let e=this.shadowRoot.querySelector(".track");e.style.transform=`translateX(-${this._index*100}%)`,this._slides.forEach((t,r)=>{t.setAttribute("aria-hidden",r!==this._index?"true":"false"),t.inert=r!==this._index,t.setAttribute("aria-roledescription","slide"),t.setAttribute("aria-label",`Slide ${r+1} of ${this._count}`)}),this.shadowRoot.querySelectorAll(".dot").forEach((t,r)=>{t.setAttribute("aria-current",r===this._index?"true":"false")})}_buildDots(){let e=this.shadowRoot.querySelector(".indicators");if(e.innerHTML="",this._slides.forEach((t,r)=>{let n=document.createElement("button");n.type="button",n.className="dot",n.setAttribute("aria-label",`Go to slide ${r+1}`),n.addEventListener("click",()=>this.goTo(r)),e.appendChild(n)}),this.hasAttribute("autoplay")){let t=document.createElement("button");t.type="button",t.className="pause-btn",t.setAttribute("aria-pressed","false"),t.setAttribute("aria-label","Pause automatic slide show"),t.textContent="Pause",t.addEventListener("click",()=>this._toggleAutoplayPause(t)),e.appendChild(t)}this._update()}_toggleAutoplayPause(e){this._autoplayPaused=!this._autoplayPaused,this._autoplayPaused?(this._pause(),e.setAttribute("aria-pressed","true"),e.setAttribute("aria-label","Resume automatic slide show"),e.textContent="Play"):(this._resume(),e.setAttribute("aria-pressed","false"),e.setAttribute("aria-label","Pause automatic slide show"),e.textContent="Pause")}_emit(){this.dispatchEvent(new CustomEvent("velin-slide-change",{bubbles:!0,detail:{index:this._index}}))}_startAutoplay(){let e=parseInt(this.getAttribute("interval")||"5000",10);this._timer=setInterval(()=>this.next(),e)}_pause(){this._timer&&(clearInterval(this._timer),this._timer=null)}_resume(){this.hasAttribute("autoplay")&&!this._timer&&!this._autoplayPaused&&this._startAutoplay()}disconnectedCallback(){this._pause()}};customElements.define("velin-carousel",Zt);ls=Zt});var us={};f(us,{default:()=>ds});function sd(i){let e=i.tagName;return e==="BUTTON"||e==="A"&&i.hasAttribute("href")||i.getAttribute("role")==="button"}var nd,od,Jt,ds,Cr=d(()=>{nd=`
|
|
623
623
|
:host { display: block; }
|
|
624
624
|
.content {
|
|
625
625
|
overflow: hidden;
|
|
@@ -630,7 +630,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
630
630
|
:host([open]) .content { grid-template-rows: 1fr; }
|
|
631
631
|
.inner { min-height: 0; }
|
|
632
632
|
@media (prefers-reduced-motion: reduce) { .content { transition: none; } }
|
|
633
|
-
`,
|
|
633
|
+
`,od=0;Jt=class extends HTMLElement{static get observedAttributes(){return["open"]}constructor(){super(),this.attachShadow({mode:"open"}),this._contentId=`velin-collapse-panel-${++od}`,this._onTriggerKey=this._onTriggerKey.bind(this)}connectedCallback(){let e=this._contentId;this.shadowRoot.innerHTML="<style>"+nd+'</style><slot name="trigger"></slot><div class="content" id="'+e+'" part="content"><div class="inner"><slot></slot></div></div>',this.shadowRoot.querySelector('slot[name="trigger"]').addEventListener("slotchange",()=>this._wireTrigger()),this._wireTrigger()}_wireTrigger(){let e=this.shadowRoot.querySelector('slot[name="trigger"]')?.assignedElements()[0];e&&(sd(e)||(e.setAttribute("role","button"),e.hasAttribute("tabindex")||e.setAttribute("tabindex","0")),e.setAttribute("aria-controls",this._contentId),e.setAttribute("aria-expanded",this.hasAttribute("open")?"true":"false"),e.removeEventListener("click",this._onClick),e.removeEventListener("keydown",this._onTriggerKey),this._onClick=()=>this.toggle(),e.addEventListener("click",this._onClick),e.addEventListener("keydown",this._onTriggerKey))}_onTriggerKey(e){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.toggle())}attributeChangedCallback(e){if(e==="open"){let t=this.shadowRoot.querySelector('slot[name="trigger"]')?.assignedElements()[0];t&&t.setAttribute("aria-expanded",this.hasAttribute("open")?"true":"false")}}toggle(){this.hasAttribute("open")?this.close():this.open()}open(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("velin-open",{bubbles:!0}))}close(){this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}};customElements.define("velin-collapse",Jt);ds=Jt});var ps={};f(ps,{default:()=>hs});var Qt,hs,Rr=d(()=>{Qt=class extends HTMLElement{constructor(){super(),this._observer=null,this._activeId=null}connectedCallback(){let e=this.getAttribute("target")||"section[id]",t=this.getAttribute("nav")||"a",r=this.getAttribute("root-margin")||"-20% 0px -60% 0px",n=document.querySelectorAll(e);n.length&&(this._observer=new IntersectionObserver(o=>{for(let a of o)a.isIntersecting&&this._activate(a.target.id,t)},{rootMargin:r,threshold:0}),n.forEach(o=>this._observer.observe(o)))}_activate(e,t){if(this._activeId===e)return;this._activeId=e,this.querySelectorAll(t).forEach(n=>{n.getAttribute("href")===`#${e}`?(n.classList.add("velin-doc-sidebar__link--active"),n.setAttribute("aria-current","true")):(n.classList.remove("velin-doc-sidebar__link--active"),n.removeAttribute("aria-current"))}),this.dispatchEvent(new CustomEvent("velin-spy-change",{bubbles:!0,detail:{id:e}}))}disconnectedCallback(){this._observer&&this._observer.disconnect()}};customElements.define("velin-scrollspy",Qt);hs=Qt});var Ir={};f(Ir,{VelinTooltip:()=>Ue,VelinTooltipWC:()=>at,default:()=>ms});var ad,ld,Ue,at,ms,ei=d(()=>{k();ad=`
|
|
634
634
|
:host { position: relative; display: inline-block; }
|
|
635
635
|
.tip {
|
|
636
636
|
position: absolute; z-index: var(--velin-z-tooltip, 700);
|
|
@@ -649,11 +649,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
649
649
|
.tip[data-placement="start"] { right: calc(100% + 6px); top: 50%; transform: translateY(-50%); }
|
|
650
650
|
.tip[data-placement="end"] { left: calc(100% + 6px); top: 50%; transform: translateY(-50%); }
|
|
651
651
|
@media (prefers-reduced-motion: reduce) { .tip { transition: none; } }
|
|
652
|
-
`,
|
|
653
|
-
<style>${
|
|
652
|
+
`,ld=0,Ue=class extends HTMLElement{static get observedAttributes(){return["content","placement"]}constructor(){super(),this.attachShadow({mode:"open"}),this._tipId=`velin-tooltip-${++ld}`}connectedCallback(){let e=this.getAttribute("placement")||"top",t="div";this.shadowRoot.innerHTML=`
|
|
653
|
+
<style>${ad}</style>
|
|
654
654
|
<slot></slot>
|
|
655
655
|
<${t} class="tip" id="${this._tipId}" role="tooltip" data-placement="${p(e)}" part="tip">${p(this.getAttribute("content")||"")}</${t}>
|
|
656
|
-
`,this.addEventListener("mouseenter",()=>this._show()),this.addEventListener("mouseleave",()=>this._hide()),this.addEventListener("focusin",()=>this._show()),this.addEventListener("focusout",()=>this._hide()),this.addEventListener("keydown",n=>{n.key==="Escape"&&this._hide()}),this.shadowRoot.querySelector("slot").addEventListener("slotchange",()=>this._linkTrigger()),this._linkTrigger()}_linkTrigger(){let e=this.shadowRoot.querySelector("slot")?.assignedElements()[0];e&&(this.hasAttribute("visible")?e.setAttribute("aria-describedby",this._tipId):e.removeAttribute("aria-describedby"))}_show(){this.setAttribute("visible","");let e=this.shadowRoot.querySelector("slot")?.assignedElements()[0];e&&e.setAttribute("aria-describedby",this._tipId),this._flip()}_hide(){this.removeAttribute("visible");let e=this.shadowRoot.querySelector("slot")?.assignedElements()[0];e&&e.removeAttribute("aria-describedby")}_flip(){let e=this.shadowRoot.querySelector(".tip");if(!e)return;let t=e.getBoundingClientRect(),r=this.getAttribute("placement")||"top";r==="top"&&t.top<0?e.setAttribute("data-placement","bottom"):r==="bottom"&&t.bottom>window.innerHeight?e.setAttribute("data-placement","top"):e.setAttribute("data-placement",r)}attributeChangedCallback(e,t,r){let n=this.shadowRoot?.querySelector(".tip");n&&(e==="content"&&(n.textContent=r),e==="placement"&&n.setAttribute("data-placement",r))}},
|
|
656
|
+
`,this.addEventListener("mouseenter",()=>this._show()),this.addEventListener("mouseleave",()=>this._hide()),this.addEventListener("focusin",()=>this._show()),this.addEventListener("focusout",()=>this._hide()),this.addEventListener("keydown",n=>{n.key==="Escape"&&this._hide()}),this.shadowRoot.querySelector("slot").addEventListener("slotchange",()=>this._linkTrigger()),this._linkTrigger()}_linkTrigger(){let e=this.shadowRoot.querySelector("slot")?.assignedElements()[0];e&&(this.hasAttribute("visible")?e.setAttribute("aria-describedby",this._tipId):e.removeAttribute("aria-describedby"))}_show(){this.setAttribute("visible","");let e=this.shadowRoot.querySelector("slot")?.assignedElements()[0];e&&e.setAttribute("aria-describedby",this._tipId),this._flip()}_hide(){this.removeAttribute("visible");let e=this.shadowRoot.querySelector("slot")?.assignedElements()[0];e&&e.removeAttribute("aria-describedby")}_flip(){let e=this.shadowRoot.querySelector(".tip");if(!e)return;let t=e.getBoundingClientRect(),r=this.getAttribute("placement")||"top";r==="top"&&t.top<0?e.setAttribute("data-placement","bottom"):r==="bottom"&&t.bottom>window.innerHeight?e.setAttribute("data-placement","top"):e.setAttribute("data-placement",r)}attributeChangedCallback(e,t,r){let n=this.shadowRoot?.querySelector(".tip");n&&(e==="content"&&(n.textContent=r),e==="placement"&&n.setAttribute("data-placement",r))}},at=class i extends Ue{static _warned=!1;connectedCallback(){!i._warned&&typeof console<"u"&&console.warn&&(i._warned=!0,console.warn("[velinstyle] <velin-tooltip-wc> is deprecated; use <velin-tooltip> instead.")),super.connectedCallback()}};customElements.get("velin-tooltip")||customElements.define("velin-tooltip",Ue);customElements.get("velin-tooltip-wc")||customElements.define("velin-tooltip-wc",at);ms=Ue});var fs={};f(fs,{announce:()=>re,ensureAriaLabel:()=>dd,getAnnouncer:()=>je,liveDotLabel:()=>Mr,respectReducedMotion:()=>ud,syncExpanded:()=>cd});function je(){return typeof document>"u"?null:(Re?.isConnected||(Re=document.querySelector("velin-announcer"),Re||(Re=document.createElement("velin-announcer"),document.body.appendChild(Re))),Re)}function re(i,e="polite"){let t=je();!t||typeof t.announce!="function"||t.announce(i,{assertive:e==="assertive"})}function cd(i,e){if(!i||!e)return;let t=i.getAttribute("aria-expanded")==="true";e.hidden=!t,e.id&&i.setAttribute("aria-controls",e.id)}function dd(i,e){!i||!e||i.getAttribute("aria-label")?.trim()||i.setAttribute("aria-label",e)}function ud(i,e){typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches&&e?e():i()}function Mr(i){return{live:"Live",idle:"Idle",error:"Error",offline:"Offline",connecting:"Connecting"}[String(i||"live").toLowerCase()]||i||"Live"}var Re,_e=d(()=>{});var vs={};f(vs,{default:()=>bs});var hd,ti,bs,Dr=d(()=>{K();_e();k();hd=`
|
|
657
657
|
:host { display: contents; }
|
|
658
658
|
.overlay {
|
|
659
659
|
position: fixed; inset: 0; z-index: var(--velin-z-modal, 500);
|
|
@@ -692,8 +692,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
692
692
|
.nav--prev { left: 0.5rem; }
|
|
693
693
|
.nav--next { right: 0.5rem; }
|
|
694
694
|
}
|
|
695
|
-
`,ti=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this._index=0,this._items=[],this._previousFocus=null,this._onTrapKey=e=>{e.key==="Tab"&&
|
|
696
|
-
<style>${
|
|
695
|
+
`,ti=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this._index=0,this._items=[],this._previousFocus=null,this._onTrapKey=e=>{e.key==="Tab"&&Y(this.shadowRoot,e)}}connectedCallback(){this.shadowRoot.innerHTML=`
|
|
696
|
+
<style>${hd}</style>
|
|
697
697
|
<slot></slot>
|
|
698
698
|
<div class="overlay" role="dialog" aria-modal="true" aria-label="Image lightbox" aria-roledescription="lightbox" part="overlay">
|
|
699
699
|
<button class="nav nav--prev" aria-label="Previous">‹</button>
|
|
@@ -702,7 +702,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
702
702
|
<button class="close" aria-label="Close">×</button>
|
|
703
703
|
<div class="counter" part="counter" aria-live="polite" aria-atomic="true"></div>
|
|
704
704
|
</div>
|
|
705
|
-
`;let e=this.shadowRoot.querySelector("slot");e.addEventListener("slotchange",()=>{this._items=e.assignedElements().filter(t=>t.tagName==="IMG"||t.tagName==="VIDEO"||t.dataset.velinLightbox),this._items.forEach((t,r)=>{t.style.cursor="pointer",t.addEventListener("click",()=>this.open(r))})}),this.shadowRoot.querySelector(".close").addEventListener("click",()=>this.close()),this.shadowRoot.querySelector(".nav--prev").addEventListener("click",()=>this._prev()),this.shadowRoot.querySelector(".nav--next").addEventListener("click",()=>this._next()),this.shadowRoot.querySelector(".overlay").addEventListener("click",t=>{t.target.classList.contains("overlay")&&this.close()}),this.shadowRoot.querySelector(".overlay").addEventListener("keydown",t=>{t.key==="Escape"&&this.close(),t.key==="ArrowLeft"&&this._prev(),t.key==="ArrowRight"&&this._next()})}open(e=0){this._previousFocus=document.activeElement,this._index=e,this.setAttribute("open",""),
|
|
705
|
+
`;let e=this.shadowRoot.querySelector("slot");e.addEventListener("slotchange",()=>{this._items=e.assignedElements().filter(t=>t.tagName==="IMG"||t.tagName==="VIDEO"||t.dataset.velinLightbox),this._items.forEach((t,r)=>{t.style.cursor="pointer",t.addEventListener("click",()=>this.open(r))})}),this.shadowRoot.querySelector(".close").addEventListener("click",()=>this.close()),this.shadowRoot.querySelector(".nav--prev").addEventListener("click",()=>this._prev()),this.shadowRoot.querySelector(".nav--next").addEventListener("click",()=>this._next()),this.shadowRoot.querySelector(".overlay").addEventListener("click",t=>{t.target.classList.contains("overlay")&&this.close()}),this.shadowRoot.querySelector(".overlay").addEventListener("keydown",t=>{t.key==="Escape"&&this.close(),t.key==="ArrowLeft"&&this._prev(),t.key==="ArrowRight"&&this._next()})}open(e=0){this._previousFocus=document.activeElement,this._index=e,this.setAttribute("open",""),te(this),this._render(),document.body.style.overflow="hidden";let t=this.shadowRoot.querySelector(".overlay");t.removeEventListener("keydown",this._onTrapKey),t.addEventListener("keydown",this._onTrapKey),this.shadowRoot.querySelector(".close").focus()}close(){this.removeAttribute("open"),ie(),document.body.style.overflow="",this._previousFocus&&(this._previousFocus.focus(),this._previousFocus=null),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}_prev(){this._index=(this._index-1+this._items.length)%this._items.length,this._render()}_next(){this._index=(this._index+1)%this._items.length,this._render()}_render(){let e=this.shadowRoot.querySelector(".content"),t=this._items[this._index];if(!t)return;let r=Ce(t.dataset.velinLightbox||t.src),n=p(t.alt||"");t.tagName==="VIDEO"?e.innerHTML=`<video src="${p(r)}" controls autoplay></video>`:e.innerHTML=`<img src="${p(r)}" alt="${n}">`;let o=this.shadowRoot.querySelector(".counter"),a=`${this._index+1} / ${this._items.length}`;o.textContent=a,re(`Slide ${a}`,"polite")}};customElements.define("velin-lightbox",ti);bs=ti});var Or={};f(Or,{VelinStepper:()=>Ke,VelinStepperWC:()=>lt,default:()=>gs});var pd,Ke,lt,gs,ii=d(()=>{k();pd=`
|
|
706
706
|
:host { display: block; }
|
|
707
707
|
.steps {
|
|
708
708
|
display: flex; gap: var(--velin-space-2, 0.5rem);
|
|
@@ -755,11 +755,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
755
755
|
position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
|
|
756
756
|
overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
|
|
757
757
|
}
|
|
758
|
-
`,
|
|
759
|
-
<style>${
|
|
758
|
+
`,Ke=class extends HTMLElement{static get observedAttributes(){return["active","aria-label","labels"]}constructor(){super(),this.attachShadow({mode:"open"}),this._current=0}connectedCallback(){this._current=parseInt(this.getAttribute("active")||"0",10),this._buildSteps()}_buildSteps(){let e=(this.getAttribute("labels")||"").split(",").map(n=>n.trim()),t=this.getAttribute("aria-label")||"Progress",r=e.map((n,o)=>{let a=o<this._current?"completed":o===this._current?"active":"",l=o<this._current?"completed":o===this._current?"current step":"upcoming",u=o<this._current?'<span class="velin-sr-only">Completed</span><span aria-hidden="true">✓</span>':`<span aria-hidden="true">${o+1}</span>`,m=o===this._current?' aria-current="step"':"",v=n?`${n}, ${l}`:`Step ${o+1}, ${l}`;return`<div class="step ${a}" role="listitem" aria-label="${p(v)}"${m}><span class="step__marker">${u}</span><span class="step__label">${p(n)}</span></div>`}).join("");this.shadowRoot.innerHTML=`
|
|
759
|
+
<style>${pd}</style>
|
|
760
760
|
<div class="steps" role="list" aria-label="${p(t)}" part="steps">${r}</div>
|
|
761
761
|
<div class="panels" part="panels"><slot></slot></div>
|
|
762
|
-
`}_updatePanels(){(this.shadowRoot.querySelector("slot")?.assignedElements()||[]).forEach((t,r)=>{r===this._current?t.setAttribute("data-active",""):t.removeAttribute("data-active")})}next(){let e=(this.getAttribute("labels")||"").split(",");this._current<e.length-1&&(this._current++,this.setAttribute("active",this._current),this._buildSteps(),this.dispatchEvent(new CustomEvent("velin-step-change",{bubbles:!0,detail:{step:this._current}})))}prev(){this._current>0&&(this._current--,this.setAttribute("active",this._current),this._buildSteps(),this.dispatchEvent(new CustomEvent("velin-step-change",{bubbles:!0,detail:{step:this._current}})))}goTo(e){this._current=e,this.setAttribute("active",this._current),this._buildSteps(),this.dispatchEvent(new CustomEvent("velin-step-change",{bubbles:!0,detail:{step:this._current}}))}attributeChangedCallback(e,t,r){e==="active"&&t!==null&&t!==r&&(this._current=parseInt(r,10),this._buildSteps())}},lt=class i extends
|
|
762
|
+
`}_updatePanels(){(this.shadowRoot.querySelector("slot")?.assignedElements()||[]).forEach((t,r)=>{r===this._current?t.setAttribute("data-active",""):t.removeAttribute("data-active")})}next(){let e=(this.getAttribute("labels")||"").split(",");this._current<e.length-1&&(this._current++,this.setAttribute("active",this._current),this._buildSteps(),this.dispatchEvent(new CustomEvent("velin-step-change",{bubbles:!0,detail:{step:this._current}})))}prev(){this._current>0&&(this._current--,this.setAttribute("active",this._current),this._buildSteps(),this.dispatchEvent(new CustomEvent("velin-step-change",{bubbles:!0,detail:{step:this._current}})))}goTo(e){this._current=e,this.setAttribute("active",this._current),this._buildSteps(),this.dispatchEvent(new CustomEvent("velin-step-change",{bubbles:!0,detail:{step:this._current}}))}attributeChangedCallback(e,t,r){e==="active"&&t!==null&&t!==r&&(this._current=parseInt(r,10),this._buildSteps())}},lt=class i extends Ke{static _warned=!1;connectedCallback(){!i._warned&&typeof console<"u"&&console.warn&&(i._warned=!0,console.warn("[velinstyle] <velin-stepper-wc> is deprecated; use <velin-stepper> instead.")),super.connectedCallback()}};customElements.get("velin-stepper")||customElements.define("velin-stepper",Ke);customElements.get("velin-stepper-wc")||customElements.define("velin-stepper-wc",lt);gs=Ke});var _s={};f(_s,{default:()=>ys});var md,ri,ys,Nr=d(()=>{k();md=`
|
|
763
763
|
:host { display: contents; }
|
|
764
764
|
dialog {
|
|
765
765
|
border: none; border-radius: var(--velin-radius-lg, 0.75rem);
|
|
@@ -816,12 +816,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
816
816
|
color: var(--velin-color-text, #1a1a2e);
|
|
817
817
|
}
|
|
818
818
|
.input:focus { outline: 3px solid var(--velin-color-focus, #2563eb); outline-offset: 0; border-color: var(--velin-color-primary, #2563eb); }
|
|
819
|
-
`,ri=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this._resolve=null,this._previousFocus=null}connectedCallback(){this.shadowRoot.innerHTML=`<style>${
|
|
820
|
-
<button class="btn ${r.danger?"btn--danger":"btn--primary"}" data-action="confirm">${
|
|
821
|
-
<div class="header"><h3 class="title" id="${
|
|
819
|
+
`,ri=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this._resolve=null,this._previousFocus=null}connectedCallback(){this.shadowRoot.innerHTML=`<style>${md}</style><dialog part="dialog"></dialog>`;let e=this.shadowRoot.querySelector("dialog");e&&e.setAttribute("aria-label",this.getAttribute("aria-label")||"Dialog")}alert(e,{title:t="Alert",confirmText:r="OK"}={}){return this._show("alert",e,{title:t,confirmText:r})}confirm(e,{title:t="Confirm",confirmText:r="Confirm",cancelText:n="Cancel",danger:o=!1}={}){return this._show("confirm",e,{title:t,confirmText:r,cancelText:n,danger:o})}prompt(e,{title:t="Input",confirmText:r="Submit",cancelText:n="Cancel",placeholder:o="",defaultValue:a=""}={}){return this._show("prompt",e,{title:t,confirmText:r,cancelText:n,placeholder:o,defaultValue:a})}_show(e,t,r){let n=this.shadowRoot.querySelector("dialog");this._previousFocus=document.activeElement;let o=p(r.title),a=p(t),l=p(r.confirmText),u=p(r.cancelText||""),m=p(r.placeholder||""),v=p(r.defaultValue||""),y=e==="alert"?`<button class="btn btn--primary" data-action="confirm">${l}</button>`:`<button class="btn" data-action="cancel">${u}</button>
|
|
820
|
+
<button class="btn ${r.danger?"btn--danger":"btn--primary"}" data-action="confirm">${l}</button>`,g=e==="prompt"?`<input class="input" placeholder="${m}" value="${v}" part="input">`:"",N=`velin-dialog-title-${Math.random().toString(36).slice(2,9)}`;if(n.innerHTML=`
|
|
821
|
+
<div class="header"><h3 class="title" id="${N}">${o}</h3><button class="close" aria-label="Close">×</button></div>
|
|
822
822
|
<div class="body"><p>${a}</p>${g}</div>
|
|
823
|
-
<div class="footer">${
|
|
824
|
-
`,n.setAttribute("aria-modal","true"),n.removeAttribute("aria-label"),n.setAttribute("aria-labelledby",
|
|
823
|
+
<div class="footer">${y}</div>
|
|
824
|
+
`,n.setAttribute("aria-modal","true"),n.removeAttribute("aria-label"),n.setAttribute("aria-labelledby",N),n.showModal(),e!=="prompt"){let w=n.querySelector("[data-action]");w&&w.focus()}return new Promise(w=>{if(this._resolve=w,n.querySelector(".close").addEventListener("click",()=>this._dismiss(e,!1,n)),n.querySelectorAll("[data-action]").forEach(A=>{A.addEventListener("click",()=>this._dismiss(e,A.dataset.action==="confirm",n))}),n.addEventListener("cancel",A=>{A.preventDefault(),this._dismiss(e,!1,n)}),e==="prompt"){let A=n.querySelector(".input");A.focus(),A.addEventListener("keydown",E=>{E.key==="Enter"&&this._dismiss(e,!0,n)})}})}_dismiss(e,t,r){if(!this._resolve)return;let n;e==="alert"?n=!0:e==="confirm"?n=t:n=t?r.querySelector(".input")?.value??"":null,r.close(),this._previousFocus&&(this._previousFocus.focus(),this._previousFocus=null),this._resolve(n),this._resolve=null,this.dispatchEvent(new CustomEvent("velin-dialog-close",{bubbles:!0,detail:{value:n}}))}};customElements.define("velin-dialog",ri);ys=ri});var As={};f(As,{default:()=>xs});var fd,ni,xs,Fr=d(()=>{k();fd=`
|
|
825
825
|
:host { display: inline-flex; font-variant-numeric: tabular-nums; }
|
|
826
826
|
.wrap { display: inline-flex; gap: var(--velin-space-3, 0.75rem); align-items: flex-start; }
|
|
827
827
|
.segment {
|
|
@@ -851,7 +851,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
851
851
|
:host([size="sm"]) .value { font-size: var(--velin-text-xl, 1.25rem); }
|
|
852
852
|
:host([size="sm"]) .segment { min-width: 2.5rem; }
|
|
853
853
|
:host([size="lg"]) .value { font-size: var(--velin-text-5xl, 3.052rem); }
|
|
854
|
-
`,ni=class extends HTMLElement{static get observedAttributes(){return["datetime"]}constructor(){super(),this.attachShadow({mode:"open"}),this._timer=null}connectedCallback(){this.shadowRoot.innerHTML=`<style>${
|
|
854
|
+
`,ni=class extends HTMLElement{static get observedAttributes(){return["datetime"]}constructor(){super(),this.attachShadow({mode:"open"}),this._timer=null}connectedCallback(){this.shadowRoot.innerHTML=`<style>${fd}</style><div class="wrap"></div>`,this._wrap=this.shadowRoot.querySelector(".wrap"),this.setAttribute("role","timer"),this.setAttribute("aria-live","polite"),this.setAttribute("aria-atomic","true"),this._start()}_start(){this._update(),this._timer=setInterval(()=>this._update(),1e3)}_update(){let e=new Date(this.getAttribute("datetime")).getTime(),t=Date.now(),r=Math.max(0,e-t),n=Math.floor(r/864e5),o=Math.floor(r%864e5/36e5),a=Math.floor(r%36e5/6e4),l=Math.floor(r%6e4/1e3),u=E=>String(E).padStart(2,"0"),m=this.getAttribute("show-days")!=="false",v=p(this.getAttribute("label-days")||"Days"),y=p(this.getAttribute("label-hours")||"Hours"),g=p(this.getAttribute("label-minutes")||"Min"),N=p(this.getAttribute("label-seconds")||"Sec"),w="";m&&(w+=`<div class="segment" part="days"><span class="value">${u(n)}</span><span class="label">${v}</span></div><span class="separator">:</span>`),w+=`<div class="segment" part="hours"><span class="value">${u(o)}</span><span class="label">${y}</span></div><span class="separator">:</span>`,w+=`<div class="segment" part="minutes"><span class="value">${u(a)}</span><span class="label">${g}</span></div><span class="separator">:</span>`,w+=`<div class="segment" part="seconds"><span class="value">${u(l)}</span><span class="label">${N}</span></div>`,this._wrap&&(this._wrap.innerHTML=w);let A=`${n} days, ${o} hours, ${a} minutes, ${l} seconds remaining`;this.setAttribute("aria-label",A),r<=0&&(clearInterval(this._timer),this.dispatchEvent(new CustomEvent("velin-countdown-end",{bubbles:!0})))}disconnectedCallback(){this._timer&&clearInterval(this._timer)}attributeChangedCallback(){this._timer&&(clearInterval(this._timer),this._start())}};customElements.define("velin-countdown",ni);xs=ni});var Es={};f(Es,{default:()=>ws});var bd,oi,ws,$r=d(()=>{bd=`
|
|
855
855
|
:host { display: inline-flex; align-items: center; justify-content: center; }
|
|
856
856
|
svg { transform: rotate(-90deg); }
|
|
857
857
|
.track { fill: none; stroke: var(--velin-color-border, #e5e5e5); }
|
|
@@ -869,16 +869,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
869
869
|
}
|
|
870
870
|
:host { position: relative; }
|
|
871
871
|
@media (prefers-reduced-motion: reduce) { .fill { transition: none; } }
|
|
872
|
-
`,oi=class extends HTMLElement{static get observedAttributes(){return["value","size","stroke","color"]}constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this._render()}_render(){let e=Math.min(100,Math.max(0,parseInt(this.getAttribute("value")||"0",10))),t=parseInt(this.getAttribute("size")||"120",10),r=parseInt(this.getAttribute("stroke")||"8",10),n=(t-r)/2,o=2*Math.PI*n,a=o-e/100*o,
|
|
873
|
-
<style>${
|
|
872
|
+
`,oi=class extends HTMLElement{static get observedAttributes(){return["value","size","stroke","color"]}constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this._render()}_render(){let e=Math.min(100,Math.max(0,parseInt(this.getAttribute("value")||"0",10))),t=parseInt(this.getAttribute("size")||"120",10),r=parseInt(this.getAttribute("stroke")||"8",10),n=(t-r)/2,o=2*Math.PI*n,a=o-e/100*o,l=this.getAttribute("color"),u=l?`stroke: var(--velin-color-${l}, ${l});`:"",m=this.getAttribute("label")!=="false";this.shadowRoot.innerHTML=`
|
|
873
|
+
<style>${bd}</style>
|
|
874
874
|
<svg width="${t}" height="${t}" viewBox="0 0 ${t} ${t}" part="svg" role="progressbar" aria-valuenow="${e}" aria-valuemin="0" aria-valuemax="100">
|
|
875
875
|
<circle class="track" cx="${t/2}" cy="${t/2}" r="${n}" stroke-width="${r}" />
|
|
876
876
|
<circle class="fill" cx="${t/2}" cy="${t/2}" r="${n}" stroke-width="${r}"
|
|
877
877
|
stroke-dasharray="${o}" stroke-dashoffset="${a}"
|
|
878
|
-
style="${
|
|
878
|
+
style="${u}" part="fill" />
|
|
879
879
|
</svg>
|
|
880
880
|
${m?`<span class="label" part="label">${e}%</span>`:""}
|
|
881
|
-
`,this.setAttribute("role","progressbar"),this.setAttribute("aria-valuenow",e),this.setAttribute("aria-valuemin","0"),this.setAttribute("aria-valuemax","100"),this.setAttribute("aria-label",this.getAttribute("aria-label")||`${e}%`)}attributeChangedCallback(){this._render()}};customElements.define("velin-progress-ring",oi);
|
|
881
|
+
`,this.setAttribute("role","progressbar"),this.setAttribute("aria-valuenow",e),this.setAttribute("aria-valuemin","0"),this.setAttribute("aria-valuemax","100"),this.setAttribute("aria-label",this.getAttribute("aria-label")||`${e}%`)}attributeChangedCallback(){this._render()}};customElements.define("velin-progress-ring",oi);ws=oi});var Ss={};f(Ss,{default:()=>ks});var vd,si,ks,zr=d(()=>{vd=/^[a-zA-Z0-9_-]{1,64}$/,si=class extends HTMLElement{static get observedAttributes(){return["key","storage"]}constructor(){super(),this._debounceTimer=null,this._onInput=this._onInput.bind(this),this._onSubmit=this._onSubmit.bind(this),this._onReset=this._onReset.bind(this)}get storageKey(){let e=this.getAttribute("key")||"default";return`velin-persist-${vd.test(e)?e:"default"}`}get _storage(){return this.getAttribute("storage")==="session"?sessionStorage:localStorage}connectedCallback(){this.style.display="contents",this.addEventListener("input",this._onInput),this.addEventListener("change",this._onInput),this.addEventListener("submit",this._onSubmit),this.addEventListener("reset",this._onReset),requestAnimationFrame(()=>this._restore())}disconnectedCallback(){this.removeEventListener("input",this._onInput),this.removeEventListener("change",this._onInput),this.removeEventListener("submit",this._onSubmit),this.removeEventListener("reset",this._onReset),this._debounceTimer&&clearTimeout(this._debounceTimer)}_onInput(){this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._save(),300)}_onSubmit(e){this.clear()}_onReset(){requestAnimationFrame(()=>this.clear())}_getFields(){return this.querySelectorAll("input[name], textarea[name], select[name]")}_save(){let e={};this._getFields().forEach(t=>{let r=t.name;r&&(t.type==="password"||t.type==="file"||(t.type==="checkbox"?e[r]=t.checked:t.type==="radio"?t.checked&&(e[r]=t.value):e[r]=t.value))});try{let t=JSON.stringify(e);if(t.length>65536)return;this._storage.setItem(this.storageKey,t)}catch(t){(t.name==="QuotaExceededError"||t.code===22)&&this.dispatchEvent(new CustomEvent("velin-persist-error",{bubbles:!0,detail:{error:"quota"}}))}}_restore(){let e;try{let t=this._storage.getItem(this.storageKey);if(!t||t.length>65536||(e=JSON.parse(t),typeof e!="object"||e===null))return}catch{return}this._getFields().forEach(t=>{let r=t.name;r in e&&(t.type==="checkbox"?t.checked=!!e[r]:t.type==="radio"?t.checked=t.value===e[r]:t.value=e[r])}),this.dispatchEvent(new CustomEvent("velin-persist-restore",{bubbles:!0,detail:{data:e}}))}clear(){try{this._storage.removeItem(this.storageKey)}catch{}this.dispatchEvent(new CustomEvent("velin-persist-clear",{bubbles:!0}))}};customElements.define("velin-persist",si);ks=si});var Ls={};f(Ls,{default:()=>Ts});var gd,ai,Ts,Hr=d(()=>{K();k();gd=`
|
|
882
882
|
:host { display: inline-block; position: relative; }
|
|
883
883
|
.listbox {
|
|
884
884
|
position: absolute; z-index: var(--velin-z-dropdown, 100);
|
|
@@ -904,10 +904,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
904
904
|
background: var(--velin-color-surface-dim, #eee);
|
|
905
905
|
}
|
|
906
906
|
`,ai=class extends HTMLElement{static get observedAttributes(){return["open","aria-label"]}constructor(){super(),this.attachShadow({mode:"open",delegatesFocus:!0}),this._onDocClick=this._onDocClick.bind(this),this._onKey=this._onKey.bind(this)}connectedCallback(){let e=`velin-combobox-list-${Math.random().toString(36).slice(2,9)}`;this._listId=e;let t=p(this.getAttribute("aria-label")||"Options");this.shadowRoot.innerHTML=`
|
|
907
|
-
<style>${
|
|
907
|
+
<style>${gd}</style>
|
|
908
908
|
<slot name="trigger"></slot>
|
|
909
909
|
<div class="listbox" id="${e}" role="listbox" aria-label="${t}" part="listbox"><slot></slot></div>
|
|
910
|
-
`,this.shadowRoot.querySelector('slot[name="trigger"]').addEventListener("slotchange",()=>this._wireTrigger()),this.shadowRoot.querySelector("slot:not([name])")?.addEventListener("slotchange",()=>this._wireOptions()),this._wireTrigger(),this._wireOptions(),this.addEventListener("keydown",this._onKey)}_wireTrigger(){let e=this.shadowRoot.querySelector('slot[name="trigger"]')?.assignedElements()[0];if(!e)return;e.setAttribute("role","combobox"),e.setAttribute("aria-expanded",this.hasAttribute("open")?"true":"false"),e.setAttribute("aria-controls",this._listId),e.setAttribute("aria-autocomplete","list"),e.id||(e.id=`velin-combobox-trigger-${Math.random().toString(36).slice(2,9)}`);let t=this.shadowRoot.querySelector(".listbox");t&&t.setAttribute("aria-labelledby",e.id),e.dataset.velinComboWired||(e.dataset.velinComboWired="1",e.addEventListener("click",()=>this.toggle()),e.addEventListener("keydown",r=>{(r.key==="ArrowDown"||r.key==="Enter")&&(r.preventDefault(),this.open())}))}_wireOptions(){this._getOptions().forEach((t,r)=>{t.setAttribute("role","option"),t.setAttribute("aria-selected",t.hasAttribute("selected")?"true":"false"),t.setAttribute("tabindex",r===0?"0":"-1")})}_getOptions(){let e=this.shadowRoot.querySelector("slot:not([name])");return e?e.assignedElements().filter(t=>!t.hidden):[]}toggle(){this.hasAttribute("open")?this.close():this.open()}open(){this.setAttribute("open","");let e=this.shadowRoot.querySelector('slot[name="trigger"]')?.assignedElements()[0];e&&e.setAttribute("aria-expanded","true"),document.addEventListener("click",this._onDocClick,!0),requestAnimationFrame(()=>{let t=this._getOptions();t.length&&t[0].focus()})}close(){this.removeAttribute("open");let e=this.shadowRoot.querySelector('slot[name="trigger"]')?.assignedElements()[0];e&&(e.setAttribute("aria-expanded","false"),e.focus()),document.removeEventListener("click",this._onDocClick,!0),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}_onDocClick(e){this.contains(e.target)||this.close()}_onKey(e){if(!this.hasAttribute("open"))return;if(e.key==="Escape"){this.close();return}let t=this._getOptions();t.length&&(
|
|
910
|
+
`,this.shadowRoot.querySelector('slot[name="trigger"]').addEventListener("slotchange",()=>this._wireTrigger()),this.shadowRoot.querySelector("slot:not([name])")?.addEventListener("slotchange",()=>this._wireOptions()),this._wireTrigger(),this._wireOptions(),this.addEventListener("keydown",this._onKey)}_wireTrigger(){let e=this.shadowRoot.querySelector('slot[name="trigger"]')?.assignedElements()[0];if(!e)return;e.setAttribute("role","combobox"),e.setAttribute("aria-expanded",this.hasAttribute("open")?"true":"false"),e.setAttribute("aria-controls",this._listId),e.setAttribute("aria-autocomplete","list"),e.id||(e.id=`velin-combobox-trigger-${Math.random().toString(36).slice(2,9)}`);let t=this.shadowRoot.querySelector(".listbox");t&&t.setAttribute("aria-labelledby",e.id),e.dataset.velinComboWired||(e.dataset.velinComboWired="1",e.addEventListener("click",()=>this.toggle()),e.addEventListener("keydown",r=>{(r.key==="ArrowDown"||r.key==="Enter")&&(r.preventDefault(),this.open())}))}_wireOptions(){this._getOptions().forEach((t,r)=>{t.setAttribute("role","option"),t.setAttribute("aria-selected",t.hasAttribute("selected")?"true":"false"),t.setAttribute("tabindex",r===0?"0":"-1")})}_getOptions(){let e=this.shadowRoot.querySelector("slot:not([name])");return e?e.assignedElements().filter(t=>!t.hidden):[]}toggle(){this.hasAttribute("open")?this.close():this.open()}open(){this.setAttribute("open","");let e=this.shadowRoot.querySelector('slot[name="trigger"]')?.assignedElements()[0];e&&e.setAttribute("aria-expanded","true"),document.addEventListener("click",this._onDocClick,!0),requestAnimationFrame(()=>{let t=this._getOptions();t.length&&t[0].focus()})}close(){this.removeAttribute("open");let e=this.shadowRoot.querySelector('slot[name="trigger"]')?.assignedElements()[0];e&&(e.setAttribute("aria-expanded","false"),e.focus()),document.removeEventListener("click",this._onDocClick,!0),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}_onDocClick(e){this.contains(e.target)||this.close()}_onKey(e){if(!this.hasAttribute("open"))return;if(e.key==="Escape"){this.close();return}let t=this._getOptions();t.length&&(X(this,t,e),e.key==="Enter"&&t.includes(e.target)&&(this._selectOption(e.target),this.close()))}_selectOption(e){this._getOptions().forEach(r=>r.setAttribute("aria-selected",r===e?"true":"false"));let t=this.shadowRoot.querySelector('slot[name="trigger"]')?.assignedElements()[0];t&&"value"in t&&(t.value=e.textContent?.trim()||""),this.dispatchEvent(new CustomEvent("velin-select",{bubbles:!0,detail:{option:e}}))}attributeChangedCallback(e){if(e==="open"&&this._wireTrigger(),e==="aria-label"){let t=this.shadowRoot?.querySelector(".listbox");t&&t.setAttribute("aria-label",p(this.getAttribute("aria-label")||"Options"))}}disconnectedCallback(){document.removeEventListener("click",this._onDocClick,!0)}};customElements.define("velin-combobox",ai);Ts=ai});var Rs={};f(Rs,{default:()=>Cs});var yd,li,Cs,Pr=d(()=>{k();yd=`
|
|
911
911
|
:host { display: block; }
|
|
912
912
|
nav {
|
|
913
913
|
display: flex;
|
|
@@ -938,9 +938,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
938
938
|
font-weight: var(--velin-weight-semibold, 600);
|
|
939
939
|
}
|
|
940
940
|
`,li=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this._onSlot=this._onSlot.bind(this)}connectedCallback(){let e=p(this.getAttribute("aria-label")||"Bottom navigation");this.shadowRoot.innerHTML=`
|
|
941
|
-
<style>${
|
|
941
|
+
<style>${yd}</style>
|
|
942
942
|
<nav role="navigation" aria-label="${e}"><slot></slot></nav>
|
|
943
|
-
`,this.shadowRoot.querySelector("slot").addEventListener("slotchange",this._onSlot),this._onSlot()}_onSlot(){this._syncCurrent(),this._syncSlotLabels()}_syncSlotLabels(){let e=this.shadowRoot?.querySelector("slot");e&&e.assignedElements().forEach(t=>{if(!t.textContent?.replace(/\s+/g," ").trim()&&!t.getAttribute("aria-label")){let n=t.getAttribute("data-nav")||t.getAttribute("title")||t.getAttribute("aria-labelledby");n&&t.setAttribute("aria-label",n)}t.tagName==="A"&&!t.getAttribute("href")&&t.setAttribute("role","button")})}_syncCurrent(){let e=this.shadowRoot?.querySelector("slot");if(!e)return;let t=this.getAttribute("current");e.assignedElements().forEach(r=>{r.hasAttribute("current")||t&&(r.dataset.nav===t||r.getAttribute("data-nav")===t)?(r.setAttribute("current",""),r.setAttribute("aria-current","page")):(r.removeAttribute("current"),r.removeAttribute("aria-current"))})}static get observedAttributes(){return["aria-label","current"]}attributeChangedCallback(e){if(e==="aria-label"){let t=this.shadowRoot?.querySelector("nav");t&&t.setAttribute("aria-label",p(this.getAttribute("aria-label")||"Bottom navigation"))}e==="current"&&this._syncCurrent()}};customElements.define("velin-bottom-nav",li);
|
|
943
|
+
`,this.shadowRoot.querySelector("slot").addEventListener("slotchange",this._onSlot),this._onSlot()}_onSlot(){this._syncCurrent(),this._syncSlotLabels()}_syncSlotLabels(){let e=this.shadowRoot?.querySelector("slot");e&&e.assignedElements().forEach(t=>{if(!t.textContent?.replace(/\s+/g," ").trim()&&!t.getAttribute("aria-label")){let n=t.getAttribute("data-nav")||t.getAttribute("title")||t.getAttribute("aria-labelledby");n&&t.setAttribute("aria-label",n)}t.tagName==="A"&&!t.getAttribute("href")&&t.setAttribute("role","button")})}_syncCurrent(){let e=this.shadowRoot?.querySelector("slot");if(!e)return;let t=this.getAttribute("current");e.assignedElements().forEach(r=>{r.hasAttribute("current")||t&&(r.dataset.nav===t||r.getAttribute("data-nav")===t)?(r.setAttribute("current",""),r.setAttribute("aria-current","page")):(r.removeAttribute("current"),r.removeAttribute("aria-current"))})}static get observedAttributes(){return["aria-label","current"]}attributeChangedCallback(e){if(e==="aria-label"){let t=this.shadowRoot?.querySelector("nav");t&&t.setAttribute("aria-label",p(this.getAttribute("aria-label")||"Bottom navigation"))}e==="current"&&this._syncCurrent()}};customElements.define("velin-bottom-nav",li);Cs=li});var de,We=d(()=>{de=`
|
|
944
944
|
:host { display: block; }
|
|
945
945
|
button, [role="button"] {
|
|
946
946
|
min-inline-size: 2.75rem;
|
|
@@ -956,8 +956,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
956
956
|
border: 1px solid ButtonText;
|
|
957
957
|
}
|
|
958
958
|
}
|
|
959
|
-
`});var
|
|
960
|
-
${
|
|
959
|
+
`});var Ms={};f(Ms,{default:()=>Is});var _d,ci,Is,qr=d(()=>{K();k();We();_d=`
|
|
960
|
+
${de}
|
|
961
961
|
:host { display: contents; }
|
|
962
962
|
.overlay {
|
|
963
963
|
position: fixed; inset: 0; z-index: var(--velin-z-overlay, 400);
|
|
@@ -988,7 +988,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
988
988
|
.body { flex: 1; overflow-y: auto; padding: var(--velin-space-5, 1.25rem); }
|
|
989
989
|
@media (prefers-reduced-motion: reduce) { .overlay, .sheet { transition: none; } }
|
|
990
990
|
`,ci=class extends HTMLElement{static get observedAttributes(){return["open"]}constructor(){super(),this.attachShadow({mode:"open",delegatesFocus:!0}),this._prev=null,this._onKey=this._onKey.bind(this)}connectedCallback(){let e=p(this.getAttribute("title")||this.getAttribute("label")||""),t="velin-sheet-title";this.shadowRoot.innerHTML=`
|
|
991
|
-
<style>${
|
|
991
|
+
<style>${_d}</style>
|
|
992
992
|
<div class="overlay" part="overlay"></div>
|
|
993
993
|
<div class="sheet" role="dialog" aria-modal="true" aria-labelledby="${t}" part="sheet">
|
|
994
994
|
<div class="header" part="header">
|
|
@@ -997,8 +997,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
997
997
|
</div>
|
|
998
998
|
<div class="body" part="body"><slot></slot></div>
|
|
999
999
|
</div>
|
|
1000
|
-
`,this.shadowRoot.querySelector(".close-btn").addEventListener("click",()=>this.close()),this.shadowRoot.querySelector(".overlay").addEventListener("click",()=>this.close()),this.hasAttribute("open")&&this._open()}attributeChangedCallback(e){e==="open"&&(this.hasAttribute("open")?this._open():this._close())}open(){this.setAttribute("open","")}close(){this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}_open(){this._prev=
|
|
1001
|
-
${
|
|
1000
|
+
`,this.shadowRoot.querySelector(".close-btn").addEventListener("click",()=>this.close()),this.shadowRoot.querySelector(".overlay").addEventListener("click",()=>this.close()),this.hasAttribute("open")&&this._open()}attributeChangedCallback(e){e==="open"&&(this.hasAttribute("open")?this._open():this._close())}open(){this.setAttribute("open","")}close(){this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}_open(){this._prev=Q(),te(this),document.addEventListener("keydown",this._onKey),document.body.style.overflow="hidden",requestAnimationFrame(()=>{let e=ce(this.shadowRoot);e.length&&e[0].focus()})}_close(){document.removeEventListener("keydown",this._onKey),document.body.style.overflow="",ie(),ee(this._prev)}_onKey(e){if(e.key==="Escape"){this.close();return}Y(this.shadowRoot,e)}disconnectedCallback(){document.removeEventListener("keydown",this._onKey),document.body.style.overflow=""}};customElements.define("velin-sheet",ci);Is=ci});var Os={};f(Os,{default:()=>Ds});var xd,di,Ds,Br=d(()=>{K();k();We();xd=`
|
|
1001
|
+
${de}
|
|
1002
1002
|
:host { display: block; }
|
|
1003
1003
|
.group {
|
|
1004
1004
|
display: inline-flex;
|
|
@@ -1025,10 +1025,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1025
1025
|
box-shadow: var(--velin-shadow-sm, 0 1px 2px rgba(0,0,0,0.06));
|
|
1026
1026
|
}
|
|
1027
1027
|
`,di=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open",delegatesFocus:!0}),this._onClick=this._onClick.bind(this),this._onKey=this._onKey.bind(this)}connectedCallback(){let e=p(this.getAttribute("aria-label")||"Segmented control");this.shadowRoot.innerHTML=`
|
|
1028
|
-
<style>${
|
|
1028
|
+
<style>${xd}</style>
|
|
1029
1029
|
<div class="group" role="group" aria-label="${e}"><slot></slot></div>
|
|
1030
|
-
`,this.addEventListener("click",this._onClick),this.addEventListener("keydown",this._onKey),this.shadowRoot.querySelector("slot")?.addEventListener("slotchange",()=>this._init()),this._init()}_getButtons(){let e=this.shadowRoot.querySelector("slot");return e?e.assignedElements().filter(t=>t.tagName==="BUTTON"):[]}_init(){let e=this._getButtons(),t=e.find(r=>r.hasAttribute("selected"))||e[0];e.forEach((r,n)=>{r.setAttribute("aria-pressed",r===t?"true":"false"),r.setAttribute("tabindex",r===t?"0":"-1")})}_onClick(e){let t=e.target.closest("button");!t||!this.contains(t)||this._select(t)}_select(e){this._getButtons().forEach(t=>{t.setAttribute("aria-pressed",t===e?"true":"false"),t.setAttribute("tabindex",t===e?"0":"-1")}),this.dispatchEvent(new CustomEvent("velin-change",{bubbles:!0,detail:{value:e.value||e.textContent?.trim()}}))}_onKey(e){let t=this._getButtons();if(t.includes(e.target)&&(
|
|
1031
|
-
${
|
|
1030
|
+
`,this.addEventListener("click",this._onClick),this.addEventListener("keydown",this._onKey),this.shadowRoot.querySelector("slot")?.addEventListener("slotchange",()=>this._init()),this._init()}_getButtons(){let e=this.shadowRoot.querySelector("slot");return e?e.assignedElements().filter(t=>t.tagName==="BUTTON"):[]}_init(){let e=this._getButtons(),t=e.find(r=>r.hasAttribute("selected"))||e[0];e.forEach((r,n)=>{r.setAttribute("aria-pressed",r===t?"true":"false"),r.setAttribute("tabindex",r===t?"0":"-1")})}_onClick(e){let t=e.target.closest("button");!t||!this.contains(t)||this._select(t)}_select(e){this._getButtons().forEach(t=>{t.setAttribute("aria-pressed",t===e?"true":"false"),t.setAttribute("tabindex",t===e?"0":"-1")}),this.dispatchEvent(new CustomEvent("velin-change",{bubbles:!0,detail:{value:e.value||e.textContent?.trim()}}))}_onKey(e){let t=this._getButtons();if(t.includes(e.target)&&(X(this,t,e),["ArrowLeft","ArrowRight","Home","End"].includes(e.key))){let r=t.find(n=>n.getAttribute("tabindex")==="0");r&&this._select(r)}}static get observedAttributes(){return["aria-label"]}attributeChangedCallback(e){if(e==="aria-label"){let t=this.shadowRoot?.querySelector(".group");t&&t.setAttribute("aria-label",p(this.getAttribute("aria-label")||"Segmented control"))}}disconnectedCallback(){this.removeEventListener("click",this._onClick),this.removeEventListener("keydown",this._onKey)}};customElements.define("velin-segmented-control",di);Ds=di});var $s={};f($s,{default:()=>Fs});var Ad,Ns,ui,Fs,Ur=d(()=>{K();k();We();Ad=`
|
|
1031
|
+
${de}
|
|
1032
1032
|
:host { display: inline-block; }
|
|
1033
1033
|
.stars { display: inline-flex; gap: var(--velin-space-1, 0.25rem); }
|
|
1034
1034
|
button {
|
|
@@ -1037,8 +1037,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1037
1037
|
color: var(--velin-color-border, #ccc);
|
|
1038
1038
|
}
|
|
1039
1039
|
button[aria-checked="true"] { color: var(--velin-color-warning, #f59e0b); }
|
|
1040
|
-
`,
|
|
1041
|
-
${
|
|
1040
|
+
`,Ns=5,ui=class extends HTMLElement{static get observedAttributes(){return["value"]}constructor(){super(),this.attachShadow({mode:"open",delegatesFocus:!0}),this._onClick=this._onClick.bind(this),this._onKey=this._onKey.bind(this)}connectedCallback(){this.shadowRoot.innerHTML=`<style>${Ad}</style><div class="stars" role="radiogroup"></div>`,this._render(),this.shadowRoot.querySelector(".stars").addEventListener("click",this._onClick),this.shadowRoot.querySelector(".stars").addEventListener("keydown",this._onKey)}_value(){let e=parseInt(this.getAttribute("value")||"0",10);return Math.min(Ns,Math.max(0,Number.isNaN(e)?0:e))}_render(){let e=this.shadowRoot.querySelector(".stars"),t=this._value(),r=p(this.getAttribute("aria-label")||"Rating");e.setAttribute("aria-label",r),e.innerHTML="";for(let n=1;n<=Ns;n++){let o=document.createElement("button");o.type="button",o.setAttribute("role","radio"),o.setAttribute("aria-checked",n<=t?"true":"false"),o.setAttribute("aria-label",p(`${n} star${n>1?"s":""}`)),o.setAttribute("tabindex",n===(t||1)?"0":"-1"),o.dataset.value=String(n),o.textContent=n<=t?"\u2605":"\u2606",e.appendChild(o)}}_getButtons(){return[...this.shadowRoot.querySelectorAll('button[role="radio"]')]}_onClick(e){let t=e.target.closest("button");t&&this._setValue(parseInt(t.dataset.value,10))}_onKey(e){let t=this._getButtons();if(t.includes(e.target)&&(X(this,t,e),["ArrowLeft","ArrowRight","Home","End"].includes(e.key))){let r=t.find(n=>n.getAttribute("tabindex")==="0");r&&this._setValue(parseInt(r.dataset.value,10))}}_setValue(e){this.setAttribute("value",String(e)),this.dispatchEvent(new CustomEvent("velin-change",{bubbles:!0,detail:{value:e}}))}attributeChangedCallback(e){e==="value"&&this.shadowRoot?.querySelector(".stars")&&this._render()}};customElements.define("velin-rating",ui);Fs=ui});var Hs={};f(Hs,{default:()=>zs});var wd,hi,zs,jr=d(()=>{K();k();We();wd=`
|
|
1041
|
+
${de}
|
|
1042
1042
|
:host { display: block; }
|
|
1043
1043
|
.menubar {
|
|
1044
1044
|
display: flex;
|
|
@@ -1063,10 +1063,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1063
1063
|
background: var(--velin-color-surface-dim, #eee);
|
|
1064
1064
|
}
|
|
1065
1065
|
`,hi=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open",delegatesFocus:!0}),this._onKey=this._onKey.bind(this)}connectedCallback(){let e=p(this.getAttribute("aria-label")||"Menu bar");this.shadowRoot.innerHTML=`
|
|
1066
|
-
<style>${
|
|
1066
|
+
<style>${wd}</style>
|
|
1067
1067
|
<div class="menubar" role="menubar" aria-label="${e}"><slot></slot></div>
|
|
1068
|
-
`,this.addEventListener("keydown",this._onKey),this.shadowRoot.querySelector("slot")?.addEventListener("slotchange",()=>this._init()),this._init()}_getItems(){let e=this.shadowRoot.querySelector("slot");return e?e.assignedElements().filter(t=>!t.hasAttribute("disabled")):[]}_init(){this._getItems().forEach((t,r)=>{t.hasAttribute("role")||t.setAttribute("role","menuitem"),t.setAttribute("tabindex",r===0?"0":"-1")})}_onKey(e){let t=this._getItems();t.includes(e.target)&&
|
|
1069
|
-
${
|
|
1068
|
+
`,this.addEventListener("keydown",this._onKey),this.shadowRoot.querySelector("slot")?.addEventListener("slotchange",()=>this._init()),this._init()}_getItems(){let e=this.shadowRoot.querySelector("slot");return e?e.assignedElements().filter(t=>!t.hasAttribute("disabled")):[]}_init(){this._getItems().forEach((t,r)=>{t.hasAttribute("role")||t.setAttribute("role","menuitem"),t.setAttribute("tabindex",r===0?"0":"-1")})}_onKey(e){let t=this._getItems();t.includes(e.target)&&X(this,t,e)}static get observedAttributes(){return["aria-label"]}attributeChangedCallback(e){if(e==="aria-label"){let t=this.shadowRoot?.querySelector(".menubar");t&&t.setAttribute("aria-label",p(this.getAttribute("aria-label")||"Menu bar"))}}disconnectedCallback(){this.removeEventListener("keydown",this._onKey)}};customElements.define("velin-menubar",hi);zs=hi});var qs={};f(qs,{default:()=>Ps});var Ed,pi,Ps,Kr=d(()=>{K();k();We();Ed=`
|
|
1069
|
+
${de}
|
|
1070
1070
|
:host { display: contents; }
|
|
1071
1071
|
.overlay {
|
|
1072
1072
|
position: fixed; inset: 0; z-index: var(--velin-z-modal, 500);
|
|
@@ -1105,16 +1105,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1105
1105
|
background: var(--velin-color-surface-dim, #eee);
|
|
1106
1106
|
}
|
|
1107
1107
|
`,pi=class extends HTMLElement{static get observedAttributes(){return["open"]}constructor(){super(),this.attachShadow({mode:"open",delegatesFocus:!0}),this._prev=null,this._onKey=this._onKey.bind(this),this._onInput=this._onInput.bind(this)}connectedCallback(){let e=p(this.getAttribute("placeholder")||"Search commands\u2026");this.shadowRoot.innerHTML=`
|
|
1108
|
-
<style>${
|
|
1108
|
+
<style>${Ed}</style>
|
|
1109
1109
|
<div class="overlay" part="overlay">
|
|
1110
1110
|
<div class="panel" role="dialog" aria-modal="true" aria-label="Command palette" part="panel">
|
|
1111
1111
|
<input class="search" type="search" autocomplete="off" placeholder="${e}" aria-label="Search" part="search" />
|
|
1112
1112
|
<div class="results" part="results"><slot></slot></div>
|
|
1113
1113
|
</div>
|
|
1114
1114
|
</div>
|
|
1115
|
-
`,this.shadowRoot.querySelector(".search").addEventListener("input",this._onInput),this.shadowRoot.querySelector("slot")?.addEventListener("slotchange",()=>this._filter("")),this._filter("")}attributeChangedCallback(e){e==="open"&&(this.hasAttribute("open")?this._open():this._close())}open(){this.setAttribute("open","")}close(){this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}_open(){this._prev=
|
|
1115
|
+
`,this.shadowRoot.querySelector(".search").addEventListener("input",this._onInput),this.shadowRoot.querySelector("slot")?.addEventListener("slotchange",()=>this._filter("")),this._filter("")}attributeChangedCallback(e){e==="open"&&(this.hasAttribute("open")?this._open():this._close())}open(){this.setAttribute("open","")}close(){this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}_open(){this._prev=Q(),te(this),document.addEventListener("keydown",this._onKey),requestAnimationFrame(()=>{this.shadowRoot.querySelector(".search")?.focus(),this._filter("")})}_close(){document.removeEventListener("keydown",this._onKey),ie(),ee(this._prev);let e=this.shadowRoot.querySelector(".search");e&&(e.value=""),this._filter("")}_onInput(e){this._filter(e.target.value)}_filter(e){let t=e.trim().toLowerCase();this.shadowRoot.querySelector("slot")?.assignedElements().forEach(n=>{let o=n.textContent?.trim().toLowerCase()||"",a=!t||o.includes(t);n.hidden=!a})}_visibleItems(){return this.shadowRoot.querySelector("slot")?.assignedElements().filter(t=>t.tagName==="BUTTON"&&!t.hidden)||[]}_onKey(e){if(e.key==="Escape"){this.close();return}let t=this._visibleItems();if(t.length&&(e.key==="ArrowDown"||e.key==="ArrowUp")){e.preventDefault();let r=t.indexOf(document.activeElement);(e.key==="ArrowDown"?t[(r+1)%t.length]:t[(r<=0?t.length:r)-1])?.focus();return}Y(this.shadowRoot,e)}disconnectedCallback(){document.removeEventListener("keydown",this._onKey)}};customElements.define("velin-command",pi);Ps=pi});var Us={};f(Us,{default:()=>Bs});var kd,mi,Bs,Wr=d(()=>{kd=`
|
|
1116
1116
|
:host { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
|
|
1117
|
-
`,mi=class extends HTMLElement{connectedCallback(){this.shadowRoot||this.attachShadow({mode:"open"});let e=this.getAttribute("polite")==="false"?"assertive":"polite";this.shadowRoot.innerHTML="<style>"+
|
|
1117
|
+
`,mi=class extends HTMLElement{connectedCallback(){this.shadowRoot||this.attachShadow({mode:"open"});let e=this.getAttribute("polite")==="false"?"assertive":"polite";this.shadowRoot.innerHTML="<style>"+kd+'</style><div role="status" aria-live="'+e+'" aria-atomic="true" part="region"></div>',this._region=this.shadowRoot.querySelector('[role="status"]')}announce(e,{assertive:t=!1}={}){this._region||this.connectedCallback(),this._region.setAttribute("aria-live",t?"assertive":"polite"),this._region.textContent="",requestAnimationFrame(()=>{this._region.textContent=typeof e=="string"?e:""})}static announceGlobal(e,t){let r=document.querySelector("velin-announcer");r||(r=document.createElement("velin-announcer"),document.body.appendChild(r)),r.announce(e,t)}};customElements.define("velin-announcer",mi);Bs=mi});var Ws={};f(Ws,{default:()=>Ks});function Sd(i,e){if(!i)return"";if(e==="rot13")return i.replace(/[a-zA-Z]/g,t=>{let r=t<="Z"?65:97;return String.fromCharCode((t.charCodeAt(0)-r+13)%26+r)});try{return atob(i)}catch{return i}}var js,fi,Ks,bi=d(()=>{k();js=`
|
|
1118
1118
|
:host { display: inline; }
|
|
1119
1119
|
button {
|
|
1120
1120
|
font: inherit;
|
|
@@ -1134,15 +1134,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1134
1134
|
border-radius: 2px;
|
|
1135
1135
|
}
|
|
1136
1136
|
.revealed { text-decoration: none; user-select: text; }
|
|
1137
|
-
`;fi=class extends HTMLElement{static get observedAttributes(){return["value","obfuscate","label"]}constructor(){super(),this.attachShadow({mode:"open"}),this._revealed=!1}connectedCallback(){this.render()}attributeChangedCallback(){this.isConnected&&this.render()}get email(){let e=this.getAttribute("obfuscate")||"",t=this.getAttribute("value")||"";return e?
|
|
1138
|
-
<style>${
|
|
1139
|
-
<span class="revealed" part="email"><a href="mailto:${
|
|
1137
|
+
`;fi=class extends HTMLElement{static get observedAttributes(){return["value","obfuscate","label"]}constructor(){super(),this.attachShadow({mode:"open"}),this._revealed=!1}connectedCallback(){this.render()}attributeChangedCallback(){this.isConnected&&this.render()}get email(){let e=this.getAttribute("obfuscate")||"",t=this.getAttribute("value")||"";return e?Sd(t,e):t}render(){let e=this.getAttribute("label")||"Show email address",t=this.email,r=p(t);if(this._revealed){this.shadowRoot.innerHTML=`
|
|
1138
|
+
<style>${js}</style>
|
|
1139
|
+
<span class="revealed" part="email"><a href="mailto:${fe(t)}">${r}</a></span>
|
|
1140
1140
|
`;return}this.shadowRoot.innerHTML=`
|
|
1141
|
-
<style>${
|
|
1142
|
-
<button type="button" part="reveal" aria-label="${
|
|
1143
|
-
`,this.shadowRoot.querySelector("button").addEventListener("click",()=>{this._revealed=!0,this.render(),this.dispatchEvent(new CustomEvent("velin-email-reveal",{bubbles:!0,detail:{email:t}}))})}};customElements.get("velin-email")||customElements.define("velin-email",fi);Is=fi});function te(i,e){let t=[],r=0;for(;r<i.length;){let n=!1;for(let{type:o,re:a}of e){a.lastIndex=r;let c=a.exec(i);if(c&&c.index===r){t.push({type:o,value:c[0]}),r+=c[0].length,n=!0;break}}if(!n){let o=t[t.length-1];o?.type==="plain"?o.value+=i[r]:t.push({type:"plain",value:i[r]}),r+=1}}return t}function ye(i,e,t){let r=[...t,{type:"keyword",re:new RegExp(`\\b(${Object.keys(e).join("|")})\\b`,"y")},{type:"identifier",re:/\b[A-Za-z_$][\w$]*\b/y}];return te(i,r)}var ce=u(()=>{});var Kr={};v(Kr,{default:()=>We});function We(i){return ye(i,nd,od)}var nd,od,ct=u(()=>{ce();nd={const:1,let:1,var:1,function:1,return:1,if:1,else:1,for:1,while:1,do:1,switch:1,case:1,break:1,continue:1,new:1,class:1,extends:1,import:1,export:1,from:1,default:1,async:1,await:1,try:1,catch:1,finally:1,throw:1,typeof:1,instanceof:1,in:1,of:1,true:1,false:1,null:1,undefined:1,void:1,this:1},od=[{type:"comment",re:/\/\/[^\n]*/y},{type:"comment",re:/\/\*[\s\S]*?\*\//y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'(?:\\.|[^'\\])*'/y},{type:"string",re:/`(?:\\.|[^`\\])*`/y},{type:"number",re:/\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/y},{type:"operator",re:/[+\-*/%=<>!&|^~?:]+/y},{type:"punctuation",re:/[{}[\]();,.]/y}]});var Wr={};v(Wr,{default:()=>Ds});function Ds(i){return We(i).map(e=>e.type==="identifier"&&sd.has(e.value)?{type:"keyword",value:e.value}:e)}var sd,Gr=u(()=>{ct();sd=new Set(["type","interface","enum","implements","declare","namespace","readonly","public","private","protected","abstract","as","satisfies","keyof"])});var bi={};v(bi,{default:()=>Ns});function Ns(i){return te(i,ad)}var ad,gi=u(()=>{ce();ad=[{type:"comment",re:/<!--[\s\S]*?-->/y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'(?:\\.|[^'\\])*'/y},{type:"tag",re:/<\/?[\w-]+/y},{type:"punctuation",re:/[<>/=]/y},{type:"attr-name",re:/\s[\w-]+(?==)/y},{type:"attr-value",re:/=(?:"[^"]*"|'[^']*'|[^\s>]+)/y}]});var $s={};v($s,{default:()=>Hs});function Hs(i){return ye(i,ld,cd)}var ld,cd,zs=u(()=>{ce();ld={important:1,inherit:1,initial:1,unset:1,revert:1},cd=[{type:"comment",re:/\/\*[\s\S]*?\*\//y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'(?:\\.|[^'\\])*'/y},{type:"number",re:/#[\da-fA-F]{3,8}\b|\b\d+(?:\.\d+)?(?:%|[a-z]+)?\b/y},{type:"tag",re:/\.[\w-]+|#[\w-]+/y},{type:"attr-name",re:/[\w-]+(?=\s*:)/y},{type:"punctuation",re:/[{}:;,()]/y},{type:"operator",re:/[+\-*/>~]/y}]});var Ps={};v(Ps,{default:()=>Fs});function Fs(i){return te(i,dd)}var dd,qs=u(()=>{ce();dd=[{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"number",re:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/y},{type:"keyword",re:/\b(true|false|null)\b/y},{type:"punctuation",re:/[{}[\]:,]/y}]});var Yr={};v(Yr,{default:()=>Us});function Us(i){return te(i,ud)}var ud,Vr=u(()=>{ce();ud=[{type:"comment",re:/<!--[\s\S]*?-->/y},{type:"string",re:/```[\s\S]*?```/y},{type:"string",re:/`[^`\n]+`/y},{type:"keyword",re:/#{1,6}\s[^\n]+/y},{type:"tag",re:/\[[^\]]+\]\([^)]+\)/y},{type:"operator",re:/[*_~]/y}]});var yi={};v(yi,{default:()=>Bs});function Bs(i){return ye(i,hd,pd)}var hd,pd,_i=u(()=>{ce();hd={if:1,then:1,else:1,fi:1,for:1,do:1,done:1,while:1,case:1,esac:1,function:1,return:1,export:1,local:1},pd=[{type:"comment",re:/#[^\n]*/y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'[^']*'/y},{type:"number",re:/\b\d+\b/y},{type:"operator",re:/[|&<>]/y},{type:"punctuation",re:/[();]/y}]});var Ks={};v(Ks,{default:()=>js});function js(i){return te(i,md)}var md,Ws=u(()=>{ce();md=[{type:"comment",re:/--[^\n]*/y},{type:"comment",re:/\/\*[\s\S]*?\*\//y},{type:"string",re:/'(?:''|[^'])*'/y},{type:"number",re:/\b\d+(?:\.\d+)?\b/y},{type:"keyword",re:/\b(?:SELECT|FROM|WHERE|INSERT|INTO|VALUES|UPDATE|SET|DELETE|JOIN|LEFT|RIGHT|INNER|OUTER|ON|AND|OR|NOT|NULL|AS|ORDER|BY|GROUP|HAVING|LIMIT|CREATE|TABLE|INDEX)\b/yi},{type:"operator",re:/[=<>!]+|,/y},{type:"punctuation",re:/[();]/y}]});var dt={};v(dt,{default:()=>Gs});function Gs(i){return i?[{type:"plain",value:i}]:[]}var ut=u(()=>{});var Vs={};v(Vs,{default:()=>Ys});function Ys(i){return ye(i,fd,vd)}var fd,vd,Xs=u(()=>{ce();fd={function:1,return:1,if:1,else:1,elseif:1,foreach:1,while:1,class:1,new:1,public:1,private:1,protected:1,static:1,namespace:1,use:1,true:1,false:1,null:1},vd=[{type:"comment",re:/\/\/[^\n]*/y},{type:"comment",re:/#[^\n]*/y},{type:"comment",re:/\/\*[\s\S]*?\*\//y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'(?:\\.|[^'\\])*'/y},{type:"number",re:/\b\d+(?:\.\d+)?\b/y},{type:"operator",re:/=>|\+\+|--|===|!==|==|!=|<=|>=|->|\?\?|[=+\-*/%.<>!&|^~?:]/y},{type:"punctuation",re:/[{}[\]();,.]/y}]});var Js={};v(Js,{default:()=>Zs});function Zs(i){return te(i,bd)}var bd,Qs=u(()=>{ce();bd=[{type:"comment",re:/{{--[\s\S]*?--}}/y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'(?:\\.|[^'\\])*'/y},{type:"keyword",re:/@(?:vite|csrf|auth|guest|section|endsection|yield|extends|include|push|endpush|stack|once|endonce|forelse|empty|endempty|can|endcan|cannot|endcannot)\b/y},{type:"operator",re:/{{|}}|{!!|!!}|@[{}]/y},{type:"punctuation",re:/[()[\],]/y}]});function fe(i){let e=(i||"").trim().toLowerCase();return e?e.startsWith("language-")?fe(e.slice(9)):{javascript:"js",jsx:"js",typescript:"ts",tsx:"ts",markup:"html",xml:"html",svg:"html",bash:"shell",sh:"shell",zsh:"shell",md:"markdown",plaintext:"text","plain-text":"text",yml:"text",yaml:"text",toml:"text",ini:"text",php8:"php"}[e]||e:""}function Ye(i,e){Ge.set(fe(i),e)}function ht(i){return Ge.get(fe(i))}async function _e(i){let e=fe(i);if(!e)return;if(Ge.has(e))return Ge.get(e);if(xi.has(e))return xi.get(e);let t=ea[e];if(!t)return;let r=t().then(n=>{let o=n.default;return Ge.set(e,o),xi.delete(e),o});return xi.set(e,r),r}function Ai(){return[...new Set([...Ge.keys(),...Object.keys(ea)])]}var Ge,xi,ea,wi=u(()=>{ct();Ge=new Map,xi=new Map,ea={js:()=>Promise.resolve().then(()=>(ct(),Kr)),javascript:()=>Promise.resolve().then(()=>(ct(),Kr)),ts:()=>Promise.resolve().then(()=>(Gr(),Wr)),typescript:()=>Promise.resolve().then(()=>(Gr(),Wr)),html:()=>Promise.resolve().then(()=>(gi(),bi)),xml:()=>Promise.resolve().then(()=>(gi(),bi)),css:()=>Promise.resolve().then(()=>(zs(),$s)),json:()=>Promise.resolve().then(()=>(qs(),Ps)),md:()=>Promise.resolve().then(()=>(Vr(),Yr)),markdown:()=>Promise.resolve().then(()=>(Vr(),Yr)),shell:()=>Promise.resolve().then(()=>(_i(),yi)),bash:()=>Promise.resolve().then(()=>(_i(),yi)),sh:()=>Promise.resolve().then(()=>(_i(),yi)),sql:()=>Promise.resolve().then(()=>(Ws(),Ks)),text:()=>Promise.resolve().then(()=>(ut(),dt)),plain:()=>Promise.resolve().then(()=>(ut(),dt)),txt:()=>Promise.resolve().then(()=>(ut(),dt)),markup:()=>Promise.resolve().then(()=>(gi(),bi)),console:()=>Promise.resolve().then(()=>(ut(),dt)),php:()=>Promise.resolve().then(()=>(Xs(),Vs)),blade:()=>Promise.resolve().then(()=>(Qs(),Js))};Ye("js",We)});function Xr(i){return i.replace(/[&<>"]/g,e=>gd[e]||e)}function Ei(i){return i.map(e=>{let t=e.type==="plain"?"":e.type;return`<span class="${t?`velin-token velin-token--${t}`:"velin-token"}">${Xr(e.value)}</span>`}).join("")}function ki(i,e){i.innerHTML=Ei(e),i.classList.add("velin-syntax-ready"),i.closest("pre")?.classList.add("velin-syntax-ready"),i.closest(".velin-code-block")?.classList.add("velin-syntax-ready")}var gd,Zr=u(()=>{gd={"&":"&","<":"<",">":">",'"':"""}});function Jr(i){let e=i.tagName==="PRE"?i:i.closest("pre"),t=i.tagName==="CODE"?i:e?.querySelector("code")||i,r=e||t,n=r.getAttribute("language")||r.getAttribute("data-language")||r.getAttribute("velin-code")||"";if(n&&n!=="true")return fe(n);let a=(t?.className||"").match(/\blanguage-([\w-]+)\b/i);return a?fe(a[1]):""}function Si(i){let t=(i.tagName==="CODE"?i:i.querySelector("code"))||i;if(t.dataset.velinSource!=null)return t.dataset.velinSource;let r=t.innerHTML;if(r&&/<|>|&/.test(r)){let n=document.createElement("textarea");if(n.innerHTML=r.replace(/<br\s*\/?>/gi,`
|
|
1144
|
-
`),n.value)return n.value}return t.textContent||""}async function
|
|
1145
|
-
`).length;g.textContent="";for(let A=0;A<w;A+=1){let E=A+1,re=document.createElement("span");n.has(E)&&(re.className="velin-code-block__line--highlight"),re.textContent=String(E),g.appendChild(re)}m.appendChild(g)}let b=document.createElement("pre");e&&(b.setAttribute("language",e),b.dataset.language=e);let _=document.createElement("code");e&&(_.className=`language-${e}`),_.textContent=o,b.appendChild(_),m.appendChild(b),this.appendChild(a),this.appendChild(m),this._pre=b}async _setupHighlight(){if(!this._pre)return;delete this._pre.dataset.velinHighlighted,delete this._pre.dataset.velinObserve,typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches?await ie(this._pre):xe(this,{root:this})}};customElements.define("velin-code-block",Li);ra=Li});var sa={};v(sa,{default:()=>oa});function Ad(i){let e=(i.getAttribute("format")||"number").toLowerCase(),t=i.getAttribute("locale")||void 0,r=i.getAttribute("decimals"),n=r!=null?Math.max(0,Number.parseInt(r,10)||0):null,o={};n!=null&&(o.minimumFractionDigits=n,o.maximumFractionDigits=n),e==="currency"?(o.style="currency",o.currency=i.getAttribute("currency")||"EUR"):e==="percent"&&(o.style="percent");try{return new Intl.NumberFormat(t,o)}catch{return new Intl.NumberFormat(void 0,o)}}var xd,Ci,oa,Ri=u(()=>{xd=i=>i===1?1:1-Math.pow(2,-10*i);Ci=class extends HTMLElement{static get observedAttributes(){return["from","to","duration","decimals","prefix","suffix","format","currency","locale"]}constructor(){super(),this._rafId=0,this._started=!1,this._observer=null}connectedCallback(){this.setAttribute("role","status"),this.setAttribute("aria-live","polite"),this.setAttribute("aria-atomic","true"),this._render(this._fromValue()),this.getAttribute("autostart")!=="false"&&this._scheduleStart()}disconnectedCallback(){cancelAnimationFrame(this._rafId),this._observer?.disconnect()}attributeChangedCallback(e){this.isConnected&&(e==="to"||e==="from"?this.start():this._render(this._lastValue??this._toValue()))}_fromValue(){return Number.parseFloat(this.getAttribute("from"))||0}_toValue(){return Number.parseFloat(this.getAttribute("to"))||0}_duration(){return Math.max(0,Number.parseFloat(this.getAttribute("duration"))||900)}_scheduleStart(){if(!this._started){if(typeof IntersectionObserver>"u"){this.start();return}this._observer=new IntersectionObserver(e=>{for(let t of e)if(t.isIntersecting){this.start(),this._observer.disconnect(),this._observer=null;break}},{threshold:.2}),this._observer.observe(this)}}start(){cancelAnimationFrame(this._rafId),this._started=!0;let e=this._fromValue(),t=this._toValue(),r=this._duration();if(typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches||r===0){this._render(t);return}let o=performance.now(),a=c=>{let d=Math.min(1,(c-o)/r),m=e+(t-e)*xd(d);this._render(m),d<1&&(this._rafId=requestAnimationFrame(a))};this._rafId=requestAnimationFrame(a)}reset(){cancelAnimationFrame(this._rafId),this._started=!1,this._render(this._fromValue())}_render(e){this._lastValue=e;let t=Ad(this),r=this.getAttribute("prefix")||"",n=this.getAttribute("suffix")||"";this.textContent=`${r}${t.format(e)}${n}`}};typeof customElements<"u"&&!customElements.get("velin-counter")&&customElements.define("velin-counter",Ci);oa=Ci});var ca={};v(ca,{default:()=>la});var aa,wd,Ed,Mi,la,Ii=u(()=>{Be();aa={live:"var(--velin-color-success, oklch(60% 0.16 145))",paused:"var(--velin-color-text-muted, oklch(60% 0.02 240))",warning:"var(--velin-color-warning, oklch(75% 0.16 80))",error:"var(--velin-color-danger, oklch(60% 0.2 25))",muted:"var(--velin-color-border, oklch(85% 0.01 240))"},wd=`
|
|
1141
|
+
<style>${js}</style>
|
|
1142
|
+
<button type="button" part="reveal" aria-label="${fe(e)}">${p(e)}</button>
|
|
1143
|
+
`,this.shadowRoot.querySelector("button").addEventListener("click",()=>{this._revealed=!0,this.render(),this.dispatchEvent(new CustomEvent("velin-email-reveal",{bubbles:!0,detail:{email:t}}))})}};customElements.get("velin-email")||customElements.define("velin-email",fi);Ks=fi});function O(i,e){let t=[],r=0;for(;r<i.length;){let n=!1;for(let{type:o,re:a}of e){a.lastIndex=r;let l=a.exec(i);if(l&&l.index===r){t.push({type:o,value:l[0]}),r+=l[0].length,n=!0;break}}if(!n){let o=t[t.length-1];o?.type==="plain"?o.value+=i[r]:t.push({type:"plain",value:i[r]}),r+=1}}return t}function xe(i,e,t){let r=[...t,{type:"keyword",re:new RegExp(`\\b(${Object.keys(e).join("|")})\\b`,"y")},{type:"identifier",re:/\b[A-Za-z_$][\w$]*\b/y}];return O(i,r)}var G=d(()=>{});var Gr={};f(Gr,{default:()=>Ge});function Ge(i){return xe(i,Td,Ld)}var Td,Ld,ct=d(()=>{G();Td={const:1,let:1,var:1,function:1,return:1,if:1,else:1,for:1,while:1,do:1,switch:1,case:1,break:1,continue:1,new:1,class:1,extends:1,import:1,export:1,from:1,default:1,async:1,await:1,try:1,catch:1,finally:1,throw:1,typeof:1,instanceof:1,in:1,of:1,true:1,false:1,null:1,undefined:1,void:1,this:1},Ld=[{type:"comment",re:/\/\/[^\n]*/y},{type:"comment",re:/\/\*[\s\S]*?\*\//y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'(?:\\.|[^'\\])*'/y},{type:"string",re:/`(?:\\.|[^`\\])*`/y},{type:"number",re:/\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/y},{type:"operator",re:/[+\-*/%=<>!&|^~?:]+/y},{type:"punctuation",re:/[{}[\]();,.]/y}]});var Vr={};f(Vr,{default:()=>Gs});function Gs(i){return Ge(i).map(e=>e.type==="identifier"&&Cd.has(e.value)?{type:"keyword",value:e.value}:e)}var Cd,Yr=d(()=>{ct();Cd=new Set(["type","interface","enum","implements","declare","namespace","readonly","public","private","protected","abstract","as","satisfies","keyof"])});var vi={};f(vi,{default:()=>Vs});function Vs(i){return O(i,Rd)}var Rd,gi=d(()=>{G();Rd=[{type:"comment",re:/<!--[\s\S]*?-->/y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'(?:\\.|[^'\\])*'/y},{type:"tag",re:/<\/?[\w-]+/y},{type:"punctuation",re:/[<>/=]/y},{type:"attr-name",re:/\s[\w-]+(?==)/y},{type:"attr-value",re:/=(?:"[^"]*"|'[^']*'|[^\s>]+)/y}]});var Xs={};f(Xs,{default:()=>Ys});function Ys(i){return xe(i,Id,Md)}var Id,Md,Zs=d(()=>{G();Id={important:1,inherit:1,initial:1,unset:1,revert:1},Md=[{type:"comment",re:/\/\*[\s\S]*?\*\//y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'(?:\\.|[^'\\])*'/y},{type:"number",re:/#[\da-fA-F]{3,8}\b|\b\d+(?:\.\d+)?(?:%|[a-z]+)?\b/y},{type:"tag",re:/\.[\w-]+|#[\w-]+/y},{type:"attr-name",re:/[\w-]+(?=\s*:)/y},{type:"punctuation",re:/[{}:;,()]/y},{type:"operator",re:/[+\-*/>~]/y}]});var Qs={};f(Qs,{default:()=>Js});function Js(i){return O(i,Dd)}var Dd,ea=d(()=>{G();Dd=[{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"number",re:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/y},{type:"keyword",re:/\b(true|false|null)\b/y},{type:"punctuation",re:/[{}[\]:,]/y}]});var Xr={};f(Xr,{default:()=>ta});function ta(i){return O(i,Od)}var Od,Zr=d(()=>{G();Od=[{type:"comment",re:/<!--[\s\S]*?-->/y},{type:"string",re:/```[\s\S]*?```/y},{type:"string",re:/`[^`\n]+`/y},{type:"keyword",re:/#{1,6}\s[^\n]+/y},{type:"tag",re:/\[[^\]]+\]\([^)]+\)/y},{type:"operator",re:/[*_~]/y}]});var yi={};f(yi,{default:()=>ia});function ia(i){return xe(i,Nd,Fd)}var Nd,Fd,_i=d(()=>{G();Nd={if:1,then:1,else:1,fi:1,for:1,do:1,done:1,while:1,case:1,esac:1,function:1,return:1,export:1,local:1},Fd=[{type:"comment",re:/#[^\n]*/y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'[^']*'/y},{type:"number",re:/\b\d+\b/y},{type:"operator",re:/[|&<>]/y},{type:"punctuation",re:/[();]/y}]});var na={};f(na,{default:()=>ra});function ra(i){return O(i,$d)}var $d,oa=d(()=>{G();$d=[{type:"comment",re:/--[^\n]*/y},{type:"comment",re:/\/\*[\s\S]*?\*\//y},{type:"string",re:/'(?:''|[^'])*'/y},{type:"number",re:/\b\d+(?:\.\d+)?\b/y},{type:"keyword",re:/\b(?:SELECT|FROM|WHERE|INSERT|INTO|VALUES|UPDATE|SET|DELETE|JOIN|LEFT|RIGHT|INNER|OUTER|ON|AND|OR|NOT|NULL|AS|ORDER|BY|GROUP|HAVING|LIMIT|CREATE|TABLE|INDEX)\b/yi},{type:"operator",re:/[=<>!]+|,/y},{type:"punctuation",re:/[();]/y}]});var dt={};f(dt,{default:()=>sa});function sa(i){return i?[{type:"plain",value:i}]:[]}var ut=d(()=>{});var la={};f(la,{default:()=>aa});function aa(i){return xe(i,zd,Hd)}var zd,Hd,ca=d(()=>{G();zd={function:1,return:1,if:1,else:1,elseif:1,foreach:1,while:1,class:1,new:1,public:1,private:1,protected:1,static:1,namespace:1,use:1,true:1,false:1,null:1},Hd=[{type:"comment",re:/\/\/[^\n]*/y},{type:"comment",re:/#[^\n]*/y},{type:"comment",re:/\/\*[\s\S]*?\*\//y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'(?:\\.|[^'\\])*'/y},{type:"number",re:/\b\d+(?:\.\d+)?\b/y},{type:"operator",re:/=>|\+\+|--|===|!==|==|!=|<=|>=|->|\?\?|[=+\-*/%.<>!&|^~?:]/y},{type:"punctuation",re:/[{}[\]();,.]/y}]});var ua={};f(ua,{default:()=>da});function da(i){return O(i,Pd)}var Pd,ha=d(()=>{G();Pd=[{type:"comment",re:/{{--[\s\S]*?--}}/y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'(?:\\.|[^'\\])*'/y},{type:"keyword",re:/@(?:vite|csrf|auth|guest|section|endsection|yield|extends|include|push|endpush|stack|once|endonce|forelse|empty|endempty|can|endcan|cannot|endcannot)\b/y},{type:"operator",re:/{{|}}|{!!|!!}|@[{}]/y},{type:"punctuation",re:/[()[\],]/y}]});var Jr={};f(Jr,{default:()=>pa});function pa(i){return O(i,qd)}var qd,Qr=d(()=>{G();qd=[{type:"comment",re:/#[^\n]*/y},{type:"string",re:/[rbfu]{0,2}"""[\s\S]*?"""/y},{type:"string",re:/[rbfu]{0,2}'''[\s\S]*?'''/y},{type:"string",re:/[rbfu]{0,2}"(?:\\.|[^"\\\n])*"/y},{type:"string",re:/[rbfu]{0,2}'(?:\\.|[^'\\\n])*'/y},{type:"number",re:/\b0[xX][\da-fA-F_]+\b|\b\d[\d_]*(?:\.[\d_]+)?(?:[eE][+-]?\d+)?j?\b/y},{type:"keyword",re:/\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|raise|return|try|while|with|yield)\b/y},{type:"builtin",re:/\b(?:None|True|False|self|cls|abs|all|any|bool|bytes|dict|dir|enumerate|filter|float|format|frozenset|getattr|hasattr|int|isinstance|issubclass|iter|len|list|map|max|min|next|object|open|print|range|repr|reversed|round|set|setattr|sorted|str|sum|super|tuple|type|zip)\b/y},{type:"operator",re:/->|:=|\*\*=?|\/\/=?|<<=?|>>=?|[-+*/%&|^~<>!=]=?/y},{type:"punctuation",re:/[[\]{}(),:;.@]/y},{type:"identifier",re:/\b[A-Za-z_]\w*\b/y}]});var en={};f(en,{default:()=>ma});function ma(i){return O(i,Bd)}var Bd,tn=d(()=>{G();Bd=[{type:"comment",re:/#[^\n]*/y},{type:"punctuation",re:/^(?:---|\.\.\.)$/my},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'(?:''|[^'])*'/y},{type:"attr-name",re:/^[ \t]*-?[ \t]*[\w.$-]+(?=[ \t]*:(?:[ \t]|$))/my},{type:"punctuation",re:/^[ \t]*-(?=[ \t]|$)/my},{type:"keyword",re:/\b(?:true|false|null|yes|no|on|off|~)\b/yi},{type:"number",re:/\b-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b/y},{type:"operator",re:/[&*]\w+|![\w/!-]*|[|>][+-]?\d*(?=\s*$)/my},{type:"punctuation",re:/[:,[\]{}]/y}]});var rn={};f(rn,{default:()=>fa});function fa(i){return O(i,Ud)}var Ud,nn=d(()=>{G();Ud=[{type:"comment",re:/\/\/[^\n]*/y},{type:"comment",re:/\/\*[\s\S]*?\*\//y},{type:"string",re:/`[^`]*`/y},{type:"string",re:/"(?:\\.|[^"\\\n])*"/y},{type:"string",re:/'(?:\\.|[^'\\\n])*'/y},{type:"number",re:/\b0[xX][\da-fA-F_]+\b|\b\d[\d_]*(?:\.[\d_]*)?(?:[eE][+-]?\d+)?i?\b/y},{type:"keyword",re:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go|goto|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/y},{type:"builtin",re:/\b(?:append|bool|byte|cap|clear|close|complex|complex64|complex128|copy|delete|error|float32|float64|imag|int|int8|int16|int32|int64|len|make|max|min|new|nil|panic|print|println|real|recover|rune|string|true|false|iota|uint|uint8|uint16|uint32|uint64|uintptr|any)\b/y},{type:"operator",re:/:=|\.\.\.|&&|\|\||<-|\+\+|--|<<=?|>>=?|&\^=?|[-+*/%&|^<>!=]=?|~/y},{type:"punctuation",re:/[[\]{}(),;:.]/y},{type:"identifier",re:/\b[A-Za-z_]\w*\b/y}]});var on={};f(on,{default:()=>ba});function ba(i){return O(i,jd)}var jd,sn=d(()=>{G();jd=[{type:"comment",re:/\/\/\/?[^\n]*/y},{type:"comment",re:/\/\*[\s\S]*?\*\//y},{type:"string",re:/b?r(#*)"[\s\S]*?"\1/y},{type:"string",re:/b?"(?:\\.|[^"\\])*"/y},{type:"string",re:/b?'(?:\\.|[^'\\])'/y},{type:"builtin",re:/#!?\[[^\]]*\]/y},{type:"number",re:/\b0[xXbo][\da-fA-F_]+\b|\b\d[\d_]*(?:\.[\d_]+)?(?:[eE][+-]?\d+)?(?:[iuf](?:8|16|32|64|128|size))?\b/y},{type:"keyword",re:/\b(?:as|async|await|break|const|continue|crate|dyn|else|enum|extern|fn|for|if|impl|in|let|loop|match|mod|move|mut|pub|ref|return|self|Self|static|struct|super|trait|type|unsafe|use|where|while)\b/y},{type:"builtin",re:/\b(?:bool|char|f32|f64|i8|i16|i32|i64|i128|isize|str|u8|u16|u32|u64|u128|usize|String|Vec|Option|Result|Some|None|Ok|Err|Box|Rc|Arc|true|false)\b/y},{type:"operator",re:/'[a-z_]\w*\b/y},{type:"operator",re:/=>|->|::|\.\.=?|&&|\|\||<<=?|>>=?|[-+*/%&|^<>!=]=?|[?@]/y},{type:"punctuation",re:/[[\]{}(),;:.#]/y},{type:"identifier",re:/\b[A-Za-z_]\w*!?\b/y}]});function be(i){let e=(i||"").trim().toLowerCase();return e?e.startsWith("language-")?be(e.slice(9)):{javascript:"js",jsx:"js",typescript:"ts",tsx:"ts",markup:"html",xml:"html",svg:"html",bash:"shell",sh:"shell",zsh:"shell",md:"markdown",plaintext:"text","plain-text":"text",yml:"yaml",toml:"text",ini:"text",php8:"php",py:"python",python3:"python",golang:"go",rs:"rust"}[e]||e:""}function Ye(i,e){Ve.set(be(i),e)}function ht(i){return Ve.get(be(i))}async function Ae(i){let e=be(i);if(!e)return;if(Ve.has(e))return Ve.get(e);if(xi.has(e))return xi.get(e);let t=va[e];if(!t)return;let r=t().then(n=>{let o=n.default;return Ve.set(e,o),xi.delete(e),o});return xi.set(e,r),r}function Ai(){return[...new Set([...Ve.keys(),...Object.keys(va)])]}var Ve,xi,va,wi=d(()=>{ct();Ve=new Map,xi=new Map,va={js:()=>Promise.resolve().then(()=>(ct(),Gr)),javascript:()=>Promise.resolve().then(()=>(ct(),Gr)),ts:()=>Promise.resolve().then(()=>(Yr(),Vr)),typescript:()=>Promise.resolve().then(()=>(Yr(),Vr)),html:()=>Promise.resolve().then(()=>(gi(),vi)),xml:()=>Promise.resolve().then(()=>(gi(),vi)),css:()=>Promise.resolve().then(()=>(Zs(),Xs)),json:()=>Promise.resolve().then(()=>(ea(),Qs)),md:()=>Promise.resolve().then(()=>(Zr(),Xr)),markdown:()=>Promise.resolve().then(()=>(Zr(),Xr)),shell:()=>Promise.resolve().then(()=>(_i(),yi)),bash:()=>Promise.resolve().then(()=>(_i(),yi)),sh:()=>Promise.resolve().then(()=>(_i(),yi)),sql:()=>Promise.resolve().then(()=>(oa(),na)),text:()=>Promise.resolve().then(()=>(ut(),dt)),plain:()=>Promise.resolve().then(()=>(ut(),dt)),txt:()=>Promise.resolve().then(()=>(ut(),dt)),markup:()=>Promise.resolve().then(()=>(gi(),vi)),console:()=>Promise.resolve().then(()=>(ut(),dt)),php:()=>Promise.resolve().then(()=>(ca(),la)),blade:()=>Promise.resolve().then(()=>(ha(),ua)),python:()=>Promise.resolve().then(()=>(Qr(),Jr)),py:()=>Promise.resolve().then(()=>(Qr(),Jr)),yaml:()=>Promise.resolve().then(()=>(tn(),en)),yml:()=>Promise.resolve().then(()=>(tn(),en)),go:()=>Promise.resolve().then(()=>(nn(),rn)),golang:()=>Promise.resolve().then(()=>(nn(),rn)),rust:()=>Promise.resolve().then(()=>(sn(),on)),rs:()=>Promise.resolve().then(()=>(sn(),on))};Ye("js",Ge)});function an(i){return i.replace(/[&<>"]/g,e=>Kd[e]||e)}function Ei(i){return i.map(e=>{let t=e.type==="plain"?"":e.type;return`<span class="${t?`velin-token velin-token--${t}`:"velin-token"}">${an(e.value)}</span>`}).join("")}function ki(i,e){i.innerHTML=Ei(e),i.classList.add("velin-syntax-ready"),i.closest("pre")?.classList.add("velin-syntax-ready"),i.closest(".velin-code-block")?.classList.add("velin-syntax-ready")}var Kd,ln=d(()=>{Kd={"&":"&","<":"<",">":">",'"':"""}});function cn(i){let e=i.tagName==="PRE"?i:i.closest("pre"),t=i.tagName==="CODE"?i:e?.querySelector("code")||i,r=e||t,n=r.getAttribute("language")||r.getAttribute("data-language")||r.getAttribute("velin-code")||"";if(n&&n!=="true")return be(n);let a=(t?.className||"").match(/\blanguage-([\w-]+)\b/i);return a?be(a[1]):""}function Si(i){let t=(i.tagName==="CODE"?i:i.querySelector("code"))||i;if(t.dataset.velinSource!=null)return t.dataset.velinSource;let r=t.innerHTML;if(r&&/<|>|&/.test(r)){let n=document.createElement("textarea");if(n.innerHTML=r.replace(/<br\s*\/?>/gi,`
|
|
1144
|
+
`),n.value)return n.value}return t.textContent||""}async function ne(i,e={}){if(i.dataset.velinHighlighted==="1")return;let t=i.tagName==="PRE"?i:i.closest("pre")||i,r=i.tagName==="CODE"?i:t.querySelector("code")||document.createElement("code");if(!t.querySelector("code")&&r!==i){let l=Si(t);r.textContent=l,t.textContent="",t.appendChild(r)}r.dataset.velinSource||(r.dataset.velinSource=r.textContent||"");let n=e.language||cn(t);if(!n)return;t.classList.add("velin-syntax-pending"),r.classList.add("velin-syntax-pending");let o=e.lexer||ht(n);o||(o=await Ae(n)),o||(o=ht("text")||await Ae("text"));let a=r.dataset.velinSource||Si(r)||"";if(!o){r.textContent=a,t.classList.remove("velin-syntax-pending"),r.classList.remove("velin-syntax-pending"),t.classList.add("velin-syntax-ready"),r.classList.add("velin-syntax-ready");return}try{let l=o(a);ki(r,l),r.dataset.velinHighlighted="1",t.dataset.velinHighlighted="1"}catch(l){console.warn("[velin-highlight]",n,l),r.textContent=a}t.classList.remove("velin-syntax-pending"),r.classList.remove("velin-syntax-pending"),t.classList.add("velin-syntax-ready"),r.classList.add("velin-syntax-ready")}async function pt(i=document){let e=i.querySelectorAll('pre[velin-code], pre[data-language], pre code[class*="language-"], [velin-code-block] pre, .velin-doc-example__code pre');await Promise.all([...e].map(t=>ne(t)))}var Ti=d(()=>{wi();ln()});function hn(i){dn.add(i),un||(un=requestAnimationFrame(()=>{un=0;let e=[...dn];dn.clear(),e.forEach(t=>t())}))}function Wd(i={}){return typeof IntersectionObserver>"u"?null:(Ie||(Ie=new IntersectionObserver(e=>{for(let t of e){if(!t.isIntersecting)continue;let r=pn.get(t.target);r&&hn(()=>r(t.target)),t.target.dataset.velinOnce!=="false"&&Ie.unobserve(t.target)}},{threshold:i.threshold??.1,rootMargin:i.rootMargin??"0px 0px -40px 0px"})),Ie)}function mt(i,e,t={}){let r=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,n=i.closest('[data-velin-motion="off"]')||i.dataset.velinMotion==="off";if(r||n)return hn(()=>e(i,!0)),()=>{};let o=Wd(t);return o?(pn.set(i,e),o.observe(i),()=>{pn.delete(i),o.unobserve(i)}):(hn(()=>e(i,!0)),()=>{})}function ga(){Ie&&(Ie.disconnect(),Ie=null)}var dn,un,Ie,pn,mn=d(()=>{dn=new Set,un=0;Ie=null,pn=new WeakMap});function we(i=document,e={}){if(typeof document>"u")return()=>{};let t=e.selector||["pre[velin-code]","pre[language]","pre[data-language]",'pre code[class*="language-"]',"velin-code-block pre",".velin-doc-example__code pre"].join(","),r=i.querySelectorAll(t),n=[],o=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;for(let a of r){let l=a.tagName==="PRE"?a:a.closest("pre");if(!l||l.dataset.velinObserve==="1")continue;if(l.dataset.velinObserve="1",o||e.immediate){ne(l);continue}l.classList.add("velin-syntax-pending");let u=mt(l,async m=>{await ne(m)});n.push(u)}return()=>n.forEach(a=>a())}var ft,fn=d(()=>{Ti();mn();ft=we});var bn={};f(bn,{applyHighlight:()=>ki,escapeHtml:()=>an,getLanguage:()=>ht,getSourceText:()=>Si,highlightAll:()=>pt,highlightElement:()=>ne,initHighlight:()=>we,lazyLoadLanguage:()=>Ae,listLanguages:()=>Ai,normalizeLanguage:()=>be,observeCodeBlocks:()=>ft,registerLanguage:()=>Ye,renderTokens:()=>Ei,resolveLanguage:()=>cn,velinSyntax:()=>ya});var ya,bt=d(()=>{wi();ln();Ti();fn();Ti();fn();wi();ya={highlightElement:ne,highlightAll:pt,initHighlight:we,observeCodeBlocks:ft,registerLanguage:Ye,lazyLoadLanguage:Ae,listLanguages:Ai}});var xa={};f(xa,{default:()=>_a});function Gd(i){let e=new Set;if(!i)return e;for(let t of i.split(",")){let r=t.trim();if(r)if(r.includes("-")){let[n,o]=r.split("-").map(a=>parseInt(a,10));if(!Number.isNaN(n)&&!Number.isNaN(o))for(let a=Math.min(n,o);a<=Math.max(n,o);a+=1)e.add(a)}else{let n=parseInt(r,10);Number.isNaN(n)||e.add(n)}}return e}var Li,_a,vn=d(()=>{bt();Li=class extends HTMLElement{static get observedAttributes(){return["language","highlight","line-numbers","collapsed"]}connectedCallback(){this._built||(this._built=!0,this.classList.add("velin-code-block"),this._render(),this._setupHighlight())}attributeChangedCallback(){this._built&&(this._render(),this._setupHighlight())}_render(){let e=this.getAttribute("language")||"",t=this.hasAttribute("line-numbers"),r=this.hasAttribute("collapsed"),n=Gd(this.getAttribute("highlight")||""),o=this.textContent.trim();this.textContent="";let a=document.createElement("div");a.className="velin-code-block__toolbar",a.innerHTML="";let l=document.createElement("velin-copy");l.setAttribute("value",o),l.setAttribute("label","Copy"),a.appendChild(l);let u=`velin-code-panel-${Math.random().toString(36).slice(2,9)}`,m=document.createElement("div");if(m.id=u,m.className=t?"velin-code-block__gutter":"",r){let g=document.createElement("button");g.type="button",g.className="velin-btn velin-btn--sm velin-btn--ghost",g.textContent="Expand",g.setAttribute("aria-expanded","false"),g.setAttribute("aria-controls",u),g.setAttribute("aria-label","Expand code block"),g.addEventListener("click",()=>{this.hasAttribute("data-collapsed")?(this.removeAttribute("data-collapsed"),g.textContent="Collapse",g.setAttribute("aria-expanded","true"),g.setAttribute("aria-label","Collapse code block")):(this.setAttribute("data-collapsed",""),g.textContent="Expand",g.setAttribute("aria-expanded","false"),g.setAttribute("aria-label","Expand code block"))}),this.setAttribute("data-collapsed",""),a.appendChild(g)}if(t){let g=document.createElement("div");g.className="velin-code-block__line-numbers";let w=o.split(`
|
|
1145
|
+
`).length;g.textContent="";for(let A=0;A<w;A+=1){let E=A+1,oe=document.createElement("span");n.has(E)&&(oe.className="velin-code-block__line--highlight"),oe.textContent=String(E),g.appendChild(oe)}m.appendChild(g)}let v=document.createElement("pre");e&&(v.setAttribute("language",e),v.dataset.language=e);let y=document.createElement("code");e&&(y.className=`language-${e}`),y.textContent=o,v.appendChild(y),m.appendChild(v),this.appendChild(a),this.appendChild(m),this._pre=v}async _setupHighlight(){if(!this._pre)return;delete this._pre.dataset.velinHighlighted,delete this._pre.dataset.velinObserve,typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches?await ne(this._pre):we(this,{root:this})}};customElements.define("velin-code-block",Li);_a=Li});var wa={};f(wa,{default:()=>Aa});function Yd(i){let e=(i.getAttribute("format")||"number").toLowerCase(),t=i.getAttribute("locale")||void 0,r=i.getAttribute("decimals"),n=r!=null?Math.max(0,Number.parseInt(r,10)||0):null,o={};n!=null&&(o.minimumFractionDigits=n,o.maximumFractionDigits=n),e==="currency"?(o.style="currency",o.currency=i.getAttribute("currency")||"EUR"):e==="percent"&&(o.style="percent");try{return new Intl.NumberFormat(t,o)}catch{return new Intl.NumberFormat(void 0,o)}}var Vd,Ci,Aa,Ri=d(()=>{Vd=i=>i===1?1:1-Math.pow(2,-10*i);Ci=class extends HTMLElement{static get observedAttributes(){return["from","to","duration","decimals","prefix","suffix","format","currency","locale"]}constructor(){super(),this._rafId=0,this._started=!1,this._observer=null}connectedCallback(){this.setAttribute("role","status"),this.setAttribute("aria-live","polite"),this.setAttribute("aria-atomic","true"),this._render(this._fromValue()),this.getAttribute("autostart")!=="false"&&this._scheduleStart()}disconnectedCallback(){cancelAnimationFrame(this._rafId),this._observer?.disconnect()}attributeChangedCallback(e){this.isConnected&&(e==="to"||e==="from"?this.start():this._render(this._lastValue??this._toValue()))}_fromValue(){return Number.parseFloat(this.getAttribute("from"))||0}_toValue(){return Number.parseFloat(this.getAttribute("to"))||0}_duration(){return Math.max(0,Number.parseFloat(this.getAttribute("duration"))||900)}_scheduleStart(){if(!this._started){if(typeof IntersectionObserver>"u"){this.start();return}this._observer=new IntersectionObserver(e=>{for(let t of e)if(t.isIntersecting){this.start(),this._observer.disconnect(),this._observer=null;break}},{threshold:.2}),this._observer.observe(this)}}start(){cancelAnimationFrame(this._rafId),this._started=!0;let e=this._fromValue(),t=this._toValue(),r=this._duration();if(typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches||r===0){this._render(t);return}let o=performance.now(),a=l=>{let u=Math.min(1,(l-o)/r),m=e+(t-e)*Vd(u);this._render(m),u<1&&(this._rafId=requestAnimationFrame(a))};this._rafId=requestAnimationFrame(a)}reset(){cancelAnimationFrame(this._rafId),this._started=!1,this._render(this._fromValue())}_render(e){this._lastValue=e;let t=Yd(this),r=this.getAttribute("prefix")||"",n=this.getAttribute("suffix")||"";this.textContent=`${r}${t.format(e)}${n}`}};typeof customElements<"u"&&!customElements.get("velin-counter")&&customElements.define("velin-counter",Ci);Aa=Ci});var Ta={};f(Ta,{default:()=>Sa});function ka(i,e){let r=(i?.dataset?.sortValue??i?.textContent??"").trim();if(e==="number"){let n=Number.parseFloat(r.replace(/[^\d.,-]/g,"").replace(",","."));return Number.isNaN(n)?Number.NEGATIVE_INFINITY:n}if(e==="date"){let n=Date.parse(r);return Number.isNaN(n)?Number.NEGATIVE_INFINITY:n}return r.toLowerCase()}var Xd,Ea,Ii,Sa,gn=d(()=>{_e();Xd=new Set(["text","number","date"]),Ea=!1;Ii=class extends HTMLElement{static get observedAttributes(){return["page-size","filter-input","empty-text","label"]}constructor(){super(),this._table=null,this._page=1,this._query="",this._sortIndex=-1,this._sortDirection="ascending",this._filterEl=null,this._pagination=null,this._emptyRow=null,this._filterTimer=null,this._onFilterInput=this._onFilterInput.bind(this)}connectedCallback(){this.classList.add("velin-data-table"),requestAnimationFrame(()=>this._init())}disconnectedCallback(){this._filterEl&&this._filterEl.removeEventListener("input",this._onFilterInput),this._filterTimer&&clearTimeout(this._filterTimer)}attributeChangedCallback(e,t,r){t===r||!this._table||(e==="page-size"?(this._page=1,this._render()):e==="filter-input"?this._bindFilterInput():e==="label"&&this._ensureAccessibleName())}get rows(){let e=this._table?.tBodies?.[0];return e?[...e.rows].filter(t=>t!==this._emptyRow):[]}get matchingRows(){return this.rows.filter(e=>!e.dataset.velinFiltered)}get visibleRows(){return this.matchingRows.filter(e=>!e.hidden)}get page(){return this._page}get pageSize(){let e=Number.parseInt(this.getAttribute("page-size")||"",10);return Number.isFinite(e)&&e>0?e:0}get pageCount(){let e=this.pageSize;return e?Math.max(1,Math.ceil(this.matchingRows.length/e)):1}sort(e,t){let n=this._headers()[e];if(!n)return;let o=this._sortType(n);if(o==="none")return;this._sortDirection=t||(this._sortIndex===e&&this._sortDirection==="ascending"?"descending":"ascending"),this._sortIndex=e;let a=this._sortDirection==="ascending"?1:-1,l=this._table.tBodies[0],u=this.rows.slice().sort((v,y)=>{let g=ka(v.cells[e],o),N=ka(y.cells[e],o);return g<N?-1*a:g>N?1*a:0});for(let v of u)l.appendChild(v);this._syncSortState(),this._page=1,this._render();let m=n.dataset.sortLabel||n.textContent.trim();re(`${m} sorted ${this._sortDirection}`),this.dispatchEvent(new CustomEvent("velin-data-table-sort",{bubbles:!0,detail:{index:e,direction:this._sortDirection,column:m}}))}filter(e){this._query=String(e||"").trim().toLowerCase();for(let r of this.rows)!this._query||this._rowText(r).includes(this._query)?delete r.dataset.velinFiltered:r.dataset.velinFiltered="true";this._page=1,this._render();let t=this.matchingRows.length;re(t===1?"1 row matches":`${t} rows match`),this.dispatchEvent(new CustomEvent("velin-data-table-filter",{bubbles:!0,detail:{query:this._query,count:t}}))}goToPage(e){let t=Math.min(Math.max(1,Math.trunc(e)||1),this.pageCount);t!==this._page&&(this._page=t,this._render(),re(`Page ${this._page} of ${this.pageCount}`),this.dispatchEvent(new CustomEvent("velin-data-table-page",{bubbles:!0,detail:{page:this._page,pageCount:this.pageCount}})))}_init(){this._table=this.querySelector("table"),!(!this._table||!this._table.tBodies.length)&&(this._ensureAccessibleName(),this._setupSorting(),this._bindFilterInput(),this._render())}_headers(){let e=this._table.tHead?.rows?.[0];return e?[...e.cells]:[]}_sortType(e){let t=(e.dataset.sort||"").toLowerCase();return t==="none"?"none":Xd.has(t)?t:this.hasAttribute("sortable")?"text":"none"}_ensureAccessibleName(){let e=this._table;if(!e)return;let t=this.getAttribute("label"),r=e.caption?.textContent.trim()||e.getAttribute("aria-label")?.trim()||e.getAttribute("aria-labelledby")?.trim();if(!r&&t){e.setAttribute("aria-label",t);return}!r&&!Ea&&(Ea=!0,console.warn("[velinstyle] <velin-data-table> needs a <caption>, aria-label, or a label attribute."))}_setupSorting(){this._headers().forEach((e,t)=>{if(this._sortType(e)==="none"||e.querySelector(".velin-data-table__sort"))return;let r=e.textContent.trim();e.dataset.sortLabel=r,e.setAttribute("aria-sort","none"),e.classList.add("velin-data-table__th");let n=document.createElement("button");n.type="button",n.className="velin-data-table__sort",n.textContent=r;let o=document.createElement("span");o.className="velin-data-table__sort-icon",o.setAttribute("aria-hidden","true"),n.appendChild(o),n.addEventListener("click",()=>this.sort(t)),e.textContent="",e.appendChild(n)})}_syncSortState(){this._headers().forEach((e,t)=>{if(this._sortType(e)==="none")return;let r=t===this._sortIndex;e.setAttribute("aria-sort",r?this._sortDirection:"none"),e.querySelector(".velin-data-table__sort")?.classList.toggle("velin-data-table__sort--active",r)})}_bindFilterInput(){this._filterEl&&this._filterEl.removeEventListener("input",this._onFilterInput);let e=this.getAttribute("filter-input");this._filterEl=e?document.querySelector(e):null,this._filterEl&&this._filterEl.addEventListener("input",this._onFilterInput)}_onFilterInput(e){this._filterTimer&&clearTimeout(this._filterTimer);let t=e.target.value;this._filterTimer=setTimeout(()=>this.filter(t),150)}_rowText(e){let t=[...e.cells].filter(n=>n.hasAttribute("data-filter"));return(t.length?t:[...e.cells]).map(n=>n.textContent||"").join(" ").toLowerCase()}_render(){let e=this.pageSize;this._page=Math.min(this._page,this.pageCount);let t=this.matchingRows,r=e?(this._page-1)*e:0,n=e?r+e:t.length;for(let o of this.rows){let a=t.indexOf(o);o.hidden=a===-1||a<r||a>=n}this._renderEmptyState(t.length===0),this._renderPagination()}_renderEmptyState(e){if(!e){this._emptyRow?.remove(),this._emptyRow=null;return}if(this._emptyRow?.isConnected)return;let t=this._headers().length||1,r=document.createElement("tr");r.className="velin-data-table__empty";let n=document.createElement("td");n.colSpan=t,n.textContent=this.getAttribute("empty-text")||"No matching rows",r.appendChild(n),this._table.tBodies[0].appendChild(r),this._emptyRow=r}_renderPagination(){if(!this.pageSize||this.pageCount<=1){this._pagination?.remove(),this._pagination=null;return}if(!this._pagination?.isConnected){let n=document.createElement("nav");n.className="velin-data-table__pagination",n.setAttribute("aria-label",this.getAttribute("pagination-label")||"Table pagination");let o=document.createElement("button");o.type="button",o.className="velin-btn velin-btn--outline velin-btn--sm",o.dataset.velinPage="previous",o.textContent=this.getAttribute("previous-text")||"Previous",o.addEventListener("click",()=>this.goToPage(this._page-1));let a=document.createElement("p");a.className="velin-data-table__page-status",a.dataset.velinPage="status";let l=document.createElement("button");l.type="button",l.className="velin-btn velin-btn--outline velin-btn--sm",l.dataset.velinPage="next",l.textContent=this.getAttribute("next-text")||"Next",l.addEventListener("click",()=>this.goToPage(this._page+1)),n.append(o,a,l),this.appendChild(n),this._pagination=n}let e=this._pagination.querySelector('[data-velin-page="status"]');e&&(e.textContent=`Page ${this._page} of ${this.pageCount}`);let t=this._pagination.querySelector('[data-velin-page="previous"]'),r=this._pagination.querySelector('[data-velin-page="next"]');t&&(t.disabled=this._page<=1),r&&(r.disabled=this._page>=this.pageCount)}};customElements.define("velin-data-table",Ii);Sa=Ii});var Ca={};f(Ca,{default:()=>La});function yn(i){let e=String(i??"");return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(e):e.replace(/[^\w-]/g,t=>`\\${t}`)}function eu(i){let e=i.getAttribute("data-error-label");if(e)return e;let t=i.getAttribute("aria-label");if(t?.trim())return t.trim();let r=i.getAttribute("aria-labelledby");if(r){let o=r.split(/\s+/).map(a=>i.ownerDocument.getElementById(a)?.textContent?.trim()||"").filter(Boolean).join(" ");if(o)return o}if(i.id){let o=i.ownerDocument.querySelector(`label[for="${yn(i.id)}"]`);if(o?.textContent.trim())return o.textContent.trim()}let n=i.closest("label");return n?.textContent.trim()?n.textContent.trim():i.name||"This field"}function tu(i){return i.getAttribute("data-error-message")?.trim()||i.validationMessage||"Invalid value"}function iu(i,e){let t=(i.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean);t.includes(e)||(t.push(e),i.setAttribute("aria-describedby",t.join(" ")))}function ru(i,e){let r=(i.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean).filter(n=>n!==e);r.length?i.setAttribute("aria-describedby",r.join(" ")):i.removeAttribute("aria-describedby")}var Zd,Jd,Qd,Mi,La,_n=d(()=>{_e();Zd="input, select, textarea",Jd=new Set(["submit","reset","button","image","hidden"]),Qd=0;Mi=class extends HTMLElement{static get observedAttributes(){return["for","heading"]}constructor(){super(),this._form=null,this._panel=null,this._errors=[],this._onSubmit=this._onSubmit.bind(this),this._onFieldChange=this._onFieldChange.bind(this),this._onReset=this._onReset.bind(this)}connectedCallback(){this.classList.add("velin-form-summary"),requestAnimationFrame(()=>this._bindForm())}disconnectedCallback(){this._unbindForm()}attributeChangedCallback(e,t,r){if(t!==r){if(e==="for"&&this.isConnected)this._unbindForm(),this._bindForm();else if(e==="heading"&&this._panel){let n=this._panel.querySelector(".velin-form-summary__heading");n&&(n.textContent=this.headingText)}}}get form(){return this._form}get errors(){return this._errors.slice()}get headingText(){return this.getAttribute("heading")||"There is a problem"}validate(){if(!this._form)return!0;let e=[];for(let t of this._fields()){if(t.checkValidity()){this._clearFieldError(t);continue}let r={field:t,label:eu(t),message:tu(t)};this._markFieldError(t,r.message),e.push(r)}return this._errors=e,this._render(),e.length===0}clear(){for(let e of this._fields())this._clearFieldError(e);this._errors=[],this._render()}focusFirstError(){let e=this._errors[0];e&&this._focusField(e.field)}_bindForm(){let e=this.getAttribute("for");this._form=e?this.ownerDocument.getElementById(e):this.closest("form"),this._form&&(this.hasAttribute("native-validation")||(this._form.noValidate=!0),this._form.addEventListener("submit",this._onSubmit),this._form.addEventListener("reset",this._onReset),this._form.addEventListener("input",this._onFieldChange),this._form.addEventListener("change",this._onFieldChange))}_unbindForm(){this._form&&(this._form.removeEventListener("submit",this._onSubmit),this._form.removeEventListener("reset",this._onReset),this._form.removeEventListener("input",this._onFieldChange),this._form.removeEventListener("change",this._onFieldChange),this._form=null)}_fields(){if(!this._form)return[];let e=new Set;return[...this._form.querySelectorAll(Zd)].filter(t=>{if(Jd.has(t.type)||t.disabled||t.hasAttribute("data-error-ignore")||typeof t.checkValidity!="function")return!1;if(t.type==="radio"&&t.name){if(e.has(t.name))return!1;e.add(t.name)}return!0})}_onSubmit(e){this.validate()||(e.preventDefault(),this._announceErrors(),this._focusPanel(),this.dispatchEvent(new CustomEvent("velin-form-invalid",{bubbles:!0,detail:{errors:this.errors.map(({label:t,message:r})=>({label:t,message:r}))}})))}_onReset(){requestAnimationFrame(()=>this.clear())}_onFieldChange(e){let t=e.target;!t||!this._errors.some(r=>r.field===t)||t.checkValidity()&&(this._clearFieldError(t),this._errors=this._errors.filter(r=>r.field!==t),this._render(),this._errors.length===0&&this.dispatchEvent(new CustomEvent("velin-form-valid",{bubbles:!0})))}_errorId(e){return e.id||(e.id=`velin-field-${++Qd}`),`${e.id}-error`}_markFieldError(e,t){let r=this._errorId(e);e.setAttribute("aria-invalid","true");let n=this.ownerDocument.getElementById(r);n||(n=this._form.querySelector(`[data-velin-error-for="${yn(e.name||e.id)}"]`)),n||(n=this.ownerDocument.createElement("p"),n.dataset.velinErrorGenerated="true",e.insertAdjacentElement("afterend",n)),n.id=r,n.classList.add("velin-field-error"),n.textContent=t,iu(e,r)}_clearFieldError(e){if(!e.id)return;let t=`${e.id}-error`;e.removeAttribute("aria-invalid"),ru(e,t);let r=this.ownerDocument.getElementById(t);r&&(r.dataset.velinErrorGenerated?r.remove():r.textContent="")}_focusField(e){let t=e.type==="radio"&&e.name&&this._form.querySelector(`input[type="radio"][name="${yn(e.name)}"]`)||e;t.focus(),this.dispatchEvent(new CustomEvent("velin-form-error-focus",{bubbles:!0,detail:{name:t.name||t.id}}))}_render(){if(!this._errors.length){this._panel?.remove(),this._panel=null,this.hidden=!0;return}if(this.hidden=!1,!this._panel?.isConnected){let t=this.ownerDocument.createElement("div");t.className="velin-form-summary__panel velin-alert velin-alert--danger",t.setAttribute("role","alert"),t.tabIndex=-1;let r=this.ownerDocument.createElement("p");r.className="velin-form-summary__heading",r.textContent=this.headingText;let n=this.ownerDocument.createElement("ul");n.className="velin-form-summary__list",t.append(r,n),this.appendChild(t),this._panel=t}let e=this._panel.querySelector(".velin-form-summary__list");e.textContent="";for(let t of this._errors){let r=this.ownerDocument.createElement("li"),n=this.ownerDocument.createElement("a");n.href=`#${this._errorId(t.field).replace(/-error$/,"")}`,n.textContent=`${t.label}: ${t.message}`,n.addEventListener("click",o=>{o.preventDefault(),this._focusField(t.field)}),r.appendChild(n),e.appendChild(r)}}_focusPanel(){this._panel?.focus()}_announceErrors(){let e=this._errors.length;re(e===1?"1 field needs attention":`${e} fields need attention`,"assertive")}};customElements.define("velin-form-summary",Mi);La=Mi});var Ma={};f(Ma,{default:()=>Ia});var Ra,nu,ou,Di,Ia,Oi=d(()=>{_e();Ra={live:"var(--velin-color-success, oklch(60% 0.16 145))",paused:"var(--velin-color-text-muted, oklch(60% 0.02 240))",warning:"var(--velin-color-warning, oklch(75% 0.16 80))",error:"var(--velin-color-danger, oklch(60% 0.2 25))",muted:"var(--velin-color-border, oklch(85% 0.01 240))"},nu=`
|
|
1146
1146
|
:host {
|
|
1147
1147
|
display: inline-flex;
|
|
1148
1148
|
align-items: center;
|
|
@@ -1163,15 +1163,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1163
1163
|
@media (prefers-reduced-motion: reduce) {
|
|
1164
1164
|
.dot { animation: none !important; }
|
|
1165
1165
|
}
|
|
1166
|
-
`,
|
|
1166
|
+
`,ou=`
|
|
1167
1167
|
@keyframes velin-live-pulse {
|
|
1168
1168
|
0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--velin-live-color) 65%, transparent); }
|
|
1169
1169
|
70% { box-shadow: 0 0 0 0.6rem color-mix(in oklch, var(--velin-live-color) 0%, transparent); }
|
|
1170
1170
|
100% { box-shadow: 0 0 0 0 transparent; }
|
|
1171
|
-
}`,
|
|
1172
|
-
<style>${
|
|
1171
|
+
}`,Di=class extends HTMLElement{static get observedAttributes(){return["status","pulse"]}constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this._render()}attributeChangedCallback(){this.shadowRoot&&this._render()}_render(){let e=this.getAttribute("status")||"live",t=Ra[e]||Ra.live,r=this.getAttribute("aria-label")||Mr(e);this.setAttribute("role","status"),this.setAttribute("aria-label",r),this.style.setProperty("--velin-live-color",t),this.shadowRoot.innerHTML=`
|
|
1172
|
+
<style>${nu}${ou}</style>
|
|
1173
1173
|
<span class="dot" aria-hidden="true"></span><slot></slot>
|
|
1174
|
-
`}};typeof customElements<"u"&&!customElements.get("velin-live-dot")&&customElements.define("velin-live-dot",
|
|
1174
|
+
`}};typeof customElements<"u"&&!customElements.get("velin-live-dot")&&customElements.define("velin-live-dot",Di);Ia=Di});function Ni(i){if(!i||typeof i!="object")return null;let e=i,t=String(e.id||e.url||e.title||"").trim(),r=String(e.title||"").trim(),n=String(e.url||"").trim();if(!t||!r)return null;let o=Array.isArray(e.keywords)?e.keywords.map(u=>String(u)):typeof e.keywords=="string"?e.keywords.split(/\s+/).filter(Boolean):[],a=vt.includes(e.category)?e.category:"docs";!e.category&&typeof e.url=="string"&&(e.url.includes("/components/")?a="components":e.url.includes("/cli/")||e.url.includes("/api/")?a="api":(e.url.includes("samples/")||e.url.includes("examples/"))&&(a="examples"));let l=n?Fo(n):`#${t}`;return{id:t,title:r,excerpt:String(e.excerpt||e.section||"").slice(0,200),url:l,category:a,keywords:o,weight:typeof e.weight=="number"?e.weight:1}}var vt,xn,An=d(()=>{k();vt=["docs","components","api","examples"],xn={components:1.25,api:1.15,docs:1,examples:.9}});function su(i,e,t){let r=i.title.toLowerCase(),n=(i.excerpt||"").toLowerCase(),o=(i.keywords||[]).join(" ").toLowerCase(),a=(xn[i.category]||1)*(i.weight||1),l=0;if(r===e)l=100;else if(r.startsWith(e))l=70;else if(r.includes(e))l=50;else if(o.includes(e))l=35;else if(n.includes(e))l=25;else if(t>0&&Fi(r,e,t))l=40;else if(t>0&&Fi(o,e,t))l=28;else if(t>0&&Fi(n,e,t))l=18;else if(Da(r,e))l=22;else if(t>0){for(let u of r.split(/[^a-z0-9]+/))if(u.length>=3&&Fi(u,e,t)){l=32;break}}return l>0?l*a:0}function Da(i,e){let t=0;for(let r=0;r<i.length&&t<e.length;r++)i[r]===e[t]&&t++;return t===e.length}function Fi(i,e,t){if(!i||!e)return!1;if(i.includes(e)||Da(i,e))return!0;let r=Math.max(1,Math.floor(e.length*t*2));return au(i.slice(0,Math.min(i.length,e.length+8)),e)<=r}function au(i,e){let t=i.length,r=e.length;if(t===0)return r;if(r===0)return t;let n=new Uint16Array((r+1)*(t+1));for(let o=0;o<=r;o++)n[o]=o;for(let o=1;o<=t;o++){n[o*(r+1)]=o;for(let a=1;a<=r;a++){let l=i[o-1]===e[a-1]?0:1;n[o*(r+1)+a]=Math.min(n[(o-1)*(r+1)+a]+1,n[o*(r+1)+(a-1)]+1,n[(o-1)*(r+1)+(a-1)]+l)}}return n[t*(r+1)+r]}var gt,Oa=d(()=>{An();gt=class{constructor(){this._entries=[]}setEntries(e){this._entries=e.map(t=>Ni(t)).filter(Boolean)}addEntries(e){let t=e.map(n=>Ni(n)).filter(Boolean),r=new Set(this._entries.map(n=>n.id));for(let n of t)r.has(n.id)||(this._entries.push(n),r.add(n.id))}query(e,t={}){let r=String(e||"").trim().toLowerCase(),n=t.minChars??2,o=t.limit??12,a=t.fuzzy??.2,l=t.categories;if(r.length<n)return{results:[],groups:{}};let u=[];for(let y of this._entries){if(l&&l.length&&!l.includes(y.category))continue;let g=su(y,r,a);g>0&&u.push({entry:y,score:g})}u.sort((y,g)=>g.score-y.score);let m=u.slice(0,o).map(y=>({...y.entry,_score:y.score})),v={};for(let y of m)v[y.category]||(v[y.category]=[]),v[y.category].push(y);return{results:m,groups:v}}}});function Fa(i,e){if(!i||typeof e!="function")throw new Error("registerSearchProvider(id, fn) requires a non-empty id and function");Na.set(i,e)}async function wn(){let i=[];for(let e of Na.values()){let t=await e();Array.isArray(t)&&i.push(...t)}return i}var Na,En=d(()=>{Na=new Map});function $i(i,e){let t=String(i||""),r=String(e||"").trim();if(!r||r.length<2)return yt(t);let n=t.toLowerCase(),o=r.toLowerCase(),a=n.indexOf(o),l=r.length;if(a===-1){if(a=lu(n,o),a===-1)return yt(t);l=Math.min(r.length,t.length-a)}return yt(t.slice(0,a))+'<mark class="velin-search-hit">'+yt(t.slice(a,a+l))+"</mark>"+yt(t.slice(a+l))}function yt(i){return i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function lu(i,e){let t=0,r=-1;for(let n=0;n<i.length&&t<e.length;n++)i[n]===e[t]&&(t===0&&(r=n),t++);return t===e.length?r:-1}var $a=d(()=>{});function Ha(){if(typeof document>"u")return"https://example.invalid/docs/";let i=document.querySelector('script[src*="doc-search"]');if(i?.src){let r=new URL(i.src),n=r.pathname.indexOf(Xe);if(n!==-1)return r.origin+r.pathname.slice(0,n+Xe.length)}let e=window.location.pathname.replace(/\\/g,"/"),t=e.indexOf(Xe);return t>=0?new URL(e.slice(0,t+Xe.length),window.location.origin).href:new URL("./",window.location.href).href}function cu(i){let e=i.indexOf("#");return e===-1?{path:i,hash:""}:{path:i.slice(0,e),hash:i.slice(e)}}function Pa(i){let e=i.indexOf(Xe);if(e<0)return null;let t=i.slice(e+Xe.length),r=t.split("/").filter(Boolean);return r.length>=2&&za.has(r[0])&&za.has(r[1])&&r[0]!==r[1]?r.slice(1).join("/"):t}function zi(i){if(!i||i==="#")return"";if(typeof window>"u")return i;let{path:e,hash:t}=cu(i);if(!e)return t||"";let r=e;if(/^https?:\/\//i.test(e))try{r=Pa(new URL(e).pathname)??e}catch{return""}try{let n=new URL(r||"",Ha());return n.href+(t&&!n.href.includes("#")?t:"")}catch{return""}}var Xe,za,qa=d(()=>{Xe="/docs/",za=new Set(["getting-started","extend","guides","utilities","components","forms","layout","content","customize","animations","about","helpers","generated","migration"])});var Ba={};f(Ba,{createSearchWorker:()=>uu});function uu(i){if(typeof Worker>"u"||!i)return null;let e=i,t;try{t=new Worker(e,{type:"module"})}catch{return null}let r=new Map;t.onmessage=o=>{let{id:a,ok:l,result:u,error:m}=o.data||{},v=r.get(a);v&&(r.delete(a),l?v.resolve(u):v.reject(new Error(m||"Worker error")))},t.onerror=()=>{for(let o of r.values())o.reject(new Error("Worker failed"));r.clear()};function n(o,a){let l=++du;return new Promise((u,m)=>{r.set(l,{resolve:u,reject:m}),t.postMessage({id:l,type:o,payload:a})})}return{setEntries(o){return n("setEntries",{entries:o})},query(o,a){return n("query",{query:o,options:a})},terminate(){t.terminate()}}}var du,Ua=d(()=>{du=0});function ja(i){return Array.isArray(i)?i:i&&Array.isArray(i.entries)?i.entries:[]}function Sn(i={}){let e=new gt,t=i.worker===!0,r=null;async function n(){if(!t||r)return r;if(typeof Worker>"u")return null;let{createSearchWorker:o}=await Promise.resolve().then(()=>(Ua(),Ba));return r=o(i.workerUrl),r}return{engine:e,async loadIndex(o){let a=[];if(typeof o=="string"){let u=await fetch(o);a=ja(await u.json())}else Array.isArray(o)&&(a=o);e.setEntries(a);let l=await n();return l&&await l.setEntries(e._entries),a.length},async query(o,a){let l=await n();return l?l.query(o,a):e.query(o,a)},addEntries(o){e.addEntries(o),n().then(a=>a?.setEntries(e._entries))}}}var Ee,kn,hu,Tn=d(()=>{Oa();En();$a();En();An();qa();Ee=new gt,kn=!1;hu={engine:Ee,async loadIndex(i){let e=[];if(typeof i=="string"){let r=await fetch(i);if(!r.ok)throw new Error(`Failed to load search index: ${r.status}`);e=ja(await r.json())}else Array.isArray(i)&&(e=i);Ee.setEntries(e);let t=await wn();return t.length&&Ee.addEntries(t),kn=!0,e.length},addEntries(i){Ee.addEntries(i)},async refreshProviders(){let i=await wn();return i.length&&Ee.addEntries(i),i.length},async query(i,e={}){return!kn&&Ee._entries.length===0&&await this.refreshProviders(),Ee.query(i,e)},isReady(){return kn||Ee._entries.length>0}}});var Ln={};f(Ln,{bindDeclarativeSearch:()=>Wa,default:()=>Ka});function Wa(i=document){i.querySelectorAll("[velin-search-input]").forEach(e=>{if(e.dataset.velinSearchBound)return;e.dataset.velinSearchBound="1";let t=e.closest("velin-search");if(!t){t=document.createElement("velin-search"),t.setAttribute("index",e.getAttribute("data-search-index")||"/search-index.json");let r=e.parentElement?.querySelector("[velin-search-results]");e.before(t),t.appendChild(e),r&&t.appendChild(r)}})}var pu,Hi,Ka,_t=d(()=>{Tn();k();pu={docs:"Documentation",components:"Components",api:"API",examples:"Examples"},Hi=class extends HTMLElement{static get observedAttributes(){return["index","categories","min-chars","fuzzy","placeholder","debounce"]}constructor(){super(),this._search=Sn(),this._debounceTimer=null,this._activeIndex=-1,this._flatResults=[],this._indexLoaded=!1,this._listId=`velin-search-listbox-${Math.random().toString(36).slice(2,9)}`,this._mounted=!1}connectedCallback(){this._mounted||(this._mounted=!0,this._ensureMarkup(),this._loadIndex(),this._bindEvents())}disconnectedCallback(){this._teardown?.(),this._mounted=!1}get indexUrl(){return this.getAttribute("index")||"/search-index.json"}get minChars(){return parseInt(this.getAttribute("min-chars")||"2",10)}get fuzzy(){let e=this.getAttribute("fuzzy");return e===null?.2:parseFloat(e)||0}get categories(){let e=this.getAttribute("categories");return e?e.split(",").map(t=>t.trim()).filter(t=>vt.includes(t)):null}get debounceMs(){return parseInt(this.getAttribute("debounce")||"120",10)}_ensureMarkup(){if(this.querySelector("[data-velin-search-input]"))return;let e=fe(this.getAttribute("placeholder")||"Search\u2026"),t=fe(this.getAttribute("aria-label")||"Search");this.innerHTML=`
|
|
1175
1175
|
<div class="velin-search">
|
|
1176
1176
|
<div class="velin-search__field">
|
|
1177
1177
|
<input type="search" class="velin-search__input" data-velin-search-input
|
|
@@ -1182,7 +1182,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1182
1182
|
<div class="velin-search__results" data-velin-search-results role="listbox"
|
|
1183
1183
|
id="${this._listId}" hidden></div>
|
|
1184
1184
|
</div>
|
|
1185
|
-
`}_inputEl(){return this.querySelector("[data-velin-search-input]")}_resultsEl(){return this.querySelector("[data-velin-search-results]")}async _loadIndex(){try{await this._search.loadIndex(this.indexUrl),this._indexLoaded=!0}catch{this._indexLoaded=!1}}_bindEvents(){let e=this._inputEl(),t=this._resultsEl();if(!e||!t)return;e.addEventListener("input",()=>{clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._runQuery(e.value),this.debounceMs)}),e.addEventListener("focus",()=>{e.value.trim().length>=this.minChars&&this._runQuery(e.value)}),e.addEventListener("keydown",n=>this._onKeydown(n,e,t));let r=n=>{this.contains(n.target)||this._hide(t,e)};document.addEventListener("click",r),this._teardown=()=>{document.removeEventListener("click",r),clearTimeout(this._debounceTimer)}}async _runQuery(e){let t=this._inputEl(),r=this._resultsEl();if(!t||!r)return;let n=e.trim();if(n.length<this.minChars){this._hide(r,t);return}this._indexLoaded||await this._loadIndex();let{groups:o}=this._search.query(n,{minChars:this.minChars,fuzzy:this.fuzzy,categories:this.categories||void 0,limit:12});this._activeIndex=-1,this._renderResults(r,t,n,o),this._flatResults.length?(r.hidden=!1,r.classList.add("velin-search__results--open"),t.setAttribute("aria-expanded","true")):this._hide(r,t)}_renderResults(e,t,r,n){e.innerHTML="";let o=this.categories||[...
|
|
1185
|
+
`}_inputEl(){return this.querySelector("[data-velin-search-input]")}_resultsEl(){return this.querySelector("[data-velin-search-results]")}async _loadIndex(){try{await this._search.loadIndex(this.indexUrl),this._indexLoaded=!0}catch{this._indexLoaded=!1}}_bindEvents(){let e=this._inputEl(),t=this._resultsEl();if(!e||!t)return;e.addEventListener("input",()=>{clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._runQuery(e.value),this.debounceMs)}),e.addEventListener("focus",()=>{e.value.trim().length>=this.minChars&&this._runQuery(e.value)}),e.addEventListener("keydown",n=>this._onKeydown(n,e,t));let r=n=>{this.contains(n.target)||this._hide(t,e)};document.addEventListener("click",r),this._teardown=()=>{document.removeEventListener("click",r),clearTimeout(this._debounceTimer)}}async _runQuery(e){let t=this._inputEl(),r=this._resultsEl();if(!t||!r)return;let n=e.trim();if(n.length<this.minChars){this._hide(r,t);return}this._indexLoaded||await this._loadIndex();let{groups:o}=this._search.query(n,{minChars:this.minChars,fuzzy:this.fuzzy,categories:this.categories||void 0,limit:12});this._activeIndex=-1,this._renderResults(r,t,n,o),this._flatResults.length?(r.hidden=!1,r.classList.add("velin-search__results--open"),t.setAttribute("aria-expanded","true")):this._hide(r,t)}_renderResults(e,t,r,n){e.innerHTML="";let o=this.categories||[...vt];this._flatResults=[];let a=0;for(let u of o){let m=n[u];if(!m?.length)continue;let v=`${this._listId}-group-${u}`,y=document.createElement("div");y.setAttribute("role","group"),y.setAttribute("aria-labelledby",v);let g=document.createElement("div");g.className="velin-search__group-label",g.id=v,g.textContent=pu[u]||u,y.appendChild(g);for(let N of m){let w=document.createElement("a"),A=zi(N.url);A&&(w.href=A),w.className="velin-search__item",w.setAttribute("role","option"),w.id=`velin-search-opt-${a}`,w.innerHTML=`<span class="velin-search__title">${$i(N.title,r)}</span><span class="velin-search__excerpt">${$i(N.excerpt||"",r)}</span>`,w.addEventListener("click",E=>{E.preventDefault(),A&&window.location.assign(A)},!0),w.addEventListener("mouseenter",()=>this._setActive(a,e,t)),y.appendChild(w),this._flatResults.push(N),a++}e.appendChild(y)}let l=this._statusEl();l&&(l.textContent=this._flatResults.length?`${this._flatResults.length} results`:"No results")}_statusEl(){return this.querySelector("[data-velin-search-status]")}_setActive(e,t,r){this._activeIndex=e,t.querySelectorAll(".velin-search__item").forEach((n,o)=>{n.classList.toggle("velin-search__item--active",o===e),o===e&&(r.setAttribute("aria-activedescendant",n.id),n.scrollIntoView({block:"nearest"}))})}_onKeydown(e,t,r){if(e.key==="Escape"){this._hide(r,t);return}if(this._flatResults.length){if(e.key==="ArrowDown"){e.preventDefault();let n=this._activeIndex<this._flatResults.length-1?this._activeIndex+1:0;this._setActive(n,r,t)}else if(e.key==="ArrowUp"){e.preventDefault();let n=this._activeIndex>0?this._activeIndex-1:this._flatResults.length-1;this._setActive(n,r,t)}else if(e.key==="Enter"){let n=this._activeIndex>=0?this._flatResults[this._activeIndex]:this._flatResults[0],o=n?.url?zi(n.url):"";o&&(e.preventDefault(),window.location.assign(o))}}}_hide(e,t){e.hidden=!0,e.classList.remove("velin-search__results--open"),t.setAttribute("aria-expanded","false"),t.removeAttribute("aria-activedescendant"),this._activeIndex=-1}},Ka=Hi;typeof HTMLElement<"u"&&typeof customElements<"u"&&!customElements.get("velin-search")&&customElements.define("velin-search",Hi)});var Ga={};f(Ga,{default:()=>bu});async function fu(i,e){if(e!=="aes-gcm"||!globalThis.crypto?.subtle)return JSON.stringify({encoding:"base64",payload:btoa(unescape(encodeURIComponent(i)))});let t=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.generateKey({name:"AES-GCM",length:256},!1,["encrypt"]),n=new TextEncoder().encode(i),o=await crypto.subtle.encrypt({name:"AES-GCM",iv:t},r,n);return JSON.stringify({encoding:"aes-gcm",iv:Array.from(t),cipher:Array.from(new Uint8Array(o))})}var mu,Pi,bu,Va=d(()=>{k();mu=`
|
|
1186
1186
|
:host { display: block; }
|
|
1187
1187
|
label { display: block; font-size: var(--velin-text-sm); margin-block-end: var(--velin-space-1); }
|
|
1188
1188
|
input {
|
|
@@ -1202,12 +1202,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1202
1202
|
color: var(--velin-color-text-muted);
|
|
1203
1203
|
margin-block-start: var(--velin-space-1);
|
|
1204
1204
|
}
|
|
1205
|
-
`;
|
|
1206
|
-
<style>${
|
|
1205
|
+
`;Pi=class extends HTMLElement{static get observedAttributes(){return["type","name","label","mode","autocomplete"]}constructor(){super(),this.attachShadow({mode:"open"}),this._onChange=null}connectedCallback(){this._onChange||this.render()}disconnectedCallback(){let e=this.shadowRoot?.querySelector("input");e&&this._onChange&&e.removeEventListener("change",this._onChange),this._onChange=null}attributeChangedCallback(){this.isConnected&&this.render()}render(){let e=$o(this.getAttribute("type")),t=this.getAttribute("name")||"secure",r=this.getAttribute("label")||"Secure field",n=fe(this.getAttribute("autocomplete")||"off"),o=`velin-secure-${Math.random().toString(36).slice(2,9)}`,a=this.shadowRoot?.querySelector("input");a&&this._onChange&&a.removeEventListener("change",this._onChange),this.shadowRoot.innerHTML=`
|
|
1206
|
+
<style>${mu}</style>
|
|
1207
1207
|
<label for="${o}">${p(r)}</label>
|
|
1208
1208
|
<input id="${o}" type="${e}" autocomplete="${n}" part="input" />
|
|
1209
1209
|
<p class="velin-field-help">Demo-only client encoding \u2014 use HTTPS and server-side crypto for real secrets.</p>
|
|
1210
|
-
`;let c=this.shadowRoot.querySelector("input");this._onChange=async()=>{let d=this.getAttribute("mode")||"aes-gcm",m=await Dd(c.value,d);this.dispatchEvent(new CustomEvent("velin-secure-submit",{bubbles:!0,detail:{name:t,payload:m}}))},c.addEventListener("change",this._onChange)}};customElements.get("velin-secure-field")||customElements.define("velin-secure-field",zi);Nd=zi});var La={};v(La,{default:()=>Ta});function Hd(i){if(!i)return[];let e=String(i).trim();if(e.startsWith("["))try{let t=JSON.parse(e);return Array.isArray(t)?t.map(Number).filter(r=>Number.isFinite(r)):[]}catch{return[]}return e.split(/[\s,]+/).map(t=>Number.parseFloat(t)).filter(t=>Number.isFinite(t))}function $d(i,e,t,r,n){let o=i.length;if(o===0)return[];if(o===1)return[[0,t/2],[e,t/2]];let a=Math.max(n-r,1e-6),c=e/(o-1);return i.map((d,m)=>{let b=m*c,_=t-(d-r)/a*t;return[b,_]})}function Sa(i){return i.length?i.map(([e,t],r)=>`${r===0?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" "):""}function zd(i,e){if(!i.length)return"";let t=Sa(i),r=i[i.length-1][0],n=i[0][0];return`${t} L${r.toFixed(2)},${e} L${n.toFixed(2)},${e} Z`}var Xe,Fi,Ta,Pi=u(()=>{Xe="http://www.w3.org/2000/svg";Fi=class extends HTMLElement{static get observedAttributes(){return["values","width","height","min","max","area","glow","animate","label"]}constructor(){super(),this._values=[],this._gradientId=`velin-spark-grad-${Math.random().toString(36).slice(2,8)}`}connectedCallback(){this._render()}attributeChangedCallback(){this.isConnected&&this._render()}get values(){return this._values.slice()}set values(e){Array.isArray(e)&&(this._values=e.filter(t=>Number.isFinite(Number(t))).map(Number),this.setAttribute("values",this._values.join(",")))}update(e){Array.isArray(e)&&(this._values=e.filter(t=>Number.isFinite(Number(t))).map(Number),this._render({tick:!0}))}_render({tick:e=!1}={}){let t=Number.parseFloat(this.getAttribute("width"))||320,r=Number.parseFloat(this.getAttribute("height"))||96,n=this._values.length?this._values:Hd(this.getAttribute("values"));if(this._values=n,!n.length){this.innerHTML="";return}let o=Number.parseFloat(this.getAttribute("min")),a=Number.parseFloat(this.getAttribute("max")),c=Number.isFinite(o)?o:Math.min(...n),d=Number.isFinite(a)?a:Math.max(...n),m=this.hasAttribute("area")&&this.getAttribute("area")!=="false",b=this.hasAttribute("glow")&&this.getAttribute("glow")!=="false",_=(this.getAttribute("animate")||"draw").toLowerCase(),g=$d(n,t,r,c,d),F=Sa(g),w=m?zd(g,r):"";this.innerHTML="";let A=document.createElementNS(Xe,"svg");if(A.setAttribute("viewBox",`0 0 ${t} ${r}`),A.setAttribute("preserveAspectRatio","none"),A.style.display="block",A.style.width="100%",A.style.height="100%",this._applyA11y(A),m){let re=document.createElementNS(Xe,"defs"),de=document.createElementNS(Xe,"linearGradient");de.setAttribute("id",this._gradientId),de.setAttribute("x1","0"),de.setAttribute("x2","0"),de.setAttribute("y1","0"),de.setAttribute("y2","1"),[["0%","currentColor","0.35"],["100%","currentColor","0"]].forEach(([Et,H,we])=>{let ue=document.createElementNS(Xe,"stop");ue.setAttribute("offset",Et),ue.setAttribute("stop-color",H),ue.setAttribute("stop-opacity",we),de.appendChild(ue)}),re.appendChild(de),A.appendChild(re);let ne=document.createElementNS(Xe,"path");ne.setAttribute("d",w),ne.setAttribute("fill",`url(#${this._gradientId})`),ne.setAttribute("stroke","none"),ne.classList.add("velin-chart-area"),A.appendChild(ne)}let E=document.createElementNS(Xe,"path");if(E.setAttribute("d",F),E.setAttribute("fill","none"),E.setAttribute("stroke","currentColor"),E.setAttribute("stroke-width","2"),E.setAttribute("stroke-linecap","round"),E.setAttribute("stroke-linejoin","round"),E.setAttribute("vector-effect","non-scaling-stroke"),A.appendChild(E),b&&A.classList.add("velin-chart-glow"),this.appendChild(A),_!=="none"){let re=typeof E.getTotalLength=="function"&&E.getTotalLength()||t;E.style.setProperty("--velin-chart-len",re.toFixed(2)),E.classList.add("velin-chart-line")}else E.style.strokeDasharray="",E.style.strokeDashoffset="";e&&(this.classList.remove("velin-spark-tick"),this.offsetWidth,this.classList.add("velin-spark-tick"))}_applyA11y(e){let t=(this.getAttribute("label")||this.getAttribute("aria-label")||"").trim();if(t){e.setAttribute("role","img"),e.setAttribute("aria-label",t),e.removeAttribute("aria-hidden"),e.removeAttribute("aria-labelledby");return}let r=this.closest("figure")?.querySelector("figcaption");if(r?.textContent?.trim()){r.id||(r.id=`velin-sparkline-cap-${Math.random().toString(36).slice(2,9)}`),e.setAttribute("role","img"),e.setAttribute("aria-labelledby",r.id),e.removeAttribute("aria-hidden"),e.removeAttribute("aria-label");return}e.setAttribute("role","presentation"),e.setAttribute("aria-hidden","true"),e.setAttribute("focusable","false"),e.removeAttribute("aria-label"),e.removeAttribute("aria-labelledby")}};typeof customElements<"u"&&!customElements.get("velin-sparkline")&&customElements.define("velin-sparkline",Fi);Ta=Fi});var vn,Ca=u(()=>{vn={"velin-accordion":()=>Promise.resolve().then(()=>(fr(),Io)),"velin-announcer":()=>Promise.resolve().then(()=>(jr(),Rs)),"velin-bottom-nav":()=>Promise.resolve().then(()=>(zr(),bs)),"velin-carousel":()=>Promise.resolve().then(()=>(Sr(),Xo)),"velin-code-block":()=>Promise.resolve().then(()=>(an(),na)),"velin-collapse":()=>Promise.resolve().then(()=>(Tr(),Jo)),"velin-combobox":()=>Promise.resolve().then(()=>($r(),fs)),"velin-command":()=>Promise.resolve().then(()=>(Br(),Ls)),"velin-copy":()=>Promise.resolve().then(()=>(Er(),Wo)),"velin-countdown":()=>Promise.resolve().then(()=>(Dr(),cs)),"velin-counter":()=>Promise.resolve().then(()=>(Ri(),sa)),"velin-dialog":()=>Promise.resolve().then(()=>(Or(),as)),"velin-drawer":()=>Promise.resolve().then(()=>(_r(),Po)),"velin-dropdown":()=>Promise.resolve().then(()=>(mr(),Ro)),"velin-email":()=>Promise.resolve().then(()=>(vi(),Os)),"velin-icon":()=>Promise.resolve().then(()=>(yr(),zo)),"velin-lightbox":()=>Promise.resolve().then(()=>(Mr(),ns)),"velin-live-dot":()=>Promise.resolve().then(()=>(Ii(),ca)),"velin-menubar":()=>Promise.resolve().then(()=>(Ur(),Ss)),"velin-modal":()=>Promise.resolve().then(()=>(pr(),Lo)),"velin-persist":()=>Promise.resolve().then(()=>(Hr(),ps)),"velin-popover":()=>Promise.resolve().then(()=>(wr(),jo)),"velin-progress-ring":()=>Promise.resolve().then(()=>(Nr(),us)),"velin-rating":()=>Promise.resolve().then(()=>(qr(),Es)),"velin-scroll-top":()=>Promise.resolve().then(()=>(kr(),Yo)),"velin-scrollspy":()=>Promise.resolve().then(()=>(Lr(),es)),"velin-search":()=>Promise.resolve().then(()=>(_t(),fn)),"velin-secure-field":()=>Promise.resolve().then(()=>(ka(),Ea)),"velin-segmented-control":()=>Promise.resolve().then(()=>(Pr(),xs)),"velin-sheet":()=>Promise.resolve().then(()=>(Fr(),ys)),"velin-sparkline":()=>Promise.resolve().then(()=>(Pi(),La)),"velin-stepper":()=>Promise.resolve().then(()=>(ii(),Ir)),"velin-stepper-wc":()=>Promise.resolve().then(()=>(ii(),Ir)),"velin-tabs":()=>Promise.resolve().then(()=>(vr(),Do)),"velin-theme-toggle":()=>Promise.resolve().then(()=>(Ar(),Uo)),"velin-toast":()=>Promise.resolve().then(()=>(br(),Ho)),"velin-tooltip":()=>Promise.resolve().then(()=>(ei(),Cr)),"velin-tooltip-wc":()=>Promise.resolve().then(()=>(ei(),Cr))}});function Ma(i,e={}){let t=new Set;for(let[r,n]of Object.entries(e)){if(n==="false"||n==="off")continue;let o=Ra[r];if(o&&o.forEach(a=>t.add(a)),r==="slide"&&n&&n!=="true"&&n!==""){let a=`slide-${n}`;Ra[a]?.forEach(c=>t.add(c))}}return t.forEach(r=>i.classList.add(r)),!i.classList.contains("velin-animate-on-scroll")&&e.reveal!==void 0&&i.classList.add("velin-animate-on-scroll"),[...t]}function qi(i){i.classList.add(bn),i.dataset.velinVisible="true"}function Ia(){return typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}var bn,Ra,Oa=u(()=>{bn="velin-in-view",Ra={reveal:["velin-animate-on-scroll"],fade:["velin-animate-on-scroll","velin-animate-on-scroll--fade"],slide:["velin-animate-on-scroll","velin-animate-on-scroll--slide-up"],"slide-up":["velin-animate-on-scroll","velin-animate-on-scroll--slide-up"],"slide-down":["velin-animate-on-scroll","velin-animate-on-scroll--slide-down"],"slide-left":["velin-animate-on-scroll","velin-animate-on-scroll--slide-left"],"slide-right":["velin-animate-on-scroll","velin-animate-on-scroll--slide-right"],scale:["velin-animate-on-scroll","velin-animate-on-scroll--scale"],parallax:["velin-parallax"],"parallax-slow":["velin-parallax","velin-parallax--slow"],hover:["velin-animate-hover"],"hover-lift":["velin-animate-hover"],flip:["velin-animate-scale-in"],blur:["velin-animate-fade-in"]}});function Fd(i,e="true"){let t=e==="true"||e===""?60:parseInt(e,10)||60;[...i.children].forEach((n,o)=>{n.style.setProperty("--velin-stagger-delay",`${o*t}ms`),n.classList.add("velin-stagger-item")}),i.classList.add("velin-stagger")}function Na(i=document){i.querySelectorAll(`[${Da}]`).forEach(e=>{e.dataset.velinStaggerDone||(e.dataset.velinStaggerDone="1",Fd(e,e.getAttribute(Da)||"true"))})}var Da,Ha=u(()=>{Da="velin-stagger"});function Pd(i,e={}){let t=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,r=typeof i=="string"?document.querySelector(i):i;r&&(r.scrollIntoView({behavior:t||e.instant?"auto":"smooth",block:e.block||"start",inline:e.inline||"nearest"}),r.tabIndex<0&&!r.hasAttribute("tabindex")&&r.setAttribute("tabindex","-1"),r.focus({preventScroll:!0}))}function $a(i=document){i.querySelectorAll("[velin-scroll]").forEach(e=>{e.dataset.velinScrollBound||(e.dataset.velinScrollBound="1",e.addEventListener("click",t=>{let r=e.getAttribute("href");if(!r||!r.startsWith("#"))return;let n=document.querySelector(r);n&&(t.preventDefault(),Pd(n))}))})}var za=u(()=>{});function Re(i={}){let e=i.root||(typeof document<"u"?document:null);if(!e)return()=>{};let t=i.selector||["[velin-reveal]","[velin-fade]","[velin-slide]","[velin-scale]","[velin-parallax]","[velin-hover]",".velin-animate-on-scroll"].join(","),r=e.querySelectorAll(t),n=Ia();for(let o of r){if(o.dataset.velinMotionInit)continue;o.dataset.velinMotionInit="1";let a={};for(let d of qd)o.hasAttribute(d)&&(a[d.replace("velin-","")]=o.getAttribute(d)||"true");if(Ma(o,a),n){qi(o);continue}let c=mt(o,d=>qi(d));gn.push(c)}return Na(e),$a(e),()=>{gn.forEach(o=>o()),gn=[],ta()}}function Fa(i={}){return Re({root:typeof document<"u"?document:null,selector:i.selector||".velin-animate-on-scroll"})}var qd,gn,Pa,yn=u(()=>{nn();Oa();Ha();za();qd=["velin-reveal","velin-fade","velin-slide","velin-scale","velin-parallax","velin-hover"],gn=[];Pa={init:Re,observe:mt,markVisible:qi,VISIBLE_CLASS:bn}});function S(i,e){Ze.set(i,e)}function Ua(i){return Ze.get(i)}function xt(i,e,t={}){i.setAttribute("data-velin-component",e);for(let[r,n]of Object.entries(t))n!=null&&i.setAttribute(r,n);return W(e)}function Ud(){S("velin-modal",{enhance(i){xt(i,"velin-modal",{open:i.getAttribute("velin-modal")||""})}}),S("velin-tabs",{enhance:i=>xt(i,"velin-tabs")}),S("velin-accordion",{enhance:i=>xt(i,"velin-accordion")}),S("velin-tooltip",{enhance(i){let e=i.getAttribute("velin-tooltip")||i.getAttribute("title")||"";if(e&&i.hasAttribute("title")&&i.removeAttribute("title"),i.tagName==="VELIN-TOOLTIP"||i.tagName==="VELIN-TOOLTIP-WC")return i.setAttribute("content",e),W("velin-tooltip");let t=document.createElement("velin-tooltip");t.setAttribute("content",e);let r=i.parentElement;return r&&(r.insertBefore(t,i),t.appendChild(i)),W("velin-tooltip")}}),S("velin-copy",{enhance(i){let e=i.getAttribute("velin-copy")||i.textContent?.trim()||"";if(!i.querySelector("velin-copy")){let t=document.createElement("velin-copy");if(t.setAttribute("value",e),i.tagName==="BUTTON")return t.append(...i.childNodes),i.replaceWith(t),W("velin-copy");i.appendChild(t)}return W("velin-copy")}}),S("velin-counter",{enhance(i){xt(i,"velin-counter",{value:i.getAttribute("velin-counter")||"0"})}}),S("velin-notify",{async enhance(i){await W("velin-toast"),i.addEventListener("click",()=>{let e=i.getAttribute("velin-notify")||i.textContent||"";document.dispatchEvent(new CustomEvent("velin-toast-show",{detail:{message:e,variant:i.dataset.variant||"info"}}))})}}),S("velin-theme",{enhance(i){let e=i.getAttribute("velin-theme")||"toggle";if(e==="toggle")return i.querySelector("velin-theme-toggle")||i.appendChild(document.createElement("velin-theme-toggle")),W("velin-theme-toggle");document.documentElement.setAttribute("data-velin-theme",e)}}),S("velin-scroll-top",{enhance(i){let e=i.getAttribute("velin-scroll-top"),t=e&&e!=="true"?e:"300";if(i.tagName==="VELIN-SCROLL-TOP")return e&&e!=="true"&&i.setAttribute("threshold",t),W("velin-scroll-top");let r=document.querySelector("velin-scroll-top");return r||(r=document.createElement("velin-scroll-top"),r.setAttribute("threshold",t),(i===document.body||i===document.documentElement?document.body:i).appendChild(r)),W("velin-scroll-top")}}),S("velin-progress",{enhance(i){if(i.hasAttribute("ring"))return xt(i,"velin-progress-ring");i.classList.add("velin-progress");let t=parseInt(i.getAttribute("velin-progress")||"0",10);i.setAttribute("role","progressbar"),i.setAttribute("aria-valuenow",String(t)),i.style.setProperty("--velin-progress",`${Math.min(100,t)}%`)}}),S("velin-search",{async enhance(i){if(i.tagName!=="VELIN-SEARCH"){let e=document.createElement("velin-search");e.setAttribute("index",i.getAttribute("data-search-index")||"/search-index.json"),i.replaceWith(e),e.appendChild(i)}return W("velin-search")}}),S("velin-lazy",{enhance(i){i.tagName==="IMG"&&(i.loading="lazy",i.decoding="async",(i.hasAttribute("velin-skeleton")||i.dataset.velinSkeleton)&&(i.classList.add("velin-skeleton","velin-skeleton--image"),i.addEventListener("load",()=>i.classList.remove("velin-skeleton","velin-skeleton--image"),{once:!0})))}}),S("velin-skeleton",{enhance(i){let e=i.getAttribute("velin-skeleton")||"text";i.classList.add("velin-skeleton",`velin-skeleton--${e}`),!(!!i.textContent?.trim()&&i.children.length>0)&&!i.textContent?.trim()&&i.setAttribute("aria-hidden","true")}}),S("velin-loading",{enhance(i){i.classList.add("velin-spinner"),i.setAttribute("aria-busy","true"),i.setAttribute("role","status"),i.getAttribute("aria-label")?.trim()||i.setAttribute("aria-label","Loading")}}),S("velin-grid",{enhance(i){let e=i.getAttribute("velin-grid")||"auto";i.classList.add("velin-grid"),e!=="auto"&&i.style.setProperty("--velin-grid-cols",e)}}),S("velin-anchor",{enhance(i){!i.id&&i.getAttribute("velin-anchor")&&(i.id=i.getAttribute("velin-anchor")),i.setAttribute("tabindex","-1")}}),S("velin-code",{async enhance(i){let e=i.getAttribute("velin-code")||i.getAttribute("language")||i.getAttribute("data-language")||"";if(i.classList.add("velin-code-block"),e&&e!=="true"&&(i.dataset.language=e,i.getAttribute("language")||i.setAttribute("language",e)),!i.querySelector("[data-velin-copy]")){let o=document.createElement("button");o.type="button",o.className="velin-code-block__copy velin-btn velin-btn--sm",o.textContent="Copy",o.setAttribute("data-velin-copy",""),o.setAttribute("velin-copy",i.querySelector("code")?.textContent||i.textContent||""),i.style.position="relative",i.appendChild(o)}await W("velin-copy");let{initHighlight:t,highlightElement:r}=await Promise.resolve().then(()=>(vt(),sn));i.getAttribute("data-velin-highlight")==="immediate"||typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches?await r(i):t(i,{root:i})}}),S("velin-quote",{enhance(i){(i.tagName==="BLOCKQUOTE"||i.tagName==="Q")&&i.classList.add("velin-quote")}}),S("velin-highlight",{enhance(i){i.classList.add("velin-highlight")}});for(let i of["velin-reveal","velin-fade","velin-slide","velin-scale","velin-parallax","velin-hover","velin-stagger","velin-scroll"])S(i,{enhance(){}})}async function _n(i=document){let e=[...Ze.keys()].map(r=>`[${r}]`).join(","),t=i.querySelectorAll(e);for(let r of t)if(!qa.has(r)){for(let n of Ze.keys()){if(!r.hasAttribute(n))continue;let o=Ze.get(n);o?.enhance&&await o.enhance(r)}qa.add(r)}if(Re({root:i}),typeof HTMLElement<"u"){let{bindDeclarativeSearch:r}=await Promise.resolve().then(()=>(_t(),fn));if(r(i),!document.querySelector("velin-announcer")){let{getAnnouncer:n}=await Promise.resolve().then(()=>(Be(),is));n()}}}function xn(){return[...Ze.keys()]}var Ze,qa,Ba=u(()=>{An();yn();Ze=new Map;Ud();qa=new WeakSet});var ja={};v(ja,{bootAttributes:()=>_n,getAttributeHandler:()=>Ua,listRegisteredAttributes:()=>xn,registerAttribute:()=>S});var wn=u(()=>{Ba()});var Ka={};v(Ka,{PATTERNS:()=>Ui,VelinHapticObserver:()=>wt,applyHaptic:()=>At,default:()=>Bd,vibrate:()=>En});function En(i){if(typeof navigator>"u"||!navigator.vibrate||window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches)return;let t=typeof i=="string"?Ui[i]||Ui.tap:i;navigator.vibrate(t)}function At(i){let e=i.getAttribute("haptic")||"tap";i.addEventListener("click",()=>En(e))}var Ui,wt,Bd,kn=u(()=>{Ui={tap:[10],"double-tap":[10,50,10],success:[50],error:[100,30,100],warning:[30,20,30],long:[200]};wt=class{constructor(){this._observer=null}start(e=document.body){e.querySelectorAll("[haptic]").forEach(At),this._observer=new MutationObserver(r=>{for(let n of r)for(let o of n.addedNodes)o.nodeType===1&&(o.hasAttribute?.("haptic")&&At(o),o.querySelectorAll?.("[haptic]").forEach(At))}),this._observer.observe(e,{childList:!0,subtree:!0})}stop(){this._observer?.disconnect()}},Bd=wt});function Kd(i){return typeof customElements>"u"?Promise.reject(new Error("customElements not available")):customElements.whenDefined(i)}async function W(i){let e=vn[i];if(!e)throw new Error(`Unknown Velin component: ${i}`);if(Sn.has(i))return Sn.get(i);let t=e().then(r=>{let n=r.default;return n&&!customElements.get(i)&&customElements.define(i,n),n});return Sn.set(i,t),t}async function Wa(i){return Promise.all(i.map(e=>W(e)))}function Wd(i){let e=new Set;i.querySelectorAll("[data-velin-component]").forEach(t=>{let r=t.getAttribute("data-velin-component");r&&e.add(r.startsWith("velin-")?r:`velin-${r}`)});for(let t of i.querySelectorAll("*")){let r=t.tagName?.toLowerCase();r&&jd.test(r)&&vn[r]&&e.add(r)}return e}async function Gd(i=document,e={}){let t=e.tags?.length?new Set(e.tags):Wd(i),r=Wa([...t]);if(e.attributes){let{bootAttributes:n}=await Promise.resolve().then(()=>(wn(),ja));await n(i)}if(e.highlight){let{initHighlight:n}=await Promise.resolve().then(()=>(vt(),sn));n(i)}if(e.haptic){let{VelinHapticObserver:n}=await Promise.resolve().then(()=>(kn(),Ka));new n().start(i instanceof Document?i.body:i)}return r}var Sn,jd,An=u(()=>{Ca();Sn=new Map,jd=/^velin-[a-z0-9-]+$/});pr();mr();fr();vr();br();yr();_r();Ar();wr();Er();kr();Sr();Tr();Lr();ei();Mr();ii();Or();Dr();Nr();Hr();$r();zr();Fr();Pr();qr();Ur();Br();jr();vi();An();Pi();Ri();Ii();an();_t();_t();yn();var Yd=Fa;if(typeof document<"u"){let i=()=>{document.documentElement?.hasAttribute("data-velin-reveal-auto")&&Re()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i,{once:!0}):i()}Be();Be();function Vd(i={}){if(typeof document>"u")return;let{announcer:e=!0,scrollPadding:t=!0,skipLink:r=!1}=i;if(e&&Ue(),t){let n=document.querySelector(".velin-nav, .velin-doc-header, .site-nav, [data-velin-fixed-nav]");if(n){let o=n.getBoundingClientRect().height;document.documentElement.style.setProperty("--velin-nav-height",`${Math.ceil(o)}px`),document.documentElement.classList.add("velin-scroll-pt-nav")}}if(r&&!document.querySelector(".velin-skip-link")&&document.getElementById("main")){let n=document.createElement("a");n.href="#main",n.className="velin-skip-link",n.textContent="Skip to main content",document.body.prepend(n)}}mn();wn();vt();var Ga=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-reduced-motion: reduce)"):null,Qa={duration:250,easing:"var(--velin-ease-expo-out, cubic-bezier(0.16, 1, 0.3, 1))",itemSelector:":scope > *"};function Tn(i,e){return Array.from(i.querySelectorAll(e))}function el(i,e,t={}){if(!i||typeof e!="function")return;let r={...Qa,...t},n=Ga&&Ga.matches,o=Tn(i,r.itemSelector),a=new Map;if(o.forEach(d=>{d.hidden||a.set(d,d.getBoundingClientRect())}),e(),n)return;Tn(i,r.itemSelector).forEach(d=>{if(d.hidden)return;let m=a.get(d),b=d.getBoundingClientRect();if(!m){if(typeof d.animate!="function")return;d.animate([{opacity:0,transform:"scale(0.96)"},{opacity:1,transform:"scale(1)"}],{duration:r.duration,easing:r.easing,fill:"both"});return}let _=m.left-b.left,g=m.top-b.top;_===0&&g===0||typeof d.animate=="function"&&d.animate([{transform:`translate(${_}px, ${g}px)`},{transform:"translate(0, 0)"}],{duration:r.duration,easing:r.easing,fill:"both"})})}function tl(i,e,t={}){if(!i||typeof e!="function")return;let r={...Qa,...t};el(i,()=>{Tn(i,r.itemSelector).forEach(n=>{n.hidden=!e(n)})},r)}function Ya(i){return i?String(i).toLowerCase().split(/[\s,|]+/).map(e=>e.trim()).filter(Boolean):[]}function Xd(i,e,t){return e.length?t==="all"?e.every(r=>i.includes(r)):e.some(r=>i.includes(r)):!0}function Zd(i,e){return e?((i.getAttribute("data-tags")||"")+" "+(i.getAttribute("data-search")||"")+" "+(i.textContent||"")).toLowerCase().includes(e.toLowerCase()):!0}var Ln=class{constructor(e){this.container=e,this.tag="",this.search="",this.matchMode=e.getAttribute("data-velin-filter-mode")==="all"?"all":"any",this.itemSelector=e.getAttribute("data-velin-filter-item")||":scope > *"}apply(){let e=Ya(this.tag),t=this.search;tl(this.container,r=>{let n=Ya(r.getAttribute("data-tags"));return Xd(n,e,this.matchMode)&&Zd(r,t)},{itemSelector:this.itemSelector})}},Va=new WeakMap;function Xa(i){let e=Va.get(i);return e||(e=new Ln(i),Va.set(i,e)),e}function Za(i){let e=i.getAttribute("data-velin-filter-target");if(!e)return null;try{return document.querySelector(e)}catch{return null}}function Jd(i,e){i&&i.querySelectorAll("[data-velin-filter-value]").forEach(t=>{t===e?t.setAttribute("data-velin-filter-active",""):t.removeAttribute("data-velin-filter-active")})}function Ja(){if(typeof document>"u")return;document.addEventListener("click",e=>{let t=e.target.closest("[data-velin-filter-value]");if(!t)return;let r=Za(t);if(!r)return;let n=t.closest("[data-velin-filter-group]")||t.parentElement;Jd(n,t);let o=Xa(r);o.tag=t.getAttribute("data-velin-filter-value")||"",(o.tag.toLowerCase()==="all"||o.tag==="*")&&(o.tag=""),o.apply()});let i=e=>{let t=e.target.closest("[data-velin-filter-input]");if(!t)return;let r=Za(t);if(!r)return;let n=Xa(r),o=t.value||(typeof t.getAttribute=="function"?t.getAttribute("value"):"");n.search=(o||"").trim(),n.apply()};document.addEventListener("input",i),document.addEventListener("change",i)}typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Ja,{once:!0}):Ja());k();kn();j();Pi();Ri();Ii();vi();export{Ui as HapticPatterns,Mo as VelinAccordion,Cs as VelinAnnouncer,vs as VelinBottomNav,Vo as VelinCarousel,ra as VelinCodeBlock,Zo as VelinCollapse,ms as VelinCombobox,Ts as VelinCommand,Ko as VelinCopy,ls as VelinCountdown,oa as VelinCounter,ss as VelinDialog,Fo as VelinDrawer,Co as VelinDropdown,Is as VelinEmail,wt as VelinHapticObserver,$o as VelinIcon,rs as VelinLightbox,la as VelinLiveDot,ks as VelinMenubar,To as VelinModal,hs as VelinPersist,Bo as VelinPopover,ds as VelinProgressRing,ws as VelinRating,Go as VelinScrollTop,Qo as VelinScrollspy,Aa as VelinSearch,_s as VelinSegmentedControl,gs as VelinSheet,Ta as VelinSparkline,os as VelinStepper,lt as VelinStepperWC,Oo as VelinTabs,qo as VelinThemeToggle,No as VelinToast,ts as VelinTooltip,st as VelinTooltipWC,at as announce,At as applyHaptic,wa as bindDeclarativeSearch,_n as bootAttributes,Gd as bootFromDOM,ee as clearBackgroundInert,gc as createSafeHTML,pn as createSearch,p as escapeHTML,me as escapeHTMLAttribute,tl as filterList,el as flipReorder,Ue as getAnnouncer,ae as getFocusableElements,So as getTrustedPolicy,pt as highlightAll,ie as highlightElement,Vd as initA11y,xe as initHighlight,Re as initMotion,Yd as initReveal,W as lazyDefine,_e as lazyLoadLanguage,xn as listRegisteredAttributes,ft as observeCodeBlocks,Wa as register,S as registerAttribute,Ye as registerLanguage,pa as registerSearchProvider,Ei as renderTokens,J as restoreFocus,Y as rovingTabindex,Te as sanitizeURL,Z as saveFocus,Q as setBackgroundInert,hr as stripControlChars,G as trapFocus,Pa as velinMotion,Md as velinSearch,ia as velinSyntax,En as vibrate,Kd as whenDefined};
|
|
1210
|
+
`;let l=this.shadowRoot.querySelector("input");this._onChange=async()=>{let u=this.getAttribute("mode")||"aes-gcm",m=await fu(l.value,u);this.dispatchEvent(new CustomEvent("velin-secure-submit",{bubbles:!0,detail:{name:t,payload:m}}))},l.addEventListener("change",this._onChange)}};customElements.get("velin-secure-field")||customElements.define("velin-secure-field",Pi);bu=Pi});var Za={};f(Za,{default:()=>Xa});function vu(i){if(!i)return[];let e=String(i).trim();if(e.startsWith("["))try{let t=JSON.parse(e);return Array.isArray(t)?t.map(Number).filter(r=>Number.isFinite(r)):[]}catch{return[]}return e.split(/[\s,]+/).map(t=>Number.parseFloat(t)).filter(t=>Number.isFinite(t))}function gu(i,e,t,r,n){let o=i.length;if(o===0)return[];if(o===1)return[[0,t/2],[e,t/2]];let a=Math.max(n-r,1e-6),l=e/(o-1);return i.map((u,m)=>{let v=m*l,y=t-(u-r)/a*t;return[v,y]})}function Ya(i){return i.length?i.map(([e,t],r)=>`${r===0?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" "):""}function yu(i,e){if(!i.length)return"";let t=Ya(i),r=i[i.length-1][0],n=i[0][0];return`${t} L${r.toFixed(2)},${e} L${n.toFixed(2)},${e} Z`}var Ze,qi,Xa,Bi=d(()=>{Ze="http://www.w3.org/2000/svg";qi=class extends HTMLElement{static get observedAttributes(){return["values","width","height","min","max","area","glow","animate","label"]}constructor(){super(),this._values=[],this._gradientId=`velin-spark-grad-${Math.random().toString(36).slice(2,8)}`}connectedCallback(){this._render()}attributeChangedCallback(){this.isConnected&&this._render()}get values(){return this._values.slice()}set values(e){Array.isArray(e)&&(this._values=e.filter(t=>Number.isFinite(Number(t))).map(Number),this.setAttribute("values",this._values.join(",")))}update(e){Array.isArray(e)&&(this._values=e.filter(t=>Number.isFinite(Number(t))).map(Number),this._render({tick:!0}))}_render({tick:e=!1}={}){let t=Number.parseFloat(this.getAttribute("width"))||320,r=Number.parseFloat(this.getAttribute("height"))||96,n=this._values.length?this._values:vu(this.getAttribute("values"));if(this._values=n,!n.length){this.innerHTML="";return}let o=Number.parseFloat(this.getAttribute("min")),a=Number.parseFloat(this.getAttribute("max")),l=Number.isFinite(o)?o:Math.min(...n),u=Number.isFinite(a)?a:Math.max(...n),m=this.hasAttribute("area")&&this.getAttribute("area")!=="false",v=this.hasAttribute("glow")&&this.getAttribute("glow")!=="false",y=(this.getAttribute("animate")||"draw").toLowerCase(),g=gu(n,t,r,l,u),N=Ya(g),w=m?yu(g,r):"";this.innerHTML="";let A=document.createElementNS(Ze,"svg");if(A.setAttribute("viewBox",`0 0 ${t} ${r}`),A.setAttribute("preserveAspectRatio","none"),A.style.display="block",A.style.width="100%",A.style.height="100%",this._applyA11y(A),m){let oe=document.createElementNS(Ze,"defs"),ue=document.createElementNS(Ze,"linearGradient");ue.setAttribute("id",this._gradientId),ue.setAttribute("x1","0"),ue.setAttribute("x2","0"),ue.setAttribute("y1","0"),ue.setAttribute("y2","1"),[["0%","currentColor","0.35"],["100%","currentColor","0"]].forEach(([Et,z,ke])=>{let he=document.createElementNS(Ze,"stop");he.setAttribute("offset",Et),he.setAttribute("stop-color",z),he.setAttribute("stop-opacity",ke),ue.appendChild(he)}),oe.appendChild(ue),A.appendChild(oe);let se=document.createElementNS(Ze,"path");se.setAttribute("d",w),se.setAttribute("fill",`url(#${this._gradientId})`),se.setAttribute("stroke","none"),se.classList.add("velin-chart-area"),A.appendChild(se)}let E=document.createElementNS(Ze,"path");if(E.setAttribute("d",N),E.setAttribute("fill","none"),E.setAttribute("stroke","currentColor"),E.setAttribute("stroke-width","2"),E.setAttribute("stroke-linecap","round"),E.setAttribute("stroke-linejoin","round"),E.setAttribute("vector-effect","non-scaling-stroke"),A.appendChild(E),v&&A.classList.add("velin-chart-glow"),this.appendChild(A),y!=="none"){let oe=typeof E.getTotalLength=="function"&&E.getTotalLength()||t;E.style.setProperty("--velin-chart-len",oe.toFixed(2)),E.classList.add("velin-chart-line")}else E.style.strokeDasharray="",E.style.strokeDashoffset="";e&&(this.classList.remove("velin-spark-tick"),this.offsetWidth,this.classList.add("velin-spark-tick"))}_applyA11y(e){let t=(this.getAttribute("label")||this.getAttribute("aria-label")||"").trim();if(t){e.setAttribute("role","img"),e.setAttribute("aria-label",t),e.removeAttribute("aria-hidden"),e.removeAttribute("aria-labelledby");return}let r=this.closest("figure")?.querySelector("figcaption");if(r?.textContent?.trim()){r.id||(r.id=`velin-sparkline-cap-${Math.random().toString(36).slice(2,9)}`),e.setAttribute("role","img"),e.setAttribute("aria-labelledby",r.id),e.removeAttribute("aria-hidden"),e.removeAttribute("aria-label");return}e.setAttribute("role","presentation"),e.setAttribute("aria-hidden","true"),e.setAttribute("focusable","false"),e.removeAttribute("aria-label"),e.removeAttribute("aria-labelledby")}};typeof customElements<"u"&&!customElements.get("velin-sparkline")&&customElements.define("velin-sparkline",qi);Xa=qi});var Cn,Ja=d(()=>{Cn={"velin-accordion":()=>Promise.resolve().then(()=>(vr(),Ko)),"velin-announcer":()=>Promise.resolve().then(()=>(Wr(),Us)),"velin-bottom-nav":()=>Promise.resolve().then(()=>(Pr(),Rs)),"velin-carousel":()=>Promise.resolve().then(()=>(Lr(),cs)),"velin-code-block":()=>Promise.resolve().then(()=>(vn(),xa)),"velin-collapse":()=>Promise.resolve().then(()=>(Cr(),us)),"velin-combobox":()=>Promise.resolve().then(()=>(Hr(),Ls)),"velin-command":()=>Promise.resolve().then(()=>(Kr(),qs)),"velin-copy":()=>Promise.resolve().then(()=>(Sr(),os)),"velin-countdown":()=>Promise.resolve().then(()=>(Fr(),As)),"velin-counter":()=>Promise.resolve().then(()=>(Ri(),wa)),"velin-data-table":()=>Promise.resolve().then(()=>(gn(),Ta)),"velin-dialog":()=>Promise.resolve().then(()=>(Nr(),_s)),"velin-drawer":()=>Promise.resolve().then(()=>(Ar(),Qo)),"velin-dropdown":()=>Promise.resolve().then(()=>(br(),Uo)),"velin-email":()=>Promise.resolve().then(()=>(bi(),Ws)),"velin-form-summary":()=>Promise.resolve().then(()=>(_n(),Ca)),"velin-icon":()=>Promise.resolve().then(()=>(xr(),Zo)),"velin-lightbox":()=>Promise.resolve().then(()=>(Dr(),vs)),"velin-live-dot":()=>Promise.resolve().then(()=>(Oi(),Ma)),"velin-menubar":()=>Promise.resolve().then(()=>(jr(),Hs)),"velin-modal":()=>Promise.resolve().then(()=>(fr(),qo)),"velin-persist":()=>Promise.resolve().then(()=>(zr(),Ss)),"velin-popover":()=>Promise.resolve().then(()=>(kr(),rs)),"velin-progress-ring":()=>Promise.resolve().then(()=>($r(),Es)),"velin-rating":()=>Promise.resolve().then(()=>(Ur(),$s)),"velin-scroll-top":()=>Promise.resolve().then(()=>(Tr(),as)),"velin-scrollspy":()=>Promise.resolve().then(()=>(Rr(),ps)),"velin-search":()=>Promise.resolve().then(()=>(_t(),Ln)),"velin-secure-field":()=>Promise.resolve().then(()=>(Va(),Ga)),"velin-segmented-control":()=>Promise.resolve().then(()=>(Br(),Os)),"velin-sheet":()=>Promise.resolve().then(()=>(qr(),Ms)),"velin-sparkline":()=>Promise.resolve().then(()=>(Bi(),Za)),"velin-stepper":()=>Promise.resolve().then(()=>(ii(),Or)),"velin-stepper-wc":()=>Promise.resolve().then(()=>(ii(),Or)),"velin-tabs":()=>Promise.resolve().then(()=>(gr(),Go)),"velin-theme-toggle":()=>Promise.resolve().then(()=>(Er(),ts)),"velin-toast":()=>Promise.resolve().then(()=>(yr(),Yo)),"velin-tooltip":()=>Promise.resolve().then(()=>(ei(),Ir)),"velin-tooltip-wc":()=>Promise.resolve().then(()=>(ei(),Ir))}});function el(i,e={}){let t=new Set;for(let[r,n]of Object.entries(e)){if(n==="false"||n==="off")continue;let o=Qa[r];if(o&&o.forEach(a=>t.add(a)),r==="slide"&&n&&n!=="true"&&n!==""){let a=`slide-${n}`;Qa[a]?.forEach(l=>t.add(l))}}return t.forEach(r=>i.classList.add(r)),!i.classList.contains("velin-animate-on-scroll")&&e.reveal!==void 0&&i.classList.add("velin-animate-on-scroll"),[...t]}function Ui(i){i.classList.add(Rn),i.dataset.velinVisible="true"}function tl(){return typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}var Rn,Qa,il=d(()=>{Rn="velin-in-view",Qa={reveal:["velin-animate-on-scroll"],fade:["velin-animate-on-scroll","velin-animate-on-scroll--fade"],slide:["velin-animate-on-scroll","velin-animate-on-scroll--slide-up"],"slide-up":["velin-animate-on-scroll","velin-animate-on-scroll--slide-up"],"slide-down":["velin-animate-on-scroll","velin-animate-on-scroll--slide-down"],"slide-left":["velin-animate-on-scroll","velin-animate-on-scroll--slide-left"],"slide-right":["velin-animate-on-scroll","velin-animate-on-scroll--slide-right"],scale:["velin-animate-on-scroll","velin-animate-on-scroll--scale"],parallax:["velin-parallax"],"parallax-slow":["velin-parallax","velin-parallax--slow"],hover:["velin-animate-hover"],"hover-lift":["velin-animate-hover"],flip:["velin-animate-scale-in"],blur:["velin-animate-fade-in"]}});function _u(i,e="true"){let t=e==="true"||e===""?60:parseInt(e,10)||60;[...i.children].forEach((n,o)=>{n.style.setProperty("--velin-stagger-delay",`${o*t}ms`),n.classList.add("velin-stagger-item")}),i.classList.add("velin-stagger")}function nl(i=document){i.querySelectorAll(`[${rl}]`).forEach(e=>{e.dataset.velinStaggerDone||(e.dataset.velinStaggerDone="1",_u(e,e.getAttribute(rl)||"true"))})}var rl,ol=d(()=>{rl="velin-stagger"});function xu(i,e={}){let t=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,r=typeof i=="string"?document.querySelector(i):i;r&&(r.scrollIntoView({behavior:t||e.instant?"auto":"smooth",block:e.block||"start",inline:e.inline||"nearest"}),r.tabIndex<0&&!r.hasAttribute("tabindex")&&r.setAttribute("tabindex","-1"),r.focus({preventScroll:!0}))}function sl(i=document){i.querySelectorAll("[velin-scroll]").forEach(e=>{e.dataset.velinScrollBound||(e.dataset.velinScrollBound="1",e.addEventListener("click",t=>{let r=e.getAttribute("href");if(!r||!r.startsWith("#"))return;let n=document.querySelector(r);n&&(t.preventDefault(),xu(n))}))})}var al=d(()=>{});function Me(i={}){let e=i.root||(typeof document<"u"?document:null);if(!e)return()=>{};let t=i.selector||["[velin-reveal]","[velin-fade]","[velin-slide]","[velin-scale]","[velin-parallax]","[velin-hover]",".velin-animate-on-scroll"].join(","),r=e.querySelectorAll(t),n=tl();for(let o of r){if(o.dataset.velinMotionInit)continue;o.dataset.velinMotionInit="1";let a={};for(let u of Au)o.hasAttribute(u)&&(a[u.replace("velin-","")]=o.getAttribute(u)||"true");if(el(o,a),n){Ui(o);continue}let l=mt(o,u=>Ui(u));In.push(l)}return nl(e),sl(e),()=>{In.forEach(o=>o()),In=[],ga()}}function ll(i={}){return Me({root:typeof document<"u"?document:null,selector:i.selector||".velin-animate-on-scroll"})}var Au,In,cl,Mn=d(()=>{mn();il();ol();al();Au=["velin-reveal","velin-fade","velin-slide","velin-scale","velin-parallax","velin-hover"],In=[];cl={init:Me,observe:mt,markVisible:Ui,VISIBLE_CLASS:Rn}});function S(i,e){Je.set(i,e)}function ul(i){return Je.get(i)}function xt(i,e,t={}){i.setAttribute("data-velin-component",e);for(let[r,n]of Object.entries(t))n!=null&&i.setAttribute(r,n);return V(e)}function wu(){S("velin-modal",{enhance(i){xt(i,"velin-modal",{open:i.getAttribute("velin-modal")||""})}}),S("velin-tabs",{enhance:i=>xt(i,"velin-tabs")}),S("velin-accordion",{enhance:i=>xt(i,"velin-accordion")}),S("velin-tooltip",{enhance(i){let e=i.getAttribute("velin-tooltip")||i.getAttribute("title")||"";if(e&&i.hasAttribute("title")&&i.removeAttribute("title"),i.tagName==="VELIN-TOOLTIP"||i.tagName==="VELIN-TOOLTIP-WC")return i.setAttribute("content",e),V("velin-tooltip");let t=document.createElement("velin-tooltip");t.setAttribute("content",e);let r=i.parentElement;return r&&(r.insertBefore(t,i),t.appendChild(i)),V("velin-tooltip")}}),S("velin-copy",{enhance(i){let e=i.getAttribute("velin-copy")||i.textContent?.trim()||"";if(!i.querySelector("velin-copy")){let t=document.createElement("velin-copy");if(t.setAttribute("value",e),i.tagName==="BUTTON")return t.append(...i.childNodes),i.replaceWith(t),V("velin-copy");i.appendChild(t)}return V("velin-copy")}}),S("velin-counter",{enhance(i){xt(i,"velin-counter",{value:i.getAttribute("velin-counter")||"0"})}}),S("velin-notify",{async enhance(i){await V("velin-toast"),i.addEventListener("click",()=>{let e=i.getAttribute("velin-notify")||i.textContent||"";document.dispatchEvent(new CustomEvent("velin-toast-show",{detail:{message:e,variant:i.dataset.variant||"info"}}))})}}),S("velin-theme",{enhance(i){let e=i.getAttribute("velin-theme")||"toggle";if(e==="toggle")return i.querySelector("velin-theme-toggle")||i.appendChild(document.createElement("velin-theme-toggle")),V("velin-theme-toggle");document.documentElement.setAttribute("data-velin-theme",e)}}),S("velin-scroll-top",{enhance(i){let e=i.getAttribute("velin-scroll-top"),t=e&&e!=="true"?e:"300";if(i.tagName==="VELIN-SCROLL-TOP")return e&&e!=="true"&&i.setAttribute("threshold",t),V("velin-scroll-top");let r=document.querySelector("velin-scroll-top");return r||(r=document.createElement("velin-scroll-top"),r.setAttribute("threshold",t),(i===document.body||i===document.documentElement?document.body:i).appendChild(r)),V("velin-scroll-top")}}),S("velin-progress",{enhance(i){if(i.hasAttribute("ring"))return xt(i,"velin-progress-ring");i.classList.add("velin-progress");let t=parseInt(i.getAttribute("velin-progress")||"0",10);i.setAttribute("role","progressbar"),i.setAttribute("aria-valuenow",String(t)),i.style.setProperty("--velin-progress",`${Math.min(100,t)}%`)}}),S("velin-search",{async enhance(i){if(i.tagName!=="VELIN-SEARCH"){let e=document.createElement("velin-search");e.setAttribute("index",i.getAttribute("data-search-index")||"/search-index.json"),i.replaceWith(e),e.appendChild(i)}return V("velin-search")}}),S("velin-lazy",{enhance(i){i.tagName==="IMG"&&(i.loading="lazy",i.decoding="async",(i.hasAttribute("velin-skeleton")||i.dataset.velinSkeleton)&&(i.classList.add("velin-skeleton","velin-skeleton--image"),i.addEventListener("load",()=>i.classList.remove("velin-skeleton","velin-skeleton--image"),{once:!0})))}}),S("velin-skeleton",{enhance(i){let e=i.getAttribute("velin-skeleton")||"text";i.classList.add("velin-skeleton",`velin-skeleton--${e}`),!(!!i.textContent?.trim()&&i.children.length>0)&&!i.textContent?.trim()&&i.setAttribute("aria-hidden","true")}}),S("velin-loading",{enhance(i){i.classList.add("velin-spinner"),i.setAttribute("aria-busy","true"),i.setAttribute("role","status"),i.getAttribute("aria-label")?.trim()||i.setAttribute("aria-label","Loading")}}),S("velin-grid",{enhance(i){let e=i.getAttribute("velin-grid")||"auto";i.classList.add("velin-grid"),e!=="auto"&&i.style.setProperty("--velin-grid-cols",e)}}),S("velin-anchor",{enhance(i){!i.id&&i.getAttribute("velin-anchor")&&(i.id=i.getAttribute("velin-anchor")),i.setAttribute("tabindex","-1")}}),S("velin-code",{async enhance(i){let e=i.getAttribute("velin-code")||i.getAttribute("language")||i.getAttribute("data-language")||"";if(i.classList.add("velin-code-block"),e&&e!=="true"&&(i.dataset.language=e,i.getAttribute("language")||i.setAttribute("language",e)),!i.querySelector("[data-velin-copy]")){let o=document.createElement("button");o.type="button",o.className="velin-code-block__copy velin-btn velin-btn--sm",o.textContent="Copy",o.setAttribute("data-velin-copy",""),o.setAttribute("velin-copy",i.querySelector("code")?.textContent||i.textContent||""),i.style.position="relative",i.appendChild(o)}await V("velin-copy");let{initHighlight:t,highlightElement:r}=await Promise.resolve().then(()=>(bt(),bn));i.getAttribute("data-velin-highlight")==="immediate"||typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches?await r(i):t(i,{root:i})}}),S("velin-quote",{enhance(i){(i.tagName==="BLOCKQUOTE"||i.tagName==="Q")&&i.classList.add("velin-quote")}}),S("velin-highlight",{enhance(i){i.classList.add("velin-highlight")}});for(let i of["velin-reveal","velin-fade","velin-slide","velin-scale","velin-parallax","velin-hover","velin-stagger","velin-scroll"])S(i,{enhance(){}})}async function Dn(i=document){let e=[...Je.keys()].map(r=>`[${r}]`).join(","),t=i.querySelectorAll(e);for(let r of t)if(!dl.has(r)){for(let n of Je.keys()){if(!r.hasAttribute(n))continue;let o=Je.get(n);o?.enhance&&await o.enhance(r)}dl.add(r)}if(Me({root:i}),typeof HTMLElement<"u"){let{bindDeclarativeSearch:r}=await Promise.resolve().then(()=>(_t(),Ln));if(r(i),!document.querySelector("velin-announcer")){let{getAnnouncer:n}=await Promise.resolve().then(()=>(_e(),fs));n()}}}function On(){return[...Je.keys()]}var Je,dl,hl=d(()=>{Nn();Mn();Je=new Map;wu();dl=new WeakSet});var pl={};f(pl,{bootAttributes:()=>Dn,getAttributeHandler:()=>ul,listRegisteredAttributes:()=>On,registerAttribute:()=>S});var Fn=d(()=>{hl()});var ml={};f(ml,{PATTERNS:()=>ji,VelinHapticObserver:()=>wt,applyHaptic:()=>At,default:()=>Eu,vibrate:()=>$n});function $n(i){if(typeof navigator>"u"||!navigator.vibrate||window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches)return;let t=typeof i=="string"?ji[i]||ji.tap:i;navigator.vibrate(t)}function At(i){let e=i.getAttribute("haptic")||"tap";i.addEventListener("click",()=>$n(e))}var ji,wt,Eu,zn=d(()=>{ji={tap:[10],"double-tap":[10,50,10],success:[50],error:[100,30,100],warning:[30,20,30],long:[200]};wt=class{constructor(){this._observer=null}start(e=document.body){e.querySelectorAll("[haptic]").forEach(At),this._observer=new MutationObserver(r=>{for(let n of r)for(let o of n.addedNodes)o.nodeType===1&&(o.hasAttribute?.("haptic")&&At(o),o.querySelectorAll?.("[haptic]").forEach(At))}),this._observer.observe(e,{childList:!0,subtree:!0})}stop(){this._observer?.disconnect()}},Eu=wt});function Su(i){return typeof customElements>"u"?Promise.reject(new Error("customElements not available")):customElements.whenDefined(i)}async function V(i){let e=Cn[i];if(!e)throw new Error(`Unknown Velin component: ${i}`);if(Hn.has(i))return Hn.get(i);let t=e().then(r=>{let n=r.default;return n&&!customElements.get(i)&&customElements.define(i,n),n});return Hn.set(i,t),t}async function fl(i){return Promise.all(i.map(e=>V(e)))}function Tu(i){let e=new Set;i.querySelectorAll("[data-velin-component]").forEach(t=>{let r=t.getAttribute("data-velin-component");r&&e.add(r.startsWith("velin-")?r:`velin-${r}`)});for(let t of i.querySelectorAll("*")){let r=t.tagName?.toLowerCase();r&&ku.test(r)&&Cn[r]&&e.add(r)}return e}async function Lu(i=document,e={}){let t=e.tags?.length?new Set(e.tags):Tu(i),r=fl([...t]);if(e.attributes){let{bootAttributes:n}=await Promise.resolve().then(()=>(Fn(),pl));await n(i)}if(e.highlight){let{initHighlight:n}=await Promise.resolve().then(()=>(bt(),bn));n(i)}if(e.haptic){let{VelinHapticObserver:n}=await Promise.resolve().then(()=>(zn(),ml));new n().start(i instanceof Document?i.body:i)}return r}var Hn,ku,Nn=d(()=>{Ja();Hn=new Map,ku=/^velin-[a-z0-9-]+$/});fr();br();vr();gr();yr();xr();Ar();Er();kr();Sr();Tr();Lr();Cr();Rr();ei();Dr();ii();Nr();Fr();$r();zr();Hr();Pr();qr();Br();Ur();jr();Kr();Wr();bi();Nn();Bi();Ri();Oi();vn();gn();_n();_t();_t();Mn();var Cu=ll;if(typeof document<"u"){let i=()=>{document.documentElement?.hasAttribute("data-velin-reveal-auto")&&Me()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i,{once:!0}):i()}_e();_e();function Ru(i={}){if(typeof document>"u")return;let{announcer:e=!0,scrollPadding:t=!0,skipLink:r=!1}=i;if(e&&je(),t){let n=document.querySelector(".velin-nav, .velin-doc-header, .site-nav, [data-velin-fixed-nav]");if(n){let o=n.getBoundingClientRect().height;document.documentElement.style.setProperty("--velin-nav-height",`${Math.ceil(o)}px`),document.documentElement.classList.add("velin-scroll-pt-nav")}}if(r&&!document.querySelector(".velin-skip-link")&&document.getElementById("main")){let n=document.createElement("a");n.href="#main",n.className="velin-skip-link",n.textContent="Skip to main content",document.body.prepend(n)}}Tn();Fn();bt();var bl=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-reduced-motion: reduce)"):null,Al={duration:250,easing:"var(--velin-ease-expo-out, cubic-bezier(0.16, 1, 0.3, 1))",itemSelector:":scope > *"};function Pn(i,e){return Array.from(i.querySelectorAll(e))}function wl(i,e,t={}){if(!i||typeof e!="function")return;let r={...Al,...t},n=bl&&bl.matches,o=Pn(i,r.itemSelector),a=new Map;if(o.forEach(u=>{u.hidden||a.set(u,u.getBoundingClientRect())}),e(),n)return;Pn(i,r.itemSelector).forEach(u=>{if(u.hidden)return;let m=a.get(u),v=u.getBoundingClientRect();if(!m){if(typeof u.animate!="function")return;u.animate([{opacity:0,transform:"scale(0.96)"},{opacity:1,transform:"scale(1)"}],{duration:r.duration,easing:r.easing,fill:"both"});return}let y=m.left-v.left,g=m.top-v.top;y===0&&g===0||typeof u.animate=="function"&&u.animate([{transform:`translate(${y}px, ${g}px)`},{transform:"translate(0, 0)"}],{duration:r.duration,easing:r.easing,fill:"both"})})}function El(i,e,t={}){if(!i||typeof e!="function")return;let r={...Al,...t};wl(i,()=>{Pn(i,r.itemSelector).forEach(n=>{n.hidden=!e(n)})},r)}function vl(i){return i?String(i).toLowerCase().split(/[\s,|]+/).map(e=>e.trim()).filter(Boolean):[]}function Iu(i,e,t){return e.length?t==="all"?e.every(r=>i.includes(r)):e.some(r=>i.includes(r)):!0}function Mu(i,e){return e?((i.getAttribute("data-tags")||"")+" "+(i.getAttribute("data-search")||"")+" "+(i.textContent||"")).toLowerCase().includes(e.toLowerCase()):!0}var qn=class{constructor(e){this.container=e,this.tag="",this.search="",this.matchMode=e.getAttribute("data-velin-filter-mode")==="all"?"all":"any",this.itemSelector=e.getAttribute("data-velin-filter-item")||":scope > *"}apply(){let e=vl(this.tag),t=this.search;El(this.container,r=>{let n=vl(r.getAttribute("data-tags"));return Iu(n,e,this.matchMode)&&Mu(r,t)},{itemSelector:this.itemSelector})}},gl=new WeakMap;function yl(i){let e=gl.get(i);return e||(e=new qn(i),gl.set(i,e)),e}function _l(i){let e=i.getAttribute("data-velin-filter-target");if(!e)return null;try{return document.querySelector(e)}catch{return null}}function Du(i,e){i&&i.querySelectorAll("[data-velin-filter-value]").forEach(t=>{t===e?t.setAttribute("data-velin-filter-active",""):t.removeAttribute("data-velin-filter-active")})}function xl(){if(typeof document>"u")return;document.addEventListener("click",e=>{let t=e.target.closest("[data-velin-filter-value]");if(!t)return;let r=_l(t);if(!r)return;let n=t.closest("[data-velin-filter-group]")||t.parentElement;Du(n,t);let o=yl(r);o.tag=t.getAttribute("data-velin-filter-value")||"",(o.tag.toLowerCase()==="all"||o.tag==="*")&&(o.tag=""),o.apply()});let i=e=>{let t=e.target.closest("[data-velin-filter-input]");if(!t)return;let r=_l(t);if(!r)return;let n=yl(r),o=t.value||(typeof t.getAttribute=="function"?t.getAttribute("value"):"");n.search=(o||"").trim(),n.apply()};document.addEventListener("input",i),document.addEventListener("change",i)}typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",xl,{once:!0}):xl());k();zn();K();Bi();Ri();Oi();bi();export{ji as HapticPatterns,jo as VelinAccordion,Bs as VelinAnnouncer,Cs as VelinBottomNav,ls as VelinCarousel,_a as VelinCodeBlock,ds as VelinCollapse,Ts as VelinCombobox,Ps as VelinCommand,ns as VelinCopy,xs as VelinCountdown,Aa as VelinCounter,Sa as VelinDataTable,ys as VelinDialog,Jo as VelinDrawer,Bo as VelinDropdown,Ks as VelinEmail,La as VelinFormSummary,wt as VelinHapticObserver,Xo as VelinIcon,bs as VelinLightbox,Ia as VelinLiveDot,zs as VelinMenubar,Po as VelinModal,ks as VelinPersist,is as VelinPopover,ws as VelinProgressRing,Fs as VelinRating,ss as VelinScrollTop,hs as VelinScrollspy,Ka as VelinSearch,Ds as VelinSegmentedControl,Is as VelinSheet,Xa as VelinSparkline,gs as VelinStepper,lt as VelinStepperWC,Wo as VelinTabs,es as VelinThemeToggle,Vo as VelinToast,ms as VelinTooltip,at as VelinTooltipWC,re as announce,At as applyHaptic,Wa as bindDeclarativeSearch,Dn as bootAttributes,Lu as bootFromDOM,ie as clearBackgroundInert,qc as createSafeHTML,Sn as createSearch,p as escapeHTML,fe as escapeHTMLAttribute,El as filterList,wl as flipReorder,je as getAnnouncer,ce as getFocusableElements,Ho as getTrustedPolicy,pt as highlightAll,ne as highlightElement,Ru as initA11y,we as initHighlight,Me as initMotion,Cu as initReveal,V as lazyDefine,Ae as lazyLoadLanguage,On as listRegisteredAttributes,ft as observeCodeBlocks,fl as register,S as registerAttribute,Ye as registerLanguage,Fa as registerSearchProvider,Ei as renderTokens,ee as restoreFocus,X as rovingTabindex,Ce as sanitizeURL,Q as saveFocus,te as setBackgroundInert,mr as stripControlChars,Y as trapFocus,cl as velinMotion,hu as velinSearch,ya as velinSyntax,$n as vibrate,Su as whenDefined};
|
|
1211
1211
|
/*! Bundled license information:
|
|
1212
1212
|
|
|
1213
1213
|
dompurify/dist/purify.es.mjs:
|