UNPKG

@salaxy/ng1

Version:

AngularJS libraries for Salaxy platform (Palkkaus.fi)

15 lines (11 loc) 5.02 MB
(function(H,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("@salaxy/core"),require("@salaxy/reports")):typeof define=="function"&&define.amd?define(["exports","@salaxy/core","@salaxy/reports"],c):(H=typeof globalThis<"u"?globalThis:H||self,c((H.salaxy=H.salaxy||{},H.salaxy.ng1={}),H.salaxy.core,H.salaxy.reports))})(this,function(H,c,Ee){"use strict";var Ggt=Object.defineProperty;var Hgt=(H,c,Ee)=>c in H?Ggt(H,c,{enumerable:!0,configurable:!0,writable:!0,value:Ee}):H[c]=Ee;var ce=(H,c,Ee)=>(Hgt(H,typeof c!="symbol"?c+"":c,Ee),Ee),Ugt=(H,c,Ee)=>{if(!c.has(H))throw TypeError("Cannot "+Ee)};var iD=(H,c,Ee)=>{if(c.has(H))throw TypeError("Cannot add the same private member more than once");c instanceof WeakSet?c.add(H):c.set(H,Ee)};var Ew=(H,c,Ee)=>(Ugt(H,c,"access private method"),Ee);var Mx,mo,Tk,dg,rD,Qx,n4;const Sc=class Sc{constructor(t,e,a=null){this.$http=t,this.$q=e,this.useCookie=!0,this.useCredentials=!1,this.serverAddress="https://test-api.salaxy.com";const s=c.Configs.current;if(s||a){const i=a?.apiServer??s.apiServer;i&&(this.serverAddress=i);const r=a?.useCredentials??s.useCredentials;r!=null&&(this.useCredentials=r);const l=a?.useCookie??s.useCookie;l!=null&&(this.useCookie=l)}}getApiAddress(){return this.serverAddress+"/v03/api"}getServerAddress(){return this.serverAddress}getJSON(t){const e={},a=this.getCurrentToken();return a&&(e.headers={Authorization:"Bearer "+a}),e.url=this.getUrl(t),e.method="GET",e.responseType="json",e.withCredentials=a?!1:this.useCredentials,this.$http(e).then(s=>s.data,s=>this.handleError(s))}getHTML(t){const e={},a=this.getCurrentToken();return a&&(e.headers={Authorization:"Bearer "+a}),e.url=this.getUrl(t),e.method="GET",e.responseType="text",e.withCredentials=a?!1:this.useCredentials,this.$http(e).then(s=>s.data,s=>this.handleError(s))}getBlob(t){const e={},a=this.getCurrentToken();return a&&(e.headers={Authorization:"Bearer "+a}),e.url=this.getUrl(t),e.method="GET",e.responseType="blob",e.withCredentials=a?!1:this.useCredentials,this.$http(e).then(s=>{const i={},r=s.headers();return Object.keys(r).forEach(l=>{i[l]=r[l]}),{data:s.data,headers:i}},s=>this.handleError(s))}postBlob(t,e){const a={},s=this.getCurrentToken();return s&&(a.headers={Authorization:"Bearer "+s}),a.url=this.getUrl(t),a.method="POST",a.data=e,a.responseType="blob",a.withCredentials=s?!1:this.useCredentials,this.$http(a).then(i=>{const r={},l=i.headers();return Object.keys(l).forEach(o=>{r[o]=l[o]}),{data:i.data,headers:r}},i=>this.handleError(i))}postJSON(t,e){const a={},s=this.getCurrentToken();return s&&(a.headers={Authorization:"Bearer "+s}),a.url=this.getUrl(t),a.method="POST",a.data=e,a.responseType="json",a.withCredentials=s?!1:this.useCredentials,this.$http(a).then(i=>i.data,i=>this.handleError(i))}postHTML(t,e){const a={},s=this.getCurrentToken();return s&&(a.headers={Authorization:"Bearer "+s}),a.url=this.getUrl(t),a.method="POST",a.data=e,a.responseType="text",a.withCredentials=s?!1:this.useCredentials,this.$http(a).then(i=>i.data,i=>this.handleError(i))}remove(t){const e={},a=this.getCurrentToken();return a&&(e.headers={Authorization:"Bearer "+a}),e.url=this.getUrl(t),e.method="DELETE",e.responseType="json",e.withCredentials=a?!1:this.useCredentials,this.$http(e).then(s=>s.data,s=>this.handleError(s))}getCurrentToken(){return!this.token&&this.useCookie&&(this.token=new c.Cookies().get("salaxy-token")||""),this.token}getTokenStatus(){const t=this.getCurrentToken();return c.Token.validate(t)}setCurrentToken(t){const e=!!c.Token.parsePayload(t??"")?.act;this.useCookie&&!e&&new c.Cookies().setCookie("salaxy-token",t||""),this.token=t}getUrl(t){return!t||t.trim()===""?null:t.toLowerCase().startsWith("http")?t:t.toLowerCase().startsWith("/v")?this.getServerAddress()+t:this.getApiAddress()+t}handleError(t){let e;if(t?t.data&&t.data.messageHtml?e=`<b>${t.data.error}:</b><br/>${t.data.messageHtml}`:t.data&&t.data.message?e=t.data.message:e=`HTTP error: ${t.statusText} (${t.status})`:e="Unexpected error in HTTP request",Sc.alertService){if(Sc.alertService.catchError)return Sc.alertService.catchError(t);Sc.alertService.addError(e)}return this.$q.reject(t)}};Sc.$inject=["$http","$q"];let Xu=Sc;const N$=class N${constructor(t,e,a=null){this.$scope=t,this.wizardService=e,this.data=a,this.colWidthClasses=["col-sm-12","col-sm-12","col-sm-6","col-sm-4","col-sm-3","col-sm-fifth","col-sm-2"]}$onInit(){}get steps(){return this.wizardService.getSteps()}get step(){return this.wizardService.activeStepNumber}set step(t){this.wizardService.activeStepNumber=t}get currentStep(){return this.wizardService.getCurrentStepObject()}get style(){return{colWidthClass:this.colWidthClasses[this.steps.length]}}get canGoNext(){return!!(this.steps.length>this.step&&this.steps[this.step]&&!this.steps[this.step].disabled)}get canGoPrevious(){return this.step>1&&!this.steps[this.step-2].disabled}goNext(){this.canGoNext&&this.step++}goPrevious(){this.canGoPrevious&&this.step--}};N$.$inject=["$scope","WizardService","data"];let xi=N$;const Y$=class Y$ extends xi{constructor(t,e,a,s,i,r,l,o){super(t,e,o),this.onboardingService=a,this.sessionService=s,this.authorizedAccountService=i,this.ajax=r,this.$location=l,this.isStepProceeding=!1,this.linkCopied=!1}$onInit(){this.wizardService.setSteps(this.getWizardSteps()),this.model&&this.model.company.resolvedId&&this.model.signature.personalId!=null?this.wizardService.activeStepNumber=this.wizardService.getSteps().length:this.wizardService.activeStepNumber=1}getWizardSteps(){const t=[];return t.push({title:"SALAXY.NG1.CustomerOnboardingComponent.stepUserInfo.title",heading:"",intro:"",view:"salaxy-components/modals/onboarding/customer/user.html",buttonsView:"salaxy-components/modals/onboarding/customer/user-buttons.html"},{title:"SALAXY.NG1.CustomerOnboardingComponent.stepCompanyInfo.title",heading:"",intro:"",view:"salaxy-components/modals/onboarding/customer/company.html",buttonsView:"salaxy-components/modals/onboarding/customer/buttons.html"},{title:"SALAXY.NG1.CustomerOnboardingComponent.stepCompanyLegal.title",heading:"",intro:"",view:"salaxy-components/modals/onboarding/customer/company-legal.html",buttonsView:"salaxy-components/modals/onboarding/customer/buttons.html"},{title:"SALAXY.NG1.CustomerOnboardingComponent.stepInsurance.title",heading:"",intro:"",view:"salaxy-components/modals/onboarding/customer/insurance.html",buttonsView:"salaxy-components/modals/onboarding/customer/commit-buttons.html"},{title:"SALAXY.NG1.CustomerOnboardingComponent.stepInviteCompany.title",heading:"",intro:"",view:"salaxy-components/modals/onboarding/customer/finish.html",buttonsView:"salaxy-components/modals/onboarding/customer/finish-buttons.html"}),t}get model(){return this.onboardingService.model}goNext(){this.isStepProceeding||(this.isStepProceeding=!0,this.save().then(()=>{super.goNext(),this.isStepProceeding=!1}).catch(t=>{this.isStepProceeding=!1}))}goPrevious(){this.isStepProceeding||(this.isStepProceeding=!0,this.save().then(()=>{super.goPrevious(),this.isStepProceeding=!1}).catch(t=>{this.isStepProceeding=!1}))}get canGoNext(){return!!(this.steps.length>this.step&&this.steps[this.step]&&!this.steps[this.step].disabled&&this.formDataValidity)}get signingLink(){return this.model?c.Configs.current.wwwServer+"/share/signing/"+encodeURIComponent(this.model.owner)+"/"+this.model.id:""}get sharingLink(){return this.model?c.Configs.current.wwwServer+"/share/authorization/"+encodeURIComponent(this.model.owner)+"/"+this.model.id:""}copyLink(t){navigator.clipboard.writeText(t),this.linkCopied=!0}get mailtoLink(){if(!this.model||!this.model.person)return"";let t="mailto:";t+=this.model.person.contact.email,t+="?subject="+encodeURIComponent("Palkkaus.fi-palvelun valtakirjan allekirjoitus");let e="Hei "+this.model.person.firstName+" "+this.model.person.lastName+`, `;return e+="Olemme ottamassa käyttöön Palkkaus.fi-palvelun yrityksesi palkanmaksuun.",e+=" Jotta he voivat hoitaa kaikki viranomaisvelvoitteet, tarvitaan allekirjoitus sinulta.",e+=" Se hoituu helposti pankkitunnuksilla seuraamalla tätä linkkiä: ",e+=this.sharingLink+`. `,e+=`Ystävällisin terveisin, `,e+=this.sessionService.getAvatar().displayName,t+="&body="+encodeURIComponent(e),t}get existingCompanyAlert(){const t=this.sessionService.session?.currentAccount?.id;return this.model?.company?.resolvedId&&this.model.company.resolvedId!=t}goToCompanySelection(){this.model.company.doYtjUpdate=!0,this.goNext()}commit(){this.isStepProceeding||(this.isStepProceeding=!0,this.model.signature.email=this.model.person.contact.email,this.model.signature.telephone=this.model.person.contact.telephone,this.model.signature.personName=(this.model.person.firstName+" "+this.model.person.lastName).trim(),this.onboardingService.commit().then(()=>{this.authorizedAccountService.reloadAuthorizingAccounts(),super.goNext(),this.isStepProceeding=!1}).catch(t=>{this.isStepProceeding=!1}))}checkPensionCompanySelection(){this.model.products.pension.isPensionContractDone||(this.model.products.pension.pensionCompany=c.PensionCompany.None,this.model.products.pension.pensionContractNumber=null);const t=this.model.products.pension.pensionCompany;this.model.products.pension.isPensionContractDone&&t===c.PensionCompany.Varma&&(this.model.products.pension.isPendingContract=!1),(t===c.PensionCompany.Veritas||t===c.PensionCompany.Apteekkien||t===c.PensionCompany.Verso||t===c.PensionCompany.Valio||(t??"").startsWith("keva")||t===c.PensionCompany.Other)&&(this.model.products.pension.isPensionSelfHandling=!0),this.model.products.pension.isPendingContract&&(this.model.products.pension.isPensionSelfHandling=!1)}checkInsuranceCompanySelection(){this.model.products.insurance.isInsuranceContractDone||(this.model.products.insurance.insuranceCompany=null,this.model.products.insurance.insuranceContractNumber=null)}save(){return this.onboardingService.save()}setPensionNumberForTest(){this.model.products.pension.pensionContractNumber=c.SettingsLogic.getPensionNumberForTest(this.model.products.pension.pensionCompany)}launch(t=null){return this.onboardingService.launchCustomerOnboarding(t)}};Y$.$inject=["$scope","WizardService","OnboardingService","SessionService","AuthorizedAccountService","AjaxNg1","$location","data"];let $g=Y$;const O$=class O$ extends xi{constructor(t,e,a,s,i,r){super(t,e),this.onboardingService=a,this.sessionService=s,this.uiHelpers=i,this.signatureService=r,this.wizardSteps=[{title:"SALAXY.NG1.WorkerOnboardingComponent.stepUserInfo.title",heading:"SALAXY.NG1.WorkerOnboardingComponent.stepUserInfo.heading",intro:"",active:!0,view:"salaxy-components/modals/onboarding/worker/user-info.html",buttonsView:"salaxy-components/modals/onboarding/worker/firstPageButtons.html"},{title:"SALAXY.NG1.WorkerOnboardingComponent.stepContract.stepTitle",heading:"SALAXY.NG1.WorkerOnboardingComponent.stepContract.heading",intro:"SALAXY.NG1.WorkerOnboardingComponent.stepContract.intro",view:"salaxy-components/modals/onboarding/worker/contract-worker.html",buttonsView:"salaxy-components/modals/onboarding/worker/contractButtons.html"}],this.isStepProceeding=!1}$onInit(){this.wizardService.setSteps(this.wizardSteps),this.wizardService.activeStepNumber=1,this.getSignatureMethods()}goNext(){return this.isStepProceeding?Promise.resolve(!1):(this.isStepProceeding=!0,this.save().then(()=>(super.goNext(),this.isStepProceeding=!1,!0)).catch(t=>(this.isStepProceeding=!1,!1)))}get canGoNext(){return!!(this.steps.length>this.step&&this.steps[this.step]&&!this.steps[this.step].disabled&&this.formDataValidity)}goNextIf(t){t(()=>this.goNext())}goPrevious(){this.isStepProceeding||(this.isStepProceeding=!0,this.save().then(()=>{super.goPrevious(),this.isStepProceeding=!1}).catch(t=>{this.isStepProceeding=!1}))}save(){return this.model.signature.email=this.model.person.contact.email,this.model.signature.telephone=this.model.person.contact.telephone,this.model.signature.personName=(this.model.person.firstName+" "+this.model.person.lastName).trim(),this.onboardingService.save()}get vismaSignUrl(){const t=this.model.signature.method;return this.onboardingService.getDigitalSignUrl(t)}get model(){return this.onboardingService.model}getPdfPreviewAddress(){return this.onboardingService.getPdfPreviewAddress()}getValidationError(t){return this.model&&this.model.validation?this.model.validation.errors.find(e=>e.key===t):null}removeValidationError(t){this.model&&this.model.validation&&(this.model.validation.errors=this.model.validation.errors.filter(e=>e.key!==t))}isOtherIdentifier(t){return/^.{7}[9]/.test((t||"").trim())}launch(t=null){return this.onboardingService.launchWorkerOnboarding(t)}getSignatureMethods(){const t=this.signatureService.getMethods("telia");this.signatureMethods=t.map(e=>({value:e.value,label:e.title,imgSrc:e.img}))}};O$.$inject=["$scope","WizardService","OnboardingService","SessionService","UiHelpers","SignatureService"];let kg=O$;const M$=class M$ extends xi{constructor(t,e,a,s,i,r){super(t,e,r),this.onboardingService=a,this.sessionService=s,this.signatureService=i,this.wizardSteps=[{title:"Käyttäjän tiedot",heading:"Tervetuloa, Palkkamyllyyn!",intro:`Palkkamyllyn tarjoaa Rakennusliitto ry, joka toimii henkilötietojen käsittelijänä ja vastaa myös asiakaspalvelusta. Palvelun tuottajana, teknisenä toteuttajana ja myös henkilötietojen käsittelijä toimii Suomen Palkanlaskenta Oy (Palkkaus.fi).`,active:!0,view:"salaxy-components/modals/onboarding/household/wizard_index.html",buttonsView:"salaxy-components/modals/onboarding/household/firstPageButtons.html"},{title:"Palkanmaksun tiedot",heading:"Palkanmaksun tiedot",view:"salaxy-components/modals/onboarding/household/household.html",buttonsView:"salaxy-components/modals/onboarding/household/householdButtons.html"},{title:"Palvelusopimus",heading:"Palvelusopimus ja valtuutus",view:"salaxy-components/modals/onboarding/household/contract.html",buttonsView:"salaxy-components/modals/onboarding/household/contractButtons.html"}],this.isStepProceeding=!1}$onInit(){this.wizardService.setSteps(this.wizardSteps),this.wizardService.activeStepNumber=1;const t=this.signatureService.getMethods("telia");this.visibleSignatureMethods=t.filter(e=>e.isPopular).map(e=>({value:e.value,label:e.title,imgSrc:e.img}))}goNext(){return this.isStepProceeding?Promise.resolve(!1):(this.isStepProceeding=!0,this.save().then(()=>(super.goNext(),this.isStepProceeding=!1,!0)).catch(t=>(this.isStepProceeding=!1,!1)))}get canGoNext(){return!!(this.steps.length>this.step&&this.steps[this.step]&&!this.steps[this.step].disabled&&this.formDataValidity)}goNextIf(t){t(()=>this.goNext())}goPrevious(){this.isStepProceeding||(this.isStepProceeding=!0,this.save().then(()=>{super.goPrevious(),this.isStepProceeding=!1}).catch(t=>{this.isStepProceeding=!1}))}save(){return this.model.signature.email=this.model.person.contact.email,this.model.signature.telephone=this.model.person.contact.telephone,this.model.signature.personName=(this.model.person.firstName+" "+this.model.person.lastName).trim(),this.onboardingService.save()}get vismaSignUrl(){const t=this.model.signature.method;return this.onboardingService.getDigitalSignUrl(t)}get model(){return this.onboardingService.model}getPdfPreviewAddress(){return this.onboardingService.getPdfPreviewAddress()}getValidationError(t){return this.model&&this.model.validation?this.model.validation.errors.find(e=>e.key===t):null}removeValidationError(t){this.model&&this.model.validation&&(this.model.validation.errors=this.model.validation.errors.filter(e=>e.key!==t))}launch(t=null){return this.onboardingService.launchHouseholdOnboarding(t)}};M$.$inject=["$scope","WizardService","OnboardingService","SessionService","SignatureService","data"];let Tg=M$;const X$=class X$ extends xi{constructor(t,e,a,s,i,r,l,o){super(t,e,l),this.onboardingService=a,this.sessionService=s,this.ajax=i,this.$location=r,this.uiHelpers=o,this.isStepProceeding=!1}$onInit(){this.wizardService.setSteps(this.getWizardSteps()),this.model&&this.model.signature.isProcura?this.wizardService.activeStepNumber=3:this.wizardService.activeStepNumber=1}getWizardSteps(){const t=[];return t.push({title:"SALAXY.NG1.CompanyOnboardingComponent.step1.title",intro:"SALAXY.NG1.CompanyOnboardingComponent.step1.intro",active:!0,view:"salaxy-components/modals/onboarding/company/wizard_index.html",buttonsView:"salaxy-components/modals/onboarding/company/firstPageButtons.html"}),this.showCompanySelection&&t.push({title:"SALAXY.NG1.CompanyOnboardingComponent.stepSuomiFi.title",intro:"SALAXY.NG1.CompanyOnboardingComponent.stepSuomiFi.intro",view:"salaxy-components/modals/onboarding/company/suomifi.html",buttonsView:"salaxy-components/modals/onboarding/company/suomifiButtons.html"}),t.push({title:"SALAXY.NG1.CompanyOnboardingComponent.stepCompanyInfo.title",intro:"SALAXY.NG1.CompanyOnboardingComponent.stepCompanyInfo.intro",view:"salaxy-components/modals/onboarding/company/company.html",buttonsView:"salaxy-components/modals/onboarding/company/defaultWizardButtons.html"},{title:"SALAXY.NG1.CompanyOnboardingComponent.stepContract.title",view:"salaxy-components/modals/onboarding/company/contract.html",buttonsView:"salaxy-components/modals/onboarding/company/contractButtons.html"}),t}goNext(){return this.isStepProceeding?Promise.resolve(!1):(this.isStepProceeding=!0,this.save().then(()=>(super.goNext(),this.isStepProceeding=!1,!0)).catch(t=>(this.isStepProceeding=!1,!1)))}get canGoNext(){return!!(this.steps.length>this.step&&this.steps[this.step]&&!this.steps[this.step].disabled&&this.formDataValidity)}goPrevious(){this.isStepProceeding||(this.isStepProceeding=!0,this.save().then(()=>{super.goPrevious(),this.isStepProceeding=!1}).catch(t=>{this.isStepProceeding=!1}))}save(){return this.model.signature.email=this.model.person.contact.email,this.model.signature.telephone=this.model.person.contact.telephone,this.model.signature.personName=(this.model.person.firstName+" "+this.model.person.lastName).trim(),this.onboardingService.save()}get vismaSignUrl(){return this.onboardingService.getDigitalSignUrl()}get model(){return this.onboardingService.model}get showCompanySelection(){return this.model&&this.model.company&&this.model.company.roles&&this.model.company.roles.some(e=>e===c.Role.Accountant||e===c.Role.AccountantCandidate)}getPdfPreviewAddress(){return this.onboardingService.getPdfPreviewAddress()}get existingCompanyAlert(){const t=this.sessionService.session?.currentAccount?.id;return this.model?.company?.resolvedId&&this.model.company.resolvedId!=t}goToSuomifi(){const t=this.$location.url();let e=this.$location.absUrl();t.length>1&&(e=e.substring(0,e.indexOf(t))),e=e.replace(/\/$/,"").trim();const a=this.ajax.getCurrentToken(),s=a?`${encodeURIComponent(a)}`:"",i=e.indexOf("&")>=0||e.indexOf("?")>=0?"&url=":"",r=`${e}${i}/onboarding/company/${this.model.id}${s?"&ob_token="+s:""}`,l=`${e}${i}/onboarding/company/${this.model.id}${s?"&ob_token="+s:""}`;this.save().then(()=>{window.location.assign(`${this.ajax.getServerAddress()}/Onboarding/CompanySelection?OnboardingId=${encodeURIComponent(this.model.id)}&Language=${encodeURIComponent(c.Translations.getLanguage())}&SuccessUrl=${encodeURIComponent(l)}&CancelUrl=${encodeURIComponent(r)}${s?"&access_token="+s:""}`)})}launch(t=null){return this.onboardingService.launchCompanyOnboarding(t)}chooseBusinessId(t){this.model.company.businessId=t,this.model.company.ytjSearch=null,this.searchYtj()}searchYtj(t){this.model.company.companyType=null,this.model.company.contact.street=null,this.model.company.contact.city=null,this.model.company.contact.postalCode=null,this.model.company.ytjSearch=null,this.model.company.doYtjUpdate=!0,t==="name"&&(this.model.company.businessId=null),t==="businessId"&&(this.model.company.name=null),this.save()}getValidationError(t){return this.model&&this.model.validation?this.model.validation.errors.find(e=>e.key===t):null}openSigningWizardDialog(t=null){const e=this.sessionService.getCurrentCss(),a=this.sessionService.getOrigin(),s=a+(e?`popup.html#settings/signing?skin=${e}&lang=${c.Translations.getLanguage()}&id=${this.onboardingService.model?.id??""}#access_token=${this.ajax.getCurrentToken()}`:`popup.html#settings/signing?lang=${c.Translations.getLanguage()}&id=${this.onboardingService.model?.id??""}#access_token=${this.ajax.getCurrentToken()}`);return this.uiHelpers.showExternalDialog(t,s,{id:t,origin:a},{width:1080,height:800}).then(i=>{if(i?.action!="cancel")return this.checkSession()})}launchSigningWizard(){const t=this.readTokenFromUrl(this.$location.absUrl(),"data="),e=JSON.parse(atob(decodeURIComponent(t)))?.id,a=JSON.parse(atob(decodeURIComponent(t)))?.origin;return this.onboardingService.getOnboardingData(e).then(()=>{const s=this.sessionService.getCurrentCss();return this.onboardingService.model.ui.successUrl=a+(s?`popup.html#settings/signing-success?skin=${s}&lang=${c.Translations.getLanguage()}&id=${this.onboardingService.model?.id??""}#access_token=${this.ajax.getCurrentToken()}`:`popup.html#settings/signing-success?lang=${c.Translations.getLanguage()}&id=${this.onboardingService.model?.id??""}#access_token=${this.ajax.getCurrentToken()}`),this.onboardingService.model.ui.cancelUrl=this.onboardingService.model.ui.successUrl.replace("/signing-success?","/signing-cancel?"),this.onboardingService.save().then(()=>this.onboardingService.launchCompanyOnboarding(this.onboardingService.model.id))})}checkSession(){return this.sessionService.checkSession()}readTokenFromUrl(t,e){const a=t.toLowerCase().indexOf(e);if(a>=0){const s=t.indexOf("&",a);return s>=0?t.substring(a+e.length,s):t.substring(a+e.length)}return null}};X$.$inject=["$scope","WizardService","OnboardingService","SessionService","AjaxNg1","$location","data","UiHelpers"];let Lg=X$;const F$=class F${constructor(t,e,a,s,i,r,l,o){this.$scope=t,this.onboardingService=e,this.sessionService=a,this.signatureService=s,this.$sce=i,this.uiHelpers=r,this.ajax=l,this.$timeout=o,this.showInPopup=!1,this.isSigninStarted=!1,this.$onInit=()=>{this.init(),this.sessionService.subscribe(this.$scope,()=>{this.init()}),this.isContactPersonSigner=!0}}save(){return this.isContactPersonSigner&&(this.model.company.contact.email=this.model.signature.email,this.model.company.contact.telephone=this.model.signature.telephone),this.onboardingService.save().then(t=>(this.pdfPreviewUrl=null,t))}get model(){return this.onboardingService.model?.company&&(this.onboardingService.model.company.language=c.Translations.getLanguage()),this.onboardingService.model?.person&&(this.onboardingService.model.person.language=c.Translations.getLanguage()),this.onboardingService.model}getPdfPreviewAddress(){return!this.pdfPreviewUrl&&this.model?.id&&(this.pdfPreviewUrl=this.$sce.trustAsResourceUrl(this.onboardingService.getPdfPreviewAddress(!0)+"&t="+new Date().getTime()+"&language="+this.model.company.language)),this.pdfPreviewUrl}startDigitalSignature(t){this.isSigninStarted=!0,this.showInPopup?this.save().then(()=>{let e=this.sessionService.getCurrentCss()||"";e&&(e=`skin=${e}&`);const a=this.sessionService.getOrigin()+`popup.html#settings/signing-success?${e}lang=${c.Translations.getLanguage()}&id=${this.onboardingService.model?.id??""}#access_token=${this.ajax.getCurrentToken()}`,s=this.onboardingService.getDigitalSignUrl(t,null,null,a,a.replace("/signing-success?","/signing-cancel?"));return this.$timeout(()=>this.isSigninStarted=!1,2e3),this.uiHelpers.showExternalDialog("vismaSignPopup",s,{},{width:1080,height:800}).then(i=>{if(i?.action!="cancel")return this.sessionService.checkSession()})}):(this.uiHelpers.showLoading("SALAXY.NG1.SigningComponent.dialog.header",`Siirrytään allekirjoitukseen (${t})`),this.save().then(()=>{window.top.location.href=this.onboardingService.getDigitalSignUrl(t)}))}get methods(){return this.signatureService.getMethods()}getMethod(t){const e=this.methods.filter(a=>a.value===t);return e.length>0?e[0]:null}async signPartnerContract(){const t={authorizationType:c.AuthorizationType.PartnerContract},e=this.uiHelpers.showLoading("SALAXY.UI_Terms.wait");try{await this.ajax.postJSON("/onboarding/contract",t),await this.sessionService.checkSession()}catch(a){console.error("Failed to sign partner contract:",a)}finally{e.dismiss()}}init(){if(this.isSigningOk=this.sessionService.isSigningOk(),this.pdfPreviewUrl=null,this.isSigningRequired=!this.sessionService.isSigningOk(),this.sessionService.isSessionChecked&&this.sessionService.isAuthenticated){const t=this.sessionService.session.currentAccount.id;if(this.onboardingService.model&&this.onboardingService.model.company.resolvedId===t)return;this.onboardingService.model=null,this.onboardingService.id=null,this.onboardingService.getOnboardingDataForAccount(this.sessionService.session.currentAccount.id).then(()=>{if(this.onboardingService.model){this.onboardingService.model.signature.isPep=null,this.onboardingService.model.company.ownership.isRequiredTracking=null,this.onboardingService.model.id||this.onboardingService.save();return}else this.onboardingService.model={accountType:c.WebSiteUserRole.Company,signature:{}},this.onboardingService.save()})}}};F$.$inject=["$scope","OnboardingService","SessionService","SignatureService","$sce","UiHelpers","AjaxNg1","$timeout"];let Fu=F$;const G$=class G${constructor(t){this.signatureService=t,this.$onInit=()=>{}}get methods(){return this.getMethods("tupas")}getMethods(t="tupas"){return this.signatureService.getMethods(t)}getMethod(t){return this.signatureService.getMethods("tupas").find(e=>e.value===t)??this.signatureService.getMethods("telia").find(e=>e.value===t)}};G$.$inject=["SignatureService"];let Dg=G$;const H$=class H${constructor(t,e,a,s){if(this.crudService=t,this.$location=e,this.$attrs=a,this.uiHelpers=s,this.copyIdAsNew=i=>{const r=this.list.find(l=>l.id===i);return r?this.copyAsNew(r):null},this.listSelect=i=>{this.$attrs.onListSelect?this.onListSelect({item:i}):this.detailsUrl?this.$location.url(this.detailsUrl+(i.id||i.rowIndex)):this.setCurrent(i)},this.listSelectId=i=>{const r=this.list.find(l=>l.id===i);r&&this.listSelect(r)},this.delete=(i,r)=>this.uiHelpers.showConfirm(r||"SALAXY.NG1.ApiCrudObjectComponent.deleteDialog").then(l=>l?this.$attrs.onDelete?this.onDelete({deleteResult:this.deleteNoConfirm(i)}):(this.listUrl&&this.$location.url(this.listUrl),this.deleteNoConfirm(i)):Promise.resolve(!1)),!t)throw new Error("crudService is undefined in CrudControllerBase");if(!e)throw new Error("$location is undefined in CrudControllerBase");if(!s)throw new Error("uiHelpers is undefined in CrudControllerBase");if(!a)throw new Error("$attrs is undefined in CrudControllerBase")}$onInit(){}get current(){return this.getBindingMode()==="model"?this.model.$viewValue:this.crudService.current}get list(){return this.crudService.list}createNew(t=null){return t||(t=this.crudService.getBlank()),this.$attrs.onCreateNew?this.onCreateNew({item:t}):(this.setCurrent(t),this.detailsUrl&&this.$location.url(this.detailsUrl+"new#"+new Date().getTime())),t}copyCurrent(){this.current&&this.setCurrent(this.crudService.copyAsNew(this.current))}copyAsNew(t){const e=this.crudService.copyAsNew(t);return this.createNew(e)}getBindingMode(){return this.model?"model":"singleton"}saveCurrent(){return this.crudService.saveCurrent()}setCurrent(t){this.getBindingMode()==="model"?this.model.$setViewValue(t):this.crudService.setCurrent(t)}deleteNoConfirm(t){const e=this.uiHelpers.showLoading("SALAXY.UI_Terms.wait");return this.crudService.delete(t).then(()=>(e.dismiss(),!0))}};H$.crudBindings={onListSelect:"&",onDelete:"&",onCreateNew:"&",detailsUrl:"@",listUrl:"@"};let Ao=H$;const U$=class U$ extends Ao{constructor(t,e,a,s,i,r){super(t,e,a,s),this.authorizedAccountService=t,this.sessionService=i,this.ajax=r}get partnerIntegrationSites(){return this.authorizedAccountService.getPartnerIntegrationSiteList()}getPartnerSite(t){return this.authorizedAccountService.getPartnerSite(t)}get currentPartnerSite(){return this.authorizedAccountService.getCurrentPartnerSite()}showPartnerSiteDialog(t){const e=this.getPartnerSite(t);this.authorizedAccountService.setCurrentPartnerSite(e),this.uiHelpers.showDialog("salaxy-components/modals/account/Authorization.html","AccountAuthorizationController")}switchAuthorization(){const t=this.currentPartnerSite;if(this.disabled!==!0&&!t.disabled){if(t.enabled==!1&&t.accountId)this.authorizedAccountService.delete(t.accountId);else if(t.enabled==!0&&t.accountId){const e=this.authorizedAccountService.getBlank();e.id=t.accountId,this.authorizedAccountService.save(e)}}}get authorizingAccounts(){return this.authorizedAccountService.getAuthorizingAccounts()}deleteAccount(t){this.uiHelpers.showConfirm("Haluatko varmasti poistaa tilin, tiliä ei voi palauttaa?").then(e=>{if(e){const a=this.uiHelpers.showLoading("SALAXY.UI_Terms.wait");this.ajax.remove("/accounts/authorizingAccount/"+t).then(()=>{this.authorizedAccountService.reloadAuthorizingAccounts().then(()=>{a.dismiss()})})}})}showAuthorizedAccountAddDialog(){super.createNew(),this.uiHelpers.showDialog("salaxy-components/modals/account/AuthorizedAccountAdd.html","AccountAuthorizationController")}saveCurrent(t=null){const e=this.uiHelpers.showLoading("SALAXY.UI_Terms.wait");return super.saveCurrent().then(a=>(e.dismiss(),t&&t(a),a))}getLoginAsUrl(t){let e=this.ajax.getServerAddress()+"/Security/LoginAs/"+t;return e=e+"?access_token="+encodeURIComponent(this.ajax.getCurrentToken()),e}isInRole(t){return this.sessionService.isInRole(t)}};U$.$inject=["AuthorizedAccountService","$location","$attrs","UiHelpers","SessionService","AjaxNg1"];let Al=U$;const B$=class B$ extends Ao{constructor(t,e,a,s,i){super(t,e,a,s),this.certificateService=t,this.certificateApi=i,this.result=void 0,this.certFormat="pfx",this.certFormats=[{value:"pfx",text:"Windows-sertifikaatti (pfx / pkcs12)",ui:{mime:"application/x-pkcs12",suffix:"pfx"}},{value:"pem",text:"Yleinen sertifikaatti (zip / pem)",ui:{mime:"application/zip",suffix:"zip"}}]}createNew(){return super.createNew(),this.current.title=c.Translations.get("SALAXY.NG1.CertificatesComponent.newCertificate"),this.current}get currentCertFormat(){return this.certFormats.find(t=>t.value===this.certFormat)||this.certFormats[0]}showCertificateAddDialog(){this.createNew(),this.uiHelpers.showDialog("salaxy-components/modals/account/CertificateAdd.html","CertificateController")}createCert(){const t=this.uiHelpers.showLoading("SALAXY.UI_Terms.wait");this.certFormat==="pem"?this.certificateApi.issuePemCertificate(this.current).then(e=>{this.result={blob:this.uiHelpers.bytes2Blob(e.bytes,this.currentCertFormat.ui.mime),text:e.cert+` `+e.key,thumbprint:e.thumbprint},t.dismiss()}):super.saveCurrent().then(e=>{this.result={blob:this.uiHelpers.bytes2Blob(e.bytes,this.currentCertFormat.ui.mime),text:e.bytes,thumbprint:e.thumbprint},t.dismiss()})}downloadCertFile(){this.uiHelpers.downloadFile(this.result.blob,`${this.result.thumbprint}.${this.currentCertFormat.ui.suffix}`)}};B$.$inject=["CertificateService","$location","$attrs","UiHelpers","Certificates"];let Xc=B$;var Js=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qs(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}/** * @license AngularJS v1.8.3 * (c) 2010-2020 Google LLC. http://angularjs.org * License: MIT */(function(n){var t={objectMaxDepth:5,urlErrorParamsEnabled:!0};function e(h){if(j(h))K(h.objectMaxDepth)&&(t.objectMaxDepth=a(h.objectMaxDepth)?h.objectMaxDepth:NaN),K(h.urlErrorParamsEnabled)&&Gt(h.urlErrorParamsEnabled)&&(t.urlErrorParamsEnabled=h.urlErrorParamsEnabled);else return t}function a(h){return ht(h)&&h>0}function s(h,g){g=g||Error;var x="https://errors.angularjs.org/1.8.3/",C=x.replace(".","\\.")+"[\\s\\S]*",k=new RegExp(C,"g");return function(){var _=arguments[0],I=arguments[1],P="["+(h?h+":":"")+_+"] ",E=Ja(arguments,2).map(function(tt){return vl(tt,t.objectMaxDepth)}),Y,G;if(P+=I.replace(/\{\d+\}/g,function(tt){var it=+tt.slice(1,-1);return it<E.length?E[it].replace(k,""):tt}),P+=` `+x+(h?h+"/":"")+_,t.urlErrorParamsEnabled)for(G=0,Y="?";G<E.length;G++,Y="&")P+=Y+"p"+G+"="+encodeURIComponent(E[G]);return new g(P)}}var i=/^\/(.+)\/([a-z]*)$/,r="validity",l=Object.prototype.hasOwnProperty,o=function(h){return et(h)?h.toLowerCase():h},d=function(h){return et(h)?h.toUpperCase():h},u,p,m,f=[].slice,b=[].splice,y=[].push,v=Object.prototype.toString,S=Object.getPrototypeOf,L=s("ng"),A=n.angular||(n.angular={}),w,D=0;u=n.document.documentMode;function R(h){if(h==null||J(h))return!1;if($t(h)||et(h)||p&&h instanceof p)return!0;var g="length"in Object(h)&&h.length;return ht(g)&&(g>=0&&g-1 in h||typeof h.item=="function")}function T(h,g,x){var C,k;if(h)if(M(h))for(C in h)C!=="prototype"&&C!=="length"&&C!=="name"&&h.hasOwnProperty(C)&&g.call(x,h[C],C,h);else if($t(h)||R(h)){var _=typeof h!="object";for(C=0,k=h.length;C<k;C++)(_||C in h)&&g.call(x,h[C],C,h)}else if(h.forEach&&h.forEach!==T)h.forEach(g,x,h);else if(z(h))for(C in h)g.call(x,h[C],C,h);else if(typeof h.hasOwnProperty=="function")for(C in h)h.hasOwnProperty(C)&&g.call(x,h[C],C,h);else for(C in h)l.call(h,C)&&g.call(x,h[C],C,h);return h}function F(h,g,x){for(var C=Object.keys(h).sort(),k=0;k<C.length;k++)g.call(x,h[C[k]],C[k]);return C}function N(h){return function(g,x){h(x,g)}}function B(){return++D}function W(h,g){g?h.$$hashKey=g:delete h.$$hashKey}function q(h,g,x){for(var C=h.$$hashKey,k=0,_=g.length;k<_;++k){var I=g[k];if(!(!j(I)&&!M(I)))for(var P=Object.keys(I),E=0,Y=P.length;E<Y;E++){var G=P[E],tt=I[G];x&&j(tt)?Et(tt)?h[G]=new Date(tt.valueOf()):X(tt)?h[G]=new RegExp(tt):tt.nodeName?h[G]=tt.cloneNode(!0):Ge(tt)?h[G]=tt.clone():G!=="__proto__"&&(j(h[G])||(h[G]=$t(tt)?[]:{}),q(h[G],[tt],!0)):h[G]=tt}}return W(h,C),h}function nt(h){return q(h,f.call(arguments,1),!1)}function rt(h){return q(h,f.call(arguments,1),!0)}function V(h){return parseInt(h,10)}var U=Number.isNaN||function(g){return g!==g};function Q(h,g){return nt(Object.create(h),g)}function ot(){}ot.$inject=[];function st(h){return h}st.$inject=[];function Lt(h){return function(){return h}}function Bt(h){return M(h.toString)&&h.toString!==v}function O(h){return typeof h>"u"}function K(h){return typeof h<"u"}function j(h){return h!==null&&typeof h=="object"}function z(h){return h!==null&&typeof h=="object"&&!S(h)}function et(h){return typeof h=="string"}function ht(h){return typeof h=="number"}function Et(h){return v.call(h)==="[object Date]"}function $t(h){return Array.isArray(h)||h instanceof Array}function Z(h){var g=v.call(h);switch(g){case"[object Error]":return!0;case"[object Exception]":return!0;case"[object DOMException]":return!0;default:return h instanceof Error}}function M(h){return typeof h=="function"}function X(h){return v.call(h)==="[object RegExp]"}function J(h){return h&&h.window===h}function mt(h){return h&&h.$evalAsync&&h.$watch}function wt(h){return v.call(h)==="[object File]"}function pt(h){return v.call(h)==="[object FormData]"}function vt(h){return v.call(h)==="[object Blob]"}function Gt(h){return typeof h=="boolean"}function ne(h){return h&&M(h.then)}var fe=/^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array]$/;function be(h){return h&&ht(h.length)&&fe.test(v.call(h))}function Qt(h){return v.call(h)==="[object ArrayBuffer]"}var he=function(h){return et(h)?h.trim():h},Ie=function(h){return h.replace(/([-()[\]{}+?*.$^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")};function Ge(h){return!!(h&&(h.nodeName||h.prop&&h.attr&&h.find))}function Ft(h){var g={},x=h.split(","),C;for(C=0;C<x.length;C++)g[x[C]]=!0;return g}function we(h){return o(h.nodeName||h[0]&&h[0].nodeName)}function de(h,g){return Array.prototype.indexOf.call(h,g)!==-1}function Re(h,g){var x=h.indexOf(g);return x>=0&&h.splice(x,1),x}function $e(h,g,x){var C=[],k=[];if(x=a(x)?x:NaN,g){if(be(g)||Qt(g))throw L("cpta","Can't copy! TypedArray destination cannot be mutated.");if(h===g)throw L("cpi","Can't copy! Source and destination are identical.");return $t(g)?g.length=0:T(g,function(E,Y){Y!=="$$hashKey"&&delete g[Y]}),C.push(h),k.push(g),_(h,g,x)}return I(h,x);function _(E,Y,G){if(G--,G<0)return"...";var tt=Y.$$hashKey,it;if($t(E))for(var xt=0,At=E.length;xt<At;xt++)Y.push(I(E[xt],G));else if(z(E))for(it in E)Y[it]=I(E[it],G);else if(E&&typeof E.hasOwnProperty=="function")for(it in E)E.hasOwnProperty(it)&&(Y[it]=I(E[it],G));else for(it in E)l.call(E,it)&&(Y[it]=I(E[it],G));return W(Y,tt),Y}function I(E,Y){if(!j(E))return E;var G=C.indexOf(E);if(G!==-1)return k[G];if(J(E)||mt(E))throw L("cpws","Can't copy! Making copies of Window or Scope instances is not supported.");var tt=!1,it=P(E);return it===void 0&&(it=$t(E)?[]:Object.create(S(E)),tt=!0),C.push(E),k.push(it),tt?_(E,it,Y):it}function P(E){switch(v.call(E)){case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Float32Array]":case"[object Float64Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return new E.constructor(I(E.buffer),E.byteOffset,E.length);case"[object ArrayBuffer]":if(!E.slice){var Y=new ArrayBuffer(E.byteLength);return new Uint8Array(Y).set(new Uint8Array(E)),Y}return E.slice(0);case"[object Boolean]":case"[object Number]":case"[object String]":case"[object Date]":return new E.constructor(E.valueOf());case"[object RegExp]":var G=new RegExp(E.source,E.toString().match(/[^/]*$/)[0]);return G.lastIndex=E.lastIndex,G;case"[object Blob]":return new E.constructor([E],{type:E.type})}if(M(E.cloneNode))return E.cloneNode(!0)}}function qe(h,g){return h===g||h!==h&&g!==g}function Xe(h,g){if(h===g)return!0;if(h===null||g===null)return!1;if(h!==h&&g!==g)return!0;var x=typeof h,C=typeof g,k,_,I;if(x===C&&x==="object")if($t(h)){if(!$t(g))return!1;if((k=h.length)===g.length){for(_=0;_<k;_++)if(!Xe(h[_],g[_]))return!1;return!0}}else{if(Et(h))return Et(g)?qe(h.getTime(),g.getTime()):!1;if(X(h))return X(g)?h.toString()===g.toString():!1;if(mt(h)||mt(g)||J(h)||J(g)||$t(g)||Et(g)||X(g))return!1;I=ee();for(_ in h)if(!(_.charAt(0)==="$"||M(h[_]))){if(!Xe(h[_],g[_]))return!1;I[_]=!0}for(_ in g)if(!(_ in I)&&_.charAt(0)!=="$"&&K(g[_])&&!M(g[_]))return!1;return!0}return!1}var Be=function(){if(!K(Be.rules)){var h=n.document.querySelector("[ng-csp]")||n.document.querySelector("[data-ng-csp]");if(h){var g=h.getAttribute("ng-csp")||h.getAttribute("data-ng-csp");Be.rules={noUnsafeEval:!g||g.indexOf("no-unsafe-eval")!==-1,noInlineStyle:!g||g.indexOf("no-inline-style")!==-1}}else Be.rules={noUnsafeEval:x(),noInlineStyle:!1}}return Be.rules;function x(){try{return new Function(""),!1}catch{return!0}}},xe=function(){if(K(xe.name_))return xe.name_;var h,g,x=ir.length,C,k;for(g=0;g<x;++g)if(C=ir[g],h=n.document.querySelector("["+C.replace(":","\\:")+"jq]"),h){k=h.getAttribute(C+"jq");break}return xe.name_=k};function Ha(h,g,x){return h.concat(f.call(g,x))}function Ja(h,g){return f.call(h,g||0)}function Ye(h,g){var x=arguments.length>2?Ja(arguments,2):[];return M(g)&&!(g instanceof RegExp)?x.length?function(){return arguments.length?g.apply(h,Ha(x,arguments,0)):g.apply(h,x)}:function(){return arguments.length?g.apply(h,arguments):g.call(h)}:g}function fs(h,g){var x=g;return typeof h=="string"&&h.charAt(0)==="$"&&h.charAt(1)==="$"?x=void 0:J(g)?x="$WINDOW":g&&n.document===g?x="$DOCUMENT":mt(g)&&(x="$SCOPE"),x}function gs(h,g){if(!O(h))return ht(g)||(g=g?2:null),JSON.stringify(h,fs,g)}function sr(h){return et(h)?JSON.parse(h):h}var Su=/:/g;function $c(h,g){h=h.replace(Su,"");var x=Date.parse("Jan 01, 1970 00:00:00 "+h)/6e4;return U(x)?g:x}function Hr(h,g){return h=new Date(h.getTime()),h.setMinutes(h.getMinutes()+g),h}function bl(h,g,x){x=x?-1:1;var C=h.getTimezoneOffset(),k=$c(g,C);return Hr(h,x*(k-C))}function Zn(h){h=p(h).clone().empty();var g=p("<div></div>").append(h).html();try{return h[0].nodeType===je?o(g):g.match(/^(<[^>]+>)/)[1].replace(/^<([\w-]+)/,function(x,C){return"<"+o(C)})}catch{return o(g)}}function kc(h){try{return decodeURIComponent(h)}catch{}}function go(h){var g={};return T((h||"").split("&"),function(x){var C,k,_;x&&(k=x=x.replace(/\+/g,"%20"),C=x.indexOf("="),C!==-1&&(k=x.substring(0,C),_=x.substring(C+1)),k=kc(k),K(k)&&(_=K(_)?kc(_):!0,l.call(g,k)?$t(g[k])?g[k].push(_):g[k]=[g[k],_]:g[k]=_))}),g}function ug(h){var g=[];return T(h,function(x,C){$t(x)?T(x,function(k){g.push(ts(C,!0)+(k===!0?"":"="+ts(k,!0)))}):g.push(ts(C,!0)+(x===!0?"":"="+ts(x,!0)))}),g.length?g.join("&"):""}function Tc(h){return ts(h,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ts(h,g){return encodeURIComponent(h).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,g?"%20":"+")}var ir=["ng-","data-ng-","ng:","x-ng-"];function Lc(h,g){var x,C,k=ir.length;for(C=0;C<k;++C)if(x=ir[C]+g,et(x=h.getAttribute(x)))return x;return null}function yo(h){var g=h.currentScript;if(!g)return!0;if(!(g instanceof n.HTMLScriptElement||g instanceof n.SVGScriptElement))return!1;var x=g.attributes,C=[x.getNamedItem("src"),x.getNamedItem("href"),x.getNamedItem("xlink:href")];return C.every(function(k){if(!k)return!0;if(!k.value)return!1;var _=h.createElement("a");if(_.href=k.value,h.location.origin===_.origin)return!0;switch(_.protocol){case"http:":case"https:":case"ftp:":case"blob:":case"file:":case"data:":return!0;default:return!1}})}var $u=yo(n.document);function bo(h,g){var x,C,k={};if(T(ir,function(_){var I=_+"app";!x&&h.hasAttribute&&h.hasAttribute(I)&&(x=h,C=h.getAttribute(I))}),T(ir,function(_){var I=_+"app",P;!x&&(P=h.querySelector("["+I.replace(":","\\:")+"]"))&&(x=P,C=P.getAttribute(I))}),x){if(!$u){n.console.error("AngularJS: disabling automatic bootstrap. <script> protocol indicates an extension, document.location.href does not match.");return}k.strictDi=Lc(x,"strict-di")!==null,g(x,C?[C]:[],k)}}function at(h,g,x){j(x)||(x={});var C={strictDi:!1};x=nt(C,x);var k=function(){if(h=p(h),h.injector()){var P=h[0]===n.document?"document":Zn(h);throw L("btstrpd","App already bootstrapped with this element '{0}'",P.replace(/</,"&lt;").replace(/>/,"&gt;"))}g=g||[],g.unshift(["$provide",function(Y){Y.value("$rootElement",h)}]),x.debugInfoEnabled&&g.push(["$compileProvider",function(Y){Y.debugInfoEnabled(!0)}]),g.unshift("ng");var E=hg(g,x.strictDi);return E.invoke(["$rootScope","$rootElement","$compile","$injector",function(G,tt,it,xt){G.$apply(function(){tt.data("$injector",xt),it(tt)(G)})}]),E},_=/^NG_ENABLE_DEBUG_INFO!/,I=/^NG_DEFER_BOOTSTRAP!/;if(n&&_.test(n.name)&&(x.debugInfoEnabled=!0,n.name=n.name.replace(_,"")),n&&!I.test(n.name))return k();n.name=n.name.replace(I,""),A.resumeBootstrap=function(P){return T(P,function(E){g.push(E)}),k()},M(A.resumeDeferredBootstrap)&&A.resumeDeferredBootstrap()}function ft(){n.name="NG_ENABLE_DEBUG_INFO!"+n.name,n.location.reload()}function ct(h){var g=A.element(h).injector();if(!g)throw L("test","no injector found for element argument to getTestability");return g.get("$$testability")}var dt=/[A-Z]/g;function gt(h,g){return g=g||"_",h.replace(dt,function(x,C){return(C?g:"")+x.toLowerCase()})}var bt=!1;function lt(){var h;if(!bt){var g=xe();m=O(g)?n.jQuery:g?n[g]:void 0,m&&m.fn.on?(p=m,nt(m.fn,{scope:Tu.scope,isolateScope:Tu.isolateScope,controller:Tu.controller,injector:Tu.injector,inheritedData:Tu.inheritedData})):p=cn,h=p.cleanData,p.cleanData=function(x){for(var C,k=0,_;(_=x[k])!=null;k++)C=(p._data(_)||{}).events,C&&C.$destroy&&p(_).triggerHandler("$destroy");h(x)},A.element=p,bt=!0}}function kt(){cn.legacyXHTMLReplacement=!0}function It(h,g,x){if(!h)throw L("areq","Argument '{0}' is {1}",g||"?",x||"required");return h}function Ct(h,g,x){return x&&$t(h)&&(h=h[h.length-1]),It(M(h),g,"not a function, got "+(h&&typeof h=="object"?h.constructor.name||"Object":typeof h)),h}function Nt(h,g){if(h==="hasOwnProperty")throw L("badname","hasOwnProperty is not a valid {0} name",g)}function Wt(h,g,x){if(!g)return h;for(var C=g.split("."),k,_=C.length,I=0;I<_;I++)k=C[I],h&&(h=h[k]);return h}function qt(h){for(var g=h[0],x=h[h.length-1],C,k=1;g!==x&&(g=g.nextSibling);k++)(C||h[k]!==g)&&(C||(C=p(f.call(h,0,k))),C.push(g));return C||h}function ee(){return Object.create(null)}function se(h){if(h==null)return"";switch(typeof h){case"string":break;case"number":h=""+h;break;default:Bt(h)&&!$t(h)&&!Et(h)?h=h.toString():h=gs(h)}return h}var re=1,Oe=2,je=3,ta=8,Oa=9,_s=11;function rr(h){var g=s("$injector"),x=s("ng");function C(_,I,P){return _[I]||(_[I]=P())}var k=C(h,"angular",Object);return k.$$minErr=k.$$minErr||s,C(k,"module",function(){var _={};return function(P,E,Y){var G={},tt=function(it,xt){if(it==="hasOwnProperty")throw x("badname","hasOwnProperty is not a valid {0} name",xt)};return tt(P,"module"),E&&_.hasOwnProperty(P)&&(_[P]=null),C(_,P,function(){if(!E)throw g("nomod","Module '{0}' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.",P);var it=[],xt=[],At=[],zt=Vt("$injector","invoke","push",xt),ae={_invokeQueue:it,_configBlocks:xt,_runBlocks:At,info:function(Ht){if(K(Ht)){if(!j(Ht))throw x("aobj","Argument '{0}' must be an object","value");return G=Ht,this}return G},requires:E,name:P,provider:Ut("$provide","provider"),factory:Ut("$provide","factory"),service:Ut("$provide","service"),value:Vt("$provide","value"),constant:Vt("$provide","constant","unshift"),decorator:Ut("$provide","decorator",xt),animation:Ut("$animateProvider","register"),filter:Ut("$filterProvider","register"),controller:Ut("$controllerProvider","register"),directive:Ut("$compileProvider","directive"),component:Ut("$compileProvider","component"),config:zt,run:function(Ht){return At.push(Ht),this}};return Y&&zt(Y),ae;function Vt(Ht,Kt,Dt,_t){return _t||(_t=it),function(){return _t[Dt||"push"]([Ht,Kt,arguments]),ae}}function Ut(Ht,Kt,Dt){return Dt||(Dt=it),function(_t,yt){return yt&&M(yt)&&(yt.$$moduleName=P),Dt.push([Ht,Kt,arguments]),ae}}})}})}function Pn(h,g){if($t(h)){g=g||[];for(var x=0,C=h.length;x<C;x++)g[x]=h[x]}else if(j(h)){g=g||{};for(var k in h)k.charAt(0)==="$"&&k.charAt(1)==="$"||(g[k]=h[k])}return g||h}function vi(h,g){var x=[];return a(g)&&(h=A.copy(h,null,g)),JSON.stringify(h,function(C,k){if(k=fs(C,k),j(k)){if(x.indexOf(k)>=0)return"...";x.push(k)}return k})}function vl(h,g){return typeof h=="function"?h.toString().replace(/ \{[\s\S]*$/,""):O(h)?"undefined":typeof h!="string"?vi(h,g):h}var qs={full:"1.8.3",major:1,minor:8,dot:3,codeName:"ultimate-farewell"};function Zx(h){nt(h,{errorHandlingConfig:e,bootstrap:at,copy:$e,extend:nt,merge:rt,equals:Xe,element:p,forEach:T,injector:hg,noop:ot,bind:Ye,toJson:gs,fromJson:sr,identity:st,isUndefined:O,isDefined:K,isString:et,isFunction:M,isObject:j,isNumber:ht,isElement:Ge,isArray:$t,version:qs,isDate:Et,callbacks:{$$counter:0},getTestability:ct,reloadWithDebugInfo:ft,UNSAFE_restoreLegacyJqLiteXHTMLReplacement:kt,$$minErr:s,$$csp:Be,$$encodeUriSegment:Tc,$$encodeUriQuery:ts,$$lowercase:o,$$stringify:se,$$uppercase:d}),w=rr(n),w("ng",["ngLocale"],["$provide",function(x){x.provider({$$sanitizeUri:Xmt}),x.provider("$compile",L3).directive({a:xft,input:LB,textarea:LB,form:Aft,script:xgt,select:Cgt,option:Sgt,ngBind:Fft,ngBindHtml:Hft,ngBindTemplate:Gft,ngClass:Bft,ngClassEven:Wft,ngClassOdd:zft,ngCloak:Vft,ngController:jft,ngForm:Cft,ngHide:hgt,ngIf:Kft,ngInclude:Jft,ngInit:Zft,ngNonBindable:igt,ngPluralize:cgt,ngRef:dgt,ngRepeat:ugt,ngShow:pgt,ngStyle:mgt,ngSwitch:fgt,ngSwitchWhen:ggt,ngSwitchDefault:ygt,ngOptions:ogt,ngTransclude:vgt,ngModel:agt,ngList:tgt,ngChange:Uft,pattern:FB,ngPattern:FB,required:XB,ngRequired:XB,minlength:HB,ngMinlength:HB,maxlength:GB,ngMaxlength:GB,ngValue:Xft,ngModelOptions:sgt}).directive({ngInclude:Qft,input:Oft}).directive(bw).directive(DB),x.provider({$anchorScroll:Iht,$animate:Oht,$animateCss:Fht,$$animateJs:Nht,$$animateQueue:Yht,$$AnimateRunner:Xht,$$animateAsyncRun:Mht,$browser:Bht,$cacheFactory:zht,$controller:Kht,$document:Jht,$$isDocumentHidden:Qht,$exceptionHandler:Zht,$filter:nB,$$forceReflow:tmt,$interpolate:umt,$interval:hmt,$$intervalFactory:mmt,$http:lmt,$httpParamSerializer:smt,$httpParamSerializerJQLike:imt,$httpBackend:cmt,$xhrFactory:omt,$jsonpCallbacks:fmt,$location:$mt,$log:kmt,$parse:_mt,$rootScope:Mmt,$q:Nmt,$$q:Ymt,$sce:Umt,$sceDelegate:Hmt,$sniffer:Bmt,$$taskTrackerFactory:zmt,$templateCache:Wht,$templateRequest:jmt,$$testability:qmt,$timeout:Jmt,$window:nft,$$rAF:Omt,$$jqLite:wht,$$Map:Cht,$$cookieReader:sft})}]).info({angularVersion:"1.8.3"})}cn.expando="ng339";var ku=cn.cache={},nht=1;cn._data=function(h){return this.cache[h[this.expando]]||{}};function sht(){return++nht}var iht=/-([a-z])/g,rht=/^-ms-/,tw={mouseleave:"mouseout",mouseenter:"mouseover"},fL=s("jqLite");function lht(h){return ew(h.replace(rht,"ms-"))}function c3(h,g){return g.toUpperCase()}function ew(h){return h.replace(iht,c3)}var oht=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,cht=/<|&#?\w+;/,dht=/<([\w:-]+)/,uht=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,Ur={thead:["table"],col:["colgroup","table"],tr:["tbody","table"],td:["tr","tbody","table"]};Ur.tbody=Ur.tfoot=Ur.colgroup=Ur.caption=Ur.thead,Ur.th=Ur.td;var pg={option:[1,'<select multiple="multiple">',"</select>"],_default:[0,"",""]};for(var d3 in Ur){var u3=Ur[d3],p3=u3.slice().reverse();pg[d3]=[p3.length,"<"+p3.join("><")+">","</"+u3.join("></")+">"]}pg.optgroup=pg.option;function gL(h){return!cht.test(h)}function yL(h){var g=h.nodeType;return g===re||!g||g===Oa}function pht(h){for(var g in ku[h.ng339])return!0;return!1}function h3(h,g){var x,C,k,_,I=g.createDocumentFragment(),P=[],E;if(gL(h))P.push(g.createTextNode(h));else{if(x=I.appendChild(g.createElement("div")),C=(dht.exec(h)||["",""])[1].toLowerCase(),_=cn.legacyXHTMLReplacement?h.replace(uht,"<$1></$2>"):h,u<10)for(k=pg[C]||pg._default,x.innerHTML=k[1]+_+k[2],E=k[0];E--;)x=x.firstChild;else{for(k=Ur[C]||[],E=k.length;--E>-1;)x.appendChild(n.document.createEl