var __awaiter=this&&this.__awaiter||function(t,e,r,n){function i(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n["throw"](t))}catch(t){o(t)}}function c(t){t.done?r(t.value):i(t.value).then(s,a)}c((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(e){return c([t,e])}}function c(s){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;i=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=e.call(t,r)}catch(t){s=[6,t];i=0}finally{n=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./index-c820db66.system.js","./index-39cc694b.system.js","./index-04238c17.system.js","./index-dc84aac6.system.js","./index-2d937df8.system.js","./index-8fad73f5.system.js","./App-f9075e71.system.js","./index-9ceb7f8c.system.js","./_commonjsHelpers-c8881874.system.js","./index-b0fe4e4c.system.js"],(function(t){"use strict";var e,r,n,i,o,s,a,c;return{setters:[function(t){e=t.r;r=t.j;n=t.h;i=t.g},function(t){o=t.E},function(){},function(t){s=t.C},function(t){a=t.d},function(t){c=t.N},function(){},function(){},function(){},function(){}],execute:function(){var u={"Failed to update contact information.":"Kunde inte uppdatera kontaktinformation.","Updated contact information.":"Kontaktinformation uppdaterad.","Updating contact information...":"Uppdaterar kontaktinformation..."};function d(t){return a.create({sv:u},t)}var m=".sc-ig-customer-details-h{display:table-row}.sc-ig-customer-details-h>td.sc-ig-customer-details{border-top:solid 1px rgb(var(--smoothly-medium-shade));border-bottom:solid 1px rgb(var(--smoothly-medium-shade));background-color:rgb(var(--smoothly-dark-shade));padding:0.5em}ig-subscription-table.sc-ig-customer-details,ig-orders-table.sc-ig-customer-details{margin:auto;width:90%;border:solid 1px rgb(var(--smoothly-medium-shade))}ig-customer-contact.sc-ig-customer-details{max-width:70em;margin:auto;padding:1em;padding-left:4.5em}ig-customer-balance.sc-ig-customer-details{width:75%;margin:auto}";var l=t("ig_customer_details",function(){function t(t){e(this,t);this.notice=r(this,"notice",7);this.updateCustomers=r(this,"updateCustomers",7);this.opened=""}t.prototype.componentWillLoad=function(){this.t=d(this.element)};t.prototype.updateContact=function(t){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(r){this.notice.emit(c.execute(this.t("Updating contact information..."),(function(){return __awaiter(e,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:this.customer.contact=t.detail;return[4,s.put("customer/"+this.customer.id+"/contact",this.customer.contact)];case 1:r=n.sent();if(o.is(r))e=[false,this.t("Failed to update contact information.")];else{this.updateCustomers.emit();e=[true,this.t("Updated contact information.")]}return[2,e]}}))}))})));return[2]}))}))};t.prototype.render=function(){var t;switch(this.opened){case"number":t=n("ig-number-details",{number:this.customer.number,identifier:this.customer.id,name:"customer"});break;case"contact":t=n("ig-customer-contact",{customer:this.customer});break;case"order":t=n("ig-orders-table",{orders:this.orders,display:true,receipt:this.whitelist});break;case"subscription":t=n("ig-subscription-table",{subscriptions:this.customer.subscription,customer:this.customer});break;case"method":t=n("ig-customer-method",{customer:this.customer});break;case"balance":t=n("ig-customer-balance",{customer:this.customer,orders:this.orders});break;default:return""}return n("td",{colSpan:9},t)};Object.defineProperty(t.prototype,"element",{get:function(){return i(this)},enumerable:false,configurable:true});return t}());l.style=m}}}));