@grasco/profile-picture 0.1.8 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/angular.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var lit=require('lit'),decorators_js=require('lit/decorators.js'),styleMap_js=require('lit/directives/style-map.js');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;var wt=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var s=(r,n,t,e)=>{for(var o=e>1?void 0:e?vt(n,t):n,i=r.length-1,p;i>=0;i--)(p=r[i])&&(o=(e?p(n,t,o):p(o))||o);return e&&o&&wt(n,t,o),o};var G="grasco-profile-picture-styles",T=false,J=false;function K(){if(T||typeof document>"u")return;if(document.getElementById(G)){T=true;return}if(document.querySelector('link[href*="profile-picture"][href$="styles.css"]')){T=true;return}J||(J=true,yt());}function yt(){(typeof requestIdleCallback<"u"?requestIdleCallback:n=>setTimeout(n,1))(()=>Ct());}function Ct(){if(T||typeof document>"u")return;if(document.getElementById(G)){T=true;return}let r=St();if(!r)return;let n=document.createElement("link");n.id=G,n.rel="stylesheet",n.href=r,document.head.appendChild(n),T=true;}function St(){if(typeof window<"u"&&window.__GRASCO_PROFILE_PICTURE_CSS__)return window.__GRASCO_PROFILE_PICTURE_CSS__;try{let n=(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('angular.cjs', document.baseURI).href));if(n)return `${n.substring(0,n.lastIndexOf("/")+1)}dist/styles.css`}catch{}let r=document.currentScript;if(r?.src){let n=new URL(r.src);return `${n.href.substring(0,n.href.lastIndexOf("/")+1)}dist/styles.css`}return null}var E={"2xs":20,xs:24,sm:32,md:40,lg:48,xl:64,"2xl":80,"3xl":120},X={online:"#30D158",away:"#FFD60A",busy:"#FF453A",offline:"#8E8E93",dnd:"#FF453A"},Z={none:"none",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",glow:"0 0 20px 0 rgba(99, 102, 241, 0.3)"},v={size:"md",variant:"circle",loading:"lazy",placeholder:"shimmer",borderWidth:2,borderColor:"#ffffff",placeholderColor:"#f3f4f6",shadow:"sm"};var A={circle:"9999px",rounded:"12px",squircle:"30%",square:"0px"},y={max:4,direction:"ltr",overlap:.3,size:"md",tooltipDelay:300,dropdownMaxHeight:280,animated:true};function k(...r){return r.filter(Boolean).join(" ")}function N(r){return /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(r)}function B(r){let t=r.trim().replace(/[^\w\s]/g,"").split(/\s+/).filter(Boolean);return t.length===0?"?":t.length===1?t[0].slice(0,1).toUpperCase():(t[0][0]+(t.at(-1)?.[0]??"")).toUpperCase()}function j(r){return Math.round(r*.38)}function Q(r,n){let t;if(n){let o=Math.round(r*.31);t=Math.min(24,Math.max(14,o));}else {let o=Math.round(r*.22);t=Math.min(14,Math.max(8,o));}let e=Math.max(9,Math.round(t*.55));return {size:t,fontSize:e}}function _(r,n){let t=Math.min(16,Math.max(8,Math.round(r*.2)));return Math.min(18,t+(n-1)*2)}function P(r,n){return typeof r=="string"?r:n&&r>n?`${n}+`:r.toString()}function tt(r){return r.length===0?"transparent":r.length===1?r[0]:`conic-gradient(${r.map((t,e)=>{let o=e/r.length*360,i=(e+1)/r.length*360;return `${t} ${o}deg ${i}deg`}).join(", ")})`}function kt(r){let n=0;for(let t=0;t<r.length;t++){let e=r.charCodeAt(t);n=(n<<5)-n+e,n&=n;}return Math.abs(n)}function et(r,n,t){let o=Math.max(0,Math.min(100,r))/100*360;return `conic-gradient(from 270deg, ${n} 0deg ${o}deg, ${t} ${o}deg 360deg)`}function M(r){let n=["linear-gradient(135deg, #667eea 0%, #764ba2 100%)","linear-gradient(135deg, #f093fb 0%, #f5576c 100%)","linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)","linear-gradient(135deg, #43e97b 0%, #38f9d7 100%)","linear-gradient(135deg, #fa709a 0%, #fee140 100%)","linear-gradient(135deg, #a8edea 0%, #fed6e3 100%)","linear-gradient(135deg, #d299c2 0%, #fef9d7 100%)","linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%)","linear-gradient(135deg, #cd9cf2 0%, #f6f3ff 100%)","linear-gradient(135deg, #fddb92 0%, #d1fdff 100%)"],t=kt(r)%n.length;return n[t]}function rt(r){return typeof r=="number"?r:E[r]??E[y.size]}function H(r,n,t){let e=t?n-1:n;if(r<=e)return {visible:r,hidden:0,showCounter:false};let o=e-1,i=r-o;return {visible:o,hidden:i,showCounter:true}}function U(r,n,t,e,o){let i=o??n*(1-t);return r*i}function nt(r,n,t){return t==="ltr"?n-r:r+1}function ot(r,n,t,e){if(r===0)return 0;if(r===1)return n;let o=e??n*(1-t);return n+o*(r-1)}function it(r){return r>99?"+99":`+${r}`}function at(r){return r<=80?"80":r<=120?"120":r<=240?"240":r<=480?"480":"960"}function st(r){if(!(r&&N(r)))return "light";let n=r.replace("#","");n.length===3&&(n=n.split("").map(p=>p+p).join(""));let t=Number.parseInt(n.slice(0,2),16),e=Number.parseInt(n.slice(2,4),16),o=Number.parseInt(n.slice(4,6),16);return (.299*t+.587*e+.114*o)/255>.5?"light":"dark"}function pt(r,n,t,e,o){let i=r.endsWith("/")?r.slice(0,-1):r,p=`${n}_${t}_${e}.webp`;return `${i}/api/profile-picture/cdn/${p}?hostname=${o}`}function dt(r){return {circle:"np:rounded-full",rounded:"np:rounded-xl",squircle:"np:rounded-[30%]",square:"np:rounded-none"}[r]}function lt(r,n){return {className:{1:"np:border",2:"np:border-2",3:"np:border-[3px]",4:"np:border-4",5:"np:border-[5px]",6:"np:border-[6px]",8:"np:border-8"}[r],style:{borderColor:n,borderStyle:"solid"}}}function ct(r,n){return n?{className:"",style:{background:n}}:r?r.includes("gradient")?{className:"",style:{background:r}}:{className:"",style:{backgroundColor:r}}:{className:"",style:{backgroundColor:"#e7e7e7"}}}function gt(r){return {boxShadow:Z[r]}}var $t={shimmer:`
1
+ 'use strict';var lit=require('lit'),decorators_js=require('lit/decorators.js'),styleMap_js=require('lit/directives/style-map.js');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;var ve=Object.defineProperty;var s=(r,n,e,t)=>{for(var o=void 0,i=r.length-1,p;i>=0;i--)(p=r[i])&&(o=(p(n,e,o))||o);return o&&ve(n,e,o),o};var G="grasco-profile-picture-styles",T=false,J=false;function K(){if(T||typeof document>"u")return;if(document.getElementById(G)){T=true;return}if(document.querySelector('link[href*="profile-picture"][href$="styles.css"]')){T=true;return}J||(J=true,Ce());}function Ce(){(typeof requestIdleCallback<"u"?requestIdleCallback:n=>setTimeout(n,1))(()=>Se());}function Se(){if(T||typeof document>"u")return;if(document.getElementById(G)){T=true;return}let r=ke();if(!r)return;let n=document.createElement("link");n.id=G,n.rel="stylesheet",n.href=r,document.head.appendChild(n),T=true;}function ke(){if(typeof window<"u"&&window.__GRASCO_PROFILE_PICTURE_CSS__)return window.__GRASCO_PROFILE_PICTURE_CSS__;try{let n=(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('angular.cjs', document.baseURI).href));if(n)return `${n.substring(0,n.lastIndexOf("/")+1)}dist/styles.css`}catch{}let r=document.currentScript;if(r?.src){let n=new URL(r.src);return `${n.href.substring(0,n.href.lastIndexOf("/")+1)}dist/styles.css`}return null}var E={"2xs":20,xs:24,sm:32,md:40,lg:48,xl:64,"2xl":80,"3xl":120},X={online:"#30D158",away:"#FFD60A",busy:"#FF453A",offline:"#8E8E93",dnd:"#FF453A"},Z={none:"none",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",glow:"0 0 20px 0 rgba(99, 102, 241, 0.3)"},v={size:"md",variant:"circle",loading:"lazy",placeholder:"shimmer",borderWidth:2,borderColor:"#ffffff",placeholderColor:"#f3f4f6",shadow:"sm"};var A={circle:"9999px",rounded:"12px",squircle:"30%",square:"0px"},y={max:4,direction:"ltr",overlap:.3,size:"md",tooltipDelay:300,dropdownMaxHeight:280,animated:true};function k(...r){return r.filter(Boolean).join(" ")}function N(r){return /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(r)}function M(r){let e=r.trim().replace(/[^\w\s]/g,"").split(/\s+/).filter(Boolean);return e.length===0?"?":e.length===1?e[0].slice(0,1).toUpperCase():(e[0][0]+(e.at(-1)?.[0]??"")).toUpperCase()}function j(r){return Math.round(r*.38)}function Q(r,n){let e;if(n){let o=Math.round(r*.31);e=Math.min(24,Math.max(14,o));}else {let o=Math.round(r*.22);e=Math.min(14,Math.max(8,o));}let t=Math.max(9,Math.round(e*.55));return {size:e,fontSize:t}}function _(r,n){let e=Math.min(16,Math.max(8,Math.round(r*.2)));return Math.min(18,e+(n-1)*2)}function ee(r,n){return typeof r=="string"?r:n&&r>n?`${n}+`:r.toString()}function te(r){return r.length===0?"transparent":r.length===1?r[0]:`conic-gradient(${r.map((e,t)=>{let o=t/r.length*360,i=(t+1)/r.length*360;return `${e} ${o}deg ${i}deg`}).join(", ")})`}function $e(r){let n=0;for(let e=0;e<r.length;e++){let t=r.charCodeAt(e);n=(n<<5)-n+t,n&=n;}return Math.abs(n)}function re(r,n,e){let o=Math.max(0,Math.min(100,r))/100*360;return `conic-gradient(from 270deg, ${n} 0deg ${o}deg, ${e} ${o}deg 360deg)`}function U(r){let n=["linear-gradient(135deg, #667eea 0%, #764ba2 100%)","linear-gradient(135deg, #f093fb 0%, #f5576c 100%)","linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)","linear-gradient(135deg, #43e97b 0%, #38f9d7 100%)","linear-gradient(135deg, #fa709a 0%, #fee140 100%)","linear-gradient(135deg, #a8edea 0%, #fed6e3 100%)","linear-gradient(135deg, #d299c2 0%, #fef9d7 100%)","linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%)","linear-gradient(135deg, #cd9cf2 0%, #f6f3ff 100%)","linear-gradient(135deg, #fddb92 0%, #d1fdff 100%)"],e=$e(r)%n.length;return n[e]}function ne(r){return typeof r=="number"?r:E[r]??E[y.size]}function H(r,n,e){let t=e?n-1:n;if(r<=t)return {visible:r,hidden:0,showCounter:false};let o=t-1,i=r-o;return {visible:o,hidden:i,showCounter:true}}function P(r,n,e,t,o){let i=o??n*(1-e);return r*i}function oe(r,n,e){return e==="ltr"?n-r:r+1}function ie(r,n,e,t){if(r===0)return 0;if(r===1)return n;let o=t??n*(1-e);return n+o*(r-1)}function ae(r){return r>99?"+99":`+${r}`}function se(r){return r<=80?"80":r<=120?"120":r<=240?"240":r<=480?"480":"960"}function pe(r){if(!(r&&N(r)))return "light";let n=r.replace("#","");n.length===3&&(n=n.split("").map(p=>p+p).join(""));let e=Number.parseInt(n.slice(0,2),16),t=Number.parseInt(n.slice(2,4),16),o=Number.parseInt(n.slice(4,6),16);return (.299*e+.587*t+.114*o)/255>.5?"light":"dark"}function de(r,n,e,t,o){let i=r.endsWith("/")?r.slice(0,-1):r,p=`${n}_${e}_${t}.webp`;return `${i}/api/profile-picture/cdn/${p}?hostname=${o}`}function le(r){return {circle:"np:rounded-full",rounded:"np:rounded-xl",squircle:"np:rounded-[30%]",square:"np:rounded-none"}[r]}function ce(r,n){return {className:{1:"np:border",2:"np:border-2",3:"np:border-[3px]",4:"np:border-4",5:"np:border-[5px]",6:"np:border-[6px]",8:"np:border-8"}[r],style:{borderColor:n,borderStyle:"solid"}}}function ue(r,n){return n?{className:"",style:{background:n}}:r?r.includes("gradient")?{className:"",style:{background:r}}:{className:"",style:{backgroundColor:r}}:{className:"",style:{backgroundColor:"#e7e7e7"}}}function ge(r){return {boxShadow:Z[r]}}var Ie={shimmer:`
2
2
  @keyframes pp-shimmer {
3
3
  0% { transform: translateX(-100%); }
4
4
  100% { transform: translateX(100%); }
@@ -36,8 +36,8 @@
36
36
  0% { transform: scale(0.8); opacity: 0; }
37
37
  50% { transform: scale(1.05); }
38
38
  100% { transform: scale(1); opacity: 1; }
39
- }`},It=Object.values($t).join(`
40
- `),zt=`
39
+ }`},ze=Object.values(Ie).join(`
40
+ `),Te=`
41
41
  /* Profile Picture Component Styles */
42
42
  .pp-container {
43
43
  --pp-transition-duration: 200ms;
@@ -240,8 +240,8 @@
240
240
  transition: none !important;
241
241
  }
242
242
  }
243
- `,ut=`${It}
244
- ${zt}`,ht=`
243
+ `,fe=`${ze}
244
+ ${Te}`,he=`
245
245
  @keyframes np-shimmer {
246
246
  0% { background-position: -200% 0; }
247
247
  100% { background-position: 200% 0; }
@@ -251,7 +251,7 @@ ${zt}`,ht=`
251
251
  background-size: 200% 100%;
252
252
  animation: np-shimmer 1.5s infinite;
253
253
  }
254
- `;function ft(r,n=.3){if(N(r)){let t=Number.parseInt(r.slice(1,3),16),e=Number.parseInt(r.slice(3,5),16),o=Number.parseInt(r.slice(5,7),16);return `0 0 20px 0 rgba(${t}, ${e}, ${o}, ${n})`}return `0 0 20px 0 ${r}`}var Tt=`
254
+ `;function me(r,n=.3){if(N(r)){let e=Number.parseInt(r.slice(1,3),16),t=Number.parseInt(r.slice(3,5),16),o=Number.parseInt(r.slice(5,7),16);return `0 0 20px 0 rgba(${e}, ${t}, ${o}, ${n})`}return `0 0 20px 0 ${r}`}var Ee=`
255
255
  @keyframes ppg-tooltip-in {
256
256
  from {
257
257
  opacity: 0;
@@ -302,7 +302,7 @@ ${zt}`,ht=`
302
302
  opacity: 1;
303
303
  }
304
304
  }
305
- `,Et=`
305
+ `,Ae=`
306
306
  /* Profile Picture Group Container */
307
307
  .ppg-container {
308
308
  --ppg-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
@@ -747,11 +747,11 @@ ${zt}`,ht=`
747
747
  box-shadow: 0 0 0 1.5px rgba(44, 44, 46, 0.95), 0 0 6px rgba(48, 209, 88, 0.5);
748
748
  }
749
749
  }
750
- `,mt=`${Tt}
751
- ${Et}`;var a=class extends lit.LitElement{constructor(){super(...arguments);this.src="";this.alt="";this.size=v.size;this.variant=v.variant;this.shadow=v.shadow;this.border=false;this.borderWidth=v.borderWidth;this.borderColor=v.borderColor;this.rotation=0;this.loading=v.loading;this.placeholder=v.placeholder;this.placeholderColor=v.placeholderColor;this.isLoaded=false;this.hasError=false;this.cdnLoadFailed=false;this.previousSrc="";this.RETRY_DELAY_MS=3e4;}static setCdnBaseUrl(t){a.cdnBaseUrl=t,a.instances.forEach(e=>{e.extCustomerId&&!e.cdnImageUrl&&(e.cdnLoadFailed=false,e.retryTimeoutId&&(clearTimeout(e.retryTimeoutId),e.retryTimeoutId=void 0),e.previousExtCustomerId||(e.previousExtCustomerId=e.extCustomerId),e.loadCdnImage());});}static getCdnBaseUrl(){return a.cdnBaseUrl}createRenderRoot(){return a.injectStylesOnce(),this}static injectStylesOnce(){if(a.stylesInjected||typeof document>"u")return;(typeof requestIdleCallback<"u"?requestIdleCallback:e=>setTimeout(e,1))(()=>{if(a.stylesInjected)return;let e=document.createElement("style");e.textContent=ut,document.head.appendChild(e),a.stylesInjected=true;});}get pixelSize(){let t=this.size;return typeof t=="number"?t:E[t]??E[v.size]}connectedCallback(){super.connectedCallback(),a.instances.add(this);}disconnectedCallback(){super.disconnectedCallback(),a.instances.delete(this),this.retryTimeoutId&&(clearTimeout(this.retryTimeoutId),this.retryTimeoutId=void 0);}firstUpdated(){this.extCustomerId&&a.cdnBaseUrl&&(this.previousExtCustomerId=this.extCustomerId,this.loadCdnImage());}updated(t){super.updated(t),this.extCustomerId&&a.cdnBaseUrl&&!this.cdnImageUrl&&(this.cdnLoadFailed||!this.previousExtCustomerId)&&(this.previousExtCustomerId||(this.previousExtCustomerId=this.extCustomerId),this.cdnLoadFailed=false,this.loadCdnImage());}willUpdate(t){t.has("src")&&this.src!==this.previousSrc&&(this.isLoaded=false,this.hasError=false,this.previousSrc=this.src),(t.has("extCustomerId")||t.has("size")||t.has("bgColor"))&&this.extCustomerId!==this.previousExtCustomerId&&(this.previousExtCustomerId=this.extCustomerId,this.cdnImageUrl=void 0,this.cdnLoadFailed=false,this.isLoaded=false,this.hasError=false,this.retryTimeoutId&&(clearTimeout(this.retryTimeoutId),this.retryTimeoutId=void 0),this.loadCdnImage());}handleLoad(){this.isLoaded=true,this.dispatchEvent(new CustomEvent("load",{bubbles:true,composed:true}));}handleError(){if(this.cdnImageUrl&&!this.cdnLoadFailed){this.cdnLoadFailed=true,this.cdnImageUrl=void 0,this.dispatchEvent(new CustomEvent("cdn-error",{bubbles:true,composed:true,detail:{error:"Image load failed"}})),this.retryTimeoutId&&clearTimeout(this.retryTimeoutId),this.retryTimeoutId=setTimeout(()=>{this.retryTimeoutId=void 0,this.extCustomerId&&a.cdnBaseUrl&&(this.cdnLoadFailed=false,this.hasError=false,this.isLoaded=false,this.loadCdnImage());},this.RETRY_DELAY_MS);return}this.hasError=true,this.isLoaded=true,this.dispatchEvent(new CustomEvent("error",{bubbles:true,composed:true}));}loadCdnImage(){if(!(this.extCustomerId&&a.cdnBaseUrl)){this.cdnLoadFailed=true;return}let t=at(this.pixelSize),e=st(this.bgColor),o=typeof window<"u"?window.location.hostname:"localhost";this.cdnImageUrl=pt(a.cdnBaseUrl,this.extCustomerId,t,e,o);}getContainerStyles(){let t=ct(this.bgColor,this.bgGradient),e=this.border?lt(this.borderWidth,this.borderColor):null,o=gt(this.shadow),i={};if(this.glow){let d=this.glow.color??this.borderColor??"#6366f1";i={"--pp-glow-color":d,boxShadow:ft(d,this.glow.intensity??.3)};}let p=this.interactive?.hoverable||this.interactive?.pressable;return {classes:k("pp-container",dt(this.variant),t.className,e?.className,p&&"pp-interactive",this.glow?.animate&&"pp-glow"),styles:{width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,borderRadius:A[this.variant],...t.style,...e?.style,...o,...i,cursor:this.interactive?.cursor??(p?"pointer":"default"),transform:this.rotation?`rotate(${this.rotation}deg)`:void 0}}}renderPlaceholder(){if(this.isLoaded||this.placeholder==="none")return lit.nothing;let t={shimmer:"pp-shimmer",pulse:"pp-pulse",skeleton:"pp-skeleton",blur:"",none:""}[this.placeholder];return lit.html`
752
- ${this.placeholder==="shimmer"?lit.html`<style>${ht}</style>`:lit.nothing}
750
+ `,be=`${Ee}
751
+ ${Ae}`;var a=class a extends lit.LitElement{constructor(){super(...arguments);this.src="";this.alt="";this.size=v.size;this.variant=v.variant;this.shadow=v.shadow;this.border=false;this.borderWidth=v.borderWidth;this.borderColor=v.borderColor;this.rotation=0;this.loading=v.loading;this.placeholder=v.placeholder;this.placeholderColor=v.placeholderColor;this.isLoaded=false;this.hasError=false;this.cdnLoadFailed=false;this.previousSrc="";this.RETRY_DELAY_MS=3e4;}static{this.stylesInjected=false;}static{this.cdnBaseUrl="";}static{this.instances=new Set;}static setCdnBaseUrl(e){a.cdnBaseUrl=e,a.instances.forEach(t=>{t.extCustomerId&&!t.cdnImageUrl&&(t.cdnLoadFailed=false,t.retryTimeoutId&&(clearTimeout(t.retryTimeoutId),t.retryTimeoutId=void 0),t.previousExtCustomerId||(t.previousExtCustomerId=t.extCustomerId),t.loadCdnImage());});}static getCdnBaseUrl(){return a.cdnBaseUrl}createRenderRoot(){return a.injectStylesOnce(),this}static injectStylesOnce(){if(a.stylesInjected||typeof document>"u")return;(typeof requestIdleCallback<"u"?requestIdleCallback:t=>setTimeout(t,1))(()=>{if(a.stylesInjected)return;let t=document.createElement("style");t.textContent=fe,document.head.appendChild(t),a.stylesInjected=true;});}get pixelSize(){let e=this.size;return typeof e=="number"?e:E[e]??E[v.size]}connectedCallback(){super.connectedCallback(),a.instances.add(this);}disconnectedCallback(){super.disconnectedCallback(),a.instances.delete(this),this.retryTimeoutId&&(clearTimeout(this.retryTimeoutId),this.retryTimeoutId=void 0);}firstUpdated(){this.extCustomerId&&a.cdnBaseUrl&&(this.previousExtCustomerId=this.extCustomerId,this.loadCdnImage());}updated(e){super.updated(e),this.extCustomerId&&a.cdnBaseUrl&&!this.cdnImageUrl&&(this.cdnLoadFailed||!this.previousExtCustomerId)&&(this.previousExtCustomerId||(this.previousExtCustomerId=this.extCustomerId),this.cdnLoadFailed=false,this.loadCdnImage());}willUpdate(e){e.has("src")&&this.src!==this.previousSrc&&(this.isLoaded=false,this.hasError=false,this.previousSrc=this.src),(e.has("extCustomerId")||e.has("size")||e.has("bgColor"))&&this.extCustomerId!==this.previousExtCustomerId&&(this.previousExtCustomerId=this.extCustomerId,this.cdnImageUrl=void 0,this.cdnLoadFailed=false,this.isLoaded=false,this.hasError=false,this.retryTimeoutId&&(clearTimeout(this.retryTimeoutId),this.retryTimeoutId=void 0),this.loadCdnImage());}handleLoad(){this.isLoaded=true,this.dispatchEvent(new CustomEvent("load",{bubbles:true,composed:true}));}handleError(){if(this.cdnImageUrl&&!this.cdnLoadFailed){this.cdnLoadFailed=true,this.cdnImageUrl=void 0,this.dispatchEvent(new CustomEvent("cdn-error",{bubbles:true,composed:true,detail:{error:"Image load failed"}})),this.retryTimeoutId&&clearTimeout(this.retryTimeoutId),this.retryTimeoutId=setTimeout(()=>{this.retryTimeoutId=void 0,this.extCustomerId&&a.cdnBaseUrl&&(this.cdnLoadFailed=false,this.hasError=false,this.isLoaded=false,this.loadCdnImage());},this.RETRY_DELAY_MS);return}this.hasError=true,this.isLoaded=true,this.dispatchEvent(new CustomEvent("error",{bubbles:true,composed:true}));}loadCdnImage(){if(!(this.extCustomerId&&a.cdnBaseUrl)){this.cdnLoadFailed=true;return}let e=se(this.pixelSize),t=pe(this.bgColor),o=typeof window<"u"?window.location.hostname:"localhost";this.cdnImageUrl=de(a.cdnBaseUrl,this.extCustomerId,e,t,o);}getContainerStyles(){let e=ue(this.bgColor,this.bgGradient),t=this.border?ce(this.borderWidth,this.borderColor):null,o=ge(this.shadow),i={};if(this.glow){let d=this.glow.color??this.borderColor??"#6366f1";i={"--pp-glow-color":d,boxShadow:me(d,this.glow.intensity??.3)};}let p=this.interactive?.hoverable||this.interactive?.pressable;return {classes:k("pp-container",le(this.variant),e.className,t?.className,p&&"pp-interactive",this.glow?.animate&&"pp-glow"),styles:{width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,borderRadius:A[this.variant],...e.style,...t?.style,...o,...i,cursor:this.interactive?.cursor??(p?"pointer":"default"),transform:this.rotation?`rotate(${this.rotation}deg)`:void 0}}}renderPlaceholder(){if(this.isLoaded||this.placeholder==="none")return lit.nothing;let e={shimmer:"pp-shimmer",pulse:"pp-pulse",skeleton:"pp-skeleton",blur:"",none:""}[this.placeholder];return lit.html`
752
+ ${this.placeholder==="shimmer"?lit.html`<style>${he}</style>`:lit.nothing}
753
753
  <div
754
- class=${k("np:absolute np:inset-0",t)}
754
+ class=${k("np:absolute np:inset-0",e)}
755
755
  style=${styleMap_js.styleMap({backgroundColor:this.placeholderColor,borderRadius:"inherit"})}>
756
756
  </div>
757
757
  `}renderFallback(){if(this.fallback)return lit.html`
@@ -760,23 +760,23 @@ ${Et}`;var a=class extends lit.LitElement{constructor(){super(...arguments);this
760
760
  style=${styleMap_js.styleMap({fontSize:`${j(this.pixelSize)}px`})}>
761
761
  ${this.fallback}
762
762
  </span>
763
- `;if(this.alt){let e=M(this.alt);return lit.html`
763
+ `;if(this.alt){let t=U(this.alt);return lit.html`
764
764
  <div
765
765
  class="pp-fallback np:absolute np:inset-0"
766
- style=${styleMap_js.styleMap({background:this.bgColor??e,fontSize:`${j(this.pixelSize)}px`})}>
767
- ${B(this.alt)}
766
+ style=${styleMap_js.styleMap({background:this.bgColor??t,fontSize:`${j(this.pixelSize)}px`})}>
767
+ ${M(this.alt)}
768
768
  </div>
769
- `}let t=this.pixelSize*.5;return lit.html`
769
+ `}let e=this.pixelSize*.5;return lit.html`
770
770
  <svg
771
771
  class="pp-fallback-icon"
772
- style="width: ${t}px; height: ${t}px;"
772
+ style="width: ${e}px; height: ${e}px;"
773
773
  fill="currentColor"
774
774
  viewBox="0 0 24 24">
775
775
  <path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" />
776
776
  </svg>
777
- `}renderImage(){let t=!!(this.extCustomerId&&a.cdnBaseUrl),e;return this.cdnImageUrl?e=this.cdnImageUrl:(!t||this.cdnLoadFailed)&&(e=this.src),this.hasError||!e?this.renderFallback():lit.html`
777
+ `}renderImage(){let e=!!(this.extCustomerId&&a.cdnBaseUrl),t;return this.cdnImageUrl?t=this.cdnImageUrl:(!e||this.cdnLoadFailed)&&(t=this.src),this.hasError||!t?this.renderFallback():lit.html`
778
778
  <img
779
- src=${e}
779
+ src=${t}
780
780
  alt=${this.alt}
781
781
  loading=${this.loading}
782
782
  decoding="async"
@@ -784,29 +784,29 @@ ${Et}`;var a=class extends lit.LitElement{constructor(){super(...arguments);this
784
784
  @error=${this.handleError}
785
785
  class=${k("pp-image",this.isLoaded?"pp-image-loaded":"pp-image-loading")}
786
786
  draggable="false" />
787
- `}renderRing(){if(!this.ring?.show)return lit.nothing;let t=this.ring.width??3,e=this.ring.gap??3,o=t+e,i,p=this.ring.progress!==void 0;if(p){let d=this.ring.progress??0,u=this.ring.color??"#30D158",h=this.ring.emptyColor??"#8E8E93";i=et(d,u,h);}else this.ring.gradient&&this.ring.gradient.length>0?i=tt(this.ring.gradient):i=this.ring.color??"linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888)";return lit.html`
787
+ `}renderRing(){if(!this.ring?.show)return lit.nothing;let e=this.ring.width??3,t=this.ring.gap??3,o=e+t,i,p=this.ring.progress!==void 0;if(p){let d=this.ring.progress??0,g=this.ring.color??"#30D158",f=this.ring.emptyColor??"#8E8E93";i=re(d,g,f);}else this.ring.gradient&&this.ring.gradient.length>0?i=te(this.ring.gradient):i=this.ring.color??"linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888)";return lit.html`
788
788
  <div
789
789
  class=${k("pp-ring",this.ring.animate&&!p&&"pp-ring-animated",p&&"pp-ring-progress")}
790
- style=${styleMap_js.styleMap({inset:`-${o}px`,padding:`${t}px`,background:i,borderRadius:A[this.variant]})}>
790
+ style=${styleMap_js.styleMap({inset:`-${o}px`,padding:`${e}px`,background:i,borderRadius:A[this.variant]})}>
791
791
  </div>
792
- `}getCornerOffset(){let t=this.border?this.borderWidth:0,e=this.pixelSize*.08,i={circle:1,square:.5,rounded:.8,squircle:1.2}[this.variant];return Math.round(e*i-t*.5)}renderPresence(){if(!this.presence)return lit.nothing;let t=this.presence.thickness??2,e=_(this.pixelSize,t),o=X[this.presence.status],i=this.getCornerOffset();return lit.html`
792
+ `}getCornerOffset(){let e=this.border?this.borderWidth:0,t=this.pixelSize*.08,i={circle:1,square:.5,rounded:.8,squircle:1.2}[this.variant];return Math.round(t*i-e*.5)}renderPresence(){if(!this.presence)return lit.nothing;let e=this.presence.thickness??2,t=_(this.pixelSize,e),o=X[this.presence.status],i=this.getCornerOffset();return lit.html`
793
793
  <div
794
794
  class=${k("pp-presence",this.presence.animate&&"pp-presence-animated")}
795
- style=${styleMap_js.styleMap({width:`${e}px`,height:`${e}px`,backgroundColor:o,bottom:`${i}px`,right:`${i}px`,color:o})}
795
+ style=${styleMap_js.styleMap({width:`${t}px`,height:`${t}px`,backgroundColor:o,bottom:`${i}px`,right:`${i}px`,color:o})}
796
796
  title=${this.presence.status}>
797
797
  </div>
798
- `}renderBadge(){if(!this.badge)return lit.nothing;let t=this.badge.position??"bottom-right",e=this.badge.content!==void 0,o=this.badge.icon!==void 0,i=e||o,{size:p,fontSize:d}=Q(this.pixelSize,i),u=this.badge.bgColor??"#22c55e",h=this.badge.color??"#ffffff",f=this.badge.borderRadius??"9999px",m=e&&this.badge.content!==void 0?P(this.badge.content,this.badge.max):null,z=o?this.badge.icon:null,O=d*.9,g=`${-this.getCornerOffset()}px`,R={"top-left":{top:g,left:g},"top-center":{top:g,left:"50%",transform:"translateX(-50%)"},"top-right":{top:g,right:g},"bottom-left":{bottom:g,left:g},"bottom-center":{bottom:g,left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:g,right:g}};return lit.html`
798
+ `}renderBadge(){if(!this.badge)return lit.nothing;let e=this.badge.position??"bottom-right",t=this.badge.content!==void 0,o=this.badge.icon!==void 0,i=t||o,{size:p,fontSize:d}=Q(this.pixelSize,i),g=this.badge.bgColor??"#22c55e",f=this.badge.color??"#ffffff",h=this.badge.borderRadius??"9999px",m=t&&this.badge.content!==void 0?ee(this.badge.content,this.badge.max):null,z=o?this.badge.icon:null,O=d*.9,c=`${-this.getCornerOffset()}px`,B={"top-left":{top:c,left:c},"top-center":{top:c,left:"50%",transform:"translateX(-50%)"},"top-right":{top:c,right:c},"bottom-left":{bottom:c,left:c},"bottom-center":{bottom:c,left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:c,right:c}};return lit.html`
799
799
  <div
800
800
  class=${k("pp-badge",this.badge.pulse&&"pp-badge-pulse",this.badge.glow&&"pp-badge-glow",o&&"pp-badge-with-icon")}
801
- style=${styleMap_js.styleMap({width:i?"auto":`${p}px`,minWidth:`${p}px`,height:`${p}px`,padding:i?"0 6px":"0",fontSize:`${d}px`,backgroundColor:u,color:h,borderRadius:f,"--pp-badge-glow-color":u,gap:o&&e?"4px":"0",...R[t]})}>
801
+ style=${styleMap_js.styleMap({width:i?"auto":`${p}px`,minWidth:`${p}px`,height:`${p}px`,padding:i?"0 6px":"0",fontSize:`${d}px`,backgroundColor:g,color:f,borderRadius:h,"--pp-badge-glow-color":g,gap:o&&t?"4px":"0",...B[e]})}>
802
802
  ${z?lit.html`<span class="pp-badge-icon" style=${styleMap_js.styleMap({fontSize:`${O}px`})}>${z}</span>`:lit.nothing}
803
803
  ${m??lit.nothing}
804
804
  </div>
805
- `}render(){let t=this.getContainerStyles(),e=this.interactive?.focusable||this.interactive?.pressable?0:void 0;return lit.html`
805
+ `}render(){let e=this.getContainerStyles(),t=this.interactive?.focusable||this.interactive?.pressable?0:void 0;return lit.html`
806
806
  <div
807
- class=${t.classes}
808
- style=${styleMap_js.styleMap(t.styles)}
809
- tabindex=${e??lit.nothing}
807
+ class=${e.classes}
808
+ style=${styleMap_js.styleMap(e.styles)}
809
+ tabindex=${t??lit.nothing}
810
810
  role=${this.interactive?.pressable?"button":lit.nothing}
811
811
  aria-label=${this.alt||lit.nothing}
812
812
  data-profile-picture>
@@ -831,7 +831,7 @@ ${Et}`;var a=class extends lit.LitElement{constructor(){super(...arguments);this
831
831
  <!-- Presence Indicator -->
832
832
  ${this.renderPresence()}
833
833
  </div>
834
- `}};a.stylesInjected=false,a.cdnBaseUrl="",a.instances=new Set,s([decorators_js.property({type:String})],a.prototype,"src",2),s([decorators_js.property({type:String})],a.prototype,"alt",2),s([decorators_js.property({type:String,attribute:"ext-customer-id"})],a.prototype,"extCustomerId",2),s([decorators_js.property({type:String})],a.prototype,"size",2),s([decorators_js.property({type:String})],a.prototype,"variant",2),s([decorators_js.property({type:String})],a.prototype,"shadow",2),s([decorators_js.property({type:Boolean})],a.prototype,"border",2),s([decorators_js.property({type:Number,attribute:"border-width"})],a.prototype,"borderWidth",2),s([decorators_js.property({type:String,attribute:"border-color"})],a.prototype,"borderColor",2),s([decorators_js.property({type:Number})],a.prototype,"rotation",2),s([decorators_js.property({type:String,attribute:"bg-color"})],a.prototype,"bgColor",2),s([decorators_js.property({type:String,attribute:"bg-gradient"})],a.prototype,"bgGradient",2),s([decorators_js.property({type:Object,attribute:"ring",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],a.prototype,"ring",2),s([decorators_js.property({type:Object,attribute:"presence",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],a.prototype,"presence",2),s([decorators_js.property({type:Object,attribute:"glow",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],a.prototype,"glow",2),s([decorators_js.property({type:Object,attribute:"badge",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],a.prototype,"badge",2),s([decorators_js.property({type:String})],a.prototype,"loading",2),s([decorators_js.property({type:String})],a.prototype,"placeholder",2),s([decorators_js.property({type:String,attribute:"placeholder-color"})],a.prototype,"placeholderColor",2),s([decorators_js.property({type:String})],a.prototype,"fallback",2),s([decorators_js.property({type:Object,attribute:"interactive",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],a.prototype,"interactive",2),s([decorators_js.state()],a.prototype,"isLoaded",2),s([decorators_js.state()],a.prototype,"hasError",2),s([decorators_js.state()],a.prototype,"cdnImageUrl",2),s([decorators_js.state()],a.prototype,"cdnLoadFailed",2),a=s([decorators_js.customElement("profile-picture")],a);var q=false;function Mt(){if(q||typeof document>"u")return;(typeof requestIdleCallback<"u"?requestIdleCallback:n=>setTimeout(n,1))(()=>{if(q)return;let n=document.createElement("style");n.textContent=mt,document.head.appendChild(n),q=true;});}var c=class extends lit.LitElement{constructor(){super(...arguments);this.max=y.max;this.direction=y.direction;this.overlap=y.overlap;this.size=y.size;this.showAddButton=false;this.addButtonLabel="Add user";this.animated=y.animated;this.rotationAmount=0;this.users=[];this.dropdownOpen=false;this.tooltipData=null;this.tooltipTimeout=null;this.slotObserver=null;this.portalContainer=null;this.counterRef=null;this.handleBackdropClick=()=>{this.dropdownOpen=false,this.destroyPortal();};}createRenderRoot(){return Mt(),this}get pixelSize(){return rt(this.size)}get tooltipEnabled(){return this.tooltip?.enabled!==false}get tooltipPosition(){return this.tooltip?.position??"top"}get tooltipDelay(){return this.tooltip?.delay??y.tooltipDelay}get dropdownMaxHeight(){return this.dropdown?.maxHeight??y.dropdownMaxHeight}get showPresence(){return this.dropdown?.showPresence!==false}get dropdownPosition(){return this.dropdown?.position??"bottom"}connectedCallback(){super.connectedCallback(),this.updateUsers(),this.setupSlotObserver();}disconnectedCallback(){super.disconnectedCallback(),this.slotObserver?.disconnect(),this.clearTooltipTimeout(),this.destroyPortal();}setupSlotObserver(){this.slotObserver=new MutationObserver(()=>{this.updateUsers();}),this.slotObserver.observe(this,{childList:true,subtree:true,attributes:true,attributeFilter:["src","alt","ext-customer-id","data-user-id","data-status","variant","shadow","border","border-width","border-color","bg-color","bg-gradient"]});}updateUsers(){let t=Array.from(this.children).filter(e=>e.tagName.toLowerCase()==="profile-picture"&&e.getAttribute("slot")!=="internal");this.users=t.map((e,o)=>{let i=(u,h)=>{let f=h??u,m=e[u];return m!=null&&m!==""?String(m):e.getAttribute(f)??void 0},p=i("borderWidth","border-width"),d=p?Number.parseInt(String(p),10):void 0;return {id:i("dataUserId","data-user-id"),name:i("alt")??`User ${o+1}`,src:i("src"),extCustomerId:i("extCustomerId","ext-customer-id"),status:i("dataStatus","data-status"),element:e,index:o,variant:i("variant"),shadow:i("shadow"),border:!!(e.border??e.hasAttribute("border")),borderWidth:d,borderColor:i("borderColor","border-color"),bgColor:i("bgColor","bg-color"),bgGradient:i("bgGradient","bg-gradient")}});for(let e of this.users)e.element&&(e.element.style.display="none");}createPortal(){this.portalContainer||(this.portalContainer=document.createElement("div"),this.portalContainer.className="ppg-portal",this.portalContainer.style.cssText="position: fixed; z-index: 99999; pointer-events: none;",document.body.appendChild(this.portalContainer),document.body.style.overflow="hidden");}destroyPortal(){this.portalContainer&&(lit.render(lit.nothing,this.portalContainer),this.portalContainer.remove(),this.portalContainer=null,document.body.style.overflow="");}updatePortalContent(t){if(!(this.portalContainer&&this.counterRef))return;let e=this.counterRef.getBoundingClientRect(),o=10,i=280,p=Math.min(this.dropdownMaxHeight+60,t.length*56+60),d=window.innerWidth,u=window.innerHeight;if(d<480){let F=lit.html`
834
+ `}};s([decorators_js.property({type:String})],a.prototype,"src"),s([decorators_js.property({type:String})],a.prototype,"alt"),s([decorators_js.property({type:String,attribute:"ext-customer-id"})],a.prototype,"extCustomerId"),s([decorators_js.property({type:String})],a.prototype,"size"),s([decorators_js.property({type:String})],a.prototype,"variant"),s([decorators_js.property({type:String})],a.prototype,"shadow"),s([decorators_js.property({type:Boolean})],a.prototype,"border"),s([decorators_js.property({type:Number,attribute:"border-width"})],a.prototype,"borderWidth"),s([decorators_js.property({type:String,attribute:"border-color"})],a.prototype,"borderColor"),s([decorators_js.property({type:Number})],a.prototype,"rotation"),s([decorators_js.property({type:String,attribute:"bg-color"})],a.prototype,"bgColor"),s([decorators_js.property({type:String,attribute:"bg-gradient"})],a.prototype,"bgGradient"),s([decorators_js.property({type:Object,attribute:"ring",converter:{fromAttribute:e=>{if(e)try{return JSON.parse(e)}catch{return}},toAttribute:e=>e?JSON.stringify(e):null}})],a.prototype,"ring"),s([decorators_js.property({type:Object,attribute:"presence",converter:{fromAttribute:e=>{if(e)try{return JSON.parse(e)}catch{return}},toAttribute:e=>e?JSON.stringify(e):null}})],a.prototype,"presence"),s([decorators_js.property({type:Object,attribute:"glow",converter:{fromAttribute:e=>{if(e)try{return JSON.parse(e)}catch{return}},toAttribute:e=>e?JSON.stringify(e):null}})],a.prototype,"glow"),s([decorators_js.property({type:Object,attribute:"badge",converter:{fromAttribute:e=>{if(e)try{return JSON.parse(e)}catch{return}},toAttribute:e=>e?JSON.stringify(e):null}})],a.prototype,"badge"),s([decorators_js.property({type:String})],a.prototype,"loading"),s([decorators_js.property({type:String})],a.prototype,"placeholder"),s([decorators_js.property({type:String,attribute:"placeholder-color"})],a.prototype,"placeholderColor"),s([decorators_js.property({type:String})],a.prototype,"fallback"),s([decorators_js.property({type:Object,attribute:"interactive",converter:{fromAttribute:e=>{if(e)try{return JSON.parse(e)}catch{return}},toAttribute:e=>e?JSON.stringify(e):null}})],a.prototype,"interactive"),s([decorators_js.state()],a.prototype,"isLoaded"),s([decorators_js.state()],a.prototype,"hasError"),s([decorators_js.state()],a.prototype,"cdnImageUrl"),s([decorators_js.state()],a.prototype,"cdnLoadFailed");var D=a;customElements.get("profile-picture")||customElements.define("profile-picture",D);var q=false;function Be(){if(q||typeof document>"u")return;(typeof requestIdleCallback<"u"?requestIdleCallback:n=>setTimeout(n,1))(()=>{if(q)return;let n=document.createElement("style");n.textContent=be,document.head.appendChild(n),q=true;});}var u=class extends lit.LitElement{constructor(){super(...arguments);this.max=y.max;this.direction=y.direction;this.overlap=y.overlap;this.size=y.size;this.showAddButton=false;this.addButtonLabel="Add user";this.animated=y.animated;this.rotationAmount=0;this.users=[];this.dropdownOpen=false;this.tooltipData=null;this.tooltipTimeout=null;this.slotObserver=null;this.portalContainer=null;this.counterRef=null;this.handleBackdropClick=()=>{this.dropdownOpen=false,this.destroyPortal();};}createRenderRoot(){return Be(),this}get pixelSize(){return ne(this.size)}get tooltipEnabled(){return this.tooltip?.enabled!==false}get tooltipPosition(){return this.tooltip?.position??"top"}get tooltipDelay(){return this.tooltip?.delay??y.tooltipDelay}get dropdownMaxHeight(){return this.dropdown?.maxHeight??y.dropdownMaxHeight}get showPresence(){return this.dropdown?.showPresence!==false}get dropdownPosition(){return this.dropdown?.position??"bottom"}connectedCallback(){super.connectedCallback(),this.updateUsers(),this.setupSlotObserver();}disconnectedCallback(){super.disconnectedCallback(),this.slotObserver?.disconnect(),this.clearTooltipTimeout(),this.destroyPortal();}setupSlotObserver(){this.slotObserver=new MutationObserver(()=>{this.updateUsers();}),this.slotObserver.observe(this,{childList:true,subtree:true,attributes:true,attributeFilter:["src","alt","ext-customer-id","data-user-id","data-status","variant","shadow","border","border-width","border-color","bg-color","bg-gradient"]});}updateUsers(){let e=Array.from(this.children).filter(t=>t.tagName.toLowerCase()==="profile-picture"&&t.getAttribute("slot")!=="internal");this.users=e.map((t,o)=>{let i=(g,f)=>{let h=f??g,m=t[g];return m!=null&&m!==""?String(m):t.getAttribute(h)??void 0},p=i("borderWidth","border-width"),d=p?Number.parseInt(String(p),10):void 0;return {id:i("dataUserId","data-user-id"),name:i("alt")??`User ${o+1}`,src:i("src"),extCustomerId:i("extCustomerId","ext-customer-id"),status:i("dataStatus","data-status"),element:t,index:o,variant:i("variant"),shadow:i("shadow"),border:!!(t.border??t.hasAttribute("border")),borderWidth:d,borderColor:i("borderColor","border-color"),bgColor:i("bgColor","bg-color"),bgGradient:i("bgGradient","bg-gradient")}});for(let t of this.users)t.element&&(t.element.style.display="none");}createPortal(){this.portalContainer||(this.portalContainer=document.createElement("div"),this.portalContainer.className="ppg-portal",this.portalContainer.style.cssText="position: fixed; z-index: 99999; pointer-events: none;",document.body.appendChild(this.portalContainer),document.body.style.overflow="hidden");}destroyPortal(){this.portalContainer&&(lit.render(lit.nothing,this.portalContainer),this.portalContainer.remove(),this.portalContainer=null,document.body.style.overflow="");}updatePortalContent(e){if(!(this.portalContainer&&this.counterRef))return;let t=this.counterRef.getBoundingClientRect(),o=10,i=280,p=Math.min(this.dropdownMaxHeight+60,e.length*56+60),d=window.innerWidth,g=window.innerHeight;if(d<480){let F=lit.html`
835
835
  <div
836
836
  class="ppg-backdrop ppg-backdrop-visible"
837
837
  style="pointer-events: auto; background: rgba(0,0,0,0.5);"
@@ -846,16 +846,16 @@ ${Et}`;var a=class extends lit.LitElement{constructor(){super(...arguments);this
846
846
  aria-label="Hidden users"
847
847
  >
848
848
  <div class="ppg-dropdown-header">
849
- ${t.length} more
849
+ ${e.length} more
850
850
  </div>
851
851
  <div
852
852
  class="ppg-dropdown-list"
853
853
  style=${styleMap_js.styleMap({maxHeight:"calc(70vh - 60px)"})}
854
854
  >
855
- ${t.map(xt=>this.renderDropdownItem(xt))}
855
+ ${e.map(we=>this.renderDropdownItem(we))}
856
856
  </div>
857
857
  </div>
858
- `;lit.render(F,this.portalContainer);return}let f=u-e.bottom-o,m=e.top-o,z=d-e.left,O=e.right,I=this.dropdownPosition;I==="bottom"&&f<p&&m>f?I="top":I==="top"&&m<p&&f>m&&(I="bottom");let g;z>=i?g=e.left:O>=i?g=e.right-i:g=(d-i)/2,g=Math.max(8,Math.min(g,d-i-8));let R=I==="bottom"?e.bottom+o:void 0,Y=I==="top"?u-e.top+o:void 0,bt=lit.html`
858
+ `;lit.render(F,this.portalContainer);return}let h=g-t.bottom-o,m=t.top-o,z=d-t.left,O=t.right,I=this.dropdownPosition;I==="bottom"&&h<p&&m>h?I="top":I==="top"&&m<p&&h>m&&(I="bottom");let c;z>=i?c=t.left:O>=i?c=t.right-i:c=(d-i)/2,c=Math.max(8,Math.min(c,d-i-8));let B=I==="bottom"?t.bottom+o:void 0,Y=I==="top"?g-t.top+o:void 0,xe=lit.html`
859
859
  <div
860
860
  class="ppg-backdrop"
861
861
  style="pointer-events: auto;"
@@ -864,74 +864,74 @@ ${Et}`;var a=class extends lit.LitElement{constructor(){super(...arguments);this
864
864
  ></div>
865
865
  <div
866
866
  class="ppg-dropdown ppg-dropdown-portal"
867
- style=${styleMap_js.styleMap({position:"fixed",pointerEvents:"auto",top:R!==void 0?`${R}px`:"auto",bottom:Y!==void 0?`${Y}px`:"auto",left:`${g}px`,width:`${i}px`})}
867
+ style=${styleMap_js.styleMap({position:"fixed",pointerEvents:"auto",top:B!==void 0?`${B}px`:"auto",bottom:Y!==void 0?`${Y}px`:"auto",left:`${c}px`,width:`${i}px`})}
868
868
  data-position=${I}
869
869
  role="menu"
870
870
  aria-label="Hidden users"
871
871
  >
872
872
  <div class="ppg-dropdown-header">
873
- ${t.length} more
873
+ ${e.length} more
874
874
  </div>
875
875
  <div
876
876
  class="ppg-dropdown-list"
877
877
  style=${styleMap_js.styleMap({maxHeight:`${this.dropdownMaxHeight}px`})}
878
878
  >
879
- ${t.map(F=>this.renderDropdownItem(F))}
879
+ ${e.map(F=>this.renderDropdownItem(F))}
880
880
  </div>
881
881
  </div>
882
- `;lit.render(bt,this.portalContainer);}handleAvatarClick(t){this.dispatchEvent(new CustomEvent("avatar-click",{detail:{user:t},bubbles:true,composed:true}));}handleAvatarHover(t,e){if(!this.tooltipEnabled)return;this.clearTooltipTimeout();let o=e.currentTarget;this.tooltipTimeout=window.setTimeout(()=>{this.tooltipData={user:t,rect:o.getBoundingClientRect()};},this.tooltipDelay),this.dispatchEvent(new CustomEvent("avatar-hover",{detail:{user:t},bubbles:true,composed:true}));}handleAvatarLeave(){this.clearTooltipTimeout(),this.tooltipData=null;}clearTooltipTimeout(){this.tooltipTimeout&&(window.clearTimeout(this.tooltipTimeout),this.tooltipTimeout=null);}handleCounterClick(t){this.dropdownOpen=!this.dropdownOpen,this.dropdownOpen?(this.createPortal(),this.updatePortalContent(t)):this.destroyPortal(),this.dispatchEvent(new CustomEvent("counter-click",{detail:{hiddenUsers:t,open:this.dropdownOpen},bubbles:true,composed:true}));}handleDropdownItemClick(t){this.dropdownOpen=false,this.destroyPortal(),this.dispatchEvent(new CustomEvent("dropdown-item-click",{detail:{user:t},bubbles:true,composed:true}));}handleAddClick(){this.dispatchEvent(new CustomEvent("add-click",{bubbles:true,composed:true}));}handleKeyDown(t,e){(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),e());}renderAvatar(t,e,o){let i=U(e,this.pixelSize,this.overlap,this.direction,this.spacing),p=nt(e,o,this.direction),d=t.variant??"circle",u=t.shadow??"none",h=this.rotationAmount?e%2===0?-this.rotationAmount:this.rotationAmount:0;return lit.html`
882
+ `;lit.render(xe,this.portalContainer);}handleAvatarClick(e){this.dispatchEvent(new CustomEvent("avatar-click",{detail:{user:e},bubbles:true,composed:true}));}handleAvatarHover(e,t){if(!this.tooltipEnabled)return;this.clearTooltipTimeout();let o=t.currentTarget;this.tooltipTimeout=window.setTimeout(()=>{this.tooltipData={user:e,rect:o.getBoundingClientRect()};},this.tooltipDelay),this.dispatchEvent(new CustomEvent("avatar-hover",{detail:{user:e},bubbles:true,composed:true}));}handleAvatarLeave(){this.clearTooltipTimeout(),this.tooltipData=null;}clearTooltipTimeout(){this.tooltipTimeout&&(window.clearTimeout(this.tooltipTimeout),this.tooltipTimeout=null);}handleCounterClick(e){this.dropdownOpen=!this.dropdownOpen,this.dropdownOpen?(this.createPortal(),this.updatePortalContent(e)):this.destroyPortal(),this.dispatchEvent(new CustomEvent("counter-click",{detail:{hiddenUsers:e,open:this.dropdownOpen},bubbles:true,composed:true}));}handleDropdownItemClick(e){this.dropdownOpen=false,this.destroyPortal(),this.dispatchEvent(new CustomEvent("dropdown-item-click",{detail:{user:e},bubbles:true,composed:true}));}handleAddClick(){this.dispatchEvent(new CustomEvent("add-click",{bubbles:true,composed:true}));}handleKeyDown(e,t){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),t());}renderAvatar(e,t,o){let i=P(t,this.pixelSize,this.overlap,this.direction,this.spacing),p=oe(t,o,this.direction),d=e.variant??"circle",g=e.shadow??"none",f=this.rotationAmount?t%2===0?-this.rotationAmount:this.rotationAmount:0;return lit.html`
883
883
  <div
884
884
  class="ppg-avatar-wrapper"
885
885
  style=${styleMap_js.styleMap({left:`${i}px`,zIndex:String(p),width:`${this.pixelSize}px`,height:`${this.pixelSize}px`})}
886
886
  tabindex="0"
887
887
  role="button"
888
- aria-label=${t.name}
889
- @click=${()=>this.handleAvatarClick(t)}
890
- @mouseenter=${f=>this.handleAvatarHover(t,f)}
888
+ aria-label=${e.name}
889
+ @click=${()=>this.handleAvatarClick(e)}
890
+ @mouseenter=${h=>this.handleAvatarHover(e,h)}
891
891
  @mouseleave=${this.handleAvatarLeave}
892
- @keydown=${f=>this.handleKeyDown(f,()=>this.handleAvatarClick(t))}
892
+ @keydown=${h=>this.handleKeyDown(h,()=>this.handleAvatarClick(e))}
893
893
  >
894
- ${this.renderProfilePicture(t,d,u,h)}
894
+ ${this.renderProfilePicture(e,d,g,f)}
895
895
  </div>
896
- `}renderProfilePicture(t,e,o,i){return lit.html`
896
+ `}renderProfilePicture(e,t,o,i){return lit.html`
897
897
  <profile-picture
898
- .src=${t.src||void 0}
899
- .alt=${t.name}
898
+ .src=${e.src||void 0}
899
+ .alt=${e.name}
900
900
  .size=${this.pixelSize}
901
- .variant=${e}
901
+ .variant=${t}
902
902
  .shadow=${o}
903
903
  .rotation=${i}
904
- .extCustomerId=${t.extCustomerId}
905
- ?border=${t.border}
906
- .borderWidth=${t.border?t.borderWidth??2:2}
907
- .borderColor=${t.border?t.borderColor??"#ffffff":"#ffffff"}
908
- .bgColor=${t.bgGradient?void 0:t.bgColor??"#ffffff"}
909
- .bgGradient=${t.bgGradient??void 0}
910
- data-user-id=${t.id??""}
911
- data-status=${t.status??""}
904
+ .extCustomerId=${e.extCustomerId}
905
+ ?border=${e.border}
906
+ .borderWidth=${e.border?e.borderWidth??2:2}
907
+ .borderColor=${e.border?e.borderColor??"#ffffff":"#ffffff"}
908
+ .bgColor=${e.bgGradient?void 0:e.bgColor??"#ffffff"}
909
+ .bgGradient=${e.bgGradient??void 0}
910
+ data-user-id=${e.id??""}
911
+ data-status=${e.status??""}
912
912
  ></profile-picture>
913
- `}renderCounter(t,e,o){return lit.html`
913
+ `}renderCounter(e,t,o){return lit.html`
914
914
  <button
915
915
  class="ppg-counter"
916
- style=${styleMap_js.styleMap({left:`${e}px`,width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,zIndex:"1"})}
917
- aria-label=${`${t} more users`}
916
+ style=${styleMap_js.styleMap({left:`${t}px`,width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,zIndex:"1"})}
917
+ aria-label=${`${e} more users`}
918
918
  aria-expanded=${this.dropdownOpen}
919
919
  aria-haspopup="true"
920
920
  @click=${()=>this.handleCounterClick(o)}
921
921
  >
922
- ${it(t)}
922
+ ${ae(e)}
923
923
  </button>
924
- `}renderAddButton(t){let e=Math.round(this.pixelSize*.4);return lit.html`
924
+ `}renderAddButton(e){let t=Math.round(this.pixelSize*.4);return lit.html`
925
925
  <button
926
926
  class="ppg-add-button"
927
- style=${styleMap_js.styleMap({left:`${t}px`,width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,zIndex:"1"})}
927
+ style=${styleMap_js.styleMap({left:`${e}px`,width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,zIndex:"1"})}
928
928
  aria-label=${this.addButtonLabel}
929
929
  @click=${this.handleAddClick}
930
930
  >
931
931
  <svg
932
932
  class="ppg-add-icon"
933
- width=${e}
934
- height=${e}
933
+ width=${t}
934
+ height=${t}
935
935
  viewBox="0 0 24 24"
936
936
  fill="none"
937
937
  stroke="currentColor"
@@ -943,54 +943,54 @@ ${Et}`;var a=class extends lit.LitElement{constructor(){super(...arguments);this
943
943
  <line x1="5" y1="12" x2="19" y2="12"></line>
944
944
  </svg>
945
945
  </button>
946
- `}renderTooltip(){if(!this.tooltipData)return lit.nothing;let{user:t,rect:e}=this.tooltipData,o=8,i=this.getBoundingClientRect(),p=e.left-i.left+e.width/2,d=e.top-i.top,u=e.bottom-i.top,h=this.tooltipPosition==="top";return lit.html`
946
+ `}renderTooltip(){if(!this.tooltipData)return lit.nothing;let{user:e,rect:t}=this.tooltipData,o=8,i=this.getBoundingClientRect(),p=t.left-i.left+t.width/2,d=t.top-i.top,g=t.bottom-i.top,f=this.tooltipPosition==="top";return lit.html`
947
947
  <div
948
948
  class="ppg-tooltip"
949
- style=${styleMap_js.styleMap({top:h?"auto":`${u+o}px`,bottom:h?`${i.height-d+o}px`:"auto",left:`${p}px`})}
949
+ style=${styleMap_js.styleMap({top:f?"auto":`${g+o}px`,bottom:f?`${i.height-d+o}px`:"auto",left:`${p}px`})}
950
950
  data-position=${this.tooltipPosition}
951
951
  role="tooltip"
952
952
  >
953
- ${t.name}
953
+ ${e.name}
954
954
  </div>
955
- `}renderDropdownItem(t){let e=M(t.name),o=t.src||t.extCustomerId;return lit.html`
955
+ `}renderDropdownItem(e){let t=U(e.name),o=e.src||e.extCustomerId;return lit.html`
956
956
  <div
957
957
  class="ppg-dropdown-item"
958
958
  role="menuitem"
959
959
  tabindex="0"
960
- @click=${()=>this.handleDropdownItemClick(t)}
961
- @keydown=${i=>this.handleKeyDown(i,()=>this.handleDropdownItemClick(t))}
960
+ @click=${()=>this.handleDropdownItemClick(e)}
961
+ @keydown=${i=>this.handleKeyDown(i,()=>this.handleDropdownItemClick(e))}
962
962
  >
963
963
  ${o?lit.html`<profile-picture
964
964
  class="ppg-dropdown-avatar"
965
- .src=${t.src||void 0}
966
- .alt=${t.name}
967
- .extCustomerId=${t.extCustomerId}
965
+ .src=${e.src||void 0}
966
+ .alt=${e.name}
967
+ .extCustomerId=${e.extCustomerId}
968
968
  .size=${40}
969
969
  variant="circle"
970
970
  shadow="none"
971
971
  ></profile-picture>`:lit.html`<div
972
972
  class="ppg-dropdown-avatar-fallback"
973
- style=${styleMap_js.styleMap({background:e})}
973
+ style=${styleMap_js.styleMap({background:t})}
974
974
  >
975
- ${B(t.name)}
975
+ ${M(e.name)}
976
976
  </div>`}
977
977
  <div class="ppg-dropdown-info">
978
- <div class="ppg-dropdown-name">${t.name}</div>
979
- ${this.showPresence&&t.status?lit.html`
978
+ <div class="ppg-dropdown-name">${e.name}</div>
979
+ ${this.showPresence&&e.status?lit.html`
980
980
  <div class="ppg-dropdown-status">
981
981
  <span
982
982
  class="ppg-dropdown-presence"
983
- data-status=${t.status}
983
+ data-status=${e.status}
984
984
  ></span>
985
- ${this.formatStatus(t.status)}
985
+ ${this.formatStatus(e.status)}
986
986
  </div>
987
987
  `:lit.nothing}
988
988
  </div>
989
989
  </div>
990
- `}formatStatus(t){return {online:"Online",away:"Away",busy:"Busy",offline:"Offline",dnd:"Do not disturb"}[t]??t}updated(t){super.updated(t);let e=this.querySelector(".ppg-counter");if(e&&(this.counterRef=e),this.dropdownOpen&&this.portalContainer){let{visible:o}=H(this.users.length,this.max,this.showAddButton),i=this.users.slice(o);this.updatePortalContent(i);}}render(){let{visible:t,hidden:e,showCounter:o}=H(this.users.length,this.max,this.showAddButton),i=this.direction==="ltr"?this.users.slice(0,t):this.users.slice(0,t).reverse(),p=this.users.slice(t),d=t;o&&d++,this.showAddButton&&d++;let u=ot(d,this.pixelSize,this.overlap,this.spacing),h=o?U(t,this.pixelSize,this.overlap,this.direction,this.spacing):0,f=U(t+(o?1:0),this.pixelSize,this.overlap,this.direction,this.spacing);return lit.html`
990
+ `}formatStatus(e){return {online:"Online",away:"Away",busy:"Busy",offline:"Offline",dnd:"Do not disturb"}[e]??e}updated(e){super.updated(e);let t=this.querySelector(".ppg-counter");if(t&&(this.counterRef=t),this.dropdownOpen&&this.portalContainer){let{visible:o}=H(this.users.length,this.max,this.showAddButton),i=this.users.slice(o);this.updatePortalContent(i);}}render(){let{visible:e,hidden:t,showCounter:o}=H(this.users.length,this.max,this.showAddButton),i=this.direction==="ltr"?this.users.slice(0,e):this.users.slice(0,e).reverse(),p=this.users.slice(e),d=e;o&&d++,this.showAddButton&&d++;let g=ie(d,this.pixelSize,this.overlap,this.spacing),f=o?P(e,this.pixelSize,this.overlap,this.direction,this.spacing):0,h=P(e+(o?1:0),this.pixelSize,this.overlap,this.direction,this.spacing);return lit.html`
991
991
  <div
992
992
  class=${k("ppg-container",this.animated&&"ppg-animated")}
993
- style=${styleMap_js.styleMap({width:`${u}px`,height:`${this.pixelSize}px`})}
993
+ style=${styleMap_js.styleMap({width:`${g}px`,height:`${this.pixelSize}px`})}
994
994
  role="group"
995
995
  aria-label="User avatars"
996
996
  >
@@ -998,16 +998,16 @@ ${Et}`;var a=class extends lit.LitElement{constructor(){super(...arguments);this
998
998
  <slot style="display: none;"></slot>
999
999
 
1000
1000
  <!-- Visible avatars -->
1001
- ${i.map((m,z)=>this.renderAvatar(m,z,t))}
1001
+ ${i.map((m,z)=>this.renderAvatar(m,z,e))}
1002
1002
 
1003
1003
  <!-- Counter -->
1004
- ${o?this.renderCounter(e,h,p):lit.nothing}
1004
+ ${o?this.renderCounter(t,f,p):lit.nothing}
1005
1005
 
1006
1006
  <!-- Add button -->
1007
- ${this.showAddButton?this.renderAddButton(f):lit.nothing}
1007
+ ${this.showAddButton?this.renderAddButton(h):lit.nothing}
1008
1008
 
1009
1009
  <!-- Tooltip -->
1010
1010
  ${this.renderTooltip()}
1011
1011
  </div>
1012
- `}};s([decorators_js.property({type:Number})],c.prototype,"max",2),s([decorators_js.property({type:String})],c.prototype,"direction",2),s([decorators_js.property({type:Number})],c.prototype,"overlap",2),s([decorators_js.property({type:String})],c.prototype,"size",2),s([decorators_js.property({type:Number})],c.prototype,"spacing",2),s([decorators_js.property({type:Object})],c.prototype,"tooltip",2),s([decorators_js.property({type:Object})],c.prototype,"dropdown",2),s([decorators_js.property({type:Boolean,attribute:"show-add-button"})],c.prototype,"showAddButton",2),s([decorators_js.property({type:String,attribute:"add-button-label"})],c.prototype,"addButtonLabel",2),s([decorators_js.property({type:Boolean})],c.prototype,"animated",2),s([decorators_js.property({type:Number,attribute:"rotation-amount"})],c.prototype,"rotationAmount",2),s([decorators_js.state()],c.prototype,"users",2),s([decorators_js.state()],c.prototype,"dropdownOpen",2),s([decorators_js.state()],c.prototype,"tooltipData",2),c=s([decorators_js.customElement("profile-picture-group")],c);function pe(r){a.setCdnBaseUrl(r);}function de(){return a.getCdnBaseUrl()}K();exports.getCdnBaseUrl=de;exports.setCdnBaseUrl=pe;//# sourceMappingURL=angular.cjs.map
1012
+ `}};s([decorators_js.property({type:Number})],u.prototype,"max"),s([decorators_js.property({type:String})],u.prototype,"direction"),s([decorators_js.property({type:Number})],u.prototype,"overlap"),s([decorators_js.property({type:String})],u.prototype,"size"),s([decorators_js.property({type:Number})],u.prototype,"spacing"),s([decorators_js.property({type:Object})],u.prototype,"tooltip"),s([decorators_js.property({type:Object})],u.prototype,"dropdown"),s([decorators_js.property({type:Boolean,attribute:"show-add-button"})],u.prototype,"showAddButton"),s([decorators_js.property({type:String,attribute:"add-button-label"})],u.prototype,"addButtonLabel"),s([decorators_js.property({type:Boolean})],u.prototype,"animated"),s([decorators_js.property({type:Number,attribute:"rotation-amount"})],u.prototype,"rotationAmount"),s([decorators_js.state()],u.prototype,"users"),s([decorators_js.state()],u.prototype,"dropdownOpen"),s([decorators_js.state()],u.prototype,"tooltipData");customElements.get("profile-picture-group")||customElements.define("profile-picture-group",u);function st(r){D.setCdnBaseUrl(r);}function pt(){return D.getCdnBaseUrl()}K();exports.getCdnBaseUrl=pt;exports.setCdnBaseUrl=st;//# sourceMappingURL=angular.cjs.map
1013
1013
  //# sourceMappingURL=angular.cjs.map