@grasco/profile-picture 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var Ut=require('react'),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;function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Ut__default=/*#__PURE__*/_interopDefault(Ut);var Ft=Object.defineProperty;var Nt=Object.getOwnPropertyDescriptor;var s=(r,o,t,e)=>{for(var n=e>1?void 0:e?Nt(o,t):o,i=r.length-1,p;i>=0;i--)(p=r[i])&&(n=(e?p(o,t,n):p(n))||n);return e&&n&&Ft(o,t,n),n};var ct="grasco-profile-picture-styles",K=false;function gt(){if(K||typeof document>"u")return;if(document.getElementById(ct)){K=true;return}if(document.querySelector('link[href*="profile-picture"][href$="styles.css"]')){K=true;return}let o=Ht();if(!o)return;let t=document.createElement("link");t.id=ct,t.rel="stylesheet",t.href=o,document.head.appendChild(t),K=true;}function Ht(){if(typeof window<"u"&&window.__GRASCO_PROFILE_PICTURE_CSS__)return window.__GRASCO_PROFILE_PICTURE_CSS__;try{let o=(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href));if(o)return `${o.substring(0,o.lastIndexOf("/")+1)}dist/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 N={"2xs":20,xs:24,sm:32,md:40,lg:48,xl:64,"2xl":80,"3xl":120},ut={online:"#30D158",away:"#FFD60A",busy:"#FF453A",offline:"#8E8E93",dnd:"#FF453A"},ft={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)"},R={size:"md",variant:"circle",loading:"lazy",placeholder:"shimmer",borderWidth:2,borderColor:"#ffffff",placeholderColor:"#f3f4f6",shadow:"sm"};var H={circle:"9999px",rounded:"12px",squircle:"30%",square:"0px"},z={max:4,direction:"ltr",overlap:.3,size:"md",tooltipDelay:300,dropdownMaxHeight:280,animated:true};function $(...r){return r.filter(Boolean).join(" ")}function V(r){return /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(r)}function bt(r){return {"top-left":"np:top-0 np:left-0","top-center":"np:top-0 np:left-1/2 np:-translate-x-1/2","top-right":"np:top-0 np:right-0","bottom-left":"np:bottom-0 np:left-0","bottom-center":"np:bottom-0 np:left-1/2 np:-translate-x-1/2","bottom-right":"np:bottom-0 np:right-0"}[r]}function ht(r){return {"top-left":"np:-rotate-45 np:-translate-x-1/4 np:-translate-y-1/2","top-center":"np:rotate-0 np:-translate-y-1/2","top-right":"np:rotate-45 np:translate-x-1/4 np:-translate-y-1/2","bottom-left":"np:rotate-45 np:-translate-x-1/4 np:translate-y-1/2","bottom-center":"np:rotate-0 np:translate-y-1/2","bottom-right":"np:-rotate-45 np:translate-x-1/4 np:translate-y-1/2"}[r]}function q(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 rt(r){return Math.round(r*.38)}function mt(r,o){let t;if(o){let n=Math.round(r*.31);t=Math.min(24,Math.max(14,n));}else {let n=Math.round(r*.22);t=Math.min(14,Math.max(8,n));}let e=Math.max(9,Math.round(t*.55));return {size:t,fontSize:e}}function xt(r,o){let t=Math.min(16,Math.max(8,Math.round(r*.2)));return Math.min(18,t+(o-1)*2)}function vt(r,o){return typeof r=="string"?r:o&&r>o?`${o}+`:r.toString()}function yt(r){return r.length===0?"transparent":r.length===1?r[0]:`conic-gradient(${r.map((t,e)=>{let n=e/r.length*360,i=(e+1)/r.length*360;return `${t} ${n}deg ${i}deg`}).join(", ")})`}function Pt(r){let o=0;for(let t=0;t<r.length;t++){let e=r.charCodeAt(t);o=(o<<5)-o+e,o&=o;}return Math.abs(o)}function wt(r,o,t){let n=Math.max(0,Math.min(100,r))/100*360;return `conic-gradient(from 270deg, ${o} 0deg ${n}deg, ${t} ${n}deg 360deg)`}function X(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%)"],t=Pt(r)%o.length;return o[t]}function Ct(r){return typeof r=="number"?r:N[r]??N[z.size]}function nt(r,o,t){let e=t?o-1:o;if(r<=e)return {visible:r,hidden:0,showCounter:false};let n=e-1,i=r-n;return {visible:n,hidden:i,showCounter:true}}function Z(r,o,t,e,n){let i=n??o*(1-t);return r*i}function St(r,o,t){return t==="ltr"?o-r:r+1}function kt(r,o,t,e){if(r===0)return 0;if(r===1)return o;let n=e??o*(1-t);return o+n*(r-1)}function $t(r){return r>99?"+99":`+${r}`}function ot(r){return r<=80?"80":r<=120?"120":r<=240?"240":r<=480?"480":"960"}function it(r){if(!(r&&V(r)))return "light";let o=r.replace("#","");o.length===3&&(o=o.split("").map(p=>p+p).join(""));let t=Number.parseInt(o.slice(0,2),16),e=Number.parseInt(o.slice(2,4),16),n=Number.parseInt(o.slice(4,6),16);return (.299*t+.587*e+.114*n)/255>.5?"light":"dark"}function at(r,o,t,e,n){let i=r.endsWith("/")?r.slice(0,-1):r,p=`${o}_${t}_${e}.webp`;return `${i}/api/profile-picture/cdn/${p}?hostname=${n}`}function Et(r){return {circle:"np:rounded-full",rounded:"np:rounded-xl",squircle:"np:rounded-[30%]",square:"np:rounded-none"}[r]}function It(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 Rt(r,o){return o?{className:"",style:{background:o}}:r?r.includes("gradient")?{className:"",style:{background:r}}:{className:"",style:{backgroundColor:r}}:{className:"",style:{backgroundColor:"#e7e7e7"}}}function zt(r){return {boxShadow:ft[r]}}var jt={shimmer:`
1
+ 'use strict';var Le=require('react'),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;function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Le__default=/*#__PURE__*/_interopDefault(Le);var Oe=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var s=(r,n,e,t)=>{for(var o=t>1?void 0:t?Ge(n,e):n,i=r.length-1,p;i>=0;i--)(p=r[i])&&(o=(t?p(n,e,o):p(o))||o);return t&&o&&Oe(n,e,o),o};var ee="grasco-profile-picture-styles",F=false,ue=false;function ge(){if(F||typeof document>"u")return;if(document.getElementById(ee)){F=true;return}if(document.querySelector('link[href*="profile-picture"][href$="styles.css"]')){F=true;return}ue||(ue=true,Fe());}function Fe(){(typeof requestIdleCallback<"u"?requestIdleCallback:n=>setTimeout(n,1))(()=>Ne());}function Ne(){if(F||typeof document>"u")return;if(document.getElementById(ee)){F=true;return}let r=He();if(!r)return;let n=document.createElement("link");n.id=ee,n.rel="stylesheet",n.href=r,document.head.appendChild(n),F=true;}function He(){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('index.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 N={"2xs":20,xs:24,sm:32,md:40,lg:48,xl:64,"2xl":80,"3xl":120},fe={online:"#30D158",away:"#FFD60A",busy:"#FF453A",offline:"#8E8E93",dnd:"#FF453A"},me={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 H={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 te(r){return /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(r)}function J(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 re(r){return Math.round(r*.38)}function he(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 be(r,n){let e=Math.min(16,Math.max(8,Math.round(r*.2)));return Math.min(18,e+(n-1)*2)}function xe(r,n){return typeof r=="string"?r:n&&r>n?`${n}+`:r.toString()}function ve(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 je(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 we(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 Y(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=je(r)%n.length;return n[e]}function ye(r){return typeof r=="number"?r:N[r]??N[I.size]}function ne(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 K(r,n,e,t,o){let i=o??n*(1-e);return r*i}function Ce(r,n,e){return e==="ltr"?n-r:r+1}function Se(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 ke(r){return r>99?"+99":`+${r}`}function oe(r){return r<=80?"80":r<=120?"120":r<=240?"240":r<=480?"480":"960"}function ie(r){if(!(r&&te(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 ae(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:me[r]}}var Pe={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
- }`},Vt=Object.values(jt).join(`
40
- `),Wt=`
39
+ }`},Ve=Object.values(Pe).join(`
40
+ `),We=`
41
41
  /* Profile Picture Component Styles */
42
42
  .pp-container {
43
43
  --pp-transition-duration: 200ms;
@@ -182,24 +182,6 @@
182
182
  box-shadow: 0 0 10px 2px var(--pp-badge-glow-color, currentColor);
183
183
  }
184
184
 
185
- /* Ribbon styles */
186
- .pp-ribbon-container {
187
- position: absolute;
188
- z-index: 10;
189
- overflow: hidden;
190
- }
191
-
192
- .pp-ribbon {
193
- position: absolute;
194
- width: 100%;
195
- text-align: center;
196
- font-weight: 600;
197
- font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
198
- text-transform: uppercase;
199
- letter-spacing: 0.05em;
200
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
201
- }
202
-
203
185
  /* Ring effect (Instagram-style) */
204
186
  .pp-ring {
205
187
  position: absolute;
@@ -258,8 +240,8 @@
258
240
  transition: none !important;
259
241
  }
260
242
  }
261
- `,At=`${Vt}
262
- ${Wt}`,Tt=`
243
+ `,Te=`${Ve}
244
+ ${We}`,Ae=`
263
245
  @keyframes np-shimmer {
264
246
  0% { background-position: -200% 0; }
265
247
  100% { background-position: 200% 0; }
@@ -269,7 +251,7 @@ ${Wt}`,Tt=`
269
251
  background-size: 200% 100%;
270
252
  animation: np-shimmer 1.5s infinite;
271
253
  }
272
- `;function Dt(r,o=.3){if(V(r)){let t=Number.parseInt(r.slice(1,3),16),e=Number.parseInt(r.slice(3,5),16),n=Number.parseInt(r.slice(5,7),16);return `0 0 20px 0 rgba(${t}, ${e}, ${n}, ${o})`}return `0 0 20px 0 ${r}`}var Jt=`
254
+ `;function De(r,n=.3){if(te(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=`
273
255
  @keyframes ppg-tooltip-in {
274
256
  from {
275
257
  opacity: 0;
@@ -320,7 +302,7 @@ ${Wt}`,Tt=`
320
302
  opacity: 1;
321
303
  }
322
304
  }
323
- `,Yt=`
305
+ `,Je=`
324
306
  /* Profile Picture Group Container */
325
307
  .ppg-container {
326
308
  --ppg-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
@@ -765,77 +747,66 @@ ${Wt}`,Tt=`
765
747
  box-shadow: 0 0 0 1.5px rgba(44, 44, 46, 0.95), 0 0 6px rgba(48, 209, 88, 0.5);
766
748
  }
767
749
  }
768
- `,Lt=`${Jt}
769
- ${Yt}`;var a=class extends lit.LitElement{constructor(){super(...arguments);this.src="";this.alt="";this.size=R.size;this.variant=R.variant;this.shadow=R.shadow;this.border=false;this.borderWidth=R.borderWidth;this.borderColor=R.borderColor;this.rotation=0;this.loading=R.loading;this.placeholder=R.placeholder;this.placeholderColor=R.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;let t=document.createElement("style");t.textContent=At,document.head.appendChild(t),a.stylesInjected=true;}get pixelSize(){let t=this.size;return typeof t=="number"?t:N[t]??N[R.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=ot(this.pixelSize),e=it(this.bgColor),n=typeof window<"u"?window.location.hostname:"localhost";this.cdnImageUrl=at(a.cdnBaseUrl,this.extCustomerId,t,e,n);}getContainerStyles(){let t=Rt(this.bgColor,this.bgGradient),e=this.border?It(this.borderWidth,this.borderColor):null,n=zt(this.shadow),i={};if(this.glow){let d=this.glow.color??this.borderColor??"#6366f1";i={"--pp-glow-color":d,boxShadow:Dt(d,this.glow.intensity??.3)};}let p=this.interactive?.hoverable||this.interactive?.pressable;return {classes:$("pp-container",Et(this.variant),t.className,e?.className,p&&"pp-interactive",this.glow?.animate&&"pp-glow"),styles:{width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,borderRadius:H[this.variant],...t.style,...e?.style,...n,...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`
770
- ${this.placeholder==="shimmer"?lit.html`<style>${Tt}</style>`:lit.nothing}
750
+ `,Re=`${qe}
751
+ ${Je}`;var a=class extends lit.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 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:N[e]??N[$.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=oe(this.pixelSize),t=ie(this.bgColor),o=typeof window<"u"?window.location.hostname:"localhost";this.cdnImageUrl=ae(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 l=this.glow.color??this.borderColor??"#6366f1";i={"--pp-glow-color":l,boxShadow:De(l,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:H[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>${Ae}</style>`:lit.nothing}
771
753
  <div
772
- class=${$("np:absolute np:inset-0",t)}
754
+ class=${R("np:absolute np:inset-0",e)}
773
755
  style=${styleMap_js.styleMap({backgroundColor:this.placeholderColor,borderRadius:"inherit"})}>
774
756
  </div>
775
757
  `}renderFallback(){if(this.fallback)return lit.html`
776
758
  <span
777
759
  class="pp-fallback"
778
- style=${styleMap_js.styleMap({fontSize:`${rt(this.pixelSize)}px`})}>
760
+ style=${styleMap_js.styleMap({fontSize:`${re(this.pixelSize)}px`})}>
779
761
  ${this.fallback}
780
762
  </span>
781
- `;if(this.alt){let e=X(this.alt);return lit.html`
763
+ `;if(this.alt){let t=Y(this.alt);return lit.html`
782
764
  <div
783
765
  class="pp-fallback np:absolute np:inset-0"
784
- style=${styleMap_js.styleMap({background:this.bgColor??e,fontSize:`${rt(this.pixelSize)}px`})}>
785
- ${q(this.alt)}
766
+ style=${styleMap_js.styleMap({background:this.bgColor??t,fontSize:`${re(this.pixelSize)}px`})}>
767
+ ${J(this.alt)}
786
768
  </div>
787
- `}let t=this.pixelSize*.5;return lit.html`
769
+ `}let e=this.pixelSize*.5;return lit.html`
788
770
  <svg
789
771
  class="pp-fallback-icon"
790
- style="width: ${t}px; height: ${t}px;"
772
+ style="width: ${e}px; height: ${e}px;"
791
773
  fill="currentColor"
792
774
  viewBox="0 0 24 24">
793
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" />
794
776
  </svg>
795
- `}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`
796
778
  <img
797
- src=${e}
779
+ src=${t}
798
780
  alt=${this.alt}
799
781
  loading=${this.loading}
800
782
  decoding="async"
801
783
  @load=${this.handleLoad}
802
784
  @error=${this.handleError}
803
- class=${$("pp-image",this.isLoaded?"pp-image-loaded":"pp-image-loading")}
785
+ class=${R("pp-image",this.isLoaded?"pp-image-loaded":"pp-image-loading")}
804
786
  draggable="false" />
805
- `}renderRing(){if(!this.ring?.show)return lit.nothing;let t=this.ring.width??3,e=this.ring.gap??3,n=t+e,i,p=this.ring.progress!==void 0;if(p){let d=this.ring.progress??0,u=this.ring.color??"#30D158",f=this.ring.emptyColor??"#8E8E93";i=wt(d,u,f);}else this.ring.gradient&&this.ring.gradient.length>0?i=yt(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 l=this.ring.progress??0,f=this.ring.color??"#30D158",m=this.ring.emptyColor??"#8E8E93";i=we(l,f,m);}else this.ring.gradient&&this.ring.gradient.length>0?i=ve(this.ring.gradient):i=this.ring.color??"linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888)";return lit.html`
806
788
  <div
807
- class=${$("pp-ring",this.ring.animate&&!p&&"pp-ring-animated",p&&"pp-ring-progress")}
808
- style=${styleMap_js.styleMap({inset:`-${n}px`,padding:`${t}px`,background:i,borderRadius:H[this.variant]})}>
789
+ class=${R("pp-ring",this.ring.animate&&!p&&"pp-ring-animated",p&&"pp-ring-progress")}
790
+ style=${styleMap_js.styleMap({inset:`-${o}px`,padding:`${e}px`,background:i,borderRadius:H[this.variant]})}>
809
791
  </div>
810
- `}renderPresence(){if(!this.presence)return lit.nothing;let t=this.presence.thickness??2,e=xt(this.pixelSize,t),n=ut[this.presence.status],i=Math.max(0,this.pixelSize*.02);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=be(this.pixelSize,e),o=fe[this.presence.status],i=this.getCornerOffset();return lit.html`
811
793
  <div
812
- class=${$("pp-presence",this.presence.animate&&"pp-presence-animated")}
813
- style=${styleMap_js.styleMap({width:`${e}px`,height:`${e}px`,backgroundColor:n,bottom:`${i}px`,right:`${i}px`,color:n})}
794
+ class=${R("pp-presence",this.presence.animate&&"pp-presence-animated")}
795
+ style=${styleMap_js.styleMap({width:`${t}px`,height:`${t}px`,backgroundColor:o,bottom:`${i}px`,right:`${i}px`,color:o})}
814
796
  title=${this.presence.status}>
815
797
  </div>
816
- `}renderBadge(){if(!this.badge)return lit.nothing;let t=this.badge.position??"bottom-right",e=this.badge.content!==void 0,n=this.badge.icon!==void 0,i=e||n,{size:p,fontSize:d}=mt(this.pixelSize,i),u=this.badge.bgColor??"#22c55e",f=this.badge.color??"#ffffff",h=this.badge.borderRadius??"9999px",v=e&&this.badge.content!==void 0?vt(this.badge.content,this.badge.max):null,y=n?this.badge.icon:null,T=d*.9,l=`${-Math.round(this.pixelSize*.06)}px`,m={"top-left":{top:l,left:l},"top-center":{top:l,left:"50%",transform:"translateX(-50%)"},"top-right":{top:l,right:l},"bottom-left":{bottom:l,left:l},"bottom-center":{bottom:l,left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:l,right:l}};return lit.html`
817
- <div
818
- class=${$("pp-badge",this.badge.pulse&&"pp-badge-pulse",this.badge.glow&&"pp-badge-glow",n&&"pp-badge-with-icon")}
819
- 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:f,borderRadius:h,"--pp-badge-glow-color":u,gap:n&&e?"4px":"0",...m[t]})}>
820
- ${y?lit.html`<span class="pp-badge-icon" style=${styleMap_js.styleMap({fontSize:`${T}px`})}>${y}</span>`:lit.nothing}
821
- ${v??lit.nothing}
822
- </div>
823
- `}renderRibbon(){if(!this.ribbon)return lit.nothing;let t=this.ribbon.position??"top-right",e=this.ribbon.bgColor??"#ef4444",n=this.ribbon.color??"#ffffff",i=V(e)?{backgroundColor:e}:{background:e},p={color:n},d=Math.min(75,this.pixelSize*.9),u=Math.min(32,this.pixelSize*.4),f=Math.min(13,Math.max(8,this.pixelSize*.11));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:l}=he(this.pixelSize,i),f=this.badge.bgColor??"#22c55e",m=this.badge.color??"#ffffff",h=this.badge.borderRadius??"9999px",x=t&&this.badge.content!==void 0?xe(this.badge.content,this.badge.max):null,v=o?this.badge.icon:null,T=l*.9,c=`${-this.getCornerOffset()}px`,M={"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`
824
799
  <div
825
- class=${$("pp-ribbon-container",bt(t))}
826
- style=${styleMap_js.styleMap({width:`${d}px`,height:`${u}px`})}>
827
- <div
828
- class=${$("pp-ribbon np:origin-center np:transform",ht(t))}
829
- style=${styleMap_js.styleMap({fontSize:`${f}px`,padding:`${f*.3}px 0`,...i,...p})}>
830
- ${this.ribbon.icon?lit.html`<span style="margin-right: 2px">${this.ribbon.icon}</span>`:lit.nothing}
831
- ${this.ribbon.text}
832
- </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_js.styleMap({width:i?"auto":`${p}px`,minWidth:`${p}px`,height:`${p}px`,padding:i?"0 6px":"0",fontSize:`${l}px`,backgroundColor:f,color:m,borderRadius:h,"--pp-badge-glow-color":f,gap:o&&t?"4px":"0",...M[e]})}>
802
+ ${v?lit.html`<span class="pp-badge-icon" style=${styleMap_js.styleMap({fontSize:`${T}px`})}>${v}</span>`:lit.nothing}
803
+ ${x??lit.nothing}
833
804
  </div>
834
- `}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`
835
806
  <div
836
- class=${t.classes}
837
- style=${styleMap_js.styleMap(t.styles)}
838
- tabindex=${e??lit.nothing}
807
+ class=${e.classes}
808
+ style=${styleMap_js.styleMap(e.styles)}
809
+ tabindex=${t??lit.nothing}
839
810
  role=${this.interactive?.pressable?"button":lit.nothing}
840
811
  aria-label=${this.alt||lit.nothing}
841
812
  data-profile-picture>
@@ -854,16 +825,13 @@ ${Yt}`;var a=class extends lit.LitElement{constructor(){super(...arguments);this
854
825
  ${this.renderImage()}
855
826
  </div>
856
827
 
857
- <!-- Ribbon -->
858
- ${this.renderRibbon()}
859
-
860
828
  <!-- Badge -->
861
829
  ${this.renderBadge()}
862
830
 
863
831
  <!-- Presence Indicator -->
864
832
  ${this.renderPresence()}
865
833
  </div>
866
- `}};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:"ribbon",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],a.prototype,"ribbon",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 Mt=false;function Qt(){if(Mt||typeof document>"u")return;let r=document.createElement("style");r.textContent=Lt,document.head.appendChild(r),Mt=true;}var b=class extends lit.LitElement{constructor(){super(...arguments);this.max=z.max;this.direction=z.direction;this.overlap=z.overlap;this.size=z.size;this.showAddButton=false;this.addButtonLabel="Add user";this.animated=z.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 Qt(),this}get pixelSize(){return Ct(this.size)}get tooltipEnabled(){return this.tooltip?.enabled!==false}get tooltipPosition(){return this.tooltip?.position??"top"}get tooltipDelay(){return this.tooltip?.delay??z.tooltipDelay}get dropdownMaxHeight(){return this.dropdown?.maxHeight??z.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","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,n)=>{let i=e.getAttribute("border-width"),p=i?Number.parseInt(i,10):void 0;return {id:e.getAttribute("data-user-id")??void 0,name:e.getAttribute("alt")??`User ${n+1}`,src:e.getAttribute("src")??void 0,status:e.getAttribute("data-status")??void 0,element:e,index:n,variant:e.getAttribute("variant")??void 0,shadow:e.getAttribute("shadow")??void 0,border:e.hasAttribute("border"),borderWidth:p,borderColor:e.getAttribute("border-color")??void 0,bgColor:e.getAttribute("bg-color")??void 0,bgGradient:e.getAttribute("bg-gradient")??void 0}});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(),n=10,i=280,p=Math.min(this.dropdownMaxHeight+60,t.length*56+60),d=window.innerWidth,u=window.innerHeight;if(d<480){let S=lit.html`
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:e=>{if(e)try{return JSON.parse(e)}catch{return}},toAttribute:e=>e?JSON.stringify(e):null}})],a.prototype,"ring",2),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",2),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",2),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",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:e=>{if(e)try{return JSON.parse(e)}catch{return}},toAttribute:e=>e?JSON.stringify(e):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 de=false;function Qe(){if(de||typeof document>"u")return;(typeof requestIdleCallback<"u"?requestIdleCallback:n=>setTimeout(n,1))(()=>{if(de)return;let n=document.createElement("style");n.textContent=Re,document.head.appendChild(n),de=true;});}var g=class extends lit.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 Qe(),this}get pixelSize(){return ye(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=t.getAttribute("border-width"),p=i?Number.parseInt(i,10):void 0;return {id:t.getAttribute("data-user-id")??void 0,name:t.getAttribute("alt")??`User ${o+1}`,src:t.getAttribute("src")??void 0,extCustomerId:t.getAttribute("ext-customer-id")??void 0,status:t.getAttribute("data-status")??void 0,element:t,index:o,variant:t.getAttribute("variant")??void 0,shadow:t.getAttribute("shadow")??void 0,border:t.hasAttribute("border"),borderWidth:p,borderColor:t.getAttribute("border-color")??void 0,bgColor:t.getAttribute("bg-color")??void 0,bgGradient:t.getAttribute("bg-gradient")??void 0}});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),l=window.innerWidth,f=window.innerHeight;if(l<480){let y=lit.html`
867
835
  <div
868
836
  class="ppg-backdrop ppg-backdrop-visible"
869
837
  style="pointer-events: auto; background: rgba(0,0,0,0.5);"
@@ -878,16 +846,16 @@ ${Yt}`;var a=class extends lit.LitElement{constructor(){super(...arguments);this
878
846
  aria-label="Hidden users"
879
847
  >
880
848
  <div class="ppg-dropdown-header">
881
- ${t.length} more
849
+ ${e.length} more
882
850
  </div>
883
851
  <div
884
852
  class="ppg-dropdown-list"
885
853
  style=${styleMap_js.styleMap({maxHeight:"calc(70vh - 60px)"})}
886
854
  >
887
- ${t.map(L=>this.renderDropdownItem(L))}
855
+ ${e.map(A=>this.renderDropdownItem(A))}
888
856
  </div>
889
857
  </div>
890
- `;lit.render(S,this.portalContainer);return}let h=u-e.bottom-n,v=e.top-n,y=d-e.left,T=e.right,l=this.dropdownPosition;l==="bottom"&&h<p&&v>h?l="top":l==="top"&&v<p&&h>v&&(l="bottom");let m;y>=i?m=e.left:T>=i?m=e.right-i:m=(d-i)/2,m=Math.max(8,Math.min(m,d-i-8));let M=l==="bottom"?e.bottom+n:void 0,U=l==="top"?u-e.top+n:void 0,P=lit.html`
858
+ `;lit.render(y,this.portalContainer);return}let h=f-t.bottom-o,x=t.top-o,v=l-t.left,T=t.right,b=this.dropdownPosition;b==="bottom"&&h<p&&x>h?b="top":b==="top"&&x<p&&h>x&&(b="bottom");let c;v>=i?c=t.left:T>=i?c=t.right-i:c=(l-i)/2,c=Math.max(8,Math.min(c,l-i-8));let M=b==="bottom"?t.bottom+o:void 0,U=b==="top"?f-t.top+o:void 0,j=lit.html`
891
859
  <div
892
860
  class="ppg-backdrop"
893
861
  style="pointer-events: auto;"
@@ -896,73 +864,74 @@ ${Yt}`;var a=class extends lit.LitElement{constructor(){super(...arguments);this
896
864
  ></div>
897
865
  <div
898
866
  class="ppg-dropdown ppg-dropdown-portal"
899
- style=${styleMap_js.styleMap({position:"fixed",pointerEvents:"auto",top:M!==void 0?`${M}px`:"auto",bottom:U!==void 0?`${U}px`:"auto",left:`${m}px`,width:`${i}px`})}
900
- data-position=${l}
867
+ style=${styleMap_js.styleMap({position:"fixed",pointerEvents:"auto",top:M!==void 0?`${M}px`:"auto",bottom:U!==void 0?`${U}px`:"auto",left:`${c}px`,width:`${i}px`})}
868
+ data-position=${b}
901
869
  role="menu"
902
870
  aria-label="Hidden users"
903
871
  >
904
872
  <div class="ppg-dropdown-header">
905
- ${t.length} more
873
+ ${e.length} more
906
874
  </div>
907
875
  <div
908
876
  class="ppg-dropdown-list"
909
877
  style=${styleMap_js.styleMap({maxHeight:`${this.dropdownMaxHeight}px`})}
910
878
  >
911
- ${t.map(S=>this.renderDropdownItem(S))}
879
+ ${e.map(y=>this.renderDropdownItem(y))}
912
880
  </div>
913
881
  </div>
914
- `;lit.render(P,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 n=e.currentTarget;this.tooltipTimeout=window.setTimeout(()=>{this.tooltipData={user:t,rect:n.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,n){let i=Z(e,this.pixelSize,this.overlap,this.direction,this.spacing),p=St(e,n,this.direction),d=t.variant??"circle",u=t.shadow??"none",f=this.rotationAmount?e%2===0?-this.rotationAmount:this.rotationAmount:0;return lit.html`
882
+ `;lit.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=K(t,this.pixelSize,this.overlap,this.direction,this.spacing),p=Ce(t,o,this.direction),l=e.variant??"circle",f=e.shadow??"none",m=this.rotationAmount?t%2===0?-this.rotationAmount:this.rotationAmount:0;return lit.html`
915
883
  <div
916
884
  class="ppg-avatar-wrapper"
917
885
  style=${styleMap_js.styleMap({left:`${i}px`,zIndex:String(p),width:`${this.pixelSize}px`,height:`${this.pixelSize}px`})}
918
886
  tabindex="0"
919
887
  role="button"
920
- aria-label=${t.name}
921
- @click=${()=>this.handleAvatarClick(t)}
922
- @mouseenter=${h=>this.handleAvatarHover(t,h)}
888
+ aria-label=${e.name}
889
+ @click=${()=>this.handleAvatarClick(e)}
890
+ @mouseenter=${h=>this.handleAvatarHover(e,h)}
923
891
  @mouseleave=${this.handleAvatarLeave}
924
- @keydown=${h=>this.handleKeyDown(h,()=>this.handleAvatarClick(t))}
892
+ @keydown=${h=>this.handleKeyDown(h,()=>this.handleAvatarClick(e))}
925
893
  >
926
- ${this.renderProfilePicture(t,d,u,f)}
894
+ ${this.renderProfilePicture(e,l,f,m)}
927
895
  </div>
928
- `}renderProfilePicture(t,e,n,i){return lit.html`
896
+ `}renderProfilePicture(e,t,o,i){return lit.html`
929
897
  <profile-picture
930
- .src=${t.src??""}
931
- .alt=${t.name}
898
+ .src=${e.src||void 0}
899
+ .alt=${e.name}
932
900
  .size=${this.pixelSize}
933
- .variant=${e}
934
- .shadow=${n}
901
+ .variant=${t}
902
+ .shadow=${o}
935
903
  .rotation=${i}
936
- ?border=${t.border}
937
- .borderWidth=${t.border?t.borderWidth??2:2}
938
- .borderColor=${t.border?t.borderColor??"#ffffff":"#ffffff"}
939
- .bgColor=${t.bgGradient?void 0:t.bgColor??"#ffffff"}
940
- .bgGradient=${t.bgGradient??void 0}
941
- data-user-id=${t.id??""}
942
- 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??""}
943
912
  ></profile-picture>
944
- `}renderCounter(t,e,n){return lit.html`
913
+ `}renderCounter(e,t,o){return lit.html`
945
914
  <button
946
915
  class="ppg-counter"
947
- style=${styleMap_js.styleMap({left:`${e}px`,width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,zIndex:"1"})}
948
- 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`}
949
918
  aria-expanded=${this.dropdownOpen}
950
919
  aria-haspopup="true"
951
- @click=${()=>this.handleCounterClick(n)}
920
+ @click=${()=>this.handleCounterClick(o)}
952
921
  >
953
- ${$t(t)}
922
+ ${ke(e)}
954
923
  </button>
955
- `}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`
956
925
  <button
957
926
  class="ppg-add-button"
958
- 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"})}
959
928
  aria-label=${this.addButtonLabel}
960
929
  @click=${this.handleAddClick}
961
930
  >
962
931
  <svg
963
932
  class="ppg-add-icon"
964
- width=${e}
965
- height=${e}
933
+ width=${t}
934
+ height=${t}
966
935
  viewBox="0 0 24 24"
967
936
  fill="none"
968
937
  stroke="currentColor"
@@ -974,50 +943,54 @@ ${Yt}`;var a=class extends lit.LitElement{constructor(){super(...arguments);this
974
943
  <line x1="5" y1="12" x2="19" y2="12"></line>
975
944
  </svg>
976
945
  </button>
977
- `}renderTooltip(){if(!this.tooltipData)return lit.nothing;let{user:t,rect:e}=this.tooltipData,n=8,i=this.getBoundingClientRect(),p=e.left-i.left+e.width/2,d=e.top-i.top,u=e.bottom-i.top,f=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,l=t.top-i.top,f=t.bottom-i.top,m=this.tooltipPosition==="top";return lit.html`
978
947
  <div
979
948
  class="ppg-tooltip"
980
- style=${styleMap_js.styleMap({top:f?"auto":`${u+n}px`,bottom:f?`${i.height-d+n}px`:"auto",left:`${p}px`})}
949
+ style=${styleMap_js.styleMap({top:m?"auto":`${f+o}px`,bottom:m?`${i.height-l+o}px`:"auto",left:`${p}px`})}
981
950
  data-position=${this.tooltipPosition}
982
951
  role="tooltip"
983
952
  >
984
- ${t.name}
953
+ ${e.name}
985
954
  </div>
986
- `}renderDropdownItem(t){let e=X(t.name);return lit.html`
955
+ `}renderDropdownItem(e){let t=Y(e.name),o=e.src||e.extCustomerId;return lit.html`
987
956
  <div
988
957
  class="ppg-dropdown-item"
989
958
  role="menuitem"
990
959
  tabindex="0"
991
- @click=${()=>this.handleDropdownItemClick(t)}
992
- @keydown=${n=>this.handleKeyDown(n,()=>this.handleDropdownItemClick(t))}
960
+ @click=${()=>this.handleDropdownItemClick(e)}
961
+ @keydown=${i=>this.handleKeyDown(i,()=>this.handleDropdownItemClick(e))}
993
962
  >
994
- ${t.src?lit.html`<img
963
+ ${o?lit.html`<profile-picture
995
964
  class="ppg-dropdown-avatar"
996
- src=${t.src}
997
- alt=${t.name}
998
- />`:lit.html`<div
965
+ .src=${e.src||void 0}
966
+ .alt=${e.name}
967
+ .extCustomerId=${e.extCustomerId}
968
+ .size=${40}
969
+ variant="circle"
970
+ shadow="none"
971
+ ></profile-picture>`:lit.html`<div
999
972
  class="ppg-dropdown-avatar-fallback"
1000
- style=${styleMap_js.styleMap({background:e})}
973
+ style=${styleMap_js.styleMap({background:t})}
1001
974
  >
1002
- ${q(t.name)}
975
+ ${J(e.name)}
1003
976
  </div>`}
1004
977
  <div class="ppg-dropdown-info">
1005
- <div class="ppg-dropdown-name">${t.name}</div>
1006
- ${this.showPresence&&t.status?lit.html`
978
+ <div class="ppg-dropdown-name">${e.name}</div>
979
+ ${this.showPresence&&e.status?lit.html`
1007
980
  <div class="ppg-dropdown-status">
1008
981
  <span
1009
982
  class="ppg-dropdown-presence"
1010
- data-status=${t.status}
983
+ data-status=${e.status}
1011
984
  ></span>
1012
- ${this.formatStatus(t.status)}
985
+ ${this.formatStatus(e.status)}
1013
986
  </div>
1014
987
  `:lit.nothing}
1015
988
  </div>
1016
989
  </div>
1017
- `}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:n}=nt(this.users.length,this.max,this.showAddButton),i=this.users.slice(n);this.updatePortalContent(i);}}render(){let{visible:t,hidden:e,showCounter:n}=nt(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;n&&d++,this.showAddButton&&d++;let u=kt(d,this.pixelSize,this.overlap,this.spacing),f=n?Z(t,this.pixelSize,this.overlap,this.direction,this.spacing):0,h=Z(t+(n?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}=ne(this.users.length,this.max,this.showAddButton),i=this.users.slice(o);this.updatePortalContent(i);}}render(){let{visible:e,hidden:t,showCounter:o}=ne(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),l=e;o&&l++,this.showAddButton&&l++;let f=Se(l,this.pixelSize,this.overlap,this.spacing),m=o?K(e,this.pixelSize,this.overlap,this.direction,this.spacing):0,h=K(e+(o?1:0),this.pixelSize,this.overlap,this.direction,this.spacing);return lit.html`
1018
991
  <div
1019
- class=${$("ppg-container",this.animated&&"ppg-animated")}
1020
- style=${styleMap_js.styleMap({width:`${u}px`,height:`${this.pixelSize}px`})}
992
+ class=${R("ppg-container",this.animated&&"ppg-animated")}
993
+ style=${styleMap_js.styleMap({width:`${f}px`,height:`${this.pixelSize}px`})}
1021
994
  role="group"
1022
995
  aria-label="User avatars"
1023
996
  >
@@ -1025,10 +998,10 @@ ${Yt}`;var a=class extends lit.LitElement{constructor(){super(...arguments);this
1025
998
  <slot style="display: none;"></slot>
1026
999
 
1027
1000
  <!-- Visible avatars -->
1028
- ${i.map((v,y)=>this.renderAvatar(v,y,t))}
1001
+ ${i.map((x,v)=>this.renderAvatar(x,v,e))}
1029
1002
 
1030
1003
  <!-- Counter -->
1031
- ${n?this.renderCounter(e,f,p):lit.nothing}
1004
+ ${o?this.renderCounter(t,m,p):lit.nothing}
1032
1005
 
1033
1006
  <!-- Add button -->
1034
1007
  ${this.showAddButton?this.renderAddButton(h):lit.nothing}
@@ -1036,5 +1009,5 @@ ${Yt}`;var a=class extends lit.LitElement{constructor(){super(...arguments);this
1036
1009
  <!-- Tooltip -->
1037
1010
  ${this.renderTooltip()}
1038
1011
  </div>
1039
- `}};s([decorators_js.property({type:Number})],b.prototype,"max",2),s([decorators_js.property({type:String})],b.prototype,"direction",2),s([decorators_js.property({type:Number})],b.prototype,"overlap",2),s([decorators_js.property({type:String})],b.prototype,"size",2),s([decorators_js.property({type:Number})],b.prototype,"spacing",2),s([decorators_js.property({type:Object})],b.prototype,"tooltip",2),s([decorators_js.property({type:Object})],b.prototype,"dropdown",2),s([decorators_js.property({type:Boolean,attribute:"show-add-button"})],b.prototype,"showAddButton",2),s([decorators_js.property({type:String,attribute:"add-button-label"})],b.prototype,"addButtonLabel",2),s([decorators_js.property({type:Boolean})],b.prototype,"animated",2),s([decorators_js.property({type:Number,attribute:"rotation-amount"})],b.prototype,"rotationAmount",2),s([decorators_js.state()],b.prototype,"users",2),s([decorators_js.state()],b.prototype,"dropdownOpen",2),s([decorators_js.state()],b.prototype,"tooltipData",2),b=s([decorators_js.customElement("profile-picture-group")],b);var dt=Ut__default.default.forwardRef(({max:r,direction:o,overlap:t,size:e,spacing:n,tooltip:i,dropdown:p,showAddButton:d,addButtonLabel:u,animated:f,rotationAmount:h,onAvatarClick:v,onAvatarHover:y,onCounterClick:T,onDropdownItemClick:l,onAddClick:m,className:M,style:U,children:P},S)=>{let L=Ut.useRef(null),B=Ut.useCallback(g=>{v?.(g.detail.user);},[v]),O=Ut.useCallback(g=>{y?.(g.detail.user);},[y]),G=Ut.useCallback(g=>{let k=g;T?.(k.detail.hiddenUsers,k.detail.open);},[T]),F=Ut.useCallback(g=>{l?.(g.detail.user);},[l]),j=Ut.useCallback(()=>{m?.();},[m]);return Ut.useEffect(()=>{let g=L.current;if(g)return g.addEventListener("avatar-click",B),g.addEventListener("avatar-hover",O),g.addEventListener("counter-click",G),g.addEventListener("dropdown-item-click",F),g.addEventListener("add-click",j),()=>{g.removeEventListener("avatar-click",B),g.removeEventListener("avatar-hover",O),g.removeEventListener("counter-click",G),g.removeEventListener("dropdown-item-click",F),g.removeEventListener("add-click",j);}},[B,O,G,F,j]),Ut.useEffect(()=>{typeof S=="function"?S(L.current):S&&(S.current=L.current);},[S]),Ut__default.default.createElement("profile-picture-group",{ref:L,max:r,direction:o,overlap:t,size:e,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":u,animated:f,"rotation-amount":h,class:M,style:U},P)});dt.displayName="ProfilePictureGroup";function Gt({src:r,alt:o,extCustomerId:t,size:e,variant:n,shadow:i,border:p,borderWidth:d,borderColor:u,rotation:f,bgColor:h,bgGradient:v,glow:y,ring:T,presence:l,ribbon:m,badge:M,loading:U,placeholder:P,placeholderColor:S,fallback:L,interactive:B,onLoad:O,onError:G,onCdnError:F,className:j,style:g,ref:k}){let Y=Ut.useRef(null),_=Ut.useCallback(()=>{O?.();},[O]),tt=Ut.useCallback(()=>{G?.();},[G]),et=Ut.useCallback(D=>{F?.(D.detail);},[F]);return Ut.useEffect(()=>{let D=Y.current;if(D)return D.addEventListener("load",_),D.addEventListener("error",tt),D.addEventListener("cdn-error",et),()=>{D.removeEventListener("load",_),D.removeEventListener("error",tt),D.removeEventListener("cdn-error",et);}},[_,tt,et]),Ut.useEffect(()=>{typeof k=="function"?k(Y.current):k&&(k.current=Y.current);},[k]),Ut__default.default.createElement("profile-picture",{ref:Y,src:r,alt:o,"ext-customer-id":t,size:e,variant:n,shadow:i,border:p||void 0,"border-width":d,"border-color":u,rotation:f,"bg-color":h,"bg-gradient":v,glow:y?JSON.stringify(y):void 0,ring:T?JSON.stringify(T):void 0,presence:l?JSON.stringify(l):void 0,ribbon:m?JSON.stringify(m):void 0,badge:M?JSON.stringify(M):void 0,loading:U,placeholder:P,"placeholder-color":S,fallback:L,interactive:B?JSON.stringify(B):void 0,class:j,style:g})}Gt.displayName="ProfilePicture";gt();exports.ProfilePicture=Gt;exports.ProfilePictureGroup=dt;exports.constructCdnUrl=at;exports.detectThemeFromColor=it;exports.getCdnSizeLabel=ot;//# sourceMappingURL=index.cjs.map
1012
+ `}};s([decorators_js.property({type:Number})],g.prototype,"max",2),s([decorators_js.property({type:String})],g.prototype,"direction",2),s([decorators_js.property({type:Number})],g.prototype,"overlap",2),s([decorators_js.property({type:String})],g.prototype,"size",2),s([decorators_js.property({type:Number})],g.prototype,"spacing",2),s([decorators_js.property({type:Object})],g.prototype,"tooltip",2),s([decorators_js.property({type:Object})],g.prototype,"dropdown",2),s([decorators_js.property({type:Boolean,attribute:"show-add-button"})],g.prototype,"showAddButton",2),s([decorators_js.property({type:String,attribute:"add-button-label"})],g.prototype,"addButtonLabel",2),s([decorators_js.property({type:Boolean})],g.prototype,"animated",2),s([decorators_js.property({type:Number,attribute:"rotation-amount"})],g.prototype,"rotationAmount",2),s([decorators_js.state()],g.prototype,"users",2),s([decorators_js.state()],g.prototype,"dropdownOpen",2),s([decorators_js.state()],g.prototype,"tooltipData",2),g=s([decorators_js.customElement("profile-picture-group")],g);var le=Le__default.default.forwardRef(({max:r,direction:n,overlap:e,size:t,spacing:o,tooltip:i,dropdown:p,showAddButton:l,addButtonLabel:f,animated:m,rotationAmount:h,onAvatarClick:x,onAvatarHover:v,onCounterClick:T,onDropdownItemClick:b,onAddClick:c,className:M,style:U,children:j},y)=>{let A=Le.useRef(null),B=Le.useCallback(d=>{x?.(d.detail.user);},[x]),O=Le.useCallback(d=>{v?.(d.detail.user);},[v]),G=Le.useCallback(d=>{let k=d;T?.(k.detail.hiddenUsers,k.detail.open);},[T]),P=Le.useCallback(d=>{b?.(d.detail.user);},[b]),V=Le.useCallback(()=>{c?.();},[c]);return Le.useEffect(()=>{let d=A.current;if(d)return d.addEventListener("avatar-click",B),d.addEventListener("avatar-hover",O),d.addEventListener("counter-click",G),d.addEventListener("dropdown-item-click",P),d.addEventListener("add-click",V),()=>{d.removeEventListener("avatar-click",B),d.removeEventListener("avatar-hover",O),d.removeEventListener("counter-click",G),d.removeEventListener("dropdown-item-click",P),d.removeEventListener("add-click",V);}},[B,O,G,P,V]),Le.useEffect(()=>{typeof y=="function"?y(A.current):y&&(y.current=A.current);},[y]),Le__default.default.createElement("profile-picture-group",{ref:A,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":l||void 0,"add-button-label":f,animated:m,"rotation-amount":h,class:M,style:U},j)});le.displayName="ProfilePictureGroup";function Be({src:r,alt:n,extCustomerId:e,size:t,variant:o,shadow:i,border:p,borderWidth:l,borderColor:f,rotation:m,bgColor:h,bgGradient:x,glow:v,ring:T,presence:b,badge:c,loading:M,placeholder:U,placeholderColor:j,fallback:y,interactive:A,onLoad:B,onError:O,onCdnError:G,className:P,style:V,ref:d}){let k=Le.useRef(null),Z=Le.useCallback(()=>{B?.();},[B]),Q=Le.useCallback(()=>{O?.();},[O]),_=Le.useCallback(D=>{G?.(D.detail);},[G]);return Le.useEffect(()=>{let D=k.current;if(D)return D.addEventListener("load",Z),D.addEventListener("error",Q),D.addEventListener("cdn-error",_),()=>{D.removeEventListener("load",Z),D.removeEventListener("error",Q),D.removeEventListener("cdn-error",_);}},[Z,Q,_]),Le.useEffect(()=>{typeof d=="function"?d(k.current):d&&(d.current=k.current);},[d]),Le__default.default.createElement("profile-picture",{ref:k,src:r,alt:n,"ext-customer-id":e,size:t,variant:o,shadow:i,border:p||void 0,"border-width":l,"border-color":f,rotation:m,"bg-color":h,"bg-gradient":x,glow:v?JSON.stringify(v):void 0,ring:T?JSON.stringify(T):void 0,presence:b?JSON.stringify(b):void 0,badge:c?JSON.stringify(c):void 0,loading:M,placeholder:U,"placeholder-color":j,fallback:y,interactive:A?JSON.stringify(A):void 0,class:P,style:V})}Be.displayName="ProfilePicture";ge();exports.ProfilePicture=Be;exports.ProfilePictureGroup=le;exports.constructCdnUrl=ae;exports.detectThemeFromColor=ie;exports.getCdnSizeLabel=oe;//# sourceMappingURL=index.cjs.map
1040
1013
  //# sourceMappingURL=index.cjs.map