PageSourceSearch

https://www.landrover.pl/etc.clientlibs/jlr/clientlibs/clientlib-d…ehiclevisualiser-js.93c2f2db488ea9e4790d.js

js landrover.pl collected 2026-10-06 03:34:05 UTC 29,737 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkaem_maven_archetype=self.webpackChunkaem_maven_archetype||[]).push([["components-eventsvehiclevisualiser-eventsvehiclevisualiser-js"],{31866:function(e,t,n){n.r(t),n.d(t,{default:function(){return w}});var r=n(37380),i=n(40443),a=n(68812),o=n(24806),l=n(25921),s=n(28148);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return l}}(e,t)||h(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){if(e){if("string"==typeof e)return f(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach(function(t){v(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function v(e,t,n){return(t=A(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function a(n,r,i,a){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return m(c,"_invoke",function(n,r,i){var a,l,s,c=0,u=i||[],d=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return a=t,l=0,s=e,h.n=n,o}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!i&&t<u.length;t++){var i,a=u[t],f=h.p,y=a[2];n>3?(i=y===r)&&(s=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=e):a[0]<=f&&((i=n<2&&f<a[1])?(l=0,h.v=r,h.n=a[1]):f<y&&(i=n<3||a[0]>r||r>y)&&(a[4]=n,a[5]=r,h.n=y,l=0))}if(i||n>1)return o;throw d=!0,r}return function(i,u,y){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,y),l=u,s=y;(t=l<2?e:s)||!d;){a||(l?l<3?(l>1&&(h.n=-1),f(l,s)):h.n=s:h.v=s);try{if(c=2,a){if(l||(i="next"),t=a[i]){if(!(t=t.call(a,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=a.return)&&t.call(a),l<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),l=1);a=e}else if((t=(d=h.n<0)?s:n.call(r,h))!==o)break}catch(t){a=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,i,a),!0),c}var o={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(m(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,m(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,m(d,"constructor",c),m(c,"constructor",s),s.displayName="GeneratorFunction",m(c,i,"GeneratorFunction"),m(d),m(d,i,"Generator"),m(d,r,function(){return this}),m(d,"toString",function(){return"[object Generator]"}),(b=function(){return{w:a,m:h}})()}function m(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}m=function(e,t,n,r){if(t)i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var a=function(t,n){m(e,t,function(e){return this._invoke(t,n,e)})};a("next",0),a("throw",1),a("return",2)}},m(e,t,n,r)}function g(e,t,n,r,i,a,o){try{var l=e[a](o),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,i)}function S(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){g(a,r,i,o,l,"next",e)}function l(e){g(a,r,i,o,l,"throw",e)}o(void 0)})}}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,A(r.key),r)}}function A(e){var t=function(e,t){if("object"!=c(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==c(t)?t:t+""}var w=function(){return e=function e(t){var n,i,o,l;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.brands=null!==(n=JSON.parse(this.element.getAttribute("data-available-brands")))&&void 0!==n?n:[],this.nameplateSpotlight=null!==(i=JSON.parse(this.element.getAttribute("data-nameplate-and-models")))&&void 0!==i?i:[],this.vehicleSelectionContainer=this.element.querySelector(".EventsVehicleVisualiser__selection"),this.vehicleVisualiserContainer=this.element.querySelector(".EventsVehicleVisualiser__visualiser"),this.locale=this.element.getAttribute("data-locale"),this.configBaseUrl=this.element.getAttribute("data-configurator-base-url"),this.rulesEngineBaseUrl=this.element.getAttribute("data-rules-engine-base-url"),this.cplayerApiKey=this.element.getAttribute("data-cplayer-api-key"),this.eventBus=new a.b,this.RCApi=null!==(o=window.RCApi)&&void 0!==o?o:window.RCApi=r.A,this.infiniteScrollEnabled=this.element.hasAttribute("data-enable-infinite-scroll"),this.excludeNameplateIds=this.element.getAttribute("data-exclude-nameplate-ids"),this.excludeNameplateIdsArray=null===(l=this.excludeNameplateIds)||void 0===l?void 0:l.toLowerCase().split(","),this.RCApi.brand="lr",this.RCApi.base_url=this.rulesEngineBaseUrl,this.RCApi.configBaseUrl=this.configBaseUrl,this.RCApi.locale=this.locale,this.RCApi.nameplate_code="",this.selectedSwatches={EXTERIOR:null,INTERIOR:null,WHEELS:null},this.init()},t=[{key:"init",value:(h=S(b().m(function e(){return b().w(function(e){for(;;)switch(e.n){case 0:this.setupListeners(),this.selectionSection=new o.default(this.vehicleSelectionContainer,{brands:this.brands,cplayerApiKey:this.cplayerApiKey,isInfinite:this.infiniteScrollEnabled}),this.selectionSection.init(this.eventBus,this.RCApi),this.visualiser=new s.default(this.vehicleVisualiserContainer,{brands:this.brands,cplayerApiKey:this.cplayerApiKey}),this.visualiser.init(this.eventBus,this.RCApi),this.fetchVehicles();case 1:return e.a(2)}},e,this)})),function(){return h.apply(this,arguments)})},{key:"setupListeners",value:function(){this.eventBus.subscribe(l.EVENTSVISUALISER_EVENTS.SWATCH_CHANGED,this.onSwatchSelectionChanged.bind(this))}},{key:"fetchVehicles",value:(c=S(b().m(function e(){var t,n,r,a,o,s,c,h,f,y,m,g,E=this;return b().w(function(e){for(;;)switch(e.n){case 0:if(null===(t=this.vehicleData)||void 0===t){e.n=1;break}f=t,e.n=6;break;case 1:return e.n=2,this.RCApi.loadJsonp();case 2:if(m=n=e.v,y=null===m){e.n=3;break}y=void 0===n;case 3:if(!y){e.n=4;break}g=void 0,e.n=5;break;case 4:g=n["vehicle-list"];case 5:f=g;case 6:if(this.vehicleData=f,a=null===(r=this.brands[0])||void 0===r?void 0:r.brandFamilyName){e.n=7;break}return e.a(2);case 7:return this.currentVehicleData=this.RCApi.getCurrentYearVehicles(this.vehicleData),e.n=8,this.RCApi.addDefenderBodystylesAsVehicles(this.currentVehicleData);case 8:return this.currentVehicleData=e.v,this.excludeNameplateIdsArray&&(this.currentVehicleData=i.A.filterByExclusionList(this.currentVehicleData,this.excludeNameplateIdsArray)),o=this.brands.reduce(function(e,t){return p(p({},e),{},v({},t.brandFamilyName,new Set))},{}),this.currentVehicleData.forEach(function(e){var t,n,r=E.setVehicleModelSpotlight(e),i=E.RCApi.loadJsonp(r.href,!1),a="range_rover"===(null===(t=e.property)||void 0===t?void 0:t.BrandFamily)?"rangeRover":null===(n=e.property)||void 0===n?void 0:n.BrandFamily;o[a].add(i)}),e.n=9,Promise.allSettled(d(o[a]));case 9:return s=e.v.map(function(e){return"fulfilled"===e.status&&e.value}),c=this.sortVehicleSpotlight(s),this.eventBus.publish(l.EVENTSVISUALISER_EVENTS.INITIAL_DATA_LOADED,{vehicles:v({},a,c)}),delete o[a],e.n=10,Promise.all(Object.entries(o).map(function(){var e=S(b().m(function e(t){var n,r,i,a,o;return b().w(function(e){for(;;)switch(e.n){case 0:return n=u(t,2),r=n[0],i=n[1],e.n=1,Promise.allSettled(i);case 1:return a=e.v,o=a.filter(function(e){return"fulfilled"===e.status&&e.value}),e.a(2,[r,o])}},e)}));return function(t){return e.apply(this,arguments)}}()));case 10:h=e.v.reduce(function(e,t){var n=u(t,2),r=n[0],i=n[1];return p(p({},e),{},v({},r,E.sortVehicleSpotlight(i.map(function(e){return e.value}))))},{}),this.vehiclesByBrand=p(v({},a,c),h),this.eventBus.publish(l.EVENTSVISUALISER_EVENTS.INITIAL_DATA_LOADED,{vehicles:this.vehiclesByBrand}),this.hasInitialised||(this.hasInitialised=!0);case 11:return e.a(2)}},e,this)})),function(){return c.apply(this,arguments)})},{key:"sortVehicleSpotlight",value:function(e){var t=this,n=function(e,t){return(null==e?void 0:e.toUpperCase())===(null==t?void 0:t.toUpperCase())};return e.sort(function(e,r){var a,o,l=null!==(a=null==e?void 0:e.id)&&void 0!==a?a:i.A.getVehicleDetails(e),s=null!==(o=null==r?void 0:r.id)&&void 0!==o?o:i.A.getVehicleDetails(r),c=i.A.getSelectedFeature("BODYSTYLE",e),u=i.A.getSelectedFeature("BODYSTYLE",r),d=t.nameplateSpotlight.findIndex(function(e){var t;return n(e.nameplateCode,null!==(t=e.nameplateCode)&&void 0!==t&&t.includes("-")?null==c?void 0:c.id:null==l?void 0:l.id)}),h=t.nameplateSpotlight.findIndex(function(e){var t;return n(e.nameplateCode,null!==(t=e.nameplateCode)&&void 0!==t&&t.includes("-")?null==u?void 0:u.id:null==s?void 0:s.id)});return-1===d?1:-1===h?-1:d===h?0:d>h?1:-1})}},{key:"setVehicleModelSpotlight",value:function(e){var t,n,r,a,o=null!==(t=null==e?void 0:e.id)&&void 0!==t?t:null===(n=i.A.getVehicleDetails(e))||void 0===n?void 0:n.id,l=this.nameplateSpotlight.find(function(t){var n,r=t.nameplateCode.includes("-")?null==e?void 0:e.href:o;return null==r||null===(n=r.toUpperCase())||void 0===n?void 0:n.includes(t.nameplateCode.toUpperCase())});if(!l)return e;var s=new URL(e.href,this.configBaseUrl),c=null===(r=l.modelCodes)||void 0===r||null===(r=r.toUpperCase())||void 0===r?void 0:r.split(",");return!l.featuredModelCode&&null!=c&&c.length?(s.searchParams.set("q",c[0]),p(p({},e),{},{href:s.toString()})):(s.searchParams.set("q",l.featuredModelCode),null!=c&&c.length&&!c.includes(null===(a=l.featuredModelCode)||void 0===a?void 0:a.toUpperCase())&&s.searchParams.set("q",c[0]),p(p({},e),{},{href:s.toString()}))}},{key:"onSwatchSelectionChanged",value:function(e){this.selectedSwatches=p(p({},this.selectedSwatches),{},v({},e.type,e.id))}}],t&&E(e.prototype,t),n&&E(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,c,h}()},24806:function(e,t,n){n.r(t),n.d(t,{default:function(){return T}});var r=n(40443),i=n(85924),a=n(19871),o=n(23684),l=n(28573),s=n(25921);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?u(Object(n),!0).forEach(function(t){h(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e,t,n){return(t=S(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function a(n,r,i,a){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return y(c,"_invoke",function(n,r,i){var a,l,s,c=0,u=i||[],d=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return a=t,l=0,s=e,h.n=n,o}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!i&&t<u.length;t++){var i,a=u[t],f=h.p,y=a[2];n>3?(i=y===r)&&(s=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=e):a[0]<=f&&((i=n<2&&f<a[1])?(l=0,h.v=r,h.n=a[1]):f<y&&(i=n<3||a[0]>r||r>y)&&(a[4]=n,a[5]=r,h.n=y,l=0))}if(i||n>1)return o;throw d=!0,r}return function(i,u,y){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,y),l=u,s=y;(t=l<2?e:s)||!d;){a||(l?l<3?(l>1&&(h.n=-1),f(l,s)):h.n=s:h.v=s);try{if(c=2,a){if(l||(i="next"),t=a[i]){if(!(t=t.call(a,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=a.return)&&t.call(a),l<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),l=1);a=e}else if((t=(d=h.n<0)?s:n.call(r,h))!==o)break}catch(t){a=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,i,a),!0),c}var o={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(y(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,y(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,y(d,"constructor",c),y(c,"constructor",s),s.displayName="GeneratorFunction",y(c,i,"GeneratorFunction"),y(d),y(d,i,"Generator"),y(d,r,function(){return this}),y(d,"toString",function(){return"[object Generator]"}),(f=function(){return{w:a,m:h}})()}function y(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}y=function(e,t,n,r){if(t)i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var a=function(t,n){y(e,t,function(e){return this._invoke(t,n,e)})};a("next",0),a("throw",1),a("return",2)}},y(e,t,n,r)}function p(e,t,n,r,i,a,o){try{var l=e[a](o),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,i)}function v(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){p(a,r,i,o,l,"next",e)}function l(e){p(a,r,i,o,l,"throw",e)}o(void 0)})}}function b(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,S(r.key),r)}}function S(e){var t=function(e,t){if("object"!=c(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==c(t)?t:t+""}function E(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}function A(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var w=new WeakSet,T=function(){return e=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),E(this,w),this.element=t,this.brands=n.brands,this.isInfinite=n.isInfinite,this.cplayerApiKey=n.cplayerApiKey,this.brandTabContainer=this.element.querySelector(".EventsVehicleVisualiser__selection-tab
1Container"),this.fromPriceLabel=this.element.getAttribute("data-from-price-label"),this.closeButton=this.element.querySelector(".EventsVehicleVisualiser__selection-closeButton")},t=[{key:"init",value:function(e,t){this.eventBus=e,this.RCApi=t,this.initTabs(),this.initGallery(),this.setupListeners()}},{key:"setupListeners",value:function(){this.eventBus.subscribe(s.EVENTSVISUALISER_EVENTS.INITIAL_DATA_LOADED,this.onDataLoaded.bind(this)),this.eventBus.subscribe(s.EVENTSVISUALISER_EVENTS.MODEL_CHANGED,this.onModelChanged.bind(this)),this.eventBus.subscribe(s.EVENTSVISUALISER_EVENTS.SWATCH_CHANGED,this.onSwatchChanged.bind(this)),this.eventBus.subscribe(s.EVENTSVISUALISER_EVENTS.CHANGE_VEHICLE,this.onChangeVehicle.bind(this)),this.closeButton.addEventListener("click",this.onCloseButtonClick.bind(this))}},{key:"initGallery",value:function(){this.gallery=new i.Ay(this.element.querySelector(".EventsVehicleVisualiser__selection-carouselContainer"),{apiKey:this.cplayerApiKey,slides:"exterior-0",useBackground:!0,paginationType:"line"})}},{key:"configureGallery",value:function(e,t){var n,i=this,a=e,o=this.isInfinite;this.isInfinite&&e.length>2&&(a=[].concat(b(e.slice(2)),b(e.slice(0,2)))),e.length<=3&&(o=!1),this.gallery.render({vehicle:a,dxArrowNavigationConfig:{useCenteredNavigationButtons:!0,centeredNavigationButtonOffset:600,loop:o},onRenderCompleteCallback:(n=v(f().m(function n(a){var o,s,c,u,d,h;return f().w(function(n){for(;;)switch(n.n){case 0:if(!t){n.n=1;break}return n.a(2);case 1:if(!(a<e.length-1)){n.n=2;break}return n.a(2);case 2:return n.n=3,l.default.selection.tabChangeEnd();case 3:if(i.element.classList.toggle("EventsVehicleVisualiser__selection--transitioning",!1),!i.continueClose){n.n=7;break}return n.n=4,new Promise(function(e){return setTimeout(e,300)});case 4:return s=r.A.getVehicleDetails(i.activeVehicle),c=r.A.getSelectedFeature("BODYSTYLE",i.activeVehicle),u=A(w,i,C).call(i,s.id,c.id),d=i.gallery.getSlideIndex(u),h=500*d,n.n=5,i.gallery.goToSlide(d,h);case 5:return n.n=6,i.onSelectVehicle(s.id,c.id,500);case 6:i.continueClose=!1;case 7:null===(o=i.gallery.carousel)||void 0===o||o.classList.toggle("DxCPlayerGallery--loading",!1);case 8:return n.a(2)}},n)})),function(e){return n.apply(this,arguments)})});var s=this.element.querySelector("#example-slide-header"),c=this.element.querySelector("#example-slide-footer");a.forEach(function(e,t){var n=i.gallery.getSlide(t),a=r.A.getVehicleDetails(e),o=r.A.getSelectedFeature("BODYSTYLE",e);n.setAttribute("data-vehicle-id",a.id),n.setAttribute("data-selected-bodystyle",o.id),i.gallery.injectSlideHeader(s.cloneNode(!0).innerHTML,t),i.gallery.injectSlideFooter(c.cloneNode(!0).innerHTML,t).querySelector("a").addEventListener("click",function(e){return i.onSelectVehicle(e.currentTarget.getAttribute("data-vehicle-id"),e.currentTarget.getAttribute("data-selected-bodystyle"))}),i.updateSlideDetails(e,n)})}},{key:"initTabs",value:function(){var e=this;this.brandTabGroup=new o.TabGroup(this.brandTabContainer,{showUnderline:!1}),this.brands.forEach(function(t,n){var r,i=e.brandTabGroup.createTab(t.brandFamilyName,null===(r=t.brandLabel)||void 0===r?void 0:r.toUpperCase());e.brandTabGroup.addTab(i),0===n&&e.onTabSelected({detail:i,isInit:!0})}),this.brandTabGroup.init(),this.brandTabContainer.addEventListener("TabGroup:tabSelected",this.onTabSelected.bind(this))}},{key:"onTabSelected",value:(V=v(f().m(function e(t){return f().w(function(e){for(;;)switch(e.n){case 0:if(t.isInit){e.n=2;break}return this.element.classList.toggle("EventsVehicleVisualiser__selection--transitioning",!0),e.n=1,l.default.selection.tabChangeStart();case 1:this.gallery.carousel.classList.toggle("DxCPlayerGallery--loading",!0);case 2:this.selectedBrand=this.brands.find(function(e){return t.detail.id.includes(e.brandFamilyName)}),this.element.parentElement.setAttribute("data-brand-family",this.selectedBrand.brandFamilyName),this.element.parentElement.setAttribute("data-selected-brand",this.selectedBrand.brandFamilyName),t.isInit||this.configureGallery(this.vehiclesByBrand[this.selectedBrand.brandFamilyName]);case 3:return e.a(2)}},e,this)})),function(e){return V.apply(this,arguments)})},{key:"onDataLoaded",value:function(e){var t,n=this;this.vehiclesByBrand=e.vehicles,this.brands.forEach(function(e){var t=n.vehiclesByBrand[e.brandFamilyName];if(t){var r=n.brandTabGroup.getTab(e.brandFamilyName);null!=t&&t.length||n.brandTabGroup.disableTab(r)}}),this.activeVehicle=null!==(t=this.activeVehicle)&&void 0!==t?t:this.vehiclesByBrand[this.selectedBrand.brandFamilyName][0],this.configureGallery(e.vehicles[this.selectedBrand.brandFamilyName],!0)}},{key:"onCloseButtonClick",value:(T=v(f().m(function e(){var t,n,i,a,o,l,s;return f().w(function(e){for(;;)switch(e.n){case 0:if(t=r.A.getVehicleDetails(this.activeVehicle),n=this.brandTabGroup.getTab(this.activeBrand.brandFamilyName),i=r.A.getSelectedFeature("BODYSTYLE",this.activeVehicle),a=this.brandTabGroup.getSelectedTab(),n.id===a.id){e.n=1;break}return this.continueClose=!0,this.brandTabGroup.setTabSelected(n),e.a(2);case 1:return o=A(w,this,C).call(this,t.id,i.id),l=this.gallery.getSlideIndex(o),s=500*l,e.n=2,this.gallery.goToSlide(l,s);case 2:return e.n=3,this.onSelectVehicle(t.id,i.id,100);case 3:return e.a(2)}},e,this)})),function(){return T.apply(this,arguments)})},{key:"onSelectVehicle",value:(S=v(f().m(function e(t,n){var i,a,o=this,c=arguments;return f().w(function(e){for(;;)switch(e.n){case 0:return i=c.length>2&&void 0!==c[2]?c[2]:0,this.closeButton.classList.toggle("EventsVehicleVisualiser__selection-closeButton--hidden",!0),a=this.vehiclesByBrand[this.selectedBrand.brandFamilyName].find(function(e){return r.A.getVehicleDetails(e).id===t&&r.A.getSelectedFeature("BODYSTYLE",e).id===n}),this.activeVehicle=a,this.activeBrand=this.brands.find(function(e){return e.brandFamilyName===o.selectedBrand.brandFamilyName}),this.eventBus.publish(s.EVENTSVISUALISER_EVENTS.NAMEPLATE_SELECTION_CHANGED,{selectedBrand:this.selectedBrand,vehicle:a}),e.n=1,l.default.selection.exit(i);case 1:this.eventBus.publish(s.EVENTSVISUALISER_EVENTS.NAMEPLATE_SELECTION_ANIMATION_COMPLETE),this.closeButton.classList.toggle("EventsVehicleVisualiser__selection-closeButton--hidden",!1);case 2:return e.a(2)}},e,this)})),function(e,t){return S.apply(this,arguments)})},{key:"onBodystyleChanged",value:(m=v(f().m(function e(t){var n,i,a;return f().w(function(e){for(;;)switch(e.n){case 0:return n=t.id,i=t.value,a=this.vehiclesByBrand[this.selectedBrand.brandFamilyName].find(function(e){return n.includes(r.A.getVehicleDetails(e).id)}),e.n=1,this.onPropertySelectionChanged("BODYSTYLE",i,a);case 1:return e.a(2)}},e,this)})),function(e){return m.apply(this,arguments)})},{key:"onModelChanged",value:(p=v(f().m(function e(t){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.onPropertySelectionChanged("MODEL",t,this.activeVehicle);case 1:return e.a(2)}},e,this)})),function(e){return p.apply(this,arguments)})},{key:"onSwatchChanged",value:(y=v(f().m(function e(t){var n,r=this;return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Promise.allSettled(this.vehiclesByBrand[this.selectedBrand.brandFamilyName].map(function(e,n){return r.onPropertySelectionChanged(t.type,t.id,e,n)}));case 1:return n=this.brands.filter(function(e){return e.brandFamilyName!==r.selectedBrand.brandFamilyName}),e.n=2,Promise.allSettled(n.map(function(e){return Promise.allSettled(r.vehiclesByBrand[e.brandFamilyName].map(function(n,i){return r.onPropertySelectionChanged(t.type,t.id,n,i,e.brandFamilyName)}))}
1));case 2:return e.a(2)}},e,this)})),function(e){return y.apply(this,arguments)})},{key:"onPropertySelectionChanged",value:(u=v(f().m(function e(t,n,i,a){var o,l,s,c,u,y,p,v,b,m,g=arguments;return f().w(function(e){for(;;)switch(e.n){case 0:return o=g.length>4&&void 0!==g[4]?g[4]:this.selectedBrand.brandFamilyName,l=r.A.getVehicleDetails(i),s=r.A.getSelectedFeature("BODYSTYLE",i),c=null!=a?a:this.vehiclesByBrand[o].findIndex(function(e){return r.A.getVehicleDetails(e).id===l.id&&r.A.getSelectedFeature("BODYSTYLE",e).id===s.id}),"BODYSTYLE"!==t&&"MODEL"!==t&&(this.selectedFeatures=d(d({},this.selectedFeatures),{},h({},t,n))),u=new URL(r.A.buildHrefWithSelections(i,d(d({},this.selectedFeatures),{},h({},t,n))),this.RCApi.base_url),e.n=1,this.RCApi.loadJsonp(u.toString(),!1);case 1:if(y=e.v,this.vehiclesByBrand[o][c]=y,p=r.A.getVehicleDetails(this.activeVehicle),v=r.A.getVehicleDetails(y),b=r.A.getSelectedFeature("BODYSTYLE",y),(null==p?void 0:p.id)===(null==v?void 0:v.id)&&(null==s?void 0:s.id)===(null==b?void 0:b.id)&&(this.activeVehicle=y),null==(m=A(w,this,C).call(this,l.id,s.id))||m.cplayer.render({vehicle:y,frame:0,view:"exterior"}),m){e.n=2;break}return e.a(2);case 2:this.updateSlideDetails(y,m);case 3:return e.a(2)}},e,this)})),function(e,t,n,r){return u.apply(this,arguments)})},{key:"updateSlideDetails",value:function(e,t){var n=this;try{var i,o=r.A.getVehicleDetails(e),l=r.A.getSelectedFeature("BODYSTYLE",e),s=r.A.getSelectedFeature("MODEL",e),c=r.A.getBodystyles(e),u=r.A.getVehicleBrandFamily(e),d="defender"===u?l.description:o.description,h=null==t?void 0:t.querySelector(".DxCPlayerGallery__slide--header");if(!h)throw new Error("Header element not found");h.querySelector("h1").innerHTML=null===(i=r.A.getDescription(d))||void 0===i?void 0:i.toUpperCase();var f=h.querySelector("*:nth-child(2)");if(!f)throw new Error("Header description element not found");f.querySelector("strong").innerHTML=r.A.getDescription(s.description),t.setAttribute("data-vehicle-id",o.id),t.setAttribute("data-selected-bodystyle",l.id),this.updatePrice(e,f);var y=t.querySelector(".DxCPlayerGallery__slide--footer a");y.setAttribute("data-vehicle-id",o.id),y.setAttribute("data-selected-bodystyle",l.id);var p,v=h.querySelector(".EventsVehicleVisualiser__selection-bodystyleSelector");if(c.length<=1||"defender"===u)return void(null===(p=v)||void 0===p||p.remove());v||((v=document.createElement("div")).classList.add("EventsVehicleVisualiser__selection-bodystyleSelector"),h.appendChild(v));var b=!v.select;this.updatePrice(e,f),b&&(v.select=new a.A(v,{name:"".concat(o.id,"-").concat(s.id)}),v.select.reset(),c.forEach(function(e){v.select.addOption(n.RCApi.getDescription(e.description),e.id)}),v.select.selectOption(l.id),v.select.on("change",this.onBodystyleChanged.bind(this)))}catch(e){console.error("An error occurred in updateTabDetails:",e)}}},{key:"updatePrice",value:function(e,t){var n=r.A.getConfigurationPrice(e);n&&(t.querySelector("span").innerHTML=this.RCApi.getFormattedFromPrice(n.value,n.currency,this.fromPriceLabel))}},{key:"onChangeVehicle",value:(c=v(f().m(function e(){return f().w(function(e){for(;;)switch(e.n){case 0:return this.element.classList.toggle("EventsVehicleVisualiser__selection--expanded",!0),e.n=1,l.default.selection.enter();case 1:this.element.classList.toggle("EventsVehicleVisualiser__selection--expanded",!1);case 2:return e.a(2)}},e,this)})),function(){return c.apply(this,arguments)})}],t&&g(e.prototype,t),n&&g(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,c,u,y,p,m,S,T,V}();function C(e,t){return this.gallery.slidesContainer.querySelector(".DxCPlayerGallery__slide[data-vehicle-id='".concat(e,"'][data-selected-bodystyle='").concat(t,"']"))}},68812:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}n.d(t,{b:function(){return o}});var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.topics={}},(t=[{key:"subscribe",value:function(e,t){e&&"function"==typeof t&&(this.topics[e]||(this.topics[e]=[]),this.topics[e].includes(t)||this.topics[e].push(t))}},{key:"publish",value:function(e,t){!this.topics[e]||this.topics[e].length<1||this.topics[e].forEach(function(e){e(t||{})})}}])&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();new o}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.