luxen-ui 0.20.0 → 0.21.1

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.
Files changed (43) hide show
  1. package/cdn/chunks/iconify-icon.js +1 -1
  2. package/cdn/custom-elements.json +70 -22
  3. package/cdn/elements/badge/badge.d.ts +36 -0
  4. package/cdn/elements/badge/badge.d.ts.map +1 -1
  5. package/cdn/elements/badge/badge.js.map +1 -1
  6. package/cdn/elements/icon/icon.d.ts +37 -0
  7. package/cdn/elements/icon/icon.d.ts.map +1 -1
  8. package/cdn/elements/icon/icon.js +2 -2
  9. package/cdn/elements/icon/icon.js.map +1 -1
  10. package/cdn/elements/select/select.js +1 -1
  11. package/cdn/elements/select/select.js.map +1 -1
  12. package/cdn/elements/tag/tag.d.ts +7 -7
  13. package/cdn/elements/tag/tag.js +1 -1
  14. package/cdn/elements/tag/tag.js.map +1 -1
  15. package/cdn/standalone.css +58 -8
  16. package/cdn/styles/elements/badge.css +58 -8
  17. package/cdn/translations/ko.d.ts +4 -0
  18. package/cdn/translations/ko.d.ts.map +1 -0
  19. package/cdn/translations/ko.js +2 -0
  20. package/cdn/translations/ko.js.map +1 -0
  21. package/dist/css/elements/badge.css +58 -8
  22. package/dist/custom-elements.json +70 -22
  23. package/dist/elements/badge/badge.d.ts +36 -0
  24. package/dist/elements/badge/badge.d.ts.map +1 -1
  25. package/dist/elements/badge/badge.js +36 -0
  26. package/dist/elements/icon/icon.d.ts +37 -1
  27. package/dist/elements/icon/icon.d.ts.map +1 -1
  28. package/dist/elements/icon/icon.js +59 -1
  29. package/dist/elements/select/select.css +10 -9
  30. package/dist/elements/tag/tag.css +9 -9
  31. package/dist/elements/tag/tag.d.ts +7 -7
  32. package/dist/elements/tag/tag.js +7 -7
  33. package/dist/metadata/badge.json +29 -2
  34. package/dist/metadata/index.json +50 -23
  35. package/dist/metadata/tag.json +20 -20
  36. package/dist/templates/elements/badge.md +90 -0
  37. package/dist/templates/elements/icon.md +33 -0
  38. package/dist/templates/elements/tag.md +19 -15
  39. package/dist/translations/ko.d.ts +4 -0
  40. package/dist/translations/ko.d.ts.map +1 -0
  41. package/dist/translations/ko.js +51 -0
  42. package/package.json +1 -1
  43. package/templates/choosing-elements.md.tpl +8 -4
@@ -1,2 +1,2 @@
1
- var e=Object.freeze({left:0,top:0,width:16,height:16}),t=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),n=Object.freeze({...e,...t}),r=Object.freeze({...n,body:``,hidden:!1}),i=Object.freeze({width:null,height:null}),a=Object.freeze({...i,...t});function o(e,t=0){let n=e.replace(/^-?[0-9.]*/,``);function r(e){for(;e<0;)e+=4;return e%4}if(n===``){let t=parseInt(e);return isNaN(t)?0:r(t)}else if(n!==e){let t=0;switch(n){case`%`:t=25;break;case`deg`:t=90}if(t){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=t,i%1==0?r(i):0)}}return t}var s=/[\s,]+/;function c(e,t){t.split(s).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0;break}})}var l={...a,preserveAspectRatio:``};function u(e){let t={...l},n=(t,n)=>e.getAttribute(t)||n;return t.width=n(`width`,null),t.height=n(`height`,null),t.rotate=o(n(`rotate`,``)),c(t,n(`flip`,``)),t.preserveAspectRatio=n(`preserveAspectRatio`,n(`preserveaspectratio`,``)),t}function d(e,t){for(let n in l)if(e[n]!==t[n])return!0;return!1}var f=/^[a-z0-9]+(-[a-z0-9]+)*$/,p=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!m(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!m(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!m(e,n)?null:e}return null},m=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1;function h(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return Object.keys(n).concat(Object.keys(r)).forEach(a),i}function g(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function _(e,n){let i=g(e,n);for(let a in r)a in t?a in e&&!(a in i)&&(i[a]=t[a]):a in n?i[a]=n[a]:a in e&&(i[a]=e[a]);return i}function v(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=_(r[e]||i[e],a)}return o(t),n.forEach(o),_(e,a)}function y(e,t){let n=[];if(typeof e!=`object`||typeof e.icons!=`object`)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});let r=h(e);for(let i in r){let a=r[i];a&&(t(i,v(e,i,a)),n.push(i))}return n}var b={provider:``,aliases:{},not_found:{},...e};function x(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function ee(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!x(e,b))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!x(t,r))return null}let i=t.aliases||Object.create(null);for(let e in i){let t=i[e],a=t.parent;if(!e||typeof a!=`string`||!n[a]&&!i[a]||!x(t,r))return null}return t}var S=Object.create(null);function te(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function C(e,t){let n=S[e]||(S[e]=Object.create(null));return n[t]||(n[t]=te(e,t))}function w(e,t){return ee(t)?y(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function ne(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}function re(e,t){let n=[];return(typeof e==`string`?[e]:Object.keys(S)).forEach(e=>{(typeof e==`string`&&typeof t==`string`?[t]:Object.keys(S[e]||{})).forEach(t=>{let r=C(e,t);n=n.concat(Object.keys(r.icons).map(n=>(e===``?``:`@`+e+`:`)+t+`:`+n))})}),n}var T=!1;function E(e){return typeof e==`boolean`&&(T=e),T}function D(e){let t=typeof e==`string`?p(e,!0,T):e;if(t){let e=C(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function ie(e,t){let n=p(e,!0,T);if(!n)return!1;let r=C(n.provider,n.prefix);return t?ne(r,n.name,t):(r.missing.add(n.name),!0)}function O(e,t){if(typeof e!=`object`)return!1;if(typeof t!=`string`&&(t=e.provider||``),T&&!t&&!e.prefix){let t=!1;return ee(e)&&(e.prefix=``,y(e,(e,n)=>{ie(e,n)&&(t=!0)})),t}let n=e.prefix;return m({prefix:n,name:`a`})?!!w(C(t,n),e):!1}function ae(e){return!!D(e)}function oe(e){let t=D(e);return t&&{...n,...t}}function k(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function se(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,r=e.provider,i=e.prefix;t.forEach(t=>{let a=t.icons,o=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==i)return!0;let o=t.name;if(e.icons[o])a.loaded.push({provider:r,prefix:i,name:o});else if(e.missing.has(o))a.missing.push({provider:r,prefix:i,name:o});else return n=!0,!0;return!1}),a.pending.length!==o&&(n||k([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var ce=0;function le(e,t,n){let r=ce++,i=k.bind(null,n,r);if(!t.pending.length)return i;let a={id:r,icons:t,callback:e,abort:i};return n.forEach(e=>{(e.loaderCallbacks||=[]).push(a)}),i}function ue(e){let t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider===t.provider?e.prefix===t.prefix?e.name.localeCompare(t.name):e.prefix.localeCompare(t.prefix):e.provider.localeCompare(t.provider));let r={provider:``,prefix:``,name:``};return e.forEach(e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;let i=e.provider,a=e.prefix,o=e.name,s=n[i]||(n[i]=Object.create(null)),c=s[a]||(s[a]=C(i,a)),l;l=o in c.icons?t.loaded:a===``||c.missing.has(o)?t.missing:t.pending;let u={provider:i,prefix:a,name:o};l.push(u)}),t}var A=Object.create(null);function de(e,t){A[e]=t}function j(e){return A[e]||A[``]}function fe(e,t=!0,n=!1){let r=[];return e.forEach(e=>{let i=typeof e==`string`?p(e,t,n):e;i&&r.push(i)}),r}function M(e){let t;if(typeof e.resources==`string`)t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||`/`,maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}for(var N=Object.create(null),P=[`https://api.simplesvg.com`,`https://api.unisvg.com`],F=[];P.length>0;)P.length===1||Math.random()>.5?F.push(P.shift()):F.push(P.pop());N[``]=M({resources:[`https://api.iconify.design`].concat(F)});function pe(e,t){let n=M(t);return n===null?!1:(N[e]=n,!0)}function I(e){return N[e]}function me(){return Object.keys(N)}var he={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function ge(e,t,n,r){let i=e.resources.length,a=e.random?Math.floor(Math.random()*i):e.index,o;if(e.random){let t=e.resources.slice(0);for(o=[];t.length>1;){let e=Math.floor(Math.random()*t.length);o.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}o=o.concat(t)}else o=e.resources.slice(a).concat(e.resources.slice(0,a));let s=Date.now(),c=`pending`,l=0,u,d=null,f=[],p=[];typeof r==`function`&&p.push(r);function m(){d&&=(clearTimeout(d),null)}function h(){c===`pending`&&(c=`aborted`),m(),f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function g(e,t){t&&(p=[]),typeof e==`function`&&p.push(e)}function _(){return{startTime:s,payload:t,status:c,queriesSent:l,queriesPending:f.length,subscribe:g,abort:h}}function v(){c=`failed`,p.forEach(e=>{e(void 0,u)})}function y(){f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function b(t,n,r){let i=n!==`success`;switch(f=f.filter(e=>e!==t),c){case`pending`:break;case`failed`:if(i||!e.dataAfterTimeout)return;break;default:return}if(n===`abort`){u=r,v();return}if(i){u=r,f.length||(o.length?x():v());return}if(m(),y(),!e.random){let n=e.resources.indexOf(t.resource);n!==-1&&n!==e.index&&(e.index=n)}c=`completed`,p.forEach(e=>{e(r)})}function x(){if(c!==`pending`)return;m();let r=o.shift();if(r===void 0){if(f.length){d=setTimeout(()=>{m(),c===`pending`&&(y(),v())},e.timeout);return}v();return}let i={status:`pending`,resource:r,callback:(e,t)=>{b(i,e,t)}};f.push(i),l++,d=setTimeout(x,e.rotate),n(r,t,i.callback)}return setTimeout(x),_}function _e(e){let t={...he,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=ge(t,e,i,(e,t)=>{r(),a&&a(e,t)});return n.push(o),o}function a(e){return n.find(t=>e(t))||null}return{query:i,find:a,setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:r}}function ve(){}var L=Object.create(null);function ye(e){if(!L[e]){let t=I(e);if(!t)return;L[e]={config:t,redundancy:_e(t)}}return L[e]}function be(e,t,n){let r,i;if(typeof e==`string`){let t=j(e);if(!t)return n(void 0,424),ve;i=t.send;let a=ye(e);a&&(r=a.redundancy)}else{let t=M(e);if(t){r=_e(t);let n=j(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),ve):r.query(t,i,n)().abort}function R(){}function xe(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,se(e)}))}function Se(e){let t=[],n=[];return e.forEach(e=>{(e.match(f)?t:n).push(e)}),{valid:t,invalid:n}}function z(e,t,n){function r(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&typeof n==`object`)try{if(!w(e,n).length){r();return}}catch(e){console.error(e)}r(),xe(e)}function B(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function Ce(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;let{provider:t,prefix:n}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;let i=e.loadIcon;if(e.loadIcons&&(r.length>1||!i)){B(e.loadIcons(r,n,t),t=>{z(e,r,t)});return}if(i){r.forEach(r=>{B(i(r,n,t),t=>{z(e,[r],t?{prefix:n,icons:{[r]:t}}:null)})});return}let{valid:a,invalid:o}=Se(r);if(o.length&&z(e,o,null),!a.length)return;let s=n.match(f)?j(t):null;if(!s){z(e,a,null);return}s.prepare(t,n,a).forEach(n=>{be(t,n,t=>{z(e,n.icons,t)})})}))}var V=(e,t)=>{let n=ue(fe(e,!0,E()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,R)}),()=>{e=!1}}let r=Object.create(null),i=[],a,o;return n.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===o&&t===a)return;a=t,o=n,i.push(C(t,n));let s=r[t]||(r[t]=Object.create(null));s[n]||(s[n]=[])}),n.pending.forEach(e=>{let{provider:t,prefix:n,name:i}=e,a=C(t,n),o=a.pendingIcons||=new Set;o.has(i)||(o.add(i),r[t][n].push(i))}),i.forEach(e=>{let t=r[e.provider][e.prefix];t.length&&Ce(e,t)}),t?le(t,n,i):R},we=e=>new Promise((t,r)=>{let i=typeof e==`string`?p(e,!0):e;if(!i){r(e);return}V([i||e],a=>{if(a.length&&i){let e=D(i);if(e){t({...n,...e});return}}r(e)})});function H(e){try{let t=typeof e==`string`?JSON.parse(e):e;if(typeof t.body==`string`)return{...t}}catch{}}function Te(e,t){if(typeof e==`object`)return{data:H(e),value:e};if(typeof e!=`string`)return{value:e};if(e.includes(`{`)){let t=H(e);if(t)return{data:t,value:e}}let n=p(e,!0,!0);if(!n)return{value:e};let r=D(n);return r!==void 0||!n.prefix?{value:e,name:n,data:r}:{value:e,name:n,loading:V([n],()=>t(e,n,D(n)))}}var U=!1;try{U=navigator.vendor.indexOf(`Apple`)===0}catch{}function Ee(e,t){switch(t){case`svg`:case`bg`:case`mask`:return t}return t!==`style`&&(U||e.indexOf(`<a`)===-1)?`svg`:e.indexOf(`currentColor`)===-1?`bg`:`mask`}var De=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Oe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function W(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(De);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=Oe.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function ke(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function Ae(e,t){return e?`<defs>`+e+`</defs>`+t:t}function je(e,t,n){let r=ke(e);return Ae(r.defs,t+r.content+n)}var Me=e=>e===`unset`||e===`undefined`||e===`none`;function G(e,t){let r={...n,...e},i={...a,...t},o={left:r.left,top:r.top,width:r.width,height:r.height},s=r.body;[r,i].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,i=e.rotate;n?r?i+=2:(t.push(`translate(`+(o.width+o.left).toString()+` `+(0-o.top).toString()+`)`),t.push(`scale(-1 1)`),o.top=o.left=0):r&&(t.push(`translate(`+(0-o.left).toString()+` `+(o.height+o.top).toString()+`)`),t.push(`scale(1 -1)`),o.top=o.left=0);let a;switch(i<0&&(i-=Math.floor(i/4)*4),i%=4,i){case 1:a=o.height/2+o.top,t.unshift(`rotate(90 `+a.toString()+` `+a.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(o.width/2+o.left).toString()+` `+(o.height/2+o.top).toString()+`)`);break;case 3:a=o.width/2+o.left,t.unshift(`rotate(-90 `+a.toString()+` `+a.toString()+`)`);break}i%2==1&&(o.left!==o.top&&(a=o.left,o.left=o.top,o.top=a),o.width!==o.height&&(a=o.width,o.width=o.height,o.height=a)),t.length&&(s=je(s,`<g transform="`+t.join(` `)+`">`,`</g>`))});let c=i.width,l=i.height,u=o.width,d=o.height,f,p;c===null?(p=l===null?`1em`:l===`auto`?d:l,f=W(p,u/d)):(f=c===`auto`?u:c,p=l===null?W(f,d/u):l===`auto`?d:l);let m={},h=(e,t)=>{Me(t)||(m[e]=t.toString())};h(`width`,f),h(`height`,p);let g=[o.left,o.top,u,d];return m.viewBox=g.join(` `),{attributes:m,viewBox:g,body:s}}function K(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function Ne(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function Pe(e){return`data:image/svg+xml,`+Ne(e)}function q(e){return`url("`+Pe(e)+`")`}var J=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function Fe(e){J=e}function Ie(){return J}function Le(e,t){let n=I(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let e=0;n.resources.forEach(t=>{e=Math.max(e,t.length)});let i=t+`.json?icons=`;r=n.maxURL-e-n.path.length-i.length}return r}function Re(e){return e===404}var ze=(e,t,n)=>{let r=[],i=Le(e,t),a=`icons`,o={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,c)=>{s+=n.length+1,s>=i&&c>0&&(r.push(o),o={type:a,provider:e,prefix:t,icons:[]},s=n.length),o.icons.push(n)}),r.push(o),r};function Be(e){if(typeof e==`string`){let t=I(e);if(t)return t.path}return`/`}var Ve={prepare:ze,send:(e,t,n)=>{if(!J){n(`abort`,424);return}let r=Be(t.provider);switch(t.type){case`icons`:{let e=t.prefix,n=t.icons.join(`,`),i=new URLSearchParams({icons:n});r+=e+`.json?`+i.toString();break}case`custom`:{let e=t.uri;r+=e.slice(0,1)===`/`?e.slice(1):e;break}default:n(`abort`,400);return}let i=503;J(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(Re(t)?`abort`:`next`,t)});return}return i=501,e.json()}).then(e=>{if(typeof e!=`object`||!e){setTimeout(()=>{e===404?n(`abort`,e):n(`next`,i)});return}setTimeout(()=>{n(`success`,e)})}).catch(()=>{n(`next`,i)})}};function He(e,t,n){C(n||``,t).loadIcons=e}function Ue(e,t,n){C(n||``,t).loadIcon=e}var Y=`data-style`,We=``;function Ge(e){We=e}function Ke(e,t){let n=Array.from(e.childNodes).find(e=>e.hasAttribute&&e.hasAttribute(Y));n||(n=document.createElement(`style`),n.setAttribute(Y,Y),e.appendChild(n)),n.textContent=`:host{display:inline-block;vertical-align:`+(t?`-0.125em`:`0`)+`}span,svg{display:block;margin:auto}`+We}function X(){de(``,Ve),E(!0);let e;try{e=window}catch{}if(e){if(e.IconifyPreload!==void 0){let t=e.IconifyPreload,n=`Invalid IconifyPreload syntax.`;typeof t==`object`&&t&&(t instanceof Array?t:[t]).forEach(e=>{try{(typeof e!=`object`||!e||e instanceof Array||typeof e.icons!=`object`||typeof e.prefix!=`string`||!O(e))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){let t=e.IconifyProviders;if(typeof t==`object`&&t)for(let e in t){let n=`IconifyProviders[`+e+`] is invalid.`;try{let r=t[e];if(typeof r!=`object`||!r||r.resources===void 0)continue;pe(e,r)||console.error(n)}catch{console.error(n)}}}}return{iconLoaded:ae,getIcon:oe,listIcons:re,addIcon:ie,addCollection:O,calculateSize:W,buildIcon:G,iconToHTML:K,svgToURL:q,loadIcons:V,loadIcon:we,addAPIProvider:pe,setCustomIconLoader:Ue,setCustomIconsLoader:He,appendCustomStyle:Ge,_api:{getAPIConfig:I,setAPIModule:de,sendAPIQuery:be,setFetch:Fe,getFetch:Ie,listAPIProviders:me}}}var Z={"background-color":`currentColor`},qe={"background-color":`transparent`},Je={image:`var(--svg)`,repeat:`no-repeat`,size:`100% 100%`},Ye={"-webkit-mask":Z,mask:Z,background:qe};for(let e in Ye){let t=Ye[e];for(let n in Je)t[e+`-`+n]=Je[n]}function Xe(e){return e?e+(e.match(/^[-0-9.]+$/)?`px`:``):`inherit`}function Ze(e,t,n){let r=document.createElement(`span`),i=e.body;i.indexOf(`<a`)!==-1&&(i+=`<!-- `+Date.now()+` -->`);let a=e.attributes,o=q(K(i,{...a,width:t.width+``,height:t.height+``})),s=r.style,c={"--svg":o,width:Xe(a.width),height:Xe(a.height),...n?Z:qe};for(let e in c)s.setProperty(e,c[e]);return r}var Q;function Qe(){try{Q=window.trustedTypes.createPolicy(`iconify`,{createHTML:e=>e})}catch{Q=null}}function $e(e){return Q===void 0&&Qe(),Q?Q.createHTML(e):e}function et(e){let t=document.createElement(`span`),n=e.attributes,r=``;return n.width||(r=`width: inherit;`),n.height||(r+=`height: inherit;`),r&&(n.style=r),t.innerHTML=$e(K(e.body,n)),t.firstChild}function $(e){return Array.from(e.childNodes).find(e=>{let t=e.tagName&&e.tagName.toUpperCase();return t===`SPAN`||t===`SVG`})}function tt(e,t){let r=t.icon.data,i=t.customisations,a=G(r,i);i.preserveAspectRatio&&(a.attributes.preserveAspectRatio=i.preserveAspectRatio);let o=t.renderedMode,s;switch(o){case`svg`:s=et(a);break;default:s=Ze(a,{...n,...r},o===`mask`)}let c=$(e);c?s.tagName===`SPAN`&&c.tagName===s.tagName?c.setAttribute(`style`,s.getAttribute(`style`)):e.replaceChild(s,c):e.appendChild(s)}function nt(e,t,n){return{rendered:!1,inline:t,icon:e,lastRender:n&&(n.rendered?n:n.lastRender)}}function rt(e=`iconify-icon`){let t,n;try{t=window.customElements,n=window.HTMLElement}catch{return}if(!t||!n)return;let r=t.get(e);if(r)return r;let i=[`icon`,`mode`,`inline`,`noobserver`,`width`,`height`,`rotate`,`flip`],a=class extends n{_shadowRoot;_initialised=!1;_state;_checkQueued=!1;_connected=!1;_observer=null;_visible=!0;constructor(){super();let e=this._shadowRoot=this.attachShadow({mode:`open`}),t=this.hasAttribute(`inline`);Ke(e,t),this._state=nt({value:``},t),this._queueCheck()}connectedCallback(){this._connected=!0,this.startObserver()}disconnectedCallback(){this._connected=!1,this.stopObserver()}static get observedAttributes(){return i.slice(0)}attributeChangedCallback(e){switch(e){case`inline`:{let e=this.hasAttribute(`inline`),t=this._state;e!==t.inline&&(t.inline=e,Ke(this._shadowRoot,e));break}case`noobserver`:this.hasAttribute(`noobserver`)?this.startObserver():this.stopObserver();break;default:this._queueCheck()}}get icon(){let e=this.getAttribute(`icon`);if(e&&e.slice(0,1)===`{`)try{return JSON.parse(e)}catch{}return e}set icon(e){typeof e==`object`&&(e=JSON.stringify(e)),this.setAttribute(`icon`,e)}get inline(){return this.hasAttribute(`inline`)}set inline(e){e?this.setAttribute(`inline`,`true`):this.removeAttribute(`inline`)}get observer(){return this.hasAttribute(`observer`)}set observer(e){e?this.setAttribute(`observer`,`true`):this.removeAttribute(`observer`)}restartAnimation(){let e=this._state;if(e.rendered){let t=this._shadowRoot;if(e.renderedMode===`svg`)try{t.lastChild.setCurrentTime(0);return}catch{}tt(t,e)}}get status(){let e=this._state;return e.rendered?`rendered`:e.icon.data===null?`failed`:`loading`}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;let e=this._state,t=this.getAttribute(`icon`);if(t!==e.icon.value){this._iconChanged(t);return}if(!e.rendered||!this._visible)return;let n=this.getAttribute(`mode`),r=u(this);(e.attrMode!==n||d(e.customisations,r)||!$(this._shadowRoot))&&this._renderIcon(e.icon,r,n)}_iconChanged(e){let t=Te(e,(e,t,n)=>{let r=this._state;if(r.rendered||this.getAttribute(`icon`)!==e)return;let i={value:e,name:t,data:n};i.data?this._gotIconData(i):r.icon=i});t.data?this._gotIconData(t):this._state=nt(t,this._state.inline,this._state)}_forceRender(){if(!this._visible){let e=$(this._shadowRoot);e&&this._shadowRoot.removeChild(e);return}this._queueCheck()}_gotIconData(e){this._checkQueued=!1,this._renderIcon(e,u(this),this.getAttribute(`mode`))}_renderIcon(e,t,n){let r=Ee(e.data.body,n),i=this._state.inline;tt(this._shadowRoot,this._state={rendered:!0,icon:e,inline:i,customisations:t,attrMode:n,renderedMode:r})}startObserver(){if(!this._observer&&!this.hasAttribute(`noobserver`))try{this._observer=new IntersectionObserver(e=>{let t=e.some(e=>e.isIntersecting);t!==this._visible&&(this._visible=t,this._forceRender())}),this._observer.observe(this)}catch{if(this._observer){try{this._observer.disconnect()}catch{}this._observer=null}}}stopObserver(){this._observer&&(this._observer.disconnect(),this._observer=null,this._visible=!0,this._connected&&this._forceRender())}};i.forEach(e=>{e in a.prototype||Object.defineProperty(a.prototype,e,{get:function(){return this.getAttribute(e)},set:function(t){t===null?this.removeAttribute(e):this.setAttribute(e,t)}})});let o=X();for(let e in o)a[e]=a.prototype[e]=o[e];return t.define(e,a),a}var{iconLoaded:it,getIcon:at,listIcons:ot,addIcon:st,addCollection:ct,calculateSize:lt,buildIcon:ut,iconToHTML:dt,svgToURL:ft,loadIcons:pt,loadIcon:mt,setCustomIconLoader:ht,setCustomIconsLoader:gt,addAPIProvider:_t,_api:vt}=rt()||X();
1
+ var e=Object.freeze({left:0,top:0,width:16,height:16}),t=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),n=Object.freeze({...e,...t}),r=Object.freeze({...n,body:``,hidden:!1}),i=Object.freeze({width:null,height:null}),a=Object.freeze({...i,...t});function o(e,t=0){let n=e.replace(/^-?[0-9.]*/,``);function r(e){for(;e<0;)e+=4;return e%4}if(n===``){let t=parseInt(e);return isNaN(t)?0:r(t)}else if(n!==e){let t=0;switch(n){case`%`:t=25;break;case`deg`:t=90}if(t){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=t,i%1==0?r(i):0)}}return t}var s=/[\s,]+/;function c(e,t){t.split(s).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0;break}})}var l={...a,preserveAspectRatio:``};function u(e){let t={...l},n=(t,n)=>e.getAttribute(t)||n;return t.width=n(`width`,null),t.height=n(`height`,null),t.rotate=o(n(`rotate`,``)),c(t,n(`flip`,``)),t.preserveAspectRatio=n(`preserveAspectRatio`,n(`preserveaspectratio`,``)),t}function d(e,t){for(let n in l)if(e[n]!==t[n])return!0;return!1}var f=/^[a-z0-9]+(-[a-z0-9]+)*$/,p=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!m(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!m(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!m(e,n)?null:e}return null},m=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1;function h(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return Object.keys(n).concat(Object.keys(r)).forEach(a),i}function g(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function _(e,n){let i=g(e,n);for(let a in r)a in t?a in e&&!(a in i)&&(i[a]=t[a]):a in n?i[a]=n[a]:a in e&&(i[a]=e[a]);return i}function v(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=_(r[e]||i[e],a)}return o(t),n.forEach(o),_(e,a)}function y(e,t){let n=[];if(typeof e!=`object`||typeof e.icons!=`object`)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});let r=h(e);for(let i in r){let a=r[i];a&&(t(i,v(e,i,a)),n.push(i))}return n}var b={provider:``,aliases:{},not_found:{},...e};function x(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function ee(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!x(e,b))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!x(t,r))return null}let i=t.aliases||Object.create(null);for(let e in i){let t=i[e],a=t.parent;if(!e||typeof a!=`string`||!n[a]&&!i[a]||!x(t,r))return null}return t}var S=Object.create(null);function te(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function C(e,t){let n=S[e]||(S[e]=Object.create(null));return n[t]||(n[t]=te(e,t))}function w(e,t){return ee(t)?y(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function ne(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}function re(e,t){let n=[];return(typeof e==`string`?[e]:Object.keys(S)).forEach(e=>{(typeof e==`string`&&typeof t==`string`?[t]:Object.keys(S[e]||{})).forEach(t=>{let r=C(e,t);n=n.concat(Object.keys(r.icons).map(n=>(e===``?``:`@`+e+`:`)+t+`:`+n))})}),n}var T=!1;function E(e){return typeof e==`boolean`&&(T=e),T}function D(e){let t=typeof e==`string`?p(e,!0,T):e;if(t){let e=C(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function ie(e,t){let n=p(e,!0,T);if(!n)return!1;let r=C(n.provider,n.prefix);return t?ne(r,n.name,t):(r.missing.add(n.name),!0)}function O(e,t){if(typeof e!=`object`)return!1;if(typeof t!=`string`&&(t=e.provider||``),T&&!t&&!e.prefix){let t=!1;return ee(e)&&(e.prefix=``,y(e,(e,n)=>{ie(e,n)&&(t=!0)})),t}let n=e.prefix;return m({prefix:n,name:`a`})?!!w(C(t,n),e):!1}function ae(e){return!!D(e)}function oe(e){let t=D(e);return t&&{...n,...t}}function k(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function se(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,r=e.provider,i=e.prefix;t.forEach(t=>{let a=t.icons,o=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==i)return!0;let o=t.name;if(e.icons[o])a.loaded.push({provider:r,prefix:i,name:o});else if(e.missing.has(o))a.missing.push({provider:r,prefix:i,name:o});else return n=!0,!0;return!1}),a.pending.length!==o&&(n||k([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var ce=0;function le(e,t,n){let r=ce++,i=k.bind(null,n,r);if(!t.pending.length)return i;let a={id:r,icons:t,callback:e,abort:i};return n.forEach(e=>{(e.loaderCallbacks||=[]).push(a)}),i}function ue(e){let t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider===t.provider?e.prefix===t.prefix?e.name.localeCompare(t.name):e.prefix.localeCompare(t.prefix):e.provider.localeCompare(t.provider));let r={provider:``,prefix:``,name:``};return e.forEach(e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;let i=e.provider,a=e.prefix,o=e.name,s=n[i]||(n[i]=Object.create(null)),c=s[a]||(s[a]=C(i,a)),l;l=o in c.icons?t.loaded:a===``||c.missing.has(o)?t.missing:t.pending;let u={provider:i,prefix:a,name:o};l.push(u)}),t}var A=Object.create(null);function de(e,t){A[e]=t}function j(e){return A[e]||A[``]}function fe(e,t=!0,n=!1){let r=[];return e.forEach(e=>{let i=typeof e==`string`?p(e,t,n):e;i&&r.push(i)}),r}function M(e){let t;if(typeof e.resources==`string`)t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||`/`,maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}for(var N=Object.create(null),P=[`https://api.simplesvg.com`,`https://api.unisvg.com`],F=[];P.length>0;)P.length===1||Math.random()>.5?F.push(P.shift()):F.push(P.pop());N[``]=M({resources:[`https://api.iconify.design`].concat(F)});function pe(e,t){let n=M(t);return n===null?!1:(N[e]=n,!0)}function I(e){return N[e]}function me(){return Object.keys(N)}var he={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function ge(e,t,n,r){let i=e.resources.length,a=e.random?Math.floor(Math.random()*i):e.index,o;if(e.random){let t=e.resources.slice(0);for(o=[];t.length>1;){let e=Math.floor(Math.random()*t.length);o.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}o=o.concat(t)}else o=e.resources.slice(a).concat(e.resources.slice(0,a));let s=Date.now(),c=`pending`,l=0,u,d=null,f=[],p=[];typeof r==`function`&&p.push(r);function m(){d&&=(clearTimeout(d),null)}function h(){c===`pending`&&(c=`aborted`),m(),f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function g(e,t){t&&(p=[]),typeof e==`function`&&p.push(e)}function _(){return{startTime:s,payload:t,status:c,queriesSent:l,queriesPending:f.length,subscribe:g,abort:h}}function v(){c=`failed`,p.forEach(e=>{e(void 0,u)})}function y(){f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function b(t,n,r){let i=n!==`success`;switch(f=f.filter(e=>e!==t),c){case`pending`:break;case`failed`:if(i||!e.dataAfterTimeout)return;break;default:return}if(n===`abort`){u=r,v();return}if(i){u=r,f.length||(o.length?x():v());return}if(m(),y(),!e.random){let n=e.resources.indexOf(t.resource);n!==-1&&n!==e.index&&(e.index=n)}c=`completed`,p.forEach(e=>{e(r)})}function x(){if(c!==`pending`)return;m();let r=o.shift();if(r===void 0){if(f.length){d=setTimeout(()=>{m(),c===`pending`&&(y(),v())},e.timeout);return}v();return}let i={status:`pending`,resource:r,callback:(e,t)=>{b(i,e,t)}};f.push(i),l++,d=setTimeout(x,e.rotate),n(r,t,i.callback)}return setTimeout(x),_}function _e(e){let t={...he,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=ge(t,e,i,(e,t)=>{r(),a&&a(e,t)});return n.push(o),o}function a(e){return n.find(t=>e(t))||null}return{query:i,find:a,setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:r}}function ve(){}var L=Object.create(null);function ye(e){if(!L[e]){let t=I(e);if(!t)return;L[e]={config:t,redundancy:_e(t)}}return L[e]}function be(e,t,n){let r,i;if(typeof e==`string`){let t=j(e);if(!t)return n(void 0,424),ve;i=t.send;let a=ye(e);a&&(r=a.redundancy)}else{let t=M(e);if(t){r=_e(t);let n=j(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),ve):r.query(t,i,n)().abort}function R(){}function xe(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,se(e)}))}function Se(e){let t=[],n=[];return e.forEach(e=>{(e.match(f)?t:n).push(e)}),{valid:t,invalid:n}}function z(e,t,n){function r(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&typeof n==`object`)try{if(!w(e,n).length){r();return}}catch(e){console.error(e)}r(),xe(e)}function B(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function Ce(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;let{provider:t,prefix:n}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;let i=e.loadIcon;if(e.loadIcons&&(r.length>1||!i)){B(e.loadIcons(r,n,t),t=>{z(e,r,t)});return}if(i){r.forEach(r=>{B(i(r,n,t),t=>{z(e,[r],t?{prefix:n,icons:{[r]:t}}:null)})});return}let{valid:a,invalid:o}=Se(r);if(o.length&&z(e,o,null),!a.length)return;let s=n.match(f)?j(t):null;if(!s){z(e,a,null);return}s.prepare(t,n,a).forEach(n=>{be(t,n,t=>{z(e,n.icons,t)})})}))}var V=(e,t)=>{let n=ue(fe(e,!0,E()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,R)}),()=>{e=!1}}let r=Object.create(null),i=[],a,o;return n.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===o&&t===a)return;a=t,o=n,i.push(C(t,n));let s=r[t]||(r[t]=Object.create(null));s[n]||(s[n]=[])}),n.pending.forEach(e=>{let{provider:t,prefix:n,name:i}=e,a=C(t,n),o=a.pendingIcons||=new Set;o.has(i)||(o.add(i),r[t][n].push(i))}),i.forEach(e=>{let t=r[e.provider][e.prefix];t.length&&Ce(e,t)}),t?le(t,n,i):R},we=e=>new Promise((t,r)=>{let i=typeof e==`string`?p(e,!0):e;if(!i){r(e);return}V([i||e],a=>{if(a.length&&i){let e=D(i);if(e){t({...n,...e});return}}r(e)})});function H(e){try{let t=typeof e==`string`?JSON.parse(e):e;if(typeof t.body==`string`)return{...t}}catch{}}function Te(e,t){if(typeof e==`object`)return{data:H(e),value:e};if(typeof e!=`string`)return{value:e};if(e.includes(`{`)){let t=H(e);if(t)return{data:t,value:e}}let n=p(e,!0,!0);if(!n)return{value:e};let r=D(n);return r!==void 0||!n.prefix?{value:e,name:n,data:r}:{value:e,name:n,loading:V([n],()=>t(e,n,D(n)))}}var U=!1;try{U=navigator.vendor.indexOf(`Apple`)===0}catch{}function Ee(e,t){switch(t){case`svg`:case`bg`:case`mask`:return t}return t!==`style`&&(U||e.indexOf(`<a`)===-1)?`svg`:e.indexOf(`currentColor`)===-1?`bg`:`mask`}var De=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Oe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function W(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(De);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=Oe.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function ke(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function Ae(e,t){return e?`<defs>`+e+`</defs>`+t:t}function je(e,t,n){let r=ke(e);return Ae(r.defs,t+r.content+n)}var Me=e=>e===`unset`||e===`undefined`||e===`none`;function G(e,t){let r={...n,...e},i={...a,...t},o={left:r.left,top:r.top,width:r.width,height:r.height},s=r.body;[r,i].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,i=e.rotate;n?r?i+=2:(t.push(`translate(`+(o.width+o.left).toString()+` `+(0-o.top).toString()+`)`),t.push(`scale(-1 1)`),o.top=o.left=0):r&&(t.push(`translate(`+(0-o.left).toString()+` `+(o.height+o.top).toString()+`)`),t.push(`scale(1 -1)`),o.top=o.left=0);let a;switch(i<0&&(i-=Math.floor(i/4)*4),i%=4,i){case 1:a=o.height/2+o.top,t.unshift(`rotate(90 `+a.toString()+` `+a.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(o.width/2+o.left).toString()+` `+(o.height/2+o.top).toString()+`)`);break;case 3:a=o.width/2+o.left,t.unshift(`rotate(-90 `+a.toString()+` `+a.toString()+`)`);break}i%2==1&&(o.left!==o.top&&(a=o.left,o.left=o.top,o.top=a),o.width!==o.height&&(a=o.width,o.width=o.height,o.height=a)),t.length&&(s=je(s,`<g transform="`+t.join(` `)+`">`,`</g>`))});let c=i.width,l=i.height,u=o.width,d=o.height,f,p;c===null?(p=l===null?`1em`:l===`auto`?d:l,f=W(p,u/d)):(f=c===`auto`?u:c,p=l===null?W(f,d/u):l===`auto`?d:l);let m={},h=(e,t)=>{Me(t)||(m[e]=t.toString())};h(`width`,f),h(`height`,p);let g=[o.left,o.top,u,d];return m.viewBox=g.join(` `),{attributes:m,viewBox:g,body:s}}function K(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function Ne(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function Pe(e){return`data:image/svg+xml,`+Ne(e)}function q(e){return`url("`+Pe(e)+`")`}var J=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function Fe(e){J=e}function Ie(){return J}function Le(e,t){let n=I(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let e=0;n.resources.forEach(t=>{e=Math.max(e,t.length)});let i=t+`.json?icons=`;r=n.maxURL-e-n.path.length-i.length}return r}function Re(e){return e===404}var ze=(e,t,n)=>{let r=[],i=Le(e,t),a=`icons`,o={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,c)=>{s+=n.length+1,s>=i&&c>0&&(r.push(o),o={type:a,provider:e,prefix:t,icons:[]},s=n.length),o.icons.push(n)}),r.push(o),r};function Be(e){if(typeof e==`string`){let t=I(e);if(t)return t.path}return`/`}var Ve={prepare:ze,send:(e,t,n)=>{if(!J){n(`abort`,424);return}let r=Be(t.provider);switch(t.type){case`icons`:{let e=t.prefix,n=t.icons.join(`,`),i=new URLSearchParams({icons:n});r+=e+`.json?`+i.toString();break}case`custom`:{let e=t.uri;r+=e.slice(0,1)===`/`?e.slice(1):e;break}default:n(`abort`,400);return}let i=503;J(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(Re(t)?`abort`:`next`,t)});return}return i=501,e.json()}).then(e=>{if(typeof e!=`object`||!e){setTimeout(()=>{e===404?n(`abort`,e):n(`next`,i)});return}setTimeout(()=>{n(`success`,e)})}).catch(()=>{n(`next`,i)})}};function He(e,t,n){C(n||``,t).loadIcons=e}function Ue(e,t,n){C(n||``,t).loadIcon=e}var Y=`data-style`,We=``;function Ge(e){We=e}function Ke(e,t){let n=Array.from(e.childNodes).find(e=>e.hasAttribute&&e.hasAttribute(Y));n||(n=document.createElement(`style`),n.setAttribute(Y,Y),e.appendChild(n)),n.textContent=`:host{display:inline-block;vertical-align:`+(t?`-0.125em`:`0`)+`}span,svg{display:block;margin:auto}`+We}function X(){de(``,Ve),E(!0);let e;try{e=window}catch{}if(e){if(e.IconifyPreload!==void 0){let t=e.IconifyPreload,n=`Invalid IconifyPreload syntax.`;typeof t==`object`&&t&&(t instanceof Array?t:[t]).forEach(e=>{try{(typeof e!=`object`||!e||e instanceof Array||typeof e.icons!=`object`||typeof e.prefix!=`string`||!O(e))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){let t=e.IconifyProviders;if(typeof t==`object`&&t)for(let e in t){let n=`IconifyProviders[`+e+`] is invalid.`;try{let r=t[e];if(typeof r!=`object`||!r||r.resources===void 0)continue;pe(e,r)||console.error(n)}catch{console.error(n)}}}}return{iconLoaded:ae,getIcon:oe,listIcons:re,addIcon:ie,addCollection:O,calculateSize:W,buildIcon:G,iconToHTML:K,svgToURL:q,loadIcons:V,loadIcon:we,addAPIProvider:pe,setCustomIconLoader:Ue,setCustomIconsLoader:He,appendCustomStyle:Ge,_api:{getAPIConfig:I,setAPIModule:de,sendAPIQuery:be,setFetch:Fe,getFetch:Ie,listAPIProviders:me}}}var Z={"background-color":`currentColor`},qe={"background-color":`transparent`},Je={image:`var(--svg)`,repeat:`no-repeat`,size:`100% 100%`},Ye={"-webkit-mask":Z,mask:Z,background:qe};for(let e in Ye){let t=Ye[e];for(let n in Je)t[e+`-`+n]=Je[n]}function Xe(e){return e?e+(e.match(/^[-0-9.]+$/)?`px`:``):`inherit`}function Ze(e,t,n){let r=document.createElement(`span`),i=e.body;i.indexOf(`<a`)!==-1&&(i+=`<!-- `+Date.now()+` -->`);let a=e.attributes,o=q(K(i,{...a,width:t.width+``,height:t.height+``})),s=r.style,c={"--svg":o,width:Xe(a.width),height:Xe(a.height),...n?Z:qe};for(let e in c)s.setProperty(e,c[e]);return r}var Q;function Qe(){try{Q=window.trustedTypes.createPolicy(`iconify`,{createHTML:e=>e})}catch{Q=null}}function $e(e){return Q===void 0&&Qe(),Q?Q.createHTML(e):e}function et(e){let t=document.createElement(`span`),n=e.attributes,r=``;return n.width||(r=`width: inherit;`),n.height||(r+=`height: inherit;`),r&&(n.style=r),t.innerHTML=$e(K(e.body,n)),t.firstChild}function $(e){return Array.from(e.childNodes).find(e=>{let t=e.tagName&&e.tagName.toUpperCase();return t===`SPAN`||t===`SVG`})}function tt(e,t){let r=t.icon.data,i=t.customisations,a=G(r,i);i.preserveAspectRatio&&(a.attributes.preserveAspectRatio=i.preserveAspectRatio);let o=t.renderedMode,s;switch(o){case`svg`:s=et(a);break;default:s=Ze(a,{...n,...r},o===`mask`)}let c=$(e);c?s.tagName===`SPAN`&&c.tagName===s.tagName?c.setAttribute(`style`,s.getAttribute(`style`)):e.replaceChild(s,c):e.appendChild(s)}function nt(e,t,n){return{rendered:!1,inline:t,icon:e,lastRender:n&&(n.rendered?n:n.lastRender)}}function rt(e=`iconify-icon`){let t,n;try{t=window.customElements,n=window.HTMLElement}catch{return}if(!t||!n)return;let r=t.get(e);if(r)return r;let i=[`icon`,`mode`,`inline`,`noobserver`,`width`,`height`,`rotate`,`flip`],a=class extends n{_shadowRoot;_initialised=!1;_state;_checkQueued=!1;_connected=!1;_observer=null;_visible=!0;constructor(){super();let e=this._shadowRoot=this.attachShadow({mode:`open`}),t=this.hasAttribute(`inline`);Ke(e,t),this._state=nt({value:``},t),this._queueCheck()}connectedCallback(){this._connected=!0,this.startObserver()}disconnectedCallback(){this._connected=!1,this.stopObserver()}static get observedAttributes(){return i.slice(0)}attributeChangedCallback(e){switch(e){case`inline`:{let e=this.hasAttribute(`inline`),t=this._state;e!==t.inline&&(t.inline=e,Ke(this._shadowRoot,e));break}case`noobserver`:this.hasAttribute(`noobserver`)?this.startObserver():this.stopObserver();break;default:this._queueCheck()}}get icon(){let e=this.getAttribute(`icon`);if(e&&e.slice(0,1)===`{`)try{return JSON.parse(e)}catch{}return e}set icon(e){typeof e==`object`&&(e=JSON.stringify(e)),this.setAttribute(`icon`,e)}get inline(){return this.hasAttribute(`inline`)}set inline(e){e?this.setAttribute(`inline`,`true`):this.removeAttribute(`inline`)}get observer(){return this.hasAttribute(`observer`)}set observer(e){e?this.setAttribute(`observer`,`true`):this.removeAttribute(`observer`)}restartAnimation(){let e=this._state;if(e.rendered){let t=this._shadowRoot;if(e.renderedMode===`svg`)try{t.lastChild.setCurrentTime(0);return}catch{}tt(t,e)}}get status(){let e=this._state;return e.rendered?`rendered`:e.icon.data===null?`failed`:`loading`}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;let e=this._state,t=this.getAttribute(`icon`);if(t!==e.icon.value){this._iconChanged(t);return}if(!e.rendered||!this._visible)return;let n=this.getAttribute(`mode`),r=u(this);(e.attrMode!==n||d(e.customisations,r)||!$(this._shadowRoot))&&this._renderIcon(e.icon,r,n)}_iconChanged(e){let t=Te(e,(e,t,n)=>{let r=this._state;if(r.rendered||this.getAttribute(`icon`)!==e)return;let i={value:e,name:t,data:n};i.data?this._gotIconData(i):r.icon=i});t.data?this._gotIconData(t):this._state=nt(t,this._state.inline,this._state)}_forceRender(){if(!this._visible){let e=$(this._shadowRoot);e&&this._shadowRoot.removeChild(e);return}this._queueCheck()}_gotIconData(e){this._checkQueued=!1,this._renderIcon(e,u(this),this.getAttribute(`mode`))}_renderIcon(e,t,n){let r=Ee(e.data.body,n),i=this._state.inline;tt(this._shadowRoot,this._state={rendered:!0,icon:e,inline:i,customisations:t,attrMode:n,renderedMode:r})}startObserver(){if(!this._observer&&!this.hasAttribute(`noobserver`))try{this._observer=new IntersectionObserver(e=>{let t=e.some(e=>e.isIntersecting);t!==this._visible&&(this._visible=t,this._forceRender())}),this._observer.observe(this)}catch{if(this._observer){try{this._observer.disconnect()}catch{}this._observer=null}}}stopObserver(){this._observer&&(this._observer.disconnect(),this._observer=null,this._visible=!0,this._connected&&this._forceRender())}};i.forEach(e=>{e in a.prototype||Object.defineProperty(a.prototype,e,{get:function(){return this.getAttribute(e)},set:function(t){t===null?this.removeAttribute(e):this.setAttribute(e,t)}})});let o=X();for(let e in o)a[e]=a.prototype[e]=o[e];return t.define(e,a),a}var{iconLoaded:it,getIcon:at,listIcons:ot,addIcon:st,addCollection:ct,calculateSize:lt,buildIcon:ut,iconToHTML:dt,svgToURL:ft,loadIcons:pt,loadIcon:mt,setCustomIconLoader:ht,setCustomIconsLoader:gt,addAPIProvider:_t,_api:vt}=rt()||X();export{mt as t};
2
2
  //# sourceMappingURL=iconify-icon.js.map
@@ -833,8 +833,26 @@
833
833
  "declarations": [
834
834
  {
835
835
  "kind": "class",
836
- "description": "",
836
+ "description": "A small, non-interactive label for a status, a count, or a category. Light\nDOM and pure CSS, so a badge renders correctly before — or without — its\nscript.\n\n`variant` is the interface-state axis and stays the library's: `info`,\n`success`, `warning`, `danger`. When the colour instead says *what kind of\nthing* this is — a site, a department, an asset class — give the badge your\nown class and set the hooks below. They win over `variant`, `appearance` and\n`pill` rather than competing with them, so a tinted badge keeps its tint\nthrough an appearance change.\n\n```css\nl-badge.chip-site {\n --text-color: var(--brand-site-ink);\n --background-color: var(--brand-site-soft);\n}\n```\n\nSize stays on the `size` attribute — there is no hook for height, label size\nor padding, and none is wanted: three steps are the design, not a default to\ndial past.",
837
837
  "name": "Badge",
838
+ "cssProperties": [
839
+ {
840
+ "description": "Label color. The border is a tint of it, so this alone repaints an outlined badge. Defaults to the `variant` step.",
841
+ "name": "--text-color"
842
+ },
843
+ {
844
+ "description": "Badge fill. Defaults to the `appearance` step — transparent when outlined.",
845
+ "name": "--background-color"
846
+ },
847
+ {
848
+ "description": "Badge border. Defaults to a 30% tint of `--text-color`; setting it replaces that derivation and holds through `appearance=\"filled\"`, whose default line is transparent.",
849
+ "name": "--border-color"
850
+ },
851
+ {
852
+ "description": "Corner radius. The corner stays a squircle; `pill` is what trades it for a true arc. Defaults to `--l-radius-md`.",
853
+ "name": "--border-radius"
854
+ }
855
+ ],
838
856
  "members": [
839
857
  {
840
858
  "kind": "field",
@@ -919,7 +937,13 @@
919
937
  },
920
938
  "tagName": "l-badge",
921
939
  "customElement": true,
922
- "summary": "A badge component for displaying small status indicators."
940
+ "summary": "A badge component for displaying small status indicators.",
941
+ "examples": [
942
+ {
943
+ "language": "html",
944
+ "code": "<l-badge variant=\"success\">Active</l-badge>\n<l-badge class=\"chip-site\">\n <l-icon name=\"mdi:map-marker-outline\"></l-icon>\n Lyon branch\n</l-badge>"
945
+ }
946
+ ]
923
947
  }
924
948
  ],
925
949
  "exports": [
@@ -4340,6 +4364,30 @@
4340
4364
  }
4341
4365
  ],
4342
4366
  "exports": [
4367
+ {
4368
+ "kind": "js",
4369
+ "name": "addCollection",
4370
+ "declaration": {
4371
+ "name": "addCollection",
4372
+ "package": "iconify-icon"
4373
+ }
4374
+ },
4375
+ {
4376
+ "kind": "js",
4377
+ "name": "addIcon",
4378
+ "declaration": {
4379
+ "name": "addIcon",
4380
+ "package": "iconify-icon"
4381
+ }
4382
+ },
4383
+ {
4384
+ "kind": "js",
4385
+ "name": "setCustomIconLoader",
4386
+ "declaration": {
4387
+ "name": "setCustomIconLoader",
4388
+ "package": "iconify-icon"
4389
+ }
4390
+ },
4343
4391
  {
4344
4392
  "kind": "js",
4345
4393
  "name": "Icon",
@@ -8986,44 +9034,44 @@
8986
9034
  "name": "Tag",
8987
9035
  "cssProperties": [
8988
9036
  {
8989
- "description": "Corner radius. Defaults to a full pill.",
8990
- "name": "--border-radius"
9037
+ "description": "Label color.",
9038
+ "name": "--text-color"
8991
9039
  },
8992
9040
  {
8993
- "description": "Chip height. Defaults to the `size` step (a selectable chip is taller, to keep a comfortable target).",
8994
- "name": "--height"
9041
+ "description": "Chip fill.",
9042
+ "name": "--background-color"
8995
9043
  },
8996
9044
  {
8997
- "description": "Label size. Defaults to the `size` step — 12px, or 14px at `size=\"lg\"`. Set it with `--height` to land between the two steps in a dense filter panel.",
8998
- "name": "--font-size"
9045
+ "description": "Chip border, and the rule that splits off the remove button. Defaults to a tint of `--text-color`; setting it pins the line in every state, so a token-based theme keeps its own value on hover.",
9046
+ "name": "--border-color"
8999
9047
  },
9000
9048
  {
9001
- "description": "Horizontal padding. Defaults to the `size` step.",
9002
- "name": "--padding-inline"
9049
+ "description": "Label, border, and checkbox accent when selected. Defaults to the library's form-control accent, lightened in dark mode.",
9050
+ "name": "--selected-text-color"
9003
9051
  },
9004
9052
  {
9005
- "description": "Chip background.",
9006
- "name": "--background"
9053
+ "description": "Chip fill when selected. Defaults to a tint of `--selected-text-color`.",
9054
+ "name": "--selected-background-color"
9007
9055
  },
9008
9056
  {
9009
- "description": "Text color.",
9010
- "name": "--color"
9057
+ "description": "Chip border when selected. Defaults to a 45% tint of `--selected-text-color`. Selection replaces the line the same way it replaces the fill and the ink, so a chip themed with `--border-color` still gets its emphasis step; set this to theme that step too.",
9058
+ "name": "--selected-border-color"
9011
9059
  },
9012
9060
  {
9013
- "description": "Chip border, and the rule that splits off the remove button. Defaults to a tint of `--color`; setting it pins the line in every state, so a token-based theme keeps its own value on hover.",
9014
- "name": "--border-color"
9061
+ "description": "Chip height. Defaults to the `size` step (a selectable chip is taller, to keep a comfortable target).",
9062
+ "name": "--height"
9015
9063
  },
9016
9064
  {
9017
- "description": "Text, border, and checkbox accent when selected. Defaults to the library's form-control accent, lightened in dark mode.",
9018
- "name": "--selected-color"
9065
+ "description": "Label size. Defaults to the `size` step — 12px, or 14px at `size=\"lg\"`. Set it with `--height` to land between the two steps in a dense filter panel.",
9066
+ "name": "--font-size"
9019
9067
  },
9020
9068
  {
9021
- "description": "Chip background when selected. Defaults to a tint of `--selected-color`.",
9022
- "name": "--selected-background"
9069
+ "description": "Horizontal padding. Defaults to the `size` step.",
9070
+ "name": "--padding-inline"
9023
9071
  },
9024
9072
  {
9025
- "description": "Chip border when selected. Defaults to a 45% tint of `--selected-color`. Selection replaces the line the same way it replaces the fill and the ink, so a chip themed with `--border-color` still gets its emphasis step; set this to theme that step too.",
9026
- "name": "--selected-border-color"
9073
+ "description": "Corner radius. Defaults to a full pill.",
9074
+ "name": "--border-radius"
9027
9075
  }
9028
9076
  ],
9029
9077
  "cssParts": [
@@ -3,8 +3,44 @@ export type BadgeVariant = 'info' | 'success' | 'warning' | 'danger' | 'neutral'
3
3
  export type BadgeSize = 'sm' | 'md' | 'lg';
4
4
  export type BadgeAppearance = 'outlined' | 'filled' | 'filled-outlined' | 'accent';
5
5
  /**
6
+ * A small, non-interactive label for a status, a count, or a category. Light
7
+ * DOM and pure CSS, so a badge renders correctly before — or without — its
8
+ * script.
9
+ *
10
+ * `variant` is the interface-state axis and stays the library's: `info`,
11
+ * `success`, `warning`, `danger`. When the colour instead says *what kind of
12
+ * thing* this is — a site, a department, an asset class — give the badge your
13
+ * own class and set the hooks below. They win over `variant`, `appearance` and
14
+ * `pill` rather than competing with them, so a tinted badge keeps its tint
15
+ * through an appearance change.
16
+ *
17
+ * ```css
18
+ * l-badge.chip-site {
19
+ * --text-color: var(--brand-site-ink);
20
+ * --background-color: var(--brand-site-soft);
21
+ * }
22
+ * ```
23
+ *
24
+ * Size stays on the `size` attribute — there is no hook for height, label size
25
+ * or padding, and none is wanted: three steps are the design, not a default to
26
+ * dial past.
27
+ *
6
28
  * @summary A badge component for displaying small status indicators.
7
29
  * @customElement l-badge
30
+ *
31
+ * @example
32
+ * ```html
33
+ * <l-badge variant="success">Active</l-badge>
34
+ * <l-badge class="chip-site">
35
+ * <l-icon name="mdi:map-marker-outline"></l-icon>
36
+ * Lyon branch
37
+ * </l-badge>
38
+ * ```
39
+ *
40
+ * @cssproperty [--text-color] - Label color. The border is a tint of it, so this alone repaints an outlined badge. Defaults to the `variant` step.
41
+ * @cssproperty [--background-color] - Badge fill. Defaults to the `appearance` step — transparent when outlined.
42
+ * @cssproperty [--border-color] - Badge border. Defaults to a 30% tint of `--text-color`; setting it replaces that derivation and holds through `appearance="filled"`, whose default line is transparent.
43
+ * @cssproperty [--border-radius] - Corner radius. The corner stays a squircle; `pill` is what trades it for a true arc. Defaults to `--l-radius-md`.
8
44
  */
9
45
  export declare class Badge extends LuxenElement {
10
46
  createRenderRoot(): this;
@@ -1 +1 @@
1
- {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/html/elements/badge/badge.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AACjF,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC3C,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,QAAQ,GAAG,iBAAiB,GAAG,QAAQ,CAAC;AAEnF;;;GAGG;AACH,qBAAa,KAAM,SAAQ,YAAY;IAC5B,gBAAgB;IAIzB,oFAAoF;IACvD,OAAO,CAAC,EAAE,YAAY,CAAC;IAEpD,4BAA4B;IACgB,IAAI,UAAS;IAEzD,6CAA6C;IAChB,IAAI,CAAC,EAAE,SAAS,CAAC;IAE9C,qFAAqF;IACxD,UAAU,CAAC,EAAE,eAAe,CAAC;CAC3D"}
1
+ {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/html/elements/badge/badge.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AACjF,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC3C,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,QAAQ,GAAG,iBAAiB,GAAG,QAAQ,CAAC;AAEnF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,qBAAa,KAAM,SAAQ,YAAY;IAC5B,gBAAgB;IAIzB,oFAAoF;IACvD,OAAO,CAAC,EAAE,YAAY,CAAC;IAEpD,4BAA4B;IACgB,IAAI,UAAS;IAEzD,6CAA6C;IAChB,IAAI,CAAC,EAAE,SAAS,CAAC;IAE9C,qFAAqF;IACxD,UAAU,CAAC,EAAE,eAAe,CAAC;CAC3D"}
@@ -1 +1 @@
1
- {"version":3,"file":"badge.js","names":[],"sources":["../../../src/html/elements/badge/badge.ts"],"sourcesContent":["import { property } from 'lit/decorators.js';\nimport { LuxenElement } from '../../shared/luxen-element.js';\n\nexport type BadgeVariant = 'info' | 'success' | 'warning' | 'danger' | 'neutral';\nexport type BadgeSize = 'sm' | 'md' | 'lg';\nexport type BadgeAppearance = 'outlined' | 'filled' | 'filled-outlined' | 'accent';\n\n/**\n * @summary A badge component for displaying small status indicators.\n * @customElement l-badge\n */\nexport class Badge extends LuxenElement {\n override createRenderRoot() {\n return this;\n }\n\n /** Style variant: `info`, `success`, `warning`, `danger`, or `neutral` (default) */\n @property({ reflect: true }) variant?: BadgeVariant;\n\n /** Display as pill shape */\n @property({ type: Boolean, reflect: true }) pill = false;\n\n /** Badge size: `sm`, `lg`. Default is md. */\n @property({ reflect: true }) size?: BadgeSize;\n\n /** Visual appearance: `filled`, `filled-outlined`, `accent`. Default is outlined. */\n @property({ reflect: true }) appearance?: BadgeAppearance;\n}\n"],"mappings":"4GAWA,IAAa,EAAb,cAA2B,CAAa,yCASa,GARnD,kBAA4B,CAC1B,OAAO,IACT,CAaF,KAVG,EAAS,CAAE,QAAS,EAAK,CAAC,CAAA,EAAA,EAAA,UAAA,UAAA,IAAA,EAAA,KAG1B,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,CAAA,EAAA,EAAA,UAAA,OAAA,IAAA,EAAA,KAGzC,EAAS,CAAE,QAAS,EAAK,CAAC,CAAA,EAAA,EAAA,UAAA,OAAA,IAAA,EAAA,KAG1B,EAAS,CAAE,QAAS,EAAK,CAAC,CAAA,EAAA,EAAA,UAAA,aAAA,IAAA,EAAA"}
1
+ {"version":3,"file":"badge.js","names":[],"sources":["../../../src/html/elements/badge/badge.ts"],"sourcesContent":["import { property } from 'lit/decorators.js';\nimport { LuxenElement } from '../../shared/luxen-element.js';\n\nexport type BadgeVariant = 'info' | 'success' | 'warning' | 'danger' | 'neutral';\nexport type BadgeSize = 'sm' | 'md' | 'lg';\nexport type BadgeAppearance = 'outlined' | 'filled' | 'filled-outlined' | 'accent';\n\n/**\n * A small, non-interactive label for a status, a count, or a category. Light\n * DOM and pure CSS, so a badge renders correctly before — or without — its\n * script.\n *\n * `variant` is the interface-state axis and stays the library's: `info`,\n * `success`, `warning`, `danger`. When the colour instead says *what kind of\n * thing* this is — a site, a department, an asset class — give the badge your\n * own class and set the hooks below. They win over `variant`, `appearance` and\n * `pill` rather than competing with them, so a tinted badge keeps its tint\n * through an appearance change.\n *\n * ```css\n * l-badge.chip-site {\n * --text-color: var(--brand-site-ink);\n * --background-color: var(--brand-site-soft);\n * }\n * ```\n *\n * Size stays on the `size` attribute — there is no hook for height, label size\n * or padding, and none is wanted: three steps are the design, not a default to\n * dial past.\n *\n * @summary A badge component for displaying small status indicators.\n * @customElement l-badge\n *\n * @example\n * ```html\n * <l-badge variant=\"success\">Active</l-badge>\n * <l-badge class=\"chip-site\">\n * <l-icon name=\"mdi:map-marker-outline\"></l-icon>\n * Lyon branch\n * </l-badge>\n * ```\n *\n * @cssproperty [--text-color] - Label color. The border is a tint of it, so this alone repaints an outlined badge. Defaults to the `variant` step.\n * @cssproperty [--background-color] - Badge fill. Defaults to the `appearance` step — transparent when outlined.\n * @cssproperty [--border-color] - Badge border. Defaults to a 30% tint of `--text-color`; setting it replaces that derivation and holds through `appearance=\"filled\"`, whose default line is transparent.\n * @cssproperty [--border-radius] - Corner radius. The corner stays a squircle; `pill` is what trades it for a true arc. Defaults to `--l-radius-md`.\n */\nexport class Badge extends LuxenElement {\n override createRenderRoot() {\n return this;\n }\n\n /** Style variant: `info`, `success`, `warning`, `danger`, or `neutral` (default) */\n @property({ reflect: true }) variant?: BadgeVariant;\n\n /** Display as pill shape */\n @property({ type: Boolean, reflect: true }) pill = false;\n\n /** Badge size: `sm`, `lg`. Default is md. */\n @property({ reflect: true }) size?: BadgeSize;\n\n /** Visual appearance: `filled`, `filled-outlined`, `accent`. Default is outlined. */\n @property({ reflect: true }) appearance?: BadgeAppearance;\n}\n"],"mappings":"4GA+CA,IAAa,EAAb,cAA2B,CAAa,yCASa,GARnD,kBAA4B,CAC1B,OAAO,IACT,CAaF,KAVG,EAAS,CAAE,QAAS,EAAK,CAAC,CAAA,EAAA,EAAA,UAAA,UAAA,IAAA,EAAA,KAG1B,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,CAAA,EAAA,EAAA,UAAA,OAAA,IAAA,EAAA,KAGzC,EAAS,CAAE,QAAS,EAAK,CAAC,CAAA,EAAA,EAAA,UAAA,OAAA,IAAA,EAAA,KAG1B,EAAS,CAAE,QAAS,EAAK,CAAC,CAAA,EAAA,EAAA,UAAA,aAAA,IAAA,EAAA"}
@@ -1,5 +1,30 @@
1
1
  import { PropertyValues } from 'lit';
2
2
  import { LuxenElement } from '../../shared/luxen-element.js';
3
+ /**
4
+ * Icon storage lives in the `iconify-icon` module, and every copy of that
5
+ * module has its own. `@iconify/vue`, `@iconify/react` and friends each bundle
6
+ * a separate one, so a collection registered through them is invisible here —
7
+ * the icon simply renders nothing, at zero width, with no error.
8
+ *
9
+ * Re-exported so the registration API a consumer needs is the *same instance*
10
+ * this element reads from, whatever the package manager did with two
11
+ * `iconify-icon` ranges:
12
+ *
13
+ * ```js
14
+ * import { addCollection } from 'luxen-ui/icon';
15
+ * addCollection(myIconSet); // before the first icon mounts — see below
16
+ * ```
17
+ *
18
+ * Registration is a plain write to storage: it does not re-render icons that
19
+ * are already on the page, and a name the API has already reported missing is
20
+ * not retried. Register before the first icon mounts.
21
+ *
22
+ * This reaches the npm build only. The CDN build inlines `iconify-icon` and
23
+ * tree-shakes the re-export out of the entry, so a CDN consumer registers
24
+ * through `window.IconifyPreload` instead — read once, at module init, so the
25
+ * assignment has to come before the script tag.
26
+ */
27
+ export { addCollection, addIcon, setCustomIconLoader } from 'iconify-icon';
3
28
  /**
4
29
  * @summary An icon component that renders icons from any Iconify icon set. Decorative by default. Set `label` for meaningful icons.
5
30
  * @customElement l-icon
@@ -12,6 +37,18 @@ export declare class Icon extends LuxenElement {
12
37
  name: string;
13
38
  /** Accessible label. When set, the icon becomes meaningful (`role="img"` + `aria-label`). When absent, the icon is decorative. */
14
39
  label?: string;
40
+ /**
41
+ * An unresolved name is otherwise completely silent: `iconify-icon` renders
42
+ * no `<svg>`, the box collapses to 0px, and the API answers a well-formed
43
+ * "not found" — so there is no console error and no failed request to
44
+ * notice either. A criteria bar can ship with every icon invisible and look
45
+ * merely tight. Say it once per name.
46
+ *
47
+ * `loadIcon()` resolves from storage when the icon is already there and
48
+ * otherwise joins the request the element itself makes, so this costs no
49
+ * extra network.
50
+ */
51
+ private _warnIfUnresolved;
15
52
  updated(changedProperties: PropertyValues<this>): void;
16
53
  render(): import('lit').TemplateResult<1>;
17
54
  }
@@ -1 +1 @@
1
- {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/html/elements/icon/icon.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAG1C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAM7D;;;;;GAKG;AACH,qBAAa,IAAK,SAAQ,YAAY;IACpC,OAAgB,MAAM,4BAAwB;IAE9C,yEAAyE;IAEzE,IAAI,SAAM;IAEV,kIAAkI;IAElI,KAAK,CAAC,EAAE,MAAM,CAAC;IAEN,OAAO,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC;IAY/C,MAAM;CAQhB"}
1
+ {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/html/elements/icon/icon.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAG1C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAI7D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAU3E;;;;;GAKG;AACH,qBAAa,IAAK,SAAQ,YAAY;IACpC,OAAgB,MAAM,4BAAwB;IAE9C,yEAAyE;IAEzE,IAAI,SAAM;IAEV,kIAAkI;IAElI,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;;;;;OAUG;IACH,OAAO,CAAC,iBAAiB;IAchB,OAAO,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC;IAc/C,MAAM;CAQhB"}
@@ -1,7 +1,7 @@
1
- import"../../chunks/iconify-icon.js";import{i as e}from"../../chunks/lit.js";import{i as t,t as n}from"../../chunks/decorate.js";import{a as r}from"../../chunks/lit-html.js";import{LuxenElement as i}from"../../shared/luxen-element.js";import a from"../../shared/styles/host.styles.js";var o=e(`:host{--color:currentColor;color:var(--color);display:contents}iconify-icon{color:inherit}`),s=class extends i{constructor(...e){super(...e),this.name=``}static{this.styles=[a,o]}updated(e){e.has(`label`)&&(this.label?(this.setAttribute(`role`,`img`),this.setAttribute(`aria-label`,this.label)):(this.removeAttribute(`role`),this.removeAttribute(`aria-label`)))}render(){return r`
1
+ import{t as e}from"../../chunks/iconify-icon.js";import{i as t}from"../../chunks/lit.js";import{i as n,t as r}from"../../chunks/decorate.js";import{a as i}from"../../chunks/lit-html.js";import{LuxenElement as a}from"../../shared/luxen-element.js";import o from"../../shared/styles/host.styles.js";var s=t(`:host{--color:currentColor;color:var(--color);display:contents}iconify-icon{color:inherit}`),c=new Set,l=class extends a{constructor(...e){super(...e),this.name=``}static{this.styles=[o,s]}_warnIfUnresolved(t){!t||c.has(t)||e(t).catch(()=>{c.has(t)||(c.add(t),console.warn(`<${this.localName}>: icon "${t}" could not be resolved. Icons outside the Iconify CDN must be registered with the addCollection() re-exported from this package — the one from a framework binding writes to a different store.`))})}updated(e){e.has(`name`)&&this._warnIfUnresolved(this.name),e.has(`label`)&&(this.label?(this.setAttribute(`role`,`img`),this.setAttribute(`aria-label`,this.label)):(this.removeAttribute(`role`),this.removeAttribute(`aria-label`)))}render(){return i`
2
2
  <iconify-icon
3
3
  icon=${this.name}
4
4
  aria-hidden="true"
5
5
  ></iconify-icon>
6
- `}};n([t()],s.prototype,`name`,void 0),n([t()],s.prototype,`label`,void 0);export{s as Icon};
6
+ `}};r([n()],l.prototype,`name`,void 0),r([n()],l.prototype,`label`,void 0);export{l as Icon};
7
7
  //# sourceMappingURL=icon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"icon.js","names":[],"sources":["../../../src/html/elements/icon/icon.css?inline","../../../src/html/elements/icon/icon.ts"],"sourcesContent":[":host {\n --color: currentColor;\n\n display: contents;\n color: var(--color);\n}\n\niconify-icon {\n color: inherit;\n}\n","import 'iconify-icon';\nimport type { PropertyValues } from 'lit';\nimport { html, unsafeCSS } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { LuxenElement } from '../../shared/luxen-element.js';\nimport hostStyles from '../../shared/styles/host.styles.js';\nimport rawStyles from './icon.css?inline';\n\nconst styles = unsafeCSS(rawStyles);\n\n/**\n * @summary An icon component that renders icons from any Iconify icon set. Decorative by default. Set `label` for meaningful icons.\n * @customElement l-icon\n *\n * @cssproperty --color - The color of the icon. Defaults to `currentColor`.\n */\nexport class Icon extends LuxenElement {\n static override styles = [hostStyles, styles];\n\n /** The icon name in Iconify format (e.g. `mdi:home`, `lucide:check`). */\n @property()\n name = '';\n\n /** Accessible label. When set, the icon becomes meaningful (`role=\"img\"` + `aria-label`). When absent, the icon is decorative. */\n @property()\n label?: string;\n\n override updated(changedProperties: PropertyValues<this>) {\n if (changedProperties.has('label')) {\n if (this.label) {\n this.setAttribute('role', 'img');\n this.setAttribute('aria-label', this.label);\n } else {\n this.removeAttribute('role');\n this.removeAttribute('aria-label');\n }\n }\n }\n\n override render() {\n return html`\n <iconify-icon\n icon=${this.name}\n aria-hidden=\"true\"\n ></iconify-icon>\n `;\n }\n}\n"],"mappings":"6RCQA,IAAM,EAAS,EAAU,4FAAS,EAQrB,EAAb,cAA0B,CAAa,yCAK9B,sBAJkB,CAAC,EAAY,CAAM,EAU5C,QAAiB,EAAyC,CACpD,EAAkB,IAAI,OAAO,IAC3B,KAAK,OACP,KAAK,aAAa,OAAQ,KAAK,EAC/B,KAAK,aAAa,aAAc,KAAK,KAAK,IAE1C,KAAK,gBAAgB,MAAM,EAC3B,KAAK,gBAAgB,YAAY,GAGvC,CAEA,QAAkB,CAChB,MAAO,EAAI;;eAEA,KAAK,KAAK;;;KAIvB,CACF,KA3BG,EAAS,CAAA,EAAA,EAAA,UAAA,OAAA,IAAA,EAAA,KAIT,EAAS,CAAA,EAAA,EAAA,UAAA,QAAA,IAAA,EAAA"}
1
+ {"version":3,"file":"icon.js","names":[],"sources":["../../../src/html/elements/icon/icon.css?inline","../../../src/html/elements/icon/icon.ts"],"sourcesContent":[":host {\n --color: currentColor;\n\n display: contents;\n color: var(--color);\n}\n\niconify-icon {\n color: inherit;\n}\n","// Defines <iconify-icon> as a side effect, and gives us the storage lookup the\n// unresolved-name warning below needs.\nimport { loadIcon } from 'iconify-icon';\nimport type { PropertyValues } from 'lit';\nimport { html, unsafeCSS } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { LuxenElement } from '../../shared/luxen-element.js';\nimport hostStyles from '../../shared/styles/host.styles.js';\nimport rawStyles from './icon.css?inline';\n\n/**\n * Icon storage lives in the `iconify-icon` module, and every copy of that\n * module has its own. `@iconify/vue`, `@iconify/react` and friends each bundle\n * a separate one, so a collection registered through them is invisible here —\n * the icon simply renders nothing, at zero width, with no error.\n *\n * Re-exported so the registration API a consumer needs is the *same instance*\n * this element reads from, whatever the package manager did with two\n * `iconify-icon` ranges:\n *\n * ```js\n * import { addCollection } from 'luxen-ui/icon';\n * addCollection(myIconSet); // before the first icon mounts — see below\n * ```\n *\n * Registration is a plain write to storage: it does not re-render icons that\n * are already on the page, and a name the API has already reported missing is\n * not retried. Register before the first icon mounts.\n *\n * This reaches the npm build only. The CDN build inlines `iconify-icon` and\n * tree-shakes the re-export out of the entry, so a CDN consumer registers\n * through `window.IconifyPreload` instead — read once, at module init, so the\n * assignment has to come before the script tag.\n */\nexport { addCollection, addIcon, setCustomIconLoader } from 'iconify-icon';\n\nconst styles = unsafeCSS(rawStyles);\n\n/**\n * Names already reported, so a collection that is missing on a table of 200\n * rows costs one line and not two hundred.\n */\nconst warnedNames = new Set<string>();\n\n/**\n * @summary An icon component that renders icons from any Iconify icon set. Decorative by default. Set `label` for meaningful icons.\n * @customElement l-icon\n *\n * @cssproperty --color - The color of the icon. Defaults to `currentColor`.\n */\nexport class Icon extends LuxenElement {\n static override styles = [hostStyles, styles];\n\n /** The icon name in Iconify format (e.g. `mdi:home`, `lucide:check`). */\n @property()\n name = '';\n\n /** Accessible label. When set, the icon becomes meaningful (`role=\"img\"` + `aria-label`). When absent, the icon is decorative. */\n @property()\n label?: string;\n\n /**\n * An unresolved name is otherwise completely silent: `iconify-icon` renders\n * no `<svg>`, the box collapses to 0px, and the API answers a well-formed\n * \"not found\" — so there is no console error and no failed request to\n * notice either. A criteria bar can ship with every icon invisible and look\n * merely tight. Say it once per name.\n *\n * `loadIcon()` resolves from storage when the icon is already there and\n * otherwise joins the request the element itself makes, so this costs no\n * extra network.\n */\n private _warnIfUnresolved(name: string) {\n if (!name || warnedNames.has(name)) return;\n loadIcon(name).catch(() => {\n if (warnedNames.has(name)) return;\n warnedNames.add(name);\n // eslint-disable-next-line no-console\n console.warn(\n `<${this.localName}>: icon \"${name}\" could not be resolved. Icons outside the ` +\n `Iconify CDN must be registered with the addCollection() re-exported from ` +\n `this package — the one from a framework binding writes to a different store.`,\n );\n });\n }\n\n override updated(changedProperties: PropertyValues<this>) {\n if (changedProperties.has('name')) this._warnIfUnresolved(this.name);\n\n if (changedProperties.has('label')) {\n if (this.label) {\n this.setAttribute('role', 'img');\n this.setAttribute('aria-label', this.label);\n } else {\n this.removeAttribute('role');\n this.removeAttribute('aria-label');\n }\n }\n }\n\n override render() {\n return html`\n <iconify-icon\n icon=${this.name}\n aria-hidden=\"true\"\n ></iconify-icon>\n `;\n }\n}\n"],"mappings":"ySCoCA,IAAM,EAAS,EAAU,4FAAS,EAM5B,EAAc,IAAI,IAQX,EAAb,cAA0B,CAAa,yCAK9B,sBAJkB,CAAC,EAAY,CAAM,EAqB5C,kBAA0B,EAAc,CAClC,CAAC,GAAQ,EAAY,IAAI,CAAI,GACjC,EAAS,CAAI,CAAC,CAAC,UAAY,CACrB,EAAY,IAAI,CAAI,IACxB,EAAY,IAAI,CAAI,EAEpB,QAAQ,KACN,IAAI,KAAK,UAAU,WAAW,EAAK,iMAGrC,EACF,CAAC,CACH,CAEA,QAAiB,EAAyC,CACpD,EAAkB,IAAI,MAAM,GAAG,KAAK,kBAAkB,KAAK,IAAI,EAE/D,EAAkB,IAAI,OAAO,IAC3B,KAAK,OACP,KAAK,aAAa,OAAQ,KAAK,EAC/B,KAAK,aAAa,aAAc,KAAK,KAAK,IAE1C,KAAK,gBAAgB,MAAM,EAC3B,KAAK,gBAAgB,YAAY,GAGvC,CAEA,QAAkB,CAChB,MAAO,EAAI;;eAEA,KAAK,KAAK;;;KAIvB,CACF,KAtDG,EAAS,CAAA,EAAA,EAAA,UAAA,OAAA,IAAA,EAAA,KAIT,EAAS,CAAA,EAAA,EAAA,UAAA,QAAA,IAAA,EAAA"}
@@ -1,4 +1,4 @@
1
- import{cls as e,tagName as t,uniqueId as n}from"../../registry.js";import{i as r}from"../../chunks/lit.js";import{i,r as a,t as o}from"../../chunks/decorate.js";import{a as s,t as c}from"../../chunks/lit-html.js";import{LocalizeController as l}from"../../shared/localize.js";import{n as u,r as d}from"../../chunks/static-html.js";import f from"../../shared/styles/host.styles.js";import{t as p}from"../../chunks/unsafe-html.js";import{LuxenFormAssociatedElement as m}from"../../shared/luxen-form-associated-element.js";import{PopoverController as h}from"../../shared/controllers/popover.js";import{ListboxNavController as g}from"../../shared/controllers/listbox-nav.js";var _=r(`:host{--height:var(--l-form-control-height);--border-radius:var(--l-form-control-border-radius);--background:var(--l-color-surface-overlay);inline-size:100%;display:block}:host([size=xs]){--height:var(--l-size-control-xs)}:host([size=sm]){--height:var(--l-size-control-sm)}:host([size=lg]){--height:var(--l-size-control-lg)}:host([size=xl]){--height:var(--l-size-control-xl)}:host([disabled]){opacity:.5;pointer-events:none}.base{position:relative}.trigger{inline-size:100%;min-block-size:var(--height);padding-block:.25rem;padding-inline:var(--l-form-control-padding-inline);border:var(--l-form-control-border-width) solid var(--l-form-control-border-color);border-radius:var(--border-radius);background-color:var(--l-form-control-background-color);color:var(--l-form-control-value-color);font:inherit;text-align:start;cursor:pointer;align-items:center;gap:.5rem;display:flex}:host([multiple]) .trigger{padding-inline-start:.375rem}@media (hover:hover){.trigger:hover{border-color:var(--l-form-control-border-color-hover)}}.trigger:focus-visible{border-color:var(--l-focus-ring);box-shadow:0 0 0 3px color-mix(in oklab, var(--l-focus-ring) 22%, transparent);outline:none}.value{flex-wrap:wrap;flex:1;align-items:center;gap:.25rem;min-inline-size:0;display:flex;overflow:hidden}.value-text{text-overflow:ellipsis;white-space:nowrap;min-inline-size:0;overflow:hidden}[part=tag]{--height:initial;--border-radius:initial;--background:initial}.placeholder{color:var(--l-form-control-placeholder-color)}.chevron{block-size:1em;inline-size:1em;color:var(--l-form-control-placeholder-color);-webkit-mask:var(--_chevron-icon) center / contain no-repeat;mask:var(--_chevron-icon) center / contain no-repeat;background-color:currentColor;flex:none;transition:rotate .15s}.trigger[aria-expanded=true] .chevron{rotate:180deg}.clear{cursor:pointer;block-size:1.5rem;inline-size:1.5rem;color:var(--l-form-control-placeholder-color);-webkit-mask:var(--_x-icon) center / 1em no-repeat;mask:var(--_x-icon) center / 1em no-repeat;background-color:currentColor;border:0;margin-block:auto;padding:0;position:absolute;inset-block:0;inset-inline-end:calc(var(--l-form-control-padding-inline) + 1.25em)}@media (hover:hover){.clear:hover{color:var(--l-form-control-value-color)}}.clear:focus-visible{outline:2px solid var(--l-focus-ring);outline-offset:2px}.value .l-select-item-media{flex:none;align-items:center;font-size:1.25em;display:inline-flex}.value .l-select-item-text{flex-direction:column;min-inline-size:0;display:flex}.value .l-select-item-title{font-weight:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.value .l-select-item-description{display:none}.panel{border:1px solid var(--l-color-border-overlay);border-radius:var(--border-radius);background-color:var(--background);color:var(--l-color-text-primary);box-shadow:var(--l-shadow-md);opacity:0;transition:opacity .12s ease, scale .12s ease, display .12s allow-discrete, overlay .12s allow-discrete;margin:0;padding:0;font-size:.875rem;line-height:1.5;inset:auto;overflow:hidden;scale:.98}.panel:popover-open{opacity:1;scale:1}@starting-style{.panel:popover-open{opacity:0;scale:.98}}.search-row{border-block-end:1px solid var(--l-color-border-overlay);padding:.375rem}.search{inline-size:100%;block-size:var(--l-size-control-sm);border:var(--l-form-control-border-width) solid var(--l-form-control-border-color);border-radius:calc(var(--border-radius) - 2px);background-color:var(--l-form-control-background-color);color:var(--l-form-control-value-color);font:inherit;padding-inline:.5rem}.search:focus-visible{border-color:var(--l-focus-ring);outline:none}.search::placeholder{color:var(--l-form-control-placeholder-color)}.listbox{overscroll-behavior:contain;max-block-size:16rem;margin:0;padding:.25rem;list-style:none;overflow-y:auto}.option{min-block-size:36px;color:var(--l-color-text-primary);cursor:pointer;border-radius:4px;align-items:start;gap:.5rem;padding-block:.5rem;padding-inline:1.75rem .5rem;display:flex;position:relative}@media (hover:hover){.option:hover{background-color:var(--l-color-bg-state-hover)}}.option[data-active]{background-color:var(--l-color-bg-state-hover)}.option[aria-disabled=true]{opacity:.4;cursor:not-allowed}.option[data-current]:after{content:"";block-size:1.3125rem;inline-size:1rem;-webkit-mask:var(--_check-icon) center / 1rem no-repeat;mask:var(--_check-icon) center / 1rem no-repeat;background-color:currentColor;position:absolute;inset-block-start:.5rem;inset-inline-start:.5rem}.option-label{text-overflow:ellipsis;white-space:nowrap;flex:1;min-inline-size:0;overflow:hidden}.option-label mark{color:inherit;background:0 0;font-weight:600}.option-rich{flex:1;align-items:start;gap:.5rem;min-inline-size:0;display:flex}.option-rich .l-select-item-media{object-fit:cover;border-radius:4px;flex:none;align-items:center;block-size:1.5rem;inline-size:1.5rem;font-size:1.25em;display:inline-flex}.option-rich .l-select-item-text{flex-direction:column;flex:auto;min-inline-size:0;display:flex}.option-rich .l-select-item-title{text-overflow:ellipsis;white-space:nowrap;font-weight:600;overflow:hidden}.option-rich .l-select-item-description{color:var(--l-color-text-tertiary);white-space:normal;text-wrap:pretty;font-size:.75rem;line-height:1.3}.empty{color:var(--l-color-text-tertiary);text-align:center;padding:.5rem}.visually-hidden{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}:host{--_chevron-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");--_x-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E");--_check-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")}@media (prefers-reduced-motion:reduce){.panel,.chevron{transition-duration:0s}}`);function v(e){return e.normalize(`NFD`).replace(/[̀-ͯ]/g,``).toLowerCase()}var y=(e,t)=>{if(!t)return!0;let n=v(e.label);return v(t).split(/\s+/).filter(Boolean).every(e=>n.includes(e))},b=class extends Event{constructor(e){super(`change`,{bubbles:!0,composed:!1,cancelable:!1}),this.value=e}},x=class extends Event{constructor(e){super(`input`,{bubbles:!0,composed:!1,cancelable:!1}),this.value=e}},S=class extends m{constructor(...e){super(...e),this._localize=new l(this),this._listId=n(`select-list`),this._floating=new h(this,{getTriggerElement:()=>this._triggerEl,getFloatingElement:()=>this._panelEl,getArrowElement:()=>null}),this._nav=new g(this,{listboxId:this._listId,getCount:()=>this._filtered.length,isDisabled:e=>this._filtered[e]?.disabled??!1,isOpen:()=>this._open,open:()=>this.show(),getOptionElements:()=>this.shadowRoot?.querySelectorAll(`.option`)}),this.#e=``,this.#t=``,this.#n=`md`,this.#r=!1,this.#i=!1,this.#a=`bottom-start`,this.#o=!1,this.filter=y,this.#s=[],this.#c=!1,this.#l=``,this.#u=[],this._defaultValues=[],this._onDocumentPointerDown=e=>{e.composedPath().includes(this)||(this.hasInteracted=!0,this._updateValidity(),this.hide({focusTrigger:!1}))},this._onTriggerKeyDown=e=>{this._open||(e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.show())},this._onPanelKeyDown=e=>{if(!this._nav.onKeyDown(e))switch(e.key){case`Enter`:{e.preventDefault();let t=this._filtered[this._nav.activeIndex];t&&this._select(t);break}case`Escape`:e.preventDefault(),this.hide();break;case`Tab`:this.hide({focusTrigger:!1});break;default:break}},this._onSearchInput=e=>{this._query=e.target.value,this._nav.reset(),this.dispatchEvent(new x(this._query))}}static{this.styles=[f,_]}#e;get placeholder(){return this.#e}set placeholder(e){this.#e=e}#t;get label(){return this.#t}set label(e){this.#t=e}#n;get size(){return this.#n}set size(e){this.#n=e}#r;get searchable(){return this.#r}set searchable(e){this.#r=e}#i;get withClear(){return this.#i}set withClear(e){this.#i=e}#a;get placement(){return this.#a}set placement(e){this.#a=e}#o;get multiple(){return this.#o}set multiple(e){this.#o=e}#s;get _values(){return this.#s}set _values(e){this.#s=e}#c;get _open(){return this.#c}set _open(e){this.#c=e}#l;get _query(){return this.#l}set _query(e){this.#l=e}#u;get _items(){return this.#u}set _items(e){this.#u=e}get value(){return this.multiple?[...this._values]:this._values[0]??``}set value(e){this._values=Array.isArray(e)?[...e]:e?[e]:[]}get _triggerEl(){return this.shadowRoot?.querySelector(`.trigger`)??null}get _panelEl(){return this.shadowRoot?.querySelector(`.panel`)??null}get _searchEl(){return this.shadowRoot?.querySelector(`.search`)??null}get validationTarget(){return this._triggerEl??void 0}connectedCallback(){if(super.connectedCallback(),this._readItems(),this._values.length===0){let e=this.getAttribute(`value`);if(e)this._values=[e];else{let e=this._items.filter(e=>e.selected).map(e=>e.value);this._values=this.multiple?e:e.slice(0,1)}}this._defaultValues=[...this._values],this._syncForm()}updated(e){(e.has(`_values`)||e.has(`multiple`))&&(this._syncForm(),this._updateValidity())}formResetCallback(){this._values=[...this._defaultValues],this._query=``,this._nav.reset(),super.formResetCallback(),this._syncForm()}formStateRestoreCallback(e){this.value=e,this._syncForm()}_readItems(){let t=this.querySelector(`datalist`),n=t?Array.from(t.options):[];this._items=n.map(t=>{let n=t.childElementCount>0,r=t.querySelector(`.${e(`select-item-title`)}`)?.textContent?.trim(),i=(t.getAttribute(`label`)||r||t.textContent||t.value).trim();return{value:t.value,label:i,disabled:t.disabled,selected:t.hasAttribute(`selected`),html:n?t.innerHTML:void 0}})}_itemFor(e){return this._items.find(t=>t.value===e)}get _filtered(){return this._items.filter(e=>this.filter(e,this._query))}_syncForm(){if(this.multiple){let e=new FormData;for(let t of this._values)e.append(this.name,t);this._internals.setFormValue(e)}else this._internals.setFormValue(this._values[0]??``)}_updateValidity(){this.required&&this._values.length===0?this.setValidity({valueMissing:!0},this._localize.term(`selectOption`),this._triggerEl??void 0):this.setValidity({})}show(){this._open||this.disabled||(this._readItems(),this.dispatchEvent(new Event(`show`,{cancelable:!0}))&&(this._open=!0,this._query=``,this._values.length&&this._nav.setActive(this._filtered.findIndex(e=>e.value===this._values[0])),this.updateComplete.then(()=>{this._panelEl?.showPopover?.(),this._floating.startPositioning({placement:this.placement,distance:4,minWidth:`trigger`}),(this._searchEl??this._panelEl?.querySelector(`.listbox`))?.focus(),document.addEventListener(`pointerdown`,this._onDocumentPointerDown,!0)})))}hide({focusTrigger:e=!0}={}){if(!this._open||!this.dispatchEvent(new Event(`hide`,{cancelable:!0})))return;this._open=!1,this._query=``,this._nav.reset();let t=this._panelEl;t?.matches?.(`:popover-open`)&&t.hidePopover?.(),this._floating.stopPositioning(),document.removeEventListener(`pointerdown`,this._onDocumentPointerDown,!0),e&&this._triggerEl?.focus()}_select(e){e.disabled||(this.hasInteracted=!0,this.multiple?(this._values=this._values.includes(e.value)?this._values.filter(t=>t!==e.value):[...this._values,e.value],this.dispatchEvent(new b(this.value)),this._searchEl?.focus()):(this._values=[e.value],this.dispatchEvent(new b(this.value)),this.hide()))}_removeValue(e){this._values=this._values.filter(t=>t!==e),this.hasInteracted=!0,this.dispatchEvent(new b(this.value))}_clear(e){e?.stopPropagation(),this._values=[],this.hasInteracted=!0,this.dispatchEvent(new b(this.value)),this._triggerEl?.focus()}_highlight(e){let t=this._query.trim();if(!t)return e;let n=v(e).indexOf(v(t).split(/\s+/)[0]);return n<0?e:s`${e.slice(0,n)}<mark>${e.slice(n,n+t.length)}</mark>${e.slice(n+t.length)}`}_renderSingleValue(){let e=this._itemFor(this._values[0]);return e?e.html?s`${p(e.html)}`:s`<span class="value-text">${e.label}</span>`:s`<span class="value-text placeholder">${this.placeholder}</span>`}_renderChips(){if(this._values.length===0)return s`<span class="value-text placeholder">${this.placeholder}</span>`;let e=u(t(`tag`));return this._values.map(t=>d`<${e}
1
+ import{cls as e,tagName as t,uniqueId as n}from"../../registry.js";import{i as r}from"../../chunks/lit.js";import{i,r as a,t as o}from"../../chunks/decorate.js";import{a as s,t as c}from"../../chunks/lit-html.js";import{LocalizeController as l}from"../../shared/localize.js";import{n as u,r as d}from"../../chunks/static-html.js";import f from"../../shared/styles/host.styles.js";import{t as p}from"../../chunks/unsafe-html.js";import{LuxenFormAssociatedElement as m}from"../../shared/luxen-form-associated-element.js";import{PopoverController as h}from"../../shared/controllers/popover.js";import{ListboxNavController as g}from"../../shared/controllers/listbox-nav.js";var _=r(`:host{--height:var(--l-form-control-height);--border-radius:var(--l-form-control-border-radius);--background:var(--l-color-surface-overlay);inline-size:100%;display:block}:host([size=xs]){--height:var(--l-size-control-xs)}:host([size=sm]){--height:var(--l-size-control-sm)}:host([size=lg]){--height:var(--l-size-control-lg)}:host([size=xl]){--height:var(--l-size-control-xl)}:host([disabled]){opacity:.5;pointer-events:none}.base{position:relative}.trigger{inline-size:100%;min-block-size:var(--height);padding-block:.25rem;padding-inline:var(--l-form-control-padding-inline);border:var(--l-form-control-border-width) solid var(--l-form-control-border-color);border-radius:var(--border-radius);background-color:var(--l-form-control-background-color);color:var(--l-form-control-value-color);font:inherit;text-align:start;cursor:pointer;align-items:center;gap:.5rem;display:flex}:host([multiple]) .trigger{padding-inline-start:.375rem}@media (hover:hover){.trigger:hover{border-color:var(--l-form-control-border-color-hover)}}.trigger:focus-visible{border-color:var(--l-focus-ring);box-shadow:0 0 0 3px color-mix(in oklab, var(--l-focus-ring) 22%, transparent);outline:none}.value{flex-wrap:wrap;flex:1;align-items:center;gap:.25rem;min-inline-size:0;display:flex;overflow:hidden}.value-text{text-overflow:ellipsis;white-space:nowrap;min-inline-size:0;overflow:hidden}[part=tag]{--height:initial;--border-radius:initial}.placeholder{color:var(--l-form-control-placeholder-color)}.chevron{block-size:1em;inline-size:1em;color:var(--l-form-control-placeholder-color);-webkit-mask:var(--_chevron-icon) center / contain no-repeat;mask:var(--_chevron-icon) center / contain no-repeat;background-color:currentColor;flex:none;transition:rotate .15s}.trigger[aria-expanded=true] .chevron{rotate:180deg}.clear{cursor:pointer;block-size:1.5rem;inline-size:1.5rem;color:var(--l-form-control-placeholder-color);-webkit-mask:var(--_x-icon) center / 1em no-repeat;mask:var(--_x-icon) center / 1em no-repeat;background-color:currentColor;border:0;margin-block:auto;padding:0;position:absolute;inset-block:0;inset-inline-end:calc(var(--l-form-control-padding-inline) + 1.25em)}@media (hover:hover){.clear:hover{color:var(--l-form-control-value-color)}}.clear:focus-visible{outline:2px solid var(--l-focus-ring);outline-offset:2px}.value .l-select-item-media{flex:none;align-items:center;font-size:1.25em;display:inline-flex}.value .l-select-item-text{flex-direction:column;min-inline-size:0;display:flex}.value .l-select-item-title{font-weight:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.value .l-select-item-description{display:none}.panel{border:1px solid var(--l-color-border-overlay);border-radius:var(--border-radius);background-color:var(--background);color:var(--l-color-text-primary);box-shadow:var(--l-shadow-md);opacity:0;transition:opacity .12s ease, scale .12s ease, display .12s allow-discrete, overlay .12s allow-discrete;margin:0;padding:0;font-size:.875rem;line-height:1.5;inset:auto;overflow:hidden;scale:.98}.panel:popover-open{opacity:1;scale:1}@starting-style{.panel:popover-open{opacity:0;scale:.98}}.search-row{border-block-end:1px solid var(--l-color-border-overlay);padding:.375rem}.search{inline-size:100%;block-size:var(--l-size-control-sm);border:var(--l-form-control-border-width) solid var(--l-form-control-border-color);border-radius:calc(var(--border-radius) - 2px);background-color:var(--l-form-control-background-color);color:var(--l-form-control-value-color);font:inherit;padding-inline:.5rem}.search:focus-visible{border-color:var(--l-focus-ring);outline:none}.search::placeholder{color:var(--l-form-control-placeholder-color)}.listbox{overscroll-behavior:contain;max-block-size:16rem;margin:0;padding:.25rem;list-style:none;overflow-y:auto}.option{min-block-size:36px;color:var(--l-color-text-primary);cursor:pointer;border-radius:4px;align-items:start;gap:.5rem;padding-block:.5rem;padding-inline:1.75rem .5rem;display:flex;position:relative}@media (hover:hover){.option:hover{background-color:var(--l-color-bg-state-hover)}}.option[data-active]{background-color:var(--l-color-bg-state-hover)}.option[aria-disabled=true]{opacity:.4;cursor:not-allowed}.option[data-current]:after{content:"";block-size:1.3125rem;inline-size:1rem;-webkit-mask:var(--_check-icon) center / 1rem no-repeat;mask:var(--_check-icon) center / 1rem no-repeat;background-color:currentColor;position:absolute;inset-block-start:.5rem;inset-inline-start:.5rem}.option-label{text-overflow:ellipsis;white-space:nowrap;flex:1;min-inline-size:0;overflow:hidden}.option-label mark{color:inherit;background:0 0;font-weight:600}.option-rich{flex:1;align-items:start;gap:.5rem;min-inline-size:0;display:flex}.option-rich .l-select-item-media{object-fit:cover;border-radius:4px;flex:none;align-items:center;block-size:1.5rem;inline-size:1.5rem;font-size:1.25em;display:inline-flex}.option-rich .l-select-item-text{flex-direction:column;flex:auto;min-inline-size:0;display:flex}.option-rich .l-select-item-title{text-overflow:ellipsis;white-space:nowrap;font-weight:600;overflow:hidden}.option-rich .l-select-item-description{color:var(--l-color-text-tertiary);white-space:normal;text-wrap:pretty;font-size:.75rem;line-height:1.3}.empty{color:var(--l-color-text-tertiary);text-align:center;padding:.5rem}.visually-hidden{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}:host{--_chevron-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");--_x-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E");--_check-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")}@media (prefers-reduced-motion:reduce){.panel,.chevron{transition-duration:0s}}`);function v(e){return e.normalize(`NFD`).replace(/[̀-ͯ]/g,``).toLowerCase()}var y=(e,t)=>{if(!t)return!0;let n=v(e.label);return v(t).split(/\s+/).filter(Boolean).every(e=>n.includes(e))},b=class extends Event{constructor(e){super(`change`,{bubbles:!0,composed:!1,cancelable:!1}),this.value=e}},x=class extends Event{constructor(e){super(`input`,{bubbles:!0,composed:!1,cancelable:!1}),this.value=e}},S=class extends m{constructor(...e){super(...e),this._localize=new l(this),this._listId=n(`select-list`),this._floating=new h(this,{getTriggerElement:()=>this._triggerEl,getFloatingElement:()=>this._panelEl,getArrowElement:()=>null}),this._nav=new g(this,{listboxId:this._listId,getCount:()=>this._filtered.length,isDisabled:e=>this._filtered[e]?.disabled??!1,isOpen:()=>this._open,open:()=>this.show(),getOptionElements:()=>this.shadowRoot?.querySelectorAll(`.option`)}),this.#e=``,this.#t=``,this.#n=`md`,this.#r=!1,this.#i=!1,this.#a=`bottom-start`,this.#o=!1,this.filter=y,this.#s=[],this.#c=!1,this.#l=``,this.#u=[],this._defaultValues=[],this._onDocumentPointerDown=e=>{e.composedPath().includes(this)||(this.hasInteracted=!0,this._updateValidity(),this.hide({focusTrigger:!1}))},this._onTriggerKeyDown=e=>{this._open||(e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.show())},this._onPanelKeyDown=e=>{if(!this._nav.onKeyDown(e))switch(e.key){case`Enter`:{e.preventDefault();let t=this._filtered[this._nav.activeIndex];t&&this._select(t);break}case`Escape`:e.preventDefault(),this.hide();break;case`Tab`:this.hide({focusTrigger:!1});break;default:break}},this._onSearchInput=e=>{this._query=e.target.value,this._nav.reset(),this.dispatchEvent(new x(this._query))}}static{this.styles=[f,_]}#e;get placeholder(){return this.#e}set placeholder(e){this.#e=e}#t;get label(){return this.#t}set label(e){this.#t=e}#n;get size(){return this.#n}set size(e){this.#n=e}#r;get searchable(){return this.#r}set searchable(e){this.#r=e}#i;get withClear(){return this.#i}set withClear(e){this.#i=e}#a;get placement(){return this.#a}set placement(e){this.#a=e}#o;get multiple(){return this.#o}set multiple(e){this.#o=e}#s;get _values(){return this.#s}set _values(e){this.#s=e}#c;get _open(){return this.#c}set _open(e){this.#c=e}#l;get _query(){return this.#l}set _query(e){this.#l=e}#u;get _items(){return this.#u}set _items(e){this.#u=e}get value(){return this.multiple?[...this._values]:this._values[0]??``}set value(e){this._values=Array.isArray(e)?[...e]:e?[e]:[]}get _triggerEl(){return this.shadowRoot?.querySelector(`.trigger`)??null}get _panelEl(){return this.shadowRoot?.querySelector(`.panel`)??null}get _searchEl(){return this.shadowRoot?.querySelector(`.search`)??null}get validationTarget(){return this._triggerEl??void 0}connectedCallback(){if(super.connectedCallback(),this._readItems(),this._values.length===0){let e=this.getAttribute(`value`);if(e)this._values=[e];else{let e=this._items.filter(e=>e.selected).map(e=>e.value);this._values=this.multiple?e:e.slice(0,1)}}this._defaultValues=[...this._values],this._syncForm()}updated(e){(e.has(`_values`)||e.has(`multiple`))&&(this._syncForm(),this._updateValidity())}formResetCallback(){this._values=[...this._defaultValues],this._query=``,this._nav.reset(),super.formResetCallback(),this._syncForm()}formStateRestoreCallback(e){this.value=e,this._syncForm()}_readItems(){let t=this.querySelector(`datalist`),n=t?Array.from(t.options):[];this._items=n.map(t=>{let n=t.childElementCount>0,r=t.querySelector(`.${e(`select-item-title`)}`)?.textContent?.trim(),i=(t.getAttribute(`label`)||r||t.textContent||t.value).trim();return{value:t.value,label:i,disabled:t.disabled,selected:t.hasAttribute(`selected`),html:n?t.innerHTML:void 0}})}_itemFor(e){return this._items.find(t=>t.value===e)}get _filtered(){return this._items.filter(e=>this.filter(e,this._query))}_syncForm(){if(this.multiple){let e=new FormData;for(let t of this._values)e.append(this.name,t);this._internals.setFormValue(e)}else this._internals.setFormValue(this._values[0]??``)}_updateValidity(){this.required&&this._values.length===0?this.setValidity({valueMissing:!0},this._localize.term(`selectOption`),this._triggerEl??void 0):this.setValidity({})}show(){this._open||this.disabled||(this._readItems(),this.dispatchEvent(new Event(`show`,{cancelable:!0}))&&(this._open=!0,this._query=``,this._values.length&&this._nav.setActive(this._filtered.findIndex(e=>e.value===this._values[0])),this.updateComplete.then(()=>{this._panelEl?.showPopover?.(),this._floating.startPositioning({placement:this.placement,distance:4,minWidth:`trigger`}),(this._searchEl??this._panelEl?.querySelector(`.listbox`))?.focus(),document.addEventListener(`pointerdown`,this._onDocumentPointerDown,!0)})))}hide({focusTrigger:e=!0}={}){if(!this._open||!this.dispatchEvent(new Event(`hide`,{cancelable:!0})))return;this._open=!1,this._query=``,this._nav.reset();let t=this._panelEl;t?.matches?.(`:popover-open`)&&t.hidePopover?.(),this._floating.stopPositioning(),document.removeEventListener(`pointerdown`,this._onDocumentPointerDown,!0),e&&this._triggerEl?.focus()}_select(e){e.disabled||(this.hasInteracted=!0,this.multiple?(this._values=this._values.includes(e.value)?this._values.filter(t=>t!==e.value):[...this._values,e.value],this.dispatchEvent(new b(this.value)),this._searchEl?.focus()):(this._values=[e.value],this.dispatchEvent(new b(this.value)),this.hide()))}_removeValue(e){this._values=this._values.filter(t=>t!==e),this.hasInteracted=!0,this.dispatchEvent(new b(this.value))}_clear(e){e?.stopPropagation(),this._values=[],this.hasInteracted=!0,this.dispatchEvent(new b(this.value)),this._triggerEl?.focus()}_highlight(e){let t=this._query.trim();if(!t)return e;let n=v(e).indexOf(v(t).split(/\s+/)[0]);return n<0?e:s`${e.slice(0,n)}<mark>${e.slice(n,n+t.length)}</mark>${e.slice(n+t.length)}`}_renderSingleValue(){let e=this._itemFor(this._values[0]);return e?e.html?s`${p(e.html)}`:s`<span class="value-text">${e.label}</span>`:s`<span class="value-text placeholder">${this.placeholder}</span>`}_renderChips(){if(this._values.length===0)return s`<span class="value-text placeholder">${this.placeholder}</span>`;let e=u(t(`tag`));return this._values.map(t=>d`<${e}
2
2
  size="sm"
3
3
  removable
4
4
  part="tag"