var __awaiter=this&&this.__awaiter||function(t,n,e,r){return new(e||(e=Promise))(function(i,s){function a(t){try{u(r.next(t))}catch(t){s(t)}}function o(t){try{u(r["throw"](t))}catch(t){s(t)}}function u(t){t.done?i(t.value):new e(function(n){n(t.value)}).then(a,o)}u((r=r.apply(t,n||[])).next())})};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(t){return function(n){return u([t,n])}}function u(a){if(r)throw new TypeError("Generator is already executing.");while(e)try{if(r=1,i&&(s=a[0]&2?i["return"]:a[0]?i["throw"]||((s=i["return"])&&s.call(i),0):i.next)&&!(s=s.call(i,a[1])).done)return s;if(i=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:e.label++;return{value:a[1],done:false};case 5:e.label++;i=a[1];a=[0];continue;case 7:a=e.ops.pop();e.trys.pop();continue;default:if(!(s=e.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){e.label=a[1];break}if(a[0]===6&&e.label<s[1]){e.label=s[1];s=a;break}if(s&&e.label<s[2]){e.label=s[2];e.ops.push(a);break}if(s[2])e.ops.pop();e.trys.pop();continue}a=n.call(t,e)}catch(t){a=[6,t];i=0}finally{r=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-dde863a3.system.js","./p-1095b4e8.system.js","./p-ed9e4708.system.js"],function(t){"use strict";var n,e,r,i;return{setters:[function(t){n=t.r;e=t.h;r=t.g},function(){},function(t){i=t.T}],execute:function(){var s=function(){function t(t){n(this,t);this.paramsJson="{}";this.transform="none";this.translate=i.instance}t.prototype.componentDidLoad=function(){this.postRender()};t.prototype.componentDidUpdate=function(){this.postRender()};t.prototype.postRender=function(){return __awaiter(this,void 0,void 0,function(){var t,n,e;return __generator(this,function(r){switch(r.label){case 0:t=this.el.querySelector("span").innerText.trim();if(this.string&&this.string!==""){t=this.string}if(!(this.language&&this.language!==this.translate.language))return[3,2];if(this.translationsLocation){this.translate.translationsLocation=this.translationsLocation}return[4,this.translate.use(this.language)];case 1:r.sent();r.label=2;case 2:this.translation=this.translate.get(t);if(this.params){this.translation=this.translate.get(t,this.params)}if(this.paramsJson!=="{}"){n=[t];e=JSON.parse(this.paramsJson);e.forEach(function(t){n.push(t)});this.translation=this.translate.get.apply(this.translate,n)}if(this.transform){this.transformTranslation(this.transform)}this.el.querySelector("span").innerText=this.translation;return[2]}})})};t.prototype.get=function(t){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(n){return[2,this.translate.get(t)]})})};t.prototype.set=function(t,n,e){return __awaiter(this,void 0,void 0,function(){var n;return __generator(this,function(e){switch(e.label){case 0:n=this;return[4,this.translate.get(t)];case 1:n.translation=e.sent();this.postRender();return[2]}})})};t.prototype.setTranslateService=function(t){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(n){this.translate=t;this.postRender();return[2]})})};t.prototype.update=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(t){this.postRender();return[2]})})};t.prototype.transformTranslation=function(t){if(t==="lowercase"){this.translation=this.translation.toLowerCase()}if(t==="lowercaseFirst"){this.translation=this.translation.charAt(0).toLowerCase()+this.translation.slice(1)}if(t==="uppercase"){this.translation=this.translation.toUpperCase()}if(t==="uppercaseFirst"){this.translation=this.translation.charAt(0).toUpperCase()+this.translation.slice(1)}};t.prototype.render=function(){return e("span",null,e("slot",null))};Object.defineProperty(t.prototype,"el",{get:function(){return r(this)},enumerable:true,configurable:true});return t}();t("ema_translate",s)}}});