@grasco/profile-picture 0.1.9 → 0.2.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.
package/dist/react.d.cts CHANGED
@@ -11,6 +11,8 @@ type Variant = "circle" | "rounded" | "squircle" | "square";
11
11
  type Position = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
12
12
  type LoadingStrategy = "lazy" | "eager";
13
13
  type PlaceholderType = "shimmer" | "pulse" | "blur" | "skeleton" | "none";
14
+ type FallbackMode = "initials" | "gradient";
15
+ type ImageMode = "transparent" | "original";
14
16
  type PresenceStatus = "online" | "away" | "busy" | "offline" | "dnd";
15
17
  interface PresenceConfig {
16
18
  /** Current status */
@@ -88,6 +90,8 @@ interface ProfilePictureProps$1 {
88
90
  alt?: string;
89
91
  /** External customer ID for CDN image loading */
90
92
  extCustomerId?: string;
93
+ /** CDN image mode: 'transparent' for transparent background, 'original' for original background */
94
+ imageMode?: ImageMode;
91
95
  /** Predefined size or custom pixel value */
92
96
  size?: Size | number;
93
97
  /** Shape variant */
@@ -122,6 +126,8 @@ interface ProfilePictureProps$1 {
122
126
  placeholderColor?: string;
123
127
  /** Custom fallback text (overrides initials from alt) */
124
128
  fallback?: string;
129
+ /** Fallback display mode: 'initials' shows letters, 'gradient' shows cloudy gradient */
130
+ fallbackMode?: FallbackMode;
125
131
  /** Interactive behavior configuration */
126
132
  interactive?: InteractionConfig;
127
133
  }
@@ -352,6 +358,11 @@ declare function getCdnBaseUrl(): string;
352
358
  /**
353
359
  * React-specific props extending the core ProfilePictureProps
354
360
  */
361
+ interface ProfilePictureClickDetail {
362
+ extCustomerId?: string;
363
+ alt?: string;
364
+ src?: string;
365
+ }
355
366
  interface ProfilePictureProps extends ProfilePictureProps$1 {
356
367
  /** Called when image loads successfully */
357
368
  onLoad?: () => void;
@@ -361,6 +372,8 @@ interface ProfilePictureProps extends ProfilePictureProps$1 {
361
372
  onCdnError?: (detail: {
362
373
  error: string;
363
374
  }) => void;
375
+ /** Called when the profile picture is clicked (requires interactive.pressable) */
376
+ onClick?: (detail: ProfilePictureClickDetail) => void;
364
377
  /** Additional CSS class names */
365
378
  className?: string;
366
379
  /** Inline styles */
@@ -372,13 +385,14 @@ interface ProfilePictureProps extends ProfilePictureProps$1 {
372
385
  * Type-safe wrapper around the profile-picture web component.
373
386
  * Uses ref as a prop (React 19+ pattern).
374
387
  */
375
- declare function ProfilePicture({ src, alt, extCustomerId, size, variant, shadow, border, borderWidth, borderColor, rotation, bgColor, bgGradient, glow, ring, presence, badge, loading, placeholder, placeholderColor, fallback, interactive, onLoad, onError, onCdnError, className, style, ref, }: ProfilePictureProps & {
388
+ declare function ProfilePicture({ src, alt, extCustomerId, imageMode, size, variant, shadow, border, borderWidth, borderColor, rotation, bgColor, bgGradient, glow, ring, presence, badge, loading, placeholder, placeholderColor, fallback, fallbackMode, interactive, onLoad, onError, onCdnError, onClick, className, style, ref, }: ProfilePictureProps & {
376
389
  ref?: React.Ref<HTMLElement>;
377
390
  }): React.ReactElement<{
378
391
  ref: React.RefObject<HTMLElement>;
379
392
  src: string | undefined;
380
393
  alt: string | undefined;
381
394
  "ext-customer-id": string | undefined;
395
+ "image-mode": ImageMode | undefined;
382
396
  size: number | Size | undefined;
383
397
  variant: Variant | undefined;
384
398
  shadow: ShadowPreset | undefined;
@@ -396,12 +410,13 @@ declare function ProfilePicture({ src, alt, extCustomerId, size, variant, shadow
396
410
  placeholder: PlaceholderType | undefined;
397
411
  "placeholder-color": string | undefined;
398
412
  fallback: string | undefined;
413
+ "fallback-mode": FallbackMode | undefined;
399
414
  interactive: string | undefined;
400
415
  class: string | undefined;
401
416
  style: React.CSSProperties | undefined;
402
- }, string | React.JSXElementConstructor<any>>;
417
+ }, string | React.JSXElementConstructor<any>> | null;
403
418
  declare namespace ProfilePicture {
404
419
  var displayName: string;
405
420
  }
406
421
 
407
- export { type BadgeConfig, type DropdownConfig, type GlowConfig, type GroupUserData, type InteractionConfig, type LoadingStrategy, type PlaceholderType, type PresenceConfig, ProfilePicture, ProfilePictureGroup, type ProfilePictureGroupProps, type ProfilePictureProps, type RingConfig, type ShadowPreset, type Size, type StackDirection, type TooltipConfig, type Variant, getCdnBaseUrl, setCdnBaseUrl };
422
+ export { type BadgeConfig, type DropdownConfig, type FallbackMode, type GlowConfig, type GroupUserData, type ImageMode, type InteractionConfig, type LoadingStrategy, type PlaceholderType, type PresenceConfig, ProfilePicture, type ProfilePictureClickDetail, ProfilePictureGroup, type ProfilePictureGroupProps, type ProfilePictureProps, type RingConfig, type ShadowPreset, type Size, type StackDirection, type TooltipConfig, type Variant, getCdnBaseUrl, setCdnBaseUrl };
package/dist/react.d.ts CHANGED
@@ -11,6 +11,8 @@ type Variant = "circle" | "rounded" | "squircle" | "square";
11
11
  type Position = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
12
12
  type LoadingStrategy = "lazy" | "eager";
13
13
  type PlaceholderType = "shimmer" | "pulse" | "blur" | "skeleton" | "none";
14
+ type FallbackMode = "initials" | "gradient";
15
+ type ImageMode = "transparent" | "original";
14
16
  type PresenceStatus = "online" | "away" | "busy" | "offline" | "dnd";
15
17
  interface PresenceConfig {
16
18
  /** Current status */
@@ -88,6 +90,8 @@ interface ProfilePictureProps$1 {
88
90
  alt?: string;
89
91
  /** External customer ID for CDN image loading */
90
92
  extCustomerId?: string;
93
+ /** CDN image mode: 'transparent' for transparent background, 'original' for original background */
94
+ imageMode?: ImageMode;
91
95
  /** Predefined size or custom pixel value */
92
96
  size?: Size | number;
93
97
  /** Shape variant */
@@ -122,6 +126,8 @@ interface ProfilePictureProps$1 {
122
126
  placeholderColor?: string;
123
127
  /** Custom fallback text (overrides initials from alt) */
124
128
  fallback?: string;
129
+ /** Fallback display mode: 'initials' shows letters, 'gradient' shows cloudy gradient */
130
+ fallbackMode?: FallbackMode;
125
131
  /** Interactive behavior configuration */
126
132
  interactive?: InteractionConfig;
127
133
  }
@@ -352,6 +358,11 @@ declare function getCdnBaseUrl(): string;
352
358
  /**
353
359
  * React-specific props extending the core ProfilePictureProps
354
360
  */
361
+ interface ProfilePictureClickDetail {
362
+ extCustomerId?: string;
363
+ alt?: string;
364
+ src?: string;
365
+ }
355
366
  interface ProfilePictureProps extends ProfilePictureProps$1 {
356
367
  /** Called when image loads successfully */
357
368
  onLoad?: () => void;
@@ -361,6 +372,8 @@ interface ProfilePictureProps extends ProfilePictureProps$1 {
361
372
  onCdnError?: (detail: {
362
373
  error: string;
363
374
  }) => void;
375
+ /** Called when the profile picture is clicked (requires interactive.pressable) */
376
+ onClick?: (detail: ProfilePictureClickDetail) => void;
364
377
  /** Additional CSS class names */
365
378
  className?: string;
366
379
  /** Inline styles */
@@ -372,13 +385,14 @@ interface ProfilePictureProps extends ProfilePictureProps$1 {
372
385
  * Type-safe wrapper around the profile-picture web component.
373
386
  * Uses ref as a prop (React 19+ pattern).
374
387
  */
375
- declare function ProfilePicture({ src, alt, extCustomerId, size, variant, shadow, border, borderWidth, borderColor, rotation, bgColor, bgGradient, glow, ring, presence, badge, loading, placeholder, placeholderColor, fallback, interactive, onLoad, onError, onCdnError, className, style, ref, }: ProfilePictureProps & {
388
+ declare function ProfilePicture({ src, alt, extCustomerId, imageMode, size, variant, shadow, border, borderWidth, borderColor, rotation, bgColor, bgGradient, glow, ring, presence, badge, loading, placeholder, placeholderColor, fallback, fallbackMode, interactive, onLoad, onError, onCdnError, onClick, className, style, ref, }: ProfilePictureProps & {
376
389
  ref?: React.Ref<HTMLElement>;
377
390
  }): React.ReactElement<{
378
391
  ref: React.RefObject<HTMLElement>;
379
392
  src: string | undefined;
380
393
  alt: string | undefined;
381
394
  "ext-customer-id": string | undefined;
395
+ "image-mode": ImageMode | undefined;
382
396
  size: number | Size | undefined;
383
397
  variant: Variant | undefined;
384
398
  shadow: ShadowPreset | undefined;
@@ -396,12 +410,13 @@ declare function ProfilePicture({ src, alt, extCustomerId, size, variant, shadow
396
410
  placeholder: PlaceholderType | undefined;
397
411
  "placeholder-color": string | undefined;
398
412
  fallback: string | undefined;
413
+ "fallback-mode": FallbackMode | undefined;
399
414
  interactive: string | undefined;
400
415
  class: string | undefined;
401
416
  style: React.CSSProperties | undefined;
402
- }, string | React.JSXElementConstructor<any>>;
417
+ }, string | React.JSXElementConstructor<any>> | null;
403
418
  declare namespace ProfilePicture {
404
419
  var displayName: string;
405
420
  }
406
421
 
407
- export { type BadgeConfig, type DropdownConfig, type GlowConfig, type GroupUserData, type InteractionConfig, type LoadingStrategy, type PlaceholderType, type PresenceConfig, ProfilePicture, ProfilePictureGroup, type ProfilePictureGroupProps, type ProfilePictureProps, type RingConfig, type ShadowPreset, type Size, type StackDirection, type TooltipConfig, type Variant, getCdnBaseUrl, setCdnBaseUrl };
422
+ export { type BadgeConfig, type DropdownConfig, type FallbackMode, type GlowConfig, type GroupUserData, type ImageMode, type InteractionConfig, type LoadingStrategy, type PlaceholderType, type PresenceConfig, ProfilePicture, type ProfilePictureClickDetail, ProfilePictureGroup, type ProfilePictureGroupProps, type ProfilePictureProps, type RingConfig, type ShadowPreset, type Size, type StackDirection, type TooltipConfig, type Variant, getCdnBaseUrl, setCdnBaseUrl };
package/dist/react.js CHANGED
@@ -1,4 +1,4 @@
1
- import Ae,{useRef,useCallback,useEffect}from'react';import {LitElement,nothing,html,render}from'lit';import {property,state}from'lit/decorators.js';import {styleMap}from'lit/directives/style-map.js';var Be=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&&Be(n,e,o),o};var te="grasco-profile-picture-styles",G=false,de=false;function le(){if(G||typeof document>"u")return;if(document.getElementById(te)){G=true;return}if(document.querySelector('link[href*="profile-picture"][href$="styles.css"]')){G=true;return}de||(de=true,Ge());}function Ge(){(typeof requestIdleCallback<"u"?requestIdleCallback:n=>setTimeout(n,1))(()=>Fe());}function Fe(){if(G||typeof document>"u")return;if(document.getElementById(te)){G=true;return}let r=Ne();if(!r)return;let n=document.createElement("link");n.id=te,n.rel="stylesheet",n.href=r,document.head.appendChild(n),G=true;}function Ne(){if(typeof window<"u"&&window.__GRASCO_PROFILE_PICTURE_CSS__)return window.__GRASCO_PROFILE_PICTURE_CSS__;try{let n=import.meta.url;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 F={"2xs":20,xs:24,sm:32,md:40,lg:48,xl:64,"2xl":80,"3xl":120},ce={online:"#30D158",away:"#FFD60A",busy:"#FF453A",offline:"#8E8E93",dnd:"#FF453A"},ue={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)"},$={size:"md",variant:"circle",loading:"lazy",placeholder:"shimmer",borderWidth:2,borderColor:"#ffffff",placeholderColor:"#f3f4f6",shadow:"sm"};var N={circle:"9999px",rounded:"12px",squircle:"30%",square:"0px"},I={max:4,direction:"ltr",overlap:.3,size:"md",tooltipDelay:300,dropdownMaxHeight:280,animated:true};function R(...r){return r.filter(Boolean).join(" ")}function re(r){return /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(r)}function Y(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 ne(r){return Math.round(r*.38)}function ge(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 fe(r,n){let e=Math.min(16,Math.max(8,Math.round(r*.2)));return Math.min(18,e+(n-1)*2)}function me(r,n){return typeof r=="string"?r:n&&r>n?`${n}+`:r.toString()}function he(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 He(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 be(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 K(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=He(r)%n.length;return n[e]}function xe(r){return typeof r=="number"?r:F[r]??F[I.size]}function oe(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 X(r,n,e,t,o){let i=o??n*(1-e);return r*i}function ve(r,n,e){return e==="ltr"?n-r:r+1}function we(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 ye(r){return r>99?"+99":`+${r}`}function Ce(r){return r<=80?"80":r<=120?"120":r<=240?"240":r<=480?"480":"960"}function Se(r){if(!(r&&re(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 ke(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 $e(r){return {circle:"np:rounded-full",rounded:"np:rounded-xl",squircle:"np:rounded-[30%]",square:"np:rounded-none"}[r]}function Ie(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 Ee(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 ze(r){return {boxShadow:ue[r]}}var je={shimmer:`
1
+ import Ne,{useRef,useCallback,useEffect,useState}from'react';import {LitElement,nothing,html,render}from'lit';import {property,state}from'lit/decorators.js';import {styleMap}from'lit/directives/style-map.js';var We=Object.defineProperty;var s=(r,o,e,t)=>{for(var n=void 0,i=r.length-1,p;i>=0;i--)(p=r[i])&&(n=(p(o,e,n))||n);return n&&We(o,e,n),n};var se="grasco-profile-picture-styles",N=false,me=false;function he(){if(N||typeof document>"u")return;if(document.getElementById(se)){N=true;return}if(document.querySelector('link[href*="profile-picture"][href$="styles.css"]')){N=true;return}me||(me=true,Je());}function Je(){(typeof requestIdleCallback<"u"?requestIdleCallback:o=>setTimeout(o,1))(()=>Ye());}function Ye(){if(N||typeof document>"u")return;if(document.getElementById(se)){N=true;return}let r=Ke();if(!r)return;let o=document.createElement("link");o.id=se,o.rel="stylesheet",o.href=r,document.head.appendChild(o),N=true;}function Ke(){if(typeof window<"u"&&window.__GRASCO_PROFILE_PICTURE_CSS__)return window.__GRASCO_PROFILE_PICTURE_CSS__;try{let o=import.meta.url;if(o)return `${o.substring(0,o.lastIndexOf("/")+1)}styles.css`}catch{}let r=document.currentScript;if(r?.src){let o=new URL(r.src);return `${o.href.substring(0,o.href.lastIndexOf("/")+1)}dist/styles.css`}return null}var H={"2xs":20,xs:24,sm:32,md:40,lg:48,xl:64,"2xl":80,"3xl":120},be={online:"#30D158",away:"#FFD60A",busy:"#FF453A",offline:"#8E8E93",dnd:"#FF453A"},xe={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)"},I={size:"md",variant:"circle",loading:"lazy",placeholder:"shimmer",borderWidth:2,borderColor:"#ffffff",placeholderColor:"#f3f4f6",shadow:"sm"};var j={circle:"9999px",rounded:"12px",squircle:"30%",square:"0px"},E={max:4,direction:"ltr",overlap:.3,size:"md",tooltipDelay:300,dropdownMaxHeight:280,animated:true};function z(...r){return r.filter(Boolean).join(" ")}function ye(r){return /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(r)}function Q(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 pe(r){return Math.round(r*.38)}function we(r,o){let e;if(o){let n=Math.round(r*.31);e=Math.min(24,Math.max(14,n));}else {let n=Math.round(r*.22);e=Math.min(14,Math.max(8,n));}let t=Math.max(9,Math.round(e*.55));return {size:e,fontSize:t}}function Ce(r,o){let e=Math.min(16,Math.max(8,Math.round(r*.2)));return Math.min(18,e+(o-1)*2)}function Se(r,o){return typeof r=="string"?r:o&&r>o?`${o}+`:r.toString()}function ke(r){return r.length===0?"transparent":r.length===1?r[0]:`conic-gradient(${r.map((e,t)=>{let n=t/r.length*360,i=(t+1)/r.length*360;return `${e} ${n}deg ${i}deg`}).join(", ")})`}function Z(r){let o=0;for(let e=0;e<r.length;e++){let t=r.charCodeAt(e);o=(o<<5)-o+t,o&=o;}return Math.abs(o)}function $e(r,o,e){let n=Math.max(0,Math.min(100,r))/100*360;return `conic-gradient(from 270deg, ${o} 0deg ${n}deg, ${e} ${n}deg 360deg)`}function _(r){let o=["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=Z(r)%o.length;return o[e]}var ve=[["#f4a261","#e76f51","#d4a5a5"],["#f2a9b0","#e07a5f","#d4c4a8"],["#c9b1d0","#e8a0bf","#f0d1ce"],["#89c2d9","#a3c4bc","#d5c6e0"],["#f7c59f","#f2a07b","#efcfe3"],["#b5a7d5","#d4a5c9","#f0c3d7"],["#7ec8c8","#6a9fb5","#c2b5d6"],["#f0b3ba","#d4a5c9","#c9d1d9"],["#e8b960","#d4956a","#c9a5b8"],["#a7c4a0","#c9d4a5","#e0c9b1"],["#c4819b","#d9a5b8","#b5aed4"],["#f0c27f","#e0a87c","#d4b5c9"]];function Ie(r){let o=Z(r),e=ve[o%ve.length],t=Z(r+"pos1"),n=Z(r+"pos2"),i=20+o%61,p=20+(o>>4)%61,d=20+t%61,c=20+(t>>4)%61,g=20+n%61,f=20+(n>>4)%61;return [`radial-gradient(circle at ${i}% ${p}%, ${e[0]} 0%, transparent 70%)`,`radial-gradient(circle at ${d}% ${c}%, ${e[1]} 0%, transparent 70%)`,`radial-gradient(circle at ${g}% ${f}%, ${e[2]} 0%, transparent 70%)`].join(", ")}function Ee(r){return typeof r=="number"?r:H[r]??H[E.size]}function de(r,o,e){let t=e?o-1:o;if(r<=t)return {visible:r,hidden:0,showCounter:false};let n=t-1,i=r-n;return {visible:n,hidden:i,showCounter:true}}function ee(r,o,e,t,n){let i=n??o*(1-e);return r*i}function ze(r,o,e){return e==="ltr"?o-r:r+1}function De(r,o,e,t){if(r===0)return 0;if(r===1)return o;let n=t??o*(1-e);return o+n*(r-1)}function Te(r){return r>99?"+99":`+${r}`}function Me(r){return r<=80?"120":r<=120?"240":r<=240?"480":("960")}function Pe(r,o,e,t,n){let i=r.endsWith("/")?r.slice(0,-1):r,p=`${o}_${e}_${t}.webp`;return `${i}/api/profile-picture/cdn/${p}?hostname=${n}`}function Re(r){return {circle:"np:rounded-full",rounded:"np:rounded-xl",squircle:"np:rounded-[30%]",square:"np:rounded-none"}[r]}function Ae(r,o){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:o,borderStyle:"solid"}}}function Le(r,o){return o?{className:"",style:{background:o}}:r?r.includes("gradient")?{className:"",style:{background:r}}:{className:"",style:{backgroundColor:r}}:{className:"",style:{backgroundColor:"transparent"}}}function Ue(r){return {boxShadow:xe[r]}}var Xe={shimmer:`
2
2
  @keyframes pp-shimmer {
3
3
  0% { transform: translateX(-100%); }
4
4
  100% { transform: translateX(100%); }
@@ -36,8 +36,8 @@ import Ae,{useRef,useCallback,useEffect}from'react';import {LitElement,nothing,h
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
- }`},Ve=Object.values(je).join(`
40
- `),We=`
39
+ }`},Ze=Object.values(Xe).join(`
40
+ `),Qe=`
41
41
  /* Profile Picture Component Styles */
42
42
  .pp-container {
43
43
  --pp-transition-duration: 200ms;
@@ -53,6 +53,7 @@ import Ae,{useRef,useCallback,useEffect}from'react';import {LitElement,nothing,h
53
53
  }
54
54
 
55
55
  /* Inner container for image clipping - allows badges/rings to overflow */
56
+ /* Background is applied here (not on container) to prevent sub-pixel bleed-through */
56
57
  .pp-inner {
57
58
  position: absolute;
58
59
  inset: 0;
@@ -240,8 +241,8 @@ import Ae,{useRef,useCallback,useEffect}from'react';import {LitElement,nothing,h
240
241
  transition: none !important;
241
242
  }
242
243
  }
243
- `,Te=`${Ve}
244
- ${We}`,De=`
244
+ `,Be=`${Ze}
245
+ ${Qe}`,Oe=`
245
246
  @keyframes np-shimmer {
246
247
  0% { background-position: -200% 0; }
247
248
  100% { background-position: 200% 0; }
@@ -251,7 +252,7 @@ ${We}`,De=`
251
252
  background-size: 200% 100%;
252
253
  animation: np-shimmer 1.5s infinite;
253
254
  }
254
- `;function Pe(r,n=.3){if(re(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 qe=`
255
+ `;function Ge(r,o=.3){if(ye(r)){let e=Number.parseInt(r.slice(1,3),16),t=Number.parseInt(r.slice(3,5),16),n=Number.parseInt(r.slice(5,7),16);return `0 0 20px 0 rgba(${e}, ${t}, ${n}, ${o})`}return `0 0 20px 0 ${r}`}var _e=`
255
256
  @keyframes ppg-tooltip-in {
256
257
  from {
257
258
  opacity: 0;
@@ -302,7 +303,7 @@ ${We}`,De=`
302
303
  opacity: 1;
303
304
  }
304
305
  }
305
- `,Je=`
306
+ `,et=`
306
307
  /* Profile Picture Group Container */
307
308
  .ppg-container {
308
309
  --ppg-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
@@ -747,29 +748,34 @@ ${We}`,De=`
747
748
  box-shadow: 0 0 0 1.5px rgba(44, 44, 46, 0.95), 0 0 6px rgba(48, 209, 88, 0.5);
748
749
  }
749
750
  }
750
- `,Re=`${qe}
751
- ${Je}`;var a=class a extends LitElement{constructor(){super(...arguments);this.src="";this.alt="";this.size=$.size;this.variant=$.variant;this.shadow=$.shadow;this.border=false;this.borderWidth=$.borderWidth;this.borderColor=$.borderColor;this.rotation=0;this.loading=$.loading;this.placeholder=$.placeholder;this.placeholderColor=$.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=Te,document.head.appendChild(t),a.stylesInjected=true;});}get pixelSize(){let e=this.size;return typeof e=="number"?e:F[e]??F[$.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=Ce(this.pixelSize),t=Se(this.bgColor),o=typeof window<"u"?window.location.hostname:"localhost";this.cdnImageUrl=ke(a.cdnBaseUrl,this.extCustomerId,e,t,o);}getContainerStyles(){let e=Ee(this.bgColor,this.bgGradient),t=this.border?Ie(this.borderWidth,this.borderColor):null,o=ze(this.shadow),i={};if(this.glow){let d=this.glow.color??this.borderColor??"#6366f1";i={"--pp-glow-color":d,boxShadow:Pe(d,this.glow.intensity??.3)};}let p=this.interactive?.hoverable||this.interactive?.pressable;return {classes:R("pp-container",$e(this.variant),e.className,t?.className,p&&"pp-interactive",this.glow?.animate&&"pp-glow"),styles:{width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,borderRadius:N[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 nothing;let e={shimmer:"pp-shimmer",pulse:"pp-pulse",skeleton:"pp-skeleton",blur:"",none:""}[this.placeholder];return html`
752
- ${this.placeholder==="shimmer"?html`<style>${De}</style>`:nothing}
751
+ `,Fe=`${_e}
752
+ ${et}`;var a=class a extends LitElement{constructor(){super(...arguments);this.src="";this.alt="";this.size=I.size;this.variant=I.variant;this.shadow=I.shadow;this.border=false;this.borderWidth=I.borderWidth;this.borderColor=I.borderColor;this.rotation=0;this.loading=I.loading;this.placeholder=I.placeholder;this.placeholderColor=I.placeholderColor;this.imageMode="original";this.isLoaded=false;this.hasError=false;this.cdnLoadFailed=false;this.previousSrc="";this.randomSeed=Math.random().toString(36).slice(2);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=Be,document.head.appendChild(t),a.stylesInjected=true;});}get pixelSize(){let e=this.size;return typeof e=="number"?e:H[e]??H[I.size]}get gradientSeed(){return this.extCustomerId||this.alt||this.src||this.randomSeed}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.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);let t=e.has("extCustomerId")&&this.extCustomerId!==this.previousExtCustomerId,n=e.has("size")||e.has("imageMode");(t||n&&this.extCustomerId)&&(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}));}handleClick(e){this.interactive?.pressable&&this.dispatchEvent(new CustomEvent("profile-picture-click",{bubbles:true,composed:true,detail:{extCustomerId:this.extCustomerId,alt:this.alt,src:this.src}}));}handleKeyDown(e){this.interactive?.pressable&&(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.handleClick(e));}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=Me(this.pixelSize),t=typeof window<"u"?window.location.hostname:"localhost";this.cdnImageUrl=Pe(a.cdnBaseUrl,this.extCustomerId,e,this.imageMode,t);}getContainerStyles(){let e=Le(this.bgColor,this.bgGradient),t=this.border?Ae(this.borderWidth,this.borderColor):null,n=Ue(this.shadow),i={};if(this.glow){let d=this.glow.color??this.borderColor??"#6366f1";i={"--pp-glow-color":d,boxShadow:Ge(d,this.glow.intensity??.3)};}let p=this.interactive?.hoverable||this.interactive?.pressable;return {classes:z("pp-container",Re(this.variant),t?.className,p&&"pp-interactive",this.glow?.animate&&"pp-glow"),styles:{width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,borderRadius:j[this.variant],...t?.style,...n,...i,cursor:this.interactive?.cursor??(p?"pointer":"default"),transform:this.rotation?`rotate(${this.rotation}deg)`:void 0},innerStyles:e.style??{},innerClasses:e.className}}renderPlaceholder(){if(this.isLoaded||this.placeholder==="none")return nothing;let e={shimmer:"pp-shimmer",pulse:"pp-pulse",skeleton:"pp-skeleton",blur:"",none:""}[this.placeholder];return html`
753
+ ${this.placeholder==="shimmer"?html`<style>${Oe}</style>`:nothing}
753
754
  <div
754
- class=${R("np:absolute np:inset-0",e)}
755
+ class=${z("np:absolute np:inset-0",e)}
755
756
  style=${styleMap({backgroundColor:this.placeholderColor,borderRadius:"inherit"})}>
756
757
  </div>
757
- `}renderFallback(){if(this.fallback)return html`
758
+ `}renderFallback(){let e=!!(this.bgColor||this.bgGradient);if(this.fallbackMode==="gradient"){let n=Ie(this.gradientSeed);return html`
759
+ <div
760
+ class="pp-fallback np:absolute np:inset-0"
761
+ style=${styleMap({background:e?"transparent":n})}>
762
+ </div>
763
+ `}if(this.fallback)return html`
758
764
  <span
759
765
  class="pp-fallback"
760
- style=${styleMap({fontSize:`${ne(this.pixelSize)}px`})}>
766
+ style=${styleMap({fontSize:`${pe(this.pixelSize)}px`})}>
761
767
  ${this.fallback}
762
768
  </span>
763
- `;if(this.alt){let t=K(this.alt);return html`
769
+ `;if(this.alt){let n=_(this.alt);return html`
764
770
  <div
765
771
  class="pp-fallback np:absolute np:inset-0"
766
- style=${styleMap({background:this.bgColor??t,fontSize:`${ne(this.pixelSize)}px`})}>
767
- ${Y(this.alt)}
772
+ style=${styleMap({background:e?"transparent":n,fontSize:`${pe(this.pixelSize)}px`})}>
773
+ ${Q(this.alt)}
768
774
  </div>
769
- `}let e=this.pixelSize*.5;return html`
775
+ `}let t=this.pixelSize*.5;return html`
770
776
  <svg
771
777
  class="pp-fallback-icon"
772
- style="width: ${e}px; height: ${e}px;"
778
+ style="width: ${t}px; height: ${t}px;"
773
779
  fill="currentColor"
774
780
  viewBox="0 0 24 24">
775
781
  <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" />
@@ -782,24 +788,24 @@ ${Je}`;var a=class a extends LitElement{constructor(){super(...arguments);this.s
782
788
  decoding="async"
783
789
  @load=${this.handleLoad}
784
790
  @error=${this.handleError}
785
- class=${R("pp-image",this.isLoaded?"pp-image-loaded":"pp-image-loading")}
791
+ class=${z("pp-image",this.isLoaded?"pp-image-loaded":"pp-image-loading")}
786
792
  draggable="false" />
787
- `}renderRing(){if(!this.ring?.show)return 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=be(d,g,f);}else this.ring.gradient&&this.ring.gradient.length>0?i=he(this.ring.gradient):i=this.ring.color??"linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888)";return html`
793
+ `}renderRing(){if(!this.ring?.show)return nothing;let e=this.ring.width??3,t=this.ring.gap??3,n=e+t,i,p=this.ring.progress!==void 0;if(p){let d=this.ring.progress??0,c=this.ring.color??"#30D158",g=this.ring.emptyColor??"#8E8E93";i=$e(d,c,g);}else this.ring.gradient&&this.ring.gradient.length>0?i=ke(this.ring.gradient):i=this.ring.color??"linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888)";return html`
788
794
  <div
789
- class=${R("pp-ring",this.ring.animate&&!p&&"pp-ring-animated",p&&"pp-ring-progress")}
790
- style=${styleMap({inset:`-${o}px`,padding:`${e}px`,background:i,borderRadius:N[this.variant]})}>
795
+ class=${z("pp-ring",this.ring.animate&&!p&&"pp-ring-animated",p&&"pp-ring-progress")}
796
+ style=${styleMap({inset:`-${n}px`,padding:`${e}px`,background:i,borderRadius:j[this.variant]})}>
791
797
  </div>
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 nothing;let e=this.presence.thickness??2,t=fe(this.pixelSize,e),o=ce[this.presence.status],i=this.getCornerOffset();return html`
798
+ `}getCornerOffset(){let e=this.pixelSize/2,n={circle:1-Math.SQRT2/2,square:0,rounded:.04,squircle:.08}[this.variant];return e*n}renderPresence(){if(!this.presence)return nothing;let e=this.presence.thickness??2,t=Ce(this.pixelSize,e),n=be[this.presence.status],p=this.getCornerOffset()-t/2;return html`
793
799
  <div
794
- class=${R("pp-presence",this.presence.animate&&"pp-presence-animated")}
795
- style=${styleMap({width:`${t}px`,height:`${t}px`,backgroundColor:o,bottom:`${i}px`,right:`${i}px`,color:o})}
800
+ class=${z("pp-presence",this.presence.animate&&"pp-presence-animated")}
801
+ style=${styleMap({width:`${t}px`,height:`${t}px`,backgroundColor:n,bottom:`${p}px`,right:`${p}px`,color:n})}
796
802
  title=${this.presence.status}>
797
803
  </div>
798
- `}renderBadge(){if(!this.badge)return 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}=ge(this.pixelSize,i),g=this.badge.bgColor??"#22c55e",f=this.badge.color??"#ffffff",m=this.badge.borderRadius??"9999px",h=t&&this.badge.content!==void 0?me(this.badge.content,this.badge.max):null,v=o?this.badge.icon:null,T=d*.9,c=`${-this.getCornerOffset()}px`,L={"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 html`
804
+ `}renderBadge(){if(!this.badge)return nothing;let e=this.badge.position??"bottom-right",t=this.badge.content!==void 0,n=this.badge.icon!==void 0,i=t||n,{size:p,fontSize:d}=we(this.pixelSize,i),c=this.badge.bgColor??"#22c55e",g=this.badge.color??"#ffffff",f=this.badge.borderRadius??"9999px",h=t&&this.badge.content!==void 0?Se(this.badge.content,this.badge.max):null,S=n?this.badge.icon:null,P=d*.9,m=`${this.getCornerOffset()-p/2}px`,R={"top-left":{top:m,left:m},"top-center":{top:m,left:"50%",transform:"translateX(-50%)"},"top-right":{top:m,right:m},"bottom-left":{bottom:m,left:m},"bottom-center":{bottom:m,left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:m,right:m}};return html`
799
805
  <div
800
- class=${R("pp-badge",this.badge.pulse&&"pp-badge-pulse",this.badge.glow&&"pp-badge-glow",o&&"pp-badge-with-icon")}
801
- style=${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:m,"--pp-badge-glow-color":g,gap:o&&t?"4px":"0",...L[e]})}>
802
- ${v?html`<span class="pp-badge-icon" style=${styleMap({fontSize:`${T}px`})}>${v}</span>`:nothing}
806
+ class=${z("pp-badge",this.badge.pulse&&"pp-badge-pulse",this.badge.glow&&"pp-badge-glow",n&&"pp-badge-with-icon")}
807
+ style=${styleMap({width:i?"auto":`${p}px`,minWidth:`${p}px`,height:`${p}px`,padding:i?"0 6px":"0",fontSize:`${d}px`,backgroundColor:c,color:g,borderRadius:f,"--pp-badge-glow-color":c,gap:n&&t?"4px":"0",...R[e]})}>
808
+ ${S?html`<span class="pp-badge-icon" style=${styleMap({fontSize:`${P}px`})}>${S}</span>`:nothing}
803
809
  ${h??nothing}
804
810
  </div>
805
811
  `}render(){let e=this.getContainerStyles(),t=this.interactive?.focusable||this.interactive?.pressable?0:void 0;return html`
@@ -809,6 +815,8 @@ ${Je}`;var a=class a extends LitElement{constructor(){super(...arguments);this.s
809
815
  tabindex=${t??nothing}
810
816
  role=${this.interactive?.pressable?"button":nothing}
811
817
  aria-label=${this.alt||nothing}
818
+ @click=${this.handleClick}
819
+ @keydown=${this.handleKeyDown}
812
820
  data-profile-picture>
813
821
 
814
822
  <!-- Ring Effect (behind everything) -->
@@ -816,8 +824,8 @@ ${Je}`;var a=class a extends LitElement{constructor(){super(...arguments);this.s
816
824
 
817
825
  <!-- Inner container for image clipping -->
818
826
  <div
819
- class="pp-inner"
820
- style=${styleMap({borderRadius:N[this.variant]})}>
827
+ class=${z("pp-inner",e.innerClasses)}
828
+ style=${styleMap({borderRadius:j[this.variant],...e.innerStyles})}>
821
829
  <!-- Placeholder -->
822
830
  ${this.renderPlaceholder()}
823
831
 
@@ -831,7 +839,7 @@ ${Je}`;var a=class a extends LitElement{constructor(){super(...arguments);this.s
831
839
  <!-- Presence Indicator -->
832
840
  ${this.renderPresence()}
833
841
  </div>
834
- `}};s([property({type:String})],a.prototype,"src"),s([property({type:String})],a.prototype,"alt"),s([property({type:String,attribute:"ext-customer-id"})],a.prototype,"extCustomerId"),s([property({type:String})],a.prototype,"size"),s([property({type:String})],a.prototype,"variant"),s([property({type:String})],a.prototype,"shadow"),s([property({type:Boolean})],a.prototype,"border"),s([property({type:Number,attribute:"border-width"})],a.prototype,"borderWidth"),s([property({type:String,attribute:"border-color"})],a.prototype,"borderColor"),s([property({type:Number})],a.prototype,"rotation"),s([property({type:String,attribute:"bg-color"})],a.prototype,"bgColor"),s([property({type:String,attribute:"bg-gradient"})],a.prototype,"bgGradient"),s([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([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([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([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([property({type:String})],a.prototype,"loading"),s([property({type:String})],a.prototype,"placeholder"),s([property({type:String,attribute:"placeholder-color"})],a.prototype,"placeholderColor"),s([property({type:String})],a.prototype,"fallback"),s([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([state()],a.prototype,"isLoaded"),s([state()],a.prototype,"hasError"),s([state()],a.prototype,"cdnImageUrl"),s([state()],a.prototype,"cdnLoadFailed");var H=a;customElements.get("profile-picture")||customElements.define("profile-picture",H);var se=false;function Xe(){if(se||typeof document>"u")return;(typeof requestIdleCallback<"u"?requestIdleCallback:n=>setTimeout(n,1))(()=>{if(se)return;let n=document.createElement("style");n.textContent=Re,document.head.appendChild(n),se=true;});}var b=class extends LitElement{constructor(){super(...arguments);this.max=I.max;this.direction=I.direction;this.overlap=I.overlap;this.size=I.size;this.showAddButton=false;this.addButtonLabel="Add user";this.animated=I.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 Xe(),this}get pixelSize(){return xe(this.size)}get tooltipEnabled(){return this.tooltip?.enabled!==false}get tooltipPosition(){return this.tooltip?.position??"top"}get tooltipDelay(){return this.tooltip?.delay??I.tooltipDelay}get dropdownMaxHeight(){return this.dropdown?.maxHeight??I.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 m=f??g,h=t[g];return h!=null&&h!==""?String(h):t.getAttribute(m)??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&&(render(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 y=html`
842
+ `}};s([property({type:String})],a.prototype,"src"),s([property({type:String})],a.prototype,"alt"),s([property({type:String,attribute:"ext-customer-id"})],a.prototype,"extCustomerId"),s([property({type:String})],a.prototype,"size"),s([property({type:String})],a.prototype,"variant"),s([property({type:String})],a.prototype,"shadow"),s([property({type:Boolean})],a.prototype,"border"),s([property({type:Number,attribute:"border-width"})],a.prototype,"borderWidth"),s([property({type:String,attribute:"border-color"})],a.prototype,"borderColor"),s([property({type:Number})],a.prototype,"rotation"),s([property({type:String,attribute:"bg-color"})],a.prototype,"bgColor"),s([property({type:String,attribute:"bg-gradient"})],a.prototype,"bgGradient"),s([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([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([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([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([property({type:String})],a.prototype,"loading"),s([property({type:String})],a.prototype,"placeholder"),s([property({type:String,attribute:"placeholder-color"})],a.prototype,"placeholderColor"),s([property({type:String})],a.prototype,"fallback"),s([property({type:String,attribute:"fallback-mode"})],a.prototype,"fallbackMode"),s([property({type:String,attribute:"image-mode"})],a.prototype,"imageMode"),s([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([state()],a.prototype,"isLoaded"),s([state()],a.prototype,"hasError"),s([state()],a.prototype,"cdnImageUrl"),s([state()],a.prototype,"cdnLoadFailed");var V=a;customElements.get("profile-picture")||customElements.define("profile-picture",V);var ue=false;function nt(){if(ue||typeof document>"u")return;(typeof requestIdleCallback<"u"?requestIdleCallback:o=>setTimeout(o,1))(()=>{if(ue)return;let o=document.createElement("style");o.textContent=Fe,document.head.appendChild(o),ue=true;});}var b=class extends LitElement{constructor(){super(...arguments);this.max=E.max;this.direction=E.direction;this.overlap=E.overlap;this.size=E.size;this.showAddButton=false;this.addButtonLabel="Add user";this.animated=E.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 nt(),this}get pixelSize(){return Ee(this.size)}get tooltipEnabled(){return this.tooltip?.enabled!==false}get tooltipPosition(){return this.tooltip?.position??"top"}get tooltipDelay(){return this.tooltip?.delay??E.tooltipDelay}get dropdownMaxHeight(){return this.dropdown?.maxHeight??E.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,n)=>{let i=(c,g)=>{let f=g??c,h=t[c];return h!=null&&h!==""?String(h):t.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 ${n+1}`,src:i("src"),extCustomerId:i("extCustomerId","ext-customer-id"),status:i("dataStatus","data-status"),element:t,index:n,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&&(render(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(),n=10,i=280,p=Math.min(this.dropdownMaxHeight+60,e.length*56+60),d=window.innerWidth,c=window.innerHeight;if(d<480){let k=html`
835
843
  <div
836
844
  class="ppg-backdrop ppg-backdrop-visible"
837
845
  style="pointer-events: auto; background: rgba(0,0,0,0.5);"
@@ -852,10 +860,10 @@ ${Je}`;var a=class a extends LitElement{constructor(){super(...arguments);this.s
852
860
  class="ppg-dropdown-list"
853
861
  style=${styleMap({maxHeight:"calc(70vh - 60px)"})}
854
862
  >
855
- ${e.map(D=>this.renderDropdownItem(D))}
863
+ ${e.map(q=>this.renderDropdownItem(q))}
856
864
  </div>
857
865
  </div>
858
- `;render(y,this.portalContainer);return}let m=g-t.bottom-o,h=t.top-o,v=d-t.left,T=t.right,x=this.dropdownPosition;x==="bottom"&&m<p&&h>m?x="top":x==="top"&&h<p&&m>h&&(x="bottom");let c;v>=i?c=t.left:T>=i?c=t.right-i:c=(d-i)/2,c=Math.max(8,Math.min(c,d-i-8));let L=x==="bottom"?t.bottom+o:void 0,U=x==="top"?g-t.top+o:void 0,j=html`
866
+ `;render(k,this.portalContainer);return}let f=c-t.bottom-n,h=t.top-n,S=d-t.left,P=t.right,x=this.dropdownPosition;x==="bottom"&&f<p&&h>f?x="top":x==="top"&&h<p&&f>h&&(x="bottom");let v;S>=i?v=t.left:P>=i?v=t.right-i:v=(d-i)/2,v=Math.max(8,Math.min(v,d-i-8));let m=x==="bottom"?t.bottom+n:void 0,R=x==="top"?c-t.top+n:void 0,W=html`
859
867
  <div
860
868
  class="ppg-backdrop"
861
869
  style="pointer-events: auto;"
@@ -864,7 +872,7 @@ ${Je}`;var a=class a extends LitElement{constructor(){super(...arguments);this.s
864
872
  ></div>
865
873
  <div
866
874
  class="ppg-dropdown ppg-dropdown-portal"
867
- style=${styleMap({position:"fixed",pointerEvents:"auto",top:L!==void 0?`${L}px`:"auto",bottom:U!==void 0?`${U}px`:"auto",left:`${c}px`,width:`${i}px`})}
875
+ style=${styleMap({position:"fixed",pointerEvents:"auto",top:m!==void 0?`${m}px`:"auto",bottom:R!==void 0?`${R}px`:"auto",left:`${v}px`,width:`${i}px`})}
868
876
  data-position=${x}
869
877
  role="menu"
870
878
  aria-label="Hidden users"
@@ -876,10 +884,10 @@ ${Je}`;var a=class a extends LitElement{constructor(){super(...arguments);this.s
876
884
  class="ppg-dropdown-list"
877
885
  style=${styleMap({maxHeight:`${this.dropdownMaxHeight}px`})}
878
886
  >
879
- ${e.map(y=>this.renderDropdownItem(y))}
887
+ ${e.map(k=>this.renderDropdownItem(k))}
880
888
  </div>
881
889
  </div>
882
- `;render(j,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=X(t,this.pixelSize,this.overlap,this.direction,this.spacing),p=ve(t,o,this.direction),d=e.variant??"circle",g=e.shadow??"none",f=this.rotationAmount?t%2===0?-this.rotationAmount:this.rotationAmount:0;return html`
890
+ `;render(W,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 n=t.currentTarget;this.tooltipTimeout=window.setTimeout(()=>{this.tooltipData={user:e,rect:n.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,n){let i=ee(t,this.pixelSize,this.overlap,this.direction,this.spacing),p=ze(t,n,this.direction),d=e.variant??"circle",c=e.shadow??"none",g=this.rotationAmount?t%2===0?-this.rotationAmount:this.rotationAmount:0;return html`
883
891
  <div
884
892
  class="ppg-avatar-wrapper"
885
893
  style=${styleMap({left:`${i}px`,zIndex:String(p),width:`${this.pixelSize}px`,height:`${this.pixelSize}px`})}
@@ -887,19 +895,19 @@ ${Je}`;var a=class a extends LitElement{constructor(){super(...arguments);this.s
887
895
  role="button"
888
896
  aria-label=${e.name}
889
897
  @click=${()=>this.handleAvatarClick(e)}
890
- @mouseenter=${m=>this.handleAvatarHover(e,m)}
898
+ @mouseenter=${f=>this.handleAvatarHover(e,f)}
891
899
  @mouseleave=${this.handleAvatarLeave}
892
- @keydown=${m=>this.handleKeyDown(m,()=>this.handleAvatarClick(e))}
900
+ @keydown=${f=>this.handleKeyDown(f,()=>this.handleAvatarClick(e))}
893
901
  >
894
- ${this.renderProfilePicture(e,d,g,f)}
902
+ ${this.renderProfilePicture(e,d,c,g)}
895
903
  </div>
896
- `}renderProfilePicture(e,t,o,i){return html`
904
+ `}renderProfilePicture(e,t,n,i){return html`
897
905
  <profile-picture
898
906
  .src=${e.src||void 0}
899
907
  .alt=${e.name}
900
908
  .size=${this.pixelSize}
901
909
  .variant=${t}
902
- .shadow=${o}
910
+ .shadow=${n}
903
911
  .rotation=${i}
904
912
  .extCustomerId=${e.extCustomerId}
905
913
  ?border=${e.border}
@@ -910,16 +918,16 @@ ${Je}`;var a=class a extends LitElement{constructor(){super(...arguments);this.s
910
918
  data-user-id=${e.id??""}
911
919
  data-status=${e.status??""}
912
920
  ></profile-picture>
913
- `}renderCounter(e,t,o){return html`
921
+ `}renderCounter(e,t,n){return html`
914
922
  <button
915
923
  class="ppg-counter"
916
924
  style=${styleMap({left:`${t}px`,width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,zIndex:"1"})}
917
925
  aria-label=${`${e} more users`}
918
926
  aria-expanded=${this.dropdownOpen}
919
927
  aria-haspopup="true"
920
- @click=${()=>this.handleCounterClick(o)}
928
+ @click=${()=>this.handleCounterClick(n)}
921
929
  >
922
- ${ye(e)}
930
+ ${Te(e)}
923
931
  </button>
924
932
  `}renderAddButton(e){let t=Math.round(this.pixelSize*.4);return html`
925
933
  <button
@@ -943,16 +951,16 @@ ${Je}`;var a=class a extends LitElement{constructor(){super(...arguments);this.s
943
951
  <line x1="5" y1="12" x2="19" y2="12"></line>
944
952
  </svg>
945
953
  </button>
946
- `}renderTooltip(){if(!this.tooltipData)return 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 html`
954
+ `}renderTooltip(){if(!this.tooltipData)return nothing;let{user:e,rect:t}=this.tooltipData,n=8,i=this.getBoundingClientRect(),p=t.left-i.left+t.width/2,d=t.top-i.top,c=t.bottom-i.top,g=this.tooltipPosition==="top";return html`
947
955
  <div
948
956
  class="ppg-tooltip"
949
- style=${styleMap({top:f?"auto":`${g+o}px`,bottom:f?`${i.height-d+o}px`:"auto",left:`${p}px`})}
957
+ style=${styleMap({top:g?"auto":`${c+n}px`,bottom:g?`${i.height-d+n}px`:"auto",left:`${p}px`})}
950
958
  data-position=${this.tooltipPosition}
951
959
  role="tooltip"
952
960
  >
953
961
  ${e.name}
954
962
  </div>
955
- `}renderDropdownItem(e){let t=K(e.name),o=e.src||e.extCustomerId;return html`
963
+ `}renderDropdownItem(e){let t=_(e.name),n=e.src||e.extCustomerId;return html`
956
964
  <div
957
965
  class="ppg-dropdown-item"
958
966
  role="menuitem"
@@ -960,7 +968,7 @@ ${Je}`;var a=class a extends LitElement{constructor(){super(...arguments);this.s
960
968
  @click=${()=>this.handleDropdownItemClick(e)}
961
969
  @keydown=${i=>this.handleKeyDown(i,()=>this.handleDropdownItemClick(e))}
962
970
  >
963
- ${o?html`<profile-picture
971
+ ${n?html`<profile-picture
964
972
  class="ppg-dropdown-avatar"
965
973
  .src=${e.src||void 0}
966
974
  .alt=${e.name}
@@ -972,7 +980,7 @@ ${Je}`;var a=class a extends LitElement{constructor(){super(...arguments);this.s
972
980
  class="ppg-dropdown-avatar-fallback"
973
981
  style=${styleMap({background:t})}
974
982
  >
975
- ${Y(e.name)}
983
+ ${Q(e.name)}
976
984
  </div>`}
977
985
  <div class="ppg-dropdown-info">
978
986
  <div class="ppg-dropdown-name">${e.name}</div>
@@ -987,10 +995,10 @@ ${Je}`;var a=class a extends LitElement{constructor(){super(...arguments);this.s
987
995
  `:nothing}
988
996
  </div>
989
997
  </div>
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}=oe(this.users.length,this.max,this.showAddButton),i=this.users.slice(o);this.updatePortalContent(i);}}render(){let{visible:e,hidden:t,showCounter:o}=oe(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=we(d,this.pixelSize,this.overlap,this.spacing),f=o?X(e,this.pixelSize,this.overlap,this.direction,this.spacing):0,m=X(e+(o?1:0),this.pixelSize,this.overlap,this.direction,this.spacing);return html`
998
+ `}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:n}=de(this.users.length,this.max,this.showAddButton),i=this.users.slice(n);this.updatePortalContent(i);}}render(){let{visible:e,hidden:t,showCounter:n}=de(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;n&&d++,this.showAddButton&&d++;let c=De(d,this.pixelSize,this.overlap,this.spacing),g=n?ee(e,this.pixelSize,this.overlap,this.direction,this.spacing):0,f=ee(e+(n?1:0),this.pixelSize,this.overlap,this.direction,this.spacing);return html`
991
999
  <div
992
- class=${R("ppg-container",this.animated&&"ppg-animated")}
993
- style=${styleMap({width:`${g}px`,height:`${this.pixelSize}px`})}
1000
+ class=${z("ppg-container",this.animated&&"ppg-animated")}
1001
+ style=${styleMap({width:`${c}px`,height:`${this.pixelSize}px`})}
994
1002
  role="group"
995
1003
  aria-label="User avatars"
996
1004
  >
@@ -998,16 +1006,16 @@ ${Je}`;var a=class a extends LitElement{constructor(){super(...arguments);this.s
998
1006
  <slot style="display: none;"></slot>
999
1007
 
1000
1008
  <!-- Visible avatars -->
1001
- ${i.map((h,v)=>this.renderAvatar(h,v,e))}
1009
+ ${i.map((h,S)=>this.renderAvatar(h,S,e))}
1002
1010
 
1003
1011
  <!-- Counter -->
1004
- ${o?this.renderCounter(t,f,p):nothing}
1012
+ ${n?this.renderCounter(t,g,p):nothing}
1005
1013
 
1006
1014
  <!-- Add button -->
1007
- ${this.showAddButton?this.renderAddButton(m):nothing}
1015
+ ${this.showAddButton?this.renderAddButton(f):nothing}
1008
1016
 
1009
1017
  <!-- Tooltip -->
1010
1018
  ${this.renderTooltip()}
1011
1019
  </div>
1012
- `}};s([property({type:Number})],b.prototype,"max"),s([property({type:String})],b.prototype,"direction"),s([property({type:Number})],b.prototype,"overlap"),s([property({type:String})],b.prototype,"size"),s([property({type:Number})],b.prototype,"spacing"),s([property({type:Object})],b.prototype,"tooltip"),s([property({type:Object})],b.prototype,"dropdown"),s([property({type:Boolean,attribute:"show-add-button"})],b.prototype,"showAddButton"),s([property({type:String,attribute:"add-button-label"})],b.prototype,"addButtonLabel"),s([property({type:Boolean})],b.prototype,"animated"),s([property({type:Number,attribute:"rotation-amount"})],b.prototype,"rotationAmount"),s([state()],b.prototype,"users"),s([state()],b.prototype,"dropdownOpen"),s([state()],b.prototype,"tooltipData");customElements.get("profile-picture-group")||customElements.define("profile-picture-group",b);var Ue=Ae.forwardRef(({max:r,direction:n,overlap:e,size:t,spacing:o,tooltip:i,dropdown:p,showAddButton:d,addButtonLabel:g,animated:f,rotationAmount:m,onAvatarClick:h,onAvatarHover:v,onCounterClick:T,onDropdownItemClick:x,onAddClick:c,className:L,style:U,children:j},y)=>{let D=useRef(null),M=useCallback(l=>{h?.(l.detail.user);},[h]),B=useCallback(l=>{v?.(l.detail.user);},[v]),O=useCallback(l=>{let k=l;T?.(k.detail.hiddenUsers,k.detail.open);},[T]),V=useCallback(l=>{x?.(l.detail.user);},[x]),W=useCallback(()=>{c?.();},[c]);return useEffect(()=>{let l=D.current;if(l)return l.addEventListener("avatar-click",M),l.addEventListener("avatar-hover",B),l.addEventListener("counter-click",O),l.addEventListener("dropdown-item-click",V),l.addEventListener("add-click",W),()=>{l.removeEventListener("avatar-click",M),l.removeEventListener("avatar-hover",B),l.removeEventListener("counter-click",O),l.removeEventListener("dropdown-item-click",V),l.removeEventListener("add-click",W);}},[M,B,O,V,W]),useEffect(()=>{typeof y=="function"?y(D.current):y&&(y.current=D.current);},[y]),Ae.createElement("profile-picture-group",{ref:D,max:r,direction:n,overlap:e,size:t,spacing:o,tooltip:i?JSON.stringify(i):void 0,dropdown:p?JSON.stringify(p):void 0,"show-add-button":d||void 0,"add-button-label":g,animated:f,"rotation-amount":m,class:L,style:U},j)});Ue.displayName="ProfilePictureGroup";function Rt(r){H.setCdnBaseUrl(r);}function At(){return H.getCdnBaseUrl()}function et({src:r,alt:n,extCustomerId:e,size:t,variant:o,shadow:i,border:p,borderWidth:d,borderColor:g,rotation:f,bgColor:m,bgGradient:h,glow:v,ring:T,presence:x,badge:c,loading:L,placeholder:U,placeholderColor:j,fallback:y,interactive:D,onLoad:M,onError:B,onCdnError:O,className:V,style:W,ref:l}){let k=useRef(null),Q=useCallback(()=>{M?.();},[M]),_=useCallback(()=>{B?.();},[B]),ee=useCallback(P=>{O?.(P.detail);},[O]);return useEffect(()=>{let P=k.current;if(P)return P.addEventListener("load",Q),P.addEventListener("error",_),P.addEventListener("cdn-error",ee),()=>{P.removeEventListener("load",Q),P.removeEventListener("error",_),P.removeEventListener("cdn-error",ee);}},[Q,_,ee]),useEffect(()=>{typeof l=="function"?l(k.current):l&&(l.current=k.current);},[l]),Ae.createElement("profile-picture",{ref:k,src:r||void 0,alt:n,"ext-customer-id":e,size:t,variant:o,shadow:i,border:p||void 0,"border-width":d,"border-color":g,rotation:f,"bg-color":m,"bg-gradient":h,glow:v?JSON.stringify(v):void 0,ring:T?JSON.stringify(T):void 0,presence:x?JSON.stringify(x):void 0,badge:c?JSON.stringify(c):void 0,loading:L,placeholder:U,"placeholder-color":j,fallback:y,interactive:D?JSON.stringify(D):void 0,class:V,style:W})}et.displayName="ProfilePicture";le();export{et as ProfilePicture,Ue as ProfilePictureGroup,At as getCdnBaseUrl,Rt as setCdnBaseUrl};//# sourceMappingURL=react.js.map
1020
+ `}};s([property({type:Number})],b.prototype,"max"),s([property({type:String})],b.prototype,"direction"),s([property({type:Number})],b.prototype,"overlap"),s([property({type:String})],b.prototype,"size"),s([property({type:Number})],b.prototype,"spacing"),s([property({type:Object})],b.prototype,"tooltip"),s([property({type:Object})],b.prototype,"dropdown"),s([property({type:Boolean,attribute:"show-add-button"})],b.prototype,"showAddButton"),s([property({type:String,attribute:"add-button-label"})],b.prototype,"addButtonLabel"),s([property({type:Boolean})],b.prototype,"animated"),s([property({type:Number,attribute:"rotation-amount"})],b.prototype,"rotationAmount"),s([state()],b.prototype,"users"),s([state()],b.prototype,"dropdownOpen"),s([state()],b.prototype,"tooltipData");customElements.get("profile-picture-group")||customElements.define("profile-picture-group",b);function at(){let[r,o]=useState(false);return useEffect(()=>{o(true);},[]),r}var He=Ne.forwardRef(({max:r,direction:o,overlap:e,size:t,spacing:n,tooltip:i,dropdown:p,showAddButton:d,addButtonLabel:c,animated:g,rotationAmount:f,onAvatarClick:h,onAvatarHover:S,onCounterClick:P,onDropdownItemClick:x,onAddClick:v,className:m,style:R,children:W},k)=>{let q=at(),L=useRef(null),U=useCallback(u=>{h?.(u.detail.user);},[h]),B=useCallback(u=>{S?.(u.detail.user);},[S]),O=useCallback(u=>{let A=u;P?.(A.detail.hiddenUsers,A.detail.open);},[P]),G=useCallback(u=>{x?.(u.detail.user);},[x]),F=useCallback(()=>{v?.();},[v]);return useEffect(()=>{let u=L.current;if(u)return u.addEventListener("avatar-click",U),u.addEventListener("avatar-hover",B),u.addEventListener("counter-click",O),u.addEventListener("dropdown-item-click",G),u.addEventListener("add-click",F),()=>{u.removeEventListener("avatar-click",U),u.removeEventListener("avatar-hover",B),u.removeEventListener("counter-click",O),u.removeEventListener("dropdown-item-click",G),u.removeEventListener("add-click",F);}},[U,B,O,G,F]),useEffect(()=>{typeof k=="function"?k(L.current):k&&(k.current=L.current);},[k]),q?Ne.createElement("profile-picture-group",{ref:L,max:r,direction:o,overlap:e,size:t,spacing:n,tooltip:i?JSON.stringify(i):void 0,dropdown:p?JSON.stringify(p):void 0,"show-add-button":d||void 0,"add-button-label":c,animated:g,"rotation-amount":f,class:m,style:R},W):null});He.displayName="ProfilePictureGroup";function lt(){let[r,o]=useState(false);return useEffect(()=>{o(true);},[]),r}function Ht(r){V.setCdnBaseUrl(r);}function jt(){return V.getCdnBaseUrl()}function ct({src:r,alt:o,extCustomerId:e,imageMode:t,size:n,variant:i,shadow:p,border:d,borderWidth:c,borderColor:g,rotation:f,bgColor:h,bgGradient:S,glow:P,ring:x,presence:v,badge:m,loading:R,placeholder:W,placeholderColor:k,fallback:q,fallbackMode:L,interactive:U,onLoad:B,onError:O,onCdnError:G,onClick:F,className:u,style:A,ref:J}){let je=lt(),X=useRef(null),ne=useCallback(()=>{B?.();},[B]),oe=useCallback(()=>{O?.();},[O]),ie=useCallback(y=>{G?.(y.detail);},[G]),ae=useCallback(y=>{F?.(y.detail);},[F]);return useEffect(()=>{let y=X.current;if(y)return y.addEventListener("load",ne),y.addEventListener("error",oe),y.addEventListener("cdn-error",ie),y.addEventListener("profile-picture-click",ae),()=>{y.removeEventListener("load",ne),y.removeEventListener("error",oe),y.removeEventListener("cdn-error",ie),y.removeEventListener("profile-picture-click",ae);}},[ne,oe,ie,ae]),useEffect(()=>{typeof J=="function"?J(X.current):J&&(J.current=X.current);},[J]),je?Ne.createElement("profile-picture",{ref:X,src:r||void 0,alt:o,"ext-customer-id":e,"image-mode":t,size:n,variant:i,shadow:p,border:d||void 0,"border-width":c,"border-color":g,rotation:f,"bg-color":h,"bg-gradient":S,glow:P?JSON.stringify(P):void 0,ring:x?JSON.stringify(x):void 0,presence:v?JSON.stringify(v):void 0,badge:m?JSON.stringify(m):void 0,loading:R,placeholder:W,"placeholder-color":k,fallback:q,"fallback-mode":L,interactive:U?JSON.stringify(U):void 0,class:u,style:A}):null}ct.displayName="ProfilePicture";he();export{ct as ProfilePicture,He as ProfilePictureGroup,jt as getCdnBaseUrl,Ht as setCdnBaseUrl};//# sourceMappingURL=react.js.map
1013
1021
  //# sourceMappingURL=react.js.map