import{h as t,f as e,r as s,H as o,g as i}from"./p-6b2342e0.js";import{s as r}from"./p-717cb35f.js";import{c,V as a,M as n,L as p}from"./p-dcc98162.js";import{I as f}from"./p-c45f0189.js";import{V as l,I as d}from"./p-9deec7a5.js";import{V as m}from"./p-dfd0e4f2.js";import{VegaIconManager as h}from"./p-18cbb2fa.js";import{f as j}from"./p-ac0df32b.js";import{f as u}from"./p-a528714c.js";import{O as v}from"./p-331a62d5.js";import{C as b}from"./p-816f6fc6.js";import"./p-3a41fc0a.js";import"./p-9ec80349.js";import"./p-8b5d3a52.js";import"./p-add8f9c6.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-07efff32.js";import"./p-d884c644.js";import"./p-ce3cf81d.js";import"./p-d72f6c7e.js";import"./p-49a2e141.js";import"./p-262ec334.js";import"./p-0c667d6a.js";import"./p-d27ae9ff.js";import"./p-6b07e711.js";import"./p-5a25014f.js";import"./p-20afe04b.js";var g=function(t,e,s,o){var i,r=arguments.length,c=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,s,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(c=(r<3?i(c):r>3?i(e,s,c):i(e,s))||c);return r>3&&c&&Object.defineProperty(e,s,c),c};class y extends a{render(){const e=m.getIconKey(this.country),s=h.hasIcon(e),o=j(this.size,"widthAndHeight"),i=`calc(${o} * 4 / 3)`;return s?t("vega-icon",{icon:e,size:this.size,style:{"--vega-icon-width":i}}):t("vega-skeleton",{type:"image",corners:"rounded-2",height:o,width:i})}}g([c()],y.prototype,"size",void 0),g([c()],y.prototype,"country",void 0);var R=function(t,e,s,o){var i,r=arguments.length,c=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,s,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(c=(r<3?i(c):r>3?i(e,s,c):i(e,s))||c);return r>3&&c&&Object.defineProperty(e,s,c),c};class w extends a{constructor(){super(...arguments),this.isAcceptObserver=()=>!0,this.listenerCallback=()=>{e(this.host)}}componentWillLoad(){this.country&&(this.isFlagForCountryCodeLoaded(this.country)||this.registerObserver())}unRegisterObserver(){this.observer&&(b.unregister(u,this.observer),this.observer=null)}registerObserver(){this.observer=new v(this.isAcceptObserver.bind(this),this.listenerCallback.bind(this)),b.register(u,this.observer)}isFlagForCountryCodeLoaded(t){const e=m.getIconKey(t);return m.hasIcon(e)}}!async function(){try{const t=(await import("./p-3e258753.js")).CountryFlags;m.register(t),b.notify(u,{})}catch(t){p.error("Error loading flag module:",t)}}(),R([c()],w.prototype,"host",void 0),R([c()],w.prototype,"country",void 0),R([n("componentWillLoad")],w.prototype,"componentWillLoad",null),R([n("disconnectedCallback")],w.prototype,"unRegisterObserver",null);var O=function(t,e,s,o){var i,r=arguments.length,c=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,s,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(c=(r<3?i(c):r>3?i(e,s,c):i(e,s))||c);return r>3&&c&&Object.defineProperty(e,s,c),c};const C=class{constructor(t){s(this,t),this.globalSlimmers={},this.renderer=new y,this.vegaFlagIconController=new w,this.vegaComponentUsageRuntimeMetricsSlimmer=new l,this.size="size-16"}render(){return r(t(o,null,this.renderer.render()),this.host)}get host(){return i(this)}};O([d()],C.prototype,"globalSlimmers",void 0),O([f()],C.prototype,"renderer",void 0),O([f()],C.prototype,"vegaFlagIconController",void 0),O([f()],C.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),C.style=":host{display:inline-block}:host vega-icon,:host vega-skeleton,:host svg{display:block;border-radius:2px}:host vega-icon{width:var(--vega-icon-width, 24px)}";export{C as vega_flag_icon}