import{aD as t,aF as e,bU as s,G as o,b1 as i,aE as r,aH as n,c2 as a,L as c,c0 as l,aG as h,a$ as f,b0 as u,b2 as d,b3 as p}from"./p-BTBbFFOR.js";import{s as v}from"./p-C2rs7Hxy.js";import{I as g,V as b}from"./p-ULeawcYN.js";import{f as m}from"./p-CfzB6QoH.js";import"./p-cEccaEEN.js";import"./p-B2ZFKKru.js";import"./p-BpvVF1E7.js";var j=function(t,e,s,o){var i,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(n=(r<3?i(n):r>3?i(e,s,n):i(e,s))||n);return r>3&&n&&Object.defineProperty(e,s,n),n};class y extends e{constructor(){super()}render(){const t=s.getIconKey(this.country),e=o.hasIcon(t),r=m(this.size,"widthAndHeight"),n=`calc(${r} * 4 / 3)`;return e?i("vega-icon",{icon:t,size:this.size,style:{"--vega-icon-width":n}}):i("vega-skeleton",{type:"image",corners:"rounded-2",height:r,width:n})}}j([t()],y.prototype,"size",void 0),j([t()],y.prototype,"country",void 0);var R=function(t,e,s,o){var i,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(n=(r<3?i(n):r>3?i(e,s,n):i(e,s))||n);return r>3&&n&&Object.defineProperty(e,s,n),n};class w extends e{constructor(){super(),this.isAcceptObserver=()=>!0,this.listenerCallback=()=>{l(this.host)}}componentWillLoad(){this.country&&(this.isFlagForCountryCodeLoaded(this.country)||this.registerObserver())}unRegisterObserver(){this.observer&&(n.unregister(a,this.observer),this.observer=null)}registerObserver(){this.observer=new h(this.isAcceptObserver.bind(this),this.listenerCallback.bind(this)),n.register(a,this.observer)}isFlagForCountryCodeLoaded(t){const e=s.getIconKey(t);return s.hasIcon(e)}}!async function(){try{const t=(await import("./p-SnxvXg-z.js")).CountryFlags;s.register(t),n.notify(a,{})}catch(t){c.error("Error loading flag module:",t)}}(),R([t()],w.prototype,"host",void 0),R([t()],w.prototype,"country",void 0),R([r("componentWillLoad")],w.prototype,"componentWillLoad",null),R([r("disconnectedCallback")],w.prototype,"unRegisterObserver",null);var O=function(t,e,s,o){var i,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(n=(r<3?i(n):r>3?i(e,s,n):i(e,s))||n);return r>3&&n&&Object.defineProperty(e,s,n),n};const F=class{constructor(t){u(this,t),this.globalSlimmers={},this.renderer=new y,this.vegaFlagIconController=new w,this.vegaComponentUsageRuntimeMetricsSlimmer=new b,this.size="size-16"}render(){return v(i(d,null,this.renderer.render()),this.host)}get host(){return p(this)}};O([g()],F.prototype,"globalSlimmers",void 0),O([f()],F.prototype,"renderer",void 0),O([f()],F.prototype,"vegaFlagIconController",void 0),O([f()],F.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),F.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{F as vega_flag_icon}