wc-country-name
Version:
A web component for displaying country name in desired locale
2 lines (1 loc) • 3.4 kB
JavaScript
function h(){}function m(t){return t()}function S(){return Object.create(null)}function l(t){t.forEach(m)}function g(t){return typeof t=="function"}function H(t,n){return t!=t?n==n:t!==n||t&&typeof t=="object"||typeof t=="function"}function L(t){return Object.keys(t).length===0}function q(t,n){t.appendChild(n)}function A(t,n,e){t.insertBefore(n,e||null)}function j(t){t.parentNode&&t.parentNode.removeChild(t)}function B(t){return document.createElement(t)}function P(t){return document.createTextNode(t)}function z(t){return Array.from(t.childNodes)}function D(t,n){n=""+n,t.data!==n&&(t.data=n)}function F(t){const n={};for(const e of t)n[e.name]=e.value;return n}let _;function d(t){_=t}const s=[],v=[];let a=[];const M=[],G=Promise.resolve();let b=!1;function I(){b||(b=!0,G.then(k))}function y(t){a.push(t)}const x=new Set;let i=0;function k(){if(i!==0)return;const t=_;do{try{for(;i<s.length;){const n=s[i];i++,d(n),J(n.$$)}}catch(n){throw s.length=0,i=0,n}for(d(null),s.length=0,i=0;v.length;)v.pop()();for(let n=0;n<a.length;n+=1){const e=a[n];x.has(e)||(x.add(e),e())}a.length=0}while(s.length);for(;M.length;)M.pop()();b=!1,x.clear(),d(t)}function J(t){if(t.fragment!==null){t.update(),l(t.before_update);const n=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,n),t.after_update.forEach(y)}}function K(t){const n=[],e=[];a.forEach(r=>t.indexOf(r)===-1?n.push(r):e.push(r)),e.forEach(r=>r()),a=n}const Q=new Set;function R(t,n){t&&t.i&&(Q.delete(t),t.i(n))}function U(t,n,e,r){const{fragment:u,after_update:p}=t.$$;u&&u.m(n,e),r||y(()=>{const f=t.$$.on_mount.map(m).filter(g);t.$$.on_destroy?t.$$.on_destroy.push(...f):l(f),t.$$.on_mount=[]}),p.forEach(y)}function V(t,n){const e=t.$$;e.fragment!==null&&(K(e.after_update),l(e.on_destroy),e.fragment&&e.fragment.d(n),e.on_destroy=e.fragment=null,e.ctx=[])}function W(t,n){t.$$.dirty[0]===-1&&(s.push(t),I(),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<<n%31}function X(t,n,e,r,u,p,f,T=[-1]){const $=_;d(t);const o=t.$$={fragment:null,ctx:[],props:p,update:h,not_equal:u,bound:S(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||($?$.$$.context:[])),callbacks:S(),dirty:T,skip_bound:!1,root:n.target||$.$$.root};f&&f(o.root);let E=!1;if(o.ctx=e?e(t,n.props||{},(c,C,...w)=>{const N=w.length?w[0]:C;return o.ctx&&u(o.ctx[c],o.ctx[c]=N)&&(!o.skip_bound&&o.bound[c]&&o.bound[c](N),E&&W(t,c)),C}):[],o.update(),E=!0,l(o.before_update),o.fragment=r?r(o.ctx):!1,n.target){if(n.hydrate){const c=z(n.target);o.fragment&&o.fragment.l(c),c.forEach(j)}else o.fragment&&o.fragment.c();n.intro&&R(t.$$.fragment),U(t,n.target,n.anchor,n.customElement),k()}d($)}let O;typeof HTMLElement=="function"&&(O=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(m).filter(g);for(const n in this.$$.slotted)this.appendChild(this.$$.slotted[n])}attributeChangedCallback(t,n,e){this[t]=e}disconnectedCallback(){l(this.$$.on_disconnect)}$destroy(){V(this,1),this.$destroy=h}$on(t,n){if(!g(n))return h;const e=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return e.push(n),()=>{const r=e.indexOf(n);r!==-1&&e.splice(r,1)}}$set(t){this.$$set&&!L(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});export{O as S,F as a,A as b,q as c,D as d,B as e,k as f,j as g,X as i,h as n,H as s,P as t};