/** * @proximus/frontend-common * @version v2.1.7 */ !function(){"use strict";angular.module("myProximus.common",[]).constant("CommonConstants",{FILES:[]})}(),function(){"use strict";angular.module("myProximus.common").constant("GlpEntityConfig",{loyaltyProgramSubscription_v1:{secure:!1,rel:"lp:loyaltyProgramSubscription",url:"/rest/loyalty-program/customer/{customerId}/loyaltyprogramsubscription",version:"v1",requiredJwts:["x-application-authorization-loyaltyprogrameligibility"],dataStrategy:proximusConfig.DATASTRATEGY.PROXY_STORAGE,storageStrategy:proximusConfig.STORAGESTRATEGY.SESSIONSTORAGE},loyaltyProgramEligibility_v1:{secure:!1,rel:"lp:loyaltyeligibility",url:"/rest/loyalty-program/customer/{customerId}/loyaltyeligibility",version:"v1",dataStrategy:proximusConfig.DATASTRATEGY.TWO_PHASE_COMMIT,storageStrategy:proximusConfig.STORAGESTRATEGY.SESSIONSTORAGE},awards_v1:{secure:!1,rel:"aw:awards",url:"/rest/awards/customer/{customerId}/awards?filter={filter}",version:"v1",dataStrategy:proximusConfig.DATASTRATEGY.TWO_PHASE_COMMIT,storageStrategy:proximusConfig.STORAGESTRATEGY.SESSIONSTORAGE},award_v1:{secure:!1,rel:"aw:award",url:"/rest/awards/customer/{customerId}/award/{awardId}",version:"v1",requiredJwts:["x-application-authorization-eligibleawards"],uniqueJwts:["x-application-authorization-awarddetail"],dataStrategy:proximusConfig.DATASTRATEGY.TWO_PHASE_COMMIT,storageStrategy:proximusConfig.STORAGESTRATEGY.SESSIONSTORAGE},birthdayawards_v1:{secure:!1,rel:"aw:birthdayawards",url:"/rest/awards/customer/{customerId}/birthdayAwards",version:"v1",uniqueJwts:["x-application-authorization-awarddetail"],dataStrategy:proximusConfig.DATASTRATEGY.TWO_PHASE_COMMIT,storageStrategy:proximusConfig.STORAGESTRATEGY.SESSIONSTORAGE},birthdayaward_v1:{secure:!1,rel:"aw:birthdayaward",url:"/rest/awards/customer/{customerId}/birthdayAward/{awardId}",version:"v1",requiredJwts:["x-application-authorization-eligiblebirthdayawards"],uniqueJwts:["x-application-authorization-awarddetail"],dataStrategy:proximusConfig.DATASTRATEGY.TWO_PHASE_COMMIT,storageStrategy:proximusConfig.STORAGESTRATEGY.SESSIONSTORAGE},stock_v1:{secure:!1,rel:"aw:stock",version:"v1",parentRel:"aw:award",parentEntityConfigFile:"GlpEntityConfig",requiredJwts:["x-application-authorization-eligibleawards"],dataStrategy:proximusConfig.DATASTRATEGY.PROXY_STORAGE,storageStrategy:proximusConfig.STORAGESTRATEGY.NONE},birthdaystock_v1:{secure:!1,rel:"aw:birthdaystock",version:"v1",parentRel:"aw:birthdayaward",parentEntityConfigFile:"GlpEntityConfig",requiredJwts:["x-application-authorization-eligiblebirthdayawards"],dataStrategy:proximusConfig.DATASTRATEGY.PROXY_STORAGE,storageStrategy:proximusConfig.STORAGESTRATEGY.NONE},vodOrderEligibility_v1:{secure:!1,rel:"ol:vodordereligibility",url:"/rest/ordering-loyalty/eligibilitycheck/customer/{customerId}/award/{awardId}/vodorder",version:"v1",requiredJwts:["x-application-authorization-loyaltyprogramsubscription","x-application-authorization-awarddetail{identifier}"],uniqueJwts:["x-application-authorization-vodorder-eligibility"],dataStrategy:proximusConfig.DATASTRATEGY.PROXY_STORAGE,storageStrategy:proximusConfig.STORAGESTRATEGY.NONE},order_v1:{secure:!1,rel:"ol:order",version:"v1",parentRel:"aw:award",parentEntityConfigFile:"GlpEntityConfig",requiredJwts:["x-application-authorization-awarddetail{identifier}","x-application-authorization-loyaltyprogramsubscription","x-application-authorization-vodorder-eligibility{identifier}"],dataStrategy:proximusConfig.DATASTRATEGY.TWO_PHASE_COMMIT,storageStrategy:proximusConfig.STORAGESTRATEGY.SESSIONSTORAGE},birthdayorder_v1:{secure:!1,rel:"ol:order",version:"v1",parentRel:"aw:birthdayaward",parentEntityConfigFile:"GlpEntityConfig",requiredJwts:["x-application-authorization-awarddetail{identifier}","x-application-authorization-loyaltyprogramsubscription","x-application-authorization-vodorder-eligibility{identifier}"],dataStrategy:proximusConfig.DATASTRATEGY.TWO_PHASE_COMMIT,storageStrategy:proximusConfig.STORAGESTRATEGY.SESSIONSTORAGE},emails_v1:{secure:!1,rel:"cp:customerContactEmails",url:"/rest/contact-person/customers/{customerId}/contact/emails?context={context}",version:"v1",dataStrategy:proximusConfig.DATASTRATEGY.TWO_PHASE_COMMIT,storageStrategy:proximusConfig.STORAGESTRATEGY.SESSIONSTORAGE},email_v1:{secure:!1,rel:"cp:customerContactEmail",url:"/rest/contact-person/customers/{customerId}/contact/email",version:"v1",requiredJwts:["x-application-authorization-contact"],dataStrategy:proximusConfig.DATASTRATEGY.TWO_PHASE_COMMIT,storageStrategy:proximusConfig.STORAGESTRATEGY.SESSIONSTORAGE},check_email_v1:{secure:!1,rel:"ecc:emailcheck",url:"/rest/email-contact-check/check/{email}",version:"v1",requiredJwts:["x-application-authorization-contact"],dataStrategy:proximusConfig.DATASTRATEGY.PROXY_STORAGE,storageStrategy:proximusConfig.STORAGESTRATEGY.NONE},pointsHistory_v1:{secure:!1,rel:"lp:loyaltyPointsHistory",url:"/rest/loyalty-program/customer/{customerId}/loyaltypoints{?fromDate,toDate}",version:"v1",dataStrategy:proximusConfig.DATASTRATEGY.TWO_PHASE_COMMIT,storageStrategy:proximusConfig.STORAGESTRATEGY.SESSIONSTORAGE},orderHistory_v1:{secure:!1,rel:"ol:orders",url:"/rest/ordering-loyalty/customer/{customerId}/orders{?fromDate,toDate}",version:"v1",requiredJwts:["x-application-authorization-loyaltyprogramsubscription"],dataStrategy:proximusConfig.DATASTRATEGY.TWO_PHASE_COMMIT,storageStrategy:proximusConfig.STORAGESTRATEGY.SESSIONSTORAGE},contact_v1:{secure:!1,rel:"cp:customerContact",url:"/rest/contact-person/customers/{customerId}/contact?context={context}",version:"v1",requiredJwts:["x-application-authorization-contact"],dataStrategy:proximusConfig.DATASTRATEGY.TWO_PHASE_COMMIT,storageStrategy:proximusConfig.STORAGESTRATEGY.SESSIONSTORAGE},transferPointsEligibility_v1:{secure:!1,rel:"lp:loyaltyPointsTransferEligibility",url:"/rest/loyalty-program/eligibilityCheck/loyaltyProgramSubscription/{loyaltyProgramSubscriptionId}/transfer",version:"v1",requiredJwts:["x-application-authorization-loyaltyprogramsubscription"],dataStrategy:proximusConfig.DATASTRATEGY.PROXY_STORAGE,storageStrategy:proximusConfig.STORAGESTRATEGY.SESSIONSTORAGE},transfer_v1:{secure:!1,rel:"lp:transfer",version:"v1",parentRel:"lp:loyaltyPointsTransferEligibility",parentEntityConfigFile:"GlpEntityConfig",requiredJwts:["x-application-authorization-loyaltyprogramsubscription","x-application-authorization-loyaltypointstransfereligibility"],dataStrategy:proximusConfig.DATASTRATEGY.PROXY_STORAGE,storageStrategy:proximusConfig.STORAGESTRATEGY.NONE},banner_v1:{secure:!1,rel:"loyaltyBanner",version:"v1",dataStrategy:proximusConfig.DATASTRATEGY.PROXY_STORAGE,storageStrategy:proximusConfig.STORAGESTRATEGY.NONE}})}(),function(){"use strict";function t(t,e){t.mapTo(e.GET_CUSTOMER_ACCOUNT.EVENT).asSequence().add(e.GET_CUSTOMER_ACCOUNT.COMMAND),t.mapTo(e.GET_BREADCRUMB_ITEMS.EVENT).asSequence().add(e.GET_BREADCRUMB_ITEMS.COMMAND),t.mapTo(e.LOGOUT_USER.EVENT).asSequence().add(e.LOGOUT_USER.COMMAND),t.mapTo(e.SET_CONTACT_EMAIL.EVENT).asSequence().add(e.GET_CUSTOMER_ACCOUNT.COMMAND).add(e.SET_CONTACT_EMAIL.COMMAND),t.mapTo(e.SHOW_ERROR_NOTIFICATION.EVENT).asSequence().add(e.SHOW_ERROR_NOTIFICATION.COMMAND),t.mapTo(e.SHOW_CONFIRMATION_NOTIFICATION.EVENT).asSequence().add(e.SHOW_CONFIRMATION_NOTIFICATION.COMMAND)}var e={GET_CUSTOMER_ACCOUNT:{EVENT:"GetCustomerAccountEvent",COMMAND:"GetCustomerAccountCommand"},GET_CUSTOMER_ACCOUNT_WITH_PROPERTIES:{EVENT:"GetCustomerAccountWithPropertiesEvent",COMMAND:"GetCustomerAccountWithPropertiesCommand"},GET_GROUP_CUSTOMERS:{EVENT:"GetGroupCustomerEvent",COMMAND:"GetGroupCustomerCommand"},GET_CONTACT_EMAIL:{EVENT:"GetContactEmailEvent",COMMAND:"GetContactEmailCommand"},SET_CONTACT_EMAIL:{EVENT:"SetContactEmailEvent",COMMAND:"SetContactEmailCommand"},SHOW_CONFIRMATION_NOTIFICATION:{EVENT:"ShowConfirmationNotificationEvent",COMMAND:"ShowConfirmationNotificationCommand"},SHOW_ERROR_NOTIFICATION:{EVENT:"ShowErrorNotificationEvent",COMMAND:"ShowErrorNotificationCommand"},LOGOUT_USER:{EVENT:"LogoutUserEvent",COMMAND:"LogoutUserCommand"},GET_BREADCRUMB_ITEMS:{EVENT:"GetBreadcrumbItemsEvent",COMMAND:"GetBreadcrumbItemsCommand"}};angular.module("myProximus.common").config(t).constant("CommonCommandConfig",e),t.$inject=["$commangularProvider","CommonCommandConfig"]}(),function(){"use strict";function t(t,e,n,i,r,a,o){return{execute:function(){var s=t.defer(),c="myProximus.common.breadcrumb",u="breadcrumbTranslations";r.setBreadcrumbTranslationKey(c);var m=e.getObject(u);return _.isNull(m)?n.dispatch(i.GET_TRANSLATIONS.EVENT,{key:c,depth:"20"}).then(function(t){e.setObject(u,t.translations),r.buildBreadcrumbItems(o),s.resolve(r.data.items)},function(){s.reject()}):(a.addTranslation(c,m),r.buildBreadcrumbItems(o),s.resolve(r.data.items)),s.promise}}}commangular.create("GetBreadcrumbItemsCommand",t,{resultKey:"breadcrumbItems"}),t.$inject=["$q","$sessionStorage","$commangular","CommandConfig","BreadcrumbService","TranslationService","breadcrumbTree"]}(),function(){"use strict";function t(t,e,n,i,r){return{execute:function(){var a=t.defer(),o="",s={customerId:e.customerId,context:r};return n.getEntity(i.emails_v1,s).subscribe(function(t){_.isEmpty(t.value.emails)||(o=t.value.emails[0].emailAddress)},function(t){a.reject(t)},function(){a.resolve(o)}),a.promise}}}commangular.create("GetContactEmailCommand",t,{resultKey:"contactEmail"}),t.$inject=["$q","customerAccount","$entityManager","GlpEntityConfig","contactContext"]}(),function(){angular.module("myProximus.common.templates",[]).run(["$templateCache",function(t){t.put("/breadcrumbTemplate",'\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n'),t.put("/directiveLoaderTemplate",'\r\n
\r\n Veuillez patienter svp\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n'),t.put("/notificationItemTemplate",'\r\n
\r\n
\r\n\r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n\r\n
\r\n \r\n \r\n
\r\n\r\n
\r\n

\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n

\r\n
\r\n\r\n
\r\n\r\n \r\n ×\r\n \r\n\r\n
\r\n\r\n
\r\n
\r\n\r\n
\r\n
\r\n\r\n'),t.put("/notificationOverviewTemplate",'
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n\r\n
\r\n
\r\n\r\n
\r\n\r\n\r\n
\r\n\r\n\r\n'),t.put("/vatTextTemplate",'\r\n hors TVA\r\n TVA incluse\r\n\r\n')}])}(),function(){"use strict";function t(t,e,n,i,r,a,o,s){function c(){var i=t.defer();return u().then(function(){e.getItem("customerAccount").then(function(t){f().then(function(e){e?(n.setCustomerAccount(t),i.resolve(n.data.customerAccount)):l(i)})},function(){l(i)})}),i.promise}function u(){var e=m(),n=o.getCookie(e),i=t.defer(),r=sessionStorage.getItem(e);return r&&r!==n?(sessionStorage.setItem(e,n),sessionStorage.removeItem("us:userv2"),sessionStorage.removeItem("customerAccount"),i.resolve("")):n?(sessionStorage.setItem(e,n),i.resolve("")):i.resolve(""),i.promise}function m(){return s.isProd()||s.isDR()?"iiamsid":s.isUat()?"iiamsid-uat":"iiamsid-itt"}function l(t){i.isSmoothAccess()?i.getCustomerFromAuthenticationToken().then(function(e){n.data.customerAccount=e,t.resolve(e)},function(){t.reject(!1)}):d(t)}function d(t){a.getEntity(r.user_v2,r.user_v2.parameters).subscribe(function(e){if(e.value&&e.value._embedded&&e.value._embedded["us:fls-default-customer"]&&e.value._embedded["us:fls-default-customer"]._links&&e.value._embedded["us:fls-default-customer"]._links["cg:group"]){var i=e.value,o=_.extend({},r.groupCustomer_v1);o.url=e.value._embedded["us:fls-default-customer"]._links["cg:group"].href,a.getEntity(o).subscribe(function(e){i.groups=e.value,n.setCustomerAccount(i),t.resolve(n.data.customerAccount)},function(e){t.reject(e)})}else n.setCustomerAccount(e.value),t.resolve(n.data.customerAccount)},function(e){t.reject(e)})}function f(){var n=t.defer();if(r.user_v2.parameters&&r.user_v2.parameters.includes){var i=a.createEntity(r.user_v2,r.user_v2.parameters);e.getItem(i.uniqueKey).then(function(){n.resolve(!0)},function(){n.resolve(!1)})}else n.resolve(!0);return n.promise}var p={execute:c};return p}commangular.create("GetCustomerAccountCommand",t,{resultKey:"customerAccount"}),t.$inject=["$q","$storage","CustomerAccountService","SmoothAccessService","CommonEntityConfig","$entityManager","CookiesService","$environment"]}(),function(){"use strict";function t(t,e,n){function i(){r(),e.location.href=n}function r(){t.clear()}var a={execute:i};return a}commangular.create("LogoutUserCommand",t),t.$inject=["$sessionStorage","$window","logoutUrl"]}(),function(){"use strict";function t(t,e,n,i,r,a,o,s,c){return{execute:function(){var u=t.defer(),m={customerId:i.customerId},l=a.createEntity(o.email_v1,m);return l.value={emailAddress:n,context:s},a.saveEntity(l).subscribe(function(){r.setString(s.toLowerCase()+"ContactEmail",n),c.setContactEmail(s,n),u.resolve(!0)},function(t){e.error(s+" contact email save failed for entity: "+t),u.reject(t)}),u.promise}}}commangular.create("SetContactEmailCommand",t),t.$inject=["$q","$log","contactEmail","customerAccount","$sessionStorage","$entityManager","GlpEntityConfig","contactContext","EmailContactService"]}(),function(){"use strict";function t(t,e,n){return{execute:function(){var i=t.defer();return e.showConfirmation(n.translationKey,n.id,n.displayContext),i.resolve(!0),i.promise}}}commangular.create("ShowConfirmationNotificationCommand",t),t.$inject=["$q","NotificationService","notification"]}(),function(){"use strict";function t(t,e,n){return{execute:function(){var i=t.defer();return e.showError(n.translationKey,n.id,n.displayContext),i.resolve(!0),i.promise}}}commangular.create("ShowErrorNotificationCommand",t),t.$inject=["$q","NotificationService","notification"]}(),function(){"use strict";angular.module("myProximus.common").constant("CommonEntityConfig",{user_v2:{secure:!0,disableCache:!0,requestHeaders:["language","proximusContentType","userId","etag","encryptionKey","customHeaders"],rel:"us:user",url:"/rest/user/user{?includes}",version:"v2",dataStrategy:proximusConfig.DATASTRATEGY.STORAGE_PROXY,storageStrategy:proximusConfig.STORAGESTRATEGY.SESSIONSTORAGE,parameters:{},customHeaders:{internalOrigin:"true"}},groupCustomer_v1:{secure:!0,rel:"cg:group",version:"v1",parentRel:"us:user",parentEntityConfigFile:"CommonEntityConfig",parentRelUrlPath:["us:fls-default-customer"],requiredJwts:["x-application-authorization"],dataStrategy:proximusConfig.DATASTRATEGY.PROXY_STORAGE,storageStrategy:proximusConfig.STORAGESTRATEGY.SESSIONSTORAGE}})}(),function(){"use strict";function t(t,e,n,i){function r(){function r(){var t,n=[];t=e.document.getElementsByTagName("img"),_.forEach(t,function(t){var e=t.attributes["data-mp-lazy-image"]||t.attributes["mp-lazy-image"];e&&n.push(t)}),n.length>0&&_.forEach(n,function(t){var e=t.attributes["data-mp-lazy-image"]||t.attributes["mp-lazy-image"],n=!!t.attributes.loaded&&_.isEqual(t.attributes.loaded.value,"loaded"),r=t.src.indexOf(e.value)<0;(n&&r||r&&i.isElementInViewport(t))&&(t.src=e.value,t.setAttribute("loaded","loaded"))})}var o=_.debounce(r,a);angular.element(e).bind("scroll",o),angular.element(e).bind("resize",o),n.onMessage("reLazyLoad",o),t(o)}var a=300,o={restrict:"A",compile:r};return o}angular.module("myProximus.common").directive("mpLazyImage",t),t.$inject=["$timeout","$window","$eventBus","AnalyticsService"]}(),function(){"use strict";function t(t,e){function n(n,i,r,a){function o(){g=!0}function s(){g=!1}function c(){var t;f(T),f(S),t=n.formValid?"formValidator.validated":"formValidator.rejected",e.emitMessage(t)}function u(){T=i.find("input"),S=i.find("select"),v=!0,_.forEach(T,function(t){var e=l(t);m(t),v=v&&_.isEmpty(e)}),_.forEach(S,function(t){var e=l(t);m(t),v=v&&_.isEmpty(e)}),n.formValid=v}function m(t){_.includes(p,t.name)||(angular.element(t).on("blur",function(t){d(t.target),g&&c()}),p.push(t.name))}function l(t){var e=null!=t.getAttribute("required"),n=t.getAttribute("regex"),i=t.getAttribute("max-int-value"),r=t.getAttribute("min-int-value"),a=!_.isEqual(t.value,""),o=[];return e&&!a?o.push("required"):(!a||_.isNull(n)||t.value.match(n)||o.push("invalid"),!a||_.isNull(i)||parseInt(t.value)<=parseInt(i)||o.push("invalid"),!a||_.isNull(r)||parseInt(t.value)>=parseInt(r)||o.push("invalid")),o}function d(t,e){var i=l(t);_.isEmpty(i)?a.invalid[t.name]&&delete a.invalid[t.name]:a.invalid[t.name]=i[0],n.formValid=_.isEmpty(a.invalid),e||n.$digest()}function f(t){_.forEach(t,function(t){d(t,!0)})}var p=[],g=!1,T=i.find("input"),S=i.find("select"),v=!0;u(),e.onMessage("formValidator.validate",c,n),e.onMessage("action.mouseDown",o,n),e.onMessage("action.mouseUp",s,n),r.resetOn&&n.$watch(function(){return r.resetOn},function(){t(u)})}function i(){this.invalid={}}var r={restrict:"A",link:n,controller:i,controllerAs:"formValidatorData"};return r}angular.module("myProximus.common").directive("mpFormValidator",t),t.$inject=["$timeout","$eventBus"]}(),function(){"use strict";function t(t,e,n,i,r,a){function o(i,r){var o=e.defer();return i=s(i),u(i)&&(i=m(r,i)),a.isSphinx()&&(i=c(i)),t.get(i,{cache:n}).then(function(t){o.resolve(t.data)})["catch"](function(t){o.reject(t.data)}),o.promise}function s(t){return t=_.isEqual(i.host(),"localhost")?t.replace(/\{language\}\//,""):t.replace(/\{language\}/,r.getSelectedLanguage())}function c(t){return t.replace(/\/[\w]+/,g)}function u(t){return t.indexOf("{segment}")>-1}function m(t,e){if(!t)throw new Error("templateUrl contains segment expression but no customerAccount info provided (param or service)");if(t.isGuest)e=e.replace(/\{segment\}/,p);else switch(t.segment){case"PRE":case"RES":e=e.replace(/\{segment\}/,l);break;case"BUS":e=e.replace(/\{segment\}/,d);break;case"GEN":case"COR":e=e.replace(/\{segment\}/,f);break;default:e="/myproximus/"+r.getSelectedLanguage()+"/Personal/services/Error~mgnlArea=body~.html"}return e}var l="Personal",d="Self-employed-and-small-companies",f="companies-and-government",p="Guest",g="/inapp-mobile",T={getTemplate:o};return T}angular.module("myProximus.common").factory("TemplateProviderService",t),t.$inject=["$http","$q","$templateCache","$location","LanguageService","$environment"]}(),function(){"use strict";function t(t){function e(t,e){r.data.breadcrumbDynamicObject[e]=t}function n(t){r.data.breadcrumbTranslationKey=t}function i(e){var n=[];_.forEach(e,function(e){var i={title:t.getTranslation(r.data.breadcrumbTranslationKey,e.titleTranslationKey)};e.state&&(i.state=e.state),e.link&&(i.link=e.link),e.detailKey&&(i.detail=!0,i.detailKey=e.detailKey),n.push(i)}),r.data.items=n}var r={setBreadcrumbTranslationKey:n,setBreadcrumbDynamicObject:e,buildBreadcrumbItems:i,data:{breadcrumbTranslationKey:void 0,items:[],breadcrumbDynamicObject:{}}};return r}angular.module("myProximus.common").factory("BreadcrumbService",t),t.$inject=["TranslationService"]}(),function(){"use strict";function t(){var t={restrict:"A",replace:!0,templateUrl:"/breadcrumbTemplate",controller:e};return t}function e(t,e,n,i,r,a){t.mpBreadcrumbData={componentError:void 0,items:void 0,isInApp:i.isSphinx()},t.$watch(function(){return r.data},function(e,n){_.isEqual(e,n)||(t.mpBreadcrumbData=e,t.mpBreadcrumbData.isInApp=i.isSphinx())},!0),t.$watch(function(){return n.current.data},function(i){_.isUndefined(i)||_.isUndefined(i.breadcrumbTree)||e.dispatch(a.GET_BREADCRUMB_ITEMS.EVENT,{breadcrumbTree:n.current.data.breadcrumbTree})["catch"](function(){t.mpBreadcrumbData.componentError=!0})})}angular.module("myProximus.common").directive("mpBreadcrumb",t),e.$inject=["$scope","$commangular","$state","$environment","BreadcrumbService","CommonCommandConfig"]}(),function(){"use strict";function t(t){function e(e,i){switch(e){case"LOYALTY":n.data.loyaltyContactEmail=i}var r="EmailContact."+e;t.emitMessage(r)}var n={setContactEmail:e,data:{loyaltyContactEmail:void 0}};return n}angular.module("myProximus.common").factory("EmailContactService",t),t.$inject=["$eventBus"]}(),function(){"use strict";function t(t,e,n){function i(e){var n={},i=t.getObject("customerAccount");i&&(n=_.cloneDeep(i));var a=e;_.isUndefined(a.isGuest)&&(_.isUndefined(a._embedded)?(a._embedded={},a.isGuest=!0):a.isGuest=!1);for(var o in a)a.hasOwnProperty(o)&&0!==o.indexOf("_")&&"password"!==o&&(n[o]=a[o]);a.lastName&&m(n),a._embedded&&(a._embedded["us:fls-default-customer"]&&v(a,n),a._embedded["us:mcs-default-customer"]&&S(a,n),a._embedded["us:implicit"]&&E(a,n)),g(n),e.groups&&r(e.groups),T(n)}function r(t){var e=[],n=t._embedded;_.forEach(n["cg:customers"],function(t){var n={customerId:t.customerId,name:t.name};e.push(n)}),f(e)}function a(){return["11","12","13","24"]}function o(t){if(t)return["prepaid","mcsautoreload","boneautoreload"].indexOf(t)>-1?"prepaid":"postpaid"}function s(){return y(A.data.customerAccount)}function c(){return A.data.customerAccount.fls?A.data.customerAccount.fls.subsegment:A.data.customerAccount.mcs?A.data.customerAccount.mcs.subsegment?A.data.customerAccount.mcs.subsegment:A.data.customerAccount.mcs.mcsSubsegment:"Unknown"}function u(t){t.name?e.setPermanentCookie("selectedCustomerAccountId",t.customerId):t.customerAccountNumber?e.setPermanentCookie("selectedCustomerAccountId",t.customerAccountNumber):e.setPermanentCookie("selectedCustomerAccountId",t.bone),T(A.data.customerAccount)}function m(t){t.fullName=t.firstName+" "+t.lastName}function l(t,e){t.customerId=e.customerId,t.name=e.name,delete t.customerAccountNumber,t.fls.bone&&(t.fls.displayId=n.format(e.bone)),t.fls.payer?(t.displayId=e.customerId,t.displayNumber=!1,t.payer=!0):(e.bone||e.contactNumber)&&(t.displayId=n.format(e.bone||e.contactNumber),t.displayNumber=!0),m(t),t.segment=y(t.fls)}function d(t,e){t.customerId=e.customerId,t.customerAccountNumber=e.customerAccountNumber,t.fls&&t.fls.payer||(t.displayId=n.format(e.contactNumber||"")),t.displayNumber=!0,t.segment=y(e),t.mcs.payer&&(t.payer=!0)}function f(t){A.data.groupCustomers=p(t)}function p(t){if(_.isArray(t))return _.sortBy(t,["name","customerId"])}function g(t){A.data.customerAccount=t}function T(n){var i=e.getCookie("selectedCustomerAccountId");if(i)if(A.data.groupCustomers||n.groups){var r=_.find(A.data.groupCustomers,function(t){return _.isEqual(t.customerId,i)});!r&&n.groups&&_.isEqual(n.fls.customerId,i)&&(r=n.fls),n.fls&&r&&l(n,r)}else n.fls&&_.isEqual(n.fls.customerId,i)?l(n,n.fls):n.mcs&&_.isEqual(n.mcs.customerAccountNumber,i.toString())?d(n,n.mcs):n.fls&&_.isEqual(n.fls.bone,i.toString())&&l(n,n.fls);t.setObject("customerAccount",n)}function S(t,e){var i=t._embedded["us:mcs-default-customer"];e.mcs=i,e.mcs.displayId=n.format(e.mcs.contactNumber||""),!_.isUndefined(e.fls)&&e.fls.payer||d(e,i),t.oneCDB||!_.isUndefined(e.fls)||_.isEqual(i.mcsSubsegment,"PRE")?e.mcs.isNotBridge=!1:e.mcs.isNotBridge=!0,(_.isUndefined(e.mcs.contactNumber)||e.mcs.contactNumber&&!e.mcs.contactNumber.match(/^\d+$/))&&(e.isGen=!0)}function v(t,e){var n=t._embedded["us:fls-default-customer"],i=_.cloneDeep(n);e.fls=i,l(e,i),!t.oneCDB&&_.isUndefined(t._embedded["us:mcs-default-customer"])?e.fls.isNotBridge=!0:e.fls.isNotBridge=!1,i._links["cg:group"]?e.groupCustomer=!0:(e.groupCustomer=!1,A.data.groupCustomers=void 0)}function E(t,e){var n=t._embedded["us:implicit"],i=_.cloneDeep(n);_.isUndefined(i.subsegment)&&!_.isUndefined(i.subSegment)&&(i.subsegment=i.subSegment),"FLS"===i.provider?(e.fls=i,l(e,i)):"MCS"===i.provider&&(e.mcs=i,d(e,i))}function y(t){var e;return _.isUndefined(t.segment)?_.isUndefined(t.subsegment)?e=t.mcsSubsegment:t.subsegment.match(/11|12|13|RES/)?e="RES":t.subsegment.match(/22|23|31|32|COR/)?e="COR":t.subsegment.match(/24|25|SE|ME/)&&(e="BUS"):e=t.segment,e}var A={setCustomerAccount:i,switchCustomer:u,getLoyaltyResidentialSubsegments:a,getSegmentCurrentUser:s,getCustomerSubsegment:c,getCustomerSubscriptionType:o,data:{customerAccount:t.getObject("customerAccount"),groupCustomers:p(t.getObject("groupCustomers"))}};return A}angular.module("myProximus.common").factory("CustomerAccountService",t),t.$inject=["$sessionStorage","CookiesService","MsisdnFormatter"]}(),function(){"use strict";function t(t,e){function n(){return _.startsWith(location.pathname,"/smoothAccess")}function i(){var n=e.defer();return t.getItem("authentication").then(function(t){var e={customerId:t.cid,segment:t.segment,oneCDB:!0,isGuest:!1};n.resolve(e)},function(){n.reject(!1)}),n.promise}var r={isSmoothAccess:n,getCustomerFromAuthenticationToken:i};return r}angular.module("myProximus.common").factory("SmoothAccessService",t),t.$inject=["$storage","$q"]}(),function(){"use strict";function t(){function t(t){if(_.isString(t))try{return JSON.parse(t.replace(/\\'/g,'"'))}catch(e){return}}var e={readObject:t};return e}angular.module("myProximus.common").factory("MagnoliaReaderService",t)}(),function(){"use strict";function t(){var t={restrict:"A",replace:!0,templateUrl:"/directiveLoaderTemplate",controller:e};return t}function e(t){t.directiveLoading=!0,t.dataLoaded=function(){t.directiveLoading=!1}}angular.module("myProximus.common").directive("mpDirectiveLoader",t),e.$inject=["$scope"]}(),function(){"use strict";function t(){var t=function(t,e,n,i){this.translationKey=t,this.id=e,this.displayContext=n,this.modificationDate=i};return t}angular.module("myProximus.common").factory("Notification",t),t.$inject=[]}(),function(){"use strict";function t(){var t={restrict:"A",replace:!0,scope:{item:"=notification",displayTime:"&timeout"},controller:e,templateUrl:"/notificationItemTemplate"};return t}function e(t,e,n){function i(t){n.removeNotification(t)}function r(){t.item.hideTimeout&&e.cancel(t.item.hideTimeout)}function a(){var r=t.displayTime()||5e3;if(!_.isEqual(t.item.displayContext,n.DISPLAY_CONTEXT.FIXED)){var a=e(i.bind(null,t.item.id),r);t.item.hideTimeout=a}}t.removeNotification=i,t.$watch(function(){return t.item},function(){r(),a()},!0)}angular.module("myProximus.common").directive("mpNotificationItem",t),t.$inject=[],e.$inject=["$scope","$timeout","NotificationService"]}(),function(){"use strict";function t(){var t={restrict:"A",controller:e,templateUrl:"/notificationOverviewTemplate"};return t}function e(t,e){t.$on("$stateChangeSuccess",function(t,n,i,r){_.isEmpty(r.name)||_.isEqual(r.name,n.name)||e.clearRemovableNotifications()}),t.notificationData={notifications:[]},t.$watch(function(){return e.data.notifications},function(e){t.notificationData.notifications=e})}angular.module("myProximus.common").directive("mpNotificationOverview",t),t.$inject=[],e.$inject=["$scope","NotificationService"]}(),function(){"use strict";function t(){var t={restrict:"A",controller:e};return t}function e(t,e,n,i,r){function a(t){if(!_.isEmpty(t.translationKey)&&!_.isEmpty(t.notificationId)){var e={translationKey:t.translationKey,id:t.notificationId,displayContext:r.DISPLAY_CONTEXT.AUTO_REMOVE };n.dispatch(i.SHOW_ERROR_NOTIFICATION.EVENT,{notification:e})}}a(t),e.onMessage("$stateChangeSuccess",function(t,e,n){a(n)})}angular.module("myProximus.common").directive("mpStateNotification",t),t.$inject=[],e.$inject=["$stateParams","$eventBus","$commangular","CommonCommandConfig","NotificationService"]}(),function(){"use strict";function t(t,e){function n(t,e,n,i){a(t,e,"error",n,i)}function i(t,e,n,i){a(t,e,"confirm",n,i)}function r(t,e,n,i){a(t,e,"info",n,i)}function a(n,i,r,a,c){var u=new Date;if(o(i))l.data.notifications[s(i)].modificationDate=u;else{var m=!0;t.getItem("closedNotifications").then(function(t){var o=_.indexOf(t,i)>=0;if(o&&(m=!1),m&&_.findIndex(l.data.notifications,{id:i})<0){var s=e.getTranslation(n,i);c&&c.length>0&&(s=e.replacePlaceholders(s,c)),l.data.notifications.push({id:i,translation:s,type:r,displayContext:a,modificationDate:u})}},function(){if(!o(i)){var t=e.getTranslation(n,i);c&&c.length>0&&(t=e.replacePlaceholders(t,c)),l.data.notifications.push({id:i,translation:t,type:r,displayContext:a,modificationDate:u})}})}}function o(t){return s(t)>-1}function s(t){return _.findIndex(l.data.notifications,{id:t})}function c(e){var n=_.findIndex(l.data.notifications,_.matchesProperty("id",e));if(n>=0){var i=l.data.notifications[n];_.isEqual(i.displayContext,l.DISPLAY_CONTEXT.FIXED)&&t.getItem("closedNotifications").then(function(n){var i=_.indexOf(n,e)>=0;i||(n.push(e),t.setItem("closedNotifications",n))},function(){t.setItem("closedNotifications",[e])}),l.data.notifications[n].active=!1,l.data.notifications.splice(n,1)}}function u(){l.data.notifications=[]}function m(){var t=[];_.each(l.data.notifications,function(e){_.isEqual(e.displayContext,l.DISPLAY_CONTEXT.AUTO_REMOVE)&&t.push(e.id)}),_.each(t,c)}var l={DISPLAY_CONTEXT:{FIXED:"fixed",AUTO_REMOVE:"removable"},showError:n,showConfirmation:i,showInformation:r,removeNotification:c,clearRemovableNotifications:m,clearAllNotifications:u,data:{notifications:[]}};return l}angular.module("myProximus.common").factory("NotificationService",t),t.$inject=["$sessionStorage","TranslationService"]}(),function(){"use strict";function t(t,e){function n(){e.onMessage("$stateChangeSuccess",i)}function i(){t.scrollTo(0,0)}var r={restrict:"A",compile:n};return r}angular.module("myProximus.common").directive("mpScrollTop",t),t.$inject=["$window","$eventBus"]}(),function(){"use strict";function t(){var t={restrict:"A",templateUrl:"/vatTextTemplate",controller:e};return t}function e(t,e){t.mpVatTextData={},t.$watch(function(){return e.data.customerAccount},function(){e.data.customerAccount&&(_.isEqual("RES",e.getSegmentCurrentUser())?t.mpVatTextData.showCbuVat=!0:t.mpVatTextData.showEbuVat=!0)})}angular.module("myProximus.common").directive("mpVatText",t),t.$inject=[],e.$inject=["$scope","CustomerAccountService"]}(),"function"==typeof define&&define.amd&&define("resources/cdn/libs/myproximus-common/common.myProximus.process.js",angular.module("myProximus.common")); //# sourceMappingURL=common.myProximus.process.js.map